diff --git a/.swiftformat b/.swiftformat new file mode 100644 index 0000000000..79a33c22af --- /dev/null +++ b/.swiftformat @@ -0,0 +1,2 @@ +# disabled rules +--disable redundantSelf,trailingCommas,hoistPatternLet,modifierorder \ No newline at end of file diff --git a/FDKClient.podspec b/FDKClient.podspec index 0061ca47f8..055761f9c6 100644 --- a/FDKClient.podspec +++ b/FDKClient.podspec @@ -5,7 +5,7 @@ Pod::Spec.new do |s| s.name = 'FDKClient' - s.version = '0.1.3' + s.version = '0.1.15' s.summary = 'FDK Client SDK for Swift language' s.description = 'FDK Client SDK for Swift language that can be used to make Apps or extensions.' @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.subspec 'Common' do |subspec| subspec.source_files = 'Sources/code/common/**/*' - subspec.dependency 'Alamofire', '= 5.0.2' + subspec.dependency 'Alamofire', '= 5.4.4' end s.subspec 'Application' do |subspec| @@ -35,4 +35,9 @@ Pod::Spec.new do |s| subspec.source_files = 'Sources/code/platform/**/*' subspec.dependency 'FDKClient/Common' end + + s.subspec 'Public' do |subspec| + subspec.source_files = 'Sources/code/public/**/*' + subspec.dependency 'FDKClient/Common' + end end diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 0000000000..fa64747d0d --- /dev/null +++ b/Package.resolved @@ -0,0 +1,25 @@ +{ + "object": { + "pins": [ + { + "package": "Alamofire", + "repositoryURL": "https://github.com/Alamofire/Alamofire.git", + "state": { + "branch": null, + "revision": "d120af1e8638c7da36c8481fd61a66c0c08dc4fc", + "version": "5.4.4" + } + }, + { + "package": "CryptoSwift", + "repositoryURL": "https://github.com/krzyzanowskim/CryptoSwift.git", + "state": { + "branch": null, + "revision": "5669f222e46c8134fb1f399c745fa6882b43532e", + "version": "1.3.8" + } + } + ] + }, + "version": 1 +} diff --git a/Package.swift b/Package.swift index b38f0dcdb4..e90420fc78 100644 --- a/Package.swift +++ b/Package.swift @@ -12,7 +12,7 @@ let package = Package( .library(name: "FDKClient", targets: ["FDKClient"]), ], dependencies: [ - .package(url: "https://github.com/Alamofire/Alamofire.git", .branch("master")), + .package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMinor(from: "5.4.4")), .package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", .upToNextMinor(from: "1.3.8")), ], targets: [ diff --git a/README.md b/README.md index bc60159148..20df6cd754 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,20 @@ Get started with the Swift Development SDK for Fynd Platform 3. Add `import FDKClient` 4. Start integrating +### Sample Usage - PublicClient + +```swift +let config = PublicConfig() +let publicClient = PublicClient(config: config) +publicClient.webhook.fetchAllWebhookEvents() { (webhookEvents, error) in + if let webhookEvents = webhookEvents { + print(webhookEvents.debugDescription) + } else if let error = error { + print(error.message) + } +} +``` + ### Sample Usage - ApplicationClient ```swift @@ -34,11 +48,11 @@ applicationClient.catalog.getProductDetailBySlug(slug: "product-slug") { (produc ### Sample Usage - PlatformClient ```swift -guard let config = PlatformConfig(companyId: "COMPANY_ID", - apiKey: "API_KEY", - apiSecret: "API_SECRET", - domain: "DOMAIN") { - return +guard let config = PlatformConfig( + companyId: "COMPANY_ID", + apiKey: "API_KEY", + apiSecret: "API_SECRET") { + return } let platformClient = PlatformClient(config: config) platformClient.catalog.getCompanyDetail { (response, error) in diff --git a/Sources/code/application/ApplicationAPIClient.swift b/Sources/code/application/ApplicationAPIClient.swift index d708887d10..793831fcc3 100644 --- a/Sources/code/application/ApplicationAPIClient.swift +++ b/Sources/code/application/ApplicationAPIClient.swift @@ -7,20 +7,29 @@ class ApplicationAPIClient { extraHeaders: [(key: String, value: String)] = [], body: [String: Any]?, responseType: String = "application/json", - onResponse: @escaping OnResponse) { + onResponse: @escaping OnResponse) + { var headers = [ (key: "Authorization", value: "Bearer " + "\(config.applicationId):\(config.applicationToken)".asBase64) ] + headers.append((key: "x-fp-sdk-version", value: "0.1.15")) + headers.append(contentsOf: extraHeaders) + headers.append(contentsOf: config.extraHeaders) if let userAgent = config.userAgent { headers.append((key: "User-Agent", value: userAgent)) } - headers.append(contentsOf: extraHeaders) - AlmofireHelper.request(config.domain.appendAsPath(url), - query: query, - parameters: body, - type: method, - headers: headers, - responseType: responseType, - onResponse: onResponse) + if let language = config.language { + headers.append((key: "Accept-Language", value: language)) + } + if let currency = config.currency { + headers.append((key: "x-currency-code", value: currency)) + } + AlmofireHelper.request(url, + query: query, + parameters: body, + type: method, + headers: headers, + responseType: responseType, + onResponse: onResponse) } -} \ No newline at end of file +} diff --git a/Sources/code/application/ApplicationClient.swift b/Sources/code/application/ApplicationClient.swift index 3886c60102..6831a0ba21 100644 --- a/Sources/code/application/ApplicationClient.swift +++ b/Sources/code/application/ApplicationClient.swift @@ -2,7 +2,6 @@ import Foundation public class ApplicationClient { - public let catalog: Catalog public let cart: Cart @@ -38,80 +37,143 @@ public class ApplicationClient { public let logistic: Logistic public init(config: ApplicationConfig) { - catalog = Catalog(config: config) - + cart = Cart(config: config) - + common = Common(config: config) - + lead = Lead(config: config) - + theme = Theme(config: config) - + user = User(config: config) - + content = Content(config: config) - + communication = Communication(config: config) - + share = Share(config: config) - + fileStorage = FileStorage(config: config) - + configuration = Configuration(config: config) - + payment = Payment(config: config) - + order = Order(config: config) - + rewards = Rewards(config: config) - + feedback = Feedback(config: config) - + posCart = PosCart(config: config) - + logistic = Logistic(config: config) - } - - public class Catalog { - var config: ApplicationConfig + var relativeUrls = [String: String]() init(config: ApplicationConfig) { - self.config = config; + self.config = config + var ulrs = [String: String]() + + ulrs["getProductDetailBySlug"] = config.domain.appendAsPath("/service/application/catalog/v1.0/products/{slug}/") + + ulrs["getProductSizesBySlug"] = config.domain.appendAsPath("/service/application/catalog/v1.0/products/{slug}/sizes/") + + ulrs["getProductComparisonBySlugs"] = config.domain.appendAsPath("/service/application/catalog/v1.0/products/compare/") + + ulrs["getSimilarComparisonProductBySlug"] = config.domain.appendAsPath("/service/application/catalog/v1.0/products/{slug}/similar/compare/") + + ulrs["getComparedFrequentlyProductBySlug"] = config.domain.appendAsPath("/service/application/catalog/v1.0/products/{slug}/similar/compared-frequently/") + + ulrs["getProductSimilarByIdentifier"] = config.domain.appendAsPath("/service/application/catalog/v1.0/products/{slug}/similar/{similar_type}/") + + ulrs["getProductVariantsBySlug"] = config.domain.appendAsPath("/service/application/catalog/v1.0/products/{slug}/variants/") + + ulrs["getProductStockByIds"] = config.domain.appendAsPath("/service/application/catalog/v1.0/products/stock-status/") + + ulrs["getProductStockForTimeByIds"] = config.domain.appendAsPath("/service/application/catalog/v1.0/products/stock-status/poll/") + + ulrs["getProducts"] = config.domain.appendAsPath("/service/application/catalog/v1.0/products/") + + ulrs["getBrands"] = config.domain.appendAsPath("/service/application/catalog/v1.0/brands/") + + ulrs["getBrandDetailBySlug"] = config.domain.appendAsPath("/service/application/catalog/v1.0/brands/{slug}/") + + ulrs["getCategories"] = config.domain.appendAsPath("/service/application/catalog/v1.0/categories/") + + ulrs["getCategoryDetailBySlug"] = config.domain.appendAsPath("/service/application/catalog/v1.0/categories/{slug}/") + + ulrs["getHomeProducts"] = config.domain.appendAsPath("/service/application/catalog/v1.0/home/listing/") + + ulrs["getDepartments"] = config.domain.appendAsPath("/service/application/catalog/v1.0/departments/") + + ulrs["getSearchResults"] = config.domain.appendAsPath("/service/application/catalog/v1.0/auto-complete/") + + ulrs["getCollections"] = config.domain.appendAsPath("/service/application/catalog/v1.0/collections/") + + ulrs["getCollectionItemsBySlug"] = config.domain.appendAsPath("/service/application/catalog/v1.0/collections/{slug}/items/") + + ulrs["getCollectionDetailBySlug"] = config.domain.appendAsPath("/service/application/catalog/v1.0/collections/{slug}/") + + ulrs["getFollowedListing"] = config.domain.appendAsPath("/service/application/catalog/v1.0/follow/{collection_type}/") + + ulrs["unfollowById"] = config.domain.appendAsPath("/service/application/catalog/v1.0/follow/{collection_type}/{collection_id}/") + + ulrs["followById"] = config.domain.appendAsPath("/service/application/catalog/v1.0/follow/{collection_type}/{collection_id}/") + + ulrs["getFollowerCountById"] = config.domain.appendAsPath("/service/application/catalog/v1.0/follow/{collection_type}/{collection_id}/count/") + + ulrs["getFollowIds"] = config.domain.appendAsPath("/service/application/catalog/v1.0/follow/ids/") + + ulrs["getStores"] = config.domain.appendAsPath("/service/application/catalog/v1.0/locations/") + + ulrs["getInStockLocations"] = config.domain.appendAsPath("/service/application/catalog/v1.0/in-stock/locations/") + + ulrs["getLocationDetailsById"] = config.domain.appendAsPath("/service/application/catalog/v1.0/locations/{location_id}/") + + ulrs["getProductBundlesBySlug"] = config.domain.appendAsPath("/service/application/catalog/v1.0/product-grouping/") + + ulrs["getProductPriceBySlug"] = config.domain.appendAsPath("/service/application/catalog/v2.0/products/{slug}/sizes/{size}/price/") + + ulrs["getProductSellersBySlug"] = config.domain.appendAsPath("/service/application/catalog/v2.0/products/{slug}/sizes/{size}/sellers/") + + self.relativeUrls = ulrs + } + + public func update(updatedUrl: [String: String]) { + for (key, value) in updatedUrl { + self.relativeUrls[key] = value + } } - - - + /** - * - * Summary: Get a product - * Description: Use this API to retrieve a product by its slug value. - **/ + * + * Summary: Get a product + * Description: Use this API to retrieve a product by its slug value. + **/ public func getProductDetailBySlug( slug: String, - + onResponse: @escaping (_ response: ProductDetail?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getProductDetailBySlug"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/products/\(slug)/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -119,55 +181,49 @@ public class ApplicationClient { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ProductDetail.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get the sizes of a product - * Description: A product can have multiple sizes. Use this API to fetch all the available sizes of a product. - **/ + * + * Summary: Get the sizes of a product + * Description: A product can have multiple sizes. Use this API to fetch all the available sizes of a product. + **/ public func getProductSizesBySlug( slug: String, storeId: Int?, - + onResponse: @escaping (_ response: ProductSizes?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = storeId { - - xQuery["store_id"] = value - -} + var xQuery: [String: Any] = [:] + if let value = storeId { + xQuery["store_id"] = value + } - + var fullUrl = relativeUrls["getProductSizesBySlug"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/products/\(slug)/sizes/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -175,251 +231,44 @@ if let value = storeId { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ProductSizes.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - /** - * - * Summary: Get the price of a product size at a PIN Code - * Description: Prices may vary for different sizes of a product. Use this API to retrieve the price of a product size at all the selling locations near to a PIN Code. - **/ - public func getProductPriceBySlug( - slug: String, - size: String, - pincode: String, - storeId: Int?, - - onResponse: @escaping (_ response: ProductSizePriceResponse?, _ error: FDKError?) -> Void - ) { - -var xQuery: [String: Any] = [:] - -if let value = storeId { - - xQuery["store_id"] = value - -} - - - - - - ApplicationAPIClient.execute( - config: config, - method: "get", - url: "/service/application/catalog/v1.0/products/\(slug)/sizes/\(size)/pincode/\(pincode)/price/", - query: xQuery, - extraHeaders: [], - body: nil, - responseType: "application/json", - onResponse: { (responseData, error, responseCode) in - if let _ = error, let data = responseData { - var err = Utility.decode(FDKError.self, from: data) - if err?.status == nil { - err?.status = responseCode - } - onResponse(nil, err) - } else if let data = responseData { - - let response = Utility.decode(ProductSizePriceResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - /** - * - * Summary: Get the sellers of a product size at a PIN Code - * Description: A product of a particular size may be sold by multiple sellers. Use this API to fetch the sellers having the stock of a particular size at a given PIN Code. - **/ - public func getProductSellersBySlug( - slug: String, - size: String, - pincode: String, - strategy: String?, - pageNo: Int?, - pageSize: Int?, - - onResponse: @escaping (_ response: ProductSizeSellersResponse?, _ error: FDKError?) -> Void - ) { - -var xQuery: [String: Any] = [:] - -if let value = strategy { - - xQuery["strategy"] = value - -} - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - - - - ApplicationAPIClient.execute( - config: config, - method: "get", - url: "/service/application/catalog/v1.0/products/\(slug)/sizes/\(size)/pincode/\(pincode)/sellers/", - query: xQuery, - extraHeaders: [], - body: nil, - responseType: "application/json", - onResponse: { (responseData, error, responseCode) in - if let _ = error, let data = responseData { - var err = Utility.decode(FDKError.self, from: data) - if err?.status == nil { - err?.status = responseCode - } - onResponse(nil, err) - } else if let data = responseData { - - let response = Utility.decode(ProductSizeSellersResponse.self, from: data) - onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getProductSellersBySlug - * Description: fetch the next page by calling .next(...) function - **/ - public func getProductSellersBySlugPaginator( - slug: String, - size: String, - pincode: String, - strategy: String?, - pageSize: Int? - - ) -> Paginator { - let pageSize = pageSize ?? 20 - let paginator = Paginator(pageSize: pageSize, type: "number") - paginator.onPage = { - self.getProductSellersBySlug( - - slug: slug, - size: size, - pincode: pincode, - strategy: strategy, - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in - if let response = response { - paginator.hasNext = response.page.hasNext ?? false - paginator.pageNo = (paginator.pageNo ?? 0) + 1 - } - paginator.onNext?(response, error) } - } - return paginator + ) } - - - - + /** - * - * Summary: Compare products - * Description: Use this API to compare the features of products belonging to the same category. Note that at least one slug is mandatory in the request query. - **/ + * + * Summary: Compare products + * Description: Use this API to compare the features of products belonging to the same category. Note that at least one slug is mandatory in the request query. + **/ public func getProductComparisonBySlugs( slug: [String], - + onResponse: @escaping (_ response: ProductsComparisonResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["slug"] = slug - + var xQuery: [String: Any] = [:] + xQuery["slug"] = slug - - + var fullUrl = relativeUrls["getProductComparisonBySlugs"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/products/compare/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -427,47 +276,42 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ProductsComparisonResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get comparison between similar products - * Description: Use this API to compare a given product automatically with similar products. Only one slug is needed. - **/ + * + * Summary: Get comparison between similar products + * Description: Use this API to compare a given product automatically with similar products. Only one slug is needed. + **/ public func getSimilarComparisonProductBySlug( slug: String, - + onResponse: @escaping (_ response: ProductCompareResponse?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getSimilarComparisonProductBySlug"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/products/\(slug)/similar/compare/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -475,47 +319,42 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ProductCompareResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get comparison between frequently compared products with the given product - * Description: Use this API to compare a given product automatically with products that are frequently compared with it. Only one slug is needed. - **/ + * + * Summary: Get comparison between frequently compared products with the given product + * Description: Use this API to compare a given product automatically with products that are frequently compared with it. Only one slug is needed. + **/ public func getComparedFrequentlyProductBySlug( slug: String, - + onResponse: @escaping (_ response: ProductFrequentlyComparedSimilarResponse?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getComparedFrequentlyProductBySlug"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/products/\(slug)/similar/compared-frequently/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -523,48 +362,45 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ProductFrequentlyComparedSimilarResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get similar products - * Description: Use this API to retrieve products similar to the one specified by its slug. You can search not only similar looking products, but also those that are sold by same seller, or those that belong to the same category, price, specifications, etc. - **/ + * + * Summary: Get similar products + * Description: Use this API to retrieve products similar to the one specified by its slug. You can search not only similar looking products, but also those that are sold by same seller, or those that belong to the same category, price, specifications, etc. + **/ public func getProductSimilarByIdentifier( slug: String, similarType: String, - + onResponse: @escaping (_ response: SimilarProductByTypeResponse?, _ error: FDKError?) -> Void ) { - - + var fullUrl = relativeUrls["getProductSimilarByIdentifier"] ?? "" - + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") + fullUrl = fullUrl.replacingOccurrences(of: "{" + "similar_type" + "}", with: "\(similarType)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/products/\(slug)/similar/\(similarType)/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -572,47 +408,42 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SimilarProductByTypeResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get variant of a particular product - * Description: A product can have a different type of variants such as colour, shade, memory. Use this API to fetch all the available variants of a product using its slug. - **/ + * + * Summary: Get variant of a particular product + * Description: A product can have a different type of variants such as colour, shade, memory. Use this API to fetch all the available variants of a product using its slug. + **/ public func getProductVariantsBySlug( slug: String, - + onResponse: @escaping (_ response: ProductVariantsResponse?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getProductVariantsBySlug"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/products/\(slug)/variants/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -620,86 +451,66 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ProductVariantsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get the stock of a product - * Description: Retrieve the available stock of the products. Use this API to retrieve stock of multiple products (up to 50) at a time. - **/ + * + * Summary: Get the stock of a product + * Description: Retrieve the available stock of the products. Use this API to retrieve stock of multiple products (up to 50) at a time. + **/ public func getProductStockByIds( itemId: String?, alu: String?, skuCode: String?, ean: String?, upc: String?, - + onResponse: @escaping (_ response: ProductStockStatusResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = itemId { - - xQuery["item_id"] = value - -} - - -if let value = alu { - - xQuery["alu"] = value - -} - - -if let value = skuCode { - - xQuery["sku_code"] = value - -} + var xQuery: [String: Any] = [:] + if let value = itemId { + xQuery["item_id"] = value + } -if let value = ean { - - xQuery["ean"] = value - -} - + if let value = alu { + xQuery["alu"] = value + } -if let value = upc { - - xQuery["upc"] = value - -} + if let value = skuCode { + xQuery["sku_code"] = value + } + if let value = ean { + xQuery["ean"] = value + } - + if let value = upc { + xQuery["upc"] = value + } + var fullUrl = relativeUrls["getProductStockByIds"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/products/stock-status/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -707,68 +518,54 @@ if let value = upc { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ProductStockStatusResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get the stock of a product - * Description: Retrieve the available stock of the products. Use this API to get the stock status of products whose inventory is updated at the specified time - **/ + * + * Summary: Get the stock of a product + * Description: Retrieve the available stock of the products. Use this API to get the stock status of products whose inventory is updated at the specified time + **/ public func getProductStockForTimeByIds( timestamp: String, pageSize: Int?, pageId: String?, - + onResponse: @escaping (_ response: ProductStockPolling?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] + xQuery["timestamp"] = timestamp - xQuery["timestamp"] = timestamp - - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = pageId { - - xQuery["page_id"] = value - -} - + if let value = pageSize { + xQuery["page_size"] = value + } - + if let value = pageId { + xQuery["page_id"] = value + } + var fullUrl = relativeUrls["getProductStockForTimeByIds"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/products/stock-status/poll/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -776,77 +573,54 @@ if let value = pageId { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ProductStockPolling.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getProductStockForTimeByIds - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getProductStockForTimeByIds + * Description: fetch the next page by calling .next(...) function + **/ public func getProductStockForTimeByIdsPaginator( timestamp: String, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "cursor") paginator.onPage = { self.getProductStockForTimeByIds( - - timestamp: timestamp, - pageSize: paginator.pageSize - , - pageId: paginator.pageId - - ) { response, error in + timestamp: timestamp, + pageSize: paginator.pageSize, + + pageId: paginator.pageId + + ) { response, error in if let response = response { paginator.hasNext = response.page.hasNext ?? false paginator.pageId = response.page.nextId - } paginator.onNext?(response, error) } } return paginator } - - - - + /** - * - * Summary: Get all the products - * Description: Use this API to list all the products. You may choose a sort order or make arbitrary search queries by entering the product name, brand, category or collection. - **/ + * + * Summary: Get all the products + * Description: Use this API to list all the products. You may choose a sort order or make arbitrary search queries by entering the product name, brand, category or collection. + **/ public func getProducts( q: String?, f: String?, @@ -856,80 +630,54 @@ if let value = pageId { pageSize: Int?, pageNo: Int?, pageType: String?, - + onResponse: @escaping (_ response: ProductListingResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = q { - - xQuery["q"] = value - -} - - -if let value = f { - - xQuery["f"] = value - -} - - -if let value = filters { - - xQuery["filters"] = value - -} - - -if let value = sortOn { - - xQuery["sort_on"] = value - -} - - -if let value = pageId { - - xQuery["page_id"] = value - -} + var xQuery: [String: Any] = [:] + if let value = q { + xQuery["q"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = f { + xQuery["f"] = value + } + if let value = filters { + xQuery["filters"] = value + } -if let value = pageNo { - - xQuery["page_no"] = value - -} + if let value = sortOn { + xQuery["sort_on"] = value + } + if let value = pageId { + xQuery["page_id"] = value + } -if let value = pageType { - - xQuery["page_type"] = value - -} + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageType { + xQuery["page_type"] = value + } + var fullUrl = relativeUrls["getProducts"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/products/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -937,150 +685,96 @@ if let value = pageType { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ProductListingResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getProducts - * Description: fetch the next page by calling .next(...) function - **/ - public func getProductsPaginator( - q: String?, - f: String?, - filters: Bool?, - sortOn: String?, - pageSize: Int? - - ) -> Paginator { + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getProducts + * Description: fetch the next page by calling .next(...) function + **/ + public func getProductsPaginator( + q: String?, + f: String?, + filters: Bool?, + sortOn: String?, + pageSize: Int? + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "cursor") paginator.onPage = { self.getProducts( - - q: q, - f: f, - filters: filters, - sortOn: sortOn, - pageId: paginator.pageId - , - pageSize: paginator.pageSize - , - pageNo: paginator.pageNo - , - pageType: paginator.type - - ) { response, error in + q: q, + f: f, + filters: filters, + sortOn: sortOn, + pageId: paginator.pageId, + + pageSize: paginator.pageSize, + + pageNo: paginator.pageNo, + + pageType: paginator.type + + ) { response, error in if let response = response { paginator.hasNext = response.page.hasNext ?? false paginator.pageId = response.page.nextId - } paginator.onNext?(response, error) } } return paginator } - - - - + /** - * - * Summary: Get all the brands - * Description: A brand is the name under which a product is sold. Use this API to list all the brands. You can also filter the brands by department. - **/ + * + * Summary: Get all the brands + * Description: A brand is the name under which a product is sold. Use this API to list all the brands. You can also filter the brands by department. + **/ public func getBrands( department: String?, pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: BrandListingResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = department { - - xQuery["department"] = value - -} - - -if let value = pageNo { - - xQuery["page_no"] = value - -} + var xQuery: [String: Any] = [:] + if let value = department { + xQuery["department"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} - + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + var fullUrl = relativeUrls["getBrands"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/brands/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1088,58 +782,39 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(BrandListingResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getBrands - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getBrands + * Description: fetch the next page by calling .next(...) function + **/ public func getBrandsPaginator( department: String?, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getBrands( - - department: department, - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + department: department, + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -1149,35 +824,30 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Get metadata of a brand - * Description: Fetch metadata of a brand such as name, information, logo, banner, etc. - **/ + * + * Summary: Get metadata of a brand + * Description: Fetch metadata of a brand such as name, information, logo, banner, etc. + **/ public func getBrandDetailBySlug( slug: String, - + onResponse: @escaping (_ response: BrandDetailResponse?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getBrandDetailBySlug"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/brands/\(slug)/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1185,54 +855,46 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(BrandDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: List all the categories - * Description: Use this API to list all the categories. You can also filter the categories by department. - **/ + * + * Summary: List all the categories + * Description: Use this API to list all the categories. You can also filter the categories by department. + **/ public func getCategories( department: String?, - + onResponse: @escaping (_ response: CategoryListingResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = department { - - xQuery["department"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = department { + xQuery["department"] = value + } + var fullUrl = relativeUrls["getCategories"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/categories/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1240,47 +902,42 @@ if let value = department { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CategoryListingResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get metadata of a category - * Description: Fetch metadata of a category such as name, information, logo, banner, etc. - **/ + * + * Summary: Get metadata of a category + * Description: Fetch metadata of a category such as name, information, logo, banner, etc. + **/ public func getCategoryDetailBySlug( slug: String, - + onResponse: @escaping (_ response: CategoryMetaResponse?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getCategoryDetailBySlug"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/categories/\(slug)/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1288,70 +945,56 @@ if let value = department { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CategoryMetaResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: List the products - * Description: List all the products associated with a brand, collection or category in a random order. - **/ + * + * Summary: List the products + * Description: List all the products associated with a brand, collection or category in a random order. + **/ public func getHomeProducts( sortOn: String?, pageId: String?, pageSize: Int?, - + onResponse: @escaping (_ response: HomeListingResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = sortOn { - - xQuery["sort_on"] = value - -} - - -if let value = pageId { - - xQuery["page_id"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = sortOn { + xQuery["sort_on"] = value + } + if let value = pageId { + xQuery["page_id"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + var fullUrl = relativeUrls["getHomeProducts"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/home/listing/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1359,96 +1002,68 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(HomeListingResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getHomeProducts - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getHomeProducts + * Description: fetch the next page by calling .next(...) function + **/ public func getHomeProductsPaginator( sortOn: String?, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "cursor") paginator.onPage = { self.getHomeProducts( - - sortOn: sortOn, - pageId: paginator.pageId - , - pageSize: paginator.pageSize - - ) { response, error in + sortOn: sortOn, + pageId: paginator.pageId, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page.hasNext ?? false paginator.pageId = response.page.nextId - } paginator.onNext?(response, error) } } return paginator } - - - - + /** - * - * Summary: List all the departments - * Description: Departments are a way to categorise similar products. A product can lie in multiple departments. For example, a skirt can below to the 'Women's Fashion' Department while a handbag can lie in 'Women's Accessories' Department. Use this API to list all the departments. If successful, returns the list of departments specified in `DepartmentResponse` - **/ + * + * Summary: List all the departments + * Description: Departments are a way to categorise similar products. A product can lie in multiple departments. For example, a skirt can below to the 'Women's Fashion' Department while a handbag can lie in 'Women's Accessories' Department. Use this API to list all the departments. If successful, returns the list of departments specified in `DepartmentResponse` + **/ public func getDepartments( - onResponse: @escaping (_ response: DepartmentResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getDepartments"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/departments/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1456,52 +1071,44 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DepartmentResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get relevant suggestions for a search query - * Description: Retrieves a list of suggestions for a given search query. Each suggestion is a valid search term that's generated on the basis of query. This is particularly useful to enhance the user experience while using the search tool. - **/ + * + * Summary: Get relevant suggestions for a search query + * Description: Retrieves a list of suggestions for a given search query. Each suggestion is a valid search term that's generated on the basis of query. This is particularly useful to enhance the user experience while using the search tool. + **/ public func getSearchResults( q: String, - + onResponse: @escaping (_ response: AutoCompleteResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] + xQuery["q"] = q - xQuery["q"] = q - - - - - + var fullUrl = relativeUrls["getSearchResults"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/auto-complete/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1509,70 +1116,56 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AutoCompleteResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: List all the collections - * Description: Collections are a great way to organize your products and can improve the ability for customers to find items quickly and efficiently. - **/ + * + * Summary: List all the collections + * Description: Collections are a great way to organize your products and can improve the ability for customers to find items quickly and efficiently. + **/ public func getCollections( pageNo: Int?, pageSize: Int?, tag: [String]?, - + onResponse: @escaping (_ response: GetCollectionListingResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = tag { - - xQuery["tag"] = value - -} + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } - + if let value = tag { + xQuery["tag"] = value + } + var fullUrl = relativeUrls["getCollections"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/collections/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1580,58 +1173,39 @@ if let value = tag { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetCollectionListingResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getCollections - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getCollections + * Description: fetch the next page by calling .next(...) function + **/ public func getCollectionsPaginator( pageSize: Int?, tag: [String]? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getCollections( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - , - tag: tag - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + tag: tag + ) { response, error in if let response = response { paginator.hasNext = response.page.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -1641,15 +1215,12 @@ if let value = tag { } return paginator } - - - - + /** - * - * Summary: Get the items in a collection - * Description: Get items in a collection specified by its `slug`. - **/ + * + * Summary: Get the items in a collection + * Description: Get items in a collection specified by its `slug`. + **/ public func getCollectionItemsBySlug( slug: String, f: String?, @@ -1657,59 +1228,44 @@ if let value = tag { sortOn: String?, pageId: String?, pageSize: Int?, - + onResponse: @escaping (_ response: ProductListingResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = f { - - xQuery["f"] = value - -} - - -if let value = filters { - - xQuery["filters"] = value - -} - - -if let value = sortOn { - - xQuery["sort_on"] = value - -} + var xQuery: [String: Any] = [:] + if let value = f { + xQuery["f"] = value + } -if let value = pageId { - - xQuery["page_id"] = value - -} + if let value = filters { + xQuery["filters"] = value + } + if let value = sortOn { + xQuery["sort_on"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = pageId { + xQuery["page_id"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } - + var fullUrl = relativeUrls["getCollectionItemsBySlug"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/collections/\(slug)/items/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1717,115 +1273,78 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ProductListingResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getCollectionItemsBySlug - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getCollectionItemsBySlug + * Description: fetch the next page by calling .next(...) function + **/ public func getCollectionItemsBySlugPaginator( slug: String, f: String?, filters: Bool?, sortOn: String?, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "cursor") paginator.onPage = { self.getCollectionItemsBySlug( - - slug: slug, - f: f, - filters: filters, - sortOn: sortOn, - pageId: paginator.pageId - , - pageSize: paginator.pageSize - - ) { response, error in + slug: slug, + f: f, + filters: filters, + sortOn: sortOn, + pageId: paginator.pageId, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page.hasNext ?? false paginator.pageId = response.page.nextId - } paginator.onNext?(response, error) } } return paginator } - - - - + /** - * - * Summary: Get a particular collection - * Description: Get the details of a collection by its `slug`. - **/ + * + * Summary: Get a particular collection + * Description: Get the details of a collection by its `slug`. + **/ public func getCollectionDetailBySlug( slug: String, - + onResponse: @escaping (_ response: CollectionDetailResponse?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getCollectionDetailBySlug"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/collections/\(slug)/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1833,63 +1352,54 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CollectionDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get a list of followed Products, Brands, Collections - * Description: Users can follow a product they like. This API retrieves the products the user have followed. - **/ + * + * Summary: Get a list of followed Products, Brands, Collections + * Description: Users can follow a product they like. This API retrieves the products the user have followed. + **/ public func getFollowedListing( collectionType: String, pageId: String?, pageSize: Int?, - + onResponse: @escaping (_ response: GetFollowListingResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = pageId { - - xQuery["page_id"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = pageId { + xQuery["page_id"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } - + var fullUrl = relativeUrls["getFollowedListing"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "collection_type" + "}", with: "\(collectionType)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/follow/\(collectionType)/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1897,98 +1407,75 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetFollowListingResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getFollowedListing - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getFollowedListing + * Description: fetch the next page by calling .next(...) function + **/ public func getFollowedListingPaginator( collectionType: String, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "cursor") paginator.onPage = { self.getFollowedListing( - - collectionType: collectionType, - pageId: paginator.pageId - , - pageSize: paginator.pageSize - - ) { response, error in + collectionType: collectionType, + pageId: paginator.pageId, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page.hasNext ?? false paginator.pageId = response.page.nextId - } paginator.onNext?(response, error) } } return paginator } - - - - + /** - * - * Summary: Follow an entity (product/brand/collection) - * Description: Follow a particular entity such as product, brand, collection specified by its ID. - **/ - public func followById( + * + * Summary: Unfollow an entity (product/brand/collection) + * Description: You can undo a followed product, brand or collection by its ID. This action is referred as _unfollow_. + **/ + public func unfollowById( collectionType: String, collectionId: String, - + onResponse: @escaping (_ response: FollowPostResponse?, _ error: FDKError?) -> Void ) { - - + var fullUrl = relativeUrls["unfollowById"] ?? "" - + fullUrl = fullUrl.replacingOccurrences(of: "{" + "collection_type" + "}", with: "\(collectionType)") + fullUrl = fullUrl.replacingOccurrences(of: "{" + "collection_id" + "}", with: "\(collectionId)") ApplicationAPIClient.execute( config: config, - method: "post", - url: "/service/application/catalog/v1.0/follow/\(collectionType)/\(collectionId)/", + method: "delete", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1996,48 +1483,45 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(FollowPostResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Unfollow an entity (product/brand/collection) - * Description: You can undo a followed product, brand or collection by its ID. This action is referred as _unfollow_. - **/ - public func unfollowById( + * + * Summary: Follow an entity (product/brand/collection) + * Description: Follow a particular entity such as product, brand, collection specified by its ID. + **/ + public func followById( collectionType: String, collectionId: String, - + onResponse: @escaping (_ response: FollowPostResponse?, _ error: FDKError?) -> Void ) { - - + var fullUrl = relativeUrls["followById"] ?? "" - + fullUrl = fullUrl.replacingOccurrences(of: "{" + "collection_type" + "}", with: "\(collectionType)") + fullUrl = fullUrl.replacingOccurrences(of: "{" + "collection_id" + "}", with: "\(collectionId)") ApplicationAPIClient.execute( config: config, - method: "delete", - url: "/service/application/catalog/v1.0/follow/\(collectionType)/\(collectionId)/", + method: "post", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2045,48 +1529,45 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(FollowPostResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get Follow Count - * Description: Get the total count of followers for a given collection type and collection ID. - **/ + * + * Summary: Get Follow Count + * Description: Get the total count of followers for a given collection type and collection ID. + **/ public func getFollowerCountById( collectionType: String, collectionId: String, - + onResponse: @escaping (_ response: FollowerCountResponse?, _ error: FDKError?) -> Void ) { - - + var fullUrl = relativeUrls["getFollowerCountById"] ?? "" - + fullUrl = fullUrl.replacingOccurrences(of: "{" + "collection_type" + "}", with: "\(collectionType)") + fullUrl = fullUrl.replacingOccurrences(of: "{" + "collection_id" + "}", with: "\(collectionId)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/follow/\(collectionType)/\(collectionId)/count/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2094,54 +1575,46 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(FollowerCountResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get the IDs of followed products, brands and collections. - * Description: You can get the IDs of all the followed Products, Brands and Collections. Pass collection_type as query parameter to fetch specific Ids - **/ + * + * Summary: Get the IDs of followed products, brands and collections. + * Description: You can get the IDs of all the followed Products, Brands and Collections. Pass collection_type as query parameter to fetch specific Ids + **/ public func getFollowIds( collectionType: String?, - + onResponse: @escaping (_ response: FollowIdsResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = collectionType { - - xQuery["collection_type"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = collectionType { + xQuery["collection_type"] = value + } + var fullUrl = relativeUrls["getFollowIds"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/catalog/v1.0/follow/ids/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2149,27 +1622,24 @@ if let value = collectionType { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(FollowIdsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get store meta information. - * Description: Use this API to get a list of stores in a specific application. - **/ + * + * Summary: Get store meta information. + * Description: Use this API to get a list of stores in a specific application. + **/ public func getStores( pageNo: Int?, pageSize: Int?, @@ -2178,237 +1648,588 @@ if let value = collectionType { range: Int?, latitude: Double?, longitude: Double?, - + onResponse: @escaping (_ response: StoreListingResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] + + if let value = pageNo { + xQuery["page_no"] = value + } + + if let value = pageSize { + xQuery["page_size"] = value + } + + if let value = q { + xQuery["q"] = value + } + + if let value = city { + xQuery["city"] = value + } + + if let value = range { + xQuery["range"] = value + } + + if let value = latitude { + xQuery["latitude"] = value + } + + if let value = longitude { + xQuery["longitude"] = value + } + + var fullUrl = relativeUrls["getStores"] ?? "" + + ApplicationAPIClient.execute( + config: config, + method: "get", + url: fullUrl, + query: xQuery, + extraHeaders: [], + body: nil, + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(StoreListingResponse.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getStores + * Description: fetch the next page by calling .next(...) function + **/ + public func getStoresPaginator( + pageSize: Int?, + q: String?, + city: String?, + range: Int?, + latitude: Double?, + longitude: Double? + + ) -> Paginator { + let pageSize = pageSize ?? 20 + let paginator = Paginator(pageSize: pageSize, type: "number") + paginator.onPage = { + self.getStores( + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + q: q, + city: city, + range: range, + latitude: latitude, + longitude: longitude + ) { response, error in + if let response = response { + paginator.hasNext = response.page.hasNext ?? false + paginator.pageNo = (paginator.pageNo ?? 0) + 1 + } + paginator.onNext?(response, error) + } + } + return paginator + } + + /** + * + * Summary: Get store meta information. + * Description: Use this API to get a list of stores in a specific application. + **/ + public func getInStockLocations( + pageNo: Int?, + pageSize: Int?, + q: String?, + city: String?, + range: Int?, + latitude: Double?, + longitude: Double?, + + onResponse: @escaping (_ response: ApplicationStoreListing?, _ error: FDKError?) -> Void + ) { + var xQuery: [String: Any] = [:] + + if let value = pageNo { + xQuery["page_no"] = value + } + + if let value = pageSize { + xQuery["page_size"] = value + } + + if let value = q { + xQuery["q"] = value + } + + if let value = city { + xQuery["city"] = value + } + + if let value = range { + xQuery["range"] = value + } + + if let value = latitude { + xQuery["latitude"] = value + } + + if let value = longitude { + xQuery["longitude"] = value + } + + var fullUrl = relativeUrls["getInStockLocations"] ?? "" + + ApplicationAPIClient.execute( + config: config, + method: "get", + url: fullUrl, + query: xQuery, + extraHeaders: [], + body: nil, + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(ApplicationStoreListing.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getInStockLocations + * Description: fetch the next page by calling .next(...) function + **/ + public func getInStockLocationsPaginator( + pageSize: Int?, + q: String?, + city: String?, + range: Int?, + latitude: Double?, + longitude: Double? + + ) -> Paginator { + let pageSize = pageSize ?? 20 + let paginator = Paginator(pageSize: pageSize, type: "number") + paginator.onPage = { + self.getInStockLocations( + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + q: q, + city: city, + range: range, + latitude: latitude, + longitude: longitude + ) { response, error in + if let response = response { + paginator.hasNext = response.page?.hasNext ?? false + paginator.pageNo = (paginator.pageNo ?? 0) + 1 + } + paginator.onNext?(response, error) + } + } + return paginator + } + + /** + * + * Summary: Get store meta information. + * Description: Use this API to get meta details for a store. + **/ + public func getLocationDetailsById( + locationId: Int, + + onResponse: @escaping (_ response: StoreDetails?, _ error: FDKError?) -> Void + ) { + var fullUrl = relativeUrls["getLocationDetailsById"] ?? "" + + fullUrl = fullUrl.replacingOccurrences(of: "{" + "location_id" + "}", with: "\(locationId)") + + ApplicationAPIClient.execute( + config: config, + method: "get", + url: fullUrl, + query: nil, + extraHeaders: [], + body: nil, + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(StoreDetails.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Get product bundles + * Description: Use this API to retrieve products bundles to the one specified by its slug. + **/ + public func getProductBundlesBySlug( + slug: String?, + id: String?, + + onResponse: @escaping (_ response: ProductBundle?, _ error: FDKError?) -> Void + ) { + var xQuery: [String: Any] = [:] + + if let value = slug { + xQuery["slug"] = value + } + + if let value = id { + xQuery["id"] = value + } + + var fullUrl = relativeUrls["getProductBundlesBySlug"] ?? "" + + ApplicationAPIClient.execute( + config: config, + method: "get", + url: fullUrl, + query: xQuery, + extraHeaders: [], + body: nil, + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(ProductBundle.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Get the price of a product size at a PIN Code + * Description: Prices may vary for different sizes of a product. Use this API to retrieve the price of a product size at all the selling locations near to a PIN Code. + **/ + public func getProductPriceBySlug( + slug: String, + size: String, + storeId: Int?, + pincode: String?, + + onResponse: @escaping (_ response: ProductSizePriceResponseV2?, _ error: FDKError?) -> Void + ) { + var xQuery: [String: Any] = [:] + + if let value = storeId { + xQuery["store_id"] = value + } + + if let value = pincode { + xQuery["pincode"] = value + } + + var fullUrl = relativeUrls["getProductPriceBySlug"] ?? "" + + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") + + fullUrl = fullUrl.replacingOccurrences(of: "{" + "size" + "}", with: "\(size)") + + ApplicationAPIClient.execute( + config: config, + method: "get", + url: fullUrl, + query: xQuery, + extraHeaders: [], + body: nil, + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(ProductSizePriceResponseV2.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Get the sellers of a product size at a PIN Code + * Description: A product of a particular size may be sold by multiple sellers. Use this API to fetch the sellers having the stock of a particular size at a given PIN Code. + **/ + public func getProductSellersBySlug( + slug: String, + size: String, + pincode: String?, + strategy: String?, + pageNo: Int?, + pageSize: Int?, + + onResponse: @escaping (_ response: ProductSizeSellersResponseV2?, _ error: FDKError?) -> Void + ) { + var xQuery: [String: Any] = [:] + + if let value = pincode { + xQuery["pincode"] = value + } + + if let value = strategy { + xQuery["strategy"] = value + } + + if let value = pageNo { + xQuery["page_no"] = value + } + + if let value = pageSize { + xQuery["page_size"] = value + } + + var fullUrl = relativeUrls["getProductSellersBySlug"] ?? "" + + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") + + fullUrl = fullUrl.replacingOccurrences(of: "{" + "size" + "}", with: "\(size)") + + ApplicationAPIClient.execute( + config: config, + method: "get", + url: fullUrl, + query: xQuery, + extraHeaders: [], + body: nil, + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(ProductSizeSellersResponseV2.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getProductSellersBySlug + * Description: fetch the next page by calling .next(...) function + **/ + public func getProductSellersBySlugPaginator( + slug: String, + size: String, + pincode: String?, + strategy: String?, + pageSize: Int? + + ) -> Paginator { + let pageSize = pageSize ?? 20 + let paginator = Paginator(pageSize: pageSize, type: "number") + paginator.onPage = { + self.getProductSellersBySlug( + slug: slug, + size: size, + pincode: pincode, + strategy: strategy, + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in + if let response = response { + paginator.hasNext = response.page.hasNext ?? false + paginator.pageNo = (paginator.pageNo ?? 0) + 1 + } + paginator.onNext?(response, error) + } + } + return paginator + } + } + + public class Cart { + var config: ApplicationConfig + var relativeUrls = [String: String]() + + init(config: ApplicationConfig) { + self.config = config + var ulrs = [String: String]() + + ulrs["getCart"] = config.domain.appendAsPath("/service/application/cart/v1.0/detail") + + ulrs["getCartLastModified"] = config.domain.appendAsPath("/service/application/cart/v1.0/detail") + + ulrs["addItems"] = config.domain.appendAsPath("/service/application/cart/v1.0/detail") + + ulrs["updateCart"] = config.domain.appendAsPath("/service/application/cart/v1.0/detail") + + ulrs["getItemCount"] = config.domain.appendAsPath("/service/application/cart/v1.0/basic") + + ulrs["getCoupons"] = config.domain.appendAsPath("/service/application/cart/v1.0/coupon") -if let value = pageNo { - - xQuery["page_no"] = value - -} + ulrs["applyCoupon"] = config.domain.appendAsPath("/service/application/cart/v1.0/coupon") + ulrs["removeCoupon"] = config.domain.appendAsPath("/service/application/cart/v1.0/coupon") -if let value = pageSize { - - xQuery["page_size"] = value - -} + ulrs["getBulkDiscountOffers"] = config.domain.appendAsPath("/service/application/cart/v1.0/bulk-price") + ulrs["applyRewardPoints"] = config.domain.appendAsPath("/service/application/cart/v1.0/redeem/points/") -if let value = q { - - xQuery["q"] = value - -} + ulrs["getAddresses"] = config.domain.appendAsPath("/service/application/cart/v1.0/address") + ulrs["addAddress"] = config.domain.appendAsPath("/service/application/cart/v1.0/address") -if let value = city { - - xQuery["city"] = value - -} + ulrs["getAddressById"] = config.domain.appendAsPath("/service/application/cart/v1.0/address/{id}") + ulrs["updateAddress"] = config.domain.appendAsPath("/service/application/cart/v1.0/address/{id}") -if let value = range { - - xQuery["range"] = value - -} + ulrs["removeAddress"] = config.domain.appendAsPath("/service/application/cart/v1.0/address/{id}") + ulrs["selectAddress"] = config.domain.appendAsPath("/service/application/cart/v1.0/select-address") -if let value = latitude { - - xQuery["latitude"] = value - -} + ulrs["selectPaymentMode"] = config.domain.appendAsPath("/service/application/cart/v1.0/payment") + ulrs["validateCouponForPayment"] = config.domain.appendAsPath("/service/application/cart/v1.0/payment/validate/") -if let value = longitude { - - xQuery["longitude"] = value - -} + ulrs["getShipments"] = config.domain.appendAsPath("/service/application/cart/v1.0/shipment") + ulrs["checkoutCart"] = config.domain.appendAsPath("/service/application/cart/v1.0/checkout") - + ulrs["updateCartMeta"] = config.domain.appendAsPath("/service/application/cart/v1.0/meta") + ulrs["getCartShareLink"] = config.domain.appendAsPath("/service/application/cart/v1.0/share-cart") - ApplicationAPIClient.execute( - config: config, - method: "get", - url: "/service/application/catalog/v1.0/locations/", - query: xQuery, - extraHeaders: [], - body: nil, - responseType: "application/json", - onResponse: { (responseData, error, responseCode) in - if let _ = error, let data = responseData { - var err = Utility.decode(FDKError.self, from: data) - if err?.status == nil { - err?.status = responseCode - } - onResponse(nil, err) - } else if let data = responseData { - - let response = Utility.decode(StoreListingResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getStores - * Description: fetch the next page by calling .next(...) function - **/ - public func getStoresPaginator( - pageSize: Int?, - q: String?, - city: String?, - range: Int?, - latitude: Double?, - longitude: Double? - - ) -> Paginator { - let pageSize = pageSize ?? 20 - let paginator = Paginator(pageSize: pageSize, type: "number") - paginator.onPage = { - self.getStores( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - , - q: q, - city: city, - range: range, - latitude: latitude, - longitude: longitude - ) { response, error in - if let response = response { - paginator.hasNext = response.page.hasNext ?? false - paginator.pageNo = (paginator.pageNo ?? 0) + 1 - } - paginator.onNext?(response, error) - } - } - return paginator + ulrs["getCartSharedItems"] = config.domain.appendAsPath("/service/application/cart/v1.0/share-cart/{token}") + + ulrs["updateCartWithSharedItems"] = config.domain.appendAsPath("/service/application/cart/v1.0/share-cart/{token}/{action}") + + self.relativeUrls = ulrs } - - - } - - - - public class Cart { - - var config: ApplicationConfig - init(config: ApplicationConfig) { - self.config = config; + public func update(updatedUrl: [String: String]) { + for (key, value) in updatedUrl { + self.relativeUrls[key] = value + } } - - - + /** - * - * Summary: Fetch all items added to the cart - * Description: Use this API to get details of all the items added to a cart. - **/ + * + * Summary: Fetch all items added to the cart + * Description: Use this API to get details of all the items added to a cart. + **/ public func getCart( id: String?, i: Bool?, b: Bool?, assignCardId: Int?, - + onResponse: @escaping (_ response: CartDetailResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - - -if let value = i { - - xQuery["i"] = value - -} - - -if let value = b { - - xQuery["b"] = value - -} + var xQuery: [String: Any] = [:] + if let value = id { + xQuery["id"] = value + } -if let value = assignCardId { - - xQuery["assign_card_id"] = value - -} + if let value = i { + xQuery["i"] = value + } + if let value = b { + xQuery["b"] = value + } - + if let value = assignCardId { + xQuery["assign_card_id"] = value + } + var fullUrl = relativeUrls["getCart"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/cart/v1.0/detail", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2416,54 +2237,46 @@ if let value = assignCardId { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Fetch last-modified timestamp - * Description: Use this API to fetch Last-Modified timestamp in header metadata. - **/ + * + * Summary: Fetch last-modified timestamp + * Description: Use this API to fetch Last-Modified timestamp in header metadata. + **/ public func getCartLastModified( id: String?, - + onResponse: @escaping (_ response: [String: Any]?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} + var xQuery: [String: Any] = [:] + if let value = id { + xQuery["id"] = value + } - - + var fullUrl = relativeUrls["getCartLastModified"] ?? "" ApplicationAPIClient.execute( config: config, method: "head", - url: "/service/application/cart/v1.0/detail", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2471,62 +2284,51 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = data.dictionary - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Add items to cart - * Description: Use this API to add items to the cart. - **/ + * + * Summary: Add items to cart + * Description: Use this API to add items to the cart. + **/ public func addItems( i: Bool?, b: Bool?, body: AddCartRequest, onResponse: @escaping (_ response: AddCartDetailResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = i { - - xQuery["i"] = value - -} - - -if let value = b { - - xQuery["b"] = value - -} + var xQuery: [String: Any] = [:] + if let value = i { + xQuery["i"] = value + } - + if let value = b { + xQuery["b"] = value + } + var fullUrl = relativeUrls["addItems"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/cart/v1.0/detail", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2534,27 +2336,24 @@ if let value = b { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AddCartDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Update items in the cart - * Description: Use this API to update items added to the cart with the help of a request object containing attributes like item_quantity and item_size. These attributes will be fetched from the following APIs

  • operation Operation for current api call. update_item for update items. remove_item for removing items.
  • item_id "/platform/content/v1/products/"
  • item_size "/platform/content/v1/products/{slug}/sizes/"
  • quantity item quantity (must be greater than or equal to 1)
  • article_id "/content​/v1​/products​/{identifier}​/sizes​/price​/"
  • item_index item position in the cart (must be greater than or equal to 0)
- **/ + * + * Summary: Update items in the cart + * Description:

Use this API to update items added to the cart with the help of a request object containing attributes like item_quantity and item_size. These attributes will be fetched from the following APIs

  • operation Operation for current api call. update_item for update items. remove_item for removing items.
  • item_id "/platform/content/v1/products/"
  • item_size "/platform/content/v1/products/:slug/sizes/"
  • quantity item quantity (must be greater than or equal to 1)
  • article_id "/content​/v1​/products​/:identifier​/sizes​/price​/"
  • item_index item position in the cart (must be greater than or equal to 0)
+ **/ public func updateCart( id: String?, i: Bool?, @@ -2562,42 +2361,31 @@ if let value = b { body: UpdateCartRequest, onResponse: @escaping (_ response: UpdateCartDetailResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - - -if let value = i { - - xQuery["i"] = value - -} + var xQuery: [String: Any] = [:] + if let value = id { + xQuery["id"] = value + } -if let value = b { - - xQuery["b"] = value - -} - + if let value = i { + xQuery["i"] = value + } - + if let value = b { + xQuery["b"] = value + } + var fullUrl = relativeUrls["updateCart"] ?? "" ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/cart/v1.0/detail", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2605,54 +2393,46 @@ if let value = b { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateCartDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Count items in the cart - * Description: Use this API to get the total number of items present in cart. - **/ + * + * Summary: Count items in the cart + * Description: Use this API to get the total number of items present in cart. + **/ public func getItemCount( id: String?, - + onResponse: @escaping (_ response: CartItemCountResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = id { + xQuery["id"] = value + } + var fullUrl = relativeUrls["getItemCount"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/cart/v1.0/basic", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2660,54 +2440,46 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartItemCountResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Fetch Coupon - * Description: Use this API to get a list of available coupons along with their details. - **/ + * + * Summary: Fetch Coupon + * Description: Use this API to get a list of available coupons along with their details. + **/ public func getCoupons( id: String?, - + onResponse: @escaping (_ response: GetCouponResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = id { + xQuery["id"] = value + } + var fullUrl = relativeUrls["getCoupons"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/cart/v1.0/coupon", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2715,27 +2487,24 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetCouponResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Apply Coupon - * Description: Use this API to apply coupons on items in the cart. - **/ + * + * Summary: Apply Coupon + * Description: Use this API to apply coupons on items in the cart. + **/ public func applyCoupon( i: Bool?, b: Bool?, @@ -2744,49 +2513,35 @@ if let value = id { body: ApplyCouponRequest, onResponse: @escaping (_ response: CartDetailResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = i { - - xQuery["i"] = value - -} - - -if let value = b { - - xQuery["b"] = value - -} - - -if let value = p { - - xQuery["p"] = value - -} + var xQuery: [String: Any] = [:] + if let value = i { + xQuery["i"] = value + } -if let value = id { - - xQuery["id"] = value - -} + if let value = b { + xQuery["b"] = value + } + if let value = p { + xQuery["p"] = value + } - + if let value = id { + xQuery["id"] = value + } + var fullUrl = relativeUrls["applyCoupon"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/cart/v1.0/coupon", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2794,54 +2549,46 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Remove Coupon Applied - * Description: Remove Coupon applied on the cart by passing uid in request body. - **/ + * + * Summary: Remove Coupon Applied + * Description: Remove Coupon applied on the cart by passing uid in request body. + **/ public func removeCoupon( id: String?, - + onResponse: @escaping (_ response: CartDetailResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = id { + xQuery["id"] = value + } + var fullUrl = relativeUrls["removeCoupon"] ?? "" ApplicationAPIClient.execute( config: config, method: "delete", - url: "/service/application/cart/v1.0/coupon", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2849,78 +2596,61 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get discount offers based on quantity - * Description: Use this API to get a list of applicable offers along with current, next and best offer for given product. Either one of uid, item_id, slug should be present. - **/ + * + * Summary: Get discount offers based on quantity + * Description: Use this API to get a list of applicable offers along with current, next and best offer for given product. Either one of uid, item_id, slug should be present. + **/ public func getBulkDiscountOffers( itemId: Int?, articleId: String?, uid: Int?, slug: String?, - + onResponse: @escaping (_ response: BulkPriceResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = itemId { - - xQuery["item_id"] = value - -} - - -if let value = articleId { - - xQuery["article_id"] = value - -} - - -if let value = uid { - - xQuery["uid"] = value - -} + var xQuery: [String: Any] = [:] + if let value = itemId { + xQuery["item_id"] = value + } -if let value = slug { - - xQuery["slug"] = value - -} + if let value = articleId { + xQuery["article_id"] = value + } + if let value = uid { + xQuery["uid"] = value + } - + if let value = slug { + xQuery["slug"] = value + } + var fullUrl = relativeUrls["getBulkDiscountOffers"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/cart/v1.0/bulk-price", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2928,27 +2658,24 @@ if let value = slug { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(BulkPriceResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Apply reward points at cart - * Description: Use this API to redeem a fixed no. of reward points by applying it to the cart. - **/ + * + * Summary: Apply reward points at cart + * Description: Use this API to redeem a fixed no. of reward points by applying it to the cart. + **/ public func applyRewardPoints( id: String?, i: Bool?, @@ -2956,42 +2683,31 @@ if let value = slug { body: RewardPointRequest, onResponse: @escaping (_ response: CartDetailResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = i { - - xQuery["i"] = value - -} - - -if let value = b { - - xQuery["b"] = value - -} + if let value = id { + xQuery["id"] = value + } + if let value = i { + xQuery["i"] = value + } - + if let value = b { + xQuery["b"] = value + } + var fullUrl = relativeUrls["applyRewardPoints"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/cart/v1.0/redeem/points/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2999,86 +2715,66 @@ if let value = b { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Fetch address - * Description: Use this API to get all the addresses associated with an account. If successful, returns a Address resource in the response body specified in GetAddressesResponse.attibutes listed below are optional
  • uid
  • address_id
  • mobile_no
  • checkout_mode
  • tags
  • default
- **/ + * + * Summary: Fetch address + * Description: Use this API to get all the addresses associated with an account. If successful, returns a Address resource in the response body specified in GetAddressesResponse.attibutes listed below are optional
  • uid
  • address_id
  • mobile_no
  • checkout_mode
  • tags
  • default
+ **/ public func getAddresses( cartId: String?, mobileNo: String?, checkoutMode: String?, tags: String?, isDefault: Bool?, - + onResponse: @escaping (_ response: GetAddressesResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = cartId { - - xQuery["cart_id"] = value - -} - - -if let value = mobileNo { - - xQuery["mobile_no"] = value - -} - - -if let value = checkoutMode { - - xQuery["checkout_mode"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = tags { - - xQuery["tags"] = value - -} + if let value = cartId { + xQuery["cart_id"] = value + } + if let value = mobileNo { + xQuery["mobile_no"] = value + } -if let value = isDefault { - - xQuery["is_default"] = value - -} + if let value = checkoutMode { + xQuery["checkout_mode"] = value + } + if let value = tags { + xQuery["tags"] = value + } - + if let value = isDefault { + xQuery["is_default"] = value + } + var fullUrl = relativeUrls["getAddresses"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/cart/v1.0/address", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3086,46 +2782,39 @@ if let value = isDefault { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetAddressesResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Add address to an account - * Description: Use this API to add an address to an account. - **/ + * + * Summary: Add address to an account + * Description: Use this API to add an address to an account. + **/ public func addAddress( body: Address, onResponse: @escaping (_ response: SaveAddressResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["addAddress"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/cart/v1.0/address", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3133,27 +2822,24 @@ if let value = isDefault { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SaveAddressResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Fetch a single address by its ID - * Description: Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional
  • mobile_no
  • checkout_mode
  • tags
  • default
- **/ + * + * Summary: Fetch a single address by its ID + * Description: Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional
  • mobile_no
  • checkout_mode
  • tags
  • default
+ **/ public func getAddressById( id: String, cartId: String?, @@ -3161,59 +2847,44 @@ if let value = isDefault { checkoutMode: String?, tags: String?, isDefault: Bool?, - + onResponse: @escaping (_ response: Address?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = cartId { - - xQuery["cart_id"] = value - -} - - -if let value = mobileNo { - - xQuery["mobile_no"] = value - -} - - -if let value = checkoutMode { - - xQuery["checkout_mode"] = value - -} + var xQuery: [String: Any] = [:] + if let value = cartId { + xQuery["cart_id"] = value + } -if let value = tags { - - xQuery["tags"] = value - -} + if let value = mobileNo { + xQuery["mobile_no"] = value + } + if let value = checkoutMode { + xQuery["checkout_mode"] = value + } -if let value = isDefault { - - xQuery["is_default"] = value - -} + if let value = tags { + xQuery["tags"] = value + } + if let value = isDefault { + xQuery["is_default"] = value + } - + var fullUrl = relativeUrls["getAddressById"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "id" + "}", with: "\(id)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/cart/v1.0/address/\(id)", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3221,47 +2892,42 @@ if let value = isDefault { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Address.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Update address added to an account - * Description: Use this API to update an existing address in the account. Request object should contain attributes mentioned in Address can be updated. These attributes are:

  • is_default_address
  • landmark
  • area
  • pincode
  • email
  • address_type
  • name
  • address_id
  • address
- **/ + * + * Summary: Update address added to an account + * Description:

Use this API to update an existing address in the account. Request object should contain attributes mentioned in Address can be updated. These attributes are:

  • is_default_address
  • landmark
  • area
  • pincode
  • email
  • address_type
  • name
  • address_id
  • address
+ **/ public func updateAddress( id: String, body: Address, onResponse: @escaping (_ response: UpdateAddressResponse?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["updateAddress"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "id" + "}", with: "\(id)") ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/cart/v1.0/address/\(id)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3269,47 +2935,42 @@ if let value = isDefault { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateAddressResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Remove address associated with an account - * Description: Use this API to delete an address by its ID. This will returns an object that will indicate whether the address was deleted successfully or not. - **/ + * + * Summary: Remove address associated with an account + * Description: Use this API to delete an address by its ID. This will returns an object that will indicate whether the address was deleted successfully or not. + **/ public func removeAddress( id: String, - + onResponse: @escaping (_ response: DeleteAddressResponse?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["removeAddress"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "id" + "}", with: "\(id)") ApplicationAPIClient.execute( config: config, method: "delete", - url: "/service/application/cart/v1.0/address/\(id)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3317,27 +2978,24 @@ if let value = isDefault { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DeleteAddressResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Select an address from available addresses - * Description:

Select Address from all addresses associated with the account in order to ship the cart items to that address, otherwise default address will be selected implicitly. See `SelectCartAddressRequest` in schema of request body for the list of attributes needed to select Address from account. On successful request, this API returns a Cart object. Below address attributes are required.

  • address_id
  • billing_address_id
  • uid
- **/ + * + * Summary: Select an address from available addresses + * Description:

Select Address from all addresses associated with the account in order to ship the cart items to that address, otherwise default address will be selected implicitly. See `SelectCartAddressRequest` in schema of request body for the list of attributes needed to select Address from account. On successful request, this API returns a Cart object. Below address attributes are required.

  • address_id
  • billing_address_id
  • uid

+ **/ public func selectAddress( cartId: String?, i: Bool?, @@ -3345,42 +3003,31 @@ if let value = isDefault { body: SelectCartAddressRequest, onResponse: @escaping (_ response: CartDetailResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = cartId { - - xQuery["cart_id"] = value - -} - - -if let value = i { - - xQuery["i"] = value - -} + var xQuery: [String: Any] = [:] + if let value = cartId { + xQuery["cart_id"] = value + } -if let value = b { - - xQuery["b"] = value - -} - + if let value = i { + xQuery["i"] = value + } - + if let value = b { + xQuery["b"] = value + } + var fullUrl = relativeUrls["selectAddress"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/cart/v1.0/select-address", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3388,54 +3035,46 @@ if let value = b { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Update cart payment - * Description: Use this API to update cart payment. - **/ + * + * Summary: Update cart payment + * Description: Use this API to update cart payment. + **/ public func selectPaymentMode( id: String?, body: UpdateCartPaymentRequest, onResponse: @escaping (_ response: CartDetailResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = id { - - xQuery["id"] = value - -} - - - + if let value = id { + xQuery["id"] = value + } + var fullUrl = relativeUrls["selectPaymentMode"] ?? "" ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/cart/v1.0/payment", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3443,27 +3082,24 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Verify the coupon eligibility against the payment mode - * Description: Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc. - **/ + * + * Summary: Verify the coupon eligibility against the payment mode + * Description: Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc. + **/ public func validateCouponForPayment( id: String?, addressId: String?, @@ -3471,66 +3107,46 @@ if let value = id { paymentIdentifier: String?, aggregatorName: String?, merchantCode: String?, - + onResponse: @escaping (_ response: PaymentCouponValidate?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - - -if let value = addressId { - - xQuery["address_id"] = value - -} - - -if let value = paymentMode { - - xQuery["payment_mode"] = value - -} - - -if let value = paymentIdentifier { - - xQuery["payment_identifier"] = value - -} + var xQuery: [String: Any] = [:] + if let value = id { + xQuery["id"] = value + } -if let value = aggregatorName { - - xQuery["aggregator_name"] = value - -} + if let value = addressId { + xQuery["address_id"] = value + } + if let value = paymentMode { + xQuery["payment_mode"] = value + } -if let value = merchantCode { - - xQuery["merchant_code"] = value - -} + if let value = paymentIdentifier { + xQuery["payment_identifier"] = value + } + if let value = aggregatorName { + xQuery["aggregator_name"] = value + } - + if let value = merchantCode { + xQuery["merchant_code"] = value + } + var fullUrl = relativeUrls["validateCouponForPayment"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/cart/v1.0/payment/validate/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3538,78 +3154,61 @@ if let value = merchantCode { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PaymentCouponValidate.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get delivery date and options before checkout - * Description: Use this API to get shipment details, expected delivery date, items and price breakup of the shipment. - **/ + * + * Summary: Get delivery date and options before checkout + * Description: Use this API to get shipment details, expected delivery date, items and price breakup of the shipment. + **/ public func getShipments( p: Bool?, id: String?, addressId: String?, areaCode: String?, - + onResponse: @escaping (_ response: CartShipmentsResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = p { - - xQuery["p"] = value - -} - - -if let value = id { - - xQuery["id"] = value - -} - - -if let value = addressId { - - xQuery["address_id"] = value - -} + var xQuery: [String: Any] = [:] + if let value = p { + xQuery["p"] = value + } -if let value = areaCode { - - xQuery["area_code"] = value - -} + if let value = id { + xQuery["id"] = value + } + if let value = addressId { + xQuery["address_id"] = value + } - + if let value = areaCode { + xQuery["area_code"] = value + } + var fullUrl = relativeUrls["getShipments"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/cart/v1.0/shipment", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3617,46 +3216,39 @@ if let value = areaCode { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartShipmentsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Checkout all items in the cart - * Description: Use this API to checkout all items in the cart for payment and order generation. For COD, order will be directly generated, whereas for other checkout modes, user will be redirected to a payment gateway. - **/ + * + * Summary: Checkout all items in the cart + * Description: Use this API to checkout all items in the cart for payment and order generation. For COD, order will be directly generated, whereas for other checkout modes, user will be redirected to a payment gateway. + **/ public func checkoutCart( body: CartCheckoutDetailRequest, onResponse: @escaping (_ response: CartCheckoutResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["checkoutCart"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/cart/v1.0/checkout", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3664,54 +3256,46 @@ if let value = areaCode { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartCheckoutResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Update the cart meta - * Description: Use this API to update cart meta like checkout_mode and gstin. - **/ + * + * Summary: Update the cart meta + * Description: Use this API to update cart meta like checkout_mode and gstin. + **/ public func updateCartMeta( id: String?, body: CartMetaRequest, onResponse: @escaping (_ response: CartMetaResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = id { - - xQuery["id"] = value - -} - - - + if let value = id { + xQuery["id"] = value + } + var fullUrl = relativeUrls["updateCartMeta"] ?? "" ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/cart/v1.0/meta", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3719,46 +3303,39 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartMetaResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Generate token for sharing the cart - * Description: Use this API to generate a shared cart snapshot and return a shortlink token. The link can be shared with other users for getting the same items in their cart. - **/ + * + * Summary: Generate token for sharing the cart + * Description: Use this API to generate a shared cart snapshot and return a shortlink token. The link can be shared with other users for getting the same items in their cart. + **/ public func getCartShareLink( body: GetShareCartLinkRequest, onResponse: @escaping (_ response: GetShareCartLinkResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getCartShareLink"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/cart/v1.0/share-cart", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3766,47 +3343,42 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetShareCartLinkResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get details of a shared cart - * Description: Use this API to get the shared cart details as per the token generated using the share-cart API. - **/ + * + * Summary: Get details of a shared cart + * Description: Use this API to get the shared cart details as per the token generated using the share-cart API. + **/ public func getCartSharedItems( token: String, - + onResponse: @escaping (_ response: SharedCartResponse?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getCartSharedItems"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "token" + "}", with: "\(token)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/cart/v1.0/share-cart/\(token)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3814,48 +3386,45 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SharedCartResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Merge or replace existing cart - * Description: Use this API to merge the shared cart with existing cart, or replace the existing cart with the shared cart. The `action` parameter is used to indicate the operation Merge or Replace. - **/ + * + * Summary: Merge or replace existing cart + * Description: Use this API to merge the shared cart with existing cart, or replace the existing cart with the shared cart. The `action` parameter is used to indicate the operation Merge or Replace. + **/ public func updateCartWithSharedItems( token: String, action: String, - + onResponse: @escaping (_ response: SharedCartResponse?, _ error: FDKError?) -> Void ) { - - + var fullUrl = relativeUrls["updateCartWithSharedItems"] ?? "" - + fullUrl = fullUrl.replacingOccurrences(of: "{" + "token" + "}", with: "\(token)") + fullUrl = fullUrl.replacingOccurrences(of: "{" + "action" + "}", with: "\(action)") ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/cart/v1.0/share-cart/\(token)/\(action)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3863,74 +3432,127 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SharedCartResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - + public class Common { - var config: ApplicationConfig + var relativeUrls = [String: String]() init(config: ApplicationConfig) { - self.config = config; + self.config = config + var ulrs = [String: String]() + + ulrs["searchApplication"] = config.domain.appendAsPath("/service/common/configuration/v1.0/application/search-application") + + ulrs["getLocations"] = config.domain.appendAsPath("/service/common/configuration/v1.0/location") + + self.relativeUrls = ulrs + } + + public func update(updatedUrl: [String: String]) { + for (key, value) in updatedUrl { + self.relativeUrls[key] = value + } + } + + /** + * + * Summary: Search Application + * Description: Provide application name or domain url + **/ + public func searchApplication( + authorization: String?, + query: String?, + + onResponse: @escaping (_ response: ApplicationResponse?, _ error: FDKError?) -> Void + ) { + var xQuery: [String: Any] = [:] + + if let value = query { + xQuery["query"] = value + } + + var xHeaders: [(key: String, value: String)] = [] + + if let value = authorization { + xHeaders.append((key: "authorization", value: value)) + } + + var fullUrl = relativeUrls["searchApplication"] ?? "" + + ApplicationAPIClient.execute( + config: config, + method: "get", + url: fullUrl, + query: xQuery, + extraHeaders: xHeaders, + body: nil, + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(ApplicationResponse.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) } - - - + /** - * - * Summary: Get countries, states, cities - * Description: - **/ + * + * Summary: Get countries, states, cities + * Description: + **/ public func getLocations( locationType: String?, id: String?, - + onResponse: @escaping (_ response: Locations?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = locationType { - - xQuery["location_type"] = value - -} - - -if let value = id { - - xQuery["id"] = value - -} + var xQuery: [String: Any] = [:] + if let value = locationType { + xQuery["location_type"] = value + } - + if let value = id { + xQuery["id"] = value + } + var fullUrl = relativeUrls["getLocations"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/common/configuration/v1.0/location", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3938,59 +3560,74 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Locations.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - + public class Lead { - var config: ApplicationConfig + var relativeUrls = [String: String]() init(config: ApplicationConfig) { - self.config = config; + self.config = config + var ulrs = [String: String]() + + ulrs["getTicket"] = config.domain.appendAsPath("/service/application/lead/v1.0/ticket/{id}") + + ulrs["createHistory"] = config.domain.appendAsPath("/service/application/lead/v1.0/ticket/{id}/history") + + ulrs["createTicket"] = config.domain.appendAsPath("/service/application/lead/v1.0/ticket/") + + ulrs["getCustomForm"] = config.domain.appendAsPath("/service/application/lead/v1.0/form/{slug}") + + ulrs["submitCustomForm"] = config.domain.appendAsPath("/service/application/lead/v1.0/form/{slug}/submit") + + ulrs["getParticipantsInsideVideoRoom"] = config.domain.appendAsPath("/service/application/lead/v1.0/video/room/{unique_name}/participants") + + ulrs["getTokenForVideoRoom"] = config.domain.appendAsPath("/service/application/lead/v1.0/video/room/{unique_name}/token") + + self.relativeUrls = ulrs + } + + public func update(updatedUrl: [String: String]) { + for (key, value) in updatedUrl { + self.relativeUrls[key] = value + } } - - - + /** - * - * Summary: Get Ticket with the specific id - * Description: Get Ticket with the specific id, this is used to view the ticket details - **/ + * + * Summary: Get Ticket with the specific id + * Description: Get Ticket with the specific id, this is used to view the ticket details + **/ public func getTicket( id: String, - + onResponse: @escaping (_ response: Ticket?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getTicket"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "id" + "}", with: "\(id)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/lead/v1.0/ticket/\(id)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3998,47 +3635,42 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Ticket.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Create history for specific Ticket - * Description: Create history for specific Ticket, this history is seen on ticket detail page, this can be comment, log or rating. - **/ + * + * Summary: Create history for specific Ticket + * Description: Create history for specific Ticket, this history is seen on ticket detail page, this can be comment, log or rating. + **/ public func createHistory( id: String, body: TicketHistoryPayload, onResponse: @escaping (_ response: TicketHistory?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["createHistory"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "id" + "}", with: "\(id)") ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/lead/v1.0/ticket/\(id)/history", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4046,46 +3678,39 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TicketHistory.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Create Ticket - * Description: This is used to Create Ticket. - **/ + * + * Summary: Create Ticket + * Description: This is used to Create Ticket. + **/ public func createTicket( body: AddTicketPayload, onResponse: @escaping (_ response: Ticket?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["createTicket"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/lead/v1.0/ticket/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4093,47 +3718,42 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Ticket.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get specific Custom Form using it's slug - * Description: Get specific Custom Form using it's slug, this is used to view the form. - **/ + * + * Summary: Get specific Custom Form using it's slug + * Description: Get specific Custom Form using it's slug, this is used to view the form. + **/ public func getCustomForm( slug: String, - + onResponse: @escaping (_ response: CustomForm?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getCustomForm"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/lead/v1.0/form/\(slug)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4141,47 +3761,42 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CustomForm.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Submit Response for a specific Custom Form using it's slug - * Description: Submit Response for a specific Custom Form using it's slug, this response is then used to create a ticket on behalf of the user. - **/ + * + * Summary: Submit Response for a specific Custom Form using it's slug + * Description: Submit Response for a specific Custom Form using it's slug, this response is then used to create a ticket on behalf of the user. + **/ public func submitCustomForm( slug: String, body: CustomFormSubmissionPayload, onResponse: @escaping (_ response: SubmitCustomFormResponse?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["submitCustomForm"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/lead/v1.0/form/\(slug)/submit", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4189,47 +3804,42 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SubmitCustomFormResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get participants of a specific Video Room using it's unique name - * Description: Get participants of a specific Video Room using it's unique name, this can be used to check if people are already there in the room and also to show their names. - **/ + * + * Summary: Get participants of a specific Video Room using it's unique name + * Description: Get participants of a specific Video Room using it's unique name, this can be used to check if people are already there in the room and also to show their names. + **/ public func getParticipantsInsideVideoRoom( uniqueName: String, - + onResponse: @escaping (_ response: GetParticipantsInsideVideoRoomResponse?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getParticipantsInsideVideoRoom"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "unique_name" + "}", with: "\(uniqueName)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/lead/v1.0/video/room/\(uniqueName)/participants", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4237,47 +3847,42 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetParticipantsInsideVideoRoomResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get Token to join a specific Video Room using it's unqiue name - * Description: Get Token to join a specific Video Room using it's unqiue name, this Token is your ticket to Room and also creates your identity there. - **/ + * + * Summary: Get Token to join a specific Video Room using it's unqiue name + * Description: Get Token to join a specific Video Room using it's unqiue name, this Token is your ticket to Room and also creates your identity there. + **/ public func getTokenForVideoRoom( uniqueName: String, - + onResponse: @escaping (_ response: GetTokenForVideoRoomResponse?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getTokenForVideoRoom"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "unique_name" + "}", with: "\(uniqueName)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/lead/v1.0/video/room/\(uniqueName)/token", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4285,59 +3890,68 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetTokenForVideoRoomResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - + public class Theme { - var config: ApplicationConfig + var relativeUrls = [String: String]() init(config: ApplicationConfig) { - self.config = config; + self.config = config + var ulrs = [String: String]() + + ulrs["getAllPages"] = config.domain.appendAsPath("/service/application/theme/v1.0/{theme_id}/page") + + ulrs["getPage"] = config.domain.appendAsPath("/service/application/theme/v1.0/{theme_id}/{page_value}") + + ulrs["getAppliedTheme"] = config.domain.appendAsPath("/service/application/theme/v1.0/applied-theme") + + ulrs["getThemeForPreview"] = config.domain.appendAsPath("/service/application/theme/v1.0/{theme_id}/preview") + + self.relativeUrls = ulrs + } + + public func update(updatedUrl: [String: String]) { + for (key, value) in updatedUrl { + self.relativeUrls[key] = value + } } - - - + /** - * - * Summary: Get all pages of a theme - * Description: Use this API to retrieve all the available pages of a theme by its ID. - **/ + * + * Summary: Get all pages of a theme + * Description: Use this API to retrieve all the available pages of a theme by its ID. + **/ public func getAllPages( themeId: String, - + onResponse: @escaping (_ response: AllAvailablePageSchema?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getAllPages"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "theme_id" + "}", with: "\(themeId)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/theme/v1.0/\(themeId)/page", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4345,48 +3959,45 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AllAvailablePageSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get page of a theme - * Description: Use this API to retrieve a page of a theme. - **/ + * + * Summary: Get page of a theme + * Description: Use this API to retrieve a page of a theme. + **/ public func getPage( themeId: String, pageValue: String, - + onResponse: @escaping (_ response: AvailablePageSchema?, _ error: FDKError?) -> Void ) { - - + var fullUrl = relativeUrls["getPage"] ?? "" - + fullUrl = fullUrl.replacingOccurrences(of: "{" + "theme_id" + "}", with: "\(themeId)") + fullUrl = fullUrl.replacingOccurrences(of: "{" + "page_value" + "}", with: "\(pageValue)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/theme/v1.0/\(themeId)/\(pageValue)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4394,46 +4005,38 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AvailablePageSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get the theme currently applied to an application - * Description: An application has multiple themes, but only one theme can be applied at a time. Use this API to retrieve the theme currently applied to the application. - **/ + * + * Summary: Get the theme currently applied to an application + * Description: An application has multiple themes, but only one theme can be applied at a time. Use this API to retrieve the theme currently applied to the application. + **/ public func getAppliedTheme( - onResponse: @escaping (_ response: ThemesSchema?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getAppliedTheme"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/theme/v1.0/applied-theme", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4441,47 +4044,42 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ThemesSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get a theme for a preview - * Description: A theme can be previewed before applying it. Use this API to retrieve the preview of a theme by its ID. - **/ + * + * Summary: Get a theme for a preview + * Description: A theme can be previewed before applying it. Use this API to retrieve the preview of a theme by its ID. + **/ public func getThemeForPreview( themeId: String, - + onResponse: @escaping (_ response: ThemesSchema?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getThemeForPreview"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "theme_id" + "}", with: "\(themeId)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/theme/v1.0/\(themeId)/preview", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4489,66 +4087,130 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ThemesSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - + public class User { - var config: ApplicationConfig + var relativeUrls = [String: String]() init(config: ApplicationConfig) { - self.config = config; + self.config = config + var ulrs = [String: String]() + + ulrs["loginWithFacebook"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/login/facebook-token") + + ulrs["loginWithGoogle"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/login/google-token") + + ulrs["loginWithGoogleAndroid"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/login/google-android") + + ulrs["loginWithGoogleIOS"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/login/google-ios") + + ulrs["loginWithAppleIOS"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/login/apple-ios") + + ulrs["loginWithOTP"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/login/otp") + + ulrs["loginWithEmailAndPassword"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/login/password") + + ulrs["sendResetPasswordEmail"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/login/password/reset") + + ulrs["forgotPassword"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/login/password/reset/forgot") + + ulrs["sendResetToken"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/login/password/reset/token") + + ulrs["loginWithToken"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/login/token") + + ulrs["registerWithForm"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/register/form") + + ulrs["verifyEmail"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/verify/email") + + ulrs["verifyMobile"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/verify/mobile") + + ulrs["hasPassword"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/has-password") + + ulrs["updatePassword"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/password") + + ulrs["logout"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/logout") + + ulrs["sendOTPOnMobile"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/otp/mobile/send") + + ulrs["verifyMobileOTP"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/otp/mobile/verify") + + ulrs["sendOTPOnEmail"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/otp/email/send") + + ulrs["verifyEmailOTP"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/otp/email/verify") + + ulrs["getLoggedInUser"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/session") + + ulrs["getListOfActiveSessions"] = config.domain.appendAsPath("/service/application/user/authentication/v1.0/sessions") + + ulrs["getPlatformConfig"] = config.domain.appendAsPath("/service/application/user/platform/v1.0/config") + + ulrs["updateProfile"] = config.domain.appendAsPath("/service/application/user/profile/v1.0/detail") + + ulrs["addMobileNumber"] = config.domain.appendAsPath("/service/application/user/profile/v1.0/mobile") + + ulrs["deleteMobileNumber"] = config.domain.appendAsPath("/service/application/user/profile/v1.0/mobile") + + ulrs["setMobileNumberAsPrimary"] = config.domain.appendAsPath("/service/application/user/profile/v1.0/mobile/primary") + + ulrs["sendVerificationLinkToMobile"] = config.domain.appendAsPath("/service/application/user/profile/v1.0/mobile/link/send") + + ulrs["addEmail"] = config.domain.appendAsPath("/service/application/user/profile/v1.0/email") + + ulrs["deleteEmail"] = config.domain.appendAsPath("/service/application/user/profile/v1.0/email") + + ulrs["setEmailAsPrimary"] = config.domain.appendAsPath("/service/application/user/profile/v1.0/email/primary") + + ulrs["sendVerificationLinkToEmail"] = config.domain.appendAsPath("/service/application/user/profile/v1.0/email/link/send") + + self.relativeUrls = ulrs + } + + public func update(updatedUrl: [String: String]) { + for (key, value) in updatedUrl { + self.relativeUrls[key] = value + } } - - - + /** - * - * Summary: Login or Register using Facebook - * Description: Use this API to login or register using Facebook credentials. - **/ + * + * Summary: Login or Register using Facebook + * Description: Use this API to login or register using Facebook credentials. + **/ public func loginWithFacebook( platform: String?, body: OAuthRequestSchema, onResponse: @escaping (_ response: AuthSuccess?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = platform { - - xQuery["platform"] = value - -} + var xQuery: [String: Any] = [:] + if let value = platform { + xQuery["platform"] = value + } - - + var fullUrl = relativeUrls["loginWithFacebook"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/authentication/v1.0/login/facebook-token", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4556,54 +4218,46 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AuthSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Login or Register using Google - * Description: Use this API to login or register using Google Account credentials. - **/ + * + * Summary: Login or Register using Google + * Description: Use this API to login or register using Google Account credentials. + **/ public func loginWithGoogle( platform: String?, body: OAuthRequestSchema, onResponse: @escaping (_ response: AuthSuccess?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = platform { - - xQuery["platform"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = platform { + xQuery["platform"] = value + } + var fullUrl = relativeUrls["loginWithGoogle"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/authentication/v1.0/login/google-token", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4611,54 +4265,93 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AuthSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Login or Register using Google on Android - * Description: Use this API to login or register in Android app using Google Account credentials. - **/ + * + * Summary: Login or Register using Google on Android + * Description: Use this API to login or register in Android app using Google Account credentials. + **/ public func loginWithGoogleAndroid( platform: String?, body: OAuthRequestSchema, onResponse: @escaping (_ response: AuthSuccess?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = platform { - - xQuery["platform"] = value - -} + if let value = platform { + xQuery["platform"] = value + } + + var fullUrl = relativeUrls["loginWithGoogleAndroid"] ?? "" + + ApplicationAPIClient.execute( + config: config, + method: "post", + url: fullUrl, + query: xQuery, + extraHeaders: [], + body: body.dictionary, + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(AuthSuccess.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + /** + * + * Summary: Login or Register using Google on iOS + * Description: Use this API to login or register in iOS app using Google Account credentials. + **/ + public func loginWithGoogleIOS( + platform: String?, + body: OAuthRequestSchema, + onResponse: @escaping (_ response: AuthSuccess?, _ error: FDKError?) -> Void + ) { + var xQuery: [String: Any] = [:] - + if let value = platform { + xQuery["platform"] = value + } + var fullUrl = relativeUrls["loginWithGoogleIOS"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/authentication/v1.0/login/google-android", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4666,54 +4359,46 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AuthSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Login or Register using Google on iOS - * Description: Use this API to login or register in iOS app using Google Account credentials. - **/ - public func loginWithGoogleIOS( + * + * Summary: Login or Register using Apple on iOS + * Description: Use this API to login or register in iOS app using Apple Account credentials. + **/ + public func loginWithAppleIOS( platform: String?, - body: OAuthRequestSchema, + body: OAuthRequestAppleSchema, onResponse: @escaping (_ response: AuthSuccess?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = platform { - - xQuery["platform"] = value - -} + var xQuery: [String: Any] = [:] + if let value = platform { + xQuery["platform"] = value + } - - + var fullUrl = relativeUrls["loginWithAppleIOS"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/authentication/v1.0/login/google-ios", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4721,54 +4406,46 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AuthSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Login or Register with OTP - * Description: Use this API to login or register with a One-time Password (OTP) sent via Email or SMS. - **/ + * + * Summary: Login or Register with OTP + * Description: Use this API to login or register with a One-time Password (OTP) sent via Email or SMS. + **/ public func loginWithOTP( platform: String?, body: SendOtpRequestSchema, onResponse: @escaping (_ response: SendOtpResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = platform { - - xQuery["platform"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = platform { + xQuery["platform"] = value + } + var fullUrl = relativeUrls["loginWithOTP"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/authentication/v1.0/login/otp", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4776,46 +4453,39 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SendOtpResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Login or Register with password - * Description: Use this API to login or register using an email address and password. - **/ + * + * Summary: Login or Register with password + * Description: Use this API to login or register using an email address and password. + **/ public func loginWithEmailAndPassword( body: PasswordLoginRequestSchema, onResponse: @escaping (_ response: LoginSuccess?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["loginWithEmailAndPassword"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/authentication/v1.0/login/password", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4823,54 +4493,46 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(LoginSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Reset Password - * Description: Use this API to reset a password using the link sent on email. - **/ + * + * Summary: Reset Password + * Description: Use this API to reset a password using the link sent on email. + **/ public func sendResetPasswordEmail( platform: String?, body: SendResetPasswordEmailRequestSchema, onResponse: @escaping (_ response: ResetPasswordSuccess?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = platform { - - xQuery["platform"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = platform { + xQuery["platform"] = value + } + var fullUrl = relativeUrls["sendResetPasswordEmail"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/authentication/v1.0/login/password/reset", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4878,46 +4540,39 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ResetPasswordSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Forgot Password - * Description: Use this API to reset a password using the code sent on email or SMS. - **/ + * + * Summary: Forgot Password + * Description: Use this API to reset a password using the code sent on email or SMS. + **/ public func forgotPassword( body: ForgotPasswordRequestSchema, onResponse: @escaping (_ response: LoginSuccess?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["forgotPassword"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/authentication/v1.0/login/password/reset/forgot", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4925,46 +4580,39 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(LoginSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Reset Password using token - * Description: Use this API to send code to reset password. - **/ + * + * Summary: Reset Password using token + * Description: Use this API to send code to reset password. + **/ public func sendResetToken( body: CodeRequestBodySchema, onResponse: @escaping (_ response: ResetPasswordSuccess?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["sendResetToken"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/authentication/v1.0/login/password/reset/token", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4972,46 +4620,39 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ResetPasswordSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Login or Register with token - * Description: Use this API to login or register using a token for authentication. - **/ + * + * Summary: Login or Register with token + * Description: Use this API to login or register using a token for authentication. + **/ public func loginWithToken( body: TokenRequestBodySchema, onResponse: @escaping (_ response: LoginSuccess?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["loginWithToken"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/authentication/v1.0/login/token", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5019,54 +4660,46 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(LoginSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Registration using a form - * Description: Use this API to perform user registration by sending form data in the request body. - **/ + * + * Summary: Registration using a form + * Description: Use this API to perform user registration by sending form data in the request body. + **/ public func registerWithForm( platform: String?, body: FormRegisterRequestSchema, onResponse: @escaping (_ response: RegisterFormSuccess?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = platform { - - xQuery["platform"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = platform { + xQuery["platform"] = value + } + var fullUrl = relativeUrls["registerWithForm"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/authentication/v1.0/register/form", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5074,46 +4707,39 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(RegisterFormSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Verify email - * Description: Use this API to send a verification code to verify an email. - **/ + * + * Summary: Verify email + * Description: Use this API to send a verification code to verify an email. + **/ public func verifyEmail( body: CodeRequestBodySchema, onResponse: @escaping (_ response: VerifyEmailSuccess?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["verifyEmail"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/authentication/v1.0/verify/email", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5121,46 +4747,39 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(VerifyEmailSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Verify mobile - * Description: Use this API to send a verification code to verify a mobile number. - **/ + * + * Summary: Verify mobile + * Description: Use this API to send a verification code to verify a mobile number. + **/ public func verifyMobile( body: CodeRequestBodySchema, onResponse: @escaping (_ response: VerifyEmailSuccess?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["verifyMobile"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/authentication/v1.0/verify/mobile", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5168,46 +4787,38 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(VerifyEmailSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Check password - * Description: Use this API to check if user has created a password for login. - **/ + * + * Summary: Check password + * Description: Use this API to check if user has created a password for login. + **/ public func hasPassword( - onResponse: @escaping (_ response: HasPasswordSuccess?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["hasPassword"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/user/authentication/v1.0/has-password", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5215,46 +4826,39 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(HasPasswordSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Update user password - * Description: Use this API to update the password. - **/ + * + * Summary: Update user password + * Description: Use this API to update the password. + **/ public func updatePassword( body: UpdatePasswordRequestSchema, onResponse: @escaping (_ response: VerifyEmailSuccess?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["updatePassword"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/authentication/v1.0/password", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5262,46 +4866,38 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(VerifyEmailSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Logs out currently logged in user - * Description: Use this API to check to logout a user from the app. - **/ + * + * Summary: Logs out currently logged in user + * Description: Use this API to check to logout a user from the app. + **/ public func logout( - onResponse: @escaping (_ response: LogoutSuccess?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["logout"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/user/authentication/v1.0/logout", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5309,54 +4905,46 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(LogoutSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Send OTP on mobile - * Description: Use this API to send an OTP to a mobile number. - **/ + * + * Summary: Send OTP on mobile + * Description: Use this API to send an OTP to a mobile number. + **/ public func sendOTPOnMobile( platform: String?, body: SendMobileOtpRequestSchema, onResponse: @escaping (_ response: OtpSuccess?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = platform { - - xQuery["platform"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = platform { + xQuery["platform"] = value + } + var fullUrl = relativeUrls["sendOTPOnMobile"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/authentication/v1.0/otp/mobile/send", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5364,54 +4952,46 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OtpSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Verify OTP on mobile - * Description: Use this API to verify the OTP received on a mobile number. - **/ + * + * Summary: Verify OTP on mobile + * Description: Use this API to verify the OTP received on a mobile number. + **/ public func verifyMobileOTP( platform: String?, body: VerifyOtpRequestSchema, onResponse: @escaping (_ response: VerifyOtpSuccess?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = platform { - - xQuery["platform"] = value - -} + var xQuery: [String: Any] = [:] + if let value = platform { + xQuery["platform"] = value + } - - + var fullUrl = relativeUrls["verifyMobileOTP"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/authentication/v1.0/otp/mobile/verify", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5419,54 +4999,46 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(VerifyOtpSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Send OTP on email - * Description: Use this API to send an OTP to an email ID. - **/ + * + * Summary: Send OTP on email + * Description: Use this API to send an OTP to an email ID. + **/ public func sendOTPOnEmail( platform: String?, body: SendEmailOtpRequestSchema, onResponse: @escaping (_ response: EmailOtpSuccess?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = platform { - - xQuery["platform"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = platform { + xQuery["platform"] = value + } + var fullUrl = relativeUrls["sendOTPOnEmail"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/authentication/v1.0/otp/email/send", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5474,54 +5046,46 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(EmailOtpSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Verify OTP on email - * Description: Use this API to verify the OTP received on an email ID. - **/ + * + * Summary: Verify OTP on email + * Description: Use this API to verify the OTP received on an email ID. + **/ public func verifyEmailOTP( platform: String?, body: VerifyEmailOtpRequestSchema, onResponse: @escaping (_ response: VerifyOtpSuccess?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = platform { - - xQuery["platform"] = value - -} - - - + if let value = platform { + xQuery["platform"] = value + } + var fullUrl = relativeUrls["verifyEmailOTP"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/authentication/v1.0/otp/email/verify", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5529,46 +5093,38 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(VerifyOtpSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get logged in user - * Description: Use this API to get the details of a logged in user. - **/ + * + * Summary: Get logged in user + * Description: Use this API to get the details of a logged in user. + **/ public func getLoggedInUser( - onResponse: @escaping (_ response: UserObjectSchema?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getLoggedInUser"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/user/authentication/v1.0/session", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5576,46 +5132,38 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UserObjectSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get list of sessions - * Description: Use this API to retrieve all active sessions of a user. - **/ + * + * Summary: Get list of sessions + * Description: Use this API to retrieve all active sessions of a user. + **/ public func getListOfActiveSessions( - onResponse: @escaping (_ response: SessionListSuccess?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getListOfActiveSessions"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/user/authentication/v1.0/sessions", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5623,54 +5171,46 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SessionListSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get platform configurations - * Description: Use this API to get all the platform configurations such as mobile image, desktop image, social logins, and all other text. - **/ + * + * Summary: Get platform configurations + * Description: Use this API to get all the platform configurations such as mobile image, desktop image, social logins, and all other text. + **/ public func getPlatformConfig( name: String?, - + onResponse: @escaping (_ response: PlatformSchema?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = name { - - xQuery["name"] = value - -} + var xQuery: [String: Any] = [:] + if let value = name { + xQuery["name"] = value + } - - + var fullUrl = relativeUrls["getPlatformConfig"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/user/platform/v1.0/config", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5678,54 +5218,46 @@ if let value = name { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PlatformSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Edit Profile Details - * Description: Use this API to update details in the user profile. Details can be first name, last name, gender, email, phone number, or profile picture. - **/ + * + * Summary: Edit Profile Details + * Description: Use this API to update details in the user profile. Details can be first name, last name, gender, email, phone number, or profile picture. + **/ public func updateProfile( platform: String?, body: EditProfileRequestSchema, onResponse: @escaping (_ response: ProfileEditSuccess?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = platform { - - xQuery["platform"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = platform { + xQuery["platform"] = value + } + var fullUrl = relativeUrls["updateProfile"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/profile/v1.0/detail", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5733,54 +5265,46 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ProfileEditSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Add mobile number to profile - * Description: Use this API to add a new mobile number to a profile. - **/ + * + * Summary: Add mobile number to profile + * Description: Use this API to add a new mobile number to a profile. + **/ public func addMobileNumber( platform: String?, body: EditMobileRequestSchema, onResponse: @escaping (_ response: VerifyMobileOTPSuccess?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = platform { - - xQuery["platform"] = value - -} - - - + if let value = platform { + xQuery["platform"] = value + } + var fullUrl = relativeUrls["addMobileNumber"] ?? "" ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/user/profile/v1.0/mobile", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5788,27 +5312,24 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(VerifyMobileOTPSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Delete mobile number from profile - * Description: Use this API to delete a mobile number from a profile. - **/ + * + * Summary: Delete mobile number from profile + * Description: Use this API to delete a mobile number from a profile. + **/ public func deleteMobileNumber( platform: String?, active: Bool, @@ -5816,56 +5337,36 @@ if let value = platform { verified: Bool, countryCode: String, phone: String, - + onResponse: @escaping (_ response: LoginSuccess?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = platform { - - xQuery["platform"] = value - -} - - - - xQuery["active"] = active - - - - - xQuery["primary"] = primary - - - - - xQuery["verified"] = verified - - - - - xQuery["country_code"] = countryCode - + var xQuery: [String: Any] = [:] + if let value = platform { + xQuery["platform"] = value + } + xQuery["active"] = active - xQuery["phone"] = phone + xQuery["primary"] = primary + xQuery["verified"] = verified + xQuery["country_code"] = countryCode - + xQuery["phone"] = phone + var fullUrl = relativeUrls["deleteMobileNumber"] ?? "" ApplicationAPIClient.execute( config: config, method: "delete", - url: "/service/application/user/profile/v1.0/mobile", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5873,46 +5374,39 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(LoginSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Set mobile as primary - * Description: Use this API to set a mobile number as primary. Primary number is a verified number used for all future communications. - **/ + * + * Summary: Set mobile as primary + * Description: Use this API to set a mobile number as primary. Primary number is a verified number used for all future communications. + **/ public func setMobileNumberAsPrimary( body: SendVerificationLinkMobileRequestSchema, onResponse: @escaping (_ response: LoginSuccess?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["setMobileNumberAsPrimary"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/profile/v1.0/mobile/primary", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5920,54 +5414,46 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(LoginSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Send verification link to mobile - * Description: Use this API to send a verification link to a mobile number - **/ + * + * Summary: Send verification link to mobile + * Description: Use this API to send a verification link to a mobile number + **/ public func sendVerificationLinkToMobile( platform: String?, body: SendVerificationLinkMobileRequestSchema, onResponse: @escaping (_ response: SendMobileVerifyLinkSuccess?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = platform { - - xQuery["platform"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = platform { + xQuery["platform"] = value + } + var fullUrl = relativeUrls["sendVerificationLinkToMobile"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/profile/v1.0/mobile/link/send", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5975,54 +5461,46 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SendMobileVerifyLinkSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Add email to profile - * Description: Use this API to add a new email address to a profile - **/ + * + * Summary: Add email to profile + * Description: Use this API to add a new email address to a profile + **/ public func addEmail( platform: String?, body: EditEmailRequestSchema, onResponse: @escaping (_ response: VerifyEmailOTPSuccess?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = platform { - - xQuery["platform"] = value - -} + var xQuery: [String: Any] = [:] + if let value = platform { + xQuery["platform"] = value + } - - + var fullUrl = relativeUrls["addEmail"] ?? "" ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/user/profile/v1.0/email", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6030,78 +5508,58 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(VerifyEmailOTPSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Delete email from profile - * Description: Use this API to delete an email address from a profile - **/ + * + * Summary: Delete email from profile + * Description: Use this API to delete an email address from a profile + **/ public func deleteEmail( platform: String?, active: Bool, primary: Bool, verified: Bool, email: String, - + onResponse: @escaping (_ response: LoginSuccess?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = platform { - - xQuery["platform"] = value - -} - - - - xQuery["active"] = active - - - - - xQuery["primary"] = primary - - - - - xQuery["verified"] = verified - - + var xQuery: [String: Any] = [:] + if let value = platform { + xQuery["platform"] = value + } - xQuery["email"] = email + xQuery["active"] = active + xQuery["primary"] = primary + xQuery["verified"] = verified - + xQuery["email"] = email + var fullUrl = relativeUrls["deleteEmail"] ?? "" ApplicationAPIClient.execute( config: config, method: "delete", - url: "/service/application/user/profile/v1.0/email", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6109,46 +5567,39 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(LoginSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Set email as primary - * Description: Use this API to set an email address as primary. Primary email ID is a email address used for all future communications. - **/ + * + * Summary: Set email as primary + * Description: Use this API to set an email address as primary. Primary email ID is a email address used for all future communications. + **/ public func setEmailAsPrimary( body: EditEmailRequestSchema, onResponse: @escaping (_ response: LoginSuccess?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["setEmailAsPrimary"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/profile/v1.0/email/primary", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6156,54 +5607,46 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(LoginSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Send verification link to email - * Description: Use this API to send verification link to an email address. - **/ + * + * Summary: Send verification link to email + * Description: Use this API to send verification link to an email address. + **/ public func sendVerificationLinkToEmail( platform: String?, body: EditEmailRequestSchema, onResponse: @escaping (_ response: SendEmailVerifyLinkSuccess?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = platform { - - xQuery["platform"] = value - -} + var xQuery: [String: Any] = [:] + if let value = platform { + xQuery["platform"] = value + } - - + var fullUrl = relativeUrls["sendVerificationLinkToEmail"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/user/profile/v1.0/email/link/send", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6211,58 +5654,94 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SendEmailVerifyLinkSuccess.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - + public class Content { - var config: ApplicationConfig + var relativeUrls = [String: String]() init(config: ApplicationConfig) { - self.config = config; + self.config = config + var ulrs = [String: String]() + + ulrs["getAnnouncements"] = config.domain.appendAsPath("/service/application/content/v1.0/announcements") + + ulrs["getBlog"] = config.domain.appendAsPath("/service/application/content/v1.0/blogs/{slug}") + + ulrs["getBlogs"] = config.domain.appendAsPath("/service/application/content/v1.0/blogs/") + + ulrs["getDataLoaders"] = config.domain.appendAsPath("/service/application/content/v1.0/data-loader") + + ulrs["getFaqs"] = config.domain.appendAsPath("/service/application/content/v1.0/faq") + + ulrs["getFaqCategories"] = config.domain.appendAsPath("/service/application/content/v1.0/faq/categories") + + ulrs["getFaqBySlug"] = config.domain.appendAsPath("/service/application/content/v1.0/faq/{slug}") + + ulrs["getFaqCategoryBySlug"] = config.domain.appendAsPath("/service/application/content/v1.0/faq/category/{slug}") + + ulrs["getFaqsByCategorySlug"] = config.domain.appendAsPath("/service/application/content/v1.0/faq/category/{slug}/faqs") + + ulrs["getLandingPage"] = config.domain.appendAsPath("/service/application/content/v1.0/landing-page") + + ulrs["getLegalInformation"] = config.domain.appendAsPath("/service/application/content/v1.0/legal") + + ulrs["getNavigations"] = config.domain.appendAsPath("/service/application/content/v1.0/navigations/") + + ulrs["getSEOConfiguration"] = config.domain.appendAsPath("/service/application/content/v1.0/seo") + + ulrs["getSlideshows"] = config.domain.appendAsPath("/service/application/content/v1.0/slideshow/") + + ulrs["getSlideshow"] = config.domain.appendAsPath("/service/application/content/v1.0/slideshow/{slug}") + + ulrs["getSupportInformation"] = config.domain.appendAsPath("/service/application/content/v1.0/support") + + ulrs["getTags"] = config.domain.appendAsPath("/service/application/content/v1.0/tags") + + ulrs["getPage"] = config.domain.appendAsPath("/service/application/content/v2.0/pages/{slug}") + + ulrs["getPages"] = config.domain.appendAsPath("/service/application/content/v2.0/pages/") + + self.relativeUrls = ulrs + } + + public func update(updatedUrl: [String: String]) { + for (key, value) in updatedUrl { + self.relativeUrls[key] = value + } } - - - + /** - * - * Summary: Get live announcements - * Description: Announcements are useful to highlight a message or information on top of a webpage. Use this API to retrieve live announcements. Get announcements on individual pages or for all pages. - **/ + * + * Summary: Get live announcements + * Description: Announcements are useful to highlight a message or information on top of a webpage. Use this API to retrieve live announcements. Get announcements on individual pages or for all pages. + **/ public func getAnnouncements( - onResponse: @escaping (_ response: AnnouncementsResponseSchema?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getAnnouncements"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/content/v1.0/announcements", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6270,55 +5749,49 @@ if let value = platform { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AnnouncementsResponseSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get a blog - * Description: Use this API to get the details of a blog using its slug. Details include the title, reading time, publish status, feature image, tags, author, etc. - **/ + * + * Summary: Get a blog + * Description: Use this API to get the details of a blog using its slug. Details include the title, reading time, publish status, feature image, tags, author, etc. + **/ public func getBlog( slug: String, rootId: String?, - + onResponse: @escaping (_ response: BlogSchema?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = rootId { - - xQuery["root_id"] = value - -} + var xQuery: [String: Any] = [:] + if let value = rootId { + xQuery["root_id"] = value + } - + var fullUrl = relativeUrls["getBlog"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/content/v1.0/blogs/\(slug)", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6326,62 +5799,51 @@ if let value = rootId { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(BlogSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get a list of blogs - * Description: Use this API to get all the blogs. - **/ + * + * Summary: Get a list of blogs + * Description: Use this API to get all the blogs. + **/ public func getBlogs( pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: BlogGetResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + var fullUrl = relativeUrls["getBlogs"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/content/v1.0/blogs/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6389,52 +5851,37 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(BlogGetResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - + /** - * - * Summary: get paginator for getBlogs - * Description: fetch the next page by calling .next(...) function - **/ + * + * Summary: get paginator for getBlogs + * Description: fetch the next page by calling .next(...) function + **/ public func getBlogsPaginator( pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getBlogs( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -6444,34 +5891,65 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Get a list of FAQs - * Description: Use this API to get a list of frequently asked questions. Users will benefit from it when facing any issue with the website. - **/ - public func getFaqs( - - onResponse: @escaping (_ response: FaqResponseSchema?, _ error: FDKError?) -> Void + * + * Summary: Get the data loaders associated with an application + * Description: Use this API to get all selected data loaders of the application in the form of tags. + **/ + public func getDataLoaders( + onResponse: @escaping (_ response: DataLoadersSchema?, _ error: FDKError?) -> Void ) { - - + var fullUrl = relativeUrls["getDataLoaders"] ?? "" + + ApplicationAPIClient.execute( + config: config, + method: "get", + url: fullUrl, + query: nil, + extraHeaders: [], + body: nil, + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(DataLoadersSchema.self, from: data) - + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + /** + * + * Summary: Get a list of FAQs + * Description: Use this API to get a list of frequently asked questions. Users will benefit from it when facing any issue with the website. + **/ + public func getFaqs( + onResponse: @escaping (_ response: FaqResponseSchema?, _ error: FDKError?) -> Void + ) { + var fullUrl = relativeUrls["getFaqs"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/content/v1.0/faq", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6479,46 +5957,38 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(FaqResponseSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get a list of FAQ categories - * Description: FAQs can be divided into categories. Use this API to get a list of FAQ categories. - **/ + * + * Summary: Get a list of FAQ categories + * Description: FAQs can be divided into categories. Use this API to get a list of FAQ categories. + **/ public func getFaqCategories( - onResponse: @escaping (_ response: GetFaqCategoriesSchema?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getFaqCategories"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/content/v1.0/faq/categories", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6526,47 +5996,42 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetFaqCategoriesSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get an FAQ - * Description: Use this API to get a particular FAQ by its slug. - **/ + * + * Summary: Get an FAQ + * Description: Use this API to get a particular FAQ by its slug. + **/ public func getFaqBySlug( slug: String, - + onResponse: @escaping (_ response: FaqSchema?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getFaqBySlug"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/content/v1.0/faq/\(slug)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6574,47 +6039,42 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(FaqSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get the FAQ category - * Description: FAQs can be divided into categories. Use this API to get the category to which an FAQ belongs. - **/ + * + * Summary: Get the FAQ category + * Description: FAQs can be divided into categories. Use this API to get the category to which an FAQ belongs. + **/ public func getFaqCategoryBySlug( slug: String, - + onResponse: @escaping (_ response: GetFaqCategoryBySlugSchema?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getFaqCategoryBySlug"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/content/v1.0/faq/category/\(slug)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6622,47 +6082,42 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetFaqCategoryBySlugSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get FAQs using the slug of FAQ category - * Description: FAQs can be divided into categories. Use this API to get all the FAQs belonging to a category by using the category slug. - **/ + * + * Summary: Get FAQs using the slug of FAQ category + * Description: FAQs can be divided into categories. Use this API to get all the FAQs belonging to a category by using the category slug. + **/ public func getFaqsByCategorySlug( slug: String, - + onResponse: @escaping (_ response: GetFaqSchema?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getFaqsByCategorySlug"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/content/v1.0/faq/category/\(slug)/faqs", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6670,46 +6125,38 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetFaqSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get the landing page - * Description: Landing page is the first page that a prospect lands upon while visiting a website. Use this API to fetch the details of a landing page. - **/ + * + * Summary: Get the landing page + * Description: Landing page is the first page that a prospect lands upon while visiting a website. Use this API to fetch the details of a landing page. + **/ public func getLandingPage( - onResponse: @escaping (_ response: LandingPageSchema?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getLandingPage"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/content/v1.0/landing-page", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6717,46 +6164,38 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(LandingPageSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get legal information - * Description: Use this API to get the legal information of an application, which includes Privacy Policy, Terms and Conditions, Shipping Policy and FAQs regarding the usage of the application. - **/ + * + * Summary: Get legal information + * Description: Use this API to get the legal information of an application, which includes Privacy Policy, Terms and Conditions, Shipping Policy and FAQs regarding the usage of the application. + **/ public func getLegalInformation( - onResponse: @escaping (_ response: ApplicationLegal?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getLegalInformation"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/content/v1.0/legal", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6764,62 +6203,51 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ApplicationLegal.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get the navigation - * Description: Use this API to fetch the navigations details which includes the items of the navigation pane. It also shows the links and sub-navigations. - **/ + * + * Summary: Get the navigation + * Description: Use this API to fetch the navigations details which includes the items of the navigation pane. It also shows the links and sub-navigations. + **/ public func getNavigations( pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: NavigationGetResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + var fullUrl = relativeUrls["getNavigations"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/content/v1.0/navigations/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6827,52 +6255,37 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(NavigationGetResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - + /** - * - * Summary: get paginator for getNavigations - * Description: fetch the next page by calling .next(...) function - **/ + * + * Summary: get paginator for getNavigations + * Description: fetch the next page by calling .next(...) function + **/ public func getNavigationsPaginator( pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getNavigations( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -6882,43 +6295,26 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Get a page - * Description: Use this API to get the details of a page using its slug. Details include the title, seo, publish status, feature image, tags, meta, etc. - **/ - public func getPage( - slug: String, - rootId: String?, - - onResponse: @escaping (_ response: PageSchema?, _ error: FDKError?) -> Void + * + * Summary: Get the SEO of an application + * Description: Use this API to get the SEO details of an application, which includes a robot.txt, meta-tags and sitemap. + **/ + public func getSEOConfiguration( + onResponse: @escaping (_ response: SeoComponent?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = rootId { - - xQuery["root_id"] = value - -} - - - - + var fullUrl = relativeUrls["getSEOConfiguration"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/content/v1.0/pages/\(slug)", - query: xQuery, - extraHeaders: [], + url: fullUrl, + query: nil, + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6926,62 +6322,51 @@ if let value = rootId { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(PageSchema.self, from: data) - + let response = Utility.decode(SeoComponent.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get all pages - * Description: Use this API to get a list of pages. - **/ - public func getPages( + * + * Summary: Get the slideshows + * Description: Use this API to get a list of slideshows along with their details. + **/ + public func getSlideshows( pageNo: Int?, pageSize: Int?, - - onResponse: @escaping (_ response: PageGetResponse?, _ error: FDKError?) -> Void - ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - -if let value = pageSize { - - xQuery["page_size"] = value - -} + onResponse: @escaping (_ response: SlideshowGetResponse?, _ error: FDKError?) -> Void + ) { + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + var fullUrl = relativeUrls["getSlideshows"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/content/v1.0/pages/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6989,52 +6374,37 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(PageGetResponse.self, from: data) - + let response = Utility.decode(SlideshowGetResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - + /** - * - * Summary: get paginator for getPages - * Description: fetch the next page by calling .next(...) function - **/ - public func getPagesPaginator( + * + * Summary: get paginator for getSlideshows + * Description: fetch the next page by calling .next(...) function + **/ + public func getSlideshowsPaginator( pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 - let paginator = Paginator(pageSize: pageSize, type: "number") + let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { - self.getPages( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + self.getSlideshows( + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -7044,34 +6414,30 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Get the SEO of an application - * Description: Use this API to get the SEO details of an application, which includes a robot.txt, meta-tags and sitemap. - **/ - public func getSEOConfiguration( - - onResponse: @escaping (_ response: SeoComponent?, _ error: FDKError?) -> Void - ) { - - + * + * Summary: Get a slideshow + * Description: A slideshow is a group of images, videos or a combination of both that are shown on the website in the form of slides. Use this API to fetch a slideshow using its `slug`. + **/ + public func getSlideshow( + slug: String, - + onResponse: @escaping (_ response: SlideshowSchema?, _ error: FDKError?) -> Void + ) { + var fullUrl = relativeUrls["getSlideshow"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/content/v1.0/seo", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7079,62 +6445,38 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(SeoComponent.self, from: data) - + let response = Utility.decode(SlideshowSchema.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get the slideshows - * Description: Use this API to get a list of slideshows along with their details. - **/ - public func getSlideshows( - pageNo: Int?, - pageSize: Int?, - - onResponse: @escaping (_ response: SlideshowGetResponse?, _ error: FDKError?) -> Void + * + * Summary: Get the support information + * Description: Use this API to get contact details for customer support including emails and phone numbers. + **/ + public func getSupportInformation( + onResponse: @escaping (_ response: Support?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - - + var fullUrl = relativeUrls["getSupportInformation"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/content/v1.0/slideshow/", - query: xQuery, - extraHeaders: [], + url: fullUrl, + query: nil, + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7142,90 +6484,38 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(SlideshowGetResponse.self, from: data) - + let response = Utility.decode(Support.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); - } - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getSlideshows - * Description: fetch the next page by calling .next(...) function - **/ - public func getSlideshowsPaginator( - pageSize: Int? - - ) -> Paginator { - let pageSize = pageSize ?? 20 - let paginator = Paginator(pageSize: pageSize, type: "number") - paginator.onPage = { - self.getSlideshows( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in - if let response = response { - paginator.hasNext = response.page?.hasNext ?? false - paginator.pageNo = (paginator.pageNo ?? 0) + 1 - } - paginator.onNext?(response, error) } - } - return paginator + ) } - - - - + /** - * - * Summary: Get a slideshow - * Description: A slideshow is a group of images, videos or a combination of both that are shown on the website in the form of slides. Use this API to fetch a slideshow using its `slug`. - **/ - public func getSlideshow( - slug: String, - - onResponse: @escaping (_ response: SlideshowSchema?, _ error: FDKError?) -> Void + * + * Summary: Get the tags associated with an application + * Description: Use this API to get all the CSS and JS injected in the application in the form of tags. + **/ + public func getTags( + onResponse: @escaping (_ response: TagsSchema?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getTags"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/content/v1.0/slideshow/\(slug)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7233,46 +6523,49 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(SlideshowSchema.self, from: data) - + let response = Utility.decode(TagsSchema.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get the support information - * Description: Use this API to get contact details for customer support including emails and phone numbers. - **/ - public func getSupportInformation( - - onResponse: @escaping (_ response: Support?, _ error: FDKError?) -> Void + * + * Summary: Get a page + * Description: Use this API to get the details of a page using its slug. Details include the title, seo, publish status, feature image, tags, meta, etc. + **/ + public func getPage( + slug: String, + rootId: String?, + + onResponse: @escaping (_ response: PageSchema?, _ error: FDKError?) -> Void ) { - - + var xQuery: [String: Any] = [:] + + if let value = rootId { + xQuery["root_id"] = value + } - + var fullUrl = relativeUrls["getPage"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/content/v1.0/support", - query: nil, - extraHeaders: [], + url: fullUrl, + query: xQuery, + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7280,46 +6573,51 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(Support.self, from: data) - + let response = Utility.decode(PageSchema.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get the tags associated with an application - * Description: Use this API to get all the CSS and JS injected in the application in the form of tags. - **/ - public func getTags( - - onResponse: @escaping (_ response: TagsSchema?, _ error: FDKError?) -> Void + * + * Summary: Get all pages + * Description: Use this API to get a list of pages. + **/ + public func getPages( + pageNo: Int?, + pageSize: Int?, + + onResponse: @escaping (_ response: PageGetResponse?, _ error: FDKError?) -> Void ) { - - + var xQuery: [String: Any] = [:] + + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + var fullUrl = relativeUrls["getPages"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/content/v1.0/tags", - query: nil, - extraHeaders: [], + url: fullUrl, + query: xQuery, + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7327,58 +6625,90 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(TagsSchema.self, from: data) - + let response = Utility.decode(PageGetResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) + } + + /** + * + * Summary: get paginator for getPages + * Description: fetch the next page by calling .next(...) function + **/ + public func getPagesPaginator( + pageSize: Int? + + ) -> Paginator { + let pageSize = pageSize ?? 20 + let paginator = Paginator(pageSize: pageSize, type: "number") + paginator.onPage = { + self.getPages( + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in + if let response = response { + paginator.hasNext = response.page?.hasNext ?? false + paginator.pageNo = (paginator.pageNo ?? 0) + 1 + } + paginator.onNext?(response, error) + } + } + return paginator } - - } - - - + public class Communication { - var config: ApplicationConfig + var relativeUrls = [String: String]() init(config: ApplicationConfig) { - self.config = config; + self.config = config + var ulrs = [String: String]() + + ulrs["getCommunicationConsent"] = config.domain.appendAsPath("/service/application/communication/v1.0/consent") + + ulrs["upsertCommunicationConsent"] = config.domain.appendAsPath("/service/application/communication/v1.0/consent") + + ulrs["upsertAppPushtoken"] = config.domain.appendAsPath("/service/application/communication/v1.0/pn-token") + + self.relativeUrls = ulrs } - - - + + public func update(updatedUrl: [String: String]) { + for (key, value) in updatedUrl { + self.relativeUrls[key] = value + } + } + /** - * - * Summary: Get communication consent - * Description: Use this API to retrieve the consent provided by the user for receiving communication messages over Email/SMS/WhatsApp. - **/ + * + * Summary: Get communication consent + * Description: Use this API to retrieve the consent provided by the user for receiving communication messages over Email/SMS/WhatsApp. + **/ public func getCommunicationConsent( - onResponse: @escaping (_ response: CommunicationConsent?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getCommunicationConsent"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/communication/v1.0/consent", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7386,46 +6716,39 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CommunicationConsent.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Upsert communication consent - * Description: Use this API to update and insert the consent provided by the user for receiving communication messages over Email/SMS/WhatsApp. - **/ + * + * Summary: Upsert communication consent + * Description: Use this API to update and insert the consent provided by the user for receiving communication messages over Email/SMS/WhatsApp. + **/ public func upsertCommunicationConsent( body: CommunicationConsentReq, onResponse: @escaping (_ response: CommunicationConsentRes?, _ error: FDKError?) -> Void - ) { - - - - - + ) { + var fullUrl = relativeUrls["upsertCommunicationConsent"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/communication/v1.0/consent", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7433,46 +6756,39 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CommunicationConsentRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Upsert push token of a user - * Description: Use this API to update and insert the push token of the user. - **/ + * + * Summary: Upsert push token of a user + * Description: Use this API to update and insert the push token of the user. + **/ public func upsertAppPushtoken( body: PushtokenReq, onResponse: @escaping (_ response: PushtokenRes?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["upsertAppPushtoken"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/communication/v1.0/pn-token", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7480,58 +6796,70 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PushtokenRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - + public class Share { - var config: ApplicationConfig + var relativeUrls = [String: String]() init(config: ApplicationConfig) { - self.config = config; + self.config = config + var ulrs = [String: String]() + + ulrs["getApplicationQRCode"] = config.domain.appendAsPath("/service/application/share/v1.0/qr/") + + ulrs["getProductQRCodeBySlug"] = config.domain.appendAsPath("/service/application/share/v1.0/qr/products/{slug}/") + + ulrs["getCollectionQRCodeBySlug"] = config.domain.appendAsPath("/service/application/share/v1.0/qr/collection/{slug}/") + + ulrs["getUrlQRCode"] = config.domain.appendAsPath("/service/application/share/v1.0/qr/url/") + + ulrs["createShortLink"] = config.domain.appendAsPath("/service/application/share/v1.0/links/short-link/") + + ulrs["getShortLinkByHash"] = config.domain.appendAsPath("/service/application/share/v1.0/links/short-link/{hash}/") + + ulrs["getOriginalShortLinkByHash"] = config.domain.appendAsPath("/service/application/share/v1.0/links/short-link/{hash}/original/") + + self.relativeUrls = ulrs + } + + public func update(updatedUrl: [String: String]) { + for (key, value) in updatedUrl { + self.relativeUrls[key] = value + } } - - - + /** - * - * Summary: Create QR Code of an app - * Description: Use this API to create a QR code of an app for sharing it with users who want to use the app. - **/ + * + * Summary: Create QR Code of an app + * Description: Use this API to create a QR code of an app for sharing it with users who want to use the app. + **/ public func getApplicationQRCode( - onResponse: @escaping (_ response: QRCodeResp?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getApplicationQRCode"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/share/v1.0/qr/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7539,47 +6867,42 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(QRCodeResp.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Create QR Code of a product - * Description: Use this API to create a QR code of a product for sharing it with users who want to view/purchase the product. - **/ + * + * Summary: Create QR Code of a product + * Description: Use this API to create a QR code of a product for sharing it with users who want to view/purchase the product. + **/ public func getProductQRCodeBySlug( slug: String, - + onResponse: @escaping (_ response: QRCodeResp?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getProductQRCodeBySlug"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/share/v1.0/qr/products/\(slug)/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7587,47 +6910,42 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(QRCodeResp.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Create QR Code of a collection - * Description: Use this API to create a QR code of a collection of products for sharing it with users who want to view/purchase the collection. - **/ + * + * Summary: Create QR Code of a collection + * Description: Use this API to create a QR code of a collection of products for sharing it with users who want to view/purchase the collection. + **/ public func getCollectionQRCodeBySlug( slug: String, - + onResponse: @escaping (_ response: QRCodeResp?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getCollectionQRCodeBySlug"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/share/v1.0/qr/collection/\(slug)/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7635,52 +6953,44 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(QRCodeResp.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Create QR Code of a URL - * Description: Use this API to create a QR code of a URL for sharing it with users who want to visit the link. - **/ + * + * Summary: Create QR Code of a URL + * Description: Use this API to create a QR code of a URL for sharing it with users who want to visit the link. + **/ public func getUrlQRCode( url: String, - + onResponse: @escaping (_ response: QRCodeResp?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["url"] = url - + var xQuery: [String: Any] = [:] + xQuery["url"] = url - - + var fullUrl = relativeUrls["getUrlQRCode"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/share/v1.0/qr/url/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7688,46 +6998,39 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(QRCodeResp.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Create a short link - * Description: Use this API to create a short link that is easy to write/share/read as compared to long URLs. - **/ + * + * Summary: Create a short link + * Description: Use this API to create a short link that is easy to write/share/read as compared to long URLs. + **/ public func createShortLink( body: ShortLinkReq, onResponse: @escaping (_ response: ShortLinkRes?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["createShortLink"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/share/v1.0/links/short-link/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7735,47 +7038,42 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ShortLinkRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get short link by hash - * Description: Use this API to get a short link by using a hash value. - **/ + * + * Summary: Get short link by hash + * Description: Use this API to get a short link by using a hash value. + **/ public func getShortLinkByHash( hash: String, - + onResponse: @escaping (_ response: ShortLinkRes?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getShortLinkByHash"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "hash" + "}", with: "\(hash)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/share/v1.0/links/short-link/\(hash)/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7783,47 +7081,42 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ShortLinkRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get original link by hash - * Description: Use this API to retrieve the original link from a short-link by using a hash value. - **/ + * + * Summary: Get original link by hash + * Description: Use this API to retrieve the original link from a short-link by using a hash value. + **/ public func getOriginalShortLinkByHash( hash: String, - + onResponse: @escaping (_ response: ShortLinkRes?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getOriginalShortLinkByHash"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "hash" + "}", with: "\(hash)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/share/v1.0/links/short-link/\(hash)/original/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7831,77 +7124,84 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ShortLinkRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - + public class FileStorage { - var config: ApplicationConfig + var relativeUrls = [String: String]() init(config: ApplicationConfig) { - self.config = config; + self.config = config + var ulrs = [String: String]() + + ulrs["startUpload"] = config.domain.appendAsPath("/service/application/assets/v1.0/namespaces/{namespace}/upload/start/") + + ulrs["completeUpload"] = config.domain.appendAsPath("/service/application/assets/v1.0/namespaces/{namespace}/upload/complete/") + + ulrs["signUrls"] = config.domain.appendAsPath("/service/application/assets/v1.0/sign-urls/") + + self.relativeUrls = ulrs + } + + public func update(updatedUrl: [String: String]) { + for (key, value) in updatedUrl { + self.relativeUrls[key] = value + } } - - - + /** - * - * Summary: Initiates an upload and returns a storage link that is valid for 30 minutes. You can use the storage link to make subsequent upload request with file buffer or blob. - * Description: Use this API to perform the first step of uploading (i.e. **Start**) an arbitrarily sized buffer or blob. + * + * Summary: Initiates an upload and returns a storage link that is valid for 30 minutes. You can use the storage link to make subsequent upload request with file buffer or blob. + * Description: Use this API to perform the first step of uploading (i.e. **Start**) an arbitrarily sized buffer or blob. -The three major steps are: -* Start -* Upload -* Complete + The three major steps are: + * Start + * Upload + * Complete -### Start -Initiates the assets upload using `startUpload`. -It returns a storage link in response. + ### Start + Initiates the assets upload using `startUpload`. + It returns a storage link in response. -### Upload -Use the storage link to upload a file (Buffer or Blob) to the File Storage. -Make a `PUT` request on storage link received from `startUpload` API with the file (Buffer or Blob) in the request body. + ### Upload + Use the storage link to upload a file (Buffer or Blob) to the File Storage. + Make a `PUT` request on storage link received from `startUpload` API with the file (Buffer or Blob) in the request body. -### Complete -After successfully upload, call the `completeUpload` API to finish the upload process. -This operation will return the URL of the uploaded file. + ### Complete + After successfully upload, call the `completeUpload` API to finish the upload process. + This operation will return the URL of the uploaded file. - **/ + **/ public func startUpload( namespace: String, body: StartRequest, onResponse: @escaping (_ response: StartResponse?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["startUpload"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "namespace" + "}", with: "\(namespace)") ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/assets/v1.0/namespaces/\(namespace)/upload/start/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7909,65 +7209,60 @@ This operation will return the URL of the uploaded file. } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(StartResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Completes the upload process. After successfully uploading a file, call this API to finish the upload process. - * Description: Use this API to perform the third step of uploading (i.e. **Complete**) an arbitrarily sized buffer or blob. + * + * Summary: Completes the upload process. After successfully uploading a file, call this API to finish the upload process. + * Description: Use this API to perform the third step of uploading (i.e. **Complete**) an arbitrarily sized buffer or blob. -The three major steps are: -* Start -* Upload -* Complete + The three major steps are: + * Start + * Upload + * Complete -### Start -Initiates the assets upload using `startUpload`. -It returns a storage link in response. + ### Start + Initiates the assets upload using `startUpload`. + It returns a storage link in response. -### Upload -Use the storage link to upload a file (Buffer or Blob) to the File Storage. -Make a `PUT` request on storage link received from `startUpload` API with the file (Buffer or Blob) in the request body. + ### Upload + Use the storage link to upload a file (Buffer or Blob) to the File Storage. + Make a `PUT` request on storage link received from `startUpload` API with the file (Buffer or Blob) in the request body. -### Complete -After successfully upload, call the `completeUpload` API to finish the upload process. -This operation will return the URL of the uploaded file. + ### Complete + After successfully upload, call the `completeUpload` API to finish the upload process. + This operation will return the URL of the uploaded file. - **/ + **/ public func completeUpload( namespace: String, body: StartResponse, onResponse: @escaping (_ response: CompleteResponse?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["completeUpload"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "namespace" + "}", with: "\(namespace)") ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/assets/v1.0/namespaces/\(namespace)/upload/complete/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7975,58 +7270,126 @@ This operation will return the URL of the uploaded file. } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CompleteResponse.self, from: data) - + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Explain here + * Description: Describe here + **/ + public func signUrls( + body: SignUrlRequest, + onResponse: @escaping (_ response: SignUrlResponse?, _ error: FDKError?) -> Void + ) { + var fullUrl = relativeUrls["signUrls"] ?? "" + + ApplicationAPIClient.execute( + config: config, + method: "post", + url: fullUrl, + query: nil, + extraHeaders: [], + body: body.dictionary, + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(SignUrlResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - + public class Configuration { - var config: ApplicationConfig + var relativeUrls = [String: String]() init(config: ApplicationConfig) { - self.config = config; + self.config = config + var ulrs = [String: String]() + + ulrs["getApplication"] = config.domain.appendAsPath("/service/application/configuration/v1.0/application") + + ulrs["getOwnerInfo"] = config.domain.appendAsPath("/service/application/configuration/v1.0/about") + + ulrs["getBasicDetails"] = config.domain.appendAsPath("/service/application/configuration/v1.0/detail") + + ulrs["getIntegrationTokens"] = config.domain.appendAsPath("/service/application/configuration/v1.0/token") + + ulrs["getOrderingStores"] = config.domain.appendAsPath("/service/application/configuration/v1.0/ordering-store/stores") + + ulrs["getStoreDetailById"] = config.domain.appendAsPath("/service/application/configuration/v1.0/ordering-store/stores/{store_id}") + + ulrs["getFeatures"] = config.domain.appendAsPath("/service/application/configuration/v1.0/feature") + + ulrs["getContactInfo"] = config.domain.appendAsPath("/service/application/configuration/v1.0/information") + + ulrs["getCurrencies"] = config.domain.appendAsPath("/service/application/configuration/v1.0/currencies") + + ulrs["getCurrencyById"] = config.domain.appendAsPath("/service/application/configuration/v1.0/currency/{id}") + + ulrs["getAppCurrencies"] = config.domain.appendAsPath("/service/application/configuration/v1.0/currency") + + ulrs["getLanguages"] = config.domain.appendAsPath("/service/application/configuration/v1.0/languages") + + ulrs["getOrderingStoreCookie"] = config.domain.appendAsPath("/service/application/configuration/v1.0/ordering-store/select") + + ulrs["removeOrderingStoreCookie"] = config.domain.appendAsPath("/service/application/configuration/v1.0/ordering-store/select") + + ulrs["getAppStaffs"] = config.domain.appendAsPath("/service/application/configuration/v1.0/staff") + + self.relativeUrls = ulrs } - - - + + public func update(updatedUrl: [String: String]) { + for (key, value) in updatedUrl { + self.relativeUrls[key] = value + } + } + /** - * - * Summary: Get current application details - * Description: Use this API to get the current application details which includes configurations that indicate the status of the website, domain, ID, tokens, images, etc. - **/ + * + * Summary: Get current application details + * Description: Use this API to get the current application details which includes configurations that indicate the status of the website, domain, ID, tokens, images, etc. + **/ public func getApplication( - onResponse: @escaping (_ response: Application?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getApplication"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/configuration/v1.0/application", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8034,46 +7397,38 @@ This operation will return the URL of the uploaded file. } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Application.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get application, owner and seller information - * Description: Use this API to get the current application details which includes channel name, description, banner, logo, favicon, domain details, etc. This API also retrieves the seller and owner information such as address, email address, and phone number. - **/ + * + * Summary: Get application, owner and seller information + * Description: Use this API to get the current application details which includes channel name, description, banner, logo, favicon, domain details, etc. This API also retrieves the seller and owner information such as address, email address, and phone number. + **/ public func getOwnerInfo( - onResponse: @escaping (_ response: ApplicationAboutResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getOwnerInfo"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/configuration/v1.0/about", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8081,46 +7436,38 @@ This operation will return the URL of the uploaded file. } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ApplicationAboutResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get basic application details - * Description: Use this API to retrieve only the basic details of the application which includes channel name, description, banner, logo, favicon, domain details, etc. - **/ + * + * Summary: Get basic application details + * Description: Use this API to retrieve only the basic details of the application which includes channel name, description, banner, logo, favicon, domain details, etc. + **/ public func getBasicDetails( - onResponse: @escaping (_ response: ApplicationDetail?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getBasicDetails"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/configuration/v1.0/detail", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8128,46 +7475,38 @@ This operation will return the URL of the uploaded file. } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ApplicationDetail.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get integration tokens - * Description: Use this API to retrieve the tokens used while integrating Firebase, MoEngage, Segment, GTM, Freshchat, Safetynet, Google Map and Facebook. **Note** - Token values are encrypted with AES encryption using a secret key. Kindly reach out to the developers for obtaining the secret key. - **/ + * + * Summary: Get integration tokens + * Description: Use this API to retrieve the tokens used while integrating Firebase, MoEngage, Segment, GTM, Freshchat, Safetynet, Google Map and Facebook. **Note** - Token values are encrypted with AES encryption using a secret key. Kindly reach out to the developers for obtaining the secret key. + **/ public func getIntegrationTokens( - onResponse: @escaping (_ response: AppTokenResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getIntegrationTokens"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/configuration/v1.0/token", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8175,70 +7514,56 @@ This operation will return the URL of the uploaded file. } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AppTokenResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get deployment stores - * Description: Use this API to retrieve the details of all the deployment stores (the selling locations where the application will be utilized for placing orders). - **/ + * + * Summary: Get deployment stores + * Description: Use this API to retrieve the details of all the deployment stores (the selling locations where the application will be utilized for placing orders). + **/ public func getOrderingStores( pageNo: Int?, pageSize: Int?, q: String?, - + onResponse: @escaping (_ response: OrderingStores?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = q { - - xQuery["q"] = value - -} + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } - + if let value = q { + xQuery["q"] = value + } + var fullUrl = relativeUrls["getOrderingStores"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/configuration/v1.0/ordering-store/stores", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8246,58 +7571,39 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OrderingStores.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getOrderingStores - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getOrderingStores + * Description: fetch the next page by calling .next(...) function + **/ public func getOrderingStoresPaginator( pageSize: Int?, q: String? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getOrderingStores( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - , - q: q - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + q: q + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -8307,35 +7613,30 @@ if let value = q { } return paginator } - - - - + /** - * - * Summary: Get ordering store details - * Description: Use this API to retrieve the details of given stores uid (the selling locations where the application will be utilized for placing orders). - **/ + * + * Summary: Get ordering store details + * Description: Use this API to retrieve the details of given stores uid (the selling locations where the application will be utilized for placing orders). + **/ public func getStoreDetailById( storeId: Int, - + onResponse: @escaping (_ response: OrderingStore?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getStoreDetailById"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "store_id" + "}", with: "\(storeId)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/configuration/v1.0/ordering-store/stores/\(storeId)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8343,46 +7644,38 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OrderingStore.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get features of application - * Description: Use this API to retrieve the configuration of features such as product detail, landing page, options in the login/registration screen, communication opt-in, cart options and many more. - **/ + * + * Summary: Get features of application + * Description: Use this API to retrieve the configuration of features such as product detail, landing page, options in the login/registration screen, communication opt-in, cart options and many more. + **/ public func getFeatures( - onResponse: @escaping (_ response: AppFeatureResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getFeatures"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/configuration/v1.0/feature", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8390,46 +7683,38 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AppFeatureResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get application information - * Description: Use this API to retrieve information about the social links, address and contact information of the company/seller/brand operating the application. - **/ + * + * Summary: Get application information + * Description: Use this API to retrieve information about the social links, address and contact information of the company/seller/brand operating the application. + **/ public func getContactInfo( - onResponse: @escaping (_ response: ApplicationInformation?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getContactInfo"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/configuration/v1.0/information", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8437,46 +7722,38 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ApplicationInformation.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get all currencies list - * Description: Use this API to get a list of currencies available. Moreover, get the name, code, symbol, and the decimal digits of the currencies. - **/ + * + * Summary: Get all currencies list + * Description: Use this API to get a list of currencies available. Moreover, get the name, code, symbol, and the decimal digits of the currencies. + **/ public func getCurrencies( - onResponse: @escaping (_ response: CurrenciesResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getCurrencies"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/configuration/v1.0/currencies", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8484,47 +7761,42 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CurrenciesResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get currency by its ID - * Description: Use this API to retrieve a currency using its ID. - **/ + * + * Summary: Get currency by its ID + * Description: Use this API to retrieve a currency using its ID. + **/ public func getCurrencyById( id: String, - + onResponse: @escaping (_ response: Currency?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getCurrencyById"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "id" + "}", with: "\(id)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/configuration/v1.0/currency/\(id)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8532,46 +7804,38 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Currency.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get currencies enabled in the application - * Description: Use this API to get a list of currencies allowed in the current application. Moreover, get the name, code, symbol, and the decimal digits of the currencies. - **/ + * + * Summary: Get currencies enabled in the application + * Description: Use this API to get a list of currencies allowed in the current application. Moreover, get the name, code, symbol, and the decimal digits of the currencies. + **/ public func getAppCurrencies( - onResponse: @escaping (_ response: AppCurrencyResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getAppCurrencies"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/configuration/v1.0/currency", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8579,46 +7843,38 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AppCurrencyResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get list of languages - * Description: Use this API to get a list of languages supported in the application. - **/ + * + * Summary: Get list of languages + * Description: Use this API to get a list of languages supported in the application. + **/ public func getLanguages( - onResponse: @escaping (_ response: LanguageResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getLanguages"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/configuration/v1.0/languages", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8626,46 +7882,39 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(LanguageResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get an Ordering Store signed cookie on selection of ordering store. - * Description: Use this API to get an Ordering Store signed cookie upon selecting an ordering store. This will be used by the cart service to verify a coupon against the selected ordering store in cart. - **/ + * + * Summary: Get an Ordering Store signed cookie on selection of ordering store. + * Description: Use this API to get an Ordering Store signed cookie upon selecting an ordering store. This will be used by the cart service to verify a coupon against the selected ordering store in cart. + **/ public func getOrderingStoreCookie( body: OrderingStoreSelectRequest, onResponse: @escaping (_ response: SuccessMessageResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getOrderingStoreCookie"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/configuration/v1.0/ordering-store/select", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8673,46 +7922,38 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SuccessMessageResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Unset the Ordering Store signed cookie. - * Description: Use this API to unset the Ordering Store cookie upon changing the sales channel, by its domain URL, in the Universal Fynd Store app. - **/ + * + * Summary: Unset the Ordering Store signed cookie. + * Description: Use this API to unset the Ordering Store cookie upon changing the sales channel, by its domain URL, in the Universal Fynd Store app. + **/ public func removeOrderingStoreCookie( - onResponse: @escaping (_ response: SuccessMessageResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["removeOrderingStoreCookie"] ?? "" ApplicationAPIClient.execute( config: config, method: "delete", - url: "/service/application/configuration/v1.0/ordering-store/select", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8720,70 +7961,56 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SuccessMessageResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get a list of staff. - * Description: Use this API to get a list of staff including the names, employee code, incentive status, assigned ordering stores, and title of each staff added to the application. - **/ + * + * Summary: Get a list of staff. + * Description: Use this API to get a list of staff including the names, employee code, incentive status, assigned ordering stores, and title of each staff added to the application. + **/ public func getAppStaffs( orderIncent: Bool?, orderingStore: Int?, user: String?, - + onResponse: @escaping (_ response: AppStaffResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = orderIncent { - - xQuery["order_incent"] = value - -} - - -if let value = orderingStore { - - xQuery["ordering_store"] = value - -} + var xQuery: [String: Any] = [:] + if let value = orderIncent { + xQuery["order_incent"] = value + } -if let value = user { - - xQuery["user"] = value - -} - + if let value = orderingStore { + xQuery["ordering_store"] = value + } - + if let value = user { + xQuery["user"] = value + } + var fullUrl = relativeUrls["getAppStaffs"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/configuration/v1.0/staff", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8791,73 +8018,115 @@ if let value = user { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AppStaffResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - + public class Payment { - var config: ApplicationConfig + var relativeUrls = [String: String]() init(config: ApplicationConfig) { - self.config = config; + self.config = config + var ulrs = [String: String]() + + ulrs["getAggregatorsConfig"] = config.domain.appendAsPath("/service/application/payment/v1.0/config/aggregators/key") + + ulrs["attachCardToCustomer"] = config.domain.appendAsPath("/service/application/payment/v1.0/card/attach") + + ulrs["getActiveCardAggregator"] = config.domain.appendAsPath("/service/application/payment/v1.0/card/aggregator") + + ulrs["getActiveUserCards"] = config.domain.appendAsPath("/service/application/payment/v1.0/cards") + + ulrs["deleteUserCard"] = config.domain.appendAsPath("/service/application/payment/v1.0/card/remove") + + ulrs["verifyCustomerForPayment"] = config.domain.appendAsPath("/service/application/payment/v1.0/payment/customer/validation") + + ulrs["verifyAndChargePayment"] = config.domain.appendAsPath("/service/application/payment/v1.0/payment/confirm/charge") + + ulrs["initialisePayment"] = config.domain.appendAsPath("/service/application/payment/v1.0/payment/request") + + ulrs["checkAndUpdatePaymentStatus"] = config.domain.appendAsPath("/service/application/payment/v1.0/payment/confirm/polling") + + ulrs["getPaymentModeRoutes"] = config.domain.appendAsPath("/service/application/payment/v1.0/payment/options") + + ulrs["getPosPaymentModeRoutes"] = config.domain.appendAsPath("/service/application/payment/v1.0/payment/options/pos") + + ulrs["getRupifiBannerDetails"] = config.domain.appendAsPath("/service/application/payment/v1.0/rupifi/banner") + + ulrs["getActiveRefundTransferModes"] = config.domain.appendAsPath("/service/application/payment/v1.0/refund/transfer-mode") + + ulrs["enableOrDisableRefundTransferMode"] = config.domain.appendAsPath("/service/application/payment/v1.0/refund/transfer-mode") + + ulrs["getUserBeneficiariesDetail"] = config.domain.appendAsPath("/service/application/payment/v1.0/refund/user/beneficiary") + + ulrs["verifyIfscCode"] = config.domain.appendAsPath("/service/application/payment/v1.0/ifsc-code/verify") + + ulrs["getOrderBeneficiariesDetail"] = config.domain.appendAsPath("/service/application/payment/v1.0/refund/order/beneficiaries") + + ulrs["verifyOtpAndAddBeneficiaryForBank"] = config.domain.appendAsPath("/service/application/payment/v1.0/refund/verification/bank") + + ulrs["addBeneficiaryDetails"] = config.domain.appendAsPath("/service/application/payment/v1.0/refund/account") + + ulrs["addRefundBankAccountUsingOTP"] = config.domain.appendAsPath("/service/application/payment/v1.0/refund/account/otp") + + ulrs["verifyOtpAndAddBeneficiaryForWallet"] = config.domain.appendAsPath("/service/application/payment/v1.0/refund/verification/wallet") + + ulrs["updateDefaultBeneficiary"] = config.domain.appendAsPath("/service/application/payment/v1.0/refund/beneficiary/default") + + self.relativeUrls = ulrs + } + + public func update(updatedUrl: [String: String]) { + for (key, value) in updatedUrl { + self.relativeUrls[key] = value + } } - - - + /** - * - * Summary: Get payment gateway keys - * Description: Use this API to retrieve the payment gateway key, secrets, merchant, SDK/API details to complete a payment at front-end. - **/ + * + * Summary: Get payment gateway keys + * Description: Use this API to retrieve the payment gateway key, secrets, merchant, SDK/API details to complete a payment at front-end. + **/ public func getAggregatorsConfig( xApiToken: String?, refresh: Bool?, - + onResponse: @escaping (_ response: AggregatorsConfigDetailResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = refresh { - - xQuery["refresh"] = value - -} + var xQuery: [String: Any] = [:] + if let value = refresh { + xQuery["refresh"] = value + } -var xHeaders: [(key: String, value: String)] = [] + var xHeaders: [(key: String, value: String)] = [] -if let value = xApiToken { - - xHeaders.append((key: "x-api-token", value: value)) - -} + if let value = xApiToken { + xHeaders.append((key: "x-api-token", value: value)) + } + var fullUrl = relativeUrls["getAggregatorsConfig"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/payment/v1.0/config/aggregators/key", + url: fullUrl, query: xQuery, - extraHeaders: xHeaders, + extraHeaders: xHeaders, body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8865,46 +8134,39 @@ if let value = xApiToken { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AggregatorsConfigDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Attach a saved card to customer. - * Description: Use this API to attach a customer's saved card at the payment gateway, such as Stripe, Juspay. - **/ + * + * Summary: Attach a saved card to customer. + * Description: Use this API to attach a customer's saved card at the payment gateway, such as Stripe, Juspay. + **/ public func attachCardToCustomer( body: AttachCardRequest, onResponse: @escaping (_ response: AttachCardsResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["attachCardToCustomer"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/payment/v1.0/card/attach", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8912,54 +8174,46 @@ if let value = xApiToken { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AttachCardsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Fetch active payment gateway for card payments - * Description: Use this API to retrieve an active payment aggregator along with the Customer ID. This is applicable for cards payments only. - **/ + * + * Summary: Fetch active payment gateway for card payments + * Description: Use this API to retrieve an active payment aggregator along with the Customer ID. This is applicable for cards payments only. + **/ public func getActiveCardAggregator( refresh: Bool?, - + onResponse: @escaping (_ response: ActiveCardPaymentGatewayResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = refresh { - - xQuery["refresh"] = value - -} + var xQuery: [String: Any] = [:] + if let value = refresh { + xQuery["refresh"] = value + } - - + var fullUrl = relativeUrls["getActiveCardAggregator"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/payment/v1.0/card/aggregator", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8967,54 +8221,46 @@ if let value = refresh { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ActiveCardPaymentGatewayResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Fetch the list of cards saved by the user - * Description: Use this API to retrieve a list of cards stored by user from an active payment gateway. - **/ + * + * Summary: Fetch the list of cards saved by the user + * Description: Use this API to retrieve a list of cards stored by user from an active payment gateway. + **/ public func getActiveUserCards( forceRefresh: Bool?, - + onResponse: @escaping (_ response: ListCardsResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = forceRefresh { - - xQuery["force_refresh"] = value - -} + var xQuery: [String: Any] = [:] + if let value = forceRefresh { + xQuery["force_refresh"] = value + } - - + var fullUrl = relativeUrls["getActiveUserCards"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/payment/v1.0/cards", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9022,46 +8268,39 @@ if let value = forceRefresh { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ListCardsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Delete a card - * Description: Use this API to delete a card added by a user on the payment gateway and clear the cache. - **/ + * + * Summary: Delete a card + * Description: Use this API to delete a card added by a user on the payment gateway and clear the cache. + **/ public func deleteUserCard( body: DeletehCardRequest, onResponse: @escaping (_ response: DeleteCardsResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["deleteUserCard"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/payment/v1.0/card/remove", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9069,46 +8308,39 @@ if let value = forceRefresh { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DeleteCardsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Validate customer for payment - * Description: Use this API to check if the customer is eligible to use credit-line facilities such as Simpl Pay Later and Rupifi. - **/ + * + * Summary: Validate customer for payment + * Description: Use this API to check if the customer is eligible to use credit-line facilities such as Simpl Pay Later and Rupifi. + **/ public func verifyCustomerForPayment( body: ValidateCustomerRequest, onResponse: @escaping (_ response: ValidateCustomerResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["verifyCustomerForPayment"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/payment/v1.0/payment/customer/validation", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9116,46 +8348,39 @@ if let value = forceRefresh { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ValidateCustomerResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Verify and charge payment - * Description: Use this API to verify and check the status of a payment transaction (server-to-server) made through aggregators like Simpl and Mswipe. - **/ + * + * Summary: Verify and charge payment + * Description: Use this API to verify and check the status of a payment transaction (server-to-server) made through aggregators like Simpl and Mswipe. + **/ public func verifyAndChargePayment( body: ChargeCustomerRequest, onResponse: @escaping (_ response: ChargeCustomerResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["verifyAndChargePayment"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/payment/v1.0/payment/confirm/charge", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9163,46 +8388,39 @@ if let value = forceRefresh { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ChargeCustomerResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Initialize a payment (server-to-server) for UPI and BharatQR - * Description: PUse this API to inititate payment using UPI, BharatQR, wherein the UPI requests are send to the app and QR code is displayed on the screen. - **/ + * + * Summary: Initialize a payment (server-to-server) for UPI and BharatQR + * Description: PUse this API to inititate payment using UPI, BharatQR, wherein the UPI requests are send to the app and QR code is displayed on the screen. + **/ public func initialisePayment( body: PaymentInitializationRequest, onResponse: @escaping (_ response: PaymentInitializationResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["initialisePayment"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/payment/v1.0/payment/request", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9210,46 +8428,39 @@ if let value = forceRefresh { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PaymentInitializationResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Performs continuous polling to check status of payment on the server - * Description: Use this API to perform continuous polling at intervals to check the status of payment until timeout. - **/ + * + * Summary: Performs continuous polling to check status of payment on the server + * Description: Use this API to perform continuous polling at intervals to check the status of payment until timeout. + **/ public func checkAndUpdatePaymentStatus( body: PaymentStatusUpdateRequest, onResponse: @escaping (_ response: PaymentStatusUpdateResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["checkAndUpdatePaymentStatus"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/payment/v1.0/payment/confirm/polling", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9257,27 +8468,24 @@ if let value = forceRefresh { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PaymentStatusUpdateResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get applicable payment options - * Description: Use this API to get all valid payment options for doing a payment. - **/ + * + * Summary: Get applicable payment options + * Description: Use this API to get all valid payment options for doing a payment. + **/ public func getPaymentModeRoutes( amount: Int, cartId: String, @@ -9286,65 +8494,42 @@ if let value = forceRefresh { refresh: Bool?, cardReference: String?, userDetails: String?, - + onResponse: @escaping (_ response: PaymentModeRouteResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["amount"] = amount - - - - - xQuery["cart_id"] = cartId - - - - - xQuery["pincode"] = pincode - - - + var xQuery: [String: Any] = [:] - xQuery["checkout_mode"] = checkoutMode + xQuery["amount"] = amount + xQuery["cart_id"] = cartId + xQuery["pincode"] = pincode -if let value = refresh { - - xQuery["refresh"] = value - -} - - -if let value = cardReference { - - xQuery["card_reference"] = value - -} + xQuery["checkout_mode"] = checkoutMode + if let value = refresh { + xQuery["refresh"] = value + } -if let value = userDetails { - - xQuery["user_details"] = value - -} - + if let value = cardReference { + xQuery["card_reference"] = value + } - + if let value = userDetails { + xQuery["user_details"] = value + } + var fullUrl = relativeUrls["getPaymentModeRoutes"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/payment/v1.0/payment/options", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9352,27 +8537,24 @@ if let value = userDetails { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PaymentModeRouteResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get applicable payment options for Point-of-Sale (POS) - * Description: Use this API to get all valid payment options for doing a payment in POS. - **/ + * + * Summary: Get applicable payment options for Point-of-Sale (POS) + * Description: Use this API to get all valid payment options for doing a payment in POS. + **/ public func getPosPaymentModeRoutes( amount: Int, cartId: String, @@ -9382,70 +8564,44 @@ if let value = userDetails { cardReference: String?, orderType: String, userDetails: String?, - + onResponse: @escaping (_ response: PaymentModeRouteResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["amount"] = amount - - - - - xQuery["cart_id"] = cartId - - - - - xQuery["pincode"] = pincode - - - - - xQuery["checkout_mode"] = checkoutMode - - - -if let value = refresh { - - xQuery["refresh"] = value - -} - - -if let value = cardReference { - - xQuery["card_reference"] = value - -} + var xQuery: [String: Any] = [:] + xQuery["amount"] = amount + xQuery["cart_id"] = cartId - xQuery["order_type"] = orderType + xQuery["pincode"] = pincode + xQuery["checkout_mode"] = checkoutMode + if let value = refresh { + xQuery["refresh"] = value + } -if let value = userDetails { - - xQuery["user_details"] = value - -} + if let value = cardReference { + xQuery["card_reference"] = value + } + xQuery["order_type"] = orderType - + if let value = userDetails { + xQuery["user_details"] = value + } + var fullUrl = relativeUrls["getPosPaymentModeRoutes"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/payment/v1.0/payment/options/pos", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9453,46 +8609,38 @@ if let value = userDetails { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PaymentModeRouteResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get CreditLine Offer - * Description: Get CreditLine Offer if user is tentatively approved by rupifi - **/ + * + * Summary: Get CreditLine Offer + * Description: Get CreditLine Offer if user is tentatively approved by rupifi + **/ public func getRupifiBannerDetails( - onResponse: @escaping (_ response: RupifiBannerResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getRupifiBannerDetails"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/payment/v1.0/rupifi/banner", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9500,46 +8648,38 @@ if let value = userDetails { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(RupifiBannerResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Lists the mode of refund - * Description: Use this API to retrieve eligible refund modes (such as Netbanking) and add the beneficiary details. - **/ + * + * Summary: Lists the mode of refund + * Description: Use this API to retrieve eligible refund modes (such as Netbanking) and add the beneficiary details. + **/ public func getActiveRefundTransferModes( - onResponse: @escaping (_ response: TransferModeResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getActiveRefundTransferModes"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/payment/v1.0/refund/transfer-mode", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9547,46 +8687,39 @@ if let value = userDetails { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TransferModeResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Enable/Disable a mode for transferring a refund - * Description: Activate or Deactivate Transfer Mode to collect Beneficiary Details for Refund - **/ + * + * Summary: Enable/Disable a mode for transferring a refund + * Description: Activate or Deactivate Transfer Mode to collect Beneficiary Details for Refund + **/ public func enableOrDisableRefundTransferMode( body: UpdateRefundTransferModeRequest, onResponse: @escaping (_ response: UpdateRefundTransferModeResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["enableOrDisableRefundTransferMode"] ?? "" ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/payment/v1.0/refund/transfer-mode", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9594,52 +8727,44 @@ if let value = userDetails { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateRefundTransferModeResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Lists the beneficiary of a refund - * Description: Use this API to get the details of all active beneficiary added by a user for refund. - **/ + * + * Summary: Lists the beneficiary of a refund + * Description: Use this API to get the details of all active beneficiary added by a user for refund. + **/ public func getUserBeneficiariesDetail( orderId: String, - + onResponse: @escaping (_ response: OrderBeneficiaryResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["order_id"] = orderId - + var xQuery: [String: Any] = [:] + xQuery["order_id"] = orderId - - + var fullUrl = relativeUrls["getUserBeneficiariesDetail"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/payment/v1.0/refund/user/beneficiary", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9647,54 +8772,46 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OrderBeneficiaryResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Verify IFSC Code - * Description: Use this API to check whether the 11-digit IFSC code is valid and to fetch the bank details for refund. - **/ + * + * Summary: Verify IFSC Code + * Description: Use this API to check whether the 11-digit IFSC code is valid and to fetch the bank details for refund. + **/ public func verifyIfscCode( ifscCode: String?, - + onResponse: @escaping (_ response: IfscCodeResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = ifscCode { - - xQuery["ifsc_code"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = ifscCode { + xQuery["ifsc_code"] = value + } + var fullUrl = relativeUrls["verifyIfscCode"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/payment/v1.0/ifsc-code/verify", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9702,52 +8819,44 @@ if let value = ifscCode { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(IfscCodeResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Lists the beneficiary of a refund - * Description: Use this API to get the details of all active beneficiary added by a user for refund. - **/ + * + * Summary: Lists the beneficiary of a refund + * Description: Use this API to get the details of all active beneficiary added by a user for refund. + **/ public func getOrderBeneficiariesDetail( orderId: String, - + onResponse: @escaping (_ response: OrderBeneficiaryResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["order_id"] = orderId - + var xQuery: [String: Any] = [:] + xQuery["order_id"] = orderId - - + var fullUrl = relativeUrls["getOrderBeneficiariesDetail"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/payment/v1.0/refund/order/beneficiaries", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9755,46 +8864,39 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OrderBeneficiaryResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Verify the beneficiary details using OTP - * Description: Use this API to perform an OTP validation before saving the beneficiary details added for a refund. - **/ + * + * Summary: Verify the beneficiary details using OTP + * Description: Use this API to perform an OTP validation before saving the beneficiary details added for a refund. + **/ public func verifyOtpAndAddBeneficiaryForBank( body: AddBeneficiaryViaOtpVerificationRequest, onResponse: @escaping (_ response: AddBeneficiaryViaOtpVerificationResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["verifyOtpAndAddBeneficiaryForBank"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/payment/v1.0/refund/verification/bank", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9802,46 +8904,39 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AddBeneficiaryViaOtpVerificationResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Save bank details for cancelled/returned order - * Description: Use this API to save the bank details for a returned or cancelled order to refund the amount. - **/ + * + * Summary: Save bank details for cancelled/returned order + * Description: Use this API to save the bank details for a returned or cancelled order to refund the amount. + **/ public func addBeneficiaryDetails( body: AddBeneficiaryDetailsRequest, onResponse: @escaping (_ response: RefundAccountResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["addBeneficiaryDetails"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/payment/v1.0/refund/account", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9849,46 +8944,39 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(RefundAccountResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Save bank details for cancelled/returned order - * Description: Use this API to save bank details for returned/cancelled order to refund amount in his account. - **/ + * + * Summary: Save bank details for cancelled/returned order + * Description: Use this API to save bank details for returned/cancelled order to refund amount in his account. + **/ public func addRefundBankAccountUsingOTP( body: AddBeneficiaryDetailsOTPRequest, onResponse: @escaping (_ response: RefundAccountResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["addRefundBankAccountUsingOTP"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/payment/v1.0/refund/account/otp", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9896,46 +8984,39 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(RefundAccountResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Send OTP on adding a wallet beneficiary - * Description: Use this API to send an OTP while adding a wallet beneficiary by mobile no. verification. - **/ + * + * Summary: Send OTP on adding a wallet beneficiary + * Description: Use this API to send an OTP while adding a wallet beneficiary by mobile no. verification. + **/ public func verifyOtpAndAddBeneficiaryForWallet( body: WalletOtpRequest, onResponse: @escaping (_ response: WalletOtpResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["verifyOtpAndAddBeneficiaryForWallet"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/payment/v1.0/refund/verification/wallet", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9943,46 +9024,39 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(WalletOtpResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Set a default beneficiary for a refund - * Description: Use this API to set a default beneficiary for getting a refund. - **/ + * + * Summary: Set a default beneficiary for a refund + * Description: Use this API to set a default beneficiary for getting a refund. + **/ public func updateDefaultBeneficiary( body: SetDefaultBeneficiaryRequest, onResponse: @escaping (_ response: SetDefaultBeneficiaryResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["updateDefaultBeneficiary"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/payment/v1.0/refund/beneficiary/default", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9990,98 +9064,104 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SetDefaultBeneficiaryResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - + public class Order { - var config: ApplicationConfig + var relativeUrls = [String: String]() init(config: ApplicationConfig) { - self.config = config; + self.config = config + var ulrs = [String: String]() + + ulrs["getOrders"] = config.domain.appendAsPath("/service/application/order/v1.0/orders") + + ulrs["getOrderById"] = config.domain.appendAsPath("/service/application/order/v1.0/orders/{order_id}") + + ulrs["getShipmentById"] = config.domain.appendAsPath("/service/application/order/v1.0/orders/shipments/{shipment_id}") + + ulrs["getShipmentReasons"] = config.domain.appendAsPath("/service/application/order/v1.0/orders/shipments/{shipment_id}/reasons") + + ulrs["updateShipmentStatus"] = config.domain.appendAsPath("/service/application/order/v1.0/orders/shipments/{shipment_id}/status") + + ulrs["trackShipment"] = config.domain.appendAsPath("/service/application/order/v1.0/orders/shipments/{shipment_id}/track") + + ulrs["getPosOrderById"] = config.domain.appendAsPath("/service/application/order/v1.0/orders/pos-order/{order_id}") + + ulrs["getCustomerDetailsByShipmentId"] = config.domain.appendAsPath("/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/customer-details") + + ulrs["sendOtpToShipmentCustomer"] = config.domain.appendAsPath("/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/otp/send/") + + ulrs["verifyOtpShipmentCustomer"] = config.domain.appendAsPath("/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/otp/verify") + + self.relativeUrls = ulrs } - - - + + public func update(updatedUrl: [String: String]) { + for (key, value) in updatedUrl { + self.relativeUrls[key] = value + } + } + /** - * - * Summary: Get all orders - * Description: Use this API to retrieve all the orders. - **/ + * + * Summary: Get all orders + * Description: Use this API to retrieve all the orders. + **/ public func getOrders( pageNo: Int?, pageSize: Int?, fromDate: String?, toDate: String?, status: Int?, - + onResponse: @escaping (_ response: OrderList?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = fromDate { - - xQuery["from_date"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = toDate { - - xQuery["to_date"] = value - -} + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } -if let value = status { - - xQuery["status"] = value - -} + if let value = fromDate { + xQuery["from_date"] = value + } + if let value = toDate { + xQuery["to_date"] = value + } - + if let value = status { + xQuery["status"] = value + } + var fullUrl = relativeUrls["getOrders"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/order/v1.0/orders", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10089,47 +9169,42 @@ if let value = status { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OrderList.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get details of an order - * Description: Use this API to retrieve order details such as tracking details, shipment, store information using Fynd Order ID. - **/ + * + * Summary: Get details of an order + * Description: Use this API to retrieve order details such as tracking details, shipment, store information using Fynd Order ID. + **/ public func getOrderById( orderId: String, - + onResponse: @escaping (_ response: OrderById?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getOrderById"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "order_id" + "}", with: "\(orderId)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/order/v1.0/orders/\(orderId)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10137,47 +9212,42 @@ if let value = status { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OrderById.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get details of a shipment - * Description: Use this API to retrieve shipment details such as price breakup, tracking details, store information, etc. using Shipment ID. - **/ + * + * Summary: Get details of a shipment + * Description: Use this API to retrieve shipment details such as price breakup, tracking details, store information, etc. using Shipment ID. + **/ public func getShipmentById( shipmentId: String, - + onResponse: @escaping (_ response: ShipmentById?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getShipmentById"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "shipment_id" + "}", with: "\(shipmentId)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/order/v1.0/orders/shipments/\(shipmentId)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10185,47 +9255,42 @@ if let value = status { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ShipmentById.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get reasons behind full or partial cancellation of a shipment - * Description: Use this API to retrieve the issues that led to the cancellation of bags within a shipment. - **/ + * + * Summary: Get reasons behind full or partial cancellation of a shipment + * Description: Use this API to retrieve the issues that led to the cancellation of bags within a shipment. + **/ public func getShipmentReasons( shipmentId: String, - + onResponse: @escaping (_ response: ShipmentReasons?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getShipmentReasons"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "shipment_id" + "}", with: "\(shipmentId)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/order/v1.0/orders/shipments/\(shipmentId)/reasons", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10233,47 +9298,42 @@ if let value = status { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ShipmentReasons.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Update the shipment status - * Description: Use this API to update the status of a shipment using its shipment ID. - **/ + * + * Summary: Update the shipment status + * Description: Use this API to update the status of a shipment using its shipment ID. + **/ public func updateShipmentStatus( shipmentId: String, body: ShipmentStatusUpdateBody, onResponse: @escaping (_ response: ShipmentStatusUpdate?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["updateShipmentStatus"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "shipment_id" + "}", with: "\(shipmentId)") ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/order/v1.0/orders/shipments/\(shipmentId)/status", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10281,47 +9341,42 @@ if let value = status { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ShipmentStatusUpdate.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Track shipment - * Description: Use this API to track a shipment using its shipment ID. - **/ + * + * Summary: Track shipment + * Description: Use this API to track a shipment using its shipment ID. + **/ public func trackShipment( shipmentId: String, - + onResponse: @escaping (_ response: ShipmentTrack?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["trackShipment"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "shipment_id" + "}", with: "\(shipmentId)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/order/v1.0/orders/shipments/\(shipmentId)/track", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10329,47 +9384,42 @@ if let value = status { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ShipmentTrack.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get POS Order - * Description: Use this API to retrieve a POS order and all its details such as tracking details, shipment, store information using Fynd Order ID. - **/ + * + * Summary: Get POS Order + * Description: Use this API to retrieve a POS order and all its details such as tracking details, shipment, store information using Fynd Order ID. + **/ public func getPosOrderById( orderId: String, - + onResponse: @escaping (_ response: PosOrderById?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getPosOrderById"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "order_id" + "}", with: "\(orderId)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/order/v1.0/orders/pos-order/\(orderId)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10377,48 +9427,45 @@ if let value = status { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PosOrderById.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get Customer Details by Shipment Id - * Description: Use this API to retrieve customer details such as mobileno using Shipment ID. - **/ + * + * Summary: Get Customer Details by Shipment Id + * Description: Use this API to retrieve customer details such as mobileno using Shipment ID. + **/ public func getCustomerDetailsByShipmentId( orderId: String, shipmentId: String, - + onResponse: @escaping (_ response: CustomerDetailsByShipmentId?, _ error: FDKError?) -> Void ) { - - + var fullUrl = relativeUrls["getCustomerDetailsByShipmentId"] ?? "" - + fullUrl = fullUrl.replacingOccurrences(of: "{" + "order_id" + "}", with: "\(orderId)") + fullUrl = fullUrl.replacingOccurrences(of: "{" + "shipment_id" + "}", with: "\(shipmentId)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/order/v1.0/orders/\(orderId)/shipments/\(shipmentId)/customer-details", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10426,48 +9473,45 @@ if let value = status { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CustomerDetailsByShipmentId.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Send and Resend Otp code to Order-Shipment customer - * Description: Use this API to send OTP to the customer of the mapped Shipment. - **/ + * + * Summary: Send and Resend Otp code to Order-Shipment customer + * Description: Use this API to send OTP to the customer of the mapped Shipment. + **/ public func sendOtpToShipmentCustomer( orderId: String, shipmentId: String, - + onResponse: @escaping (_ response: sendOTPApplicationResponse?, _ error: FDKError?) -> Void ) { - - + var fullUrl = relativeUrls["sendOtpToShipmentCustomer"] ?? "" - + fullUrl = fullUrl.replacingOccurrences(of: "{" + "order_id" + "}", with: "\(orderId)") + fullUrl = fullUrl.replacingOccurrences(of: "{" + "shipment_id" + "}", with: "\(shipmentId)") ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/order/v1.0/orders/\(orderId)/shipments/\(shipmentId)/otp/send/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10475,48 +9519,45 @@ if let value = status { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(sendOTPApplicationResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Verify Otp code - * Description: Use this API to verify OTP and create a session token with custom payload. - **/ + * + * Summary: Verify Otp code + * Description: Use this API to verify OTP and create a session token with custom payload. + **/ public func verifyOtpShipmentCustomer( orderId: String, shipmentId: String, body: ReqBodyVerifyOTPShipment, onResponse: @escaping (_ response: ResponseVerifyOTPShipment?, _ error: FDKError?) -> Void ) { - - + var fullUrl = relativeUrls["verifyOtpShipmentCustomer"] ?? "" - + fullUrl = fullUrl.replacingOccurrences(of: "{" + "order_id" + "}", with: "\(orderId)") + fullUrl = fullUrl.replacingOccurrences(of: "{" + "shipment_id" + "}", with: "\(shipmentId)") ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/order/v1.0/orders/\(orderId)/shipments/\(shipmentId)/otp/verify", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10524,58 +9565,71 @@ if let value = status { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ResponseVerifyOTPShipment.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) + } + } + + public class Rewards { + var config: ApplicationConfig + var relativeUrls = [String: String]() + + init(config: ApplicationConfig) { + self.config = config + var ulrs = [String: String]() + + ulrs["getPointsOnProduct"] = config.domain.appendAsPath("/service/application/rewards/v1.0/catalogue/offer/order/") + + ulrs["getOfferByName"] = config.domain.appendAsPath("/service/application/rewards/v1.0/offers/{name}/") + + ulrs["getOrderDiscount"] = config.domain.appendAsPath("/service/application/rewards/v1.0/user/offers/order-discount/") + + ulrs["getUserPoints"] = config.domain.appendAsPath("/service/application/rewards/v1.0/user/points/") + + ulrs["getUserPointsHistory"] = config.domain.appendAsPath("/service/application/rewards/v1.0/user/points/history/") + + ulrs["getUserReferralDetails"] = config.domain.appendAsPath("/service/application/rewards/v1.0/user/referral/") + + ulrs["redeemReferralCode"] = config.domain.appendAsPath("/service/application/rewards/v1.0/user/referral/redeem/") + + self.relativeUrls = ulrs } - - - } - - - - public class Rewards { - - var config: ApplicationConfig - init(config: ApplicationConfig) { - self.config = config; + public func update(updatedUrl: [String: String]) { + for (key, value) in updatedUrl { + self.relativeUrls[key] = value + } } - - - + /** - * - * Summary: Get the eligibility of reward points on a product - * Description: Use this API to evaluate the amount of reward points that could be earned on any catalogue product. - **/ + * + * Summary: Get the eligibility of reward points on a product + * Description: Use this API to evaluate the amount of reward points that could be earned on any catalogue product. + **/ public func getPointsOnProduct( body: CatalogueOrderRequest, onResponse: @escaping (_ response: CatalogueOrderResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getPointsOnProduct"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/rewards/v1.0/catalogue/offer/order/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10583,47 +9637,42 @@ if let value = status { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CatalogueOrderResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get offer by name - * Description: Use this API to get the offer details and configuration by entering the name of the offer. - **/ + * + * Summary: Get offer by name + * Description: Use this API to get the offer details and configuration by entering the name of the offer. + **/ public func getOfferByName( name: String, - + onResponse: @escaping (_ response: Offer?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getOfferByName"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "name" + "}", with: "\(name)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/rewards/v1.0/offers/\(name)/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10631,46 +9680,39 @@ if let value = status { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Offer.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Calculates the discount on order-amount - * Description: Use this API to calculate the discount on order-amount based on all the amount range configured in order_discount. - **/ + * + * Summary: Calculates the discount on order-amount + * Description: Use this API to calculate the discount on order-amount based on all the amount range configured in order_discount. + **/ public func getOrderDiscount( body: OrderDiscountRequest, onResponse: @escaping (_ response: OrderDiscountResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getOrderDiscount"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/rewards/v1.0/user/offers/order-discount/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10678,46 +9720,38 @@ if let value = status { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OrderDiscountResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get reward points available with a user - * Description: Use this API to retrieve total available points of a user for current application - **/ + * + * Summary: Get reward points available with a user + * Description: Use this API to retrieve total available points of a user for current application + **/ public func getUserPoints( - onResponse: @escaping (_ response: PointsResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getUserPoints"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/rewards/v1.0/user/points/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10725,62 +9759,51 @@ if let value = status { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PointsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get all transactions of reward points - * Description: Use this API to get a list of points transactions. The list of points history is paginated. - **/ + * + * Summary: Get all transactions of reward points + * Description: Use this API to get a list of points transactions. The list of points history is paginated. + **/ public func getUserPointsHistory( pageId: String?, pageSize: Int?, - + onResponse: @escaping (_ response: PointsHistoryResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageId { - - xQuery["page_id"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageId { + xQuery["page_id"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + var fullUrl = relativeUrls["getUserPointsHistory"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/rewards/v1.0/user/points/history/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10788,90 +9811,66 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PointsHistoryResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - + /** - * - * Summary: get paginator for getUserPointsHistory - * Description: fetch the next page by calling .next(...) function - **/ + * + * Summary: get paginator for getUserPointsHistory + * Description: fetch the next page by calling .next(...) function + **/ public func getUserPointsHistoryPaginator( pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "cursor") paginator.onPage = { self.getUserPointsHistory( - - pageId: paginator.pageId - , - pageSize: paginator.pageSize - - ) { response, error in + pageId: paginator.pageId, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageId = response.page?.nextId - } paginator.onNext?(response, error) } } return paginator } - - - - + /** - * - * Summary: Get referral details of a user - * Description: Use this API to retrieve the referral details a user has configured in the application. - **/ + * + * Summary: Get referral details of a user + * Description: Use this API to retrieve the referral details a user has configured in the application. + **/ public func getUserReferralDetails( - onResponse: @escaping (_ response: ReferralDetailsResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getUserReferralDetails"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/rewards/v1.0/user/referral/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10879,46 +9878,39 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ReferralDetailsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Redeems a referral code and credits reward points to users - * Description: Use this API to enter a referral code following which, the configured points would be credited to a user's reward points account. - **/ + * + * Summary: Redeems a referral code and credits reward points to users + * Description: Use this API to enter a referral code following which, the configured points would be credited to a user's reward points account. + **/ public func redeemReferralCode( body: RedeemReferralCodeRequest, onResponse: @escaping (_ response: RedeemReferralCodeResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["redeemReferralCode"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/rewards/v1.0/user/referral/redeem/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10926,58 +9918,109 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(RedeemReferralCodeResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - + public class Feedback { - var config: ApplicationConfig + var relativeUrls = [String: String]() init(config: ApplicationConfig) { - self.config = config; + self.config = config + var ulrs = [String: String]() + + ulrs["createAbuseReport"] = config.domain.appendAsPath("/service/application/feedback/v1.0/abuse/") + + ulrs["updateAbuseReport"] = config.domain.appendAsPath("/service/application/feedback/v1.0/abuse/") + + ulrs["getAbuseReports"] = config.domain.appendAsPath("/service/application/feedback/v1.0/abuse/entity/{entity_type}/entity-id/{entity_id}") + + ulrs["getAttributes"] = config.domain.appendAsPath("/service/application/feedback/v1.0/attributes/") + + ulrs["createAttribute"] = config.domain.appendAsPath("/service/application/feedback/v1.0/attributes/") + + ulrs["getAttribute"] = config.domain.appendAsPath("/service/application/feedback/v1.0/attributes/{slug}") + + ulrs["updateAttribute"] = config.domain.appendAsPath("/service/application/feedback/v1.0/attributes/{slug}") + + ulrs["createComment"] = config.domain.appendAsPath("/service/application/feedback/v1.0/comment/") + + ulrs["updateComment"] = config.domain.appendAsPath("/service/application/feedback/v1.0/comment/") + + ulrs["getComments"] = config.domain.appendAsPath("/service/application/feedback/v1.0/comment/entity/{entity_type}") + + ulrs["checkEligibility"] = config.domain.appendAsPath("/service/application/feedback/v1.0/config/entity/{entity_type}/entity-id/{entity_id}") + + ulrs["deleteMedia"] = config.domain.appendAsPath("/service/application/feedback/v1.0/media/") + + ulrs["createMedia"] = config.domain.appendAsPath("/service/application/feedback/v1.0/media/") + + ulrs["updateMedia"] = config.domain.appendAsPath("/service/application/feedback/v1.0/media/") + + ulrs["getMedias"] = config.domain.appendAsPath("/service/application/feedback/v1.0/media/entity/{entity_type}/entity-id/{entity_id}") + + ulrs["getReviewSummaries"] = config.domain.appendAsPath("/service/application/feedback/v1.0/rating/summary/entity/{entity_type}/entity-id/{entity_id}") + + ulrs["createReview"] = config.domain.appendAsPath("/service/application/feedback/v1.0/review/") + + ulrs["updateReview"] = config.domain.appendAsPath("/service/application/feedback/v1.0/review/") + + ulrs["getReviews"] = config.domain.appendAsPath("/service/application/feedback/v1.0/review/entity/{entity_type}/entity-id/{entity_id}") + + ulrs["getTemplates"] = config.domain.appendAsPath("/service/application/feedback/v1.0/template/") + + ulrs["createQuestion"] = config.domain.appendAsPath("/service/application/feedback/v1.0/template/qna/") + + ulrs["updateQuestion"] = config.domain.appendAsPath("/service/application/feedback/v1.0/template/qna/") + + ulrs["getQuestionAndAnswers"] = config.domain.appendAsPath("/service/application/feedback/v1.0/template/qna/entity/{entity_type}/entity-id/{entity_id}") + + ulrs["getVotes"] = config.domain.appendAsPath("/service/application/feedback/v1.0/vote/") + + ulrs["createVote"] = config.domain.appendAsPath("/service/application/feedback/v1.0/vote/") + + ulrs["updateVote"] = config.domain.appendAsPath("/service/application/feedback/v1.0/vote/") + + self.relativeUrls = ulrs } - - - + + public func update(updatedUrl: [String: String]) { + for (key, value) in updatedUrl { + self.relativeUrls[key] = value + } + } + /** - * - * Summary: Post a new abuse request - * Description: Use this API to report a specific entity (question/review/comment) for abuse. - **/ + * + * Summary: Post a new abuse request + * Description: Use this API to report a specific entity (question/review/comment) for abuse. + **/ public func createAbuseReport( body: ReportAbuseRequest, onResponse: @escaping (_ response: InsertResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["createAbuseReport"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/feedback/v1.0/abuse/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10985,46 +10028,39 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(InsertResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Update abuse details - * Description: Use this API to update the abuse details, i.e. status and description. - **/ + * + * Summary: Update abuse details + * Description: Use this API to update the abuse details, i.e. status and description. + **/ public func updateAbuseReport( body: UpdateAbuseStatusRequest, onResponse: @escaping (_ response: UpdateResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["updateAbuseReport"] ?? "" ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/feedback/v1.0/abuse/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11032,72 +10068,62 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get a list of abuse data - * Description: Use this API to retrieve a list of abuse data from entity type and entity ID. - **/ + * + * Summary: Get a list of abuse data + * Description: Use this API to retrieve a list of abuse data from entity type and entity ID. + **/ public func getAbuseReports( entityId: String, entityType: String, id: String?, pageId: String?, pageSize: Int?, - + onResponse: @escaping (_ response: ReportAbuseGetResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = pageId { - - xQuery["page_id"] = value - -} + if let value = id { + xQuery["id"] = value + } + if let value = pageId { + xQuery["page_id"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = pageSize { + xQuery["page_size"] = value + } + var fullUrl = relativeUrls["getAbuseReports"] ?? "" - + fullUrl = fullUrl.replacingOccurrences(of: "{" + "entity_id" + "}", with: "\(entityId)") + fullUrl = fullUrl.replacingOccurrences(of: "{" + "entity_type" + "}", with: "\(entityType)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/feedback/v1.0/abuse/entity/\(entityType)/entityId/\(entityId)", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11105,124 +10131,85 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ReportAbuseGetResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getAbuseReports - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getAbuseReports + * Description: fetch the next page by calling .next(...) function + **/ public func getAbuseReportsPaginator( entityId: String, entityType: String, id: String?, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "cursor") paginator.onPage = { self.getAbuseReports( - - entityId: entityId, - entityType: entityType, - id: id, - pageId: paginator.pageId - , - pageSize: paginator.pageSize - - ) { response, error in + entityId: entityId, + entityType: entityType, + id: id, + pageId: paginator.pageId, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageId = response.page?.nextId - } paginator.onNext?(response, error) } } return paginator } - - - - + /** - * - * Summary: Get a list of attribute data - * Description: Use this API to retrieve a list of all attribute data, e.g. quality, material, product fitting, packaging, etc. - **/ + * + * Summary: Get a list of attribute data + * Description: Use this API to retrieve a list of all attribute data, e.g. quality, material, product fitting, packaging, etc. + **/ public func getAttributes( pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: AttributeResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + var fullUrl = relativeUrls["getAttributes"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/feedback/v1.0/attributes/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11230,52 +10217,37 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AttributeResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - + /** - * - * Summary: get paginator for getAttributes - * Description: fetch the next page by calling .next(...) function - **/ + * + * Summary: get paginator for getAttributes + * Description: fetch the next page by calling .next(...) function + **/ public func getAttributesPaginator( pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getAttributes( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -11285,34 +10257,27 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Add a new attribute request - * Description: Use this API to add a new attribute (e.g. product quality/material/value for money) with its name, slug and description. - **/ + * + * Summary: Add a new attribute request + * Description: Use this API to add a new attribute (e.g. product quality/material/value for money) with its name, slug and description. + **/ public func createAttribute( body: SaveAttributeRequest, onResponse: @escaping (_ response: InsertResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["createAttribute"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/feedback/v1.0/attributes/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11320,47 +10285,42 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(InsertResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get data of a single attribute - * Description: Use this API to retrieve a single attribute data from a given slug. - **/ + * + * Summary: Get data of a single attribute + * Description: Use this API to retrieve a single attribute data from a given slug. + **/ public func getAttribute( slug: String, - + onResponse: @escaping (_ response: Attribute?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getAttribute"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/feedback/v1.0/attributes/\(slug)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11368,47 +10328,42 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Attribute.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Update details of an attribute - * Description: Use this API update the attribute's name and description. - **/ + * + * Summary: Update details of an attribute + * Description: Use this API update the attribute's name and description. + **/ public func updateAttribute( slug: String, body: UpdateAttributeRequest, onResponse: @escaping (_ response: UpdateResponse?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["updateAttribute"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "slug" + "}", with: "\(slug)") ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/feedback/v1.0/attributes/\(slug)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11416,46 +10371,39 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Post a new comment - * Description: Use this API to add a new comment for a specific entity. - **/ + * + * Summary: Post a new comment + * Description: Use this API to add a new comment for a specific entity. + **/ public func createComment( body: CommentRequest, onResponse: @escaping (_ response: InsertResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["createComment"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/feedback/v1.0/comment/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11463,46 +10411,39 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(InsertResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Update the status of a comment - * Description: Use this API to update the comment status (active or approve) along with new comment if any. - **/ + * + * Summary: Update the status of a comment + * Description: Use this API to update the comment status (active or approve) along with new comment if any. + **/ public func updateComment( body: UpdateCommentRequest, onResponse: @escaping (_ response: UpdateResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["updateComment"] ?? "" ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/feedback/v1.0/comment/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11510,27 +10451,24 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get a list of comments - * Description: Use this API to retrieve a list of comments for a specific entity type, e.g. products. - **/ + * + * Summary: Get a list of comments + * Description: Use this API to retrieve a list of comments for a specific entity type, e.g. products. + **/ public func getComments( entityType: String, id: String?, @@ -11538,59 +10476,44 @@ if let value = pageSize { userId: String?, pageId: String?, pageSize: Int?, - + onResponse: @escaping (_ response: CommentGetResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - - -if let value = entityId { - - xQuery["entity_id"] = value - -} - - -if let value = userId { - - xQuery["user_id"] = value - -} + var xQuery: [String: Any] = [:] + if let value = id { + xQuery["id"] = value + } -if let value = pageId { - - xQuery["page_id"] = value - -} + if let value = entityId { + xQuery["entity_id"] = value + } + if let value = userId { + xQuery["user_id"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = pageId { + xQuery["page_id"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } - + var fullUrl = relativeUrls["getComments"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "entity_type" + "}", with: "\(entityType)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/feedback/v1.0/comment/entity/\(entityType)", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11598,116 +10521,81 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CommentGetResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getComments - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getComments + * Description: fetch the next page by calling .next(...) function + **/ public func getCommentsPaginator( entityType: String, id: String?, entityId: String?, userId: String?, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "cursor") paginator.onPage = { self.getComments( - - entityType: entityType, - id: id, - entityId: entityId, - userId: userId, - pageId: paginator.pageId - , - pageSize: paginator.pageSize - - ) { response, error in + entityType: entityType, + id: id, + entityId: entityId, + userId: userId, + pageId: paginator.pageId, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageId = response.page?.nextId - } paginator.onNext?(response, error) } } return paginator } - - - - + /** - * - * Summary: Checks eligibility to rate and review, and shows the cloud media configuration - * Description: Use this API to check whether an entity is eligible to be rated and reviewed. Moreover, it shows the cloud media configuration too. - **/ + * + * Summary: Checks eligibility to rate and review, and shows the cloud media configuration + * Description: Use this API to check whether an entity is eligible to be rated and reviewed. Moreover, it shows the cloud media configuration too. + **/ public func checkEligibility( entityType: String, entityId: String, - + onResponse: @escaping (_ response: CheckEligibilityResponse?, _ error: FDKError?) -> Void ) { - - + var fullUrl = relativeUrls["checkEligibility"] ?? "" - + fullUrl = fullUrl.replacingOccurrences(of: "{" + "entity_type" + "}", with: "\(entityType)") + fullUrl = fullUrl.replacingOccurrences(of: "{" + "entity_id" + "}", with: "\(entityId)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/feedback/v1.0/config/entity/\(entityType)/entityId/\(entityId)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11715,52 +10603,44 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CheckEligibilityResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Delete Media - * Description: Use this API to delete media for an entity ID. - **/ + * + * Summary: Delete Media + * Description: Use this API to delete media for an entity ID. + **/ public func deleteMedia( ids: [String], - + onResponse: @escaping (_ response: UpdateResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - + var xQuery: [String: Any] = [:] - xQuery["ids"] = ids - - - - + xQuery["ids"] = ids + var fullUrl = relativeUrls["deleteMedia"] ?? "" ApplicationAPIClient.execute( config: config, method: "delete", - url: "/service/application/feedback/v1.0/media/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11768,46 +10648,39 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Add Media - * Description: Use this API to add media to an entity, e.g. review. - **/ + * + * Summary: Add Media + * Description: Use this API to add media to an entity, e.g. review. + **/ public func createMedia( body: AddMediaListRequest, onResponse: @escaping (_ response: InsertResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["createMedia"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/feedback/v1.0/media/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11815,46 +10688,39 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(InsertResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Update Media - * Description: Use this API to update media (archive/approve) for an entity. - **/ + * + * Summary: Update Media + * Description: Use this API to update media (archive/approve) for an entity. + **/ public func updateMedia( body: UpdateMediaListRequest, onResponse: @escaping (_ response: UpdateResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["updateMedia"] ?? "" ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/feedback/v1.0/media/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11862,27 +10728,24 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get Media - * Description: Use this API to retrieve all media from an entity. - **/ + * + * Summary: Get Media + * Description: Use this API to retrieve all media from an entity. + **/ public func getMedias( entityType: String, entityId: String, @@ -11890,52 +10753,42 @@ var xQuery: [String: Any] = [:] type: String?, pageId: String?, pageSize: Int?, - + onResponse: @escaping (_ response: MediaGetResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - - -if let value = type { - - xQuery["type"] = value - -} + var xQuery: [String: Any] = [:] + if let value = id { + xQuery["id"] = value + } -if let value = pageId { - - xQuery["page_id"] = value - -} + if let value = type { + xQuery["type"] = value + } + if let value = pageId { + xQuery["page_id"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = pageSize { + xQuery["page_size"] = value + } + var fullUrl = relativeUrls["getMedias"] ?? "" - + fullUrl = fullUrl.replacingOccurrences(of: "{" + "entity_type" + "}", with: "\(entityType)") + fullUrl = fullUrl.replacingOccurrences(of: "{" + "entity_id" + "}", with: "\(entityId)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/feedback/v1.0/media/entity/\(entityType)/entityId/\(entityId)", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11943,140 +10796,98 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(MediaGetResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getMedias - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getMedias + * Description: fetch the next page by calling .next(...) function + **/ public func getMediasPaginator( entityType: String, entityId: String, id: String?, type: String?, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "cursor") paginator.onPage = { self.getMedias( - - entityType: entityType, - entityId: entityId, - id: id, - type: type, - pageId: paginator.pageId - , - pageSize: paginator.pageSize - - ) { response, error in + entityType: entityType, + entityId: entityId, + id: id, + type: type, + pageId: paginator.pageId, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageId = response.page?.nextId - } paginator.onNext?(response, error) } } return paginator } - - - - + /** - * - * Summary: Get a review summary - * Description: Review summary gives ratings and attribute metrics of a review per entity. Use this API to retrieve the following response data: review count, rating average. 'review metrics'/'attribute rating metrics' which contains name, type, average and count. - **/ + * + * Summary: Get a review summary + * Description: Review summary gives ratings and attribute metrics of a review per entity. Use this API to retrieve the following response data: review count, rating average. 'review metrics'/'attribute rating metrics' which contains name, type, average and count. + **/ public func getReviewSummaries( entityType: String, entityId: String, id: String?, pageId: String?, pageSize: Int?, - + onResponse: @escaping (_ response: ReviewMetricGetResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = pageId { - - xQuery["page_id"] = value - -} + if let value = id { + xQuery["id"] = value + } + if let value = pageId { + xQuery["page_id"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = pageSize { + xQuery["page_size"] = value + } + var fullUrl = relativeUrls["getReviewSummaries"] ?? "" - + fullUrl = fullUrl.replacingOccurrences(of: "{" + "entity_type" + "}", with: "\(entityType)") + fullUrl = fullUrl.replacingOccurrences(of: "{" + "entity_id" + "}", with: "\(entityId)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/feedback/v1.0/rating/summary/entity/\(entityType)/entityId/\(entityId)", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12084,108 +10895,73 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ReviewMetricGetResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getReviewSummaries - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getReviewSummaries + * Description: fetch the next page by calling .next(...) function + **/ public func getReviewSummariesPaginator( entityType: String, entityId: String, id: String?, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "cursor") paginator.onPage = { self.getReviewSummaries( - - entityType: entityType, - entityId: entityId, - id: id, - pageId: paginator.pageId - , - pageSize: paginator.pageSize - - ) { response, error in + entityType: entityType, + entityId: entityId, + id: id, + pageId: paginator.pageId, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageId = response.page?.nextId - } paginator.onNext?(response, error) } } return paginator } - - - - + /** - * - * Summary: Add customer reviews - * Description: Use this API to add customer reviews for a specific entity along with the following data: attributes rating, entity rating, title, description, media resources and template ID. - **/ + * + * Summary: Add customer reviews + * Description: Use this API to add customer reviews for a specific entity along with the following data: attributes rating, entity rating, title, description, media resources and template ID. + **/ public func createReview( body: UpdateReviewRequest, onResponse: @escaping (_ response: UpdateResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["createReview"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/feedback/v1.0/review/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12193,46 +10969,39 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Update customer reviews - * Description: Use this API to update customer reviews for a specific entity along with following data: attributes rating, entity rating, title, description, media resources and template ID. - **/ + * + * Summary: Update customer reviews + * Description: Use this API to update customer reviews for a specific entity along with following data: attributes rating, entity rating, title, description, media resources and template ID. + **/ public func updateReview( body: UpdateReviewRequest, onResponse: @escaping (_ response: UpdateResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["updateReview"] ?? "" ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/feedback/v1.0/review/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12240,27 +11009,24 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get list of customer reviews - * Description: Use this API to retrieve a list of customer reviews based on entity and filters provided. - **/ + * + * Summary: Get list of customer reviews + * Description: Use this API to retrieve a list of customer reviews based on entity and filters provided. + **/ public func getReviews( entityType: String, entityId: String, @@ -12275,101 +11041,70 @@ if let value = pageSize { approve: Bool?, pageId: String?, pageSize: Int?, - + onResponse: @escaping (_ response: ReviewGetResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - - -if let value = userId { - - xQuery["user_id"] = value - -} - - -if let value = media { - - xQuery["media"] = value - -} - - -if let value = rating { - - xQuery["rating"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = attributeRating { - - xQuery["attribute_rating"] = value - -} - - -if let value = facets { - - xQuery["facets"] = value - -} + if let value = id { + xQuery["id"] = value + } + if let value = userId { + xQuery["user_id"] = value + } -if let value = sort { - - xQuery["sort"] = value - -} + if let value = media { + xQuery["media"] = value + } + if let value = rating { + xQuery["rating"] = value + } -if let value = active { - - xQuery["active"] = value - -} + if let value = attributeRating { + xQuery["attribute_rating"] = value + } + if let value = facets { + xQuery["facets"] = value + } -if let value = approve { - - xQuery["approve"] = value - -} + if let value = sort { + xQuery["sort"] = value + } + if let value = active { + xQuery["active"] = value + } -if let value = pageId { - - xQuery["page_id"] = value - -} + if let value = approve { + xQuery["approve"] = value + } + if let value = pageId { + xQuery["page_id"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = pageSize { + xQuery["page_size"] = value + } + var fullUrl = relativeUrls["getReviews"] ?? "" - + fullUrl = fullUrl.replacingOccurrences(of: "{" + "entity_type" + "}", with: "\(entityType)") + fullUrl = fullUrl.replacingOccurrences(of: "{" + "entity_id" + "}", with: "\(entityId)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/feedback/v1.0/review/entity/\(entityType)/entityId/\(entityId)", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12377,82 +11112,24 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ReviewGetResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getReviews - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getReviews + * Description: fetch the next page by calling .next(...) function + **/ public func getReviewsPaginator( entityType: String, entityId: String, @@ -12466,91 +11143,75 @@ if let value = pageSize { active: Bool?, approve: Bool?, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "cursor") paginator.onPage = { self.getReviews( - - entityType: entityType, - entityId: entityId, - id: id, - userId: userId, - media: media, - rating: rating, - attributeRating: attributeRating, - facets: facets, - sort: sort, - active: active, - approve: approve, - pageId: paginator.pageId - , - pageSize: paginator.pageSize - - ) { response, error in + entityType: entityType, + entityId: entityId, + id: id, + userId: userId, + media: media, + rating: rating, + attributeRating: attributeRating, + facets: facets, + sort: sort, + active: active, + approve: approve, + pageId: paginator.pageId, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageId = response.page?.nextId - } paginator.onNext?(response, error) } } return paginator } - - - - + /** - * - * Summary: Get the feedback templates for a product or l3 - * Description: Use this API to retrieve the details of the following feedback template. order, delivered, application, seller, order, placed, product - **/ + * + * Summary: Get the feedback templates for a product or l3 + * Description: Use this API to retrieve the details of the following feedback template. order, delivered, application, seller, order, placed, product + **/ public func getTemplates( templateId: String?, entityId: String?, entityType: String?, - + onResponse: @escaping (_ response: TemplateGetResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = templateId { - - xQuery["template_id"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = entityId { - - xQuery["entity_id"] = value - -} - - -if let value = entityType { - - xQuery["entity_type"] = value - -} + if let value = templateId { + xQuery["template_id"] = value + } + if let value = entityId { + xQuery["entity_id"] = value + } - + if let value = entityType { + xQuery["entity_type"] = value + } + var fullUrl = relativeUrls["getTemplates"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/feedback/v1.0/template/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12558,46 +11219,39 @@ if let value = entityType { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TemplateGetResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Create a new question - * Description: Use this API to create a new question with following data- tags, text, type, choices for MCQ type questions, maximum length of answer. - **/ + * + * Summary: Create a new question + * Description: Use this API to create a new question with following data- tags, text, type, choices for MCQ type questions, maximum length of answer. + **/ public func createQuestion( body: CreateQNARequest, onResponse: @escaping (_ response: InsertResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["createQuestion"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/feedback/v1.0/template/qna/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12605,46 +11259,39 @@ if let value = entityType { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(InsertResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Update a question - * Description: Use this API to update the status of a question, its tags and its choices. - **/ + * + * Summary: Update a question + * Description: Use this API to update the status of a question, its tags and its choices. + **/ public func updateQuestion( body: UpdateQNARequest, onResponse: @escaping (_ response: UpdateResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["updateQuestion"] ?? "" ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/feedback/v1.0/template/qna/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12652,27 +11299,24 @@ if let value = entityType { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get a list of QnA - * Description: Use this API to retrieve a list of questions and answers for a given entity. - **/ + * + * Summary: Get a list of QnA + * Description: Use this API to retrieve a list of questions and answers for a given entity. + **/ public func getQuestionAndAnswers( entityType: String, entityId: String, @@ -12681,59 +11325,46 @@ if let value = entityType { showAnswer: Bool?, pageId: String?, pageSize: Int?, - + onResponse: @escaping (_ response: QNAGetResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = userId { - - xQuery["user_id"] = value - -} - - -if let value = showAnswer { - - xQuery["show_answer"] = value - -} + if let value = id { + xQuery["id"] = value + } + if let value = userId { + xQuery["user_id"] = value + } -if let value = pageId { - - xQuery["page_id"] = value - -} + if let value = showAnswer { + xQuery["show_answer"] = value + } + if let value = pageId { + xQuery["page_id"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = pageSize { + xQuery["page_size"] = value + } + var fullUrl = relativeUrls["getQuestionAndAnswers"] ?? "" - + fullUrl = fullUrl.replacingOccurrences(of: "{" + "entity_type" + "}", with: "\(entityType)") + fullUrl = fullUrl.replacingOccurrences(of: "{" + "entity_id" + "}", with: "\(entityId)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/feedback/v1.0/template/qna/entity/\(entityType)/entityId/\(entityId)", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12741,58 +11372,24 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(QNAGetResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getQuestionAndAnswers - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getQuestionAndAnswers + * Description: fetch the next page by calling .next(...) function + **/ public func getQuestionAndAnswersPaginator( entityType: String, entityId: String, @@ -12800,93 +11397,74 @@ if let value = pageSize { userId: String?, showAnswer: Bool?, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "cursor") paginator.onPage = { self.getQuestionAndAnswers( - - entityType: entityType, - entityId: entityId, - id: id, - userId: userId, - showAnswer: showAnswer, - pageId: paginator.pageId - , - pageSize: paginator.pageSize - - ) { response, error in + entityType: entityType, + entityId: entityId, + id: id, + userId: userId, + showAnswer: showAnswer, + pageId: paginator.pageId, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageId = response.page?.nextId - } paginator.onNext?(response, error) } } return paginator } - - - - + /** - * - * Summary: Get a list of votes - * Description: Use this API to retrieve a list of votes of a current logged in user. Votes can be filtered using `ref_type`, i.e. review | comment. - **/ + * + * Summary: Get a list of votes + * Description: Use this API to retrieve a list of votes of a current logged in user. Votes can be filtered using `ref_type`, i.e. review | comment. + **/ public func getVotes( id: String?, refType: String?, pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: VoteResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - - -if let value = refType { - - xQuery["ref_type"] = value - -} - - -if let value = pageNo { - - xQuery["page_no"] = value - -} + var xQuery: [String: Any] = [:] + if let value = id { + xQuery["id"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = refType { + xQuery["ref_type"] = value + } + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + var fullUrl = relativeUrls["getVotes"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/feedback/v1.0/vote/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12894,64 +11472,41 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(VoteResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getVotes - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getVotes + * Description: fetch the next page by calling .next(...) function + **/ public func getVotesPaginator( id: String?, refType: String?, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getVotes( - - id: id, - refType: refType, - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + id: id, + refType: refType, + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -12961,34 +11516,27 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Create a new vote - * Description: Use this API to create a new vote, where the action could be an upvote or a downvote. This is useful when you want to give a vote (say upvote) to a review (ref_type) of a product (entity_type). - **/ + * + * Summary: Create a new vote + * Description: Use this API to create a new vote, where the action could be an upvote or a downvote. This is useful when you want to give a vote (say upvote) to a review (ref_type) of a product (entity_type). + **/ public func createVote( body: VoteRequest, onResponse: @escaping (_ response: InsertResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["createVote"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/feedback/v1.0/vote/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12996,46 +11544,39 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(InsertResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Update a vote - * Description: Use this API to update a vote with a new action, i.e. either an upvote or a downvote. - **/ + * + * Summary: Update a vote + * Description: Use this API to update a vote with a new action, i.e. either an upvote or a downvote. + **/ public func updateVote( body: UpdateVoteRequest, onResponse: @escaping (_ response: UpdateResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["updateVote"] ?? "" ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/feedback/v1.0/vote/", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13043,90 +11584,133 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - + public class PosCart { - var config: ApplicationConfig + var relativeUrls = [String: String]() init(config: ApplicationConfig) { - self.config = config; + self.config = config + var ulrs = [String: String]() + + ulrs["getCart"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/detail") + + ulrs["getCartLastModified"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/detail") + + ulrs["addItems"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/detail") + + ulrs["updateCart"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/detail") + + ulrs["getItemCount"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/basic") + + ulrs["getCoupons"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/coupon") + + ulrs["applyCoupon"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/coupon") + + ulrs["removeCoupon"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/coupon") + + ulrs["getBulkDiscountOffers"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/bulk-price") + + ulrs["applyRewardPoints"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/redeem/points/") + + ulrs["getAddresses"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/address") + + ulrs["addAddress"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/address") + + ulrs["getAddressById"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/address/{id}") + + ulrs["updateAddress"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/address/{id}") + + ulrs["removeAddress"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/address/{id}") + + ulrs["selectAddress"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/select-address") + + ulrs["selectPaymentMode"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/payment") + + ulrs["validateCouponForPayment"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/payment/validate/") + + ulrs["getShipments"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/shipment") + + ulrs["updateShipments"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/shipment") + + ulrs["checkoutCart"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/checkout") + + ulrs["updateCartMeta"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/meta") + + ulrs["getAvailableDeliveryModes"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/available-delivery-mode") + + ulrs["getStoreAddressByUid"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/store-address") + + ulrs["getCartShareLink"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/share-cart") + + ulrs["getCartSharedItems"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/share-cart/{token}") + + ulrs["updateCartWithSharedItems"] = config.domain.appendAsPath("/service/application/pos/cart/v1.0/share-cart/{token}/{action}") + + self.relativeUrls = ulrs + } + + public func update(updatedUrl: [String: String]) { + for (key, value) in updatedUrl { + self.relativeUrls[key] = value + } } - - - + /** - * - * Summary: Fetch all items added to the cart - * Description: Use this API to get details of all the items added to a cart. - **/ + * + * Summary: Fetch all items added to the cart + * Description: Use this API to get details of all the items added to a cart. + **/ public func getCart( id: String?, i: Bool?, b: Bool?, assignCardId: Int?, - + onResponse: @escaping (_ response: CartDetailResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - - -if let value = i { - - xQuery["i"] = value - -} - - -if let value = b { - - xQuery["b"] = value - -} + var xQuery: [String: Any] = [:] + if let value = id { + xQuery["id"] = value + } -if let value = assignCardId { - - xQuery["assign_card_id"] = value - -} + if let value = i { + xQuery["i"] = value + } + if let value = b { + xQuery["b"] = value + } - + if let value = assignCardId { + xQuery["assign_card_id"] = value + } + var fullUrl = relativeUrls["getCart"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/pos/cart/v1.0/detail", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13134,54 +11718,46 @@ if let value = assignCardId { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Fetch last-modified timestamp - * Description: Use this API to fetch Last-Modified timestamp in header metadata. - **/ + * + * Summary: Fetch last-modified timestamp + * Description: Use this API to fetch Last-Modified timestamp in header metadata. + **/ public func getCartLastModified( id: String?, - + onResponse: @escaping (_ response: [String: Any]?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = id { + xQuery["id"] = value + } + var fullUrl = relativeUrls["getCartLastModified"] ?? "" ApplicationAPIClient.execute( config: config, method: "head", - url: "/service/application/pos/cart/v1.0/detail", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13189,62 +11765,51 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = data.dictionary - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Add items to cart - * Description: Use this API to add items to the cart. - **/ + * + * Summary: Add items to cart + * Description: Use this API to add items to the cart. + **/ public func addItems( i: Bool?, b: Bool?, body: AddCartRequest, onResponse: @escaping (_ response: AddCartDetailResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = i { - - xQuery["i"] = value - -} - - -if let value = b { - - xQuery["b"] = value - -} + var xQuery: [String: Any] = [:] + if let value = i { + xQuery["i"] = value + } - + if let value = b { + xQuery["b"] = value + } + var fullUrl = relativeUrls["addItems"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/pos/cart/v1.0/detail", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13252,27 +11817,24 @@ if let value = b { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AddCartDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Update items in the cart - * Description: Use this API to update items added to the cart with the help of a request object containing attributes like item_quantity and item_size. These attributes will be fetched from the following APIs

  • operation Operation for current api call. update_item for update items. remove_item for removing items.
  • item_id "/platform/content/v1/products/"
  • item_size "/platform/content/v1/products/{slug}/sizes/"
  • quantity item quantity (must be greater than or equal to 1)
  • article_id "/content​/v1​/products​/{identifier}​/sizes​/price​/"
  • item_index item position in the cart (must be greater than or equal to 0)
- **/ + * + * Summary: Update items in the cart + * Description:

Use this API to update items added to the cart with the help of a request object containing attributes like item_quantity and item_size. These attributes will be fetched from the following APIs

  • operation Operation for current api call. update_item for update items. remove_item for removing items.
  • item_id "/platform/content/v1/products/"
  • item_size "/platform/content/v1/products/:slug/sizes/"
  • quantity item quantity (must be greater than or equal to 1)
  • article_id "/content​/v1​/products​/:identifier​/sizes​/price​/"
  • item_index item position in the cart (must be greater than or equal to 0)
+ **/ public func updateCart( id: String?, i: Bool?, @@ -13280,42 +11842,31 @@ if let value = b { body: UpdateCartRequest, onResponse: @escaping (_ response: UpdateCartDetailResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} + var xQuery: [String: Any] = [:] + if let value = id { + xQuery["id"] = value + } -if let value = i { - - xQuery["i"] = value - -} - - -if let value = b { - - xQuery["b"] = value - -} - + if let value = i { + xQuery["i"] = value + } - + if let value = b { + xQuery["b"] = value + } + var fullUrl = relativeUrls["updateCart"] ?? "" ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/pos/cart/v1.0/detail", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13323,54 +11874,46 @@ if let value = b { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateCartDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Count items in the cart - * Description: Use this API to get the total number of items present in cart. - **/ + * + * Summary: Count items in the cart + * Description: Use this API to get the total number of items present in cart. + **/ public func getItemCount( id: String?, - + onResponse: @escaping (_ response: CartItemCountResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = id { - - xQuery["id"] = value - -} - - - + if let value = id { + xQuery["id"] = value + } + var fullUrl = relativeUrls["getItemCount"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/pos/cart/v1.0/basic", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13378,54 +11921,46 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartItemCountResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Fetch Coupon - * Description: Use this API to get a list of available coupons along with their details. - **/ + * + * Summary: Fetch Coupon + * Description: Use this API to get a list of available coupons along with their details. + **/ public func getCoupons( id: String?, - + onResponse: @escaping (_ response: GetCouponResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = id { - - xQuery["id"] = value - -} - - - + if let value = id { + xQuery["id"] = value + } + var fullUrl = relativeUrls["getCoupons"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/pos/cart/v1.0/coupon", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13433,78 +11968,61 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetCouponResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Apply Coupon - * Description: Use this API to apply coupons on items in the cart. - **/ + * + * Summary: Apply Coupon + * Description: Use this API to apply coupons on items in the cart. + **/ public func applyCoupon( i: Bool?, b: Bool?, - p: Bool?, - id: String?, - body: ApplyCouponRequest, - onResponse: @escaping (_ response: CartDetailResponse?, _ error: FDKError?) -> Void - ) { - -var xQuery: [String: Any] = [:] - -if let value = i { - - xQuery["i"] = value - -} - - -if let value = b { - - xQuery["b"] = value - -} - - -if let value = p { - - xQuery["p"] = value - -} + p: Bool?, + id: String?, + body: ApplyCouponRequest, + onResponse: @escaping (_ response: CartDetailResponse?, _ error: FDKError?) -> Void + ) { + var xQuery: [String: Any] = [:] + if let value = i { + xQuery["i"] = value + } -if let value = id { - - xQuery["id"] = value - -} + if let value = b { + xQuery["b"] = value + } + if let value = p { + xQuery["p"] = value + } - + if let value = id { + xQuery["id"] = value + } + var fullUrl = relativeUrls["applyCoupon"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/pos/cart/v1.0/coupon", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13512,54 +12030,46 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Remove Coupon Applied - * Description: Remove Coupon applied on the cart by passing uid in request body. - **/ + * + * Summary: Remove Coupon Applied + * Description: Remove Coupon applied on the cart by passing uid in request body. + **/ public func removeCoupon( id: String?, - + onResponse: @escaping (_ response: CartDetailResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} + var xQuery: [String: Any] = [:] + if let value = id { + xQuery["id"] = value + } - - + var fullUrl = relativeUrls["removeCoupon"] ?? "" ApplicationAPIClient.execute( config: config, method: "delete", - url: "/service/application/pos/cart/v1.0/coupon", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13567,78 +12077,61 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get discount offers based on quantity - * Description: Use this API to get a list of applicable offers along with current, next and best offer for given product. Either one of uid, item_id, slug should be present. - **/ + * + * Summary: Get discount offers based on quantity + * Description: Use this API to get a list of applicable offers along with current, next and best offer for given product. Either one of uid, item_id, slug should be present. + **/ public func getBulkDiscountOffers( itemId: Int?, articleId: String?, uid: Int?, slug: String?, - + onResponse: @escaping (_ response: BulkPriceResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = itemId { - - xQuery["item_id"] = value - -} - - -if let value = articleId { - - xQuery["article_id"] = value - -} - - -if let value = uid { - - xQuery["uid"] = value - -} + var xQuery: [String: Any] = [:] + if let value = itemId { + xQuery["item_id"] = value + } -if let value = slug { - - xQuery["slug"] = value - -} + if let value = articleId { + xQuery["article_id"] = value + } + if let value = uid { + xQuery["uid"] = value + } - + if let value = slug { + xQuery["slug"] = value + } + var fullUrl = relativeUrls["getBulkDiscountOffers"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/pos/cart/v1.0/bulk-price", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13646,27 +12139,24 @@ if let value = slug { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(BulkPriceResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Apply reward points at cart - * Description: Use this API to redeem a fixed no. of reward points by applying it to the cart. - **/ + * + * Summary: Apply reward points at cart + * Description: Use this API to redeem a fixed no. of reward points by applying it to the cart. + **/ public func applyRewardPoints( id: String?, i: Bool?, @@ -13674,42 +12164,31 @@ if let value = slug { body: RewardPointRequest, onResponse: @escaping (_ response: CartDetailResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} + var xQuery: [String: Any] = [:] + if let value = id { + xQuery["id"] = value + } -if let value = i { - - xQuery["i"] = value - -} - - -if let value = b { - - xQuery["b"] = value - -} - + if let value = i { + xQuery["i"] = value + } - + if let value = b { + xQuery["b"] = value + } + var fullUrl = relativeUrls["applyRewardPoints"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/pos/cart/v1.0/redeem/points/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13717,86 +12196,66 @@ if let value = b { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Fetch address - * Description: Use this API to get all the addresses associated with an account. If successful, returns a Address resource in the response body specified in GetAddressesResponse.attibutes listed below are optional
  • uid
  • address_id
  • mobile_no
  • checkout_mode
  • tags
  • default
- **/ + * + * Summary: Fetch address + * Description: Use this API to get all the addresses associated with an account. If successful, returns a Address resource in the response body specified in GetAddressesResponse.attibutes listed below are optional
  • uid
  • address_id
  • mobile_no
  • checkout_mode
  • tags
  • default
+ **/ public func getAddresses( cartId: String?, mobileNo: String?, checkoutMode: String?, tags: String?, isDefault: Bool?, - + onResponse: @escaping (_ response: GetAddressesResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = cartId { - - xQuery["cart_id"] = value - -} - - -if let value = mobileNo { - - xQuery["mobile_no"] = value - -} - - -if let value = checkoutMode { - - xQuery["checkout_mode"] = value - -} + var xQuery: [String: Any] = [:] + if let value = cartId { + xQuery["cart_id"] = value + } -if let value = tags { - - xQuery["tags"] = value - -} - + if let value = mobileNo { + xQuery["mobile_no"] = value + } -if let value = isDefault { - - xQuery["is_default"] = value - -} + if let value = checkoutMode { + xQuery["checkout_mode"] = value + } + if let value = tags { + xQuery["tags"] = value + } - + if let value = isDefault { + xQuery["is_default"] = value + } + var fullUrl = relativeUrls["getAddresses"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/pos/cart/v1.0/address", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13804,46 +12263,39 @@ if let value = isDefault { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetAddressesResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Add address to an account - * Description: Use this API to add an address to an account. - **/ + * + * Summary: Add address to an account + * Description: Use this API to add an address to an account. + **/ public func addAddress( body: Address, onResponse: @escaping (_ response: SaveAddressResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["addAddress"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/pos/cart/v1.0/address", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13851,27 +12303,24 @@ if let value = isDefault { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SaveAddressResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Fetch a single address by its ID - * Description: Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional
  • mobile_no
  • checkout_mode
  • tags
  • default
- **/ + * + * Summary: Fetch a single address by its ID + * Description: Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional
  • mobile_no
  • checkout_mode
  • tags
  • default
+ **/ public func getAddressById( id: String, cartId: String?, @@ -13879,59 +12328,44 @@ if let value = isDefault { checkoutMode: String?, tags: String?, isDefault: Bool?, - + onResponse: @escaping (_ response: Address?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = cartId { - - xQuery["cart_id"] = value - -} - - -if let value = mobileNo { - - xQuery["mobile_no"] = value - -} - - -if let value = checkoutMode { - - xQuery["checkout_mode"] = value - -} + var xQuery: [String: Any] = [:] + if let value = cartId { + xQuery["cart_id"] = value + } -if let value = tags { - - xQuery["tags"] = value - -} + if let value = mobileNo { + xQuery["mobile_no"] = value + } + if let value = checkoutMode { + xQuery["checkout_mode"] = value + } -if let value = isDefault { - - xQuery["is_default"] = value - -} + if let value = tags { + xQuery["tags"] = value + } + if let value = isDefault { + xQuery["is_default"] = value + } - + var fullUrl = relativeUrls["getAddressById"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "id" + "}", with: "\(id)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/pos/cart/v1.0/address/\(id)", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13939,47 +12373,42 @@ if let value = isDefault { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Address.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Update address added to an account - * Description: Use this API to update an existing address in the account. Request object should contain attributes mentioned in Address can be updated. These attributes are:

  • is_default_address
  • landmark
  • area
  • pincode
  • email
  • address_type
  • name
  • address_id
  • address
- **/ + * + * Summary: Update address added to an account + * Description:

Use this API to update an existing address in the account. Request object should contain attributes mentioned in Address can be updated. These attributes are:

  • is_default_address
  • landmark
  • area
  • pincode
  • email
  • address_type
  • name
  • address_id
  • address
+ **/ public func updateAddress( id: String, body: Address, onResponse: @escaping (_ response: UpdateAddressResponse?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["updateAddress"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "id" + "}", with: "\(id)") ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/pos/cart/v1.0/address/\(id)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13987,47 +12416,42 @@ if let value = isDefault { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateAddressResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Remove address associated with an account - * Description: Use this API to delete an address by its ID. This will returns an object that will indicate whether the address was deleted successfully or not. - **/ + * + * Summary: Remove address associated with an account + * Description: Use this API to delete an address by its ID. This will returns an object that will indicate whether the address was deleted successfully or not. + **/ public func removeAddress( id: String, - + onResponse: @escaping (_ response: DeleteAddressResponse?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["removeAddress"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "id" + "}", with: "\(id)") ApplicationAPIClient.execute( config: config, method: "delete", - url: "/service/application/pos/cart/v1.0/address/\(id)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14035,27 +12459,24 @@ if let value = isDefault { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DeleteAddressResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Select an address from available addresses - * Description:

Select Address from all addresses associated with the account in order to ship the cart items to that address, otherwise default address will be selected implicitly. See `SelectCartAddressRequest` in schema of request body for the list of attributes needed to select Address from account. On successful request, this API returns a Cart object. Below address attributes are required.

  • address_id
  • billing_address_id
  • uid
- **/ + * + * Summary: Select an address from available addresses + * Description:

Select Address from all addresses associated with the account in order to ship the cart items to that address, otherwise default address will be selected implicitly. See `SelectCartAddressRequest` in schema of request body for the list of attributes needed to select Address from account. On successful request, this API returns a Cart object. Below address attributes are required.

  • address_id
  • billing_address_id
  • uid

+ **/ public func selectAddress( cartId: String?, i: Bool?, @@ -14063,42 +12484,31 @@ if let value = isDefault { body: SelectCartAddressRequest, onResponse: @escaping (_ response: CartDetailResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = cartId { - - xQuery["cart_id"] = value - -} - - -if let value = i { - - xQuery["i"] = value - -} - - -if let value = b { - - xQuery["b"] = value - -} + if let value = cartId { + xQuery["cart_id"] = value + } + if let value = i { + xQuery["i"] = value + } - + if let value = b { + xQuery["b"] = value + } + var fullUrl = relativeUrls["selectAddress"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/pos/cart/v1.0/select-address", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14106,54 +12516,46 @@ if let value = b { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Update cart payment - * Description: Use this API to update cart payment. - **/ + * + * Summary: Update cart payment + * Description: Use this API to update cart payment. + **/ public func selectPaymentMode( id: String?, body: UpdateCartPaymentRequest, onResponse: @escaping (_ response: CartDetailResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = id { + xQuery["id"] = value + } + var fullUrl = relativeUrls["selectPaymentMode"] ?? "" ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/pos/cart/v1.0/payment", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14161,27 +12563,24 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Verify the coupon eligibility against the payment mode - * Description: Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc. - **/ + * + * Summary: Verify the coupon eligibility against the payment mode + * Description: Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc. + **/ public func validateCouponForPayment( id: String?, addressId: String?, @@ -14189,66 +12588,46 @@ if let value = id { paymentIdentifier: String?, aggregatorName: String?, merchantCode: String?, - + onResponse: @escaping (_ response: PaymentCouponValidate?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - - -if let value = addressId { - - xQuery["address_id"] = value - -} - - -if let value = paymentMode { - - xQuery["payment_mode"] = value - -} - - -if let value = paymentIdentifier { - - xQuery["payment_identifier"] = value - -} + var xQuery: [String: Any] = [:] + if let value = id { + xQuery["id"] = value + } -if let value = aggregatorName { - - xQuery["aggregator_name"] = value - -} + if let value = addressId { + xQuery["address_id"] = value + } + if let value = paymentMode { + xQuery["payment_mode"] = value + } -if let value = merchantCode { - - xQuery["merchant_code"] = value - -} + if let value = paymentIdentifier { + xQuery["payment_identifier"] = value + } + if let value = aggregatorName { + xQuery["aggregator_name"] = value + } - + if let value = merchantCode { + xQuery["merchant_code"] = value + } + var fullUrl = relativeUrls["validateCouponForPayment"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/pos/cart/v1.0/payment/validate/", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14256,27 +12635,24 @@ if let value = merchantCode { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PaymentCouponValidate.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get delivery date and options before checkout - * Description: Use this API to get shipment details, expected delivery date, items and price breakup of the shipment. - **/ + * + * Summary: Get delivery date and options before checkout + * Description: Use this API to get shipment details, expected delivery date, items and price breakup of the shipment. + **/ public func getShipments( pickAtStoreUid: Int?, orderingStoreId: Int?, @@ -14285,73 +12661,50 @@ if let value = merchantCode { addressId: String?, areaCode: String?, orderType: String?, - + onResponse: @escaping (_ response: CartShipmentsResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pickAtStoreUid { - - xQuery["pick_at_store_uid"] = value - -} - - -if let value = orderingStoreId { - - xQuery["ordering_store_id"] = value - -} - - -if let value = p { - - xQuery["p"] = value - -} - - -if let value = id { - - xQuery["id"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = addressId { - - xQuery["address_id"] = value - -} + if let value = pickAtStoreUid { + xQuery["pick_at_store_uid"] = value + } + if let value = orderingStoreId { + xQuery["ordering_store_id"] = value + } -if let value = areaCode { - - xQuery["area_code"] = value - -} + if let value = p { + xQuery["p"] = value + } + if let value = id { + xQuery["id"] = value + } -if let value = orderType { - - xQuery["order_type"] = value - -} + if let value = addressId { + xQuery["address_id"] = value + } + if let value = areaCode { + xQuery["area_code"] = value + } - + if let value = orderType { + xQuery["order_type"] = value + } + var fullUrl = relativeUrls["getShipments"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/pos/cart/v1.0/shipment", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14359,27 +12712,24 @@ if let value = orderType { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartShipmentsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Update shipment delivery type and quantity before checkout - * Description: Use this API to update the delivery type and quantity as per customer's preference for either store pick-up or home-delivery. - **/ + * + * Summary: Update shipment delivery type and quantity before checkout + * Description: Use this API to update the delivery type and quantity as per customer's preference for either store pick-up or home-delivery. + **/ public func updateShipments( i: Bool?, p: Bool?, @@ -14389,56 +12739,39 @@ if let value = orderType { body: UpdateCartShipmentRequest, onResponse: @escaping (_ response: CartShipmentsResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = i { - - xQuery["i"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = p { - - xQuery["p"] = value - -} - - -if let value = id { - - xQuery["id"] = value - -} - - -if let value = addressId { - - xQuery["address_id"] = value - -} + if let value = i { + xQuery["i"] = value + } + if let value = p { + xQuery["p"] = value + } -if let value = orderType { - - xQuery["order_type"] = value - -} + if let value = id { + xQuery["id"] = value + } + if let value = addressId { + xQuery["address_id"] = value + } - + if let value = orderType { + xQuery["order_type"] = value + } + var fullUrl = relativeUrls["updateShipments"] ?? "" ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/pos/cart/v1.0/shipment", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14446,54 +12779,46 @@ if let value = orderType { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartShipmentsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Checkout all items in the cart - * Description: Use this API to checkout all items in the cart for payment and order generation. For COD, order will be generated directly, whereas for other checkout modes, user will be redirected to a payment gateway. - **/ + * + * Summary: Checkout all items in the cart + * Description: Use this API to checkout all items in the cart for payment and order generation. For COD, order will be generated directly, whereas for other checkout modes, user will be redirected to a payment gateway. + **/ public func checkoutCart( id: String?, body: CartPosCheckoutDetailRequest, onResponse: @escaping (_ response: CartCheckoutResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = id { - - xQuery["id"] = value - -} - - - + if let value = id { + xQuery["id"] = value + } + var fullUrl = relativeUrls["checkoutCart"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/pos/cart/v1.0/checkout", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14501,54 +12826,46 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartCheckoutResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Update the cart meta - * Description: Use this API to update cart meta like checkout_mode and gstin. - **/ + * + * Summary: Update the cart meta + * Description: Use this API to update cart meta like checkout_mode and gstin. + **/ public func updateCartMeta( id: String?, body: CartMetaRequest, onResponse: @escaping (_ response: CartMetaResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = id { + xQuery["id"] = value + } + var fullUrl = relativeUrls["updateCartMeta"] ?? "" ApplicationAPIClient.execute( config: config, method: "put", - url: "/service/application/pos/cart/v1.0/meta", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14556,60 +12873,49 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartMetaResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get available delivery modes for cart - * Description: Use this API to get the delivery modes (home-delivery/store-pickup) along with a list of pickup stores available for a given cart at a given PIN Code. User can then view the address of a pickup store with the help of store-address API. - **/ + * + * Summary: Get available delivery modes for cart + * Description: Use this API to get the delivery modes (home-delivery/store-pickup) along with a list of pickup stores available for a given cart at a given PIN Code. User can then view the address of a pickup store with the help of store-address API. + **/ public func getAvailableDeliveryModes( areaCode: String, id: String?, - + onResponse: @escaping (_ response: CartDeliveryModesResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - + var xQuery: [String: Any] = [:] - xQuery["area_code"] = areaCode + xQuery["area_code"] = areaCode + if let value = id { + xQuery["id"] = value + } - -if let value = id { - - xQuery["id"] = value - -} - - - - + var fullUrl = relativeUrls["getAvailableDeliveryModes"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/pos/cart/v1.0/available-delivery-mode", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14617,52 +12923,44 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CartDeliveryModesResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get list of stores for give uids - * Description: Use this API to get the store details by entering the unique identifier of the pickup stores shown in the response of available-delivery-mode API. - **/ + * + * Summary: Get list of stores for give uids + * Description: Use this API to get the store details by entering the unique identifier of the pickup stores shown in the response of available-delivery-mode API. + **/ public func getStoreAddressByUid( storeUid: Int, - + onResponse: @escaping (_ response: StoreDetailsResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["store_uid"] = storeUid + var xQuery: [String: Any] = [:] + xQuery["store_uid"] = storeUid - - - + var fullUrl = relativeUrls["getStoreAddressByUid"] ?? "" ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/pos/cart/v1.0/store-address", + url: fullUrl, query: xQuery, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14670,46 +12968,39 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(StoreDetailsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Generate token for sharing the cart - * Description: Use this API to generate a shared cart snapshot and return a shortlink token. The link can be shared with other users for getting the same items in their cart. - **/ + * + * Summary: Generate token for sharing the cart + * Description: Use this API to generate a shared cart snapshot and return a shortlink token. The link can be shared with other users for getting the same items in their cart. + **/ public func getCartShareLink( body: GetShareCartLinkRequest, onResponse: @escaping (_ response: GetShareCartLinkResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getCartShareLink"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/pos/cart/v1.0/share-cart", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14717,47 +13008,42 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetShareCartLinkResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get details of a shared cart - * Description: Use this API to get the shared cart details as per the token generated using the share-cart API. - **/ + * + * Summary: Get details of a shared cart + * Description: Use this API to get the shared cart details as per the token generated using the share-cart API. + **/ public func getCartSharedItems( token: String, - + onResponse: @escaping (_ response: SharedCartResponse?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getCartSharedItems"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "token" + "}", with: "\(token)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/pos/cart/v1.0/share-cart/\(token)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14765,48 +13051,45 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SharedCartResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Merge or replace existing cart - * Description: Use this API to merge the shared cart with existing cart, or replace the existing cart with the shared cart. The `action` parameter is used to indicate the operation Merge or Replace. - **/ + * + * Summary: Merge or replace existing cart + * Description: Use this API to merge the shared cart with existing cart, or replace the existing cart with the shared cart. The `action` parameter is used to indicate the operation Merge or Replace. + **/ public func updateCartWithSharedItems( token: String, action: String, - + onResponse: @escaping (_ response: SharedCartResponse?, _ error: FDKError?) -> Void ) { - - + var fullUrl = relativeUrls["updateCartWithSharedItems"] ?? "" - + fullUrl = fullUrl.replacingOccurrences(of: "{" + "token" + "}", with: "\(token)") + fullUrl = fullUrl.replacingOccurrences(of: "{" + "action" + "}", with: "\(action)") ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/pos/cart/v1.0/share-cart/\(token)/\(action)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14814,58 +13097,61 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SharedCartResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - + public class Logistic { - var config: ApplicationConfig + var relativeUrls = [String: String]() init(config: ApplicationConfig) { - self.config = config; + self.config = config + var ulrs = [String: String]() + + ulrs["getTatProduct"] = config.domain.appendAsPath("/service/application/logistics/v1.0") + + ulrs["getPincodeCity"] = config.domain.appendAsPath("/service/application/logistics/v1.0/pincode/{pincode}") + + self.relativeUrls = ulrs + } + + public func update(updatedUrl: [String: String]) { + for (key, value) in updatedUrl { + self.relativeUrls[key] = value + } } - - - + /** - * - * Summary: Get TAT of a product - * Description: Use this API to know the delivery turnaround time (TAT) by entering the product details along with the PIN Code of the location. - **/ + * + * Summary: Get TAT of a product + * Description: Use this API to know the delivery turnaround time (TAT) by entering the product details along with the PIN Code of the location. + **/ public func getTatProduct( body: GetTatProductReqBody, onResponse: @escaping (_ response: GetTatProductResponse?, _ error: FDKError?) -> Void ) { - - - - - + var fullUrl = relativeUrls["getTatProduct"] ?? "" ApplicationAPIClient.execute( config: config, method: "post", - url: "/service/application/logistics/v1.0", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: body.dictionary, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14873,47 +13159,42 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetTatProductResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - + /** - * - * Summary: Get city from PIN Code - * Description: Use this API to retrieve a city by its PIN Code. - **/ + * + * Summary: Get city from PIN Code + * Description: Use this API to retrieve a city by its PIN Code. + **/ public func getPincodeCity( pincode: String, - + onResponse: @escaping (_ response: GetPincodeCityResponse?, _ error: FDKError?) -> Void ) { - - - - + var fullUrl = relativeUrls["getPincodeCity"] ?? "" + fullUrl = fullUrl.replacingOccurrences(of: "{" + "pincode" + "}", with: "\(pincode)") ApplicationAPIClient.execute( config: config, method: "get", - url: "/service/application/logistics/v1.0/pincode/\(pincode)", + url: fullUrl, query: nil, - extraHeaders: [], + extraHeaders: [], body: nil, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14921,21 +13202,17 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetPincodeCityResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - -} \ No newline at end of file +} diff --git a/Sources/code/application/ApplicationConfig.swift b/Sources/code/application/ApplicationConfig.swift index 02e15c1f01..608b1d2266 100644 --- a/Sources/code/application/ApplicationConfig.swift +++ b/Sources/code/application/ApplicationConfig.swift @@ -4,18 +4,26 @@ public class ApplicationConfig { var applicationToken: String var domain: String var userAgent: String? + var currency: String? + var language: String? + var extraHeaders: [(key: String, value: String)] = [] - public init?(applicationId: String, applicationToken: String, domain: String = "https://api.fynd.com", userAgent: String? = nil) { + public init?(applicationId: String, applicationToken: String, domain: String = "https://api.fynd.com", userAgent: String? = nil, language: String? = "en-IN", currency: String? = "INR", extraHeaders: [(key: String, value: String)] = []) { self.applicationId = applicationId self.applicationToken = applicationToken self.domain = domain self.userAgent = userAgent - //let regex = "^[0-9a-fA-F]{24}$" + self.language = language + self.currency = currency + self.extraHeaders = extraHeaders + + // let regex = "^[0-9a-fA-F]{24}$" let regex = try? NSRegularExpression(pattern: "^[0-9a-fA-F]{24}$", - options: [.caseInsensitive]) + options: [.caseInsensitive]) - if regex?.firstMatch(in: applicationId, options:[], - range: NSMakeRange(0, applicationId.utf16.count)) == nil { + if regex?.firstMatch(in: applicationId, options: [], + range: NSMakeRange(0, applicationId.utf16.count)) == nil + { return nil } @@ -26,4 +34,4 @@ public class ApplicationConfig { // } // } } -} \ No newline at end of file +} diff --git a/Sources/code/application/ApplicationEnums.swift b/Sources/code/application/ApplicationEnums.swift index c65147acb8..5511a70557 100644 --- a/Sources/code/application/ApplicationEnums.swift +++ b/Sources/code/application/ApplicationEnums.swift @@ -1,98 +1,63 @@ import Foundation public extension ApplicationClient { - - - - - - /* - Enum: PriorityEnum - Used By: Lead - */ + Enum: PriorityEnum + Used By: Lead + */ enum PriorityEnum: String, Codable { - - case low = "low" - - case medium = "medium" - - case high = "high" - - case urgent = "urgent" - + case low + + case medium + + case high + + case urgent } - - /* - Enum: HistoryTypeEnum - Used By: Lead - */ + Enum: HistoryTypeEnum + Used By: Lead + */ enum HistoryTypeEnum: String, Codable { - - case rating = "rating" - - case log = "log" - - case comment = "comment" - + case rating + + case log + + case comment } - - /* - Enum: TicketAssetType - Used By: Lead - */ - enum TicketAssetType: String, Codable { - - case image = "image" - - case video = "video" - - case file = "file" - - case youtube = "youtube" - - case product = "product" - - case collection = "collection" - - case brand = "brand" - - case shipment = "shipment" - - case order = "order" - + Enum: TicketAssetTypeEnum + Used By: Lead + */ + enum TicketAssetTypeEnum: String, Codable { + case image + + case video + + case file + + case youtube + + case product + + case collection + + case brand + + case shipment + + case order } - - /* - Enum: TicketSourceEnum - Used By: Lead - */ + Enum: TicketSourceEnum + Used By: Lead + */ enum TicketSourceEnum: String, Codable { - case platformPanel = "platform_panel" - + case salesChannel = "sales_channel" - } - - - - - - - - - - - - - - - -} \ No newline at end of file +} diff --git a/Sources/code/application/ApplicationModels.swift b/Sources/code/application/ApplicationModels.swift deleted file mode 100644 index a40704e02b..0000000000 --- a/Sources/code/application/ApplicationModels.swift +++ /dev/null @@ -1,87788 +0,0 @@ - import Foundation - public extension ApplicationClient { - - - /* - Model: ProductListingActionPage - Used By: Catalog - */ - class ProductListingActionPage: Codable { - - public var query: [String: Any]? - - public var params: [String: Any]? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case query = "query" - - case params = "params" - - case type = "type" - - } - - public init(params: [String: Any]?, query: [String: Any]?, type: String?) { - - self.query = query - - self.params = params - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - query = try container.decode([String: Any].self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - params = try container.decode([String: Any].self, forKey: .params) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(query, forKey: .query) - - - - try? container.encodeIfPresent(params, forKey: .params) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ProductListingAction - Used By: Catalog - */ - class ProductListingAction: Codable { - - public var page: ProductListingActionPage? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case page = "page" - - case type = "type" - - } - - public init(page: ProductListingActionPage?, type: String?) { - - self.page = page - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - page = try container.decode(ProductListingActionPage.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: Meta - Used By: Catalog - */ - class Meta: Codable { - - public var source: String? - - - public enum CodingKeys: String, CodingKey { - - case source = "source" - - } - - public init(source: String?) { - - self.source = source - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - source = try container.decode(String.self, forKey: .source) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(source, forKey: .source) - - - } - - } - - /* - Model: Media - Used By: Catalog - */ - class Media: Codable { - - public var meta: Meta? - - public var url: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case meta = "meta" - - case url = "url" - - case type = "type" - - } - - public init(meta: Meta?, type: String?, url: String?) { - - self.meta = meta - - self.url = url - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - meta = try container.decode(Meta.self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: Price - Used By: Catalog - */ - class Price: Codable { - - public var max: Double? - - public var currencySymbol: String? - - public var currencyCode: String? - - public var min: Double? - - - public enum CodingKeys: String, CodingKey { - - case max = "max" - - case currencySymbol = "currency_symbol" - - case currencyCode = "currency_code" - - case min = "min" - - } - - public init(currencyCode: String?, currencySymbol: String?, max: Double?, min: Double?) { - - self.max = max - - self.currencySymbol = currencySymbol - - self.currencyCode = currencyCode - - self.min = min - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - max = try container.decode(Double.self, forKey: .max) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencySymbol = try container.decode(String.self, forKey: .currencySymbol) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - min = try container.decode(Double.self, forKey: .min) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(max, forKey: .max) - - - - try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - - try? container.encodeIfPresent(min, forKey: .min) - - - } - - } - - /* - Model: ProductListingPrice - Used By: Catalog - */ - class ProductListingPrice: Codable { - - public var marked: Price? - - public var effective: Price? - - - public enum CodingKeys: String, CodingKey { - - case marked = "marked" - - case effective = "effective" - - } - - public init(effective: Price?, marked: Price?) { - - self.marked = marked - - self.effective = effective - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - marked = try container.decode(Price.self, forKey: .marked) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - effective = try container.decode(Price.self, forKey: .effective) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(marked, forKey: .marked) - - - - try? container.encodeIfPresent(effective, forKey: .effective) - - - } - - } - - /* - Model: ProductBrand - Used By: Catalog - */ - class ProductBrand: Codable { - - public var logo: Media? - - public var action: ProductListingAction? - - public var name: String? - - public var uid: Int? - - - public enum CodingKeys: String, CodingKey { - - case logo = "logo" - - case action = "action" - - case name = "name" - - case uid = "uid" - - } - - public init(action: ProductListingAction?, logo: Media?, name: String?, uid: Int?) { - - self.logo = logo - - self.action = action - - self.name = name - - self.uid = uid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - logo = try container.decode(Media.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(ProductListingAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - } - - } - - /* - Model: ProductDetailAttribute - Used By: Catalog - */ - class ProductDetailAttribute: Codable { - - public var key: String? - - public var value: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case value = "value" - - case type = "type" - - } - - public init(key: String?, type: String?, value: String?) { - - self.key = key - - self.value = value - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ProductDetailGroupedAttribute - Used By: Catalog - */ - class ProductDetailGroupedAttribute: Codable { - - public var title: String? - - public var details: [ProductDetailAttribute]? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case details = "details" - - } - - public init(details: [ProductDetailAttribute]?, title: String?) { - - self.title = title - - self.details = details - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - details = try container.decode([ProductDetailAttribute].self, forKey: .details) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(details, forKey: .details) - - - } - - } - - /* - Model: ProductDetail - Used By: Catalog - */ - class ProductDetail: Codable { - - public var ratingCount: Int? - - public var shortDescription: String? - - public var slug: String - - public var action: ProductListingAction? - - public var uid: Int? - - public var discount: String? - - public var rating: Double? - - public var itemType: String? - - public var name: String? - - public var medias: [Media]? - - public var price: ProductListingPrice? - - public var similars: [String]? - - public var color: String? - - public var categories: [ProductBrand]? - - public var itemCode: String? - - public var type: String? - - public var highlights: [String]? - - public var hasVariant: Bool? - - public var imageNature: String? - - public var groupedAttributes: [ProductDetailGroupedAttribute]? - - public var tryouts: [String]? - - public var attributes: [String: Any]? - - public var description: String? - - public var teaserTag: String? - - public var brand: ProductBrand? - - public var productOnlineDate: String? - - - public enum CodingKeys: String, CodingKey { - - case ratingCount = "rating_count" - - case shortDescription = "short_description" - - case slug = "slug" - - case action = "action" - - case uid = "uid" - - case discount = "discount" - - case rating = "rating" - - case itemType = "item_type" - - case name = "name" - - case medias = "medias" - - case price = "price" - - case similars = "similars" - - case color = "color" - - case categories = "categories" - - case itemCode = "item_code" - - case type = "type" - - case highlights = "highlights" - - case hasVariant = "has_variant" - - case imageNature = "image_nature" - - case groupedAttributes = "grouped_attributes" - - case tryouts = "tryouts" - - case attributes = "attributes" - - case description = "description" - - case teaserTag = "teaser_tag" - - case brand = "brand" - - case productOnlineDate = "product_online_date" - - } - - public init(action: ProductListingAction?, attributes: [String: Any]?, brand: ProductBrand?, categories: [ProductBrand]?, color: String?, description: String?, discount: String?, groupedAttributes: [ProductDetailGroupedAttribute]?, hasVariant: Bool?, highlights: [String]?, imageNature: String?, itemCode: String?, itemType: String?, medias: [Media]?, name: String?, price: ProductListingPrice?, productOnlineDate: String?, rating: Double?, ratingCount: Int?, shortDescription: String?, similars: [String]?, slug: String, teaserTag: String?, tryouts: [String]?, type: String?, uid: Int?) { - - self.ratingCount = ratingCount - - self.shortDescription = shortDescription - - self.slug = slug - - self.action = action - - self.uid = uid - - self.discount = discount - - self.rating = rating - - self.itemType = itemType - - self.name = name - - self.medias = medias - - self.price = price - - self.similars = similars - - self.color = color - - self.categories = categories - - self.itemCode = itemCode - - self.type = type - - self.highlights = highlights - - self.hasVariant = hasVariant - - self.imageNature = imageNature - - self.groupedAttributes = groupedAttributes - - self.tryouts = tryouts - - self.attributes = attributes - - self.description = description - - self.teaserTag = teaserTag - - self.brand = brand - - self.productOnlineDate = productOnlineDate - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - ratingCount = try container.decode(Int.self, forKey: .ratingCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shortDescription = try container.decode(String.self, forKey: .shortDescription) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - slug = try container.decode(String.self, forKey: .slug) - - - - - do { - action = try container.decode(ProductListingAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discount = try container.decode(String.self, forKey: .discount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rating = try container.decode(Double.self, forKey: .rating) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemType = try container.decode(String.self, forKey: .itemType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - medias = try container.decode([Media].self, forKey: .medias) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(ProductListingPrice.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - similars = try container.decode([String].self, forKey: .similars) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - color = try container.decode(String.self, forKey: .color) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - categories = try container.decode([ProductBrand].self, forKey: .categories) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemCode = try container.decode(String.self, forKey: .itemCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - highlights = try container.decode([String].self, forKey: .highlights) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasVariant = try container.decode(Bool.self, forKey: .hasVariant) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - imageNature = try container.decode(String.self, forKey: .imageNature) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - groupedAttributes = try container.decode([ProductDetailGroupedAttribute].self, forKey: .groupedAttributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tryouts = try container.decode([String].self, forKey: .tryouts) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attributes = try container.decode([String: Any].self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - teaserTag = try container.decode(String.self, forKey: .teaserTag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brand = try container.decode(ProductBrand.self, forKey: .brand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productOnlineDate = try container.decode(String.self, forKey: .productOnlineDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(ratingCount, forKey: .ratingCount) - - - - try? container.encodeIfPresent(shortDescription, forKey: .shortDescription) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - - try? container.encodeIfPresent(rating, forKey: .rating) - - - - try? container.encodeIfPresent(itemType, forKey: .itemType) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(medias, forKey: .medias) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(similars, forKey: .similars) - - - - try? container.encodeIfPresent(color, forKey: .color) - - - - try? container.encodeIfPresent(categories, forKey: .categories) - - - - try? container.encodeIfPresent(itemCode, forKey: .itemCode) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(highlights, forKey: .highlights) - - - - try? container.encodeIfPresent(hasVariant, forKey: .hasVariant) - - - - try? container.encodeIfPresent(imageNature, forKey: .imageNature) - - - - try? container.encodeIfPresent(groupedAttributes, forKey: .groupedAttributes) - - - - try? container.encodeIfPresent(tryouts, forKey: .tryouts) - - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(teaserTag, forKey: .teaserTag) - - - - try? container.encodeIfPresent(brand, forKey: .brand) - - - - try? container.encodeIfPresent(productOnlineDate, forKey: .productOnlineDate) - - - } - - } - - /* - Model: ErrorResponse - Used By: Catalog - */ - class ErrorResponse: Codable { - - public var error: String? - - - public enum CodingKeys: String, CodingKey { - - case error = "error" - - } - - public init(error: String?) { - - self.error = error - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - error = try container.decode(String.self, forKey: .error) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(error, forKey: .error) - - - } - - } - - /* - Model: ColumnHeader - Used By: Catalog - */ - class ColumnHeader: Codable { - - public var convertable: Bool? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case convertable = "convertable" - - case value = "value" - - } - - public init(convertable: Bool?, value: String?) { - - self.convertable = convertable - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - convertable = try container.decode(Bool.self, forKey: .convertable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(convertable, forKey: .convertable) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: ColumnHeaders - Used By: Catalog - */ - class ColumnHeaders: Codable { - - public var col3: ColumnHeader? - - public var col4: ColumnHeader? - - public var col6: ColumnHeader? - - public var col1: ColumnHeader? - - public var col2: ColumnHeader? - - public var col5: ColumnHeader? - - - public enum CodingKeys: String, CodingKey { - - case col3 = "col_3" - - case col4 = "col_4" - - case col6 = "col_6" - - case col1 = "col_1" - - case col2 = "col_2" - - case col5 = "col_5" - - } - - public init(col1: ColumnHeader?, col2: ColumnHeader?, col3: ColumnHeader?, col4: ColumnHeader?, col5: ColumnHeader?, col6: ColumnHeader?) { - - self.col3 = col3 - - self.col4 = col4 - - self.col6 = col6 - - self.col1 = col1 - - self.col2 = col2 - - self.col5 = col5 - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - col3 = try container.decode(ColumnHeader.self, forKey: .col3) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - col4 = try container.decode(ColumnHeader.self, forKey: .col4) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - col6 = try container.decode(ColumnHeader.self, forKey: .col6) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - col1 = try container.decode(ColumnHeader.self, forKey: .col1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - col2 = try container.decode(ColumnHeader.self, forKey: .col2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - col5 = try container.decode(ColumnHeader.self, forKey: .col5) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(col3, forKey: .col3) - - - - try? container.encodeIfPresent(col4, forKey: .col4) - - - - try? container.encodeIfPresent(col6, forKey: .col6) - - - - try? container.encodeIfPresent(col1, forKey: .col1) - - - - try? container.encodeIfPresent(col2, forKey: .col2) - - - - try? container.encodeIfPresent(col5, forKey: .col5) - - - } - - } - - /* - Model: SizeChartValues - Used By: Catalog - */ - class SizeChartValues: Codable { - - public var col3: String? - - public var col4: String? - - public var col6: String? - - public var col1: String? - - public var col2: String? - - public var col5: String? - - - public enum CodingKeys: String, CodingKey { - - case col3 = "col_3" - - case col4 = "col_4" - - case col6 = "col_6" - - case col1 = "col_1" - - case col2 = "col_2" - - case col5 = "col_5" - - } - - public init(col1: String?, col2: String?, col3: String?, col4: String?, col5: String?, col6: String?) { - - self.col3 = col3 - - self.col4 = col4 - - self.col6 = col6 - - self.col1 = col1 - - self.col2 = col2 - - self.col5 = col5 - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - col3 = try container.decode(String.self, forKey: .col3) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - col4 = try container.decode(String.self, forKey: .col4) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - col6 = try container.decode(String.self, forKey: .col6) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - col1 = try container.decode(String.self, forKey: .col1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - col2 = try container.decode(String.self, forKey: .col2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - col5 = try container.decode(String.self, forKey: .col5) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(col3, forKey: .col3) - - - - try? container.encodeIfPresent(col4, forKey: .col4) - - - - try? container.encodeIfPresent(col6, forKey: .col6) - - - - try? container.encodeIfPresent(col1, forKey: .col1) - - - - try? container.encodeIfPresent(col2, forKey: .col2) - - - - try? container.encodeIfPresent(col5, forKey: .col5) - - - } - - } - - /* - Model: SizeChart - Used By: Catalog - */ - class SizeChart: Codable { - - public var image: String? - - public var title: String? - - public var headers: ColumnHeaders? - - public var sizeTip: String? - - public var description: String? - - public var sizes: [SizeChartValues]? - - public var unit: String? - - - public enum CodingKeys: String, CodingKey { - - case image = "image" - - case title = "title" - - case headers = "headers" - - case sizeTip = "size_tip" - - case description = "description" - - case sizes = "sizes" - - case unit = "unit" - - } - - public init(description: String?, headers: ColumnHeaders?, image: String?, sizes: [SizeChartValues]?, sizeTip: String?, title: String?, unit: String?) { - - self.image = image - - self.title = title - - self.headers = headers - - self.sizeTip = sizeTip - - self.description = description - - self.sizes = sizes - - self.unit = unit - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - image = try container.decode(String.self, forKey: .image) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - headers = try container.decode(ColumnHeaders.self, forKey: .headers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sizeTip = try container.decode(String.self, forKey: .sizeTip) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sizes = try container.decode([SizeChartValues].self, forKey: .sizes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - unit = try container.decode(String.self, forKey: .unit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(image, forKey: .image) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(headers, forKey: .headers) - - - - try? container.encodeIfPresent(sizeTip, forKey: .sizeTip) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(sizes, forKey: .sizes) - - - - try? container.encodeIfPresent(unit, forKey: .unit) - - - } - - } - - /* - Model: ProductSize - Used By: Catalog - */ - class ProductSize: Codable { - - public var display: String? - - public var quantity: Int? - - public var value: String? - - public var isAvailable: Bool? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case quantity = "quantity" - - case value = "value" - - case isAvailable = "is_available" - - } - - public init(display: String?, isAvailable: Bool?, quantity: Int?, value: String?) { - - self.display = display - - self.quantity = quantity - - self.value = value - - self.isAvailable = isAvailable - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isAvailable = try container.decode(Bool.self, forKey: .isAvailable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(isAvailable, forKey: .isAvailable) - - - } - - } - - /* - Model: ProductSizeStores - Used By: Catalog - */ - class ProductSizeStores: Codable { - - public var count: Int? - - - public enum CodingKeys: String, CodingKey { - - case count = "count" - - } - - public init(count: Int?) { - - self.count = count - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(count, forKey: .count) - - - } - - } - - /* - Model: ProductSizes - Used By: Catalog - */ - class ProductSizes: Codable { - - public var sizeChart: SizeChart? - - public var sizes: [ProductSize]? - - public var price: ProductListingPrice? - - public var stores: ProductSizeStores? - - public var sellable: Bool? - - public var discount: String? - - - public enum CodingKeys: String, CodingKey { - - case sizeChart = "size_chart" - - case sizes = "sizes" - - case price = "price" - - case stores = "stores" - - case sellable = "sellable" - - case discount = "discount" - - } - - public init(discount: String?, price: ProductListingPrice?, sellable: Bool?, sizes: [ProductSize]?, sizeChart: SizeChart?, stores: ProductSizeStores?) { - - self.sizeChart = sizeChart - - self.sizes = sizes - - self.price = price - - self.stores = stores - - self.sellable = sellable - - self.discount = discount - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - sizeChart = try container.decode(SizeChart.self, forKey: .sizeChart) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sizes = try container.decode([ProductSize].self, forKey: .sizes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(ProductListingPrice.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stores = try container.decode(ProductSizeStores.self, forKey: .stores) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sellable = try container.decode(Bool.self, forKey: .sellable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discount = try container.decode(String.self, forKey: .discount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(sizeChart, forKey: .sizeChart) - - - - try? container.encodeIfPresent(sizes, forKey: .sizes) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(stores, forKey: .stores) - - - - try? container.encodeIfPresent(sellable, forKey: .sellable) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - } - - } - - /* - Model: ProductStockPrice - Used By: Catalog - */ - class ProductStockPrice: Codable { - - public var marked: Double? - - public var currency: String? - - public var effective: Double? - - - public enum CodingKeys: String, CodingKey { - - case marked = "marked" - - case currency = "currency" - - case effective = "effective" - - } - - public init(currency: String?, effective: Double?, marked: Double?) { - - self.marked = marked - - self.currency = currency - - self.effective = effective - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - marked = try container.decode(Double.self, forKey: .marked) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(String.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - effective = try container.decode(Double.self, forKey: .effective) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(marked, forKey: .marked) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(effective, forKey: .effective) - - - } - - } - - /* - Model: StrategyWiseListing - Used By: Catalog - */ - class StrategyWiseListing: Codable { - - public var distance: Int? - - public var quantity: Int? - - public var tat: Int? - - public var pincode: Int? - - - public enum CodingKeys: String, CodingKey { - - case distance = "distance" - - case quantity = "quantity" - - case tat = "tat" - - case pincode = "pincode" - - } - - public init(distance: Int?, pincode: Int?, quantity: Int?, tat: Int?) { - - self.distance = distance - - self.quantity = quantity - - self.tat = tat - - self.pincode = pincode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - distance = try container.decode(Int.self, forKey: .distance) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tat = try container.decode(Int.self, forKey: .tat) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(Int.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(distance, forKey: .distance) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - - try? container.encodeIfPresent(tat, forKey: .tat) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - } - - } - - /* - Model: Seller - Used By: Catalog - */ - class Seller: Codable { - - public var count: Int? - - public var name: String? - - public var uid: Int? - - - public enum CodingKeys: String, CodingKey { - - case count = "count" - - case name = "name" - - case uid = "uid" - - } - - public init(count: Int?, name: String?, uid: Int?) { - - self.count = count - - self.name = name - - self.uid = uid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(count, forKey: .count) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - } - - } - - /* - Model: ReturnConfig - Used By: Catalog - */ - class ReturnConfig: Codable { - - public var returnable: Bool? - - public var time: Int? - - public var unit: String? - - - public enum CodingKeys: String, CodingKey { - - case returnable = "returnable" - - case time = "time" - - case unit = "unit" - - } - - public init(returnable: Bool?, time: Int?, unit: String?) { - - self.returnable = returnable - - self.time = time - - self.unit = unit - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - returnable = try container.decode(Bool.self, forKey: .returnable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - time = try container.decode(Int.self, forKey: .time) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - unit = try container.decode(String.self, forKey: .unit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(returnable, forKey: .returnable) - - - - try? container.encodeIfPresent(time, forKey: .time) - - - - try? container.encodeIfPresent(unit, forKey: .unit) - - - } - - } - - /* - Model: ProductSetDistributionSize - Used By: Catalog - */ - class ProductSetDistributionSize: Codable { - - public var size: String? - - public var pieces: Int? - - - public enum CodingKeys: String, CodingKey { - - case size = "size" - - case pieces = "pieces" - - } - - public init(pieces: Int?, size: String?) { - - self.size = size - - self.pieces = pieces - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - size = try container.decode(String.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pieces = try container.decode(Int.self, forKey: .pieces) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(pieces, forKey: .pieces) - - - } - - } - - /* - Model: ProductSetDistribution - Used By: Catalog - */ - class ProductSetDistribution: Codable { - - public var sizes: [ProductSetDistributionSize]? - - - public enum CodingKeys: String, CodingKey { - - case sizes = "sizes" - - } - - public init(sizes: [ProductSetDistributionSize]?) { - - self.sizes = sizes - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - sizes = try container.decode([ProductSetDistributionSize].self, forKey: .sizes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(sizes, forKey: .sizes) - - - } - - } - - /* - Model: ProductSet - Used By: Catalog - */ - class ProductSet: Codable { - - public var quantity: Int? - - public var sizeDistribution: ProductSetDistribution? - - - public enum CodingKeys: String, CodingKey { - - case quantity = "quantity" - - case sizeDistribution = "size_distribution" - - } - - public init(quantity: Int?, sizeDistribution: ProductSetDistribution?) { - - self.quantity = quantity - - self.sizeDistribution = sizeDistribution - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sizeDistribution = try container.decode(ProductSetDistribution.self, forKey: .sizeDistribution) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - - try? container.encodeIfPresent(sizeDistribution, forKey: .sizeDistribution) - - - } - - } - - /* - Model: ArticleAssignment - Used By: Catalog - */ - class ArticleAssignment: Codable { - - public var level: String? - - public var strategy: String? - - - public enum CodingKeys: String, CodingKey { - - case level = "level" - - case strategy = "strategy" - - } - - public init(level: String?, strategy: String?) { - - self.level = level - - self.strategy = strategy - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - level = try container.decode(String.self, forKey: .level) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - strategy = try container.decode(String.self, forKey: .strategy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(level, forKey: .level) - - - - try? container.encodeIfPresent(strategy, forKey: .strategy) - - - } - - } - - /* - Model: Store - Used By: Catalog - */ - class Store: Codable { - - public var count: Int? - - public var name: String? - - public var uid: Int? - - - public enum CodingKeys: String, CodingKey { - - case count = "count" - - case name = "name" - - case uid = "uid" - - } - - public init(count: Int?, name: String?, uid: Int?) { - - self.count = count - - self.name = name - - self.uid = uid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(count, forKey: .count) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - } - - } - - /* - Model: Details - Used By: Catalog - */ - class Details: Codable { - - public var key: String? - - public var value: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case value = "value" - - case type = "type" - - } - - public init(key: String?, type: String?, value: String?) { - - self.key = key - - self.value = value - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: MarketPlaceSttributes - Used By: Catalog - */ - class MarketPlaceSttributes: Codable { - - public var title: String? - - public var details: [Details]? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case details = "details" - - } - - public init(details: [Details]?, title: String?) { - - self.title = title - - self.details = details - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - details = try container.decode([Details].self, forKey: .details) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(details, forKey: .details) - - - } - - } - - /* - Model: ProductSizePriceResponse - Used By: Catalog - */ - class ProductSizePriceResponse: Codable { - - public var pricePerPiece: ProductStockPrice? - - public var strategyWiseListing: [StrategyWiseListing]? - - public var itemType: String? - - public var articleId: String? - - public var seller: Seller? - - public var longLat: [Double]? - - public var returnConfig: ReturnConfig? - - public var pincode: Int? - - public var specialBadge: String? - - public var set: ProductSet? - - public var discount: String? - - public var price: ProductStockPrice? - - public var articleAssignment: ArticleAssignment? - - public var store: Store? - - public var quantity: Int? - - public var sellerCount: Int? - - public var marketplaceAttributes: [MarketPlaceSttributes]? - - - public enum CodingKeys: String, CodingKey { - - case pricePerPiece = "price_per_piece" - - case strategyWiseListing = "strategy_wise_listing" - - case itemType = "item_type" - - case articleId = "article_id" - - case seller = "seller" - - case longLat = "long_lat" - - case returnConfig = "return_config" - - case pincode = "pincode" - - case specialBadge = "special_badge" - - case set = "set" - - case discount = "discount" - - case price = "price" - - case articleAssignment = "article_assignment" - - case store = "store" - - case quantity = "quantity" - - case sellerCount = "seller_count" - - case marketplaceAttributes = "marketplace_attributes" - - } - - public init(articleAssignment: ArticleAssignment?, articleId: String?, discount: String?, itemType: String?, longLat: [Double]?, marketplaceAttributes: [MarketPlaceSttributes]?, pincode: Int?, price: ProductStockPrice?, pricePerPiece: ProductStockPrice?, quantity: Int?, returnConfig: ReturnConfig?, seller: Seller?, sellerCount: Int?, set: ProductSet?, specialBadge: String?, store: Store?, strategyWiseListing: [StrategyWiseListing]?) { - - self.pricePerPiece = pricePerPiece - - self.strategyWiseListing = strategyWiseListing - - self.itemType = itemType - - self.articleId = articleId - - self.seller = seller - - self.longLat = longLat - - self.returnConfig = returnConfig - - self.pincode = pincode - - self.specialBadge = specialBadge - - self.set = set - - self.discount = discount - - self.price = price - - self.articleAssignment = articleAssignment - - self.store = store - - self.quantity = quantity - - self.sellerCount = sellerCount - - self.marketplaceAttributes = marketplaceAttributes - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pricePerPiece = try container.decode(ProductStockPrice.self, forKey: .pricePerPiece) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - strategyWiseListing = try container.decode([StrategyWiseListing].self, forKey: .strategyWiseListing) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemType = try container.decode(String.self, forKey: .itemType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - articleId = try container.decode(String.self, forKey: .articleId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - seller = try container.decode(Seller.self, forKey: .seller) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - longLat = try container.decode([Double].self, forKey: .longLat) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - returnConfig = try container.decode(ReturnConfig.self, forKey: .returnConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(Int.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - specialBadge = try container.decode(String.self, forKey: .specialBadge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - set = try container.decode(ProductSet.self, forKey: .set) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discount = try container.decode(String.self, forKey: .discount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(ProductStockPrice.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - articleAssignment = try container.decode(ArticleAssignment.self, forKey: .articleAssignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - store = try container.decode(Store.self, forKey: .store) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sellerCount = try container.decode(Int.self, forKey: .sellerCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - marketplaceAttributes = try container.decode([MarketPlaceSttributes].self, forKey: .marketplaceAttributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pricePerPiece, forKey: .pricePerPiece) - - - - try? container.encodeIfPresent(strategyWiseListing, forKey: .strategyWiseListing) - - - - try? container.encodeIfPresent(itemType, forKey: .itemType) - - - - try? container.encodeIfPresent(articleId, forKey: .articleId) - - - - try? container.encodeIfPresent(seller, forKey: .seller) - - - - try? container.encodeIfPresent(longLat, forKey: .longLat) - - - - try? container.encodeIfPresent(returnConfig, forKey: .returnConfig) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(specialBadge, forKey: .specialBadge) - - - - try? container.encodeIfPresent(set, forKey: .set) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(articleAssignment, forKey: .articleAssignment) - - - - try? container.encodeIfPresent(store, forKey: .store) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - - try? container.encodeIfPresent(sellerCount, forKey: .sellerCount) - - - - try? container.encodeIfPresent(marketplaceAttributes, forKey: .marketplaceAttributes) - - - } - - } - - /* - Model: ProductSizeSellerFilter - Used By: Catalog - */ - class ProductSizeSellerFilter: Codable { - - public var value: String? - - public var isSelected: Bool? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case value = "value" - - case isSelected = "is_selected" - - case name = "name" - - } - - public init(isSelected: Bool?, name: String?, value: String?) { - - self.value = value - - self.isSelected = isSelected - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isSelected = try container.decode(Bool.self, forKey: .isSelected) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(isSelected, forKey: .isSelected) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: ProductSizeSellersResponse - Used By: Catalog - */ - class ProductSizeSellersResponse: Codable { - - public var page: Page - - public var sortOn: [ProductSizeSellerFilter]? - - public var items: [ProductSizePriceResponse]? - - - public enum CodingKeys: String, CodingKey { - - case page = "page" - - case sortOn = "sort_on" - - case items = "items" - - } - - public init(items: [ProductSizePriceResponse]?, page: Page, sortOn: [ProductSizeSellerFilter]?) { - - self.page = page - - self.sortOn = sortOn - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - page = try container.decode(Page.self, forKey: .page) - - - - - do { - sortOn = try container.decode([ProductSizeSellerFilter].self, forKey: .sortOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([ProductSizePriceResponse].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(sortOn, forKey: .sortOn) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: AttributeDetail - Used By: Catalog - */ - class AttributeDetail: Codable { - - public var display: String? - - public var key: String? - - public var logo: String? - - public var description: String? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case key = "key" - - case logo = "logo" - - case description = "description" - - } - - public init(description: String?, display: String?, key: String?, logo: String?) { - - self.display = display - - self.key = key - - self.logo = logo - - self.description = description - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - } - - } - - /* - Model: AttributeMetadata - Used By: Catalog - */ - class AttributeMetadata: Codable { - - public var title: String? - - public var details: [AttributeDetail]? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case details = "details" - - } - - public init(details: [AttributeDetail]?, title: String?) { - - self.title = title - - self.details = details - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - details = try container.decode([AttributeDetail].self, forKey: .details) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(details, forKey: .details) - - - } - - } - - /* - Model: ProductsComparisonResponse - Used By: Catalog - */ - class ProductsComparisonResponse: Codable { - - public var attributesMetadata: [AttributeMetadata]? - - public var items: [ProductDetail]? - - - public enum CodingKeys: String, CodingKey { - - case attributesMetadata = "attributes_metadata" - - case items = "items" - - } - - public init(attributesMetadata: [AttributeMetadata]?, items: [ProductDetail]?) { - - self.attributesMetadata = attributesMetadata - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - attributesMetadata = try container.decode([AttributeMetadata].self, forKey: .attributesMetadata) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([ProductDetail].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(attributesMetadata, forKey: .attributesMetadata) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: ProductCompareResponse - Used By: Catalog - */ - class ProductCompareResponse: Codable { - - public var attributesMetadata: [AttributeMetadata]? - - public var title: String? - - public var items: [ProductDetail]? - - public var subtitle: String? - - - public enum CodingKeys: String, CodingKey { - - case attributesMetadata = "attributes_metadata" - - case title = "title" - - case items = "items" - - case subtitle = "subtitle" - - } - - public init(attributesMetadata: [AttributeMetadata]?, items: [ProductDetail]?, subtitle: String?, title: String?) { - - self.attributesMetadata = attributesMetadata - - self.title = title - - self.items = items - - self.subtitle = subtitle - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - attributesMetadata = try container.decode([AttributeMetadata].self, forKey: .attributesMetadata) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([ProductDetail].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subtitle = try container.decode(String.self, forKey: .subtitle) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(attributesMetadata, forKey: .attributesMetadata) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(subtitle, forKey: .subtitle) - - - } - - } - - /* - Model: ProductFrequentlyComparedSimilarResponse - Used By: Catalog - */ - class ProductFrequentlyComparedSimilarResponse: Codable { - - public var similars: ProductCompareResponse? - - - public enum CodingKeys: String, CodingKey { - - case similars = "similars" - - } - - public init(similars: ProductCompareResponse?) { - - self.similars = similars - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - similars = try container.decode(ProductCompareResponse.self, forKey: .similars) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(similars, forKey: .similars) - - - } - - } - - /* - Model: ProductSimilarItem - Used By: Catalog - */ - class ProductSimilarItem: Codable { - - public var title: String? - - public var items: [ProductDetail]? - - public var subtitle: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case items = "items" - - case subtitle = "subtitle" - - } - - public init(items: [ProductDetail]?, subtitle: String?, title: String?) { - - self.title = title - - self.items = items - - self.subtitle = subtitle - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([ProductDetail].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subtitle = try container.decode(String.self, forKey: .subtitle) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(subtitle, forKey: .subtitle) - - - } - - } - - /* - Model: SimilarProductByTypeResponse - Used By: Catalog - */ - class SimilarProductByTypeResponse: Codable { - - public var similars: ProductSimilarItem? - - - public enum CodingKeys: String, CodingKey { - - case similars = "similars" - - } - - public init(similars: ProductSimilarItem?) { - - self.similars = similars - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - similars = try container.decode(ProductSimilarItem.self, forKey: .similars) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(similars, forKey: .similars) - - - } - - } - - /* - Model: ProductVariantItemResponse - Used By: Catalog - */ - class ProductVariantItemResponse: Codable { - - public var color: String? - - public var value: String? - - public var slug: String? - - public var action: ProductListingAction? - - public var name: String? - - public var uid: Int? - - public var isAvailable: Bool? - - public var medias: [Media]? - - public var colorName: String? - - - public enum CodingKeys: String, CodingKey { - - case color = "color" - - case value = "value" - - case slug = "slug" - - case action = "action" - - case name = "name" - - case uid = "uid" - - case isAvailable = "is_available" - - case medias = "medias" - - case colorName = "color_name" - - } - - public init(action: ProductListingAction?, color: String?, colorName: String?, isAvailable: Bool?, medias: [Media]?, name: String?, slug: String?, uid: Int?, value: String?) { - - self.color = color - - self.value = value - - self.slug = slug - - self.action = action - - self.name = name - - self.uid = uid - - self.isAvailable = isAvailable - - self.medias = medias - - self.colorName = colorName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - color = try container.decode(String.self, forKey: .color) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(ProductListingAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isAvailable = try container.decode(Bool.self, forKey: .isAvailable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - medias = try container.decode([Media].self, forKey: .medias) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - colorName = try container.decode(String.self, forKey: .colorName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(color, forKey: .color) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(isAvailable, forKey: .isAvailable) - - - - try? container.encodeIfPresent(medias, forKey: .medias) - - - - try? container.encodeIfPresent(colorName, forKey: .colorName) - - - } - - } - - /* - Model: ProductVariantResponse - Used By: Catalog - */ - class ProductVariantResponse: Codable { - - public var header: String? - - public var key: String? - - public var displayType: String? - - public var items: [ProductVariantItemResponse]? - - - public enum CodingKeys: String, CodingKey { - - case header = "header" - - case key = "key" - - case displayType = "display_type" - - case items = "items" - - } - - public init(displayType: String?, header: String?, items: [ProductVariantItemResponse]?, key: String?) { - - self.header = header - - self.key = key - - self.displayType = displayType - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - header = try container.decode(String.self, forKey: .header) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayType = try container.decode(String.self, forKey: .displayType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([ProductVariantItemResponse].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(header, forKey: .header) - - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(displayType, forKey: .displayType) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: ProductVariantsResponse - Used By: Catalog - */ - class ProductVariantsResponse: Codable { - - public var variants: [ProductVariantResponse]? - - - public enum CodingKeys: String, CodingKey { - - case variants = "variants" - - } - - public init(variants: [ProductVariantResponse]?) { - - self.variants = variants - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - variants = try container.decode([ProductVariantResponse].self, forKey: .variants) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(variants, forKey: .variants) - - - } - - } - - /* - Model: CompanyDetail - Used By: Catalog - */ - class CompanyDetail: Codable { - - public var name: String? - - public var id: Int? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case id = "id" - - } - - public init(id: Int?, name: String?) { - - self.name = name - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: StoreDetail - Used By: Catalog - */ - class StoreDetail: Codable { - - public var city: String? - - public var code: String? - - public var name: String? - - public var id: Int? - - - public enum CodingKeys: String, CodingKey { - - case city = "city" - - case code = "code" - - case name = "name" - - case id = "id" - - } - - public init(city: String?, code: String?, id: Int?, name: String?) { - - self.city = city - - self.code = code - - self.name = name - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: ProductStockStatusItem - Used By: Catalog - */ - class ProductStockStatusItem: Codable { - - public var size: String? - - public var itemId: Int? - - public var seller: Seller? - - public var company: CompanyDetail? - - public var identifier: [String: Any]? - - public var uid: String? - - public var price: ProductStockPrice? - - public var store: StoreDetail? - - public var quantity: Int? - - - public enum CodingKeys: String, CodingKey { - - case size = "size" - - case itemId = "item_id" - - case seller = "seller" - - case company = "company" - - case identifier = "identifier" - - case uid = "uid" - - case price = "price" - - case store = "store" - - case quantity = "quantity" - - } - - public init(company: CompanyDetail?, identifier: [String: Any]?, itemId: Int?, price: ProductStockPrice?, quantity: Int?, seller: Seller?, size: String?, store: StoreDetail?, uid: String?) { - - self.size = size - - self.itemId = itemId - - self.seller = seller - - self.company = company - - self.identifier = identifier - - self.uid = uid - - self.price = price - - self.store = store - - self.quantity = quantity - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - size = try container.decode(String.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemId = try container.decode(Int.self, forKey: .itemId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - seller = try container.decode(Seller.self, forKey: .seller) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - company = try container.decode(CompanyDetail.self, forKey: .company) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - identifier = try container.decode([String: Any].self, forKey: .identifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(ProductStockPrice.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - store = try container.decode(StoreDetail.self, forKey: .store) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(itemId, forKey: .itemId) - - - - try? container.encodeIfPresent(seller, forKey: .seller) - - - - try? container.encodeIfPresent(company, forKey: .company) - - - - try? container.encodeIfPresent(identifier, forKey: .identifier) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(store, forKey: .store) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - } - - } - - /* - Model: ProductStockStatusResponse - Used By: Catalog - */ - class ProductStockStatusResponse: Codable { - - public var items: [ProductStockStatusItem]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - } - - public init(items: [ProductStockStatusItem]?) { - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([ProductStockStatusItem].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: ProductStockPolling - Used By: Catalog - */ - class ProductStockPolling: Codable { - - public var page: Page - - public var items: [ProductStockStatusItem]? - - - public enum CodingKeys: String, CodingKey { - - case page = "page" - - case items = "items" - - } - - public init(items: [ProductStockStatusItem]?, page: Page) { - - self.page = page - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - page = try container.decode(Page.self, forKey: .page) - - - - - do { - items = try container.decode([ProductStockStatusItem].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: ProductFiltersValue - Used By: Catalog - */ - class ProductFiltersValue: Codable { - - public var selectedMax: Int? - - public var value: String? - - public var min: Int? - - public var currencySymbol: String? - - public var currencyCode: String? - - public var selectedMin: Int? - - public var displayFormat: String? - - public var max: Int? - - public var display: String - - public var queryFormat: String? - - public var count: Int? - - public var isSelected: Bool - - - public enum CodingKeys: String, CodingKey { - - case selectedMax = "selected_max" - - case value = "value" - - case min = "min" - - case currencySymbol = "currency_symbol" - - case currencyCode = "currency_code" - - case selectedMin = "selected_min" - - case displayFormat = "display_format" - - case max = "max" - - case display = "display" - - case queryFormat = "query_format" - - case count = "count" - - case isSelected = "is_selected" - - } - - public init(count: Int?, currencyCode: String?, currencySymbol: String?, display: String, displayFormat: String?, isSelected: Bool, max: Int?, min: Int?, queryFormat: String?, selectedMax: Int?, selectedMin: Int?, value: String?) { - - self.selectedMax = selectedMax - - self.value = value - - self.min = min - - self.currencySymbol = currencySymbol - - self.currencyCode = currencyCode - - self.selectedMin = selectedMin - - self.displayFormat = displayFormat - - self.max = max - - self.display = display - - self.queryFormat = queryFormat - - self.count = count - - self.isSelected = isSelected - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - selectedMax = try container.decode(Int.self, forKey: .selectedMax) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - min = try container.decode(Int.self, forKey: .min) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencySymbol = try container.decode(String.self, forKey: .currencySymbol) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - selectedMin = try container.decode(Int.self, forKey: .selectedMin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayFormat = try container.decode(String.self, forKey: .displayFormat) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - max = try container.decode(Int.self, forKey: .max) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - display = try container.decode(String.self, forKey: .display) - - - - - do { - queryFormat = try container.decode(String.self, forKey: .queryFormat) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - isSelected = try container.decode(Bool.self, forKey: .isSelected) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(selectedMax, forKey: .selectedMax) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(min, forKey: .min) - - - - try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - - try? container.encodeIfPresent(selectedMin, forKey: .selectedMin) - - - - try? container.encodeIfPresent(displayFormat, forKey: .displayFormat) - - - - try? container.encodeIfPresent(max, forKey: .max) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(queryFormat, forKey: .queryFormat) - - - - try? container.encodeIfPresent(count, forKey: .count) - - - - try? container.encodeIfPresent(isSelected, forKey: .isSelected) - - - } - - } - - /* - Model: ProductFiltersKey - Used By: Catalog - */ - class ProductFiltersKey: Codable { - - public var display: String - - public var logo: String? - - public var kind: String? - - public var name: String - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case logo = "logo" - - case kind = "kind" - - case name = "name" - - } - - public init(display: String, kind: String?, logo: String?, name: String) { - - self.display = display - - self.logo = logo - - self.kind = kind - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - display = try container.decode(String.self, forKey: .display) - - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - kind = try container.decode(String.self, forKey: .kind) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(kind, forKey: .kind) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: ProductFilters - Used By: Catalog - */ - class ProductFilters: Codable { - - public var values: [ProductFiltersValue] - - public var key: ProductFiltersKey - - - public enum CodingKeys: String, CodingKey { - - case values = "values" - - case key = "key" - - } - - public init(key: ProductFiltersKey, values: [ProductFiltersValue]) { - - self.values = values - - self.key = key - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - values = try container.decode([ProductFiltersValue].self, forKey: .values) - - - - - key = try container.decode(ProductFiltersKey.self, forKey: .key) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(values, forKey: .values) - - - - try? container.encodeIfPresent(key, forKey: .key) - - - } - - } - - /* - Model: ProductSortOn - Used By: Catalog - */ - class ProductSortOn: Codable { - - public var value: String? - - public var isSelected: Bool? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case value = "value" - - case isSelected = "is_selected" - - case name = "name" - - } - - public init(isSelected: Bool?, name: String?, value: String?) { - - self.value = value - - self.isSelected = isSelected - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isSelected = try container.decode(Bool.self, forKey: .isSelected) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(isSelected, forKey: .isSelected) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: ProductListingDetail - Used By: Catalog - */ - class ProductListingDetail: Codable { - - public var ratingCount: Int? - - public var shortDescription: String? - - public var slug: String - - public var action: ProductListingAction? - - public var uid: Int? - - public var discount: String? - - public var rating: Double? - - public var itemType: String? - - public var name: String? - - public var medias: [Media]? - - public var price: ProductListingPrice? - - public var similars: [String]? - - public var color: String? - - public var categories: [ProductBrand]? - - public var itemCode: String? - - public var type: String? - - public var highlights: [String]? - - public var sellable: Bool? - - public var hasVariant: Bool? - - public var imageNature: String? - - public var groupedAttributes: [ProductDetailGroupedAttribute]? - - public var tryouts: [String]? - - public var attributes: [String: Any]? - - public var description: String? - - public var teaserTag: String? - - public var brand: ProductBrand? - - public var productOnlineDate: String? - - - public enum CodingKeys: String, CodingKey { - - case ratingCount = "rating_count" - - case shortDescription = "short_description" - - case slug = "slug" - - case action = "action" - - case uid = "uid" - - case discount = "discount" - - case rating = "rating" - - case itemType = "item_type" - - case name = "name" - - case medias = "medias" - - case price = "price" - - case similars = "similars" - - case color = "color" - - case categories = "categories" - - case itemCode = "item_code" - - case type = "type" - - case highlights = "highlights" - - case sellable = "sellable" - - case hasVariant = "has_variant" - - case imageNature = "image_nature" - - case groupedAttributes = "grouped_attributes" - - case tryouts = "tryouts" - - case attributes = "attributes" - - case description = "description" - - case teaserTag = "teaser_tag" - - case brand = "brand" - - case productOnlineDate = "product_online_date" - - } - - public init(action: ProductListingAction?, attributes: [String: Any]?, brand: ProductBrand?, categories: [ProductBrand]?, color: String?, description: String?, discount: String?, groupedAttributes: [ProductDetailGroupedAttribute]?, hasVariant: Bool?, highlights: [String]?, imageNature: String?, itemCode: String?, itemType: String?, medias: [Media]?, name: String?, price: ProductListingPrice?, productOnlineDate: String?, rating: Double?, ratingCount: Int?, sellable: Bool?, shortDescription: String?, similars: [String]?, slug: String, teaserTag: String?, tryouts: [String]?, type: String?, uid: Int?) { - - self.ratingCount = ratingCount - - self.shortDescription = shortDescription - - self.slug = slug - - self.action = action - - self.uid = uid - - self.discount = discount - - self.rating = rating - - self.itemType = itemType - - self.name = name - - self.medias = medias - - self.price = price - - self.similars = similars - - self.color = color - - self.categories = categories - - self.itemCode = itemCode - - self.type = type - - self.highlights = highlights - - self.sellable = sellable - - self.hasVariant = hasVariant - - self.imageNature = imageNature - - self.groupedAttributes = groupedAttributes - - self.tryouts = tryouts - - self.attributes = attributes - - self.description = description - - self.teaserTag = teaserTag - - self.brand = brand - - self.productOnlineDate = productOnlineDate - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - ratingCount = try container.decode(Int.self, forKey: .ratingCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shortDescription = try container.decode(String.self, forKey: .shortDescription) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - slug = try container.decode(String.self, forKey: .slug) - - - - - do { - action = try container.decode(ProductListingAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discount = try container.decode(String.self, forKey: .discount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rating = try container.decode(Double.self, forKey: .rating) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemType = try container.decode(String.self, forKey: .itemType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - medias = try container.decode([Media].self, forKey: .medias) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(ProductListingPrice.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - similars = try container.decode([String].self, forKey: .similars) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - color = try container.decode(String.self, forKey: .color) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - categories = try container.decode([ProductBrand].self, forKey: .categories) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemCode = try container.decode(String.self, forKey: .itemCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - highlights = try container.decode([String].self, forKey: .highlights) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sellable = try container.decode(Bool.self, forKey: .sellable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasVariant = try container.decode(Bool.self, forKey: .hasVariant) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - imageNature = try container.decode(String.self, forKey: .imageNature) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - groupedAttributes = try container.decode([ProductDetailGroupedAttribute].self, forKey: .groupedAttributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tryouts = try container.decode([String].self, forKey: .tryouts) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attributes = try container.decode([String: Any].self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - teaserTag = try container.decode(String.self, forKey: .teaserTag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brand = try container.decode(ProductBrand.self, forKey: .brand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productOnlineDate = try container.decode(String.self, forKey: .productOnlineDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(ratingCount, forKey: .ratingCount) - - - - try? container.encodeIfPresent(shortDescription, forKey: .shortDescription) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - - try? container.encodeIfPresent(rating, forKey: .rating) - - - - try? container.encodeIfPresent(itemType, forKey: .itemType) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(medias, forKey: .medias) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(similars, forKey: .similars) - - - - try? container.encodeIfPresent(color, forKey: .color) - - - - try? container.encodeIfPresent(categories, forKey: .categories) - - - - try? container.encodeIfPresent(itemCode, forKey: .itemCode) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(highlights, forKey: .highlights) - - - - try? container.encodeIfPresent(sellable, forKey: .sellable) - - - - try? container.encodeIfPresent(hasVariant, forKey: .hasVariant) - - - - try? container.encodeIfPresent(imageNature, forKey: .imageNature) - - - - try? container.encodeIfPresent(groupedAttributes, forKey: .groupedAttributes) - - - - try? container.encodeIfPresent(tryouts, forKey: .tryouts) - - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(teaserTag, forKey: .teaserTag) - - - - try? container.encodeIfPresent(brand, forKey: .brand) - - - - try? container.encodeIfPresent(productOnlineDate, forKey: .productOnlineDate) - - - } - - } - - /* - Model: ProductListingResponse - Used By: Catalog - */ - class ProductListingResponse: Codable { - - public var filters: [ProductFilters]? - - public var page: Page - - public var sortOn: [ProductSortOn]? - - public var items: [ProductListingDetail]? - - - public enum CodingKeys: String, CodingKey { - - case filters = "filters" - - case page = "page" - - case sortOn = "sort_on" - - case items = "items" - - } - - public init(filters: [ProductFilters]?, items: [ProductListingDetail]?, page: Page, sortOn: [ProductSortOn]?) { - - self.filters = filters - - self.page = page - - self.sortOn = sortOn - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - filters = try container.decode([ProductFilters].self, forKey: .filters) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - page = try container.decode(Page.self, forKey: .page) - - - - - do { - sortOn = try container.decode([ProductSortOn].self, forKey: .sortOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([ProductListingDetail].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(filters, forKey: .filters) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(sortOn, forKey: .sortOn) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: ImageUrls - Used By: Catalog - */ - class ImageUrls: Codable { - - public var portrait: Media? - - public var landscape: Media? - - - public enum CodingKeys: String, CodingKey { - - case portrait = "portrait" - - case landscape = "landscape" - - } - - public init(landscape: Media?, portrait: Media?) { - - self.portrait = portrait - - self.landscape = landscape - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - portrait = try container.decode(Media.self, forKey: .portrait) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - landscape = try container.decode(Media.self, forKey: .landscape) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(portrait, forKey: .portrait) - - - - try? container.encodeIfPresent(landscape, forKey: .landscape) - - - } - - } - - /* - Model: BrandItem - Used By: Catalog - */ - class BrandItem: Codable { - - public var departments: [String]? - - public var banners: ImageUrls? - - public var action: ProductListingAction? - - public var logo: Media? - - public var name: String? - - public var uid: Int? - - public var slug: String? - - public var discount: String? - - - public enum CodingKeys: String, CodingKey { - - case departments = "departments" - - case banners = "banners" - - case action = "action" - - case logo = "logo" - - case name = "name" - - case uid = "uid" - - case slug = "slug" - - case discount = "discount" - - } - - public init(action: ProductListingAction?, banners: ImageUrls?, departments: [String]?, discount: String?, logo: Media?, name: String?, slug: String?, uid: Int?) { - - self.departments = departments - - self.banners = banners - - self.action = action - - self.logo = logo - - self.name = name - - self.uid = uid - - self.slug = slug - - self.discount = discount - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - departments = try container.decode([String].self, forKey: .departments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - banners = try container.decode(ImageUrls.self, forKey: .banners) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(ProductListingAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(Media.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discount = try container.decode(String.self, forKey: .discount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(departments, forKey: .departments) - - - - try? container.encodeIfPresent(banners, forKey: .banners) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - } - - } - - /* - Model: BrandListingResponse - Used By: Catalog - */ - class BrandListingResponse: Codable { - - public var page: Page - - public var items: [BrandItem]? - - - public enum CodingKeys: String, CodingKey { - - case page = "page" - - case items = "items" - - } - - public init(items: [BrandItem]?, page: Page) { - - self.page = page - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - page = try container.decode(Page.self, forKey: .page) - - - - - do { - items = try container.decode([BrandItem].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: BrandDetailResponse - Used By: Catalog - */ - class BrandDetailResponse: Codable { - - public var banners: ImageUrls? - - public var logo: Media? - - public var name: String? - - public var uid: Int? - - - public enum CodingKeys: String, CodingKey { - - case banners = "banners" - - case logo = "logo" - - case name = "name" - - case uid = "uid" - - } - - public init(banners: ImageUrls?, logo: Media?, name: String?, uid: Int?) { - - self.banners = banners - - self.logo = logo - - self.name = name - - self.uid = uid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - banners = try container.decode(ImageUrls.self, forKey: .banners) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(Media.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(banners, forKey: .banners) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - } - - } - - /* - Model: DepartmentIdentifier - Used By: Catalog - */ - class DepartmentIdentifier: Codable { - - public var slug: String? - - public var uid: Int? - - - public enum CodingKeys: String, CodingKey { - - case slug = "slug" - - case uid = "uid" - - } - - public init(slug: String?, uid: Int?) { - - self.slug = slug - - self.uid = uid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - } - - } - - /* - Model: ThirdLevelChild - Used By: Catalog - */ - class ThirdLevelChild: Codable { - - public var banners: ImageUrls? - - public var slug: String? - - public var action: ProductListingAction? - - public var name: String? - - public var uid: Int? - - public var customJson: [String: Any]? - - public var childs: [[String: Any]]? - - - public enum CodingKeys: String, CodingKey { - - case banners = "banners" - - case slug = "slug" - - case action = "action" - - case name = "name" - - case uid = "uid" - - case customJson = "_custom_json" - - case childs = "childs" - - } - - public init(action: ProductListingAction?, banners: ImageUrls?, childs: [[String: Any]]?, name: String?, slug: String?, uid: Int?, customJson: [String: Any]?) { - - self.banners = banners - - self.slug = slug - - self.action = action - - self.name = name - - self.uid = uid - - self.customJson = customJson - - self.childs = childs - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - banners = try container.decode(ImageUrls.self, forKey: .banners) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(ProductListingAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - childs = try container.decode([[String: Any]].self, forKey: .childs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(banners, forKey: .banners) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(childs, forKey: .childs) - - - } - - } - - /* - Model: SecondLevelChild - Used By: Catalog - */ - class SecondLevelChild: Codable { - - public var banners: ImageUrls? - - public var slug: String? - - public var action: ProductListingAction? - - public var name: String? - - public var uid: Int? - - public var customJson: [String: Any]? - - public var childs: [ThirdLevelChild]? - - - public enum CodingKeys: String, CodingKey { - - case banners = "banners" - - case slug = "slug" - - case action = "action" - - case name = "name" - - case uid = "uid" - - case customJson = "_custom_json" - - case childs = "childs" - - } - - public init(action: ProductListingAction?, banners: ImageUrls?, childs: [ThirdLevelChild]?, name: String?, slug: String?, uid: Int?, customJson: [String: Any]?) { - - self.banners = banners - - self.slug = slug - - self.action = action - - self.name = name - - self.uid = uid - - self.customJson = customJson - - self.childs = childs - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - banners = try container.decode(ImageUrls.self, forKey: .banners) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(ProductListingAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - childs = try container.decode([ThirdLevelChild].self, forKey: .childs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(banners, forKey: .banners) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(childs, forKey: .childs) - - - } - - } - - /* - Model: Child - Used By: Catalog - */ - class Child: Codable { - - public var banners: ImageUrls? - - public var slug: String? - - public var action: ProductListingAction? - - public var name: String? - - public var uid: Int? - - public var customJson: [String: Any]? - - public var childs: [SecondLevelChild]? - - - public enum CodingKeys: String, CodingKey { - - case banners = "banners" - - case slug = "slug" - - case action = "action" - - case name = "name" - - case uid = "uid" - - case customJson = "_custom_json" - - case childs = "childs" - - } - - public init(action: ProductListingAction?, banners: ImageUrls?, childs: [SecondLevelChild]?, name: String?, slug: String?, uid: Int?, customJson: [String: Any]?) { - - self.banners = banners - - self.slug = slug - - self.action = action - - self.name = name - - self.uid = uid - - self.customJson = customJson - - self.childs = childs - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - banners = try container.decode(ImageUrls.self, forKey: .banners) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(ProductListingAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - childs = try container.decode([SecondLevelChild].self, forKey: .childs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(banners, forKey: .banners) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(childs, forKey: .childs) - - - } - - } - - /* - Model: CategoryItems - Used By: Catalog - */ - class CategoryItems: Codable { - - public var banners: ImageUrls? - - public var slug: String? - - public var action: ProductListingAction? - - public var name: String? - - public var uid: Int? - - public var childs: [Child]? - - - public enum CodingKeys: String, CodingKey { - - case banners = "banners" - - case slug = "slug" - - case action = "action" - - case name = "name" - - case uid = "uid" - - case childs = "childs" - - } - - public init(action: ProductListingAction?, banners: ImageUrls?, childs: [Child]?, name: String?, slug: String?, uid: Int?) { - - self.banners = banners - - self.slug = slug - - self.action = action - - self.name = name - - self.uid = uid - - self.childs = childs - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - banners = try container.decode(ImageUrls.self, forKey: .banners) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(ProductListingAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - childs = try container.decode([Child].self, forKey: .childs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(banners, forKey: .banners) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(childs, forKey: .childs) - - - } - - } - - /* - Model: DepartmentCategoryTree - Used By: Catalog - */ - class DepartmentCategoryTree: Codable { - - public var department: String? - - public var items: [CategoryItems]? - - - public enum CodingKeys: String, CodingKey { - - case department = "department" - - case items = "items" - - } - - public init(department: String?, items: [CategoryItems]?) { - - self.department = department - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - department = try container.decode(String.self, forKey: .department) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([CategoryItems].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(department, forKey: .department) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: CategoryListingResponse - Used By: Catalog - */ - class CategoryListingResponse: Codable { - - public var departments: [DepartmentIdentifier]? - - public var data: [DepartmentCategoryTree]? - - - public enum CodingKeys: String, CodingKey { - - case departments = "departments" - - case data = "data" - - } - - public init(data: [DepartmentCategoryTree]?, departments: [DepartmentIdentifier]?) { - - self.departments = departments - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - departments = try container.decode([DepartmentIdentifier].self, forKey: .departments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode([DepartmentCategoryTree].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(departments, forKey: .departments) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: CategoryMetaResponse - Used By: Catalog - */ - class CategoryMetaResponse: Codable { - - public var banners: ImageUrls? - - public var logo: Media? - - public var name: String? - - public var uid: Int? - - - public enum CodingKeys: String, CodingKey { - - case banners = "banners" - - case logo = "logo" - - case name = "name" - - case uid = "uid" - - } - - public init(banners: ImageUrls?, logo: Media?, name: String?, uid: Int?) { - - self.banners = banners - - self.logo = logo - - self.name = name - - self.uid = uid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - banners = try container.decode(ImageUrls.self, forKey: .banners) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(Media.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(banners, forKey: .banners) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - } - - } - - /* - Model: HomeListingResponse - Used By: Catalog - */ - class HomeListingResponse: Codable { - - public var message: String? - - public var page: Page - - public var items: [ProductListingDetail]? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - case page = "page" - - case items = "items" - - } - - public init(items: [ProductListingDetail]?, message: String?, page: Page) { - - self.message = message - - self.page = page - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - page = try container.decode(Page.self, forKey: .page) - - - - - do { - items = try container.decode([ProductListingDetail].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: Department - Used By: Catalog - */ - class Department: Codable { - - public var slug: String? - - public var priorityOrder: Int? - - public var name: String? - - public var uid: Int? - - public var logo: Media? - - - public enum CodingKeys: String, CodingKey { - - case slug = "slug" - - case priorityOrder = "priority_order" - - case name = "name" - - case uid = "uid" - - case logo = "logo" - - } - - public init(logo: Media?, name: String?, priorityOrder: Int?, slug: String?, uid: Int?) { - - self.slug = slug - - self.priorityOrder = priorityOrder - - self.name = name - - self.uid = uid - - self.logo = logo - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priorityOrder = try container.decode(Int.self, forKey: .priorityOrder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(Media.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(priorityOrder, forKey: .priorityOrder) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - } - - } - - /* - Model: DepartmentResponse - Used By: Catalog - */ - class DepartmentResponse: Codable { - - public var items: [Department]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - } - - public init(items: [Department]?) { - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Department].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: AutocompleteItem - Used By: Catalog - */ - class AutocompleteItem: Codable { - - public var display: String? - - public var action: ProductListingAction? - - public var logo: Media? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case action = "action" - - case logo = "logo" - - case type = "type" - - } - - public init(action: ProductListingAction?, display: String?, logo: Media?, type: String?) { - - self.display = display - - self.action = action - - self.logo = logo - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(ProductListingAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(Media.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: AutoCompleteResponse - Used By: Catalog - */ - class AutoCompleteResponse: Codable { - - public var items: [AutocompleteItem]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - } - - public init(items: [AutocompleteItem]?) { - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([AutocompleteItem].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: CollectionListingFilterTag - Used By: Catalog - */ - class CollectionListingFilterTag: Codable { - - public var display: String? - - public var isSelected: Bool? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case isSelected = "is_selected" - - case name = "name" - - } - - public init(display: String?, isSelected: Bool?, name: String?) { - - self.display = display - - self.isSelected = isSelected - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isSelected = try container.decode(Bool.self, forKey: .isSelected) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(isSelected, forKey: .isSelected) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: CollectionListingFilterType - Used By: Catalog - */ - class CollectionListingFilterType: Codable { - - public var display: String? - - public var isSelected: Bool? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case isSelected = "is_selected" - - case name = "name" - - } - - public init(display: String?, isSelected: Bool?, name: String?) { - - self.display = display - - self.isSelected = isSelected - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isSelected = try container.decode(Bool.self, forKey: .isSelected) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(isSelected, forKey: .isSelected) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: CollectionListingFilter - Used By: Catalog - */ - class CollectionListingFilter: Codable { - - public var tags: [CollectionListingFilterTag]? - - public var type: [CollectionListingFilterType]? - - - public enum CodingKeys: String, CodingKey { - - case tags = "tags" - - case type = "type" - - } - - public init(tags: [CollectionListingFilterTag]?, type: [CollectionListingFilterType]?) { - - self.tags = tags - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - tags = try container.decode([CollectionListingFilterTag].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode([CollectionListingFilterType].self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: GetCollectionDetailNest - Used By: Catalog - */ - class GetCollectionDetailNest: Codable { - - public var query: [String: Any]? - - public var slug: String? - - public var allowSort: Bool? - - public var action: ProductListingAction? - - public var uid: String? - - public var allowFacets: Bool? - - public var appId: String? - - public var schedule: [String: Any]? - - public var banners: ImageUrls? - - public var name: String? - - public var badge: [String: Any]? - - public var isActive: Bool? - - public var tag: [String]? - - public var cron: [String: Any]? - - public var type: String? - - public var visibleFacetsKeys: [String]? - - public var description: String? - - public var meta: [String: Any]? - - public var logo: Media? - - - public enum CodingKeys: String, CodingKey { - - case query = "query" - - case slug = "slug" - - case allowSort = "allow_sort" - - case action = "action" - - case uid = "uid" - - case allowFacets = "allow_facets" - - case appId = "app_id" - - case schedule = "_schedule" - - case banners = "banners" - - case name = "name" - - case badge = "badge" - - case isActive = "is_active" - - case tag = "tag" - - case cron = "cron" - - case type = "type" - - case visibleFacetsKeys = "visible_facets_keys" - - case description = "description" - - case meta = "meta" - - case logo = "logo" - - } - - public init(action: ProductListingAction?, allowFacets: Bool?, allowSort: Bool?, appId: String?, badge: [String: Any]?, banners: ImageUrls?, cron: [String: Any]?, description: String?, isActive: Bool?, logo: Media?, meta: [String: Any]?, name: String?, query: [String: Any]?, slug: String?, tag: [String]?, type: String?, uid: String?, visibleFacetsKeys: [String]?, schedule: [String: Any]?) { - - self.query = query - - self.slug = slug - - self.allowSort = allowSort - - self.action = action - - self.uid = uid - - self.allowFacets = allowFacets - - self.appId = appId - - self.schedule = schedule - - self.banners = banners - - self.name = name - - self.badge = badge - - self.isActive = isActive - - self.tag = tag - - self.cron = cron - - self.type = type - - self.visibleFacetsKeys = visibleFacetsKeys - - self.description = description - - self.meta = meta - - self.logo = logo - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - query = try container.decode([String: Any].self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allowSort = try container.decode(Bool.self, forKey: .allowSort) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(ProductListingAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allowFacets = try container.decode(Bool.self, forKey: .allowFacets) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode([String: Any].self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - banners = try container.decode(ImageUrls.self, forKey: .banners) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - badge = try container.decode([String: Any].self, forKey: .badge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tag = try container.decode([String].self, forKey: .tag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cron = try container.decode([String: Any].self, forKey: .cron) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - visibleFacetsKeys = try container.decode([String].self, forKey: .visibleFacetsKeys) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(Media.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(query, forKey: .query) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(allowSort, forKey: .allowSort) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(allowFacets, forKey: .allowFacets) - - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - - try? container.encodeIfPresent(banners, forKey: .banners) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(badge, forKey: .badge) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(tag, forKey: .tag) - - - - try? container.encodeIfPresent(cron, forKey: .cron) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(visibleFacetsKeys, forKey: .visibleFacetsKeys) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - } - - } - - /* - Model: GetCollectionListingResponse - Used By: Catalog - */ - class GetCollectionListingResponse: Codable { - - public var filters: CollectionListingFilter? - - public var page: Page - - public var items: [GetCollectionDetailNest]? - - - public enum CodingKeys: String, CodingKey { - - case filters = "filters" - - case page = "page" - - case items = "items" - - } - - public init(filters: CollectionListingFilter?, items: [GetCollectionDetailNest]?, page: Page) { - - self.filters = filters - - self.page = page - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - filters = try container.decode(CollectionListingFilter.self, forKey: .filters) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - page = try container.decode(Page.self, forKey: .page) - - - - - do { - items = try container.decode([GetCollectionDetailNest].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(filters, forKey: .filters) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: CollectionDetailResponse - Used By: Catalog - */ - class CollectionDetailResponse: Codable { - - public var tag: [String]? - - public var schedule: [String: Any]? - - public var banners: ImageUrls? - - public var allowFacets: Bool? - - public var query: [String: Any]? - - public var slug: String? - - public var description: String? - - public var name: String? - - public var cron: [String: Any]? - - public var type: String? - - public var allowSort: Bool? - - public var visibleFacetsKeys: [String]? - - public var badge: [String: Any]? - - public var appId: String? - - public var meta: [String: Any]? - - public var isActive: Bool? - - public var logo: Media? - - - public enum CodingKeys: String, CodingKey { - - case tag = "tag" - - case schedule = "_schedule" - - case banners = "banners" - - case allowFacets = "allow_facets" - - case query = "query" - - case slug = "slug" - - case description = "description" - - case name = "name" - - case cron = "cron" - - case type = "type" - - case allowSort = "allow_sort" - - case visibleFacetsKeys = "visible_facets_keys" - - case badge = "badge" - - case appId = "app_id" - - case meta = "meta" - - case isActive = "is_active" - - case logo = "logo" - - } - - public init(allowFacets: Bool?, allowSort: Bool?, appId: String?, badge: [String: Any]?, banners: ImageUrls?, cron: [String: Any]?, description: String?, isActive: Bool?, logo: Media?, meta: [String: Any]?, name: String?, query: [String: Any]?, slug: String?, tag: [String]?, type: String?, visibleFacetsKeys: [String]?, schedule: [String: Any]?) { - - self.tag = tag - - self.schedule = schedule - - self.banners = banners - - self.allowFacets = allowFacets - - self.query = query - - self.slug = slug - - self.description = description - - self.name = name - - self.cron = cron - - self.type = type - - self.allowSort = allowSort - - self.visibleFacetsKeys = visibleFacetsKeys - - self.badge = badge - - self.appId = appId - - self.meta = meta - - self.isActive = isActive - - self.logo = logo - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - tag = try container.decode([String].self, forKey: .tag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode([String: Any].self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - banners = try container.decode(ImageUrls.self, forKey: .banners) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allowFacets = try container.decode(Bool.self, forKey: .allowFacets) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - query = try container.decode([String: Any].self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cron = try container.decode([String: Any].self, forKey: .cron) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allowSort = try container.decode(Bool.self, forKey: .allowSort) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - visibleFacetsKeys = try container.decode([String].self, forKey: .visibleFacetsKeys) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - badge = try container.decode([String: Any].self, forKey: .badge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(Media.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(tag, forKey: .tag) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - - try? container.encodeIfPresent(banners, forKey: .banners) - - - - try? container.encodeIfPresent(allowFacets, forKey: .allowFacets) - - - - try? container.encodeIfPresent(query, forKey: .query) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(cron, forKey: .cron) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(allowSort, forKey: .allowSort) - - - - try? container.encodeIfPresent(visibleFacetsKeys, forKey: .visibleFacetsKeys) - - - - try? container.encodeIfPresent(badge, forKey: .badge) - - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - } - - } - - /* - Model: GetFollowListingResponse - Used By: Catalog - */ - class GetFollowListingResponse: Codable { - - public var page: Page - - public var items: [ProductListingDetail] - - - public enum CodingKeys: String, CodingKey { - - case page = "page" - - case items = "items" - - } - - public init(items: [ProductListingDetail], page: Page) { - - self.page = page - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - page = try container.decode(Page.self, forKey: .page) - - - - - items = try container.decode([ProductListingDetail].self, forKey: .items) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: FollowPostResponse - Used By: Catalog - */ - class FollowPostResponse: Codable { - - public var message: String - - public var id: String - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - case id = "id" - - } - - public init(id: String, message: String) { - - self.message = message - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - message = try container.decode(String.self, forKey: .message) - - - - - id = try container.decode(String.self, forKey: .id) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: FollowerCountResponse - Used By: Catalog - */ - class FollowerCountResponse: Codable { - - public var count: Int? - - - public enum CodingKeys: String, CodingKey { - - case count = "count" - - } - - public init(count: Int?) { - - self.count = count - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(count, forKey: .count) - - - } - - } - - /* - Model: FollowIdsData - Used By: Catalog - */ - class FollowIdsData: Codable { - - public var collections: [Int]? - - public var products: [Int]? - - public var brands: [Int]? - - - public enum CodingKeys: String, CodingKey { - - case collections = "collections" - - case products = "products" - - case brands = "brands" - - } - - public init(brands: [Int]?, collections: [Int]?, products: [Int]?) { - - self.collections = collections - - self.products = products - - self.brands = brands - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - collections = try container.decode([Int].self, forKey: .collections) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - products = try container.decode([Int].self, forKey: .products) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brands = try container.decode([Int].self, forKey: .brands) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(collections, forKey: .collections) - - - - try? container.encodeIfPresent(products, forKey: .products) - - - - try? container.encodeIfPresent(brands, forKey: .brands) - - - } - - } - - /* - Model: FollowIdsResponse - Used By: Catalog - */ - class FollowIdsResponse: Codable { - - public var data: FollowIdsData? - - - public enum CodingKeys: String, CodingKey { - - case data = "data" - - } - - public init(data: FollowIdsData?) { - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - data = try container.decode(FollowIdsData.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: LatLong - Used By: Catalog - */ - class LatLong: Codable { - - public var coordinates: [Double]? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case coordinates = "coordinates" - - case type = "type" - - } - - public init(coordinates: [Double]?, type: String?) { - - self.coordinates = coordinates - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - coordinates = try container.decode([Double].self, forKey: .coordinates) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(coordinates, forKey: .coordinates) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: Store1 - Used By: Catalog - */ - class Store1: Codable { - - public var storeEmail: String? - - public var city: String? - - public var storeCode: String? - - public var address: String? - - public var pincode: Int? - - public var latLong: LatLong? - - public var name: String? - - public var uid: Int? - - public var country: String? - - public var state: String? - - - public enum CodingKeys: String, CodingKey { - - case storeEmail = "store_email" - - case city = "city" - - case storeCode = "store_code" - - case address = "address" - - case pincode = "pincode" - - case latLong = "lat_long" - - case name = "name" - - case uid = "uid" - - case country = "country" - - case state = "state" - - } - - public init(address: String?, city: String?, country: String?, latLong: LatLong?, name: String?, pincode: Int?, state: String?, storeCode: String?, storeEmail: String?, uid: Int?) { - - self.storeEmail = storeEmail - - self.city = city - - self.storeCode = storeCode - - self.address = address - - self.pincode = pincode - - self.latLong = latLong - - self.name = name - - self.uid = uid - - self.country = country - - self.state = state - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - storeEmail = try container.decode(String.self, forKey: .storeEmail) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeCode = try container.decode(String.self, forKey: .storeCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address = try container.decode(String.self, forKey: .address) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(Int.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - latLong = try container.decode(LatLong.self, forKey: .latLong) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(String.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(storeEmail, forKey: .storeEmail) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(storeCode, forKey: .storeCode) - - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(latLong, forKey: .latLong) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - } - - } - - /* - Model: StoreListingResponse - Used By: Catalog - */ - class StoreListingResponse: Codable { - - public var page: Page - - public var items: [Store1] - - - public enum CodingKeys: String, CodingKey { - - case page = "page" - - case items = "items" - - } - - public init(items: [Store1], page: Page) { - - self.page = page - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - page = try container.decode(Page.self, forKey: .page) - - - - - items = try container.decode([Store1].self, forKey: .items) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - - - /* - Model: PromiseFormatted - Used By: Cart - */ - class PromiseFormatted: Codable { - - public var min: String? - - public var max: String? - - - public enum CodingKeys: String, CodingKey { - - case min = "min" - - case max = "max" - - } - - public init(max: String?, min: String?) { - - self.min = min - - self.max = max - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - min = try container.decode(String.self, forKey: .min) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - max = try container.decode(String.self, forKey: .max) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(min, forKey: .min) - - - - try? container.encodeIfPresent(max, forKey: .max) - - - } - - } - - /* - Model: PromiseTimestamp - Used By: Cart - */ - class PromiseTimestamp: Codable { - - public var min: Double? - - public var max: Double? - - - public enum CodingKeys: String, CodingKey { - - case min = "min" - - case max = "max" - - } - - public init(max: Double?, min: Double?) { - - self.min = min - - self.max = max - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - min = try container.decode(Double.self, forKey: .min) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - max = try container.decode(Double.self, forKey: .max) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(min, forKey: .min) - - - - try? container.encodeIfPresent(max, forKey: .max) - - - } - - } - - /* - Model: ShipmentPromise - Used By: Cart - */ - class ShipmentPromise: Codable { - - public var formatted: PromiseFormatted? - - public var timestamp: PromiseTimestamp? - - - public enum CodingKeys: String, CodingKey { - - case formatted = "formatted" - - case timestamp = "timestamp" - - } - - public init(formatted: PromiseFormatted?, timestamp: PromiseTimestamp?) { - - self.formatted = formatted - - self.timestamp = timestamp - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - formatted = try container.decode(PromiseFormatted.self, forKey: .formatted) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - timestamp = try container.decode(PromiseTimestamp.self, forKey: .timestamp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(formatted, forKey: .formatted) - - - - try? container.encodeIfPresent(timestamp, forKey: .timestamp) - - - } - - } - - /* - Model: RawBreakup - Used By: Cart - */ - class RawBreakup: Codable { - - public var codCharge: Double? - - public var subtotal: Double? - - public var youSaved: Double? - - public var vog: Double? - - public var coupon: Double? - - public var deliveryCharge: Double? - - public var gstCharges: Double? - - public var convenienceFee: Double? - - public var fyndCash: Double? - - public var mrpTotal: String? - - public var discount: Double? - - public var total: Double? - - - public enum CodingKeys: String, CodingKey { - - case codCharge = "cod_charge" - - case subtotal = "subtotal" - - case youSaved = "you_saved" - - case vog = "vog" - - case coupon = "coupon" - - case deliveryCharge = "delivery_charge" - - case gstCharges = "gst_charges" - - case convenienceFee = "convenience_fee" - - case fyndCash = "fynd_cash" - - case mrpTotal = "mrp_total" - - case discount = "discount" - - case total = "total" - - } - - public init(codCharge: Double?, convenienceFee: Double?, coupon: Double?, deliveryCharge: Double?, discount: Double?, fyndCash: Double?, gstCharges: Double?, mrpTotal: String?, subtotal: Double?, total: Double?, vog: Double?, youSaved: Double?) { - - self.codCharge = codCharge - - self.subtotal = subtotal - - self.youSaved = youSaved - - self.vog = vog - - self.coupon = coupon - - self.deliveryCharge = deliveryCharge - - self.gstCharges = gstCharges - - self.convenienceFee = convenienceFee - - self.fyndCash = fyndCash - - self.mrpTotal = mrpTotal - - self.discount = discount - - self.total = total - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - codCharge = try container.decode(Double.self, forKey: .codCharge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subtotal = try container.decode(Double.self, forKey: .subtotal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - youSaved = try container.decode(Double.self, forKey: .youSaved) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - vog = try container.decode(Double.self, forKey: .vog) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - coupon = try container.decode(Double.self, forKey: .coupon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryCharge = try container.decode(Double.self, forKey: .deliveryCharge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstCharges = try container.decode(Double.self, forKey: .gstCharges) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - convenienceFee = try container.decode(Double.self, forKey: .convenienceFee) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fyndCash = try container.decode(Double.self, forKey: .fyndCash) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mrpTotal = try container.decode(String.self, forKey: .mrpTotal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discount = try container.decode(Double.self, forKey: .discount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - total = try container.decode(Double.self, forKey: .total) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(codCharge, forKey: .codCharge) - - - - try? container.encodeIfPresent(subtotal, forKey: .subtotal) - - - - try? container.encodeIfPresent(youSaved, forKey: .youSaved) - - - - try? container.encodeIfPresent(vog, forKey: .vog) - - - - try? container.encodeIfPresent(coupon, forKey: .coupon) - - - - try? container.encodeIfPresent(deliveryCharge, forKey: .deliveryCharge) - - - - try? container.encodeIfPresent(gstCharges, forKey: .gstCharges) - - - - try? container.encodeIfPresent(convenienceFee, forKey: .convenienceFee) - - - - try? container.encodeIfPresent(fyndCash, forKey: .fyndCash) - - - - try? container.encodeIfPresent(mrpTotal, forKey: .mrpTotal) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - - try? container.encodeIfPresent(total, forKey: .total) - - - } - - } - - /* - Model: DisplayBreakup - Used By: Cart - */ - class DisplayBreakup: Codable { - - public var display: String? - - public var value: Double? - - public var key: String? - - public var currencySymbol: String? - - public var currencyCode: String? - - public var message: [String]? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case value = "value" - - case key = "key" - - case currencySymbol = "currency_symbol" - - case currencyCode = "currency_code" - - case message = "message" - - } - - public init(currencyCode: String?, currencySymbol: String?, display: String?, key: String?, message: [String]?, value: Double?) { - - self.display = display - - self.value = value - - self.key = key - - self.currencySymbol = currencySymbol - - self.currencyCode = currencyCode - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(Double.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencySymbol = try container.decode(String.self, forKey: .currencySymbol) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode([String].self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: CouponBreakup - Used By: Cart - */ - class CouponBreakup: Codable { - - public var isApplied: Bool? - - public var uid: String? - - public var type: String? - - public var value: Double? - - public var code: String? - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case isApplied = "is_applied" - - case uid = "uid" - - case type = "type" - - case value = "value" - - case code = "code" - - case message = "message" - - } - - public init(code: String?, isApplied: Bool?, message: String?, type: String?, uid: String?, value: Double?) { - - self.isApplied = isApplied - - self.uid = uid - - self.type = type - - self.value = value - - self.code = code - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isApplied = try container.decode(Bool.self, forKey: .isApplied) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(Double.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isApplied, forKey: .isApplied) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: LoyaltyPoints - Used By: Cart - */ - class LoyaltyPoints: Codable { - - public var description: String? - - public var isApplied: Bool? - - public var applicable: Double? - - public var total: Double? - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case isApplied = "is_applied" - - case applicable = "applicable" - - case total = "total" - - } - - public init(applicable: Double?, description: String?, isApplied: Bool?, total: Double?) { - - self.description = description - - self.isApplied = isApplied - - self.applicable = applicable - - self.total = total - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isApplied = try container.decode(Bool.self, forKey: .isApplied) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - applicable = try container.decode(Double.self, forKey: .applicable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - total = try container.decode(Double.self, forKey: .total) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(isApplied, forKey: .isApplied) - - - - try? container.encodeIfPresent(applicable, forKey: .applicable) - - - - try? container.encodeIfPresent(total, forKey: .total) - - - } - - } - - /* - Model: CartBreakup - Used By: Cart - */ - class CartBreakup: Codable { - - public var raw: RawBreakup? - - public var display: [DisplayBreakup]? - - public var coupon: CouponBreakup? - - public var loyaltyPoints: LoyaltyPoints? - - - public enum CodingKeys: String, CodingKey { - - case raw = "raw" - - case display = "display" - - case coupon = "coupon" - - case loyaltyPoints = "loyalty_points" - - } - - public init(coupon: CouponBreakup?, display: [DisplayBreakup]?, loyaltyPoints: LoyaltyPoints?, raw: RawBreakup?) { - - self.raw = raw - - self.display = display - - self.coupon = coupon - - self.loyaltyPoints = loyaltyPoints - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - raw = try container.decode(RawBreakup.self, forKey: .raw) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - display = try container.decode([DisplayBreakup].self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - coupon = try container.decode(CouponBreakup.self, forKey: .coupon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - loyaltyPoints = try container.decode(LoyaltyPoints.self, forKey: .loyaltyPoints) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(raw, forKey: .raw) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(coupon, forKey: .coupon) - - - - try? container.encodeIfPresent(loyaltyPoints, forKey: .loyaltyPoints) - - - } - - } - - /* - Model: PaymentSelectionLock - Used By: Cart - */ - class PaymentSelectionLock: Codable { - - public var paymentIdentifier: String? - - public var defaultOptions: String? - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case paymentIdentifier = "payment_identifier" - - case defaultOptions = "default_options" - - case enabled = "enabled" - - } - - public init(defaultOptions: String?, enabled: Bool?, paymentIdentifier: String?) { - - self.paymentIdentifier = paymentIdentifier - - self.defaultOptions = defaultOptions - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - paymentIdentifier = try container.decode(String.self, forKey: .paymentIdentifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - defaultOptions = try container.decode(String.self, forKey: .defaultOptions) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(paymentIdentifier, forKey: .paymentIdentifier) - - - - try? container.encodeIfPresent(defaultOptions, forKey: .defaultOptions) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: BasePrice - Used By: Cart - */ - class BasePrice: Codable { - - public var effective: Double? - - public var currencyCode: String? - - public var currencySymbol: String? - - public var marked: Double? - - - public enum CodingKeys: String, CodingKey { - - case effective = "effective" - - case currencyCode = "currency_code" - - case currencySymbol = "currency_symbol" - - case marked = "marked" - - } - - public init(currencyCode: String?, currencySymbol: String?, effective: Double?, marked: Double?) { - - self.effective = effective - - self.currencyCode = currencyCode - - self.currencySymbol = currencySymbol - - self.marked = marked - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - effective = try container.decode(Double.self, forKey: .effective) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencySymbol = try container.decode(String.self, forKey: .currencySymbol) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - marked = try container.decode(Double.self, forKey: .marked) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(effective, forKey: .effective) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - - try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) - - - - try? container.encodeIfPresent(marked, forKey: .marked) - - - } - - } - - /* - Model: ArticlePriceInfo - Used By: Cart - */ - class ArticlePriceInfo: Codable { - - public var converted: BasePrice? - - public var base: BasePrice? - - - public enum CodingKeys: String, CodingKey { - - case converted = "converted" - - case base = "base" - - } - - public init(base: BasePrice?, converted: BasePrice?) { - - self.converted = converted - - self.base = base - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - converted = try container.decode(BasePrice.self, forKey: .converted) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - base = try container.decode(BasePrice.self, forKey: .base) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(converted, forKey: .converted) - - - - try? container.encodeIfPresent(base, forKey: .base) - - - } - - } - - /* - Model: BaseInfo - Used By: Cart - */ - class BaseInfo: Codable { - - public var name: String? - - public var uid: Int? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case uid = "uid" - - } - - public init(name: String?, uid: Int?) { - - self.name = name - - self.uid = uid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - } - - } - - /* - Model: ProductArticle - Used By: Cart - */ - class ProductArticle: Codable { - - public var extraMeta: [String: Any]? - - public var uid: String? - - public var type: String? - - public var price: ArticlePriceInfo? - - public var store: BaseInfo? - - public var seller: BaseInfo? - - public var size: String? - - public var quantity: Int? - - - public enum CodingKeys: String, CodingKey { - - case extraMeta = "extra_meta" - - case uid = "uid" - - case type = "type" - - case price = "price" - - case store = "store" - - case seller = "seller" - - case size = "size" - - case quantity = "quantity" - - } - - public init(extraMeta: [String: Any]?, price: ArticlePriceInfo?, quantity: Int?, seller: BaseInfo?, size: String?, store: BaseInfo?, type: String?, uid: String?) { - - self.extraMeta = extraMeta - - self.uid = uid - - self.type = type - - self.price = price - - self.store = store - - self.seller = seller - - self.size = size - - self.quantity = quantity - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - extraMeta = try container.decode([String: Any].self, forKey: .extraMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(ArticlePriceInfo.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - store = try container.decode(BaseInfo.self, forKey: .store) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - seller = try container.decode(BaseInfo.self, forKey: .seller) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - size = try container.decode(String.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(extraMeta, forKey: .extraMeta) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(store, forKey: .store) - - - - try? container.encodeIfPresent(seller, forKey: .seller) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - } - - } - - /* - Model: CartProductIdentifer - Used By: Cart - */ - class CartProductIdentifer: Codable { - - public var identifier: String? - - - public enum CodingKeys: String, CodingKey { - - case identifier = "identifier" - - } - - public init(identifier: String?) { - - self.identifier = identifier - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - identifier = try container.decode(String.self, forKey: .identifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(identifier, forKey: .identifier) - - - } - - } - - /* - Model: ProductAvailability - Used By: Cart - */ - class ProductAvailability: Codable { - - public var otherStoreQuantity: Int? - - public var outOfStock: Bool? - - public var sizes: [String]? - - public var isValid: Bool? - - public var deliverable: Bool? - - - public enum CodingKeys: String, CodingKey { - - case otherStoreQuantity = "other_store_quantity" - - case outOfStock = "out_of_stock" - - case sizes = "sizes" - - case isValid = "is_valid" - - case deliverable = "deliverable" - - } - - public init(deliverable: Bool?, isValid: Bool?, otherStoreQuantity: Int?, outOfStock: Bool?, sizes: [String]?) { - - self.otherStoreQuantity = otherStoreQuantity - - self.outOfStock = outOfStock - - self.sizes = sizes - - self.isValid = isValid - - self.deliverable = deliverable - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - otherStoreQuantity = try container.decode(Int.self, forKey: .otherStoreQuantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - outOfStock = try container.decode(Bool.self, forKey: .outOfStock) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sizes = try container.decode([String].self, forKey: .sizes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isValid = try container.decode(Bool.self, forKey: .isValid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliverable = try container.decode(Bool.self, forKey: .deliverable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(otherStoreQuantity, forKey: .otherStoreQuantity) - - - - try? container.encodeIfPresent(outOfStock, forKey: .outOfStock) - - - - try? container.encodeIfPresent(sizes, forKey: .sizes) - - - - try? container.encodeIfPresent(isValid, forKey: .isValid) - - - - try? container.encodeIfPresent(deliverable, forKey: .deliverable) - - - } - - } - - /* - Model: ActionQuery - Used By: Cart - */ - class ActionQuery: Codable { - - public var productSlug: [String]? - - - public enum CodingKeys: String, CodingKey { - - case productSlug = "product_slug" - - } - - public init(productSlug: [String]?) { - - self.productSlug = productSlug - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - productSlug = try container.decode([String].self, forKey: .productSlug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(productSlug, forKey: .productSlug) - - - } - - } - - /* - Model: ProductAction - Used By: Cart - */ - class ProductAction: Codable { - - public var url: String? - - public var query: ActionQuery? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case url = "url" - - case query = "query" - - case type = "type" - - } - - public init(query: ActionQuery?, type: String?, url: String?) { - - self.url = url - - self.query = query - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - query = try container.decode(ActionQuery.self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(query, forKey: .query) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ProductImage - Used By: Cart - */ - class ProductImage: Codable { - - public var url: String? - - public var aspectRatio: String? - - public var secureUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case url = "url" - - case aspectRatio = "aspect_ratio" - - case secureUrl = "secure_url" - - } - - public init(aspectRatio: String?, secureUrl: String?, url: String?) { - - self.url = url - - self.aspectRatio = aspectRatio - - self.secureUrl = secureUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - aspectRatio = try container.decode(String.self, forKey: .aspectRatio) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - secureUrl = try container.decode(String.self, forKey: .secureUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) - - - - try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) - - - } - - } - - /* - Model: CategoryInfo - Used By: Cart - */ - class CategoryInfo: Codable { - - public var name: String? - - public var uid: Int? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case uid = "uid" - - } - - public init(name: String?, uid: Int?) { - - self.name = name - - self.uid = uid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - } - - } - - /* - Model: CartProduct - Used By: Cart - */ - class CartProduct: Codable { - - public var slug: String? - - public var name: String? - - public var action: ProductAction? - - public var uid: Int? - - public var type: String? - - public var images: [ProductImage]? - - public var categories: [CategoryInfo]? - - public var brand: BaseInfo? - - - public enum CodingKeys: String, CodingKey { - - case slug = "slug" - - case name = "name" - - case action = "action" - - case uid = "uid" - - case type = "type" - - case images = "images" - - case categories = "categories" - - case brand = "brand" - - } - - public init(action: ProductAction?, brand: BaseInfo?, categories: [CategoryInfo]?, images: [ProductImage]?, name: String?, slug: String?, type: String?, uid: Int?) { - - self.slug = slug - - self.name = name - - self.action = action - - self.uid = uid - - self.type = type - - self.images = images - - self.categories = categories - - self.brand = brand - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(ProductAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - images = try container.decode([ProductImage].self, forKey: .images) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - categories = try container.decode([CategoryInfo].self, forKey: .categories) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brand = try container.decode(BaseInfo.self, forKey: .brand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(images, forKey: .images) - - - - try? container.encodeIfPresent(categories, forKey: .categories) - - - - try? container.encodeIfPresent(brand, forKey: .brand) - - - } - - } - - /* - Model: ProductPrice - Used By: Cart - */ - class ProductPrice: Codable { - - public var addOn: Double? - - public var selling: Double? - - public var marked: Double? - - public var currencySymbol: String? - - public var currencyCode: String? - - public var effective: Double? - - - public enum CodingKeys: String, CodingKey { - - case addOn = "add_on" - - case selling = "selling" - - case marked = "marked" - - case currencySymbol = "currency_symbol" - - case currencyCode = "currency_code" - - case effective = "effective" - - } - - public init(addOn: Double?, currencyCode: String?, currencySymbol: String?, effective: Double?, marked: Double?, selling: Double?) { - - self.addOn = addOn - - self.selling = selling - - self.marked = marked - - self.currencySymbol = currencySymbol - - self.currencyCode = currencyCode - - self.effective = effective - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - addOn = try container.decode(Double.self, forKey: .addOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - selling = try container.decode(Double.self, forKey: .selling) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - marked = try container.decode(Double.self, forKey: .marked) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencySymbol = try container.decode(String.self, forKey: .currencySymbol) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - effective = try container.decode(Double.self, forKey: .effective) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(addOn, forKey: .addOn) - - - - try? container.encodeIfPresent(selling, forKey: .selling) - - - - try? container.encodeIfPresent(marked, forKey: .marked) - - - - try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - - try? container.encodeIfPresent(effective, forKey: .effective) - - - } - - } - - /* - Model: ProductPriceInfo - Used By: Cart - */ - class ProductPriceInfo: Codable { - - public var converted: ProductPrice? - - public var base: ProductPrice? - - - public enum CodingKeys: String, CodingKey { - - case converted = "converted" - - case base = "base" - - } - - public init(base: ProductPrice?, converted: ProductPrice?) { - - self.converted = converted - - self.base = base - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - converted = try container.decode(ProductPrice.self, forKey: .converted) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - base = try container.decode(ProductPrice.self, forKey: .base) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(converted, forKey: .converted) - - - - try? container.encodeIfPresent(base, forKey: .base) - - - } - - } - - /* - Model: PromoMeta - Used By: Cart - */ - class PromoMeta: Codable { - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: CartProductInfo - Used By: Cart - */ - class CartProductInfo: Codable { - - public var article: ProductArticle? - - public var identifiers: CartProductIdentifer - - public var bulkOffer: [String: Any]? - - public var availability: ProductAvailability? - - public var product: CartProduct? - - public var pricePerUnit: ProductPriceInfo? - - public var key: String? - - public var price: ProductPriceInfo? - - public var couponMessage: String? - - public var message: String? - - public var promoMeta: PromoMeta? - - public var isSet: Bool? - - public var discount: String? - - public var quantity: Int? - - - public enum CodingKeys: String, CodingKey { - - case article = "article" - - case identifiers = "identifiers" - - case bulkOffer = "bulk_offer" - - case availability = "availability" - - case product = "product" - - case pricePerUnit = "price_per_unit" - - case key = "key" - - case price = "price" - - case couponMessage = "coupon_message" - - case message = "message" - - case promoMeta = "promo_meta" - - case isSet = "is_set" - - case discount = "discount" - - case quantity = "quantity" - - } - - public init(article: ProductArticle?, availability: ProductAvailability?, bulkOffer: [String: Any]?, couponMessage: String?, discount: String?, identifiers: CartProductIdentifer, isSet: Bool?, key: String?, message: String?, price: ProductPriceInfo?, pricePerUnit: ProductPriceInfo?, product: CartProduct?, promoMeta: PromoMeta?, quantity: Int?) { - - self.article = article - - self.identifiers = identifiers - - self.bulkOffer = bulkOffer - - self.availability = availability - - self.product = product - - self.pricePerUnit = pricePerUnit - - self.key = key - - self.price = price - - self.couponMessage = couponMessage - - self.message = message - - self.promoMeta = promoMeta - - self.isSet = isSet - - self.discount = discount - - self.quantity = quantity - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - article = try container.decode(ProductArticle.self, forKey: .article) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - identifiers = try container.decode(CartProductIdentifer.self, forKey: .identifiers) - - - - - do { - bulkOffer = try container.decode([String: Any].self, forKey: .bulkOffer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - availability = try container.decode(ProductAvailability.self, forKey: .availability) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - product = try container.decode(CartProduct.self, forKey: .product) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pricePerUnit = try container.decode(ProductPriceInfo.self, forKey: .pricePerUnit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(ProductPriceInfo.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - couponMessage = try container.decode(String.self, forKey: .couponMessage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - promoMeta = try container.decode(PromoMeta.self, forKey: .promoMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isSet = try container.decode(Bool.self, forKey: .isSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discount = try container.decode(String.self, forKey: .discount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(article, forKey: .article) - - - - try? container.encodeIfPresent(identifiers, forKey: .identifiers) - - - - try? container.encodeIfPresent(bulkOffer, forKey: .bulkOffer) - - - - try? container.encodeIfPresent(availability, forKey: .availability) - - - - try? container.encodeIfPresent(product, forKey: .product) - - - - try? container.encodeIfPresent(pricePerUnit, forKey: .pricePerUnit) - - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(couponMessage, forKey: .couponMessage) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(promoMeta, forKey: .promoMeta) - - - - try? container.encodeIfPresent(isSet, forKey: .isSet) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - } - - } - - /* - Model: CartCurrency - Used By: Cart - */ - class CartCurrency: Codable { - - public var symbol: String? - - public var code: String? - - - public enum CodingKeys: String, CodingKey { - - case symbol = "symbol" - - case code = "code" - - } - - public init(code: String?, symbol: String?) { - - self.symbol = symbol - - self.code = code - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - symbol = try container.decode(String.self, forKey: .symbol) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(symbol, forKey: .symbol) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - } - - } - - /* - Model: CartDetailResponse - Used By: Cart - */ - class CartDetailResponse: Codable { - - public var id: String? - - public var checkoutMode: String? - - public var restrictCheckout: Bool? - - public var lastModified: String? - - public var deliveryPromise: ShipmentPromise? - - public var couponText: String? - - public var message: String? - - public var breakupValues: CartBreakup? - - public var gstin: String? - - public var comment: String? - - public var paymentSelectionLock: PaymentSelectionLock? - - public var items: [CartProductInfo]? - - public var isValid: Bool? - - public var deliveryChargeInfo: String? - - public var currency: CartCurrency? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case checkoutMode = "checkout_mode" - - case restrictCheckout = "restrict_checkout" - - case lastModified = "last_modified" - - case deliveryPromise = "delivery_promise" - - case couponText = "coupon_text" - - case message = "message" - - case breakupValues = "breakup_values" - - case gstin = "gstin" - - case comment = "comment" - - case paymentSelectionLock = "payment_selection_lock" - - case items = "items" - - case isValid = "is_valid" - - case deliveryChargeInfo = "delivery_charge_info" - - case currency = "currency" - - } - - public init(breakupValues: CartBreakup?, checkoutMode: String?, comment: String?, couponText: String?, currency: CartCurrency?, deliveryChargeInfo: String?, deliveryPromise: ShipmentPromise?, gstin: String?, id: String?, isValid: Bool?, items: [CartProductInfo]?, lastModified: String?, message: String?, paymentSelectionLock: PaymentSelectionLock?, restrictCheckout: Bool?) { - - self.id = id - - self.checkoutMode = checkoutMode - - self.restrictCheckout = restrictCheckout - - self.lastModified = lastModified - - self.deliveryPromise = deliveryPromise - - self.couponText = couponText - - self.message = message - - self.breakupValues = breakupValues - - self.gstin = gstin - - self.comment = comment - - self.paymentSelectionLock = paymentSelectionLock - - self.items = items - - self.isValid = isValid - - self.deliveryChargeInfo = deliveryChargeInfo - - self.currency = currency - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - checkoutMode = try container.decode(String.self, forKey: .checkoutMode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - restrictCheckout = try container.decode(Bool.self, forKey: .restrictCheckout) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastModified = try container.decode(String.self, forKey: .lastModified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryPromise = try container.decode(ShipmentPromise.self, forKey: .deliveryPromise) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - couponText = try container.decode(String.self, forKey: .couponText) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - breakupValues = try container.decode(CartBreakup.self, forKey: .breakupValues) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstin = try container.decode(String.self, forKey: .gstin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - comment = try container.decode(String.self, forKey: .comment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentSelectionLock = try container.decode(PaymentSelectionLock.self, forKey: .paymentSelectionLock) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([CartProductInfo].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isValid = try container.decode(Bool.self, forKey: .isValid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryChargeInfo = try container.decode(String.self, forKey: .deliveryChargeInfo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(CartCurrency.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(checkoutMode, forKey: .checkoutMode) - - - - try? container.encodeIfPresent(restrictCheckout, forKey: .restrictCheckout) - - - - try? container.encodeIfPresent(lastModified, forKey: .lastModified) - - - - try? container.encodeIfPresent(deliveryPromise, forKey: .deliveryPromise) - - - - try? container.encodeIfPresent(couponText, forKey: .couponText) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) - - - - try? container.encodeIfPresent(gstin, forKey: .gstin) - - - - try? container.encodeIfPresent(comment, forKey: .comment) - - - - try? container.encodeIfPresent(paymentSelectionLock, forKey: .paymentSelectionLock) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(isValid, forKey: .isValid) - - - - try? container.encodeIfPresent(deliveryChargeInfo, forKey: .deliveryChargeInfo) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - } - - } - - /* - Model: AddProductCart - Used By: Cart - */ - class AddProductCart: Codable { - - public var sellerId: Int? - - public var storeId: Int? - - public var display: String? - - public var extraMeta: [String: Any]? - - public var itemId: Int? - - public var itemSize: String? - - public var pos: Bool? - - public var articleId: String? - - public var articleAssignment: [String: Any]? - - public var quantity: Int? - - - public enum CodingKeys: String, CodingKey { - - case sellerId = "seller_id" - - case storeId = "store_id" - - case display = "display" - - case extraMeta = "extra_meta" - - case itemId = "item_id" - - case itemSize = "item_size" - - case pos = "pos" - - case articleId = "article_id" - - case articleAssignment = "article_assignment" - - case quantity = "quantity" - - } - - public init(articleAssignment: [String: Any]?, articleId: String?, display: String?, extraMeta: [String: Any]?, itemId: Int?, itemSize: String?, pos: Bool?, quantity: Int?, sellerId: Int?, storeId: Int?) { - - self.sellerId = sellerId - - self.storeId = storeId - - self.display = display - - self.extraMeta = extraMeta - - self.itemId = itemId - - self.itemSize = itemSize - - self.pos = pos - - self.articleId = articleId - - self.articleAssignment = articleAssignment - - self.quantity = quantity - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - sellerId = try container.decode(Int.self, forKey: .sellerId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeId = try container.decode(Int.self, forKey: .storeId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - extraMeta = try container.decode([String: Any].self, forKey: .extraMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemId = try container.decode(Int.self, forKey: .itemId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemSize = try container.decode(String.self, forKey: .itemSize) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pos = try container.decode(Bool.self, forKey: .pos) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - articleId = try container.decode(String.self, forKey: .articleId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - articleAssignment = try container.decode([String: Any].self, forKey: .articleAssignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(sellerId, forKey: .sellerId) - - - - try? container.encodeIfPresent(storeId, forKey: .storeId) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(extraMeta, forKey: .extraMeta) - - - - try? container.encodeIfPresent(itemId, forKey: .itemId) - - - - try? container.encodeIfPresent(itemSize, forKey: .itemSize) - - - - try? container.encodeIfPresent(pos, forKey: .pos) - - - - try? container.encodeIfPresent(articleId, forKey: .articleId) - - - - try? container.encodeIfPresent(articleAssignment, forKey: .articleAssignment) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - } - - } - - /* - Model: AddCartRequest - Used By: Cart - */ - class AddCartRequest: Codable { - - public var items: [AddProductCart]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - } - - public init(items: [AddProductCart]?) { - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([AddProductCart].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: AddCartDetailResponse - Used By: Cart - */ - class AddCartDetailResponse: Codable { - - public var cart: CartDetailResponse? - - public var partial: Bool? - - public var message: String? - - public var success: Bool? - - - public enum CodingKeys: String, CodingKey { - - case cart = "cart" - - case partial = "partial" - - case message = "message" - - case success = "success" - - } - - public init(cart: CartDetailResponse?, message: String?, partial: Bool?, success: Bool?) { - - self.cart = cart - - self.partial = partial - - self.message = message - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cart = try container.decode(CartDetailResponse.self, forKey: .cart) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - partial = try container.decode(Bool.self, forKey: .partial) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cart, forKey: .cart) - - - - try? container.encodeIfPresent(partial, forKey: .partial) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: UpdateProductCart - Used By: Cart - */ - class UpdateProductCart: Codable { - - public var identifiers: CartProductIdentifer - - public var extraMeta: [String: Any]? - - public var itemId: Int? - - public var itemSize: String? - - public var articleId: String? - - public var itemIndex: Int? - - public var quantity: Int? - - - public enum CodingKeys: String, CodingKey { - - case identifiers = "identifiers" - - case extraMeta = "extra_meta" - - case itemId = "item_id" - - case itemSize = "item_size" - - case articleId = "article_id" - - case itemIndex = "item_index" - - case quantity = "quantity" - - } - - public init(articleId: String?, extraMeta: [String: Any]?, identifiers: CartProductIdentifer, itemId: Int?, itemIndex: Int?, itemSize: String?, quantity: Int?) { - - self.identifiers = identifiers - - self.extraMeta = extraMeta - - self.itemId = itemId - - self.itemSize = itemSize - - self.articleId = articleId - - self.itemIndex = itemIndex - - self.quantity = quantity - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - identifiers = try container.decode(CartProductIdentifer.self, forKey: .identifiers) - - - - - do { - extraMeta = try container.decode([String: Any].self, forKey: .extraMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemId = try container.decode(Int.self, forKey: .itemId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemSize = try container.decode(String.self, forKey: .itemSize) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - articleId = try container.decode(String.self, forKey: .articleId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemIndex = try container.decode(Int.self, forKey: .itemIndex) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(identifiers, forKey: .identifiers) - - - - try? container.encodeIfPresent(extraMeta, forKey: .extraMeta) - - - - try? container.encodeIfPresent(itemId, forKey: .itemId) - - - - try? container.encodeIfPresent(itemSize, forKey: .itemSize) - - - - try? container.encodeIfPresent(articleId, forKey: .articleId) - - - - try? container.encodeIfPresent(itemIndex, forKey: .itemIndex) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - } - - } - - /* - Model: UpdateCartRequest - Used By: Cart - */ - class UpdateCartRequest: Codable { - - public var items: [UpdateProductCart]? - - public var operation: String - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case operation = "operation" - - } - - public init(items: [UpdateProductCart]?, operation: String) { - - self.items = items - - self.operation = operation - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([UpdateProductCart].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - operation = try container.decode(String.self, forKey: .operation) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(operation, forKey: .operation) - - - } - - } - - /* - Model: UpdateCartDetailResponse - Used By: Cart - */ - class UpdateCartDetailResponse: Codable { - - public var cart: CartDetailResponse? - - public var message: String? - - public var success: Bool? - - - public enum CodingKeys: String, CodingKey { - - case cart = "cart" - - case message = "message" - - case success = "success" - - } - - public init(cart: CartDetailResponse?, message: String?, success: Bool?) { - - self.cart = cart - - self.message = message - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cart = try container.decode(CartDetailResponse.self, forKey: .cart) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cart, forKey: .cart) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: CartItemCountResponse - Used By: Cart - */ - class CartItemCountResponse: Codable { - - public var userCartItemsCount: Int? - - - public enum CodingKeys: String, CodingKey { - - case userCartItemsCount = "user_cart_items_count" - - } - - public init(userCartItemsCount: Int?) { - - self.userCartItemsCount = userCartItemsCount - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - userCartItemsCount = try container.decode(Int.self, forKey: .userCartItemsCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(userCartItemsCount, forKey: .userCartItemsCount) - - - } - - } - - /* - Model: Coupon - Used By: Cart - */ - class Coupon: Codable { - - public var expiresOn: String? - - public var couponValue: Double? - - public var isApplied: Bool? - - public var couponCode: String? - - public var subTitle: String? - - public var title: String? - - public var message: String? - - public var isApplicable: Bool? - - public var maxDiscountValue: Double? - - public var minimumCartValue: Double? - - - public enum CodingKeys: String, CodingKey { - - case expiresOn = "expires_on" - - case couponValue = "coupon_value" - - case isApplied = "is_applied" - - case couponCode = "coupon_code" - - case subTitle = "sub_title" - - case title = "title" - - case message = "message" - - case isApplicable = "is_applicable" - - case maxDiscountValue = "max_discount_value" - - case minimumCartValue = "minimum_cart_value" - - } - - public init(couponCode: String?, couponValue: Double?, expiresOn: String?, isApplicable: Bool?, isApplied: Bool?, maxDiscountValue: Double?, message: String?, minimumCartValue: Double?, subTitle: String?, title: String?) { - - self.expiresOn = expiresOn - - self.couponValue = couponValue - - self.isApplied = isApplied - - self.couponCode = couponCode - - self.subTitle = subTitle - - self.title = title - - self.message = message - - self.isApplicable = isApplicable - - self.maxDiscountValue = maxDiscountValue - - self.minimumCartValue = minimumCartValue - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - expiresOn = try container.decode(String.self, forKey: .expiresOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - couponValue = try container.decode(Double.self, forKey: .couponValue) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isApplied = try container.decode(Bool.self, forKey: .isApplied) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - couponCode = try container.decode(String.self, forKey: .couponCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subTitle = try container.decode(String.self, forKey: .subTitle) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isApplicable = try container.decode(Bool.self, forKey: .isApplicable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - maxDiscountValue = try container.decode(Double.self, forKey: .maxDiscountValue) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - minimumCartValue = try container.decode(Double.self, forKey: .minimumCartValue) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(expiresOn, forKey: .expiresOn) - - - - try? container.encodeIfPresent(couponValue, forKey: .couponValue) - - - - try? container.encodeIfPresent(isApplied, forKey: .isApplied) - - - - try? container.encodeIfPresent(couponCode, forKey: .couponCode) - - - - try? container.encodeIfPresent(subTitle, forKey: .subTitle) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(isApplicable, forKey: .isApplicable) - - - - try? container.encodeIfPresent(maxDiscountValue, forKey: .maxDiscountValue) - - - - try? container.encodeIfPresent(minimumCartValue, forKey: .minimumCartValue) - - - } - - } - - /* - Model: PageCoupon - Used By: Cart - */ - class PageCoupon: Codable { - - public var current: Int? - - public var hasPrevious: Bool? - - public var totalItemCount: Int? - - public var total: Int? - - public var hasNext: Bool? - - - public enum CodingKeys: String, CodingKey { - - case current = "current" - - case hasPrevious = "has_previous" - - case totalItemCount = "total_item_count" - - case total = "total" - - case hasNext = "has_next" - - } - - public init(current: Int?, hasNext: Bool?, hasPrevious: Bool?, total: Int?, totalItemCount: Int?) { - - self.current = current - - self.hasPrevious = hasPrevious - - self.totalItemCount = totalItemCount - - self.total = total - - self.hasNext = hasNext - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - current = try container.decode(Int.self, forKey: .current) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasPrevious = try container.decode(Bool.self, forKey: .hasPrevious) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalItemCount = try container.decode(Int.self, forKey: .totalItemCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - total = try container.decode(Int.self, forKey: .total) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasNext = try container.decode(Bool.self, forKey: .hasNext) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(current, forKey: .current) - - - - try? container.encodeIfPresent(hasPrevious, forKey: .hasPrevious) - - - - try? container.encodeIfPresent(totalItemCount, forKey: .totalItemCount) - - - - try? container.encodeIfPresent(total, forKey: .total) - - - - try? container.encodeIfPresent(hasNext, forKey: .hasNext) - - - } - - } - - /* - Model: GetCouponResponse - Used By: Cart - */ - class GetCouponResponse: Codable { - - public var availableCouponList: [Coupon]? - - public var page: PageCoupon? - - - public enum CodingKeys: String, CodingKey { - - case availableCouponList = "available_coupon_list" - - case page = "page" - - } - - public init(availableCouponList: [Coupon]?, page: PageCoupon?) { - - self.availableCouponList = availableCouponList - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - availableCouponList = try container.decode([Coupon].self, forKey: .availableCouponList) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(PageCoupon.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(availableCouponList, forKey: .availableCouponList) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: ApplyCouponRequest - Used By: Cart - */ - class ApplyCouponRequest: Codable { - - public var couponCode: String - - - public enum CodingKeys: String, CodingKey { - - case couponCode = "coupon_code" - - } - - public init(couponCode: String) { - - self.couponCode = couponCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - couponCode = try container.decode(String.self, forKey: .couponCode) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(couponCode, forKey: .couponCode) - - - } - - } - - /* - Model: OfferSeller - Used By: Cart - */ - class OfferSeller: Codable { - - public var name: String? - - public var uid: Int? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case uid = "uid" - - } - - public init(name: String?, uid: Int?) { - - self.name = name - - self.uid = uid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - } - - } - - /* - Model: OfferPrice - Used By: Cart - */ - class OfferPrice: Codable { - - public var marked: Int? - - public var bulkEffective: Double? - - public var currencySymbol: String? - - public var currencyCode: String? - - public var effective: Int? - - - public enum CodingKeys: String, CodingKey { - - case marked = "marked" - - case bulkEffective = "bulk_effective" - - case currencySymbol = "currency_symbol" - - case currencyCode = "currency_code" - - case effective = "effective" - - } - - public init(bulkEffective: Double?, currencyCode: String?, currencySymbol: String?, effective: Int?, marked: Int?) { - - self.marked = marked - - self.bulkEffective = bulkEffective - - self.currencySymbol = currencySymbol - - self.currencyCode = currencyCode - - self.effective = effective - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - marked = try container.decode(Int.self, forKey: .marked) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bulkEffective = try container.decode(Double.self, forKey: .bulkEffective) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencySymbol = try container.decode(String.self, forKey: .currencySymbol) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - effective = try container.decode(Int.self, forKey: .effective) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(marked, forKey: .marked) - - - - try? container.encodeIfPresent(bulkEffective, forKey: .bulkEffective) - - - - try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - - try? container.encodeIfPresent(effective, forKey: .effective) - - - } - - } - - /* - Model: OfferItem - Used By: Cart - */ - class OfferItem: Codable { - - public var total: Double? - - public var best: Bool? - - public var autoApplied: Bool? - - public var type: String? - - public var price: OfferPrice? - - public var margin: Int? - - public var quantity: Int? - - - public enum CodingKeys: String, CodingKey { - - case total = "total" - - case best = "best" - - case autoApplied = "auto_applied" - - case type = "type" - - case price = "price" - - case margin = "margin" - - case quantity = "quantity" - - } - - public init(autoApplied: Bool?, best: Bool?, margin: Int?, price: OfferPrice?, quantity: Int?, total: Double?, type: String?) { - - self.total = total - - self.best = best - - self.autoApplied = autoApplied - - self.type = type - - self.price = price - - self.margin = margin - - self.quantity = quantity - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - total = try container.decode(Double.self, forKey: .total) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - best = try container.decode(Bool.self, forKey: .best) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - autoApplied = try container.decode(Bool.self, forKey: .autoApplied) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(OfferPrice.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - margin = try container.decode(Int.self, forKey: .margin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(total, forKey: .total) - - - - try? container.encodeIfPresent(best, forKey: .best) - - - - try? container.encodeIfPresent(autoApplied, forKey: .autoApplied) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(margin, forKey: .margin) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - } - - } - - /* - Model: BulkPriceOffer - Used By: Cart - */ - class BulkPriceOffer: Codable { - - public var seller: OfferSeller? - - public var offers: [OfferItem]? - - - public enum CodingKeys: String, CodingKey { - - case seller = "seller" - - case offers = "offers" - - } - - public init(offers: [OfferItem]?, seller: OfferSeller?) { - - self.seller = seller - - self.offers = offers - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - seller = try container.decode(OfferSeller.self, forKey: .seller) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - offers = try container.decode([OfferItem].self, forKey: .offers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(seller, forKey: .seller) - - - - try? container.encodeIfPresent(offers, forKey: .offers) - - - } - - } - - /* - Model: BulkPriceResponse - Used By: Cart - */ - class BulkPriceResponse: Codable { - - public var data: [BulkPriceOffer]? - - - public enum CodingKeys: String, CodingKey { - - case data = "data" - - } - - public init(data: [BulkPriceOffer]?) { - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - data = try container.decode([BulkPriceOffer].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: RewardPointRequest - Used By: Cart - */ - class RewardPointRequest: Codable { - - public var points: Bool - - - public enum CodingKeys: String, CodingKey { - - case points = "points" - - } - - public init(points: Bool) { - - self.points = points - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - points = try container.decode(Bool.self, forKey: .points) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(points, forKey: .points) - - - } - - } - - /* - Model: GeoLocation - Used By: Cart - */ - class GeoLocation: Codable { - - public var longitude: Double? - - public var latitude: Double? - - - public enum CodingKeys: String, CodingKey { - - case longitude = "longitude" - - case latitude = "latitude" - - } - - public init(latitude: Double?, longitude: Double?) { - - self.longitude = longitude - - self.latitude = latitude - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - longitude = try container.decode(Double.self, forKey: .longitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - latitude = try container.decode(Double.self, forKey: .latitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(longitude, forKey: .longitude) - - - - try? container.encodeIfPresent(latitude, forKey: .latitude) - - - } - - } - - /* - Model: Address - Used By: Cart - */ - class Address: Codable { - - public var email: String? - - public var id: String? - - public var isDefaultAddress: Bool? - - public var city: String? - - public var areaCodeSlug: String? - - public var area: String? - - public var name: String? - - public var geoLocation: GeoLocation? - - public var areaCode: String? - - public var userId: String? - - public var countryCode: String? - - public var addressType: String? - - public var landmark: String? - - public var state: String? - - public var googleMapPoint: [String: Any]? - - public var phone: String? - - public var checkoutMode: String? - - public var isActive: Bool? - - public var country: String? - - public var address: String? - - public var meta: [String: Any]? - - public var tags: [String]? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case id = "id" - - case isDefaultAddress = "is_default_address" - - case city = "city" - - case areaCodeSlug = "area_code_slug" - - case area = "area" - - case name = "name" - - case geoLocation = "geo_location" - - case areaCode = "area_code" - - case userId = "user_id" - - case countryCode = "country_code" - - case addressType = "address_type" - - case landmark = "landmark" - - case state = "state" - - case googleMapPoint = "google_map_point" - - case phone = "phone" - - case checkoutMode = "checkout_mode" - - case isActive = "is_active" - - case country = "country" - - case address = "address" - - case meta = "meta" - - case tags = "tags" - - } - - public init(address: String?, addressType: String?, area: String?, areaCode: String?, areaCodeSlug: String?, checkoutMode: String?, city: String?, country: String?, countryCode: String?, email: String?, geoLocation: GeoLocation?, googleMapPoint: [String: Any]?, id: String?, isActive: Bool?, isDefaultAddress: Bool?, landmark: String?, meta: [String: Any]?, name: String?, phone: String?, state: String?, tags: [String]?, userId: String?) { - - self.email = email - - self.id = id - - self.isDefaultAddress = isDefaultAddress - - self.city = city - - self.areaCodeSlug = areaCodeSlug - - self.area = area - - self.name = name - - self.geoLocation = geoLocation - - self.areaCode = areaCode - - self.userId = userId - - self.countryCode = countryCode - - self.addressType = addressType - - self.landmark = landmark - - self.state = state - - self.googleMapPoint = googleMapPoint - - self.phone = phone - - self.checkoutMode = checkoutMode - - self.isActive = isActive - - self.country = country - - self.address = address - - self.meta = meta - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isDefaultAddress = try container.decode(Bool.self, forKey: .isDefaultAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - areaCodeSlug = try container.decode(String.self, forKey: .areaCodeSlug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - area = try container.decode(String.self, forKey: .area) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - geoLocation = try container.decode(GeoLocation.self, forKey: .geoLocation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - areaCode = try container.decode(String.self, forKey: .areaCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressType = try container.decode(String.self, forKey: .addressType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - landmark = try container.decode(String.self, forKey: .landmark) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(String.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - googleMapPoint = try container.decode([String: Any].self, forKey: .googleMapPoint) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - checkoutMode = try container.decode(String.self, forKey: .checkoutMode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address = try container.decode(String.self, forKey: .address) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(isDefaultAddress, forKey: .isDefaultAddress) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(areaCodeSlug, forKey: .areaCodeSlug) - - - - try? container.encodeIfPresent(area, forKey: .area) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(geoLocation, forKey: .geoLocation) - - - - try? container.encodeIfPresent(areaCode, forKey: .areaCode) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(addressType, forKey: .addressType) - - - - try? container.encodeIfPresent(landmark, forKey: .landmark) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(googleMapPoint, forKey: .googleMapPoint) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(checkoutMode, forKey: .checkoutMode) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: GetAddressesResponse - Used By: Cart - */ - class GetAddressesResponse: Codable { - - public var address: [Address]? - - - public enum CodingKeys: String, CodingKey { - - case address = "address" - - } - - public init(address: [Address]?) { - - self.address = address - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - address = try container.decode([Address].self, forKey: .address) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(address, forKey: .address) - - - } - - } - - /* - Model: SaveAddressResponse - Used By: Cart - */ - class SaveAddressResponse: Codable { - - public var id: String? - - public var success: Bool? - - public var isDefaultAddress: Bool? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case success = "success" - - case isDefaultAddress = "is_default_address" - - } - - public init(id: String?, isDefaultAddress: Bool?, success: Bool?) { - - self.id = id - - self.success = success - - self.isDefaultAddress = isDefaultAddress - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isDefaultAddress = try container.decode(Bool.self, forKey: .isDefaultAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(isDefaultAddress, forKey: .isDefaultAddress) - - - } - - } - - /* - Model: UpdateAddressResponse - Used By: Cart - */ - class UpdateAddressResponse: Codable { - - public var id: String? - - public var success: Bool? - - public var isDefaultAddress: Bool? - - public var isUpdated: Bool? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case success = "success" - - case isDefaultAddress = "is_default_address" - - case isUpdated = "is_updated" - - } - - public init(id: String?, isDefaultAddress: Bool?, isUpdated: Bool?, success: Bool?) { - - self.id = id - - self.success = success - - self.isDefaultAddress = isDefaultAddress - - self.isUpdated = isUpdated - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isDefaultAddress = try container.decode(Bool.self, forKey: .isDefaultAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isUpdated = try container.decode(Bool.self, forKey: .isUpdated) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(isDefaultAddress, forKey: .isDefaultAddress) - - - - try? container.encodeIfPresent(isUpdated, forKey: .isUpdated) - - - } - - } - - /* - Model: DeleteAddressResponse - Used By: Cart - */ - class DeleteAddressResponse: Codable { - - public var id: String? - - public var isDeleted: Bool? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case isDeleted = "is_deleted" - - } - - public init(id: String?, isDeleted: Bool?) { - - self.id = id - - self.isDeleted = isDeleted - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isDeleted = try container.decode(Bool.self, forKey: .isDeleted) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(isDeleted, forKey: .isDeleted) - - - } - - } - - /* - Model: SelectCartAddressRequest - Used By: Cart - */ - class SelectCartAddressRequest: Codable { - - public var id: String? - - public var billingAddressId: String? - - public var cartId: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case billingAddressId = "billing_address_id" - - case cartId = "cart_id" - - } - - public init(billingAddressId: String?, cartId: String?, id: String?) { - - self.id = id - - self.billingAddressId = billingAddressId - - self.cartId = cartId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - billingAddressId = try container.decode(String.self, forKey: .billingAddressId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cartId = try container.decode(String.self, forKey: .cartId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(billingAddressId, forKey: .billingAddressId) - - - - try? container.encodeIfPresent(cartId, forKey: .cartId) - - - } - - } - - /* - Model: UpdateCartPaymentRequest - Used By: Cart - */ - class UpdateCartPaymentRequest: Codable { - - public var paymentIdentifier: String? - - public var addressId: String? - - public var aggregatorName: String? - - public var paymentMode: String? - - public var id: String? - - public var merchantCode: String? - - - public enum CodingKeys: String, CodingKey { - - case paymentIdentifier = "payment_identifier" - - case addressId = "address_id" - - case aggregatorName = "aggregator_name" - - case paymentMode = "payment_mode" - - case id = "id" - - case merchantCode = "merchant_code" - - } - - public init(addressId: String?, aggregatorName: String?, id: String?, merchantCode: String?, paymentIdentifier: String?, paymentMode: String?) { - - self.paymentIdentifier = paymentIdentifier - - self.addressId = addressId - - self.aggregatorName = aggregatorName - - self.paymentMode = paymentMode - - self.id = id - - self.merchantCode = merchantCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - paymentIdentifier = try container.decode(String.self, forKey: .paymentIdentifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressId = try container.decode(String.self, forKey: .addressId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - aggregatorName = try container.decode(String.self, forKey: .aggregatorName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentMode = try container.decode(String.self, forKey: .paymentMode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - merchantCode = try container.decode(String.self, forKey: .merchantCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(paymentIdentifier, forKey: .paymentIdentifier) - - - - try? container.encodeIfPresent(addressId, forKey: .addressId) - - - - try? container.encodeIfPresent(aggregatorName, forKey: .aggregatorName) - - - - try? container.encodeIfPresent(paymentMode, forKey: .paymentMode) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(merchantCode, forKey: .merchantCode) - - - } - - } - - /* - Model: CouponValidity - Used By: Cart - */ - class CouponValidity: Codable { - - public var displayMessageEn: String? - - public var code: String? - - public var title: String? - - public var discount: Double? - - public var valid: Bool? - - - public enum CodingKeys: String, CodingKey { - - case displayMessageEn = "display_message_en" - - case code = "code" - - case title = "title" - - case discount = "discount" - - case valid = "valid" - - } - - public init(code: String?, discount: Double?, displayMessageEn: String?, title: String?, valid: Bool?) { - - self.displayMessageEn = displayMessageEn - - self.code = code - - self.title = title - - self.discount = discount - - self.valid = valid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - displayMessageEn = try container.decode(String.self, forKey: .displayMessageEn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discount = try container.decode(Double.self, forKey: .discount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - valid = try container.decode(Bool.self, forKey: .valid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(displayMessageEn, forKey: .displayMessageEn) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - - try? container.encodeIfPresent(valid, forKey: .valid) - - - } - - } - - /* - Model: PaymentCouponValidate - Used By: Cart - */ - class PaymentCouponValidate: Codable { - - public var couponValidity: CouponValidity? - - public var message: String? - - public var success: Bool - - - public enum CodingKeys: String, CodingKey { - - case couponValidity = "coupon_validity" - - case message = "message" - - case success = "success" - - } - - public init(couponValidity: CouponValidity?, message: String?, success: Bool) { - - self.couponValidity = couponValidity - - self.message = message - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - couponValidity = try container.decode(CouponValidity.self, forKey: .couponValidity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - success = try container.decode(Bool.self, forKey: .success) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(couponValidity, forKey: .couponValidity) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: ShipmentResponse - Used By: Cart - */ - class ShipmentResponse: Codable { - - public var dpOptions: [String: Any]? - - public var shipmentType: String? - - public var fulfillmentId: Int? - - public var promise: ShipmentPromise? - - public var orderType: String? - - public var dpId: Int? - - public var shipments: Int? - - public var boxType: String? - - public var items: [CartProductInfo]? - - public var fulfillmentType: String? - - - public enum CodingKeys: String, CodingKey { - - case dpOptions = "dp_options" - - case shipmentType = "shipment_type" - - case fulfillmentId = "fulfillment_id" - - case promise = "promise" - - case orderType = "order_type" - - case dpId = "dp_id" - - case shipments = "shipments" - - case boxType = "box_type" - - case items = "items" - - case fulfillmentType = "fulfillment_type" - - } - - public init(boxType: String?, dpId: Int?, dpOptions: [String: Any]?, fulfillmentId: Int?, fulfillmentType: String?, items: [CartProductInfo]?, orderType: String?, promise: ShipmentPromise?, shipments: Int?, shipmentType: String?) { - - self.dpOptions = dpOptions - - self.shipmentType = shipmentType - - self.fulfillmentId = fulfillmentId - - self.promise = promise - - self.orderType = orderType - - self.dpId = dpId - - self.shipments = shipments - - self.boxType = boxType - - self.items = items - - self.fulfillmentType = fulfillmentType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - dpOptions = try container.decode([String: Any].self, forKey: .dpOptions) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shipmentType = try container.decode(String.self, forKey: .shipmentType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fulfillmentId = try container.decode(Int.self, forKey: .fulfillmentId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - promise = try container.decode(ShipmentPromise.self, forKey: .promise) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderType = try container.decode(String.self, forKey: .orderType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dpId = try container.decode(Int.self, forKey: .dpId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shipments = try container.decode(Int.self, forKey: .shipments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - boxType = try container.decode(String.self, forKey: .boxType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([CartProductInfo].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fulfillmentType = try container.decode(String.self, forKey: .fulfillmentType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(dpOptions, forKey: .dpOptions) - - - - try? container.encodeIfPresent(shipmentType, forKey: .shipmentType) - - - - try? container.encodeIfPresent(fulfillmentId, forKey: .fulfillmentId) - - - - try? container.encodeIfPresent(promise, forKey: .promise) - - - - try? container.encodeIfPresent(orderType, forKey: .orderType) - - - - try? container.encodeIfPresent(dpId, forKey: .dpId) - - - - try? container.encodeIfPresent(shipments, forKey: .shipments) - - - - try? container.encodeIfPresent(boxType, forKey: .boxType) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(fulfillmentType, forKey: .fulfillmentType) - - - } - - } - - /* - Model: CartShipmentsResponse - Used By: Cart - */ - class CartShipmentsResponse: Codable { - - public var uid: String? - - public var id: String? - - public var restrictCheckout: Bool? - - public var breakupValues: CartBreakup? - - public var paymentSelectionLock: PaymentSelectionLock? - - public var isValid: Bool? - - public var error: Bool? - - public var shipments: [ShipmentResponse]? - - public var currency: CartCurrency? - - public var cartId: Int? - - public var checkoutMode: String? - - public var lastModified: String? - - public var couponText: String? - - public var message: String? - - public var comment: String? - - public var deliveryChargeInfo: String? - - public var deliveryPromise: ShipmentPromise? - - public var gstin: String? - - - public enum CodingKeys: String, CodingKey { - - case uid = "uid" - - case id = "id" - - case restrictCheckout = "restrict_checkout" - - case breakupValues = "breakup_values" - - case paymentSelectionLock = "payment_selection_lock" - - case isValid = "is_valid" - - case error = "error" - - case shipments = "shipments" - - case currency = "currency" - - case cartId = "cart_id" - - case checkoutMode = "checkout_mode" - - case lastModified = "last_modified" - - case couponText = "coupon_text" - - case message = "message" - - case comment = "comment" - - case deliveryChargeInfo = "delivery_charge_info" - - case deliveryPromise = "delivery_promise" - - case gstin = "gstin" - - } - - public init(breakupValues: CartBreakup?, cartId: Int?, checkoutMode: String?, comment: String?, couponText: String?, currency: CartCurrency?, deliveryChargeInfo: String?, deliveryPromise: ShipmentPromise?, error: Bool?, gstin: String?, id: String?, isValid: Bool?, lastModified: String?, message: String?, paymentSelectionLock: PaymentSelectionLock?, restrictCheckout: Bool?, shipments: [ShipmentResponse]?, uid: String?) { - - self.uid = uid - - self.id = id - - self.restrictCheckout = restrictCheckout - - self.breakupValues = breakupValues - - self.paymentSelectionLock = paymentSelectionLock - - self.isValid = isValid - - self.error = error - - self.shipments = shipments - - self.currency = currency - - self.cartId = cartId - - self.checkoutMode = checkoutMode - - self.lastModified = lastModified - - self.couponText = couponText - - self.message = message - - self.comment = comment - - self.deliveryChargeInfo = deliveryChargeInfo - - self.deliveryPromise = deliveryPromise - - self.gstin = gstin - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - restrictCheckout = try container.decode(Bool.self, forKey: .restrictCheckout) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - breakupValues = try container.decode(CartBreakup.self, forKey: .breakupValues) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentSelectionLock = try container.decode(PaymentSelectionLock.self, forKey: .paymentSelectionLock) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isValid = try container.decode(Bool.self, forKey: .isValid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - error = try container.decode(Bool.self, forKey: .error) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shipments = try container.decode([ShipmentResponse].self, forKey: .shipments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(CartCurrency.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cartId = try container.decode(Int.self, forKey: .cartId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - checkoutMode = try container.decode(String.self, forKey: .checkoutMode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastModified = try container.decode(String.self, forKey: .lastModified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - couponText = try container.decode(String.self, forKey: .couponText) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - comment = try container.decode(String.self, forKey: .comment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryChargeInfo = try container.decode(String.self, forKey: .deliveryChargeInfo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryPromise = try container.decode(ShipmentPromise.self, forKey: .deliveryPromise) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstin = try container.decode(String.self, forKey: .gstin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(restrictCheckout, forKey: .restrictCheckout) - - - - try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) - - - - try? container.encodeIfPresent(paymentSelectionLock, forKey: .paymentSelectionLock) - - - - try? container.encodeIfPresent(isValid, forKey: .isValid) - - - - try? container.encodeIfPresent(error, forKey: .error) - - - - try? container.encodeIfPresent(shipments, forKey: .shipments) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(cartId, forKey: .cartId) - - - - try? container.encodeIfPresent(checkoutMode, forKey: .checkoutMode) - - - - try? container.encodeIfPresent(lastModified, forKey: .lastModified) - - - - try? container.encodeIfPresent(couponText, forKey: .couponText) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(comment, forKey: .comment) - - - - try? container.encodeIfPresent(deliveryChargeInfo, forKey: .deliveryChargeInfo) - - - - try? container.encodeIfPresent(deliveryPromise, forKey: .deliveryPromise) - - - - try? container.encodeIfPresent(gstin, forKey: .gstin) - - - } - - } - - /* - Model: StaffCheckout - Used By: Cart - */ - class StaffCheckout: Codable { - - public var lastName: String - - public var firstName: String - - public var user: String - - public var id: String - - - public enum CodingKeys: String, CodingKey { - - case lastName = "last_name" - - case firstName = "first_name" - - case user = "user" - - case id = "_id" - - } - - public init(firstName: String, lastName: String, user: String, id: String) { - - self.lastName = lastName - - self.firstName = firstName - - self.user = user - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - lastName = try container.decode(String.self, forKey: .lastName) - - - - - firstName = try container.decode(String.self, forKey: .firstName) - - - - - user = try container.decode(String.self, forKey: .user) - - - - - id = try container.decode(String.self, forKey: .id) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: CartCheckoutDetailRequest - Used By: Cart - */ - class CartCheckoutDetailRequest: Codable { - - public var billingAddressId: String? - - public var paymentAutoConfirm: Bool? - - public var paymentIdentifier: String? - - public var addressId: String? - - public var deliveryAddress: [String: Any]? - - public var orderingStore: Int? - - public var paymentParams: [String: Any]? - - public var paymentMode: String - - public var aggregator: String? - - public var extraMeta: [String: Any]? - - public var staff: StaffCheckout? - - public var merchantCode: String? - - public var meta: [String: Any]? - - public var fyndstoreEmpId: String? - - public var callbackUrl: String? - - public var billingAddress: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case billingAddressId = "billing_address_id" - - case paymentAutoConfirm = "payment_auto_confirm" - - case paymentIdentifier = "payment_identifier" - - case addressId = "address_id" - - case deliveryAddress = "delivery_address" - - case orderingStore = "ordering_store" - - case paymentParams = "payment_params" - - case paymentMode = "payment_mode" - - case aggregator = "aggregator" - - case extraMeta = "extra_meta" - - case staff = "staff" - - case merchantCode = "merchant_code" - - case meta = "meta" - - case fyndstoreEmpId = "fyndstore_emp_id" - - case callbackUrl = "callback_url" - - case billingAddress = "billing_address" - - } - - public init(addressId: String?, aggregator: String?, billingAddress: [String: Any]?, billingAddressId: String?, callbackUrl: String?, deliveryAddress: [String: Any]?, extraMeta: [String: Any]?, fyndstoreEmpId: String?, merchantCode: String?, meta: [String: Any]?, orderingStore: Int?, paymentAutoConfirm: Bool?, paymentIdentifier: String?, paymentMode: String, paymentParams: [String: Any]?, staff: StaffCheckout?) { - - self.billingAddressId = billingAddressId - - self.paymentAutoConfirm = paymentAutoConfirm - - self.paymentIdentifier = paymentIdentifier - - self.addressId = addressId - - self.deliveryAddress = deliveryAddress - - self.orderingStore = orderingStore - - self.paymentParams = paymentParams - - self.paymentMode = paymentMode - - self.aggregator = aggregator - - self.extraMeta = extraMeta - - self.staff = staff - - self.merchantCode = merchantCode - - self.meta = meta - - self.fyndstoreEmpId = fyndstoreEmpId - - self.callbackUrl = callbackUrl - - self.billingAddress = billingAddress - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - billingAddressId = try container.decode(String.self, forKey: .billingAddressId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentAutoConfirm = try container.decode(Bool.self, forKey: .paymentAutoConfirm) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentIdentifier = try container.decode(String.self, forKey: .paymentIdentifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressId = try container.decode(String.self, forKey: .addressId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryAddress = try container.decode([String: Any].self, forKey: .deliveryAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderingStore = try container.decode(Int.self, forKey: .orderingStore) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentParams = try container.decode([String: Any].self, forKey: .paymentParams) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - paymentMode = try container.decode(String.self, forKey: .paymentMode) - - - - - do { - aggregator = try container.decode(String.self, forKey: .aggregator) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - extraMeta = try container.decode([String: Any].self, forKey: .extraMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - staff = try container.decode(StaffCheckout.self, forKey: .staff) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - merchantCode = try container.decode(String.self, forKey: .merchantCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fyndstoreEmpId = try container.decode(String.self, forKey: .fyndstoreEmpId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - callbackUrl = try container.decode(String.self, forKey: .callbackUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - billingAddress = try container.decode([String: Any].self, forKey: .billingAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(billingAddressId, forKey: .billingAddressId) - - - - try? container.encodeIfPresent(paymentAutoConfirm, forKey: .paymentAutoConfirm) - - - - try? container.encodeIfPresent(paymentIdentifier, forKey: .paymentIdentifier) - - - - try? container.encodeIfPresent(addressId, forKey: .addressId) - - - - try? container.encodeIfPresent(deliveryAddress, forKey: .deliveryAddress) - - - - try? container.encodeIfPresent(orderingStore, forKey: .orderingStore) - - - - try? container.encodeIfPresent(paymentParams, forKey: .paymentParams) - - - - try? container.encodeIfPresent(paymentMode, forKey: .paymentMode) - - - - try? container.encodeIfPresent(aggregator, forKey: .aggregator) - - - - try? container.encodeIfPresent(extraMeta, forKey: .extraMeta) - - - - try? container.encodeIfPresent(staff, forKey: .staff) - - - - try? container.encodeIfPresent(merchantCode, forKey: .merchantCode) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(fyndstoreEmpId, forKey: .fyndstoreEmpId) - - - - try? container.encodeIfPresent(callbackUrl, forKey: .callbackUrl) - - - - try? container.encodeIfPresent(billingAddress, forKey: .billingAddress) - - - } - - } - - /* - Model: CheckCart - Used By: Cart - */ - class CheckCart: Codable { - - public var deliveryChargeOrderValue: Int? - - public var uid: String? - - public var id: String? - - public var restrictCheckout: Bool? - - public var userType: String? - - public var codCharges: Int? - - public var breakupValues: CartBreakup? - - public var paymentSelectionLock: PaymentSelectionLock? - - public var isValid: Bool? - - public var storeEmps: [[String: Any]]? - - public var orderId: String? - - public var currency: CartCurrency? - - public var cartId: Int? - - public var codAvailable: Bool? - - public var checkoutMode: String? - - public var codMessage: String? - - public var lastModified: String? - - public var couponText: String? - - public var message: String? - - public var comment: String? - - public var items: [CartProductInfo]? - - public var deliveryChargeInfo: String? - - public var errorMessage: String? - - public var deliveryPromise: ShipmentPromise? - - public var deliveryCharges: Int? - - public var storeCode: String? - - public var gstin: String? - - public var success: Bool? - - - public enum CodingKeys: String, CodingKey { - - case deliveryChargeOrderValue = "delivery_charge_order_value" - - case uid = "uid" - - case id = "id" - - case restrictCheckout = "restrict_checkout" - - case userType = "user_type" - - case codCharges = "cod_charges" - - case breakupValues = "breakup_values" - - case paymentSelectionLock = "payment_selection_lock" - - case isValid = "is_valid" - - case storeEmps = "store_emps" - - case orderId = "order_id" - - case currency = "currency" - - case cartId = "cart_id" - - case codAvailable = "cod_available" - - case checkoutMode = "checkout_mode" - - case codMessage = "cod_message" - - case lastModified = "last_modified" - - case couponText = "coupon_text" - - case message = "message" - - case comment = "comment" - - case items = "items" - - case deliveryChargeInfo = "delivery_charge_info" - - case errorMessage = "error_message" - - case deliveryPromise = "delivery_promise" - - case deliveryCharges = "delivery_charges" - - case storeCode = "store_code" - - case gstin = "gstin" - - case success = "success" - - } - - public init(breakupValues: CartBreakup?, cartId: Int?, checkoutMode: String?, codAvailable: Bool?, codCharges: Int?, codMessage: String?, comment: String?, couponText: String?, currency: CartCurrency?, deliveryCharges: Int?, deliveryChargeInfo: String?, deliveryChargeOrderValue: Int?, deliveryPromise: ShipmentPromise?, errorMessage: String?, gstin: String?, id: String?, isValid: Bool?, items: [CartProductInfo]?, lastModified: String?, message: String?, orderId: String?, paymentSelectionLock: PaymentSelectionLock?, restrictCheckout: Bool?, storeCode: String?, storeEmps: [[String: Any]]?, success: Bool?, uid: String?, userType: String?) { - - self.deliveryChargeOrderValue = deliveryChargeOrderValue - - self.uid = uid - - self.id = id - - self.restrictCheckout = restrictCheckout - - self.userType = userType - - self.codCharges = codCharges - - self.breakupValues = breakupValues - - self.paymentSelectionLock = paymentSelectionLock - - self.isValid = isValid - - self.storeEmps = storeEmps - - self.orderId = orderId - - self.currency = currency - - self.cartId = cartId - - self.codAvailable = codAvailable - - self.checkoutMode = checkoutMode - - self.codMessage = codMessage - - self.lastModified = lastModified - - self.couponText = couponText - - self.message = message - - self.comment = comment - - self.items = items - - self.deliveryChargeInfo = deliveryChargeInfo - - self.errorMessage = errorMessage - - self.deliveryPromise = deliveryPromise - - self.deliveryCharges = deliveryCharges - - self.storeCode = storeCode - - self.gstin = gstin - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - deliveryChargeOrderValue = try container.decode(Int.self, forKey: .deliveryChargeOrderValue) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - restrictCheckout = try container.decode(Bool.self, forKey: .restrictCheckout) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userType = try container.decode(String.self, forKey: .userType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - codCharges = try container.decode(Int.self, forKey: .codCharges) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - breakupValues = try container.decode(CartBreakup.self, forKey: .breakupValues) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentSelectionLock = try container.decode(PaymentSelectionLock.self, forKey: .paymentSelectionLock) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isValid = try container.decode(Bool.self, forKey: .isValid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeEmps = try container.decode([[String: Any]].self, forKey: .storeEmps) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderId = try container.decode(String.self, forKey: .orderId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(CartCurrency.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cartId = try container.decode(Int.self, forKey: .cartId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - codAvailable = try container.decode(Bool.self, forKey: .codAvailable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - checkoutMode = try container.decode(String.self, forKey: .checkoutMode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - codMessage = try container.decode(String.self, forKey: .codMessage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastModified = try container.decode(String.self, forKey: .lastModified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - couponText = try container.decode(String.self, forKey: .couponText) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - comment = try container.decode(String.self, forKey: .comment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([CartProductInfo].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryChargeInfo = try container.decode(String.self, forKey: .deliveryChargeInfo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - errorMessage = try container.decode(String.self, forKey: .errorMessage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryPromise = try container.decode(ShipmentPromise.self, forKey: .deliveryPromise) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryCharges = try container.decode(Int.self, forKey: .deliveryCharges) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeCode = try container.decode(String.self, forKey: .storeCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstin = try container.decode(String.self, forKey: .gstin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(deliveryChargeOrderValue, forKey: .deliveryChargeOrderValue) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(restrictCheckout, forKey: .restrictCheckout) - - - - try? container.encodeIfPresent(userType, forKey: .userType) - - - - try? container.encodeIfPresent(codCharges, forKey: .codCharges) - - - - try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) - - - - try? container.encodeIfPresent(paymentSelectionLock, forKey: .paymentSelectionLock) - - - - try? container.encodeIfPresent(isValid, forKey: .isValid) - - - - try? container.encodeIfPresent(storeEmps, forKey: .storeEmps) - - - - try? container.encodeIfPresent(orderId, forKey: .orderId) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(cartId, forKey: .cartId) - - - - try? container.encodeIfPresent(codAvailable, forKey: .codAvailable) - - - - try? container.encodeIfPresent(checkoutMode, forKey: .checkoutMode) - - - - try? container.encodeIfPresent(codMessage, forKey: .codMessage) - - - - try? container.encodeIfPresent(lastModified, forKey: .lastModified) - - - - try? container.encodeIfPresent(couponText, forKey: .couponText) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(comment, forKey: .comment) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(deliveryChargeInfo, forKey: .deliveryChargeInfo) - - - - try? container.encodeIfPresent(errorMessage, forKey: .errorMessage) - - - - try? container.encodeIfPresent(deliveryPromise, forKey: .deliveryPromise) - - - - try? container.encodeIfPresent(deliveryCharges, forKey: .deliveryCharges) - - - - try? container.encodeIfPresent(storeCode, forKey: .storeCode) - - - - try? container.encodeIfPresent(gstin, forKey: .gstin) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: CartCheckoutResponse - Used By: Cart - */ - class CartCheckoutResponse: Codable { - - public var orderId: String? - - public var cart: CheckCart? - - public var message: String? - - public var success: Bool? - - public var callbackUrl: String? - - public var data: [String: Any]? - - public var appInterceptUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case orderId = "order_id" - - case cart = "cart" - - case message = "message" - - case success = "success" - - case callbackUrl = "callback_url" - - case data = "data" - - case appInterceptUrl = "app_intercept_url" - - } - - public init(appInterceptUrl: String?, callbackUrl: String?, cart: CheckCart?, data: [String: Any]?, message: String?, orderId: String?, success: Bool?) { - - self.orderId = orderId - - self.cart = cart - - self.message = message - - self.success = success - - self.callbackUrl = callbackUrl - - self.data = data - - self.appInterceptUrl = appInterceptUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - orderId = try container.decode(String.self, forKey: .orderId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cart = try container.decode(CheckCart.self, forKey: .cart) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - callbackUrl = try container.decode(String.self, forKey: .callbackUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode([String: Any].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appInterceptUrl = try container.decode(String.self, forKey: .appInterceptUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(orderId, forKey: .orderId) - - - - try? container.encodeIfPresent(cart, forKey: .cart) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(callbackUrl, forKey: .callbackUrl) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - - try? container.encodeIfPresent(appInterceptUrl, forKey: .appInterceptUrl) - - - } - - } - - /* - Model: CartMetaRequest - Used By: Cart - */ - class CartMetaRequest: Codable { - - public var checkoutMode: String? - - public var pickUpCustomerDetails: [String: Any]? - - public var comment: String? - - public var gstin: String? - - - public enum CodingKeys: String, CodingKey { - - case checkoutMode = "checkout_mode" - - case pickUpCustomerDetails = "pick_up_customer_details" - - case comment = "comment" - - case gstin = "gstin" - - } - - public init(checkoutMode: String?, comment: String?, gstin: String?, pickUpCustomerDetails: [String: Any]?) { - - self.checkoutMode = checkoutMode - - self.pickUpCustomerDetails = pickUpCustomerDetails - - self.comment = comment - - self.gstin = gstin - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - checkoutMode = try container.decode(String.self, forKey: .checkoutMode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pickUpCustomerDetails = try container.decode([String: Any].self, forKey: .pickUpCustomerDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - comment = try container.decode(String.self, forKey: .comment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstin = try container.decode(String.self, forKey: .gstin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(checkoutMode, forKey: .checkoutMode) - - - - try? container.encodeIfPresent(pickUpCustomerDetails, forKey: .pickUpCustomerDetails) - - - - try? container.encodeIfPresent(comment, forKey: .comment) - - - - try? container.encodeIfPresent(gstin, forKey: .gstin) - - - } - - } - - /* - Model: CartMetaResponse - Used By: Cart - */ - class CartMetaResponse: Codable { - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: CartMetaMissingResponse - Used By: Cart - */ - class CartMetaMissingResponse: Codable { - - public var errors: [String]? - - - public enum CodingKeys: String, CodingKey { - - case errors = "errors" - - } - - public init(errors: [String]?) { - - self.errors = errors - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - errors = try container.decode([String].self, forKey: .errors) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(errors, forKey: .errors) - - - } - - } - - /* - Model: GetShareCartLinkRequest - Used By: Cart - */ - class GetShareCartLinkRequest: Codable { - - public var id: String? - - public var meta: [String: Any]? - - public var uid: Int - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case meta = "meta" - - case uid = "uid" - - } - - public init(id: String?, meta: [String: Any]?, uid: Int) { - - self.id = id - - self.meta = meta - - self.uid = uid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - uid = try container.decode(Int.self, forKey: .uid) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - } - - } - - /* - Model: GetShareCartLinkResponse - Used By: Cart - */ - class GetShareCartLinkResponse: Codable { - - public var token: String? - - public var shareUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case token = "token" - - case shareUrl = "share_url" - - } - - public init(shareUrl: String?, token: String?) { - - self.token = token - - self.shareUrl = shareUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - token = try container.decode(String.self, forKey: .token) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shareUrl = try container.decode(String.self, forKey: .shareUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(token, forKey: .token) - - - - try? container.encodeIfPresent(shareUrl, forKey: .shareUrl) - - - } - - } - - /* - Model: SharedCartDetails - Used By: Cart - */ - class SharedCartDetails: Codable { - - public var token: String? - - public var createdOn: String? - - public var user: [String: Any]? - - public var meta: [String: Any]? - - public var source: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case token = "token" - - case createdOn = "created_on" - - case user = "user" - - case meta = "meta" - - case source = "source" - - } - - public init(createdOn: String?, meta: [String: Any]?, source: [String: Any]?, token: String?, user: [String: Any]?) { - - self.token = token - - self.createdOn = createdOn - - self.user = user - - self.meta = meta - - self.source = source - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - token = try container.decode(String.self, forKey: .token) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - user = try container.decode([String: Any].self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - source = try container.decode([String: Any].self, forKey: .source) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(token, forKey: .token) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(source, forKey: .source) - - - } - - } - - /* - Model: SharedCart - Used By: Cart - */ - class SharedCart: Codable { - - public var cartId: Int? - - public var uid: String? - - public var id: String? - - public var checkoutMode: String? - - public var restrictCheckout: Bool? - - public var lastModified: String? - - public var deliveryPromise: ShipmentPromise? - - public var couponText: String? - - public var message: String? - - public var breakupValues: CartBreakup? - - public var gstin: String? - - public var comment: String? - - public var paymentSelectionLock: PaymentSelectionLock? - - public var items: [CartProductInfo]? - - public var isValid: Bool? - - public var deliveryChargeInfo: String? - - public var sharedCartDetails: SharedCartDetails? - - public var currency: CartCurrency? - - - public enum CodingKeys: String, CodingKey { - - case cartId = "cart_id" - - case uid = "uid" - - case id = "id" - - case checkoutMode = "checkout_mode" - - case restrictCheckout = "restrict_checkout" - - case lastModified = "last_modified" - - case deliveryPromise = "delivery_promise" - - case couponText = "coupon_text" - - case message = "message" - - case breakupValues = "breakup_values" - - case gstin = "gstin" - - case comment = "comment" - - case paymentSelectionLock = "payment_selection_lock" - - case items = "items" - - case isValid = "is_valid" - - case deliveryChargeInfo = "delivery_charge_info" - - case sharedCartDetails = "shared_cart_details" - - case currency = "currency" - - } - - public init(breakupValues: CartBreakup?, cartId: Int?, checkoutMode: String?, comment: String?, couponText: String?, currency: CartCurrency?, deliveryChargeInfo: String?, deliveryPromise: ShipmentPromise?, gstin: String?, id: String?, isValid: Bool?, items: [CartProductInfo]?, lastModified: String?, message: String?, paymentSelectionLock: PaymentSelectionLock?, restrictCheckout: Bool?, sharedCartDetails: SharedCartDetails?, uid: String?) { - - self.cartId = cartId - - self.uid = uid - - self.id = id - - self.checkoutMode = checkoutMode - - self.restrictCheckout = restrictCheckout - - self.lastModified = lastModified - - self.deliveryPromise = deliveryPromise - - self.couponText = couponText - - self.message = message - - self.breakupValues = breakupValues - - self.gstin = gstin - - self.comment = comment - - self.paymentSelectionLock = paymentSelectionLock - - self.items = items - - self.isValid = isValid - - self.deliveryChargeInfo = deliveryChargeInfo - - self.sharedCartDetails = sharedCartDetails - - self.currency = currency - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cartId = try container.decode(Int.self, forKey: .cartId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - checkoutMode = try container.decode(String.self, forKey: .checkoutMode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - restrictCheckout = try container.decode(Bool.self, forKey: .restrictCheckout) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastModified = try container.decode(String.self, forKey: .lastModified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryPromise = try container.decode(ShipmentPromise.self, forKey: .deliveryPromise) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - couponText = try container.decode(String.self, forKey: .couponText) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - breakupValues = try container.decode(CartBreakup.self, forKey: .breakupValues) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstin = try container.decode(String.self, forKey: .gstin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - comment = try container.decode(String.self, forKey: .comment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentSelectionLock = try container.decode(PaymentSelectionLock.self, forKey: .paymentSelectionLock) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([CartProductInfo].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isValid = try container.decode(Bool.self, forKey: .isValid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryChargeInfo = try container.decode(String.self, forKey: .deliveryChargeInfo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sharedCartDetails = try container.decode(SharedCartDetails.self, forKey: .sharedCartDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(CartCurrency.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cartId, forKey: .cartId) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(checkoutMode, forKey: .checkoutMode) - - - - try? container.encodeIfPresent(restrictCheckout, forKey: .restrictCheckout) - - - - try? container.encodeIfPresent(lastModified, forKey: .lastModified) - - - - try? container.encodeIfPresent(deliveryPromise, forKey: .deliveryPromise) - - - - try? container.encodeIfPresent(couponText, forKey: .couponText) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) - - - - try? container.encodeIfPresent(gstin, forKey: .gstin) - - - - try? container.encodeIfPresent(comment, forKey: .comment) - - - - try? container.encodeIfPresent(paymentSelectionLock, forKey: .paymentSelectionLock) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(isValid, forKey: .isValid) - - - - try? container.encodeIfPresent(deliveryChargeInfo, forKey: .deliveryChargeInfo) - - - - try? container.encodeIfPresent(sharedCartDetails, forKey: .sharedCartDetails) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - } - - } - - /* - Model: SharedCartResponse - Used By: Cart - */ - class SharedCartResponse: Codable { - - public var cart: SharedCart? - - public var error: String? - - - public enum CodingKeys: String, CodingKey { - - case cart = "cart" - - case error = "error" - - } - - public init(cart: SharedCart?, error: String?) { - - self.cart = cart - - self.error = error - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cart = try container.decode(SharedCart.self, forKey: .cart) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - error = try container.decode(String.self, forKey: .error) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cart, forKey: .cart) - - - - try? container.encodeIfPresent(error, forKey: .error) - - - } - - } - - - - /* - Model: LocationDefaultLanguage - Used By: Common - */ - class LocationDefaultLanguage: Codable { - - public var name: String? - - public var code: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case code = "code" - - } - - public init(code: String?, name: String?) { - - self.name = name - - self.code = code - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - } - - } - - /* - Model: LocationDefaultCurrency - Used By: Common - */ - class LocationDefaultCurrency: Codable { - - public var name: String? - - public var symbol: String? - - public var code: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case symbol = "symbol" - - case code = "code" - - } - - public init(code: String?, name: String?, symbol: String?) { - - self.name = name - - self.symbol = symbol - - self.code = code - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - symbol = try container.decode(String.self, forKey: .symbol) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(symbol, forKey: .symbol) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - } - - } - - /* - Model: LocationCountry - Used By: Common - */ - class LocationCountry: Codable { - - public var capital: String? - - public var currency: String? - - public var iso2: String? - - public var iso3: String? - - public var name: String? - - public var parent: String? - - public var phoneCode: String? - - public var type: String? - - public var uid: Int? - - public var v: Int? - - public var id: String? - - public var defaultCurrency: LocationDefaultCurrency? - - public var defaultLanguage: LocationDefaultLanguage? - - - public enum CodingKeys: String, CodingKey { - - case capital = "capital" - - case currency = "currency" - - case iso2 = "iso2" - - case iso3 = "iso3" - - case name = "name" - - case parent = "parent" - - case phoneCode = "phone_code" - - case type = "type" - - case uid = "uid" - - case v = "__v" - - case id = "_id" - - case defaultCurrency = "default_currency" - - case defaultLanguage = "default_language" - - } - - public init(capital: String?, currency: String?, defaultCurrency: LocationDefaultCurrency?, defaultLanguage: LocationDefaultLanguage?, iso2: String?, iso3: String?, name: String?, parent: String?, phoneCode: String?, type: String?, uid: Int?, id: String?, v: Int?) { - - self.capital = capital - - self.currency = currency - - self.iso2 = iso2 - - self.iso3 = iso3 - - self.name = name - - self.parent = parent - - self.phoneCode = phoneCode - - self.type = type - - self.uid = uid - - self.v = v - - self.id = id - - self.defaultCurrency = defaultCurrency - - self.defaultLanguage = defaultLanguage - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - capital = try container.decode(String.self, forKey: .capital) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(String.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - iso2 = try container.decode(String.self, forKey: .iso2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - iso3 = try container.decode(String.self, forKey: .iso3) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - parent = try container.decode(String.self, forKey: .parent) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phoneCode = try container.decode(String.self, forKey: .phoneCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - defaultCurrency = try container.decode(LocationDefaultCurrency.self, forKey: .defaultCurrency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - defaultLanguage = try container.decode(LocationDefaultLanguage.self, forKey: .defaultLanguage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(capital, forKey: .capital) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(iso2, forKey: .iso2) - - - - try? container.encodeIfPresent(iso3, forKey: .iso3) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(parent, forKey: .parent) - - - - try? container.encodeIfPresent(phoneCode, forKey: .phoneCode) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(defaultCurrency, forKey: .defaultCurrency) - - - - try? container.encodeIfPresent(defaultLanguage, forKey: .defaultLanguage) - - - } - - } - - /* - Model: Locations - Used By: Common - */ - class Locations: Codable { - - public var items: [[String: Any]]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - } - - public init(items: [[String: Any]]?) { - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([[String: Any]].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - - - /* - Model: TicketList - Used By: Lead - */ - class TicketList: Codable { - - public var items: [Ticket]? - - public var filters: Filter? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case filters = "filters" - - case page = "page" - - } - - public init(filters: Filter?, items: [Ticket]?, page: Page?) { - - self.items = items - - self.filters = filters - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Ticket].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - filters = try container.decode(Filter.self, forKey: .filters) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(filters, forKey: .filters) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: Page - Used By: Lead - */ - class Page: Codable { - - public var itemTotal: Int? - - public var nextId: String? - - public var hasPrevious: Bool? - - public var hasNext: Bool? - - public var current: Int? - - public var type: String - - public var size: Int? - - - public enum CodingKeys: String, CodingKey { - - case itemTotal = "item_total" - - case nextId = "next_id" - - case hasPrevious = "has_previous" - - case hasNext = "has_next" - - case current = "current" - - case type = "type" - - case size = "size" - - } - - public init(current: Int?, hasNext: Bool?, hasPrevious: Bool?, itemTotal: Int?, nextId: String?, size: Int?, type: String) { - - self.itemTotal = itemTotal - - self.nextId = nextId - - self.hasPrevious = hasPrevious - - self.hasNext = hasNext - - self.current = current - - self.type = type - - self.size = size - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - itemTotal = try container.decode(Int.self, forKey: .itemTotal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - nextId = try container.decode(String.self, forKey: .nextId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasPrevious = try container.decode(Bool.self, forKey: .hasPrevious) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasNext = try container.decode(Bool.self, forKey: .hasNext) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - current = try container.decode(Int.self, forKey: .current) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - type = try container.decode(String.self, forKey: .type) - - - - - do { - size = try container.decode(Int.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) - - - - try? container.encodeIfPresent(nextId, forKey: .nextId) - - - - try? container.encodeIfPresent(hasPrevious, forKey: .hasPrevious) - - - - try? container.encodeIfPresent(hasNext, forKey: .hasNext) - - - - try? container.encodeIfPresent(current, forKey: .current) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - } - - } - - /* - Model: TicketHistoryList - Used By: Lead - */ - class TicketHistoryList: Codable { - - public var items: [TicketHistory]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [TicketHistory]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([TicketHistory].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: CustomFormList - Used By: Lead - */ - class CustomFormList: Codable { - - public var items: [CustomForm]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [CustomForm]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([CustomForm].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: CreateCustomFormPayload - Used By: Lead - */ - class CreateCustomFormPayload: Codable { - - public var slug: String - - public var title: String - - public var inputs: [[String: Any]] - - public var description: String? - - public var headerImage: String? - - public var priority: [String: Any] - - public var shouldNotify: Bool? - - public var successMessage: String? - - public var pollForAssignment: PollForAssignment? - - - public enum CodingKeys: String, CodingKey { - - case slug = "slug" - - case title = "title" - - case inputs = "inputs" - - case description = "description" - - case headerImage = "header_image" - - case priority = "priority" - - case shouldNotify = "should_notify" - - case successMessage = "success_message" - - case pollForAssignment = "poll_for_assignment" - - } - - public init(description: String?, headerImage: String?, inputs: [[String: Any]], pollForAssignment: PollForAssignment?, priority: [String: Any], shouldNotify: Bool?, slug: String, successMessage: String?, title: String) { - - self.slug = slug - - self.title = title - - self.inputs = inputs - - self.description = description - - self.headerImage = headerImage - - self.priority = priority - - self.shouldNotify = shouldNotify - - self.successMessage = successMessage - - self.pollForAssignment = pollForAssignment - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - slug = try container.decode(String.self, forKey: .slug) - - - - - title = try container.decode(String.self, forKey: .title) - - - - - inputs = try container.decode([[String: Any]].self, forKey: .inputs) - - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - headerImage = try container.decode(String.self, forKey: .headerImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - priority = try container.decode([String: Any].self, forKey: .priority) - - - - - do { - shouldNotify = try container.decode(Bool.self, forKey: .shouldNotify) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - successMessage = try container.decode(String.self, forKey: .successMessage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pollForAssignment = try container.decode(PollForAssignment.self, forKey: .pollForAssignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(inputs, forKey: .inputs) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(headerImage, forKey: .headerImage) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(shouldNotify, forKey: .shouldNotify) - - - - try? container.encodeIfPresent(successMessage, forKey: .successMessage) - - - - try? container.encodeIfPresent(pollForAssignment, forKey: .pollForAssignment) - - - } - - } - - /* - Model: EditCustomFormPayload - Used By: Lead - */ - class EditCustomFormPayload: Codable { - - public var title: String - - public var inputs: [[String: Any]] - - public var description: String? - - public var priority: [String: Any] - - public var headerImage: String? - - public var shouldNotify: Bool? - - public var loginRequired: Bool? - - public var successMessage: String? - - public var pollForAssignment: PollForAssignment? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case inputs = "inputs" - - case description = "description" - - case priority = "priority" - - case headerImage = "header_image" - - case shouldNotify = "should_notify" - - case loginRequired = "login_required" - - case successMessage = "success_message" - - case pollForAssignment = "poll_for_assignment" - - } - - public init(description: String?, headerImage: String?, inputs: [[String: Any]], loginRequired: Bool?, pollForAssignment: PollForAssignment?, priority: [String: Any], shouldNotify: Bool?, successMessage: String?, title: String) { - - self.title = title - - self.inputs = inputs - - self.description = description - - self.priority = priority - - self.headerImage = headerImage - - self.shouldNotify = shouldNotify - - self.loginRequired = loginRequired - - self.successMessage = successMessage - - self.pollForAssignment = pollForAssignment - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - title = try container.decode(String.self, forKey: .title) - - - - - inputs = try container.decode([[String: Any]].self, forKey: .inputs) - - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - priority = try container.decode([String: Any].self, forKey: .priority) - - - - - do { - headerImage = try container.decode(String.self, forKey: .headerImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shouldNotify = try container.decode(Bool.self, forKey: .shouldNotify) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - loginRequired = try container.decode(Bool.self, forKey: .loginRequired) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - successMessage = try container.decode(String.self, forKey: .successMessage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pollForAssignment = try container.decode(PollForAssignment.self, forKey: .pollForAssignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(inputs, forKey: .inputs) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(headerImage, forKey: .headerImage) - - - - try? container.encodeIfPresent(shouldNotify, forKey: .shouldNotify) - - - - try? container.encodeIfPresent(loginRequired, forKey: .loginRequired) - - - - try? container.encodeIfPresent(successMessage, forKey: .successMessage) - - - - try? container.encodeIfPresent(pollForAssignment, forKey: .pollForAssignment) - - - } - - } - - /* - Model: EditTicketPayload - Used By: Lead - */ - class EditTicketPayload: Codable { - - public var content: TicketContent? - - public var category: String? - - public var subCategory: String? - - public var source: String? - - public var status: String? - - public var priority: [String: Any]? - - public var assignedTo: AgentChangePayload? - - public var tags: [String]? - - - public enum CodingKeys: String, CodingKey { - - case content = "content" - - case category = "category" - - case subCategory = "sub_category" - - case source = "source" - - case status = "status" - - case priority = "priority" - - case assignedTo = "assigned_to" - - case tags = "tags" - - } - - public init(assignedTo: AgentChangePayload?, category: String?, content: TicketContent?, priority: [String: Any]?, source: String?, status: String?, subCategory: String?, tags: [String]?) { - - self.content = content - - self.category = category - - self.subCategory = subCategory - - self.source = source - - self.status = status - - self.priority = priority - - self.assignedTo = assignedTo - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - content = try container.decode(TicketContent.self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - category = try container.decode(String.self, forKey: .category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subCategory = try container.decode(String.self, forKey: .subCategory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - source = try container.decode(String.self, forKey: .source) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priority = try container.decode([String: Any].self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - assignedTo = try container.decode(AgentChangePayload.self, forKey: .assignedTo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(content, forKey: .content) - - - - try? container.encodeIfPresent(category, forKey: .category) - - - - try? container.encodeIfPresent(subCategory, forKey: .subCategory) - - - - try? container.encodeIfPresent(source, forKey: .source) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(assignedTo, forKey: .assignedTo) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: AgentChangePayload - Used By: Lead - */ - class AgentChangePayload: Codable { - - public var agentId: String - - - public enum CodingKeys: String, CodingKey { - - case agentId = "agent_id" - - } - - public init(agentId: String) { - - self.agentId = agentId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - agentId = try container.decode(String.self, forKey: .agentId) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(agentId, forKey: .agentId) - - - } - - } - - /* - Model: CreateVideoRoomResponse - Used By: Lead - */ - class CreateVideoRoomResponse: Codable { - - public var uniqueName: String - - - public enum CodingKeys: String, CodingKey { - - case uniqueName = "unique_name" - - } - - public init(uniqueName: String) { - - self.uniqueName = uniqueName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - uniqueName = try container.decode(String.self, forKey: .uniqueName) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uniqueName, forKey: .uniqueName) - - - } - - } - - /* - Model: CloseVideoRoomResponse - Used By: Lead - */ - class CloseVideoRoomResponse: Codable { - - public var success: Bool - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - } - - public init(success: Bool) { - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: CreateVideoRoomPayload - Used By: Lead - */ - class CreateVideoRoomPayload: Codable { - - public var uniqueName: String - - public var notify: [NotifyUser]? - - - public enum CodingKeys: String, CodingKey { - - case uniqueName = "unique_name" - - case notify = "notify" - - } - - public init(notify: [NotifyUser]?, uniqueName: String) { - - self.uniqueName = uniqueName - - self.notify = notify - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - uniqueName = try container.decode(String.self, forKey: .uniqueName) - - - - - do { - notify = try container.decode([NotifyUser].self, forKey: .notify) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uniqueName, forKey: .uniqueName) - - - - try? container.encodeIfPresent(notify, forKey: .notify) - - - } - - } - - /* - Model: NotifyUser - Used By: Lead - */ - class NotifyUser: Codable { - - public var countryCode: String - - public var phoneNumber: String - - - public enum CodingKeys: String, CodingKey { - - case countryCode = "country_code" - - case phoneNumber = "phone_number" - - } - - public init(countryCode: String, phoneNumber: String) { - - self.countryCode = countryCode - - self.phoneNumber = phoneNumber - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - countryCode = try container.decode(String.self, forKey: .countryCode) - - - - - phoneNumber = try container.decode(String.self, forKey: .phoneNumber) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(phoneNumber, forKey: .phoneNumber) - - - } - - } - - /* - Model: Filter - Used By: Lead - */ - class Filter: Codable { - - public var priorities: [Priority] - - public var categories: [TicketCategory]? - - public var statuses: [Status] - - public var assignees: [[String: Any]] - - - public enum CodingKeys: String, CodingKey { - - case priorities = "priorities" - - case categories = "categories" - - case statuses = "statuses" - - case assignees = "assignees" - - } - - public init(assignees: [[String: Any]], categories: [TicketCategory]?, priorities: [Priority], statuses: [Status]) { - - self.priorities = priorities - - self.categories = categories - - self.statuses = statuses - - self.assignees = assignees - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - priorities = try container.decode([Priority].self, forKey: .priorities) - - - - - do { - categories = try container.decode([TicketCategory].self, forKey: .categories) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - statuses = try container.decode([Status].self, forKey: .statuses) - - - - - assignees = try container.decode([[String: Any]].self, forKey: .assignees) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(priorities, forKey: .priorities) - - - - try? container.encodeIfPresent(categories, forKey: .categories) - - - - try? container.encodeIfPresent(statuses, forKey: .statuses) - - - - try? container.encodeIfPresent(assignees, forKey: .assignees) - - - } - - } - - /* - Model: TicketHistoryPayload - Used By: Lead - */ - class TicketHistoryPayload: Codable { - - public var value: [String: Any] - - public var type: [String: Any] - - - public enum CodingKeys: String, CodingKey { - - case value = "value" - - case type = "type" - - } - - public init(type: [String: Any], value: [String: Any]) { - - self.value = value - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - value = try container.decode([String: Any].self, forKey: .value) - - - - - type = try container.decode([String: Any].self, forKey: .type) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: CustomFormSubmissionPayload - Used By: Lead - */ - class CustomFormSubmissionPayload: Codable { - - public var response: [KeyValue] - - public var attachments: [TicketAsset]? - - - public enum CodingKeys: String, CodingKey { - - case response = "response" - - case attachments = "attachments" - - } - - public init(attachments: [TicketAsset]?, response: [KeyValue]) { - - self.response = response - - self.attachments = attachments - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - response = try container.decode([KeyValue].self, forKey: .response) - - - - - do { - attachments = try container.decode([TicketAsset].self, forKey: .attachments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(response, forKey: .response) - - - - try? container.encodeIfPresent(attachments, forKey: .attachments) - - - } - - } - - /* - Model: KeyValue - Used By: Lead - */ - class KeyValue: Codable { - - public var key: String - - public var value: [String: Any] - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case value = "value" - - } - - public init(key: String, value: [String: Any]) { - - self.key = key - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - key = try container.decode(String.self, forKey: .key) - - - - - value = try container.decode([String: Any].self, forKey: .value) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: GetTokenForVideoRoomResponse - Used By: Lead - */ - class GetTokenForVideoRoomResponse: Codable { - - public var accessToken: String - - - public enum CodingKeys: String, CodingKey { - - case accessToken = "access_token" - - } - - public init(accessToken: String) { - - self.accessToken = accessToken - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - accessToken = try container.decode(String.self, forKey: .accessToken) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(accessToken, forKey: .accessToken) - - - } - - } - - /* - Model: GetParticipantsInsideVideoRoomResponse - Used By: Lead - */ - class GetParticipantsInsideVideoRoomResponse: Codable { - - public var participants: [Participant] - - - public enum CodingKeys: String, CodingKey { - - case participants = "participants" - - } - - public init(participants: [Participant]) { - - self.participants = participants - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - participants = try container.decode([Participant].self, forKey: .participants) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(participants, forKey: .participants) - - - } - - } - - /* - Model: Participant - Used By: Lead - */ - class Participant: Codable { - - public var user: UserSchema? - - public var identity: String? - - public var status: String? - - - public enum CodingKeys: String, CodingKey { - - case user = "user" - - case identity = "identity" - - case status = "status" - - } - - public init(identity: String?, status: String?, user: UserSchema?) { - - self.user = user - - self.identity = identity - - self.status = status - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - user = try container.decode(UserSchema.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - identity = try container.decode(String.self, forKey: .identity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(identity, forKey: .identity) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - } - - } - - /* - Model: PhoneNumber - Used By: Lead - */ - class PhoneNumber: Codable { - - public var active: Bool? - - public var primary: Bool? - - public var verified: Bool? - - public var phone: String? - - public var countryCode: Int? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case primary = "primary" - - case verified = "verified" - - case phone = "phone" - - case countryCode = "country_code" - - } - - public init(active: Bool?, countryCode: Int?, phone: String?, primary: Bool?, verified: Bool?) { - - self.active = active - - self.primary = primary - - self.verified = verified - - self.phone = phone - - self.countryCode = countryCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - primary = try container.decode(Bool.self, forKey: .primary) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verified = try container.decode(Bool.self, forKey: .verified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(Int.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(primary, forKey: .primary) - - - - try? container.encodeIfPresent(verified, forKey: .verified) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - } - - } - - /* - Model: Email - Used By: Lead - */ - class Email: Codable { - - public var primary: Bool? - - public var verified: Bool? - - public var email: String? - - public var active: Bool? - - - public enum CodingKeys: String, CodingKey { - - case primary = "primary" - - case verified = "verified" - - case email = "email" - - case active = "active" - - } - - public init(active: Bool?, email: String?, primary: Bool?, verified: Bool?) { - - self.primary = primary - - self.verified = verified - - self.email = email - - self.active = active - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - primary = try container.decode(Bool.self, forKey: .primary) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verified = try container.decode(Bool.self, forKey: .verified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(primary, forKey: .primary) - - - - try? container.encodeIfPresent(verified, forKey: .verified) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - } - - } - - /* - Model: Debug - Used By: Lead - */ - class Debug: Codable { - - public var source: String? - - public var platform: String? - - - public enum CodingKeys: String, CodingKey { - - case source = "source" - - case platform = "platform" - - } - - public init(platform: String?, source: String?) { - - self.source = source - - self.platform = platform - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - source = try container.decode(String.self, forKey: .source) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode(String.self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(source, forKey: .source) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - } - - } - - /* - Model: SubmitCustomFormResponse - Used By: Lead - */ - class SubmitCustomFormResponse: Codable { - - public var ticket: Ticket - - - public enum CodingKeys: String, CodingKey { - - case ticket = "ticket" - - } - - public init(ticket: Ticket) { - - self.ticket = ticket - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - ticket = try container.decode(Ticket.self, forKey: .ticket) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(ticket, forKey: .ticket) - - - } - - } - - /* - Model: TicketContext - Used By: Lead - */ - class TicketContext: Codable { - - public var applicationId: String? - - public var companyId: String - - - public enum CodingKeys: String, CodingKey { - - case applicationId = "application_id" - - case companyId = "company_id" - - } - - public init(applicationId: String?, companyId: String) { - - self.applicationId = applicationId - - self.companyId = companyId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - applicationId = try container.decode(String.self, forKey: .applicationId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - companyId = try container.decode(String.self, forKey: .companyId) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(applicationId, forKey: .applicationId) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - } - - } - - /* - Model: CreatedOn - Used By: Lead - */ - class CreatedOn: Codable { - - public var userAgent: String - - - public enum CodingKeys: String, CodingKey { - - case userAgent = "user_agent" - - } - - public init(userAgent: String) { - - self.userAgent = userAgent - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - userAgent = try container.decode(String.self, forKey: .userAgent) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(userAgent, forKey: .userAgent) - - - } - - } - - /* - Model: TicketAsset - Used By: Lead - */ - class TicketAsset: Codable { - - public var display: String? - - public var value: String - - public var type: [String: Any] - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case value = "value" - - case type = "type" - - } - - public init(display: String?, type: [String: Any], value: String) { - - self.display = display - - self.value = value - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - value = try container.decode(String.self, forKey: .value) - - - - - type = try container.decode([String: Any].self, forKey: .type) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: TicketContent - Used By: Lead - */ - class TicketContent: Codable { - - public var title: String - - public var description: String? - - public var attachments: [TicketAsset]? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case description = "description" - - case attachments = "attachments" - - } - - public init(attachments: [TicketAsset]?, description: String?, title: String) { - - self.title = title - - self.description = description - - self.attachments = attachments - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - title = try container.decode(String.self, forKey: .title) - - - - - do { - description = try container.decode(String.self, forKey: .description) - - if let strong_description = description, - let descriptionData = Data(base64Encoded: strong_description) { - description = String(data: descriptionData, encoding: .utf8) ?? description - } - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attachments = try container.decode([TicketAsset].self, forKey: .attachments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - - try? container.encodeIfPresent(description?.asBase64, forKey: .description) - - - - - try? container.encodeIfPresent(attachments, forKey: .attachments) - - - } - - } - - /* - Model: AddTicketPayload - Used By: Lead - */ - class AddTicketPayload: Codable { - - public var createdBy: [String: Any]? - - public var status: String? - - public var priority: [String: Any]? - - public var category: String - - public var content: TicketContent - - - public enum CodingKeys: String, CodingKey { - - case createdBy = "created_by" - - case status = "status" - - case priority = "priority" - - case category = "category" - - case content = "content" - - } - - public init(category: String, content: TicketContent, createdBy: [String: Any]?, priority: [String: Any]?, status: String?) { - - self.createdBy = createdBy - - self.status = status - - self.priority = priority - - self.category = category - - self.content = content - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdBy = try container.decode([String: Any].self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priority = try container.decode([String: Any].self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - category = try container.decode(String.self, forKey: .category) - - - - - content = try container.decode(TicketContent.self, forKey: .content) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(category, forKey: .category) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - } - - } - - /* - Model: Priority - Used By: Lead - */ - class Priority: Codable { - - public var key: PriorityEnum - - public var display: String - - public var color: String - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case display = "display" - - case color = "color" - - } - - public init(color: String, display: String, key: PriorityEnum) { - - self.key = key - - self.display = display - - self.color = color - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - key = try container.decode(PriorityEnum.self, forKey: .key) - - - - - display = try container.decode(String.self, forKey: .display) - - - - - color = try container.decode(String.self, forKey: .color) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(color, forKey: .color) - - - } - - } - - /* - Model: Status - Used By: Lead - */ - class Status: Codable { - - public var key: String - - public var display: String - - public var color: String - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case display = "display" - - case color = "color" - - } - - public init(color: String, display: String, key: String) { - - self.key = key - - self.display = display - - self.color = color - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - key = try container.decode(String.self, forKey: .key) - - - - - display = try container.decode(String.self, forKey: .display) - - - - - color = try container.decode(String.self, forKey: .color) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(color, forKey: .color) - - - } - - } - - /* - Model: TicketCategory - Used By: Lead - */ - class TicketCategory: Codable { - - public var key: String - - public var display: String - - public var form: CustomForm? - - public var subCategories: [TicketSubCategory]? - - public var feedbackForm: TicketFeedbackForm? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case display = "display" - - case form = "form" - - case subCategories = "sub_categories" - - case feedbackForm = "feedback_form" - - } - - public init(display: String, feedbackForm: TicketFeedbackForm?, form: CustomForm?, key: String, subCategories: [TicketSubCategory]?) { - - self.key = key - - self.display = display - - self.form = form - - self.subCategories = subCategories - - self.feedbackForm = feedbackForm - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - key = try container.decode(String.self, forKey: .key) - - - - - display = try container.decode(String.self, forKey: .display) - - - - - do { - form = try container.decode(CustomForm.self, forKey: .form) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subCategories = try container.decode([TicketSubCategory].self, forKey: .subCategories) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - feedbackForm = try container.decode(TicketFeedbackForm.self, forKey: .feedbackForm) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(form, forKey: .form) - - - - try? container.encodeIfPresent(subCategories, forKey: .subCategories) - - - - try? container.encodeIfPresent(feedbackForm, forKey: .feedbackForm) - - - } - - } - - /* - Model: TicketSubCategory - Used By: Lead - */ - class TicketSubCategory: Codable { - - public var key: String - - public var display: String - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case display = "display" - - } - - public init(display: String, key: String) { - - self.key = key - - self.display = display - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - key = try container.decode(String.self, forKey: .key) - - - - - display = try container.decode(String.self, forKey: .display) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - } - - } - - /* - Model: TicketFeedbackForm - Used By: Lead - */ - class TicketFeedbackForm: Codable { - - public var title: String - - public var display: [[String: Any]]? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case display = "display" - - } - - public init(display: [[String: Any]]?, title: String) { - - self.title = title - - self.display = display - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - title = try container.decode(String.self, forKey: .title) - - - - - do { - display = try container.decode([[String: Any]].self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - } - - } - - /* - Model: TicketFeedbackList - Used By: Lead - */ - class TicketFeedbackList: Codable { - - public var items: [TicketFeedback]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - } - - public init(items: [TicketFeedback]?) { - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([TicketFeedback].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: TicketFeedbackPayload - Used By: Lead - */ - class TicketFeedbackPayload: Codable { - - public var formResponse: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case formResponse = "form_response" - - } - - public init(formResponse: [String: Any]?) { - - self.formResponse = formResponse - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - formResponse = try container.decode([String: Any].self, forKey: .formResponse) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(formResponse, forKey: .formResponse) - - - } - - } - - /* - Model: SubmitButton - Used By: Lead - */ - class SubmitButton: Codable { - - public var title: String - - public var titleColor: String - - public var backgroundColor: String - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case titleColor = "title_color" - - case backgroundColor = "background_color" - - } - - public init(backgroundColor: String, title: String, titleColor: String) { - - self.title = title - - self.titleColor = titleColor - - self.backgroundColor = backgroundColor - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - title = try container.decode(String.self, forKey: .title) - - - - - titleColor = try container.decode(String.self, forKey: .titleColor) - - - - - backgroundColor = try container.decode(String.self, forKey: .backgroundColor) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(titleColor, forKey: .titleColor) - - - - try? container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) - - - } - - } - - /* - Model: PollForAssignment - Used By: Lead - */ - class PollForAssignment: Codable { - - public var duration: Double - - public var message: String - - public var successMessage: String - - public var failureMessage: String - - - public enum CodingKeys: String, CodingKey { - - case duration = "duration" - - case message = "message" - - case successMessage = "success_message" - - case failureMessage = "failure_message" - - } - - public init(duration: Double, failureMessage: String, message: String, successMessage: String) { - - self.duration = duration - - self.message = message - - self.successMessage = successMessage - - self.failureMessage = failureMessage - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - duration = try container.decode(Double.self, forKey: .duration) - - - - - message = try container.decode(String.self, forKey: .message) - - - - - successMessage = try container.decode(String.self, forKey: .successMessage) - - - - - failureMessage = try container.decode(String.self, forKey: .failureMessage) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(duration, forKey: .duration) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(successMessage, forKey: .successMessage) - - - - try? container.encodeIfPresent(failureMessage, forKey: .failureMessage) - - - } - - } - - /* - Model: CustomForm - Used By: Lead - */ - class CustomForm: Codable { - - public var applicationId: String - - public var slug: String - - public var headerImage: String? - - public var title: String - - public var description: String? - - public var priority: Priority - - public var loginRequired: Bool - - public var shouldNotify: Bool - - public var successMessage: String? - - public var submitButton: SubmitButton? - - public var inputs: [[String: Any]] - - public var createdOn: CreatedOn? - - public var createdBy: [String: Any]? - - public var pollForAssignment: PollForAssignment? - - public var id: String - - - public enum CodingKeys: String, CodingKey { - - case applicationId = "application_id" - - case slug = "slug" - - case headerImage = "header_image" - - case title = "title" - - case description = "description" - - case priority = "priority" - - case loginRequired = "login_required" - - case shouldNotify = "should_notify" - - case successMessage = "success_message" - - case submitButton = "submit_button" - - case inputs = "inputs" - - case createdOn = "created_on" - - case createdBy = "created_by" - - case pollForAssignment = "poll_for_assignment" - - case id = "_id" - - } - - public init(applicationId: String, createdBy: [String: Any]?, createdOn: CreatedOn?, description: String?, headerImage: String?, inputs: [[String: Any]], loginRequired: Bool, pollForAssignment: PollForAssignment?, priority: Priority, shouldNotify: Bool, slug: String, submitButton: SubmitButton?, successMessage: String?, title: String, id: String) { - - self.applicationId = applicationId - - self.slug = slug - - self.headerImage = headerImage - - self.title = title - - self.description = description - - self.priority = priority - - self.loginRequired = loginRequired - - self.shouldNotify = shouldNotify - - self.successMessage = successMessage - - self.submitButton = submitButton - - self.inputs = inputs - - self.createdOn = createdOn - - self.createdBy = createdBy - - self.pollForAssignment = pollForAssignment - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - applicationId = try container.decode(String.self, forKey: .applicationId) - - - - - slug = try container.decode(String.self, forKey: .slug) - - - - - do { - headerImage = try container.decode(String.self, forKey: .headerImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - title = try container.decode(String.self, forKey: .title) - - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - priority = try container.decode(Priority.self, forKey: .priority) - - - - - loginRequired = try container.decode(Bool.self, forKey: .loginRequired) - - - - - shouldNotify = try container.decode(Bool.self, forKey: .shouldNotify) - - - - - do { - successMessage = try container.decode(String.self, forKey: .successMessage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - submitButton = try container.decode(SubmitButton.self, forKey: .submitButton) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - inputs = try container.decode([[String: Any]].self, forKey: .inputs) - - - - - do { - createdOn = try container.decode(CreatedOn.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode([String: Any].self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pollForAssignment = try container.decode(PollForAssignment.self, forKey: .pollForAssignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - id = try container.decode(String.self, forKey: .id) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(applicationId, forKey: .applicationId) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(headerImage, forKey: .headerImage) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(loginRequired, forKey: .loginRequired) - - - - try? container.encodeIfPresent(shouldNotify, forKey: .shouldNotify) - - - - try? container.encodeIfPresent(successMessage, forKey: .successMessage) - - - - try? container.encodeIfPresent(submitButton, forKey: .submitButton) - - - - try? container.encodeIfPresent(inputs, forKey: .inputs) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(pollForAssignment, forKey: .pollForAssignment) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: FeedbackResponseItem - Used By: Lead - */ - class FeedbackResponseItem: Codable { - - public var display: String - - public var key: String - - public var value: String - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case key = "key" - - case value = "value" - - } - - public init(display: String, key: String, value: String) { - - self.display = display - - self.key = key - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - display = try container.decode(String.self, forKey: .display) - - - - - key = try container.decode(String.self, forKey: .key) - - - - - value = try container.decode(String.self, forKey: .value) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: TicketFeedback - Used By: Lead - */ - class TicketFeedback: Codable { - - public var id: String - - public var ticketId: String - - public var companyId: String - - public var response: [FeedbackResponseItem] - - public var category: String? - - public var user: [String: Any]? - - public var updatedAt: String? - - public var createdAt: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case ticketId = "ticket_id" - - case companyId = "company_id" - - case response = "response" - - case category = "category" - - case user = "user" - - case updatedAt = "updated_at" - - case createdAt = "created_at" - - } - - public init(category: String?, companyId: String, createdAt: String?, response: [FeedbackResponseItem], ticketId: String, updatedAt: String?, user: [String: Any]?, id: String) { - - self.id = id - - self.ticketId = ticketId - - self.companyId = companyId - - self.response = response - - self.category = category - - self.user = user - - self.updatedAt = updatedAt - - self.createdAt = createdAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - id = try container.decode(String.self, forKey: .id) - - - - - ticketId = try container.decode(String.self, forKey: .ticketId) - - - - - companyId = try container.decode(String.self, forKey: .companyId) - - - - - response = try container.decode([FeedbackResponseItem].self, forKey: .response) - - - - - do { - category = try container.decode(String.self, forKey: .category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - user = try container.decode([String: Any].self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(ticketId, forKey: .ticketId) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(response, forKey: .response) - - - - try? container.encodeIfPresent(category, forKey: .category) - - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - } - - } - - /* - Model: TicketHistory - Used By: Lead - */ - class TicketHistory: Codable { - - public var type: String - - public var value: [String: Any] - - public var ticketId: String - - public var createdOn: CreatedOn? - - public var createdBy: [String: Any]? - - public var id: String - - public var updatedAt: String? - - public var createdAt: String? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case value = "value" - - case ticketId = "ticket_id" - - case createdOn = "created_on" - - case createdBy = "created_by" - - case id = "_id" - - case updatedAt = "updated_at" - - case createdAt = "created_at" - - } - - public init(createdAt: String?, createdBy: [String: Any]?, createdOn: CreatedOn?, ticketId: String, type: String, updatedAt: String?, value: [String: Any], id: String) { - - self.type = type - - self.value = value - - self.ticketId = ticketId - - self.createdOn = createdOn - - self.createdBy = createdBy - - self.id = id - - self.updatedAt = updatedAt - - self.createdAt = createdAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - type = try container.decode(String.self, forKey: .type) - - - - - value = try container.decode([String: Any].self, forKey: .value) - - - - - ticketId = try container.decode(String.self, forKey: .ticketId) - - - - - do { - createdOn = try container.decode(CreatedOn.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode([String: Any].self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - id = try container.decode(String.self, forKey: .id) - - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(ticketId, forKey: .ticketId) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - } - - } - - /* - Model: Ticket - Used By: Lead - */ - class Ticket: Codable { - - public var context: TicketContext? - - public var createdOn: CreatedOn? - - public var responseId: String? - - public var content: TicketContent? - - public var ticketId: String - - public var category: TicketCategory - - public var subCategory: TicketSubCategory? - - public var source: [String: Any] - - public var status: Status - - public var priority: Priority - - public var createdBy: [String: Any]? - - public var assignedTo: [String: Any]? - - public var tags: [String]? - - public var customJson: [String: Any]? - - public var isFeedbackPending: Bool? - - public var id: String - - public var updatedAt: String? - - public var createdAt: String? - - - public enum CodingKeys: String, CodingKey { - - case context = "context" - - case createdOn = "created_on" - - case responseId = "response_id" - - case content = "content" - - case ticketId = "ticket_id" - - case category = "category" - - case subCategory = "sub_category" - - case source = "source" - - case status = "status" - - case priority = "priority" - - case createdBy = "created_by" - - case assignedTo = "assigned_to" - - case tags = "tags" - - case customJson = "_custom_json" - - case isFeedbackPending = "is_feedback_pending" - - case id = "_id" - - case updatedAt = "updated_at" - - case createdAt = "created_at" - - } - - public init(assignedTo: [String: Any]?, category: TicketCategory, content: TicketContent?, context: TicketContext?, createdAt: String?, createdBy: [String: Any]?, createdOn: CreatedOn?, isFeedbackPending: Bool?, priority: Priority, responseId: String?, source: [String: Any], status: Status, subCategory: TicketSubCategory?, tags: [String]?, ticketId: String, updatedAt: String?, customJson: [String: Any]?, id: String) { - - self.context = context - - self.createdOn = createdOn - - self.responseId = responseId - - self.content = content - - self.ticketId = ticketId - - self.category = category - - self.subCategory = subCategory - - self.source = source - - self.status = status - - self.priority = priority - - self.createdBy = createdBy - - self.assignedTo = assignedTo - - self.tags = tags - - self.customJson = customJson - - self.isFeedbackPending = isFeedbackPending - - self.id = id - - self.updatedAt = updatedAt - - self.createdAt = createdAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - context = try container.decode(TicketContext.self, forKey: .context) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(CreatedOn.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - responseId = try container.decode(String.self, forKey: .responseId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode(TicketContent.self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - ticketId = try container.decode(String.self, forKey: .ticketId) - - - - - category = try container.decode(TicketCategory.self, forKey: .category) - - - - - do { - subCategory = try container.decode(TicketSubCategory.self, forKey: .subCategory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - source = try container.decode([String: Any].self, forKey: .source) - - - - - status = try container.decode(Status.self, forKey: .status) - - - - - priority = try container.decode(Priority.self, forKey: .priority) - - - - - do { - createdBy = try container.decode([String: Any].self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - assignedTo = try container.decode([String: Any].self, forKey: .assignedTo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isFeedbackPending = try container.decode(Bool.self, forKey: .isFeedbackPending) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - id = try container.decode(String.self, forKey: .id) - - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(context, forKey: .context) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(responseId, forKey: .responseId) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - - try? container.encodeIfPresent(ticketId, forKey: .ticketId) - - - - try? container.encodeIfPresent(category, forKey: .category) - - - - try? container.encodeIfPresent(subCategory, forKey: .subCategory) - - - - try? container.encodeIfPresent(source, forKey: .source) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(assignedTo, forKey: .assignedTo) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(isFeedbackPending, forKey: .isFeedbackPending) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - } - - } - - - - /* - Model: AvailablePageSchema - Used By: Theme - */ - class AvailablePageSchema: Codable { - - public var value: String? - - public var text: String? - - public var path: String? - - public var type: String? - - public var sections: [AvailablePageSchemaSections]? - - public var sectionsMeta: [AvailablePageSectionMetaAttributes]? - - public var theme: String? - - public var seo: AvailablePageSeo? - - public var props: [[String: Any]]? - - public var id: String? - - - public enum CodingKeys: String, CodingKey { - - case value = "value" - - case text = "text" - - case path = "path" - - case type = "type" - - case sections = "sections" - - case sectionsMeta = "sections_meta" - - case theme = "theme" - - case seo = "seo" - - case props = "props" - - case id = "_id" - - } - - public init(path: String?, props: [[String: Any]]?, sections: [AvailablePageSchemaSections]?, sectionsMeta: [AvailablePageSectionMetaAttributes]?, seo: AvailablePageSeo?, text: String?, theme: String?, type: String?, value: String?, id: String?) { - - self.value = value - - self.text = text - - self.path = path - - self.type = type - - self.sections = sections - - self.sectionsMeta = sectionsMeta - - self.theme = theme - - self.seo = seo - - self.props = props - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text = try container.decode(String.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - path = try container.decode(String.self, forKey: .path) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sections = try container.decode([AvailablePageSchemaSections].self, forKey: .sections) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sectionsMeta = try container.decode([AvailablePageSectionMetaAttributes].self, forKey: .sectionsMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - theme = try container.decode(String.self, forKey: .theme) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - seo = try container.decode(AvailablePageSeo.self, forKey: .seo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - props = try container.decode([[String: Any]].self, forKey: .props) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(path, forKey: .path) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(sections, forKey: .sections) - - - - try? container.encodeIfPresent(sectionsMeta, forKey: .sectionsMeta) - - - - try? container.encodeIfPresent(theme, forKey: .theme) - - - - try? container.encodeIfPresent(seo, forKey: .seo) - - - - try? container.encodeIfPresent(props, forKey: .props) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: AvailablePageSectionMetaAttributes - Used By: Theme - */ - class AvailablePageSectionMetaAttributes: Codable { - - public var attributes: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case attributes = "attributes" - - } - - public init(attributes: [String: Any]?) { - - self.attributes = attributes - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - attributes = try container.decode([String: Any].self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - } - - } - - /* - Model: AvailablePageSeo - Used By: Theme - */ - class AvailablePageSeo: Codable { - - public var title: String? - - public var description: String? - - public var id: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case description = "description" - - case id = "_id" - - } - - public init(description: String?, title: String?, id: String?) { - - self.title = title - - self.description = description - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: AvailablePageSchemaSections - Used By: Theme - */ - class AvailablePageSchemaSections: Codable { - - public var name: String? - - public var label: String? - - public var props: [String: Any]? - - public var blocks: [[String: Any]]? - - public var preset: [String: Any]? - - public var predicate: AvailablePagePredicate? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case label = "label" - - case props = "props" - - case blocks = "blocks" - - case preset = "preset" - - case predicate = "predicate" - - } - - public init(blocks: [[String: Any]]?, label: String?, name: String?, predicate: AvailablePagePredicate?, preset: [String: Any]?, props: [String: Any]?) { - - self.name = name - - self.label = label - - self.props = props - - self.blocks = blocks - - self.preset = preset - - self.predicate = predicate - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - label = try container.decode(String.self, forKey: .label) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - props = try container.decode([String: Any].self, forKey: .props) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - blocks = try container.decode([[String: Any]].self, forKey: .blocks) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - preset = try container.decode([String: Any].self, forKey: .preset) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - predicate = try container.decode(AvailablePagePredicate.self, forKey: .predicate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(label, forKey: .label) - - - - try? container.encodeIfPresent(props, forKey: .props) - - - - try? container.encodeIfPresent(blocks, forKey: .blocks) - - - - try? container.encodeIfPresent(preset, forKey: .preset) - - - - try? container.encodeIfPresent(predicate, forKey: .predicate) - - - } - - } - - /* - Model: AvailablePageScreenPredicate - Used By: Theme - */ - class AvailablePageScreenPredicate: Codable { - - public var mobile: Bool? - - public var desktop: Bool? - - public var tablet: Bool? - - - public enum CodingKeys: String, CodingKey { - - case mobile = "mobile" - - case desktop = "desktop" - - case tablet = "tablet" - - } - - public init(desktop: Bool?, mobile: Bool?, tablet: Bool?) { - - self.mobile = mobile - - self.desktop = desktop - - self.tablet = tablet - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - mobile = try container.decode(Bool.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - desktop = try container.decode(Bool.self, forKey: .desktop) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tablet = try container.decode(Bool.self, forKey: .tablet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(desktop, forKey: .desktop) - - - - try? container.encodeIfPresent(tablet, forKey: .tablet) - - - } - - } - - /* - Model: AvailablePageUserPredicate - Used By: Theme - */ - class AvailablePageUserPredicate: Codable { - - public var authenticated: Bool? - - public var anonymous: Bool? - - - public enum CodingKeys: String, CodingKey { - - case authenticated = "authenticated" - - case anonymous = "anonymous" - - } - - public init(anonymous: Bool?, authenticated: Bool?) { - - self.authenticated = authenticated - - self.anonymous = anonymous - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - authenticated = try container.decode(Bool.self, forKey: .authenticated) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - anonymous = try container.decode(Bool.self, forKey: .anonymous) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(authenticated, forKey: .authenticated) - - - - try? container.encodeIfPresent(anonymous, forKey: .anonymous) - - - } - - } - - /* - Model: AvailablePageRoutePredicate - Used By: Theme - */ - class AvailablePageRoutePredicate: Codable { - - public var selected: String? - - public var exactUrl: String? - - public var query: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case selected = "selected" - - case exactUrl = "exact_url" - - case query = "query" - - } - - public init(exactUrl: String?, query: [String: Any]?, selected: String?) { - - self.selected = selected - - self.exactUrl = exactUrl - - self.query = query - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - selected = try container.decode(String.self, forKey: .selected) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - exactUrl = try container.decode(String.self, forKey: .exactUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - query = try container.decode([String: Any].self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(selected, forKey: .selected) - - - - try? container.encodeIfPresent(exactUrl, forKey: .exactUrl) - - - - try? container.encodeIfPresent(query, forKey: .query) - - - } - - } - - /* - Model: AvailablePagePredicate - Used By: Theme - */ - class AvailablePagePredicate: Codable { - - public var screen: AvailablePageScreenPredicate? - - public var user: AvailablePageUserPredicate? - - public var route: AvailablePageRoutePredicate? - - - public enum CodingKeys: String, CodingKey { - - case screen = "screen" - - case user = "user" - - case route = "route" - - } - - public init(route: AvailablePageRoutePredicate?, screen: AvailablePageScreenPredicate?, user: AvailablePageUserPredicate?) { - - self.screen = screen - - self.user = user - - self.route = route - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - screen = try container.decode(AvailablePageScreenPredicate.self, forKey: .screen) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - user = try container.decode(AvailablePageUserPredicate.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - route = try container.decode(AvailablePageRoutePredicate.self, forKey: .route) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(screen, forKey: .screen) - - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(route, forKey: .route) - - - } - - } - - /* - Model: AllAvailablePageSchema - Used By: Theme - */ - class AllAvailablePageSchema: Codable { - - public var pages: [AvailablePageSchema]? - - - public enum CodingKeys: String, CodingKey { - - case pages = "pages" - - } - - public init(pages: [AvailablePageSchema]?) { - - self.pages = pages - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pages = try container.decode([AvailablePageSchema].self, forKey: .pages) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pages, forKey: .pages) - - - } - - } - - /* - Model: PaginationSchema - Used By: Theme - */ - class PaginationSchema: Codable { - - public var size: Int? - - public var itemTotal: Int? - - public var hasNext: Bool? - - public var type: String? - - public var current: Int? - - - public enum CodingKeys: String, CodingKey { - - case size = "size" - - case itemTotal = "item_total" - - case hasNext = "has_next" - - case type = "type" - - case current = "current" - - } - - public init(current: Int?, hasNext: Bool?, itemTotal: Int?, size: Int?, type: String?) { - - self.size = size - - self.itemTotal = itemTotal - - self.hasNext = hasNext - - self.type = type - - self.current = current - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - size = try container.decode(Int.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemTotal = try container.decode(Int.self, forKey: .itemTotal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasNext = try container.decode(Bool.self, forKey: .hasNext) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - current = try container.decode(Int.self, forKey: .current) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) - - - - try? container.encodeIfPresent(hasNext, forKey: .hasNext) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(current, forKey: .current) - - - } - - } - - /* - Model: ThemesListingResponseSchema - Used By: Theme - */ - class ThemesListingResponseSchema: Codable { - - public var items: [ThemesSchema]? - - public var page: PaginationSchema? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [ThemesSchema]?, page: PaginationSchema?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([ThemesSchema].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(PaginationSchema.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: AddThemeRequestSchema - Used By: Theme - */ - class AddThemeRequestSchema: Codable { - - public var themeId: String? - - - public enum CodingKeys: String, CodingKey { - - case themeId = "theme_id" - - } - - public init(themeId: String?) { - - self.themeId = themeId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - themeId = try container.decode(String.self, forKey: .themeId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(themeId, forKey: .themeId) - - - } - - } - - /* - Model: UpgradableThemeSchema - Used By: Theme - */ - class UpgradableThemeSchema: Codable { - - public var parentTheme: String? - - public var appliedTheme: String? - - public var upgrade: Bool? - - - public enum CodingKeys: String, CodingKey { - - case parentTheme = "parent_theme" - - case appliedTheme = "applied_theme" - - case upgrade = "upgrade" - - } - - public init(appliedTheme: String?, parentTheme: String?, upgrade: Bool?) { - - self.parentTheme = parentTheme - - self.appliedTheme = appliedTheme - - self.upgrade = upgrade - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - parentTheme = try container.decode(String.self, forKey: .parentTheme) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appliedTheme = try container.decode(String.self, forKey: .appliedTheme) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - upgrade = try container.decode(Bool.self, forKey: .upgrade) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(parentTheme, forKey: .parentTheme) - - - - try? container.encodeIfPresent(appliedTheme, forKey: .appliedTheme) - - - - try? container.encodeIfPresent(upgrade, forKey: .upgrade) - - - } - - } - - /* - Model: FontsSchema - Used By: Theme - */ - class FontsSchema: Codable { - - public var items: FontsSchemaItems? - - public var kind: String? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case kind = "kind" - - } - - public init(items: FontsSchemaItems?, kind: String?) { - - self.items = items - - self.kind = kind - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode(FontsSchemaItems.self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - kind = try container.decode(String.self, forKey: .kind) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(kind, forKey: .kind) - - - } - - } - - /* - Model: BlitzkriegApiErrorSchema - Used By: Theme - */ - class BlitzkriegApiErrorSchema: Codable { - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: BlitzkriegNotFoundSchema - Used By: Theme - */ - class BlitzkriegNotFoundSchema: Codable { - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: BlitzkriegInternalServerErrorSchema - Used By: Theme - */ - class BlitzkriegInternalServerErrorSchema: Codable { - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: FontsSchemaItems - Used By: Theme - */ - class FontsSchemaItems: Codable { - - public var family: String? - - public var variants: [String]? - - public var subsets: [String]? - - public var version: String? - - public var lastModified: String? - - public var files: FontsSchemaItemsFiles? - - public var category: String? - - public var kind: String? - - - public enum CodingKeys: String, CodingKey { - - case family = "family" - - case variants = "variants" - - case subsets = "subsets" - - case version = "version" - - case lastModified = "last_modified" - - case files = "files" - - case category = "category" - - case kind = "kind" - - } - - public init(category: String?, family: String?, files: FontsSchemaItemsFiles?, kind: String?, lastModified: String?, subsets: [String]?, variants: [String]?, version: String?) { - - self.family = family - - self.variants = variants - - self.subsets = subsets - - self.version = version - - self.lastModified = lastModified - - self.files = files - - self.category = category - - self.kind = kind - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - family = try container.decode(String.self, forKey: .family) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - variants = try container.decode([String].self, forKey: .variants) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subsets = try container.decode([String].self, forKey: .subsets) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - version = try container.decode(String.self, forKey: .version) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastModified = try container.decode(String.self, forKey: .lastModified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - files = try container.decode(FontsSchemaItemsFiles.self, forKey: .files) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - category = try container.decode(String.self, forKey: .category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - kind = try container.decode(String.self, forKey: .kind) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(family, forKey: .family) - - - - try? container.encodeIfPresent(variants, forKey: .variants) - - - - try? container.encodeIfPresent(subsets, forKey: .subsets) - - - - try? container.encodeIfPresent(version, forKey: .version) - - - - try? container.encodeIfPresent(lastModified, forKey: .lastModified) - - - - try? container.encodeIfPresent(files, forKey: .files) - - - - try? container.encodeIfPresent(category, forKey: .category) - - - - try? container.encodeIfPresent(kind, forKey: .kind) - - - } - - } - - /* - Model: FontsSchemaItemsFiles - Used By: Theme - */ - class FontsSchemaItemsFiles: Codable { - - public var regular: String? - - public var italic: String? - - public var bold: String? - - - public enum CodingKeys: String, CodingKey { - - case regular = "regular" - - case italic = "italic" - - case bold = "bold" - - } - - public init(bold: String?, italic: String?, regular: String?) { - - self.regular = regular - - self.italic = italic - - self.bold = bold - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - regular = try container.decode(String.self, forKey: .regular) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - italic = try container.decode(String.self, forKey: .italic) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bold = try container.decode(String.self, forKey: .bold) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(regular, forKey: .regular) - - - - try? container.encodeIfPresent(italic, forKey: .italic) - - - - try? container.encodeIfPresent(bold, forKey: .bold) - - - } - - } - - /* - Model: ThemesSchema - Used By: Theme - */ - class ThemesSchema: Codable { - - public var application: String? - - public var applied: Bool? - - public var customized: Bool? - - public var published: Bool? - - public var archived: Bool? - - public var createdAt: String? - - public var updatedAt: String? - - public var version: String? - - public var parentThemeVersion: String? - - public var parentTheme: String? - - public var information: Information? - - public var tags: [String]? - - public var src: Src? - - public var assets: AssetsSchema? - - public var availableSections: [availableSectionSchema]? - - public var constants: [String: Any]? - - public var styles: [String: Any]? - - public var config: Config? - - public var settings: [String: Any]? - - public var font: Font? - - public var id: String? - - public var v: Int? - - public var colors: Colors? - - - public enum CodingKeys: String, CodingKey { - - case application = "application" - - case applied = "applied" - - case customized = "customized" - - case published = "published" - - case archived = "archived" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case version = "version" - - case parentThemeVersion = "parent_theme_version" - - case parentTheme = "parent_theme" - - case information = "information" - - case tags = "tags" - - case src = "src" - - case assets = "assets" - - case availableSections = "available_sections" - - case constants = "constants" - - case styles = "styles" - - case config = "config" - - case settings = "settings" - - case font = "font" - - case id = "_id" - - case v = "__v" - - case colors = "colors" - - } - - public init(application: String?, applied: Bool?, archived: Bool?, assets: AssetsSchema?, availableSections: [availableSectionSchema]?, colors: Colors?, config: Config?, constants: [String: Any]?, createdAt: String?, customized: Bool?, font: Font?, information: Information?, parentTheme: String?, parentThemeVersion: String?, published: Bool?, settings: [String: Any]?, src: Src?, styles: [String: Any]?, tags: [String]?, updatedAt: String?, version: String?, id: String?, v: Int?) { - - self.application = application - - self.applied = applied - - self.customized = customized - - self.published = published - - self.archived = archived - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.version = version - - self.parentThemeVersion = parentThemeVersion - - self.parentTheme = parentTheme - - self.information = information - - self.tags = tags - - self.src = src - - self.assets = assets - - self.availableSections = availableSections - - self.constants = constants - - self.styles = styles - - self.config = config - - self.settings = settings - - self.font = font - - self.id = id - - self.v = v - - self.colors = colors - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - applied = try container.decode(Bool.self, forKey: .applied) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customized = try container.decode(Bool.self, forKey: .customized) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archived = try container.decode(Bool.self, forKey: .archived) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - version = try container.decode(String.self, forKey: .version) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - parentThemeVersion = try container.decode(String.self, forKey: .parentThemeVersion) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - parentTheme = try container.decode(String.self, forKey: .parentTheme) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - information = try container.decode(Information.self, forKey: .information) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - src = try container.decode(Src.self, forKey: .src) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - assets = try container.decode(AssetsSchema.self, forKey: .assets) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - availableSections = try container.decode([availableSectionSchema].self, forKey: .availableSections) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - constants = try container.decode([String: Any].self, forKey: .constants) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - styles = try container.decode([String: Any].self, forKey: .styles) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - config = try container.decode(Config.self, forKey: .config) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - settings = try container.decode([String: Any].self, forKey: .settings) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - font = try container.decode(Font.self, forKey: .font) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - colors = try container.decode(Colors.self, forKey: .colors) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(applied, forKey: .applied) - - - - try? container.encodeIfPresent(customized, forKey: .customized) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(archived, forKey: .archived) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(version, forKey: .version) - - - - try? container.encodeIfPresent(parentThemeVersion, forKey: .parentThemeVersion) - - - - try? container.encodeIfPresent(parentTheme, forKey: .parentTheme) - - - - try? container.encodeIfPresent(information, forKey: .information) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(src, forKey: .src) - - - - try? container.encodeIfPresent(assets, forKey: .assets) - - - - try? container.encodeIfPresent(availableSections, forKey: .availableSections) - - - - try? container.encodeIfPresent(constants, forKey: .constants) - - - - try? container.encodeIfPresent(styles, forKey: .styles) - - - - try? container.encodeIfPresent(config, forKey: .config) - - - - try? container.encodeIfPresent(settings, forKey: .settings) - - - - try? container.encodeIfPresent(font, forKey: .font) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - - try? container.encodeIfPresent(colors, forKey: .colors) - - - } - - } - - /* - Model: availableSectionSchema - Used By: Theme - */ - class availableSectionSchema: Codable { - - public var blocks: [Blocks]? - - public var name: String? - - public var label: String? - - public var props: [BlocksProps]? - - - public enum CodingKeys: String, CodingKey { - - case blocks = "blocks" - - case name = "name" - - case label = "label" - - case props = "props" - - } - - public init(blocks: [Blocks]?, label: String?, name: String?, props: [BlocksProps]?) { - - self.blocks = blocks - - self.name = name - - self.label = label - - self.props = props - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - blocks = try container.decode([Blocks].self, forKey: .blocks) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - label = try container.decode(String.self, forKey: .label) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - props = try container.decode([BlocksProps].self, forKey: .props) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(blocks, forKey: .blocks) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(label, forKey: .label) - - - - try? container.encodeIfPresent(props, forKey: .props) - - - } - - } - - /* - Model: Information - Used By: Theme - */ - class Information: Codable { - - public var images: Images? - - public var features: [String]? - - public var name: String? - - public var description: String? - - - public enum CodingKeys: String, CodingKey { - - case images = "images" - - case features = "features" - - case name = "name" - - case description = "description" - - } - - public init(description: String?, features: [String]?, images: Images?, name: String?) { - - self.images = images - - self.features = features - - self.name = name - - self.description = description - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - images = try container.decode(Images.self, forKey: .images) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - features = try container.decode([String].self, forKey: .features) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(images, forKey: .images) - - - - try? container.encodeIfPresent(features, forKey: .features) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - } - - } - - /* - Model: Images - Used By: Theme - */ - class Images: Codable { - - public var desktop: [String]? - - public var android: [String]? - - public var ios: [String]? - - public var thumbnail: [String]? - - - public enum CodingKeys: String, CodingKey { - - case desktop = "desktop" - - case android = "android" - - case ios = "ios" - - case thumbnail = "thumbnail" - - } - - public init(android: [String]?, desktop: [String]?, ios: [String]?, thumbnail: [String]?) { - - self.desktop = desktop - - self.android = android - - self.ios = ios - - self.thumbnail = thumbnail - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - desktop = try container.decode([String].self, forKey: .desktop) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - android = try container.decode([String].self, forKey: .android) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ios = try container.decode([String].self, forKey: .ios) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - thumbnail = try container.decode([String].self, forKey: .thumbnail) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(desktop, forKey: .desktop) - - - - try? container.encodeIfPresent(android, forKey: .android) - - - - try? container.encodeIfPresent(ios, forKey: .ios) - - - - try? container.encodeIfPresent(thumbnail, forKey: .thumbnail) - - - } - - } - - /* - Model: Src - Used By: Theme - */ - class Src: Codable { - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case link = "link" - - } - - public init(link: String?) { - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: AssetsSchema - Used By: Theme - */ - class AssetsSchema: Codable { - - public var umdJs: UmdJs? - - public var commonJs: CommonJs? - - public var css: Css? - - - public enum CodingKeys: String, CodingKey { - - case umdJs = "umd_js" - - case commonJs = "common_js" - - case css = "css" - - } - - public init(commonJs: CommonJs?, css: Css?, umdJs: UmdJs?) { - - self.umdJs = umdJs - - self.commonJs = commonJs - - self.css = css - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - umdJs = try container.decode(UmdJs.self, forKey: .umdJs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - commonJs = try container.decode(CommonJs.self, forKey: .commonJs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - css = try container.decode(Css.self, forKey: .css) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(umdJs, forKey: .umdJs) - - - - try? container.encodeIfPresent(commonJs, forKey: .commonJs) - - - - try? container.encodeIfPresent(css, forKey: .css) - - - } - - } - - /* - Model: UmdJs - Used By: Theme - */ - class UmdJs: Codable { - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case link = "link" - - } - - public init(link: String?) { - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: CommonJs - Used By: Theme - */ - class CommonJs: Codable { - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case link = "link" - - } - - public init(link: String?) { - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: Css - Used By: Theme - */ - class Css: Codable { - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case link = "link" - - } - - public init(link: String?) { - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: Seo - Used By: Theme - */ - class Seo: Codable { - - public var title: String? - - public var description: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case description = "description" - - } - - public init(description: String?, title: String?) { - - self.title = title - - self.description = description - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - } - - } - - /* - Model: Sections - Used By: Theme - */ - class Sections: Codable { - - public var attributes: String? - - - public enum CodingKeys: String, CodingKey { - - case attributes = "attributes" - - } - - public init(attributes: String?) { - - self.attributes = attributes - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - attributes = try container.decode(String.self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - } - - } - - /* - Model: Config - Used By: Theme - */ - class Config: Codable { - - public var preset: Preset? - - public var globalSchema: GlobalSchema? - - public var current: String? - - public var list: [ListSchemaItem]? - - - public enum CodingKeys: String, CodingKey { - - case preset = "preset" - - case globalSchema = "global_schema" - - case current = "current" - - case list = "list" - - } - - public init(current: String?, globalSchema: GlobalSchema?, list: [ListSchemaItem]?, preset: Preset?) { - - self.preset = preset - - self.globalSchema = globalSchema - - self.current = current - - self.list = list - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - preset = try container.decode(Preset.self, forKey: .preset) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - globalSchema = try container.decode(GlobalSchema.self, forKey: .globalSchema) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - current = try container.decode(String.self, forKey: .current) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - list = try container.decode([ListSchemaItem].self, forKey: .list) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(preset, forKey: .preset) - - - - try? container.encodeIfPresent(globalSchema, forKey: .globalSchema) - - - - try? container.encodeIfPresent(current, forKey: .current) - - - - try? container.encodeIfPresent(list, forKey: .list) - - - } - - } - - /* - Model: Preset - Used By: Theme - */ - class Preset: Codable { - - public var pages: [AvailablePageSchema]? - - - public enum CodingKeys: String, CodingKey { - - case pages = "pages" - - } - - public init(pages: [AvailablePageSchema]?) { - - self.pages = pages - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pages = try container.decode([AvailablePageSchema].self, forKey: .pages) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pages, forKey: .pages) - - - } - - } - - /* - Model: GlobalSchema - Used By: Theme - */ - class GlobalSchema: Codable { - - public var props: [GlobalSchemaProps]? - - - public enum CodingKeys: String, CodingKey { - - case props = "props" - - } - - public init(props: [GlobalSchemaProps]?) { - - self.props = props - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - props = try container.decode([GlobalSchemaProps].self, forKey: .props) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(props, forKey: .props) - - - } - - } - - /* - Model: ListSchemaItem - Used By: Theme - */ - class ListSchemaItem: Codable { - - public var global: [String: Any]? - - public var page: [ConfigPage]? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case global = "global" - - case page = "page" - - case name = "name" - - } - - public init(global: [String: Any]?, name: String?, page: [ConfigPage]?) { - - self.global = global - - self.page = page - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - global = try container.decode([String: Any].self, forKey: .global) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode([ConfigPage].self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(global, forKey: .global) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: Colors - Used By: Theme - */ - class Colors: Codable { - - public var bgColor: String? - - public var primaryColor: String? - - public var secondaryColor: String? - - public var accentColor: String? - - public var linkColor: String? - - public var buttonSecondaryColor: String? - - - public enum CodingKeys: String, CodingKey { - - case bgColor = "bg_color" - - case primaryColor = "primary_color" - - case secondaryColor = "secondary_color" - - case accentColor = "accent_color" - - case linkColor = "link_color" - - case buttonSecondaryColor = "button_secondary_color" - - } - - public init(accentColor: String?, bgColor: String?, buttonSecondaryColor: String?, linkColor: String?, primaryColor: String?, secondaryColor: String?) { - - self.bgColor = bgColor - - self.primaryColor = primaryColor - - self.secondaryColor = secondaryColor - - self.accentColor = accentColor - - self.linkColor = linkColor - - self.buttonSecondaryColor = buttonSecondaryColor - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - bgColor = try container.decode(String.self, forKey: .bgColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - primaryColor = try container.decode(String.self, forKey: .primaryColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - secondaryColor = try container.decode(String.self, forKey: .secondaryColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - accentColor = try container.decode(String.self, forKey: .accentColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - linkColor = try container.decode(String.self, forKey: .linkColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - buttonSecondaryColor = try container.decode(String.self, forKey: .buttonSecondaryColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(bgColor, forKey: .bgColor) - - - - try? container.encodeIfPresent(primaryColor, forKey: .primaryColor) - - - - try? container.encodeIfPresent(secondaryColor, forKey: .secondaryColor) - - - - try? container.encodeIfPresent(accentColor, forKey: .accentColor) - - - - try? container.encodeIfPresent(linkColor, forKey: .linkColor) - - - - try? container.encodeIfPresent(buttonSecondaryColor, forKey: .buttonSecondaryColor) - - - } - - } - - /* - Model: Custom - Used By: Theme - */ - class Custom: Codable { - - public var props: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case props = "props" - - } - - public init(props: [String: Any]?) { - - self.props = props - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - props = try container.decode([String: Any].self, forKey: .props) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(props, forKey: .props) - - - } - - } - - /* - Model: ConfigPage - Used By: Theme - */ - class ConfigPage: Codable { - - public var settings: [String: Any]? - - public var page: String? - - - public enum CodingKeys: String, CodingKey { - - case settings = "settings" - - case page = "page" - - } - - public init(page: String?, settings: [String: Any]?) { - - self.settings = settings - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - settings = try container.decode([String: Any].self, forKey: .settings) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(String.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(settings, forKey: .settings) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: Font - Used By: Theme - */ - class Font: Codable { - - public var family: String? - - public var variants: Variants? - - - public enum CodingKeys: String, CodingKey { - - case family = "family" - - case variants = "variants" - - } - - public init(family: String?, variants: Variants?) { - - self.family = family - - self.variants = variants - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - family = try container.decode(String.self, forKey: .family) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - variants = try container.decode(Variants.self, forKey: .variants) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(family, forKey: .family) - - - - try? container.encodeIfPresent(variants, forKey: .variants) - - - } - - } - - /* - Model: Variants - Used By: Theme - */ - class Variants: Codable { - - public var medium: Medium? - - public var semiBold: SemiBold? - - public var bold: Bold? - - public var light: Light? - - public var regular: Regular? - - - public enum CodingKeys: String, CodingKey { - - case medium = "medium" - - case semiBold = "semi_bold" - - case bold = "bold" - - case light = "light" - - case regular = "regular" - - } - - public init(bold: Bold?, light: Light?, medium: Medium?, regular: Regular?, semiBold: SemiBold?) { - - self.medium = medium - - self.semiBold = semiBold - - self.bold = bold - - self.light = light - - self.regular = regular - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - medium = try container.decode(Medium.self, forKey: .medium) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - semiBold = try container.decode(SemiBold.self, forKey: .semiBold) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bold = try container.decode(Bold.self, forKey: .bold) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - light = try container.decode(Light.self, forKey: .light) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - regular = try container.decode(Regular.self, forKey: .regular) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(medium, forKey: .medium) - - - - try? container.encodeIfPresent(semiBold, forKey: .semiBold) - - - - try? container.encodeIfPresent(bold, forKey: .bold) - - - - try? container.encodeIfPresent(light, forKey: .light) - - - - try? container.encodeIfPresent(regular, forKey: .regular) - - - } - - } - - /* - Model: Medium - Used By: Theme - */ - class Medium: Codable { - - public var name: String? - - public var file: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case file = "file" - - } - - public init(file: String?, name: String?) { - - self.name = name - - self.file = file - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - file = try container.decode(String.self, forKey: .file) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(file, forKey: .file) - - - } - - } - - /* - Model: SemiBold - Used By: Theme - */ - class SemiBold: Codable { - - public var name: String? - - public var file: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case file = "file" - - } - - public init(file: String?, name: String?) { - - self.name = name - - self.file = file - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - file = try container.decode(String.self, forKey: .file) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(file, forKey: .file) - - - } - - } - - /* - Model: Bold - Used By: Theme - */ - class Bold: Codable { - - public var name: String? - - public var file: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case file = "file" - - } - - public init(file: String?, name: String?) { - - self.name = name - - self.file = file - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - file = try container.decode(String.self, forKey: .file) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(file, forKey: .file) - - - } - - } - - /* - Model: Light - Used By: Theme - */ - class Light: Codable { - - public var name: String? - - public var file: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case file = "file" - - } - - public init(file: String?, name: String?) { - - self.name = name - - self.file = file - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - file = try container.decode(String.self, forKey: .file) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(file, forKey: .file) - - - } - - } - - /* - Model: Regular - Used By: Theme - */ - class Regular: Codable { - - public var name: String? - - public var file: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case file = "file" - - } - - public init(file: String?, name: String?) { - - self.name = name - - self.file = file - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - file = try container.decode(String.self, forKey: .file) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(file, forKey: .file) - - - } - - } - - /* - Model: Blocks - Used By: Theme - */ - class Blocks: Codable { - - public var type: String? - - public var name: String? - - public var props: [BlocksProps]? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case name = "name" - - case props = "props" - - } - - public init(name: String?, props: [BlocksProps]?, type: String?) { - - self.type = type - - self.name = name - - self.props = props - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - props = try container.decode([BlocksProps].self, forKey: .props) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(props, forKey: .props) - - - } - - } - - /* - Model: GlobalSchemaProps - Used By: Theme - */ - class GlobalSchemaProps: Codable { - - public var id: String? - - public var label: String? - - public var type: String? - - public var category: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case label = "label" - - case type = "type" - - case category = "category" - - } - - public init(category: String?, id: String?, label: String?, type: String?) { - - self.id = id - - self.label = label - - self.type = type - - self.category = category - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - label = try container.decode(String.self, forKey: .label) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - category = try container.decode(String.self, forKey: .category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(label, forKey: .label) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(category, forKey: .category) - - - } - - } - - /* - Model: BlocksProps - Used By: Theme - */ - class BlocksProps: Codable { - - public var id: String? - - public var label: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case label = "label" - - case type = "type" - - } - - public init(id: String?, label: String?, type: String?) { - - self.id = id - - self.label = label - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - label = try container.decode(String.self, forKey: .label) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(label, forKey: .label) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - - - /* - Model: EditEmailRequestSchema - Used By: User - */ - class EditEmailRequestSchema: Codable { - - public var email: String? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - } - - public init(email: String?) { - - self.email = email - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - } - - } - - /* - Model: SendVerificationLinkMobileRequestSchema - Used By: User - */ - class SendVerificationLinkMobileRequestSchema: Codable { - - public var verified: Bool? - - public var active: Bool? - - public var countryCode: String? - - public var phone: String? - - public var primary: Bool? - - - public enum CodingKeys: String, CodingKey { - - case verified = "verified" - - case active = "active" - - case countryCode = "country_code" - - case phone = "phone" - - case primary = "primary" - - } - - public init(active: Bool?, countryCode: String?, phone: String?, primary: Bool?, verified: Bool?) { - - self.verified = verified - - self.active = active - - self.countryCode = countryCode - - self.phone = phone - - self.primary = primary - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - verified = try container.decode(Bool.self, forKey: .verified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - primary = try container.decode(Bool.self, forKey: .primary) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(verified, forKey: .verified) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(primary, forKey: .primary) - - - } - - } - - /* - Model: EditMobileRequestSchema - Used By: User - */ - class EditMobileRequestSchema: Codable { - - public var countryCode: String? - - public var phone: String? - - - public enum CodingKeys: String, CodingKey { - - case countryCode = "country_code" - - case phone = "phone" - - } - - public init(countryCode: String?, phone: String?) { - - self.countryCode = countryCode - - self.phone = phone - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - } - - } - - /* - Model: EditProfileRequestSchema - Used By: User - */ - class EditProfileRequestSchema: Codable { - - public var firstName: String? - - public var lastName: String? - - public var mobile: EditProfileMobileSchema? - - public var countryCode: String? - - public var email: String? - - public var gender: String? - - public var dob: String? - - public var profilePicUrl: String? - - public var androidHash: String? - - public var sender: String? - - public var registerToken: String? - - - public enum CodingKeys: String, CodingKey { - - case firstName = "first_name" - - case lastName = "last_name" - - case mobile = "mobile" - - case countryCode = "country_code" - - case email = "email" - - case gender = "gender" - - case dob = "dob" - - case profilePicUrl = "profile_pic_url" - - case androidHash = "android_hash" - - case sender = "sender" - - case registerToken = "register_token" - - } - - public init(androidHash: String?, countryCode: String?, dob: String?, email: String?, firstName: String?, gender: String?, lastName: String?, mobile: EditProfileMobileSchema?, profilePicUrl: String?, registerToken: String?, sender: String?) { - - self.firstName = firstName - - self.lastName = lastName - - self.mobile = mobile - - self.countryCode = countryCode - - self.email = email - - self.gender = gender - - self.dob = dob - - self.profilePicUrl = profilePicUrl - - self.androidHash = androidHash - - self.sender = sender - - self.registerToken = registerToken - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobile = try container.decode(EditProfileMobileSchema.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gender = try container.decode(String.self, forKey: .gender) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dob = try container.decode(String.self, forKey: .dob) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - profilePicUrl = try container.decode(String.self, forKey: .profilePicUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - androidHash = try container.decode(String.self, forKey: .androidHash) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sender = try container.decode(String.self, forKey: .sender) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(gender, forKey: .gender) - - - - try? container.encodeIfPresent(dob, forKey: .dob) - - - - try? container.encodeIfPresent(profilePicUrl, forKey: .profilePicUrl) - - - - try? container.encodeIfPresent(androidHash, forKey: .androidHash) - - - - try? container.encodeIfPresent(sender, forKey: .sender) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - } - - } - - /* - Model: EditProfileMobileSchema - Used By: User - */ - class EditProfileMobileSchema: Codable { - - public var phone: String? - - public var countryCode: String? - - - public enum CodingKeys: String, CodingKey { - - case phone = "phone" - - case countryCode = "country_code" - - } - - public init(countryCode: String?, phone: String?) { - - self.phone = phone - - self.countryCode = countryCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - } - - } - - /* - Model: SendEmailOtpRequestSchema - Used By: User - */ - class SendEmailOtpRequestSchema: Codable { - - public var email: String? - - public var action: String? - - public var token: String? - - public var registerToken: String? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case action = "action" - - case token = "token" - - case registerToken = "register_token" - - } - - public init(action: String?, email: String?, registerToken: String?, token: String?) { - - self.email = email - - self.action = action - - self.token = token - - self.registerToken = registerToken - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(String.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - token = try container.decode(String.self, forKey: .token) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(token, forKey: .token) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - } - - } - - /* - Model: VerifyEmailOtpRequestSchema - Used By: User - */ - class VerifyEmailOtpRequestSchema: Codable { - - public var email: String? - - public var action: String? - - public var registerToken: String? - - public var otp: String? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case action = "action" - - case registerToken = "register_token" - - case otp = "otp" - - } - - public init(action: String?, email: String?, otp: String?, registerToken: String?) { - - self.email = email - - self.action = action - - self.registerToken = registerToken - - self.otp = otp - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(String.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - otp = try container.decode(String.self, forKey: .otp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - - try? container.encodeIfPresent(otp, forKey: .otp) - - - } - - } - - /* - Model: VerifyOtpRequestSchema - Used By: User - */ - class VerifyOtpRequestSchema: Codable { - - public var requestId: String? - - public var registerToken: String? - - public var otp: String? - - - public enum CodingKeys: String, CodingKey { - - case requestId = "request_id" - - case registerToken = "register_token" - - case otp = "otp" - - } - - public init(otp: String?, registerToken: String?, requestId: String?) { - - self.requestId = requestId - - self.registerToken = registerToken - - self.otp = otp - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - requestId = try container.decode(String.self, forKey: .requestId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - otp = try container.decode(String.self, forKey: .otp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - - try? container.encodeIfPresent(otp, forKey: .otp) - - - } - - } - - /* - Model: SendMobileOtpRequestSchema - Used By: User - */ - class SendMobileOtpRequestSchema: Codable { - - public var mobile: String? - - public var countryCode: String? - - public var action: String? - - public var token: String? - - public var androidHash: String? - - public var force: String? - - public var captchaCode: String? - - - public enum CodingKeys: String, CodingKey { - - case mobile = "mobile" - - case countryCode = "country_code" - - case action = "action" - - case token = "token" - - case androidHash = "android_hash" - - case force = "force" - - case captchaCode = "captcha_code" - - } - - public init(action: String?, androidHash: String?, captchaCode: String?, countryCode: String?, force: String?, mobile: String?, token: String?) { - - self.mobile = mobile - - self.countryCode = countryCode - - self.action = action - - self.token = token - - self.androidHash = androidHash - - self.force = force - - self.captchaCode = captchaCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - mobile = try container.decode(String.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(String.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - token = try container.decode(String.self, forKey: .token) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - androidHash = try container.decode(String.self, forKey: .androidHash) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - force = try container.decode(String.self, forKey: .force) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - captchaCode = try container.decode(String.self, forKey: .captchaCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(token, forKey: .token) - - - - try? container.encodeIfPresent(androidHash, forKey: .androidHash) - - - - try? container.encodeIfPresent(force, forKey: .force) - - - - try? container.encodeIfPresent(captchaCode, forKey: .captchaCode) - - - } - - } - - /* - Model: UpdatePasswordRequestSchema - Used By: User - */ - class UpdatePasswordRequestSchema: Codable { - - public var oldPassword: String? - - public var newPassword: String? - - - public enum CodingKeys: String, CodingKey { - - case oldPassword = "old_password" - - case newPassword = "new_password" - - } - - public init(newPassword: String?, oldPassword: String?) { - - self.oldPassword = oldPassword - - self.newPassword = newPassword - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - oldPassword = try container.decode(String.self, forKey: .oldPassword) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - newPassword = try container.decode(String.self, forKey: .newPassword) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(oldPassword, forKey: .oldPassword) - - - - try? container.encodeIfPresent(newPassword, forKey: .newPassword) - - - } - - } - - /* - Model: FormRegisterRequestSchema - Used By: User - */ - class FormRegisterRequestSchema: Codable { - - public var firstName: String? - - public var lastName: String? - - public var gender: String? - - public var email: String? - - public var password: String? - - public var phone: FormRegisterRequestSchemaPhone? - - public var registerToken: String? - - - public enum CodingKeys: String, CodingKey { - - case firstName = "first_name" - - case lastName = "last_name" - - case gender = "gender" - - case email = "email" - - case password = "password" - - case phone = "phone" - - case registerToken = "register_token" - - } - - public init(email: String?, firstName: String?, gender: String?, lastName: String?, password: String?, phone: FormRegisterRequestSchemaPhone?, registerToken: String?) { - - self.firstName = firstName - - self.lastName = lastName - - self.gender = gender - - self.email = email - - self.password = password - - self.phone = phone - - self.registerToken = registerToken - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gender = try container.decode(String.self, forKey: .gender) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - password = try container.decode(String.self, forKey: .password) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(FormRegisterRequestSchemaPhone.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(gender, forKey: .gender) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(password, forKey: .password) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - } - - } - - /* - Model: TokenRequestBodySchema - Used By: User - */ - class TokenRequestBodySchema: Codable { - - public var token: String? - - - public enum CodingKeys: String, CodingKey { - - case token = "token" - - } - - public init(token: String?) { - - self.token = token - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - token = try container.decode(String.self, forKey: .token) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(token, forKey: .token) - - - } - - } - - /* - Model: ForgotPasswordRequestSchema - Used By: User - */ - class ForgotPasswordRequestSchema: Codable { - - public var code: String? - - public var password: String? - - - public enum CodingKeys: String, CodingKey { - - case code = "code" - - case password = "password" - - } - - public init(code: String?, password: String?) { - - self.code = code - - self.password = password - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - password = try container.decode(String.self, forKey: .password) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(password, forKey: .password) - - - } - - } - - /* - Model: CodeRequestBodySchema - Used By: User - */ - class CodeRequestBodySchema: Codable { - - public var code: String? - - - public enum CodingKeys: String, CodingKey { - - case code = "code" - - } - - public init(code: String?) { - - self.code = code - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(code, forKey: .code) - - - } - - } - - /* - Model: SendResetPasswordEmailRequestSchema - Used By: User - */ - class SendResetPasswordEmailRequestSchema: Codable { - - public var email: String? - - public var captchaCode: String? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case captchaCode = "captcha_code" - - } - - public init(captchaCode: String?, email: String?) { - - self.email = email - - self.captchaCode = captchaCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - captchaCode = try container.decode(String.self, forKey: .captchaCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(captchaCode, forKey: .captchaCode) - - - } - - } - - /* - Model: PasswordLoginRequestSchema - Used By: User - */ - class PasswordLoginRequestSchema: Codable { - - public var captchaCode: String? - - public var password: String? - - public var username: String? - - - public enum CodingKeys: String, CodingKey { - - case captchaCode = "captcha_code" - - case password = "password" - - case username = "username" - - } - - public init(captchaCode: String?, password: String?, username: String?) { - - self.captchaCode = captchaCode - - self.password = password - - self.username = username - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - captchaCode = try container.decode(String.self, forKey: .captchaCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - password = try container.decode(String.self, forKey: .password) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - username = try container.decode(String.self, forKey: .username) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(captchaCode, forKey: .captchaCode) - - - - try? container.encodeIfPresent(password, forKey: .password) - - - - try? container.encodeIfPresent(username, forKey: .username) - - - } - - } - - /* - Model: SendOtpRequestSchema - Used By: User - */ - class SendOtpRequestSchema: Codable { - - public var countryCode: String? - - public var captchaCode: String? - - public var mobile: String? - - - public enum CodingKeys: String, CodingKey { - - case countryCode = "country_code" - - case captchaCode = "captcha_code" - - case mobile = "mobile" - - } - - public init(captchaCode: String?, countryCode: String?, mobile: String?) { - - self.countryCode = countryCode - - self.captchaCode = captchaCode - - self.mobile = mobile - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - captchaCode = try container.decode(String.self, forKey: .captchaCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobile = try container.decode(String.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(captchaCode, forKey: .captchaCode) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - } - - } - - /* - Model: OAuthRequestSchema - Used By: User - */ - class OAuthRequestSchema: Codable { - - public var isSignedIn: Bool? - - public var oauth2: OAuthRequestSchemaOauth2? - - public var profile: OAuthRequestSchemaProfile? - - - public enum CodingKeys: String, CodingKey { - - case isSignedIn = "is_signed_in" - - case oauth2 = "oauth2" - - case profile = "profile" - - } - - public init(isSignedIn: Bool?, oauth2: OAuthRequestSchemaOauth2?, profile: OAuthRequestSchemaProfile?) { - - self.isSignedIn = isSignedIn - - self.oauth2 = oauth2 - - self.profile = profile - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isSignedIn = try container.decode(Bool.self, forKey: .isSignedIn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - oauth2 = try container.decode(OAuthRequestSchemaOauth2.self, forKey: .oauth2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - profile = try container.decode(OAuthRequestSchemaProfile.self, forKey: .profile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isSignedIn, forKey: .isSignedIn) - - - - try? container.encodeIfPresent(oauth2, forKey: .oauth2) - - - - try? container.encodeIfPresent(profile, forKey: .profile) - - - } - - } - - /* - Model: UserObjectSchema - Used By: User - */ - class UserObjectSchema: Codable { - - public var user: UserSchema? - - - public enum CodingKeys: String, CodingKey { - - case user = "user" - - } - - public init(user: UserSchema?) { - - self.user = user - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - user = try container.decode(UserSchema.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(user, forKey: .user) - - - } - - } - - /* - Model: AuthSuccess - Used By: User - */ - class AuthSuccess: Codable { - - public var registerToken: String? - - public var userExists: Bool? - - public var user: UserSchema? - - - public enum CodingKeys: String, CodingKey { - - case registerToken = "register_token" - - case userExists = "user_exists" - - case user = "user" - - } - - public init(registerToken: String?, user: UserSchema?, userExists: Bool?) { - - self.registerToken = registerToken - - self.userExists = userExists - - self.user = user - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userExists = try container.decode(Bool.self, forKey: .userExists) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - user = try container.decode(UserSchema.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - - try? container.encodeIfPresent(userExists, forKey: .userExists) - - - - try? container.encodeIfPresent(user, forKey: .user) - - - } - - } - - /* - Model: SendOtpResponse - Used By: User - */ - class SendOtpResponse: Codable { - - public var resendTimer: Int? - - public var resendToken: String? - - public var success: Bool? - - public var requestId: String? - - public var message: String? - - public var mobile: String? - - public var countryCode: String? - - public var email: String? - - public var resendEmailToken: String? - - public var registerToken: String? - - public var verifyEmailOtp: Bool? - - public var verifyMobileOtp: Bool? - - public var userExists: Bool? - - - public enum CodingKeys: String, CodingKey { - - case resendTimer = "resend_timer" - - case resendToken = "resend_token" - - case success = "success" - - case requestId = "request_id" - - case message = "message" - - case mobile = "mobile" - - case countryCode = "country_code" - - case email = "email" - - case resendEmailToken = "resend_email_token" - - case registerToken = "register_token" - - case verifyEmailOtp = "verify_email_otp" - - case verifyMobileOtp = "verify_mobile_otp" - - case userExists = "user_exists" - - } - - public init(countryCode: String?, email: String?, message: String?, mobile: String?, registerToken: String?, requestId: String?, resendEmailToken: String?, resendTimer: Int?, resendToken: String?, success: Bool?, userExists: Bool?, verifyEmailOtp: Bool?, verifyMobileOtp: Bool?) { - - self.resendTimer = resendTimer - - self.resendToken = resendToken - - self.success = success - - self.requestId = requestId - - self.message = message - - self.mobile = mobile - - self.countryCode = countryCode - - self.email = email - - self.resendEmailToken = resendEmailToken - - self.registerToken = registerToken - - self.verifyEmailOtp = verifyEmailOtp - - self.verifyMobileOtp = verifyMobileOtp - - self.userExists = userExists - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - resendTimer = try container.decode(Int.self, forKey: .resendTimer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - resendToken = try container.decode(String.self, forKey: .resendToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requestId = try container.decode(String.self, forKey: .requestId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobile = try container.decode(String.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - resendEmailToken = try container.decode(String.self, forKey: .resendEmailToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyEmailOtp = try container.decode(Bool.self, forKey: .verifyEmailOtp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyMobileOtp = try container.decode(Bool.self, forKey: .verifyMobileOtp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userExists = try container.decode(Bool.self, forKey: .userExists) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(resendTimer, forKey: .resendTimer) - - - - try? container.encodeIfPresent(resendToken, forKey: .resendToken) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(resendEmailToken, forKey: .resendEmailToken) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - - try? container.encodeIfPresent(verifyEmailOtp, forKey: .verifyEmailOtp) - - - - try? container.encodeIfPresent(verifyMobileOtp, forKey: .verifyMobileOtp) - - - - try? container.encodeIfPresent(userExists, forKey: .userExists) - - - } - - } - - /* - Model: ProfileEditSuccess - Used By: User - */ - class ProfileEditSuccess: Codable { - - public var user: UserSchema? - - public var registerToken: String? - - public var userExists: Bool? - - public var verifyEmailLink: Bool? - - public var verifyEmailOtp: Bool? - - public var verifyMobileOtp: Bool? - - public var email: String? - - - public enum CodingKeys: String, CodingKey { - - case user = "user" - - case registerToken = "register_token" - - case userExists = "user_exists" - - case verifyEmailLink = "verify_email_link" - - case verifyEmailOtp = "verify_email_otp" - - case verifyMobileOtp = "verify_mobile_otp" - - case email = "email" - - } - - public init(email: String?, registerToken: String?, user: UserSchema?, userExists: Bool?, verifyEmailLink: Bool?, verifyEmailOtp: Bool?, verifyMobileOtp: Bool?) { - - self.user = user - - self.registerToken = registerToken - - self.userExists = userExists - - self.verifyEmailLink = verifyEmailLink - - self.verifyEmailOtp = verifyEmailOtp - - self.verifyMobileOtp = verifyMobileOtp - - self.email = email - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - user = try container.decode(UserSchema.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userExists = try container.decode(Bool.self, forKey: .userExists) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyEmailLink = try container.decode(Bool.self, forKey: .verifyEmailLink) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyEmailOtp = try container.decode(Bool.self, forKey: .verifyEmailOtp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyMobileOtp = try container.decode(Bool.self, forKey: .verifyMobileOtp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - - try? container.encodeIfPresent(userExists, forKey: .userExists) - - - - try? container.encodeIfPresent(verifyEmailLink, forKey: .verifyEmailLink) - - - - try? container.encodeIfPresent(verifyEmailOtp, forKey: .verifyEmailOtp) - - - - try? container.encodeIfPresent(verifyMobileOtp, forKey: .verifyMobileOtp) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - } - - } - - /* - Model: LoginSuccess - Used By: User - */ - class LoginSuccess: Codable { - - public var user: UserSchema? - - public var requestId: String? - - public var registerToken: String? - - - public enum CodingKeys: String, CodingKey { - - case user = "user" - - case requestId = "request_id" - - case registerToken = "register_token" - - } - - public init(registerToken: String?, requestId: String?, user: UserSchema?) { - - self.user = user - - self.requestId = requestId - - self.registerToken = registerToken - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - user = try container.decode(UserSchema.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requestId = try container.decode(String.self, forKey: .requestId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - } - - } - - /* - Model: VerifyOtpSuccess - Used By: User - */ - class VerifyOtpSuccess: Codable { - - public var user: UserSchema? - - public var userExists: Bool? - - public var registerToken: String? - - - public enum CodingKeys: String, CodingKey { - - case user = "user" - - case userExists = "user_exists" - - case registerToken = "register_token" - - } - - public init(registerToken: String?, user: UserSchema?, userExists: Bool?) { - - self.user = user - - self.userExists = userExists - - self.registerToken = registerToken - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - user = try container.decode(UserSchema.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userExists = try container.decode(Bool.self, forKey: .userExists) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(userExists, forKey: .userExists) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - } - - } - - /* - Model: ResetPasswordSuccess - Used By: User - */ - class ResetPasswordSuccess: Codable { - - public var status: String? - - - public enum CodingKeys: String, CodingKey { - - case status = "status" - - } - - public init(status: String?) { - - self.status = status - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(status, forKey: .status) - - - } - - } - - /* - Model: RegisterFormSuccess - Used By: User - */ - class RegisterFormSuccess: Codable { - - public var email: String? - - public var resendTimer: Int? - - public var resendToken: String? - - public var resendEmailToken: String? - - public var registerToken: String? - - public var success: Bool? - - public var requestId: String? - - public var message: String? - - public var mobile: String? - - public var countryCode: String? - - public var verifyEmailOtp: Bool? - - public var verifyMobileOtp: Bool? - - public var userExists: Bool? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case resendTimer = "resend_timer" - - case resendToken = "resend_token" - - case resendEmailToken = "resend_email_token" - - case registerToken = "register_token" - - case success = "success" - - case requestId = "request_id" - - case message = "message" - - case mobile = "mobile" - - case countryCode = "country_code" - - case verifyEmailOtp = "verify_email_otp" - - case verifyMobileOtp = "verify_mobile_otp" - - case userExists = "user_exists" - - } - - public init(countryCode: String?, email: String?, message: String?, mobile: String?, registerToken: String?, requestId: String?, resendEmailToken: String?, resendTimer: Int?, resendToken: String?, success: Bool?, userExists: Bool?, verifyEmailOtp: Bool?, verifyMobileOtp: Bool?) { - - self.email = email - - self.resendTimer = resendTimer - - self.resendToken = resendToken - - self.resendEmailToken = resendEmailToken - - self.registerToken = registerToken - - self.success = success - - self.requestId = requestId - - self.message = message - - self.mobile = mobile - - self.countryCode = countryCode - - self.verifyEmailOtp = verifyEmailOtp - - self.verifyMobileOtp = verifyMobileOtp - - self.userExists = userExists - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - resendTimer = try container.decode(Int.self, forKey: .resendTimer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - resendToken = try container.decode(String.self, forKey: .resendToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - resendEmailToken = try container.decode(String.self, forKey: .resendEmailToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requestId = try container.decode(String.self, forKey: .requestId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobile = try container.decode(String.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyEmailOtp = try container.decode(Bool.self, forKey: .verifyEmailOtp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyMobileOtp = try container.decode(Bool.self, forKey: .verifyMobileOtp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userExists = try container.decode(Bool.self, forKey: .userExists) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(resendTimer, forKey: .resendTimer) - - - - try? container.encodeIfPresent(resendToken, forKey: .resendToken) - - - - try? container.encodeIfPresent(resendEmailToken, forKey: .resendEmailToken) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(verifyEmailOtp, forKey: .verifyEmailOtp) - - - - try? container.encodeIfPresent(verifyMobileOtp, forKey: .verifyMobileOtp) - - - - try? container.encodeIfPresent(userExists, forKey: .userExists) - - - } - - } - - /* - Model: VerifyEmailSuccess - Used By: User - */ - class VerifyEmailSuccess: Codable { - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: HasPasswordSuccess - Used By: User - */ - class HasPasswordSuccess: Codable { - - public var result: Bool? - - - public enum CodingKeys: String, CodingKey { - - case result = "result" - - } - - public init(result: Bool?) { - - self.result = result - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - result = try container.decode(Bool.self, forKey: .result) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(result, forKey: .result) - - - } - - } - - /* - Model: LogoutSuccess - Used By: User - */ - class LogoutSuccess: Codable { - - public var logout: Bool? - - - public enum CodingKeys: String, CodingKey { - - case logout = "logout" - - } - - public init(logout: Bool?) { - - self.logout = logout - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - logout = try container.decode(Bool.self, forKey: .logout) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(logout, forKey: .logout) - - - } - - } - - /* - Model: OtpSuccess - Used By: User - */ - class OtpSuccess: Codable { - - public var resendTimer: Int? - - public var resendToken: String? - - public var registerToken: String? - - public var success: Bool? - - public var requestId: String? - - public var message: String? - - public var mobile: String? - - public var countryCode: String? - - - public enum CodingKeys: String, CodingKey { - - case resendTimer = "resend_timer" - - case resendToken = "resend_token" - - case registerToken = "register_token" - - case success = "success" - - case requestId = "request_id" - - case message = "message" - - case mobile = "mobile" - - case countryCode = "country_code" - - } - - public init(countryCode: String?, message: String?, mobile: String?, registerToken: String?, requestId: String?, resendTimer: Int?, resendToken: String?, success: Bool?) { - - self.resendTimer = resendTimer - - self.resendToken = resendToken - - self.registerToken = registerToken - - self.success = success - - self.requestId = requestId - - self.message = message - - self.mobile = mobile - - self.countryCode = countryCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - resendTimer = try container.decode(Int.self, forKey: .resendTimer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - resendToken = try container.decode(String.self, forKey: .resendToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requestId = try container.decode(String.self, forKey: .requestId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobile = try container.decode(String.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(resendTimer, forKey: .resendTimer) - - - - try? container.encodeIfPresent(resendToken, forKey: .resendToken) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - } - - } - - /* - Model: EmailOtpSuccess - Used By: User - */ - class EmailOtpSuccess: Codable { - - public var success: Bool? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - } - - public init(success: Bool?) { - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: SessionListSuccess - Used By: User - */ - class SessionListSuccess: Codable { - - public var sessions: [String]? - - - public enum CodingKeys: String, CodingKey { - - case sessions = "sessions" - - } - - public init(sessions: [String]?) { - - self.sessions = sessions - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - sessions = try container.decode([String].self, forKey: .sessions) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(sessions, forKey: .sessions) - - - } - - } - - /* - Model: VerifyMobileOTPSuccess - Used By: User - */ - class VerifyMobileOTPSuccess: Codable { - - public var user: UserSchema? - - public var verifyMobileLink: Bool? - - - public enum CodingKeys: String, CodingKey { - - case user = "user" - - case verifyMobileLink = "verify_mobile_link" - - } - - public init(user: UserSchema?, verifyMobileLink: Bool?) { - - self.user = user - - self.verifyMobileLink = verifyMobileLink - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - user = try container.decode(UserSchema.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyMobileLink = try container.decode(Bool.self, forKey: .verifyMobileLink) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(verifyMobileLink, forKey: .verifyMobileLink) - - - } - - } - - /* - Model: VerifyEmailOTPSuccess - Used By: User - */ - class VerifyEmailOTPSuccess: Codable { - - public var user: UserSchema? - - public var verifyEmailLink: Bool? - - - public enum CodingKeys: String, CodingKey { - - case user = "user" - - case verifyEmailLink = "verify_email_link" - - } - - public init(user: UserSchema?, verifyEmailLink: Bool?) { - - self.user = user - - self.verifyEmailLink = verifyEmailLink - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - user = try container.decode(UserSchema.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyEmailLink = try container.decode(Bool.self, forKey: .verifyEmailLink) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(verifyEmailLink, forKey: .verifyEmailLink) - - - } - - } - - /* - Model: SendMobileVerifyLinkSuccess - Used By: User - */ - class SendMobileVerifyLinkSuccess: Codable { - - public var verifyMobileLink: Bool? - - - public enum CodingKeys: String, CodingKey { - - case verifyMobileLink = "verify_mobile_link" - - } - - public init(verifyMobileLink: Bool?) { - - self.verifyMobileLink = verifyMobileLink - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - verifyMobileLink = try container.decode(Bool.self, forKey: .verifyMobileLink) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(verifyMobileLink, forKey: .verifyMobileLink) - - - } - - } - - /* - Model: SendEmailVerifyLinkSuccess - Used By: User - */ - class SendEmailVerifyLinkSuccess: Codable { - - public var verifyEmailLink: Bool? - - - public enum CodingKeys: String, CodingKey { - - case verifyEmailLink = "verify_email_link" - - } - - public init(verifyEmailLink: Bool?) { - - self.verifyEmailLink = verifyEmailLink - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - verifyEmailLink = try container.decode(Bool.self, forKey: .verifyEmailLink) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(verifyEmailLink, forKey: .verifyEmailLink) - - - } - - } - - /* - Model: UserSearchResponseSchema - Used By: User - */ - class UserSearchResponseSchema: Codable { - - public var users: [UserSchema]? - - - public enum CodingKeys: String, CodingKey { - - case users = "users" - - } - - public init(users: [UserSchema]?) { - - self.users = users - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - users = try container.decode([UserSchema].self, forKey: .users) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(users, forKey: .users) - - - } - - } - - /* - Model: CustomerListResponseSchema - Used By: User - */ - class CustomerListResponseSchema: Codable { - - public var items: [UserSchema]? - - public var page: PaginationSchema? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [UserSchema]?, page: PaginationSchema?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([UserSchema].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(PaginationSchema.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: UnauthorizedSchema - Used By: User - */ - class UnauthorizedSchema: Codable { - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: UnauthenticatedSchema - Used By: User - */ - class UnauthenticatedSchema: Codable { - - public var authenticated: Bool? - - - public enum CodingKeys: String, CodingKey { - - case authenticated = "authenticated" - - } - - public init(authenticated: Bool?) { - - self.authenticated = authenticated - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - authenticated = try container.decode(Bool.self, forKey: .authenticated) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(authenticated, forKey: .authenticated) - - - } - - } - - /* - Model: NotFoundSchema - Used By: User - */ - class NotFoundSchema: Codable { - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: AuthenticationInternalServerErrorSchema - Used By: User - */ - class AuthenticationInternalServerErrorSchema: Codable { - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: AuthenticationApiErrorSchema - Used By: User - */ - class AuthenticationApiErrorSchema: Codable { - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: ProfileEditSuccessSchema - Used By: User - */ - class ProfileEditSuccessSchema: Codable { - - public var email: String? - - public var verifyEmailOtp: Bool? - - public var verifyEmailLink: Bool? - - public var verifyMobileOtp: Bool? - - public var user: String? - - public var registerToken: String? - - public var userExists: Bool? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case verifyEmailOtp = "verify_email_otp" - - case verifyEmailLink = "verify_email_link" - - case verifyMobileOtp = "verify_mobile_otp" - - case user = "user" - - case registerToken = "register_token" - - case userExists = "user_exists" - - } - - public init(email: String?, registerToken: String?, user: String?, userExists: Bool?, verifyEmailLink: Bool?, verifyEmailOtp: Bool?, verifyMobileOtp: Bool?) { - - self.email = email - - self.verifyEmailOtp = verifyEmailOtp - - self.verifyEmailLink = verifyEmailLink - - self.verifyMobileOtp = verifyMobileOtp - - self.user = user - - self.registerToken = registerToken - - self.userExists = userExists - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyEmailOtp = try container.decode(Bool.self, forKey: .verifyEmailOtp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyEmailLink = try container.decode(Bool.self, forKey: .verifyEmailLink) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyMobileOtp = try container.decode(Bool.self, forKey: .verifyMobileOtp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - user = try container.decode(String.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userExists = try container.decode(Bool.self, forKey: .userExists) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(verifyEmailOtp, forKey: .verifyEmailOtp) - - - - try? container.encodeIfPresent(verifyEmailLink, forKey: .verifyEmailLink) - - - - try? container.encodeIfPresent(verifyMobileOtp, forKey: .verifyMobileOtp) - - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - - try? container.encodeIfPresent(userExists, forKey: .userExists) - - - } - - } - - /* - Model: FormRegisterRequestSchemaPhone - Used By: User - */ - class FormRegisterRequestSchemaPhone: Codable { - - public var countryCode: String? - - public var mobile: String? - - - public enum CodingKeys: String, CodingKey { - - case countryCode = "country_code" - - case mobile = "mobile" - - } - - public init(countryCode: String?, mobile: String?) { - - self.countryCode = countryCode - - self.mobile = mobile - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobile = try container.decode(String.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - } - - } - - /* - Model: OAuthRequestSchemaOauth2 - Used By: User - */ - class OAuthRequestSchemaOauth2: Codable { - - public var accessToken: String? - - public var expiry: Int? - - public var refreshToken: String? - - - public enum CodingKeys: String, CodingKey { - - case accessToken = "access_token" - - case expiry = "expiry" - - case refreshToken = "refresh_token" - - } - - public init(accessToken: String?, expiry: Int?, refreshToken: String?) { - - self.accessToken = accessToken - - self.expiry = expiry - - self.refreshToken = refreshToken - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - accessToken = try container.decode(String.self, forKey: .accessToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expiry = try container.decode(Int.self, forKey: .expiry) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refreshToken = try container.decode(String.self, forKey: .refreshToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(accessToken, forKey: .accessToken) - - - - try? container.encodeIfPresent(expiry, forKey: .expiry) - - - - try? container.encodeIfPresent(refreshToken, forKey: .refreshToken) - - - } - - } - - /* - Model: OAuthRequestSchemaProfile - Used By: User - */ - class OAuthRequestSchemaProfile: Codable { - - public var lastName: String? - - public var image: String? - - public var id: String? - - public var email: String? - - public var fullName: String? - - public var firstName: String? - - - public enum CodingKeys: String, CodingKey { - - case lastName = "last_name" - - case image = "image" - - case id = "id" - - case email = "email" - - case fullName = "full_name" - - case firstName = "first_name" - - } - - public init(email: String?, firstName: String?, fullName: String?, id: String?, image: String?, lastName: String?) { - - self.lastName = lastName - - self.image = image - - self.id = id - - self.email = email - - self.fullName = fullName - - self.firstName = firstName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - image = try container.decode(String.self, forKey: .image) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fullName = try container.decode(String.self, forKey: .fullName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(image, forKey: .image) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(fullName, forKey: .fullName) - - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - } - - } - - /* - Model: AuthSuccessUser - Used By: User - */ - class AuthSuccessUser: Codable { - - public var firstName: String? - - public var lastName: String? - - public var debug: AuthSuccessUserDebug? - - public var active: Bool? - - public var emails: AuthSuccessUserEmails? - - - public enum CodingKeys: String, CodingKey { - - case firstName = "first_name" - - case lastName = "last_name" - - case debug = "debug" - - case active = "active" - - case emails = "emails" - - } - - public init(active: Bool?, debug: AuthSuccessUserDebug?, emails: AuthSuccessUserEmails?, firstName: String?, lastName: String?) { - - self.firstName = firstName - - self.lastName = lastName - - self.debug = debug - - self.active = active - - self.emails = emails - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - debug = try container.decode(AuthSuccessUserDebug.self, forKey: .debug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - emails = try container.decode(AuthSuccessUserEmails.self, forKey: .emails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(debug, forKey: .debug) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(emails, forKey: .emails) - - - } - - } - - /* - Model: AuthSuccessUserDebug - Used By: User - */ - class AuthSuccessUserDebug: Codable { - - public var platform: String? - - - public enum CodingKeys: String, CodingKey { - - case platform = "platform" - - } - - public init(platform: String?) { - - self.platform = platform - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - platform = try container.decode(String.self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - } - - } - - /* - Model: AuthSuccessUserEmails - Used By: User - */ - class AuthSuccessUserEmails: Codable { - - public var email: String? - - public var verified: Bool? - - public var primary: Bool? - - public var active: Bool? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case verified = "verified" - - case primary = "primary" - - case active = "active" - - } - - public init(active: Bool?, email: String?, primary: Bool?, verified: Bool?) { - - self.email = email - - self.verified = verified - - self.primary = primary - - self.active = active - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verified = try container.decode(Bool.self, forKey: .verified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - primary = try container.decode(Bool.self, forKey: .primary) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(verified, forKey: .verified) - - - - try? container.encodeIfPresent(primary, forKey: .primary) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - } - - } - - /* - Model: CreateUserRequestSchema - Used By: User - */ - class CreateUserRequestSchema: Codable { - - public var phoneNumber: String - - public var email: String? - - public var firstName: String? - - public var lastName: String? - - public var gender: String? - - public var username: String - - public var meta: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case phoneNumber = "phone_number" - - case email = "email" - - case firstName = "first_name" - - case lastName = "last_name" - - case gender = "gender" - - case username = "username" - - case meta = "meta" - - } - - public init(email: String?, firstName: String?, gender: String?, lastName: String?, meta: [String: Any]?, phoneNumber: String, username: String) { - - self.phoneNumber = phoneNumber - - self.email = email - - self.firstName = firstName - - self.lastName = lastName - - self.gender = gender - - self.username = username - - self.meta = meta - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - phoneNumber = try container.decode(String.self, forKey: .phoneNumber) - - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gender = try container.decode(String.self, forKey: .gender) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - username = try container.decode(String.self, forKey: .username) - - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(phoneNumber, forKey: .phoneNumber) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(gender, forKey: .gender) - - - - try? container.encodeIfPresent(username, forKey: .username) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - } - - } - - /* - Model: CreateUserResponseSchema - Used By: User - */ - class CreateUserResponseSchema: Codable { - - public var user: UserSchema? - - - public enum CodingKeys: String, CodingKey { - - case user = "user" - - } - - public init(user: UserSchema?) { - - self.user = user - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - user = try container.decode(UserSchema.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(user, forKey: .user) - - - } - - } - - /* - Model: CreateUserSessionRequestSchema - Used By: User - */ - class CreateUserSessionRequestSchema: Codable { - - public var domain: String? - - public var maxAge: Double? - - public var userId: String? - - - public enum CodingKeys: String, CodingKey { - - case domain = "domain" - - case maxAge = "max_age" - - case userId = "user_id" - - } - - public init(domain: String?, maxAge: Double?, userId: String?) { - - self.domain = domain - - self.maxAge = maxAge - - self.userId = userId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - domain = try container.decode(String.self, forKey: .domain) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - maxAge = try container.decode(Double.self, forKey: .maxAge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(domain, forKey: .domain) - - - - try? container.encodeIfPresent(maxAge, forKey: .maxAge) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - } - - } - - /* - Model: CreateUserSessionResponseSchema - Used By: User - */ - class CreateUserSessionResponseSchema: Codable { - - public var domain: String? - - public var maxAge: Double? - - public var secure: Bool? - - public var httpOnly: Bool? - - public var cookie: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case domain = "domain" - - case maxAge = "max_age" - - case secure = "secure" - - case httpOnly = "http_only" - - case cookie = "cookie" - - } - - public init(cookie: [String: Any]?, domain: String?, httpOnly: Bool?, maxAge: Double?, secure: Bool?) { - - self.domain = domain - - self.maxAge = maxAge - - self.secure = secure - - self.httpOnly = httpOnly - - self.cookie = cookie - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - domain = try container.decode(String.self, forKey: .domain) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - maxAge = try container.decode(Double.self, forKey: .maxAge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - secure = try container.decode(Bool.self, forKey: .secure) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - httpOnly = try container.decode(Bool.self, forKey: .httpOnly) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cookie = try container.decode([String: Any].self, forKey: .cookie) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(domain, forKey: .domain) - - - - try? container.encodeIfPresent(maxAge, forKey: .maxAge) - - - - try? container.encodeIfPresent(secure, forKey: .secure) - - - - try? container.encodeIfPresent(httpOnly, forKey: .httpOnly) - - - - try? container.encodeIfPresent(cookie, forKey: .cookie) - - - } - - } - - /* - Model: PlatformSchema - Used By: User - */ - class PlatformSchema: Codable { - - public var display: String? - - public var lookAndFeel: LookAndFeel? - - public var updatedAt: String? - - public var active: Bool? - - public var forgotPassword: Bool? - - public var login: Login? - - public var skipCaptcha: Bool? - - public var name: String? - - public var meta: MetaSchema? - - public var id: String? - - public var social: Social? - - public var requiredFields: RequiredFields? - - public var registerRequiredFields: RegisterRequiredFields? - - public var skipLogin: Bool? - - public var flashCard: FlashCard? - - public var subtext: String? - - public var socialTokens: SocialTokens? - - public var createdAt: String? - - public var register: Bool? - - public var mobileImage: String? - - public var desktopImage: String? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case lookAndFeel = "look_and_feel" - - case updatedAt = "updated_at" - - case active = "active" - - case forgotPassword = "forgot_password" - - case login = "login" - - case skipCaptcha = "skip_captcha" - - case name = "name" - - case meta = "meta" - - case id = "_id" - - case social = "social" - - case requiredFields = "required_fields" - - case registerRequiredFields = "register_required_fields" - - case skipLogin = "skip_login" - - case flashCard = "flash_card" - - case subtext = "subtext" - - case socialTokens = "social_tokens" - - case createdAt = "created_at" - - case register = "register" - - case mobileImage = "mobile_image" - - case desktopImage = "desktop_image" - - } - - public init(active: Bool?, createdAt: String?, desktopImage: String?, display: String?, flashCard: FlashCard?, forgotPassword: Bool?, login: Login?, lookAndFeel: LookAndFeel?, meta: MetaSchema?, mobileImage: String?, name: String?, register: Bool?, registerRequiredFields: RegisterRequiredFields?, requiredFields: RequiredFields?, skipCaptcha: Bool?, skipLogin: Bool?, social: Social?, socialTokens: SocialTokens?, subtext: String?, updatedAt: String?, id: String?) { - - self.display = display - - self.lookAndFeel = lookAndFeel - - self.updatedAt = updatedAt - - self.active = active - - self.forgotPassword = forgotPassword - - self.login = login - - self.skipCaptcha = skipCaptcha - - self.name = name - - self.meta = meta - - self.id = id - - self.social = social - - self.requiredFields = requiredFields - - self.registerRequiredFields = registerRequiredFields - - self.skipLogin = skipLogin - - self.flashCard = flashCard - - self.subtext = subtext - - self.socialTokens = socialTokens - - self.createdAt = createdAt - - self.register = register - - self.mobileImage = mobileImage - - self.desktopImage = desktopImage - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lookAndFeel = try container.decode(LookAndFeel.self, forKey: .lookAndFeel) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - forgotPassword = try container.decode(Bool.self, forKey: .forgotPassword) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - login = try container.decode(Login.self, forKey: .login) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - skipCaptcha = try container.decode(Bool.self, forKey: .skipCaptcha) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode(MetaSchema.self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - social = try container.decode(Social.self, forKey: .social) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requiredFields = try container.decode(RequiredFields.self, forKey: .requiredFields) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerRequiredFields = try container.decode(RegisterRequiredFields.self, forKey: .registerRequiredFields) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - skipLogin = try container.decode(Bool.self, forKey: .skipLogin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - flashCard = try container.decode(FlashCard.self, forKey: .flashCard) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subtext = try container.decode(String.self, forKey: .subtext) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - socialTokens = try container.decode(SocialTokens.self, forKey: .socialTokens) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - register = try container.decode(Bool.self, forKey: .register) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobileImage = try container.decode(String.self, forKey: .mobileImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - desktopImage = try container.decode(String.self, forKey: .desktopImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(lookAndFeel, forKey: .lookAndFeel) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(forgotPassword, forKey: .forgotPassword) - - - - try? container.encodeIfPresent(login, forKey: .login) - - - - try? container.encodeIfPresent(skipCaptcha, forKey: .skipCaptcha) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(social, forKey: .social) - - - - try? container.encodeIfPresent(requiredFields, forKey: .requiredFields) - - - - try? container.encodeIfPresent(registerRequiredFields, forKey: .registerRequiredFields) - - - - try? container.encodeIfPresent(skipLogin, forKey: .skipLogin) - - - - try? container.encodeIfPresent(flashCard, forKey: .flashCard) - - - - try? container.encodeIfPresent(subtext, forKey: .subtext) - - - - try? container.encodeIfPresent(socialTokens, forKey: .socialTokens) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(register, forKey: .register) - - - - try? container.encodeIfPresent(mobileImage, forKey: .mobileImage) - - - - try? container.encodeIfPresent(desktopImage, forKey: .desktopImage) - - - } - - } - - /* - Model: LookAndFeel - Used By: User - */ - class LookAndFeel: Codable { - - public var cardPosition: String? - - public var backgroundColor: String? - - - public enum CodingKeys: String, CodingKey { - - case cardPosition = "card_position" - - case backgroundColor = "background_color" - - } - - public init(backgroundColor: String?, cardPosition: String?) { - - self.cardPosition = cardPosition - - self.backgroundColor = backgroundColor - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cardPosition = try container.decode(String.self, forKey: .cardPosition) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - backgroundColor = try container.decode(String.self, forKey: .backgroundColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cardPosition, forKey: .cardPosition) - - - - try? container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) - - - } - - } - - /* - Model: Login - Used By: User - */ - class Login: Codable { - - public var password: Bool? - - public var otp: Bool? - - - public enum CodingKeys: String, CodingKey { - - case password = "password" - - case otp = "otp" - - } - - public init(otp: Bool?, password: Bool?) { - - self.password = password - - self.otp = otp - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - password = try container.decode(Bool.self, forKey: .password) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - otp = try container.decode(Bool.self, forKey: .otp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(password, forKey: .password) - - - - try? container.encodeIfPresent(otp, forKey: .otp) - - - } - - } - - /* - Model: MetaSchema - Used By: User - */ - class MetaSchema: Codable { - - public var fyndDefault: Bool? - - - public enum CodingKeys: String, CodingKey { - - case fyndDefault = "fynd_default" - - } - - public init(fyndDefault: Bool?) { - - self.fyndDefault = fyndDefault - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - fyndDefault = try container.decode(Bool.self, forKey: .fyndDefault) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(fyndDefault, forKey: .fyndDefault) - - - } - - } - - /* - Model: Social - Used By: User - */ - class Social: Codable { - - public var accountKit: Bool? - - public var facebook: Bool? - - public var google: Bool? - - - public enum CodingKeys: String, CodingKey { - - case accountKit = "account_kit" - - case facebook = "facebook" - - case google = "google" - - } - - public init(accountKit: Bool?, facebook: Bool?, google: Bool?) { - - self.accountKit = accountKit - - self.facebook = facebook - - self.google = google - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - accountKit = try container.decode(Bool.self, forKey: .accountKit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - facebook = try container.decode(Bool.self, forKey: .facebook) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - google = try container.decode(Bool.self, forKey: .google) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(accountKit, forKey: .accountKit) - - - - try? container.encodeIfPresent(facebook, forKey: .facebook) - - - - try? container.encodeIfPresent(google, forKey: .google) - - - } - - } - - /* - Model: RequiredFields - Used By: User - */ - class RequiredFields: Codable { - - public var email: PlatformEmail? - - public var mobile: PlatformMobile? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case mobile = "mobile" - - } - - public init(email: PlatformEmail?, mobile: PlatformMobile?) { - - self.email = email - - self.mobile = mobile - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(PlatformEmail.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobile = try container.decode(PlatformMobile.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - } - - } - - /* - Model: PlatformEmail - Used By: User - */ - class PlatformEmail: Codable { - - public var isRequired: Bool? - - public var level: String? - - - public enum CodingKeys: String, CodingKey { - - case isRequired = "is_required" - - case level = "level" - - } - - public init(isRequired: Bool?, level: String?) { - - self.isRequired = isRequired - - self.level = level - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isRequired = try container.decode(Bool.self, forKey: .isRequired) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - level = try container.decode(String.self, forKey: .level) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isRequired, forKey: .isRequired) - - - - try? container.encodeIfPresent(level, forKey: .level) - - - } - - } - - /* - Model: PlatformMobile - Used By: User - */ - class PlatformMobile: Codable { - - public var isRequired: Bool? - - public var level: String? - - - public enum CodingKeys: String, CodingKey { - - case isRequired = "is_required" - - case level = "level" - - } - - public init(isRequired: Bool?, level: String?) { - - self.isRequired = isRequired - - self.level = level - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isRequired = try container.decode(Bool.self, forKey: .isRequired) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - level = try container.decode(String.self, forKey: .level) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isRequired, forKey: .isRequired) - - - - try? container.encodeIfPresent(level, forKey: .level) - - - } - - } - - /* - Model: RegisterRequiredFields - Used By: User - */ - class RegisterRequiredFields: Codable { - - public var email: RegisterRequiredFieldsEmail? - - public var mobile: RegisterRequiredFieldsMobile? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case mobile = "mobile" - - } - - public init(email: RegisterRequiredFieldsEmail?, mobile: RegisterRequiredFieldsMobile?) { - - self.email = email - - self.mobile = mobile - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(RegisterRequiredFieldsEmail.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobile = try container.decode(RegisterRequiredFieldsMobile.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - } - - } - - /* - Model: RegisterRequiredFieldsEmail - Used By: User - */ - class RegisterRequiredFieldsEmail: Codable { - - public var isRequired: Bool? - - public var level: String? - - - public enum CodingKeys: String, CodingKey { - - case isRequired = "is_required" - - case level = "level" - - } - - public init(isRequired: Bool?, level: String?) { - - self.isRequired = isRequired - - self.level = level - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isRequired = try container.decode(Bool.self, forKey: .isRequired) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - level = try container.decode(String.self, forKey: .level) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isRequired, forKey: .isRequired) - - - - try? container.encodeIfPresent(level, forKey: .level) - - - } - - } - - /* - Model: RegisterRequiredFieldsMobile - Used By: User - */ - class RegisterRequiredFieldsMobile: Codable { - - public var isRequired: Bool? - - public var level: String? - - - public enum CodingKeys: String, CodingKey { - - case isRequired = "is_required" - - case level = "level" - - } - - public init(isRequired: Bool?, level: String?) { - - self.isRequired = isRequired - - self.level = level - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isRequired = try container.decode(Bool.self, forKey: .isRequired) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - level = try container.decode(String.self, forKey: .level) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isRequired, forKey: .isRequired) - - - - try? container.encodeIfPresent(level, forKey: .level) - - - } - - } - - /* - Model: FlashCard - Used By: User - */ - class FlashCard: Codable { - - public var text: String? - - public var textColor: String? - - public var backgroundColor: String? - - - public enum CodingKeys: String, CodingKey { - - case text = "text" - - case textColor = "text_color" - - case backgroundColor = "background_color" - - } - - public init(backgroundColor: String?, text: String?, textColor: String?) { - - self.text = text - - self.textColor = textColor - - self.backgroundColor = backgroundColor - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - text = try container.decode(String.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - textColor = try container.decode(String.self, forKey: .textColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - backgroundColor = try container.decode(String.self, forKey: .backgroundColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(textColor, forKey: .textColor) - - - - try? container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) - - - } - - } - - /* - Model: SocialTokens - Used By: User - */ - class SocialTokens: Codable { - - public var facebook: Facebook? - - public var accountKit: Accountkit? - - public var google: Google? - - - public enum CodingKeys: String, CodingKey { - - case facebook = "facebook" - - case accountKit = "account_kit" - - case google = "google" - - } - - public init(accountKit: Accountkit?, facebook: Facebook?, google: Google?) { - - self.facebook = facebook - - self.accountKit = accountKit - - self.google = google - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - facebook = try container.decode(Facebook.self, forKey: .facebook) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - accountKit = try container.decode(Accountkit.self, forKey: .accountKit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - google = try container.decode(Google.self, forKey: .google) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(facebook, forKey: .facebook) - - - - try? container.encodeIfPresent(accountKit, forKey: .accountKit) - - - - try? container.encodeIfPresent(google, forKey: .google) - - - } - - } - - /* - Model: Facebook - Used By: User - */ - class Facebook: Codable { - - public var appId: String? - - - public enum CodingKeys: String, CodingKey { - - case appId = "app_id" - - } - - public init(appId: String?) { - - self.appId = appId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - } - - } - - /* - Model: Accountkit - Used By: User - */ - class Accountkit: Codable { - - public var appId: String? - - - public enum CodingKeys: String, CodingKey { - - case appId = "app_id" - - } - - public init(appId: String?) { - - self.appId = appId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - } - - } - - /* - Model: Google - Used By: User - */ - class Google: Codable { - - public var appId: String? - - - public enum CodingKeys: String, CodingKey { - - case appId = "app_id" - - } - - public init(appId: String?) { - - self.appId = appId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - } - - } - - /* - Model: UpdateUserRequestSchema - Used By: User - */ - class UpdateUserRequestSchema: Codable { - - public var firstName: String? - - public var lastName: String? - - public var gender: String? - - public var meta: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case firstName = "first_name" - - case lastName = "last_name" - - case gender = "gender" - - case meta = "meta" - - } - - public init(firstName: String?, gender: String?, lastName: String?, meta: [String: Any]?) { - - self.firstName = firstName - - self.lastName = lastName - - self.gender = gender - - self.meta = meta - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gender = try container.decode(String.self, forKey: .gender) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(gender, forKey: .gender) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - } - - } - - /* - Model: UserSchema - Used By: User - */ - class UserSchema: Codable { - - public var firstName: String? - - public var meta: [String: Any]? - - public var lastName: String? - - public var phoneNumbers: [PhoneNumber]? - - public var emails: [Email]? - - public var gender: String? - - public var dob: String? - - public var active: Bool? - - public var profilePicUrl: String? - - public var username: String? - - public var accountType: String? - - public var uid: String? - - public var debug: Debug? - - public var hasOldPasswordHash: Bool? - - public var id: String? - - public var createdAt: String? - - public var updatedAt: String? - - - public enum CodingKeys: String, CodingKey { - - case firstName = "first_name" - - case meta = "meta" - - case lastName = "last_name" - - case phoneNumbers = "phone_numbers" - - case emails = "emails" - - case gender = "gender" - - case dob = "dob" - - case active = "active" - - case profilePicUrl = "profile_pic_url" - - case username = "username" - - case accountType = "account_type" - - case uid = "uid" - - case debug = "debug" - - case hasOldPasswordHash = "has_old_password_hash" - - case id = "_id" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - } - - public init(accountType: String?, active: Bool?, createdAt: String?, debug: Debug?, dob: String?, emails: [Email]?, firstName: String?, gender: String?, hasOldPasswordHash: Bool?, lastName: String?, meta: [String: Any]?, phoneNumbers: [PhoneNumber]?, profilePicUrl: String?, uid: String?, updatedAt: String?, username: String?, id: String?) { - - self.firstName = firstName - - self.meta = meta - - self.lastName = lastName - - self.phoneNumbers = phoneNumbers - - self.emails = emails - - self.gender = gender - - self.dob = dob - - self.active = active - - self.profilePicUrl = profilePicUrl - - self.username = username - - self.accountType = accountType - - self.uid = uid - - self.debug = debug - - self.hasOldPasswordHash = hasOldPasswordHash - - self.id = id - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phoneNumbers = try container.decode([PhoneNumber].self, forKey: .phoneNumbers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - emails = try container.decode([Email].self, forKey: .emails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gender = try container.decode(String.self, forKey: .gender) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dob = try container.decode(String.self, forKey: .dob) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - profilePicUrl = try container.decode(String.self, forKey: .profilePicUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - username = try container.decode(String.self, forKey: .username) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - accountType = try container.decode(String.self, forKey: .accountType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - debug = try container.decode(Debug.self, forKey: .debug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasOldPasswordHash = try container.decode(Bool.self, forKey: .hasOldPasswordHash) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(phoneNumbers, forKey: .phoneNumbers) - - - - try? container.encodeIfPresent(emails, forKey: .emails) - - - - try? container.encodeIfPresent(gender, forKey: .gender) - - - - try? container.encodeIfPresent(dob, forKey: .dob) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(profilePicUrl, forKey: .profilePicUrl) - - - - try? container.encodeIfPresent(username, forKey: .username) - - - - try? container.encodeIfPresent(accountType, forKey: .accountType) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(debug, forKey: .debug) - - - - try? container.encodeIfPresent(hasOldPasswordHash, forKey: .hasOldPasswordHash) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - } - - } - - - - /* - Model: ApplicationLegal - Used By: Content - */ - class ApplicationLegal: Codable { - - public var application: String? - - public var tnc: String? - - public var policy: String? - - public var shipping: String? - - public var faq: [ApplicationLegalFAQ]? - - public var id: String? - - public var updatedAt: String? - - public var createdAt: String? - - - public enum CodingKeys: String, CodingKey { - - case application = "application" - - case tnc = "tnc" - - case policy = "policy" - - case shipping = "shipping" - - case faq = "faq" - - case id = "_id" - - case updatedAt = "updated_at" - - case createdAt = "created_at" - - } - - public init(application: String?, createdAt: String?, faq: [ApplicationLegalFAQ]?, policy: String?, shipping: String?, tnc: String?, updatedAt: String?, id: String?) { - - self.application = application - - self.tnc = tnc - - self.policy = policy - - self.shipping = shipping - - self.faq = faq - - self.id = id - - self.updatedAt = updatedAt - - self.createdAt = createdAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tnc = try container.decode(String.self, forKey: .tnc) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - policy = try container.decode(String.self, forKey: .policy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shipping = try container.decode(String.self, forKey: .shipping) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - faq = try container.decode([ApplicationLegalFAQ].self, forKey: .faq) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(tnc, forKey: .tnc) - - - - try? container.encodeIfPresent(policy, forKey: .policy) - - - - try? container.encodeIfPresent(shipping, forKey: .shipping) - - - - try? container.encodeIfPresent(faq, forKey: .faq) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - } - - } - - /* - Model: ApplicationLegalFAQ - Used By: Content - */ - class ApplicationLegalFAQ: Codable { - - public var question: String? - - public var answer: String? - - - public enum CodingKeys: String, CodingKey { - - case question = "question" - - case answer = "answer" - - } - - public init(answer: String?, question: String?) { - - self.question = question - - self.answer = answer - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - question = try container.decode(String.self, forKey: .question) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - answer = try container.decode(String.self, forKey: .answer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(question, forKey: .question) - - - - try? container.encodeIfPresent(answer, forKey: .answer) - - - } - - } - - /* - Model: SeoComponent - Used By: Content - */ - class SeoComponent: Codable { - - public var seo: SeoSchema? - - - public enum CodingKeys: String, CodingKey { - - case seo = "seo" - - } - - public init(seo: SeoSchema?) { - - self.seo = seo - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - seo = try container.decode(SeoSchema.self, forKey: .seo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(seo, forKey: .seo) - - - } - - } - - /* - Model: SeoSchema - Used By: Content - */ - class SeoSchema: Codable { - - public var app: String? - - public var id: String? - - public var robotsTxt: String? - - public var sitemapEnabled: Bool? - - public var customMetaTags: [CustomMetaTag]? - - public var details: Detail? - - public var createdAt: String? - - public var updatedAt: String? - - - public enum CodingKeys: String, CodingKey { - - case app = "app" - - case id = "_id" - - case robotsTxt = "robots_txt" - - case sitemapEnabled = "sitemap_enabled" - - case customMetaTags = "custom_meta_tags" - - case details = "details" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - } - - public init(app: String?, createdAt: String?, customMetaTags: [CustomMetaTag]?, details: Detail?, robotsTxt: String?, sitemapEnabled: Bool?, updatedAt: String?, id: String?) { - - self.app = app - - self.id = id - - self.robotsTxt = robotsTxt - - self.sitemapEnabled = sitemapEnabled - - self.customMetaTags = customMetaTags - - self.details = details - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - app = try container.decode(String.self, forKey: .app) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - robotsTxt = try container.decode(String.self, forKey: .robotsTxt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sitemapEnabled = try container.decode(Bool.self, forKey: .sitemapEnabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customMetaTags = try container.decode([CustomMetaTag].self, forKey: .customMetaTags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - details = try container.decode(Detail.self, forKey: .details) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(app, forKey: .app) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(robotsTxt, forKey: .robotsTxt) - - - - try? container.encodeIfPresent(sitemapEnabled, forKey: .sitemapEnabled) - - - - try? container.encodeIfPresent(customMetaTags, forKey: .customMetaTags) - - - - try? container.encodeIfPresent(details, forKey: .details) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - } - - } - - /* - Model: CustomMetaTag - Used By: Content - */ - class CustomMetaTag: Codable { - - public var name: String? - - public var content: String? - - public var id: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case content = "content" - - case id = "_id" - - } - - public init(content: String?, name: String?, id: String?) { - - self.name = name - - self.content = content - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode(String.self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: Detail - Used By: Content - */ - class Detail: Codable { - - public var title: String? - - public var description: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case description = "description" - - } - - public init(description: String?, title: String?) { - - self.title = title - - self.description = description - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - } - - } - - /* - Model: AnnouncementPageSchema - Used By: Content - */ - class AnnouncementPageSchema: Codable { - - public var pageSlug: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case pageSlug = "page_slug" - - case type = "type" - - } - - public init(pageSlug: String?, type: String?) { - - self.pageSlug = pageSlug - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pageSlug = try container.decode(String.self, forKey: .pageSlug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pageSlug, forKey: .pageSlug) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: EditorMeta - Used By: Content - */ - class EditorMeta: Codable { - - public var foregroundColor: String? - - public var backgroundColor: String? - - public var contentType: String? - - public var content: String? - - - public enum CodingKeys: String, CodingKey { - - case foregroundColor = "foreground_color" - - case backgroundColor = "background_color" - - case contentType = "content_type" - - case content = "content" - - } - - public init(backgroundColor: String?, content: String?, contentType: String?, foregroundColor: String?) { - - self.foregroundColor = foregroundColor - - self.backgroundColor = backgroundColor - - self.contentType = contentType - - self.content = content - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - foregroundColor = try container.decode(String.self, forKey: .foregroundColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - backgroundColor = try container.decode(String.self, forKey: .backgroundColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contentType = try container.decode(String.self, forKey: .contentType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode(String.self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(foregroundColor, forKey: .foregroundColor) - - - - try? container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) - - - - try? container.encodeIfPresent(contentType, forKey: .contentType) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - } - - } - - /* - Model: AnnouncementAuthorSchema - Used By: Content - */ - class AnnouncementAuthorSchema: Codable { - - public var createdBy: String? - - public var modifiedBy: String? - - - public enum CodingKeys: String, CodingKey { - - case createdBy = "created_by" - - case modifiedBy = "modified_by" - - } - - public init(createdBy: String?, modifiedBy: String?) { - - self.createdBy = createdBy - - self.modifiedBy = modifiedBy - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdBy = try container.decode(String.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode(String.self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - } - - } - - /* - Model: AdminAnnouncementSchema - Used By: Content - */ - class AdminAnnouncementSchema: Codable { - - public var id: String? - - public var platforms: [String]? - - public var title: String? - - public var announcement: String? - - public var pages: [AnnouncementPageSchema]? - - public var editorMeta: EditorMeta? - - public var author: AnnouncementAuthorSchema? - - public var createdAt: String? - - public var app: String? - - public var modifiedAt: String? - - public var schedule: ScheduleSchema? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case platforms = "platforms" - - case title = "title" - - case announcement = "announcement" - - case pages = "pages" - - case editorMeta = "editor_meta" - - case author = "author" - - case createdAt = "created_at" - - case app = "app" - - case modifiedAt = "modified_at" - - case schedule = "_schedule" - - } - - public init(announcement: String?, app: String?, author: AnnouncementAuthorSchema?, createdAt: String?, editorMeta: EditorMeta?, modifiedAt: String?, pages: [AnnouncementPageSchema]?, platforms: [String]?, title: String?, id: String?, schedule: ScheduleSchema?) { - - self.id = id - - self.platforms = platforms - - self.title = title - - self.announcement = announcement - - self.pages = pages - - self.editorMeta = editorMeta - - self.author = author - - self.createdAt = createdAt - - self.app = app - - self.modifiedAt = modifiedAt - - self.schedule = schedule - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platforms = try container.decode([String].self, forKey: .platforms) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - announcement = try container.decode(String.self, forKey: .announcement) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pages = try container.decode([AnnouncementPageSchema].self, forKey: .pages) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - editorMeta = try container.decode(EditorMeta.self, forKey: .editorMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - author = try container.decode(AnnouncementAuthorSchema.self, forKey: .author) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - app = try container.decode(String.self, forKey: .app) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedAt = try container.decode(String.self, forKey: .modifiedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode(ScheduleSchema.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(platforms, forKey: .platforms) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(announcement, forKey: .announcement) - - - - try? container.encodeIfPresent(pages, forKey: .pages) - - - - try? container.encodeIfPresent(editorMeta, forKey: .editorMeta) - - - - try? container.encodeIfPresent(author, forKey: .author) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(app, forKey: .app) - - - - try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - } - - } - - /* - Model: ScheduleSchema - Used By: Content - */ - class ScheduleSchema: Codable { - - public var cron: String? - - public var start: String? - - public var end: String? - - public var duration: Double? - - public var nextSchedule: [NextSchedule]? - - - public enum CodingKeys: String, CodingKey { - - case cron = "cron" - - case start = "start" - - case end = "end" - - case duration = "duration" - - case nextSchedule = "next_schedule" - - } - - public init(cron: String?, duration: Double?, end: String?, nextSchedule: [NextSchedule]?, start: String?) { - - self.cron = cron - - self.start = start - - self.end = end - - self.duration = duration - - self.nextSchedule = nextSchedule - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cron = try container.decode(String.self, forKey: .cron) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - start = try container.decode(String.self, forKey: .start) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - end = try container.decode(String.self, forKey: .end) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - duration = try container.decode(Double.self, forKey: .duration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - nextSchedule = try container.decode([NextSchedule].self, forKey: .nextSchedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cron, forKey: .cron) - - - - try? container.encodeIfPresent(start, forKey: .start) - - - - try? container.encodeIfPresent(end, forKey: .end) - - - - try? container.encodeIfPresent(duration, forKey: .duration) - - - - try? container.encodeIfPresent(nextSchedule, forKey: .nextSchedule) - - - } - - } - - /* - Model: NextSchedule - Used By: Content - */ - class NextSchedule: Codable { - - public var start: String? - - public var end: String? - - - public enum CodingKeys: String, CodingKey { - - case start = "start" - - case end = "end" - - } - - public init(end: String?, start: String?) { - - self.start = start - - self.end = end - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - start = try container.decode(String.self, forKey: .start) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - end = try container.decode(String.self, forKey: .end) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(start, forKey: .start) - - - - try? container.encodeIfPresent(end, forKey: .end) - - - } - - } - - /* - Model: AnnouncementSchema - Used By: Content - */ - class AnnouncementSchema: Codable { - - public var announcement: String? - - public var schedule: ScheduleStartSchema? - - - public enum CodingKeys: String, CodingKey { - - case announcement = "announcement" - - case schedule = "schedule" - - } - - public init(announcement: String?, schedule: ScheduleStartSchema?) { - - self.announcement = announcement - - self.schedule = schedule - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - announcement = try container.decode(String.self, forKey: .announcement) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode(ScheduleStartSchema.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(announcement, forKey: .announcement) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - } - - } - - /* - Model: ScheduleStartSchema - Used By: Content - */ - class ScheduleStartSchema: Codable { - - public var start: String? - - public var end: String? - - - public enum CodingKeys: String, CodingKey { - - case start = "start" - - case end = "end" - - } - - public init(end: String?, start: String?) { - - self.start = start - - self.end = end - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - start = try container.decode(String.self, forKey: .start) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - end = try container.decode(String.self, forKey: .end) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(start, forKey: .start) - - - - try? container.encodeIfPresent(end, forKey: .end) - - - } - - } - - /* - Model: BlogGetResponse - Used By: Content - */ - class BlogGetResponse: Codable { - - public var items: [BlogSchema]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [BlogSchema]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([BlogSchema].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: ResourceContent - Used By: Content - */ - class ResourceContent: Codable { - - public var type: String? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case value = "value" - - } - - public init(type: String?, value: String?) { - - self.type = type - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: Asset - Used By: Content - */ - class Asset: Codable { - - public var aspectRatio: String? - - public var id: String? - - public var secureUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case aspectRatio = "aspect_ratio" - - case id = "id" - - case secureUrl = "secure_url" - - } - - public init(aspectRatio: String?, id: String?, secureUrl: String?) { - - self.aspectRatio = aspectRatio - - self.id = id - - self.secureUrl = secureUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - aspectRatio = try container.decode(String.self, forKey: .aspectRatio) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - secureUrl = try container.decode(String.self, forKey: .secureUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) - - - } - - } - - /* - Model: Author - Used By: Content - */ - class Author: Codable { - - public var designation: String? - - public var id: String? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case designation = "designation" - - case id = "id" - - case name = "name" - - } - - public init(designation: String?, id: String?, name: String?) { - - self.designation = designation - - self.id = id - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - designation = try container.decode(String.self, forKey: .designation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(designation, forKey: .designation) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: BlogSchema - Used By: Content - */ - class BlogSchema: Codable { - - public var id: String? - - public var customJson: [String: Any]? - - public var application: String? - - public var archived: Bool? - - public var author: Author? - - public var content: [ResourceContent]? - - public var featureImage: Asset? - - public var published: Bool? - - public var readingTime: String? - - public var slug: String? - - public var tags: [String]? - - public var seo: SEO? - - public var schedule: CronSchedule? - - public var title: String? - - public var dateMeta: DateMeta? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case customJson = "_custom_json" - - case application = "application" - - case archived = "archived" - - case author = "author" - - case content = "content" - - case featureImage = "feature_image" - - case published = "published" - - case readingTime = "reading_time" - - case slug = "slug" - - case tags = "tags" - - case seo = "seo" - - case schedule = "_schedule" - - case title = "title" - - case dateMeta = "date_meta" - - } - - public init(application: String?, archived: Bool?, author: Author?, content: [ResourceContent]?, dateMeta: DateMeta?, featureImage: Asset?, published: Bool?, readingTime: String?, seo: SEO?, slug: String?, tags: [String]?, title: String?, customJson: [String: Any]?, id: String?, schedule: CronSchedule?) { - - self.id = id - - self.customJson = customJson - - self.application = application - - self.archived = archived - - self.author = author - - self.content = content - - self.featureImage = featureImage - - self.published = published - - self.readingTime = readingTime - - self.slug = slug - - self.tags = tags - - self.seo = seo - - self.schedule = schedule - - self.title = title - - self.dateMeta = dateMeta - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archived = try container.decode(Bool.self, forKey: .archived) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - author = try container.decode(Author.self, forKey: .author) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode([ResourceContent].self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - featureImage = try container.decode(Asset.self, forKey: .featureImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - readingTime = try container.decode(String.self, forKey: .readingTime) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - seo = try container.decode(SEO.self, forKey: .seo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode(CronSchedule.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(archived, forKey: .archived) - - - - try? container.encodeIfPresent(author, forKey: .author) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - - try? container.encodeIfPresent(featureImage, forKey: .featureImage) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(readingTime, forKey: .readingTime) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(seo, forKey: .seo) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - } - - } - - /* - Model: SEO - Used By: Content - */ - class SEO: Codable { - - public var description: String? - - public var image: SEOImage? - - public var title: String? - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case image = "image" - - case title = "title" - - } - - public init(description: String?, image: SEOImage?, title: String?) { - - self.description = description - - self.image = image - - self.title = title - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - image = try container.decode(SEOImage.self, forKey: .image) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(image, forKey: .image) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - } - - } - - /* - Model: SEOImage - Used By: Content - */ - class SEOImage: Codable { - - public var url: String? - - - public enum CodingKeys: String, CodingKey { - - case url = "url" - - } - - public init(url: String?) { - - self.url = url - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(url, forKey: .url) - - - } - - } - - /* - Model: DateMeta - Used By: Content - */ - class DateMeta: Codable { - - public var createdOn: String? - - public var modifiedOn: String? - - - public enum CodingKeys: String, CodingKey { - - case createdOn = "created_on" - - case modifiedOn = "modified_on" - - } - - public init(createdOn: String?, modifiedOn: String?) { - - self.createdOn = createdOn - - self.modifiedOn = modifiedOn - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - } - - } - - /* - Model: BlogRequest - Used By: Content - */ - class BlogRequest: Codable { - - public var application: String? - - public var customJson: [String: Any]? - - public var author: Author? - - public var content: [ResourceContent]? - - public var featureImage: Asset? - - public var published: Bool? - - public var readingTime: String? - - public var slug: String? - - public var tags: [String]? - - public var title: String? - - public var seo: SEO? - - public var schedule: CronSchedule? - - - public enum CodingKeys: String, CodingKey { - - case application = "application" - - case customJson = "_custom_json" - - case author = "author" - - case content = "content" - - case featureImage = "feature_image" - - case published = "published" - - case readingTime = "reading_time" - - case slug = "slug" - - case tags = "tags" - - case title = "title" - - case seo = "seo" - - case schedule = "_schedule" - - } - - public init(application: String?, author: Author?, content: [ResourceContent]?, featureImage: Asset?, published: Bool?, readingTime: String?, seo: SEO?, slug: String?, tags: [String]?, title: String?, customJson: [String: Any]?, schedule: CronSchedule?) { - - self.application = application - - self.customJson = customJson - - self.author = author - - self.content = content - - self.featureImage = featureImage - - self.published = published - - self.readingTime = readingTime - - self.slug = slug - - self.tags = tags - - self.title = title - - self.seo = seo - - self.schedule = schedule - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - author = try container.decode(Author.self, forKey: .author) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode([ResourceContent].self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - featureImage = try container.decode(Asset.self, forKey: .featureImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - readingTime = try container.decode(String.self, forKey: .readingTime) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - seo = try container.decode(SEO.self, forKey: .seo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode(CronSchedule.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(author, forKey: .author) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - - try? container.encodeIfPresent(featureImage, forKey: .featureImage) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(readingTime, forKey: .readingTime) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(seo, forKey: .seo) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - } - - } - - /* - Model: GetAnnouncementListSchema - Used By: Content - */ - class GetAnnouncementListSchema: Codable { - - public var items: [AdminAnnouncementSchema]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [AdminAnnouncementSchema]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([AdminAnnouncementSchema].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: CreateAnnouncementSchema - Used By: Content - */ - class CreateAnnouncementSchema: Codable { - - public var message: String? - - public var data: AdminAnnouncementSchema? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - case data = "data" - - } - - public init(data: AdminAnnouncementSchema?, message: String?) { - - self.message = message - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode(AdminAnnouncementSchema.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: Navigation - Used By: Content - */ - class Navigation: Codable { - - public var name: String? - - public var slug: String? - - public var orientation: String? - - public var createdBy: CreatedBySchema? - - public var dateMeta: DateMeta? - - public var id: String? - - public var position: String? - - public var application: String? - - public var platform: String? - - public var navigation: NavigationReference? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case slug = "slug" - - case orientation = "orientation" - - case createdBy = "created_by" - - case dateMeta = "date_meta" - - case id = "_id" - - case position = "position" - - case application = "application" - - case platform = "platform" - - case navigation = "navigation" - - } - - public init(application: String?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, name: String?, navigation: NavigationReference?, orientation: String?, platform: String?, position: String?, slug: String?, id: String?) { - - self.name = name - - self.slug = slug - - self.orientation = orientation - - self.createdBy = createdBy - - self.dateMeta = dateMeta - - self.id = id - - self.position = position - - self.application = application - - self.platform = platform - - self.navigation = navigation - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orientation = try container.decode(String.self, forKey: .orientation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - position = try container.decode(String.self, forKey: .position) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode(String.self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - navigation = try container.decode(NavigationReference.self, forKey: .navigation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(orientation, forKey: .orientation) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(position, forKey: .position) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - - try? container.encodeIfPresent(navigation, forKey: .navigation) - - - } - - } - - /* - Model: LocaleLanguage - Used By: Content - */ - class LocaleLanguage: Codable { - - public var hi: Language? - - public var ar: Language? - - public var enUs: Language? - - - public enum CodingKeys: String, CodingKey { - - case hi = "hi" - - case ar = "ar" - - case enUs = "en_us" - - } - - public init(ar: Language?, enUs: Language?, hi: Language?) { - - self.hi = hi - - self.ar = ar - - self.enUs = enUs - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - hi = try container.decode(Language.self, forKey: .hi) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ar = try container.decode(Language.self, forKey: .ar) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enUs = try container.decode(Language.self, forKey: .enUs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(hi, forKey: .hi) - - - - try? container.encodeIfPresent(ar, forKey: .ar) - - - - try? container.encodeIfPresent(enUs, forKey: .enUs) - - - } - - } - - /* - Model: Language - Used By: Content - */ - class Language: Codable { - - public var display: String? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - } - - public init(display: String?) { - - self.display = display - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - } - - } - - /* - Model: Action - Used By: Content - */ - class Action: Codable { - - public var page: ActionPage? - - public var popup: ActionPage? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case page = "page" - - case popup = "popup" - - case type = "type" - - } - - public init(page: ActionPage?, popup: ActionPage?, type: String?) { - - self.page = page - - self.popup = popup - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - page = try container.decode(ActionPage.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - popup = try container.decode(ActionPage.self, forKey: .popup) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(popup, forKey: .popup) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ActionPage - Used By: Content - */ - class ActionPage: Codable { - - public var params: [String: [String]]? - - public var query: [String: [String]]? - - public var url: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case params = "params" - - case query = "query" - - case url = "url" - - case type = "type" - - } - - public init(params: [String: [String]]?, query: [String: [String]]?, type: String?, url: String?) { - - self.params = params - - self.query = query - - self.url = url - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - params = try container.decode([String: [String]].self, forKey: .params) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - query = try container.decode([String: [String]].self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(params, forKey: .params) - - - - try? container.encodeIfPresent(query, forKey: .query) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: NavigationReference - Used By: Content - */ - class NavigationReference: Codable { - - public var acl: [String]? - - public var tags: [String]? - - public var localeLanguage: LocaleLanguage? - - public var image: String? - - public var type: String? - - public var action: Action? - - public var active: Bool? - - public var display: String? - - public var sortOrder: Int? - - public var subNavigation: [NavigationReference]? - - - public enum CodingKeys: String, CodingKey { - - case acl = "acl" - - case tags = "tags" - - case localeLanguage = "_locale_language" - - case image = "image" - - case type = "type" - - case action = "action" - - case active = "active" - - case display = "display" - - case sortOrder = "sort_order" - - case subNavigation = "sub_navigation" - - } - - public init(acl: [String]?, action: Action?, active: Bool?, display: String?, image: String?, sortOrder: Int?, subNavigation: [NavigationReference]?, tags: [String]?, type: String?, localeLanguage: LocaleLanguage?) { - - self.acl = acl - - self.tags = tags - - self.localeLanguage = localeLanguage - - self.image = image - - self.type = type - - self.action = action - - self.active = active - - self.display = display - - self.sortOrder = sortOrder - - self.subNavigation = subNavigation - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - acl = try container.decode([String].self, forKey: .acl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - localeLanguage = try container.decode(LocaleLanguage.self, forKey: .localeLanguage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - image = try container.decode(String.self, forKey: .image) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(Action.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sortOrder = try container.decode(Int.self, forKey: .sortOrder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subNavigation = try container.decode([NavigationReference].self, forKey: .subNavigation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(acl, forKey: .acl) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(localeLanguage, forKey: .localeLanguage) - - - - try? container.encodeIfPresent(image, forKey: .image) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(sortOrder, forKey: .sortOrder) - - - - try? container.encodeIfPresent(subNavigation, forKey: .subNavigation) - - - } - - } - - /* - Model: LandingPage - Used By: Content - */ - class LandingPage: Codable { - - public var data: LandingPageSchema? - - public var success: Bool? - - - public enum CodingKeys: String, CodingKey { - - case data = "data" - - case success = "success" - - } - - public init(data: LandingPageSchema?, success: Bool?) { - - self.data = data - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - data = try container.decode(LandingPageSchema.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(data, forKey: .data) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: ConfigurationSchema - Used By: Content - */ - class ConfigurationSchema: Codable { - - public var sleepTime: Int? - - public var startOnLaunch: Bool? - - public var duration: Int? - - public var slideDirection: String? - - - public enum CodingKeys: String, CodingKey { - - case sleepTime = "sleep_time" - - case startOnLaunch = "start_on_launch" - - case duration = "duration" - - case slideDirection = "slide_direction" - - } - - public init(duration: Int?, sleepTime: Int?, slideDirection: String?, startOnLaunch: Bool?) { - - self.sleepTime = sleepTime - - self.startOnLaunch = startOnLaunch - - self.duration = duration - - self.slideDirection = slideDirection - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - sleepTime = try container.decode(Int.self, forKey: .sleepTime) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - startOnLaunch = try container.decode(Bool.self, forKey: .startOnLaunch) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - duration = try container.decode(Int.self, forKey: .duration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slideDirection = try container.decode(String.self, forKey: .slideDirection) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(sleepTime, forKey: .sleepTime) - - - - try? container.encodeIfPresent(startOnLaunch, forKey: .startOnLaunch) - - - - try? container.encodeIfPresent(duration, forKey: .duration) - - - - try? container.encodeIfPresent(slideDirection, forKey: .slideDirection) - - - } - - } - - /* - Model: SlideshowMedia - Used By: Content - */ - class SlideshowMedia: Codable { - - public var type: String? - - public var url: String? - - public var bgColor: String? - - public var duration: Int? - - public var autoDecideDuration: Bool? - - public var action: Action? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case url = "url" - - case bgColor = "bg_color" - - case duration = "duration" - - case autoDecideDuration = "auto_decide_duration" - - case action = "action" - - } - - public init(action: Action?, autoDecideDuration: Bool?, bgColor: String?, duration: Int?, type: String?, url: String?) { - - self.type = type - - self.url = url - - self.bgColor = bgColor - - self.duration = duration - - self.autoDecideDuration = autoDecideDuration - - self.action = action - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bgColor = try container.decode(String.self, forKey: .bgColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - duration = try container.decode(Int.self, forKey: .duration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - autoDecideDuration = try container.decode(Bool.self, forKey: .autoDecideDuration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(Action.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(bgColor, forKey: .bgColor) - - - - try? container.encodeIfPresent(duration, forKey: .duration) - - - - try? container.encodeIfPresent(autoDecideDuration, forKey: .autoDecideDuration) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - } - - } - - /* - Model: Slideshow - Used By: Content - */ - class Slideshow: Codable { - - public var data: SlideshowSchema? - - public var success: Bool? - - - public enum CodingKeys: String, CodingKey { - - case data = "data" - - case success = "success" - - } - - public init(data: SlideshowSchema?, success: Bool?) { - - self.data = data - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - data = try container.decode(SlideshowSchema.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(data, forKey: .data) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: AnnouncementsResponseSchema - Used By: Content - */ - class AnnouncementsResponseSchema: Codable { - - public var announcements: [String: [AnnouncementSchema]]? - - public var refreshRate: Int? - - public var refreshPages: [String]? - - - public enum CodingKeys: String, CodingKey { - - case announcements = "announcements" - - case refreshRate = "refresh_rate" - - case refreshPages = "refresh_pages" - - } - - public init(announcements: [String: [AnnouncementSchema]]?, refreshPages: [String]?, refreshRate: Int?) { - - self.announcements = announcements - - self.refreshRate = refreshRate - - self.refreshPages = refreshPages - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - announcements = try container.decode([String: [AnnouncementSchema]].self, forKey: .announcements) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refreshRate = try container.decode(Int.self, forKey: .refreshRate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refreshPages = try container.decode([String].self, forKey: .refreshPages) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(announcements, forKey: .announcements) - - - - try? container.encodeIfPresent(refreshRate, forKey: .refreshRate) - - - - try? container.encodeIfPresent(refreshPages, forKey: .refreshPages) - - - } - - } - - /* - Model: FaqResponseSchema - Used By: Content - */ - class FaqResponseSchema: Codable { - - public var faqs: [FaqSchema]? - - - public enum CodingKeys: String, CodingKey { - - case faqs = "faqs" - - } - - public init(faqs: [FaqSchema]?) { - - self.faqs = faqs - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - faqs = try container.decode([FaqSchema].self, forKey: .faqs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(faqs, forKey: .faqs) - - - } - - } - - /* - Model: UpdateHandpickedSchema - Used By: Content - */ - class UpdateHandpickedSchema: Codable { - - public var tag: HandpickedTagSchema? - - - public enum CodingKeys: String, CodingKey { - - case tag = "tag" - - } - - public init(tag: HandpickedTagSchema?) { - - self.tag = tag - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - tag = try container.decode(HandpickedTagSchema.self, forKey: .tag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(tag, forKey: .tag) - - - } - - } - - /* - Model: HandpickedTagSchema - Used By: Content - */ - class HandpickedTagSchema: Codable { - - public var position: String? - - public var attributes: [String: Any]? - - public var name: String? - - public var url: String? - - public var type: String? - - public var subType: String? - - public var content: String? - - - public enum CodingKeys: String, CodingKey { - - case position = "position" - - case attributes = "attributes" - - case name = "name" - - case url = "url" - - case type = "type" - - case subType = "sub_type" - - case content = "content" - - } - - public init(attributes: [String: Any]?, content: String?, name: String?, position: String?, subType: String?, type: String?, url: String?) { - - self.position = position - - self.attributes = attributes - - self.name = name - - self.url = url - - self.type = type - - self.subType = subType - - self.content = content - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - position = try container.decode(String.self, forKey: .position) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attributes = try container.decode([String: Any].self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subType = try container.decode(String.self, forKey: .subType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode(String.self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(position, forKey: .position) - - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(subType, forKey: .subType) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - } - - } - - /* - Model: RemoveHandpickedSchema - Used By: Content - */ - class RemoveHandpickedSchema: Codable { - - public var tags: [String]? - - - public enum CodingKeys: String, CodingKey { - - case tags = "tags" - - } - - public init(tags: [String]?) { - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: CreateTagSchema - Used By: Content - */ - class CreateTagSchema: Codable { - - public var name: String? - - public var subType: String? - - public var id: String? - - public var type: String? - - public var url: String? - - public var position: String? - - public var attributes: [String: Any]? - - public var content: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case subType = "sub_type" - - case id = "_id" - - case type = "type" - - case url = "url" - - case position = "position" - - case attributes = "attributes" - - case content = "content" - - } - - public init(attributes: [String: Any]?, content: String?, name: String?, position: String?, subType: String?, type: String?, url: String?, id: String?) { - - self.name = name - - self.subType = subType - - self.id = id - - self.type = type - - self.url = url - - self.position = position - - self.attributes = attributes - - self.content = content - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subType = try container.decode(String.self, forKey: .subType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - position = try container.decode(String.self, forKey: .position) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attributes = try container.decode([String: Any].self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode(String.self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(subType, forKey: .subType) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(position, forKey: .position) - - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - } - - } - - /* - Model: CreateTagRequestSchema - Used By: Content - */ - class CreateTagRequestSchema: Codable { - - public var tags: [CreateTagSchema]? - - - public enum CodingKeys: String, CodingKey { - - case tags = "tags" - - } - - public init(tags: [CreateTagSchema]?) { - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - tags = try container.decode([CreateTagSchema].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: TagDeleteSuccessResponse - Used By: Content - */ - class TagDeleteSuccessResponse: Codable { - - public var success: Bool? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - } - - public init(success: Bool?) { - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: APIError - Used By: Content - */ - class APIError: Codable { - - public var message: String? - - public var status: Double? - - public var code: String? - - public var exception: String? - - public var info: String? - - public var requestId: String? - - public var stackTrace: String? - - public var meta: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - case status = "status" - - case code = "code" - - case exception = "exception" - - case info = "info" - - case requestId = "request_id" - - case stackTrace = "stack_trace" - - case meta = "meta" - - } - - public init(code: String?, exception: String?, info: String?, message: String?, meta: [String: Any]?, requestId: String?, stackTrace: String?, status: Double?) { - - self.message = message - - self.status = status - - self.code = code - - self.exception = exception - - self.info = info - - self.requestId = requestId - - self.stackTrace = stackTrace - - self.meta = meta - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(Double.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - exception = try container.decode(String.self, forKey: .exception) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - info = try container.decode(String.self, forKey: .info) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requestId = try container.decode(String.self, forKey: .requestId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stackTrace = try container.decode(String.self, forKey: .stackTrace) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(exception, forKey: .exception) - - - - try? container.encodeIfPresent(info, forKey: .info) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(stackTrace, forKey: .stackTrace) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - } - - } - - /* - Model: CategorySchema - Used By: Content - */ - class CategorySchema: Codable { - - public var index: Int? - - public var title: String? - - public var description: String? - - public var children: [String]? - - public var id: String? - - public var slug: String? - - public var application: String? - - public var iconUrl: String? - - public var customJson: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case index = "index" - - case title = "title" - - case description = "description" - - case children = "children" - - case id = "_id" - - case slug = "slug" - - case application = "application" - - case iconUrl = "icon_url" - - case customJson = "_custom_json" - - } - - public init(application: String?, children: [String]?, description: String?, iconUrl: String?, index: Int?, slug: String?, title: String?, customJson: [String: Any]?, id: String?) { - - self.index = index - - self.title = title - - self.description = description - - self.children = children - - self.id = id - - self.slug = slug - - self.application = application - - self.iconUrl = iconUrl - - self.customJson = customJson - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - index = try container.decode(Int.self, forKey: .index) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - children = try container.decode([String].self, forKey: .children) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - iconUrl = try container.decode(String.self, forKey: .iconUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(index, forKey: .index) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(children, forKey: .children) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(iconUrl, forKey: .iconUrl) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - } - - } - - /* - Model: ChildrenSchema - Used By: Content - */ - class ChildrenSchema: Codable { - - public var question: String? - - public var answer: String? - - public var slug: String? - - public var application: String? - - public var id: String? - - - public enum CodingKeys: String, CodingKey { - - case question = "question" - - case answer = "answer" - - case slug = "slug" - - case application = "application" - - case id = "_id" - - } - - public init(answer: String?, application: String?, question: String?, slug: String?, id: String?) { - - self.question = question - - self.answer = answer - - self.slug = slug - - self.application = application - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - question = try container.decode(String.self, forKey: .question) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - answer = try container.decode(String.self, forKey: .answer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(question, forKey: .question) - - - - try? container.encodeIfPresent(answer, forKey: .answer) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: CategoryRequestSchema - Used By: Content - */ - class CategoryRequestSchema: Codable { - - public var slug: String? - - public var title: String? - - - public enum CodingKeys: String, CodingKey { - - case slug = "slug" - - case title = "title" - - } - - public init(slug: String?, title: String?) { - - self.slug = slug - - self.title = title - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - } - - } - - /* - Model: FAQCategorySchema - Used By: Content - */ - class FAQCategorySchema: Codable { - - public var index: Int? - - public var title: String? - - public var description: String? - - public var children: [ChildrenSchema]? - - public var id: String? - - public var slug: String? - - public var application: String? - - public var iconUrl: String? - - public var customJson: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case index = "index" - - case title = "title" - - case description = "description" - - case children = "children" - - case id = "_id" - - case slug = "slug" - - case application = "application" - - case iconUrl = "icon_url" - - case customJson = "_custom_json" - - } - - public init(application: String?, children: [ChildrenSchema]?, description: String?, iconUrl: String?, index: Int?, slug: String?, title: String?, customJson: [String: Any]?, id: String?) { - - self.index = index - - self.title = title - - self.description = description - - self.children = children - - self.id = id - - self.slug = slug - - self.application = application - - self.iconUrl = iconUrl - - self.customJson = customJson - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - index = try container.decode(Int.self, forKey: .index) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - children = try container.decode([ChildrenSchema].self, forKey: .children) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - iconUrl = try container.decode(String.self, forKey: .iconUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(index, forKey: .index) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(children, forKey: .children) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(iconUrl, forKey: .iconUrl) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - } - - } - - /* - Model: FaqSchema - Used By: Content - */ - class FaqSchema: Codable { - - public var slug: String? - - public var application: String? - - public var id: String? - - public var question: String? - - public var answer: String? - - - public enum CodingKeys: String, CodingKey { - - case slug = "slug" - - case application = "application" - - case id = "_id" - - case question = "question" - - case answer = "answer" - - } - - public init(answer: String?, application: String?, question: String?, slug: String?, id: String?) { - - self.slug = slug - - self.application = application - - self.id = id - - self.question = question - - self.answer = answer - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - question = try container.decode(String.self, forKey: .question) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - answer = try container.decode(String.self, forKey: .answer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(question, forKey: .question) - - - - try? container.encodeIfPresent(answer, forKey: .answer) - - - } - - } - - /* - Model: FAQ - Used By: Content - */ - class FAQ: Codable { - - public var slug: String? - - public var question: String? - - public var answer: String? - - - public enum CodingKeys: String, CodingKey { - - case slug = "slug" - - case question = "question" - - case answer = "answer" - - } - - public init(answer: String?, question: String?, slug: String?) { - - self.slug = slug - - self.question = question - - self.answer = answer - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - question = try container.decode(String.self, forKey: .question) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - answer = try container.decode(String.self, forKey: .answer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(question, forKey: .question) - - - - try? container.encodeIfPresent(answer, forKey: .answer) - - - } - - } - - /* - Model: CreateFaqResponseSchema - Used By: Content - */ - class CreateFaqResponseSchema: Codable { - - public var faq: FaqSchema? - - - public enum CodingKeys: String, CodingKey { - - case faq = "faq" - - } - - public init(faq: FaqSchema?) { - - self.faq = faq - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - faq = try container.decode(FaqSchema.self, forKey: .faq) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(faq, forKey: .faq) - - - } - - } - - /* - Model: CreateFaqSchema - Used By: Content - */ - class CreateFaqSchema: Codable { - - public var faq: FAQ? - - - public enum CodingKeys: String, CodingKey { - - case faq = "faq" - - } - - public init(faq: FAQ?) { - - self.faq = faq - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - faq = try container.decode(FAQ.self, forKey: .faq) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(faq, forKey: .faq) - - - } - - } - - /* - Model: GetFaqSchema - Used By: Content - */ - class GetFaqSchema: Codable { - - public var faqs: [FaqSchema]? - - - public enum CodingKeys: String, CodingKey { - - case faqs = "faqs" - - } - - public init(faqs: [FaqSchema]?) { - - self.faqs = faqs - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - faqs = try container.decode([FaqSchema].self, forKey: .faqs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(faqs, forKey: .faqs) - - - } - - } - - /* - Model: UpdateFaqCategoryRequestSchema - Used By: Content - */ - class UpdateFaqCategoryRequestSchema: Codable { - - public var category: CategorySchema? - - - public enum CodingKeys: String, CodingKey { - - case category = "category" - - } - - public init(category: CategorySchema?) { - - self.category = category - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - category = try container.decode(CategorySchema.self, forKey: .category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(category, forKey: .category) - - - } - - } - - /* - Model: CreateFaqCategoryRequestSchema - Used By: Content - */ - class CreateFaqCategoryRequestSchema: Codable { - - public var category: CategoryRequestSchema? - - - public enum CodingKeys: String, CodingKey { - - case category = "category" - - } - - public init(category: CategoryRequestSchema?) { - - self.category = category - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - category = try container.decode(CategoryRequestSchema.self, forKey: .category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(category, forKey: .category) - - - } - - } - - /* - Model: CreateFaqCategorySchema - Used By: Content - */ - class CreateFaqCategorySchema: Codable { - - public var category: CategorySchema? - - - public enum CodingKeys: String, CodingKey { - - case category = "category" - - } - - public init(category: CategorySchema?) { - - self.category = category - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - category = try container.decode(CategorySchema.self, forKey: .category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(category, forKey: .category) - - - } - - } - - /* - Model: GetFaqCategoriesSchema - Used By: Content - */ - class GetFaqCategoriesSchema: Codable { - - public var categories: [CategorySchema]? - - - public enum CodingKeys: String, CodingKey { - - case categories = "categories" - - } - - public init(categories: [CategorySchema]?) { - - self.categories = categories - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - categories = try container.decode([CategorySchema].self, forKey: .categories) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(categories, forKey: .categories) - - - } - - } - - /* - Model: GetFaqCategoryBySlugSchema - Used By: Content - */ - class GetFaqCategoryBySlugSchema: Codable { - - public var category: FAQCategorySchema? - - - public enum CodingKeys: String, CodingKey { - - case category = "category" - - } - - public init(category: FAQCategorySchema?) { - - self.category = category - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - category = try container.decode(FAQCategorySchema.self, forKey: .category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(category, forKey: .category) - - - } - - } - - /* - Model: LandingPageGetResponse - Used By: Content - */ - class LandingPageGetResponse: Codable { - - public var items: [LandingPageSchema]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [LandingPageSchema]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([LandingPageSchema].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: LandingPageSchema - Used By: Content - */ - class LandingPageSchema: Codable { - - public var slug: String? - - public var action: Action? - - public var platform: [String]? - - public var createdBy: CreatedBySchema? - - public var dateMeta: DateMeta? - - public var id: String? - - public var application: String? - - public var archived: Bool? - - public var customJson: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case slug = "slug" - - case action = "action" - - case platform = "platform" - - case createdBy = "created_by" - - case dateMeta = "date_meta" - - case id = "_id" - - case application = "application" - - case archived = "archived" - - case customJson = "_custom_json" - - } - - public init(action: Action?, application: String?, archived: Bool?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, platform: [String]?, slug: String?, customJson: [String: Any]?, id: String?) { - - self.slug = slug - - self.action = action - - self.platform = platform - - self.createdBy = createdBy - - self.dateMeta = dateMeta - - self.id = id - - self.application = application - - self.archived = archived - - self.customJson = customJson - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(Action.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode([String].self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archived = try container.decode(Bool.self, forKey: .archived) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(archived, forKey: .archived) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - } - - } - - /* - Model: DefaultNavigationResponse - Used By: Content - */ - class DefaultNavigationResponse: Codable { - - public var items: [NavigationSchema]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - } - - public init(items: [NavigationSchema]?) { - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([NavigationSchema].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: NavigationGetResponse - Used By: Content - */ - class NavigationGetResponse: Codable { - - public var items: [NavigationSchema]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [NavigationSchema]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([NavigationSchema].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: Orientation - Used By: Content - */ - class Orientation: Codable { - - public var portrait: [String]? - - public var landscape: [String]? - - - public enum CodingKeys: String, CodingKey { - - case portrait = "portrait" - - case landscape = "landscape" - - } - - public init(landscape: [String]?, portrait: [String]?) { - - self.portrait = portrait - - self.landscape = landscape - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - portrait = try container.decode([String].self, forKey: .portrait) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - landscape = try container.decode([String].self, forKey: .landscape) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(portrait, forKey: .portrait) - - - - try? container.encodeIfPresent(landscape, forKey: .landscape) - - - } - - } - - /* - Model: NavigationSchema - Used By: Content - */ - class NavigationSchema: Codable { - - public var id: String? - - public var application: String? - - public var archived: Bool? - - public var name: String? - - public var slug: String? - - public var platform: [String]? - - public var createdBy: CreatedBySchema? - - public var dateMeta: DateMeta? - - public var orientation: Orientation? - - public var version: Double? - - public var navigation: [NavigationReference]? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case application = "application" - - case archived = "archived" - - case name = "name" - - case slug = "slug" - - case platform = "platform" - - case createdBy = "created_by" - - case dateMeta = "date_meta" - - case orientation = "orientation" - - case version = "version" - - case navigation = "navigation" - - } - - public init(application: String?, archived: Bool?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, name: String?, navigation: [NavigationReference]?, orientation: Orientation?, platform: [String]?, slug: String?, version: Double?, id: String?) { - - self.id = id - - self.application = application - - self.archived = archived - - self.name = name - - self.slug = slug - - self.platform = platform - - self.createdBy = createdBy - - self.dateMeta = dateMeta - - self.orientation = orientation - - self.version = version - - self.navigation = navigation - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archived = try container.decode(Bool.self, forKey: .archived) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode([String].self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orientation = try container.decode(Orientation.self, forKey: .orientation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - version = try container.decode(Double.self, forKey: .version) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - navigation = try container.decode([NavigationReference].self, forKey: .navigation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(archived, forKey: .archived) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(orientation, forKey: .orientation) - - - - try? container.encodeIfPresent(version, forKey: .version) - - - - try? container.encodeIfPresent(navigation, forKey: .navigation) - - - } - - } - - /* - Model: NavigationRequest - Used By: Content - */ - class NavigationRequest: Codable { - - public var name: String? - - public var slug: String? - - public var platform: [String]? - - public var orientation: Orientation? - - public var navigation: [NavigationReference]? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case slug = "slug" - - case platform = "platform" - - case orientation = "orientation" - - case navigation = "navigation" - - } - - public init(name: String?, navigation: [NavigationReference]?, orientation: Orientation?, platform: [String]?, slug: String?) { - - self.name = name - - self.slug = slug - - self.platform = platform - - self.orientation = orientation - - self.navigation = navigation - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode([String].self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orientation = try container.decode(Orientation.self, forKey: .orientation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - navigation = try container.decode([NavigationReference].self, forKey: .navigation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - - try? container.encodeIfPresent(orientation, forKey: .orientation) - - - - try? container.encodeIfPresent(navigation, forKey: .navigation) - - - } - - } - - /* - Model: CustomPageSchema - Used By: Content - */ - class CustomPageSchema: Codable { - - public var id: String? - - public var platform: String? - - public var title: String? - - public var slug: String? - - public var type: String? - - public var orientation: String? - - public var application: String? - - public var description: String? - - public var published: Bool? - - public var tags: [String]? - - public var content: [[String: Any]]? - - public var createdBy: CreatedBySchema? - - public var dateMeta: DateMeta? - - public var schedule: ScheduleSchema? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case platform = "platform" - - case title = "title" - - case slug = "slug" - - case type = "type" - - case orientation = "orientation" - - case application = "application" - - case description = "description" - - case published = "published" - - case tags = "tags" - - case content = "content" - - case createdBy = "created_by" - - case dateMeta = "date_meta" - - case schedule = "_schedule" - - } - - public init(application: String?, content: [[String: Any]]?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, description: String?, orientation: String?, platform: String?, published: Bool?, slug: String?, tags: [String]?, title: String?, type: String?, id: String?, schedule: ScheduleSchema?) { - - self.id = id - - self.platform = platform - - self.title = title - - self.slug = slug - - self.type = type - - self.orientation = orientation - - self.application = application - - self.description = description - - self.published = published - - self.tags = tags - - self.content = content - - self.createdBy = createdBy - - self.dateMeta = dateMeta - - self.schedule = schedule - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode(String.self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orientation = try container.decode(String.self, forKey: .orientation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode([[String: Any]].self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode(ScheduleSchema.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(orientation, forKey: .orientation) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - } - - } - - /* - Model: ContentSchema - Used By: Content - */ - class ContentSchema: Codable { - - public var type: String? - - public var value: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case value = "value" - - } - - public init(type: String?, value: [String: Any]?) { - - self.type = type - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode([String: Any].self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: CustomPage - Used By: Content - */ - class CustomPage: Codable { - - public var data: CustomPageSchema? - - - public enum CodingKeys: String, CodingKey { - - case data = "data" - - } - - public init(data: CustomPageSchema?) { - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - data = try container.decode(CustomPageSchema.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: FeatureImage - Used By: Content - */ - class FeatureImage: Codable { - - public var secureUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case secureUrl = "secure_url" - - } - - public init(secureUrl: String?) { - - self.secureUrl = secureUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - secureUrl = try container.decode(String.self, forKey: .secureUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) - - - } - - } - - /* - Model: PageGetResponse - Used By: Content - */ - class PageGetResponse: Codable { - - public var items: [PageSchema]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [PageSchema]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([PageSchema].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: PageSpec - Used By: Content - */ - class PageSpec: Codable { - - public var specifications: [PageSpecItem]? - - - public enum CodingKeys: String, CodingKey { - - case specifications = "specifications" - - } - - public init(specifications: [PageSpecItem]?) { - - self.specifications = specifications - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - specifications = try container.decode([PageSpecItem].self, forKey: .specifications) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(specifications, forKey: .specifications) - - - } - - } - - /* - Model: PageSpecParam - Used By: Content - */ - class PageSpecParam: Codable { - - public var key: String? - - public var required: Bool? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case required = "required" - - } - - public init(key: String?, required: Bool?) { - - self.key = key - - self.required = required - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - required = try container.decode(Bool.self, forKey: .required) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(required, forKey: .required) - - - } - - } - - /* - Model: PageSpecItem - Used By: Content - */ - class PageSpecItem: Codable { - - public var pageType: String? - - public var displayName: String? - - public var params: [PageSpecParam]? - - public var query: [PageSpecParam]? - - - public enum CodingKeys: String, CodingKey { - - case pageType = "page_type" - - case displayName = "display_name" - - case params = "params" - - case query = "query" - - } - - public init(displayName: String?, pageType: String?, params: [PageSpecParam]?, query: [PageSpecParam]?) { - - self.pageType = pageType - - self.displayName = displayName - - self.params = params - - self.query = query - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pageType = try container.decode(String.self, forKey: .pageType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - params = try container.decode([PageSpecParam].self, forKey: .params) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - query = try container.decode([PageSpecParam].self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pageType, forKey: .pageType) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(params, forKey: .params) - - - - try? container.encodeIfPresent(query, forKey: .query) - - - } - - } - - /* - Model: PageSchema - Used By: Content - */ - class PageSchema: Codable { - - public var id: String? - - public var application: String? - - public var componentIds: [String]? - - public var content: [[String: Any]]? - - public var createdBy: CreatedBySchema? - - public var dateMeta: DateMeta? - - public var description: String? - - public var featureImage: Asset? - - public var pageMeta: [[String: Any]]? - - public var schedule: ScheduleSchema? - - public var customJson: [String: Any]? - - public var orientation: String? - - public var platform: String? - - public var published: Bool? - - public var slug: String? - - public var tags: [String]? - - public var title: String? - - public var type: String? - - public var seo: SEO? - - public var visibility: [String: Any]? - - public var archived: Bool? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case application = "application" - - case componentIds = "component_ids" - - case content = "content" - - case createdBy = "created_by" - - case dateMeta = "date_meta" - - case description = "description" - - case featureImage = "feature_image" - - case pageMeta = "page_meta" - - case schedule = "_schedule" - - case customJson = "_custom_json" - - case orientation = "orientation" - - case platform = "platform" - - case published = "published" - - case slug = "slug" - - case tags = "tags" - - case title = "title" - - case type = "type" - - case seo = "seo" - - case visibility = "visibility" - - case archived = "archived" - - } - - public init(application: String?, archived: Bool?, componentIds: [String]?, content: [[String: Any]]?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, description: String?, featureImage: Asset?, orientation: String?, pageMeta: [[String: Any]]?, platform: String?, published: Bool?, seo: SEO?, slug: String?, tags: [String]?, title: String?, type: String?, visibility: [String: Any]?, customJson: [String: Any]?, id: String?, schedule: ScheduleSchema?) { - - self.id = id - - self.application = application - - self.componentIds = componentIds - - self.content = content - - self.createdBy = createdBy - - self.dateMeta = dateMeta - - self.description = description - - self.featureImage = featureImage - - self.pageMeta = pageMeta - - self.schedule = schedule - - self.customJson = customJson - - self.orientation = orientation - - self.platform = platform - - self.published = published - - self.slug = slug - - self.tags = tags - - self.title = title - - self.type = type - - self.seo = seo - - self.visibility = visibility - - self.archived = archived - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - componentIds = try container.decode([String].self, forKey: .componentIds) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode([[String: Any]].self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - featureImage = try container.decode(Asset.self, forKey: .featureImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pageMeta = try container.decode([[String: Any]].self, forKey: .pageMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode(ScheduleSchema.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orientation = try container.decode(String.self, forKey: .orientation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode(String.self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - seo = try container.decode(SEO.self, forKey: .seo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - visibility = try container.decode([String: Any].self, forKey: .visibility) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archived = try container.decode(Bool.self, forKey: .archived) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(componentIds, forKey: .componentIds) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(featureImage, forKey: .featureImage) - - - - try? container.encodeIfPresent(pageMeta, forKey: .pageMeta) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(orientation, forKey: .orientation) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(seo, forKey: .seo) - - - - try? container.encodeIfPresent(visibility, forKey: .visibility) - - - - try? container.encodeIfPresent(archived, forKey: .archived) - - - } - - } - - /* - Model: CreatedBySchema - Used By: Content - */ - class CreatedBySchema: Codable { - - public var id: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - } - - public init(id: String?) { - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: PageContent - Used By: Content - */ - class PageContent: Codable { - - public var type: String? - - public var value: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case value = "value" - - } - - public init(type: String?, value: [String: Any]?) { - - self.type = type - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode([String: Any].self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: PageMeta - Used By: Content - */ - class PageMeta: Codable { - - public var key: String? - - public var value: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case value = "value" - - } - - public init(key: String?, value: [String: Any]?) { - - self.key = key - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode([String: Any].self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: PageRequest - Used By: Content - */ - class PageRequest: Codable { - - public var schedule: CronSchedule? - - public var application: String? - - public var author: Author? - - public var customJson: [String: Any]? - - public var orientation: String? - - public var content: [[String: Any]]? - - public var featureImage: Asset? - - public var published: Bool? - - public var readingTime: String? - - public var slug: String? - - public var tags: [String]? - - public var seo: SEO? - - public var title: String? - - - public enum CodingKeys: String, CodingKey { - - case schedule = "_schedule" - - case application = "application" - - case author = "author" - - case customJson = "_custom_json" - - case orientation = "orientation" - - case content = "content" - - case featureImage = "feature_image" - - case published = "published" - - case readingTime = "reading_time" - - case slug = "slug" - - case tags = "tags" - - case seo = "seo" - - case title = "title" - - } - - public init(application: String?, author: Author?, content: [[String: Any]]?, featureImage: Asset?, orientation: String?, published: Bool?, readingTime: String?, seo: SEO?, slug: String?, tags: [String]?, title: String?, customJson: [String: Any]?, schedule: CronSchedule?) { - - self.schedule = schedule - - self.application = application - - self.author = author - - self.customJson = customJson - - self.orientation = orientation - - self.content = content - - self.featureImage = featureImage - - self.published = published - - self.readingTime = readingTime - - self.slug = slug - - self.tags = tags - - self.seo = seo - - self.title = title - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - schedule = try container.decode(CronSchedule.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - author = try container.decode(Author.self, forKey: .author) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orientation = try container.decode(String.self, forKey: .orientation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode([[String: Any]].self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - featureImage = try container.decode(Asset.self, forKey: .featureImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - readingTime = try container.decode(String.self, forKey: .readingTime) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - seo = try container.decode(SEO.self, forKey: .seo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(author, forKey: .author) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(orientation, forKey: .orientation) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - - try? container.encodeIfPresent(featureImage, forKey: .featureImage) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(readingTime, forKey: .readingTime) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(seo, forKey: .seo) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - } - - } - - /* - Model: CronSchedule - Used By: Content - */ - class CronSchedule: Codable { - - public var cron: String? - - public var start: String? - - public var end: String? - - public var duration: Double? - - - public enum CodingKeys: String, CodingKey { - - case cron = "cron" - - case start = "start" - - case end = "end" - - case duration = "duration" - - } - - public init(cron: String?, duration: Double?, end: String?, start: String?) { - - self.cron = cron - - self.start = start - - self.end = end - - self.duration = duration - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cron = try container.decode(String.self, forKey: .cron) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - start = try container.decode(String.self, forKey: .start) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - end = try container.decode(String.self, forKey: .end) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - duration = try container.decode(Double.self, forKey: .duration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cron, forKey: .cron) - - - - try? container.encodeIfPresent(start, forKey: .start) - - - - try? container.encodeIfPresent(end, forKey: .end) - - - - try? container.encodeIfPresent(duration, forKey: .duration) - - - } - - } - - /* - Model: PagePublishRequest - Used By: Content - */ - class PagePublishRequest: Codable { - - public var publish: Bool? - - - public enum CodingKeys: String, CodingKey { - - case publish = "publish" - - } - - public init(publish: Bool?) { - - self.publish = publish - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - publish = try container.decode(Bool.self, forKey: .publish) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(publish, forKey: .publish) - - - } - - } - - /* - Model: PageMetaSchema - Used By: Content - */ - class PageMetaSchema: Codable { - - public var systemPages: [NavigationSchema]? - - public var customPages: [PageSchema]? - - public var applicationId: String? - - - public enum CodingKeys: String, CodingKey { - - case systemPages = "system_pages" - - case customPages = "custom_pages" - - case applicationId = "application_id" - - } - - public init(applicationId: String?, customPages: [PageSchema]?, systemPages: [NavigationSchema]?) { - - self.systemPages = systemPages - - self.customPages = customPages - - self.applicationId = applicationId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - systemPages = try container.decode([NavigationSchema].self, forKey: .systemPages) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customPages = try container.decode([PageSchema].self, forKey: .customPages) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - applicationId = try container.decode(String.self, forKey: .applicationId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(systemPages, forKey: .systemPages) - - - - try? container.encodeIfPresent(customPages, forKey: .customPages) - - - - try? container.encodeIfPresent(applicationId, forKey: .applicationId) - - - } - - } - - /* - Model: SlideshowGetResponse - Used By: Content - */ - class SlideshowGetResponse: Codable { - - public var items: [SlideshowSchema]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [SlideshowSchema]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([SlideshowSchema].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: SlideshowSchema - Used By: Content - */ - class SlideshowSchema: Codable { - - public var id: String? - - public var slug: String? - - public var dateMeta: DateMeta? - - public var application: String? - - public var platform: String? - - public var configuration: ConfigurationSchema? - - public var media: [SlideshowMedia]? - - public var active: Bool? - - public var archived: Bool? - - public var customJson: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case slug = "slug" - - case dateMeta = "date_meta" - - case application = "application" - - case platform = "platform" - - case configuration = "configuration" - - case media = "media" - - case active = "active" - - case archived = "archived" - - case customJson = "_custom_json" - - } - - public init(active: Bool?, application: String?, archived: Bool?, configuration: ConfigurationSchema?, dateMeta: DateMeta?, media: [SlideshowMedia]?, platform: String?, slug: String?, customJson: [String: Any]?, id: String?) { - - self.id = id - - self.slug = slug - - self.dateMeta = dateMeta - - self.application = application - - self.platform = platform - - self.configuration = configuration - - self.media = media - - self.active = active - - self.archived = archived - - self.customJson = customJson - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode(String.self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - configuration = try container.decode(ConfigurationSchema.self, forKey: .configuration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - media = try container.decode([SlideshowMedia].self, forKey: .media) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archived = try container.decode(Bool.self, forKey: .archived) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - - try? container.encodeIfPresent(configuration, forKey: .configuration) - - - - try? container.encodeIfPresent(media, forKey: .media) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(archived, forKey: .archived) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - } - - } - - /* - Model: SlideshowRequest - Used By: Content - */ - class SlideshowRequest: Codable { - - public var slug: String? - - public var platform: String? - - public var configuration: ConfigurationSchema? - - public var media: SlideshowMedia? - - public var active: Bool? - - - public enum CodingKeys: String, CodingKey { - - case slug = "slug" - - case platform = "platform" - - case configuration = "configuration" - - case media = "media" - - case active = "active" - - } - - public init(active: Bool?, configuration: ConfigurationSchema?, media: SlideshowMedia?, platform: String?, slug: String?) { - - self.slug = slug - - self.platform = platform - - self.configuration = configuration - - self.media = media - - self.active = active - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode(String.self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - configuration = try container.decode(ConfigurationSchema.self, forKey: .configuration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - media = try container.decode(SlideshowMedia.self, forKey: .media) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - - try? container.encodeIfPresent(configuration, forKey: .configuration) - - - - try? container.encodeIfPresent(media, forKey: .media) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - } - - } - - /* - Model: Support - Used By: Content - */ - class Support: Codable { - - public var created: Bool? - - public var id: String? - - public var configType: String? - - public var application: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var contact: ContactSchema? - - - public enum CodingKeys: String, CodingKey { - - case created = "created" - - case id = "_id" - - case configType = "config_type" - - case application = "application" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case contact = "contact" - - } - - public init(application: String?, configType: String?, contact: ContactSchema?, created: Bool?, createdAt: String?, updatedAt: String?, id: String?) { - - self.created = created - - self.id = id - - self.configType = configType - - self.application = application - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.contact = contact - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - created = try container.decode(Bool.self, forKey: .created) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - configType = try container.decode(String.self, forKey: .configType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contact = try container.decode(ContactSchema.self, forKey: .contact) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(created, forKey: .created) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(configType, forKey: .configType) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(contact, forKey: .contact) - - - } - - } - - /* - Model: PhoneProperties - Used By: Content - */ - class PhoneProperties: Codable { - - public var key: String? - - public var code: String? - - public var number: String? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case code = "code" - - case number = "number" - - } - - public init(code: String?, key: String?, number: String?) { - - self.key = key - - self.code = code - - self.number = number - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - number = try container.decode(String.self, forKey: .number) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(number, forKey: .number) - - - } - - } - - /* - Model: PhoneSchema - Used By: Content - */ - class PhoneSchema: Codable { - - public var active: Bool? - - public var phone: [PhoneProperties]? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case phone = "phone" - - } - - public init(active: Bool?, phone: [PhoneProperties]?) { - - self.active = active - - self.phone = phone - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode([PhoneProperties].self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - } - - } - - /* - Model: EmailProperties - Used By: Content - */ - class EmailProperties: Codable { - - public var key: String? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case value = "value" - - } - - public init(key: String?, value: String?) { - - self.key = key - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: EmailSchema - Used By: Content - */ - class EmailSchema: Codable { - - public var active: Bool? - - public var email: [EmailProperties]? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case email = "email" - - } - - public init(active: Bool?, email: [EmailProperties]?) { - - self.active = active - - self.email = email - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode([EmailProperties].self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - } - - } - - /* - Model: ContactSchema - Used By: Content - */ - class ContactSchema: Codable { - - public var phone: PhoneSchema? - - public var email: EmailSchema? - - - public enum CodingKeys: String, CodingKey { - - case phone = "phone" - - case email = "email" - - } - - public init(email: EmailSchema?, phone: PhoneSchema?) { - - self.phone = phone - - self.email = email - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - phone = try container.decode(PhoneSchema.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(EmailSchema.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - } - - } - - /* - Model: TagsSchema - Used By: Content - */ - class TagsSchema: Codable { - - public var application: String? - - public var id: String? - - public var tags: [TagSchema]? - - - public enum CodingKeys: String, CodingKey { - - case application = "application" - - case id = "_id" - - case tags = "tags" - - } - - public init(application: String?, tags: [TagSchema]?, id: String?) { - - self.application = application - - self.id = id - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([TagSchema].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: TagSchema - Used By: Content - */ - class TagSchema: Codable { - - public var name: String? - - public var url: String? - - public var type: String? - - public var subType: String? - - public var id: String? - - public var position: String? - - public var attributes: [String: Any]? - - public var content: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case url = "url" - - case type = "type" - - case subType = "sub_type" - - case id = "_id" - - case position = "position" - - case attributes = "attributes" - - case content = "content" - - } - - public init(attributes: [String: Any]?, content: String?, name: String?, position: String?, subType: String?, type: String?, url: String?, id: String?) { - - self.name = name - - self.url = url - - self.type = type - - self.subType = subType - - self.id = id - - self.position = position - - self.attributes = attributes - - self.content = content - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subType = try container.decode(String.self, forKey: .subType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - position = try container.decode(String.self, forKey: .position) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attributes = try container.decode([String: Any].self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode(String.self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(subType, forKey: .subType) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(position, forKey: .position) - - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - } - - } - - - - /* - Model: CommunicationConsentReq - Used By: Communication - */ - class CommunicationConsentReq: Codable { - - public var response: String? - - public var action: String? - - public var channel: String? - - - public enum CodingKeys: String, CodingKey { - - case response = "response" - - case action = "action" - - case channel = "channel" - - } - - public init(action: String?, channel: String?, response: String?) { - - self.response = response - - self.action = action - - self.channel = channel - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - response = try container.decode(String.self, forKey: .response) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(String.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - channel = try container.decode(String.self, forKey: .channel) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(response, forKey: .response) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(channel, forKey: .channel) - - - } - - } - - /* - Model: CommunicationConsentRes - Used By: Communication - */ - class CommunicationConsentRes: Codable { - - public var appId: String? - - public var userId: String? - - public var channels: CommunicationConsentChannels? - - - public enum CodingKeys: String, CodingKey { - - case appId = "app_id" - - case userId = "user_id" - - case channels = "channels" - - } - - public init(appId: String?, channels: CommunicationConsentChannels?, userId: String?) { - - self.appId = appId - - self.userId = userId - - self.channels = channels - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - channels = try container.decode(CommunicationConsentChannels.self, forKey: .channels) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - - try? container.encodeIfPresent(channels, forKey: .channels) - - - } - - } - - /* - Model: CommunicationConsentChannelsEmail - Used By: Communication - */ - class CommunicationConsentChannelsEmail: Codable { - - public var response: String? - - public var displayName: String? - - - public enum CodingKeys: String, CodingKey { - - case response = "response" - - case displayName = "display_name" - - } - - public init(displayName: String?, response: String?) { - - self.response = response - - self.displayName = displayName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - response = try container.decode(String.self, forKey: .response) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(response, forKey: .response) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - } - - } - - /* - Model: CommunicationConsentChannelsSms - Used By: Communication - */ - class CommunicationConsentChannelsSms: Codable { - - public var response: String? - - public var displayName: String? - - - public enum CodingKeys: String, CodingKey { - - case response = "response" - - case displayName = "display_name" - - } - - public init(displayName: String?, response: String?) { - - self.response = response - - self.displayName = displayName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - response = try container.decode(String.self, forKey: .response) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(response, forKey: .response) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - } - - } - - /* - Model: CommunicationConsentChannelsWhatsapp - Used By: Communication - */ - class CommunicationConsentChannelsWhatsapp: Codable { - - public var response: String? - - public var displayName: String? - - public var countryCode: String? - - public var phoneNumber: String? - - - public enum CodingKeys: String, CodingKey { - - case response = "response" - - case displayName = "display_name" - - case countryCode = "country_code" - - case phoneNumber = "phone_number" - - } - - public init(countryCode: String?, displayName: String?, phoneNumber: String?, response: String?) { - - self.response = response - - self.displayName = displayName - - self.countryCode = countryCode - - self.phoneNumber = phoneNumber - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - response = try container.decode(String.self, forKey: .response) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phoneNumber = try container.decode(String.self, forKey: .phoneNumber) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(response, forKey: .response) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(phoneNumber, forKey: .phoneNumber) - - - } - - } - - /* - Model: CommunicationConsentChannels - Used By: Communication - */ - class CommunicationConsentChannels: Codable { - - public var email: CommunicationConsentChannelsEmail? - - public var sms: CommunicationConsentChannelsSms? - - public var whatsapp: CommunicationConsentChannelsWhatsapp? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case sms = "sms" - - case whatsapp = "whatsapp" - - } - - public init(email: CommunicationConsentChannelsEmail?, sms: CommunicationConsentChannelsSms?, whatsapp: CommunicationConsentChannelsWhatsapp?) { - - self.email = email - - self.sms = sms - - self.whatsapp = whatsapp - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(CommunicationConsentChannelsEmail.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sms = try container.decode(CommunicationConsentChannelsSms.self, forKey: .sms) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - whatsapp = try container.decode(CommunicationConsentChannelsWhatsapp.self, forKey: .whatsapp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(sms, forKey: .sms) - - - - try? container.encodeIfPresent(whatsapp, forKey: .whatsapp) - - - } - - } - - /* - Model: CommunicationConsent - Used By: Communication - */ - class CommunicationConsent: Codable { - - public var appId: String? - - public var userId: String? - - public var channels: CommunicationConsentChannels? - - - public enum CodingKeys: String, CodingKey { - - case appId = "app_id" - - case userId = "user_id" - - case channels = "channels" - - } - - public init(appId: String?, channels: CommunicationConsentChannels?, userId: String?) { - - self.appId = appId - - self.userId = userId - - self.channels = channels - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - channels = try container.decode(CommunicationConsentChannels.self, forKey: .channels) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - - try? container.encodeIfPresent(channels, forKey: .channels) - - - } - - } - - /* - Model: PushtokenReq - Used By: Communication - */ - class PushtokenReq: Codable { - - public var action: String? - - public var bundleIdentifier: String? - - public var pushToken: String? - - public var uniqueDeviceId: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case action = "action" - - case bundleIdentifier = "bundle_identifier" - - case pushToken = "push_token" - - case uniqueDeviceId = "unique_device_id" - - case type = "type" - - } - - public init(action: String?, bundleIdentifier: String?, pushToken: String?, type: String?, uniqueDeviceId: String?) { - - self.action = action - - self.bundleIdentifier = bundleIdentifier - - self.pushToken = pushToken - - self.uniqueDeviceId = uniqueDeviceId - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - action = try container.decode(String.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bundleIdentifier = try container.decode(String.self, forKey: .bundleIdentifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pushToken = try container.decode(String.self, forKey: .pushToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uniqueDeviceId = try container.decode(String.self, forKey: .uniqueDeviceId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(bundleIdentifier, forKey: .bundleIdentifier) - - - - try? container.encodeIfPresent(pushToken, forKey: .pushToken) - - - - try? container.encodeIfPresent(uniqueDeviceId, forKey: .uniqueDeviceId) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: PushtokenRes - Used By: Communication - */ - class PushtokenRes: Codable { - - public var id: String? - - public var bundleIdentifier: String? - - public var pushToken: String? - - public var uniqueDeviceId: String? - - public var type: String? - - public var platform: String? - - public var applicationId: String? - - public var userId: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var expiredAt: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case bundleIdentifier = "bundle_identifier" - - case pushToken = "push_token" - - case uniqueDeviceId = "unique_device_id" - - case type = "type" - - case platform = "platform" - - case applicationId = "application_id" - - case userId = "user_id" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case expiredAt = "expired_at" - - } - - public init(applicationId: String?, bundleIdentifier: String?, createdAt: String?, expiredAt: String?, platform: String?, pushToken: String?, type: String?, uniqueDeviceId: String?, updatedAt: String?, userId: String?, id: String?) { - - self.id = id - - self.bundleIdentifier = bundleIdentifier - - self.pushToken = pushToken - - self.uniqueDeviceId = uniqueDeviceId - - self.type = type - - self.platform = platform - - self.applicationId = applicationId - - self.userId = userId - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.expiredAt = expiredAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bundleIdentifier = try container.decode(String.self, forKey: .bundleIdentifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pushToken = try container.decode(String.self, forKey: .pushToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uniqueDeviceId = try container.decode(String.self, forKey: .uniqueDeviceId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode(String.self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - applicationId = try container.decode(String.self, forKey: .applicationId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expiredAt = try container.decode(String.self, forKey: .expiredAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(bundleIdentifier, forKey: .bundleIdentifier) - - - - try? container.encodeIfPresent(pushToken, forKey: .pushToken) - - - - try? container.encodeIfPresent(uniqueDeviceId, forKey: .uniqueDeviceId) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - - try? container.encodeIfPresent(applicationId, forKey: .applicationId) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(expiredAt, forKey: .expiredAt) - - - } - - } - - - - /* - Model: QRCodeResp - Used By: Share - */ - class QRCodeResp: Codable { - - public var link: String? - - public var svg: String? - - - public enum CodingKeys: String, CodingKey { - - case link = "link" - - case svg = "svg" - - } - - public init(link: String?, svg: String?) { - - self.link = link - - self.svg = svg - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - svg = try container.decode(String.self, forKey: .svg) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(link, forKey: .link) - - - - try? container.encodeIfPresent(svg, forKey: .svg) - - - } - - } - - /* - Model: RedirectDevice - Used By: Share - */ - class RedirectDevice: Codable { - - public var link: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case link = "link" - - case type = "type" - - } - - public init(link: String?, type: String?) { - - self.link = link - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(link, forKey: .link) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: WebRedirect - Used By: Share - */ - class WebRedirect: Codable { - - public var link: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case link = "link" - - case type = "type" - - } - - public init(link: String?, type: String?) { - - self.link = link - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(link, forKey: .link) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: Redirects - Used By: Share - */ - class Redirects: Codable { - - public var ios: RedirectDevice? - - public var android: RedirectDevice? - - public var web: WebRedirect? - - public var forceWeb: Bool? - - - public enum CodingKeys: String, CodingKey { - - case ios = "ios" - - case android = "android" - - case web = "web" - - case forceWeb = "force_web" - - } - - public init(android: RedirectDevice?, forceWeb: Bool?, ios: RedirectDevice?, web: WebRedirect?) { - - self.ios = ios - - self.android = android - - self.web = web - - self.forceWeb = forceWeb - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - ios = try container.decode(RedirectDevice.self, forKey: .ios) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - android = try container.decode(RedirectDevice.self, forKey: .android) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - web = try container.decode(WebRedirect.self, forKey: .web) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - forceWeb = try container.decode(Bool.self, forKey: .forceWeb) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(ios, forKey: .ios) - - - - try? container.encodeIfPresent(android, forKey: .android) - - - - try? container.encodeIfPresent(web, forKey: .web) - - - - try? container.encodeIfPresent(forceWeb, forKey: .forceWeb) - - - } - - } - - /* - Model: CampaignShortLink - Used By: Share - */ - class CampaignShortLink: Codable { - - public var source: String? - - public var medium: String? - - - public enum CodingKeys: String, CodingKey { - - case source = "source" - - case medium = "medium" - - } - - public init(medium: String?, source: String?) { - - self.source = source - - self.medium = medium - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - source = try container.decode(String.self, forKey: .source) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - medium = try container.decode(String.self, forKey: .medium) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(source, forKey: .source) - - - - try? container.encodeIfPresent(medium, forKey: .medium) - - - } - - } - - /* - Model: Attribution - Used By: Share - */ - class Attribution: Codable { - - public var campaignCookieExpiry: String? - - - public enum CodingKeys: String, CodingKey { - - case campaignCookieExpiry = "campaign_cookie_expiry" - - } - - public init(campaignCookieExpiry: String?) { - - self.campaignCookieExpiry = campaignCookieExpiry - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - campaignCookieExpiry = try container.decode(String.self, forKey: .campaignCookieExpiry) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(campaignCookieExpiry, forKey: .campaignCookieExpiry) - - - } - - } - - /* - Model: SocialMediaTags - Used By: Share - */ - class SocialMediaTags: Codable { - - public var title: String? - - public var description: String? - - public var image: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case description = "description" - - case image = "image" - - } - - public init(description: String?, image: String?, title: String?) { - - self.title = title - - self.description = description - - self.image = image - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - image = try container.decode(String.self, forKey: .image) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(image, forKey: .image) - - - } - - } - - /* - Model: ShortLinkReq - Used By: Share - */ - class ShortLinkReq: Codable { - - public var title: String - - public var url: String - - public var hash: String? - - public var active: Bool? - - public var expireAt: String? - - public var enableTracking: Bool? - - public var personalized: Bool? - - public var campaign: CampaignShortLink? - - public var redirects: Redirects? - - public var attribution: Attribution? - - public var socialMediaTags: SocialMediaTags? - - public var count: Int? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case url = "url" - - case hash = "hash" - - case active = "active" - - case expireAt = "expire_at" - - case enableTracking = "enable_tracking" - - case personalized = "personalized" - - case campaign = "campaign" - - case redirects = "redirects" - - case attribution = "attribution" - - case socialMediaTags = "social_media_tags" - - case count = "count" - - } - - public init(active: Bool?, attribution: Attribution?, campaign: CampaignShortLink?, count: Int?, enableTracking: Bool?, expireAt: String?, hash: String?, personalized: Bool?, redirects: Redirects?, socialMediaTags: SocialMediaTags?, title: String, url: String) { - - self.title = title - - self.url = url - - self.hash = hash - - self.active = active - - self.expireAt = expireAt - - self.enableTracking = enableTracking - - self.personalized = personalized - - self.campaign = campaign - - self.redirects = redirects - - self.attribution = attribution - - self.socialMediaTags = socialMediaTags - - self.count = count - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - title = try container.decode(String.self, forKey: .title) - - - - - url = try container.decode(String.self, forKey: .url) - - - - - do { - hash = try container.decode(String.self, forKey: .hash) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expireAt = try container.decode(String.self, forKey: .expireAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enableTracking = try container.decode(Bool.self, forKey: .enableTracking) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - personalized = try container.decode(Bool.self, forKey: .personalized) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - campaign = try container.decode(CampaignShortLink.self, forKey: .campaign) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - redirects = try container.decode(Redirects.self, forKey: .redirects) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attribution = try container.decode(Attribution.self, forKey: .attribution) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - socialMediaTags = try container.decode(SocialMediaTags.self, forKey: .socialMediaTags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(hash, forKey: .hash) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(expireAt, forKey: .expireAt) - - - - try? container.encodeIfPresent(enableTracking, forKey: .enableTracking) - - - - try? container.encodeIfPresent(personalized, forKey: .personalized) - - - - try? container.encodeIfPresent(campaign, forKey: .campaign) - - - - try? container.encodeIfPresent(redirects, forKey: .redirects) - - - - try? container.encodeIfPresent(attribution, forKey: .attribution) - - - - try? container.encodeIfPresent(socialMediaTags, forKey: .socialMediaTags) - - - - try? container.encodeIfPresent(count, forKey: .count) - - - } - - } - - /* - Model: UrlInfo - Used By: Share - */ - class UrlInfo: Codable { - - public var original: String? - - public var short: String? - - public var hash: String? - - - public enum CodingKeys: String, CodingKey { - - case original = "original" - - case short = "short" - - case hash = "hash" - - } - - public init(hash: String?, original: String?, short: String?) { - - self.original = original - - self.short = short - - self.hash = hash - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - original = try container.decode(String.self, forKey: .original) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - short = try container.decode(String.self, forKey: .short) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hash = try container.decode(String.self, forKey: .hash) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(original, forKey: .original) - - - - try? container.encodeIfPresent(short, forKey: .short) - - - - try? container.encodeIfPresent(hash, forKey: .hash) - - - } - - } - - /* - Model: ShortLinkRes - Used By: Share - */ - class ShortLinkRes: Codable { - - public var title: String? - - public var url: UrlInfo? - - public var createdBy: String? - - public var appRedirect: Bool? - - public var fallback: String? - - public var active: Bool? - - public var id: String? - - public var enableTracking: Bool? - - public var expireAt: String? - - public var application: String? - - public var userId: String? - - public var createdAt: String? - - public var meta: [String: Any]? - - public var updatedAt: String? - - public var personalized: Bool? - - public var campaign: CampaignShortLink? - - public var redirects: Redirects? - - public var attribution: Attribution? - - public var socialMediaTags: SocialMediaTags? - - public var count: Int? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case url = "url" - - case createdBy = "created_by" - - case appRedirect = "app_redirect" - - case fallback = "fallback" - - case active = "active" - - case id = "_id" - - case enableTracking = "enable_tracking" - - case expireAt = "expire_at" - - case application = "application" - - case userId = "user_id" - - case createdAt = "created_at" - - case meta = "meta" - - case updatedAt = "updated_at" - - case personalized = "personalized" - - case campaign = "campaign" - - case redirects = "redirects" - - case attribution = "attribution" - - case socialMediaTags = "social_media_tags" - - case count = "count" - - } - - public init(active: Bool?, application: String?, appRedirect: Bool?, attribution: Attribution?, campaign: CampaignShortLink?, count: Int?, createdAt: String?, createdBy: String?, enableTracking: Bool?, expireAt: String?, fallback: String?, meta: [String: Any]?, personalized: Bool?, redirects: Redirects?, socialMediaTags: SocialMediaTags?, title: String?, updatedAt: String?, url: UrlInfo?, userId: String?, id: String?) { - - self.title = title - - self.url = url - - self.createdBy = createdBy - - self.appRedirect = appRedirect - - self.fallback = fallback - - self.active = active - - self.id = id - - self.enableTracking = enableTracking - - self.expireAt = expireAt - - self.application = application - - self.userId = userId - - self.createdAt = createdAt - - self.meta = meta - - self.updatedAt = updatedAt - - self.personalized = personalized - - self.campaign = campaign - - self.redirects = redirects - - self.attribution = attribution - - self.socialMediaTags = socialMediaTags - - self.count = count - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(UrlInfo.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(String.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appRedirect = try container.decode(Bool.self, forKey: .appRedirect) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fallback = try container.decode(String.self, forKey: .fallback) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enableTracking = try container.decode(Bool.self, forKey: .enableTracking) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expireAt = try container.decode(String.self, forKey: .expireAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - personalized = try container.decode(Bool.self, forKey: .personalized) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - campaign = try container.decode(CampaignShortLink.self, forKey: .campaign) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - redirects = try container.decode(Redirects.self, forKey: .redirects) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attribution = try container.decode(Attribution.self, forKey: .attribution) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - socialMediaTags = try container.decode(SocialMediaTags.self, forKey: .socialMediaTags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(appRedirect, forKey: .appRedirect) - - - - try? container.encodeIfPresent(fallback, forKey: .fallback) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(enableTracking, forKey: .enableTracking) - - - - try? container.encodeIfPresent(expireAt, forKey: .expireAt) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(personalized, forKey: .personalized) - - - - try? container.encodeIfPresent(campaign, forKey: .campaign) - - - - try? container.encodeIfPresent(redirects, forKey: .redirects) - - - - try? container.encodeIfPresent(attribution, forKey: .attribution) - - - - try? container.encodeIfPresent(socialMediaTags, forKey: .socialMediaTags) - - - - try? container.encodeIfPresent(count, forKey: .count) - - - } - - } - - /* - Model: ShortLinkList - Used By: Share - */ - class ShortLinkList: Codable { - - public var items: [ShortLinkRes]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [ShortLinkRes]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([ShortLinkRes].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: ErrorRes - Used By: Share - */ - class ErrorRes: Codable { - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - - - /* - Model: FailedResponse - Used By: FileStorage - */ - class FailedResponse: Codable { - - public var message: String - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - message = try container.decode(String.self, forKey: .message) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: CDN - Used By: FileStorage - */ - class CDN: Codable { - - public var url: String - - - public enum CodingKeys: String, CodingKey { - - case url = "url" - - } - - public init(url: String) { - - self.url = url - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - url = try container.decode(String.self, forKey: .url) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(url, forKey: .url) - - - } - - } - - /* - Model: Upload - Used By: FileStorage - */ - class Upload: Codable { - - public var expiry: Int - - public var url: String - - - public enum CodingKeys: String, CodingKey { - - case expiry = "expiry" - - case url = "url" - - } - - public init(expiry: Int, url: String) { - - self.expiry = expiry - - self.url = url - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - expiry = try container.decode(Int.self, forKey: .expiry) - - - - - url = try container.decode(String.self, forKey: .url) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(expiry, forKey: .expiry) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - } - - } - - /* - Model: StartResponse - Used By: FileStorage - */ - class StartResponse: Codable { - - public var fileName: String - - public var filePath: String - - public var contentType: String - - public var method: String - - public var namespace: String - - public var operation: String - - public var size: Int - - public var upload: Upload - - public var cdn: CDN - - public var tags: [String]? - - - public enum CodingKeys: String, CodingKey { - - case fileName = "file_name" - - case filePath = "file_path" - - case contentType = "content_type" - - case method = "method" - - case namespace = "namespace" - - case operation = "operation" - - case size = "size" - - case upload = "upload" - - case cdn = "cdn" - - case tags = "tags" - - } - - public init(cdn: CDN, contentType: String, fileName: String, filePath: String, method: String, namespace: String, operation: String, size: Int, tags: [String]?, upload: Upload) { - - self.fileName = fileName - - self.filePath = filePath - - self.contentType = contentType - - self.method = method - - self.namespace = namespace - - self.operation = operation - - self.size = size - - self.upload = upload - - self.cdn = cdn - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - fileName = try container.decode(String.self, forKey: .fileName) - - - - - filePath = try container.decode(String.self, forKey: .filePath) - - - - - contentType = try container.decode(String.self, forKey: .contentType) - - - - - method = try container.decode(String.self, forKey: .method) - - - - - namespace = try container.decode(String.self, forKey: .namespace) - - - - - operation = try container.decode(String.self, forKey: .operation) - - - - - size = try container.decode(Int.self, forKey: .size) - - - - - upload = try container.decode(Upload.self, forKey: .upload) - - - - - cdn = try container.decode(CDN.self, forKey: .cdn) - - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(fileName, forKey: .fileName) - - - - try? container.encodeIfPresent(filePath, forKey: .filePath) - - - - try? container.encodeIfPresent(contentType, forKey: .contentType) - - - - try? container.encodeIfPresent(method, forKey: .method) - - - - try? container.encodeIfPresent(namespace, forKey: .namespace) - - - - try? container.encodeIfPresent(operation, forKey: .operation) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(upload, forKey: .upload) - - - - try? container.encodeIfPresent(cdn, forKey: .cdn) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: StartRequest - Used By: FileStorage - */ - class StartRequest: Codable { - - public var fileName: String - - public var contentType: String - - public var size: Int - - public var tags: [String]? - - public var params: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case fileName = "file_name" - - case contentType = "content_type" - - case size = "size" - - case tags = "tags" - - case params = "params" - - } - - public init(contentType: String, fileName: String, params: [String: Any]?, size: Int, tags: [String]?) { - - self.fileName = fileName - - self.contentType = contentType - - self.size = size - - self.tags = tags - - self.params = params - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - fileName = try container.decode(String.self, forKey: .fileName) - - - - - contentType = try container.decode(String.self, forKey: .contentType) - - - - - size = try container.decode(Int.self, forKey: .size) - - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - params = try container.decode([String: Any].self, forKey: .params) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(fileName, forKey: .fileName) - - - - try? container.encodeIfPresent(contentType, forKey: .contentType) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(params, forKey: .params) - - - } - - } - - /* - Model: CompleteResponse - Used By: FileStorage - */ - class CompleteResponse: Codable { - - public var id: String - - public var fileName: String - - public var filePath: String - - public var contentType: String - - public var method: String - - public var namespace: String - - public var operation: String - - public var size: Int - - public var upload: Upload - - public var cdn: CDN - - public var success: String - - public var tags: [String]? - - public var createdOn: String - - public var modifiedOn: String - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case fileName = "file_name" - - case filePath = "file_path" - - case contentType = "content_type" - - case method = "method" - - case namespace = "namespace" - - case operation = "operation" - - case size = "size" - - case upload = "upload" - - case cdn = "cdn" - - case success = "success" - - case tags = "tags" - - case createdOn = "created_on" - - case modifiedOn = "modified_on" - - } - - public init(cdn: CDN, contentType: String, createdOn: String, fileName: String, filePath: String, method: String, modifiedOn: String, namespace: String, operation: String, size: Int, success: String, tags: [String]?, upload: Upload, id: String) { - - self.id = id - - self.fileName = fileName - - self.filePath = filePath - - self.contentType = contentType - - self.method = method - - self.namespace = namespace - - self.operation = operation - - self.size = size - - self.upload = upload - - self.cdn = cdn - - self.success = success - - self.tags = tags - - self.createdOn = createdOn - - self.modifiedOn = modifiedOn - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - id = try container.decode(String.self, forKey: .id) - - - - - fileName = try container.decode(String.self, forKey: .fileName) - - - - - filePath = try container.decode(String.self, forKey: .filePath) - - - - - contentType = try container.decode(String.self, forKey: .contentType) - - - - - method = try container.decode(String.self, forKey: .method) - - - - - namespace = try container.decode(String.self, forKey: .namespace) - - - - - operation = try container.decode(String.self, forKey: .operation) - - - - - size = try container.decode(Int.self, forKey: .size) - - - - - upload = try container.decode(Upload.self, forKey: .upload) - - - - - cdn = try container.decode(CDN.self, forKey: .cdn) - - - - - success = try container.decode(String.self, forKey: .success) - - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - createdOn = try container.decode(String.self, forKey: .createdOn) - - - - - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(fileName, forKey: .fileName) - - - - try? container.encodeIfPresent(filePath, forKey: .filePath) - - - - try? container.encodeIfPresent(contentType, forKey: .contentType) - - - - try? container.encodeIfPresent(method, forKey: .method) - - - - try? container.encodeIfPresent(namespace, forKey: .namespace) - - - - try? container.encodeIfPresent(operation, forKey: .operation) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(upload, forKey: .upload) - - - - try? container.encodeIfPresent(cdn, forKey: .cdn) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - } - - } - - /* - Model: Opts - Used By: FileStorage - */ - class Opts: Codable { - - public var attempts: Int? - - public var timestamp: Int? - - public var delay: Int? - - - public enum CodingKeys: String, CodingKey { - - case attempts = "attempts" - - case timestamp = "timestamp" - - case delay = "delay" - - } - - public init(attempts: Int?, delay: Int?, timestamp: Int?) { - - self.attempts = attempts - - self.timestamp = timestamp - - self.delay = delay - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - attempts = try container.decode(Int.self, forKey: .attempts) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - timestamp = try container.decode(Int.self, forKey: .timestamp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - delay = try container.decode(Int.self, forKey: .delay) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(attempts, forKey: .attempts) - - - - try? container.encodeIfPresent(timestamp, forKey: .timestamp) - - - - try? container.encodeIfPresent(delay, forKey: .delay) - - - } - - } - - /* - Model: CopyFileTask - Used By: FileStorage - */ - class CopyFileTask: Codable { - - public var id: String - - public var name: String - - public var data: BulkRequest - - public var opts: Opts - - public var progress: Int - - public var delay: Int - - public var timestamp: Int - - public var attemptsMade: Int - - public var stacktrace: [String]? - - public var finishedOn: Int - - public var processedOn: Int - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case name = "name" - - case data = "data" - - case opts = "opts" - - case progress = "progress" - - case delay = "delay" - - case timestamp = "timestamp" - - case attemptsMade = "attempts_made" - - case stacktrace = "stacktrace" - - case finishedOn = "finished_on" - - case processedOn = "processed_on" - - } - - public init(attemptsMade: Int, data: BulkRequest, delay: Int, finishedOn: Int, id: String, name: String, opts: Opts, processedOn: Int, progress: Int, stacktrace: [String]?, timestamp: Int) { - - self.id = id - - self.name = name - - self.data = data - - self.opts = opts - - self.progress = progress - - self.delay = delay - - self.timestamp = timestamp - - self.attemptsMade = attemptsMade - - self.stacktrace = stacktrace - - self.finishedOn = finishedOn - - self.processedOn = processedOn - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - id = try container.decode(String.self, forKey: .id) - - - - - name = try container.decode(String.self, forKey: .name) - - - - - data = try container.decode(BulkRequest.self, forKey: .data) - - - - - opts = try container.decode(Opts.self, forKey: .opts) - - - - - progress = try container.decode(Int.self, forKey: .progress) - - - - - delay = try container.decode(Int.self, forKey: .delay) - - - - - timestamp = try container.decode(Int.self, forKey: .timestamp) - - - - - attemptsMade = try container.decode(Int.self, forKey: .attemptsMade) - - - - - do { - stacktrace = try container.decode([String].self, forKey: .stacktrace) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - finishedOn = try container.decode(Int.self, forKey: .finishedOn) - - - - - processedOn = try container.decode(Int.self, forKey: .processedOn) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - - try? container.encodeIfPresent(opts, forKey: .opts) - - - - try? container.encodeIfPresent(progress, forKey: .progress) - - - - try? container.encodeIfPresent(delay, forKey: .delay) - - - - try? container.encodeIfPresent(timestamp, forKey: .timestamp) - - - - try? container.encodeIfPresent(attemptsMade, forKey: .attemptsMade) - - - - try? container.encodeIfPresent(stacktrace, forKey: .stacktrace) - - - - try? container.encodeIfPresent(finishedOn, forKey: .finishedOn) - - - - try? container.encodeIfPresent(processedOn, forKey: .processedOn) - - - } - - } - - /* - Model: BulkResponse - Used By: FileStorage - */ - class BulkResponse: Codable { - - public var trackingUrl: String - - public var task: CopyFileTask - - - public enum CodingKeys: String, CodingKey { - - case trackingUrl = "tracking_url" - - case task = "task" - - } - - public init(task: CopyFileTask, trackingUrl: String) { - - self.trackingUrl = trackingUrl - - self.task = task - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - trackingUrl = try container.decode(String.self, forKey: .trackingUrl) - - - - - task = try container.decode(CopyFileTask.self, forKey: .task) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(trackingUrl, forKey: .trackingUrl) - - - - try? container.encodeIfPresent(task, forKey: .task) - - - } - - } - - /* - Model: ReqConfiguration - Used By: FileStorage - */ - class ReqConfiguration: Codable { - - public var concurrency: Int? - - - public enum CodingKeys: String, CodingKey { - - case concurrency = "concurrency" - - } - - public init(concurrency: Int?) { - - self.concurrency = concurrency - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - concurrency = try container.decode(Int.self, forKey: .concurrency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(concurrency, forKey: .concurrency) - - - } - - } - - /* - Model: Destination - Used By: FileStorage - */ - class Destination: Codable { - - public var namespace: String - - public var rewrite: String - - public var basepath: String? - - - public enum CodingKeys: String, CodingKey { - - case namespace = "namespace" - - case rewrite = "rewrite" - - case basepath = "basepath" - - } - - public init(basepath: String?, namespace: String, rewrite: String) { - - self.namespace = namespace - - self.rewrite = rewrite - - self.basepath = basepath - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - namespace = try container.decode(String.self, forKey: .namespace) - - - - - rewrite = try container.decode(String.self, forKey: .rewrite) - - - - - do { - basepath = try container.decode(String.self, forKey: .basepath) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(namespace, forKey: .namespace) - - - - try? container.encodeIfPresent(rewrite, forKey: .rewrite) - - - - try? container.encodeIfPresent(basepath, forKey: .basepath) - - - } - - } - - /* - Model: BulkRequest - Used By: FileStorage - */ - class BulkRequest: Codable { - - public var urls: [String] - - public var destination: Destination - - public var configuration: ReqConfiguration? - - - public enum CodingKeys: String, CodingKey { - - case urls = "urls" - - case destination = "destination" - - case configuration = "configuration" - - } - - public init(configuration: ReqConfiguration?, destination: Destination, urls: [String]) { - - self.urls = urls - - self.destination = destination - - self.configuration = configuration - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - urls = try container.decode([String].self, forKey: .urls) - - - - - destination = try container.decode(Destination.self, forKey: .destination) - - - - - do { - configuration = try container.decode(ReqConfiguration.self, forKey: .configuration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(urls, forKey: .urls) - - - - try? container.encodeIfPresent(destination, forKey: .destination) - - - - try? container.encodeIfPresent(configuration, forKey: .configuration) - - - } - - } - - /* - Model: Urls - Used By: FileStorage - */ - class Urls: Codable { - - public var url: String - - public var signedUrl: String - - public var expiry: Int - - - public enum CodingKeys: String, CodingKey { - - case url = "url" - - case signedUrl = "signed_url" - - case expiry = "expiry" - - } - - public init(expiry: Int, signedUrl: String, url: String) { - - self.url = url - - self.signedUrl = signedUrl - - self.expiry = expiry - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - url = try container.decode(String.self, forKey: .url) - - - - - signedUrl = try container.decode(String.self, forKey: .signedUrl) - - - - - expiry = try container.decode(Int.self, forKey: .expiry) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(signedUrl, forKey: .signedUrl) - - - - try? container.encodeIfPresent(expiry, forKey: .expiry) - - - } - - } - - /* - Model: SignUrlResponse - Used By: FileStorage - */ - class SignUrlResponse: Codable { - - public var urls: [Urls] - - - public enum CodingKeys: String, CodingKey { - - case urls = "urls" - - } - - public init(urls: [Urls]) { - - self.urls = urls - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - urls = try container.decode([Urls].self, forKey: .urls) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(urls, forKey: .urls) - - - } - - } - - /* - Model: SignUrlRequest - Used By: FileStorage - */ - class SignUrlRequest: Codable { - - public var expiry: Int - - public var urls: [String] - - - public enum CodingKeys: String, CodingKey { - - case expiry = "expiry" - - case urls = "urls" - - } - - public init(expiry: Int, urls: [String]) { - - self.expiry = expiry - - self.urls = urls - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - expiry = try container.decode(Int.self, forKey: .expiry) - - - - - urls = try container.decode([String].self, forKey: .urls) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(expiry, forKey: .expiry) - - - - try? container.encodeIfPresent(urls, forKey: .urls) - - - } - - } - - /* - Model: DbRecord - Used By: FileStorage - */ - class DbRecord: Codable { - - public var success: Bool - - public var tags: [String] - - public var id: String - - public var fileName: String - - public var operation: String? - - public var namespace: String - - public var contentType: String - - public var filePath: String - - public var upload: Upload - - public var cdn: CDN - - public var createdOn: String - - public var modifiedOn: String - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case tags = "tags" - - case id = "_id" - - case fileName = "file_name" - - case operation = "operation" - - case namespace = "namespace" - - case contentType = "content_type" - - case filePath = "file_path" - - case upload = "upload" - - case cdn = "cdn" - - case createdOn = "created_on" - - case modifiedOn = "modified_on" - - } - - public init(cdn: CDN, contentType: String, createdOn: String, fileName: String, filePath: String, modifiedOn: String, namespace: String, operation: String?, success: Bool, tags: [String], upload: Upload, id: String) { - - self.success = success - - self.tags = tags - - self.id = id - - self.fileName = fileName - - self.operation = operation - - self.namespace = namespace - - self.contentType = contentType - - self.filePath = filePath - - self.upload = upload - - self.cdn = cdn - - self.createdOn = createdOn - - self.modifiedOn = modifiedOn - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - tags = try container.decode([String].self, forKey: .tags) - - - - - id = try container.decode(String.self, forKey: .id) - - - - - fileName = try container.decode(String.self, forKey: .fileName) - - - - - do { - operation = try container.decode(String.self, forKey: .operation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - namespace = try container.decode(String.self, forKey: .namespace) - - - - - contentType = try container.decode(String.self, forKey: .contentType) - - - - - filePath = try container.decode(String.self, forKey: .filePath) - - - - - upload = try container.decode(Upload.self, forKey: .upload) - - - - - cdn = try container.decode(CDN.self, forKey: .cdn) - - - - - createdOn = try container.decode(String.self, forKey: .createdOn) - - - - - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(fileName, forKey: .fileName) - - - - try? container.encodeIfPresent(operation, forKey: .operation) - - - - try? container.encodeIfPresent(namespace, forKey: .namespace) - - - - try? container.encodeIfPresent(contentType, forKey: .contentType) - - - - try? container.encodeIfPresent(filePath, forKey: .filePath) - - - - try? container.encodeIfPresent(upload, forKey: .upload) - - - - try? container.encodeIfPresent(cdn, forKey: .cdn) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - } - - } - - /* - Model: BrowseResponse - Used By: FileStorage - */ - class BrowseResponse: Codable { - - public var items: [DbRecord] - - public var page: Page - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [DbRecord], page: Page) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - items = try container.decode([DbRecord].self, forKey: .items) - - - - - page = try container.decode(Page.self, forKey: .page) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - - - /* - Model: ApplicationAboutResponse - Used By: Configuration - */ - class ApplicationAboutResponse: Codable { - - public var applicationInfo: ApplicationInfo? - - public var companyInfo: CompanyInfo? - - public var ownerInfo: OwnerInfo? - - - public enum CodingKeys: String, CodingKey { - - case applicationInfo = "application_info" - - case companyInfo = "company_info" - - case ownerInfo = "owner_info" - - } - - public init(applicationInfo: ApplicationInfo?, companyInfo: CompanyInfo?, ownerInfo: OwnerInfo?) { - - self.applicationInfo = applicationInfo - - self.companyInfo = companyInfo - - self.ownerInfo = ownerInfo - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - applicationInfo = try container.decode(ApplicationInfo.self, forKey: .applicationInfo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyInfo = try container.decode(CompanyInfo.self, forKey: .companyInfo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ownerInfo = try container.decode(OwnerInfo.self, forKey: .ownerInfo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(applicationInfo, forKey: .applicationInfo) - - - - try? container.encodeIfPresent(companyInfo, forKey: .companyInfo) - - - - try? container.encodeIfPresent(ownerInfo, forKey: .ownerInfo) - - - } - - } - - /* - Model: ApplicationInfo - Used By: Configuration - */ - class ApplicationInfo: Codable { - - public var id: String? - - public var domain: Domain? - - public var website: ApplicationWebsite? - - public var cors: ApplicationCors? - - public var description: String? - - public var name: String? - - public var meta: ApplicationMeta? - - public var token: String? - - public var secret: String? - - public var createdAt: String? - - public var banner: SecureUrl? - - public var logo: SecureUrl? - - public var isActive: Bool? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case domain = "domain" - - case website = "website" - - case cors = "cors" - - case description = "description" - - case name = "name" - - case meta = "meta" - - case token = "token" - - case secret = "secret" - - case createdAt = "created_at" - - case banner = "banner" - - case logo = "logo" - - case isActive = "is_active" - - } - - public init(banner: SecureUrl?, cors: ApplicationCors?, createdAt: String?, description: String?, domain: Domain?, isActive: Bool?, logo: SecureUrl?, meta: ApplicationMeta?, name: String?, secret: String?, token: String?, website: ApplicationWebsite?, id: String?) { - - self.id = id - - self.domain = domain - - self.website = website - - self.cors = cors - - self.description = description - - self.name = name - - self.meta = meta - - self.token = token - - self.secret = secret - - self.createdAt = createdAt - - self.banner = banner - - self.logo = logo - - self.isActive = isActive - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - domain = try container.decode(Domain.self, forKey: .domain) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - website = try container.decode(ApplicationWebsite.self, forKey: .website) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cors = try container.decode(ApplicationCors.self, forKey: .cors) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode(ApplicationMeta.self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - token = try container.decode(String.self, forKey: .token) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - secret = try container.decode(String.self, forKey: .secret) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - banner = try container.decode(SecureUrl.self, forKey: .banner) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(SecureUrl.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(domain, forKey: .domain) - - - - try? container.encodeIfPresent(website, forKey: .website) - - - - try? container.encodeIfPresent(cors, forKey: .cors) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(token, forKey: .token) - - - - try? container.encodeIfPresent(secret, forKey: .secret) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(banner, forKey: .banner) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - } - - } - - /* - Model: CompanyInfo - Used By: Configuration - */ - class CompanyInfo: Codable { - - public var id: String? - - public var uid: Int? - - public var createdOn: String? - - public var isActive: Bool? - - public var name: String? - - public var addresses: [CompanyAboutAddress]? - - public var notificationEmails: [String]? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case uid = "uid" - - case createdOn = "created_on" - - case isActive = "is_active" - - case name = "name" - - case addresses = "addresses" - - case notificationEmails = "notification_emails" - - } - - public init(addresses: [CompanyAboutAddress]?, createdOn: String?, isActive: Bool?, name: String?, notificationEmails: [String]?, uid: Int?, id: String?) { - - self.id = id - - self.uid = uid - - self.createdOn = createdOn - - self.isActive = isActive - - self.name = name - - self.addresses = addresses - - self.notificationEmails = notificationEmails - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addresses = try container.decode([CompanyAboutAddress].self, forKey: .addresses) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - notificationEmails = try container.decode([String].self, forKey: .notificationEmails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(addresses, forKey: .addresses) - - - - try? container.encodeIfPresent(notificationEmails, forKey: .notificationEmails) - - - } - - } - - /* - Model: OwnerInfo - Used By: Configuration - */ - class OwnerInfo: Codable { - - public var id: String? - - public var emails: [UserEmail]? - - public var phoneNumbers: [UserPhoneNumber]? - - public var firstName: String? - - public var lastName: String? - - public var profilePic: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case emails = "emails" - - case phoneNumbers = "phone_numbers" - - case firstName = "first_name" - - case lastName = "last_name" - - case profilePic = "profile_pic" - - } - - public init(emails: [UserEmail]?, firstName: String?, lastName: String?, phoneNumbers: [UserPhoneNumber]?, profilePic: String?, id: String?) { - - self.id = id - - self.emails = emails - - self.phoneNumbers = phoneNumbers - - self.firstName = firstName - - self.lastName = lastName - - self.profilePic = profilePic - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - emails = try container.decode([UserEmail].self, forKey: .emails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phoneNumbers = try container.decode([UserPhoneNumber].self, forKey: .phoneNumbers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - profilePic = try container.decode(String.self, forKey: .profilePic) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(emails, forKey: .emails) - - - - try? container.encodeIfPresent(phoneNumbers, forKey: .phoneNumbers) - - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(profilePic, forKey: .profilePic) - - - } - - } - - /* - Model: AppVersionRequest - Used By: Configuration - */ - class AppVersionRequest: Codable { - - public var application: ApplicationVersionRequest - - public var device: Device - - public var locale: String? - - public var timezone: String? - - - public enum CodingKeys: String, CodingKey { - - case application = "application" - - case device = "device" - - case locale = "locale" - - case timezone = "timezone" - - } - - public init(application: ApplicationVersionRequest, device: Device, locale: String?, timezone: String?) { - - self.application = application - - self.device = device - - self.locale = locale - - self.timezone = timezone - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - application = try container.decode(ApplicationVersionRequest.self, forKey: .application) - - - - - device = try container.decode(Device.self, forKey: .device) - - - - - do { - locale = try container.decode(String.self, forKey: .locale) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - timezone = try container.decode(String.self, forKey: .timezone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(device, forKey: .device) - - - - try? container.encodeIfPresent(locale, forKey: .locale) - - - - try? container.encodeIfPresent(timezone, forKey: .timezone) - - - } - - } - - /* - Model: ApplicationVersionRequest - Used By: Configuration - */ - class ApplicationVersionRequest: Codable { - - public var id: String? - - public var name: String - - public var namespace: String? - - public var token: String? - - public var version: String - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case name = "name" - - case namespace = "namespace" - - case token = "token" - - case version = "version" - - } - - public init(id: String?, name: String, namespace: String?, token: String?, version: String) { - - self.id = id - - self.name = name - - self.namespace = namespace - - self.token = token - - self.version = version - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - - do { - namespace = try container.decode(String.self, forKey: .namespace) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - token = try container.decode(String.self, forKey: .token) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - version = try container.decode(String.self, forKey: .version) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(namespace, forKey: .namespace) - - - - try? container.encodeIfPresent(token, forKey: .token) - - - - try? container.encodeIfPresent(version, forKey: .version) - - - } - - } - - /* - Model: Device - Used By: Configuration - */ - class Device: Codable { - - public var build: Int? - - public var model: String? - - public var os: OS - - - public enum CodingKeys: String, CodingKey { - - case build = "build" - - case model = "model" - - case os = "os" - - } - - public init(build: Int?, model: String?, os: OS) { - - self.build = build - - self.model = model - - self.os = os - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - build = try container.decode(Int.self, forKey: .build) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - model = try container.decode(String.self, forKey: .model) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - os = try container.decode(OS.self, forKey: .os) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(build, forKey: .build) - - - - try? container.encodeIfPresent(model, forKey: .model) - - - - try? container.encodeIfPresent(os, forKey: .os) - - - } - - } - - /* - Model: OS - Used By: Configuration - */ - class OS: Codable { - - public var name: String - - public var version: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case version = "version" - - } - - public init(name: String, version: String?) { - - self.name = name - - self.version = version - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - name = try container.decode(String.self, forKey: .name) - - - - - do { - version = try container.decode(String.self, forKey: .version) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(version, forKey: .version) - - - } - - } - - /* - Model: SupportedLanguage - Used By: Configuration - */ - class SupportedLanguage: Codable { - - public var name: String? - - public var code: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case code = "code" - - } - - public init(code: String?, name: String?) { - - self.name = name - - self.code = code - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - } - - } - - /* - Model: LanguageResponse - Used By: Configuration - */ - class LanguageResponse: Codable { - - public var items: [SupportedLanguage]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - } - - public init(items: [SupportedLanguage]?) { - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([SupportedLanguage].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: AppStaffResponse - Used By: Configuration - */ - class AppStaffResponse: Codable { - - public var staffUsers: [AppStaff]? - - - public enum CodingKeys: String, CodingKey { - - case staffUsers = "staff_users" - - } - - public init(staffUsers: [AppStaff]?) { - - self.staffUsers = staffUsers - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - staffUsers = try container.decode([AppStaff].self, forKey: .staffUsers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(staffUsers, forKey: .staffUsers) - - - } - - } - - /* - Model: UpdateDialog - Used By: Configuration - */ - class UpdateDialog: Codable { - - public var type: String? - - public var interval: Int? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case interval = "interval" - - } - - public init(interval: Int?, type: String?) { - - self.type = type - - self.interval = interval - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - interval = try container.decode(Int.self, forKey: .interval) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(interval, forKey: .interval) - - - } - - } - - /* - Model: OrderingStoreSelectRequest - Used By: Configuration - */ - class OrderingStoreSelectRequest: Codable { - - public var orderingStore: OrderingStoreSelect - - - public enum CodingKeys: String, CodingKey { - - case orderingStore = "ordering_store" - - } - - public init(orderingStore: OrderingStoreSelect) { - - self.orderingStore = orderingStore - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - orderingStore = try container.decode(OrderingStoreSelect.self, forKey: .orderingStore) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(orderingStore, forKey: .orderingStore) - - - } - - } - - /* - Model: OrderingStoreSelect - Used By: Configuration - */ - class OrderingStoreSelect: Codable { - - public var uid: Int - - - public enum CodingKeys: String, CodingKey { - - case uid = "uid" - - } - - public init(uid: Int) { - - self.uid = uid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - uid = try container.decode(Int.self, forKey: .uid) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - } - - } - - /* - Model: AppStaff - Used By: Configuration - */ - class AppStaff: Codable { - - public var id: String? - - public var orderIncent: Bool? - - public var stores: [Int]? - - public var application: String? - - public var title: String? - - public var user: String? - - public var employeeCode: String? - - public var firstName: String? - - public var lastName: String? - - public var profilePicUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case orderIncent = "order_incent" - - case stores = "stores" - - case application = "application" - - case title = "title" - - case user = "user" - - case employeeCode = "employee_code" - - case firstName = "first_name" - - case lastName = "last_name" - - case profilePicUrl = "profile_pic_url" - - } - - public init(application: String?, employeeCode: String?, firstName: String?, lastName: String?, orderIncent: Bool?, profilePicUrl: String?, stores: [Int]?, title: String?, user: String?, id: String?) { - - self.id = id - - self.orderIncent = orderIncent - - self.stores = stores - - self.application = application - - self.title = title - - self.user = user - - self.employeeCode = employeeCode - - self.firstName = firstName - - self.lastName = lastName - - self.profilePicUrl = profilePicUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderIncent = try container.decode(Bool.self, forKey: .orderIncent) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stores = try container.decode([Int].self, forKey: .stores) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - user = try container.decode(String.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - employeeCode = try container.decode(String.self, forKey: .employeeCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - profilePicUrl = try container.decode(String.self, forKey: .profilePicUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(orderIncent, forKey: .orderIncent) - - - - try? container.encodeIfPresent(stores, forKey: .stores) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(employeeCode, forKey: .employeeCode) - - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(profilePicUrl, forKey: .profilePicUrl) - - - } - - } - - /* - Model: AppTokenResponse - Used By: Configuration - */ - class AppTokenResponse: Codable { - - public var tokens: Tokens? - - public var id: String? - - public var application: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case tokens = "tokens" - - case id = "_id" - - case application = "application" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case v = "__v" - - } - - public init(application: String?, createdAt: String?, tokens: Tokens?, updatedAt: String?, id: String?, v: Int?) { - - self.tokens = tokens - - self.id = id - - self.application = application - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - tokens = try container.decode(Tokens.self, forKey: .tokens) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(tokens, forKey: .tokens) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: Tokens - Used By: Configuration - */ - class Tokens: Codable { - - public var firebase: Firebase? - - public var moengage: Moengage? - - public var segment: Segment? - - public var gtm: Gtm? - - public var freshchat: Freshchat? - - public var safetynet: Safetynet? - - public var fyndRewards: FyndRewards? - - public var googleMap: GoogleMap? - - - public enum CodingKeys: String, CodingKey { - - case firebase = "firebase" - - case moengage = "moengage" - - case segment = "segment" - - case gtm = "gtm" - - case freshchat = "freshchat" - - case safetynet = "safetynet" - - case fyndRewards = "fynd_rewards" - - case googleMap = "google_map" - - } - - public init(firebase: Firebase?, freshchat: Freshchat?, fyndRewards: FyndRewards?, googleMap: GoogleMap?, gtm: Gtm?, moengage: Moengage?, safetynet: Safetynet?, segment: Segment?) { - - self.firebase = firebase - - self.moengage = moengage - - self.segment = segment - - self.gtm = gtm - - self.freshchat = freshchat - - self.safetynet = safetynet - - self.fyndRewards = fyndRewards - - self.googleMap = googleMap - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - firebase = try container.decode(Firebase.self, forKey: .firebase) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - moengage = try container.decode(Moengage.self, forKey: .moengage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - segment = try container.decode(Segment.self, forKey: .segment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gtm = try container.decode(Gtm.self, forKey: .gtm) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - freshchat = try container.decode(Freshchat.self, forKey: .freshchat) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - safetynet = try container.decode(Safetynet.self, forKey: .safetynet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fyndRewards = try container.decode(FyndRewards.self, forKey: .fyndRewards) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - googleMap = try container.decode(GoogleMap.self, forKey: .googleMap) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(firebase, forKey: .firebase) - - - - try? container.encodeIfPresent(moengage, forKey: .moengage) - - - - try? container.encodeIfPresent(segment, forKey: .segment) - - - - try? container.encodeIfPresent(gtm, forKey: .gtm) - - - - try? container.encodeIfPresent(freshchat, forKey: .freshchat) - - - - try? container.encodeIfPresent(safetynet, forKey: .safetynet) - - - - try? container.encodeIfPresent(fyndRewards, forKey: .fyndRewards) - - - - try? container.encodeIfPresent(googleMap, forKey: .googleMap) - - - } - - } - - /* - Model: Firebase - Used By: Configuration - */ - class Firebase: Codable { - - public var credentials: Credentials? - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case credentials = "credentials" - - case enabled = "enabled" - - } - - public init(credentials: Credentials?, enabled: Bool?) { - - self.credentials = credentials - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - credentials = try container.decode(Credentials.self, forKey: .credentials) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(credentials, forKey: .credentials) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: Credentials - Used By: Configuration - */ - class Credentials: Codable { - - public var ios: Ios? - - public var android: Android? - - public var projectId: String? - - public var gcmSenderId: String? - - public var applicationId: String? - - public var apiKey: String? - - - public enum CodingKeys: String, CodingKey { - - case ios = "ios" - - case android = "android" - - case projectId = "project_id" - - case gcmSenderId = "gcm_sender_id" - - case applicationId = "application_id" - - case apiKey = "api_key" - - } - - public init(android: Android?, apiKey: String?, applicationId: String?, gcmSenderId: String?, ios: Ios?, projectId: String?) { - - self.ios = ios - - self.android = android - - self.projectId = projectId - - self.gcmSenderId = gcmSenderId - - self.applicationId = applicationId - - self.apiKey = apiKey - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - ios = try container.decode(Ios.self, forKey: .ios) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - android = try container.decode(Android.self, forKey: .android) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - projectId = try container.decode(String.self, forKey: .projectId) - - if let strong_projectId = projectId, - let projectIdData = Data(base64Encoded: strong_projectId) { - projectId = String(data: projectIdData, encoding: .utf8) ?? projectId - } - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gcmSenderId = try container.decode(String.self, forKey: .gcmSenderId) - - if let strong_gcmSenderId = gcmSenderId, - let gcmSenderIdData = Data(base64Encoded: strong_gcmSenderId) { - gcmSenderId = String(data: gcmSenderIdData, encoding: .utf8) ?? gcmSenderId - } - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - applicationId = try container.decode(String.self, forKey: .applicationId) - - if let strong_applicationId = applicationId, - let applicationIdData = Data(base64Encoded: strong_applicationId) { - applicationId = String(data: applicationIdData, encoding: .utf8) ?? applicationId - } - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - apiKey = try container.decode(String.self, forKey: .apiKey) - - if let strong_apiKey = apiKey, - let apiKeyData = Data(base64Encoded: strong_apiKey) { - apiKey = String(data: apiKeyData, encoding: .utf8) ?? apiKey - } - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(ios, forKey: .ios) - - - - try? container.encodeIfPresent(android, forKey: .android) - - - - - try? container.encodeIfPresent(projectId?.asBase64, forKey: .projectId) - - - - - - try? container.encodeIfPresent(gcmSenderId?.asBase64, forKey: .gcmSenderId) - - - - - - try? container.encodeIfPresent(applicationId?.asBase64, forKey: .applicationId) - - - - - - try? container.encodeIfPresent(apiKey?.asBase64, forKey: .apiKey) - - - - } - - } - - /* - Model: Ios - Used By: Configuration - */ - class Ios: Codable { - - public var applicationId: String? - - public var apiKey: String? - - - public enum CodingKeys: String, CodingKey { - - case applicationId = "application_id" - - case apiKey = "api_key" - - } - - public init(apiKey: String?, applicationId: String?) { - - self.applicationId = applicationId - - self.apiKey = apiKey - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - applicationId = try container.decode(String.self, forKey: .applicationId) - - if let strong_applicationId = applicationId, - let applicationIdData = Data(base64Encoded: strong_applicationId) { - applicationId = String(data: applicationIdData, encoding: .utf8) ?? applicationId - } - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - apiKey = try container.decode(String.self, forKey: .apiKey) - - if let strong_apiKey = apiKey, - let apiKeyData = Data(base64Encoded: strong_apiKey) { - apiKey = String(data: apiKeyData, encoding: .utf8) ?? apiKey - } - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - - try? container.encodeIfPresent(applicationId?.asBase64, forKey: .applicationId) - - - - - - try? container.encodeIfPresent(apiKey?.asBase64, forKey: .apiKey) - - - - } - - } - - /* - Model: Android - Used By: Configuration - */ - class Android: Codable { - - public var applicationId: String? - - public var apiKey: String? - - - public enum CodingKeys: String, CodingKey { - - case applicationId = "application_id" - - case apiKey = "api_key" - - } - - public init(apiKey: String?, applicationId: String?) { - - self.applicationId = applicationId - - self.apiKey = apiKey - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - applicationId = try container.decode(String.self, forKey: .applicationId) - - if let strong_applicationId = applicationId, - let applicationIdData = Data(base64Encoded: strong_applicationId) { - applicationId = String(data: applicationIdData, encoding: .utf8) ?? applicationId - } - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - apiKey = try container.decode(String.self, forKey: .apiKey) - - if let strong_apiKey = apiKey, - let apiKeyData = Data(base64Encoded: strong_apiKey) { - apiKey = String(data: apiKeyData, encoding: .utf8) ?? apiKey - } - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - - try? container.encodeIfPresent(applicationId?.asBase64, forKey: .applicationId) - - - - - - try? container.encodeIfPresent(apiKey?.asBase64, forKey: .apiKey) - - - - } - - } - - /* - Model: Moengage - Used By: Configuration - */ - class Moengage: Codable { - - public var credentials: MoengageCredentials? - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case credentials = "credentials" - - case enabled = "enabled" - - } - - public init(credentials: MoengageCredentials?, enabled: Bool?) { - - self.credentials = credentials - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - credentials = try container.decode(MoengageCredentials.self, forKey: .credentials) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(credentials, forKey: .credentials) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: MoengageCredentials - Used By: Configuration - */ - class MoengageCredentials: Codable { - - public var appId: String? - - - public enum CodingKeys: String, CodingKey { - - case appId = "app_id" - - } - - public init(appId: String?) { - - self.appId = appId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - appId = try container.decode(String.self, forKey: .appId) - - if let strong_appId = appId, - let appIdData = Data(base64Encoded: strong_appId) { - appId = String(data: appIdData, encoding: .utf8) ?? appId - } - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - - try? container.encodeIfPresent(appId?.asBase64, forKey: .appId) - - - - } - - } - - /* - Model: Segment - Used By: Configuration - */ - class Segment: Codable { - - public var credentials: SegmentCredentials? - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case credentials = "credentials" - - case enabled = "enabled" - - } - - public init(credentials: SegmentCredentials?, enabled: Bool?) { - - self.credentials = credentials - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - credentials = try container.decode(SegmentCredentials.self, forKey: .credentials) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(credentials, forKey: .credentials) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: SegmentCredentials - Used By: Configuration - */ - class SegmentCredentials: Codable { - - public var writeKey: String? - - - public enum CodingKeys: String, CodingKey { - - case writeKey = "write_key" - - } - - public init(writeKey: String?) { - - self.writeKey = writeKey - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - writeKey = try container.decode(String.self, forKey: .writeKey) - - if let strong_writeKey = writeKey, - let writeKeyData = Data(base64Encoded: strong_writeKey) { - writeKey = String(data: writeKeyData, encoding: .utf8) ?? writeKey - } - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - - try? container.encodeIfPresent(writeKey?.asBase64, forKey: .writeKey) - - - - } - - } - - /* - Model: Gtm - Used By: Configuration - */ - class Gtm: Codable { - - public var credentials: GtmCredentials? - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case credentials = "credentials" - - case enabled = "enabled" - - } - - public init(credentials: GtmCredentials?, enabled: Bool?) { - - self.credentials = credentials - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - credentials = try container.decode(GtmCredentials.self, forKey: .credentials) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(credentials, forKey: .credentials) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: GtmCredentials - Used By: Configuration - */ - class GtmCredentials: Codable { - - public var apiKey: String? - - - public enum CodingKeys: String, CodingKey { - - case apiKey = "api_key" - - } - - public init(apiKey: String?) { - - self.apiKey = apiKey - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - apiKey = try container.decode(String.self, forKey: .apiKey) - - if let strong_apiKey = apiKey, - let apiKeyData = Data(base64Encoded: strong_apiKey) { - apiKey = String(data: apiKeyData, encoding: .utf8) ?? apiKey - } - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - - try? container.encodeIfPresent(apiKey?.asBase64, forKey: .apiKey) - - - - } - - } - - /* - Model: Freshchat - Used By: Configuration - */ - class Freshchat: Codable { - - public var credentials: FreshchatCredentials? - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case credentials = "credentials" - - case enabled = "enabled" - - } - - public init(credentials: FreshchatCredentials?, enabled: Bool?) { - - self.credentials = credentials - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - credentials = try container.decode(FreshchatCredentials.self, forKey: .credentials) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(credentials, forKey: .credentials) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: FreshchatCredentials - Used By: Configuration - */ - class FreshchatCredentials: Codable { - - public var appId: String? - - public var appKey: String? - - public var webToken: String? - - - public enum CodingKeys: String, CodingKey { - - case appId = "app_id" - - case appKey = "app_key" - - case webToken = "web_token" - - } - - public init(appId: String?, appKey: String?, webToken: String?) { - - self.appId = appId - - self.appKey = appKey - - self.webToken = webToken - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - appId = try container.decode(String.self, forKey: .appId) - - if let strong_appId = appId, - let appIdData = Data(base64Encoded: strong_appId) { - appId = String(data: appIdData, encoding: .utf8) ?? appId - } - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appKey = try container.decode(String.self, forKey: .appKey) - - if let strong_appKey = appKey, - let appKeyData = Data(base64Encoded: strong_appKey) { - appKey = String(data: appKeyData, encoding: .utf8) ?? appKey - } - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - webToken = try container.decode(String.self, forKey: .webToken) - - if let strong_webToken = webToken, - let webTokenData = Data(base64Encoded: strong_webToken) { - webToken = String(data: webTokenData, encoding: .utf8) ?? webToken - } - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - - try? container.encodeIfPresent(appId?.asBase64, forKey: .appId) - - - - - - try? container.encodeIfPresent(appKey?.asBase64, forKey: .appKey) - - - - - - try? container.encodeIfPresent(webToken?.asBase64, forKey: .webToken) - - - - } - - } - - /* - Model: Safetynet - Used By: Configuration - */ - class Safetynet: Codable { - - public var credentials: SafetynetCredentials? - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case credentials = "credentials" - - case enabled = "enabled" - - } - - public init(credentials: SafetynetCredentials?, enabled: Bool?) { - - self.credentials = credentials - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - credentials = try container.decode(SafetynetCredentials.self, forKey: .credentials) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(credentials, forKey: .credentials) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: SafetynetCredentials - Used By: Configuration - */ - class SafetynetCredentials: Codable { - - public var apiKey: String? - - - public enum CodingKeys: String, CodingKey { - - case apiKey = "api_key" - - } - - public init(apiKey: String?) { - - self.apiKey = apiKey - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - apiKey = try container.decode(String.self, forKey: .apiKey) - - if let strong_apiKey = apiKey, - let apiKeyData = Data(base64Encoded: strong_apiKey) { - apiKey = String(data: apiKeyData, encoding: .utf8) ?? apiKey - } - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - - try? container.encodeIfPresent(apiKey?.asBase64, forKey: .apiKey) - - - - } - - } - - /* - Model: FyndRewards - Used By: Configuration - */ - class FyndRewards: Codable { - - public var credentials: FyndRewardsCredentials? - - - public enum CodingKeys: String, CodingKey { - - case credentials = "credentials" - - } - - public init(credentials: FyndRewardsCredentials?) { - - self.credentials = credentials - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - credentials = try container.decode(FyndRewardsCredentials.self, forKey: .credentials) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(credentials, forKey: .credentials) - - - } - - } - - /* - Model: FyndRewardsCredentials - Used By: Configuration - */ - class FyndRewardsCredentials: Codable { - - public var publicKey: String? - - - public enum CodingKeys: String, CodingKey { - - case publicKey = "public_key" - - } - - public init(publicKey: String?) { - - self.publicKey = publicKey - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - publicKey = try container.decode(String.self, forKey: .publicKey) - - if let strong_publicKey = publicKey, - let publicKeyData = Data(base64Encoded: strong_publicKey) { - publicKey = String(data: publicKeyData, encoding: .utf8) ?? publicKey - } - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - - try? container.encodeIfPresent(publicKey?.asBase64, forKey: .publicKey) - - - - } - - } - - /* - Model: GoogleMap - Used By: Configuration - */ - class GoogleMap: Codable { - - public var credentials: GoogleMapCredentials? - - - public enum CodingKeys: String, CodingKey { - - case credentials = "credentials" - - } - - public init(credentials: GoogleMapCredentials?) { - - self.credentials = credentials - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - credentials = try container.decode(GoogleMapCredentials.self, forKey: .credentials) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(credentials, forKey: .credentials) - - - } - - } - - /* - Model: GoogleMapCredentials - Used By: Configuration - */ - class GoogleMapCredentials: Codable { - - public var apiKey: String? - - - public enum CodingKeys: String, CodingKey { - - case apiKey = "api_key" - - } - - public init(apiKey: String?) { - - self.apiKey = apiKey - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - apiKey = try container.decode(String.self, forKey: .apiKey) - - if let strong_apiKey = apiKey, - let apiKeyData = Data(base64Encoded: strong_apiKey) { - apiKey = String(data: apiKeyData, encoding: .utf8) ?? apiKey - } - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - - try? container.encodeIfPresent(apiKey?.asBase64, forKey: .apiKey) - - - - } - - } - - /* - Model: RewardPointsConfig - Used By: Configuration - */ - class RewardPointsConfig: Codable { - - public var credit: Credit? - - public var debit: Debit? - - - public enum CodingKeys: String, CodingKey { - - case credit = "credit" - - case debit = "debit" - - } - - public init(credit: Credit?, debit: Debit?) { - - self.credit = credit - - self.debit = debit - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - credit = try container.decode(Credit.self, forKey: .credit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - debit = try container.decode(Debit.self, forKey: .debit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(credit, forKey: .credit) - - - - try? container.encodeIfPresent(debit, forKey: .debit) - - - } - - } - - /* - Model: Credit - Used By: Configuration - */ - class Credit: Codable { - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - } - - public init(enabled: Bool?) { - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: Debit - Used By: Configuration - */ - class Debit: Codable { - - public var enabled: Bool? - - public var autoApply: Bool? - - public var strategyChannel: String? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - case autoApply = "auto_apply" - - case strategyChannel = "strategy_channel" - - } - - public init(autoApply: Bool?, enabled: Bool?, strategyChannel: String?) { - - self.enabled = enabled - - self.autoApply = autoApply - - self.strategyChannel = strategyChannel - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - autoApply = try container.decode(Bool.self, forKey: .autoApply) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - strategyChannel = try container.decode(String.self, forKey: .strategyChannel) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(autoApply, forKey: .autoApply) - - - - try? container.encodeIfPresent(strategyChannel, forKey: .strategyChannel) - - - } - - } - - /* - Model: ProductDetailFeature - Used By: Configuration - */ - class ProductDetailFeature: Codable { - - public var similar: [String]? - - public var sellerSelection: Bool? - - public var updateProductMeta: Bool? - - public var requestProduct: Bool? - - - public enum CodingKeys: String, CodingKey { - - case similar = "similar" - - case sellerSelection = "seller_selection" - - case updateProductMeta = "update_product_meta" - - case requestProduct = "request_product" - - } - - public init(requestProduct: Bool?, sellerSelection: Bool?, similar: [String]?, updateProductMeta: Bool?) { - - self.similar = similar - - self.sellerSelection = sellerSelection - - self.updateProductMeta = updateProductMeta - - self.requestProduct = requestProduct - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - similar = try container.decode([String].self, forKey: .similar) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sellerSelection = try container.decode(Bool.self, forKey: .sellerSelection) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updateProductMeta = try container.decode(Bool.self, forKey: .updateProductMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requestProduct = try container.decode(Bool.self, forKey: .requestProduct) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(similar, forKey: .similar) - - - - try? container.encodeIfPresent(sellerSelection, forKey: .sellerSelection) - - - - try? container.encodeIfPresent(updateProductMeta, forKey: .updateProductMeta) - - - - try? container.encodeIfPresent(requestProduct, forKey: .requestProduct) - - - } - - } - - /* - Model: LaunchPage - Used By: Configuration - */ - class LaunchPage: Codable { - - public var pageType: String? - - public var params: [String: Any]? - - public var query: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case pageType = "page_type" - - case params = "params" - - case query = "query" - - } - - public init(pageType: String?, params: [String: Any]?, query: [String: Any]?) { - - self.pageType = pageType - - self.params = params - - self.query = query - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pageType = try container.decode(String.self, forKey: .pageType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - params = try container.decode([String: Any].self, forKey: .params) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - query = try container.decode([String: Any].self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pageType, forKey: .pageType) - - - - try? container.encodeIfPresent(params, forKey: .params) - - - - try? container.encodeIfPresent(query, forKey: .query) - - - } - - } - - /* - Model: LandingPageFeature - Used By: Configuration - */ - class LandingPageFeature: Codable { - - public var launchPage: LaunchPage? - - public var continueAsGuest: Bool? - - public var loginBtnText: String? - - public var showDomainTextbox: Bool? - - public var showRegisterBtn: Bool? - - - public enum CodingKeys: String, CodingKey { - - case launchPage = "launch_page" - - case continueAsGuest = "continue_as_guest" - - case loginBtnText = "login_btn_text" - - case showDomainTextbox = "show_domain_textbox" - - case showRegisterBtn = "show_register_btn" - - } - - public init(continueAsGuest: Bool?, launchPage: LaunchPage?, loginBtnText: String?, showDomainTextbox: Bool?, showRegisterBtn: Bool?) { - - self.launchPage = launchPage - - self.continueAsGuest = continueAsGuest - - self.loginBtnText = loginBtnText - - self.showDomainTextbox = showDomainTextbox - - self.showRegisterBtn = showRegisterBtn - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - launchPage = try container.decode(LaunchPage.self, forKey: .launchPage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - continueAsGuest = try container.decode(Bool.self, forKey: .continueAsGuest) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - loginBtnText = try container.decode(String.self, forKey: .loginBtnText) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - showDomainTextbox = try container.decode(Bool.self, forKey: .showDomainTextbox) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - showRegisterBtn = try container.decode(Bool.self, forKey: .showRegisterBtn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(launchPage, forKey: .launchPage) - - - - try? container.encodeIfPresent(continueAsGuest, forKey: .continueAsGuest) - - - - try? container.encodeIfPresent(loginBtnText, forKey: .loginBtnText) - - - - try? container.encodeIfPresent(showDomainTextbox, forKey: .showDomainTextbox) - - - - try? container.encodeIfPresent(showRegisterBtn, forKey: .showRegisterBtn) - - - } - - } - - /* - Model: RegistrationPageFeature - Used By: Configuration - */ - class RegistrationPageFeature: Codable { - - public var askStoreAddress: Bool? - - - public enum CodingKeys: String, CodingKey { - - case askStoreAddress = "ask_store_address" - - } - - public init(askStoreAddress: Bool?) { - - self.askStoreAddress = askStoreAddress - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - askStoreAddress = try container.decode(Bool.self, forKey: .askStoreAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(askStoreAddress, forKey: .askStoreAddress) - - - } - - } - - /* - Model: AppFeature - Used By: Configuration - */ - class AppFeature: Codable { - - public var productDetail: ProductDetailFeature? - - public var landingPage: LandingPageFeature? - - public var registrationPage: RegistrationPageFeature? - - public var homePage: HomePageFeature? - - public var common: CommonFeature? - - public var cart: CartFeature? - - public var qr: QrFeature? - - public var pcr: PcrFeature? - - public var order: OrderFeature? - - public var id: String? - - public var app: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case productDetail = "product_detail" - - case landingPage = "landing_page" - - case registrationPage = "registration_page" - - case homePage = "home_page" - - case common = "common" - - case cart = "cart" - - case qr = "qr" - - case pcr = "pcr" - - case order = "order" - - case id = "_id" - - case app = "app" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case v = "__v" - - } - - public init(app: String?, cart: CartFeature?, common: CommonFeature?, createdAt: String?, homePage: HomePageFeature?, landingPage: LandingPageFeature?, order: OrderFeature?, pcr: PcrFeature?, productDetail: ProductDetailFeature?, qr: QrFeature?, registrationPage: RegistrationPageFeature?, updatedAt: String?, id: String?, v: Int?) { - - self.productDetail = productDetail - - self.landingPage = landingPage - - self.registrationPage = registrationPage - - self.homePage = homePage - - self.common = common - - self.cart = cart - - self.qr = qr - - self.pcr = pcr - - self.order = order - - self.id = id - - self.app = app - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - productDetail = try container.decode(ProductDetailFeature.self, forKey: .productDetail) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - landingPage = try container.decode(LandingPageFeature.self, forKey: .landingPage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registrationPage = try container.decode(RegistrationPageFeature.self, forKey: .registrationPage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - homePage = try container.decode(HomePageFeature.self, forKey: .homePage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - common = try container.decode(CommonFeature.self, forKey: .common) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cart = try container.decode(CartFeature.self, forKey: .cart) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - qr = try container.decode(QrFeature.self, forKey: .qr) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pcr = try container.decode(PcrFeature.self, forKey: .pcr) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - order = try container.decode(OrderFeature.self, forKey: .order) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - app = try container.decode(String.self, forKey: .app) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(productDetail, forKey: .productDetail) - - - - try? container.encodeIfPresent(landingPage, forKey: .landingPage) - - - - try? container.encodeIfPresent(registrationPage, forKey: .registrationPage) - - - - try? container.encodeIfPresent(homePage, forKey: .homePage) - - - - try? container.encodeIfPresent(common, forKey: .common) - - - - try? container.encodeIfPresent(cart, forKey: .cart) - - - - try? container.encodeIfPresent(qr, forKey: .qr) - - - - try? container.encodeIfPresent(pcr, forKey: .pcr) - - - - try? container.encodeIfPresent(order, forKey: .order) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(app, forKey: .app) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: HomePageFeature - Used By: Configuration - */ - class HomePageFeature: Codable { - - public var orderProcessing: Bool? - - - public enum CodingKeys: String, CodingKey { - - case orderProcessing = "order_processing" - - } - - public init(orderProcessing: Bool?) { - - self.orderProcessing = orderProcessing - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - orderProcessing = try container.decode(Bool.self, forKey: .orderProcessing) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(orderProcessing, forKey: .orderProcessing) - - - } - - } - - /* - Model: CommonFeature - Used By: Configuration - */ - class CommonFeature: Codable { - - public var communicationOptinDialog: CommunicationOptinDialogFeature? - - public var deploymentStoreSelection: DeploymentStoreSelectionFeature? - - public var listingPrice: ListingPriceFeature? - - public var currency: CurrencyFeature? - - public var revenueEngine: RevenueEngineFeature? - - public var feedback: FeedbackFeature? - - public var compareProducts: CompareProductsFeature? - - public var rewardPoints: RewardPointsConfig? - - - public enum CodingKeys: String, CodingKey { - - case communicationOptinDialog = "communication_optin_dialog" - - case deploymentStoreSelection = "deployment_store_selection" - - case listingPrice = "listing_price" - - case currency = "currency" - - case revenueEngine = "revenue_engine" - - case feedback = "feedback" - - case compareProducts = "compare_products" - - case rewardPoints = "reward_points" - - } - - public init(communicationOptinDialog: CommunicationOptinDialogFeature?, compareProducts: CompareProductsFeature?, currency: CurrencyFeature?, deploymentStoreSelection: DeploymentStoreSelectionFeature?, feedback: FeedbackFeature?, listingPrice: ListingPriceFeature?, revenueEngine: RevenueEngineFeature?, rewardPoints: RewardPointsConfig?) { - - self.communicationOptinDialog = communicationOptinDialog - - self.deploymentStoreSelection = deploymentStoreSelection - - self.listingPrice = listingPrice - - self.currency = currency - - self.revenueEngine = revenueEngine - - self.feedback = feedback - - self.compareProducts = compareProducts - - self.rewardPoints = rewardPoints - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - communicationOptinDialog = try container.decode(CommunicationOptinDialogFeature.self, forKey: .communicationOptinDialog) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deploymentStoreSelection = try container.decode(DeploymentStoreSelectionFeature.self, forKey: .deploymentStoreSelection) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - listingPrice = try container.decode(ListingPriceFeature.self, forKey: .listingPrice) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(CurrencyFeature.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - revenueEngine = try container.decode(RevenueEngineFeature.self, forKey: .revenueEngine) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - feedback = try container.decode(FeedbackFeature.self, forKey: .feedback) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - compareProducts = try container.decode(CompareProductsFeature.self, forKey: .compareProducts) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rewardPoints = try container.decode(RewardPointsConfig.self, forKey: .rewardPoints) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(communicationOptinDialog, forKey: .communicationOptinDialog) - - - - try? container.encodeIfPresent(deploymentStoreSelection, forKey: .deploymentStoreSelection) - - - - try? container.encodeIfPresent(listingPrice, forKey: .listingPrice) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(revenueEngine, forKey: .revenueEngine) - - - - try? container.encodeIfPresent(feedback, forKey: .feedback) - - - - try? container.encodeIfPresent(compareProducts, forKey: .compareProducts) - - - - try? container.encodeIfPresent(rewardPoints, forKey: .rewardPoints) - - - } - - } - - /* - Model: CommunicationOptinDialogFeature - Used By: Configuration - */ - class CommunicationOptinDialogFeature: Codable { - - public var visibility: Bool? - - - public enum CodingKeys: String, CodingKey { - - case visibility = "visibility" - - } - - public init(visibility: Bool?) { - - self.visibility = visibility - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - visibility = try container.decode(Bool.self, forKey: .visibility) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(visibility, forKey: .visibility) - - - } - - } - - /* - Model: DeploymentStoreSelectionFeature - Used By: Configuration - */ - class DeploymentStoreSelectionFeature: Codable { - - public var enabled: Bool? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - case type = "type" - - } - - public init(enabled: Bool?, type: String?) { - - self.enabled = enabled - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ListingPriceFeature - Used By: Configuration - */ - class ListingPriceFeature: Codable { - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case value = "value" - - } - - public init(value: String?) { - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: CurrencyFeature - Used By: Configuration - */ - class CurrencyFeature: Codable { - - public var value: [String]? - - public var type: String? - - public var defaultCurrency: String? - - - public enum CodingKeys: String, CodingKey { - - case value = "value" - - case type = "type" - - case defaultCurrency = "default_currency" - - } - - public init(defaultCurrency: String?, type: String?, value: [String]?) { - - self.value = value - - self.type = type - - self.defaultCurrency = defaultCurrency - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - value = try container.decode([String].self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - defaultCurrency = try container.decode(String.self, forKey: .defaultCurrency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(defaultCurrency, forKey: .defaultCurrency) - - - } - - } - - /* - Model: RevenueEngineFeature - Used By: Configuration - */ - class RevenueEngineFeature: Codable { - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - } - - public init(enabled: Bool?) { - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: FeedbackFeature - Used By: Configuration - */ - class FeedbackFeature: Codable { - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - } - - public init(enabled: Bool?) { - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: CompareProductsFeature - Used By: Configuration - */ - class CompareProductsFeature: Codable { - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - } - - public init(enabled: Bool?) { - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: CartFeature - Used By: Configuration - */ - class CartFeature: Codable { - - public var gstInput: Bool? - - public var staffSelection: Bool? - - public var placingForCustomer: Bool? - - public var googleMap: Bool? - - public var revenueEngineCoupon: Bool? - - - public enum CodingKeys: String, CodingKey { - - case gstInput = "gst_input" - - case staffSelection = "staff_selection" - - case placingForCustomer = "placing_for_customer" - - case googleMap = "google_map" - - case revenueEngineCoupon = "revenue_engine_coupon" - - } - - public init(googleMap: Bool?, gstInput: Bool?, placingForCustomer: Bool?, revenueEngineCoupon: Bool?, staffSelection: Bool?) { - - self.gstInput = gstInput - - self.staffSelection = staffSelection - - self.placingForCustomer = placingForCustomer - - self.googleMap = googleMap - - self.revenueEngineCoupon = revenueEngineCoupon - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - gstInput = try container.decode(Bool.self, forKey: .gstInput) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - staffSelection = try container.decode(Bool.self, forKey: .staffSelection) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - placingForCustomer = try container.decode(Bool.self, forKey: .placingForCustomer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - googleMap = try container.decode(Bool.self, forKey: .googleMap) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - revenueEngineCoupon = try container.decode(Bool.self, forKey: .revenueEngineCoupon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(gstInput, forKey: .gstInput) - - - - try? container.encodeIfPresent(staffSelection, forKey: .staffSelection) - - - - try? container.encodeIfPresent(placingForCustomer, forKey: .placingForCustomer) - - - - try? container.encodeIfPresent(googleMap, forKey: .googleMap) - - - - try? container.encodeIfPresent(revenueEngineCoupon, forKey: .revenueEngineCoupon) - - - } - - } - - /* - Model: QrFeature - Used By: Configuration - */ - class QrFeature: Codable { - - public var application: Bool? - - public var products: Bool? - - public var collections: Bool? - - - public enum CodingKeys: String, CodingKey { - - case application = "application" - - case products = "products" - - case collections = "collections" - - } - - public init(application: Bool?, collections: Bool?, products: Bool?) { - - self.application = application - - self.products = products - - self.collections = collections - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - application = try container.decode(Bool.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - products = try container.decode(Bool.self, forKey: .products) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - collections = try container.decode(Bool.self, forKey: .collections) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(products, forKey: .products) - - - - try? container.encodeIfPresent(collections, forKey: .collections) - - - } - - } - - /* - Model: PcrFeature - Used By: Configuration - */ - class PcrFeature: Codable { - - public var staffSelection: Bool? - - - public enum CodingKeys: String, CodingKey { - - case staffSelection = "staff_selection" - - } - - public init(staffSelection: Bool?) { - - self.staffSelection = staffSelection - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - staffSelection = try container.decode(Bool.self, forKey: .staffSelection) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(staffSelection, forKey: .staffSelection) - - - } - - } - - /* - Model: OrderFeature - Used By: Configuration - */ - class OrderFeature: Codable { - - public var buyAgain: Bool? - - - public enum CodingKeys: String, CodingKey { - - case buyAgain = "buy_again" - - } - - public init(buyAgain: Bool?) { - - self.buyAgain = buyAgain - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - buyAgain = try container.decode(Bool.self, forKey: .buyAgain) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(buyAgain, forKey: .buyAgain) - - - } - - } - - /* - Model: AppFeatureRequest - Used By: Configuration - */ - class AppFeatureRequest: Codable { - - public var feature: AppFeature? - - - public enum CodingKeys: String, CodingKey { - - case feature = "feature" - - } - - public init(feature: AppFeature?) { - - self.feature = feature - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - feature = try container.decode(AppFeature.self, forKey: .feature) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(feature, forKey: .feature) - - - } - - } - - /* - Model: AppFeatureResponse - Used By: Configuration - */ - class AppFeatureResponse: Codable { - - public var feature: AppFeature? - - - public enum CodingKeys: String, CodingKey { - - case feature = "feature" - - } - - public init(feature: AppFeature?) { - - self.feature = feature - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - feature = try container.decode(AppFeature.self, forKey: .feature) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(feature, forKey: .feature) - - - } - - } - - /* - Model: Currency - Used By: Configuration - */ - class Currency: Codable { - - public var id: String? - - public var isActive: Bool? - - public var name: String? - - public var code: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var decimalDigits: Int? - - public var symbol: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case isActive = "is_active" - - case name = "name" - - case code = "code" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case decimalDigits = "decimal_digits" - - case symbol = "symbol" - - } - - public init(code: String?, createdAt: String?, decimalDigits: Int?, isActive: Bool?, name: String?, symbol: String?, updatedAt: String?, id: String?) { - - self.id = id - - self.isActive = isActive - - self.name = name - - self.code = code - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.decimalDigits = decimalDigits - - self.symbol = symbol - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - decimalDigits = try container.decode(Int.self, forKey: .decimalDigits) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - symbol = try container.decode(String.self, forKey: .symbol) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(decimalDigits, forKey: .decimalDigits) - - - - try? container.encodeIfPresent(symbol, forKey: .symbol) - - - } - - } - - /* - Model: Domain - Used By: Configuration - */ - class Domain: Codable { - - public var verified: Bool? - - public var isPrimary: Bool? - - public var isDefault: Bool? - - public var isShortlink: Bool? - - public var id: String? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case verified = "verified" - - case isPrimary = "is_primary" - - case isDefault = "is_default" - - case isShortlink = "is_shortlink" - - case id = "_id" - - case name = "name" - - } - - public init(isDefault: Bool?, isPrimary: Bool?, isShortlink: Bool?, name: String?, verified: Bool?, id: String?) { - - self.verified = verified - - self.isPrimary = isPrimary - - self.isDefault = isDefault - - self.isShortlink = isShortlink - - self.id = id - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - verified = try container.decode(Bool.self, forKey: .verified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isPrimary = try container.decode(Bool.self, forKey: .isPrimary) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isDefault = try container.decode(Bool.self, forKey: .isDefault) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isShortlink = try container.decode(Bool.self, forKey: .isShortlink) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(verified, forKey: .verified) - - - - try? container.encodeIfPresent(isPrimary, forKey: .isPrimary) - - - - try? container.encodeIfPresent(isDefault, forKey: .isDefault) - - - - try? container.encodeIfPresent(isShortlink, forKey: .isShortlink) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: ApplicationWebsite - Used By: Configuration - */ - class ApplicationWebsite: Codable { - - public var enabled: Bool? - - public var basepath: String? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - case basepath = "basepath" - - } - - public init(basepath: String?, enabled: Bool?) { - - self.enabled = enabled - - self.basepath = basepath - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - basepath = try container.decode(String.self, forKey: .basepath) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(basepath, forKey: .basepath) - - - } - - } - - /* - Model: ApplicationCors - Used By: Configuration - */ - class ApplicationCors: Codable { - - public var domains: [String]? - - - public enum CodingKeys: String, CodingKey { - - case domains = "domains" - - } - - public init(domains: [String]?) { - - self.domains = domains - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - domains = try container.decode([String].self, forKey: .domains) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(domains, forKey: .domains) - - - } - - } - - /* - Model: ApplicationAuth - Used By: Configuration - */ - class ApplicationAuth: Codable { - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - } - - public init(enabled: Bool?) { - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: ApplicationRedirections - Used By: Configuration - */ - class ApplicationRedirections: Codable { - - public var from: String? - - public var redirectTo: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case from = "from" - - case redirectTo = "redirect_to" - - case type = "type" - - } - - public init(from: String?, redirectTo: String?, type: String?) { - - self.from = from - - self.redirectTo = redirectTo - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - from = try container.decode(String.self, forKey: .from) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - redirectTo = try container.decode(String.self, forKey: .redirectTo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(from, forKey: .from) - - - - try? container.encodeIfPresent(redirectTo, forKey: .redirectTo) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ApplicationMeta - Used By: Configuration - */ - class ApplicationMeta: Codable { - - public var name: String? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case value = "value" - - } - - public init(name: String?, value: String?) { - - self.name = name - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: SecureUrl - Used By: Configuration - */ - class SecureUrl: Codable { - - public var secureUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case secureUrl = "secure_url" - - } - - public init(secureUrl: String?) { - - self.secureUrl = secureUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - secureUrl = try container.decode(String.self, forKey: .secureUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) - - - } - - } - - /* - Model: Application - Used By: Configuration - */ - class Application: Codable { - - public var website: ApplicationWebsite? - - public var cors: ApplicationCors? - - public var auth: ApplicationAuth? - - public var description: String? - - public var channelType: String? - - public var cacheTtl: Int? - - public var isInternal: Bool? - - public var isActive: Bool? - - public var id: String? - - public var name: String? - - public var owner: String? - - public var companyId: Int? - - public var token: String? - - public var redirections: [ApplicationRedirections]? - - public var meta: [ApplicationMeta]? - - public var createdAt: String? - - public var updatedAt: String? - - public var v: Int? - - public var banner: SecureUrl? - - public var logo: SecureUrl? - - public var favicon: SecureUrl? - - public var domains: [Domain]? - - public var appType: String? - - public var mobileLogo: SecureUrl? - - public var domain: Domain? - - - public enum CodingKeys: String, CodingKey { - - case website = "website" - - case cors = "cors" - - case auth = "auth" - - case description = "description" - - case channelType = "channel_type" - - case cacheTtl = "cache_ttl" - - case isInternal = "is_internal" - - case isActive = "is_active" - - case id = "_id" - - case name = "name" - - case owner = "owner" - - case companyId = "company_id" - - case token = "token" - - case redirections = "redirections" - - case meta = "meta" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case v = "__v" - - case banner = "banner" - - case logo = "logo" - - case favicon = "favicon" - - case domains = "domains" - - case appType = "app_type" - - case mobileLogo = "mobile_logo" - - case domain = "domain" - - } - - public init(appType: String?, auth: ApplicationAuth?, banner: SecureUrl?, cacheTtl: Int?, channelType: String?, companyId: Int?, cors: ApplicationCors?, createdAt: String?, description: String?, domain: Domain?, domains: [Domain]?, favicon: SecureUrl?, isActive: Bool?, isInternal: Bool?, logo: SecureUrl?, meta: [ApplicationMeta]?, mobileLogo: SecureUrl?, name: String?, owner: String?, redirections: [ApplicationRedirections]?, token: String?, updatedAt: String?, website: ApplicationWebsite?, id: String?, v: Int?) { - - self.website = website - - self.cors = cors - - self.auth = auth - - self.description = description - - self.channelType = channelType - - self.cacheTtl = cacheTtl - - self.isInternal = isInternal - - self.isActive = isActive - - self.id = id - - self.name = name - - self.owner = owner - - self.companyId = companyId - - self.token = token - - self.redirections = redirections - - self.meta = meta - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.v = v - - self.banner = banner - - self.logo = logo - - self.favicon = favicon - - self.domains = domains - - self.appType = appType - - self.mobileLogo = mobileLogo - - self.domain = domain - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - website = try container.decode(ApplicationWebsite.self, forKey: .website) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cors = try container.decode(ApplicationCors.self, forKey: .cors) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - auth = try container.decode(ApplicationAuth.self, forKey: .auth) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - channelType = try container.decode(String.self, forKey: .channelType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cacheTtl = try container.decode(Int.self, forKey: .cacheTtl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isInternal = try container.decode(Bool.self, forKey: .isInternal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - owner = try container.decode(String.self, forKey: .owner) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - token = try container.decode(String.self, forKey: .token) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - redirections = try container.decode([ApplicationRedirections].self, forKey: .redirections) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([ApplicationMeta].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - banner = try container.decode(SecureUrl.self, forKey: .banner) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(SecureUrl.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - favicon = try container.decode(SecureUrl.self, forKey: .favicon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - domains = try container.decode([Domain].self, forKey: .domains) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appType = try container.decode(String.self, forKey: .appType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobileLogo = try container.decode(SecureUrl.self, forKey: .mobileLogo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - domain = try container.decode(Domain.self, forKey: .domain) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(website, forKey: .website) - - - - try? container.encodeIfPresent(cors, forKey: .cors) - - - - try? container.encodeIfPresent(auth, forKey: .auth) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(channelType, forKey: .channelType) - - - - try? container.encodeIfPresent(cacheTtl, forKey: .cacheTtl) - - - - try? container.encodeIfPresent(isInternal, forKey: .isInternal) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(owner, forKey: .owner) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(token, forKey: .token) - - - - try? container.encodeIfPresent(redirections, forKey: .redirections) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - - try? container.encodeIfPresent(banner, forKey: .banner) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(favicon, forKey: .favicon) - - - - try? container.encodeIfPresent(domains, forKey: .domains) - - - - try? container.encodeIfPresent(appType, forKey: .appType) - - - - try? container.encodeIfPresent(mobileLogo, forKey: .mobileLogo) - - - - try? container.encodeIfPresent(domain, forKey: .domain) - - - } - - } - - /* - Model: NotFound - Used By: Configuration - */ - class NotFound: Codable { - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: UnhandledError - Used By: Configuration - */ - class UnhandledError: Codable { - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: InvalidPayloadRequest - Used By: Configuration - */ - class InvalidPayloadRequest: Codable { - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: SuccessMessageResponse - Used By: Configuration - */ - class SuccessMessageResponse: Codable { - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: InventoryBrandRule - Used By: Configuration - */ - class InventoryBrandRule: Codable { - - public var criteria: String? - - public var brands: [Int]? - - - public enum CodingKeys: String, CodingKey { - - case criteria = "criteria" - - case brands = "brands" - - } - - public init(brands: [Int]?, criteria: String?) { - - self.criteria = criteria - - self.brands = brands - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - criteria = try container.decode(String.self, forKey: .criteria) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brands = try container.decode([Int].self, forKey: .brands) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(criteria, forKey: .criteria) - - - - try? container.encodeIfPresent(brands, forKey: .brands) - - - } - - } - - /* - Model: StoreCriteriaRule - Used By: Configuration - */ - class StoreCriteriaRule: Codable { - - public var companies: [Int]? - - public var brands: [Int]? - - - public enum CodingKeys: String, CodingKey { - - case companies = "companies" - - case brands = "brands" - - } - - public init(brands: [Int]?, companies: [Int]?) { - - self.companies = companies - - self.brands = brands - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - companies = try container.decode([Int].self, forKey: .companies) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brands = try container.decode([Int].self, forKey: .brands) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(companies, forKey: .companies) - - - - try? container.encodeIfPresent(brands, forKey: .brands) - - - } - - } - - /* - Model: InventoryStoreRule - Used By: Configuration - */ - class InventoryStoreRule: Codable { - - public var criteria: String? - - public var rules: [StoreCriteriaRule]? - - public var stores: [Int]? - - - public enum CodingKeys: String, CodingKey { - - case criteria = "criteria" - - case rules = "rules" - - case stores = "stores" - - } - - public init(criteria: String?, rules: [StoreCriteriaRule]?, stores: [Int]?) { - - self.criteria = criteria - - self.rules = rules - - self.stores = stores - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - criteria = try container.decode(String.self, forKey: .criteria) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rules = try container.decode([StoreCriteriaRule].self, forKey: .rules) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stores = try container.decode([Int].self, forKey: .stores) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(criteria, forKey: .criteria) - - - - try? container.encodeIfPresent(rules, forKey: .rules) - - - - try? container.encodeIfPresent(stores, forKey: .stores) - - - } - - } - - /* - Model: InventoryPaymentConfig - Used By: Configuration - */ - class InventoryPaymentConfig: Codable { - - public var modeOfPayment: String? - - public var source: String? - - - public enum CodingKeys: String, CodingKey { - - case modeOfPayment = "mode_of_payment" - - case source = "source" - - } - - public init(modeOfPayment: String?, source: String?) { - - self.modeOfPayment = modeOfPayment - - self.source = source - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - modeOfPayment = try container.decode(String.self, forKey: .modeOfPayment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - source = try container.decode(String.self, forKey: .source) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(modeOfPayment, forKey: .modeOfPayment) - - - - try? container.encodeIfPresent(source, forKey: .source) - - - } - - } - - /* - Model: StorePriorityRule - Used By: Configuration - */ - class StorePriorityRule: Codable { - - public var enabled: Bool? - - public var storetypeOrder: [String]? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - case storetypeOrder = "storetype_order" - - } - - public init(enabled: Bool?, storetypeOrder: [String]?) { - - self.enabled = enabled - - self.storetypeOrder = storetypeOrder - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storetypeOrder = try container.decode([String].self, forKey: .storetypeOrder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(storetypeOrder, forKey: .storetypeOrder) - - - } - - } - - /* - Model: ArticleAssignmentRule - Used By: Configuration - */ - class ArticleAssignmentRule: Codable { - - public var storePriority: StorePriorityRule? - - - public enum CodingKeys: String, CodingKey { - - case storePriority = "store_priority" - - } - - public init(storePriority: StorePriorityRule?) { - - self.storePriority = storePriority - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - storePriority = try container.decode(StorePriorityRule.self, forKey: .storePriority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(storePriority, forKey: .storePriority) - - - } - - } - - /* - Model: InventoryArticleAssignment - Used By: Configuration - */ - class InventoryArticleAssignment: Codable { - - public var postOrderReassignment: Bool? - - public var rules: ArticleAssignmentRule? - - - public enum CodingKeys: String, CodingKey { - - case postOrderReassignment = "post_order_reassignment" - - case rules = "rules" - - } - - public init(postOrderReassignment: Bool?, rules: ArticleAssignmentRule?) { - - self.postOrderReassignment = postOrderReassignment - - self.rules = rules - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - postOrderReassignment = try container.decode(Bool.self, forKey: .postOrderReassignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rules = try container.decode(ArticleAssignmentRule.self, forKey: .rules) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(postOrderReassignment, forKey: .postOrderReassignment) - - - - try? container.encodeIfPresent(rules, forKey: .rules) - - - } - - } - - /* - Model: CompanyAboutAddress - Used By: Configuration - */ - class CompanyAboutAddress: Codable { - - public var pincode: Int? - - public var address1: String? - - public var address2: String? - - public var city: String? - - public var state: String? - - public var country: String? - - public var addressType: String? - - - public enum CodingKeys: String, CodingKey { - - case pincode = "pincode" - - case address1 = "address1" - - case address2 = "address2" - - case city = "city" - - case state = "state" - - case country = "country" - - case addressType = "address_type" - - } - - public init(address1: String?, address2: String?, addressType: String?, city: String?, country: String?, pincode: Int?, state: String?) { - - self.pincode = pincode - - self.address1 = address1 - - self.address2 = address2 - - self.city = city - - self.state = state - - self.country = country - - self.addressType = addressType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pincode = try container.decode(Int.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address1 = try container.decode(String.self, forKey: .address1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address2 = try container.decode(String.self, forKey: .address2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(String.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressType = try container.decode(String.self, forKey: .addressType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(address1, forKey: .address1) - - - - try? container.encodeIfPresent(address2, forKey: .address2) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(addressType, forKey: .addressType) - - - } - - } - - /* - Model: UserEmail - Used By: Configuration - */ - class UserEmail: Codable { - - public var active: Bool? - - public var primary: Bool? - - public var verified: Bool? - - public var email: String? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case primary = "primary" - - case verified = "verified" - - case email = "email" - - } - - public init(active: Bool?, email: String?, primary: Bool?, verified: Bool?) { - - self.active = active - - self.primary = primary - - self.verified = verified - - self.email = email - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - primary = try container.decode(Bool.self, forKey: .primary) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verified = try container.decode(Bool.self, forKey: .verified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(primary, forKey: .primary) - - - - try? container.encodeIfPresent(verified, forKey: .verified) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - } - - } - - /* - Model: UserPhoneNumber - Used By: Configuration - */ - class UserPhoneNumber: Codable { - - public var active: Bool? - - public var primary: Bool? - - public var verified: Bool? - - public var countryCode: Int? - - public var phone: String? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case primary = "primary" - - case verified = "verified" - - case countryCode = "country_code" - - case phone = "phone" - - } - - public init(active: Bool?, countryCode: Int?, phone: String?, primary: Bool?, verified: Bool?) { - - self.active = active - - self.primary = primary - - self.verified = verified - - self.countryCode = countryCode - - self.phone = phone - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - primary = try container.decode(Bool.self, forKey: .primary) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verified = try container.decode(Bool.self, forKey: .verified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(Int.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(primary, forKey: .primary) - - - - try? container.encodeIfPresent(verified, forKey: .verified) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - } - - } - - /* - Model: ApplicationInformation - Used By: Configuration - */ - class ApplicationInformation: Codable { - - public var address: InformationAddress? - - public var support: InformationSupport? - - public var socialLinks: SocialLinks? - - public var links: Links? - - public var copyrightText: String? - - public var id: String? - - public var businessHighlights: BusinessHighlights? - - public var application: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case address = "address" - - case support = "support" - - case socialLinks = "social_links" - - case links = "links" - - case copyrightText = "copyright_text" - - case id = "_id" - - case businessHighlights = "business_highlights" - - case application = "application" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case v = "__v" - - } - - public init(address: InformationAddress?, application: String?, businessHighlights: BusinessHighlights?, copyrightText: String?, createdAt: String?, links: Links?, socialLinks: SocialLinks?, support: InformationSupport?, updatedAt: String?, id: String?, v: Int?) { - - self.address = address - - self.support = support - - self.socialLinks = socialLinks - - self.links = links - - self.copyrightText = copyrightText - - self.id = id - - self.businessHighlights = businessHighlights - - self.application = application - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - address = try container.decode(InformationAddress.self, forKey: .address) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - support = try container.decode(InformationSupport.self, forKey: .support) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - socialLinks = try container.decode(SocialLinks.self, forKey: .socialLinks) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - links = try container.decode(Links.self, forKey: .links) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - copyrightText = try container.decode(String.self, forKey: .copyrightText) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - businessHighlights = try container.decode(BusinessHighlights.self, forKey: .businessHighlights) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(support, forKey: .support) - - - - try? container.encodeIfPresent(socialLinks, forKey: .socialLinks) - - - - try? container.encodeIfPresent(links, forKey: .links) - - - - try? container.encodeIfPresent(copyrightText, forKey: .copyrightText) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(businessHighlights, forKey: .businessHighlights) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: InformationAddress - Used By: Configuration - */ - class InformationAddress: Codable { - - public var loc: String? - - public var addressLine: [String]? - - public var phone: InformationPhone? - - public var city: String? - - public var country: String? - - public var pincode: Int? - - - public enum CodingKeys: String, CodingKey { - - case loc = "loc" - - case addressLine = "address_line" - - case phone = "phone" - - case city = "city" - - case country = "country" - - case pincode = "pincode" - - } - - public init(addressLine: [String]?, city: String?, country: String?, loc: String?, phone: InformationPhone?, pincode: Int?) { - - self.loc = loc - - self.addressLine = addressLine - - self.phone = phone - - self.city = city - - self.country = country - - self.pincode = pincode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - loc = try container.decode(String.self, forKey: .loc) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressLine = try container.decode([String].self, forKey: .addressLine) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(InformationPhone.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(Int.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(loc, forKey: .loc) - - - - try? container.encodeIfPresent(addressLine, forKey: .addressLine) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - } - - } - - /* - Model: InformationPhone - Used By: Configuration - */ - class InformationPhone: Codable { - - public var code: String? - - public var number: String? - - - public enum CodingKeys: String, CodingKey { - - case code = "code" - - case number = "number" - - } - - public init(code: String?, number: String?) { - - self.code = code - - self.number = number - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - number = try container.decode(String.self, forKey: .number) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(number, forKey: .number) - - - } - - } - - /* - Model: InformationSupport - Used By: Configuration - */ - class InformationSupport: Codable { - - public var phone: [String]? - - public var email: [String]? - - public var timing: String? - - - public enum CodingKeys: String, CodingKey { - - case phone = "phone" - - case email = "email" - - case timing = "timing" - - } - - public init(email: [String]?, phone: [String]?, timing: String?) { - - self.phone = phone - - self.email = email - - self.timing = timing - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - phone = try container.decode([String].self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode([String].self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - timing = try container.decode(String.self, forKey: .timing) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(timing, forKey: .timing) - - - } - - } - - /* - Model: SocialLinks - Used By: Configuration - */ - class SocialLinks: Codable { - - public var facebook: FacebookLink? - - public var instagram: InstagramLink? - - public var twitter: TwitterLink? - - public var pinterest: PinterestLink? - - public var googlePlus: GooglePlusLink? - - public var youtube: YoutubeLink? - - public var linkedIn: LinkedInLink? - - public var vimeo: VimeoLink? - - public var blogLink: BlogLink? - - - public enum CodingKeys: String, CodingKey { - - case facebook = "facebook" - - case instagram = "instagram" - - case twitter = "twitter" - - case pinterest = "pinterest" - - case googlePlus = "google_plus" - - case youtube = "youtube" - - case linkedIn = "linked_in" - - case vimeo = "vimeo" - - case blogLink = "blog_link" - - } - - public init(blogLink: BlogLink?, facebook: FacebookLink?, googlePlus: GooglePlusLink?, instagram: InstagramLink?, linkedIn: LinkedInLink?, pinterest: PinterestLink?, twitter: TwitterLink?, vimeo: VimeoLink?, youtube: YoutubeLink?) { - - self.facebook = facebook - - self.instagram = instagram - - self.twitter = twitter - - self.pinterest = pinterest - - self.googlePlus = googlePlus - - self.youtube = youtube - - self.linkedIn = linkedIn - - self.vimeo = vimeo - - self.blogLink = blogLink - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - facebook = try container.decode(FacebookLink.self, forKey: .facebook) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - instagram = try container.decode(InstagramLink.self, forKey: .instagram) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - twitter = try container.decode(TwitterLink.self, forKey: .twitter) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pinterest = try container.decode(PinterestLink.self, forKey: .pinterest) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - googlePlus = try container.decode(GooglePlusLink.self, forKey: .googlePlus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - youtube = try container.decode(YoutubeLink.self, forKey: .youtube) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - linkedIn = try container.decode(LinkedInLink.self, forKey: .linkedIn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - vimeo = try container.decode(VimeoLink.self, forKey: .vimeo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - blogLink = try container.decode(BlogLink.self, forKey: .blogLink) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(facebook, forKey: .facebook) - - - - try? container.encodeIfPresent(instagram, forKey: .instagram) - - - - try? container.encodeIfPresent(twitter, forKey: .twitter) - - - - try? container.encodeIfPresent(pinterest, forKey: .pinterest) - - - - try? container.encodeIfPresent(googlePlus, forKey: .googlePlus) - - - - try? container.encodeIfPresent(youtube, forKey: .youtube) - - - - try? container.encodeIfPresent(linkedIn, forKey: .linkedIn) - - - - try? container.encodeIfPresent(vimeo, forKey: .vimeo) - - - - try? container.encodeIfPresent(blogLink, forKey: .blogLink) - - - } - - } - - /* - Model: FacebookLink - Used By: Configuration - */ - class FacebookLink: Codable { - - public var title: String? - - public var icon: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case icon = "icon" - - case link = "link" - - } - - public init(icon: String?, link: String?, title: String?) { - - self.title = title - - self.icon = icon - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: InstagramLink - Used By: Configuration - */ - class InstagramLink: Codable { - - public var title: String? - - public var icon: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case icon = "icon" - - case link = "link" - - } - - public init(icon: String?, link: String?, title: String?) { - - self.title = title - - self.icon = icon - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: TwitterLink - Used By: Configuration - */ - class TwitterLink: Codable { - - public var title: String? - - public var icon: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case icon = "icon" - - case link = "link" - - } - - public init(icon: String?, link: String?, title: String?) { - - self.title = title - - self.icon = icon - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: PinterestLink - Used By: Configuration - */ - class PinterestLink: Codable { - - public var title: String? - - public var icon: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case icon = "icon" - - case link = "link" - - } - - public init(icon: String?, link: String?, title: String?) { - - self.title = title - - self.icon = icon - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: GooglePlusLink - Used By: Configuration - */ - class GooglePlusLink: Codable { - - public var title: String? - - public var icon: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case icon = "icon" - - case link = "link" - - } - - public init(icon: String?, link: String?, title: String?) { - - self.title = title - - self.icon = icon - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: YoutubeLink - Used By: Configuration - */ - class YoutubeLink: Codable { - - public var title: String? - - public var icon: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case icon = "icon" - - case link = "link" - - } - - public init(icon: String?, link: String?, title: String?) { - - self.title = title - - self.icon = icon - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: LinkedInLink - Used By: Configuration - */ - class LinkedInLink: Codable { - - public var title: String? - - public var icon: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case icon = "icon" - - case link = "link" - - } - - public init(icon: String?, link: String?, title: String?) { - - self.title = title - - self.icon = icon - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: VimeoLink - Used By: Configuration - */ - class VimeoLink: Codable { - - public var title: String? - - public var icon: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case icon = "icon" - - case link = "link" - - } - - public init(icon: String?, link: String?, title: String?) { - - self.title = title - - self.icon = icon - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: BlogLink - Used By: Configuration - */ - class BlogLink: Codable { - - public var title: String? - - public var icon: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case icon = "icon" - - case link = "link" - - } - - public init(icon: String?, link: String?, title: String?) { - - self.title = title - - self.icon = icon - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: Links - Used By: Configuration - */ - class Links: Codable { - - public var title: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case link = "link" - - } - - public init(link: String?, title: String?) { - - self.title = title - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: BusinessHighlights - Used By: Configuration - */ - class BusinessHighlights: Codable { - - public var id: String? - - public var title: String? - - public var icon: String? - - public var subTitle: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case title = "title" - - case icon = "icon" - - case subTitle = "sub_title" - - } - - public init(icon: String?, subTitle: String?, title: String?, id: String?) { - - self.id = id - - self.title = title - - self.icon = icon - - self.subTitle = subTitle - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subTitle = try container.decode(String.self, forKey: .subTitle) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(subTitle, forKey: .subTitle) - - - } - - } - - /* - Model: ApplicationDetail - Used By: Configuration - */ - class ApplicationDetail: Codable { - - public var name: String - - public var description: String - - public var logo: SecureUrl - - public var mobileLogo: SecureUrl - - public var favicon: SecureUrl - - public var banner: SecureUrl - - public var domain: Domain? - - public var domains: [Domain]? - - public var id: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case description = "description" - - case logo = "logo" - - case mobileLogo = "mobile_logo" - - case favicon = "favicon" - - case banner = "banner" - - case domain = "domain" - - case domains = "domains" - - case id = "_id" - - } - - public init(banner: SecureUrl, description: String, domain: Domain?, domains: [Domain]?, favicon: SecureUrl, logo: SecureUrl, mobileLogo: SecureUrl, name: String, id: String?) { - - self.name = name - - self.description = description - - self.logo = logo - - self.mobileLogo = mobileLogo - - self.favicon = favicon - - self.banner = banner - - self.domain = domain - - self.domains = domains - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - name = try container.decode(String.self, forKey: .name) - - - - - description = try container.decode(String.self, forKey: .description) - - - - - logo = try container.decode(SecureUrl.self, forKey: .logo) - - - - - mobileLogo = try container.decode(SecureUrl.self, forKey: .mobileLogo) - - - - - favicon = try container.decode(SecureUrl.self, forKey: .favicon) - - - - - banner = try container.decode(SecureUrl.self, forKey: .banner) - - - - - do { - domain = try container.decode(Domain.self, forKey: .domain) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - domains = try container.decode([Domain].self, forKey: .domains) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(mobileLogo, forKey: .mobileLogo) - - - - try? container.encodeIfPresent(favicon, forKey: .favicon) - - - - try? container.encodeIfPresent(banner, forKey: .banner) - - - - try? container.encodeIfPresent(domain, forKey: .domain) - - - - try? container.encodeIfPresent(domains, forKey: .domains) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: CurrenciesResponse - Used By: Configuration - */ - class CurrenciesResponse: Codable { - - public var items: [Currency]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - } - - public init(items: [Currency]?) { - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Currency].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: DefaultCurrency - Used By: Configuration - */ - class DefaultCurrency: Codable { - - public var ref: String? - - public var code: String? - - - public enum CodingKeys: String, CodingKey { - - case ref = "ref" - - case code = "code" - - } - - public init(code: String?, ref: String?) { - - self.ref = ref - - self.code = code - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - ref = try container.decode(String.self, forKey: .ref) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(ref, forKey: .ref) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - } - - } - - /* - Model: AppCurrencyResponse - Used By: Configuration - */ - class AppCurrencyResponse: Codable { - - public var application: String? - - public var defaultCurrency: DefaultCurrency? - - public var supportedCurrency: [Currency]? - - - public enum CodingKeys: String, CodingKey { - - case application = "application" - - case defaultCurrency = "default_currency" - - case supportedCurrency = "supported_currency" - - } - - public init(application: String?, defaultCurrency: DefaultCurrency?, supportedCurrency: [Currency]?) { - - self.application = application - - self.defaultCurrency = defaultCurrency - - self.supportedCurrency = supportedCurrency - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - defaultCurrency = try container.decode(DefaultCurrency.self, forKey: .defaultCurrency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - supportedCurrency = try container.decode([Currency].self, forKey: .supportedCurrency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(defaultCurrency, forKey: .defaultCurrency) - - - - try? container.encodeIfPresent(supportedCurrency, forKey: .supportedCurrency) - - - } - - } - - /* - Model: StoreLatLong - Used By: Configuration - */ - class StoreLatLong: Codable { - - public var type: String? - - public var coordinates: [Double]? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case coordinates = "coordinates" - - } - - public init(coordinates: [Double]?, type: String?) { - - self.type = type - - self.coordinates = coordinates - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - coordinates = try container.decode([Double].self, forKey: .coordinates) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(coordinates, forKey: .coordinates) - - - } - - } - - /* - Model: OptedStoreAddress - Used By: Configuration - */ - class OptedStoreAddress: Codable { - - public var state: String? - - public var address1: String? - - public var latLong: StoreLatLong? - - public var address2: String? - - public var pincode: Int? - - public var country: String? - - public var city: String? - - - public enum CodingKeys: String, CodingKey { - - case state = "state" - - case address1 = "address1" - - case latLong = "lat_long" - - case address2 = "address2" - - case pincode = "pincode" - - case country = "country" - - case city = "city" - - } - - public init(address1: String?, address2: String?, city: String?, country: String?, latLong: StoreLatLong?, pincode: Int?, state: String?) { - - self.state = state - - self.address1 = address1 - - self.latLong = latLong - - self.address2 = address2 - - self.pincode = pincode - - self.country = country - - self.city = city - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - state = try container.decode(String.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address1 = try container.decode(String.self, forKey: .address1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - latLong = try container.decode(StoreLatLong.self, forKey: .latLong) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address2 = try container.decode(String.self, forKey: .address2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(Int.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(address1, forKey: .address1) - - - - try? container.encodeIfPresent(latLong, forKey: .latLong) - - - - try? container.encodeIfPresent(address2, forKey: .address2) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - } - - } - - /* - Model: OrderingStore - Used By: Configuration - */ - class OrderingStore: Codable { - - public var address: OptedStoreAddress? - - public var id: String? - - public var uid: Int? - - public var name: String? - - public var displayName: String? - - public var storeType: String? - - public var storeCode: String? - - public var pincode: Int? - - public var code: String? - - - public enum CodingKeys: String, CodingKey { - - case address = "address" - - case id = "_id" - - case uid = "uid" - - case name = "name" - - case displayName = "display_name" - - case storeType = "store_type" - - case storeCode = "store_code" - - case pincode = "pincode" - - case code = "code" - - } - - public init(address: OptedStoreAddress?, code: String?, displayName: String?, name: String?, pincode: Int?, storeCode: String?, storeType: String?, uid: Int?, id: String?) { - - self.address = address - - self.id = id - - self.uid = uid - - self.name = name - - self.displayName = displayName - - self.storeType = storeType - - self.storeCode = storeCode - - self.pincode = pincode - - self.code = code - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - address = try container.decode(OptedStoreAddress.self, forKey: .address) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeType = try container.decode(String.self, forKey: .storeType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeCode = try container.decode(String.self, forKey: .storeCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(Int.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(storeType, forKey: .storeType) - - - - try? container.encodeIfPresent(storeCode, forKey: .storeCode) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - } - - } - - /* - Model: OrderingStores - Used By: Configuration - */ - class OrderingStores: Codable { - - public var page: Page? - - public var items: [OrderingStore]? - - public var deployedStores: [Int]? - - public var allStores: Bool? - - public var enabled: Bool? - - public var type: String? - - public var id: String? - - public var app: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case page = "page" - - case items = "items" - - case deployedStores = "deployed_stores" - - case allStores = "all_stores" - - case enabled = "enabled" - - case type = "type" - - case id = "_id" - - case app = "app" - - case v = "__v" - - } - - public init(allStores: Bool?, app: String?, deployedStores: [Int]?, enabled: Bool?, items: [OrderingStore]?, page: Page?, type: String?, id: String?, v: Int?) { - - self.page = page - - self.items = items - - self.deployedStores = deployedStores - - self.allStores = allStores - - self.enabled = enabled - - self.type = type - - self.id = id - - self.app = app - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([OrderingStore].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deployedStores = try container.decode([Int].self, forKey: .deployedStores) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allStores = try container.decode(Bool.self, forKey: .allStores) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - app = try container.decode(String.self, forKey: .app) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(deployedStores, forKey: .deployedStores) - - - - try? container.encodeIfPresent(allStores, forKey: .allStores) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(app, forKey: .app) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - - - /* - Model: AggregatorConfigDetail - Used By: Payment - */ - class AggregatorConfigDetail: Codable { - - public var sdk: Bool? - - public var merchantId: String? - - public var pin: String? - - public var key: String - - public var configType: String - - public var api: String? - - public var merchantKey: String? - - public var secret: String - - public var userId: String? - - public var verifyApi: String? - - - public enum CodingKeys: String, CodingKey { - - case sdk = "sdk" - - case merchantId = "merchant_id" - - case pin = "pin" - - case key = "key" - - case configType = "config_type" - - case api = "api" - - case merchantKey = "merchant_key" - - case secret = "secret" - - case userId = "user_id" - - case verifyApi = "verify_api" - - } - - public init(api: String?, configType: String, key: String, merchantId: String?, merchantKey: String?, pin: String?, sdk: Bool?, secret: String, userId: String?, verifyApi: String?) { - - self.sdk = sdk - - self.merchantId = merchantId - - self.pin = pin - - self.key = key - - self.configType = configType - - self.api = api - - self.merchantKey = merchantKey - - self.secret = secret - - self.userId = userId - - self.verifyApi = verifyApi - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - sdk = try container.decode(Bool.self, forKey: .sdk) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - merchantId = try container.decode(String.self, forKey: .merchantId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pin = try container.decode(String.self, forKey: .pin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - key = try container.decode(String.self, forKey: .key) - - - - - configType = try container.decode(String.self, forKey: .configType) - - - - - do { - api = try container.decode(String.self, forKey: .api) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - merchantKey = try container.decode(String.self, forKey: .merchantKey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - secret = try container.decode(String.self, forKey: .secret) - - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyApi = try container.decode(String.self, forKey: .verifyApi) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(sdk, forKey: .sdk) - - - - try? container.encodeIfPresent(merchantId, forKey: .merchantId) - - - - try? container.encodeIfPresent(pin, forKey: .pin) - - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(configType, forKey: .configType) - - - - try? container.encodeIfPresent(api, forKey: .api) - - - - try? container.encodeIfPresent(merchantKey, forKey: .merchantKey) - - - - try? container.encodeIfPresent(secret, forKey: .secret) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - - try? container.encodeIfPresent(verifyApi, forKey: .verifyApi) - - - } - - } - - /* - Model: AggregatorsConfigDetailResponse - Used By: Payment - */ - class AggregatorsConfigDetailResponse: Codable { - - public var mswipe: AggregatorConfigDetail? - - public var success: Bool - - public var stripe: AggregatorConfigDetail? - - public var juspay: AggregatorConfigDetail? - - public var env: String - - public var simpl: AggregatorConfigDetail? - - public var razorpay: AggregatorConfigDetail? - - public var payumoney: AggregatorConfigDetail? - - public var rupifi: AggregatorConfigDetail? - - public var ccavenue: AggregatorConfigDetail? - - - public enum CodingKeys: String, CodingKey { - - case mswipe = "mswipe" - - case success = "success" - - case stripe = "stripe" - - case juspay = "juspay" - - case env = "env" - - case simpl = "simpl" - - case razorpay = "razorpay" - - case payumoney = "payumoney" - - case rupifi = "rupifi" - - case ccavenue = "ccavenue" - - } - - public init(ccavenue: AggregatorConfigDetail?, env: String, juspay: AggregatorConfigDetail?, mswipe: AggregatorConfigDetail?, payumoney: AggregatorConfigDetail?, razorpay: AggregatorConfigDetail?, rupifi: AggregatorConfigDetail?, simpl: AggregatorConfigDetail?, stripe: AggregatorConfigDetail?, success: Bool) { - - self.mswipe = mswipe - - self.success = success - - self.stripe = stripe - - self.juspay = juspay - - self.env = env - - self.simpl = simpl - - self.razorpay = razorpay - - self.payumoney = payumoney - - self.rupifi = rupifi - - self.ccavenue = ccavenue - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - mswipe = try container.decode(AggregatorConfigDetail.self, forKey: .mswipe) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - success = try container.decode(Bool.self, forKey: .success) - - - - - do { - stripe = try container.decode(AggregatorConfigDetail.self, forKey: .stripe) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - juspay = try container.decode(AggregatorConfigDetail.self, forKey: .juspay) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - env = try container.decode(String.self, forKey: .env) - - - - - do { - simpl = try container.decode(AggregatorConfigDetail.self, forKey: .simpl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - razorpay = try container.decode(AggregatorConfigDetail.self, forKey: .razorpay) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - payumoney = try container.decode(AggregatorConfigDetail.self, forKey: .payumoney) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rupifi = try container.decode(AggregatorConfigDetail.self, forKey: .rupifi) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ccavenue = try container.decode(AggregatorConfigDetail.self, forKey: .ccavenue) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(mswipe, forKey: .mswipe) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(stripe, forKey: .stripe) - - - - try? container.encodeIfPresent(juspay, forKey: .juspay) - - - - try? container.encodeIfPresent(env, forKey: .env) - - - - try? container.encodeIfPresent(simpl, forKey: .simpl) - - - - try? container.encodeIfPresent(razorpay, forKey: .razorpay) - - - - try? container.encodeIfPresent(payumoney, forKey: .payumoney) - - - - try? container.encodeIfPresent(rupifi, forKey: .rupifi) - - - - try? container.encodeIfPresent(ccavenue, forKey: .ccavenue) - - - } - - } - - /* - Model: ErrorCodeAndDescription - Used By: Payment - */ - class ErrorCodeAndDescription: Codable { - - public var code: String - - public var description: String - - - public enum CodingKeys: String, CodingKey { - - case code = "code" - - case description = "description" - - } - - public init(code: String, description: String) { - - self.code = code - - self.description = description - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - code = try container.decode(String.self, forKey: .code) - - - - - description = try container.decode(String.self, forKey: .description) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - } - - } - - /* - Model: HttpErrorCodeAndResponse - Used By: Payment - */ - class HttpErrorCodeAndResponse: Codable { - - public var success: Bool - - public var error: ErrorCodeAndDescription - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case error = "error" - - } - - public init(error: ErrorCodeAndDescription, success: Bool) { - - self.success = success - - self.error = error - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - error = try container.decode(ErrorCodeAndDescription.self, forKey: .error) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(error, forKey: .error) - - - } - - } - - /* - Model: AttachCardRequest - Used By: Payment - */ - class AttachCardRequest: Codable { - - public var refresh: Bool? - - public var cardId: String - - public var nameOnCard: String? - - public var nickname: String? - - - public enum CodingKeys: String, CodingKey { - - case refresh = "refresh" - - case cardId = "card_id" - - case nameOnCard = "name_on_card" - - case nickname = "nickname" - - } - - public init(cardId: String, nameOnCard: String?, nickname: String?, refresh: Bool?) { - - self.refresh = refresh - - self.cardId = cardId - - self.nameOnCard = nameOnCard - - self.nickname = nickname - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - refresh = try container.decode(Bool.self, forKey: .refresh) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - cardId = try container.decode(String.self, forKey: .cardId) - - - - - do { - nameOnCard = try container.decode(String.self, forKey: .nameOnCard) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - nickname = try container.decode(String.self, forKey: .nickname) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(refresh, forKey: .refresh) - - - - try? container.encodeIfPresent(cardId, forKey: .cardId) - - - - try? container.encodeIfPresent(nameOnCard, forKey: .nameOnCard) - - - - try? container.encodeIfPresent(nickname, forKey: .nickname) - - - } - - } - - /* - Model: AttachCardsResponse - Used By: Payment - */ - class AttachCardsResponse: Codable { - - public var success: Bool - - public var message: String? - - public var data: [String: Any] - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case message = "message" - - case data = "data" - - } - - public init(data: [String: Any], message: String?, success: Bool) { - - self.success = success - - self.message = message - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - data = try container.decode([String: Any].self, forKey: .data) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: CardPaymentGateway - Used By: Payment - */ - class CardPaymentGateway: Codable { - - public var api: String? - - public var customerId: String? - - public var aggregator: String - - - public enum CodingKeys: String, CodingKey { - - case api = "api" - - case customerId = "customer_id" - - case aggregator = "aggregator" - - } - - public init(aggregator: String, api: String?, customerId: String?) { - - self.api = api - - self.customerId = customerId - - self.aggregator = aggregator - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - api = try container.decode(String.self, forKey: .api) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customerId = try container.decode(String.self, forKey: .customerId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - aggregator = try container.decode(String.self, forKey: .aggregator) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(api, forKey: .api) - - - - try? container.encodeIfPresent(customerId, forKey: .customerId) - - - - try? container.encodeIfPresent(aggregator, forKey: .aggregator) - - - } - - } - - /* - Model: ActiveCardPaymentGatewayResponse - Used By: Payment - */ - class ActiveCardPaymentGatewayResponse: Codable { - - public var success: Bool - - public var message: String - - public var cards: CardPaymentGateway - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case message = "message" - - case cards = "cards" - - } - - public init(cards: CardPaymentGateway, message: String, success: Bool) { - - self.success = success - - self.message = message - - self.cards = cards - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - message = try container.decode(String.self, forKey: .message) - - - - - cards = try container.decode(CardPaymentGateway.self, forKey: .cards) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(cards, forKey: .cards) - - - } - - } - - /* - Model: Card - Used By: Payment - */ - class Card: Codable { - - public var cardIsin: String? - - public var aggregatorName: String - - public var cardToken: String? - - public var expMonth: Int? - - public var cardBrandImage: String? - - public var expired: Bool? - - public var cardNumber: String? - - public var cardBrand: String? - - public var cardFingerprint: String? - - public var cardReference: String? - - public var cardIssuer: String? - - public var cardType: String? - - public var cardId: String? - - public var cardName: String? - - public var expYear: Int? - - public var nickname: String? - - - public enum CodingKeys: String, CodingKey { - - case cardIsin = "card_isin" - - case aggregatorName = "aggregator_name" - - case cardToken = "card_token" - - case expMonth = "exp_month" - - case cardBrandImage = "card_brand_image" - - case expired = "expired" - - case cardNumber = "card_number" - - case cardBrand = "card_brand" - - case cardFingerprint = "card_fingerprint" - - case cardReference = "card_reference" - - case cardIssuer = "card_issuer" - - case cardType = "card_type" - - case cardId = "card_id" - - case cardName = "card_name" - - case expYear = "exp_year" - - case nickname = "nickname" - - } - - public init(aggregatorName: String, cardBrand: String?, cardBrandImage: String?, cardFingerprint: String?, cardId: String?, cardIsin: String?, cardIssuer: String?, cardName: String?, cardNumber: String?, cardReference: String?, cardToken: String?, cardType: String?, expired: Bool?, expMonth: Int?, expYear: Int?, nickname: String?) { - - self.cardIsin = cardIsin - - self.aggregatorName = aggregatorName - - self.cardToken = cardToken - - self.expMonth = expMonth - - self.cardBrandImage = cardBrandImage - - self.expired = expired - - self.cardNumber = cardNumber - - self.cardBrand = cardBrand - - self.cardFingerprint = cardFingerprint - - self.cardReference = cardReference - - self.cardIssuer = cardIssuer - - self.cardType = cardType - - self.cardId = cardId - - self.cardName = cardName - - self.expYear = expYear - - self.nickname = nickname - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cardIsin = try container.decode(String.self, forKey: .cardIsin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - aggregatorName = try container.decode(String.self, forKey: .aggregatorName) - - - - - do { - cardToken = try container.decode(String.self, forKey: .cardToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expMonth = try container.decode(Int.self, forKey: .expMonth) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardBrandImage = try container.decode(String.self, forKey: .cardBrandImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expired = try container.decode(Bool.self, forKey: .expired) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardNumber = try container.decode(String.self, forKey: .cardNumber) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardBrand = try container.decode(String.self, forKey: .cardBrand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardFingerprint = try container.decode(String.self, forKey: .cardFingerprint) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardReference = try container.decode(String.self, forKey: .cardReference) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardIssuer = try container.decode(String.self, forKey: .cardIssuer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardType = try container.decode(String.self, forKey: .cardType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardId = try container.decode(String.self, forKey: .cardId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardName = try container.decode(String.self, forKey: .cardName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expYear = try container.decode(Int.self, forKey: .expYear) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - nickname = try container.decode(String.self, forKey: .nickname) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cardIsin, forKey: .cardIsin) - - - - try? container.encodeIfPresent(aggregatorName, forKey: .aggregatorName) - - - - try? container.encodeIfPresent(cardToken, forKey: .cardToken) - - - - try? container.encodeIfPresent(expMonth, forKey: .expMonth) - - - - try? container.encodeIfPresent(cardBrandImage, forKey: .cardBrandImage) - - - - try? container.encodeIfPresent(expired, forKey: .expired) - - - - try? container.encodeIfPresent(cardNumber, forKey: .cardNumber) - - - - try? container.encodeIfPresent(cardBrand, forKey: .cardBrand) - - - - try? container.encodeIfPresent(cardFingerprint, forKey: .cardFingerprint) - - - - try? container.encodeIfPresent(cardReference, forKey: .cardReference) - - - - try? container.encodeIfPresent(cardIssuer, forKey: .cardIssuer) - - - - try? container.encodeIfPresent(cardType, forKey: .cardType) - - - - try? container.encodeIfPresent(cardId, forKey: .cardId) - - - - try? container.encodeIfPresent(cardName, forKey: .cardName) - - - - try? container.encodeIfPresent(expYear, forKey: .expYear) - - - - try? container.encodeIfPresent(nickname, forKey: .nickname) - - - } - - } - - /* - Model: ListCardsResponse - Used By: Payment - */ - class ListCardsResponse: Codable { - - public var success: Bool - - public var message: String - - public var data: [Card]? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case message = "message" - - case data = "data" - - } - - public init(data: [Card]?, message: String, success: Bool) { - - self.success = success - - self.message = message - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - message = try container.decode(String.self, forKey: .message) - - - - - do { - data = try container.decode([Card].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: DeletehCardRequest - Used By: Payment - */ - class DeletehCardRequest: Codable { - - public var cardId: String - - - public enum CodingKeys: String, CodingKey { - - case cardId = "card_id" - - } - - public init(cardId: String) { - - self.cardId = cardId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - cardId = try container.decode(String.self, forKey: .cardId) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cardId, forKey: .cardId) - - - } - - } - - /* - Model: DeleteCardsResponse - Used By: Payment - */ - class DeleteCardsResponse: Codable { - - public var success: Bool - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case message = "message" - - } - - public init(message: String?, success: Bool) { - - self.success = success - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: ValidateCustomerRequest - Used By: Payment - */ - class ValidateCustomerRequest: Codable { - - public var phoneNumber: String - - public var transactionAmountInPaise: Int - - public var payload: String - - public var merchantParams: [String: Any] - - public var aggregator: String - - - public enum CodingKeys: String, CodingKey { - - case phoneNumber = "phone_number" - - case transactionAmountInPaise = "transaction_amount_in_paise" - - case payload = "payload" - - case merchantParams = "merchant_params" - - case aggregator = "aggregator" - - } - - public init(aggregator: String, merchantParams: [String: Any], payload: String, phoneNumber: String, transactionAmountInPaise: Int) { - - self.phoneNumber = phoneNumber - - self.transactionAmountInPaise = transactionAmountInPaise - - self.payload = payload - - self.merchantParams = merchantParams - - self.aggregator = aggregator - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - phoneNumber = try container.decode(String.self, forKey: .phoneNumber) - - - - - transactionAmountInPaise = try container.decode(Int.self, forKey: .transactionAmountInPaise) - - - - - payload = try container.decode(String.self, forKey: .payload) - - - - - merchantParams = try container.decode([String: Any].self, forKey: .merchantParams) - - - - - aggregator = try container.decode(String.self, forKey: .aggregator) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(phoneNumber, forKey: .phoneNumber) - - - - try? container.encodeIfPresent(transactionAmountInPaise, forKey: .transactionAmountInPaise) - - - - try? container.encodeIfPresent(payload, forKey: .payload) - - - - try? container.encodeIfPresent(merchantParams, forKey: .merchantParams) - - - - try? container.encodeIfPresent(aggregator, forKey: .aggregator) - - - } - - } - - /* - Model: ValidateCustomerResponse - Used By: Payment - */ - class ValidateCustomerResponse: Codable { - - public var success: Bool - - public var message: String - - public var data: [String: Any] - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case message = "message" - - case data = "data" - - } - - public init(data: [String: Any], message: String, success: Bool) { - - self.success = success - - self.message = message - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - message = try container.decode(String.self, forKey: .message) - - - - - data = try container.decode([String: Any].self, forKey: .data) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: ChargeCustomerRequest - Used By: Payment - */ - class ChargeCustomerRequest: Codable { - - public var orderId: String - - public var transactionToken: String? - - public var verified: Bool? - - public var amount: Int - - public var aggregator: String - - - public enum CodingKeys: String, CodingKey { - - case orderId = "order_id" - - case transactionToken = "transaction_token" - - case verified = "verified" - - case amount = "amount" - - case aggregator = "aggregator" - - } - - public init(aggregator: String, amount: Int, orderId: String, transactionToken: String?, verified: Bool?) { - - self.orderId = orderId - - self.transactionToken = transactionToken - - self.verified = verified - - self.amount = amount - - self.aggregator = aggregator - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - orderId = try container.decode(String.self, forKey: .orderId) - - - - - do { - transactionToken = try container.decode(String.self, forKey: .transactionToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verified = try container.decode(Bool.self, forKey: .verified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - amount = try container.decode(Int.self, forKey: .amount) - - - - - aggregator = try container.decode(String.self, forKey: .aggregator) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(orderId, forKey: .orderId) - - - - try? container.encodeIfPresent(transactionToken, forKey: .transactionToken) - - - - try? container.encodeIfPresent(verified, forKey: .verified) - - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(aggregator, forKey: .aggregator) - - - } - - } - - /* - Model: ChargeCustomerResponse - Used By: Payment - */ - class ChargeCustomerResponse: Codable { - - public var orderId: String - - public var success: Bool - - public var deliveryAddressId: String? - - public var message: String - - public var cartId: String? - - public var status: String - - public var aggregator: String - - - public enum CodingKeys: String, CodingKey { - - case orderId = "order_id" - - case success = "success" - - case deliveryAddressId = "delivery_address_id" - - case message = "message" - - case cartId = "cart_id" - - case status = "status" - - case aggregator = "aggregator" - - } - - public init(aggregator: String, cartId: String?, deliveryAddressId: String?, message: String, orderId: String, status: String, success: Bool) { - - self.orderId = orderId - - self.success = success - - self.deliveryAddressId = deliveryAddressId - - self.message = message - - self.cartId = cartId - - self.status = status - - self.aggregator = aggregator - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - orderId = try container.decode(String.self, forKey: .orderId) - - - - - success = try container.decode(Bool.self, forKey: .success) - - - - - do { - deliveryAddressId = try container.decode(String.self, forKey: .deliveryAddressId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - message = try container.decode(String.self, forKey: .message) - - - - - do { - cartId = try container.decode(String.self, forKey: .cartId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - status = try container.decode(String.self, forKey: .status) - - - - - aggregator = try container.decode(String.self, forKey: .aggregator) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(orderId, forKey: .orderId) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(deliveryAddressId, forKey: .deliveryAddressId) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(cartId, forKey: .cartId) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(aggregator, forKey: .aggregator) - - - } - - } - - /* - Model: PaymentInitializationRequest - Used By: Payment - */ - class PaymentInitializationRequest: Codable { - - public var razorpayPaymentId: String - - public var aggregatorOrderId: String - - public var pollingUrl: String - - public var timeout: Int - - public var customerId: String - - public var virtualId: String? - - public var merchantOrderId: String - - public var method: String - - public var aggregator: String - - - public enum CodingKeys: String, CodingKey { - - case razorpayPaymentId = "razorpay_payment_id" - - case aggregatorOrderId = "aggregator_order_id" - - case pollingUrl = "polling_url" - - case timeout = "timeout" - - case customerId = "customer_id" - - case virtualId = "virtual_id" - - case merchantOrderId = "merchant_order_id" - - case method = "method" - - case aggregator = "aggregator" - - } - - public init(aggregator: String, aggregatorOrderId: String, customerId: String, merchantOrderId: String, method: String, pollingUrl: String, razorpayPaymentId: String, timeout: Int, virtualId: String?) { - - self.razorpayPaymentId = razorpayPaymentId - - self.aggregatorOrderId = aggregatorOrderId - - self.pollingUrl = pollingUrl - - self.timeout = timeout - - self.customerId = customerId - - self.virtualId = virtualId - - self.merchantOrderId = merchantOrderId - - self.method = method - - self.aggregator = aggregator - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - razorpayPaymentId = try container.decode(String.self, forKey: .razorpayPaymentId) - - - - - aggregatorOrderId = try container.decode(String.self, forKey: .aggregatorOrderId) - - - - - pollingUrl = try container.decode(String.self, forKey: .pollingUrl) - - - - - timeout = try container.decode(Int.self, forKey: .timeout) - - - - - customerId = try container.decode(String.self, forKey: .customerId) - - - - - do { - virtualId = try container.decode(String.self, forKey: .virtualId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - merchantOrderId = try container.decode(String.self, forKey: .merchantOrderId) - - - - - method = try container.decode(String.self, forKey: .method) - - - - - aggregator = try container.decode(String.self, forKey: .aggregator) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(razorpayPaymentId, forKey: .razorpayPaymentId) - - - - try? container.encodeIfPresent(aggregatorOrderId, forKey: .aggregatorOrderId) - - - - try? container.encodeIfPresent(pollingUrl, forKey: .pollingUrl) - - - - try? container.encodeIfPresent(timeout, forKey: .timeout) - - - - try? container.encodeIfPresent(customerId, forKey: .customerId) - - - - try? container.encodeIfPresent(virtualId, forKey: .virtualId) - - - - try? container.encodeIfPresent(merchantOrderId, forKey: .merchantOrderId) - - - - try? container.encodeIfPresent(method, forKey: .method) - - - - try? container.encodeIfPresent(aggregator, forKey: .aggregator) - - - } - - } - - /* - Model: PaymentInitializationResponse - Used By: Payment - */ - class PaymentInitializationResponse: Codable { - - public var razorpayPaymentId: String? - - public var success: Bool - - public var aggregatorOrderId: String? - - public var method: String - - public var pollingUrl: String - - public var timeout: Int? - - public var vpa: String? - - public var virtualId: String? - - public var bqrImage: String? - - public var customerId: String? - - public var currency: String? - - public var merchantOrderId: String - - public var amount: Int? - - public var status: String? - - public var aggregator: String - - - public enum CodingKeys: String, CodingKey { - - case razorpayPaymentId = "razorpay_payment_id" - - case success = "success" - - case aggregatorOrderId = "aggregator_order_id" - - case method = "method" - - case pollingUrl = "polling_url" - - case timeout = "timeout" - - case vpa = "vpa" - - case virtualId = "virtual_id" - - case bqrImage = "bqr_image" - - case customerId = "customer_id" - - case currency = "currency" - - case merchantOrderId = "merchant_order_id" - - case amount = "amount" - - case status = "status" - - case aggregator = "aggregator" - - } - - public init(aggregator: String, aggregatorOrderId: String?, amount: Int?, bqrImage: String?, currency: String?, customerId: String?, merchantOrderId: String, method: String, pollingUrl: String, razorpayPaymentId: String?, status: String?, success: Bool, timeout: Int?, virtualId: String?, vpa: String?) { - - self.razorpayPaymentId = razorpayPaymentId - - self.success = success - - self.aggregatorOrderId = aggregatorOrderId - - self.method = method - - self.pollingUrl = pollingUrl - - self.timeout = timeout - - self.vpa = vpa - - self.virtualId = virtualId - - self.bqrImage = bqrImage - - self.customerId = customerId - - self.currency = currency - - self.merchantOrderId = merchantOrderId - - self.amount = amount - - self.status = status - - self.aggregator = aggregator - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - razorpayPaymentId = try container.decode(String.self, forKey: .razorpayPaymentId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - success = try container.decode(Bool.self, forKey: .success) - - - - - do { - aggregatorOrderId = try container.decode(String.self, forKey: .aggregatorOrderId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - method = try container.decode(String.self, forKey: .method) - - - - - pollingUrl = try container.decode(String.self, forKey: .pollingUrl) - - - - - do { - timeout = try container.decode(Int.self, forKey: .timeout) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - vpa = try container.decode(String.self, forKey: .vpa) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - virtualId = try container.decode(String.self, forKey: .virtualId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bqrImage = try container.decode(String.self, forKey: .bqrImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customerId = try container.decode(String.self, forKey: .customerId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(String.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - merchantOrderId = try container.decode(String.self, forKey: .merchantOrderId) - - - - - do { - amount = try container.decode(Int.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - aggregator = try container.decode(String.self, forKey: .aggregator) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(razorpayPaymentId, forKey: .razorpayPaymentId) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(aggregatorOrderId, forKey: .aggregatorOrderId) - - - - try? container.encodeIfPresent(method, forKey: .method) - - - - try? container.encodeIfPresent(pollingUrl, forKey: .pollingUrl) - - - - try? container.encodeIfPresent(timeout, forKey: .timeout) - - - - try? container.encodeIfPresent(vpa, forKey: .vpa) - - - - try? container.encodeIfPresent(virtualId, forKey: .virtualId) - - - - try? container.encodeIfPresent(bqrImage, forKey: .bqrImage) - - - - try? container.encodeIfPresent(customerId, forKey: .customerId) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(merchantOrderId, forKey: .merchantOrderId) - - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(aggregator, forKey: .aggregator) - - - } - - } - - /* - Model: PaymentStatusUpdateRequest - Used By: Payment - */ - class PaymentStatusUpdateRequest: Codable { - - public var orderId: String - - public var method: String - - public var contact: String - - public var vpa: String - - public var email: String - - public var customerId: String - - public var currency: String - - public var merchantOrderId: String - - public var amount: Int - - public var status: String - - public var aggregator: String - - - public enum CodingKeys: String, CodingKey { - - case orderId = "order_id" - - case method = "method" - - case contact = "contact" - - case vpa = "vpa" - - case email = "email" - - case customerId = "customer_id" - - case currency = "currency" - - case merchantOrderId = "merchant_order_id" - - case amount = "amount" - - case status = "status" - - case aggregator = "aggregator" - - } - - public init(aggregator: String, amount: Int, contact: String, currency: String, customerId: String, email: String, merchantOrderId: String, method: String, orderId: String, status: String, vpa: String) { - - self.orderId = orderId - - self.method = method - - self.contact = contact - - self.vpa = vpa - - self.email = email - - self.customerId = customerId - - self.currency = currency - - self.merchantOrderId = merchantOrderId - - self.amount = amount - - self.status = status - - self.aggregator = aggregator - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - orderId = try container.decode(String.self, forKey: .orderId) - - - - - method = try container.decode(String.self, forKey: .method) - - - - - contact = try container.decode(String.self, forKey: .contact) - - - - - vpa = try container.decode(String.self, forKey: .vpa) - - - - - email = try container.decode(String.self, forKey: .email) - - - - - customerId = try container.decode(String.self, forKey: .customerId) - - - - - currency = try container.decode(String.self, forKey: .currency) - - - - - merchantOrderId = try container.decode(String.self, forKey: .merchantOrderId) - - - - - amount = try container.decode(Int.self, forKey: .amount) - - - - - status = try container.decode(String.self, forKey: .status) - - - - - aggregator = try container.decode(String.self, forKey: .aggregator) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(orderId, forKey: .orderId) - - - - try? container.encodeIfPresent(method, forKey: .method) - - - - try? container.encodeIfPresent(contact, forKey: .contact) - - - - try? container.encodeIfPresent(vpa, forKey: .vpa) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(customerId, forKey: .customerId) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(merchantOrderId, forKey: .merchantOrderId) - - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(aggregator, forKey: .aggregator) - - - } - - } - - /* - Model: PaymentStatusUpdateResponse - Used By: Payment - */ - class PaymentStatusUpdateResponse: Codable { - - public var aggregatorName: String - - public var status: String - - public var retry: Bool - - - public enum CodingKeys: String, CodingKey { - - case aggregatorName = "aggregator_name" - - case status = "status" - - case retry = "retry" - - } - - public init(aggregatorName: String, retry: Bool, status: String) { - - self.aggregatorName = aggregatorName - - self.status = status - - self.retry = retry - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - aggregatorName = try container.decode(String.self, forKey: .aggregatorName) - - - - - status = try container.decode(String.self, forKey: .status) - - - - - retry = try container.decode(Bool.self, forKey: .retry) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(aggregatorName, forKey: .aggregatorName) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(retry, forKey: .retry) - - - } - - } - - /* - Model: AggregatorRoute - Used By: Payment - */ - class AggregatorRoute: Codable { - - public var apiLink: String? - - public var data: [String: Any]? - - public var paymentFlow: String? - - - public enum CodingKeys: String, CodingKey { - - case apiLink = "api_link" - - case data = "data" - - case paymentFlow = "payment_flow" - - } - - public init(apiLink: String?, data: [String: Any]?, paymentFlow: String?) { - - self.apiLink = apiLink - - self.data = data - - self.paymentFlow = paymentFlow - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - apiLink = try container.decode(String.self, forKey: .apiLink) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode([String: Any].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentFlow = try container.decode(String.self, forKey: .paymentFlow) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(apiLink, forKey: .apiLink) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - - try? container.encodeIfPresent(paymentFlow, forKey: .paymentFlow) - - - } - - } - - /* - Model: PaymentFlow - Used By: Payment - */ - class PaymentFlow: Codable { - - public var bqrRazorpay: AggregatorRoute? - - public var stripe: AggregatorRoute? - - public var juspay: AggregatorRoute? - - public var upiRazorpay: AggregatorRoute? - - public var msipe: AggregatorRoute? - - public var simpl: AggregatorRoute? - - public var razorpay: AggregatorRoute? - - public var rupifi: AggregatorRoute? - - public var payubiz: AggregatorRoute? - - public var ccavenue: AggregatorRoute? - - public var fynd: AggregatorRoute? - - - public enum CodingKeys: String, CodingKey { - - case bqrRazorpay = "bqr_razorpay" - - case stripe = "stripe" - - case juspay = "juspay" - - case upiRazorpay = "upi_razorpay" - - case msipe = "msipe" - - case simpl = "simpl" - - case razorpay = "razorpay" - - case rupifi = "rupifi" - - case payubiz = "payubiz" - - case ccavenue = "ccavenue" - - case fynd = "fynd" - - } - - public init(bqrRazorpay: AggregatorRoute?, ccavenue: AggregatorRoute?, fynd: AggregatorRoute?, juspay: AggregatorRoute?, msipe: AggregatorRoute?, payubiz: AggregatorRoute?, razorpay: AggregatorRoute?, rupifi: AggregatorRoute?, simpl: AggregatorRoute?, stripe: AggregatorRoute?, upiRazorpay: AggregatorRoute?) { - - self.bqrRazorpay = bqrRazorpay - - self.stripe = stripe - - self.juspay = juspay - - self.upiRazorpay = upiRazorpay - - self.msipe = msipe - - self.simpl = simpl - - self.razorpay = razorpay - - self.rupifi = rupifi - - self.payubiz = payubiz - - self.ccavenue = ccavenue - - self.fynd = fynd - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - bqrRazorpay = try container.decode(AggregatorRoute.self, forKey: .bqrRazorpay) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stripe = try container.decode(AggregatorRoute.self, forKey: .stripe) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - juspay = try container.decode(AggregatorRoute.self, forKey: .juspay) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - upiRazorpay = try container.decode(AggregatorRoute.self, forKey: .upiRazorpay) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - msipe = try container.decode(AggregatorRoute.self, forKey: .msipe) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - simpl = try container.decode(AggregatorRoute.self, forKey: .simpl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - razorpay = try container.decode(AggregatorRoute.self, forKey: .razorpay) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rupifi = try container.decode(AggregatorRoute.self, forKey: .rupifi) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - payubiz = try container.decode(AggregatorRoute.self, forKey: .payubiz) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ccavenue = try container.decode(AggregatorRoute.self, forKey: .ccavenue) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fynd = try container.decode(AggregatorRoute.self, forKey: .fynd) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(bqrRazorpay, forKey: .bqrRazorpay) - - - - try? container.encodeIfPresent(stripe, forKey: .stripe) - - - - try? container.encodeIfPresent(juspay, forKey: .juspay) - - - - try? container.encodeIfPresent(upiRazorpay, forKey: .upiRazorpay) - - - - try? container.encodeIfPresent(msipe, forKey: .msipe) - - - - try? container.encodeIfPresent(simpl, forKey: .simpl) - - - - try? container.encodeIfPresent(razorpay, forKey: .razorpay) - - - - try? container.encodeIfPresent(rupifi, forKey: .rupifi) - - - - try? container.encodeIfPresent(payubiz, forKey: .payubiz) - - - - try? container.encodeIfPresent(ccavenue, forKey: .ccavenue) - - - - try? container.encodeIfPresent(fynd, forKey: .fynd) - - - } - - } - - /* - Model: PaymentModeLogo - Used By: Payment - */ - class PaymentModeLogo: Codable { - - public var large: String - - public var small: String - - - public enum CodingKeys: String, CodingKey { - - case large = "large" - - case small = "small" - - } - - public init(large: String, small: String) { - - self.large = large - - self.small = small - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - large = try container.decode(String.self, forKey: .large) - - - - - small = try container.decode(String.self, forKey: .small) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(large, forKey: .large) - - - - try? container.encodeIfPresent(small, forKey: .small) - - - } - - } - - /* - Model: PaymentModeList - Used By: Payment - */ - class PaymentModeList: Codable { - - public var logoUrl: PaymentModeLogo? - - public var expMonth: Int? - - public var cardNumber: String? - - public var timeout: Int? - - public var cardReference: String? - - public var retryCount: Int? - - public var cardType: String? - - public var displayName: String? - - public var cardId: String? - - public var cardIsin: String? - - public var aggregatorName: String - - public var cardIssuer: String? - - public var intentAppErrorList: [String]? - - public var cardName: String? - - public var nickname: String? - - public var merchantCode: String? - - public var cardToken: String? - - public var cardBrandImage: String? - - public var expired: Bool? - - public var code: String? - - public var cardBrand: String? - - public var displayPriority: Int? - - public var cardFingerprint: String? - - public var intentFlow: String? - - public var name: String? - - public var expYear: Int? - - public var fyndVpa: String? - - - public enum CodingKeys: String, CodingKey { - - case logoUrl = "logo_url" - - case expMonth = "exp_month" - - case cardNumber = "card_number" - - case timeout = "timeout" - - case cardReference = "card_reference" - - case retryCount = "retry_count" - - case cardType = "card_type" - - case displayName = "display_name" - - case cardId = "card_id" - - case cardIsin = "card_isin" - - case aggregatorName = "aggregator_name" - - case cardIssuer = "card_issuer" - - case intentAppErrorList = "intent_app_error_list" - - case cardName = "card_name" - - case nickname = "nickname" - - case merchantCode = "merchant_code" - - case cardToken = "card_token" - - case cardBrandImage = "card_brand_image" - - case expired = "expired" - - case code = "code" - - case cardBrand = "card_brand" - - case displayPriority = "display_priority" - - case cardFingerprint = "card_fingerprint" - - case intentFlow = "intent_flow" - - case name = "name" - - case expYear = "exp_year" - - case fyndVpa = "fynd_vpa" - - } - - public init(aggregatorName: String, cardBrand: String?, cardBrandImage: String?, cardFingerprint: String?, cardId: String?, cardIsin: String?, cardIssuer: String?, cardName: String?, cardNumber: String?, cardReference: String?, cardToken: String?, cardType: String?, code: String?, displayName: String?, displayPriority: Int?, expired: Bool?, expMonth: Int?, expYear: Int?, fyndVpa: String?, intentAppErrorList: [String]?, intentFlow: String?, logoUrl: PaymentModeLogo?, merchantCode: String?, name: String?, nickname: String?, retryCount: Int?, timeout: Int?) { - - self.logoUrl = logoUrl - - self.expMonth = expMonth - - self.cardNumber = cardNumber - - self.timeout = timeout - - self.cardReference = cardReference - - self.retryCount = retryCount - - self.cardType = cardType - - self.displayName = displayName - - self.cardId = cardId - - self.cardIsin = cardIsin - - self.aggregatorName = aggregatorName - - self.cardIssuer = cardIssuer - - self.intentAppErrorList = intentAppErrorList - - self.cardName = cardName - - self.nickname = nickname - - self.merchantCode = merchantCode - - self.cardToken = cardToken - - self.cardBrandImage = cardBrandImage - - self.expired = expired - - self.code = code - - self.cardBrand = cardBrand - - self.displayPriority = displayPriority - - self.cardFingerprint = cardFingerprint - - self.intentFlow = intentFlow - - self.name = name - - self.expYear = expYear - - self.fyndVpa = fyndVpa - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - logoUrl = try container.decode(PaymentModeLogo.self, forKey: .logoUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expMonth = try container.decode(Int.self, forKey: .expMonth) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardNumber = try container.decode(String.self, forKey: .cardNumber) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - timeout = try container.decode(Int.self, forKey: .timeout) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardReference = try container.decode(String.self, forKey: .cardReference) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - retryCount = try container.decode(Int.self, forKey: .retryCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardType = try container.decode(String.self, forKey: .cardType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardId = try container.decode(String.self, forKey: .cardId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardIsin = try container.decode(String.self, forKey: .cardIsin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - aggregatorName = try container.decode(String.self, forKey: .aggregatorName) - - - - - do { - cardIssuer = try container.decode(String.self, forKey: .cardIssuer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - intentAppErrorList = try container.decode([String].self, forKey: .intentAppErrorList) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardName = try container.decode(String.self, forKey: .cardName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - nickname = try container.decode(String.self, forKey: .nickname) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - merchantCode = try container.decode(String.self, forKey: .merchantCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardToken = try container.decode(String.self, forKey: .cardToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardBrandImage = try container.decode(String.self, forKey: .cardBrandImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expired = try container.decode(Bool.self, forKey: .expired) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardBrand = try container.decode(String.self, forKey: .cardBrand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayPriority = try container.decode(Int.self, forKey: .displayPriority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardFingerprint = try container.decode(String.self, forKey: .cardFingerprint) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - intentFlow = try container.decode(String.self, forKey: .intentFlow) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expYear = try container.decode(Int.self, forKey: .expYear) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fyndVpa = try container.decode(String.self, forKey: .fyndVpa) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(logoUrl, forKey: .logoUrl) - - - - try? container.encodeIfPresent(expMonth, forKey: .expMonth) - - - - try? container.encodeIfPresent(cardNumber, forKey: .cardNumber) - - - - try? container.encodeIfPresent(timeout, forKey: .timeout) - - - - try? container.encodeIfPresent(cardReference, forKey: .cardReference) - - - - try? container.encodeIfPresent(retryCount, forKey: .retryCount) - - - - try? container.encodeIfPresent(cardType, forKey: .cardType) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(cardId, forKey: .cardId) - - - - try? container.encodeIfPresent(cardIsin, forKey: .cardIsin) - - - - try? container.encodeIfPresent(aggregatorName, forKey: .aggregatorName) - - - - try? container.encodeIfPresent(cardIssuer, forKey: .cardIssuer) - - - - try? container.encodeIfPresent(intentAppErrorList, forKey: .intentAppErrorList) - - - - try? container.encodeIfPresent(cardName, forKey: .cardName) - - - - try? container.encodeIfPresent(nickname, forKey: .nickname) - - - - try? container.encodeIfPresent(merchantCode, forKey: .merchantCode) - - - - try? container.encodeIfPresent(cardToken, forKey: .cardToken) - - - - try? container.encodeIfPresent(cardBrandImage, forKey: .cardBrandImage) - - - - try? container.encodeIfPresent(expired, forKey: .expired) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(cardBrand, forKey: .cardBrand) - - - - try? container.encodeIfPresent(displayPriority, forKey: .displayPriority) - - - - try? container.encodeIfPresent(cardFingerprint, forKey: .cardFingerprint) - - - - try? container.encodeIfPresent(intentFlow, forKey: .intentFlow) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(expYear, forKey: .expYear) - - - - try? container.encodeIfPresent(fyndVpa, forKey: .fyndVpa) - - - } - - } - - /* - Model: RootPaymentMode - Used By: Payment - */ - class RootPaymentMode: Codable { - - public var list: [PaymentModeList]? - - public var aggregatorName: String? - - public var anonymousEnable: Bool? - - public var displayPriority: Int - - public var addCardEnabled: Bool? - - public var displayName: String - - public var name: String - - - public enum CodingKeys: String, CodingKey { - - case list = "list" - - case aggregatorName = "aggregator_name" - - case anonymousEnable = "anonymous_enable" - - case displayPriority = "display_priority" - - case addCardEnabled = "add_card_enabled" - - case displayName = "display_name" - - case name = "name" - - } - - public init(addCardEnabled: Bool?, aggregatorName: String?, anonymousEnable: Bool?, displayName: String, displayPriority: Int, list: [PaymentModeList]?, name: String) { - - self.list = list - - self.aggregatorName = aggregatorName - - self.anonymousEnable = anonymousEnable - - self.displayPriority = displayPriority - - self.addCardEnabled = addCardEnabled - - self.displayName = displayName - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - list = try container.decode([PaymentModeList].self, forKey: .list) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - aggregatorName = try container.decode(String.self, forKey: .aggregatorName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - anonymousEnable = try container.decode(Bool.self, forKey: .anonymousEnable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - displayPriority = try container.decode(Int.self, forKey: .displayPriority) - - - - - do { - addCardEnabled = try container.decode(Bool.self, forKey: .addCardEnabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - displayName = try container.decode(String.self, forKey: .displayName) - - - - - name = try container.decode(String.self, forKey: .name) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(list, forKey: .list) - - - - try? container.encodeIfPresent(aggregatorName, forKey: .aggregatorName) - - - - try? container.encodeIfPresent(anonymousEnable, forKey: .anonymousEnable) - - - - try? container.encodeIfPresent(displayPriority, forKey: .displayPriority) - - - - try? container.encodeIfPresent(addCardEnabled, forKey: .addCardEnabled) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: PaymentOptionAndFlow - Used By: Payment - */ - class PaymentOptionAndFlow: Codable { - - public var paymentFlows: PaymentFlow - - public var paymentOption: [RootPaymentMode] - - - public enum CodingKeys: String, CodingKey { - - case paymentFlows = "payment_flows" - - case paymentOption = "payment_option" - - } - - public init(paymentFlows: PaymentFlow, paymentOption: [RootPaymentMode]) { - - self.paymentFlows = paymentFlows - - self.paymentOption = paymentOption - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - paymentFlows = try container.decode(PaymentFlow.self, forKey: .paymentFlows) - - - - - paymentOption = try container.decode([RootPaymentMode].self, forKey: .paymentOption) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(paymentFlows, forKey: .paymentFlows) - - - - try? container.encodeIfPresent(paymentOption, forKey: .paymentOption) - - - } - - } - - /* - Model: PaymentModeRouteResponse - Used By: Payment - */ - class PaymentModeRouteResponse: Codable { - - public var success: Bool - - public var paymentOptions: PaymentOptionAndFlow - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case paymentOptions = "payment_options" - - } - - public init(paymentOptions: PaymentOptionAndFlow, success: Bool) { - - self.success = success - - self.paymentOptions = paymentOptions - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - paymentOptions = try container.decode(PaymentOptionAndFlow.self, forKey: .paymentOptions) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(paymentOptions, forKey: .paymentOptions) - - - } - - } - - /* - Model: RupifiBannerData - Used By: Payment - */ - class RupifiBannerData: Codable { - - public var status: String? - - public var kycUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case status = "status" - - case kycUrl = "kyc_url" - - } - - public init(kycUrl: String?, status: String?) { - - self.status = status - - self.kycUrl = kycUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - kycUrl = try container.decode(String.self, forKey: .kycUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(kycUrl, forKey: .kycUrl) - - - } - - } - - /* - Model: RupifiBannerResponse - Used By: Payment - */ - class RupifiBannerResponse: Codable { - - public var success: Bool - - public var data: RupifiBannerData - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case data = "data" - - } - - public init(data: RupifiBannerData, success: Bool) { - - self.success = success - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - data = try container.decode(RupifiBannerData.self, forKey: .data) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: TransferItemsDetails - Used By: Payment - */ - class TransferItemsDetails: Codable { - - public var id: String - - public var logoLarge: String - - public var logoSmall: String - - public var displayName: Bool? - - public var name: String - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case logoLarge = "logo_large" - - case logoSmall = "logo_small" - - case displayName = "display_name" - - case name = "name" - - } - - public init(displayName: Bool?, id: String, logoLarge: String, logoSmall: String, name: String) { - - self.id = id - - self.logoLarge = logoLarge - - self.logoSmall = logoSmall - - self.displayName = displayName - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - id = try container.decode(String.self, forKey: .id) - - - - - logoLarge = try container.decode(String.self, forKey: .logoLarge) - - - - - logoSmall = try container.decode(String.self, forKey: .logoSmall) - - - - - do { - displayName = try container.decode(Bool.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(logoLarge, forKey: .logoLarge) - - - - try? container.encodeIfPresent(logoSmall, forKey: .logoSmall) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: TransferModeDetails - Used By: Payment - */ - class TransferModeDetails: Codable { - - public var items: [TransferItemsDetails]? - - public var displayName: String - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case displayName = "display_name" - - } - - public init(displayName: String, items: [TransferItemsDetails]?) { - - self.items = items - - self.displayName = displayName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([TransferItemsDetails].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - displayName = try container.decode(String.self, forKey: .displayName) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - } - - } - - /* - Model: TransferModeResponse - Used By: Payment - */ - class TransferModeResponse: Codable { - - public var data: [TransferModeDetails] - - - public enum CodingKeys: String, CodingKey { - - case data = "data" - - } - - public init(data: [TransferModeDetails]) { - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - data = try container.decode([TransferModeDetails].self, forKey: .data) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: UpdateRefundTransferModeRequest - Used By: Payment - */ - class UpdateRefundTransferModeRequest: Codable { - - public var transferMode: String - - public var enable: Bool - - - public enum CodingKeys: String, CodingKey { - - case transferMode = "transfer_mode" - - case enable = "enable" - - } - - public init(enable: Bool, transferMode: String) { - - self.transferMode = transferMode - - self.enable = enable - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - transferMode = try container.decode(String.self, forKey: .transferMode) - - - - - enable = try container.decode(Bool.self, forKey: .enable) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(transferMode, forKey: .transferMode) - - - - try? container.encodeIfPresent(enable, forKey: .enable) - - - } - - } - - /* - Model: UpdateRefundTransferModeResponse - Used By: Payment - */ - class UpdateRefundTransferModeResponse: Codable { - - public var success: Bool? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - } - - public init(success: Bool?) { - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: OrderBeneficiaryDetails - Used By: Payment - */ - class OrderBeneficiaryDetails: Codable { - - public var modifiedOn: String - - public var id: Int - - public var comment: Bool? - - public var subtitle: String - - public var mobile: Bool? - - public var email: String - - public var transferMode: String - - public var displayName: String - - public var beneficiaryId: String - - public var ifscCode: String - - public var bankName: String - - public var isActive: Bool - - public var createdOn: String - - public var address: String - - public var branchName: Bool? - - public var delightsUserName: String - - public var accountHolder: String - - public var title: String - - public var accountNo: String - - - public enum CodingKeys: String, CodingKey { - - case modifiedOn = "modified_on" - - case id = "id" - - case comment = "comment" - - case subtitle = "subtitle" - - case mobile = "mobile" - - case email = "email" - - case transferMode = "transfer_mode" - - case displayName = "display_name" - - case beneficiaryId = "beneficiary_id" - - case ifscCode = "ifsc_code" - - case bankName = "bank_name" - - case isActive = "is_active" - - case createdOn = "created_on" - - case address = "address" - - case branchName = "branch_name" - - case delightsUserName = "delights_user_name" - - case accountHolder = "account_holder" - - case title = "title" - - case accountNo = "account_no" - - } - - public init(accountHolder: String, accountNo: String, address: String, bankName: String, beneficiaryId: String, branchName: Bool?, comment: Bool?, createdOn: String, delightsUserName: String, displayName: String, email: String, id: Int, ifscCode: String, isActive: Bool, mobile: Bool?, modifiedOn: String, subtitle: String, title: String, transferMode: String) { - - self.modifiedOn = modifiedOn - - self.id = id - - self.comment = comment - - self.subtitle = subtitle - - self.mobile = mobile - - self.email = email - - self.transferMode = transferMode - - self.displayName = displayName - - self.beneficiaryId = beneficiaryId - - self.ifscCode = ifscCode - - self.bankName = bankName - - self.isActive = isActive - - self.createdOn = createdOn - - self.address = address - - self.branchName = branchName - - self.delightsUserName = delightsUserName - - self.accountHolder = accountHolder - - self.title = title - - self.accountNo = accountNo - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - - - - id = try container.decode(Int.self, forKey: .id) - - - - - do { - comment = try container.decode(Bool.self, forKey: .comment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - subtitle = try container.decode(String.self, forKey: .subtitle) - - - - - do { - mobile = try container.decode(Bool.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - email = try container.decode(String.self, forKey: .email) - - - - - transferMode = try container.decode(String.self, forKey: .transferMode) - - - - - displayName = try container.decode(String.self, forKey: .displayName) - - - - - beneficiaryId = try container.decode(String.self, forKey: .beneficiaryId) - - - - - ifscCode = try container.decode(String.self, forKey: .ifscCode) - - - - - bankName = try container.decode(String.self, forKey: .bankName) - - - - - isActive = try container.decode(Bool.self, forKey: .isActive) - - - - - createdOn = try container.decode(String.self, forKey: .createdOn) - - - - - address = try container.decode(String.self, forKey: .address) - - - - - do { - branchName = try container.decode(Bool.self, forKey: .branchName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - delightsUserName = try container.decode(String.self, forKey: .delightsUserName) - - - - - accountHolder = try container.decode(String.self, forKey: .accountHolder) - - - - - title = try container.decode(String.self, forKey: .title) - - - - - accountNo = try container.decode(String.self, forKey: .accountNo) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(comment, forKey: .comment) - - - - try? container.encodeIfPresent(subtitle, forKey: .subtitle) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(transferMode, forKey: .transferMode) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(beneficiaryId, forKey: .beneficiaryId) - - - - try? container.encodeIfPresent(ifscCode, forKey: .ifscCode) - - - - try? container.encodeIfPresent(bankName, forKey: .bankName) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(branchName, forKey: .branchName) - - - - try? container.encodeIfPresent(delightsUserName, forKey: .delightsUserName) - - - - try? container.encodeIfPresent(accountHolder, forKey: .accountHolder) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(accountNo, forKey: .accountNo) - - - } - - } - - /* - Model: OrderBeneficiaryResponse - Used By: Payment - */ - class OrderBeneficiaryResponse: Codable { - - public var beneficiaries: [OrderBeneficiaryDetails] - - public var showBeneficiaryDetails: Bool? - - - public enum CodingKeys: String, CodingKey { - - case beneficiaries = "beneficiaries" - - case showBeneficiaryDetails = "show_beneficiary_details" - - } - - public init(beneficiaries: [OrderBeneficiaryDetails], showBeneficiaryDetails: Bool?) { - - self.beneficiaries = beneficiaries - - self.showBeneficiaryDetails = showBeneficiaryDetails - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - beneficiaries = try container.decode([OrderBeneficiaryDetails].self, forKey: .beneficiaries) - - - - - do { - showBeneficiaryDetails = try container.decode(Bool.self, forKey: .showBeneficiaryDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(beneficiaries, forKey: .beneficiaries) - - - - try? container.encodeIfPresent(showBeneficiaryDetails, forKey: .showBeneficiaryDetails) - - - } - - } - - /* - Model: NotFoundResourceError - Used By: Payment - */ - class NotFoundResourceError: Codable { - - public var success: Bool - - public var code: String - - public var description: String - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case code = "code" - - case description = "description" - - } - - public init(code: String, description: String, success: Bool) { - - self.success = success - - self.code = code - - self.description = description - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - code = try container.decode(String.self, forKey: .code) - - - - - description = try container.decode(String.self, forKey: .description) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - } - - } - - /* - Model: IfscCodeResponse - Used By: Payment - */ - class IfscCodeResponse: Codable { - - public var success: Bool? - - public var bankName: String - - public var branchName: String - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case bankName = "bank_name" - - case branchName = "branch_name" - - } - - public init(bankName: String, branchName: String, success: Bool?) { - - self.success = success - - self.bankName = bankName - - self.branchName = branchName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - bankName = try container.decode(String.self, forKey: .bankName) - - - - - branchName = try container.decode(String.self, forKey: .branchName) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(bankName, forKey: .bankName) - - - - try? container.encodeIfPresent(branchName, forKey: .branchName) - - - } - - } - - /* - Model: ErrorCodeDescription - Used By: Payment - */ - class ErrorCodeDescription: Codable { - - public var success: Bool - - public var code: String - - public var description: String - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case code = "code" - - case description = "description" - - } - - public init(code: String, description: String, success: Bool) { - - self.success = success - - self.code = code - - self.description = description - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - code = try container.decode(String.self, forKey: .code) - - - - - description = try container.decode(String.self, forKey: .description) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - } - - } - - /* - Model: AddBeneficiaryViaOtpVerificationRequest - Used By: Payment - */ - class AddBeneficiaryViaOtpVerificationRequest: Codable { - - public var otp: String - - public var requestId: String - - public var hashKey: String - - - public enum CodingKeys: String, CodingKey { - - case otp = "otp" - - case requestId = "request_id" - - case hashKey = "hash_key" - - } - - public init(hashKey: String, otp: String, requestId: String) { - - self.otp = otp - - self.requestId = requestId - - self.hashKey = hashKey - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - otp = try container.decode(String.self, forKey: .otp) - - - - - requestId = try container.decode(String.self, forKey: .requestId) - - - - - hashKey = try container.decode(String.self, forKey: .hashKey) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(otp, forKey: .otp) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(hashKey, forKey: .hashKey) - - - } - - } - - /* - Model: AddBeneficiaryViaOtpVerificationResponse - Used By: Payment - */ - class AddBeneficiaryViaOtpVerificationResponse: Codable { - - public var otp: String - - public var requestId: String - - public var hashKey: String - - - public enum CodingKeys: String, CodingKey { - - case otp = "otp" - - case requestId = "request_id" - - case hashKey = "hash_key" - - } - - public init(hashKey: String, otp: String, requestId: String) { - - self.otp = otp - - self.requestId = requestId - - self.hashKey = hashKey - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - otp = try container.decode(String.self, forKey: .otp) - - - - - requestId = try container.decode(String.self, forKey: .requestId) - - - - - hashKey = try container.decode(String.self, forKey: .hashKey) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(otp, forKey: .otp) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(hashKey, forKey: .hashKey) - - - } - - } - - /* - Model: WrongOtpError - Used By: Payment - */ - class WrongOtpError: Codable { - - public var success: String - - public var description: String - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case description = "description" - - } - - public init(description: String, success: String) { - - self.success = success - - self.description = description - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(String.self, forKey: .success) - - - - - description = try container.decode(String.self, forKey: .description) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - } - - } - - /* - Model: BeneficiaryModeDetails - Used By: Payment - */ - class BeneficiaryModeDetails: Codable { - - public var address: String? - - public var wallet: String? - - public var branchName: String - - public var bankName: String - - public var comment: String? - - public var mobile: String - - public var accountHolder: String - - public var vpa: String? - - public var email: String - - public var ifscCode: String - - public var accountNo: String - - - public enum CodingKeys: String, CodingKey { - - case address = "address" - - case wallet = "wallet" - - case branchName = "branch_name" - - case bankName = "bank_name" - - case comment = "comment" - - case mobile = "mobile" - - case accountHolder = "account_holder" - - case vpa = "vpa" - - case email = "email" - - case ifscCode = "ifsc_code" - - case accountNo = "account_no" - - } - - public init(accountHolder: String, accountNo: String, address: String?, bankName: String, branchName: String, comment: String?, email: String, ifscCode: String, mobile: String, vpa: String?, wallet: String?) { - - self.address = address - - self.wallet = wallet - - self.branchName = branchName - - self.bankName = bankName - - self.comment = comment - - self.mobile = mobile - - self.accountHolder = accountHolder - - self.vpa = vpa - - self.email = email - - self.ifscCode = ifscCode - - self.accountNo = accountNo - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - address = try container.decode(String.self, forKey: .address) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - wallet = try container.decode(String.self, forKey: .wallet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - branchName = try container.decode(String.self, forKey: .branchName) - - - - - bankName = try container.decode(String.self, forKey: .bankName) - - - - - do { - comment = try container.decode(String.self, forKey: .comment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - mobile = try container.decode(String.self, forKey: .mobile) - - - - - accountHolder = try container.decode(String.self, forKey: .accountHolder) - - - - - do { - vpa = try container.decode(String.self, forKey: .vpa) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - email = try container.decode(String.self, forKey: .email) - - - - - ifscCode = try container.decode(String.self, forKey: .ifscCode) - - - - - accountNo = try container.decode(String.self, forKey: .accountNo) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(wallet, forKey: .wallet) - - - - try? container.encodeIfPresent(branchName, forKey: .branchName) - - - - try? container.encodeIfPresent(bankName, forKey: .bankName) - - - - try? container.encodeIfPresent(comment, forKey: .comment) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(accountHolder, forKey: .accountHolder) - - - - try? container.encodeIfPresent(vpa, forKey: .vpa) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(ifscCode, forKey: .ifscCode) - - - - try? container.encodeIfPresent(accountNo, forKey: .accountNo) - - - } - - } - - /* - Model: AddBeneficiaryDetailsRequest - Used By: Payment - */ - class AddBeneficiaryDetailsRequest: Codable { - - public var orderId: String - - public var details: BeneficiaryModeDetails - - public var requestId: String? - - public var otp: String? - - public var transferMode: String - - public var shipmentId: String - - public var delights: Bool - - - public enum CodingKeys: String, CodingKey { - - case orderId = "order_id" - - case details = "details" - - case requestId = "request_id" - - case otp = "otp" - - case transferMode = "transfer_mode" - - case shipmentId = "shipment_id" - - case delights = "delights" - - } - - public init(delights: Bool, details: BeneficiaryModeDetails, orderId: String, otp: String?, requestId: String?, shipmentId: String, transferMode: String) { - - self.orderId = orderId - - self.details = details - - self.requestId = requestId - - self.otp = otp - - self.transferMode = transferMode - - self.shipmentId = shipmentId - - self.delights = delights - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - orderId = try container.decode(String.self, forKey: .orderId) - - - - - details = try container.decode(BeneficiaryModeDetails.self, forKey: .details) - - - - - do { - requestId = try container.decode(String.self, forKey: .requestId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - otp = try container.decode(String.self, forKey: .otp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - transferMode = try container.decode(String.self, forKey: .transferMode) - - - - - shipmentId = try container.decode(String.self, forKey: .shipmentId) - - - - - delights = try container.decode(Bool.self, forKey: .delights) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(orderId, forKey: .orderId) - - - - try? container.encodeIfPresent(details, forKey: .details) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(otp, forKey: .otp) - - - - try? container.encodeIfPresent(transferMode, forKey: .transferMode) - - - - try? container.encodeIfPresent(shipmentId, forKey: .shipmentId) - - - - try? container.encodeIfPresent(delights, forKey: .delights) - - - } - - } - - /* - Model: RefundAccountResponse - Used By: Payment - */ - class RefundAccountResponse: Codable { - - public var success: Bool - - public var message: String - - public var data: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case message = "message" - - case data = "data" - - } - - public init(data: [String: Any]?, message: String, success: Bool) { - - self.success = success - - self.message = message - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - message = try container.decode(String.self, forKey: .message) - - - - - do { - data = try container.decode([String: Any].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: BankDetailsForOTP - Used By: Payment - */ - class BankDetailsForOTP: Codable { - - public var branchName: String - - public var accountHolder: String - - public var accountNo: String - - public var ifscCode: String - - public var bankName: String - - - public enum CodingKeys: String, CodingKey { - - case branchName = "branch_name" - - case accountHolder = "account_holder" - - case accountNo = "account_no" - - case ifscCode = "ifsc_code" - - case bankName = "bank_name" - - } - - public init(accountHolder: String, accountNo: String, bankName: String, branchName: String, ifscCode: String) { - - self.branchName = branchName - - self.accountHolder = accountHolder - - self.accountNo = accountNo - - self.ifscCode = ifscCode - - self.bankName = bankName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - branchName = try container.decode(String.self, forKey: .branchName) - - - - - accountHolder = try container.decode(String.self, forKey: .accountHolder) - - - - - accountNo = try container.decode(String.self, forKey: .accountNo) - - - - - ifscCode = try container.decode(String.self, forKey: .ifscCode) - - - - - bankName = try container.decode(String.self, forKey: .bankName) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(branchName, forKey: .branchName) - - - - try? container.encodeIfPresent(accountHolder, forKey: .accountHolder) - - - - try? container.encodeIfPresent(accountNo, forKey: .accountNo) - - - - try? container.encodeIfPresent(ifscCode, forKey: .ifscCode) - - - - try? container.encodeIfPresent(bankName, forKey: .bankName) - - - } - - } - - /* - Model: AddBeneficiaryDetailsOTPRequest - Used By: Payment - */ - class AddBeneficiaryDetailsOTPRequest: Codable { - - public var orderId: String - - public var details: BankDetailsForOTP - - - public enum CodingKeys: String, CodingKey { - - case orderId = "order_id" - - case details = "details" - - } - - public init(details: BankDetailsForOTP, orderId: String) { - - self.orderId = orderId - - self.details = details - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - orderId = try container.decode(String.self, forKey: .orderId) - - - - - details = try container.decode(BankDetailsForOTP.self, forKey: .details) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(orderId, forKey: .orderId) - - - - try? container.encodeIfPresent(details, forKey: .details) - - - } - - } - - /* - Model: WalletOtpRequest - Used By: Payment - */ - class WalletOtpRequest: Codable { - - public var countryCode: String - - public var mobile: String - - - public enum CodingKeys: String, CodingKey { - - case countryCode = "country_code" - - case mobile = "mobile" - - } - - public init(countryCode: String, mobile: String) { - - self.countryCode = countryCode - - self.mobile = mobile - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - countryCode = try container.decode(String.self, forKey: .countryCode) - - - - - mobile = try container.decode(String.self, forKey: .mobile) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - } - - } - - /* - Model: WalletOtpResponse - Used By: Payment - */ - class WalletOtpResponse: Codable { - - public var success: Bool? - - public var requestId: String - - public var isVerifiedFlag: String - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case requestId = "request_id" - - case isVerifiedFlag = "is_verified_flag" - - } - - public init(isVerifiedFlag: String, requestId: String, success: Bool?) { - - self.success = success - - self.requestId = requestId - - self.isVerifiedFlag = isVerifiedFlag - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - requestId = try container.decode(String.self, forKey: .requestId) - - - - - isVerifiedFlag = try container.decode(String.self, forKey: .isVerifiedFlag) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(isVerifiedFlag, forKey: .isVerifiedFlag) - - - } - - } - - /* - Model: SetDefaultBeneficiaryRequest - Used By: Payment - */ - class SetDefaultBeneficiaryRequest: Codable { - - public var orderId: String - - public var beneficiaryId: String - - - public enum CodingKeys: String, CodingKey { - - case orderId = "order_id" - - case beneficiaryId = "beneficiary_id" - - } - - public init(beneficiaryId: String, orderId: String) { - - self.orderId = orderId - - self.beneficiaryId = beneficiaryId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - orderId = try container.decode(String.self, forKey: .orderId) - - - - - beneficiaryId = try container.decode(String.self, forKey: .beneficiaryId) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(orderId, forKey: .orderId) - - - - try? container.encodeIfPresent(beneficiaryId, forKey: .beneficiaryId) - - - } - - } - - /* - Model: SetDefaultBeneficiaryResponse - Used By: Payment - */ - class SetDefaultBeneficiaryResponse: Codable { - - public var success: Bool? - - public var isBeneficiarySet: Bool - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case isBeneficiarySet = "is_beneficiary_set" - - } - - public init(isBeneficiarySet: Bool, success: Bool?) { - - self.success = success - - self.isBeneficiarySet = isBeneficiarySet - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - isBeneficiarySet = try container.decode(Bool.self, forKey: .isBeneficiarySet) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(isBeneficiarySet, forKey: .isBeneficiarySet) - - - } - - } - - - - /* - Model: OrderById - Used By: Order - */ - class OrderById: Codable { - - public var order: OrderSchema - - - public enum CodingKeys: String, CodingKey { - - case order = "order" - - } - - public init(order: OrderSchema) { - - self.order = order - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - order = try container.decode(OrderSchema.self, forKey: .order) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(order, forKey: .order) - - - } - - } - - /* - Model: OrderList - Used By: Order - */ - class OrderList: Codable { - - public var items: [OrderSchema] - - public var page: OrderPage - - public var filters: OrderFilters - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - case filters = "filters" - - } - - public init(filters: OrderFilters, items: [OrderSchema], page: OrderPage) { - - self.items = items - - self.page = page - - self.filters = filters - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - items = try container.decode([OrderSchema].self, forKey: .items) - - - - - page = try container.decode(OrderPage.self, forKey: .page) - - - - - filters = try container.decode(OrderFilters.self, forKey: .filters) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(filters, forKey: .filters) - - - } - - } - - /* - Model: OrderPage - Used By: Order - */ - class OrderPage: Codable { - - public var itemTotal: Int? - - public var type: String? - - public var size: Int? - - public var current: Int? - - public var hasNext: Bool? - - - public enum CodingKeys: String, CodingKey { - - case itemTotal = "item_total" - - case type = "type" - - case size = "size" - - case current = "current" - - case hasNext = "has_next" - - } - - public init(current: Int?, hasNext: Bool?, itemTotal: Int?, size: Int?, type: String?) { - - self.itemTotal = itemTotal - - self.type = type - - self.size = size - - self.current = current - - self.hasNext = hasNext - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - itemTotal = try container.decode(Int.self, forKey: .itemTotal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - size = try container.decode(Int.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - current = try container.decode(Int.self, forKey: .current) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasNext = try container.decode(Bool.self, forKey: .hasNext) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(current, forKey: .current) - - - - try? container.encodeIfPresent(hasNext, forKey: .hasNext) - - - } - - } - - /* - Model: OrderFilters - Used By: Order - */ - class OrderFilters: Codable { - - public var statuses: [OrderStatuses]? - - - public enum CodingKeys: String, CodingKey { - - case statuses = "statuses" - - } - - public init(statuses: [OrderStatuses]?) { - - self.statuses = statuses - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - statuses = try container.decode([OrderStatuses].self, forKey: .statuses) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(statuses, forKey: .statuses) - - - } - - } - - /* - Model: OrderStatuses - Used By: Order - */ - class OrderStatuses: Codable { - - public var display: String? - - public var value: Int? - - public var isSelected: Bool? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case value = "value" - - case isSelected = "is_selected" - - } - - public init(display: String?, isSelected: Bool?, value: Int?) { - - self.display = display - - self.value = value - - self.isSelected = isSelected - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(Int.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isSelected = try container.decode(Bool.self, forKey: .isSelected) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(isSelected, forKey: .isSelected) - - - } - - } - - /* - Model: ReqBodyVerifyOTPShipment - Used By: Order - */ - class ReqBodyVerifyOTPShipment: Codable { - - public var requestId: String - - public var otpCode: String - - - public enum CodingKeys: String, CodingKey { - - case requestId = "request_id" - - case otpCode = "otp_code" - - } - - public init(otpCode: String, requestId: String) { - - self.requestId = requestId - - self.otpCode = otpCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - requestId = try container.decode(String.self, forKey: .requestId) - - - - - otpCode = try container.decode(String.self, forKey: .otpCode) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(otpCode, forKey: .otpCode) - - - } - - } - - /* - Model: ResponseVerifyOTPShipment - Used By: Order - */ - class ResponseVerifyOTPShipment: Codable { - - public var success: Bool - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - } - - public init(success: Bool) { - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: sendOTPApplicationResponse - Used By: Order - */ - class sendOTPApplicationResponse: Codable { - - public var success: Bool - - public var requestId: String - - public var message: String - - public var resendTimer: Int - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case requestId = "request_id" - - case message = "message" - - case resendTimer = "resend_timer" - - } - - public init(message: String, requestId: String, resendTimer: Int, success: Bool) { - - self.success = success - - self.requestId = requestId - - self.message = message - - self.resendTimer = resendTimer - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - requestId = try container.decode(String.self, forKey: .requestId) - - - - - message = try container.decode(String.self, forKey: .message) - - - - - resendTimer = try container.decode(Int.self, forKey: .resendTimer) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(resendTimer, forKey: .resendTimer) - - - } - - } - - /* - Model: ShipmentById - Used By: Order - */ - class ShipmentById: Codable { - - public var shipment: Shipments - - - public enum CodingKeys: String, CodingKey { - - case shipment = "shipment" - - } - - public init(shipment: Shipments) { - - self.shipment = shipment - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - shipment = try container.decode(Shipments.self, forKey: .shipment) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(shipment, forKey: .shipment) - - - } - - } - - /* - Model: CustomerDetailsByShipmentId - Used By: Order - */ - class CustomerDetailsByShipmentId: Codable { - - public var orderId: String - - public var shipmentId: String - - public var name: String - - public var phone: String - - public var country: String - - - public enum CodingKeys: String, CodingKey { - - case orderId = "order_id" - - case shipmentId = "shipment_id" - - case name = "name" - - case phone = "phone" - - case country = "country" - - } - - public init(country: String, name: String, orderId: String, phone: String, shipmentId: String) { - - self.orderId = orderId - - self.shipmentId = shipmentId - - self.name = name - - self.phone = phone - - self.country = country - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - orderId = try container.decode(String.self, forKey: .orderId) - - - - - shipmentId = try container.decode(String.self, forKey: .shipmentId) - - - - - name = try container.decode(String.self, forKey: .name) - - - - - phone = try container.decode(String.self, forKey: .phone) - - - - - country = try container.decode(String.self, forKey: .country) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(orderId, forKey: .orderId) - - - - try? container.encodeIfPresent(shipmentId, forKey: .shipmentId) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - } - - } - - /* - Model: ShipmentReasons - Used By: Order - */ - class ShipmentReasons: Codable { - - public var reasons: [Reasons] - - - public enum CodingKeys: String, CodingKey { - - case reasons = "reasons" - - } - - public init(reasons: [Reasons]) { - - self.reasons = reasons - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - reasons = try container.decode([Reasons].self, forKey: .reasons) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(reasons, forKey: .reasons) - - - } - - } - - /* - Model: ShipmentStatusUpdateBody - Used By: Order - */ - class ShipmentStatusUpdateBody: Codable { - - public var statuses: [StatusesBody] - - public var forceTransition: Bool - - - public enum CodingKeys: String, CodingKey { - - case statuses = "statuses" - - case forceTransition = "force_transition" - - } - - public init(forceTransition: Bool, statuses: [StatusesBody]) { - - self.statuses = statuses - - self.forceTransition = forceTransition - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - statuses = try container.decode([StatusesBody].self, forKey: .statuses) - - - - - forceTransition = try container.decode(Bool.self, forKey: .forceTransition) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(statuses, forKey: .statuses) - - - - try? container.encodeIfPresent(forceTransition, forKey: .forceTransition) - - - } - - } - - /* - Model: StatusesBody - Used By: Order - */ - class StatusesBody: Codable { - - public var status: String? - - public var shipments: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case status = "status" - - case shipments = "shipments" - - } - - public init(shipments: [String: Any]?, status: String?) { - - self.status = status - - self.shipments = shipments - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shipments = try container.decode([String: Any].self, forKey: .shipments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(shipments, forKey: .shipments) - - - } - - } - - /* - Model: ShipmentStatusUpdate - Used By: Order - */ - class ShipmentStatusUpdate: Codable { - - public var message: [[String: Any]] - - public var status: Bool - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - case status = "status" - - } - - public init(message: [[String: Any]], status: Bool) { - - self.message = message - - self.status = status - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - message = try container.decode([[String: Any]].self, forKey: .message) - - - - - status = try container.decode(Bool.self, forKey: .status) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - } - - } - - /* - Model: ShipmentTrack - Used By: Order - */ - class ShipmentTrack: Codable { - - public var results: [Track] - - - public enum CodingKeys: String, CodingKey { - - case results = "results" - - } - - public init(results: [Track]) { - - self.results = results - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - results = try container.decode([Track].self, forKey: .results) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(results, forKey: .results) - - - } - - } - - /* - Model: OrderSchema - Used By: Order - */ - class OrderSchema: Codable { - - public var orderId: String? - - public var breakupValues: [BreakupValues]? - - public var orderCreatedTime: String? - - public var shipments: [Shipments]? - - public var totalShipmentsInOrder: Int? - - public var userInfo: UserInfo? - - public var bagsForReorder: [BagsForReorder]? - - - public enum CodingKeys: String, CodingKey { - - case orderId = "order_id" - - case breakupValues = "breakup_values" - - case orderCreatedTime = "order_created_time" - - case shipments = "shipments" - - case totalShipmentsInOrder = "total_shipments_in_order" - - case userInfo = "user_info" - - case bagsForReorder = "bags_for_reorder" - - } - - public init(bagsForReorder: [BagsForReorder]?, breakupValues: [BreakupValues]?, orderCreatedTime: String?, orderId: String?, shipments: [Shipments]?, totalShipmentsInOrder: Int?, userInfo: UserInfo?) { - - self.orderId = orderId - - self.breakupValues = breakupValues - - self.orderCreatedTime = orderCreatedTime - - self.shipments = shipments - - self.totalShipmentsInOrder = totalShipmentsInOrder - - self.userInfo = userInfo - - self.bagsForReorder = bagsForReorder - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - orderId = try container.decode(String.self, forKey: .orderId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - breakupValues = try container.decode([BreakupValues].self, forKey: .breakupValues) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderCreatedTime = try container.decode(String.self, forKey: .orderCreatedTime) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shipments = try container.decode([Shipments].self, forKey: .shipments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalShipmentsInOrder = try container.decode(Int.self, forKey: .totalShipmentsInOrder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userInfo = try container.decode(UserInfo.self, forKey: .userInfo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bagsForReorder = try container.decode([BagsForReorder].self, forKey: .bagsForReorder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(orderId, forKey: .orderId) - - - - try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) - - - - try? container.encodeIfPresent(orderCreatedTime, forKey: .orderCreatedTime) - - - - try? container.encodeIfPresent(shipments, forKey: .shipments) - - - - try? container.encodeIfPresent(totalShipmentsInOrder, forKey: .totalShipmentsInOrder) - - - - try? container.encodeIfPresent(userInfo, forKey: .userInfo) - - - - try? container.encodeIfPresent(bagsForReorder, forKey: .bagsForReorder) - - - } - - } - - /* - Model: BagsForReorder - Used By: Order - */ - class BagsForReorder: Codable { - - public var itemId: Int? - - public var itemSize: String? - - public var storeId: Int? - - public var sellerId: Int? - - public var quantity: Int? - - public var articleAssignment: BagsForReorderArticleAssignment? - - - public enum CodingKeys: String, CodingKey { - - case itemId = "item_id" - - case itemSize = "item_size" - - case storeId = "store_id" - - case sellerId = "seller_id" - - case quantity = "quantity" - - case articleAssignment = "article_assignment" - - } - - public init(articleAssignment: BagsForReorderArticleAssignment?, itemId: Int?, itemSize: String?, quantity: Int?, sellerId: Int?, storeId: Int?) { - - self.itemId = itemId - - self.itemSize = itemSize - - self.storeId = storeId - - self.sellerId = sellerId - - self.quantity = quantity - - self.articleAssignment = articleAssignment - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - itemId = try container.decode(Int.self, forKey: .itemId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemSize = try container.decode(String.self, forKey: .itemSize) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeId = try container.decode(Int.self, forKey: .storeId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sellerId = try container.decode(Int.self, forKey: .sellerId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - articleAssignment = try container.decode(BagsForReorderArticleAssignment.self, forKey: .articleAssignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(itemId, forKey: .itemId) - - - - try? container.encodeIfPresent(itemSize, forKey: .itemSize) - - - - try? container.encodeIfPresent(storeId, forKey: .storeId) - - - - try? container.encodeIfPresent(sellerId, forKey: .sellerId) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - - try? container.encodeIfPresent(articleAssignment, forKey: .articleAssignment) - - - } - - } - - /* - Model: BagsForReorderArticleAssignment - Used By: Order - */ - class BagsForReorderArticleAssignment: Codable { - - public var level: String? - - public var strategy: String? - - - public enum CodingKeys: String, CodingKey { - - case level = "level" - - case strategy = "strategy" - - } - - public init(level: String?, strategy: String?) { - - self.level = level - - self.strategy = strategy - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - level = try container.decode(String.self, forKey: .level) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - strategy = try container.decode(String.self, forKey: .strategy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(level, forKey: .level) - - - - try? container.encodeIfPresent(strategy, forKey: .strategy) - - - } - - } - - /* - Model: PosOrderById - Used By: Order - */ - class PosOrderById: Codable { - - public var order: OrderSchema - - - public enum CodingKeys: String, CodingKey { - - case order = "order" - - } - - public init(order: OrderSchema) { - - self.order = order - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - order = try container.decode(OrderSchema.self, forKey: .order) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(order, forKey: .order) - - - } - - } - - /* - Model: Bags - Used By: Order - */ - class Bags: Codable { - - public var item: Item? - - public var prices: Prices? - - public var currentStatus: CurrentStatus? - - public var id: Int? - - public var financialBreakup: [FinancialBreakup]? - - - public enum CodingKeys: String, CodingKey { - - case item = "item" - - case prices = "prices" - - case currentStatus = "current_status" - - case id = "id" - - case financialBreakup = "financial_breakup" - - } - - public init(currentStatus: CurrentStatus?, financialBreakup: [FinancialBreakup]?, id: Int?, item: Item?, prices: Prices?) { - - self.item = item - - self.prices = prices - - self.currentStatus = currentStatus - - self.id = id - - self.financialBreakup = financialBreakup - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - item = try container.decode(Item.self, forKey: .item) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - prices = try container.decode(Prices.self, forKey: .prices) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currentStatus = try container.decode(CurrentStatus.self, forKey: .currentStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - financialBreakup = try container.decode([FinancialBreakup].self, forKey: .financialBreakup) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(item, forKey: .item) - - - - try? container.encodeIfPresent(prices, forKey: .prices) - - - - try? container.encodeIfPresent(currentStatus, forKey: .currentStatus) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(financialBreakup, forKey: .financialBreakup) - - - } - - } - - /* - Model: Item - Used By: Order - */ - class Item: Codable { - - public var brand: ItemBrand? - - public var name: String? - - public var size: String? - - public var slugKey: String? - - public var image: [String]? - - public var code: String? - - public var id: Double? - - - public enum CodingKeys: String, CodingKey { - - case brand = "brand" - - case name = "name" - - case size = "size" - - case slugKey = "slug_key" - - case image = "image" - - case code = "code" - - case id = "id" - - } - - public init(brand: ItemBrand?, code: String?, id: Double?, image: [String]?, name: String?, size: String?, slugKey: String?) { - - self.brand = brand - - self.name = name - - self.size = size - - self.slugKey = slugKey - - self.image = image - - self.code = code - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - brand = try container.decode(ItemBrand.self, forKey: .brand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - size = try container.decode(String.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slugKey = try container.decode(String.self, forKey: .slugKey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - image = try container.decode([String].self, forKey: .image) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(Double.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(brand, forKey: .brand) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(slugKey, forKey: .slugKey) - - - - try? container.encodeIfPresent(image, forKey: .image) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: Prices - Used By: Order - */ - class Prices: Codable { - - public var amountPaidRoundoff: Double? - - public var fyndCredits: Double? - - public var codCharges: Double? - - public var cashback: Double? - - public var addedToFyndCash: Bool? - - public var priceMarked: Double? - - public var transferPrice: Double? - - public var couponValue: Double? - - public var priceEffective: Double? - - public var refundCredit: Double? - - public var amountPaid: Double? - - public var refundAmount: Double? - - public var cashbackApplied: Double? - - public var gstTaxPercentage: Double? - - public var valueOfGood: Double? - - public var brandCalculatedAmount: Double? - - public var promotionEffectiveDiscount: Double? - - public var discount: Double? - - public var couponEffectiveDiscount: Double? - - public var deliveryCharge: Double? - - - public enum CodingKeys: String, CodingKey { - - case amountPaidRoundoff = "amount_paid_roundoff" - - case fyndCredits = "fynd_credits" - - case codCharges = "cod_charges" - - case cashback = "cashback" - - case addedToFyndCash = "added_to_fynd_cash" - - case priceMarked = "price_marked" - - case transferPrice = "transfer_price" - - case couponValue = "coupon_value" - - case priceEffective = "price_effective" - - case refundCredit = "refund_credit" - - case amountPaid = "amount_paid" - - case refundAmount = "refund_amount" - - case cashbackApplied = "cashback_applied" - - case gstTaxPercentage = "gst_tax_percentage" - - case valueOfGood = "value_of_good" - - case brandCalculatedAmount = "brand_calculated_amount" - - case promotionEffectiveDiscount = "promotion_effective_discount" - - case discount = "discount" - - case couponEffectiveDiscount = "coupon_effective_discount" - - case deliveryCharge = "delivery_charge" - - } - - public init(addedToFyndCash: Bool?, amountPaid: Double?, amountPaidRoundoff: Double?, brandCalculatedAmount: Double?, cashback: Double?, cashbackApplied: Double?, codCharges: Double?, couponEffectiveDiscount: Double?, couponValue: Double?, deliveryCharge: Double?, discount: Double?, fyndCredits: Double?, gstTaxPercentage: Double?, priceEffective: Double?, priceMarked: Double?, promotionEffectiveDiscount: Double?, refundAmount: Double?, refundCredit: Double?, transferPrice: Double?, valueOfGood: Double?) { - - self.amountPaidRoundoff = amountPaidRoundoff - - self.fyndCredits = fyndCredits - - self.codCharges = codCharges - - self.cashback = cashback - - self.addedToFyndCash = addedToFyndCash - - self.priceMarked = priceMarked - - self.transferPrice = transferPrice - - self.couponValue = couponValue - - self.priceEffective = priceEffective - - self.refundCredit = refundCredit - - self.amountPaid = amountPaid - - self.refundAmount = refundAmount - - self.cashbackApplied = cashbackApplied - - self.gstTaxPercentage = gstTaxPercentage - - self.valueOfGood = valueOfGood - - self.brandCalculatedAmount = brandCalculatedAmount - - self.promotionEffectiveDiscount = promotionEffectiveDiscount - - self.discount = discount - - self.couponEffectiveDiscount = couponEffectiveDiscount - - self.deliveryCharge = deliveryCharge - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - amountPaidRoundoff = try container.decode(Double.self, forKey: .amountPaidRoundoff) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fyndCredits = try container.decode(Double.self, forKey: .fyndCredits) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - codCharges = try container.decode(Double.self, forKey: .codCharges) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cashback = try container.decode(Double.self, forKey: .cashback) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addedToFyndCash = try container.decode(Bool.self, forKey: .addedToFyndCash) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priceMarked = try container.decode(Double.self, forKey: .priceMarked) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - transferPrice = try container.decode(Double.self, forKey: .transferPrice) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - couponValue = try container.decode(Double.self, forKey: .couponValue) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priceEffective = try container.decode(Double.self, forKey: .priceEffective) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refundCredit = try container.decode(Double.self, forKey: .refundCredit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - amountPaid = try container.decode(Double.self, forKey: .amountPaid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refundAmount = try container.decode(Double.self, forKey: .refundAmount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cashbackApplied = try container.decode(Double.self, forKey: .cashbackApplied) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstTaxPercentage = try container.decode(Double.self, forKey: .gstTaxPercentage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - valueOfGood = try container.decode(Double.self, forKey: .valueOfGood) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandCalculatedAmount = try container.decode(Double.self, forKey: .brandCalculatedAmount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - promotionEffectiveDiscount = try container.decode(Double.self, forKey: .promotionEffectiveDiscount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discount = try container.decode(Double.self, forKey: .discount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - couponEffectiveDiscount = try container.decode(Double.self, forKey: .couponEffectiveDiscount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryCharge = try container.decode(Double.self, forKey: .deliveryCharge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amountPaidRoundoff, forKey: .amountPaidRoundoff) - - - - try? container.encodeIfPresent(fyndCredits, forKey: .fyndCredits) - - - - try? container.encodeIfPresent(codCharges, forKey: .codCharges) - - - - try? container.encodeIfPresent(cashback, forKey: .cashback) - - - - try? container.encodeIfPresent(addedToFyndCash, forKey: .addedToFyndCash) - - - - try? container.encodeIfPresent(priceMarked, forKey: .priceMarked) - - - - try? container.encodeIfPresent(transferPrice, forKey: .transferPrice) - - - - try? container.encodeIfPresent(couponValue, forKey: .couponValue) - - - - try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) - - - - try? container.encodeIfPresent(refundCredit, forKey: .refundCredit) - - - - try? container.encodeIfPresent(amountPaid, forKey: .amountPaid) - - - - try? container.encodeIfPresent(refundAmount, forKey: .refundAmount) - - - - try? container.encodeIfPresent(cashbackApplied, forKey: .cashbackApplied) - - - - try? container.encodeIfPresent(gstTaxPercentage, forKey: .gstTaxPercentage) - - - - try? container.encodeIfPresent(valueOfGood, forKey: .valueOfGood) - - - - try? container.encodeIfPresent(brandCalculatedAmount, forKey: .brandCalculatedAmount) - - - - try? container.encodeIfPresent(promotionEffectiveDiscount, forKey: .promotionEffectiveDiscount) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - - try? container.encodeIfPresent(couponEffectiveDiscount, forKey: .couponEffectiveDiscount) - - - - try? container.encodeIfPresent(deliveryCharge, forKey: .deliveryCharge) - - - } - - } - - /* - Model: CurrentStatus - Used By: Order - */ - class CurrentStatus: Codable { - - public var updatedAt: String? - - public var status: String? - - public var name: String? - - public var journeyType: String? - - - public enum CodingKeys: String, CodingKey { - - case updatedAt = "updated_at" - - case status = "status" - - case name = "name" - - case journeyType = "journey_type" - - } - - public init(journeyType: String?, name: String?, status: String?, updatedAt: String?) { - - self.updatedAt = updatedAt - - self.status = status - - self.name = name - - self.journeyType = journeyType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - journeyType = try container.decode(String.self, forKey: .journeyType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(journeyType, forKey: .journeyType) - - - } - - } - - /* - Model: FinancialBreakup - Used By: Order - */ - class FinancialBreakup: Codable { - - public var brandCalculatedAmount: Double? - - public var couponValue: Double? - - public var amountPaidRoundoff: Double? - - public var gstFee: String? - - public var refundCredit: Double? - - public var cashback: Double? - - public var refundAmount: Double? - - public var valueOfGood: Double? - - public var promotionEffectiveDiscount: Double? - - public var size: String? - - public var totalUnits: Int? - - public var discount: Double? - - public var amountPaid: Double? - - public var fyndCredits: Double? - - public var addedToFyndCash: Bool? - - public var deliveryCharge: Double? - - public var hsnCode: String? - - public var couponEffectiveDiscount: Double? - - public var transferPrice: Double? - - public var identifiers: Identifiers? - - public var gstTag: String? - - public var priceMarked: Double? - - public var priceEffective: Double? - - public var codCharges: Double? - - public var itemName: String? - - public var cashbackApplied: Double? - - public var gstTaxPercentage: Double? - - - public enum CodingKeys: String, CodingKey { - - case brandCalculatedAmount = "brand_calculated_amount" - - case couponValue = "coupon_value" - - case amountPaidRoundoff = "amount_paid_roundoff" - - case gstFee = "gst_fee" - - case refundCredit = "refund_credit" - - case cashback = "cashback" - - case refundAmount = "refund_amount" - - case valueOfGood = "value_of_good" - - case promotionEffectiveDiscount = "promotion_effective_discount" - - case size = "size" - - case totalUnits = "total_units" - - case discount = "discount" - - case amountPaid = "amount_paid" - - case fyndCredits = "fynd_credits" - - case addedToFyndCash = "added_to_fynd_cash" - - case deliveryCharge = "delivery_charge" - - case hsnCode = "hsn_code" - - case couponEffectiveDiscount = "coupon_effective_discount" - - case transferPrice = "transfer_price" - - case identifiers = "identifiers" - - case gstTag = "gst_tag" - - case priceMarked = "price_marked" - - case priceEffective = "price_effective" - - case codCharges = "cod_charges" - - case itemName = "item_name" - - case cashbackApplied = "cashback_applied" - - case gstTaxPercentage = "gst_tax_percentage" - - } - - public init(addedToFyndCash: Bool?, amountPaid: Double?, amountPaidRoundoff: Double?, brandCalculatedAmount: Double?, cashback: Double?, cashbackApplied: Double?, codCharges: Double?, couponEffectiveDiscount: Double?, couponValue: Double?, deliveryCharge: Double?, discount: Double?, fyndCredits: Double?, gstFee: String?, gstTag: String?, gstTaxPercentage: Double?, hsnCode: String?, identifiers: Identifiers?, itemName: String?, priceEffective: Double?, priceMarked: Double?, promotionEffectiveDiscount: Double?, refundAmount: Double?, refundCredit: Double?, size: String?, totalUnits: Int?, transferPrice: Double?, valueOfGood: Double?) { - - self.brandCalculatedAmount = brandCalculatedAmount - - self.couponValue = couponValue - - self.amountPaidRoundoff = amountPaidRoundoff - - self.gstFee = gstFee - - self.refundCredit = refundCredit - - self.cashback = cashback - - self.refundAmount = refundAmount - - self.valueOfGood = valueOfGood - - self.promotionEffectiveDiscount = promotionEffectiveDiscount - - self.size = size - - self.totalUnits = totalUnits - - self.discount = discount - - self.amountPaid = amountPaid - - self.fyndCredits = fyndCredits - - self.addedToFyndCash = addedToFyndCash - - self.deliveryCharge = deliveryCharge - - self.hsnCode = hsnCode - - self.couponEffectiveDiscount = couponEffectiveDiscount - - self.transferPrice = transferPrice - - self.identifiers = identifiers - - self.gstTag = gstTag - - self.priceMarked = priceMarked - - self.priceEffective = priceEffective - - self.codCharges = codCharges - - self.itemName = itemName - - self.cashbackApplied = cashbackApplied - - self.gstTaxPercentage = gstTaxPercentage - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - brandCalculatedAmount = try container.decode(Double.self, forKey: .brandCalculatedAmount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - couponValue = try container.decode(Double.self, forKey: .couponValue) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - amountPaidRoundoff = try container.decode(Double.self, forKey: .amountPaidRoundoff) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstFee = try container.decode(String.self, forKey: .gstFee) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refundCredit = try container.decode(Double.self, forKey: .refundCredit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cashback = try container.decode(Double.self, forKey: .cashback) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refundAmount = try container.decode(Double.self, forKey: .refundAmount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - valueOfGood = try container.decode(Double.self, forKey: .valueOfGood) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - promotionEffectiveDiscount = try container.decode(Double.self, forKey: .promotionEffectiveDiscount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - size = try container.decode(String.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalUnits = try container.decode(Int.self, forKey: .totalUnits) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discount = try container.decode(Double.self, forKey: .discount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - amountPaid = try container.decode(Double.self, forKey: .amountPaid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fyndCredits = try container.decode(Double.self, forKey: .fyndCredits) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addedToFyndCash = try container.decode(Bool.self, forKey: .addedToFyndCash) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryCharge = try container.decode(Double.self, forKey: .deliveryCharge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hsnCode = try container.decode(String.self, forKey: .hsnCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - couponEffectiveDiscount = try container.decode(Double.self, forKey: .couponEffectiveDiscount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - transferPrice = try container.decode(Double.self, forKey: .transferPrice) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - identifiers = try container.decode(Identifiers.self, forKey: .identifiers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstTag = try container.decode(String.self, forKey: .gstTag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priceMarked = try container.decode(Double.self, forKey: .priceMarked) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priceEffective = try container.decode(Double.self, forKey: .priceEffective) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - codCharges = try container.decode(Double.self, forKey: .codCharges) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemName = try container.decode(String.self, forKey: .itemName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cashbackApplied = try container.decode(Double.self, forKey: .cashbackApplied) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstTaxPercentage = try container.decode(Double.self, forKey: .gstTaxPercentage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(brandCalculatedAmount, forKey: .brandCalculatedAmount) - - - - try? container.encodeIfPresent(couponValue, forKey: .couponValue) - - - - try? container.encodeIfPresent(amountPaidRoundoff, forKey: .amountPaidRoundoff) - - - - try? container.encodeIfPresent(gstFee, forKey: .gstFee) - - - - try? container.encodeIfPresent(refundCredit, forKey: .refundCredit) - - - - try? container.encodeIfPresent(cashback, forKey: .cashback) - - - - try? container.encodeIfPresent(refundAmount, forKey: .refundAmount) - - - - try? container.encodeIfPresent(valueOfGood, forKey: .valueOfGood) - - - - try? container.encodeIfPresent(promotionEffectiveDiscount, forKey: .promotionEffectiveDiscount) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(totalUnits, forKey: .totalUnits) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - - try? container.encodeIfPresent(amountPaid, forKey: .amountPaid) - - - - try? container.encodeIfPresent(fyndCredits, forKey: .fyndCredits) - - - - try? container.encodeIfPresent(addedToFyndCash, forKey: .addedToFyndCash) - - - - try? container.encodeIfPresent(deliveryCharge, forKey: .deliveryCharge) - - - - try? container.encodeIfPresent(hsnCode, forKey: .hsnCode) - - - - try? container.encodeIfPresent(couponEffectiveDiscount, forKey: .couponEffectiveDiscount) - - - - try? container.encodeIfPresent(transferPrice, forKey: .transferPrice) - - - - try? container.encodeIfPresent(identifiers, forKey: .identifiers) - - - - try? container.encodeIfPresent(gstTag, forKey: .gstTag) - - - - try? container.encodeIfPresent(priceMarked, forKey: .priceMarked) - - - - try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) - - - - try? container.encodeIfPresent(codCharges, forKey: .codCharges) - - - - try? container.encodeIfPresent(itemName, forKey: .itemName) - - - - try? container.encodeIfPresent(cashbackApplied, forKey: .cashbackApplied) - - - - try? container.encodeIfPresent(gstTaxPercentage, forKey: .gstTaxPercentage) - - - } - - } - - /* - Model: Identifiers - Used By: Order - */ - class Identifiers: Codable { - - public var ean: String? - - public var skuCode: String? - - - public enum CodingKeys: String, CodingKey { - - case ean = "ean" - - case skuCode = "sku_code" - - } - - public init(ean: String?, skuCode: String?) { - - self.ean = ean - - self.skuCode = skuCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - ean = try container.decode(String.self, forKey: .ean) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - skuCode = try container.decode(String.self, forKey: .skuCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(ean, forKey: .ean) - - - - try? container.encodeIfPresent(skuCode, forKey: .skuCode) - - - } - - } - - /* - Model: ItemBrand - Used By: Order - */ - class ItemBrand: Codable { - - public var name: String? - - public var logo: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case logo = "logo" - - } - - public init(logo: String?, name: String?) { - - self.name = name - - self.logo = logo - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - } - - } - - /* - Model: BreakupValues - Used By: Order - */ - class BreakupValues: Codable { - - public var display: String? - - public var value: Double? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case value = "value" - - case name = "name" - - } - - public init(display: String?, name: String?, value: Double?) { - - self.display = display - - self.value = value - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(Double.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: DeliveryAddress - Used By: Order - */ - class DeliveryAddress: Codable { - - public var pincode: String? - - public var landmark: String? - - public var contactPerson: String? - - public var phone: String? - - public var state: String? - - public var version: String? - - public var address1: String? - - public var createdAt: String? - - public var addressType: String? - - public var addressCategory: String? - - public var area: String? - - public var city: String? - - public var latitude: Double? - - public var longitude: Double? - - public var email: String? - - public var country: String? - - public var address2: String? - - public var updatedAt: String? - - public var name: String? - - public var address: String? - - - public enum CodingKeys: String, CodingKey { - - case pincode = "pincode" - - case landmark = "landmark" - - case contactPerson = "contact_person" - - case phone = "phone" - - case state = "state" - - case version = "version" - - case address1 = "address1" - - case createdAt = "created_at" - - case addressType = "address_type" - - case addressCategory = "address_category" - - case area = "area" - - case city = "city" - - case latitude = "latitude" - - case longitude = "longitude" - - case email = "email" - - case country = "country" - - case address2 = "address2" - - case updatedAt = "updated_at" - - case name = "name" - - case address = "address" - - } - - public init(address: String?, address1: String?, address2: String?, addressCategory: String?, addressType: String?, area: String?, city: String?, contactPerson: String?, country: String?, createdAt: String?, email: String?, landmark: String?, latitude: Double?, longitude: Double?, name: String?, phone: String?, pincode: String?, state: String?, updatedAt: String?, version: String?) { - - self.pincode = pincode - - self.landmark = landmark - - self.contactPerson = contactPerson - - self.phone = phone - - self.state = state - - self.version = version - - self.address1 = address1 - - self.createdAt = createdAt - - self.addressType = addressType - - self.addressCategory = addressCategory - - self.area = area - - self.city = city - - self.latitude = latitude - - self.longitude = longitude - - self.email = email - - self.country = country - - self.address2 = address2 - - self.updatedAt = updatedAt - - self.name = name - - self.address = address - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pincode = try container.decode(String.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - landmark = try container.decode(String.self, forKey: .landmark) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contactPerson = try container.decode(String.self, forKey: .contactPerson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(String.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - version = try container.decode(String.self, forKey: .version) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address1 = try container.decode(String.self, forKey: .address1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressType = try container.decode(String.self, forKey: .addressType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressCategory = try container.decode(String.self, forKey: .addressCategory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - area = try container.decode(String.self, forKey: .area) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - latitude = try container.decode(Double.self, forKey: .latitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - longitude = try container.decode(Double.self, forKey: .longitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address2 = try container.decode(String.self, forKey: .address2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address = try container.decode(String.self, forKey: .address) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(landmark, forKey: .landmark) - - - - try? container.encodeIfPresent(contactPerson, forKey: .contactPerson) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(version, forKey: .version) - - - - try? container.encodeIfPresent(address1, forKey: .address1) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(addressType, forKey: .addressType) - - - - try? container.encodeIfPresent(addressCategory, forKey: .addressCategory) - - - - try? container.encodeIfPresent(area, forKey: .area) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(latitude, forKey: .latitude) - - - - try? container.encodeIfPresent(longitude, forKey: .longitude) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(address2, forKey: .address2) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(address, forKey: .address) - - - } - - } - - /* - Model: FulfillingStore - Used By: Order - */ - class FulfillingStore: Codable { - - public var code: String? - - public var id: Int? - - public var name: String? - - public var companyId: Int? - - - public enum CodingKeys: String, CodingKey { - - case code = "code" - - case id = "id" - - case name = "name" - - case companyId = "company_id" - - } - - public init(code: String?, companyId: Int?, id: Int?, name: String?) { - - self.code = code - - self.id = id - - self.name = name - - self.companyId = companyId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - } - - } - - /* - Model: Invoice - Used By: Order - */ - class Invoice: Codable { - - public var updatedDate: String? - - public var invoiceUrl: String? - - public var labelUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case updatedDate = "updated_date" - - case invoiceUrl = "invoice_url" - - case labelUrl = "label_url" - - } - - public init(invoiceUrl: String?, labelUrl: String?, updatedDate: String?) { - - self.updatedDate = updatedDate - - self.invoiceUrl = invoiceUrl - - self.labelUrl = labelUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - updatedDate = try container.decode(String.self, forKey: .updatedDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - invoiceUrl = try container.decode(String.self, forKey: .invoiceUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - labelUrl = try container.decode(String.self, forKey: .labelUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(updatedDate, forKey: .updatedDate) - - - - try? container.encodeIfPresent(invoiceUrl, forKey: .invoiceUrl) - - - - try? container.encodeIfPresent(labelUrl, forKey: .labelUrl) - - - } - - } - - /* - Model: Promise - Used By: Order - */ - class Promise: Codable { - - public var timestamp: Timestamp? - - - public enum CodingKeys: String, CodingKey { - - case timestamp = "timestamp" - - } - - public init(timestamp: Timestamp?) { - - self.timestamp = timestamp - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - timestamp = try container.decode(Timestamp.self, forKey: .timestamp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(timestamp, forKey: .timestamp) - - - } - - } - - /* - Model: Timestamp - Used By: Order - */ - class Timestamp: Codable { - - public var min: String? - - public var max: String? - - - public enum CodingKeys: String, CodingKey { - - case min = "min" - - case max = "max" - - } - - public init(max: String?, min: String?) { - - self.min = min - - self.max = max - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - min = try container.decode(String.self, forKey: .min) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - max = try container.decode(String.self, forKey: .max) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(min, forKey: .min) - - - - try? container.encodeIfPresent(max, forKey: .max) - - - } - - } - - /* - Model: Reasons - Used By: Order - */ - class Reasons: Codable { - - public var reasonText: String? - - public var showTextArea: Bool? - - public var feedbackType: String? - - public var flow: String? - - public var reasonId: Int? - - public var priority: Int? - - - public enum CodingKeys: String, CodingKey { - - case reasonText = "reason_text" - - case showTextArea = "show_text_area" - - case feedbackType = "feedback_type" - - case flow = "flow" - - case reasonId = "reason_id" - - case priority = "priority" - - } - - public init(feedbackType: String?, flow: String?, priority: Int?, reasonId: Int?, reasonText: String?, showTextArea: Bool?) { - - self.reasonText = reasonText - - self.showTextArea = showTextArea - - self.feedbackType = feedbackType - - self.flow = flow - - self.reasonId = reasonId - - self.priority = priority - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - reasonText = try container.decode(String.self, forKey: .reasonText) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - showTextArea = try container.decode(Bool.self, forKey: .showTextArea) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - feedbackType = try container.decode(String.self, forKey: .feedbackType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - flow = try container.decode(String.self, forKey: .flow) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - reasonId = try container.decode(Int.self, forKey: .reasonId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priority = try container.decode(Int.self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(reasonText, forKey: .reasonText) - - - - try? container.encodeIfPresent(showTextArea, forKey: .showTextArea) - - - - try? container.encodeIfPresent(feedbackType, forKey: .feedbackType) - - - - try? container.encodeIfPresent(flow, forKey: .flow) - - - - try? container.encodeIfPresent(reasonId, forKey: .reasonId) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - } - - } - - /* - Model: ShipmentStatus - Used By: Order - */ - class ShipmentStatus: Codable { - - public var title: String? - - public var hexCode: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case hexCode = "hex_code" - - } - - public init(hexCode: String?, title: String?) { - - self.title = title - - self.hexCode = hexCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hexCode = try container.decode(String.self, forKey: .hexCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(hexCode, forKey: .hexCode) - - - } - - } - - /* - Model: ShipmentUserInfo - Used By: Order - */ - class ShipmentUserInfo: Codable { - - public var gender: String? - - public var mobile: String? - - public var firstName: String? - - public var lastName: String? - - - public enum CodingKeys: String, CodingKey { - - case gender = "gender" - - case mobile = "mobile" - - case firstName = "first_name" - - case lastName = "last_name" - - } - - public init(firstName: String?, gender: String?, lastName: String?, mobile: String?) { - - self.gender = gender - - self.mobile = mobile - - self.firstName = firstName - - self.lastName = lastName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - gender = try container.decode(String.self, forKey: .gender) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobile = try container.decode(String.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(gender, forKey: .gender) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - } - - } - - /* - Model: Shipments - Used By: Order - */ - class Shipments: Codable { - - public var orderId: String? - - public var breakupValues: [BreakupValues]? - - public var trackUrl: String? - - public var trakingNo: String? - - public var trackingDetails: [TrackingDetails]? - - public var beneficiaryDetails: Bool? - - public var canReturn: Bool? - - public var prices: Prices? - - public var needHelpUrl: String? - - public var shipmentId: String? - - public var totalBags: Int? - - public var deliveryAddress: DeliveryAddress? - - public var invoice: Invoice? - - public var comment: String? - - public var orderType: String? - - public var promise: Promise? - - public var fulfillingStore: FulfillingStore? - - public var bags: [Bags]? - - public var canCancel: Bool? - - public var payment: ShipmentPayment? - - public var shipmentCreatedAt: String? - - public var shipmentStatus: ShipmentStatus? - - public var userInfo: ShipmentUserInfo? - - public var sizeInfo: [String: Any]? - - public var totalDetails: ShipmentTotalDetails? - - - public enum CodingKeys: String, CodingKey { - - case orderId = "order_id" - - case breakupValues = "breakup_values" - - case trackUrl = "track_url" - - case trakingNo = "traking_no" - - case trackingDetails = "tracking_details" - - case beneficiaryDetails = "beneficiary_details" - - case canReturn = "can_return" - - case prices = "prices" - - case needHelpUrl = "need_help_url" - - case shipmentId = "shipment_id" - - case totalBags = "total_bags" - - case deliveryAddress = "delivery_address" - - case invoice = "invoice" - - case comment = "comment" - - case orderType = "order_type" - - case promise = "promise" - - case fulfillingStore = "fulfilling_store" - - case bags = "bags" - - case canCancel = "can_cancel" - - case payment = "payment" - - case shipmentCreatedAt = "shipment_created_at" - - case shipmentStatus = "shipment_status" - - case userInfo = "user_info" - - case sizeInfo = "size_info" - - case totalDetails = "total_details" - - } - - public init(bags: [Bags]?, beneficiaryDetails: Bool?, breakupValues: [BreakupValues]?, canCancel: Bool?, canReturn: Bool?, comment: String?, deliveryAddress: DeliveryAddress?, fulfillingStore: FulfillingStore?, invoice: Invoice?, needHelpUrl: String?, orderId: String?, orderType: String?, payment: ShipmentPayment?, prices: Prices?, promise: Promise?, shipmentCreatedAt: String?, shipmentId: String?, shipmentStatus: ShipmentStatus?, sizeInfo: [String: Any]?, totalBags: Int?, totalDetails: ShipmentTotalDetails?, trackingDetails: [TrackingDetails]?, trackUrl: String?, trakingNo: String?, userInfo: ShipmentUserInfo?) { - - self.orderId = orderId - - self.breakupValues = breakupValues - - self.trackUrl = trackUrl - - self.trakingNo = trakingNo - - self.trackingDetails = trackingDetails - - self.beneficiaryDetails = beneficiaryDetails - - self.canReturn = canReturn - - self.prices = prices - - self.needHelpUrl = needHelpUrl - - self.shipmentId = shipmentId - - self.totalBags = totalBags - - self.deliveryAddress = deliveryAddress - - self.invoice = invoice - - self.comment = comment - - self.orderType = orderType - - self.promise = promise - - self.fulfillingStore = fulfillingStore - - self.bags = bags - - self.canCancel = canCancel - - self.payment = payment - - self.shipmentCreatedAt = shipmentCreatedAt - - self.shipmentStatus = shipmentStatus - - self.userInfo = userInfo - - self.sizeInfo = sizeInfo - - self.totalDetails = totalDetails - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - orderId = try container.decode(String.self, forKey: .orderId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - breakupValues = try container.decode([BreakupValues].self, forKey: .breakupValues) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - trackUrl = try container.decode(String.self, forKey: .trackUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - trakingNo = try container.decode(String.self, forKey: .trakingNo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - trackingDetails = try container.decode([TrackingDetails].self, forKey: .trackingDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - beneficiaryDetails = try container.decode(Bool.self, forKey: .beneficiaryDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - canReturn = try container.decode(Bool.self, forKey: .canReturn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - prices = try container.decode(Prices.self, forKey: .prices) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - needHelpUrl = try container.decode(String.self, forKey: .needHelpUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shipmentId = try container.decode(String.self, forKey: .shipmentId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalBags = try container.decode(Int.self, forKey: .totalBags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryAddress = try container.decode(DeliveryAddress.self, forKey: .deliveryAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - invoice = try container.decode(Invoice.self, forKey: .invoice) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - comment = try container.decode(String.self, forKey: .comment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderType = try container.decode(String.self, forKey: .orderType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - promise = try container.decode(Promise.self, forKey: .promise) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fulfillingStore = try container.decode(FulfillingStore.self, forKey: .fulfillingStore) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bags = try container.decode([Bags].self, forKey: .bags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - canCancel = try container.decode(Bool.self, forKey: .canCancel) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - payment = try container.decode(ShipmentPayment.self, forKey: .payment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shipmentCreatedAt = try container.decode(String.self, forKey: .shipmentCreatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shipmentStatus = try container.decode(ShipmentStatus.self, forKey: .shipmentStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userInfo = try container.decode(ShipmentUserInfo.self, forKey: .userInfo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sizeInfo = try container.decode([String: Any].self, forKey: .sizeInfo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalDetails = try container.decode(ShipmentTotalDetails.self, forKey: .totalDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(orderId, forKey: .orderId) - - - - try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) - - - - try? container.encodeIfPresent(trackUrl, forKey: .trackUrl) - - - - try? container.encodeIfPresent(trakingNo, forKey: .trakingNo) - - - - try? container.encodeIfPresent(trackingDetails, forKey: .trackingDetails) - - - - try? container.encodeIfPresent(beneficiaryDetails, forKey: .beneficiaryDetails) - - - - try? container.encodeIfPresent(canReturn, forKey: .canReturn) - - - - try? container.encodeIfPresent(prices, forKey: .prices) - - - - try? container.encodeIfPresent(needHelpUrl, forKey: .needHelpUrl) - - - - try? container.encodeIfPresent(shipmentId, forKey: .shipmentId) - - - - try? container.encodeIfPresent(totalBags, forKey: .totalBags) - - - - try? container.encodeIfPresent(deliveryAddress, forKey: .deliveryAddress) - - - - try? container.encodeIfPresent(invoice, forKey: .invoice) - - - - try? container.encodeIfPresent(comment, forKey: .comment) - - - - try? container.encodeIfPresent(orderType, forKey: .orderType) - - - - try? container.encodeIfPresent(promise, forKey: .promise) - - - - try? container.encodeIfPresent(fulfillingStore, forKey: .fulfillingStore) - - - - try? container.encodeIfPresent(bags, forKey: .bags) - - - - try? container.encodeIfPresent(canCancel, forKey: .canCancel) - - - - try? container.encodeIfPresent(payment, forKey: .payment) - - - - try? container.encodeIfPresent(shipmentCreatedAt, forKey: .shipmentCreatedAt) - - - - try? container.encodeIfPresent(shipmentStatus, forKey: .shipmentStatus) - - - - try? container.encodeIfPresent(userInfo, forKey: .userInfo) - - - - try? container.encodeIfPresent(sizeInfo, forKey: .sizeInfo) - - - - try? container.encodeIfPresent(totalDetails, forKey: .totalDetails) - - - } - - } - - /* - Model: ShipmentTotalDetails - Used By: Order - */ - class ShipmentTotalDetails: Codable { - - public var totalPrice: Double? - - public var sizes: Int? - - public var pieces: Int? - - - public enum CodingKeys: String, CodingKey { - - case totalPrice = "total_price" - - case sizes = "sizes" - - case pieces = "pieces" - - } - - public init(pieces: Int?, sizes: Int?, totalPrice: Double?) { - - self.totalPrice = totalPrice - - self.sizes = sizes - - self.pieces = pieces - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - totalPrice = try container.decode(Double.self, forKey: .totalPrice) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sizes = try container.decode(Int.self, forKey: .sizes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pieces = try container.decode(Int.self, forKey: .pieces) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(totalPrice, forKey: .totalPrice) - - - - try? container.encodeIfPresent(sizes, forKey: .sizes) - - - - try? container.encodeIfPresent(pieces, forKey: .pieces) - - - } - - } - - /* - Model: ShipmentPayment - Used By: Order - */ - class ShipmentPayment: Codable { - - public var logo: String? - - public var mode: String? - - public var status: String? - - - public enum CodingKeys: String, CodingKey { - - case logo = "logo" - - case mode = "mode" - - case status = "status" - - } - - public init(logo: String?, mode: String?, status: String?) { - - self.logo = logo - - self.mode = mode - - self.status = status - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mode = try container.decode(String.self, forKey: .mode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(mode, forKey: .mode) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - } - - } - - /* - Model: Track - Used By: Order - */ - class Track: Codable { - - public var awb: String? - - public var updatedAt: String? - - public var lastLocationRecievedAt: String? - - public var reason: String? - - public var shipmentType: String? - - public var status: String? - - public var updatedTime: String? - - public var accountName: String? - - - public enum CodingKeys: String, CodingKey { - - case awb = "awb" - - case updatedAt = "updated_at" - - case lastLocationRecievedAt = "last_location_recieved_at" - - case reason = "reason" - - case shipmentType = "shipment_type" - - case status = "status" - - case updatedTime = "updated_time" - - case accountName = "account_name" - - } - - public init(accountName: String?, awb: String?, lastLocationRecievedAt: String?, reason: String?, shipmentType: String?, status: String?, updatedAt: String?, updatedTime: String?) { - - self.awb = awb - - self.updatedAt = updatedAt - - self.lastLocationRecievedAt = lastLocationRecievedAt - - self.reason = reason - - self.shipmentType = shipmentType - - self.status = status - - self.updatedTime = updatedTime - - self.accountName = accountName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - awb = try container.decode(String.self, forKey: .awb) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastLocationRecievedAt = try container.decode(String.self, forKey: .lastLocationRecievedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - reason = try container.decode(String.self, forKey: .reason) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shipmentType = try container.decode(String.self, forKey: .shipmentType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedTime = try container.decode(String.self, forKey: .updatedTime) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - accountName = try container.decode(String.self, forKey: .accountName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(awb, forKey: .awb) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(lastLocationRecievedAt, forKey: .lastLocationRecievedAt) - - - - try? container.encodeIfPresent(reason, forKey: .reason) - - - - try? container.encodeIfPresent(shipmentType, forKey: .shipmentType) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(updatedTime, forKey: .updatedTime) - - - - try? container.encodeIfPresent(accountName, forKey: .accountName) - - - } - - } - - /* - Model: TrackingDetails - Used By: Order - */ - class TrackingDetails: Codable { - - public var isCurrent: Bool? - - public var status: String? - - public var time: String? - - public var isPassed: Bool? - - - public enum CodingKeys: String, CodingKey { - - case isCurrent = "is_current" - - case status = "status" - - case time = "time" - - case isPassed = "is_passed" - - } - - public init(isCurrent: Bool?, isPassed: Bool?, status: String?, time: String?) { - - self.isCurrent = isCurrent - - self.status = status - - self.time = time - - self.isPassed = isPassed - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isCurrent = try container.decode(Bool.self, forKey: .isCurrent) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - time = try container.decode(String.self, forKey: .time) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isPassed = try container.decode(Bool.self, forKey: .isPassed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isCurrent, forKey: .isCurrent) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(time, forKey: .time) - - - - try? container.encodeIfPresent(isPassed, forKey: .isPassed) - - - } - - } - - /* - Model: UserInfo - Used By: Order - */ - class UserInfo: Codable { - - public var gender: String? - - public var mobile: String? - - public var name: String? - - public var email: String? - - - public enum CodingKeys: String, CodingKey { - - case gender = "gender" - - case mobile = "mobile" - - case name = "name" - - case email = "email" - - } - - public init(email: String?, gender: String?, mobile: String?, name: String?) { - - self.gender = gender - - self.mobile = mobile - - self.name = name - - self.email = email - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - gender = try container.decode(String.self, forKey: .gender) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobile = try container.decode(String.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(gender, forKey: .gender) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - } - - } - - /* - Model: ApefaceApiError - Used By: Order - */ - class ApefaceApiError: Codable { - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - - - /* - Model: ActionPageParams - Used By: Rewards - */ - class ActionPageParams: Codable { - - public var slug: [String]? - - - public enum CodingKeys: String, CodingKey { - - case slug = "slug" - - } - - public init(slug: [String]?) { - - self.slug = slug - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - slug = try container.decode([String].self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - } - - } - - /* - Model: CatalogueOrderRequest - Used By: Rewards - */ - class CatalogueOrderRequest: Codable { - - public var articles: [RewardsArticle]? - - - public enum CodingKeys: String, CodingKey { - - case articles = "articles" - - } - - public init(articles: [RewardsArticle]?) { - - self.articles = articles - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - articles = try container.decode([RewardsArticle].self, forKey: .articles) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(articles, forKey: .articles) - - - } - - } - - /* - Model: CatalogueOrderResponse - Used By: Rewards - */ - class CatalogueOrderResponse: Codable { - - public var articles: [RewardsArticle]? - - - public enum CodingKeys: String, CodingKey { - - case articles = "articles" - - } - - public init(articles: [RewardsArticle]?) { - - self.articles = articles - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - articles = try container.decode([RewardsArticle].self, forKey: .articles) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(articles, forKey: .articles) - - - } - - } - - /* - Model: DiscountProperties - Used By: Rewards - */ - class DiscountProperties: Codable { - - public var absolute: Double? - - public var currency: String? - - public var displayAbsolute: String? - - public var displayPercent: String? - - public var percent: Double? - - - public enum CodingKeys: String, CodingKey { - - case absolute = "absolute" - - case currency = "currency" - - case displayAbsolute = "display_absolute" - - case displayPercent = "display_percent" - - case percent = "percent" - - } - - public init(absolute: Double?, currency: String?, displayAbsolute: String?, displayPercent: String?, percent: Double?) { - - self.absolute = absolute - - self.currency = currency - - self.displayAbsolute = displayAbsolute - - self.displayPercent = displayPercent - - self.percent = percent - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - absolute = try container.decode(Double.self, forKey: .absolute) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(String.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayAbsolute = try container.decode(String.self, forKey: .displayAbsolute) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayPercent = try container.decode(String.self, forKey: .displayPercent) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - percent = try container.decode(Double.self, forKey: .percent) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(absolute, forKey: .absolute) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(displayAbsolute, forKey: .displayAbsolute) - - - - try? container.encodeIfPresent(displayPercent, forKey: .displayPercent) - - - - try? container.encodeIfPresent(percent, forKey: .percent) - - - } - - } - - /* - Model: Error - Used By: Rewards - */ - class Error: Codable { - - public var code: Int? - - public var exception: String? - - public var info: String? - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case code = "code" - - case exception = "exception" - - case info = "info" - - case message = "message" - - } - - public init(code: Int?, exception: String?, info: String?, message: String?) { - - self.code = code - - self.exception = exception - - self.info = info - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - code = try container.decode(Int.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - exception = try container.decode(String.self, forKey: .exception) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - info = try container.decode(String.self, forKey: .info) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(exception, forKey: .exception) - - - - try? container.encodeIfPresent(info, forKey: .info) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: Offer - Used By: Rewards - */ - class Offer: Codable { - - public var schedule: Schedule? - - public var active: Bool? - - public var applicationId: String? - - public var bannerImage: Asset? - - public var createdAt: String? - - public var name: String? - - public var rule: [String: Any]? - - public var share: ShareMessages? - - public var subText: String? - - public var text: String? - - public var type: String? - - public var updatedAt: String? - - public var updatedBy: String? - - public var url: String? - - - public enum CodingKeys: String, CodingKey { - - case schedule = "_schedule" - - case active = "active" - - case applicationId = "application_id" - - case bannerImage = "banner_image" - - case createdAt = "created_at" - - case name = "name" - - case rule = "rule" - - case share = "share" - - case subText = "sub_text" - - case text = "text" - - case type = "type" - - case updatedAt = "updated_at" - - case updatedBy = "updated_by" - - case url = "url" - - } - - public init(active: Bool?, applicationId: String?, bannerImage: Asset?, createdAt: String?, name: String?, rule: [String: Any]?, share: ShareMessages?, subText: String?, text: String?, type: String?, updatedAt: String?, updatedBy: String?, url: String?, schedule: Schedule?) { - - self.schedule = schedule - - self.active = active - - self.applicationId = applicationId - - self.bannerImage = bannerImage - - self.createdAt = createdAt - - self.name = name - - self.rule = rule - - self.share = share - - self.subText = subText - - self.text = text - - self.type = type - - self.updatedAt = updatedAt - - self.updatedBy = updatedBy - - self.url = url - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - schedule = try container.decode(Schedule.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - applicationId = try container.decode(String.self, forKey: .applicationId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bannerImage = try container.decode(Asset.self, forKey: .bannerImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rule = try container.decode([String: Any].self, forKey: .rule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - share = try container.decode(ShareMessages.self, forKey: .share) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subText = try container.decode(String.self, forKey: .subText) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text = try container.decode(String.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedBy = try container.decode(String.self, forKey: .updatedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(applicationId, forKey: .applicationId) - - - - try? container.encodeIfPresent(bannerImage, forKey: .bannerImage) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(rule, forKey: .rule) - - - - try? container.encodeIfPresent(share, forKey: .share) - - - - try? container.encodeIfPresent(subText, forKey: .subText) - - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(updatedBy, forKey: .updatedBy) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - } - - } - - /* - Model: OrderDiscountRequest - Used By: Rewards - */ - class OrderDiscountRequest: Codable { - - public var currency: String? - - public var orderAmount: Double - - - public enum CodingKeys: String, CodingKey { - - case currency = "currency" - - case orderAmount = "order_amount" - - } - - public init(currency: String?, orderAmount: Double) { - - self.currency = currency - - self.orderAmount = orderAmount - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - currency = try container.decode(String.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - orderAmount = try container.decode(Double.self, forKey: .orderAmount) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(orderAmount, forKey: .orderAmount) - - - } - - } - - /* - Model: OrderDiscountResponse - Used By: Rewards - */ - class OrderDiscountResponse: Codable { - - public var appliedRuleBucket: OrderDiscountRuleBucket? - - public var baseDiscount: DiscountProperties? - - public var discount: DiscountProperties? - - public var orderAmount: Double? - - public var points: Double? - - - public enum CodingKeys: String, CodingKey { - - case appliedRuleBucket = "applied_rule_bucket" - - case baseDiscount = "base_discount" - - case discount = "discount" - - case orderAmount = "order_amount" - - case points = "points" - - } - - public init(appliedRuleBucket: OrderDiscountRuleBucket?, baseDiscount: DiscountProperties?, discount: DiscountProperties?, orderAmount: Double?, points: Double?) { - - self.appliedRuleBucket = appliedRuleBucket - - self.baseDiscount = baseDiscount - - self.discount = discount - - self.orderAmount = orderAmount - - self.points = points - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - appliedRuleBucket = try container.decode(OrderDiscountRuleBucket.self, forKey: .appliedRuleBucket) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - baseDiscount = try container.decode(DiscountProperties.self, forKey: .baseDiscount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discount = try container.decode(DiscountProperties.self, forKey: .discount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderAmount = try container.decode(Double.self, forKey: .orderAmount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - points = try container.decode(Double.self, forKey: .points) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(appliedRuleBucket, forKey: .appliedRuleBucket) - - - - try? container.encodeIfPresent(baseDiscount, forKey: .baseDiscount) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - - try? container.encodeIfPresent(orderAmount, forKey: .orderAmount) - - - - try? container.encodeIfPresent(points, forKey: .points) - - - } - - } - - /* - Model: OrderDiscountRuleBucket - Used By: Rewards - */ - class OrderDiscountRuleBucket: Codable { - - public var high: Double? - - public var low: Double? - - public var max: Double? - - public var value: Double? - - public var valueType: String? - - - public enum CodingKeys: String, CodingKey { - - case high = "high" - - case low = "low" - - case max = "max" - - case value = "value" - - case valueType = "value_type" - - } - - public init(high: Double?, low: Double?, max: Double?, value: Double?, valueType: String?) { - - self.high = high - - self.low = low - - self.max = max - - self.value = value - - self.valueType = valueType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - high = try container.decode(Double.self, forKey: .high) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - low = try container.decode(Double.self, forKey: .low) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - max = try container.decode(Double.self, forKey: .max) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(Double.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - valueType = try container.decode(String.self, forKey: .valueType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(high, forKey: .high) - - - - try? container.encodeIfPresent(low, forKey: .low) - - - - try? container.encodeIfPresent(max, forKey: .max) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(valueType, forKey: .valueType) - - - } - - } - - /* - Model: PointsHistory - Used By: Rewards - */ - class PointsHistory: Codable { - - public var id: String? - - public var applicationId: String? - - public var claimed: Bool? - - public var createdAt: String? - - public var expiresOn: String? - - public var meta: [String: Any]? - - public var points: Double? - - public var remainingPoints: Double? - - public var text1: String? - - public var text2: String? - - public var text3: String? - - public var txnName: String? - - public var updatedAt: String? - - public var userId: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case applicationId = "application_id" - - case claimed = "claimed" - - case createdAt = "created_at" - - case expiresOn = "expires_on" - - case meta = "meta" - - case points = "points" - - case remainingPoints = "remaining_points" - - case text1 = "text_1" - - case text2 = "text_2" - - case text3 = "text_3" - - case txnName = "txn_name" - - case updatedAt = "updated_at" - - case userId = "user_id" - - } - - public init(applicationId: String?, claimed: Bool?, createdAt: String?, expiresOn: String?, meta: [String: Any]?, points: Double?, remainingPoints: Double?, text1: String?, text2: String?, text3: String?, txnName: String?, updatedAt: String?, userId: String?, id: String?) { - - self.id = id - - self.applicationId = applicationId - - self.claimed = claimed - - self.createdAt = createdAt - - self.expiresOn = expiresOn - - self.meta = meta - - self.points = points - - self.remainingPoints = remainingPoints - - self.text1 = text1 - - self.text2 = text2 - - self.text3 = text3 - - self.txnName = txnName - - self.updatedAt = updatedAt - - self.userId = userId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - applicationId = try container.decode(String.self, forKey: .applicationId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - claimed = try container.decode(Bool.self, forKey: .claimed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expiresOn = try container.decode(String.self, forKey: .expiresOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - points = try container.decode(Double.self, forKey: .points) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - remainingPoints = try container.decode(Double.self, forKey: .remainingPoints) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text1 = try container.decode(String.self, forKey: .text1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text2 = try container.decode(String.self, forKey: .text2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text3 = try container.decode(String.self, forKey: .text3) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - txnName = try container.decode(String.self, forKey: .txnName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(applicationId, forKey: .applicationId) - - - - try? container.encodeIfPresent(claimed, forKey: .claimed) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(expiresOn, forKey: .expiresOn) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(points, forKey: .points) - - - - try? container.encodeIfPresent(remainingPoints, forKey: .remainingPoints) - - - - try? container.encodeIfPresent(text1, forKey: .text1) - - - - try? container.encodeIfPresent(text2, forKey: .text2) - - - - try? container.encodeIfPresent(text3, forKey: .text3) - - - - try? container.encodeIfPresent(txnName, forKey: .txnName) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - } - - } - - /* - Model: PointsHistoryResponse - Used By: Rewards - */ - class PointsHistoryResponse: Codable { - - public var items: [PointsHistory]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [PointsHistory]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([PointsHistory].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: PointsResponse - Used By: Rewards - */ - class PointsResponse: Codable { - - public var points: Double? - - - public enum CodingKeys: String, CodingKey { - - case points = "points" - - } - - public init(points: Double?) { - - self.points = points - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - points = try container.decode(Double.self, forKey: .points) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(points, forKey: .points) - - - } - - } - - /* - Model: RedeemReferralCodeRequest - Used By: Rewards - */ - class RedeemReferralCodeRequest: Codable { - - public var deviceId: String - - public var referralCode: String - - - public enum CodingKeys: String, CodingKey { - - case deviceId = "device_id" - - case referralCode = "referral_code" - - } - - public init(deviceId: String, referralCode: String) { - - self.deviceId = deviceId - - self.referralCode = referralCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - deviceId = try container.decode(String.self, forKey: .deviceId) - - - - - referralCode = try container.decode(String.self, forKey: .referralCode) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(deviceId, forKey: .deviceId) - - - - try? container.encodeIfPresent(referralCode, forKey: .referralCode) - - - } - - } - - /* - Model: RedeemReferralCodeResponse - Used By: Rewards - */ - class RedeemReferralCodeResponse: Codable { - - public var message: String? - - public var points: Double? - - public var redeemed: Bool? - - public var referrerId: String? - - public var referrerInfo: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - case points = "points" - - case redeemed = "redeemed" - - case referrerId = "referrer_id" - - case referrerInfo = "referrer_info" - - } - - public init(message: String?, points: Double?, redeemed: Bool?, referrerId: String?, referrerInfo: String?) { - - self.message = message - - self.points = points - - self.redeemed = redeemed - - self.referrerId = referrerId - - self.referrerInfo = referrerInfo - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - points = try container.decode(Double.self, forKey: .points) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - redeemed = try container.decode(Bool.self, forKey: .redeemed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - referrerId = try container.decode(String.self, forKey: .referrerId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - referrerInfo = try container.decode(String.self, forKey: .referrerInfo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(points, forKey: .points) - - - - try? container.encodeIfPresent(redeemed, forKey: .redeemed) - - - - try? container.encodeIfPresent(referrerId, forKey: .referrerId) - - - - try? container.encodeIfPresent(referrerInfo, forKey: .referrerInfo) - - - } - - } - - /* - Model: ReferralDetailsResponse - Used By: Rewards - */ - class ReferralDetailsResponse: Codable { - - public var referral: Offer? - - public var referrerInfo: String? - - public var share: ShareMessages? - - public var user: ReferralDetailsUser? - - - public enum CodingKeys: String, CodingKey { - - case referral = "referral" - - case referrerInfo = "referrer_info" - - case share = "share" - - case user = "user" - - } - - public init(referral: Offer?, referrerInfo: String?, share: ShareMessages?, user: ReferralDetailsUser?) { - - self.referral = referral - - self.referrerInfo = referrerInfo - - self.share = share - - self.user = user - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - referral = try container.decode(Offer.self, forKey: .referral) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - referrerInfo = try container.decode(String.self, forKey: .referrerInfo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - share = try container.decode(ShareMessages.self, forKey: .share) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - user = try container.decode(ReferralDetailsUser.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(referral, forKey: .referral) - - - - try? container.encodeIfPresent(referrerInfo, forKey: .referrerInfo) - - - - try? container.encodeIfPresent(share, forKey: .share) - - - - try? container.encodeIfPresent(user, forKey: .user) - - - } - - } - - /* - Model: ReferralDetailsUser - Used By: Rewards - */ - class ReferralDetailsUser: Codable { - - public var blocked: Bool? - - public var points: Double? - - public var redeemed: Bool? - - public var referralCode: String? - - - public enum CodingKeys: String, CodingKey { - - case blocked = "blocked" - - case points = "points" - - case redeemed = "redeemed" - - case referralCode = "referral_code" - - } - - public init(blocked: Bool?, points: Double?, redeemed: Bool?, referralCode: String?) { - - self.blocked = blocked - - self.points = points - - self.redeemed = redeemed - - self.referralCode = referralCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - blocked = try container.decode(Bool.self, forKey: .blocked) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - points = try container.decode(Double.self, forKey: .points) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - redeemed = try container.decode(Bool.self, forKey: .redeemed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - referralCode = try container.decode(String.self, forKey: .referralCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(blocked, forKey: .blocked) - - - - try? container.encodeIfPresent(points, forKey: .points) - - - - try? container.encodeIfPresent(redeemed, forKey: .redeemed) - - - - try? container.encodeIfPresent(referralCode, forKey: .referralCode) - - - } - - } - - /* - Model: RewardsArticle - Used By: Rewards - */ - class RewardsArticle: Codable { - - public var id: String? - - public var points: Double? - - public var price: Double? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case points = "points" - - case price = "price" - - } - - public init(id: String?, points: Double?, price: Double?) { - - self.id = id - - self.points = points - - self.price = price - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - points = try container.decode(Double.self, forKey: .points) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(Double.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(points, forKey: .points) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - } - - } - - /* - Model: Schedule - Used By: Rewards - */ - class Schedule: Codable { - - public var cron: String? - - public var duration: Int? - - public var end: String? - - public var start: String? - - - public enum CodingKeys: String, CodingKey { - - case cron = "cron" - - case duration = "duration" - - case end = "end" - - case start = "start" - - } - - public init(cron: String?, duration: Int?, end: String?, start: String?) { - - self.cron = cron - - self.duration = duration - - self.end = end - - self.start = start - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cron = try container.decode(String.self, forKey: .cron) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - duration = try container.decode(Int.self, forKey: .duration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - end = try container.decode(String.self, forKey: .end) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - start = try container.decode(String.self, forKey: .start) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cron, forKey: .cron) - - - - try? container.encodeIfPresent(duration, forKey: .duration) - - - - try? container.encodeIfPresent(end, forKey: .end) - - - - try? container.encodeIfPresent(start, forKey: .start) - - - } - - } - - /* - Model: ShareMessages - Used By: Rewards - */ - class ShareMessages: Codable { - - public var email: String? - - public var facebook: String? - - public var fallback: String? - - public var message: String? - - public var messenger: String? - - public var sms: String? - - public var text: String? - - public var twitter: String? - - public var whatsapp: String? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case facebook = "facebook" - - case fallback = "fallback" - - case message = "message" - - case messenger = "messenger" - - case sms = "sms" - - case text = "text" - - case twitter = "twitter" - - case whatsapp = "whatsapp" - - } - - public init(email: String?, facebook: String?, fallback: String?, message: String?, messenger: String?, sms: String?, text: String?, twitter: String?, whatsapp: String?) { - - self.email = email - - self.facebook = facebook - - self.fallback = fallback - - self.message = message - - self.messenger = messenger - - self.sms = sms - - self.text = text - - self.twitter = twitter - - self.whatsapp = whatsapp - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - facebook = try container.decode(String.self, forKey: .facebook) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fallback = try container.decode(String.self, forKey: .fallback) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - messenger = try container.decode(String.self, forKey: .messenger) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sms = try container.decode(String.self, forKey: .sms) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text = try container.decode(String.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - twitter = try container.decode(String.self, forKey: .twitter) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - whatsapp = try container.decode(String.self, forKey: .whatsapp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(facebook, forKey: .facebook) - - - - try? container.encodeIfPresent(fallback, forKey: .fallback) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(messenger, forKey: .messenger) - - - - try? container.encodeIfPresent(sms, forKey: .sms) - - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(twitter, forKey: .twitter) - - - - try? container.encodeIfPresent(whatsapp, forKey: .whatsapp) - - - } - - } - - - - /* - Model: AbuseReport - Used By: Feedback - */ - class AbuseReport: Codable { - - public var abused: Bool? - - public var dateMeta: DateMeta? - - public var description: String? - - public var entity: Entity? - - public var id: String? - - public var name: String? - - public var state: FeedbackState? - - public var tags: [TagMeta]? - - - public enum CodingKeys: String, CodingKey { - - case abused = "abused" - - case dateMeta = "date_meta" - - case description = "description" - - case entity = "entity" - - case id = "id" - - case name = "name" - - case state = "state" - - case tags = "tags" - - } - - public init(abused: Bool?, dateMeta: DateMeta?, description: String?, entity: Entity?, id: String?, name: String?, state: FeedbackState?, tags: [TagMeta]?) { - - self.abused = abused - - self.dateMeta = dateMeta - - self.description = description - - self.entity = entity - - self.id = id - - self.name = name - - self.state = state - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - abused = try container.decode(Bool.self, forKey: .abused) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entity = try container.decode(Entity.self, forKey: .entity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(FeedbackState.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([TagMeta].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(abused, forKey: .abused) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(entity, forKey: .entity) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: Access - Used By: Feedback - */ - class Access: Codable { - - public var answer: Bool? - - public var askQuestion: Bool? - - public var comment: Bool? - - public var rnr: Bool? - - - public enum CodingKeys: String, CodingKey { - - case answer = "answer" - - case askQuestion = "ask_question" - - case comment = "comment" - - case rnr = "rnr" - - } - - public init(answer: Bool?, askQuestion: Bool?, comment: Bool?, rnr: Bool?) { - - self.answer = answer - - self.askQuestion = askQuestion - - self.comment = comment - - self.rnr = rnr - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - answer = try container.decode(Bool.self, forKey: .answer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - askQuestion = try container.decode(Bool.self, forKey: .askQuestion) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - comment = try container.decode(Bool.self, forKey: .comment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rnr = try container.decode(Bool.self, forKey: .rnr) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(answer, forKey: .answer) - - - - try? container.encodeIfPresent(askQuestion, forKey: .askQuestion) - - - - try? container.encodeIfPresent(comment, forKey: .comment) - - - - try? container.encodeIfPresent(rnr, forKey: .rnr) - - - } - - } - - /* - Model: AddMediaListRequest - Used By: Feedback - */ - class AddMediaListRequest: Codable { - - public var entityId: String? - - public var entityType: String? - - public var mediaList: [AddMediaRequest]? - - public var refId: String? - - public var refType: String? - - - public enum CodingKeys: String, CodingKey { - - case entityId = "entity_id" - - case entityType = "entity_type" - - case mediaList = "media_list" - - case refId = "ref_id" - - case refType = "ref_type" - - } - - public init(entityId: String?, entityType: String?, mediaList: [AddMediaRequest]?, refId: String?, refType: String?) { - - self.entityId = entityId - - self.entityType = entityType - - self.mediaList = mediaList - - self.refId = refId - - self.refType = refType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - entityId = try container.decode(String.self, forKey: .entityId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entityType = try container.decode(String.self, forKey: .entityType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mediaList = try container.decode([AddMediaRequest].self, forKey: .mediaList) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refId = try container.decode(String.self, forKey: .refId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refType = try container.decode(String.self, forKey: .refType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(entityId, forKey: .entityId) - - - - try? container.encodeIfPresent(entityType, forKey: .entityType) - - - - try? container.encodeIfPresent(mediaList, forKey: .mediaList) - - - - try? container.encodeIfPresent(refId, forKey: .refId) - - - - try? container.encodeIfPresent(refType, forKey: .refType) - - - } - - } - - /* - Model: AddMediaRequest - Used By: Feedback - */ - class AddMediaRequest: Codable { - - public var cloudId: String? - - public var cloudName: String? - - public var cloudProvider: String? - - public var entityId: String? - - public var entityType: String? - - public var mediaUrl: String? - - public var refId: String? - - public var refType: String? - - public var tags: [String]? - - public var thumbnailUrl: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case cloudId = "cloud_id" - - case cloudName = "cloud_name" - - case cloudProvider = "cloud_provider" - - case entityId = "entity_id" - - case entityType = "entity_type" - - case mediaUrl = "media_url" - - case refId = "ref_id" - - case refType = "ref_type" - - case tags = "tags" - - case thumbnailUrl = "thumbnail_url" - - case type = "type" - - } - - public init(cloudId: String?, cloudName: String?, cloudProvider: String?, entityId: String?, entityType: String?, mediaUrl: String?, refId: String?, refType: String?, tags: [String]?, thumbnailUrl: String?, type: String?) { - - self.cloudId = cloudId - - self.cloudName = cloudName - - self.cloudProvider = cloudProvider - - self.entityId = entityId - - self.entityType = entityType - - self.mediaUrl = mediaUrl - - self.refId = refId - - self.refType = refType - - self.tags = tags - - self.thumbnailUrl = thumbnailUrl - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cloudId = try container.decode(String.self, forKey: .cloudId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cloudName = try container.decode(String.self, forKey: .cloudName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cloudProvider = try container.decode(String.self, forKey: .cloudProvider) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entityId = try container.decode(String.self, forKey: .entityId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entityType = try container.decode(String.self, forKey: .entityType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mediaUrl = try container.decode(String.self, forKey: .mediaUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refId = try container.decode(String.self, forKey: .refId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refType = try container.decode(String.self, forKey: .refType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - thumbnailUrl = try container.decode(String.self, forKey: .thumbnailUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cloudId, forKey: .cloudId) - - - - try? container.encodeIfPresent(cloudName, forKey: .cloudName) - - - - try? container.encodeIfPresent(cloudProvider, forKey: .cloudProvider) - - - - try? container.encodeIfPresent(entityId, forKey: .entityId) - - - - try? container.encodeIfPresent(entityType, forKey: .entityType) - - - - try? container.encodeIfPresent(mediaUrl, forKey: .mediaUrl) - - - - try? container.encodeIfPresent(refId, forKey: .refId) - - - - try? container.encodeIfPresent(refType, forKey: .refType) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(thumbnailUrl, forKey: .thumbnailUrl) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ApplicationSchema - Used By: Feedback - */ - class ApplicationSchema: Codable { - - public var id: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - } - - public init(id: String?) { - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: Attribute - Used By: Feedback - */ - class Attribute: Codable { - - public var dateMeta: DateMeta? - - public var description: String? - - public var id: String? - - public var name: String? - - public var slug: String? - - public var tags: [TagMeta]? - - - public enum CodingKeys: String, CodingKey { - - case dateMeta = "date_meta" - - case description = "description" - - case id = "id" - - case name = "name" - - case slug = "slug" - - case tags = "tags" - - } - - public init(dateMeta: DateMeta?, description: String?, id: String?, name: String?, slug: String?, tags: [TagMeta]?) { - - self.dateMeta = dateMeta - - self.description = description - - self.id = id - - self.name = name - - self.slug = slug - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([TagMeta].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: AttributeObject - Used By: Feedback - */ - class AttributeObject: Codable { - - public var description: String? - - public var name: String - - public var slug: String? - - public var title: String? - - public var type: String - - public var value: Double - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case name = "name" - - case slug = "slug" - - case title = "title" - - case type = "type" - - case value = "value" - - } - - public init(description: String?, name: String, slug: String?, title: String?, type: String, value: Double) { - - self.description = description - - self.name = name - - self.slug = slug - - self.title = title - - self.type = type - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - type = try container.decode(String.self, forKey: .type) - - - - - value = try container.decode(Double.self, forKey: .value) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: AttributeResponse - Used By: Feedback - */ - class AttributeResponse: Codable { - - public var items: [Attribute]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [Attribute]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Attribute].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: AutoDetectors - Used By: Feedback - */ - class AutoDetectors: Codable { - - public var textDetector: [TextDetector]? - - - public enum CodingKeys: String, CodingKey { - - case textDetector = "text_detector" - - } - - public init(textDetector: [TextDetector]?) { - - self.textDetector = textDetector - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - textDetector = try container.decode([TextDetector].self, forKey: .textDetector) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(textDetector, forKey: .textDetector) - - - } - - } - - /* - Model: CheckEligibilityResponse - Used By: Feedback - */ - class CheckEligibilityResponse: Codable { - - public var access: Access? - - - public enum CodingKeys: String, CodingKey { - - case access = "access" - - } - - public init(access: Access?) { - - self.access = access - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - access = try container.decode(Access.self, forKey: .access) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(access, forKey: .access) - - - } - - } - - /* - Model: Cloud - Used By: Feedback - */ - class Cloud: Codable { - - public var id: String? - - public var name: String? - - public var provider: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case name = "name" - - case provider = "provider" - - } - - public init(id: String?, name: String?, provider: String?) { - - self.id = id - - self.name = name - - self.provider = provider - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - provider = try container.decode(String.self, forKey: .provider) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(provider, forKey: .provider) - - - } - - } - - /* - Model: Comment - Used By: Feedback - */ - class Comment: Codable { - - public var comment: [String]? - - public var dateMeta: DateMeta? - - public var entity: Entity? - - public var id: String? - - public var name: String? - - public var state: FeedbackState? - - public var tags: [TagMeta]? - - public var voteCount: VoteCount? - - - public enum CodingKeys: String, CodingKey { - - case comment = "comment" - - case dateMeta = "date_meta" - - case entity = "entity" - - case id = "id" - - case name = "name" - - case state = "state" - - case tags = "tags" - - case voteCount = "vote_count" - - } - - public init(comment: [String]?, dateMeta: DateMeta?, entity: Entity?, id: String?, name: String?, state: FeedbackState?, tags: [TagMeta]?, voteCount: VoteCount?) { - - self.comment = comment - - self.dateMeta = dateMeta - - self.entity = entity - - self.id = id - - self.name = name - - self.state = state - - self.tags = tags - - self.voteCount = voteCount - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - comment = try container.decode([String].self, forKey: .comment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entity = try container.decode(Entity.self, forKey: .entity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(FeedbackState.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([TagMeta].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - voteCount = try container.decode(VoteCount.self, forKey: .voteCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(comment, forKey: .comment) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(entity, forKey: .entity) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(voteCount, forKey: .voteCount) - - - } - - } - - /* - Model: CommentGetResponse - Used By: Feedback - */ - class CommentGetResponse: Codable { - - public var items: [Comment]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [Comment]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Comment].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: CommentRequest - Used By: Feedback - */ - class CommentRequest: Codable { - - public var comment: [String] - - public var entityId: String - - public var entityType: String - - - public enum CodingKeys: String, CodingKey { - - case comment = "comment" - - case entityId = "entity_id" - - case entityType = "entity_type" - - } - - public init(comment: [String], entityId: String, entityType: String) { - - self.comment = comment - - self.entityId = entityId - - self.entityType = entityType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - comment = try container.decode([String].self, forKey: .comment) - - - - - entityId = try container.decode(String.self, forKey: .entityId) - - - - - entityType = try container.decode(String.self, forKey: .entityType) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(comment, forKey: .comment) - - - - try? container.encodeIfPresent(entityId, forKey: .entityId) - - - - try? container.encodeIfPresent(entityType, forKey: .entityType) - - - } - - } - - /* - Model: CreateQNARequest - Used By: Feedback - */ - class CreateQNARequest: Codable { - - public var choices: [String]? - - public var entityId: String - - public var entityType: String - - public var maxLen: Int? - - public var sortPriority: Int? - - public var tags: [String]? - - public var text: String - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case choices = "choices" - - case entityId = "entity_id" - - case entityType = "entity_type" - - case maxLen = "max_len" - - case sortPriority = "sort_priority" - - case tags = "tags" - - case text = "text" - - case type = "type" - - } - - public init(choices: [String]?, entityId: String, entityType: String, maxLen: Int?, sortPriority: Int?, tags: [String]?, text: String, type: String?) { - - self.choices = choices - - self.entityId = entityId - - self.entityType = entityType - - self.maxLen = maxLen - - self.sortPriority = sortPriority - - self.tags = tags - - self.text = text - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - choices = try container.decode([String].self, forKey: .choices) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - entityId = try container.decode(String.self, forKey: .entityId) - - - - - entityType = try container.decode(String.self, forKey: .entityType) - - - - - do { - maxLen = try container.decode(Int.self, forKey: .maxLen) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sortPriority = try container.decode(Int.self, forKey: .sortPriority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - text = try container.decode(String.self, forKey: .text) - - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(choices, forKey: .choices) - - - - try? container.encodeIfPresent(entityId, forKey: .entityId) - - - - try? container.encodeIfPresent(entityType, forKey: .entityType) - - - - try? container.encodeIfPresent(maxLen, forKey: .maxLen) - - - - try? container.encodeIfPresent(sortPriority, forKey: .sortPriority) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: CreatedBy - Used By: Feedback - */ - class CreatedBy: Codable { - - public var id: String? - - public var name: String? - - public var tags: [TagMeta]? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case name = "name" - - case tags = "tags" - - } - - public init(id: String?, name: String?, tags: [TagMeta]?) { - - self.id = id - - self.name = name - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([TagMeta].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: CursorGetResponse - Used By: Feedback - */ - class CursorGetResponse: Codable { - - public var items: [[String: Any]]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [[String: Any]]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([[String: Any]].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: CustomerReview - Used By: Feedback - */ - class CustomerReview: Codable { - - public var autoDetectors: AutoDetectors? - - public var createdOn: String? - - public var deviceMeta: DeviceMeta? - - public var entity: ProductEntity? - - public var id: String? - - public var locationMeta: LocationMeta? - - public var modifiedOn: String? - - public var name: String? - - public var rating: ReviewRating? - - public var review: Review? - - public var slug: String? - - public var state: State? - - public var tags: [TagMeta]? - - public var template: Template? - - public var voteCount: VoteCount? - - - public enum CodingKeys: String, CodingKey { - - case autoDetectors = "auto_detectors" - - case createdOn = "created_on" - - case deviceMeta = "device_meta" - - case entity = "entity" - - case id = "id" - - case locationMeta = "location_meta" - - case modifiedOn = "modified_on" - - case name = "name" - - case rating = "rating" - - case review = "review" - - case slug = "slug" - - case state = "state" - - case tags = "tags" - - case template = "template" - - case voteCount = "vote_count" - - } - - public init(autoDetectors: AutoDetectors?, createdOn: String?, deviceMeta: DeviceMeta?, entity: ProductEntity?, id: String?, locationMeta: LocationMeta?, modifiedOn: String?, name: String?, rating: ReviewRating?, review: Review?, slug: String?, state: State?, tags: [TagMeta]?, template: Template?, voteCount: VoteCount?) { - - self.autoDetectors = autoDetectors - - self.createdOn = createdOn - - self.deviceMeta = deviceMeta - - self.entity = entity - - self.id = id - - self.locationMeta = locationMeta - - self.modifiedOn = modifiedOn - - self.name = name - - self.rating = rating - - self.review = review - - self.slug = slug - - self.state = state - - self.tags = tags - - self.template = template - - self.voteCount = voteCount - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - autoDetectors = try container.decode(AutoDetectors.self, forKey: .autoDetectors) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deviceMeta = try container.decode(DeviceMeta.self, forKey: .deviceMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entity = try container.decode(ProductEntity.self, forKey: .entity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - locationMeta = try container.decode(LocationMeta.self, forKey: .locationMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rating = try container.decode(ReviewRating.self, forKey: .rating) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - review = try container.decode(Review.self, forKey: .review) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(State.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([TagMeta].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - template = try container.decode(Template.self, forKey: .template) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - voteCount = try container.decode(VoteCount.self, forKey: .voteCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(autoDetectors, forKey: .autoDetectors) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(deviceMeta, forKey: .deviceMeta) - - - - try? container.encodeIfPresent(entity, forKey: .entity) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(locationMeta, forKey: .locationMeta) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(rating, forKey: .rating) - - - - try? container.encodeIfPresent(review, forKey: .review) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(template, forKey: .template) - - - - try? container.encodeIfPresent(voteCount, forKey: .voteCount) - - - } - - } - - /* - Model: DeviceMeta - Used By: Feedback - */ - class DeviceMeta: Codable { - - public var appVersion: String? - - public var platform: String? - - - public enum CodingKeys: String, CodingKey { - - case appVersion = "app_version" - - case platform = "platform" - - } - - public init(appVersion: String?, platform: String?) { - - self.appVersion = appVersion - - self.platform = platform - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - appVersion = try container.decode(String.self, forKey: .appVersion) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode(String.self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(appVersion, forKey: .appVersion) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - } - - } - - /* - Model: Entity - Used By: Feedback - */ - class Entity: Codable { - - public var id: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case type = "type" - - } - - public init(id: String?, type: String?) { - - self.id = id - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: EntityMeta - Used By: Feedback - */ - class EntityMeta: Codable { - - public var orderId: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case orderId = "order_id" - - case type = "type" - - } - - public init(orderId: String?, type: String?) { - - self.orderId = orderId - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - orderId = try container.decode(String.self, forKey: .orderId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(orderId, forKey: .orderId) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: FeedbackError - Used By: Feedback - */ - class FeedbackError: Codable { - - public var code: String? - - public var exception: String? - - public var info: String? - - public var message: String? - - public var meta: [String: Any]? - - public var requestId: String? - - public var stackTrace: String? - - public var status: Int? - - - public enum CodingKeys: String, CodingKey { - - case code = "code" - - case exception = "exception" - - case info = "info" - - case message = "message" - - case meta = "meta" - - case requestId = "request_id" - - case stackTrace = "stack_trace" - - case status = "status" - - } - - public init(code: String?, exception: String?, info: String?, message: String?, meta: [String: Any]?, requestId: String?, stackTrace: String?, status: Int?) { - - self.code = code - - self.exception = exception - - self.info = info - - self.message = message - - self.meta = meta - - self.requestId = requestId - - self.stackTrace = stackTrace - - self.status = status - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - exception = try container.decode(String.self, forKey: .exception) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - info = try container.decode(String.self, forKey: .info) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requestId = try container.decode(String.self, forKey: .requestId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stackTrace = try container.decode(String.self, forKey: .stackTrace) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(Int.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(exception, forKey: .exception) - - - - try? container.encodeIfPresent(info, forKey: .info) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(stackTrace, forKey: .stackTrace) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - } - - } - - /* - Model: FeedbackMedia - Used By: Feedback - */ - class FeedbackMedia: Codable { - - public var application: ApplicationSchema? - - public var cloud: Cloud? - - public var createdBy: CreatedBy? - - public var dateMeta: DateMeta? - - public var description: String? - - public var entity: Entity? - - public var id: String? - - public var name: String? - - public var reference: Entity? - - public var state: MediaState? - - public var tags: [TagMeta]? - - public var type: String? - - public var url: Url? - - - public enum CodingKeys: String, CodingKey { - - case application = "application" - - case cloud = "cloud" - - case createdBy = "created_by" - - case dateMeta = "date_meta" - - case description = "description" - - case entity = "entity" - - case id = "id" - - case name = "name" - - case reference = "reference" - - case state = "state" - - case tags = "tags" - - case type = "type" - - case url = "url" - - } - - public init(application: ApplicationSchema?, cloud: Cloud?, createdBy: CreatedBy?, dateMeta: DateMeta?, description: String?, entity: Entity?, id: String?, name: String?, reference: Entity?, state: MediaState?, tags: [TagMeta]?, type: String?, url: Url?) { - - self.application = application - - self.cloud = cloud - - self.createdBy = createdBy - - self.dateMeta = dateMeta - - self.description = description - - self.entity = entity - - self.id = id - - self.name = name - - self.reference = reference - - self.state = state - - self.tags = tags - - self.type = type - - self.url = url - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - application = try container.decode(ApplicationSchema.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cloud = try container.decode(Cloud.self, forKey: .cloud) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(CreatedBy.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entity = try container.decode(Entity.self, forKey: .entity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - reference = try container.decode(Entity.self, forKey: .reference) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(MediaState.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([TagMeta].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(Url.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(cloud, forKey: .cloud) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(entity, forKey: .entity) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(reference, forKey: .reference) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - } - - } - - /* - Model: FeedbackState - Used By: Feedback - */ - class FeedbackState: Codable { - - public var active: Bool? - - public var archive: Bool? - - public var media: String? - - public var qna: Bool? - - public var rating: Bool? - - public var review: Bool? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case archive = "archive" - - case media = "media" - - case qna = "qna" - - case rating = "rating" - - case review = "review" - - } - - public init(active: Bool?, archive: Bool?, media: String?, qna: Bool?, rating: Bool?, review: Bool?) { - - self.active = active - - self.archive = archive - - self.media = media - - self.qna = qna - - self.rating = rating - - self.review = review - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archive = try container.decode(Bool.self, forKey: .archive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - media = try container.decode(String.self, forKey: .media) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - qna = try container.decode(Bool.self, forKey: .qna) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rating = try container.decode(Bool.self, forKey: .rating) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - review = try container.decode(Bool.self, forKey: .review) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(archive, forKey: .archive) - - - - try? container.encodeIfPresent(media, forKey: .media) - - - - try? container.encodeIfPresent(qna, forKey: .qna) - - - - try? container.encodeIfPresent(rating, forKey: .rating) - - - - try? container.encodeIfPresent(review, forKey: .review) - - - } - - } - - /* - Model: GeoLoc - Used By: Feedback - */ - class GeoLoc: Codable { - - public var latitude: String? - - public var longitude: String? - - - public enum CodingKeys: String, CodingKey { - - case latitude = "latitude" - - case longitude = "longitude" - - } - - public init(latitude: String?, longitude: String?) { - - self.latitude = latitude - - self.longitude = longitude - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - latitude = try container.decode(String.self, forKey: .latitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - longitude = try container.decode(String.self, forKey: .longitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(latitude, forKey: .latitude) - - - - try? container.encodeIfPresent(longitude, forKey: .longitude) - - - } - - } - - /* - Model: InsertResponse - Used By: Feedback - */ - class InsertResponse: Codable { - - public var ids: String? - - - public enum CodingKeys: String, CodingKey { - - case ids = "ids" - - } - - public init(ids: String?) { - - self.ids = ids - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - ids = try container.decode(String.self, forKey: .ids) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(ids, forKey: .ids) - - - } - - } - - /* - Model: Location - Used By: Feedback - */ - class Location: Codable { - - public var countryCode: String? - - public var flagUrl: String? - - public var geoLoc: GeoLoc? - - public var name: String? - - public var pincode: String? - - - public enum CodingKeys: String, CodingKey { - - case countryCode = "country_code" - - case flagUrl = "flag_url" - - case geoLoc = "geo_loc" - - case name = "name" - - case pincode = "pincode" - - } - - public init(countryCode: String?, flagUrl: String?, geoLoc: GeoLoc?, name: String?, pincode: String?) { - - self.countryCode = countryCode - - self.flagUrl = flagUrl - - self.geoLoc = geoLoc - - self.name = name - - self.pincode = pincode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - flagUrl = try container.decode(String.self, forKey: .flagUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - geoLoc = try container.decode(GeoLoc.self, forKey: .geoLoc) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(String.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(flagUrl, forKey: .flagUrl) - - - - try? container.encodeIfPresent(geoLoc, forKey: .geoLoc) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - } - - } - - /* - Model: LocationMeta - Used By: Feedback - */ - class LocationMeta: Codable { - - public var demand: Location? - - public var supply: Location? - - - public enum CodingKeys: String, CodingKey { - - case demand = "demand" - - case supply = "supply" - - } - - public init(demand: Location?, supply: Location?) { - - self.demand = demand - - self.supply = supply - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - demand = try container.decode(Location.self, forKey: .demand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - supply = try container.decode(Location.self, forKey: .supply) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(demand, forKey: .demand) - - - - try? container.encodeIfPresent(supply, forKey: .supply) - - - } - - } - - /* - Model: MediaGetResponse - Used By: Feedback - */ - class MediaGetResponse: Codable { - - public var items: [FeedbackMedia]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [FeedbackMedia]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([FeedbackMedia].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: MediaMeta - Used By: Feedback - */ - class MediaMeta: Codable { - - public var cloud: Cloud? - - public var comment: [String]? - - public var description: String? - - public var id: String? - - public var type: String? - - public var url: Url? - - - public enum CodingKeys: String, CodingKey { - - case cloud = "cloud" - - case comment = "comment" - - case description = "description" - - case id = "id" - - case type = "type" - - case url = "url" - - } - - public init(cloud: Cloud?, comment: [String]?, description: String?, id: String?, type: String?, url: Url?) { - - self.cloud = cloud - - self.comment = comment - - self.description = description - - self.id = id - - self.type = type - - self.url = url - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cloud = try container.decode(Cloud.self, forKey: .cloud) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - comment = try container.decode([String].self, forKey: .comment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(Url.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cloud, forKey: .cloud) - - - - try? container.encodeIfPresent(comment, forKey: .comment) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - } - - } - - /* - Model: MediaState - Used By: Feedback - */ - class MediaState: Codable { - - public var approve: Bool? - - public var archive: Bool? - - - public enum CodingKeys: String, CodingKey { - - case approve = "approve" - - case archive = "archive" - - } - - public init(approve: Bool?, archive: Bool?) { - - self.approve = approve - - self.archive = archive - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - approve = try container.decode(Bool.self, forKey: .approve) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archive = try container.decode(Bool.self, forKey: .archive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(approve, forKey: .approve) - - - - try? container.encodeIfPresent(archive, forKey: .archive) - - - } - - } - - /* - Model: NumberGetResponse - Used By: Feedback - */ - class NumberGetResponse: Codable { - - public var items: [[String: Any]]? - - public var page: PageNumber? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [[String: Any]]?, page: PageNumber?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([[String: Any]].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(PageNumber.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: PageNumber - Used By: Feedback - */ - class PageNumber: Codable { - - public var current: Int? - - public var hasNext: Bool? - - public var itemTotal: Int? - - public var size: Int? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case current = "current" - - case hasNext = "has_next" - - case itemTotal = "item_total" - - case size = "size" - - case type = "type" - - } - - public init(current: Int?, hasNext: Bool?, itemTotal: Int?, size: Int?, type: String?) { - - self.current = current - - self.hasNext = hasNext - - self.itemTotal = itemTotal - - self.size = size - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - current = try container.decode(Int.self, forKey: .current) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasNext = try container.decode(Bool.self, forKey: .hasNext) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemTotal = try container.decode(Int.self, forKey: .itemTotal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - size = try container.decode(Int.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(current, forKey: .current) - - - - try? container.encodeIfPresent(hasNext, forKey: .hasNext) - - - - try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ProductEntity - Used By: Feedback - */ - class ProductEntity: Codable { - - public var id: String? - - public var meta: EntityMeta? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case meta = "meta" - - case type = "type" - - } - - public init(id: String?, meta: EntityMeta?, type: String?) { - - self.id = id - - self.meta = meta - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode(EntityMeta.self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: QNA - Used By: Feedback - */ - class QNA: Codable { - - public var comments: [Comment]? - - public var dateMeta: DateMeta? - - public var entity: Entity? - - public var id: String? - - public var name: String? - - public var question: Question? - - public var state: QNAState? - - public var tag: [String]? - - public var tags: [TagMeta]? - - - public enum CodingKeys: String, CodingKey { - - case comments = "comments" - - case dateMeta = "date_meta" - - case entity = "entity" - - case id = "id" - - case name = "name" - - case question = "question" - - case state = "state" - - case tag = "tag" - - case tags = "tags" - - } - - public init(comments: [Comment]?, dateMeta: DateMeta?, entity: Entity?, id: String?, name: String?, question: Question?, state: QNAState?, tag: [String]?, tags: [TagMeta]?) { - - self.comments = comments - - self.dateMeta = dateMeta - - self.entity = entity - - self.id = id - - self.name = name - - self.question = question - - self.state = state - - self.tag = tag - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - comments = try container.decode([Comment].self, forKey: .comments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entity = try container.decode(Entity.self, forKey: .entity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - question = try container.decode(Question.self, forKey: .question) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(QNAState.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tag = try container.decode([String].self, forKey: .tag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([TagMeta].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(comments, forKey: .comments) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(entity, forKey: .entity) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(question, forKey: .question) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(tag, forKey: .tag) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: QNAGetResponse - Used By: Feedback - */ - class QNAGetResponse: Codable { - - public var items: [QNA]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [QNA]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([QNA].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: QNAState - Used By: Feedback - */ - class QNAState: Codable { - - public var active: Bool? - - public var approve: Bool? - - public var modify: Bool? - - public var priority: Int? - - public var reply: Bool? - - public var vote: Bool? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case approve = "approve" - - case modify = "modify" - - case priority = "priority" - - case reply = "reply" - - case vote = "vote" - - } - - public init(active: Bool?, approve: Bool?, modify: Bool?, priority: Int?, reply: Bool?, vote: Bool?) { - - self.active = active - - self.approve = approve - - self.modify = modify - - self.priority = priority - - self.reply = reply - - self.vote = vote - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - approve = try container.decode(Bool.self, forKey: .approve) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modify = try container.decode(Bool.self, forKey: .modify) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priority = try container.decode(Int.self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - reply = try container.decode(Bool.self, forKey: .reply) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - vote = try container.decode(Bool.self, forKey: .vote) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(approve, forKey: .approve) - - - - try? container.encodeIfPresent(modify, forKey: .modify) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(reply, forKey: .reply) - - - - try? container.encodeIfPresent(vote, forKey: .vote) - - - } - - } - - /* - Model: Question - Used By: Feedback - */ - class Question: Codable { - - public var choices: [String]? - - public var maxLen: Int? - - public var text: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case choices = "choices" - - case maxLen = "max_len" - - case text = "text" - - case type = "type" - - } - - public init(choices: [String]?, maxLen: Int?, text: String?, type: String?) { - - self.choices = choices - - self.maxLen = maxLen - - self.text = text - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - choices = try container.decode([String].self, forKey: .choices) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - maxLen = try container.decode(Int.self, forKey: .maxLen) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text = try container.decode(String.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(choices, forKey: .choices) - - - - try? container.encodeIfPresent(maxLen, forKey: .maxLen) - - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: Rating - Used By: Feedback - */ - class Rating: Codable { - - public var attributes: [Attribute]? - - public var attributesSlugs: [String]? - - public var ui: UI? - - - public enum CodingKeys: String, CodingKey { - - case attributes = "attributes" - - case attributesSlugs = "attributes_slugs" - - case ui = "ui" - - } - - public init(attributes: [Attribute]?, attributesSlugs: [String]?, ui: UI?) { - - self.attributes = attributes - - self.attributesSlugs = attributesSlugs - - self.ui = ui - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - attributes = try container.decode([Attribute].self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attributesSlugs = try container.decode([String].self, forKey: .attributesSlugs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ui = try container.decode(UI.self, forKey: .ui) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - - try? container.encodeIfPresent(attributesSlugs, forKey: .attributesSlugs) - - - - try? container.encodeIfPresent(ui, forKey: .ui) - - - } - - } - - /* - Model: RatingGetResponse - Used By: Feedback - */ - class RatingGetResponse: Codable { - - public var items: [Rating]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [Rating]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Rating].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: RatingMetric - Used By: Feedback - */ - class RatingMetric: Codable { - - public var avg: Double? - - public var count: Int? - - public var name: String? - - public var slug: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case avg = "avg" - - case count = "count" - - case name = "name" - - case slug = "slug" - - case type = "type" - - } - - public init(avg: Double?, count: Int?, name: String?, slug: String?, type: String?) { - - self.avg = avg - - self.count = count - - self.name = name - - self.slug = slug - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - avg = try container.decode(Double.self, forKey: .avg) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(avg, forKey: .avg) - - - - try? container.encodeIfPresent(count, forKey: .count) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ReportAbuseGetResponse - Used By: Feedback - */ - class ReportAbuseGetResponse: Codable { - - public var items: [AbuseReport]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [AbuseReport]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([AbuseReport].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: ReportAbuseRequest - Used By: Feedback - */ - class ReportAbuseRequest: Codable { - - public var description: String? - - public var entityId: String - - public var entityType: String - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case entityId = "entity_id" - - case entityType = "entity_type" - - } - - public init(description: String?, entityId: String, entityType: String) { - - self.description = description - - self.entityId = entityId - - self.entityType = entityType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - entityId = try container.decode(String.self, forKey: .entityId) - - - - - entityType = try container.decode(String.self, forKey: .entityType) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(entityId, forKey: .entityId) - - - - try? container.encodeIfPresent(entityType, forKey: .entityType) - - - } - - } - - /* - Model: Review - Used By: Feedback - */ - class Review: Codable { - - public var answerIds: [String]? - - public var comments: [String]? - - public var description: String? - - public var mediaMeta: [MediaMeta]? - - public var title: String? - - - public enum CodingKeys: String, CodingKey { - - case answerIds = "answer_ids" - - case comments = "comments" - - case description = "description" - - case mediaMeta = "media_meta" - - case title = "title" - - } - - public init(answerIds: [String]?, comments: [String]?, description: String?, mediaMeta: [MediaMeta]?, title: String?) { - - self.answerIds = answerIds - - self.comments = comments - - self.description = description - - self.mediaMeta = mediaMeta - - self.title = title - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - answerIds = try container.decode([String].self, forKey: .answerIds) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - comments = try container.decode([String].self, forKey: .comments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mediaMeta = try container.decode([MediaMeta].self, forKey: .mediaMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(answerIds, forKey: .answerIds) - - - - try? container.encodeIfPresent(comments, forKey: .comments) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(mediaMeta, forKey: .mediaMeta) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - } - - } - - /* - Model: ReviewFacet - Used By: Feedback - */ - class ReviewFacet: Codable { - - public var display: String? - - public var name: String? - - public var selected: Bool? - - public var slug: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case name = "name" - - case selected = "selected" - - case slug = "slug" - - case type = "type" - - } - - public init(display: String?, name: String?, selected: Bool?, slug: String?, type: String?) { - - self.display = display - - self.name = name - - self.selected = selected - - self.slug = slug - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - selected = try container.decode(Bool.self, forKey: .selected) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(selected, forKey: .selected) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ReviewGetResponse - Used By: Feedback - */ - class ReviewGetResponse: Codable { - - public var facets: [ReviewFacet]? - - public var items: [CustomerReview]? - - public var page: Page? - - public var sort: [SortMethod]? - - - public enum CodingKeys: String, CodingKey { - - case facets = "facets" - - case items = "items" - - case page = "page" - - case sort = "sort" - - } - - public init(facets: [ReviewFacet]?, items: [CustomerReview]?, page: Page?, sort: [SortMethod]?) { - - self.facets = facets - - self.items = items - - self.page = page - - self.sort = sort - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - facets = try container.decode([ReviewFacet].self, forKey: .facets) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([CustomerReview].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sort = try container.decode([SortMethod].self, forKey: .sort) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(facets, forKey: .facets) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(sort, forKey: .sort) - - - } - - } - - /* - Model: ReviewMediaMeta - Used By: Feedback - */ - class ReviewMediaMeta: Codable { - - public var maxCount: Double? - - public var size: Double? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case maxCount = "max_count" - - case size = "size" - - case type = "type" - - } - - public init(maxCount: Double?, size: Double?, type: String?) { - - self.maxCount = maxCount - - self.size = size - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - maxCount = try container.decode(Double.self, forKey: .maxCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - size = try container.decode(Double.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(maxCount, forKey: .maxCount) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ReviewMetric - Used By: Feedback - */ - class ReviewMetric: Codable { - - public var attributeMetric: [RatingMetric]? - - public var createdOn: String? - - public var entity: Entity? - - public var id: String? - - public var modifiedOn: String? - - public var ratingAvg: Double? - - public var ratingCount: Int? - - public var ratingMetric: [RatingMetric]? - - public var reviewCount: Int? - - - public enum CodingKeys: String, CodingKey { - - case attributeMetric = "attribute_metric" - - case createdOn = "created_on" - - case entity = "entity" - - case id = "id" - - case modifiedOn = "modified_on" - - case ratingAvg = "rating_avg" - - case ratingCount = "rating_count" - - case ratingMetric = "rating_metric" - - case reviewCount = "review_count" - - } - - public init(attributeMetric: [RatingMetric]?, createdOn: String?, entity: Entity?, id: String?, modifiedOn: String?, ratingAvg: Double?, ratingCount: Int?, ratingMetric: [RatingMetric]?, reviewCount: Int?) { - - self.attributeMetric = attributeMetric - - self.createdOn = createdOn - - self.entity = entity - - self.id = id - - self.modifiedOn = modifiedOn - - self.ratingAvg = ratingAvg - - self.ratingCount = ratingCount - - self.ratingMetric = ratingMetric - - self.reviewCount = reviewCount - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - attributeMetric = try container.decode([RatingMetric].self, forKey: .attributeMetric) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entity = try container.decode(Entity.self, forKey: .entity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ratingAvg = try container.decode(Double.self, forKey: .ratingAvg) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ratingCount = try container.decode(Int.self, forKey: .ratingCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ratingMetric = try container.decode([RatingMetric].self, forKey: .ratingMetric) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - reviewCount = try container.decode(Int.self, forKey: .reviewCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(attributeMetric, forKey: .attributeMetric) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(entity, forKey: .entity) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(ratingAvg, forKey: .ratingAvg) - - - - try? container.encodeIfPresent(ratingCount, forKey: .ratingCount) - - - - try? container.encodeIfPresent(ratingMetric, forKey: .ratingMetric) - - - - try? container.encodeIfPresent(reviewCount, forKey: .reviewCount) - - - } - - } - - /* - Model: ReviewMetricGetResponse - Used By: Feedback - */ - class ReviewMetricGetResponse: Codable { - - public var items: [ReviewMetric]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [ReviewMetric]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([ReviewMetric].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: ReviewRating - Used By: Feedback - */ - class ReviewRating: Codable { - - public var attributes: [AttributeObject]? - - public var value: Double? - - - public enum CodingKeys: String, CodingKey { - - case attributes = "attributes" - - case value = "value" - - } - - public init(attributes: [AttributeObject]?, value: Double?) { - - self.attributes = attributes - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - attributes = try container.decode([AttributeObject].self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(Double.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: SaveAttributeRequest - Used By: Feedback - */ - class SaveAttributeRequest: Codable { - - public var description: String? - - public var name: String - - public var slug: String - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case name = "name" - - case slug = "slug" - - } - - public init(description: String?, name: String, slug: String) { - - self.description = description - - self.name = name - - self.slug = slug - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - - slug = try container.decode(String.self, forKey: .slug) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - } - - } - - /* - Model: SortMethod - Used By: Feedback - */ - class SortMethod: Codable { - - public var name: String? - - public var selected: Bool? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case selected = "selected" - - case type = "type" - - } - - public init(name: String?, selected: Bool?, type: String?) { - - self.name = name - - self.selected = selected - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - selected = try container.decode(Bool.self, forKey: .selected) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(selected, forKey: .selected) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: State - Used By: Feedback - */ - class State: Codable { - - public var active: Bool? - - public var approve: Bool? - - public var autoDecided: Bool? - - public var status: Int? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case approve = "approve" - - case autoDecided = "auto_decided" - - case status = "status" - - } - - public init(active: Bool?, approve: Bool?, autoDecided: Bool?, status: Int?) { - - self.active = active - - self.approve = approve - - self.autoDecided = autoDecided - - self.status = status - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - approve = try container.decode(Bool.self, forKey: .approve) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - autoDecided = try container.decode(Bool.self, forKey: .autoDecided) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(Int.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(approve, forKey: .approve) - - - - try? container.encodeIfPresent(autoDecided, forKey: .autoDecided) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - } - - } - - /* - Model: TagMeta - Used By: Feedback - */ - class TagMeta: Codable { - - public var media: [MediaMeta]? - - public var name: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case media = "media" - - case name = "name" - - case type = "type" - - } - - public init(media: [MediaMeta]?, name: String?, type: String?) { - - self.media = media - - self.name = name - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - media = try container.decode([MediaMeta].self, forKey: .media) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(media, forKey: .media) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: Template - Used By: Feedback - */ - class Template: Codable { - - public var dateMeta: DateMeta? - - public var entity: Entity? - - public var id: String? - - public var name: String? - - public var rating: Rating? - - public var review: TemplateReview? - - public var state: FeedbackState? - - - public enum CodingKeys: String, CodingKey { - - case dateMeta = "date_meta" - - case entity = "entity" - - case id = "id" - - case name = "name" - - case rating = "rating" - - case review = "review" - - case state = "state" - - } - - public init(dateMeta: DateMeta?, entity: Entity?, id: String?, name: String?, rating: Rating?, review: TemplateReview?, state: FeedbackState?) { - - self.dateMeta = dateMeta - - self.entity = entity - - self.id = id - - self.name = name - - self.rating = rating - - self.review = review - - self.state = state - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entity = try container.decode(Entity.self, forKey: .entity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rating = try container.decode(Rating.self, forKey: .rating) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - review = try container.decode(TemplateReview.self, forKey: .review) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(FeedbackState.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(entity, forKey: .entity) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(rating, forKey: .rating) - - - - try? container.encodeIfPresent(review, forKey: .review) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - } - - } - - /* - Model: TemplateGetResponse - Used By: Feedback - */ - class TemplateGetResponse: Codable { - - public var items: [Template]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [Template]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Template].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: TemplateReview - Used By: Feedback - */ - class TemplateReview: Codable { - - public var description: String? - - public var header: String? - - public var imageMeta: ReviewMediaMeta? - - public var title: String? - - public var videoMeta: ReviewMediaMeta? - - public var voteAllowed: Bool? - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case header = "header" - - case imageMeta = "image_meta" - - case title = "title" - - case videoMeta = "video_meta" - - case voteAllowed = "vote_allowed" - - } - - public init(description: String?, header: String?, imageMeta: ReviewMediaMeta?, title: String?, videoMeta: ReviewMediaMeta?, voteAllowed: Bool?) { - - self.description = description - - self.header = header - - self.imageMeta = imageMeta - - self.title = title - - self.videoMeta = videoMeta - - self.voteAllowed = voteAllowed - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - header = try container.decode(String.self, forKey: .header) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - imageMeta = try container.decode(ReviewMediaMeta.self, forKey: .imageMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - videoMeta = try container.decode(ReviewMediaMeta.self, forKey: .videoMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - voteAllowed = try container.decode(Bool.self, forKey: .voteAllowed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(header, forKey: .header) - - - - try? container.encodeIfPresent(imageMeta, forKey: .imageMeta) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(videoMeta, forKey: .videoMeta) - - - - try? container.encodeIfPresent(voteAllowed, forKey: .voteAllowed) - - - } - - } - - /* - Model: TextDetector - Used By: Feedback - */ - class TextDetector: Codable { - - public var confidence: Double? - - public var text: String? - - public var textClass: String? - - public var textType: String? - - - public enum CodingKeys: String, CodingKey { - - case confidence = "confidence" - - case text = "text" - - case textClass = "text_class" - - case textType = "text_type" - - } - - public init(confidence: Double?, text: String?, textClass: String?, textType: String?) { - - self.confidence = confidence - - self.text = text - - self.textClass = textClass - - self.textType = textType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - confidence = try container.decode(Double.self, forKey: .confidence) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text = try container.decode(String.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - textClass = try container.decode(String.self, forKey: .textClass) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - textType = try container.decode(String.self, forKey: .textType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(confidence, forKey: .confidence) - - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(textClass, forKey: .textClass) - - - - try? container.encodeIfPresent(textType, forKey: .textType) - - - } - - } - - /* - Model: UI - Used By: Feedback - */ - class UI: Codable { - - public var feedbackQuestion: [String]? - - public var icon: UIIcon? - - public var text: [String]? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case feedbackQuestion = "feedback_question" - - case icon = "icon" - - case text = "text" - - case type = "type" - - } - - public init(feedbackQuestion: [String]?, icon: UIIcon?, text: [String]?, type: String?) { - - self.feedbackQuestion = feedbackQuestion - - self.icon = icon - - self.text = text - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - feedbackQuestion = try container.decode([String].self, forKey: .feedbackQuestion) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(UIIcon.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text = try container.decode([String].self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(feedbackQuestion, forKey: .feedbackQuestion) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: UIIcon - Used By: Feedback - */ - class UIIcon: Codable { - - public var active: String? - - public var inactive: String? - - public var selected: [String]? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case inactive = "inactive" - - case selected = "selected" - - } - - public init(active: String?, inactive: String?, selected: [String]?) { - - self.active = active - - self.inactive = inactive - - self.selected = selected - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(String.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - inactive = try container.decode(String.self, forKey: .inactive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - selected = try container.decode([String].self, forKey: .selected) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(inactive, forKey: .inactive) - - - - try? container.encodeIfPresent(selected, forKey: .selected) - - - } - - } - - /* - Model: UpdateAbuseStatusRequest - Used By: Feedback - */ - class UpdateAbuseStatusRequest: Codable { - - public var abusive: Bool? - - public var active: Bool? - - public var approve: Bool? - - public var description: String? - - public var entityId: String? - - public var entityType: String? - - public var id: String? - - - public enum CodingKeys: String, CodingKey { - - case abusive = "abusive" - - case active = "active" - - case approve = "approve" - - case description = "description" - - case entityId = "entity_id" - - case entityType = "entity_type" - - case id = "id" - - } - - public init(abusive: Bool?, active: Bool?, approve: Bool?, description: String?, entityId: String?, entityType: String?, id: String?) { - - self.abusive = abusive - - self.active = active - - self.approve = approve - - self.description = description - - self.entityId = entityId - - self.entityType = entityType - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - abusive = try container.decode(Bool.self, forKey: .abusive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - approve = try container.decode(Bool.self, forKey: .approve) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entityId = try container.decode(String.self, forKey: .entityId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entityType = try container.decode(String.self, forKey: .entityType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(abusive, forKey: .abusive) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(approve, forKey: .approve) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(entityId, forKey: .entityId) - - - - try? container.encodeIfPresent(entityType, forKey: .entityType) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: UpdateAttributeRequest - Used By: Feedback - */ - class UpdateAttributeRequest: Codable { - - public var description: String? - - public var name: String - - public var slug: String? - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case name = "name" - - case slug = "slug" - - } - - public init(description: String?, name: String, slug: String?) { - - self.description = description - - self.name = name - - self.slug = slug - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - } - - } - - /* - Model: UpdateCommentRequest - Used By: Feedback - */ - class UpdateCommentRequest: Codable { - - public var active: Bool? - - public var approve: Bool? - - public var comment: [String] - - public var id: String - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case approve = "approve" - - case comment = "comment" - - case id = "id" - - } - - public init(active: Bool?, approve: Bool?, comment: [String], id: String) { - - self.active = active - - self.approve = approve - - self.comment = comment - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - approve = try container.decode(Bool.self, forKey: .approve) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - comment = try container.decode([String].self, forKey: .comment) - - - - - id = try container.decode(String.self, forKey: .id) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(approve, forKey: .approve) - - - - try? container.encodeIfPresent(comment, forKey: .comment) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: UpdateMediaListRequest - Used By: Feedback - */ - class UpdateMediaListRequest: Codable { - - public var approve: Bool? - - public var archive: Bool? - - public var entityType: String? - - public var ids: [String]? - - - public enum CodingKeys: String, CodingKey { - - case approve = "approve" - - case archive = "archive" - - case entityType = "entity_type" - - case ids = "ids" - - } - - public init(approve: Bool?, archive: Bool?, entityType: String?, ids: [String]?) { - - self.approve = approve - - self.archive = archive - - self.entityType = entityType - - self.ids = ids - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - approve = try container.decode(Bool.self, forKey: .approve) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archive = try container.decode(Bool.self, forKey: .archive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entityType = try container.decode(String.self, forKey: .entityType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ids = try container.decode([String].self, forKey: .ids) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(approve, forKey: .approve) - - - - try? container.encodeIfPresent(archive, forKey: .archive) - - - - try? container.encodeIfPresent(entityType, forKey: .entityType) - - - - try? container.encodeIfPresent(ids, forKey: .ids) - - - } - - } - - /* - Model: UpdateQNARequest - Used By: Feedback - */ - class UpdateQNARequest: Codable { - - public var active: Bool? - - public var approve: Bool? - - public var choices: [String]? - - public var id: String? - - public var tags: [String]? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case approve = "approve" - - case choices = "choices" - - case id = "id" - - case tags = "tags" - - } - - public init(active: Bool?, approve: Bool?, choices: [String]?, id: String?, tags: [String]?) { - - self.active = active - - self.approve = approve - - self.choices = choices - - self.id = id - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - approve = try container.decode(Bool.self, forKey: .approve) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - choices = try container.decode([String].self, forKey: .choices) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(approve, forKey: .approve) - - - - try? container.encodeIfPresent(choices, forKey: .choices) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: UpdateResponse - Used By: Feedback - */ - class UpdateResponse: Codable { - - public var id: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - } - - public init(id: String?) { - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: UpdateReviewRequest - Used By: Feedback - */ - class UpdateReviewRequest: Codable { - - public var active: Bool? - - public var application: String? - - public var approve: Bool? - - public var archive: Bool? - - public var attributesRating: [AttributeObject]? - - public var description: String? - - public var deviceMeta: DeviceMeta? - - public var entityId: String? - - public var entityType: String? - - public var mediaResource: [MediaMeta]? - - public var rating: Double? - - public var reviewId: String? - - public var templateId: String? - - public var title: String? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case application = "application" - - case approve = "approve" - - case archive = "archive" - - case attributesRating = "attributes_rating" - - case description = "description" - - case deviceMeta = "device_meta" - - case entityId = "entity_id" - - case entityType = "entity_type" - - case mediaResource = "media_resource" - - case rating = "rating" - - case reviewId = "review_id" - - case templateId = "template_id" - - case title = "title" - - } - - public init(active: Bool?, application: String?, approve: Bool?, archive: Bool?, attributesRating: [AttributeObject]?, description: String?, deviceMeta: DeviceMeta?, entityId: String?, entityType: String?, mediaResource: [MediaMeta]?, rating: Double?, reviewId: String?, templateId: String?, title: String?) { - - self.active = active - - self.application = application - - self.approve = approve - - self.archive = archive - - self.attributesRating = attributesRating - - self.description = description - - self.deviceMeta = deviceMeta - - self.entityId = entityId - - self.entityType = entityType - - self.mediaResource = mediaResource - - self.rating = rating - - self.reviewId = reviewId - - self.templateId = templateId - - self.title = title - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - approve = try container.decode(Bool.self, forKey: .approve) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archive = try container.decode(Bool.self, forKey: .archive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attributesRating = try container.decode([AttributeObject].self, forKey: .attributesRating) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deviceMeta = try container.decode(DeviceMeta.self, forKey: .deviceMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entityId = try container.decode(String.self, forKey: .entityId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entityType = try container.decode(String.self, forKey: .entityType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mediaResource = try container.decode([MediaMeta].self, forKey: .mediaResource) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rating = try container.decode(Double.self, forKey: .rating) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - reviewId = try container.decode(String.self, forKey: .reviewId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - templateId = try container.decode(String.self, forKey: .templateId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(approve, forKey: .approve) - - - - try? container.encodeIfPresent(archive, forKey: .archive) - - - - try? container.encodeIfPresent(attributesRating, forKey: .attributesRating) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(deviceMeta, forKey: .deviceMeta) - - - - try? container.encodeIfPresent(entityId, forKey: .entityId) - - - - try? container.encodeIfPresent(entityType, forKey: .entityType) - - - - try? container.encodeIfPresent(mediaResource, forKey: .mediaResource) - - - - try? container.encodeIfPresent(rating, forKey: .rating) - - - - try? container.encodeIfPresent(reviewId, forKey: .reviewId) - - - - try? container.encodeIfPresent(templateId, forKey: .templateId) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - } - - } - - /* - Model: UpdateVoteRequest - Used By: Feedback - */ - class UpdateVoteRequest: Codable { - - public var action: String? - - public var active: Bool? - - public var id: String? - - public var refId: String? - - public var refType: String? - - - public enum CodingKeys: String, CodingKey { - - case action = "action" - - case active = "active" - - case id = "id" - - case refId = "ref_id" - - case refType = "ref_type" - - } - - public init(action: String?, active: Bool?, id: String?, refId: String?, refType: String?) { - - self.action = action - - self.active = active - - self.id = id - - self.refId = refId - - self.refType = refType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - action = try container.decode(String.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refId = try container.decode(String.self, forKey: .refId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refType = try container.decode(String.self, forKey: .refType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(refId, forKey: .refId) - - - - try? container.encodeIfPresent(refType, forKey: .refType) - - - } - - } - - /* - Model: Url - Used By: Feedback - */ - class Url: Codable { - - public var main: String? - - public var thumbnail: String? - - - public enum CodingKeys: String, CodingKey { - - case main = "main" - - case thumbnail = "thumbnail" - - } - - public init(main: String?, thumbnail: String?) { - - self.main = main - - self.thumbnail = thumbnail - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - main = try container.decode(String.self, forKey: .main) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - thumbnail = try container.decode(String.self, forKey: .thumbnail) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(main, forKey: .main) - - - - try? container.encodeIfPresent(thumbnail, forKey: .thumbnail) - - - } - - } - - /* - Model: Vote - Used By: Feedback - */ - class Vote: Codable { - - public var action: String? - - public var dateMeta: DateMeta? - - public var entity: Entity? - - public var id: String? - - public var name: String? - - public var reference: Entity? - - public var state: FeedbackState? - - public var tags: [TagMeta]? - - - public enum CodingKeys: String, CodingKey { - - case action = "action" - - case dateMeta = "date_meta" - - case entity = "entity" - - case id = "id" - - case name = "name" - - case reference = "reference" - - case state = "state" - - case tags = "tags" - - } - - public init(action: String?, dateMeta: DateMeta?, entity: Entity?, id: String?, name: String?, reference: Entity?, state: FeedbackState?, tags: [TagMeta]?) { - - self.action = action - - self.dateMeta = dateMeta - - self.entity = entity - - self.id = id - - self.name = name - - self.reference = reference - - self.state = state - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - action = try container.decode(String.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entity = try container.decode(Entity.self, forKey: .entity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - reference = try container.decode(Entity.self, forKey: .reference) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(FeedbackState.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([TagMeta].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(entity, forKey: .entity) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(reference, forKey: .reference) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: VoteCount - Used By: Feedback - */ - class VoteCount: Codable { - - public var downvote: Int? - - public var upvote: Int? - - - public enum CodingKeys: String, CodingKey { - - case downvote = "downvote" - - case upvote = "upvote" - - } - - public init(downvote: Int?, upvote: Int?) { - - self.downvote = downvote - - self.upvote = upvote - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - downvote = try container.decode(Int.self, forKey: .downvote) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - upvote = try container.decode(Int.self, forKey: .upvote) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(downvote, forKey: .downvote) - - - - try? container.encodeIfPresent(upvote, forKey: .upvote) - - - } - - } - - /* - Model: VoteRequest - Used By: Feedback - */ - class VoteRequest: Codable { - - public var action: String? - - public var entityId: String? - - public var entityType: String? - - public var refId: String? - - public var refType: String? - - - public enum CodingKeys: String, CodingKey { - - case action = "action" - - case entityId = "entity_id" - - case entityType = "entity_type" - - case refId = "ref_id" - - case refType = "ref_type" - - } - - public init(action: String?, entityId: String?, entityType: String?, refId: String?, refType: String?) { - - self.action = action - - self.entityId = entityId - - self.entityType = entityType - - self.refId = refId - - self.refType = refType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - action = try container.decode(String.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entityId = try container.decode(String.self, forKey: .entityId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entityType = try container.decode(String.self, forKey: .entityType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refId = try container.decode(String.self, forKey: .refId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refType = try container.decode(String.self, forKey: .refType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(entityId, forKey: .entityId) - - - - try? container.encodeIfPresent(entityType, forKey: .entityType) - - - - try? container.encodeIfPresent(refId, forKey: .refId) - - - - try? container.encodeIfPresent(refType, forKey: .refType) - - - } - - } - - /* - Model: VoteResponse - Used By: Feedback - */ - class VoteResponse: Codable { - - public var items: [Vote]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [Vote]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Vote].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - - - /* - Model: UpdateCartShipmentItem - Used By: PosCart - */ - class UpdateCartShipmentItem: Codable { - - public var quantity: Int? - - public var shipmentType: String - - public var articleUid: String - - - public enum CodingKeys: String, CodingKey { - - case quantity = "quantity" - - case shipmentType = "shipment_type" - - case articleUid = "article_uid" - - } - - public init(articleUid: String, quantity: Int?, shipmentType: String) { - - self.quantity = quantity - - self.shipmentType = shipmentType - - self.articleUid = articleUid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - shipmentType = try container.decode(String.self, forKey: .shipmentType) - - - - - articleUid = try container.decode(String.self, forKey: .articleUid) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - - try? container.encodeIfPresent(shipmentType, forKey: .shipmentType) - - - - try? container.encodeIfPresent(articleUid, forKey: .articleUid) - - - } - - } - - /* - Model: UpdateCartShipmentRequest - Used By: PosCart - */ - class UpdateCartShipmentRequest: Codable { - - public var shipments: [UpdateCartShipmentItem] - - - public enum CodingKeys: String, CodingKey { - - case shipments = "shipments" - - } - - public init(shipments: [UpdateCartShipmentItem]) { - - self.shipments = shipments - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - shipments = try container.decode([UpdateCartShipmentItem].self, forKey: .shipments) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(shipments, forKey: .shipments) - - - } - - } - - /* - Model: Files - Used By: PosCart - */ - class Files: Codable { - - public var values: [String] - - public var key: String - - - public enum CodingKeys: String, CodingKey { - - case values = "values" - - case key = "key" - - } - - public init(key: String, values: [String]) { - - self.values = values - - self.key = key - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - values = try container.decode([String].self, forKey: .values) - - - - - key = try container.decode(String.self, forKey: .key) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(values, forKey: .values) - - - - try? container.encodeIfPresent(key, forKey: .key) - - - } - - } - - /* - Model: CartPosCheckoutDetailRequest - Used By: PosCart - */ - class CartPosCheckoutDetailRequest: Codable { - - public var meta: [String: Any]? - - public var addressId: String? - - public var billingAddress: [String: Any]? - - public var pos: Bool? - - public var staff: StaffCheckout? - - public var deliveryAddress: [String: Any]? - - public var files: [Files]? - - public var fyndstoreEmpId: String? - - public var aggregator: String? - - public var orderType: String - - public var billingAddressId: String? - - public var callbackUrl: String? - - public var paymentMode: String - - public var extraMeta: [String: Any]? - - public var paymentIdentifier: String? - - public var paymentAutoConfirm: Bool? - - public var merchantCode: String? - - public var orderingStore: Int? - - public var pickAtStoreUid: Int? - - public var paymentParams: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case meta = "meta" - - case addressId = "address_id" - - case billingAddress = "billing_address" - - case pos = "pos" - - case staff = "staff" - - case deliveryAddress = "delivery_address" - - case files = "files" - - case fyndstoreEmpId = "fyndstore_emp_id" - - case aggregator = "aggregator" - - case orderType = "order_type" - - case billingAddressId = "billing_address_id" - - case callbackUrl = "callback_url" - - case paymentMode = "payment_mode" - - case extraMeta = "extra_meta" - - case paymentIdentifier = "payment_identifier" - - case paymentAutoConfirm = "payment_auto_confirm" - - case merchantCode = "merchant_code" - - case orderingStore = "ordering_store" - - case pickAtStoreUid = "pick_at_store_uid" - - case paymentParams = "payment_params" - - } - - public init(addressId: String?, aggregator: String?, billingAddress: [String: Any]?, billingAddressId: String?, callbackUrl: String?, deliveryAddress: [String: Any]?, extraMeta: [String: Any]?, files: [Files]?, fyndstoreEmpId: String?, merchantCode: String?, meta: [String: Any]?, orderingStore: Int?, orderType: String, paymentAutoConfirm: Bool?, paymentIdentifier: String?, paymentMode: String, paymentParams: [String: Any]?, pickAtStoreUid: Int?, pos: Bool?, staff: StaffCheckout?) { - - self.meta = meta - - self.addressId = addressId - - self.billingAddress = billingAddress - - self.pos = pos - - self.staff = staff - - self.deliveryAddress = deliveryAddress - - self.files = files - - self.fyndstoreEmpId = fyndstoreEmpId - - self.aggregator = aggregator - - self.orderType = orderType - - self.billingAddressId = billingAddressId - - self.callbackUrl = callbackUrl - - self.paymentMode = paymentMode - - self.extraMeta = extraMeta - - self.paymentIdentifier = paymentIdentifier - - self.paymentAutoConfirm = paymentAutoConfirm - - self.merchantCode = merchantCode - - self.orderingStore = orderingStore - - self.pickAtStoreUid = pickAtStoreUid - - self.paymentParams = paymentParams - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressId = try container.decode(String.self, forKey: .addressId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - billingAddress = try container.decode([String: Any].self, forKey: .billingAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pos = try container.decode(Bool.self, forKey: .pos) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - staff = try container.decode(StaffCheckout.self, forKey: .staff) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryAddress = try container.decode([String: Any].self, forKey: .deliveryAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - files = try container.decode([Files].self, forKey: .files) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fyndstoreEmpId = try container.decode(String.self, forKey: .fyndstoreEmpId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - aggregator = try container.decode(String.self, forKey: .aggregator) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - orderType = try container.decode(String.self, forKey: .orderType) - - - - - do { - billingAddressId = try container.decode(String.self, forKey: .billingAddressId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - callbackUrl = try container.decode(String.self, forKey: .callbackUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - paymentMode = try container.decode(String.self, forKey: .paymentMode) - - - - - do { - extraMeta = try container.decode([String: Any].self, forKey: .extraMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentIdentifier = try container.decode(String.self, forKey: .paymentIdentifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentAutoConfirm = try container.decode(Bool.self, forKey: .paymentAutoConfirm) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - merchantCode = try container.decode(String.self, forKey: .merchantCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderingStore = try container.decode(Int.self, forKey: .orderingStore) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pickAtStoreUid = try container.decode(Int.self, forKey: .pickAtStoreUid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentParams = try container.decode([String: Any].self, forKey: .paymentParams) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(addressId, forKey: .addressId) - - - - try? container.encodeIfPresent(billingAddress, forKey: .billingAddress) - - - - try? container.encodeIfPresent(pos, forKey: .pos) - - - - try? container.encodeIfPresent(staff, forKey: .staff) - - - - try? container.encodeIfPresent(deliveryAddress, forKey: .deliveryAddress) - - - - try? container.encodeIfPresent(files, forKey: .files) - - - - try? container.encodeIfPresent(fyndstoreEmpId, forKey: .fyndstoreEmpId) - - - - try? container.encodeIfPresent(aggregator, forKey: .aggregator) - - - - try? container.encodeIfPresent(orderType, forKey: .orderType) - - - - try? container.encodeIfPresent(billingAddressId, forKey: .billingAddressId) - - - - try? container.encodeIfPresent(callbackUrl, forKey: .callbackUrl) - - - - try? container.encodeIfPresent(paymentMode, forKey: .paymentMode) - - - - try? container.encodeIfPresent(extraMeta, forKey: .extraMeta) - - - - try? container.encodeIfPresent(paymentIdentifier, forKey: .paymentIdentifier) - - - - try? container.encodeIfPresent(paymentAutoConfirm, forKey: .paymentAutoConfirm) - - - - try? container.encodeIfPresent(merchantCode, forKey: .merchantCode) - - - - try? container.encodeIfPresent(orderingStore, forKey: .orderingStore) - - - - try? container.encodeIfPresent(pickAtStoreUid, forKey: .pickAtStoreUid) - - - - try? container.encodeIfPresent(paymentParams, forKey: .paymentParams) - - - } - - } - - /* - Model: CartDeliveryModesResponse - Used By: PosCart - */ - class CartDeliveryModesResponse: Codable { - - public var pickupStores: [Int]? - - public var availableModes: [String]? - - - public enum CodingKeys: String, CodingKey { - - case pickupStores = "pickup_stores" - - case availableModes = "available_modes" - - } - - public init(availableModes: [String]?, pickupStores: [Int]?) { - - self.pickupStores = pickupStores - - self.availableModes = availableModes - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pickupStores = try container.decode([Int].self, forKey: .pickupStores) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - availableModes = try container.decode([String].self, forKey: .availableModes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pickupStores, forKey: .pickupStores) - - - - try? container.encodeIfPresent(availableModes, forKey: .availableModes) - - - } - - } - - /* - Model: PickupStoreDetail - Used By: PosCart - */ - class PickupStoreDetail: Codable { - - public var city: String? - - public var phone: String? - - public var email: String? - - public var storeCode: String? - - public var uid: Int? - - public var pincode: Int? - - public var id: Int? - - public var landmark: String? - - public var addressType: String? - - public var areaCode: String? - - public var address: String? - - public var name: String? - - public var areaCodeSlug: String? - - public var area: String? - - public var country: String? - - public var state: String? - - - public enum CodingKeys: String, CodingKey { - - case city = "city" - - case phone = "phone" - - case email = "email" - - case storeCode = "store_code" - - case uid = "uid" - - case pincode = "pincode" - - case id = "id" - - case landmark = "landmark" - - case addressType = "address_type" - - case areaCode = "area_code" - - case address = "address" - - case name = "name" - - case areaCodeSlug = "area_code_slug" - - case area = "area" - - case country = "country" - - case state = "state" - - } - - public init(address: String?, addressType: String?, area: String?, areaCode: String?, areaCodeSlug: String?, city: String?, country: String?, email: String?, id: Int?, landmark: String?, name: String?, phone: String?, pincode: Int?, state: String?, storeCode: String?, uid: Int?) { - - self.city = city - - self.phone = phone - - self.email = email - - self.storeCode = storeCode - - self.uid = uid - - self.pincode = pincode - - self.id = id - - self.landmark = landmark - - self.addressType = addressType - - self.areaCode = areaCode - - self.address = address - - self.name = name - - self.areaCodeSlug = areaCodeSlug - - self.area = area - - self.country = country - - self.state = state - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeCode = try container.decode(String.self, forKey: .storeCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(Int.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - landmark = try container.decode(String.self, forKey: .landmark) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressType = try container.decode(String.self, forKey: .addressType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - areaCode = try container.decode(String.self, forKey: .areaCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address = try container.decode(String.self, forKey: .address) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - areaCodeSlug = try container.decode(String.self, forKey: .areaCodeSlug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - area = try container.decode(String.self, forKey: .area) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(String.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(storeCode, forKey: .storeCode) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(landmark, forKey: .landmark) - - - - try? container.encodeIfPresent(addressType, forKey: .addressType) - - - - try? container.encodeIfPresent(areaCode, forKey: .areaCode) - - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(areaCodeSlug, forKey: .areaCodeSlug) - - - - try? container.encodeIfPresent(area, forKey: .area) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - } - - } - - /* - Model: StoreDetailsResponse - Used By: PosCart - */ - class StoreDetailsResponse: Codable { - - public var items: [PickupStoreDetail]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - } - - public init(items: [PickupStoreDetail]?) { - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([PickupStoreDetail].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - - - /* - Model: GetPincodeCityResponse - Used By: Logistic - */ - class GetPincodeCityResponse: Codable { - - public var requestUuid: String - - public var stormbreakerUuid: String - - public var success: Bool - - public var data: [LogisticPincodeData] - - - public enum CodingKeys: String, CodingKey { - - case requestUuid = "request_uuid" - - case stormbreakerUuid = "stormbreaker_uuid" - - case success = "success" - - case data = "data" - - } - - public init(data: [LogisticPincodeData], requestUuid: String, stormbreakerUuid: String, success: Bool) { - - self.requestUuid = requestUuid - - self.stormbreakerUuid = stormbreakerUuid - - self.success = success - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - requestUuid = try container.decode(String.self, forKey: .requestUuid) - - - - - stormbreakerUuid = try container.decode(String.self, forKey: .stormbreakerUuid) - - - - - success = try container.decode(Bool.self, forKey: .success) - - - - - data = try container.decode([LogisticPincodeData].self, forKey: .data) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(requestUuid, forKey: .requestUuid) - - - - try? container.encodeIfPresent(stormbreakerUuid, forKey: .stormbreakerUuid) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: LogisticPincodeData - Used By: Logistic - */ - class LogisticPincodeData: Codable { - - public var meta: LogisticMeta? - - public var parents: [LogisticParents]? - - public var subType: String? - - public var name: String? - - public var error: LogisticError? - - public var uid: String? - - public var displayName: String? - - - public enum CodingKeys: String, CodingKey { - - case meta = "meta" - - case parents = "parents" - - case subType = "sub_type" - - case name = "name" - - case error = "error" - - case uid = "uid" - - case displayName = "display_name" - - } - - public init(displayName: String?, error: LogisticError?, meta: LogisticMeta?, name: String?, parents: [LogisticParents]?, subType: String?, uid: String?) { - - self.meta = meta - - self.parents = parents - - self.subType = subType - - self.name = name - - self.error = error - - self.uid = uid - - self.displayName = displayName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - meta = try container.decode(LogisticMeta.self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - parents = try container.decode([LogisticParents].self, forKey: .parents) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subType = try container.decode(String.self, forKey: .subType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - error = try container.decode(LogisticError.self, forKey: .error) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(parents, forKey: .parents) - - - - try? container.encodeIfPresent(subType, forKey: .subType) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(error, forKey: .error) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - } - - } - - /* - Model: LogisticMeta - Used By: Logistic - */ - class LogisticMeta: Codable { - - public var zone: String? - - public var deliverables: [[String: Any]]? - - - public enum CodingKeys: String, CodingKey { - - case zone = "zone" - - case deliverables = "deliverables" - - } - - public init(deliverables: [[String: Any]]?, zone: String?) { - - self.zone = zone - - self.deliverables = deliverables - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - zone = try container.decode(String.self, forKey: .zone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliverables = try container.decode([[String: Any]].self, forKey: .deliverables) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(zone, forKey: .zone) - - - - try? container.encodeIfPresent(deliverables, forKey: .deliverables) - - - } - - } - - /* - Model: LogisticParents - Used By: Logistic - */ - class LogisticParents: Codable { - - public var subType: String? - - public var name: String? - - public var displayName: String? - - public var uid: String? - - - public enum CodingKeys: String, CodingKey { - - case subType = "sub_type" - - case name = "name" - - case displayName = "display_name" - - case uid = "uid" - - } - - public init(displayName: String?, name: String?, subType: String?, uid: String?) { - - self.subType = subType - - self.name = name - - self.displayName = displayName - - self.uid = uid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - subType = try container.decode(String.self, forKey: .subType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(subType, forKey: .subType) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - } - - } - - /* - Model: LogisticError - Used By: Logistic - */ - class LogisticError: Codable { - - public var type: String? - - public var value: String? - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case value = "value" - - case message = "message" - - } - - public init(message: String?, type: String?, value: String?) { - - self.type = type - - self.value = value - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: GetTatProductReqBody - Used By: Logistic - */ - class GetTatProductReqBody: Codable { - - public var locationDetails: [LocationDetailsReq] - - public var toPincode: String - - public var action: String? - - - public enum CodingKeys: String, CodingKey { - - case locationDetails = "location_details" - - case toPincode = "to_pincode" - - case action = "action" - - } - - public init(action: String?, locationDetails: [LocationDetailsReq], toPincode: String) { - - self.locationDetails = locationDetails - - self.toPincode = toPincode - - self.action = action - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - locationDetails = try container.decode([LocationDetailsReq].self, forKey: .locationDetails) - - - - - toPincode = try container.decode(String.self, forKey: .toPincode) - - - - - do { - action = try container.decode(String.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(locationDetails, forKey: .locationDetails) - - - - try? container.encodeIfPresent(toPincode, forKey: .toPincode) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - } - - } - - /* - Model: LocationDetailsReq - Used By: Logistic - */ - class LocationDetailsReq: Codable { - - public var fromPincode: String? - - public var articles: [TatReqProductArticles]? - - public var fulfillmentId: Int? - - - public enum CodingKeys: String, CodingKey { - - case fromPincode = "from_pincode" - - case articles = "articles" - - case fulfillmentId = "fulfillment_id" - - } - - public init(articles: [TatReqProductArticles]?, fromPincode: String?, fulfillmentId: Int?) { - - self.fromPincode = fromPincode - - self.articles = articles - - self.fulfillmentId = fulfillmentId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - fromPincode = try container.decode(String.self, forKey: .fromPincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - articles = try container.decode([TatReqProductArticles].self, forKey: .articles) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fulfillmentId = try container.decode(Int.self, forKey: .fulfillmentId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(fromPincode, forKey: .fromPincode) - - - - try? container.encodeIfPresent(articles, forKey: .articles) - - - - try? container.encodeIfPresent(fulfillmentId, forKey: .fulfillmentId) - - - } - - } - - /* - Model: TatReqProductArticles - Used By: Logistic - */ - class TatReqProductArticles: Codable { - - public var category: LogisticRequestCategory? - - - public enum CodingKeys: String, CodingKey { - - case category = "category" - - } - - public init(category: LogisticRequestCategory?) { - - self.category = category - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - category = try container.decode(LogisticRequestCategory.self, forKey: .category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(category, forKey: .category) - - - } - - } - - /* - Model: LogisticRequestCategory - Used By: Logistic - */ - class LogisticRequestCategory: Codable { - - public var id: Int? - - public var level: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case level = "level" - - } - - public init(id: Int?, level: String?) { - - self.id = id - - self.level = level - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - level = try container.decode(String.self, forKey: .level) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(level, forKey: .level) - - - } - - } - - /* - Model: GetTatProductResponse - Used By: Logistic - */ - class GetTatProductResponse: Codable { - - public var locationDetails: [LocationDetails] - - public var requestUuid: String - - public var error: [String: Any] - - public var toCity: String - - public var source: String - - public var toPincode: String - - public var action: String - - public var stormbreakerUuid: String - - public var success: Bool - - public var identifier: String - - public var journey: String - - - public enum CodingKeys: String, CodingKey { - - case locationDetails = "location_details" - - case requestUuid = "request_uuid" - - case error = "error" - - case toCity = "to_city" - - case source = "source" - - case toPincode = "to_pincode" - - case action = "action" - - case stormbreakerUuid = "stormbreaker_uuid" - - case success = "success" - - case identifier = "identifier" - - case journey = "journey" - - } - - public init(action: String, error: [String: Any], identifier: String, journey: String, locationDetails: [LocationDetails], requestUuid: String, source: String, stormbreakerUuid: String, success: Bool, toCity: String, toPincode: String) { - - self.locationDetails = locationDetails - - self.requestUuid = requestUuid - - self.error = error - - self.toCity = toCity - - self.source = source - - self.toPincode = toPincode - - self.action = action - - self.stormbreakerUuid = stormbreakerUuid - - self.success = success - - self.identifier = identifier - - self.journey = journey - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - locationDetails = try container.decode([LocationDetails].self, forKey: .locationDetails) - - - - - requestUuid = try container.decode(String.self, forKey: .requestUuid) - - - - - error = try container.decode([String: Any].self, forKey: .error) - - - - - toCity = try container.decode(String.self, forKey: .toCity) - - - - - source = try container.decode(String.self, forKey: .source) - - - - - toPincode = try container.decode(String.self, forKey: .toPincode) - - - - - action = try container.decode(String.self, forKey: .action) - - - - - stormbreakerUuid = try container.decode(String.self, forKey: .stormbreakerUuid) - - - - - success = try container.decode(Bool.self, forKey: .success) - - - - - identifier = try container.decode(String.self, forKey: .identifier) - - - - - journey = try container.decode(String.self, forKey: .journey) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(locationDetails, forKey: .locationDetails) - - - - try? container.encodeIfPresent(requestUuid, forKey: .requestUuid) - - - - try? container.encodeIfPresent(error, forKey: .error) - - - - try? container.encodeIfPresent(toCity, forKey: .toCity) - - - - try? container.encodeIfPresent(source, forKey: .source) - - - - try? container.encodeIfPresent(toPincode, forKey: .toPincode) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(stormbreakerUuid, forKey: .stormbreakerUuid) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(identifier, forKey: .identifier) - - - - try? container.encodeIfPresent(journey, forKey: .journey) - - - } - - } - - /* - Model: LocationDetails - Used By: Logistic - */ - class LocationDetails: Codable { - - public var fromPincode: String? - - public var articles: [TatProductArticles]? - - public var fulfillmentId: Int? - - - public enum CodingKeys: String, CodingKey { - - case fromPincode = "from_pincode" - - case articles = "articles" - - case fulfillmentId = "fulfillment_id" - - } - - public init(articles: [TatProductArticles]?, fromPincode: String?, fulfillmentId: Int?) { - - self.fromPincode = fromPincode - - self.articles = articles - - self.fulfillmentId = fulfillmentId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - fromPincode = try container.decode(String.self, forKey: .fromPincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - articles = try container.decode([TatProductArticles].self, forKey: .articles) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fulfillmentId = try container.decode(Int.self, forKey: .fulfillmentId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(fromPincode, forKey: .fromPincode) - - - - try? container.encodeIfPresent(articles, forKey: .articles) - - - - try? container.encodeIfPresent(fulfillmentId, forKey: .fulfillmentId) - - - } - - } - - /* - Model: TatProductArticles - Used By: Logistic - */ - class TatProductArticles: Codable { - - public var error: [String: Any]? - - public var category: LogisticResponseCategory? - - public var promise: LogisticPromise? - - - public enum CodingKeys: String, CodingKey { - - case error = "error" - - case category = "category" - - case promise = "promise" - - } - - public init(category: LogisticResponseCategory?, error: [String: Any]?, promise: LogisticPromise?) { - - self.error = error - - self.category = category - - self.promise = promise - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - error = try container.decode([String: Any].self, forKey: .error) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - category = try container.decode(LogisticResponseCategory.self, forKey: .category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - promise = try container.decode(LogisticPromise.self, forKey: .promise) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(error, forKey: .error) - - - - try? container.encodeIfPresent(category, forKey: .category) - - - - try? container.encodeIfPresent(promise, forKey: .promise) - - - } - - } - - /* - Model: LogisticResponseCategory - Used By: Logistic - */ - class LogisticResponseCategory: Codable { - - public var id: Int? - - public var level: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case level = "level" - - } - - public init(id: Int?, level: String?) { - - self.id = id - - self.level = level - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - level = try container.decode(String.self, forKey: .level) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(level, forKey: .level) - - - } - - } - - /* - Model: LogisticPromise - Used By: Logistic - */ - class LogisticPromise: Codable { - - public var timestamp: LogisticTimestamp? - - public var formatted: Formatted? - - - public enum CodingKeys: String, CodingKey { - - case timestamp = "timestamp" - - case formatted = "formatted" - - } - - public init(formatted: Formatted?, timestamp: LogisticTimestamp?) { - - self.timestamp = timestamp - - self.formatted = formatted - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - timestamp = try container.decode(LogisticTimestamp.self, forKey: .timestamp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - formatted = try container.decode(Formatted.self, forKey: .formatted) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(timestamp, forKey: .timestamp) - - - - try? container.encodeIfPresent(formatted, forKey: .formatted) - - - } - - } - - /* - Model: LogisticTimestamp - Used By: Logistic - */ - class LogisticTimestamp: Codable { - - public var min: Int? - - public var max: Int? - - - public enum CodingKeys: String, CodingKey { - - case min = "min" - - case max = "max" - - } - - public init(max: Int?, min: Int?) { - - self.min = min - - self.max = max - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - min = try container.decode(Int.self, forKey: .min) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - max = try container.decode(Int.self, forKey: .max) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(min, forKey: .min) - - - - try? container.encodeIfPresent(max, forKey: .max) - - - } - - } - - /* - Model: Formatted - Used By: Logistic - */ - class Formatted: Codable { - - public var min: String? - - public var max: String? - - - public enum CodingKeys: String, CodingKey { - - case min = "min" - - case max = "max" - - } - - public init(max: String?, min: String?) { - - self.min = min - - self.max = max - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - min = try container.decode(String.self, forKey: .min) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - max = try container.decode(String.self, forKey: .max) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(min, forKey: .min) - - - - try? container.encodeIfPresent(max, forKey: .max) - - - } - - } - - - } \ No newline at end of file diff --git a/Sources/code/application/ApplicationModelsExtenstions.swift b/Sources/code/application/ApplicationModelsExtenstions.swift new file mode 100644 index 0000000000..d567f81326 --- /dev/null +++ b/Sources/code/application/ApplicationModelsExtenstions.swift @@ -0,0 +1,103 @@ +import Foundation +#if canImport(FoundationNetworking) + import FoundationNetworking +#endif + +public extension ApplicationClient.ActionPage { + static func convertURLToAction(urlString: String) -> ApplicationClient.ActionPage? { + ApplicationClient.ActionPage(urlString: urlString) + } + + convenience init?(urlString: String) { + let url = urlString + var query: [String: [String]] = [:] + var params: [String: [String]] = [:] + var urlComp = URLComponents(string: urlString) + if urlComp?.scheme == nil { + urlComp = URLComponents(string: "https://\(urlString)") + } + guard let urlComponents = urlComp else { return nil } + guard let type = ApplicationClient.PageType(path: urlComponents.percentEncodedPath) else { return nil } + for item in urlComponents.queryItems ?? [] { + if let queryValue = item.value { + if var list = query[item.name] { + list.append(queryValue) + query[item.name] = list + } else { + query[item.name] = [queryValue] + } + } + } + for param in type.queryParams { + if param.required, query[param.name] == nil { + return nil + } + } + let components = urlComponents.percentEncodedPath.components(separatedBy: "/").map { $0.removingPercentEncoding ?? $0 } + let symbolic = URLComponents(string: type.link)?.percentEncodedPath.components(separatedBy: "/") ?? [] + for paramSpec in type.pathParams { + if let i = symbolic.firstIndex(of: ":\(paramSpec.name)") { + let index = Int(i) + if let value = components.getIfExists(index: index) { + let splitVal = value.components(separatedBy: ":::") + if splitVal.count > 1 { + params[paramSpec.name] = splitVal + } else { + params[paramSpec.name] = [value] + } + } else if paramSpec.required { + return nil + } + } else if paramSpec.required { + return nil + } + } + self.init(params: params, query: query, type: type, url: url) + } + + func getURL() -> String? { + var urlParts = type.link.components(separatedBy: "/") + for paramSpec in type.pathParams { + if let index = urlParts.firstIndex(of: ":\(paramSpec.name)") { + if let value = self.params?[paramSpec.name] { + if value.isEmpty { + return nil + } else if value.count == 1 { + urlParts[index] = value[0].addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? value[0] + } else { + urlParts[index] = value + .map { $0.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? $0 } + .joined(separator: ":::") + } + } else if paramSpec.required { + return nil + } else { + urlParts.remove(at: index) + } + } else if paramSpec.required { + return nil + } + } + for q in type.queryParams { + if q.required { + if let value = self.query?[q.name], + value.isEmpty + { + return nil + } else if self.query?[q.name] == nil { + return nil + } + } + } + var queryString: String? + for (key, value) in self.query ?? [:] { + var text = "" + for val in value { + text += "\(key)=\(val.addingPercentEncoding(withAllowedCharacters: .afURLQueryAllowed) ?? "")&" + } + queryString = (queryString ?? "?") + text + } + let finalUrl = urlParts.joined(separator: "/") + (queryString?.dropLast() ?? "") + return finalUrl + } +} diff --git a/Sources/code/application/ApplicationPageType.swift b/Sources/code/application/ApplicationPageType.swift new file mode 100644 index 0000000000..0d375db645 --- /dev/null +++ b/Sources/code/application/ApplicationPageType.swift @@ -0,0 +1,446 @@ +import Foundation +public extension ApplicationClient { + enum PageType: String, Codable, CaseIterable { + case aboutUs = "about-us" + case addresses + case blog + case brands + case cards + case cart + case categories + case brand + case category + case collection + case collections + case contactUs = "contact-us" + case external + case faq + case freshchat + case home + case notificationSettings = "notification-settings" + case orders + case page + case policy + case product + case productReviews = "product-reviews" + case addProductReview = "add-product-review" + case productRequest = "product-request" + case products + case profile + case profileBasic = "profile-basic" + case profileCompany = "profile-company" + case profileEmails = "profile-emails" + case profilePhones = "profile-phones" + case rateUs = "rate-us" + case referEarn = "refer-earn" + case settings + case sharedCart = "shared-cart" + case tnc + case trackOrder = "track-order" + case wishlist + case sections + case form + case cartDelivery = "cart-delivery" + case cartPayment = "cart-payment" + case cartReview = "cart-review" + + init?(path: String) { + let slash = CharacterSet(charactersIn: "/") + let path = path.trimmingCharacters(in: slash) + var allPossible: [(type: PageType, link: String)] = [] + for type in PageType.allCases { + allPossible.append((type: type, link: type.link.trimmingCharacters(in: slash))) + var possibleLink = type.link + for params in type.pathParams where !params.required { + possibleLink = possibleLink.replacingOccurrences(of: ":\(params.name)", with: "") + } + possibleLink = possibleLink.replacingOccurrences(of: "//", with: "/") + allPossible.append((type: type, link: possibleLink.trimmingCharacters(in: slash))) + } + allPossible = allPossible.sorted { $0.link.count > $1.link.count } + var match = allPossible.first(where: { $0.link == path }) + for possible in allPossible { + if match != nil { + break + } + let pathComp = path.split(separator: "/") + let typeComp = possible.link.split(separator: "/") + if pathComp.count == typeComp.count { + var paramsCount = 0 + var matchCount = 0 + for i in 0 ..< pathComp.count { + if typeComp[i].starts(with: ":") { + paramsCount += 1 + } else if typeComp[i] == pathComp[i] { + matchCount += 1 + } + } + if paramsCount + matchCount == pathComp.count { + match = possible + } + } + } + if let bestMatch = match { + self = bestMatch.type + } else { + return nil + } + } + + public var link: String { + switch self { + case .aboutUs: + return "/about-us" + case .addresses: + return "/profile/address" + case .blog: + return "/blog/:slug" + case .brands: + return "/brands/:department" + case .cards: + return "/profile/my-cards" + case .cart: + return "/cart/bag/" + case .categories: + return "/categories/:department" + case .brand: + return "/brand/:slug" + case .category: + return "/category/:slug" + case .collection: + return "/collection/:slug" + case .collections: + return "/collections/" + case .contactUs: + return "/contact-us/" + case .external: + return "/external/:url" + case .faq: + return "/faq/:category" + case .freshchat: + return "/freshchat" + case .home: + return "/" + case .notificationSettings: + return "/notification-settings" + case .orders: + return "/profile/orders" + case .page: + return "/page/:slug" + case .policy: + return "/privacy-policy" + case .product: + return "/product/:slug" + case .productReviews: + return "/product/:slug/reviews" + case .addProductReview: + return "/product/:slug/add-review" + case .productRequest: + return "/product-request/" + case .products: + return "/products/" + case .profile: + return "/profile" + case .profileBasic: + return "/profile/details" + case .profileCompany: + return "/profile/company" + case .profileEmails: + return "/profile/email" + case .profilePhones: + return "/profile/phone" + case .rateUs: + return "/rate-us" + case .referEarn: + return "/profile/refer-earn" + case .settings: + return "/setting/currency" + case .sharedCart: + return "/shared-cart/:token" + case .tnc: + return "/terms-and-conditions" + case .trackOrder: + return "/order-tracking/:orderId" + case .wishlist: + return "/wishlist/" + case .sections: + return "/sections/:group" + case .form: + return "/form/:slug" + case .cartDelivery: + return "/cart/delivery" + case .cartPayment: + return "/cart/payment-info" + case .cartReview: + return "/cart/order-review" + } + } + + public var name: String { + switch self { + case .aboutUs: + return "About Us" + case .addresses: + return "Saved Addresses" + case .blog: + return "Blog" + case .brands: + return "Brands" + case .cards: + return "Saved Cards" + case .cart: + return "Cart" + case .categories: + return "Categories" + case .brand: + return "Brand" + case .category: + return "Category" + case .collection: + return "Collection" + case .collections: + return "Collections" + case .contactUs: + return "Contact Us" + case .external: + return "External Link" + case .faq: + return "FAQ" + case .freshchat: + return "Chat by Freshchat" + case .home: + return "Home" + case .notificationSettings: + return "Notification Settings" + case .orders: + return "Orders" + case .page: + return "Page" + case .policy: + return "Privacy Policy" + case .product: + return "Product" + case .productReviews: + return "Product Reviews" + case .addProductReview: + return "Add Product review" + case .productRequest: + return "Product Request" + case .products: + return "Products" + case .profile: + return "Profile" + case .profileBasic: + return "Basic Profile" + case .profileCompany: + return "Profile Company" + case .profileEmails: + return "Profile Emails" + case .profilePhones: + return "Profile Phones" + case .rateUs: + return "Rate Us" + case .referEarn: + return "Refer & Earn" + case .settings: + return "Settings" + case .sharedCart: + return "Shared Cart" + case .tnc: + return "Terms and Conditions" + case .trackOrder: + return "Track Order" + case .wishlist: + return "Wishlist" + case .sections: + return "Sections" + case .form: + return "Form" + case .cartDelivery: + return "Cart Delivery" + case .cartPayment: + return "Cart Payment Information" + case .cartReview: + return "Cart Order Review" + } + } + + public var pathParams: [(name: String, required: Bool)] { + switch self { + case .aboutUs: + return [] + case .addresses: + return [] + case .blog: + return [(name: "slug", required: false)] + case .brands: + return [(name: "department", required: false)] + case .cards: + return [] + case .cart: + return [] + case .categories: + return [(name: "department", required: false)] + case .brand: + return [(name: "slug", required: true)] + case .category: + return [(name: "slug", required: true)] + case .collection: + return [(name: "slug", required: true)] + case .collections: + return [] + case .contactUs: + return [] + case .external: + return [] + case .faq: + return [(name: "category", required: false)] + case .freshchat: + return [] + case .home: + return [] + case .notificationSettings: + return [] + case .orders: + return [] + case .page: + return [(name: "slug", required: true)] + case .policy: + return [] + case .product: + return [(name: "slug", required: true)] + case .productReviews: + return [(name: "slug", required: true)] + case .addProductReview: + return [(name: "slug", required: true)] + case .productRequest: + return [] + case .products: + return [] + case .profile: + return [] + case .profileBasic: + return [] + case .profileCompany: + return [] + case .profileEmails: + return [] + case .profilePhones: + return [] + case .rateUs: + return [] + case .referEarn: + return [] + case .settings: + return [] + case .sharedCart: + return [(name: "token", required: true)] + case .tnc: + return [] + case .trackOrder: + return [(name: "orderId", required: false)] + case .wishlist: + return [] + case .sections: + return [(name: "group", required: true)] + case .form: + return [(name: "slug", required: true)] + case .cartDelivery: + return [] + case .cartPayment: + return [] + case .cartReview: + return [] + } + } + + public var queryParams: [(name: String, required: Bool)] { + switch self { + case .aboutUs: + return [] + case .addresses: + return [] + case .blog: + return [] + case .brands: + return [] + case .cards: + return [] + case .cart: + return [] + case .categories: + return [] + case .brand: + return [] + case .category: + return [] + case .collection: + return [] + case .collections: + return [] + case .contactUs: + return [] + case .external: + return [(name: "url", required: true)] + case .faq: + return [] + case .freshchat: + return [] + case .home: + return [] + case .notificationSettings: + return [] + case .orders: + return [] + case .page: + return [] + case .policy: + return [] + case .product: + return [] + case .productReviews: + return [] + case .addProductReview: + return [] + case .productRequest: + return [] + case .products: + return [] + case .profile: + return [] + case .profileBasic: + return [] + case .profileCompany: + return [] + case .profileEmails: + return [] + case .profilePhones: + return [] + case .rateUs: + return [] + case .referEarn: + return [] + case .settings: + return [] + case .sharedCart: + return [] + case .tnc: + return [] + case .trackOrder: + return [] + case .wishlist: + return [] + case .sections: + return [] + case .form: + return [] + case .cartDelivery: + return [] + case .cartPayment: + return [] + case .cartReview: + return [] + } + } + } +} diff --git a/Sources/code/application/FileStorage.swift b/Sources/code/application/FileStorage.swift index 322776ecf6..b65ebe5552 100644 --- a/Sources/code/application/FileStorage.swift +++ b/Sources/code/application/FileStorage.swift @@ -3,14 +3,14 @@ import Foundation public extension ApplicationClient.FileStorage { func upload(data: Data, withFileName fileName: String, as contentType: String, toNameSpace namespace: String, onResponse: @escaping (_ response: ApplicationClient.CompleteResponse?, _ error: FDKError?) -> Void) { - startUpload(namespace: namespace, body: ApplicationClient.StartRequest(contentType: contentType, fileName: fileName, params: nil, size: data.count, tags: nil)) { (startResponse, error) in + startUpload(namespace: namespace, body: ApplicationClient.StartRequest(contentType: contentType, fileName: fileName, params: nil, size: data.count, tags: nil)) { startResponse, error in guard let startResponse = startResponse else { return onResponse(nil, error) } - AF.upload(data, to: startResponse.upload.url, method: .put, headers: ["Content-Type": contentType]).validate(statusCode: [200]).response { (response) in + AF.upload(data, to: startResponse.upload.url, method: .put, headers: ["Content-Type": contentType]).validate(statusCode: [200]).response { response in switch response.result { - case .success(_): - self.completeUpload(namespace: namespace, body: startResponse) { (completeResponse, error) in + case .success: + self.completeUpload(namespace: namespace, body: startResponse) { completeResponse, error in onResponse(completeResponse, error) } case .failure(let error): @@ -19,7 +19,7 @@ public extension ApplicationClient.FileStorage { } } } - + // func upload(image: UIImage, withFileName fileName: String, as contentType: String, toNameSpace namespace: String, onResponse: @escaping (_ response: ApplicationClient.CompleteResponse?, _ error: FDKError?) -> Void) { // guard let data = image.pngData() else { // return onResponse(nil, FDKError(message: "Image could not be converted to data")) diff --git a/Sources/code/application/models/CartAppModelClass.swift b/Sources/code/application/models/CartAppModelClass.swift new file mode 100644 index 0000000000..a1c01aec4c --- /dev/null +++ b/Sources/code/application/models/CartAppModelClass.swift @@ -0,0 +1,7194 @@ +import Foundation + +import Foundation +public extension ApplicationClient { + /* + Model: CartCurrency + Used By: Cart + */ + class CartCurrency: Codable { + public var code: String? + + public var symbol: String? + + public enum CodingKeys: String, CodingKey { + case code + + case symbol + } + + public init(code: String?, symbol: String?) { + self.code = code + + self.symbol = symbol + } + + public func duplicate() -> CartCurrency { + let dict = self.dictionary! + let copy = CartCurrency(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + symbol = try container.decode(String.self, forKey: .symbol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(symbol, forKey: .symbol) + } + } + + /* + Model: PaymentSelectionLock + Used By: Cart + */ + class PaymentSelectionLock: Codable { + public var defaultOptions: String? + + public var enabled: Bool? + + public var paymentIdentifier: String? + + public enum CodingKeys: String, CodingKey { + case defaultOptions = "default_options" + + case enabled + + case paymentIdentifier = "payment_identifier" + } + + public init(defaultOptions: String?, enabled: Bool?, paymentIdentifier: String?) { + self.defaultOptions = defaultOptions + + self.enabled = enabled + + self.paymentIdentifier = paymentIdentifier + } + + public func duplicate() -> PaymentSelectionLock { + let dict = self.dictionary! + let copy = PaymentSelectionLock(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + defaultOptions = try container.decode(String.self, forKey: .defaultOptions) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentIdentifier = try container.decode(String.self, forKey: .paymentIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(defaultOptions, forKey: .defaultOptions) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(paymentIdentifier, forKey: .paymentIdentifier) + } + } + + /* + Model: PromiseTimestamp + Used By: Cart + */ + class PromiseTimestamp: Codable { + public var min: Double? + + public var max: Double? + + public enum CodingKeys: String, CodingKey { + case min + + case max + } + + public init(max: Double?, min: Double?) { + self.min = min + + self.max = max + } + + public func duplicate() -> PromiseTimestamp { + let dict = self.dictionary! + let copy = PromiseTimestamp(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + min = try container.decode(Double.self, forKey: .min) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + max = try container.decode(Double.self, forKey: .max) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(min, forKey: .min) + + try? container.encodeIfPresent(max, forKey: .max) + } + } + + /* + Model: PromiseFormatted + Used By: Cart + */ + class PromiseFormatted: Codable { + public var min: String? + + public var max: String? + + public enum CodingKeys: String, CodingKey { + case min + + case max + } + + public init(max: String?, min: String?) { + self.min = min + + self.max = max + } + + public func duplicate() -> PromiseFormatted { + let dict = self.dictionary! + let copy = PromiseFormatted(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + min = try container.decode(String.self, forKey: .min) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + max = try container.decode(String.self, forKey: .max) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(min, forKey: .min) + + try? container.encodeIfPresent(max, forKey: .max) + } + } + + /* + Model: ShipmentPromise + Used By: Cart + */ + class ShipmentPromise: Codable { + public var timestamp: PromiseTimestamp? + + public var formatted: PromiseFormatted? + + public enum CodingKeys: String, CodingKey { + case timestamp + + case formatted + } + + public init(formatted: PromiseFormatted?, timestamp: PromiseTimestamp?) { + self.timestamp = timestamp + + self.formatted = formatted + } + + public func duplicate() -> ShipmentPromise { + let dict = self.dictionary! + let copy = ShipmentPromise(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + timestamp = try container.decode(PromiseTimestamp.self, forKey: .timestamp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + formatted = try container.decode(PromiseFormatted.self, forKey: .formatted) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(timestamp, forKey: .timestamp) + + try? container.encodeIfPresent(formatted, forKey: .formatted) + } + } + + /* + Model: LoyaltyPoints + Used By: Cart + */ + class LoyaltyPoints: Codable { + public var applicable: Double? + + public var isApplied: Bool? + + public var total: Double? + + public var description: String? + + public enum CodingKeys: String, CodingKey { + case applicable + + case isApplied = "is_applied" + + case total + + case description + } + + public init(applicable: Double?, description: String?, isApplied: Bool?, total: Double?) { + self.applicable = applicable + + self.isApplied = isApplied + + self.total = total + + self.description = description + } + + public func duplicate() -> LoyaltyPoints { + let dict = self.dictionary! + let copy = LoyaltyPoints(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + applicable = try container.decode(Double.self, forKey: .applicable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isApplied = try container.decode(Bool.self, forKey: .isApplied) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + total = try container.decode(Double.self, forKey: .total) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(applicable, forKey: .applicable) + + try? container.encodeIfPresent(isApplied, forKey: .isApplied) + + try? container.encodeIfPresent(total, forKey: .total) + + try? container.encodeIfPresent(description, forKey: .description) + } + } + + /* + Model: DisplayBreakup + Used By: Cart + */ + class DisplayBreakup: Codable { + public var value: Double? + + public var display: String? + + public var key: String? + + public var currencySymbol: String? + + public var currencyCode: String? + + public var message: [String]? + + public enum CodingKeys: String, CodingKey { + case value + + case display + + case key + + case currencySymbol = "currency_symbol" + + case currencyCode = "currency_code" + + case message + } + + public init(currencyCode: String?, currencySymbol: String?, display: String?, key: String?, message: [String]?, value: Double?) { + self.value = value + + self.display = display + + self.key = key + + self.currencySymbol = currencySymbol + + self.currencyCode = currencyCode + + self.message = message + } + + public func duplicate() -> DisplayBreakup { + let dict = self.dictionary! + let copy = DisplayBreakup(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + value = try container.decode(Double.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencySymbol = try container.decode(String.self, forKey: .currencySymbol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode([String].self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: RawBreakup + Used By: Cart + */ + class RawBreakup: Codable { + public var codCharge: Double? + + public var discount: Double? + + public var gstCharges: Double? + + public var convenienceFee: Double? + + public var coupon: Double? + + public var total: Double? + + public var deliveryCharge: Double? + + public var youSaved: Double? + + public var mrpTotal: Double? + + public var fyndCash: Double? + + public var subtotal: Double? + + public var vog: Double? + + public enum CodingKeys: String, CodingKey { + case codCharge = "cod_charge" + + case discount + + case gstCharges = "gst_charges" + + case convenienceFee = "convenience_fee" + + case coupon + + case total + + case deliveryCharge = "delivery_charge" + + case youSaved = "you_saved" + + case mrpTotal = "mrp_total" + + case fyndCash = "fynd_cash" + + case subtotal + + case vog + } + + public init(codCharge: Double?, convenienceFee: Double?, coupon: Double?, deliveryCharge: Double?, discount: Double?, fyndCash: Double?, gstCharges: Double?, mrpTotal: Double?, subtotal: Double?, total: Double?, vog: Double?, youSaved: Double?) { + self.codCharge = codCharge + + self.discount = discount + + self.gstCharges = gstCharges + + self.convenienceFee = convenienceFee + + self.coupon = coupon + + self.total = total + + self.deliveryCharge = deliveryCharge + + self.youSaved = youSaved + + self.mrpTotal = mrpTotal + + self.fyndCash = fyndCash + + self.subtotal = subtotal + + self.vog = vog + } + + public func duplicate() -> RawBreakup { + let dict = self.dictionary! + let copy = RawBreakup(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + codCharge = try container.decode(Double.self, forKey: .codCharge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discount = try container.decode(Double.self, forKey: .discount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstCharges = try container.decode(Double.self, forKey: .gstCharges) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + convenienceFee = try container.decode(Double.self, forKey: .convenienceFee) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + coupon = try container.decode(Double.self, forKey: .coupon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + total = try container.decode(Double.self, forKey: .total) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryCharge = try container.decode(Double.self, forKey: .deliveryCharge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + youSaved = try container.decode(Double.self, forKey: .youSaved) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mrpTotal = try container.decode(Double.self, forKey: .mrpTotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fyndCash = try container.decode(Double.self, forKey: .fyndCash) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subtotal = try container.decode(Double.self, forKey: .subtotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + vog = try container.decode(Double.self, forKey: .vog) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(codCharge, forKey: .codCharge) + + try? container.encodeIfPresent(discount, forKey: .discount) + + try? container.encodeIfPresent(gstCharges, forKey: .gstCharges) + + try? container.encodeIfPresent(convenienceFee, forKey: .convenienceFee) + + try? container.encodeIfPresent(coupon, forKey: .coupon) + + try? container.encodeIfPresent(total, forKey: .total) + + try? container.encodeIfPresent(deliveryCharge, forKey: .deliveryCharge) + + try? container.encodeIfPresent(youSaved, forKey: .youSaved) + + try? container.encodeIfPresent(mrpTotal, forKey: .mrpTotal) + + try? container.encodeIfPresent(fyndCash, forKey: .fyndCash) + + try? container.encodeIfPresent(subtotal, forKey: .subtotal) + + try? container.encodeIfPresent(vog, forKey: .vog) + } + } + + /* + Model: CouponBreakup + Used By: Cart + */ + class CouponBreakup: Codable { + public var uid: String? + + public var value: Double? + + public var code: String? + + public var isApplied: Bool? + + public var message: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case value + + case code + + case isApplied = "is_applied" + + case message + + case type + } + + public init(code: String?, isApplied: Bool?, message: String?, type: String?, uid: String?, value: Double?) { + self.uid = uid + + self.value = value + + self.code = code + + self.isApplied = isApplied + + self.message = message + + self.type = type + } + + public func duplicate() -> CouponBreakup { + let dict = self.dictionary! + let copy = CouponBreakup(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(Double.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isApplied = try container.decode(Bool.self, forKey: .isApplied) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(isApplied, forKey: .isApplied) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: CartBreakup + Used By: Cart + */ + class CartBreakup: Codable { + public var loyaltyPoints: LoyaltyPoints? + + public var display: [DisplayBreakup]? + + public var raw: RawBreakup? + + public var coupon: CouponBreakup? + + public enum CodingKeys: String, CodingKey { + case loyaltyPoints = "loyalty_points" + + case display + + case raw + + case coupon + } + + public init(coupon: CouponBreakup?, display: [DisplayBreakup]?, loyaltyPoints: LoyaltyPoints?, raw: RawBreakup?) { + self.loyaltyPoints = loyaltyPoints + + self.display = display + + self.raw = raw + + self.coupon = coupon + } + + public func duplicate() -> CartBreakup { + let dict = self.dictionary! + let copy = CartBreakup(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + loyaltyPoints = try container.decode(LoyaltyPoints.self, forKey: .loyaltyPoints) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode([DisplayBreakup].self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + raw = try container.decode(RawBreakup.self, forKey: .raw) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + coupon = try container.decode(CouponBreakup.self, forKey: .coupon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(loyaltyPoints, forKey: .loyaltyPoints) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(raw, forKey: .raw) + + try? container.encodeIfPresent(coupon, forKey: .coupon) + } + } + + /* + Model: ProductAvailability + Used By: Cart + */ + class ProductAvailability: Codable { + public var isValid: Bool? + + public var sizes: [String]? + + public var otherStoreQuantity: Int? + + public var deliverable: Bool? + + public var outOfStock: Bool? + + public enum CodingKeys: String, CodingKey { + case isValid = "is_valid" + + case sizes + + case otherStoreQuantity = "other_store_quantity" + + case deliverable + + case outOfStock = "out_of_stock" + } + + public init(deliverable: Bool?, isValid: Bool?, otherStoreQuantity: Int?, outOfStock: Bool?, sizes: [String]?) { + self.isValid = isValid + + self.sizes = sizes + + self.otherStoreQuantity = otherStoreQuantity + + self.deliverable = deliverable + + self.outOfStock = outOfStock + } + + public func duplicate() -> ProductAvailability { + let dict = self.dictionary! + let copy = ProductAvailability(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isValid = try container.decode(Bool.self, forKey: .isValid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sizes = try container.decode([String].self, forKey: .sizes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + otherStoreQuantity = try container.decode(Int.self, forKey: .otherStoreQuantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliverable = try container.decode(Bool.self, forKey: .deliverable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + outOfStock = try container.decode(Bool.self, forKey: .outOfStock) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isValid, forKey: .isValid) + + try? container.encodeIfPresent(sizes, forKey: .sizes) + + try? container.encodeIfPresent(otherStoreQuantity, forKey: .otherStoreQuantity) + + try? container.encodeIfPresent(deliverable, forKey: .deliverable) + + try? container.encodeIfPresent(outOfStock, forKey: .outOfStock) + } + } + + /* + Model: BasePrice + Used By: Cart + */ + class BasePrice: Codable { + public var currencyCode: String? + + public var effective: Double? + + public var marked: Double? + + public var currencySymbol: String? + + public enum CodingKeys: String, CodingKey { + case currencyCode = "currency_code" + + case effective + + case marked + + case currencySymbol = "currency_symbol" + } + + public init(currencyCode: String?, currencySymbol: String?, effective: Double?, marked: Double?) { + self.currencyCode = currencyCode + + self.effective = effective + + self.marked = marked + + self.currencySymbol = currencySymbol + } + + public func duplicate() -> BasePrice { + let dict = self.dictionary! + let copy = BasePrice(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + effective = try container.decode(Double.self, forKey: .effective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + marked = try container.decode(Double.self, forKey: .marked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencySymbol = try container.decode(String.self, forKey: .currencySymbol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + + try? container.encodeIfPresent(effective, forKey: .effective) + + try? container.encodeIfPresent(marked, forKey: .marked) + + try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) + } + } + + /* + Model: ArticlePriceInfo + Used By: Cart + */ + class ArticlePriceInfo: Codable { + public var converted: BasePrice? + + public var base: BasePrice? + + public enum CodingKeys: String, CodingKey { + case converted + + case base + } + + public init(base: BasePrice?, converted: BasePrice?) { + self.converted = converted + + self.base = base + } + + public func duplicate() -> ArticlePriceInfo { + let dict = self.dictionary! + let copy = ArticlePriceInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + converted = try container.decode(BasePrice.self, forKey: .converted) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + base = try container.decode(BasePrice.self, forKey: .base) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(converted, forKey: .converted) + + try? container.encodeIfPresent(base, forKey: .base) + } + } + + /* + Model: BaseInfo + Used By: Cart + */ + class BaseInfo: Codable { + public var uid: Int? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case name + } + + public init(name: String?, uid: Int?) { + self.uid = uid + + self.name = name + } + + public func duplicate() -> BaseInfo { + let dict = self.dictionary! + let copy = BaseInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: ProductArticle + Used By: Cart + */ + class ProductArticle: Codable { + public var uid: String? + + public var price: ArticlePriceInfo? + + public var extraMeta: [String: Any]? + + public var store: BaseInfo? + + public var size: String? + + public var seller: BaseInfo? + + public var quantity: Int? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case price + + case extraMeta = "extra_meta" + + case store + + case size + + case seller + + case quantity + + case type + } + + public init(extraMeta: [String: Any]?, price: ArticlePriceInfo?, quantity: Int?, seller: BaseInfo?, size: String?, store: BaseInfo?, type: String?, uid: String?) { + self.uid = uid + + self.price = price + + self.extraMeta = extraMeta + + self.store = store + + self.size = size + + self.seller = seller + + self.quantity = quantity + + self.type = type + } + + public func duplicate() -> ProductArticle { + let dict = self.dictionary! + let copy = ProductArticle(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(ArticlePriceInfo.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + extraMeta = try container.decode([String: Any].self, forKey: .extraMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + store = try container.decode(BaseInfo.self, forKey: .store) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(String.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + seller = try container.decode(BaseInfo.self, forKey: .seller) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(extraMeta, forKey: .extraMeta) + + try? container.encodeIfPresent(store, forKey: .store) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(seller, forKey: .seller) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: ProductPrice + Used By: Cart + */ + class ProductPrice: Codable { + public var selling: Double? + + public var currencySymbol: String? + + public var currencyCode: String? + + public var marked: Double? + + public var addOn: Double? + + public var effective: Double? + + public enum CodingKeys: String, CodingKey { + case selling + + case currencySymbol = "currency_symbol" + + case currencyCode = "currency_code" + + case marked + + case addOn = "add_on" + + case effective + } + + public init(addOn: Double?, currencyCode: String?, currencySymbol: String?, effective: Double?, marked: Double?, selling: Double?) { + self.selling = selling + + self.currencySymbol = currencySymbol + + self.currencyCode = currencyCode + + self.marked = marked + + self.addOn = addOn + + self.effective = effective + } + + public func duplicate() -> ProductPrice { + let dict = self.dictionary! + let copy = ProductPrice(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + selling = try container.decode(Double.self, forKey: .selling) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencySymbol = try container.decode(String.self, forKey: .currencySymbol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + marked = try container.decode(Double.self, forKey: .marked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addOn = try container.decode(Double.self, forKey: .addOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + effective = try container.decode(Double.self, forKey: .effective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(selling, forKey: .selling) + + try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + + try? container.encodeIfPresent(marked, forKey: .marked) + + try? container.encodeIfPresent(addOn, forKey: .addOn) + + try? container.encodeIfPresent(effective, forKey: .effective) + } + } + + /* + Model: ProductPriceInfo + Used By: Cart + */ + class ProductPriceInfo: Codable { + public var converted: ProductPrice? + + public var base: ProductPrice? + + public enum CodingKeys: String, CodingKey { + case converted + + case base + } + + public init(base: ProductPrice?, converted: ProductPrice?) { + self.converted = converted + + self.base = base + } + + public func duplicate() -> ProductPriceInfo { + let dict = self.dictionary! + let copy = ProductPriceInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + converted = try container.decode(ProductPrice.self, forKey: .converted) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + base = try container.decode(ProductPrice.self, forKey: .base) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(converted, forKey: .converted) + + try? container.encodeIfPresent(base, forKey: .base) + } + } + + /* + Model: CategoryInfo + Used By: Cart + */ + class CategoryInfo: Codable { + public var uid: Int? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case name + } + + public init(name: String?, uid: Int?) { + self.uid = uid + + self.name = name + } + + public func duplicate() -> CategoryInfo { + let dict = self.dictionary! + let copy = CategoryInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: ActionQuery + Used By: Cart + */ + class ActionQuery: Codable { + public var productSlug: [String]? + + public enum CodingKeys: String, CodingKey { + case productSlug = "product_slug" + } + + public init(productSlug: [String]?) { + self.productSlug = productSlug + } + + public func duplicate() -> ActionQuery { + let dict = self.dictionary! + let copy = ActionQuery(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + productSlug = try container.decode([String].self, forKey: .productSlug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(productSlug, forKey: .productSlug) + } + } + + /* + Model: ProductAction + Used By: Cart + */ + class ProductAction: Codable { + public var url: String? + + public var query: ActionQuery? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case url + + case query + + case type + } + + public init(query: ActionQuery?, type: String?, url: String?) { + self.url = url + + self.query = query + + self.type = type + } + + public func duplicate() -> ProductAction { + let dict = self.dictionary! + let copy = ProductAction(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode(ActionQuery.self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(query, forKey: .query) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: ProductImage + Used By: Cart + */ + class ProductImage: Codable { + public var url: String? + + public var secureUrl: String? + + public var aspectRatio: String? + + public enum CodingKeys: String, CodingKey { + case url + + case secureUrl = "secure_url" + + case aspectRatio = "aspect_ratio" + } + + public init(aspectRatio: String?, secureUrl: String?, url: String?) { + self.url = url + + self.secureUrl = secureUrl + + self.aspectRatio = aspectRatio + } + + public func duplicate() -> ProductImage { + let dict = self.dictionary! + let copy = ProductImage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + secureUrl = try container.decode(String.self, forKey: .secureUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + aspectRatio = try container.decode(String.self, forKey: .aspectRatio) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) + + try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) + } + } + + /* + Model: CartProduct + Used By: Cart + */ + class CartProduct: Codable { + public var uid: Int? + + public var categories: [CategoryInfo]? + + public var slug: String? + + public var action: ProductAction? + + public var images: [ProductImage]? + + public var name: String? + + public var brand: BaseInfo? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case categories + + case slug + + case action + + case images + + case name + + case brand + + case type + } + + public init(action: ProductAction?, brand: BaseInfo?, categories: [CategoryInfo]?, images: [ProductImage]?, name: String?, slug: String?, type: String?, uid: Int?) { + self.uid = uid + + self.categories = categories + + self.slug = slug + + self.action = action + + self.images = images + + self.name = name + + self.brand = brand + + self.type = type + } + + public func duplicate() -> CartProduct { + let dict = self.dictionary! + let copy = CartProduct(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + categories = try container.decode([CategoryInfo].self, forKey: .categories) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(ProductAction.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + images = try container.decode([ProductImage].self, forKey: .images) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brand = try container.decode(BaseInfo.self, forKey: .brand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(categories, forKey: .categories) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(images, forKey: .images) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(brand, forKey: .brand) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: PromoMeta + Used By: Cart + */ + class PromoMeta: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> PromoMeta { + let dict = self.dictionary! + let copy = PromoMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: CartProductIdentifer + Used By: Cart + */ + class CartProductIdentifer: Codable { + public var identifier: String? + + public enum CodingKeys: String, CodingKey { + case identifier + } + + public init(identifier: String?) { + self.identifier = identifier + } + + public func duplicate() -> CartProductIdentifer { + let dict = self.dictionary! + let copy = CartProductIdentifer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + identifier = try container.decode(String.self, forKey: .identifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(identifier, forKey: .identifier) + } + } + + /* + Model: CartProductInfo + Used By: Cart + */ + class CartProductInfo: Codable { + public var availability: ProductAvailability? + + public var discount: String? + + public var article: ProductArticle? + + public var key: String? + + public var isSet: Bool? + + public var pricePerUnit: ProductPriceInfo? + + public var product: CartProduct? + + public var couponMessage: String? + + public var promoMeta: PromoMeta? + + public var message: String? + + public var quantity: Int? + + public var bulkOffer: [String: Any]? + + public var identifiers: CartProductIdentifer + + public var price: ProductPriceInfo? + + public enum CodingKeys: String, CodingKey { + case availability + + case discount + + case article + + case key + + case isSet = "is_set" + + case pricePerUnit = "price_per_unit" + + case product + + case couponMessage = "coupon_message" + + case promoMeta = "promo_meta" + + case message + + case quantity + + case bulkOffer = "bulk_offer" + + case identifiers + + case price + } + + public init(article: ProductArticle?, availability: ProductAvailability?, bulkOffer: [String: Any]?, couponMessage: String?, discount: String?, identifiers: CartProductIdentifer, isSet: Bool?, key: String?, message: String?, price: ProductPriceInfo?, pricePerUnit: ProductPriceInfo?, product: CartProduct?, promoMeta: PromoMeta?, quantity: Int?) { + self.availability = availability + + self.discount = discount + + self.article = article + + self.key = key + + self.isSet = isSet + + self.pricePerUnit = pricePerUnit + + self.product = product + + self.couponMessage = couponMessage + + self.promoMeta = promoMeta + + self.message = message + + self.quantity = quantity + + self.bulkOffer = bulkOffer + + self.identifiers = identifiers + + self.price = price + } + + public func duplicate() -> CartProductInfo { + let dict = self.dictionary! + let copy = CartProductInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + availability = try container.decode(ProductAvailability.self, forKey: .availability) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discount = try container.decode(String.self, forKey: .discount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + article = try container.decode(ProductArticle.self, forKey: .article) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isSet = try container.decode(Bool.self, forKey: .isSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pricePerUnit = try container.decode(ProductPriceInfo.self, forKey: .pricePerUnit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + product = try container.decode(CartProduct.self, forKey: .product) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + couponMessage = try container.decode(String.self, forKey: .couponMessage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + promoMeta = try container.decode(PromoMeta.self, forKey: .promoMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bulkOffer = try container.decode([String: Any].self, forKey: .bulkOffer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + identifiers = try container.decode(CartProductIdentifer.self, forKey: .identifiers) + + do { + price = try container.decode(ProductPriceInfo.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(availability, forKey: .availability) + + try? container.encodeIfPresent(discount, forKey: .discount) + + try? container.encodeIfPresent(article, forKey: .article) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(isSet, forKey: .isSet) + + try? container.encodeIfPresent(pricePerUnit, forKey: .pricePerUnit) + + try? container.encodeIfPresent(product, forKey: .product) + + try? container.encodeIfPresent(couponMessage, forKey: .couponMessage) + + try? container.encodeIfPresent(promoMeta, forKey: .promoMeta) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(bulkOffer, forKey: .bulkOffer) + + try? container.encodeIfPresent(identifiers, forKey: .identifiers) + + try? container.encodeIfPresent(price, forKey: .price) + } + } + + /* + Model: CartDetailResponse + Used By: Cart + */ + class CartDetailResponse: Codable { + public var restrictCheckout: Bool? + + public var isValid: Bool? + + public var currency: CartCurrency? + + public var lastModified: String? + + public var id: String? + + public var gstin: String? + + public var couponText: String? + + public var paymentSelectionLock: PaymentSelectionLock? + + public var deliveryPromise: ShipmentPromise? + + public var breakupValues: CartBreakup? + + public var deliveryChargeInfo: String? + + public var message: String? + + public var comment: String? + + public var items: [CartProductInfo]? + + public var checkoutMode: String? + + public enum CodingKeys: String, CodingKey { + case restrictCheckout = "restrict_checkout" + + case isValid = "is_valid" + + case currency + + case lastModified = "last_modified" + + case id + + case gstin + + case couponText = "coupon_text" + + case paymentSelectionLock = "payment_selection_lock" + + case deliveryPromise = "delivery_promise" + + case breakupValues = "breakup_values" + + case deliveryChargeInfo = "delivery_charge_info" + + case message + + case comment + + case items + + case checkoutMode = "checkout_mode" + } + + public init(breakupValues: CartBreakup?, checkoutMode: String?, comment: String?, couponText: String?, currency: CartCurrency?, deliveryChargeInfo: String?, deliveryPromise: ShipmentPromise?, gstin: String?, id: String?, isValid: Bool?, items: [CartProductInfo]?, lastModified: String?, message: String?, paymentSelectionLock: PaymentSelectionLock?, restrictCheckout: Bool?) { + self.restrictCheckout = restrictCheckout + + self.isValid = isValid + + self.currency = currency + + self.lastModified = lastModified + + self.id = id + + self.gstin = gstin + + self.couponText = couponText + + self.paymentSelectionLock = paymentSelectionLock + + self.deliveryPromise = deliveryPromise + + self.breakupValues = breakupValues + + self.deliveryChargeInfo = deliveryChargeInfo + + self.message = message + + self.comment = comment + + self.items = items + + self.checkoutMode = checkoutMode + } + + public func duplicate() -> CartDetailResponse { + let dict = self.dictionary! + let copy = CartDetailResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + restrictCheckout = try container.decode(Bool.self, forKey: .restrictCheckout) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isValid = try container.decode(Bool.self, forKey: .isValid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(CartCurrency.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastModified = try container.decode(String.self, forKey: .lastModified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstin = try container.decode(String.self, forKey: .gstin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + couponText = try container.decode(String.self, forKey: .couponText) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentSelectionLock = try container.decode(PaymentSelectionLock.self, forKey: .paymentSelectionLock) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryPromise = try container.decode(ShipmentPromise.self, forKey: .deliveryPromise) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + breakupValues = try container.decode(CartBreakup.self, forKey: .breakupValues) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryChargeInfo = try container.decode(String.self, forKey: .deliveryChargeInfo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + comment = try container.decode(String.self, forKey: .comment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([CartProductInfo].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + checkoutMode = try container.decode(String.self, forKey: .checkoutMode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(restrictCheckout, forKey: .restrictCheckout) + + try? container.encodeIfPresent(isValid, forKey: .isValid) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(lastModified, forKey: .lastModified) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(gstin, forKey: .gstin) + + try? container.encodeIfPresent(couponText, forKey: .couponText) + + try? container.encodeIfPresent(paymentSelectionLock, forKey: .paymentSelectionLock) + + try? container.encodeIfPresent(deliveryPromise, forKey: .deliveryPromise) + + try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) + + try? container.encodeIfPresent(deliveryChargeInfo, forKey: .deliveryChargeInfo) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(comment, forKey: .comment) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(checkoutMode, forKey: .checkoutMode) + } + } + + /* + Model: AddProductCart + Used By: Cart + */ + class AddProductCart: Codable { + public var display: String? + + public var extraMeta: [String: Any]? + + public var sellerId: Int? + + public var storeId: Int? + + public var articleId: String? + + public var pos: Bool? + + public var itemSize: String? + + public var quantity: Int? + + public var itemId: Int? + + public var articleAssignment: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case display + + case extraMeta = "extra_meta" + + case sellerId = "seller_id" + + case storeId = "store_id" + + case articleId = "article_id" + + case pos + + case itemSize = "item_size" + + case quantity + + case itemId = "item_id" + + case articleAssignment = "article_assignment" + } + + public init(articleAssignment: [String: Any]?, articleId: String?, display: String?, extraMeta: [String: Any]?, itemId: Int?, itemSize: String?, pos: Bool?, quantity: Int?, sellerId: Int?, storeId: Int?) { + self.display = display + + self.extraMeta = extraMeta + + self.sellerId = sellerId + + self.storeId = storeId + + self.articleId = articleId + + self.pos = pos + + self.itemSize = itemSize + + self.quantity = quantity + + self.itemId = itemId + + self.articleAssignment = articleAssignment + } + + public func duplicate() -> AddProductCart { + let dict = self.dictionary! + let copy = AddProductCart(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + extraMeta = try container.decode([String: Any].self, forKey: .extraMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sellerId = try container.decode(Int.self, forKey: .sellerId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeId = try container.decode(Int.self, forKey: .storeId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + articleId = try container.decode(String.self, forKey: .articleId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pos = try container.decode(Bool.self, forKey: .pos) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemSize = try container.decode(String.self, forKey: .itemSize) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemId = try container.decode(Int.self, forKey: .itemId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + articleAssignment = try container.decode([String: Any].self, forKey: .articleAssignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(extraMeta, forKey: .extraMeta) + + try? container.encodeIfPresent(sellerId, forKey: .sellerId) + + try? container.encodeIfPresent(storeId, forKey: .storeId) + + try? container.encodeIfPresent(articleId, forKey: .articleId) + + try? container.encodeIfPresent(pos, forKey: .pos) + + try? container.encodeIfPresent(itemSize, forKey: .itemSize) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(itemId, forKey: .itemId) + + try? container.encodeIfPresent(articleAssignment, forKey: .articleAssignment) + } + } + + /* + Model: AddCartRequest + Used By: Cart + */ + class AddCartRequest: Codable { + public var items: [AddProductCart]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [AddProductCart]?) { + self.items = items + } + + public func duplicate() -> AddCartRequest { + let dict = self.dictionary! + let copy = AddCartRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([AddProductCart].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: AddCartDetailResponse + Used By: Cart + */ + class AddCartDetailResponse: Codable { + public var success: Bool? + + public var partial: Bool? + + public var cart: CartDetailResponse? + + public var message: String? + + public enum CodingKeys: String, CodingKey { + case success + + case partial + + case cart + + case message + } + + public init(cart: CartDetailResponse?, message: String?, partial: Bool?, success: Bool?) { + self.success = success + + self.partial = partial + + self.cart = cart + + self.message = message + } + + public func duplicate() -> AddCartDetailResponse { + let dict = self.dictionary! + let copy = AddCartDetailResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + partial = try container.decode(Bool.self, forKey: .partial) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cart = try container.decode(CartDetailResponse.self, forKey: .cart) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(partial, forKey: .partial) + + try? container.encodeIfPresent(cart, forKey: .cart) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: UpdateProductCart + Used By: Cart + */ + class UpdateProductCart: Codable { + public var extraMeta: [String: Any]? + + public var articleId: String? + + public var itemSize: String? + + public var quantity: Int? + + public var itemId: Int? + + public var itemIndex: Int? + + public var identifiers: CartProductIdentifer + + public enum CodingKeys: String, CodingKey { + case extraMeta = "extra_meta" + + case articleId = "article_id" + + case itemSize = "item_size" + + case quantity + + case itemId = "item_id" + + case itemIndex = "item_index" + + case identifiers + } + + public init(articleId: String?, extraMeta: [String: Any]?, identifiers: CartProductIdentifer, itemId: Int?, itemIndex: Int?, itemSize: String?, quantity: Int?) { + self.extraMeta = extraMeta + + self.articleId = articleId + + self.itemSize = itemSize + + self.quantity = quantity + + self.itemId = itemId + + self.itemIndex = itemIndex + + self.identifiers = identifiers + } + + public func duplicate() -> UpdateProductCart { + let dict = self.dictionary! + let copy = UpdateProductCart(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + extraMeta = try container.decode([String: Any].self, forKey: .extraMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + articleId = try container.decode(String.self, forKey: .articleId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemSize = try container.decode(String.self, forKey: .itemSize) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemId = try container.decode(Int.self, forKey: .itemId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemIndex = try container.decode(Int.self, forKey: .itemIndex) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + identifiers = try container.decode(CartProductIdentifer.self, forKey: .identifiers) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(extraMeta, forKey: .extraMeta) + + try? container.encodeIfPresent(articleId, forKey: .articleId) + + try? container.encodeIfPresent(itemSize, forKey: .itemSize) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(itemId, forKey: .itemId) + + try? container.encodeIfPresent(itemIndex, forKey: .itemIndex) + + try? container.encodeIfPresent(identifiers, forKey: .identifiers) + } + } + + /* + Model: UpdateCartRequest + Used By: Cart + */ + class UpdateCartRequest: Codable { + public var items: [UpdateProductCart]? + + public var operation: String + + public enum CodingKeys: String, CodingKey { + case items + + case operation + } + + public init(items: [UpdateProductCart]?, operation: String) { + self.items = items + + self.operation = operation + } + + public func duplicate() -> UpdateCartRequest { + let dict = self.dictionary! + let copy = UpdateCartRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([UpdateProductCart].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + operation = try container.decode(String.self, forKey: .operation) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(operation, forKey: .operation) + } + } + + /* + Model: UpdateCartDetailResponse + Used By: Cart + */ + class UpdateCartDetailResponse: Codable { + public var success: Bool? + + public var cart: CartDetailResponse? + + public var message: String? + + public enum CodingKeys: String, CodingKey { + case success + + case cart + + case message + } + + public init(cart: CartDetailResponse?, message: String?, success: Bool?) { + self.success = success + + self.cart = cart + + self.message = message + } + + public func duplicate() -> UpdateCartDetailResponse { + let dict = self.dictionary! + let copy = UpdateCartDetailResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cart = try container.decode(CartDetailResponse.self, forKey: .cart) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(cart, forKey: .cart) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: CartItemCountResponse + Used By: Cart + */ + class CartItemCountResponse: Codable { + public var userCartItemsCount: Int? + + public enum CodingKeys: String, CodingKey { + case userCartItemsCount = "user_cart_items_count" + } + + public init(userCartItemsCount: Int?) { + self.userCartItemsCount = userCartItemsCount + } + + public func duplicate() -> CartItemCountResponse { + let dict = self.dictionary! + let copy = CartItemCountResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + userCartItemsCount = try container.decode(Int.self, forKey: .userCartItemsCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(userCartItemsCount, forKey: .userCartItemsCount) + } + } + + /* + Model: PageCoupon + Used By: Cart + */ + class PageCoupon: Codable { + public var hasPrevious: Bool? + + public var totalItemCount: Int? + + public var current: Int? + + public var hasNext: Bool? + + public var total: Int? + + public enum CodingKeys: String, CodingKey { + case hasPrevious = "has_previous" + + case totalItemCount = "total_item_count" + + case current + + case hasNext = "has_next" + + case total + } + + public init(current: Int?, hasNext: Bool?, hasPrevious: Bool?, total: Int?, totalItemCount: Int?) { + self.hasPrevious = hasPrevious + + self.totalItemCount = totalItemCount + + self.current = current + + self.hasNext = hasNext + + self.total = total + } + + public func duplicate() -> PageCoupon { + let dict = self.dictionary! + let copy = PageCoupon(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + hasPrevious = try container.decode(Bool.self, forKey: .hasPrevious) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalItemCount = try container.decode(Int.self, forKey: .totalItemCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + current = try container.decode(Int.self, forKey: .current) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasNext = try container.decode(Bool.self, forKey: .hasNext) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + total = try container.decode(Int.self, forKey: .total) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(hasPrevious, forKey: .hasPrevious) + + try? container.encodeIfPresent(totalItemCount, forKey: .totalItemCount) + + try? container.encodeIfPresent(current, forKey: .current) + + try? container.encodeIfPresent(hasNext, forKey: .hasNext) + + try? container.encodeIfPresent(total, forKey: .total) + } + } + + /* + Model: Coupon + Used By: Cart + */ + class Coupon: Codable { + public var couponCode: String? + + public var couponValue: Double? + + public var title: String? + + public var isApplied: Bool? + + public var isApplicable: Bool? + + public var expiresOn: String? + + public var subTitle: String? + + public var message: String? + + public var maxDiscountValue: Double? + + public var minimumCartValue: Double? + + public enum CodingKeys: String, CodingKey { + case couponCode = "coupon_code" + + case couponValue = "coupon_value" + + case title + + case isApplied = "is_applied" + + case isApplicable = "is_applicable" + + case expiresOn = "expires_on" + + case subTitle = "sub_title" + + case message + + case maxDiscountValue = "max_discount_value" + + case minimumCartValue = "minimum_cart_value" + } + + public init(couponCode: String?, couponValue: Double?, expiresOn: String?, isApplicable: Bool?, isApplied: Bool?, maxDiscountValue: Double?, message: String?, minimumCartValue: Double?, subTitle: String?, title: String?) { + self.couponCode = couponCode + + self.couponValue = couponValue + + self.title = title + + self.isApplied = isApplied + + self.isApplicable = isApplicable + + self.expiresOn = expiresOn + + self.subTitle = subTitle + + self.message = message + + self.maxDiscountValue = maxDiscountValue + + self.minimumCartValue = minimumCartValue + } + + public func duplicate() -> Coupon { + let dict = self.dictionary! + let copy = Coupon(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + couponCode = try container.decode(String.self, forKey: .couponCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + couponValue = try container.decode(Double.self, forKey: .couponValue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isApplied = try container.decode(Bool.self, forKey: .isApplied) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isApplicable = try container.decode(Bool.self, forKey: .isApplicable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expiresOn = try container.decode(String.self, forKey: .expiresOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subTitle = try container.decode(String.self, forKey: .subTitle) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + maxDiscountValue = try container.decode(Double.self, forKey: .maxDiscountValue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + minimumCartValue = try container.decode(Double.self, forKey: .minimumCartValue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(couponCode, forKey: .couponCode) + + try? container.encodeIfPresent(couponValue, forKey: .couponValue) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(isApplied, forKey: .isApplied) + + try? container.encodeIfPresent(isApplicable, forKey: .isApplicable) + + try? container.encodeIfPresent(expiresOn, forKey: .expiresOn) + + try? container.encodeIfPresent(subTitle, forKey: .subTitle) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(maxDiscountValue, forKey: .maxDiscountValue) + + try? container.encodeIfPresent(minimumCartValue, forKey: .minimumCartValue) + } + } + + /* + Model: GetCouponResponse + Used By: Cart + */ + class GetCouponResponse: Codable { + public var page: PageCoupon? + + public var availableCouponList: [Coupon]? + + public enum CodingKeys: String, CodingKey { + case page + + case availableCouponList = "available_coupon_list" + } + + public init(availableCouponList: [Coupon]?, page: PageCoupon?) { + self.page = page + + self.availableCouponList = availableCouponList + } + + public func duplicate() -> GetCouponResponse { + let dict = self.dictionary! + let copy = GetCouponResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(PageCoupon.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + availableCouponList = try container.decode([Coupon].self, forKey: .availableCouponList) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(availableCouponList, forKey: .availableCouponList) + } + } + + /* + Model: ApplyCouponRequest + Used By: Cart + */ + class ApplyCouponRequest: Codable { + public var couponCode: String + + public enum CodingKeys: String, CodingKey { + case couponCode = "coupon_code" + } + + public init(couponCode: String) { + self.couponCode = couponCode + } + + public func duplicate() -> ApplyCouponRequest { + let dict = self.dictionary! + let copy = ApplyCouponRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + couponCode = try container.decode(String.self, forKey: .couponCode) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(couponCode, forKey: .couponCode) + } + } + + /* + Model: OfferPrice + Used By: Cart + */ + class OfferPrice: Codable { + public var bulkEffective: Double? + + public var currencySymbol: String? + + public var currencyCode: String? + + public var marked: Int? + + public var effective: Int? + + public enum CodingKeys: String, CodingKey { + case bulkEffective = "bulk_effective" + + case currencySymbol = "currency_symbol" + + case currencyCode = "currency_code" + + case marked + + case effective + } + + public init(bulkEffective: Double?, currencyCode: String?, currencySymbol: String?, effective: Int?, marked: Int?) { + self.bulkEffective = bulkEffective + + self.currencySymbol = currencySymbol + + self.currencyCode = currencyCode + + self.marked = marked + + self.effective = effective + } + + public func duplicate() -> OfferPrice { + let dict = self.dictionary! + let copy = OfferPrice(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + bulkEffective = try container.decode(Double.self, forKey: .bulkEffective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencySymbol = try container.decode(String.self, forKey: .currencySymbol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + marked = try container.decode(Int.self, forKey: .marked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + effective = try container.decode(Int.self, forKey: .effective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(bulkEffective, forKey: .bulkEffective) + + try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + + try? container.encodeIfPresent(marked, forKey: .marked) + + try? container.encodeIfPresent(effective, forKey: .effective) + } + } + + /* + Model: OfferItem + Used By: Cart + */ + class OfferItem: Codable { + public var best: Bool? + + public var margin: Int? + + public var total: Double? + + public var autoApplied: Bool? + + public var quantity: Int? + + public var type: String? + + public var price: OfferPrice? + + public enum CodingKeys: String, CodingKey { + case best + + case margin + + case total + + case autoApplied = "auto_applied" + + case quantity + + case type + + case price + } + + public init(autoApplied: Bool?, best: Bool?, margin: Int?, price: OfferPrice?, quantity: Int?, total: Double?, type: String?) { + self.best = best + + self.margin = margin + + self.total = total + + self.autoApplied = autoApplied + + self.quantity = quantity + + self.type = type + + self.price = price + } + + public func duplicate() -> OfferItem { + let dict = self.dictionary! + let copy = OfferItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + best = try container.decode(Bool.self, forKey: .best) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + margin = try container.decode(Int.self, forKey: .margin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + total = try container.decode(Double.self, forKey: .total) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + autoApplied = try container.decode(Bool.self, forKey: .autoApplied) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(OfferPrice.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(best, forKey: .best) + + try? container.encodeIfPresent(margin, forKey: .margin) + + try? container.encodeIfPresent(total, forKey: .total) + + try? container.encodeIfPresent(autoApplied, forKey: .autoApplied) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(price, forKey: .price) + } + } + + /* + Model: OfferSeller + Used By: Cart + */ + class OfferSeller: Codable { + public var uid: Int? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case name + } + + public init(name: String?, uid: Int?) { + self.uid = uid + + self.name = name + } + + public func duplicate() -> OfferSeller { + let dict = self.dictionary! + let copy = OfferSeller(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: BulkPriceOffer + Used By: Cart + */ + class BulkPriceOffer: Codable { + public var offers: [OfferItem]? + + public var seller: OfferSeller? + + public enum CodingKeys: String, CodingKey { + case offers + + case seller + } + + public init(offers: [OfferItem]?, seller: OfferSeller?) { + self.offers = offers + + self.seller = seller + } + + public func duplicate() -> BulkPriceOffer { + let dict = self.dictionary! + let copy = BulkPriceOffer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + offers = try container.decode([OfferItem].self, forKey: .offers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + seller = try container.decode(OfferSeller.self, forKey: .seller) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(offers, forKey: .offers) + + try? container.encodeIfPresent(seller, forKey: .seller) + } + } + + /* + Model: BulkPriceResponse + Used By: Cart + */ + class BulkPriceResponse: Codable { + public var data: [BulkPriceOffer]? + + public enum CodingKeys: String, CodingKey { + case data + } + + public init(data: [BulkPriceOffer]?) { + self.data = data + } + + public func duplicate() -> BulkPriceResponse { + let dict = self.dictionary! + let copy = BulkPriceResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode([BulkPriceOffer].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: RewardPointRequest + Used By: Cart + */ + class RewardPointRequest: Codable { + public var points: Bool + + public enum CodingKeys: String, CodingKey { + case points + } + + public init(points: Bool) { + self.points = points + } + + public func duplicate() -> RewardPointRequest { + let dict = self.dictionary! + let copy = RewardPointRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + points = try container.decode(Bool.self, forKey: .points) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(points, forKey: .points) + } + } + + /* + Model: GeoLocation + Used By: Cart + */ + class GeoLocation: Codable { + public var longitude: Double? + + public var latitude: Double? + + public enum CodingKeys: String, CodingKey { + case longitude + + case latitude + } + + public init(latitude: Double?, longitude: Double?) { + self.longitude = longitude + + self.latitude = latitude + } + + public func duplicate() -> GeoLocation { + let dict = self.dictionary! + let copy = GeoLocation(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + longitude = try container.decode(Double.self, forKey: .longitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + latitude = try container.decode(Double.self, forKey: .latitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(longitude, forKey: .longitude) + + try? container.encodeIfPresent(latitude, forKey: .latitude) + } + } + + /* + Model: Address + Used By: Cart + */ + class Address: Codable { + public var state: String? + + public var country: String? + + public var tags: [String]? + + public var address: String? + + public var name: String? + + public var isDefaultAddress: Bool? + + public var userId: String? + + public var checkoutMode: String? + + public var area: String? + + public var isActive: Bool? + + public var id: String? + + public var areaCodeSlug: String? + + public var googleMapPoint: [String: Any]? + + public var city: String? + + public var countryCode: String? + + public var areaCode: String? + + public var phone: String? + + public var meta: [String: Any]? + + public var email: String? + + public var landmark: String? + + public var addressType: String? + + public var geoLocation: GeoLocation? + + public enum CodingKeys: String, CodingKey { + case state + + case country + + case tags + + case address + + case name + + case isDefaultAddress = "is_default_address" + + case userId = "user_id" + + case checkoutMode = "checkout_mode" + + case area + + case isActive = "is_active" + + case id + + case areaCodeSlug = "area_code_slug" + + case googleMapPoint = "google_map_point" + + case city + + case countryCode = "country_code" + + case areaCode = "area_code" + + case phone + + case meta + + case email + + case landmark + + case addressType = "address_type" + + case geoLocation = "geo_location" + } + + public init(address: String?, addressType: String?, area: String?, areaCode: String?, areaCodeSlug: String?, checkoutMode: String?, city: String?, country: String?, countryCode: String?, email: String?, geoLocation: GeoLocation?, googleMapPoint: [String: Any]?, id: String?, isActive: Bool?, isDefaultAddress: Bool?, landmark: String?, meta: [String: Any]?, name: String?, phone: String?, state: String?, tags: [String]?, userId: String?) { + self.state = state + + self.country = country + + self.tags = tags + + self.address = address + + self.name = name + + self.isDefaultAddress = isDefaultAddress + + self.userId = userId + + self.checkoutMode = checkoutMode + + self.area = area + + self.isActive = isActive + + self.id = id + + self.areaCodeSlug = areaCodeSlug + + self.googleMapPoint = googleMapPoint + + self.city = city + + self.countryCode = countryCode + + self.areaCode = areaCode + + self.phone = phone + + self.meta = meta + + self.email = email + + self.landmark = landmark + + self.addressType = addressType + + self.geoLocation = geoLocation + } + + public func duplicate() -> Address { + let dict = self.dictionary! + let copy = Address(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address = try container.decode(String.self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isDefaultAddress = try container.decode(Bool.self, forKey: .isDefaultAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + checkoutMode = try container.decode(String.self, forKey: .checkoutMode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + area = try container.decode(String.self, forKey: .area) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + areaCodeSlug = try container.decode(String.self, forKey: .areaCodeSlug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + googleMapPoint = try container.decode([String: Any].self, forKey: .googleMapPoint) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + areaCode = try container.decode(String.self, forKey: .areaCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + landmark = try container.decode(String.self, forKey: .landmark) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressType = try container.decode(String.self, forKey: .addressType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + geoLocation = try container.decode(GeoLocation.self, forKey: .geoLocation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(isDefaultAddress, forKey: .isDefaultAddress) + + try? container.encodeIfPresent(userId, forKey: .userId) + + try? container.encodeIfPresent(checkoutMode, forKey: .checkoutMode) + + try? container.encodeIfPresent(area, forKey: .area) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(areaCodeSlug, forKey: .areaCodeSlug) + + try? container.encodeIfPresent(googleMapPoint, forKey: .googleMapPoint) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(areaCode, forKey: .areaCode) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(landmark, forKey: .landmark) + + try? container.encodeIfPresent(addressType, forKey: .addressType) + + try? container.encodeIfPresent(geoLocation, forKey: .geoLocation) + } + } + + /* + Model: GetAddressesResponse + Used By: Cart + */ + class GetAddressesResponse: Codable { + public var address: [Address]? + + public enum CodingKeys: String, CodingKey { + case address + } + + public init(address: [Address]?) { + self.address = address + } + + public func duplicate() -> GetAddressesResponse { + let dict = self.dictionary! + let copy = GetAddressesResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + address = try container.decode([Address].self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(address, forKey: .address) + } + } + + /* + Model: SaveAddressResponse + Used By: Cart + */ + class SaveAddressResponse: Codable { + public var success: Bool? + + public var id: String? + + public var isDefaultAddress: Bool? + + public enum CodingKeys: String, CodingKey { + case success + + case id + + case isDefaultAddress = "is_default_address" + } + + public init(id: String?, isDefaultAddress: Bool?, success: Bool?) { + self.success = success + + self.id = id + + self.isDefaultAddress = isDefaultAddress + } + + public func duplicate() -> SaveAddressResponse { + let dict = self.dictionary! + let copy = SaveAddressResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isDefaultAddress = try container.decode(Bool.self, forKey: .isDefaultAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(isDefaultAddress, forKey: .isDefaultAddress) + } + } + + /* + Model: UpdateAddressResponse + Used By: Cart + */ + class UpdateAddressResponse: Codable { + public var success: Bool? + + public var id: String? + + public var isDefaultAddress: Bool? + + public var isUpdated: Bool? + + public enum CodingKeys: String, CodingKey { + case success + + case id + + case isDefaultAddress = "is_default_address" + + case isUpdated = "is_updated" + } + + public init(id: String?, isDefaultAddress: Bool?, isUpdated: Bool?, success: Bool?) { + self.success = success + + self.id = id + + self.isDefaultAddress = isDefaultAddress + + self.isUpdated = isUpdated + } + + public func duplicate() -> UpdateAddressResponse { + let dict = self.dictionary! + let copy = UpdateAddressResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isDefaultAddress = try container.decode(Bool.self, forKey: .isDefaultAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isUpdated = try container.decode(Bool.self, forKey: .isUpdated) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(isDefaultAddress, forKey: .isDefaultAddress) + + try? container.encodeIfPresent(isUpdated, forKey: .isUpdated) + } + } + + /* + Model: DeleteAddressResponse + Used By: Cart + */ + class DeleteAddressResponse: Codable { + public var id: String? + + public var isDeleted: Bool? + + public enum CodingKeys: String, CodingKey { + case id + + case isDeleted = "is_deleted" + } + + public init(id: String?, isDeleted: Bool?) { + self.id = id + + self.isDeleted = isDeleted + } + + public func duplicate() -> DeleteAddressResponse { + let dict = self.dictionary! + let copy = DeleteAddressResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isDeleted = try container.decode(Bool.self, forKey: .isDeleted) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(isDeleted, forKey: .isDeleted) + } + } + + /* + Model: SelectCartAddressRequest + Used By: Cart + */ + class SelectCartAddressRequest: Codable { + public var id: String? + + public var billingAddressId: String? + + public var cartId: String? + + public enum CodingKeys: String, CodingKey { + case id + + case billingAddressId = "billing_address_id" + + case cartId = "cart_id" + } + + public init(billingAddressId: String?, cartId: String?, id: String?) { + self.id = id + + self.billingAddressId = billingAddressId + + self.cartId = cartId + } + + public func duplicate() -> SelectCartAddressRequest { + let dict = self.dictionary! + let copy = SelectCartAddressRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + billingAddressId = try container.decode(String.self, forKey: .billingAddressId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cartId = try container.decode(String.self, forKey: .cartId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(billingAddressId, forKey: .billingAddressId) + + try? container.encodeIfPresent(cartId, forKey: .cartId) + } + } + + /* + Model: UpdateCartPaymentRequest + Used By: Cart + */ + class UpdateCartPaymentRequest: Codable { + public var id: String? + + public var merchantCode: String? + + public var paymentMode: String? + + public var addressId: String? + + public var aggregatorName: String? + + public var paymentIdentifier: String? + + public enum CodingKeys: String, CodingKey { + case id + + case merchantCode = "merchant_code" + + case paymentMode = "payment_mode" + + case addressId = "address_id" + + case aggregatorName = "aggregator_name" + + case paymentIdentifier = "payment_identifier" + } + + public init(addressId: String?, aggregatorName: String?, id: String?, merchantCode: String?, paymentIdentifier: String?, paymentMode: String?) { + self.id = id + + self.merchantCode = merchantCode + + self.paymentMode = paymentMode + + self.addressId = addressId + + self.aggregatorName = aggregatorName + + self.paymentIdentifier = paymentIdentifier + } + + public func duplicate() -> UpdateCartPaymentRequest { + let dict = self.dictionary! + let copy = UpdateCartPaymentRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + merchantCode = try container.decode(String.self, forKey: .merchantCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentMode = try container.decode(String.self, forKey: .paymentMode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressId = try container.decode(String.self, forKey: .addressId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + aggregatorName = try container.decode(String.self, forKey: .aggregatorName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentIdentifier = try container.decode(String.self, forKey: .paymentIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(merchantCode, forKey: .merchantCode) + + try? container.encodeIfPresent(paymentMode, forKey: .paymentMode) + + try? container.encodeIfPresent(addressId, forKey: .addressId) + + try? container.encodeIfPresent(aggregatorName, forKey: .aggregatorName) + + try? container.encode(paymentIdentifier, forKey: .paymentIdentifier) + } + } + + /* + Model: CouponValidity + Used By: Cart + */ + class CouponValidity: Codable { + public var discount: Double? + + public var title: String? + + public var valid: Bool? + + public var code: String? + + public var displayMessageEn: String? + + public enum CodingKeys: String, CodingKey { + case discount + + case title + + case valid + + case code + + case displayMessageEn = "display_message_en" + } + + public init(code: String?, discount: Double?, displayMessageEn: String?, title: String?, valid: Bool?) { + self.discount = discount + + self.title = title + + self.valid = valid + + self.code = code + + self.displayMessageEn = displayMessageEn + } + + public func duplicate() -> CouponValidity { + let dict = self.dictionary! + let copy = CouponValidity(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + discount = try container.decode(Double.self, forKey: .discount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + valid = try container.decode(Bool.self, forKey: .valid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayMessageEn = try container.decode(String.self, forKey: .displayMessageEn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(discount, forKey: .discount) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(valid, forKey: .valid) + + try? container.encode(code, forKey: .code) + + try? container.encode(displayMessageEn, forKey: .displayMessageEn) + } + } + + /* + Model: PaymentCouponValidate + Used By: Cart + */ + class PaymentCouponValidate: Codable { + public var success: Bool + + public var message: String? + + public var couponValidity: CouponValidity? + + public enum CodingKeys: String, CodingKey { + case success + + case message + + case couponValidity = "coupon_validity" + } + + public init(couponValidity: CouponValidity?, message: String?, success: Bool) { + self.success = success + + self.message = message + + self.couponValidity = couponValidity + } + + public func duplicate() -> PaymentCouponValidate { + let dict = self.dictionary! + let copy = PaymentCouponValidate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + couponValidity = try container.decode(CouponValidity.self, forKey: .couponValidity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(couponValidity, forKey: .couponValidity) + } + } + + /* + Model: ShipmentResponse + Used By: Cart + */ + class ShipmentResponse: Codable { + public var promise: ShipmentPromise? + + public var fulfillmentId: Int? + + public var shipmentType: String? + + public var dpId: String? + + public var shipments: Int? + + public var orderType: String? + + public var dpOptions: [String: Any]? + + public var boxType: String? + + public var fulfillmentType: String? + + public var items: [CartProductInfo]? + + public enum CodingKeys: String, CodingKey { + case promise + + case fulfillmentId = "fulfillment_id" + + case shipmentType = "shipment_type" + + case dpId = "dp_id" + + case shipments + + case orderType = "order_type" + + case dpOptions = "dp_options" + + case boxType = "box_type" + + case fulfillmentType = "fulfillment_type" + + case items + } + + public init(boxType: String?, dpId: String?, dpOptions: [String: Any]?, fulfillmentId: Int?, fulfillmentType: String?, items: [CartProductInfo]?, orderType: String?, promise: ShipmentPromise?, shipments: Int?, shipmentType: String?) { + self.promise = promise + + self.fulfillmentId = fulfillmentId + + self.shipmentType = shipmentType + + self.dpId = dpId + + self.shipments = shipments + + self.orderType = orderType + + self.dpOptions = dpOptions + + self.boxType = boxType + + self.fulfillmentType = fulfillmentType + + self.items = items + } + + public func duplicate() -> ShipmentResponse { + let dict = self.dictionary! + let copy = ShipmentResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + promise = try container.decode(ShipmentPromise.self, forKey: .promise) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fulfillmentId = try container.decode(Int.self, forKey: .fulfillmentId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shipmentType = try container.decode(String.self, forKey: .shipmentType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dpId = try container.decode(String.self, forKey: .dpId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shipments = try container.decode(Int.self, forKey: .shipments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderType = try container.decode(String.self, forKey: .orderType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dpOptions = try container.decode([String: Any].self, forKey: .dpOptions) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + boxType = try container.decode(String.self, forKey: .boxType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fulfillmentType = try container.decode(String.self, forKey: .fulfillmentType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([CartProductInfo].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(promise, forKey: .promise) + + try? container.encodeIfPresent(fulfillmentId, forKey: .fulfillmentId) + + try? container.encodeIfPresent(shipmentType, forKey: .shipmentType) + + try? container.encode(dpId, forKey: .dpId) + + try? container.encodeIfPresent(shipments, forKey: .shipments) + + try? container.encodeIfPresent(orderType, forKey: .orderType) + + try? container.encode(dpOptions, forKey: .dpOptions) + + try? container.encode(boxType, forKey: .boxType) + + try? container.encodeIfPresent(fulfillmentType, forKey: .fulfillmentType) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: CartShipmentsResponse + Used By: Cart + */ + class CartShipmentsResponse: Codable { + public var uid: String? + + public var error: Bool? + + public var id: String? + + public var message: String? + + public var paymentSelectionLock: PaymentSelectionLock? + + public var lastModified: String? + + public var restrictCheckout: Bool? + + public var isValid: Bool? + + public var currency: CartCurrency? + + public var shipments: [ShipmentResponse]? + + public var gstin: String? + + public var cartId: Int? + + public var couponText: String? + + public var deliveryPromise: ShipmentPromise? + + public var breakupValues: CartBreakup? + + public var deliveryChargeInfo: String? + + public var comment: String? + + public var checkoutMode: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case error + + case id + + case message + + case paymentSelectionLock = "payment_selection_lock" + + case lastModified = "last_modified" + + case restrictCheckout = "restrict_checkout" + + case isValid = "is_valid" + + case currency + + case shipments + + case gstin + + case cartId = "cart_id" + + case couponText = "coupon_text" + + case deliveryPromise = "delivery_promise" + + case breakupValues = "breakup_values" + + case deliveryChargeInfo = "delivery_charge_info" + + case comment + + case checkoutMode = "checkout_mode" + } + + public init(breakupValues: CartBreakup?, cartId: Int?, checkoutMode: String?, comment: String?, couponText: String?, currency: CartCurrency?, deliveryChargeInfo: String?, deliveryPromise: ShipmentPromise?, error: Bool?, gstin: String?, id: String?, isValid: Bool?, lastModified: String?, message: String?, paymentSelectionLock: PaymentSelectionLock?, restrictCheckout: Bool?, shipments: [ShipmentResponse]?, uid: String?) { + self.uid = uid + + self.error = error + + self.id = id + + self.message = message + + self.paymentSelectionLock = paymentSelectionLock + + self.lastModified = lastModified + + self.restrictCheckout = restrictCheckout + + self.isValid = isValid + + self.currency = currency + + self.shipments = shipments + + self.gstin = gstin + + self.cartId = cartId + + self.couponText = couponText + + self.deliveryPromise = deliveryPromise + + self.breakupValues = breakupValues + + self.deliveryChargeInfo = deliveryChargeInfo + + self.comment = comment + + self.checkoutMode = checkoutMode + } + + public func duplicate() -> CartShipmentsResponse { + let dict = self.dictionary! + let copy = CartShipmentsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + error = try container.decode(Bool.self, forKey: .error) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentSelectionLock = try container.decode(PaymentSelectionLock.self, forKey: .paymentSelectionLock) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastModified = try container.decode(String.self, forKey: .lastModified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + restrictCheckout = try container.decode(Bool.self, forKey: .restrictCheckout) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isValid = try container.decode(Bool.self, forKey: .isValid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(CartCurrency.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shipments = try container.decode([ShipmentResponse].self, forKey: .shipments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstin = try container.decode(String.self, forKey: .gstin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cartId = try container.decode(Int.self, forKey: .cartId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + couponText = try container.decode(String.self, forKey: .couponText) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryPromise = try container.decode(ShipmentPromise.self, forKey: .deliveryPromise) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + breakupValues = try container.decode(CartBreakup.self, forKey: .breakupValues) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryChargeInfo = try container.decode(String.self, forKey: .deliveryChargeInfo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + comment = try container.decode(String.self, forKey: .comment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + checkoutMode = try container.decode(String.self, forKey: .checkoutMode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(error, forKey: .error) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(paymentSelectionLock, forKey: .paymentSelectionLock) + + try? container.encodeIfPresent(lastModified, forKey: .lastModified) + + try? container.encodeIfPresent(restrictCheckout, forKey: .restrictCheckout) + + try? container.encodeIfPresent(isValid, forKey: .isValid) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(shipments, forKey: .shipments) + + try? container.encodeIfPresent(gstin, forKey: .gstin) + + try? container.encodeIfPresent(cartId, forKey: .cartId) + + try? container.encodeIfPresent(couponText, forKey: .couponText) + + try? container.encodeIfPresent(deliveryPromise, forKey: .deliveryPromise) + + try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) + + try? container.encodeIfPresent(deliveryChargeInfo, forKey: .deliveryChargeInfo) + + try? container.encodeIfPresent(comment, forKey: .comment) + + try? container.encodeIfPresent(checkoutMode, forKey: .checkoutMode) + } + } + + /* + Model: StaffCheckout + Used By: Cart + */ + class StaffCheckout: Codable { + public var user: String + + public var firstName: String + + public var lastName: String + + public var id: String + + public enum CodingKeys: String, CodingKey { + case user + + case firstName = "first_name" + + case lastName = "last_name" + + case id = "_id" + } + + public init(firstName: String, lastName: String, user: String, id: String) { + self.user = user + + self.firstName = firstName + + self.lastName = lastName + + self.id = id + } + + public func duplicate() -> StaffCheckout { + let dict = self.dictionary! + let copy = StaffCheckout(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + user = try container.decode(String.self, forKey: .user) + + firstName = try container.decode(String.self, forKey: .firstName) + + lastName = try container.decode(String.self, forKey: .lastName) + + id = try container.decode(String.self, forKey: .id) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: CartCheckoutDetailRequest + Used By: Cart + */ + class CartCheckoutDetailRequest: Codable { + public var orderingStore: Int? + + public var extraMeta: [String: Any]? + + public var callbackUrl: String? + + public var aggregator: String? + + public var paymentAutoConfirm: Bool? + + public var merchantCode: String? + + public var meta: [String: Any]? + + public var staff: StaffCheckout? + + public var paymentMode: String + + public var addressId: String? + + public var billingAddressId: String? + + public var billingAddress: [String: Any]? + + public var paymentParams: [String: Any]? + + public var deliveryAddress: [String: Any]? + + public var paymentIdentifier: String? + + public enum CodingKeys: String, CodingKey { + case orderingStore = "ordering_store" + + case extraMeta = "extra_meta" + + case callbackUrl = "callback_url" + + case aggregator + + case paymentAutoConfirm = "payment_auto_confirm" + + case merchantCode = "merchant_code" + + case meta + + case staff + + case paymentMode = "payment_mode" + + case addressId = "address_id" + + case billingAddressId = "billing_address_id" + + case billingAddress = "billing_address" + + case paymentParams = "payment_params" + + case deliveryAddress = "delivery_address" + + case paymentIdentifier = "payment_identifier" + } + + public init(addressId: String?, aggregator: String?, billingAddress: [String: Any]?, billingAddressId: String?, callbackUrl: String?, deliveryAddress: [String: Any]?, extraMeta: [String: Any]?, merchantCode: String?, meta: [String: Any]?, orderingStore: Int?, paymentAutoConfirm: Bool?, paymentIdentifier: String?, paymentMode: String, paymentParams: [String: Any]?, staff: StaffCheckout?) { + self.orderingStore = orderingStore + + self.extraMeta = extraMeta + + self.callbackUrl = callbackUrl + + self.aggregator = aggregator + + self.paymentAutoConfirm = paymentAutoConfirm + + self.merchantCode = merchantCode + + self.meta = meta + + self.staff = staff + + self.paymentMode = paymentMode + + self.addressId = addressId + + self.billingAddressId = billingAddressId + + self.billingAddress = billingAddress + + self.paymentParams = paymentParams + + self.deliveryAddress = deliveryAddress + + self.paymentIdentifier = paymentIdentifier + } + + public func duplicate() -> CartCheckoutDetailRequest { + let dict = self.dictionary! + let copy = CartCheckoutDetailRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + orderingStore = try container.decode(Int.self, forKey: .orderingStore) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + extraMeta = try container.decode([String: Any].self, forKey: .extraMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + callbackUrl = try container.decode(String.self, forKey: .callbackUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + aggregator = try container.decode(String.self, forKey: .aggregator) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentAutoConfirm = try container.decode(Bool.self, forKey: .paymentAutoConfirm) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + merchantCode = try container.decode(String.self, forKey: .merchantCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + staff = try container.decode(StaffCheckout.self, forKey: .staff) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + paymentMode = try container.decode(String.self, forKey: .paymentMode) + + do { + addressId = try container.decode(String.self, forKey: .addressId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + billingAddressId = try container.decode(String.self, forKey: .billingAddressId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + billingAddress = try container.decode([String: Any].self, forKey: .billingAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentParams = try container.decode([String: Any].self, forKey: .paymentParams) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryAddress = try container.decode([String: Any].self, forKey: .deliveryAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentIdentifier = try container.decode(String.self, forKey: .paymentIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(orderingStore, forKey: .orderingStore) + + try? container.encodeIfPresent(extraMeta, forKey: .extraMeta) + + try? container.encode(callbackUrl, forKey: .callbackUrl) + + try? container.encodeIfPresent(aggregator, forKey: .aggregator) + + try? container.encodeIfPresent(paymentAutoConfirm, forKey: .paymentAutoConfirm) + + try? container.encodeIfPresent(merchantCode, forKey: .merchantCode) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(staff, forKey: .staff) + + try? container.encodeIfPresent(paymentMode, forKey: .paymentMode) + + try? container.encodeIfPresent(addressId, forKey: .addressId) + + try? container.encodeIfPresent(billingAddressId, forKey: .billingAddressId) + + try? container.encodeIfPresent(billingAddress, forKey: .billingAddress) + + try? container.encode(paymentParams, forKey: .paymentParams) + + try? container.encodeIfPresent(deliveryAddress, forKey: .deliveryAddress) + + try? container.encode(paymentIdentifier, forKey: .paymentIdentifier) + } + } + + /* + Model: CheckCart + Used By: Cart + */ + class CheckCart: Codable { + public var uid: String? + + public var storeEmps: [[String: Any]]? + + public var message: String? + + public var paymentSelectionLock: PaymentSelectionLock? + + public var lastModified: String? + + public var codCharges: Int? + + public var restrictCheckout: Bool? + + public var isValid: Bool? + + public var gstin: String? + + public var deliveryPromise: ShipmentPromise? + + public var errorMessage: String? + + public var comment: String? + + public var checkoutMode: String? + + public var id: String? + + public var codMessage: String? + + public var success: Bool? + + public var storeCode: String? + + public var deliveryCharges: Int? + + public var userType: String? + + public var orderId: String? + + public var currency: CartCurrency? + + public var cartId: Int? + + public var couponText: String? + + public var codAvailable: Bool? + + public var deliveryChargeOrderValue: Int? + + public var breakupValues: CartBreakup? + + public var deliveryChargeInfo: String? + + public var items: [CartProductInfo]? + + public enum CodingKeys: String, CodingKey { + case uid + + case storeEmps = "store_emps" + + case message + + case paymentSelectionLock = "payment_selection_lock" + + case lastModified = "last_modified" + + case codCharges = "cod_charges" + + case restrictCheckout = "restrict_checkout" + + case isValid = "is_valid" + + case gstin + + case deliveryPromise = "delivery_promise" + + case errorMessage = "error_message" + + case comment + + case checkoutMode = "checkout_mode" + + case id + + case codMessage = "cod_message" + + case success + + case storeCode = "store_code" + + case deliveryCharges = "delivery_charges" + + case userType = "user_type" + + case orderId = "order_id" + + case currency + + case cartId = "cart_id" + + case couponText = "coupon_text" + + case codAvailable = "cod_available" + + case deliveryChargeOrderValue = "delivery_charge_order_value" + + case breakupValues = "breakup_values" + + case deliveryChargeInfo = "delivery_charge_info" + + case items + } + + public init(breakupValues: CartBreakup?, cartId: Int?, checkoutMode: String?, codAvailable: Bool?, codCharges: Int?, codMessage: String?, comment: String?, couponText: String?, currency: CartCurrency?, deliveryCharges: Int?, deliveryChargeInfo: String?, deliveryChargeOrderValue: Int?, deliveryPromise: ShipmentPromise?, errorMessage: String?, gstin: String?, id: String?, isValid: Bool?, items: [CartProductInfo]?, lastModified: String?, message: String?, orderId: String?, paymentSelectionLock: PaymentSelectionLock?, restrictCheckout: Bool?, storeCode: String?, storeEmps: [[String: Any]]?, success: Bool?, uid: String?, userType: String?) { + self.uid = uid + + self.storeEmps = storeEmps + + self.message = message + + self.paymentSelectionLock = paymentSelectionLock + + self.lastModified = lastModified + + self.codCharges = codCharges + + self.restrictCheckout = restrictCheckout + + self.isValid = isValid + + self.gstin = gstin + + self.deliveryPromise = deliveryPromise + + self.errorMessage = errorMessage + + self.comment = comment + + self.checkoutMode = checkoutMode + + self.id = id + + self.codMessage = codMessage + + self.success = success + + self.storeCode = storeCode + + self.deliveryCharges = deliveryCharges + + self.userType = userType + + self.orderId = orderId + + self.currency = currency + + self.cartId = cartId + + self.couponText = couponText + + self.codAvailable = codAvailable + + self.deliveryChargeOrderValue = deliveryChargeOrderValue + + self.breakupValues = breakupValues + + self.deliveryChargeInfo = deliveryChargeInfo + + self.items = items + } + + public func duplicate() -> CheckCart { + let dict = self.dictionary! + let copy = CheckCart(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeEmps = try container.decode([[String: Any]].self, forKey: .storeEmps) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentSelectionLock = try container.decode(PaymentSelectionLock.self, forKey: .paymentSelectionLock) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastModified = try container.decode(String.self, forKey: .lastModified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + codCharges = try container.decode(Int.self, forKey: .codCharges) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + restrictCheckout = try container.decode(Bool.self, forKey: .restrictCheckout) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isValid = try container.decode(Bool.self, forKey: .isValid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstin = try container.decode(String.self, forKey: .gstin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryPromise = try container.decode(ShipmentPromise.self, forKey: .deliveryPromise) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + errorMessage = try container.decode(String.self, forKey: .errorMessage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + comment = try container.decode(String.self, forKey: .comment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + checkoutMode = try container.decode(String.self, forKey: .checkoutMode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + codMessage = try container.decode(String.self, forKey: .codMessage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeCode = try container.decode(String.self, forKey: .storeCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryCharges = try container.decode(Int.self, forKey: .deliveryCharges) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userType = try container.decode(String.self, forKey: .userType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderId = try container.decode(String.self, forKey: .orderId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(CartCurrency.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cartId = try container.decode(Int.self, forKey: .cartId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + couponText = try container.decode(String.self, forKey: .couponText) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + codAvailable = try container.decode(Bool.self, forKey: .codAvailable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryChargeOrderValue = try container.decode(Int.self, forKey: .deliveryChargeOrderValue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + breakupValues = try container.decode(CartBreakup.self, forKey: .breakupValues) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryChargeInfo = try container.decode(String.self, forKey: .deliveryChargeInfo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([CartProductInfo].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(storeEmps, forKey: .storeEmps) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(paymentSelectionLock, forKey: .paymentSelectionLock) + + try? container.encodeIfPresent(lastModified, forKey: .lastModified) + + try? container.encodeIfPresent(codCharges, forKey: .codCharges) + + try? container.encodeIfPresent(restrictCheckout, forKey: .restrictCheckout) + + try? container.encodeIfPresent(isValid, forKey: .isValid) + + try? container.encodeIfPresent(gstin, forKey: .gstin) + + try? container.encodeIfPresent(deliveryPromise, forKey: .deliveryPromise) + + try? container.encodeIfPresent(errorMessage, forKey: .errorMessage) + + try? container.encodeIfPresent(comment, forKey: .comment) + + try? container.encodeIfPresent(checkoutMode, forKey: .checkoutMode) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(codMessage, forKey: .codMessage) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(storeCode, forKey: .storeCode) + + try? container.encodeIfPresent(deliveryCharges, forKey: .deliveryCharges) + + try? container.encodeIfPresent(userType, forKey: .userType) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(cartId, forKey: .cartId) + + try? container.encodeIfPresent(couponText, forKey: .couponText) + + try? container.encodeIfPresent(codAvailable, forKey: .codAvailable) + + try? container.encodeIfPresent(deliveryChargeOrderValue, forKey: .deliveryChargeOrderValue) + + try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) + + try? container.encodeIfPresent(deliveryChargeInfo, forKey: .deliveryChargeInfo) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: CartCheckoutResponse + Used By: Cart + */ + class CartCheckoutResponse: Codable { + public var orderId: String? + + public var callbackUrl: String? + + public var paymentConfirmUrl: String? + + public var success: Bool? + + public var message: String? + + public var data: [String: Any]? + + public var appInterceptUrl: String? + + public var cart: CheckCart? + + public enum CodingKeys: String, CodingKey { + case orderId = "order_id" + + case callbackUrl = "callback_url" + + case paymentConfirmUrl = "payment_confirm_url" + + case success + + case message + + case data + + case appInterceptUrl = "app_intercept_url" + + case cart + } + + public init(appInterceptUrl: String?, callbackUrl: String?, cart: CheckCart?, data: [String: Any]?, message: String?, orderId: String?, paymentConfirmUrl: String?, success: Bool?) { + self.orderId = orderId + + self.callbackUrl = callbackUrl + + self.paymentConfirmUrl = paymentConfirmUrl + + self.success = success + + self.message = message + + self.data = data + + self.appInterceptUrl = appInterceptUrl + + self.cart = cart + } + + public func duplicate() -> CartCheckoutResponse { + let dict = self.dictionary! + let copy = CartCheckoutResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + orderId = try container.decode(String.self, forKey: .orderId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + callbackUrl = try container.decode(String.self, forKey: .callbackUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentConfirmUrl = try container.decode(String.self, forKey: .paymentConfirmUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode([String: Any].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appInterceptUrl = try container.decode(String.self, forKey: .appInterceptUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cart = try container.decode(CheckCart.self, forKey: .cart) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + + try? container.encodeIfPresent(callbackUrl, forKey: .callbackUrl) + + try? container.encodeIfPresent(paymentConfirmUrl, forKey: .paymentConfirmUrl) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(appInterceptUrl, forKey: .appInterceptUrl) + + try? container.encodeIfPresent(cart, forKey: .cart) + } + } + + /* + Model: CartMetaRequest + Used By: Cart + */ + class CartMetaRequest: Codable { + public var gstin: String? + + public var pickUpCustomerDetails: [String: Any]? + + public var checkoutMode: String? + + public var comment: String? + + public enum CodingKeys: String, CodingKey { + case gstin + + case pickUpCustomerDetails = "pick_up_customer_details" + + case checkoutMode = "checkout_mode" + + case comment + } + + public init(checkoutMode: String?, comment: String?, gstin: String?, pickUpCustomerDetails: [String: Any]?) { + self.gstin = gstin + + self.pickUpCustomerDetails = pickUpCustomerDetails + + self.checkoutMode = checkoutMode + + self.comment = comment + } + + public func duplicate() -> CartMetaRequest { + let dict = self.dictionary! + let copy = CartMetaRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + gstin = try container.decode(String.self, forKey: .gstin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pickUpCustomerDetails = try container.decode([String: Any].self, forKey: .pickUpCustomerDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + checkoutMode = try container.decode(String.self, forKey: .checkoutMode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + comment = try container.decode(String.self, forKey: .comment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(gstin, forKey: .gstin) + + try? container.encodeIfPresent(pickUpCustomerDetails, forKey: .pickUpCustomerDetails) + + try? container.encodeIfPresent(checkoutMode, forKey: .checkoutMode) + + try? container.encodeIfPresent(comment, forKey: .comment) + } + } + + /* + Model: CartMetaResponse + Used By: Cart + */ + class CartMetaResponse: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> CartMetaResponse { + let dict = self.dictionary! + let copy = CartMetaResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: CartMetaMissingResponse + Used By: Cart + */ + class CartMetaMissingResponse: Codable { + public var errors: [String]? + + public enum CodingKeys: String, CodingKey { + case errors + } + + public init(errors: [String]?) { + self.errors = errors + } + + public func duplicate() -> CartMetaMissingResponse { + let dict = self.dictionary! + let copy = CartMetaMissingResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + errors = try container.decode([String].self, forKey: .errors) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(errors, forKey: .errors) + } + } + + /* + Model: GetShareCartLinkRequest + Used By: Cart + */ + class GetShareCartLinkRequest: Codable { + public var id: String? + + public var meta: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case id + + case meta + } + + public init(id: String?, meta: [String: Any]?) { + self.id = id + + self.meta = meta + } + + public func duplicate() -> GetShareCartLinkRequest { + let dict = self.dictionary! + let copy = GetShareCartLinkRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(meta, forKey: .meta) + } + } + + /* + Model: GetShareCartLinkResponse + Used By: Cart + */ + class GetShareCartLinkResponse: Codable { + public var shareUrl: String? + + public var token: String? + + public enum CodingKeys: String, CodingKey { + case shareUrl = "share_url" + + case token + } + + public init(shareUrl: String?, token: String?) { + self.shareUrl = shareUrl + + self.token = token + } + + public func duplicate() -> GetShareCartLinkResponse { + let dict = self.dictionary! + let copy = GetShareCartLinkResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + shareUrl = try container.decode(String.self, forKey: .shareUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + token = try container.decode(String.self, forKey: .token) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(shareUrl, forKey: .shareUrl) + + try? container.encodeIfPresent(token, forKey: .token) + } + } + + /* + Model: SharedCartDetails + Used By: Cart + */ + class SharedCartDetails: Codable { + public var user: [String: Any]? + + public var createdOn: String? + + public var meta: [String: Any]? + + public var source: [String: Any]? + + public var token: String? + + public enum CodingKeys: String, CodingKey { + case user + + case createdOn = "created_on" + + case meta + + case source + + case token + } + + public init(createdOn: String?, meta: [String: Any]?, source: [String: Any]?, token: String?, user: [String: Any]?) { + self.user = user + + self.createdOn = createdOn + + self.meta = meta + + self.source = source + + self.token = token + } + + public func duplicate() -> SharedCartDetails { + let dict = self.dictionary! + let copy = SharedCartDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode([String: Any].self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + source = try container.decode([String: Any].self, forKey: .source) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + token = try container.decode(String.self, forKey: .token) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(source, forKey: .source) + + try? container.encodeIfPresent(token, forKey: .token) + } + } + + /* + Model: SharedCart + Used By: Cart + */ + class SharedCart: Codable { + public var restrictCheckout: Bool? + + public var uid: String? + + public var isValid: Bool? + + public var sharedCartDetails: SharedCartDetails? + + public var currency: CartCurrency? + + public var lastModified: String? + + public var cartId: Int? + + public var id: String? + + public var gstin: String? + + public var couponText: String? + + public var paymentSelectionLock: PaymentSelectionLock? + + public var deliveryPromise: ShipmentPromise? + + public var breakupValues: CartBreakup? + + public var deliveryChargeInfo: String? + + public var message: String? + + public var comment: String? + + public var items: [CartProductInfo]? + + public var checkoutMode: String? + + public enum CodingKeys: String, CodingKey { + case restrictCheckout = "restrict_checkout" + + case uid + + case isValid = "is_valid" + + case sharedCartDetails = "shared_cart_details" + + case currency + + case lastModified = "last_modified" + + case cartId = "cart_id" + + case id + + case gstin + + case couponText = "coupon_text" + + case paymentSelectionLock = "payment_selection_lock" + + case deliveryPromise = "delivery_promise" + + case breakupValues = "breakup_values" + + case deliveryChargeInfo = "delivery_charge_info" + + case message + + case comment + + case items + + case checkoutMode = "checkout_mode" + } + + public init(breakupValues: CartBreakup?, cartId: Int?, checkoutMode: String?, comment: String?, couponText: String?, currency: CartCurrency?, deliveryChargeInfo: String?, deliveryPromise: ShipmentPromise?, gstin: String?, id: String?, isValid: Bool?, items: [CartProductInfo]?, lastModified: String?, message: String?, paymentSelectionLock: PaymentSelectionLock?, restrictCheckout: Bool?, sharedCartDetails: SharedCartDetails?, uid: String?) { + self.restrictCheckout = restrictCheckout + + self.uid = uid + + self.isValid = isValid + + self.sharedCartDetails = sharedCartDetails + + self.currency = currency + + self.lastModified = lastModified + + self.cartId = cartId + + self.id = id + + self.gstin = gstin + + self.couponText = couponText + + self.paymentSelectionLock = paymentSelectionLock + + self.deliveryPromise = deliveryPromise + + self.breakupValues = breakupValues + + self.deliveryChargeInfo = deliveryChargeInfo + + self.message = message + + self.comment = comment + + self.items = items + + self.checkoutMode = checkoutMode + } + + public func duplicate() -> SharedCart { + let dict = self.dictionary! + let copy = SharedCart(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + restrictCheckout = try container.decode(Bool.self, forKey: .restrictCheckout) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isValid = try container.decode(Bool.self, forKey: .isValid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sharedCartDetails = try container.decode(SharedCartDetails.self, forKey: .sharedCartDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(CartCurrency.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastModified = try container.decode(String.self, forKey: .lastModified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cartId = try container.decode(Int.self, forKey: .cartId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstin = try container.decode(String.self, forKey: .gstin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + couponText = try container.decode(String.self, forKey: .couponText) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentSelectionLock = try container.decode(PaymentSelectionLock.self, forKey: .paymentSelectionLock) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryPromise = try container.decode(ShipmentPromise.self, forKey: .deliveryPromise) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + breakupValues = try container.decode(CartBreakup.self, forKey: .breakupValues) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryChargeInfo = try container.decode(String.self, forKey: .deliveryChargeInfo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + comment = try container.decode(String.self, forKey: .comment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([CartProductInfo].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + checkoutMode = try container.decode(String.self, forKey: .checkoutMode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(restrictCheckout, forKey: .restrictCheckout) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(isValid, forKey: .isValid) + + try? container.encodeIfPresent(sharedCartDetails, forKey: .sharedCartDetails) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(lastModified, forKey: .lastModified) + + try? container.encodeIfPresent(cartId, forKey: .cartId) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(gstin, forKey: .gstin) + + try? container.encodeIfPresent(couponText, forKey: .couponText) + + try? container.encodeIfPresent(paymentSelectionLock, forKey: .paymentSelectionLock) + + try? container.encodeIfPresent(deliveryPromise, forKey: .deliveryPromise) + + try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) + + try? container.encodeIfPresent(deliveryChargeInfo, forKey: .deliveryChargeInfo) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(comment, forKey: .comment) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(checkoutMode, forKey: .checkoutMode) + } + } + + /* + Model: SharedCartResponse + Used By: Cart + */ + class SharedCartResponse: Codable { + public var cart: SharedCart? + + public var error: String? + + public enum CodingKeys: String, CodingKey { + case cart + + case error + } + + public init(cart: SharedCart?, error: String?) { + self.cart = cart + + self.error = error + } + + public func duplicate() -> SharedCartResponse { + let dict = self.dictionary! + let copy = SharedCartResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + cart = try container.decode(SharedCart.self, forKey: .cart) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + error = try container.decode(String.self, forKey: .error) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(cart, forKey: .cart) + + try? container.encodeIfPresent(error, forKey: .error) + } + } +} diff --git a/Sources/code/application/models/CatalogAppModelClass.swift b/Sources/code/application/models/CatalogAppModelClass.swift new file mode 100644 index 0000000000..012b0f9e7c --- /dev/null +++ b/Sources/code/application/models/CatalogAppModelClass.swift @@ -0,0 +1,9996 @@ +import Foundation + +import Foundation +public extension ApplicationClient { + /* + Model: ProductListingActionPage + Used By: Catalog + */ + class ProductListingActionPage: Codable { + public var params: [String: Any]? + + public var query: [String: Any]? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case params + + case query + + case type + } + + public init(params: [String: Any]?, query: [String: Any]?, type: String?) { + self.params = params + + self.query = query + + self.type = type + } + + public func duplicate() -> ProductListingActionPage { + let dict = self.dictionary! + let copy = ProductListingActionPage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + params = try container.decode([String: Any].self, forKey: .params) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode([String: Any].self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(params, forKey: .params) + + try? container.encodeIfPresent(query, forKey: .query) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: ProductListingAction + Used By: Catalog + */ + class ProductListingAction: Codable { + public var page: ProductListingActionPage? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case page + + case type + } + + public init(page: ProductListingActionPage?, type: String?) { + self.page = page + + self.type = type + } + + public func duplicate() -> ProductListingAction { + let dict = self.dictionary! + let copy = ProductListingAction(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(ProductListingActionPage.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: Meta + Used By: Catalog + */ + class Meta: Codable { + public var source: String? + + public enum CodingKeys: String, CodingKey { + case source + } + + public init(source: String?) { + self.source = source + } + + public func duplicate() -> Meta { + let dict = self.dictionary! + let copy = Meta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + source = try container.decode(String.self, forKey: .source) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(source, forKey: .source) + } + } + + /* + Model: Media + Used By: Catalog + */ + class Media: Codable { + public var url: String? + + public var type: String? + + public var meta: Meta? + + public enum CodingKeys: String, CodingKey { + case url + + case type + + case meta + } + + public init(meta: Meta?, type: String?, url: String?) { + self.url = url + + self.type = type + + self.meta = meta + } + + public func duplicate() -> Media { + let dict = self.dictionary! + let copy = Media(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode(Meta.self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(meta, forKey: .meta) + } + } + + /* + Model: Price + Used By: Catalog + */ + class Price: Codable { + public var currencyCode: String? + + public var max: Double? + + public var min: Double? + + public var currencySymbol: String? + + public enum CodingKeys: String, CodingKey { + case currencyCode = "currency_code" + + case max + + case min + + case currencySymbol = "currency_symbol" + } + + public init(currencyCode: String?, currencySymbol: String?, max: Double?, min: Double?) { + self.currencyCode = currencyCode + + self.max = max + + self.min = min + + self.currencySymbol = currencySymbol + } + + public func duplicate() -> Price { + let dict = self.dictionary! + let copy = Price(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + max = try container.decode(Double.self, forKey: .max) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + min = try container.decode(Double.self, forKey: .min) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencySymbol = try container.decode(String.self, forKey: .currencySymbol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + + try? container.encodeIfPresent(max, forKey: .max) + + try? container.encodeIfPresent(min, forKey: .min) + + try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) + } + } + + /* + Model: ProductListingPrice + Used By: Catalog + */ + class ProductListingPrice: Codable { + public var marked: Price? + + public var effective: Price? + + public enum CodingKeys: String, CodingKey { + case marked + + case effective + } + + public init(effective: Price?, marked: Price?) { + self.marked = marked + + self.effective = effective + } + + public func duplicate() -> ProductListingPrice { + let dict = self.dictionary! + let copy = ProductListingPrice(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + marked = try container.decode(Price.self, forKey: .marked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + effective = try container.decode(Price.self, forKey: .effective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(marked, forKey: .marked) + + try? container.encodeIfPresent(effective, forKey: .effective) + } + } + + /* + Model: MetaFields + Used By: Catalog + */ + class MetaFields: Codable { + public var key: String + + public var value: String + + public enum CodingKeys: String, CodingKey { + case key + + case value + } + + public init(key: String, value: String) { + self.key = key + + self.value = value + } + + public func duplicate() -> MetaFields { + let dict = self.dictionary! + let copy = MetaFields(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + key = try container.decode(String.self, forKey: .key) + + value = try container.decode(String.self, forKey: .value) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: ProductBrand + Used By: Catalog + */ + class ProductBrand: Codable { + public var uid: Int? + + public var name: String? + + public var action: ProductListingAction? + + public var logo: Media? + + public enum CodingKeys: String, CodingKey { + case uid + + case name + + case action + + case logo + } + + public init(action: ProductListingAction?, logo: Media?, name: String?, uid: Int?) { + self.uid = uid + + self.name = name + + self.action = action + + self.logo = logo + } + + public func duplicate() -> ProductBrand { + let dict = self.dictionary! + let copy = ProductBrand(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(ProductListingAction.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(Media.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(logo, forKey: .logo) + } + } + + /* + Model: ProductDetailAttribute + Used By: Catalog + */ + class ProductDetailAttribute: Codable { + public var key: String? + + public var type: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case key + + case type + + case value + } + + public init(key: String?, type: String?, value: String?) { + self.key = key + + self.type = type + + self.value = value + } + + public func duplicate() -> ProductDetailAttribute { + let dict = self.dictionary! + let copy = ProductDetailAttribute(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: ProductDetailGroupedAttribute + Used By: Catalog + */ + class ProductDetailGroupedAttribute: Codable { + public var details: [ProductDetailAttribute]? + + public var title: String? + + public enum CodingKeys: String, CodingKey { + case details + + case title + } + + public init(details: [ProductDetailAttribute]?, title: String?) { + self.details = details + + self.title = title + } + + public func duplicate() -> ProductDetailGroupedAttribute { + let dict = self.dictionary! + let copy = ProductDetailGroupedAttribute(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + details = try container.decode([ProductDetailAttribute].self, forKey: .details) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(details, forKey: .details) + + try? container.encodeIfPresent(title, forKey: .title) + } + } + + /* + Model: ProductDetail + Used By: Catalog + */ + class ProductDetail: Codable { + public var slug: String + + public var similars: [String]? + + public var rating: Double? + + public var name: String? + + public var action: ProductListingAction? + + public var medias: [Media]? + + public var hasVariant: Bool? + + public var description: String? + + public var color: String? + + public var productOnlineDate: String? + + public var ratingCount: Int? + + public var shortDescription: String? + + public var price: ProductListingPrice? + + public var customMeta: [MetaFields]? + + public var itemCode: String? + + public var brand: ProductBrand? + + public var categories: [ProductBrand]? + + public var imageNature: String? + + public var teaserTag: String? + + public var groupedAttributes: [ProductDetailGroupedAttribute]? + + public var attributes: [String: Any]? + + public var type: String? + + public var uid: Int? + + public var highlights: [String]? + + public var discount: String? + + public var itemType: String? + + public var tryouts: [String]? + + public enum CodingKeys: String, CodingKey { + case slug + + case similars + + case rating + + case name + + case action + + case medias + + case hasVariant = "has_variant" + + case description + + case color + + case productOnlineDate = "product_online_date" + + case ratingCount = "rating_count" + + case shortDescription = "short_description" + + case price + + case customMeta = "_custom_meta" + + case itemCode = "item_code" + + case brand + + case categories + + case imageNature = "image_nature" + + case teaserTag = "teaser_tag" + + case groupedAttributes = "grouped_attributes" + + case attributes + + case type + + case uid + + case highlights + + case discount + + case itemType = "item_type" + + case tryouts + } + + public init(action: ProductListingAction?, attributes: [String: Any]?, brand: ProductBrand?, categories: [ProductBrand]?, color: String?, description: String?, discount: String?, groupedAttributes: [ProductDetailGroupedAttribute]?, hasVariant: Bool?, highlights: [String]?, imageNature: String?, itemCode: String?, itemType: String?, medias: [Media]?, name: String?, price: ProductListingPrice?, productOnlineDate: String?, rating: Double?, ratingCount: Int?, shortDescription: String?, similars: [String]?, slug: String, teaserTag: String?, tryouts: [String]?, type: String?, uid: Int?, customMeta: [MetaFields]?) { + self.slug = slug + + self.similars = similars + + self.rating = rating + + self.name = name + + self.action = action + + self.medias = medias + + self.hasVariant = hasVariant + + self.description = description + + self.color = color + + self.productOnlineDate = productOnlineDate + + self.ratingCount = ratingCount + + self.shortDescription = shortDescription + + self.price = price + + self.customMeta = customMeta + + self.itemCode = itemCode + + self.brand = brand + + self.categories = categories + + self.imageNature = imageNature + + self.teaserTag = teaserTag + + self.groupedAttributes = groupedAttributes + + self.attributes = attributes + + self.type = type + + self.uid = uid + + self.highlights = highlights + + self.discount = discount + + self.itemType = itemType + + self.tryouts = tryouts + } + + public func duplicate() -> ProductDetail { + let dict = self.dictionary! + let copy = ProductDetail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + slug = try container.decode(String.self, forKey: .slug) + + do { + similars = try container.decode([String].self, forKey: .similars) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rating = try container.decode(Double.self, forKey: .rating) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(ProductListingAction.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + medias = try container.decode([Media].self, forKey: .medias) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasVariant = try container.decode(Bool.self, forKey: .hasVariant) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + color = try container.decode(String.self, forKey: .color) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productOnlineDate = try container.decode(String.self, forKey: .productOnlineDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ratingCount = try container.decode(Int.self, forKey: .ratingCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shortDescription = try container.decode(String.self, forKey: .shortDescription) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(ProductListingPrice.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customMeta = try container.decode([MetaFields].self, forKey: .customMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemCode = try container.decode(String.self, forKey: .itemCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brand = try container.decode(ProductBrand.self, forKey: .brand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + categories = try container.decode([ProductBrand].self, forKey: .categories) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + imageNature = try container.decode(String.self, forKey: .imageNature) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + teaserTag = try container.decode(String.self, forKey: .teaserTag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + groupedAttributes = try container.decode([ProductDetailGroupedAttribute].self, forKey: .groupedAttributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributes = try container.decode([String: Any].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + highlights = try container.decode([String].self, forKey: .highlights) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discount = try container.decode(String.self, forKey: .discount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemType = try container.decode(String.self, forKey: .itemType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tryouts = try container.decode([String].self, forKey: .tryouts) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(similars, forKey: .similars) + + try? container.encodeIfPresent(rating, forKey: .rating) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(medias, forKey: .medias) + + try? container.encodeIfPresent(hasVariant, forKey: .hasVariant) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(color, forKey: .color) + + try? container.encodeIfPresent(productOnlineDate, forKey: .productOnlineDate) + + try? container.encodeIfPresent(ratingCount, forKey: .ratingCount) + + try? container.encodeIfPresent(shortDescription, forKey: .shortDescription) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(customMeta, forKey: .customMeta) + + try? container.encodeIfPresent(itemCode, forKey: .itemCode) + + try? container.encodeIfPresent(brand, forKey: .brand) + + try? container.encodeIfPresent(categories, forKey: .categories) + + try? container.encodeIfPresent(imageNature, forKey: .imageNature) + + try? container.encodeIfPresent(teaserTag, forKey: .teaserTag) + + try? container.encodeIfPresent(groupedAttributes, forKey: .groupedAttributes) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(highlights, forKey: .highlights) + + try? container.encodeIfPresent(discount, forKey: .discount) + + try? container.encodeIfPresent(itemType, forKey: .itemType) + + try? container.encodeIfPresent(tryouts, forKey: .tryouts) + } + } + + /* + Model: ErrorResponse + Used By: Catalog + */ + class ErrorResponse: Codable { + public var error: String? + + public enum CodingKeys: String, CodingKey { + case error + } + + public init(error: String?) { + self.error = error + } + + public func duplicate() -> ErrorResponse { + let dict = self.dictionary! + let copy = ErrorResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + error = try container.decode(String.self, forKey: .error) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(error, forKey: .error) + } + } + + /* + Model: ProductSizeStores + Used By: Catalog + */ + class ProductSizeStores: Codable { + public var count: Int? + + public enum CodingKeys: String, CodingKey { + case count + } + + public init(count: Int?) { + self.count = count + } + + public func duplicate() -> ProductSizeStores { + let dict = self.dictionary! + let copy = ProductSizeStores(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(count, forKey: .count) + } + } + + /* + Model: ColumnHeader + Used By: Catalog + */ + class ColumnHeader: Codable { + public var value: String? + + public var convertable: Bool? + + public enum CodingKeys: String, CodingKey { + case value + + case convertable + } + + public init(convertable: Bool?, value: String?) { + self.value = value + + self.convertable = convertable + } + + public func duplicate() -> ColumnHeader { + let dict = self.dictionary! + let copy = ColumnHeader(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + convertable = try container.decode(Bool.self, forKey: .convertable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(convertable, forKey: .convertable) + } + } + + /* + Model: ColumnHeaders + Used By: Catalog + */ + class ColumnHeaders: Codable { + public var col5: ColumnHeader? + + public var col4: ColumnHeader? + + public var col6: ColumnHeader? + + public var col1: ColumnHeader? + + public var col2: ColumnHeader? + + public var col3: ColumnHeader? + + public enum CodingKeys: String, CodingKey { + case col5 = "col_5" + + case col4 = "col_4" + + case col6 = "col_6" + + case col1 = "col_1" + + case col2 = "col_2" + + case col3 = "col_3" + } + + public init(col1: ColumnHeader?, col2: ColumnHeader?, col3: ColumnHeader?, col4: ColumnHeader?, col5: ColumnHeader?, col6: ColumnHeader?) { + self.col5 = col5 + + self.col4 = col4 + + self.col6 = col6 + + self.col1 = col1 + + self.col2 = col2 + + self.col3 = col3 + } + + public func duplicate() -> ColumnHeaders { + let dict = self.dictionary! + let copy = ColumnHeaders(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + col5 = try container.decode(ColumnHeader.self, forKey: .col5) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + col4 = try container.decode(ColumnHeader.self, forKey: .col4) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + col6 = try container.decode(ColumnHeader.self, forKey: .col6) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + col1 = try container.decode(ColumnHeader.self, forKey: .col1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + col2 = try container.decode(ColumnHeader.self, forKey: .col2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + col3 = try container.decode(ColumnHeader.self, forKey: .col3) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(col5, forKey: .col5) + + try? container.encodeIfPresent(col4, forKey: .col4) + + try? container.encodeIfPresent(col6, forKey: .col6) + + try? container.encodeIfPresent(col1, forKey: .col1) + + try? container.encodeIfPresent(col2, forKey: .col2) + + try? container.encodeIfPresent(col3, forKey: .col3) + } + } + + /* + Model: SizeChartValues + Used By: Catalog + */ + class SizeChartValues: Codable { + public var col5: String? + + public var col4: String? + + public var col6: String? + + public var col1: String? + + public var col2: String? + + public var col3: String? + + public enum CodingKeys: String, CodingKey { + case col5 = "col_5" + + case col4 = "col_4" + + case col6 = "col_6" + + case col1 = "col_1" + + case col2 = "col_2" + + case col3 = "col_3" + } + + public init(col1: String?, col2: String?, col3: String?, col4: String?, col5: String?, col6: String?) { + self.col5 = col5 + + self.col4 = col4 + + self.col6 = col6 + + self.col1 = col1 + + self.col2 = col2 + + self.col3 = col3 + } + + public func duplicate() -> SizeChartValues { + let dict = self.dictionary! + let copy = SizeChartValues(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + col5 = try container.decode(String.self, forKey: .col5) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + col4 = try container.decode(String.self, forKey: .col4) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + col6 = try container.decode(String.self, forKey: .col6) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + col1 = try container.decode(String.self, forKey: .col1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + col2 = try container.decode(String.self, forKey: .col2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + col3 = try container.decode(String.self, forKey: .col3) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(col5, forKey: .col5) + + try? container.encodeIfPresent(col4, forKey: .col4) + + try? container.encodeIfPresent(col6, forKey: .col6) + + try? container.encodeIfPresent(col1, forKey: .col1) + + try? container.encodeIfPresent(col2, forKey: .col2) + + try? container.encodeIfPresent(col3, forKey: .col3) + } + } + + /* + Model: SizeChart + Used By: Catalog + */ + class SizeChart: Codable { + public var headers: ColumnHeaders? + + public var title: String? + + public var sizeTip: String? + + public var unit: String? + + public var image: String? + + public var sizes: [SizeChartValues]? + + public var description: String? + + public enum CodingKeys: String, CodingKey { + case headers + + case title + + case sizeTip = "size_tip" + + case unit + + case image + + case sizes + + case description + } + + public init(description: String?, headers: ColumnHeaders?, image: String?, sizes: [SizeChartValues]?, sizeTip: String?, title: String?, unit: String?) { + self.headers = headers + + self.title = title + + self.sizeTip = sizeTip + + self.unit = unit + + self.image = image + + self.sizes = sizes + + self.description = description + } + + public func duplicate() -> SizeChart { + let dict = self.dictionary! + let copy = SizeChart(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + headers = try container.decode(ColumnHeaders.self, forKey: .headers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sizeTip = try container.decode(String.self, forKey: .sizeTip) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + unit = try container.decode(String.self, forKey: .unit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + image = try container.decode(String.self, forKey: .image) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sizes = try container.decode([SizeChartValues].self, forKey: .sizes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(headers, forKey: .headers) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(sizeTip, forKey: .sizeTip) + + try? container.encodeIfPresent(unit, forKey: .unit) + + try? container.encodeIfPresent(image, forKey: .image) + + try? container.encodeIfPresent(sizes, forKey: .sizes) + + try? container.encodeIfPresent(description, forKey: .description) + } + } + + /* + Model: ProductSize + Used By: Catalog + */ + class ProductSize: Codable { + public var display: String? + + public var value: String? + + public var isAvailable: Bool? + + public var quantity: Int? + + public enum CodingKeys: String, CodingKey { + case display + + case value + + case isAvailable = "is_available" + + case quantity + } + + public init(display: String?, isAvailable: Bool?, quantity: Int?, value: String?) { + self.display = display + + self.value = value + + self.isAvailable = isAvailable + + self.quantity = quantity + } + + public func duplicate() -> ProductSize { + let dict = self.dictionary! + let copy = ProductSize(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isAvailable = try container.decode(Bool.self, forKey: .isAvailable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(isAvailable, forKey: .isAvailable) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + } + } + + /* + Model: ProductSizes + Used By: Catalog + */ + class ProductSizes: Codable { + public var sellable: Bool? + + public var stores: ProductSizeStores? + + public var discount: String? + + public var price: ProductListingPrice? + + public var sizeChart: SizeChart? + + public var sizes: [ProductSize]? + + public enum CodingKeys: String, CodingKey { + case sellable + + case stores + + case discount + + case price + + case sizeChart = "size_chart" + + case sizes + } + + public init(discount: String?, price: ProductListingPrice?, sellable: Bool?, sizes: [ProductSize]?, sizeChart: SizeChart?, stores: ProductSizeStores?) { + self.sellable = sellable + + self.stores = stores + + self.discount = discount + + self.price = price + + self.sizeChart = sizeChart + + self.sizes = sizes + } + + public func duplicate() -> ProductSizes { + let dict = self.dictionary! + let copy = ProductSizes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + sellable = try container.decode(Bool.self, forKey: .sellable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stores = try container.decode(ProductSizeStores.self, forKey: .stores) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discount = try container.decode(String.self, forKey: .discount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(ProductListingPrice.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sizeChart = try container.decode(SizeChart.self, forKey: .sizeChart) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sizes = try container.decode([ProductSize].self, forKey: .sizes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(sellable, forKey: .sellable) + + try? container.encodeIfPresent(stores, forKey: .stores) + + try? container.encodeIfPresent(discount, forKey: .discount) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(sizeChart, forKey: .sizeChart) + + try? container.encodeIfPresent(sizes, forKey: .sizes) + } + } + + /* + Model: AttributeDetail + Used By: Catalog + */ + class AttributeDetail: Codable { + public var display: String? + + public var logo: String? + + public var key: String? + + public var description: String? + + public enum CodingKeys: String, CodingKey { + case display + + case logo + + case key + + case description + } + + public init(description: String?, display: String?, key: String?, logo: String?) { + self.display = display + + self.logo = logo + + self.key = key + + self.description = description + } + + public func duplicate() -> AttributeDetail { + let dict = self.dictionary! + let copy = AttributeDetail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(description, forKey: .description) + } + } + + /* + Model: AttributeMetadata + Used By: Catalog + */ + class AttributeMetadata: Codable { + public var details: [AttributeDetail]? + + public var title: String? + + public enum CodingKeys: String, CodingKey { + case details + + case title + } + + public init(details: [AttributeDetail]?, title: String?) { + self.details = details + + self.title = title + } + + public func duplicate() -> AttributeMetadata { + let dict = self.dictionary! + let copy = AttributeMetadata(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + details = try container.decode([AttributeDetail].self, forKey: .details) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(details, forKey: .details) + + try? container.encodeIfPresent(title, forKey: .title) + } + } + + /* + Model: ProductsComparisonResponse + Used By: Catalog + */ + class ProductsComparisonResponse: Codable { + public var items: [ProductDetail]? + + public var attributesMetadata: [AttributeMetadata]? + + public enum CodingKeys: String, CodingKey { + case items + + case attributesMetadata = "attributes_metadata" + } + + public init(attributesMetadata: [AttributeMetadata]?, items: [ProductDetail]?) { + self.items = items + + self.attributesMetadata = attributesMetadata + } + + public func duplicate() -> ProductsComparisonResponse { + let dict = self.dictionary! + let copy = ProductsComparisonResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([ProductDetail].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributesMetadata = try container.decode([AttributeMetadata].self, forKey: .attributesMetadata) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(attributesMetadata, forKey: .attributesMetadata) + } + } + + /* + Model: ProductCompareResponse + Used By: Catalog + */ + class ProductCompareResponse: Codable { + public var items: [ProductDetail]? + + public var subtitle: String? + + public var attributesMetadata: [AttributeMetadata]? + + public var title: String? + + public enum CodingKeys: String, CodingKey { + case items + + case subtitle + + case attributesMetadata = "attributes_metadata" + + case title + } + + public init(attributesMetadata: [AttributeMetadata]?, items: [ProductDetail]?, subtitle: String?, title: String?) { + self.items = items + + self.subtitle = subtitle + + self.attributesMetadata = attributesMetadata + + self.title = title + } + + public func duplicate() -> ProductCompareResponse { + let dict = self.dictionary! + let copy = ProductCompareResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([ProductDetail].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subtitle = try container.decode(String.self, forKey: .subtitle) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributesMetadata = try container.decode([AttributeMetadata].self, forKey: .attributesMetadata) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(subtitle, forKey: .subtitle) + + try? container.encodeIfPresent(attributesMetadata, forKey: .attributesMetadata) + + try? container.encodeIfPresent(title, forKey: .title) + } + } + + /* + Model: ProductFrequentlyComparedSimilarResponse + Used By: Catalog + */ + class ProductFrequentlyComparedSimilarResponse: Codable { + public var similars: ProductCompareResponse? + + public enum CodingKeys: String, CodingKey { + case similars + } + + public init(similars: ProductCompareResponse?) { + self.similars = similars + } + + public func duplicate() -> ProductFrequentlyComparedSimilarResponse { + let dict = self.dictionary! + let copy = ProductFrequentlyComparedSimilarResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + similars = try container.decode(ProductCompareResponse.self, forKey: .similars) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(similars, forKey: .similars) + } + } + + /* + Model: ProductSimilarItem + Used By: Catalog + */ + class ProductSimilarItem: Codable { + public var items: [ProductDetail]? + + public var subtitle: String? + + public var title: String? + + public enum CodingKeys: String, CodingKey { + case items + + case subtitle + + case title + } + + public init(items: [ProductDetail]?, subtitle: String?, title: String?) { + self.items = items + + self.subtitle = subtitle + + self.title = title + } + + public func duplicate() -> ProductSimilarItem { + let dict = self.dictionary! + let copy = ProductSimilarItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([ProductDetail].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subtitle = try container.decode(String.self, forKey: .subtitle) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(subtitle, forKey: .subtitle) + + try? container.encodeIfPresent(title, forKey: .title) + } + } + + /* + Model: SimilarProductByTypeResponse + Used By: Catalog + */ + class SimilarProductByTypeResponse: Codable { + public var similars: ProductSimilarItem? + + public enum CodingKeys: String, CodingKey { + case similars + } + + public init(similars: ProductSimilarItem?) { + self.similars = similars + } + + public func duplicate() -> SimilarProductByTypeResponse { + let dict = self.dictionary! + let copy = SimilarProductByTypeResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + similars = try container.decode(ProductSimilarItem.self, forKey: .similars) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(similars, forKey: .similars) + } + } + + /* + Model: ProductVariantItemResponse + Used By: Catalog + */ + class ProductVariantItemResponse: Codable { + public var slug: String? + + public var colorName: String? + + public var color: String? + + public var name: String? + + public var isAvailable: Bool? + + public var medias: [Media]? + + public var action: ProductListingAction? + + public var value: String? + + public var uid: Int? + + public enum CodingKeys: String, CodingKey { + case slug + + case colorName = "color_name" + + case color + + case name + + case isAvailable = "is_available" + + case medias + + case action + + case value + + case uid + } + + public init(action: ProductListingAction?, color: String?, colorName: String?, isAvailable: Bool?, medias: [Media]?, name: String?, slug: String?, uid: Int?, value: String?) { + self.slug = slug + + self.colorName = colorName + + self.color = color + + self.name = name + + self.isAvailable = isAvailable + + self.medias = medias + + self.action = action + + self.value = value + + self.uid = uid + } + + public func duplicate() -> ProductVariantItemResponse { + let dict = self.dictionary! + let copy = ProductVariantItemResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + colorName = try container.decode(String.self, forKey: .colorName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + color = try container.decode(String.self, forKey: .color) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isAvailable = try container.decode(Bool.self, forKey: .isAvailable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + medias = try container.decode([Media].self, forKey: .medias) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(ProductListingAction.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(colorName, forKey: .colorName) + + try? container.encodeIfPresent(color, forKey: .color) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(isAvailable, forKey: .isAvailable) + + try? container.encodeIfPresent(medias, forKey: .medias) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(uid, forKey: .uid) + } + } + + /* + Model: ProductVariantResponse + Used By: Catalog + */ + class ProductVariantResponse: Codable { + public var header: String? + + public var items: [ProductVariantItemResponse]? + + public var key: String? + + public var displayType: String? + + public enum CodingKeys: String, CodingKey { + case header + + case items + + case key + + case displayType = "display_type" + } + + public init(displayType: String?, header: String?, items: [ProductVariantItemResponse]?, key: String?) { + self.header = header + + self.items = items + + self.key = key + + self.displayType = displayType + } + + public func duplicate() -> ProductVariantResponse { + let dict = self.dictionary! + let copy = ProductVariantResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + header = try container.decode(String.self, forKey: .header) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([ProductVariantItemResponse].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayType = try container.decode(String.self, forKey: .displayType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(header, forKey: .header) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(displayType, forKey: .displayType) + } + } + + /* + Model: ProductVariantsResponse + Used By: Catalog + */ + class ProductVariantsResponse: Codable { + public var variants: [ProductVariantResponse]? + + public enum CodingKeys: String, CodingKey { + case variants + } + + public init(variants: [ProductVariantResponse]?) { + self.variants = variants + } + + public func duplicate() -> ProductVariantsResponse { + let dict = self.dictionary! + let copy = ProductVariantsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + variants = try container.decode([ProductVariantResponse].self, forKey: .variants) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(variants, forKey: .variants) + } + } + + /* + Model: StoreDetail + Used By: Catalog + */ + class StoreDetail: Codable { + public var id: Int? + + public var name: String? + + public var code: String? + + public var city: String? + + public enum CodingKeys: String, CodingKey { + case id + + case name + + case code + + case city + } + + public init(city: String?, code: String?, id: Int?, name: String?) { + self.id = id + + self.name = name + + self.code = code + + self.city = city + } + + public func duplicate() -> StoreDetail { + let dict = self.dictionary! + let copy = StoreDetail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(city, forKey: .city) + } + } + + /* + Model: Seller + Used By: Catalog + */ + class Seller: Codable { + public var uid: Int? + + public var name: String? + + public var count: Int? + + public enum CodingKeys: String, CodingKey { + case uid + + case name + + case count + } + + public init(count: Int?, name: String?, uid: Int?) { + self.uid = uid + + self.name = name + + self.count = count + } + + public func duplicate() -> Seller { + let dict = self.dictionary! + let copy = Seller(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(count, forKey: .count) + } + } + + /* + Model: CompanyDetail + Used By: Catalog + */ + class CompanyDetail: Codable { + public var id: Int? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case id + + case name + } + + public init(id: Int?, name: String?) { + self.id = id + + self.name = name + } + + public func duplicate() -> CompanyDetail { + let dict = self.dictionary! + let copy = CompanyDetail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: ProductStockPrice + Used By: Catalog + */ + class ProductStockPrice: Codable { + public var currency: String? + + public var marked: Double? + + public var effective: Double? + + public enum CodingKeys: String, CodingKey { + case currency + + case marked + + case effective + } + + public init(currency: String?, effective: Double?, marked: Double?) { + self.currency = currency + + self.marked = marked + + self.effective = effective + } + + public func duplicate() -> ProductStockPrice { + let dict = self.dictionary! + let copy = ProductStockPrice(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + marked = try container.decode(Double.self, forKey: .marked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + effective = try container.decode(Double.self, forKey: .effective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(marked, forKey: .marked) + + try? container.encodeIfPresent(effective, forKey: .effective) + } + } + + /* + Model: ProductStockStatusItem + Used By: Catalog + */ + class ProductStockStatusItem: Codable { + public var store: StoreDetail? + + public var quantity: Int? + + public var size: String? + + public var seller: Seller? + + public var company: CompanyDetail? + + public var itemId: Int? + + public var uid: String? + + public var price: ProductStockPrice? + + public var identifier: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case store + + case quantity + + case size + + case seller + + case company + + case itemId = "item_id" + + case uid + + case price + + case identifier + } + + public init(company: CompanyDetail?, identifier: [String: Any]?, itemId: Int?, price: ProductStockPrice?, quantity: Int?, seller: Seller?, size: String?, store: StoreDetail?, uid: String?) { + self.store = store + + self.quantity = quantity + + self.size = size + + self.seller = seller + + self.company = company + + self.itemId = itemId + + self.uid = uid + + self.price = price + + self.identifier = identifier + } + + public func duplicate() -> ProductStockStatusItem { + let dict = self.dictionary! + let copy = ProductStockStatusItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + store = try container.decode(StoreDetail.self, forKey: .store) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(String.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + seller = try container.decode(Seller.self, forKey: .seller) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + company = try container.decode(CompanyDetail.self, forKey: .company) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemId = try container.decode(Int.self, forKey: .itemId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(ProductStockPrice.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + identifier = try container.decode([String: Any].self, forKey: .identifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(store, forKey: .store) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(seller, forKey: .seller) + + try? container.encodeIfPresent(company, forKey: .company) + + try? container.encodeIfPresent(itemId, forKey: .itemId) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(identifier, forKey: .identifier) + } + } + + /* + Model: ProductStockStatusResponse + Used By: Catalog + */ + class ProductStockStatusResponse: Codable { + public var items: [ProductStockStatusItem]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [ProductStockStatusItem]?) { + self.items = items + } + + public func duplicate() -> ProductStockStatusResponse { + let dict = self.dictionary! + let copy = ProductStockStatusResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([ProductStockStatusItem].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: ProductStockPolling + Used By: Catalog + */ + class ProductStockPolling: Codable { + public var page: Page + + public var items: [ProductStockStatusItem]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [ProductStockStatusItem]?, page: Page) { + self.page = page + + self.items = items + } + + public func duplicate() -> ProductStockPolling { + let dict = self.dictionary! + let copy = ProductStockPolling(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + page = try container.decode(Page.self, forKey: .page) + + do { + items = try container.decode([ProductStockStatusItem].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: ProductListingDetail + Used By: Catalog + */ + class ProductListingDetail: Codable { + public var slug: String + + public var similars: [String]? + + public var rating: Double? + + public var name: String? + + public var action: ProductListingAction? + + public var medias: [Media]? + + public var hasVariant: Bool? + + public var description: String? + + public var color: String? + + public var productOnlineDate: String? + + public var ratingCount: Int? + + public var shortDescription: String? + + public var price: ProductListingPrice? + + public var customMeta: [MetaFields]? + + public var itemCode: String? + + public var brand: ProductBrand? + + public var categories: [ProductBrand]? + + public var imageNature: String? + + public var teaserTag: String? + + public var groupedAttributes: [ProductDetailGroupedAttribute]? + + public var attributes: [String: Any]? + + public var type: String? + + public var uid: Int? + + public var sellable: Bool? + + public var highlights: [String]? + + public var discount: String? + + public var itemType: String? + + public var tryouts: [String]? + + public enum CodingKeys: String, CodingKey { + case slug + + case similars + + case rating + + case name + + case action + + case medias + + case hasVariant = "has_variant" + + case description + + case color + + case productOnlineDate = "product_online_date" + + case ratingCount = "rating_count" + + case shortDescription = "short_description" + + case price + + case customMeta = "_custom_meta" + + case itemCode = "item_code" + + case brand + + case categories + + case imageNature = "image_nature" + + case teaserTag = "teaser_tag" + + case groupedAttributes = "grouped_attributes" + + case attributes + + case type + + case uid + + case sellable + + case highlights + + case discount + + case itemType = "item_type" + + case tryouts + } + + public init(action: ProductListingAction?, attributes: [String: Any]?, brand: ProductBrand?, categories: [ProductBrand]?, color: String?, description: String?, discount: String?, groupedAttributes: [ProductDetailGroupedAttribute]?, hasVariant: Bool?, highlights: [String]?, imageNature: String?, itemCode: String?, itemType: String?, medias: [Media]?, name: String?, price: ProductListingPrice?, productOnlineDate: String?, rating: Double?, ratingCount: Int?, sellable: Bool?, shortDescription: String?, similars: [String]?, slug: String, teaserTag: String?, tryouts: [String]?, type: String?, uid: Int?, customMeta: [MetaFields]?) { + self.slug = slug + + self.similars = similars + + self.rating = rating + + self.name = name + + self.action = action + + self.medias = medias + + self.hasVariant = hasVariant + + self.description = description + + self.color = color + + self.productOnlineDate = productOnlineDate + + self.ratingCount = ratingCount + + self.shortDescription = shortDescription + + self.price = price + + self.customMeta = customMeta + + self.itemCode = itemCode + + self.brand = brand + + self.categories = categories + + self.imageNature = imageNature + + self.teaserTag = teaserTag + + self.groupedAttributes = groupedAttributes + + self.attributes = attributes + + self.type = type + + self.uid = uid + + self.sellable = sellable + + self.highlights = highlights + + self.discount = discount + + self.itemType = itemType + + self.tryouts = tryouts + } + + public func duplicate() -> ProductListingDetail { + let dict = self.dictionary! + let copy = ProductListingDetail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + slug = try container.decode(String.self, forKey: .slug) + + do { + similars = try container.decode([String].self, forKey: .similars) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rating = try container.decode(Double.self, forKey: .rating) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(ProductListingAction.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + medias = try container.decode([Media].self, forKey: .medias) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasVariant = try container.decode(Bool.self, forKey: .hasVariant) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + color = try container.decode(String.self, forKey: .color) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productOnlineDate = try container.decode(String.self, forKey: .productOnlineDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ratingCount = try container.decode(Int.self, forKey: .ratingCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shortDescription = try container.decode(String.self, forKey: .shortDescription) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(ProductListingPrice.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customMeta = try container.decode([MetaFields].self, forKey: .customMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemCode = try container.decode(String.self, forKey: .itemCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brand = try container.decode(ProductBrand.self, forKey: .brand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + categories = try container.decode([ProductBrand].self, forKey: .categories) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + imageNature = try container.decode(String.self, forKey: .imageNature) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + teaserTag = try container.decode(String.self, forKey: .teaserTag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + groupedAttributes = try container.decode([ProductDetailGroupedAttribute].self, forKey: .groupedAttributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributes = try container.decode([String: Any].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sellable = try container.decode(Bool.self, forKey: .sellable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + highlights = try container.decode([String].self, forKey: .highlights) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discount = try container.decode(String.self, forKey: .discount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemType = try container.decode(String.self, forKey: .itemType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tryouts = try container.decode([String].self, forKey: .tryouts) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(similars, forKey: .similars) + + try? container.encodeIfPresent(rating, forKey: .rating) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(medias, forKey: .medias) + + try? container.encodeIfPresent(hasVariant, forKey: .hasVariant) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(color, forKey: .color) + + try? container.encodeIfPresent(productOnlineDate, forKey: .productOnlineDate) + + try? container.encodeIfPresent(ratingCount, forKey: .ratingCount) + + try? container.encodeIfPresent(shortDescription, forKey: .shortDescription) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(customMeta, forKey: .customMeta) + + try? container.encodeIfPresent(itemCode, forKey: .itemCode) + + try? container.encodeIfPresent(brand, forKey: .brand) + + try? container.encodeIfPresent(categories, forKey: .categories) + + try? container.encodeIfPresent(imageNature, forKey: .imageNature) + + try? container.encodeIfPresent(teaserTag, forKey: .teaserTag) + + try? container.encodeIfPresent(groupedAttributes, forKey: .groupedAttributes) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(sellable, forKey: .sellable) + + try? container.encodeIfPresent(highlights, forKey: .highlights) + + try? container.encodeIfPresent(discount, forKey: .discount) + + try? container.encodeIfPresent(itemType, forKey: .itemType) + + try? container.encodeIfPresent(tryouts, forKey: .tryouts) + } + } + + /* + Model: ProductFiltersKey + Used By: Catalog + */ + class ProductFiltersKey: Codable { + public var kind: String? + + public var display: String + + public var name: String + + public var logo: String? + + public enum CodingKeys: String, CodingKey { + case kind + + case display + + case name + + case logo + } + + public init(display: String, kind: String?, logo: String?, name: String) { + self.kind = kind + + self.display = display + + self.name = name + + self.logo = logo + } + + public func duplicate() -> ProductFiltersKey { + let dict = self.dictionary! + let copy = ProductFiltersKey(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + kind = try container.decode(String.self, forKey: .kind) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + display = try container.decode(String.self, forKey: .display) + + name = try container.decode(String.self, forKey: .name) + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(kind, forKey: .kind) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(logo, forKey: .logo) + } + } + + /* + Model: ProductFiltersValue + Used By: Catalog + */ + class ProductFiltersValue: Codable { + public var currencySymbol: String? + + public var queryFormat: String? + + public var selectedMin: Int? + + public var isSelected: Bool + + public var min: Int? + + public var selectedMax: Int? + + public var count: Int? + + public var max: Int? + + public var value: String? + + public var display: String + + public var currencyCode: String? + + public var displayFormat: String? + + public enum CodingKeys: String, CodingKey { + case currencySymbol = "currency_symbol" + + case queryFormat = "query_format" + + case selectedMin = "selected_min" + + case isSelected = "is_selected" + + case min + + case selectedMax = "selected_max" + + case count + + case max + + case value + + case display + + case currencyCode = "currency_code" + + case displayFormat = "display_format" + } + + public init(count: Int?, currencyCode: String?, currencySymbol: String?, display: String, displayFormat: String?, isSelected: Bool, max: Int?, min: Int?, queryFormat: String?, selectedMax: Int?, selectedMin: Int?, value: String?) { + self.currencySymbol = currencySymbol + + self.queryFormat = queryFormat + + self.selectedMin = selectedMin + + self.isSelected = isSelected + + self.min = min + + self.selectedMax = selectedMax + + self.count = count + + self.max = max + + self.value = value + + self.display = display + + self.currencyCode = currencyCode + + self.displayFormat = displayFormat + } + + public func duplicate() -> ProductFiltersValue { + let dict = self.dictionary! + let copy = ProductFiltersValue(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + currencySymbol = try container.decode(String.self, forKey: .currencySymbol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + queryFormat = try container.decode(String.self, forKey: .queryFormat) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + selectedMin = try container.decode(Int.self, forKey: .selectedMin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + isSelected = try container.decode(Bool.self, forKey: .isSelected) + + do { + min = try container.decode(Int.self, forKey: .min) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + selectedMax = try container.decode(Int.self, forKey: .selectedMax) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + max = try container.decode(Int.self, forKey: .max) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + display = try container.decode(String.self, forKey: .display) + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayFormat = try container.decode(String.self, forKey: .displayFormat) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) + + try? container.encodeIfPresent(queryFormat, forKey: .queryFormat) + + try? container.encodeIfPresent(selectedMin, forKey: .selectedMin) + + try? container.encodeIfPresent(isSelected, forKey: .isSelected) + + try? container.encodeIfPresent(min, forKey: .min) + + try? container.encodeIfPresent(selectedMax, forKey: .selectedMax) + + try? container.encodeIfPresent(count, forKey: .count) + + try? container.encodeIfPresent(max, forKey: .max) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + + try? container.encodeIfPresent(displayFormat, forKey: .displayFormat) + } + } + + /* + Model: ProductFilters + Used By: Catalog + */ + class ProductFilters: Codable { + public var key: ProductFiltersKey + + public var values: [ProductFiltersValue] + + public enum CodingKeys: String, CodingKey { + case key + + case values + } + + public init(key: ProductFiltersKey, values: [ProductFiltersValue]) { + self.key = key + + self.values = values + } + + public func duplicate() -> ProductFilters { + let dict = self.dictionary! + let copy = ProductFilters(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + key = try container.decode(ProductFiltersKey.self, forKey: .key) + + values = try container.decode([ProductFiltersValue].self, forKey: .values) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(values, forKey: .values) + } + } + + /* + Model: ProductSortOn + Used By: Catalog + */ + class ProductSortOn: Codable { + public var isSelected: Bool? + + public var name: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case isSelected = "is_selected" + + case name + + case value + } + + public init(isSelected: Bool?, name: String?, value: String?) { + self.isSelected = isSelected + + self.name = name + + self.value = value + } + + public func duplicate() -> ProductSortOn { + let dict = self.dictionary! + let copy = ProductSortOn(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isSelected = try container.decode(Bool.self, forKey: .isSelected) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isSelected, forKey: .isSelected) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: ProductListingResponse + Used By: Catalog + */ + class ProductListingResponse: Codable { + public var page: Page + + public var items: [ProductListingDetail]? + + public var filters: [ProductFilters]? + + public var sortOn: [ProductSortOn]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + + case filters + + case sortOn = "sort_on" + } + + public init(filters: [ProductFilters]?, items: [ProductListingDetail]?, page: Page, sortOn: [ProductSortOn]?) { + self.page = page + + self.items = items + + self.filters = filters + + self.sortOn = sortOn + } + + public func duplicate() -> ProductListingResponse { + let dict = self.dictionary! + let copy = ProductListingResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + page = try container.decode(Page.self, forKey: .page) + + do { + items = try container.decode([ProductListingDetail].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filters = try container.decode([ProductFilters].self, forKey: .filters) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sortOn = try container.decode([ProductSortOn].self, forKey: .sortOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(filters, forKey: .filters) + + try? container.encodeIfPresent(sortOn, forKey: .sortOn) + } + } + + /* + Model: ImageUrls + Used By: Catalog + */ + class ImageUrls: Codable { + public var portrait: Media? + + public var landscape: Media? + + public enum CodingKeys: String, CodingKey { + case portrait + + case landscape + } + + public init(landscape: Media?, portrait: Media?) { + self.portrait = portrait + + self.landscape = landscape + } + + public func duplicate() -> ImageUrls { + let dict = self.dictionary! + let copy = ImageUrls(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + portrait = try container.decode(Media.self, forKey: .portrait) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + landscape = try container.decode(Media.self, forKey: .landscape) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(portrait, forKey: .portrait) + + try? container.encodeIfPresent(landscape, forKey: .landscape) + } + } + + /* + Model: BrandItem + Used By: Catalog + */ + class BrandItem: Codable { + public var slug: String? + + public var name: String? + + public var discount: String? + + public var banners: ImageUrls? + + public var action: ProductListingAction? + + public var logo: Media? + + public var uid: Int? + + public var departments: [String]? + + public enum CodingKeys: String, CodingKey { + case slug + + case name + + case discount + + case banners + + case action + + case logo + + case uid + + case departments + } + + public init(action: ProductListingAction?, banners: ImageUrls?, departments: [String]?, discount: String?, logo: Media?, name: String?, slug: String?, uid: Int?) { + self.slug = slug + + self.name = name + + self.discount = discount + + self.banners = banners + + self.action = action + + self.logo = logo + + self.uid = uid + + self.departments = departments + } + + public func duplicate() -> BrandItem { + let dict = self.dictionary! + let copy = BrandItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discount = try container.decode(String.self, forKey: .discount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banners = try container.decode(ImageUrls.self, forKey: .banners) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(ProductListingAction.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(Media.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + departments = try container.decode([String].self, forKey: .departments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(discount, forKey: .discount) + + try? container.encodeIfPresent(banners, forKey: .banners) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(departments, forKey: .departments) + } + } + + /* + Model: BrandListingResponse + Used By: Catalog + */ + class BrandListingResponse: Codable { + public var page: Page + + public var items: [BrandItem]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [BrandItem]?, page: Page) { + self.page = page + + self.items = items + } + + public func duplicate() -> BrandListingResponse { + let dict = self.dictionary! + let copy = BrandListingResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + page = try container.decode(Page.self, forKey: .page) + + do { + items = try container.decode([BrandItem].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: BrandDetailResponse + Used By: Catalog + */ + class BrandDetailResponse: Codable { + public var uid: Int? + + public var name: String? + + public var banners: ImageUrls? + + public var logo: Media? + + public enum CodingKeys: String, CodingKey { + case uid + + case name + + case banners + + case logo + } + + public init(banners: ImageUrls?, logo: Media?, name: String?, uid: Int?) { + self.uid = uid + + self.name = name + + self.banners = banners + + self.logo = logo + } + + public func duplicate() -> BrandDetailResponse { + let dict = self.dictionary! + let copy = BrandDetailResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banners = try container.decode(ImageUrls.self, forKey: .banners) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(Media.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(banners, forKey: .banners) + + try? container.encodeIfPresent(logo, forKey: .logo) + } + } + + /* + Model: DepartmentIdentifier + Used By: Catalog + */ + class DepartmentIdentifier: Codable { + public var uid: Int? + + public var slug: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case slug + } + + public init(slug: String?, uid: Int?) { + self.uid = uid + + self.slug = slug + } + + public func duplicate() -> DepartmentIdentifier { + let dict = self.dictionary! + let copy = DepartmentIdentifier(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(slug, forKey: .slug) + } + } + + /* + Model: ThirdLevelChild + Used By: Catalog + */ + class ThirdLevelChild: Codable { + public var customJson: [String: Any]? + + public var slug: String? + + public var name: String? + + public var banners: ImageUrls? + + public var childs: [[String: Any]]? + + public var action: ProductListingAction? + + public var uid: Int? + + public enum CodingKeys: String, CodingKey { + case customJson = "_custom_json" + + case slug + + case name + + case banners + + case childs + + case action + + case uid + } + + public init(action: ProductListingAction?, banners: ImageUrls?, childs: [[String: Any]]?, name: String?, slug: String?, uid: Int?, customJson: [String: Any]?) { + self.customJson = customJson + + self.slug = slug + + self.name = name + + self.banners = banners + + self.childs = childs + + self.action = action + + self.uid = uid + } + + public func duplicate() -> ThirdLevelChild { + let dict = self.dictionary! + let copy = ThirdLevelChild(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banners = try container.decode(ImageUrls.self, forKey: .banners) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + childs = try container.decode([[String: Any]].self, forKey: .childs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(ProductListingAction.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(banners, forKey: .banners) + + try? container.encodeIfPresent(childs, forKey: .childs) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(uid, forKey: .uid) + } + } + + /* + Model: SecondLevelChild + Used By: Catalog + */ + class SecondLevelChild: Codable { + public var customJson: [String: Any]? + + public var slug: String? + + public var name: String? + + public var banners: ImageUrls? + + public var childs: [ThirdLevelChild]? + + public var action: ProductListingAction? + + public var uid: Int? + + public enum CodingKeys: String, CodingKey { + case customJson = "_custom_json" + + case slug + + case name + + case banners + + case childs + + case action + + case uid + } + + public init(action: ProductListingAction?, banners: ImageUrls?, childs: [ThirdLevelChild]?, name: String?, slug: String?, uid: Int?, customJson: [String: Any]?) { + self.customJson = customJson + + self.slug = slug + + self.name = name + + self.banners = banners + + self.childs = childs + + self.action = action + + self.uid = uid + } + + public func duplicate() -> SecondLevelChild { + let dict = self.dictionary! + let copy = SecondLevelChild(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banners = try container.decode(ImageUrls.self, forKey: .banners) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + childs = try container.decode([ThirdLevelChild].self, forKey: .childs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(ProductListingAction.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(banners, forKey: .banners) + + try? container.encodeIfPresent(childs, forKey: .childs) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(uid, forKey: .uid) + } + } + + /* + Model: Child + Used By: Catalog + */ + class Child: Codable { + public var customJson: [String: Any]? + + public var slug: String? + + public var name: String? + + public var banners: ImageUrls? + + public var childs: [SecondLevelChild]? + + public var action: ProductListingAction? + + public var uid: Int? + + public enum CodingKeys: String, CodingKey { + case customJson = "_custom_json" + + case slug + + case name + + case banners + + case childs + + case action + + case uid + } + + public init(action: ProductListingAction?, banners: ImageUrls?, childs: [SecondLevelChild]?, name: String?, slug: String?, uid: Int?, customJson: [String: Any]?) { + self.customJson = customJson + + self.slug = slug + + self.name = name + + self.banners = banners + + self.childs = childs + + self.action = action + + self.uid = uid + } + + public func duplicate() -> Child { + let dict = self.dictionary! + let copy = Child(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banners = try container.decode(ImageUrls.self, forKey: .banners) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + childs = try container.decode([SecondLevelChild].self, forKey: .childs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(ProductListingAction.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(banners, forKey: .banners) + + try? container.encodeIfPresent(childs, forKey: .childs) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(uid, forKey: .uid) + } + } + + /* + Model: CategoryItems + Used By: Catalog + */ + class CategoryItems: Codable { + public var slug: String? + + public var name: String? + + public var banners: ImageUrls? + + public var childs: [Child]? + + public var action: ProductListingAction? + + public var uid: Int? + + public enum CodingKeys: String, CodingKey { + case slug + + case name + + case banners + + case childs + + case action + + case uid + } + + public init(action: ProductListingAction?, banners: ImageUrls?, childs: [Child]?, name: String?, slug: String?, uid: Int?) { + self.slug = slug + + self.name = name + + self.banners = banners + + self.childs = childs + + self.action = action + + self.uid = uid + } + + public func duplicate() -> CategoryItems { + let dict = self.dictionary! + let copy = CategoryItems(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banners = try container.decode(ImageUrls.self, forKey: .banners) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + childs = try container.decode([Child].self, forKey: .childs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(ProductListingAction.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(banners, forKey: .banners) + + try? container.encodeIfPresent(childs, forKey: .childs) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(uid, forKey: .uid) + } + } + + /* + Model: DepartmentCategoryTree + Used By: Catalog + */ + class DepartmentCategoryTree: Codable { + public var items: [CategoryItems]? + + public var department: String? + + public enum CodingKeys: String, CodingKey { + case items + + case department + } + + public init(department: String?, items: [CategoryItems]?) { + self.items = items + + self.department = department + } + + public func duplicate() -> DepartmentCategoryTree { + let dict = self.dictionary! + let copy = DepartmentCategoryTree(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([CategoryItems].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + department = try container.decode(String.self, forKey: .department) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(department, forKey: .department) + } + } + + /* + Model: CategoryListingResponse + Used By: Catalog + */ + class CategoryListingResponse: Codable { + public var departments: [DepartmentIdentifier]? + + public var data: [DepartmentCategoryTree]? + + public enum CodingKeys: String, CodingKey { + case departments + + case data + } + + public init(data: [DepartmentCategoryTree]?, departments: [DepartmentIdentifier]?) { + self.departments = departments + + self.data = data + } + + public func duplicate() -> CategoryListingResponse { + let dict = self.dictionary! + let copy = CategoryListingResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + departments = try container.decode([DepartmentIdentifier].self, forKey: .departments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode([DepartmentCategoryTree].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(departments, forKey: .departments) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: CategoryMetaResponse + Used By: Catalog + */ + class CategoryMetaResponse: Codable { + public var uid: Int? + + public var name: String? + + public var banners: ImageUrls? + + public var logo: Media? + + public enum CodingKeys: String, CodingKey { + case uid + + case name + + case banners + + case logo + } + + public init(banners: ImageUrls?, logo: Media?, name: String?, uid: Int?) { + self.uid = uid + + self.name = name + + self.banners = banners + + self.logo = logo + } + + public func duplicate() -> CategoryMetaResponse { + let dict = self.dictionary! + let copy = CategoryMetaResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banners = try container.decode(ImageUrls.self, forKey: .banners) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(Media.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(banners, forKey: .banners) + + try? container.encodeIfPresent(logo, forKey: .logo) + } + } + + /* + Model: HomeListingResponse + Used By: Catalog + */ + class HomeListingResponse: Codable { + public var message: String? + + public var page: Page + + public var items: [ProductListingDetail]? + + public enum CodingKeys: String, CodingKey { + case message + + case page + + case items + } + + public init(items: [ProductListingDetail]?, message: String?, page: Page) { + self.message = message + + self.page = page + + self.items = items + } + + public func duplicate() -> HomeListingResponse { + let dict = self.dictionary! + let copy = HomeListingResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + page = try container.decode(Page.self, forKey: .page) + + do { + items = try container.decode([ProductListingDetail].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: Department + Used By: Catalog + */ + class Department: Codable { + public var slug: String? + + public var name: String? + + public var logo: Media? + + public var uid: Int? + + public var priorityOrder: Int? + + public enum CodingKeys: String, CodingKey { + case slug + + case name + + case logo + + case uid + + case priorityOrder = "priority_order" + } + + public init(logo: Media?, name: String?, priorityOrder: Int?, slug: String?, uid: Int?) { + self.slug = slug + + self.name = name + + self.logo = logo + + self.uid = uid + + self.priorityOrder = priorityOrder + } + + public func duplicate() -> Department { + let dict = self.dictionary! + let copy = Department(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(Media.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priorityOrder = try container.decode(Int.self, forKey: .priorityOrder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(priorityOrder, forKey: .priorityOrder) + } + } + + /* + Model: DepartmentResponse + Used By: Catalog + */ + class DepartmentResponse: Codable { + public var items: [Department]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [Department]?) { + self.items = items + } + + public func duplicate() -> DepartmentResponse { + let dict = self.dictionary! + let copy = DepartmentResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Department].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: AutocompleteItem + Used By: Catalog + */ + class AutocompleteItem: Codable { + public var action: ProductListingAction? + + public var display: String? + + public var type: String? + + public var logo: Media? + + public enum CodingKeys: String, CodingKey { + case action + + case display + + case type + + case logo + } + + public init(action: ProductListingAction?, display: String?, logo: Media?, type: String?) { + self.action = action + + self.display = display + + self.type = type + + self.logo = logo + } + + public func duplicate() -> AutocompleteItem { + let dict = self.dictionary! + let copy = AutocompleteItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + action = try container.decode(ProductListingAction.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(Media.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(logo, forKey: .logo) + } + } + + /* + Model: AutoCompleteResponse + Used By: Catalog + */ + class AutoCompleteResponse: Codable { + public var items: [AutocompleteItem]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [AutocompleteItem]?) { + self.items = items + } + + public func duplicate() -> AutoCompleteResponse { + let dict = self.dictionary! + let copy = AutoCompleteResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([AutocompleteItem].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: GetCollectionDetailNest + Used By: Catalog + */ + class GetCollectionDetailNest: Codable { + public var slug: String? + + public var name: String? + + public var banners: ImageUrls? + + public var action: ProductListingAction? + + public var description: String? + + public var meta: [String: Any]? + + public var visibleFacetsKeys: [String]? + + public var query: [String: Any]? + + public var badge: [String: Any]? + + public var type: String? + + public var allowFacets: Bool? + + public var logo: Media? + + public var uid: String? + + public var appId: String? + + public var schedule: [String: Any]? + + public var isActive: Bool? + + public var allowSort: Bool? + + public var cron: [String: Any]? + + public var tag: [String]? + + public enum CodingKeys: String, CodingKey { + case slug + + case name + + case banners + + case action + + case description + + case meta + + case visibleFacetsKeys = "visible_facets_keys" + + case query + + case badge + + case type + + case allowFacets = "allow_facets" + + case logo + + case uid + + case appId = "app_id" + + case schedule = "_schedule" + + case isActive = "is_active" + + case allowSort = "allow_sort" + + case cron + + case tag + } + + public init(action: ProductListingAction?, allowFacets: Bool?, allowSort: Bool?, appId: String?, badge: [String: Any]?, banners: ImageUrls?, cron: [String: Any]?, description: String?, isActive: Bool?, logo: Media?, meta: [String: Any]?, name: String?, query: [String: Any]?, slug: String?, tag: [String]?, type: String?, uid: String?, visibleFacetsKeys: [String]?, schedule: [String: Any]?) { + self.slug = slug + + self.name = name + + self.banners = banners + + self.action = action + + self.description = description + + self.meta = meta + + self.visibleFacetsKeys = visibleFacetsKeys + + self.query = query + + self.badge = badge + + self.type = type + + self.allowFacets = allowFacets + + self.logo = logo + + self.uid = uid + + self.appId = appId + + self.schedule = schedule + + self.isActive = isActive + + self.allowSort = allowSort + + self.cron = cron + + self.tag = tag + } + + public func duplicate() -> GetCollectionDetailNest { + let dict = self.dictionary! + let copy = GetCollectionDetailNest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banners = try container.decode(ImageUrls.self, forKey: .banners) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(ProductListingAction.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + visibleFacetsKeys = try container.decode([String].self, forKey: .visibleFacetsKeys) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode([String: Any].self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + badge = try container.decode([String: Any].self, forKey: .badge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allowFacets = try container.decode(Bool.self, forKey: .allowFacets) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(Media.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode([String: Any].self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allowSort = try container.decode(Bool.self, forKey: .allowSort) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cron = try container.decode([String: Any].self, forKey: .cron) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tag = try container.decode([String].self, forKey: .tag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(banners, forKey: .banners) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(visibleFacetsKeys, forKey: .visibleFacetsKeys) + + try? container.encodeIfPresent(query, forKey: .query) + + try? container.encodeIfPresent(badge, forKey: .badge) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(allowFacets, forKey: .allowFacets) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(allowSort, forKey: .allowSort) + + try? container.encodeIfPresent(cron, forKey: .cron) + + try? container.encodeIfPresent(tag, forKey: .tag) + } + } + + /* + Model: CollectionListingFilterType + Used By: Catalog + */ + class CollectionListingFilterType: Codable { + public var isSelected: Bool? + + public var name: String? + + public var display: String? + + public enum CodingKeys: String, CodingKey { + case isSelected = "is_selected" + + case name + + case display + } + + public init(display: String?, isSelected: Bool?, name: String?) { + self.isSelected = isSelected + + self.name = name + + self.display = display + } + + public func duplicate() -> CollectionListingFilterType { + let dict = self.dictionary! + let copy = CollectionListingFilterType(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isSelected = try container.decode(Bool.self, forKey: .isSelected) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isSelected, forKey: .isSelected) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(display, forKey: .display) + } + } + + /* + Model: CollectionListingFilterTag + Used By: Catalog + */ + class CollectionListingFilterTag: Codable { + public var isSelected: Bool? + + public var name: String? + + public var display: String? + + public enum CodingKeys: String, CodingKey { + case isSelected = "is_selected" + + case name + + case display + } + + public init(display: String?, isSelected: Bool?, name: String?) { + self.isSelected = isSelected + + self.name = name + + self.display = display + } + + public func duplicate() -> CollectionListingFilterTag { + let dict = self.dictionary! + let copy = CollectionListingFilterTag(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isSelected = try container.decode(Bool.self, forKey: .isSelected) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isSelected, forKey: .isSelected) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(display, forKey: .display) + } + } + + /* + Model: CollectionListingFilter + Used By: Catalog + */ + class CollectionListingFilter: Codable { + public var type: [CollectionListingFilterType]? + + public var tags: [CollectionListingFilterTag]? + + public enum CodingKeys: String, CodingKey { + case type + + case tags + } + + public init(tags: [CollectionListingFilterTag]?, type: [CollectionListingFilterType]?) { + self.type = type + + self.tags = tags + } + + public func duplicate() -> CollectionListingFilter { + let dict = self.dictionary! + let copy = CollectionListingFilter(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode([CollectionListingFilterType].self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([CollectionListingFilterTag].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: GetCollectionListingResponse + Used By: Catalog + */ + class GetCollectionListingResponse: Codable { + public var page: Page + + public var items: [GetCollectionDetailNest]? + + public var filters: CollectionListingFilter? + + public enum CodingKeys: String, CodingKey { + case page + + case items + + case filters + } + + public init(filters: CollectionListingFilter?, items: [GetCollectionDetailNest]?, page: Page) { + self.page = page + + self.items = items + + self.filters = filters + } + + public func duplicate() -> GetCollectionListingResponse { + let dict = self.dictionary! + let copy = GetCollectionListingResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + page = try container.decode(Page.self, forKey: .page) + + do { + items = try container.decode([GetCollectionDetailNest].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filters = try container.decode(CollectionListingFilter.self, forKey: .filters) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(filters, forKey: .filters) + } + } + + /* + Model: CollectionDetailResponse + Used By: Catalog + */ + class CollectionDetailResponse: Codable { + public var appId: String? + + public var slug: String? + + public var schedule: [String: Any]? + + public var isActive: Bool? + + public var allowFacets: Bool? + + public var name: String? + + public var banners: ImageUrls? + + public var allowSort: Bool? + + public var badge: [String: Any]? + + public var meta: [String: Any]? + + public var cron: [String: Any]? + + public var tag: [String]? + + public var type: String? + + public var logo: Media? + + public var visibleFacetsKeys: [String]? + + public var query: [String: Any]? + + public var description: String? + + public enum CodingKeys: String, CodingKey { + case appId = "app_id" + + case slug + + case schedule = "_schedule" + + case isActive = "is_active" + + case allowFacets = "allow_facets" + + case name + + case banners + + case allowSort = "allow_sort" + + case badge + + case meta + + case cron + + case tag + + case type + + case logo + + case visibleFacetsKeys = "visible_facets_keys" + + case query + + case description + } + + public init(allowFacets: Bool?, allowSort: Bool?, appId: String?, badge: [String: Any]?, banners: ImageUrls?, cron: [String: Any]?, description: String?, isActive: Bool?, logo: Media?, meta: [String: Any]?, name: String?, query: [String: Any]?, slug: String?, tag: [String]?, type: String?, visibleFacetsKeys: [String]?, schedule: [String: Any]?) { + self.appId = appId + + self.slug = slug + + self.schedule = schedule + + self.isActive = isActive + + self.allowFacets = allowFacets + + self.name = name + + self.banners = banners + + self.allowSort = allowSort + + self.badge = badge + + self.meta = meta + + self.cron = cron + + self.tag = tag + + self.type = type + + self.logo = logo + + self.visibleFacetsKeys = visibleFacetsKeys + + self.query = query + + self.description = description + } + + public func duplicate() -> CollectionDetailResponse { + let dict = self.dictionary! + let copy = CollectionDetailResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode([String: Any].self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allowFacets = try container.decode(Bool.self, forKey: .allowFacets) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banners = try container.decode(ImageUrls.self, forKey: .banners) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allowSort = try container.decode(Bool.self, forKey: .allowSort) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + badge = try container.decode([String: Any].self, forKey: .badge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cron = try container.decode([String: Any].self, forKey: .cron) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tag = try container.decode([String].self, forKey: .tag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(Media.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + visibleFacetsKeys = try container.decode([String].self, forKey: .visibleFacetsKeys) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode([String: Any].self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(allowFacets, forKey: .allowFacets) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(banners, forKey: .banners) + + try? container.encodeIfPresent(allowSort, forKey: .allowSort) + + try? container.encodeIfPresent(badge, forKey: .badge) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(cron, forKey: .cron) + + try? container.encodeIfPresent(tag, forKey: .tag) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(visibleFacetsKeys, forKey: .visibleFacetsKeys) + + try? container.encodeIfPresent(query, forKey: .query) + + try? container.encodeIfPresent(description, forKey: .description) + } + } + + /* + Model: GetFollowListingResponse + Used By: Catalog + */ + class GetFollowListingResponse: Codable { + public var page: Page + + public var items: [ProductListingDetail] + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [ProductListingDetail], page: Page) { + self.page = page + + self.items = items + } + + public func duplicate() -> GetFollowListingResponse { + let dict = self.dictionary! + let copy = GetFollowListingResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + page = try container.decode(Page.self, forKey: .page) + + items = try container.decode([ProductListingDetail].self, forKey: .items) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: FollowPostResponse + Used By: Catalog + */ + class FollowPostResponse: Codable { + public var id: String + + public var message: String + + public enum CodingKeys: String, CodingKey { + case id + + case message + } + + public init(id: String, message: String) { + self.id = id + + self.message = message + } + + public func duplicate() -> FollowPostResponse { + let dict = self.dictionary! + let copy = FollowPostResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + id = try container.decode(String.self, forKey: .id) + + message = try container.decode(String.self, forKey: .message) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: FollowerCountResponse + Used By: Catalog + */ + class FollowerCountResponse: Codable { + public var count: Int? + + public enum CodingKeys: String, CodingKey { + case count + } + + public init(count: Int?) { + self.count = count + } + + public func duplicate() -> FollowerCountResponse { + let dict = self.dictionary! + let copy = FollowerCountResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(count, forKey: .count) + } + } + + /* + Model: FollowIdsData + Used By: Catalog + */ + class FollowIdsData: Codable { + public var products: [Int]? + + public var collections: [Int]? + + public var brands: [Int]? + + public enum CodingKeys: String, CodingKey { + case products + + case collections + + case brands + } + + public init(brands: [Int]?, collections: [Int]?, products: [Int]?) { + self.products = products + + self.collections = collections + + self.brands = brands + } + + public func duplicate() -> FollowIdsData { + let dict = self.dictionary! + let copy = FollowIdsData(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + products = try container.decode([Int].self, forKey: .products) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + collections = try container.decode([Int].self, forKey: .collections) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brands = try container.decode([Int].self, forKey: .brands) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(products, forKey: .products) + + try? container.encodeIfPresent(collections, forKey: .collections) + + try? container.encodeIfPresent(brands, forKey: .brands) + } + } + + /* + Model: FollowIdsResponse + Used By: Catalog + */ + class FollowIdsResponse: Codable { + public var data: FollowIdsData? + + public enum CodingKeys: String, CodingKey { + case data + } + + public init(data: FollowIdsData?) { + self.data = data + } + + public func duplicate() -> FollowIdsResponse { + let dict = self.dictionary! + let copy = FollowIdsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode(FollowIdsData.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: LatLong + Used By: Catalog + */ + class LatLong: Codable { + public var coordinates: [Double]? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case coordinates + + case type + } + + public init(coordinates: [Double]?, type: String?) { + self.coordinates = coordinates + + self.type = type + } + + public func duplicate() -> LatLong { + let dict = self.dictionary! + let copy = LatLong(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + coordinates = try container.decode([Double].self, forKey: .coordinates) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(coordinates, forKey: .coordinates) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: Store + Used By: Catalog + */ + class Store: Codable { + public var address: String? + + public var name: String? + + public var uid: Int? + + public var storeEmail: String? + + public var pincode: Int? + + public var state: String? + + public var city: String? + + public var latLong: LatLong? + + public var country: String? + + public var storeCode: String? + + public enum CodingKeys: String, CodingKey { + case address + + case name + + case uid + + case storeEmail = "store_email" + + case pincode + + case state + + case city + + case latLong = "lat_long" + + case country + + case storeCode = "store_code" + } + + public init(address: String?, city: String?, country: String?, latLong: LatLong?, name: String?, pincode: Int?, state: String?, storeCode: String?, storeEmail: String?, uid: Int?) { + self.address = address + + self.name = name + + self.uid = uid + + self.storeEmail = storeEmail + + self.pincode = pincode + + self.state = state + + self.city = city + + self.latLong = latLong + + self.country = country + + self.storeCode = storeCode + } + + public func duplicate() -> Store { + let dict = self.dictionary! + let copy = Store(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + address = try container.decode(String.self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeEmail = try container.decode(String.self, forKey: .storeEmail) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(Int.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + latLong = try container.decode(LatLong.self, forKey: .latLong) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeCode = try container.decode(String.self, forKey: .storeCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(storeEmail, forKey: .storeEmail) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(latLong, forKey: .latLong) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(storeCode, forKey: .storeCode) + } + } + + /* + Model: StoreListingResponse + Used By: Catalog + */ + class StoreListingResponse: Codable { + public var page: Page + + public var items: [Store] + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [Store], page: Page) { + self.page = page + + self.items = items + } + + public func duplicate() -> StoreListingResponse { + let dict = self.dictionary! + let copy = StoreListingResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + page = try container.decode(Page.self, forKey: .page) + + items = try container.decode([Store].self, forKey: .items) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: StoreAddressSerializer + Used By: Catalog + */ + class StoreAddressSerializer: Codable { + public var address2: String? + + public var longitude: Double? + + public var address1: String? + + public var pincode: Int? + + public var latitude: Double? + + public var state: String? + + public var city: String? + + public var landmark: String? + + public var country: String? + + public enum CodingKeys: String, CodingKey { + case address2 + + case longitude + + case address1 + + case pincode + + case latitude + + case state + + case city + + case landmark + + case country + } + + public init(address1: String?, address2: String?, city: String?, country: String?, landmark: String?, latitude: Double?, longitude: Double?, pincode: Int?, state: String?) { + self.address2 = address2 + + self.longitude = longitude + + self.address1 = address1 + + self.pincode = pincode + + self.latitude = latitude + + self.state = state + + self.city = city + + self.landmark = landmark + + self.country = country + } + + public func duplicate() -> StoreAddressSerializer { + let dict = self.dictionary! + let copy = StoreAddressSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + address2 = try container.decode(String.self, forKey: .address2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + longitude = try container.decode(Double.self, forKey: .longitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address1 = try container.decode(String.self, forKey: .address1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(Int.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + latitude = try container.decode(Double.self, forKey: .latitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + landmark = try container.decode(String.self, forKey: .landmark) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(address2, forKey: .address2) + + try? container.encodeIfPresent(longitude, forKey: .longitude) + + try? container.encodeIfPresent(address1, forKey: .address1) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(latitude, forKey: .latitude) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(landmark, forKey: .landmark) + + try? container.encodeIfPresent(country, forKey: .country) + } + } + + /* + Model: SellerPhoneNumber + Used By: Catalog + */ + class SellerPhoneNumber: Codable { + public var number: String + + public var countryCode: Int + + public enum CodingKeys: String, CodingKey { + case number + + case countryCode = "country_code" + } + + public init(countryCode: Int, number: String) { + self.number = number + + self.countryCode = countryCode + } + + public func duplicate() -> SellerPhoneNumber { + let dict = self.dictionary! + let copy = SellerPhoneNumber(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + number = try container.decode(String.self, forKey: .number) + + countryCode = try container.decode(Int.self, forKey: .countryCode) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(number, forKey: .number) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + } + } + + /* + Model: StoreManagerSerializer + Used By: Catalog + */ + class StoreManagerSerializer: Codable { + public var email: String? + + public var name: String? + + public var mobileNo: SellerPhoneNumber? + + public enum CodingKeys: String, CodingKey { + case email + + case name + + case mobileNo = "mobile_no" + } + + public init(email: String?, mobileNo: SellerPhoneNumber?, name: String?) { + self.email = email + + self.name = name + + self.mobileNo = mobileNo + } + + public func duplicate() -> StoreManagerSerializer { + let dict = self.dictionary! + let copy = StoreManagerSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobileNo = try container.decode(SellerPhoneNumber.self, forKey: .mobileNo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(mobileNo, forKey: .mobileNo) + } + } + + /* + Model: CompanyStore + Used By: Catalog + */ + class CompanyStore: Codable { + public var uid: Int? + + public var name: String? + + public var companyType: String? + + public var businessType: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case name + + case companyType = "company_type" + + case businessType = "business_type" + } + + public init(businessType: String?, companyType: String?, name: String?, uid: Int?) { + self.uid = uid + + self.name = name + + self.companyType = companyType + + self.businessType = businessType + } + + public func duplicate() -> CompanyStore { + let dict = self.dictionary! + let copy = CompanyStore(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyType = try container.decode(String.self, forKey: .companyType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + businessType = try container.decode(String.self, forKey: .businessType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(companyType, forKey: .companyType) + + try? container.encodeIfPresent(businessType, forKey: .businessType) + } + } + + /* + Model: StoreDepartments + Used By: Catalog + */ + class StoreDepartments: Codable { + public var slug: String? + + public var name: String? + + public var logo: String? + + public var uid: Int? + + public var priorityOrder: Int? + + public enum CodingKeys: String, CodingKey { + case slug + + case name + + case logo + + case uid + + case priorityOrder = "priority_order" + } + + public init(logo: String?, name: String?, priorityOrder: Int?, slug: String?, uid: Int?) { + self.slug = slug + + self.name = name + + self.logo = logo + + self.uid = uid + + self.priorityOrder = priorityOrder + } + + public func duplicate() -> StoreDepartments { + let dict = self.dictionary! + let copy = StoreDepartments(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priorityOrder = try container.decode(Int.self, forKey: .priorityOrder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(priorityOrder, forKey: .priorityOrder) + } + } + + /* + Model: AppStore + Used By: Catalog + */ + class AppStore: Codable { + public var address: StoreAddressSerializer? + + public var manager: StoreManagerSerializer? + + public var name: String? + + public var company: CompanyStore? + + public var uid: Int? + + public var departments: [StoreDepartments]? + + public var contactNumbers: [SellerPhoneNumber]? + + public enum CodingKeys: String, CodingKey { + case address + + case manager + + case name + + case company + + case uid + + case departments + + case contactNumbers = "contact_numbers" + } + + public init(address: StoreAddressSerializer?, company: CompanyStore?, contactNumbers: [SellerPhoneNumber]?, departments: [StoreDepartments]?, manager: StoreManagerSerializer?, name: String?, uid: Int?) { + self.address = address + + self.manager = manager + + self.name = name + + self.company = company + + self.uid = uid + + self.departments = departments + + self.contactNumbers = contactNumbers + } + + public func duplicate() -> AppStore { + let dict = self.dictionary! + let copy = AppStore(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + address = try container.decode(StoreAddressSerializer.self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + manager = try container.decode(StoreManagerSerializer.self, forKey: .manager) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + company = try container.decode(CompanyStore.self, forKey: .company) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + departments = try container.decode([StoreDepartments].self, forKey: .departments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contactNumbers = try container.decode([SellerPhoneNumber].self, forKey: .contactNumbers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(manager, forKey: .manager) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(company, forKey: .company) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(departments, forKey: .departments) + + try? container.encodeIfPresent(contactNumbers, forKey: .contactNumbers) + } + } + + /* + Model: ApplicationStoreListing + Used By: Catalog + */ + class ApplicationStoreListing: Codable { + public var page: Page? + + public var items: [AppStore]? + + public var filters: [StoreDepartments]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + + case filters + } + + public init(filters: [StoreDepartments]?, items: [AppStore]?, page: Page?) { + self.page = page + + self.items = items + + self.filters = filters + } + + public func duplicate() -> ApplicationStoreListing { + let dict = self.dictionary! + let copy = ApplicationStoreListing(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([AppStore].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filters = try container.decode([StoreDepartments].self, forKey: .filters) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(filters, forKey: .filters) + } + } + + /* + Model: Time + Used By: Catalog + */ + class Time: Codable { + public var hour: Int? + + public var minute: Int? + + public enum CodingKeys: String, CodingKey { + case hour + + case minute + } + + public init(hour: Int?, minute: Int?) { + self.hour = hour + + self.minute = minute + } + + public func duplicate() -> Time { + let dict = self.dictionary! + let copy = Time(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + hour = try container.decode(Int.self, forKey: .hour) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + minute = try container.decode(Int.self, forKey: .minute) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(hour, forKey: .hour) + + try? container.encodeIfPresent(minute, forKey: .minute) + } + } + + /* + Model: StoreTiming + Used By: Catalog + */ + class StoreTiming: Codable { + public var open: Bool? + + public var closing: Time? + + public var opening: Time? + + public var weekday: String? + + public enum CodingKeys: String, CodingKey { + case open + + case closing + + case opening + + case weekday + } + + public init(closing: Time?, open: Bool?, opening: Time?, weekday: String?) { + self.open = open + + self.closing = closing + + self.opening = opening + + self.weekday = weekday + } + + public func duplicate() -> StoreTiming { + let dict = self.dictionary! + let copy = StoreTiming(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + open = try container.decode(Bool.self, forKey: .open) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + closing = try container.decode(Time.self, forKey: .closing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + opening = try container.decode(Time.self, forKey: .opening) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + weekday = try container.decode(String.self, forKey: .weekday) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(open, forKey: .open) + + try? container.encodeIfPresent(closing, forKey: .closing) + + try? container.encodeIfPresent(opening, forKey: .opening) + + try? container.encodeIfPresent(weekday, forKey: .weekday) + } + } + + /* + Model: StoreDetails + Used By: Catalog + */ + class StoreDetails: Codable { + public var address: StoreAddressSerializer? + + public var customJson: [String: Any]? + + public var manager: StoreManagerSerializer? + + public var name: String? + + public var timing: [StoreTiming]? + + public var company: CompanyStore? + + public var uid: Int? + + public var departments: [StoreDepartments]? + + public var contactNumbers: [SellerPhoneNumber]? + + public enum CodingKeys: String, CodingKey { + case address + + case customJson = "_custom_json" + + case manager + + case name + + case timing + + case company + + case uid + + case departments + + case contactNumbers = "contact_numbers" + } + + public init(address: StoreAddressSerializer?, company: CompanyStore?, contactNumbers: [SellerPhoneNumber]?, departments: [StoreDepartments]?, manager: StoreManagerSerializer?, name: String?, timing: [StoreTiming]?, uid: Int?, customJson: [String: Any]?) { + self.address = address + + self.customJson = customJson + + self.manager = manager + + self.name = name + + self.timing = timing + + self.company = company + + self.uid = uid + + self.departments = departments + + self.contactNumbers = contactNumbers + } + + public func duplicate() -> StoreDetails { + let dict = self.dictionary! + let copy = StoreDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + address = try container.decode(StoreAddressSerializer.self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + manager = try container.decode(StoreManagerSerializer.self, forKey: .manager) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + timing = try container.decode([StoreTiming].self, forKey: .timing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + company = try container.decode(CompanyStore.self, forKey: .company) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + departments = try container.decode([StoreDepartments].self, forKey: .departments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contactNumbers = try container.decode([SellerPhoneNumber].self, forKey: .contactNumbers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(manager, forKey: .manager) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(timing, forKey: .timing) + + try? container.encodeIfPresent(company, forKey: .company) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(departments, forKey: .departments) + + try? container.encodeIfPresent(contactNumbers, forKey: .contactNumbers) + } + } + + /* + Model: ProductDetails + Used By: Catalog + */ + class ProductDetails: Codable { + public var slug: String? + + public var rating: Double? + + public var name: String? + + public var images: [[String: Any]]? + + public var isSet: Bool? + + public var hasVariant: Bool? + + public var identifier: [String: Any]? + + public var description: String? + + public var ratingCount: Int? + + public var shortDescription: String? + + public var hsnCode: Int? + + public var outOfStock: Bool? + + public var countryOfOrigin: String? + + public var itemCode: String? + + public var imageNature: String? + + public var attributes: [String: Any]? + + public var groupedAttributes: [String: Any]? + + public var media: [[String: Any]]? + + public var brandUid: Int? + + public var templateTag: String? + + public enum CodingKeys: String, CodingKey { + case slug + + case rating + + case name + + case images + + case isSet = "is_set" + + case hasVariant = "has_variant" + + case identifier + + case description + + case ratingCount = "rating_count" + + case shortDescription = "short_description" + + case hsnCode = "hsn_code" + + case outOfStock = "out_of_stock" + + case countryOfOrigin = "country_of_origin" + + case itemCode = "item_code" + + case imageNature = "image_nature" + + case attributes + + case groupedAttributes = "grouped_attributes" + + case media + + case brandUid = "brand_uid" + + case templateTag = "template_tag" + } + + public init(attributes: [String: Any]?, brandUid: Int?, countryOfOrigin: String?, description: String?, groupedAttributes: [String: Any]?, hasVariant: Bool?, hsnCode: Int?, identifier: [String: Any]?, images: [[String: Any]]?, imageNature: String?, isSet: Bool?, itemCode: String?, media: [[String: Any]]?, name: String?, outOfStock: Bool?, rating: Double?, ratingCount: Int?, shortDescription: String?, slug: String?, templateTag: String?) { + self.slug = slug + + self.rating = rating + + self.name = name + + self.images = images + + self.isSet = isSet + + self.hasVariant = hasVariant + + self.identifier = identifier + + self.description = description + + self.ratingCount = ratingCount + + self.shortDescription = shortDescription + + self.hsnCode = hsnCode + + self.outOfStock = outOfStock + + self.countryOfOrigin = countryOfOrigin + + self.itemCode = itemCode + + self.imageNature = imageNature + + self.attributes = attributes + + self.groupedAttributes = groupedAttributes + + self.media = media + + self.brandUid = brandUid + + self.templateTag = templateTag + } + + public func duplicate() -> ProductDetails { + let dict = self.dictionary! + let copy = ProductDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rating = try container.decode(Double.self, forKey: .rating) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + images = try container.decode([[String: Any]].self, forKey: .images) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isSet = try container.decode(Bool.self, forKey: .isSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasVariant = try container.decode(Bool.self, forKey: .hasVariant) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + identifier = try container.decode([String: Any].self, forKey: .identifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ratingCount = try container.decode(Int.self, forKey: .ratingCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shortDescription = try container.decode(String.self, forKey: .shortDescription) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hsnCode = try container.decode(Int.self, forKey: .hsnCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + outOfStock = try container.decode(Bool.self, forKey: .outOfStock) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryOfOrigin = try container.decode(String.self, forKey: .countryOfOrigin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemCode = try container.decode(String.self, forKey: .itemCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + imageNature = try container.decode(String.self, forKey: .imageNature) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributes = try container.decode([String: Any].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + groupedAttributes = try container.decode([String: Any].self, forKey: .groupedAttributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + media = try container.decode([[String: Any]].self, forKey: .media) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandUid = try container.decode(Int.self, forKey: .brandUid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + templateTag = try container.decode(String.self, forKey: .templateTag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(rating, forKey: .rating) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(images, forKey: .images) + + try? container.encodeIfPresent(isSet, forKey: .isSet) + + try? container.encodeIfPresent(hasVariant, forKey: .hasVariant) + + try? container.encodeIfPresent(identifier, forKey: .identifier) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(ratingCount, forKey: .ratingCount) + + try? container.encodeIfPresent(shortDescription, forKey: .shortDescription) + + try? container.encodeIfPresent(hsnCode, forKey: .hsnCode) + + try? container.encodeIfPresent(outOfStock, forKey: .outOfStock) + + try? container.encodeIfPresent(countryOfOrigin, forKey: .countryOfOrigin) + + try? container.encodeIfPresent(itemCode, forKey: .itemCode) + + try? container.encodeIfPresent(imageNature, forKey: .imageNature) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + + try? container.encodeIfPresent(groupedAttributes, forKey: .groupedAttributes) + + try? container.encodeIfPresent(media, forKey: .media) + + try? container.encodeIfPresent(brandUid, forKey: .brandUid) + + try? container.encodeIfPresent(templateTag, forKey: .templateTag) + } + } + + /* + Model: Price1 + Used By: Catalog + */ + class Price1: Codable { + public var maxEffective: Double? + + public var maxMarked: Double? + + public var minEffective: Double? + + public var currency: String? + + public var minMarked: Double? + + public enum CodingKeys: String, CodingKey { + case maxEffective = "max_effective" + + case maxMarked = "max_marked" + + case minEffective = "min_effective" + + case currency + + case minMarked = "min_marked" + } + + public init(currency: String?, maxEffective: Double?, maxMarked: Double?, minEffective: Double?, minMarked: Double?) { + self.maxEffective = maxEffective + + self.maxMarked = maxMarked + + self.minEffective = minEffective + + self.currency = currency + + self.minMarked = minMarked + } + + public func duplicate() -> Price1 { + let dict = self.dictionary! + let copy = Price1(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + maxEffective = try container.decode(Double.self, forKey: .maxEffective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + maxMarked = try container.decode(Double.self, forKey: .maxMarked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + minEffective = try container.decode(Double.self, forKey: .minEffective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + minMarked = try container.decode(Double.self, forKey: .minMarked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(maxEffective, forKey: .maxEffective) + + try? container.encodeIfPresent(maxMarked, forKey: .maxMarked) + + try? container.encodeIfPresent(minEffective, forKey: .minEffective) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(minMarked, forKey: .minMarked) + } + } + + /* + Model: Size + Used By: Catalog + */ + class Size: Codable { + public var display: String? + + public var value: String? + + public var isAvailable: Bool? + + public var quantity: Int? + + public enum CodingKeys: String, CodingKey { + case display + + case value + + case isAvailable = "is_available" + + case quantity + } + + public init(display: String?, isAvailable: Bool?, quantity: Int?, value: String?) { + self.display = display + + self.value = value + + self.isAvailable = isAvailable + + self.quantity = quantity + } + + public func duplicate() -> Size { + let dict = self.dictionary! + let copy = Size(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isAvailable = try container.decode(Bool.self, forKey: .isAvailable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(isAvailable, forKey: .isAvailable) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + } + } + + /* + Model: Products + Used By: Catalog + */ + class Products: Codable { + public var autoAddToCart: Bool? + + public var allowRemove: Bool? + + public var maxQuantity: Int? + + public var minQuantity: Int? + + public var productDetails: ProductDetails? + + public var price: Price1? + + public var productUid: Int? + + public var sizes: [Size]? + + public var autoSelect: Bool? + + public enum CodingKeys: String, CodingKey { + case autoAddToCart = "auto_add_to_cart" + + case allowRemove = "allow_remove" + + case maxQuantity = "max_quantity" + + case minQuantity = "min_quantity" + + case productDetails = "product_details" + + case price + + case productUid = "product_uid" + + case sizes + + case autoSelect = "auto_select" + } + + public init(allowRemove: Bool?, autoAddToCart: Bool?, autoSelect: Bool?, maxQuantity: Int?, minQuantity: Int?, price: Price1?, productDetails: ProductDetails?, productUid: Int?, sizes: [Size]?) { + self.autoAddToCart = autoAddToCart + + self.allowRemove = allowRemove + + self.maxQuantity = maxQuantity + + self.minQuantity = minQuantity + + self.productDetails = productDetails + + self.price = price + + self.productUid = productUid + + self.sizes = sizes + + self.autoSelect = autoSelect + } + + public func duplicate() -> Products { + let dict = self.dictionary! + let copy = Products(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + autoAddToCart = try container.decode(Bool.self, forKey: .autoAddToCart) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allowRemove = try container.decode(Bool.self, forKey: .allowRemove) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + maxQuantity = try container.decode(Int.self, forKey: .maxQuantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + minQuantity = try container.decode(Int.self, forKey: .minQuantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productDetails = try container.decode(ProductDetails.self, forKey: .productDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(Price1.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productUid = try container.decode(Int.self, forKey: .productUid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sizes = try container.decode([Size].self, forKey: .sizes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + autoSelect = try container.decode(Bool.self, forKey: .autoSelect) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(autoAddToCart, forKey: .autoAddToCart) + + try? container.encodeIfPresent(allowRemove, forKey: .allowRemove) + + try? container.encodeIfPresent(maxQuantity, forKey: .maxQuantity) + + try? container.encodeIfPresent(minQuantity, forKey: .minQuantity) + + try? container.encodeIfPresent(productDetails, forKey: .productDetails) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(productUid, forKey: .productUid) + + try? container.encodeIfPresent(sizes, forKey: .sizes) + + try? container.encodeIfPresent(autoSelect, forKey: .autoSelect) + } + } + + /* + Model: GetGroupedProducts + Used By: Catalog + */ + class GetGroupedProducts: Codable { + public var slug: String? + + public var name: String? + + public var sameStoreAssignment: Bool? + + public var pageVisibility: [String]? + + public var meta: [String: Any]? + + public var products: [Products]? + + public var active: Bool? + + public var logo: String? + + public var companyId: Int? + + public var choice: String? + + public enum CodingKeys: String, CodingKey { + case slug + + case name + + case sameStoreAssignment = "same_store_assignment" + + case pageVisibility = "page_visibility" + + case meta + + case products + + case active + + case logo + + case companyId = "company_id" + + case choice + } + + public init(active: Bool?, choice: String?, companyId: Int?, logo: String?, meta: [String: Any]?, name: String?, pageVisibility: [String]?, products: [Products]?, sameStoreAssignment: Bool?, slug: String?) { + self.slug = slug + + self.name = name + + self.sameStoreAssignment = sameStoreAssignment + + self.pageVisibility = pageVisibility + + self.meta = meta + + self.products = products + + self.active = active + + self.logo = logo + + self.companyId = companyId + + self.choice = choice + } + + public func duplicate() -> GetGroupedProducts { + let dict = self.dictionary! + let copy = GetGroupedProducts(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sameStoreAssignment = try container.decode(Bool.self, forKey: .sameStoreAssignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pageVisibility = try container.decode([String].self, forKey: .pageVisibility) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + products = try container.decode([Products].self, forKey: .products) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + choice = try container.decode(String.self, forKey: .choice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(sameStoreAssignment, forKey: .sameStoreAssignment) + + try? container.encodeIfPresent(pageVisibility, forKey: .pageVisibility) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(products, forKey: .products) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(choice, forKey: .choice) + } + } + + /* + Model: ProductBundle + Used By: Catalog + */ + class ProductBundle: Codable { + public var items: [GetGroupedProducts]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [GetGroupedProducts]?) { + self.items = items + } + + public func duplicate() -> ProductBundle { + let dict = self.dictionary! + let copy = ProductBundle(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([GetGroupedProducts].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: StoreV2 + Used By: Catalog + */ + class StoreV2: Codable { + public var uid: Int? + + public var name: String? + + public var count: Int? + + public enum CodingKeys: String, CodingKey { + case uid + + case name + + case count + } + + public init(count: Int?, name: String?, uid: Int?) { + self.uid = uid + + self.name = name + + self.count = count + } + + public func duplicate() -> StoreV2 { + let dict = self.dictionary! + let copy = StoreV2(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(count, forKey: .count) + } + } + + /* + Model: DetailsSchemaV2 + Used By: Catalog + */ + class DetailsSchemaV2: Codable { + public var key: String? + + public var type: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case key + + case type + + case value + } + + public init(key: String?, type: String?, value: String?) { + self.key = key + + self.type = type + + self.value = value + } + + public func duplicate() -> DetailsSchemaV2 { + let dict = self.dictionary! + let copy = DetailsSchemaV2(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: MarketPlaceSttributesSchemaV2 + Used By: Catalog + */ + class MarketPlaceSttributesSchemaV2: Codable { + public var details: [DetailsSchemaV2]? + + public var title: String? + + public enum CodingKeys: String, CodingKey { + case details + + case title + } + + public init(details: [DetailsSchemaV2]?, title: String?) { + self.details = details + + self.title = title + } + + public func duplicate() -> MarketPlaceSttributesSchemaV2 { + let dict = self.dictionary! + let copy = MarketPlaceSttributesSchemaV2(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + details = try container.decode([DetailsSchemaV2].self, forKey: .details) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(details, forKey: .details) + + try? container.encodeIfPresent(title, forKey: .title) + } + } + + /* + Model: StrategyWiseListingSchemaV2 + Used By: Catalog + */ + class StrategyWiseListingSchemaV2: Codable { + public var quantity: Int? + + public var tat: Int? + + public var pincode: Int? + + public var distance: Int? + + public enum CodingKeys: String, CodingKey { + case quantity + + case tat + + case pincode + + case distance + } + + public init(distance: Int?, pincode: Int?, quantity: Int?, tat: Int?) { + self.quantity = quantity + + self.tat = tat + + self.pincode = pincode + + self.distance = distance + } + + public func duplicate() -> StrategyWiseListingSchemaV2 { + let dict = self.dictionary! + let copy = StrategyWiseListingSchemaV2(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tat = try container.decode(Int.self, forKey: .tat) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(Int.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + distance = try container.decode(Int.self, forKey: .distance) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(tat, forKey: .tat) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(distance, forKey: .distance) + } + } + + /* + Model: ProductSetDistributionSizeV2 + Used By: Catalog + */ + class ProductSetDistributionSizeV2: Codable { + public var pieces: Int? + + public var size: String? + + public enum CodingKeys: String, CodingKey { + case pieces + + case size + } + + public init(pieces: Int?, size: String?) { + self.pieces = pieces + + self.size = size + } + + public func duplicate() -> ProductSetDistributionSizeV2 { + let dict = self.dictionary! + let copy = ProductSetDistributionSizeV2(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + pieces = try container.decode(Int.self, forKey: .pieces) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(String.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pieces, forKey: .pieces) + + try? container.encodeIfPresent(size, forKey: .size) + } + } + + /* + Model: ProductSetDistributionV2 + Used By: Catalog + */ + class ProductSetDistributionV2: Codable { + public var sizes: [ProductSetDistributionSizeV2]? + + public enum CodingKeys: String, CodingKey { + case sizes + } + + public init(sizes: [ProductSetDistributionSizeV2]?) { + self.sizes = sizes + } + + public func duplicate() -> ProductSetDistributionV2 { + let dict = self.dictionary! + let copy = ProductSetDistributionV2(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + sizes = try container.decode([ProductSetDistributionSizeV2].self, forKey: .sizes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(sizes, forKey: .sizes) + } + } + + /* + Model: ProductSetV2 + Used By: Catalog + */ + class ProductSetV2: Codable { + public var sizeDistribution: ProductSetDistributionV2? + + public var quantity: Int? + + public enum CodingKeys: String, CodingKey { + case sizeDistribution = "size_distribution" + + case quantity + } + + public init(quantity: Int?, sizeDistribution: ProductSetDistributionV2?) { + self.sizeDistribution = sizeDistribution + + self.quantity = quantity + } + + public func duplicate() -> ProductSetV2 { + let dict = self.dictionary! + let copy = ProductSetV2(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + sizeDistribution = try container.decode(ProductSetDistributionV2.self, forKey: .sizeDistribution) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(sizeDistribution, forKey: .sizeDistribution) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + } + } + + /* + Model: ReturnConfigSchemaV2 + Used By: Catalog + */ + class ReturnConfigSchemaV2: Codable { + public var returnable: Bool? + + public var time: Int? + + public var unit: String? + + public enum CodingKeys: String, CodingKey { + case returnable + + case time + + case unit + } + + public init(returnable: Bool?, time: Int?, unit: String?) { + self.returnable = returnable + + self.time = time + + self.unit = unit + } + + public func duplicate() -> ReturnConfigSchemaV2 { + let dict = self.dictionary! + let copy = ReturnConfigSchemaV2(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + returnable = try container.decode(Bool.self, forKey: .returnable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + time = try container.decode(Int.self, forKey: .time) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + unit = try container.decode(String.self, forKey: .unit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(returnable, forKey: .returnable) + + try? container.encodeIfPresent(time, forKey: .time) + + try? container.encodeIfPresent(unit, forKey: .unit) + } + } + + /* + Model: ArticleAssignmentV2 + Used By: Catalog + */ + class ArticleAssignmentV2: Codable { + public var level: String? + + public var strategy: String? + + public enum CodingKeys: String, CodingKey { + case level + + case strategy + } + + public init(level: String?, strategy: String?) { + self.level = level + + self.strategy = strategy + } + + public func duplicate() -> ArticleAssignmentV2 { + let dict = self.dictionary! + let copy = ArticleAssignmentV2(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + level = try container.decode(String.self, forKey: .level) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + strategy = try container.decode(String.self, forKey: .strategy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(level, forKey: .level) + + try? container.encodeIfPresent(strategy, forKey: .strategy) + } + } + + /* + Model: SellerV2 + Used By: Catalog + */ + class SellerV2: Codable { + public var uid: Int? + + public var name: String? + + public var count: Int? + + public enum CodingKeys: String, CodingKey { + case uid + + case name + + case count + } + + public init(count: Int?, name: String?, uid: Int?) { + self.uid = uid + + self.name = name + + self.count = count + } + + public func duplicate() -> SellerV2 { + let dict = self.dictionary! + let copy = SellerV2(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(count, forKey: .count) + } + } + + /* + Model: ProductStockPriceV2 + Used By: Catalog + */ + class ProductStockPriceV2: Codable { + public var currency: String? + + public var marked: Double? + + public var effective: Double? + + public enum CodingKeys: String, CodingKey { + case currency + + case marked + + case effective + } + + public init(currency: String?, effective: Double?, marked: Double?) { + self.currency = currency + + self.marked = marked + + self.effective = effective + } + + public func duplicate() -> ProductStockPriceV2 { + let dict = self.dictionary! + let copy = ProductStockPriceV2(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + marked = try container.decode(Double.self, forKey: .marked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + effective = try container.decode(Double.self, forKey: .effective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(marked, forKey: .marked) + + try? container.encodeIfPresent(effective, forKey: .effective) + } + } + + /* + Model: ProductSizePriceResponseV2 + Used By: Catalog + */ + class ProductSizePriceResponseV2: Codable { + public var store: StoreV2? + + public var marketplaceAttributes: [MarketPlaceSttributesSchemaV2]? + + public var strategyWiseListing: [StrategyWiseListingSchemaV2]? + + public var discount: String? + + public var itemType: String? + + public var set: ProductSetV2? + + public var pincode: Int? + + public var quantity: Int? + + public var returnConfig: ReturnConfigSchemaV2? + + public var articleAssignment: ArticleAssignmentV2? + + public var longLat: [Double]? + + public var seller: SellerV2? + + public var price: ProductStockPriceV2? + + public var articleId: String? + + public var specialBadge: String? + + public var pricePerPiece: ProductStockPriceV2? + + public var sellerCount: Int? + + public enum CodingKeys: String, CodingKey { + case store + + case marketplaceAttributes = "marketplace_attributes" + + case strategyWiseListing = "strategy_wise_listing" + + case discount + + case itemType = "item_type" + + case set + + case pincode + + case quantity + + case returnConfig = "return_config" + + case articleAssignment = "article_assignment" + + case longLat = "long_lat" + + case seller + + case price + + case articleId = "article_id" + + case specialBadge = "special_badge" + + case pricePerPiece = "price_per_piece" + + case sellerCount = "seller_count" + } + + public init(articleAssignment: ArticleAssignmentV2?, articleId: String?, discount: String?, itemType: String?, longLat: [Double]?, marketplaceAttributes: [MarketPlaceSttributesSchemaV2]?, pincode: Int?, price: ProductStockPriceV2?, pricePerPiece: ProductStockPriceV2?, quantity: Int?, returnConfig: ReturnConfigSchemaV2?, seller: SellerV2?, sellerCount: Int?, set: ProductSetV2?, specialBadge: String?, store: StoreV2?, strategyWiseListing: [StrategyWiseListingSchemaV2]?) { + self.store = store + + self.marketplaceAttributes = marketplaceAttributes + + self.strategyWiseListing = strategyWiseListing + + self.discount = discount + + self.itemType = itemType + + self.set = set + + self.pincode = pincode + + self.quantity = quantity + + self.returnConfig = returnConfig + + self.articleAssignment = articleAssignment + + self.longLat = longLat + + self.seller = seller + + self.price = price + + self.articleId = articleId + + self.specialBadge = specialBadge + + self.pricePerPiece = pricePerPiece + + self.sellerCount = sellerCount + } + + public func duplicate() -> ProductSizePriceResponseV2 { + let dict = self.dictionary! + let copy = ProductSizePriceResponseV2(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + store = try container.decode(StoreV2.self, forKey: .store) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + marketplaceAttributes = try container.decode([MarketPlaceSttributesSchemaV2].self, forKey: .marketplaceAttributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + strategyWiseListing = try container.decode([StrategyWiseListingSchemaV2].self, forKey: .strategyWiseListing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discount = try container.decode(String.self, forKey: .discount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemType = try container.decode(String.self, forKey: .itemType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + set = try container.decode(ProductSetV2.self, forKey: .set) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(Int.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + returnConfig = try container.decode(ReturnConfigSchemaV2.self, forKey: .returnConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + articleAssignment = try container.decode(ArticleAssignmentV2.self, forKey: .articleAssignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + longLat = try container.decode([Double].self, forKey: .longLat) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + seller = try container.decode(SellerV2.self, forKey: .seller) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(ProductStockPriceV2.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + articleId = try container.decode(String.self, forKey: .articleId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + specialBadge = try container.decode(String.self, forKey: .specialBadge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pricePerPiece = try container.decode(ProductStockPriceV2.self, forKey: .pricePerPiece) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sellerCount = try container.decode(Int.self, forKey: .sellerCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(store, forKey: .store) + + try? container.encodeIfPresent(marketplaceAttributes, forKey: .marketplaceAttributes) + + try? container.encodeIfPresent(strategyWiseListing, forKey: .strategyWiseListing) + + try? container.encodeIfPresent(discount, forKey: .discount) + + try? container.encodeIfPresent(itemType, forKey: .itemType) + + try? container.encodeIfPresent(set, forKey: .set) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(returnConfig, forKey: .returnConfig) + + try? container.encodeIfPresent(articleAssignment, forKey: .articleAssignment) + + try? container.encodeIfPresent(longLat, forKey: .longLat) + + try? container.encodeIfPresent(seller, forKey: .seller) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(articleId, forKey: .articleId) + + try? container.encodeIfPresent(specialBadge, forKey: .specialBadge) + + try? container.encodeIfPresent(pricePerPiece, forKey: .pricePerPiece) + + try? container.encodeIfPresent(sellerCount, forKey: .sellerCount) + } + } + + /* + Model: ProductSizeSellerFilterSchemaV2 + Used By: Catalog + */ + class ProductSizeSellerFilterSchemaV2: Codable { + public var isSelected: Bool? + + public var name: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case isSelected = "is_selected" + + case name + + case value + } + + public init(isSelected: Bool?, name: String?, value: String?) { + self.isSelected = isSelected + + self.name = name + + self.value = value + } + + public func duplicate() -> ProductSizeSellerFilterSchemaV2 { + let dict = self.dictionary! + let copy = ProductSizeSellerFilterSchemaV2(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isSelected = try container.decode(Bool.self, forKey: .isSelected) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isSelected, forKey: .isSelected) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: ProductSizeSellersResponseV2 + Used By: Catalog + */ + class ProductSizeSellersResponseV2: Codable { + public var page: Page + + public var items: [ProductSizePriceResponseV2]? + + public var sortOn: [ProductSizeSellerFilterSchemaV2]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + + case sortOn = "sort_on" + } + + public init(items: [ProductSizePriceResponseV2]?, page: Page, sortOn: [ProductSizeSellerFilterSchemaV2]?) { + self.page = page + + self.items = items + + self.sortOn = sortOn + } + + public func duplicate() -> ProductSizeSellersResponseV2 { + let dict = self.dictionary! + let copy = ProductSizeSellersResponseV2(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + page = try container.decode(Page.self, forKey: .page) + + do { + items = try container.decode([ProductSizePriceResponseV2].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sortOn = try container.decode([ProductSizeSellerFilterSchemaV2].self, forKey: .sortOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(sortOn, forKey: .sortOn) + } + } +} diff --git a/Sources/code/application/models/CommonAppModelClass.swift b/Sources/code/application/models/CommonAppModelClass.swift new file mode 100644 index 0000000000..539550cea6 --- /dev/null +++ b/Sources/code/application/models/CommonAppModelClass.swift @@ -0,0 +1,1508 @@ +import Foundation + +import Foundation +public extension ApplicationClient { + /* + Model: ApplicationResponse + Used By: Common + */ + class ApplicationResponse: Codable { + public var application: Application? + + public enum CodingKeys: String, CodingKey { + case application + } + + public init(application: Application?) { + self.application = application + } + + public func duplicate() -> ApplicationResponse { + let dict = self.dictionary! + let copy = ApplicationResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(Application.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + } + } + + /* + Model: Currency + Used By: Common + */ + class Currency: Codable { + public var id: String? + + public var isActive: Bool? + + public var name: String? + + public var code: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var decimalDigits: Int? + + public var symbol: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case isActive = "is_active" + + case name + + case code + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case decimalDigits = "decimal_digits" + + case symbol + } + + public init(code: String?, createdAt: String?, decimalDigits: Int?, isActive: Bool?, name: String?, symbol: String?, updatedAt: String?, id: String?) { + self.id = id + + self.isActive = isActive + + self.name = name + + self.code = code + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.decimalDigits = decimalDigits + + self.symbol = symbol + } + + public func duplicate() -> Currency { + let dict = self.dictionary! + let copy = Currency(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + decimalDigits = try container.decode(Int.self, forKey: .decimalDigits) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + symbol = try container.decode(String.self, forKey: .symbol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(decimalDigits, forKey: .decimalDigits) + + try? container.encodeIfPresent(symbol, forKey: .symbol) + } + } + + /* + Model: Domain + Used By: Common + */ + class Domain: Codable { + public var verified: Bool? + + public var isPrimary: Bool? + + public var isShortlink: Bool? + + public var id: String? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case verified + + case isPrimary = "is_primary" + + case isShortlink = "is_shortlink" + + case id = "_id" + + case name + } + + public init(isPrimary: Bool?, isShortlink: Bool?, name: String?, verified: Bool?, id: String?) { + self.verified = verified + + self.isPrimary = isPrimary + + self.isShortlink = isShortlink + + self.id = id + + self.name = name + } + + public func duplicate() -> Domain { + let dict = self.dictionary! + let copy = Domain(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + verified = try container.decode(Bool.self, forKey: .verified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isPrimary = try container.decode(Bool.self, forKey: .isPrimary) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isShortlink = try container.decode(Bool.self, forKey: .isShortlink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(verified, forKey: .verified) + + try? container.encodeIfPresent(isPrimary, forKey: .isPrimary) + + try? container.encodeIfPresent(isShortlink, forKey: .isShortlink) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: ApplicationWebsite + Used By: Common + */ + class ApplicationWebsite: Codable { + public var enabled: Bool? + + public var basepath: String? + + public enum CodingKeys: String, CodingKey { + case enabled + + case basepath + } + + public init(basepath: String?, enabled: Bool?) { + self.enabled = enabled + + self.basepath = basepath + } + + public func duplicate() -> ApplicationWebsite { + let dict = self.dictionary! + let copy = ApplicationWebsite(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + basepath = try container.decode(String.self, forKey: .basepath) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(basepath, forKey: .basepath) + } + } + + /* + Model: ApplicationCors + Used By: Common + */ + class ApplicationCors: Codable { + public var domains: [String]? + + public enum CodingKeys: String, CodingKey { + case domains + } + + public init(domains: [String]?) { + self.domains = domains + } + + public func duplicate() -> ApplicationCors { + let dict = self.dictionary! + let copy = ApplicationCors(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + domains = try container.decode([String].self, forKey: .domains) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(domains, forKey: .domains) + } + } + + /* + Model: ApplicationAuth + Used By: Common + */ + class ApplicationAuth: Codable { + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case enabled + } + + public init(enabled: Bool?) { + self.enabled = enabled + } + + public func duplicate() -> ApplicationAuth { + let dict = self.dictionary! + let copy = ApplicationAuth(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: ApplicationRedirections + Used By: Common + */ + class ApplicationRedirections: Codable { + public var redirectFrom: String? + + public var redirectTo: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case redirectFrom = "redirect_from" + + case redirectTo = "redirect_to" + + case type + } + + public init(redirectFrom: String?, redirectTo: String?, type: String?) { + self.redirectFrom = redirectFrom + + self.redirectTo = redirectTo + + self.type = type + } + + public func duplicate() -> ApplicationRedirections { + let dict = self.dictionary! + let copy = ApplicationRedirections(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + redirectFrom = try container.decode(String.self, forKey: .redirectFrom) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + redirectTo = try container.decode(String.self, forKey: .redirectTo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(redirectFrom, forKey: .redirectFrom) + + try? container.encodeIfPresent(redirectTo, forKey: .redirectTo) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: ApplicationMeta + Used By: Common + */ + class ApplicationMeta: Codable { + public var name: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case name + + case value + } + + public init(name: String?, value: String?) { + self.name = name + + self.value = value + } + + public func duplicate() -> ApplicationMeta { + let dict = self.dictionary! + let copy = ApplicationMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: SecureUrl + Used By: Common + */ + class SecureUrl: Codable { + public var secureUrl: String? + + public enum CodingKeys: String, CodingKey { + case secureUrl = "secure_url" + } + + public init(secureUrl: String?) { + self.secureUrl = secureUrl + } + + public func duplicate() -> SecureUrl { + let dict = self.dictionary! + let copy = SecureUrl(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + secureUrl = try container.decode(String.self, forKey: .secureUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) + } + } + + /* + Model: Application + Used By: Common + */ + class Application: Codable { + public var website: ApplicationWebsite? + + public var cors: ApplicationCors? + + public var auth: ApplicationAuth? + + public var description: String? + + public var channelType: String? + + public var cacheTtl: Int? + + public var isInternal: Bool? + + public var isActive: Bool? + + public var id: String? + + public var name: String? + + public var owner: String? + + public var companyId: Int? + + public var token: String? + + public var redirections: [ApplicationRedirections]? + + public var meta: [ApplicationMeta]? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public var banner: SecureUrl? + + public var logo: SecureUrl? + + public var favicon: SecureUrl? + + public var domains: [Domain]? + + public var appType: String? + + public var mobileLogo: SecureUrl? + + public var domain: Domain? + + public enum CodingKeys: String, CodingKey { + case website + + case cors + + case auth + + case description + + case channelType = "channel_type" + + case cacheTtl = "cache_ttl" + + case isInternal = "is_internal" + + case isActive = "is_active" + + case id = "_id" + + case name + + case owner + + case companyId = "company_id" + + case token + + case redirections + + case meta + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + + case banner + + case logo + + case favicon + + case domains + + case appType = "app_type" + + case mobileLogo = "mobile_logo" + + case domain + } + + public init(appType: String?, auth: ApplicationAuth?, banner: SecureUrl?, cacheTtl: Int?, channelType: String?, companyId: Int?, cors: ApplicationCors?, createdAt: String?, description: String?, domain: Domain?, domains: [Domain]?, favicon: SecureUrl?, isActive: Bool?, isInternal: Bool?, logo: SecureUrl?, meta: [ApplicationMeta]?, mobileLogo: SecureUrl?, name: String?, owner: String?, redirections: [ApplicationRedirections]?, token: String?, updatedAt: String?, website: ApplicationWebsite?, id: String?, v: Int?) { + self.website = website + + self.cors = cors + + self.auth = auth + + self.description = description + + self.channelType = channelType + + self.cacheTtl = cacheTtl + + self.isInternal = isInternal + + self.isActive = isActive + + self.id = id + + self.name = name + + self.owner = owner + + self.companyId = companyId + + self.token = token + + self.redirections = redirections + + self.meta = meta + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + + self.banner = banner + + self.logo = logo + + self.favicon = favicon + + self.domains = domains + + self.appType = appType + + self.mobileLogo = mobileLogo + + self.domain = domain + } + + public func duplicate() -> Application { + let dict = self.dictionary! + let copy = Application(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + website = try container.decode(ApplicationWebsite.self, forKey: .website) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cors = try container.decode(ApplicationCors.self, forKey: .cors) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + auth = try container.decode(ApplicationAuth.self, forKey: .auth) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + channelType = try container.decode(String.self, forKey: .channelType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cacheTtl = try container.decode(Int.self, forKey: .cacheTtl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isInternal = try container.decode(Bool.self, forKey: .isInternal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + owner = try container.decode(String.self, forKey: .owner) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + token = try container.decode(String.self, forKey: .token) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + redirections = try container.decode([ApplicationRedirections].self, forKey: .redirections) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([ApplicationMeta].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banner = try container.decode(SecureUrl.self, forKey: .banner) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(SecureUrl.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + favicon = try container.decode(SecureUrl.self, forKey: .favicon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + domains = try container.decode([Domain].self, forKey: .domains) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appType = try container.decode(String.self, forKey: .appType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobileLogo = try container.decode(SecureUrl.self, forKey: .mobileLogo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + domain = try container.decode(Domain.self, forKey: .domain) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(website, forKey: .website) + + try? container.encodeIfPresent(cors, forKey: .cors) + + try? container.encodeIfPresent(auth, forKey: .auth) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(channelType, forKey: .channelType) + + try? container.encodeIfPresent(cacheTtl, forKey: .cacheTtl) + + try? container.encodeIfPresent(isInternal, forKey: .isInternal) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(owner, forKey: .owner) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(token, forKey: .token) + + try? container.encodeIfPresent(redirections, forKey: .redirections) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + + try? container.encodeIfPresent(banner, forKey: .banner) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(favicon, forKey: .favicon) + + try? container.encodeIfPresent(domains, forKey: .domains) + + try? container.encodeIfPresent(appType, forKey: .appType) + + try? container.encodeIfPresent(mobileLogo, forKey: .mobileLogo) + + try? container.encodeIfPresent(domain, forKey: .domain) + } + } + + /* + Model: NotFound + Used By: Common + */ + class NotFound: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> NotFound { + let dict = self.dictionary! + let copy = NotFound(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: BadRequest + Used By: Common + */ + class BadRequest: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> BadRequest { + let dict = self.dictionary! + let copy = BadRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: LocationDefaultLanguage + Used By: Common + */ + class LocationDefaultLanguage: Codable { + public var name: String? + + public var code: String? + + public enum CodingKeys: String, CodingKey { + case name + + case code + } + + public init(code: String?, name: String?) { + self.name = name + + self.code = code + } + + public func duplicate() -> LocationDefaultLanguage { + let dict = self.dictionary! + let copy = LocationDefaultLanguage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: LocationDefaultCurrency + Used By: Common + */ + class LocationDefaultCurrency: Codable { + public var name: String? + + public var symbol: String? + + public var code: String? + + public enum CodingKeys: String, CodingKey { + case name + + case symbol + + case code + } + + public init(code: String?, name: String?, symbol: String?) { + self.name = name + + self.symbol = symbol + + self.code = code + } + + public func duplicate() -> LocationDefaultCurrency { + let dict = self.dictionary! + let copy = LocationDefaultCurrency(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + symbol = try container.decode(String.self, forKey: .symbol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(symbol, forKey: .symbol) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: LocationCountry + Used By: Common + */ + class LocationCountry: Codable { + public var capital: String? + + public var currency: String? + + public var iso2: String? + + public var iso3: String? + + public var name: String? + + public var parent: String? + + public var phoneCode: String? + + public var type: String? + + public var uid: Int? + + public var v: Int? + + public var id: String? + + public var defaultCurrency: LocationDefaultCurrency? + + public var defaultLanguage: LocationDefaultLanguage? + + public enum CodingKeys: String, CodingKey { + case capital + + case currency + + case iso2 + + case iso3 + + case name + + case parent + + case phoneCode = "phone_code" + + case type + + case uid + + case v = "__v" + + case id = "_id" + + case defaultCurrency = "default_currency" + + case defaultLanguage = "default_language" + } + + public init(capital: String?, currency: String?, defaultCurrency: LocationDefaultCurrency?, defaultLanguage: LocationDefaultLanguage?, iso2: String?, iso3: String?, name: String?, parent: String?, phoneCode: String?, type: String?, uid: Int?, id: String?, v: Int?) { + self.capital = capital + + self.currency = currency + + self.iso2 = iso2 + + self.iso3 = iso3 + + self.name = name + + self.parent = parent + + self.phoneCode = phoneCode + + self.type = type + + self.uid = uid + + self.v = v + + self.id = id + + self.defaultCurrency = defaultCurrency + + self.defaultLanguage = defaultLanguage + } + + public func duplicate() -> LocationCountry { + let dict = self.dictionary! + let copy = LocationCountry(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + capital = try container.decode(String.self, forKey: .capital) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + iso2 = try container.decode(String.self, forKey: .iso2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + iso3 = try container.decode(String.self, forKey: .iso3) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + parent = try container.decode(String.self, forKey: .parent) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phoneCode = try container.decode(String.self, forKey: .phoneCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + defaultCurrency = try container.decode(LocationDefaultCurrency.self, forKey: .defaultCurrency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + defaultLanguage = try container.decode(LocationDefaultLanguage.self, forKey: .defaultLanguage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(capital, forKey: .capital) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(iso2, forKey: .iso2) + + try? container.encodeIfPresent(iso3, forKey: .iso3) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(parent, forKey: .parent) + + try? container.encodeIfPresent(phoneCode, forKey: .phoneCode) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(v, forKey: .v) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(defaultCurrency, forKey: .defaultCurrency) + + try? container.encodeIfPresent(defaultLanguage, forKey: .defaultLanguage) + } + } + + /* + Model: Locations + Used By: Common + */ + class Locations: Codable { + public var items: [[String: Any]]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [[String: Any]]?) { + self.items = items + } + + public func duplicate() -> Locations { + let dict = self.dictionary! + let copy = Locations(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([[String: Any]].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } +} diff --git a/Sources/code/application/models/CommunicationAppModelClass.swift b/Sources/code/application/models/CommunicationAppModelClass.swift new file mode 100644 index 0000000000..822a5c1617 --- /dev/null +++ b/Sources/code/application/models/CommunicationAppModelClass.swift @@ -0,0 +1,796 @@ +import Foundation + +import Foundation +public extension ApplicationClient { + /* + Model: CommunicationConsentReq + Used By: Communication + */ + class CommunicationConsentReq: Codable { + public var response: String? + + public var action: String? + + public var channel: String? + + public enum CodingKeys: String, CodingKey { + case response + + case action + + case channel + } + + public init(action: String?, channel: String?, response: String?) { + self.response = response + + self.action = action + + self.channel = channel + } + + public func duplicate() -> CommunicationConsentReq { + let dict = self.dictionary! + let copy = CommunicationConsentReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + response = try container.decode(String.self, forKey: .response) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(String.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + channel = try container.decode(String.self, forKey: .channel) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(response, forKey: .response) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(channel, forKey: .channel) + } + } + + /* + Model: CommunicationConsentRes + Used By: Communication + */ + class CommunicationConsentRes: Codable { + public var appId: String? + + public var userId: String? + + public var channels: CommunicationConsentChannels? + + public enum CodingKeys: String, CodingKey { + case appId = "app_id" + + case userId = "user_id" + + case channels + } + + public init(appId: String?, channels: CommunicationConsentChannels?, userId: String?) { + self.appId = appId + + self.userId = userId + + self.channels = channels + } + + public func duplicate() -> CommunicationConsentRes { + let dict = self.dictionary! + let copy = CommunicationConsentRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + channels = try container.decode(CommunicationConsentChannels.self, forKey: .channels) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(userId, forKey: .userId) + + try? container.encodeIfPresent(channels, forKey: .channels) + } + } + + /* + Model: CommunicationConsentChannelsEmail + Used By: Communication + */ + class CommunicationConsentChannelsEmail: Codable { + public var response: String? + + public var displayName: String? + + public enum CodingKeys: String, CodingKey { + case response + + case displayName = "display_name" + } + + public init(displayName: String?, response: String?) { + self.response = response + + self.displayName = displayName + } + + public func duplicate() -> CommunicationConsentChannelsEmail { + let dict = self.dictionary! + let copy = CommunicationConsentChannelsEmail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + response = try container.decode(String.self, forKey: .response) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(response, forKey: .response) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + } + } + + /* + Model: CommunicationConsentChannelsSms + Used By: Communication + */ + class CommunicationConsentChannelsSms: Codable { + public var response: String? + + public var displayName: String? + + public enum CodingKeys: String, CodingKey { + case response + + case displayName = "display_name" + } + + public init(displayName: String?, response: String?) { + self.response = response + + self.displayName = displayName + } + + public func duplicate() -> CommunicationConsentChannelsSms { + let dict = self.dictionary! + let copy = CommunicationConsentChannelsSms(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + response = try container.decode(String.self, forKey: .response) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(response, forKey: .response) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + } + } + + /* + Model: CommunicationConsentChannelsWhatsapp + Used By: Communication + */ + class CommunicationConsentChannelsWhatsapp: Codable { + public var response: String? + + public var displayName: String? + + public var countryCode: String? + + public var phoneNumber: String? + + public enum CodingKeys: String, CodingKey { + case response + + case displayName = "display_name" + + case countryCode = "country_code" + + case phoneNumber = "phone_number" + } + + public init(countryCode: String?, displayName: String?, phoneNumber: String?, response: String?) { + self.response = response + + self.displayName = displayName + + self.countryCode = countryCode + + self.phoneNumber = phoneNumber + } + + public func duplicate() -> CommunicationConsentChannelsWhatsapp { + let dict = self.dictionary! + let copy = CommunicationConsentChannelsWhatsapp(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + response = try container.decode(String.self, forKey: .response) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phoneNumber = try container.decode(String.self, forKey: .phoneNumber) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(response, forKey: .response) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(phoneNumber, forKey: .phoneNumber) + } + } + + /* + Model: CommunicationConsentChannels + Used By: Communication + */ + class CommunicationConsentChannels: Codable { + public var email: CommunicationConsentChannelsEmail? + + public var sms: CommunicationConsentChannelsSms? + + public var whatsapp: CommunicationConsentChannelsWhatsapp? + + public enum CodingKeys: String, CodingKey { + case email + + case sms + + case whatsapp + } + + public init(email: CommunicationConsentChannelsEmail?, sms: CommunicationConsentChannelsSms?, whatsapp: CommunicationConsentChannelsWhatsapp?) { + self.email = email + + self.sms = sms + + self.whatsapp = whatsapp + } + + public func duplicate() -> CommunicationConsentChannels { + let dict = self.dictionary! + let copy = CommunicationConsentChannels(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(CommunicationConsentChannelsEmail.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sms = try container.decode(CommunicationConsentChannelsSms.self, forKey: .sms) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + whatsapp = try container.decode(CommunicationConsentChannelsWhatsapp.self, forKey: .whatsapp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(sms, forKey: .sms) + + try? container.encodeIfPresent(whatsapp, forKey: .whatsapp) + } + } + + /* + Model: CommunicationConsent + Used By: Communication + */ + class CommunicationConsent: Codable { + public var appId: String? + + public var userId: String? + + public var channels: CommunicationConsentChannels? + + public enum CodingKeys: String, CodingKey { + case appId = "app_id" + + case userId = "user_id" + + case channels + } + + public init(appId: String?, channels: CommunicationConsentChannels?, userId: String?) { + self.appId = appId + + self.userId = userId + + self.channels = channels + } + + public func duplicate() -> CommunicationConsent { + let dict = self.dictionary! + let copy = CommunicationConsent(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + channels = try container.decode(CommunicationConsentChannels.self, forKey: .channels) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(userId, forKey: .userId) + + try? container.encodeIfPresent(channels, forKey: .channels) + } + } + + /* + Model: PushtokenReq + Used By: Communication + */ + class PushtokenReq: Codable { + public var action: String? + + public var bundleIdentifier: String? + + public var pushToken: String? + + public var uniqueDeviceId: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case action + + case bundleIdentifier = "bundle_identifier" + + case pushToken = "push_token" + + case uniqueDeviceId = "unique_device_id" + + case type + } + + public init(action: String?, bundleIdentifier: String?, pushToken: String?, type: String?, uniqueDeviceId: String?) { + self.action = action + + self.bundleIdentifier = bundleIdentifier + + self.pushToken = pushToken + + self.uniqueDeviceId = uniqueDeviceId + + self.type = type + } + + public func duplicate() -> PushtokenReq { + let dict = self.dictionary! + let copy = PushtokenReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + action = try container.decode(String.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bundleIdentifier = try container.decode(String.self, forKey: .bundleIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pushToken = try container.decode(String.self, forKey: .pushToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uniqueDeviceId = try container.decode(String.self, forKey: .uniqueDeviceId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(bundleIdentifier, forKey: .bundleIdentifier) + + try? container.encodeIfPresent(pushToken, forKey: .pushToken) + + try? container.encodeIfPresent(uniqueDeviceId, forKey: .uniqueDeviceId) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: PushtokenRes + Used By: Communication + */ + class PushtokenRes: Codable { + public var id: String? + + public var bundleIdentifier: String? + + public var pushToken: String? + + public var uniqueDeviceId: String? + + public var type: String? + + public var platform: String? + + public var applicationId: String? + + public var userId: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var expiredAt: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case bundleIdentifier = "bundle_identifier" + + case pushToken = "push_token" + + case uniqueDeviceId = "unique_device_id" + + case type + + case platform + + case applicationId = "application_id" + + case userId = "user_id" + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case expiredAt = "expired_at" + } + + public init(applicationId: String?, bundleIdentifier: String?, createdAt: String?, expiredAt: String?, platform: String?, pushToken: String?, type: String?, uniqueDeviceId: String?, updatedAt: String?, userId: String?, id: String?) { + self.id = id + + self.bundleIdentifier = bundleIdentifier + + self.pushToken = pushToken + + self.uniqueDeviceId = uniqueDeviceId + + self.type = type + + self.platform = platform + + self.applicationId = applicationId + + self.userId = userId + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.expiredAt = expiredAt + } + + public func duplicate() -> PushtokenRes { + let dict = self.dictionary! + let copy = PushtokenRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bundleIdentifier = try container.decode(String.self, forKey: .bundleIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pushToken = try container.decode(String.self, forKey: .pushToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uniqueDeviceId = try container.decode(String.self, forKey: .uniqueDeviceId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode(String.self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + applicationId = try container.decode(String.self, forKey: .applicationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expiredAt = try container.decode(String.self, forKey: .expiredAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(bundleIdentifier, forKey: .bundleIdentifier) + + try? container.encodeIfPresent(pushToken, forKey: .pushToken) + + try? container.encodeIfPresent(uniqueDeviceId, forKey: .uniqueDeviceId) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(platform, forKey: .platform) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + + try? container.encodeIfPresent(userId, forKey: .userId) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(expiredAt, forKey: .expiredAt) + } + } +} diff --git a/Sources/code/application/models/ConfigurationAppModelClass.swift b/Sources/code/application/models/ConfigurationAppModelClass.swift new file mode 100644 index 0000000000..ebf1d50a4c --- /dev/null +++ b/Sources/code/application/models/ConfigurationAppModelClass.swift @@ -0,0 +1,7334 @@ +import Foundation + +import Foundation +public extension ApplicationClient { + /* + Model: ApplicationAboutResponse + Used By: Configuration + */ + class ApplicationAboutResponse: Codable { + public var applicationInfo: ApplicationInfo? + + public var companyInfo: CompanyInfo? + + public var ownerInfo: OwnerInfo? + + public enum CodingKeys: String, CodingKey { + case applicationInfo = "application_info" + + case companyInfo = "company_info" + + case ownerInfo = "owner_info" + } + + public init(applicationInfo: ApplicationInfo?, companyInfo: CompanyInfo?, ownerInfo: OwnerInfo?) { + self.applicationInfo = applicationInfo + + self.companyInfo = companyInfo + + self.ownerInfo = ownerInfo + } + + public func duplicate() -> ApplicationAboutResponse { + let dict = self.dictionary! + let copy = ApplicationAboutResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + applicationInfo = try container.decode(ApplicationInfo.self, forKey: .applicationInfo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyInfo = try container.decode(CompanyInfo.self, forKey: .companyInfo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ownerInfo = try container.decode(OwnerInfo.self, forKey: .ownerInfo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(applicationInfo, forKey: .applicationInfo) + + try? container.encodeIfPresent(companyInfo, forKey: .companyInfo) + + try? container.encodeIfPresent(ownerInfo, forKey: .ownerInfo) + } + } + + /* + Model: ApplicationInfo + Used By: Configuration + */ + class ApplicationInfo: Codable { + public var id: String? + + public var domain: Domain? + + public var website: ApplicationWebsite? + + public var cors: ApplicationCors? + + public var description: String? + + public var name: String? + + public var meta: ApplicationMeta? + + public var token: String? + + public var secret: String? + + public var createdAt: String? + + public var banner: SecureUrl? + + public var logo: SecureUrl? + + public var isActive: Bool? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case domain + + case website + + case cors + + case description + + case name + + case meta + + case token + + case secret + + case createdAt = "created_at" + + case banner + + case logo + + case isActive = "is_active" + } + + public init(banner: SecureUrl?, cors: ApplicationCors?, createdAt: String?, description: String?, domain: Domain?, isActive: Bool?, logo: SecureUrl?, meta: ApplicationMeta?, name: String?, secret: String?, token: String?, website: ApplicationWebsite?, id: String?) { + self.id = id + + self.domain = domain + + self.website = website + + self.cors = cors + + self.description = description + + self.name = name + + self.meta = meta + + self.token = token + + self.secret = secret + + self.createdAt = createdAt + + self.banner = banner + + self.logo = logo + + self.isActive = isActive + } + + public func duplicate() -> ApplicationInfo { + let dict = self.dictionary! + let copy = ApplicationInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + domain = try container.decode(Domain.self, forKey: .domain) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + website = try container.decode(ApplicationWebsite.self, forKey: .website) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cors = try container.decode(ApplicationCors.self, forKey: .cors) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode(ApplicationMeta.self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + token = try container.decode(String.self, forKey: .token) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + secret = try container.decode(String.self, forKey: .secret) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banner = try container.decode(SecureUrl.self, forKey: .banner) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(SecureUrl.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(domain, forKey: .domain) + + try? container.encodeIfPresent(website, forKey: .website) + + try? container.encodeIfPresent(cors, forKey: .cors) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(token, forKey: .token) + + try? container.encodeIfPresent(secret, forKey: .secret) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(banner, forKey: .banner) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + } + } + + /* + Model: CompanyInfo + Used By: Configuration + */ + class CompanyInfo: Codable { + public var id: String? + + public var uid: Int? + + public var createdOn: String? + + public var isActive: Bool? + + public var name: String? + + public var addresses: [CompanyAboutAddress]? + + public var notificationEmails: [String]? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case uid + + case createdOn = "created_on" + + case isActive = "is_active" + + case name + + case addresses + + case notificationEmails = "notification_emails" + } + + public init(addresses: [CompanyAboutAddress]?, createdOn: String?, isActive: Bool?, name: String?, notificationEmails: [String]?, uid: Int?, id: String?) { + self.id = id + + self.uid = uid + + self.createdOn = createdOn + + self.isActive = isActive + + self.name = name + + self.addresses = addresses + + self.notificationEmails = notificationEmails + } + + public func duplicate() -> CompanyInfo { + let dict = self.dictionary! + let copy = CompanyInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addresses = try container.decode([CompanyAboutAddress].self, forKey: .addresses) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + notificationEmails = try container.decode([String].self, forKey: .notificationEmails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(addresses, forKey: .addresses) + + try? container.encodeIfPresent(notificationEmails, forKey: .notificationEmails) + } + } + + /* + Model: OwnerInfo + Used By: Configuration + */ + class OwnerInfo: Codable { + public var id: String? + + public var emails: [UserEmail]? + + public var phoneNumbers: [UserPhoneNumber]? + + public var firstName: String? + + public var lastName: String? + + public var profilePic: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case emails + + case phoneNumbers = "phone_numbers" + + case firstName = "first_name" + + case lastName = "last_name" + + case profilePic = "profile_pic" + } + + public init(emails: [UserEmail]?, firstName: String?, lastName: String?, phoneNumbers: [UserPhoneNumber]?, profilePic: String?, id: String?) { + self.id = id + + self.emails = emails + + self.phoneNumbers = phoneNumbers + + self.firstName = firstName + + self.lastName = lastName + + self.profilePic = profilePic + } + + public func duplicate() -> OwnerInfo { + let dict = self.dictionary! + let copy = OwnerInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + emails = try container.decode([UserEmail].self, forKey: .emails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phoneNumbers = try container.decode([UserPhoneNumber].self, forKey: .phoneNumbers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + profilePic = try container.decode(String.self, forKey: .profilePic) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(emails, forKey: .emails) + + try? container.encodeIfPresent(phoneNumbers, forKey: .phoneNumbers) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(profilePic, forKey: .profilePic) + } + } + + /* + Model: AppVersionRequest + Used By: Configuration + */ + class AppVersionRequest: Codable { + public var application: ApplicationVersionRequest + + public var device: Device + + public var locale: String? + + public var timezone: String? + + public enum CodingKeys: String, CodingKey { + case application + + case device + + case locale + + case timezone + } + + public init(application: ApplicationVersionRequest, device: Device, locale: String?, timezone: String?) { + self.application = application + + self.device = device + + self.locale = locale + + self.timezone = timezone + } + + public func duplicate() -> AppVersionRequest { + let dict = self.dictionary! + let copy = AppVersionRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + application = try container.decode(ApplicationVersionRequest.self, forKey: .application) + + device = try container.decode(Device.self, forKey: .device) + + do { + locale = try container.decode(String.self, forKey: .locale) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + timezone = try container.decode(String.self, forKey: .timezone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(device, forKey: .device) + + try? container.encodeIfPresent(locale, forKey: .locale) + + try? container.encodeIfPresent(timezone, forKey: .timezone) + } + } + + /* + Model: ApplicationVersionRequest + Used By: Configuration + */ + class ApplicationVersionRequest: Codable { + public var id: String? + + public var name: String + + public var namespace: String? + + public var token: String? + + public var version: String + + public enum CodingKeys: String, CodingKey { + case id + + case name + + case namespace + + case token + + case version + } + + public init(id: String?, name: String, namespace: String?, token: String?, version: String) { + self.id = id + + self.name = name + + self.namespace = namespace + + self.token = token + + self.version = version + } + + public func duplicate() -> ApplicationVersionRequest { + let dict = self.dictionary! + let copy = ApplicationVersionRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + name = try container.decode(String.self, forKey: .name) + + do { + namespace = try container.decode(String.self, forKey: .namespace) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + token = try container.decode(String.self, forKey: .token) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + version = try container.decode(String.self, forKey: .version) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(namespace, forKey: .namespace) + + try? container.encodeIfPresent(token, forKey: .token) + + try? container.encodeIfPresent(version, forKey: .version) + } + } + + /* + Model: Device + Used By: Configuration + */ + class Device: Codable { + public var build: Int? + + public var model: String? + + public var os: OS + + public enum CodingKeys: String, CodingKey { + case build + + case model + + case os + } + + public init(build: Int?, model: String?, os: OS) { + self.build = build + + self.model = model + + self.os = os + } + + public func duplicate() -> Device { + let dict = self.dictionary! + let copy = Device(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + build = try container.decode(Int.self, forKey: .build) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + model = try container.decode(String.self, forKey: .model) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + os = try container.decode(OS.self, forKey: .os) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(build, forKey: .build) + + try? container.encodeIfPresent(model, forKey: .model) + + try? container.encodeIfPresent(os, forKey: .os) + } + } + + /* + Model: OS + Used By: Configuration + */ + class OS: Codable { + public var name: String + + public var version: String? + + public enum CodingKeys: String, CodingKey { + case name + + case version + } + + public init(name: String, version: String?) { + self.name = name + + self.version = version + } + + public func duplicate() -> OS { + let dict = self.dictionary! + let copy = OS(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + name = try container.decode(String.self, forKey: .name) + + do { + version = try container.decode(String.self, forKey: .version) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(version, forKey: .version) + } + } + + /* + Model: SupportedLanguage + Used By: Configuration + */ + class SupportedLanguage: Codable { + public var name: String? + + public var code: String? + + public enum CodingKeys: String, CodingKey { + case name + + case code + } + + public init(code: String?, name: String?) { + self.name = name + + self.code = code + } + + public func duplicate() -> SupportedLanguage { + let dict = self.dictionary! + let copy = SupportedLanguage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: LanguageResponse + Used By: Configuration + */ + class LanguageResponse: Codable { + public var items: [SupportedLanguage]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [SupportedLanguage]?) { + self.items = items + } + + public func duplicate() -> LanguageResponse { + let dict = self.dictionary! + let copy = LanguageResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([SupportedLanguage].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: AppStaffResponse + Used By: Configuration + */ + class AppStaffResponse: Codable { + public var staffUsers: [AppStaff]? + + public enum CodingKeys: String, CodingKey { + case staffUsers = "staff_users" + } + + public init(staffUsers: [AppStaff]?) { + self.staffUsers = staffUsers + } + + public func duplicate() -> AppStaffResponse { + let dict = self.dictionary! + let copy = AppStaffResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + staffUsers = try container.decode([AppStaff].self, forKey: .staffUsers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(staffUsers, forKey: .staffUsers) + } + } + + /* + Model: UpdateDialog + Used By: Configuration + */ + class UpdateDialog: Codable { + public var type: String? + + public var interval: Int? + + public enum CodingKeys: String, CodingKey { + case type + + case interval + } + + public init(interval: Int?, type: String?) { + self.type = type + + self.interval = interval + } + + public func duplicate() -> UpdateDialog { + let dict = self.dictionary! + let copy = UpdateDialog(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + interval = try container.decode(Int.self, forKey: .interval) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(interval, forKey: .interval) + } + } + + /* + Model: OrderingStoreSelectRequest + Used By: Configuration + */ + class OrderingStoreSelectRequest: Codable { + public var orderingStore: OrderingStoreSelect + + public enum CodingKeys: String, CodingKey { + case orderingStore = "ordering_store" + } + + public init(orderingStore: OrderingStoreSelect) { + self.orderingStore = orderingStore + } + + public func duplicate() -> OrderingStoreSelectRequest { + let dict = self.dictionary! + let copy = OrderingStoreSelectRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + orderingStore = try container.decode(OrderingStoreSelect.self, forKey: .orderingStore) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(orderingStore, forKey: .orderingStore) + } + } + + /* + Model: OrderingStoreSelect + Used By: Configuration + */ + class OrderingStoreSelect: Codable { + public var uid: Int + + public enum CodingKeys: String, CodingKey { + case uid + } + + public init(uid: Int) { + self.uid = uid + } + + public func duplicate() -> OrderingStoreSelect { + let dict = self.dictionary! + let copy = OrderingStoreSelect(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + uid = try container.decode(Int.self, forKey: .uid) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + } + } + + /* + Model: AppStaff + Used By: Configuration + */ + class AppStaff: Codable { + public var id: String? + + public var orderIncent: Bool? + + public var stores: [Int]? + + public var application: String? + + public var title: String? + + public var user: String? + + public var employeeCode: String? + + public var firstName: String? + + public var lastName: String? + + public var profilePicUrl: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case orderIncent = "order_incent" + + case stores + + case application + + case title + + case user + + case employeeCode = "employee_code" + + case firstName = "first_name" + + case lastName = "last_name" + + case profilePicUrl = "profile_pic_url" + } + + public init(application: String?, employeeCode: String?, firstName: String?, lastName: String?, orderIncent: Bool?, profilePicUrl: String?, stores: [Int]?, title: String?, user: String?, id: String?) { + self.id = id + + self.orderIncent = orderIncent + + self.stores = stores + + self.application = application + + self.title = title + + self.user = user + + self.employeeCode = employeeCode + + self.firstName = firstName + + self.lastName = lastName + + self.profilePicUrl = profilePicUrl + } + + public func duplicate() -> AppStaff { + let dict = self.dictionary! + let copy = AppStaff(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderIncent = try container.decode(Bool.self, forKey: .orderIncent) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stores = try container.decode([Int].self, forKey: .stores) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + user = try container.decode(String.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + employeeCode = try container.decode(String.self, forKey: .employeeCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + profilePicUrl = try container.decode(String.self, forKey: .profilePicUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(orderIncent, forKey: .orderIncent) + + try? container.encodeIfPresent(stores, forKey: .stores) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(employeeCode, forKey: .employeeCode) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(profilePicUrl, forKey: .profilePicUrl) + } + } + + /* + Model: AppTokenResponse + Used By: Configuration + */ + class AppTokenResponse: Codable { + public var tokens: Tokens? + + public var id: String? + + public var application: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case tokens + + case id = "_id" + + case application + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + } + + public init(application: String?, createdAt: String?, tokens: Tokens?, updatedAt: String?, id: String?, v: Int?) { + self.tokens = tokens + + self.id = id + + self.application = application + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + } + + public func duplicate() -> AppTokenResponse { + let dict = self.dictionary! + let copy = AppTokenResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + tokens = try container.decode(Tokens.self, forKey: .tokens) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(tokens, forKey: .tokens) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: Tokens + Used By: Configuration + */ + class Tokens: Codable { + public var firebase: Firebase? + + public var moengage: Moengage? + + public var segment: Segment? + + public var gtm: Gtm? + + public var freshchat: Freshchat? + + public var safetynet: Safetynet? + + public var fyndRewards: FyndRewards? + + public var googleMap: GoogleMap? + + public enum CodingKeys: String, CodingKey { + case firebase + + case moengage + + case segment + + case gtm + + case freshchat + + case safetynet + + case fyndRewards = "fynd_rewards" + + case googleMap = "google_map" + } + + public init(firebase: Firebase?, freshchat: Freshchat?, fyndRewards: FyndRewards?, googleMap: GoogleMap?, gtm: Gtm?, moengage: Moengage?, safetynet: Safetynet?, segment: Segment?) { + self.firebase = firebase + + self.moengage = moengage + + self.segment = segment + + self.gtm = gtm + + self.freshchat = freshchat + + self.safetynet = safetynet + + self.fyndRewards = fyndRewards + + self.googleMap = googleMap + } + + public func duplicate() -> Tokens { + let dict = self.dictionary! + let copy = Tokens(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + firebase = try container.decode(Firebase.self, forKey: .firebase) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + moengage = try container.decode(Moengage.self, forKey: .moengage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + segment = try container.decode(Segment.self, forKey: .segment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gtm = try container.decode(Gtm.self, forKey: .gtm) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + freshchat = try container.decode(Freshchat.self, forKey: .freshchat) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + safetynet = try container.decode(Safetynet.self, forKey: .safetynet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fyndRewards = try container.decode(FyndRewards.self, forKey: .fyndRewards) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + googleMap = try container.decode(GoogleMap.self, forKey: .googleMap) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(firebase, forKey: .firebase) + + try? container.encodeIfPresent(moengage, forKey: .moengage) + + try? container.encodeIfPresent(segment, forKey: .segment) + + try? container.encodeIfPresent(gtm, forKey: .gtm) + + try? container.encodeIfPresent(freshchat, forKey: .freshchat) + + try? container.encodeIfPresent(safetynet, forKey: .safetynet) + + try? container.encodeIfPresent(fyndRewards, forKey: .fyndRewards) + + try? container.encodeIfPresent(googleMap, forKey: .googleMap) + } + } + + /* + Model: Firebase + Used By: Configuration + */ + class Firebase: Codable { + public var credentials: Credentials? + + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case credentials + + case enabled + } + + public init(credentials: Credentials?, enabled: Bool?) { + self.credentials = credentials + + self.enabled = enabled + } + + public func duplicate() -> Firebase { + let dict = self.dictionary! + let copy = Firebase(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + credentials = try container.decode(Credentials.self, forKey: .credentials) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(credentials, forKey: .credentials) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: Credentials + Used By: Configuration + */ + class Credentials: Codable { + public var ios: Ios? + + public var android: Android? + + public var projectId: String? + + public var gcmSenderId: String? + + public var applicationId: String? + + public var apiKey: String? + + public enum CodingKeys: String, CodingKey { + case ios + + case android + + case projectId = "project_id" + + case gcmSenderId = "gcm_sender_id" + + case applicationId = "application_id" + + case apiKey = "api_key" + } + + public init(android: Android?, apiKey: String?, applicationId: String?, gcmSenderId: String?, ios: Ios?, projectId: String?) { + self.ios = ios + + self.android = android + + self.projectId = projectId + + self.gcmSenderId = gcmSenderId + + self.applicationId = applicationId + + self.apiKey = apiKey + } + + public func duplicate() -> Credentials { + let dict = self.dictionary! + let copy = Credentials(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + ios = try container.decode(Ios.self, forKey: .ios) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + android = try container.decode(Android.self, forKey: .android) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + projectId = try container.decode(String.self, forKey: .projectId) + + if let strong_projectId = projectId, + let projectIdData = Data(base64Encoded: strong_projectId) + { + projectId = String(data: projectIdData, encoding: .utf8) ?? projectId + } + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gcmSenderId = try container.decode(String.self, forKey: .gcmSenderId) + + if let strong_gcmSenderId = gcmSenderId, + let gcmSenderIdData = Data(base64Encoded: strong_gcmSenderId) + { + gcmSenderId = String(data: gcmSenderIdData, encoding: .utf8) ?? gcmSenderId + } + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + applicationId = try container.decode(String.self, forKey: .applicationId) + + if let strong_applicationId = applicationId, + let applicationIdData = Data(base64Encoded: strong_applicationId) + { + applicationId = String(data: applicationIdData, encoding: .utf8) ?? applicationId + } + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + apiKey = try container.decode(String.self, forKey: .apiKey) + + if let strong_apiKey = apiKey, + let apiKeyData = Data(base64Encoded: strong_apiKey) + { + apiKey = String(data: apiKeyData, encoding: .utf8) ?? apiKey + } + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(ios, forKey: .ios) + + try? container.encodeIfPresent(android, forKey: .android) + + try? container.encodeIfPresent(projectId?.asBase64, forKey: .projectId) + + try? container.encodeIfPresent(gcmSenderId?.asBase64, forKey: .gcmSenderId) + + try? container.encodeIfPresent(applicationId?.asBase64, forKey: .applicationId) + + try? container.encodeIfPresent(apiKey?.asBase64, forKey: .apiKey) + } + } + + /* + Model: Ios + Used By: Configuration + */ + class Ios: Codable { + public var applicationId: String? + + public var apiKey: String? + + public enum CodingKeys: String, CodingKey { + case applicationId = "application_id" + + case apiKey = "api_key" + } + + public init(apiKey: String?, applicationId: String?) { + self.applicationId = applicationId + + self.apiKey = apiKey + } + + public func duplicate() -> Ios { + let dict = self.dictionary! + let copy = Ios(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + applicationId = try container.decode(String.self, forKey: .applicationId) + + if let strong_applicationId = applicationId, + let applicationIdData = Data(base64Encoded: strong_applicationId) + { + applicationId = String(data: applicationIdData, encoding: .utf8) ?? applicationId + } + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + apiKey = try container.decode(String.self, forKey: .apiKey) + + if let strong_apiKey = apiKey, + let apiKeyData = Data(base64Encoded: strong_apiKey) + { + apiKey = String(data: apiKeyData, encoding: .utf8) ?? apiKey + } + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(applicationId?.asBase64, forKey: .applicationId) + + try? container.encodeIfPresent(apiKey?.asBase64, forKey: .apiKey) + } + } + + /* + Model: Android + Used By: Configuration + */ + class Android: Codable { + public var applicationId: String? + + public var apiKey: String? + + public enum CodingKeys: String, CodingKey { + case applicationId = "application_id" + + case apiKey = "api_key" + } + + public init(apiKey: String?, applicationId: String?) { + self.applicationId = applicationId + + self.apiKey = apiKey + } + + public func duplicate() -> Android { + let dict = self.dictionary! + let copy = Android(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + applicationId = try container.decode(String.self, forKey: .applicationId) + + if let strong_applicationId = applicationId, + let applicationIdData = Data(base64Encoded: strong_applicationId) + { + applicationId = String(data: applicationIdData, encoding: .utf8) ?? applicationId + } + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + apiKey = try container.decode(String.self, forKey: .apiKey) + + if let strong_apiKey = apiKey, + let apiKeyData = Data(base64Encoded: strong_apiKey) + { + apiKey = String(data: apiKeyData, encoding: .utf8) ?? apiKey + } + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(applicationId?.asBase64, forKey: .applicationId) + + try? container.encodeIfPresent(apiKey?.asBase64, forKey: .apiKey) + } + } + + /* + Model: Moengage + Used By: Configuration + */ + class Moengage: Codable { + public var credentials: MoengageCredentials? + + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case credentials + + case enabled + } + + public init(credentials: MoengageCredentials?, enabled: Bool?) { + self.credentials = credentials + + self.enabled = enabled + } + + public func duplicate() -> Moengage { + let dict = self.dictionary! + let copy = Moengage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + credentials = try container.decode(MoengageCredentials.self, forKey: .credentials) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(credentials, forKey: .credentials) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: MoengageCredentials + Used By: Configuration + */ + class MoengageCredentials: Codable { + public var appId: String? + + public enum CodingKeys: String, CodingKey { + case appId = "app_id" + } + + public init(appId: String?) { + self.appId = appId + } + + public func duplicate() -> MoengageCredentials { + let dict = self.dictionary! + let copy = MoengageCredentials(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + appId = try container.decode(String.self, forKey: .appId) + + if let strong_appId = appId, + let appIdData = Data(base64Encoded: strong_appId) + { + appId = String(data: appIdData, encoding: .utf8) ?? appId + } + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appId?.asBase64, forKey: .appId) + } + } + + /* + Model: Segment + Used By: Configuration + */ + class Segment: Codable { + public var credentials: SegmentCredentials? + + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case credentials + + case enabled + } + + public init(credentials: SegmentCredentials?, enabled: Bool?) { + self.credentials = credentials + + self.enabled = enabled + } + + public func duplicate() -> Segment { + let dict = self.dictionary! + let copy = Segment(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + credentials = try container.decode(SegmentCredentials.self, forKey: .credentials) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(credentials, forKey: .credentials) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: SegmentCredentials + Used By: Configuration + */ + class SegmentCredentials: Codable { + public var writeKey: String? + + public enum CodingKeys: String, CodingKey { + case writeKey = "write_key" + } + + public init(writeKey: String?) { + self.writeKey = writeKey + } + + public func duplicate() -> SegmentCredentials { + let dict = self.dictionary! + let copy = SegmentCredentials(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + writeKey = try container.decode(String.self, forKey: .writeKey) + + if let strong_writeKey = writeKey, + let writeKeyData = Data(base64Encoded: strong_writeKey) + { + writeKey = String(data: writeKeyData, encoding: .utf8) ?? writeKey + } + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(writeKey?.asBase64, forKey: .writeKey) + } + } + + /* + Model: Gtm + Used By: Configuration + */ + class Gtm: Codable { + public var credentials: GtmCredentials? + + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case credentials + + case enabled + } + + public init(credentials: GtmCredentials?, enabled: Bool?) { + self.credentials = credentials + + self.enabled = enabled + } + + public func duplicate() -> Gtm { + let dict = self.dictionary! + let copy = Gtm(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + credentials = try container.decode(GtmCredentials.self, forKey: .credentials) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(credentials, forKey: .credentials) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: GtmCredentials + Used By: Configuration + */ + class GtmCredentials: Codable { + public var apiKey: String? + + public enum CodingKeys: String, CodingKey { + case apiKey = "api_key" + } + + public init(apiKey: String?) { + self.apiKey = apiKey + } + + public func duplicate() -> GtmCredentials { + let dict = self.dictionary! + let copy = GtmCredentials(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + apiKey = try container.decode(String.self, forKey: .apiKey) + + if let strong_apiKey = apiKey, + let apiKeyData = Data(base64Encoded: strong_apiKey) + { + apiKey = String(data: apiKeyData, encoding: .utf8) ?? apiKey + } + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(apiKey?.asBase64, forKey: .apiKey) + } + } + + /* + Model: Freshchat + Used By: Configuration + */ + class Freshchat: Codable { + public var credentials: FreshchatCredentials? + + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case credentials + + case enabled + } + + public init(credentials: FreshchatCredentials?, enabled: Bool?) { + self.credentials = credentials + + self.enabled = enabled + } + + public func duplicate() -> Freshchat { + let dict = self.dictionary! + let copy = Freshchat(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + credentials = try container.decode(FreshchatCredentials.self, forKey: .credentials) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(credentials, forKey: .credentials) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: FreshchatCredentials + Used By: Configuration + */ + class FreshchatCredentials: Codable { + public var appId: String? + + public var appKey: String? + + public var webToken: String? + + public enum CodingKeys: String, CodingKey { + case appId = "app_id" + + case appKey = "app_key" + + case webToken = "web_token" + } + + public init(appId: String?, appKey: String?, webToken: String?) { + self.appId = appId + + self.appKey = appKey + + self.webToken = webToken + } + + public func duplicate() -> FreshchatCredentials { + let dict = self.dictionary! + let copy = FreshchatCredentials(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + appId = try container.decode(String.self, forKey: .appId) + + if let strong_appId = appId, + let appIdData = Data(base64Encoded: strong_appId) + { + appId = String(data: appIdData, encoding: .utf8) ?? appId + } + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appKey = try container.decode(String.self, forKey: .appKey) + + if let strong_appKey = appKey, + let appKeyData = Data(base64Encoded: strong_appKey) + { + appKey = String(data: appKeyData, encoding: .utf8) ?? appKey + } + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + webToken = try container.decode(String.self, forKey: .webToken) + + if let strong_webToken = webToken, + let webTokenData = Data(base64Encoded: strong_webToken) + { + webToken = String(data: webTokenData, encoding: .utf8) ?? webToken + } + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appId?.asBase64, forKey: .appId) + + try? container.encodeIfPresent(appKey?.asBase64, forKey: .appKey) + + try? container.encodeIfPresent(webToken?.asBase64, forKey: .webToken) + } + } + + /* + Model: Safetynet + Used By: Configuration + */ + class Safetynet: Codable { + public var credentials: SafetynetCredentials? + + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case credentials + + case enabled + } + + public init(credentials: SafetynetCredentials?, enabled: Bool?) { + self.credentials = credentials + + self.enabled = enabled + } + + public func duplicate() -> Safetynet { + let dict = self.dictionary! + let copy = Safetynet(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + credentials = try container.decode(SafetynetCredentials.self, forKey: .credentials) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(credentials, forKey: .credentials) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: SafetynetCredentials + Used By: Configuration + */ + class SafetynetCredentials: Codable { + public var apiKey: String? + + public enum CodingKeys: String, CodingKey { + case apiKey = "api_key" + } + + public init(apiKey: String?) { + self.apiKey = apiKey + } + + public func duplicate() -> SafetynetCredentials { + let dict = self.dictionary! + let copy = SafetynetCredentials(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + apiKey = try container.decode(String.self, forKey: .apiKey) + + if let strong_apiKey = apiKey, + let apiKeyData = Data(base64Encoded: strong_apiKey) + { + apiKey = String(data: apiKeyData, encoding: .utf8) ?? apiKey + } + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(apiKey?.asBase64, forKey: .apiKey) + } + } + + /* + Model: FyndRewards + Used By: Configuration + */ + class FyndRewards: Codable { + public var credentials: FyndRewardsCredentials? + + public enum CodingKeys: String, CodingKey { + case credentials + } + + public init(credentials: FyndRewardsCredentials?) { + self.credentials = credentials + } + + public func duplicate() -> FyndRewards { + let dict = self.dictionary! + let copy = FyndRewards(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + credentials = try container.decode(FyndRewardsCredentials.self, forKey: .credentials) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(credentials, forKey: .credentials) + } + } + + /* + Model: FyndRewardsCredentials + Used By: Configuration + */ + class FyndRewardsCredentials: Codable { + public var publicKey: String? + + public enum CodingKeys: String, CodingKey { + case publicKey = "public_key" + } + + public init(publicKey: String?) { + self.publicKey = publicKey + } + + public func duplicate() -> FyndRewardsCredentials { + let dict = self.dictionary! + let copy = FyndRewardsCredentials(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + publicKey = try container.decode(String.self, forKey: .publicKey) + + if let strong_publicKey = publicKey, + let publicKeyData = Data(base64Encoded: strong_publicKey) + { + publicKey = String(data: publicKeyData, encoding: .utf8) ?? publicKey + } + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(publicKey?.asBase64, forKey: .publicKey) + } + } + + /* + Model: GoogleMap + Used By: Configuration + */ + class GoogleMap: Codable { + public var credentials: GoogleMapCredentials? + + public enum CodingKeys: String, CodingKey { + case credentials + } + + public init(credentials: GoogleMapCredentials?) { + self.credentials = credentials + } + + public func duplicate() -> GoogleMap { + let dict = self.dictionary! + let copy = GoogleMap(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + credentials = try container.decode(GoogleMapCredentials.self, forKey: .credentials) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(credentials, forKey: .credentials) + } + } + + /* + Model: GoogleMapCredentials + Used By: Configuration + */ + class GoogleMapCredentials: Codable { + public var apiKey: String? + + public enum CodingKeys: String, CodingKey { + case apiKey = "api_key" + } + + public init(apiKey: String?) { + self.apiKey = apiKey + } + + public func duplicate() -> GoogleMapCredentials { + let dict = self.dictionary! + let copy = GoogleMapCredentials(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + apiKey = try container.decode(String.self, forKey: .apiKey) + + if let strong_apiKey = apiKey, + let apiKeyData = Data(base64Encoded: strong_apiKey) + { + apiKey = String(data: apiKeyData, encoding: .utf8) ?? apiKey + } + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(apiKey?.asBase64, forKey: .apiKey) + } + } + + /* + Model: RewardPointsConfig + Used By: Configuration + */ + class RewardPointsConfig: Codable { + public var credit: Credit? + + public var debit: Debit? + + public enum CodingKeys: String, CodingKey { + case credit + + case debit + } + + public init(credit: Credit?, debit: Debit?) { + self.credit = credit + + self.debit = debit + } + + public func duplicate() -> RewardPointsConfig { + let dict = self.dictionary! + let copy = RewardPointsConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + credit = try container.decode(Credit.self, forKey: .credit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + debit = try container.decode(Debit.self, forKey: .debit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(credit, forKey: .credit) + + try? container.encodeIfPresent(debit, forKey: .debit) + } + } + + /* + Model: Credit + Used By: Configuration + */ + class Credit: Codable { + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case enabled + } + + public init(enabled: Bool?) { + self.enabled = enabled + } + + public func duplicate() -> Credit { + let dict = self.dictionary! + let copy = Credit(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: Debit + Used By: Configuration + */ + class Debit: Codable { + public var enabled: Bool? + + public var autoApply: Bool? + + public var strategyChannel: String? + + public enum CodingKeys: String, CodingKey { + case enabled + + case autoApply = "auto_apply" + + case strategyChannel = "strategy_channel" + } + + public init(autoApply: Bool?, enabled: Bool?, strategyChannel: String?) { + self.enabled = enabled + + self.autoApply = autoApply + + self.strategyChannel = strategyChannel + } + + public func duplicate() -> Debit { + let dict = self.dictionary! + let copy = Debit(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + autoApply = try container.decode(Bool.self, forKey: .autoApply) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + strategyChannel = try container.decode(String.self, forKey: .strategyChannel) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(autoApply, forKey: .autoApply) + + try? container.encodeIfPresent(strategyChannel, forKey: .strategyChannel) + } + } + + /* + Model: ProductDetailFeature + Used By: Configuration + */ + class ProductDetailFeature: Codable { + public var similar: [String]? + + public var sellerSelection: Bool? + + public var updateProductMeta: Bool? + + public var requestProduct: Bool? + + public enum CodingKeys: String, CodingKey { + case similar + + case sellerSelection = "seller_selection" + + case updateProductMeta = "update_product_meta" + + case requestProduct = "request_product" + } + + public init(requestProduct: Bool?, sellerSelection: Bool?, similar: [String]?, updateProductMeta: Bool?) { + self.similar = similar + + self.sellerSelection = sellerSelection + + self.updateProductMeta = updateProductMeta + + self.requestProduct = requestProduct + } + + public func duplicate() -> ProductDetailFeature { + let dict = self.dictionary! + let copy = ProductDetailFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + similar = try container.decode([String].self, forKey: .similar) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sellerSelection = try container.decode(Bool.self, forKey: .sellerSelection) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updateProductMeta = try container.decode(Bool.self, forKey: .updateProductMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestProduct = try container.decode(Bool.self, forKey: .requestProduct) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(similar, forKey: .similar) + + try? container.encodeIfPresent(sellerSelection, forKey: .sellerSelection) + + try? container.encodeIfPresent(updateProductMeta, forKey: .updateProductMeta) + + try? container.encodeIfPresent(requestProduct, forKey: .requestProduct) + } + } + + /* + Model: LaunchPage + Used By: Configuration + */ + class LaunchPage: Codable { + public var pageType: String? + + public var params: [String: Any]? + + public var query: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case pageType = "page_type" + + case params + + case query + } + + public init(pageType: String?, params: [String: Any]?, query: [String: Any]?) { + self.pageType = pageType + + self.params = params + + self.query = query + } + + public func duplicate() -> LaunchPage { + let dict = self.dictionary! + let copy = LaunchPage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + pageType = try container.decode(String.self, forKey: .pageType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + params = try container.decode([String: Any].self, forKey: .params) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode([String: Any].self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pageType, forKey: .pageType) + + try? container.encodeIfPresent(params, forKey: .params) + + try? container.encodeIfPresent(query, forKey: .query) + } + } + + /* + Model: LandingPageFeature + Used By: Configuration + */ + class LandingPageFeature: Codable { + public var launchPage: LaunchPage? + + public var continueAsGuest: Bool? + + public var loginBtnText: String? + + public var showDomainTextbox: Bool? + + public var showRegisterBtn: Bool? + + public enum CodingKeys: String, CodingKey { + case launchPage = "launch_page" + + case continueAsGuest = "continue_as_guest" + + case loginBtnText = "login_btn_text" + + case showDomainTextbox = "show_domain_textbox" + + case showRegisterBtn = "show_register_btn" + } + + public init(continueAsGuest: Bool?, launchPage: LaunchPage?, loginBtnText: String?, showDomainTextbox: Bool?, showRegisterBtn: Bool?) { + self.launchPage = launchPage + + self.continueAsGuest = continueAsGuest + + self.loginBtnText = loginBtnText + + self.showDomainTextbox = showDomainTextbox + + self.showRegisterBtn = showRegisterBtn + } + + public func duplicate() -> LandingPageFeature { + let dict = self.dictionary! + let copy = LandingPageFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + launchPage = try container.decode(LaunchPage.self, forKey: .launchPage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + continueAsGuest = try container.decode(Bool.self, forKey: .continueAsGuest) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + loginBtnText = try container.decode(String.self, forKey: .loginBtnText) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + showDomainTextbox = try container.decode(Bool.self, forKey: .showDomainTextbox) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + showRegisterBtn = try container.decode(Bool.self, forKey: .showRegisterBtn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(launchPage, forKey: .launchPage) + + try? container.encodeIfPresent(continueAsGuest, forKey: .continueAsGuest) + + try? container.encodeIfPresent(loginBtnText, forKey: .loginBtnText) + + try? container.encodeIfPresent(showDomainTextbox, forKey: .showDomainTextbox) + + try? container.encodeIfPresent(showRegisterBtn, forKey: .showRegisterBtn) + } + } + + /* + Model: RegistrationPageFeature + Used By: Configuration + */ + class RegistrationPageFeature: Codable { + public var askStoreAddress: Bool? + + public enum CodingKeys: String, CodingKey { + case askStoreAddress = "ask_store_address" + } + + public init(askStoreAddress: Bool?) { + self.askStoreAddress = askStoreAddress + } + + public func duplicate() -> RegistrationPageFeature { + let dict = self.dictionary! + let copy = RegistrationPageFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + askStoreAddress = try container.decode(Bool.self, forKey: .askStoreAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(askStoreAddress, forKey: .askStoreAddress) + } + } + + /* + Model: AppFeature + Used By: Configuration + */ + class AppFeature: Codable { + public var productDetail: ProductDetailFeature? + + public var landingPage: LandingPageFeature? + + public var registrationPage: RegistrationPageFeature? + + public var homePage: HomePageFeature? + + public var common: CommonFeature? + + public var cart: CartFeature? + + public var qr: QrFeature? + + public var pcr: PcrFeature? + + public var order: OrderFeature? + + public var id: String? + + public var app: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case productDetail = "product_detail" + + case landingPage = "landing_page" + + case registrationPage = "registration_page" + + case homePage = "home_page" + + case common + + case cart + + case qr + + case pcr + + case order + + case id = "_id" + + case app + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + } + + public init(app: String?, cart: CartFeature?, common: CommonFeature?, createdAt: String?, homePage: HomePageFeature?, landingPage: LandingPageFeature?, order: OrderFeature?, pcr: PcrFeature?, productDetail: ProductDetailFeature?, qr: QrFeature?, registrationPage: RegistrationPageFeature?, updatedAt: String?, id: String?, v: Int?) { + self.productDetail = productDetail + + self.landingPage = landingPage + + self.registrationPage = registrationPage + + self.homePage = homePage + + self.common = common + + self.cart = cart + + self.qr = qr + + self.pcr = pcr + + self.order = order + + self.id = id + + self.app = app + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + } + + public func duplicate() -> AppFeature { + let dict = self.dictionary! + let copy = AppFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + productDetail = try container.decode(ProductDetailFeature.self, forKey: .productDetail) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + landingPage = try container.decode(LandingPageFeature.self, forKey: .landingPage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registrationPage = try container.decode(RegistrationPageFeature.self, forKey: .registrationPage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + homePage = try container.decode(HomePageFeature.self, forKey: .homePage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + common = try container.decode(CommonFeature.self, forKey: .common) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cart = try container.decode(CartFeature.self, forKey: .cart) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + qr = try container.decode(QrFeature.self, forKey: .qr) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pcr = try container.decode(PcrFeature.self, forKey: .pcr) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + order = try container.decode(OrderFeature.self, forKey: .order) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + app = try container.decode(String.self, forKey: .app) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(productDetail, forKey: .productDetail) + + try? container.encodeIfPresent(landingPage, forKey: .landingPage) + + try? container.encodeIfPresent(registrationPage, forKey: .registrationPage) + + try? container.encodeIfPresent(homePage, forKey: .homePage) + + try? container.encodeIfPresent(common, forKey: .common) + + try? container.encodeIfPresent(cart, forKey: .cart) + + try? container.encodeIfPresent(qr, forKey: .qr) + + try? container.encodeIfPresent(pcr, forKey: .pcr) + + try? container.encodeIfPresent(order, forKey: .order) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(app, forKey: .app) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: HomePageFeature + Used By: Configuration + */ + class HomePageFeature: Codable { + public var orderProcessing: Bool? + + public enum CodingKeys: String, CodingKey { + case orderProcessing = "order_processing" + } + + public init(orderProcessing: Bool?) { + self.orderProcessing = orderProcessing + } + + public func duplicate() -> HomePageFeature { + let dict = self.dictionary! + let copy = HomePageFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + orderProcessing = try container.decode(Bool.self, forKey: .orderProcessing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(orderProcessing, forKey: .orderProcessing) + } + } + + /* + Model: CommonFeature + Used By: Configuration + */ + class CommonFeature: Codable { + public var communicationOptinDialog: CommunicationOptinDialogFeature? + + public var deploymentStoreSelection: DeploymentStoreSelectionFeature? + + public var listingPrice: ListingPriceFeature? + + public var currency: CurrencyFeature? + + public var revenueEngine: RevenueEngineFeature? + + public var feedback: FeedbackFeature? + + public var compareProducts: CompareProductsFeature? + + public var rewardPoints: RewardPointsConfig? + + public enum CodingKeys: String, CodingKey { + case communicationOptinDialog = "communication_optin_dialog" + + case deploymentStoreSelection = "deployment_store_selection" + + case listingPrice = "listing_price" + + case currency + + case revenueEngine = "revenue_engine" + + case feedback + + case compareProducts = "compare_products" + + case rewardPoints = "reward_points" + } + + public init(communicationOptinDialog: CommunicationOptinDialogFeature?, compareProducts: CompareProductsFeature?, currency: CurrencyFeature?, deploymentStoreSelection: DeploymentStoreSelectionFeature?, feedback: FeedbackFeature?, listingPrice: ListingPriceFeature?, revenueEngine: RevenueEngineFeature?, rewardPoints: RewardPointsConfig?) { + self.communicationOptinDialog = communicationOptinDialog + + self.deploymentStoreSelection = deploymentStoreSelection + + self.listingPrice = listingPrice + + self.currency = currency + + self.revenueEngine = revenueEngine + + self.feedback = feedback + + self.compareProducts = compareProducts + + self.rewardPoints = rewardPoints + } + + public func duplicate() -> CommonFeature { + let dict = self.dictionary! + let copy = CommonFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + communicationOptinDialog = try container.decode(CommunicationOptinDialogFeature.self, forKey: .communicationOptinDialog) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deploymentStoreSelection = try container.decode(DeploymentStoreSelectionFeature.self, forKey: .deploymentStoreSelection) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + listingPrice = try container.decode(ListingPriceFeature.self, forKey: .listingPrice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(CurrencyFeature.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + revenueEngine = try container.decode(RevenueEngineFeature.self, forKey: .revenueEngine) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + feedback = try container.decode(FeedbackFeature.self, forKey: .feedback) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + compareProducts = try container.decode(CompareProductsFeature.self, forKey: .compareProducts) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rewardPoints = try container.decode(RewardPointsConfig.self, forKey: .rewardPoints) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(communicationOptinDialog, forKey: .communicationOptinDialog) + + try? container.encodeIfPresent(deploymentStoreSelection, forKey: .deploymentStoreSelection) + + try? container.encodeIfPresent(listingPrice, forKey: .listingPrice) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(revenueEngine, forKey: .revenueEngine) + + try? container.encodeIfPresent(feedback, forKey: .feedback) + + try? container.encodeIfPresent(compareProducts, forKey: .compareProducts) + + try? container.encodeIfPresent(rewardPoints, forKey: .rewardPoints) + } + } + + /* + Model: CommunicationOptinDialogFeature + Used By: Configuration + */ + class CommunicationOptinDialogFeature: Codable { + public var visibility: Bool? + + public enum CodingKeys: String, CodingKey { + case visibility + } + + public init(visibility: Bool?) { + self.visibility = visibility + } + + public func duplicate() -> CommunicationOptinDialogFeature { + let dict = self.dictionary! + let copy = CommunicationOptinDialogFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + visibility = try container.decode(Bool.self, forKey: .visibility) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(visibility, forKey: .visibility) + } + } + + /* + Model: DeploymentStoreSelectionFeature + Used By: Configuration + */ + class DeploymentStoreSelectionFeature: Codable { + public var enabled: Bool? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case enabled + + case type + } + + public init(enabled: Bool?, type: String?) { + self.enabled = enabled + + self.type = type + } + + public func duplicate() -> DeploymentStoreSelectionFeature { + let dict = self.dictionary! + let copy = DeploymentStoreSelectionFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: ListingPriceFeature + Used By: Configuration + */ + class ListingPriceFeature: Codable { + public var value: String? + + public enum CodingKeys: String, CodingKey { + case value + } + + public init(value: String?) { + self.value = value + } + + public func duplicate() -> ListingPriceFeature { + let dict = self.dictionary! + let copy = ListingPriceFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: CurrencyFeature + Used By: Configuration + */ + class CurrencyFeature: Codable { + public var value: [String]? + + public var type: String? + + public var defaultCurrency: String? + + public enum CodingKeys: String, CodingKey { + case value + + case type + + case defaultCurrency = "default_currency" + } + + public init(defaultCurrency: String?, type: String?, value: [String]?) { + self.value = value + + self.type = type + + self.defaultCurrency = defaultCurrency + } + + public func duplicate() -> CurrencyFeature { + let dict = self.dictionary! + let copy = CurrencyFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + value = try container.decode([String].self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + defaultCurrency = try container.decode(String.self, forKey: .defaultCurrency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(defaultCurrency, forKey: .defaultCurrency) + } + } + + /* + Model: RevenueEngineFeature + Used By: Configuration + */ + class RevenueEngineFeature: Codable { + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case enabled + } + + public init(enabled: Bool?) { + self.enabled = enabled + } + + public func duplicate() -> RevenueEngineFeature { + let dict = self.dictionary! + let copy = RevenueEngineFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: FeedbackFeature + Used By: Configuration + */ + class FeedbackFeature: Codable { + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case enabled + } + + public init(enabled: Bool?) { + self.enabled = enabled + } + + public func duplicate() -> FeedbackFeature { + let dict = self.dictionary! + let copy = FeedbackFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: CompareProductsFeature + Used By: Configuration + */ + class CompareProductsFeature: Codable { + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case enabled + } + + public init(enabled: Bool?) { + self.enabled = enabled + } + + public func duplicate() -> CompareProductsFeature { + let dict = self.dictionary! + let copy = CompareProductsFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: CartFeature + Used By: Configuration + */ + class CartFeature: Codable { + public var gstInput: Bool? + + public var staffSelection: Bool? + + public var placingForCustomer: Bool? + + public var googleMap: Bool? + + public var revenueEngineCoupon: Bool? + + public enum CodingKeys: String, CodingKey { + case gstInput = "gst_input" + + case staffSelection = "staff_selection" + + case placingForCustomer = "placing_for_customer" + + case googleMap = "google_map" + + case revenueEngineCoupon = "revenue_engine_coupon" + } + + public init(googleMap: Bool?, gstInput: Bool?, placingForCustomer: Bool?, revenueEngineCoupon: Bool?, staffSelection: Bool?) { + self.gstInput = gstInput + + self.staffSelection = staffSelection + + self.placingForCustomer = placingForCustomer + + self.googleMap = googleMap + + self.revenueEngineCoupon = revenueEngineCoupon + } + + public func duplicate() -> CartFeature { + let dict = self.dictionary! + let copy = CartFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + gstInput = try container.decode(Bool.self, forKey: .gstInput) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + staffSelection = try container.decode(Bool.self, forKey: .staffSelection) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + placingForCustomer = try container.decode(Bool.self, forKey: .placingForCustomer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + googleMap = try container.decode(Bool.self, forKey: .googleMap) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + revenueEngineCoupon = try container.decode(Bool.self, forKey: .revenueEngineCoupon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(gstInput, forKey: .gstInput) + + try? container.encodeIfPresent(staffSelection, forKey: .staffSelection) + + try? container.encodeIfPresent(placingForCustomer, forKey: .placingForCustomer) + + try? container.encodeIfPresent(googleMap, forKey: .googleMap) + + try? container.encodeIfPresent(revenueEngineCoupon, forKey: .revenueEngineCoupon) + } + } + + /* + Model: QrFeature + Used By: Configuration + */ + class QrFeature: Codable { + public var application: Bool? + + public var products: Bool? + + public var collections: Bool? + + public enum CodingKeys: String, CodingKey { + case application + + case products + + case collections + } + + public init(application: Bool?, collections: Bool?, products: Bool?) { + self.application = application + + self.products = products + + self.collections = collections + } + + public func duplicate() -> QrFeature { + let dict = self.dictionary! + let copy = QrFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(Bool.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + products = try container.decode(Bool.self, forKey: .products) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + collections = try container.decode(Bool.self, forKey: .collections) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(products, forKey: .products) + + try? container.encodeIfPresent(collections, forKey: .collections) + } + } + + /* + Model: PcrFeature + Used By: Configuration + */ + class PcrFeature: Codable { + public var staffSelection: Bool? + + public enum CodingKeys: String, CodingKey { + case staffSelection = "staff_selection" + } + + public init(staffSelection: Bool?) { + self.staffSelection = staffSelection + } + + public func duplicate() -> PcrFeature { + let dict = self.dictionary! + let copy = PcrFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + staffSelection = try container.decode(Bool.self, forKey: .staffSelection) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(staffSelection, forKey: .staffSelection) + } + } + + /* + Model: OrderFeature + Used By: Configuration + */ + class OrderFeature: Codable { + public var buyAgain: Bool? + + public enum CodingKeys: String, CodingKey { + case buyAgain = "buy_again" + } + + public init(buyAgain: Bool?) { + self.buyAgain = buyAgain + } + + public func duplicate() -> OrderFeature { + let dict = self.dictionary! + let copy = OrderFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + buyAgain = try container.decode(Bool.self, forKey: .buyAgain) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(buyAgain, forKey: .buyAgain) + } + } + + /* + Model: AppFeatureRequest + Used By: Configuration + */ + class AppFeatureRequest: Codable { + public var feature: AppFeature? + + public enum CodingKeys: String, CodingKey { + case feature + } + + public init(feature: AppFeature?) { + self.feature = feature + } + + public func duplicate() -> AppFeatureRequest { + let dict = self.dictionary! + let copy = AppFeatureRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + feature = try container.decode(AppFeature.self, forKey: .feature) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(feature, forKey: .feature) + } + } + + /* + Model: AppFeatureResponse + Used By: Configuration + */ + class AppFeatureResponse: Codable { + public var feature: AppFeature? + + public enum CodingKeys: String, CodingKey { + case feature + } + + public init(feature: AppFeature?) { + self.feature = feature + } + + public func duplicate() -> AppFeatureResponse { + let dict = self.dictionary! + let copy = AppFeatureResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + feature = try container.decode(AppFeature.self, forKey: .feature) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(feature, forKey: .feature) + } + } + + /* + Model: UnhandledError + Used By: Configuration + */ + class UnhandledError: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> UnhandledError { + let dict = self.dictionary! + let copy = UnhandledError(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: InvalidPayloadRequest + Used By: Configuration + */ + class InvalidPayloadRequest: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> InvalidPayloadRequest { + let dict = self.dictionary! + let copy = InvalidPayloadRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: SuccessMessageResponse + Used By: Configuration + */ + class SuccessMessageResponse: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> SuccessMessageResponse { + let dict = self.dictionary! + let copy = SuccessMessageResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: InventoryBrandRule + Used By: Configuration + */ + class InventoryBrandRule: Codable { + public var criteria: String? + + public var brands: [Int]? + + public enum CodingKeys: String, CodingKey { + case criteria + + case brands + } + + public init(brands: [Int]?, criteria: String?) { + self.criteria = criteria + + self.brands = brands + } + + public func duplicate() -> InventoryBrandRule { + let dict = self.dictionary! + let copy = InventoryBrandRule(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + criteria = try container.decode(String.self, forKey: .criteria) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brands = try container.decode([Int].self, forKey: .brands) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(criteria, forKey: .criteria) + + try? container.encodeIfPresent(brands, forKey: .brands) + } + } + + /* + Model: StoreCriteriaRule + Used By: Configuration + */ + class StoreCriteriaRule: Codable { + public var companies: [Int]? + + public var brands: [Int]? + + public enum CodingKeys: String, CodingKey { + case companies + + case brands + } + + public init(brands: [Int]?, companies: [Int]?) { + self.companies = companies + + self.brands = brands + } + + public func duplicate() -> StoreCriteriaRule { + let dict = self.dictionary! + let copy = StoreCriteriaRule(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + companies = try container.decode([Int].self, forKey: .companies) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brands = try container.decode([Int].self, forKey: .brands) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(companies, forKey: .companies) + + try? container.encodeIfPresent(brands, forKey: .brands) + } + } + + /* + Model: InventoryStoreRule + Used By: Configuration + */ + class InventoryStoreRule: Codable { + public var criteria: String? + + public var rules: [StoreCriteriaRule]? + + public var stores: [Int]? + + public enum CodingKeys: String, CodingKey { + case criteria + + case rules + + case stores + } + + public init(criteria: String?, rules: [StoreCriteriaRule]?, stores: [Int]?) { + self.criteria = criteria + + self.rules = rules + + self.stores = stores + } + + public func duplicate() -> InventoryStoreRule { + let dict = self.dictionary! + let copy = InventoryStoreRule(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + criteria = try container.decode(String.self, forKey: .criteria) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rules = try container.decode([StoreCriteriaRule].self, forKey: .rules) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stores = try container.decode([Int].self, forKey: .stores) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(criteria, forKey: .criteria) + + try? container.encodeIfPresent(rules, forKey: .rules) + + try? container.encodeIfPresent(stores, forKey: .stores) + } + } + + /* + Model: InventoryPaymentConfig + Used By: Configuration + */ + class InventoryPaymentConfig: Codable { + public var modeOfPayment: String? + + public var source: String? + + public enum CodingKeys: String, CodingKey { + case modeOfPayment = "mode_of_payment" + + case source + } + + public init(modeOfPayment: String?, source: String?) { + self.modeOfPayment = modeOfPayment + + self.source = source + } + + public func duplicate() -> InventoryPaymentConfig { + let dict = self.dictionary! + let copy = InventoryPaymentConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + modeOfPayment = try container.decode(String.self, forKey: .modeOfPayment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + source = try container.decode(String.self, forKey: .source) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(modeOfPayment, forKey: .modeOfPayment) + + try? container.encodeIfPresent(source, forKey: .source) + } + } + + /* + Model: StorePriorityRule + Used By: Configuration + */ + class StorePriorityRule: Codable { + public var enabled: Bool? + + public var storetypeOrder: [String]? + + public enum CodingKeys: String, CodingKey { + case enabled + + case storetypeOrder = "storetype_order" + } + + public init(enabled: Bool?, storetypeOrder: [String]?) { + self.enabled = enabled + + self.storetypeOrder = storetypeOrder + } + + public func duplicate() -> StorePriorityRule { + let dict = self.dictionary! + let copy = StorePriorityRule(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storetypeOrder = try container.decode([String].self, forKey: .storetypeOrder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(storetypeOrder, forKey: .storetypeOrder) + } + } + + /* + Model: ArticleAssignmentRule + Used By: Configuration + */ + class ArticleAssignmentRule: Codable { + public var storePriority: StorePriorityRule? + + public enum CodingKeys: String, CodingKey { + case storePriority = "store_priority" + } + + public init(storePriority: StorePriorityRule?) { + self.storePriority = storePriority + } + + public func duplicate() -> ArticleAssignmentRule { + let dict = self.dictionary! + let copy = ArticleAssignmentRule(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + storePriority = try container.decode(StorePriorityRule.self, forKey: .storePriority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(storePriority, forKey: .storePriority) + } + } + + /* + Model: InventoryArticleAssignment + Used By: Configuration + */ + class InventoryArticleAssignment: Codable { + public var postOrderReassignment: Bool? + + public var rules: ArticleAssignmentRule? + + public enum CodingKeys: String, CodingKey { + case postOrderReassignment = "post_order_reassignment" + + case rules + } + + public init(postOrderReassignment: Bool?, rules: ArticleAssignmentRule?) { + self.postOrderReassignment = postOrderReassignment + + self.rules = rules + } + + public func duplicate() -> InventoryArticleAssignment { + let dict = self.dictionary! + let copy = InventoryArticleAssignment(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + postOrderReassignment = try container.decode(Bool.self, forKey: .postOrderReassignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rules = try container.decode(ArticleAssignmentRule.self, forKey: .rules) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(postOrderReassignment, forKey: .postOrderReassignment) + + try? container.encodeIfPresent(rules, forKey: .rules) + } + } + + /* + Model: CompanyAboutAddress + Used By: Configuration + */ + class CompanyAboutAddress: Codable { + public var pincode: Int? + + public var address1: String? + + public var address2: String? + + public var city: String? + + public var state: String? + + public var country: String? + + public var addressType: String? + + public enum CodingKeys: String, CodingKey { + case pincode + + case address1 + + case address2 + + case city + + case state + + case country + + case addressType = "address_type" + } + + public init(address1: String?, address2: String?, addressType: String?, city: String?, country: String?, pincode: Int?, state: String?) { + self.pincode = pincode + + self.address1 = address1 + + self.address2 = address2 + + self.city = city + + self.state = state + + self.country = country + + self.addressType = addressType + } + + public func duplicate() -> CompanyAboutAddress { + let dict = self.dictionary! + let copy = CompanyAboutAddress(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + pincode = try container.decode(Int.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address1 = try container.decode(String.self, forKey: .address1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address2 = try container.decode(String.self, forKey: .address2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressType = try container.decode(String.self, forKey: .addressType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(address1, forKey: .address1) + + try? container.encodeIfPresent(address2, forKey: .address2) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(addressType, forKey: .addressType) + } + } + + /* + Model: UserEmail + Used By: Configuration + */ + class UserEmail: Codable { + public var active: Bool? + + public var primary: Bool? + + public var verified: Bool? + + public var email: String? + + public enum CodingKeys: String, CodingKey { + case active + + case primary + + case verified + + case email + } + + public init(active: Bool?, email: String?, primary: Bool?, verified: Bool?) { + self.active = active + + self.primary = primary + + self.verified = verified + + self.email = email + } + + public func duplicate() -> UserEmail { + let dict = self.dictionary! + let copy = UserEmail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + primary = try container.decode(Bool.self, forKey: .primary) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verified = try container.decode(Bool.self, forKey: .verified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(primary, forKey: .primary) + + try? container.encodeIfPresent(verified, forKey: .verified) + + try? container.encodeIfPresent(email, forKey: .email) + } + } + + /* + Model: UserPhoneNumber + Used By: Configuration + */ + class UserPhoneNumber: Codable { + public var active: Bool? + + public var primary: Bool? + + public var verified: Bool? + + public var countryCode: Int? + + public var phone: String? + + public enum CodingKeys: String, CodingKey { + case active + + case primary + + case verified + + case countryCode = "country_code" + + case phone + } + + public init(active: Bool?, countryCode: Int?, phone: String?, primary: Bool?, verified: Bool?) { + self.active = active + + self.primary = primary + + self.verified = verified + + self.countryCode = countryCode + + self.phone = phone + } + + public func duplicate() -> UserPhoneNumber { + let dict = self.dictionary! + let copy = UserPhoneNumber(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + primary = try container.decode(Bool.self, forKey: .primary) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verified = try container.decode(Bool.self, forKey: .verified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(Int.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(primary, forKey: .primary) + + try? container.encodeIfPresent(verified, forKey: .verified) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(phone, forKey: .phone) + } + } + + /* + Model: ApplicationInformation + Used By: Configuration + */ + class ApplicationInformation: Codable { + public var address: InformationAddress? + + public var support: InformationSupport? + + public var socialLinks: SocialLinks? + + public var links: Links? + + public var copyrightText: String? + + public var id: String? + + public var businessHighlights: BusinessHighlights? + + public var application: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case address + + case support + + case socialLinks = "social_links" + + case links + + case copyrightText = "copyright_text" + + case id = "_id" + + case businessHighlights = "business_highlights" + + case application + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + } + + public init(address: InformationAddress?, application: String?, businessHighlights: BusinessHighlights?, copyrightText: String?, createdAt: String?, links: Links?, socialLinks: SocialLinks?, support: InformationSupport?, updatedAt: String?, id: String?, v: Int?) { + self.address = address + + self.support = support + + self.socialLinks = socialLinks + + self.links = links + + self.copyrightText = copyrightText + + self.id = id + + self.businessHighlights = businessHighlights + + self.application = application + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + } + + public func duplicate() -> ApplicationInformation { + let dict = self.dictionary! + let copy = ApplicationInformation(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + address = try container.decode(InformationAddress.self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + support = try container.decode(InformationSupport.self, forKey: .support) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + socialLinks = try container.decode(SocialLinks.self, forKey: .socialLinks) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + links = try container.decode(Links.self, forKey: .links) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + copyrightText = try container.decode(String.self, forKey: .copyrightText) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + businessHighlights = try container.decode(BusinessHighlights.self, forKey: .businessHighlights) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(support, forKey: .support) + + try? container.encodeIfPresent(socialLinks, forKey: .socialLinks) + + try? container.encodeIfPresent(links, forKey: .links) + + try? container.encodeIfPresent(copyrightText, forKey: .copyrightText) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(businessHighlights, forKey: .businessHighlights) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: InformationAddress + Used By: Configuration + */ + class InformationAddress: Codable { + public var loc: String? + + public var addressLine: [String]? + + public var phone: InformationPhone? + + public var city: String? + + public var country: String? + + public var pincode: Int? + + public enum CodingKeys: String, CodingKey { + case loc + + case addressLine = "address_line" + + case phone + + case city + + case country + + case pincode + } + + public init(addressLine: [String]?, city: String?, country: String?, loc: String?, phone: InformationPhone?, pincode: Int?) { + self.loc = loc + + self.addressLine = addressLine + + self.phone = phone + + self.city = city + + self.country = country + + self.pincode = pincode + } + + public func duplicate() -> InformationAddress { + let dict = self.dictionary! + let copy = InformationAddress(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + loc = try container.decode(String.self, forKey: .loc) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressLine = try container.decode([String].self, forKey: .addressLine) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(InformationPhone.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(Int.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(loc, forKey: .loc) + + try? container.encodeIfPresent(addressLine, forKey: .addressLine) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + } + } + + /* + Model: InformationPhone + Used By: Configuration + */ + class InformationPhone: Codable { + public var code: String? + + public var number: String? + + public enum CodingKeys: String, CodingKey { + case code + + case number + } + + public init(code: String?, number: String?) { + self.code = code + + self.number = number + } + + public func duplicate() -> InformationPhone { + let dict = self.dictionary! + let copy = InformationPhone(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + number = try container.decode(String.self, forKey: .number) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(number, forKey: .number) + } + } + + /* + Model: InformationSupport + Used By: Configuration + */ + class InformationSupport: Codable { + public var phone: [String]? + + public var email: [String]? + + public var timing: String? + + public enum CodingKeys: String, CodingKey { + case phone + + case email + + case timing + } + + public init(email: [String]?, phone: [String]?, timing: String?) { + self.phone = phone + + self.email = email + + self.timing = timing + } + + public func duplicate() -> InformationSupport { + let dict = self.dictionary! + let copy = InformationSupport(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + phone = try container.decode([String].self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode([String].self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + timing = try container.decode(String.self, forKey: .timing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(timing, forKey: .timing) + } + } + + /* + Model: SocialLinks + Used By: Configuration + */ + class SocialLinks: Codable { + public var facebook: FacebookLink? + + public var instagram: InstagramLink? + + public var twitter: TwitterLink? + + public var pinterest: PinterestLink? + + public var googlePlus: GooglePlusLink? + + public var youtube: YoutubeLink? + + public var linkedIn: LinkedInLink? + + public var vimeo: VimeoLink? + + public var blogLink: BlogLink? + + public enum CodingKeys: String, CodingKey { + case facebook + + case instagram + + case twitter + + case pinterest + + case googlePlus = "google_plus" + + case youtube + + case linkedIn = "linked_in" + + case vimeo + + case blogLink = "blog_link" + } + + public init(blogLink: BlogLink?, facebook: FacebookLink?, googlePlus: GooglePlusLink?, instagram: InstagramLink?, linkedIn: LinkedInLink?, pinterest: PinterestLink?, twitter: TwitterLink?, vimeo: VimeoLink?, youtube: YoutubeLink?) { + self.facebook = facebook + + self.instagram = instagram + + self.twitter = twitter + + self.pinterest = pinterest + + self.googlePlus = googlePlus + + self.youtube = youtube + + self.linkedIn = linkedIn + + self.vimeo = vimeo + + self.blogLink = blogLink + } + + public func duplicate() -> SocialLinks { + let dict = self.dictionary! + let copy = SocialLinks(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + facebook = try container.decode(FacebookLink.self, forKey: .facebook) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + instagram = try container.decode(InstagramLink.self, forKey: .instagram) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + twitter = try container.decode(TwitterLink.self, forKey: .twitter) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pinterest = try container.decode(PinterestLink.self, forKey: .pinterest) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + googlePlus = try container.decode(GooglePlusLink.self, forKey: .googlePlus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + youtube = try container.decode(YoutubeLink.self, forKey: .youtube) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + linkedIn = try container.decode(LinkedInLink.self, forKey: .linkedIn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + vimeo = try container.decode(VimeoLink.self, forKey: .vimeo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + blogLink = try container.decode(BlogLink.self, forKey: .blogLink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(facebook, forKey: .facebook) + + try? container.encodeIfPresent(instagram, forKey: .instagram) + + try? container.encodeIfPresent(twitter, forKey: .twitter) + + try? container.encodeIfPresent(pinterest, forKey: .pinterest) + + try? container.encodeIfPresent(googlePlus, forKey: .googlePlus) + + try? container.encodeIfPresent(youtube, forKey: .youtube) + + try? container.encodeIfPresent(linkedIn, forKey: .linkedIn) + + try? container.encodeIfPresent(vimeo, forKey: .vimeo) + + try? container.encodeIfPresent(blogLink, forKey: .blogLink) + } + } + + /* + Model: FacebookLink + Used By: Configuration + */ + class FacebookLink: Codable { + public var title: String? + + public var icon: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case icon + + case link + } + + public init(icon: String?, link: String?, title: String?) { + self.title = title + + self.icon = icon + + self.link = link + } + + public func duplicate() -> FacebookLink { + let dict = self.dictionary! + let copy = FacebookLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: InstagramLink + Used By: Configuration + */ + class InstagramLink: Codable { + public var title: String? + + public var icon: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case icon + + case link + } + + public init(icon: String?, link: String?, title: String?) { + self.title = title + + self.icon = icon + + self.link = link + } + + public func duplicate() -> InstagramLink { + let dict = self.dictionary! + let copy = InstagramLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: TwitterLink + Used By: Configuration + */ + class TwitterLink: Codable { + public var title: String? + + public var icon: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case icon + + case link + } + + public init(icon: String?, link: String?, title: String?) { + self.title = title + + self.icon = icon + + self.link = link + } + + public func duplicate() -> TwitterLink { + let dict = self.dictionary! + let copy = TwitterLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: PinterestLink + Used By: Configuration + */ + class PinterestLink: Codable { + public var title: String? + + public var icon: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case icon + + case link + } + + public init(icon: String?, link: String?, title: String?) { + self.title = title + + self.icon = icon + + self.link = link + } + + public func duplicate() -> PinterestLink { + let dict = self.dictionary! + let copy = PinterestLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: GooglePlusLink + Used By: Configuration + */ + class GooglePlusLink: Codable { + public var title: String? + + public var icon: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case icon + + case link + } + + public init(icon: String?, link: String?, title: String?) { + self.title = title + + self.icon = icon + + self.link = link + } + + public func duplicate() -> GooglePlusLink { + let dict = self.dictionary! + let copy = GooglePlusLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: YoutubeLink + Used By: Configuration + */ + class YoutubeLink: Codable { + public var title: String? + + public var icon: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case icon + + case link + } + + public init(icon: String?, link: String?, title: String?) { + self.title = title + + self.icon = icon + + self.link = link + } + + public func duplicate() -> YoutubeLink { + let dict = self.dictionary! + let copy = YoutubeLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: LinkedInLink + Used By: Configuration + */ + class LinkedInLink: Codable { + public var title: String? + + public var icon: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case icon + + case link + } + + public init(icon: String?, link: String?, title: String?) { + self.title = title + + self.icon = icon + + self.link = link + } + + public func duplicate() -> LinkedInLink { + let dict = self.dictionary! + let copy = LinkedInLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: VimeoLink + Used By: Configuration + */ + class VimeoLink: Codable { + public var title: String? + + public var icon: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case icon + + case link + } + + public init(icon: String?, link: String?, title: String?) { + self.title = title + + self.icon = icon + + self.link = link + } + + public func duplicate() -> VimeoLink { + let dict = self.dictionary! + let copy = VimeoLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: BlogLink + Used By: Configuration + */ + class BlogLink: Codable { + public var title: String? + + public var icon: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case icon + + case link + } + + public init(icon: String?, link: String?, title: String?) { + self.title = title + + self.icon = icon + + self.link = link + } + + public func duplicate() -> BlogLink { + let dict = self.dictionary! + let copy = BlogLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: Links + Used By: Configuration + */ + class Links: Codable { + public var title: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case link + } + + public init(link: String?, title: String?) { + self.title = title + + self.link = link + } + + public func duplicate() -> Links { + let dict = self.dictionary! + let copy = Links(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: BusinessHighlights + Used By: Configuration + */ + class BusinessHighlights: Codable { + public var id: String? + + public var title: String? + + public var icon: String? + + public var subTitle: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case title + + case icon + + case subTitle = "sub_title" + } + + public init(icon: String?, subTitle: String?, title: String?, id: String?) { + self.id = id + + self.title = title + + self.icon = icon + + self.subTitle = subTitle + } + + public func duplicate() -> BusinessHighlights { + let dict = self.dictionary! + let copy = BusinessHighlights(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subTitle = try container.decode(String.self, forKey: .subTitle) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(subTitle, forKey: .subTitle) + } + } + + /* + Model: ApplicationDetail + Used By: Configuration + */ + class ApplicationDetail: Codable { + public var name: String + + public var description: String + + public var logo: SecureUrl + + public var mobileLogo: SecureUrl + + public var favicon: SecureUrl + + public var banner: SecureUrl + + public var domain: Domain? + + public var domains: [Domain]? + + public var id: String? + + public enum CodingKeys: String, CodingKey { + case name + + case description + + case logo + + case mobileLogo = "mobile_logo" + + case favicon + + case banner + + case domain + + case domains + + case id = "_id" + } + + public init(banner: SecureUrl, description: String, domain: Domain?, domains: [Domain]?, favicon: SecureUrl, logo: SecureUrl, mobileLogo: SecureUrl, name: String, id: String?) { + self.name = name + + self.description = description + + self.logo = logo + + self.mobileLogo = mobileLogo + + self.favicon = favicon + + self.banner = banner + + self.domain = domain + + self.domains = domains + + self.id = id + } + + public func duplicate() -> ApplicationDetail { + let dict = self.dictionary! + let copy = ApplicationDetail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + name = try container.decode(String.self, forKey: .name) + + description = try container.decode(String.self, forKey: .description) + + logo = try container.decode(SecureUrl.self, forKey: .logo) + + mobileLogo = try container.decode(SecureUrl.self, forKey: .mobileLogo) + + favicon = try container.decode(SecureUrl.self, forKey: .favicon) + + banner = try container.decode(SecureUrl.self, forKey: .banner) + + do { + domain = try container.decode(Domain.self, forKey: .domain) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + domains = try container.decode([Domain].self, forKey: .domains) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(mobileLogo, forKey: .mobileLogo) + + try? container.encodeIfPresent(favicon, forKey: .favicon) + + try? container.encodeIfPresent(banner, forKey: .banner) + + try? container.encodeIfPresent(domain, forKey: .domain) + + try? container.encodeIfPresent(domains, forKey: .domains) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: CurrenciesResponse + Used By: Configuration + */ + class CurrenciesResponse: Codable { + public var items: [Currency]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [Currency]?) { + self.items = items + } + + public func duplicate() -> CurrenciesResponse { + let dict = self.dictionary! + let copy = CurrenciesResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Currency].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: DefaultCurrency + Used By: Configuration + */ + class DefaultCurrency: Codable { + public var ref: String? + + public var code: String? + + public enum CodingKeys: String, CodingKey { + case ref + + case code + } + + public init(code: String?, ref: String?) { + self.ref = ref + + self.code = code + } + + public func duplicate() -> DefaultCurrency { + let dict = self.dictionary! + let copy = DefaultCurrency(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + ref = try container.decode(String.self, forKey: .ref) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(ref, forKey: .ref) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: AppCurrencyResponse + Used By: Configuration + */ + class AppCurrencyResponse: Codable { + public var application: String? + + public var defaultCurrency: DefaultCurrency? + + public var supportedCurrency: [Currency]? + + public enum CodingKeys: String, CodingKey { + case application + + case defaultCurrency = "default_currency" + + case supportedCurrency = "supported_currency" + } + + public init(application: String?, defaultCurrency: DefaultCurrency?, supportedCurrency: [Currency]?) { + self.application = application + + self.defaultCurrency = defaultCurrency + + self.supportedCurrency = supportedCurrency + } + + public func duplicate() -> AppCurrencyResponse { + let dict = self.dictionary! + let copy = AppCurrencyResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + defaultCurrency = try container.decode(DefaultCurrency.self, forKey: .defaultCurrency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + supportedCurrency = try container.decode([Currency].self, forKey: .supportedCurrency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(defaultCurrency, forKey: .defaultCurrency) + + try? container.encodeIfPresent(supportedCurrency, forKey: .supportedCurrency) + } + } + + /* + Model: StoreLatLong + Used By: Configuration + */ + class StoreLatLong: Codable { + public var type: String? + + public var coordinates: [Double]? + + public enum CodingKeys: String, CodingKey { + case type + + case coordinates + } + + public init(coordinates: [Double]?, type: String?) { + self.type = type + + self.coordinates = coordinates + } + + public func duplicate() -> StoreLatLong { + let dict = self.dictionary! + let copy = StoreLatLong(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + coordinates = try container.decode([Double].self, forKey: .coordinates) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(coordinates, forKey: .coordinates) + } + } + + /* + Model: OptedStoreAddress + Used By: Configuration + */ + class OptedStoreAddress: Codable { + public var state: String? + + public var address1: String? + + public var latLong: StoreLatLong? + + public var address2: String? + + public var pincode: Int? + + public var country: String? + + public var city: String? + + public enum CodingKeys: String, CodingKey { + case state + + case address1 + + case latLong = "lat_long" + + case address2 + + case pincode + + case country + + case city + } + + public init(address1: String?, address2: String?, city: String?, country: String?, latLong: StoreLatLong?, pincode: Int?, state: String?) { + self.state = state + + self.address1 = address1 + + self.latLong = latLong + + self.address2 = address2 + + self.pincode = pincode + + self.country = country + + self.city = city + } + + public func duplicate() -> OptedStoreAddress { + let dict = self.dictionary! + let copy = OptedStoreAddress(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address1 = try container.decode(String.self, forKey: .address1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + latLong = try container.decode(StoreLatLong.self, forKey: .latLong) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address2 = try container.decode(String.self, forKey: .address2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(Int.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(address1, forKey: .address1) + + try? container.encodeIfPresent(latLong, forKey: .latLong) + + try? container.encodeIfPresent(address2, forKey: .address2) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(city, forKey: .city) + } + } + + /* + Model: OrderingStore + Used By: Configuration + */ + class OrderingStore: Codable { + public var address: OptedStoreAddress? + + public var id: String? + + public var uid: Int? + + public var name: String? + + public var displayName: String? + + public var storeType: String? + + public var storeCode: String? + + public var pincode: Int? + + public var code: String? + + public enum CodingKeys: String, CodingKey { + case address + + case id = "_id" + + case uid + + case name + + case displayName = "display_name" + + case storeType = "store_type" + + case storeCode = "store_code" + + case pincode + + case code + } + + public init(address: OptedStoreAddress?, code: String?, displayName: String?, name: String?, pincode: Int?, storeCode: String?, storeType: String?, uid: Int?, id: String?) { + self.address = address + + self.id = id + + self.uid = uid + + self.name = name + + self.displayName = displayName + + self.storeType = storeType + + self.storeCode = storeCode + + self.pincode = pincode + + self.code = code + } + + public func duplicate() -> OrderingStore { + let dict = self.dictionary! + let copy = OrderingStore(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + address = try container.decode(OptedStoreAddress.self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeType = try container.decode(String.self, forKey: .storeType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeCode = try container.decode(String.self, forKey: .storeCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(Int.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(storeType, forKey: .storeType) + + try? container.encodeIfPresent(storeCode, forKey: .storeCode) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: OrderingStores + Used By: Configuration + */ + class OrderingStores: Codable { + public var page: Page? + + public var items: [OrderingStore]? + + public var deployedStores: [Int]? + + public var allStores: Bool? + + public var enabled: Bool? + + public var type: String? + + public var id: String? + + public var app: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case page + + case items + + case deployedStores = "deployed_stores" + + case allStores = "all_stores" + + case enabled + + case type + + case id = "_id" + + case app + + case v = "__v" + } + + public init(allStores: Bool?, app: String?, deployedStores: [Int]?, enabled: Bool?, items: [OrderingStore]?, page: Page?, type: String?, id: String?, v: Int?) { + self.page = page + + self.items = items + + self.deployedStores = deployedStores + + self.allStores = allStores + + self.enabled = enabled + + self.type = type + + self.id = id + + self.app = app + + self.v = v + } + + public func duplicate() -> OrderingStores { + let dict = self.dictionary! + let copy = OrderingStores(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([OrderingStore].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deployedStores = try container.decode([Int].self, forKey: .deployedStores) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allStores = try container.decode(Bool.self, forKey: .allStores) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + app = try container.decode(String.self, forKey: .app) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(deployedStores, forKey: .deployedStores) + + try? container.encodeIfPresent(allStores, forKey: .allStores) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(app, forKey: .app) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: OrderingStoresResponse + Used By: Configuration + */ + class OrderingStoresResponse: Codable { + public var page: Page? + + public var items: [OrderingStore]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [OrderingStore]?, page: Page?) { + self.page = page + + self.items = items + } + + public func duplicate() -> OrderingStoresResponse { + let dict = self.dictionary! + let copy = OrderingStoresResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([OrderingStore].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } +} diff --git a/Sources/code/application/models/ContentAppModelClass.swift b/Sources/code/application/models/ContentAppModelClass.swift new file mode 100644 index 0000000000..0d134d784e --- /dev/null +++ b/Sources/code/application/models/ContentAppModelClass.swift @@ -0,0 +1,8830 @@ +import Foundation + +import Foundation +public extension ApplicationClient { + /* + Model: ApplicationLegal + Used By: Content + */ + class ApplicationLegal: Codable { + public var application: String? + + public var tnc: String? + + public var policy: String? + + public var shipping: String? + + public var faq: [ApplicationLegalFAQ]? + + public var id: String? + + public var updatedAt: String? + + public var createdAt: String? + + public enum CodingKeys: String, CodingKey { + case application + + case tnc + + case policy + + case shipping + + case faq + + case id = "_id" + + case updatedAt = "updated_at" + + case createdAt = "created_at" + } + + public init(application: String?, createdAt: String?, faq: [ApplicationLegalFAQ]?, policy: String?, shipping: String?, tnc: String?, updatedAt: String?, id: String?) { + self.application = application + + self.tnc = tnc + + self.policy = policy + + self.shipping = shipping + + self.faq = faq + + self.id = id + + self.updatedAt = updatedAt + + self.createdAt = createdAt + } + + public func duplicate() -> ApplicationLegal { + let dict = self.dictionary! + let copy = ApplicationLegal(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tnc = try container.decode(String.self, forKey: .tnc) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + policy = try container.decode(String.self, forKey: .policy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shipping = try container.decode(String.self, forKey: .shipping) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + faq = try container.decode([ApplicationLegalFAQ].self, forKey: .faq) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(tnc, forKey: .tnc) + + try? container.encodeIfPresent(policy, forKey: .policy) + + try? container.encodeIfPresent(shipping, forKey: .shipping) + + try? container.encodeIfPresent(faq, forKey: .faq) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + } + } + + /* + Model: ApplicationLegalFAQ + Used By: Content + */ + class ApplicationLegalFAQ: Codable { + public var question: String? + + public var answer: String? + + public enum CodingKeys: String, CodingKey { + case question + + case answer + } + + public init(answer: String?, question: String?) { + self.question = question + + self.answer = answer + } + + public func duplicate() -> ApplicationLegalFAQ { + let dict = self.dictionary! + let copy = ApplicationLegalFAQ(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + question = try container.decode(String.self, forKey: .question) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + answer = try container.decode(String.self, forKey: .answer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(question, forKey: .question) + + try? container.encodeIfPresent(answer, forKey: .answer) + } + } + + /* + Model: PathMappingSchema + Used By: Content + */ + class PathMappingSchema: Codable { + public var application: String? + + public var redirections: [RedirectionSchema]? + + public var id: String? + + public var updatedAt: String? + + public var createdAt: String? + + public enum CodingKeys: String, CodingKey { + case application + + case redirections + + case id = "_id" + + case updatedAt = "updated_at" + + case createdAt = "created_at" + } + + public init(application: String?, createdAt: String?, redirections: [RedirectionSchema]?, updatedAt: String?, id: String?) { + self.application = application + + self.redirections = redirections + + self.id = id + + self.updatedAt = updatedAt + + self.createdAt = createdAt + } + + public func duplicate() -> PathMappingSchema { + let dict = self.dictionary! + let copy = PathMappingSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + redirections = try container.decode([RedirectionSchema].self, forKey: .redirections) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(redirections, forKey: .redirections) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + } + } + + /* + Model: RedirectionSchema + Used By: Content + */ + class RedirectionSchema: Codable { + public var redirectFrom: String? + + public var redirectTo: String? + + public enum CodingKeys: String, CodingKey { + case redirectFrom = "redirect_from" + + case redirectTo = "redirect_to" + } + + public init(redirectFrom: String?, redirectTo: String?) { + self.redirectFrom = redirectFrom + + self.redirectTo = redirectTo + } + + public func duplicate() -> RedirectionSchema { + let dict = self.dictionary! + let copy = RedirectionSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + redirectFrom = try container.decode(String.self, forKey: .redirectFrom) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + redirectTo = try container.decode(String.self, forKey: .redirectTo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(redirectFrom, forKey: .redirectFrom) + + try? container.encodeIfPresent(redirectTo, forKey: .redirectTo) + } + } + + /* + Model: SeoComponent + Used By: Content + */ + class SeoComponent: Codable { + public var seo: SeoSchema? + + public enum CodingKeys: String, CodingKey { + case seo + } + + public init(seo: SeoSchema?) { + self.seo = seo + } + + public func duplicate() -> SeoComponent { + let dict = self.dictionary! + let copy = SeoComponent(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + seo = try container.decode(SeoSchema.self, forKey: .seo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(seo, forKey: .seo) + } + } + + /* + Model: SeoSchema + Used By: Content + */ + class SeoSchema: Codable { + public var app: String? + + public var id: String? + + public var robotsTxt: String? + + public var sitemapEnabled: Bool? + + public var customMetaTags: [CustomMetaTag]? + + public var details: Detail? + + public var createdAt: String? + + public var updatedAt: String? + + public enum CodingKeys: String, CodingKey { + case app + + case id = "_id" + + case robotsTxt = "robots_txt" + + case sitemapEnabled = "sitemap_enabled" + + case customMetaTags = "custom_meta_tags" + + case details + + case createdAt = "created_at" + + case updatedAt = "updated_at" + } + + public init(app: String?, createdAt: String?, customMetaTags: [CustomMetaTag]?, details: Detail?, robotsTxt: String?, sitemapEnabled: Bool?, updatedAt: String?, id: String?) { + self.app = app + + self.id = id + + self.robotsTxt = robotsTxt + + self.sitemapEnabled = sitemapEnabled + + self.customMetaTags = customMetaTags + + self.details = details + + self.createdAt = createdAt + + self.updatedAt = updatedAt + } + + public func duplicate() -> SeoSchema { + let dict = self.dictionary! + let copy = SeoSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + app = try container.decode(String.self, forKey: .app) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + robotsTxt = try container.decode(String.self, forKey: .robotsTxt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sitemapEnabled = try container.decode(Bool.self, forKey: .sitemapEnabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customMetaTags = try container.decode([CustomMetaTag].self, forKey: .customMetaTags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + details = try container.decode(Detail.self, forKey: .details) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(app, forKey: .app) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(robotsTxt, forKey: .robotsTxt) + + try? container.encodeIfPresent(sitemapEnabled, forKey: .sitemapEnabled) + + try? container.encodeIfPresent(customMetaTags, forKey: .customMetaTags) + + try? container.encodeIfPresent(details, forKey: .details) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + } + } + + /* + Model: CustomMetaTag + Used By: Content + */ + class CustomMetaTag: Codable { + public var name: String? + + public var content: String? + + public var id: String? + + public enum CodingKeys: String, CodingKey { + case name + + case content + + case id = "_id" + } + + public init(content: String?, name: String?, id: String?) { + self.name = name + + self.content = content + + self.id = id + } + + public func duplicate() -> CustomMetaTag { + let dict = self.dictionary! + let copy = CustomMetaTag(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode(String.self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: Detail + Used By: Content + */ + class Detail: Codable { + public var title: String? + + public var description: String? + + public enum CodingKeys: String, CodingKey { + case title + + case description + } + + public init(description: String?, title: String?) { + self.title = title + + self.description = description + } + + public func duplicate() -> Detail { + let dict = self.dictionary! + let copy = Detail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(description, forKey: .description) + } + } + + /* + Model: AnnouncementPageSchema + Used By: Content + */ + class AnnouncementPageSchema: Codable { + public var pageSlug: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case pageSlug = "page_slug" + + case type + } + + public init(pageSlug: String?, type: String?) { + self.pageSlug = pageSlug + + self.type = type + } + + public func duplicate() -> AnnouncementPageSchema { + let dict = self.dictionary! + let copy = AnnouncementPageSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + pageSlug = try container.decode(String.self, forKey: .pageSlug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pageSlug, forKey: .pageSlug) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: EditorMeta + Used By: Content + */ + class EditorMeta: Codable { + public var foregroundColor: String? + + public var backgroundColor: String? + + public var contentType: String? + + public var content: String? + + public enum CodingKeys: String, CodingKey { + case foregroundColor = "foreground_color" + + case backgroundColor = "background_color" + + case contentType = "content_type" + + case content + } + + public init(backgroundColor: String?, content: String?, contentType: String?, foregroundColor: String?) { + self.foregroundColor = foregroundColor + + self.backgroundColor = backgroundColor + + self.contentType = contentType + + self.content = content + } + + public func duplicate() -> EditorMeta { + let dict = self.dictionary! + let copy = EditorMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + foregroundColor = try container.decode(String.self, forKey: .foregroundColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + backgroundColor = try container.decode(String.self, forKey: .backgroundColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contentType = try container.decode(String.self, forKey: .contentType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode(String.self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(foregroundColor, forKey: .foregroundColor) + + try? container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) + + try? container.encodeIfPresent(contentType, forKey: .contentType) + + try? container.encodeIfPresent(content, forKey: .content) + } + } + + /* + Model: AnnouncementAuthorSchema + Used By: Content + */ + class AnnouncementAuthorSchema: Codable { + public var createdBy: String? + + public var modifiedBy: String? + + public enum CodingKeys: String, CodingKey { + case createdBy = "created_by" + + case modifiedBy = "modified_by" + } + + public init(createdBy: String?, modifiedBy: String?) { + self.createdBy = createdBy + + self.modifiedBy = modifiedBy + } + + public func duplicate() -> AnnouncementAuthorSchema { + let dict = self.dictionary! + let copy = AnnouncementAuthorSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + createdBy = try container.decode(String.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode(String.self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + } + } + + /* + Model: AdminAnnouncementSchema + Used By: Content + */ + class AdminAnnouncementSchema: Codable { + public var id: String? + + public var platforms: [String]? + + public var title: String? + + public var announcement: String? + + public var pages: [AnnouncementPageSchema]? + + public var editorMeta: EditorMeta? + + public var author: AnnouncementAuthorSchema? + + public var createdAt: String? + + public var app: String? + + public var modifiedAt: String? + + public var schedule: ScheduleSchema? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case platforms + + case title + + case announcement + + case pages + + case editorMeta = "editor_meta" + + case author + + case createdAt = "created_at" + + case app + + case modifiedAt = "modified_at" + + case schedule = "_schedule" + } + + public init(announcement: String?, app: String?, author: AnnouncementAuthorSchema?, createdAt: String?, editorMeta: EditorMeta?, modifiedAt: String?, pages: [AnnouncementPageSchema]?, platforms: [String]?, title: String?, id: String?, schedule: ScheduleSchema?) { + self.id = id + + self.platforms = platforms + + self.title = title + + self.announcement = announcement + + self.pages = pages + + self.editorMeta = editorMeta + + self.author = author + + self.createdAt = createdAt + + self.app = app + + self.modifiedAt = modifiedAt + + self.schedule = schedule + } + + public func duplicate() -> AdminAnnouncementSchema { + let dict = self.dictionary! + let copy = AdminAnnouncementSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platforms = try container.decode([String].self, forKey: .platforms) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + announcement = try container.decode(String.self, forKey: .announcement) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pages = try container.decode([AnnouncementPageSchema].self, forKey: .pages) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + editorMeta = try container.decode(EditorMeta.self, forKey: .editorMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + author = try container.decode(AnnouncementAuthorSchema.self, forKey: .author) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + app = try container.decode(String.self, forKey: .app) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedAt = try container.decode(String.self, forKey: .modifiedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode(ScheduleSchema.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(platforms, forKey: .platforms) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(announcement, forKey: .announcement) + + try? container.encodeIfPresent(pages, forKey: .pages) + + try? container.encodeIfPresent(editorMeta, forKey: .editorMeta) + + try? container.encodeIfPresent(author, forKey: .author) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(app, forKey: .app) + + try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + } + } + + /* + Model: ScheduleSchema + Used By: Content + */ + class ScheduleSchema: Codable { + public var cron: String? + + public var start: String? + + public var end: String? + + public var duration: Double? + + public var nextSchedule: [NextSchedule]? + + public enum CodingKeys: String, CodingKey { + case cron + + case start + + case end + + case duration + + case nextSchedule = "next_schedule" + } + + public init(cron: String?, duration: Double?, end: String?, nextSchedule: [NextSchedule]?, start: String?) { + self.cron = cron + + self.start = start + + self.end = end + + self.duration = duration + + self.nextSchedule = nextSchedule + } + + public func duplicate() -> ScheduleSchema { + let dict = self.dictionary! + let copy = ScheduleSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + cron = try container.decode(String.self, forKey: .cron) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + start = try container.decode(String.self, forKey: .start) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + end = try container.decode(String.self, forKey: .end) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + duration = try container.decode(Double.self, forKey: .duration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + nextSchedule = try container.decode([NextSchedule].self, forKey: .nextSchedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(cron, forKey: .cron) + + try? container.encodeIfPresent(start, forKey: .start) + + try? container.encodeIfPresent(end, forKey: .end) + + try? container.encodeIfPresent(duration, forKey: .duration) + + try? container.encodeIfPresent(nextSchedule, forKey: .nextSchedule) + } + } + + /* + Model: NextSchedule + Used By: Content + */ + class NextSchedule: Codable { + public var start: String? + + public var end: String? + + public enum CodingKeys: String, CodingKey { + case start + + case end + } + + public init(end: String?, start: String?) { + self.start = start + + self.end = end + } + + public func duplicate() -> NextSchedule { + let dict = self.dictionary! + let copy = NextSchedule(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + start = try container.decode(String.self, forKey: .start) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + end = try container.decode(String.self, forKey: .end) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(start, forKey: .start) + + try? container.encodeIfPresent(end, forKey: .end) + } + } + + /* + Model: AnnouncementSchema + Used By: Content + */ + class AnnouncementSchema: Codable { + public var announcement: String? + + public var schedule: ScheduleStartSchema? + + public enum CodingKeys: String, CodingKey { + case announcement + + case schedule + } + + public init(announcement: String?, schedule: ScheduleStartSchema?) { + self.announcement = announcement + + self.schedule = schedule + } + + public func duplicate() -> AnnouncementSchema { + let dict = self.dictionary! + let copy = AnnouncementSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + announcement = try container.decode(String.self, forKey: .announcement) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode(ScheduleStartSchema.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(announcement, forKey: .announcement) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + } + } + + /* + Model: ScheduleStartSchema + Used By: Content + */ + class ScheduleStartSchema: Codable { + public var start: String? + + public var end: String? + + public enum CodingKeys: String, CodingKey { + case start + + case end + } + + public init(end: String?, start: String?) { + self.start = start + + self.end = end + } + + public func duplicate() -> ScheduleStartSchema { + let dict = self.dictionary! + let copy = ScheduleStartSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + start = try container.decode(String.self, forKey: .start) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + end = try container.decode(String.self, forKey: .end) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(start, forKey: .start) + + try? container.encodeIfPresent(end, forKey: .end) + } + } + + /* + Model: BlogGetResponse + Used By: Content + */ + class BlogGetResponse: Codable { + public var items: [BlogSchema]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [BlogSchema]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> BlogGetResponse { + let dict = self.dictionary! + let copy = BlogGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([BlogSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: ResourceContent + Used By: Content + */ + class ResourceContent: Codable { + public var type: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case type + + case value + } + + public init(type: String?, value: String?) { + self.type = type + + self.value = value + } + + public func duplicate() -> ResourceContent { + let dict = self.dictionary! + let copy = ResourceContent(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: Asset + Used By: Content + */ + class Asset: Codable { + public var aspectRatio: String? + + public var id: String? + + public var secureUrl: String? + + public enum CodingKeys: String, CodingKey { + case aspectRatio = "aspect_ratio" + + case id + + case secureUrl = "secure_url" + } + + public init(aspectRatio: String?, id: String?, secureUrl: String?) { + self.aspectRatio = aspectRatio + + self.id = id + + self.secureUrl = secureUrl + } + + public func duplicate() -> Asset { + let dict = self.dictionary! + let copy = Asset(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + aspectRatio = try container.decode(String.self, forKey: .aspectRatio) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + secureUrl = try container.decode(String.self, forKey: .secureUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) + } + } + + /* + Model: Author + Used By: Content + */ + class Author: Codable { + public var designation: String? + + public var id: String? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case designation + + case id + + case name + } + + public init(designation: String?, id: String?, name: String?) { + self.designation = designation + + self.id = id + + self.name = name + } + + public func duplicate() -> Author { + let dict = self.dictionary! + let copy = Author(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + designation = try container.decode(String.self, forKey: .designation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(designation, forKey: .designation) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: BlogSchema + Used By: Content + */ + class BlogSchema: Codable { + public var id: String? + + public var customJson: [String: Any]? + + public var application: String? + + public var archived: Bool? + + public var author: Author? + + public var content: [ResourceContent]? + + public var featureImage: Asset? + + public var published: Bool? + + public var readingTime: String? + + public var slug: String? + + public var tags: [String]? + + public var seo: SEO? + + public var schedule: CronSchedule? + + public var title: String? + + public var dateMeta: DateMeta? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case customJson = "_custom_json" + + case application + + case archived + + case author + + case content + + case featureImage = "feature_image" + + case published + + case readingTime = "reading_time" + + case slug + + case tags + + case seo + + case schedule = "_schedule" + + case title + + case dateMeta = "date_meta" + } + + public init(application: String?, archived: Bool?, author: Author?, content: [ResourceContent]?, dateMeta: DateMeta?, featureImage: Asset?, published: Bool?, readingTime: String?, seo: SEO?, slug: String?, tags: [String]?, title: String?, customJson: [String: Any]?, id: String?, schedule: CronSchedule?) { + self.id = id + + self.customJson = customJson + + self.application = application + + self.archived = archived + + self.author = author + + self.content = content + + self.featureImage = featureImage + + self.published = published + + self.readingTime = readingTime + + self.slug = slug + + self.tags = tags + + self.seo = seo + + self.schedule = schedule + + self.title = title + + self.dateMeta = dateMeta + } + + public func duplicate() -> BlogSchema { + let dict = self.dictionary! + let copy = BlogSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archived = try container.decode(Bool.self, forKey: .archived) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + author = try container.decode(Author.self, forKey: .author) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode([ResourceContent].self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + featureImage = try container.decode(Asset.self, forKey: .featureImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + readingTime = try container.decode(String.self, forKey: .readingTime) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + seo = try container.decode(SEO.self, forKey: .seo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode(CronSchedule.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(archived, forKey: .archived) + + try? container.encodeIfPresent(author, forKey: .author) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(featureImage, forKey: .featureImage) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(readingTime, forKey: .readingTime) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(seo, forKey: .seo) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + } + } + + /* + Model: SEO + Used By: Content + */ + class SEO: Codable { + public var description: String? + + public var image: SEOImage? + + public var title: String? + + public enum CodingKeys: String, CodingKey { + case description + + case image + + case title + } + + public init(description: String?, image: SEOImage?, title: String?) { + self.description = description + + self.image = image + + self.title = title + } + + public func duplicate() -> SEO { + let dict = self.dictionary! + let copy = SEO(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + image = try container.decode(SEOImage.self, forKey: .image) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(image, forKey: .image) + + try? container.encodeIfPresent(title, forKey: .title) + } + } + + /* + Model: SEOImage + Used By: Content + */ + class SEOImage: Codable { + public var url: String? + + public enum CodingKeys: String, CodingKey { + case url + } + + public init(url: String?) { + self.url = url + } + + public func duplicate() -> SEOImage { + let dict = self.dictionary! + let copy = SEOImage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(url, forKey: .url) + } + } + + /* + Model: DateMeta + Used By: Content + */ + class DateMeta: Codable { + public var createdOn: String? + + public var modifiedOn: String? + + public enum CodingKeys: String, CodingKey { + case createdOn = "created_on" + + case modifiedOn = "modified_on" + } + + public init(createdOn: String?, modifiedOn: String?) { + self.createdOn = createdOn + + self.modifiedOn = modifiedOn + } + + public func duplicate() -> DateMeta { + let dict = self.dictionary! + let copy = DateMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + } + } + + /* + Model: BlogRequest + Used By: Content + */ + class BlogRequest: Codable { + public var application: String? + + public var customJson: [String: Any]? + + public var author: Author? + + public var content: [ResourceContent]? + + public var featureImage: Asset? + + public var published: Bool? + + public var readingTime: String? + + public var slug: String? + + public var tags: [String]? + + public var title: String? + + public var seo: SEO? + + public var schedule: CronSchedule? + + public enum CodingKeys: String, CodingKey { + case application + + case customJson = "_custom_json" + + case author + + case content + + case featureImage = "feature_image" + + case published + + case readingTime = "reading_time" + + case slug + + case tags + + case title + + case seo + + case schedule = "_schedule" + } + + public init(application: String?, author: Author?, content: [ResourceContent]?, featureImage: Asset?, published: Bool?, readingTime: String?, seo: SEO?, slug: String?, tags: [String]?, title: String?, customJson: [String: Any]?, schedule: CronSchedule?) { + self.application = application + + self.customJson = customJson + + self.author = author + + self.content = content + + self.featureImage = featureImage + + self.published = published + + self.readingTime = readingTime + + self.slug = slug + + self.tags = tags + + self.title = title + + self.seo = seo + + self.schedule = schedule + } + + public func duplicate() -> BlogRequest { + let dict = self.dictionary! + let copy = BlogRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + author = try container.decode(Author.self, forKey: .author) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode([ResourceContent].self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + featureImage = try container.decode(Asset.self, forKey: .featureImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + readingTime = try container.decode(String.self, forKey: .readingTime) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + seo = try container.decode(SEO.self, forKey: .seo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode(CronSchedule.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(author, forKey: .author) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(featureImage, forKey: .featureImage) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(readingTime, forKey: .readingTime) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(seo, forKey: .seo) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + } + } + + /* + Model: GetAnnouncementListSchema + Used By: Content + */ + class GetAnnouncementListSchema: Codable { + public var items: [AdminAnnouncementSchema]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [AdminAnnouncementSchema]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> GetAnnouncementListSchema { + let dict = self.dictionary! + let copy = GetAnnouncementListSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([AdminAnnouncementSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: CreateAnnouncementSchema + Used By: Content + */ + class CreateAnnouncementSchema: Codable { + public var message: String? + + public var data: AdminAnnouncementSchema? + + public enum CodingKeys: String, CodingKey { + case message + + case data + } + + public init(data: AdminAnnouncementSchema?, message: String?) { + self.message = message + + self.data = data + } + + public func duplicate() -> CreateAnnouncementSchema { + let dict = self.dictionary! + let copy = CreateAnnouncementSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode(AdminAnnouncementSchema.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: DataLoaderResponseSchema + Used By: Content + */ + class DataLoaderResponseSchema: Codable { + public var application: String? + + public var company: String? + + public var id: String? + + public var name: String? + + public var service: String? + + public var operationId: String? + + public var type: String? + + public var url: String? + + public var content: String? + + public var source: DataLoaderSourceSchema? + + public enum CodingKeys: String, CodingKey { + case application + + case company + + case id = "_id" + + case name + + case service + + case operationId = "operation_id" + + case type + + case url + + case content + + case source = "__source" + } + + public init(application: String?, company: String?, content: String?, name: String?, operationId: String?, service: String?, type: String?, url: String?, id: String?, source: DataLoaderSourceSchema?) { + self.application = application + + self.company = company + + self.id = id + + self.name = name + + self.service = service + + self.operationId = operationId + + self.type = type + + self.url = url + + self.content = content + + self.source = source + } + + public func duplicate() -> DataLoaderResponseSchema { + let dict = self.dictionary! + let copy = DataLoaderResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + company = try container.decode(String.self, forKey: .company) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + service = try container.decode(String.self, forKey: .service) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + operationId = try container.decode(String.self, forKey: .operationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode(String.self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + source = try container.decode(DataLoaderSourceSchema.self, forKey: .source) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(company, forKey: .company) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(service, forKey: .service) + + try? container.encodeIfPresent(operationId, forKey: .operationId) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(source, forKey: .source) + } + } + + /* + Model: DataLoaderResetResponseSchema + Used By: Content + */ + class DataLoaderResetResponseSchema: Codable { + public var reset: String? + + public enum CodingKeys: String, CodingKey { + case reset + } + + public init(reset: String?) { + self.reset = reset + } + + public func duplicate() -> DataLoaderResetResponseSchema { + let dict = self.dictionary! + let copy = DataLoaderResetResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + reset = try container.decode(String.self, forKey: .reset) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(reset, forKey: .reset) + } + } + + /* + Model: Navigation + Used By: Content + */ + class Navigation: Codable { + public var name: String? + + public var slug: String? + + public var orientation: String? + + public var createdBy: CreatedBySchema? + + public var dateMeta: DateMeta? + + public var id: String? + + public var position: String? + + public var application: String? + + public var platform: String? + + public var navigation: NavigationReference? + + public enum CodingKeys: String, CodingKey { + case name + + case slug + + case orientation + + case createdBy = "created_by" + + case dateMeta = "date_meta" + + case id = "_id" + + case position + + case application + + case platform + + case navigation + } + + public init(application: String?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, name: String?, navigation: NavigationReference?, orientation: String?, platform: String?, position: String?, slug: String?, id: String?) { + self.name = name + + self.slug = slug + + self.orientation = orientation + + self.createdBy = createdBy + + self.dateMeta = dateMeta + + self.id = id + + self.position = position + + self.application = application + + self.platform = platform + + self.navigation = navigation + } + + public func duplicate() -> Navigation { + let dict = self.dictionary! + let copy = Navigation(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orientation = try container.decode(String.self, forKey: .orientation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + position = try container.decode(String.self, forKey: .position) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode(String.self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + navigation = try container.decode(NavigationReference.self, forKey: .navigation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(orientation, forKey: .orientation) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(position, forKey: .position) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(platform, forKey: .platform) + + try? container.encodeIfPresent(navigation, forKey: .navigation) + } + } + + /* + Model: LocaleLanguage + Used By: Content + */ + class LocaleLanguage: Codable { + public var hi: Language? + + public var ar: Language? + + public var enUs: Language? + + public enum CodingKeys: String, CodingKey { + case hi + + case ar + + case enUs = "en_us" + } + + public init(ar: Language?, enUs: Language?, hi: Language?) { + self.hi = hi + + self.ar = ar + + self.enUs = enUs + } + + public func duplicate() -> LocaleLanguage { + let dict = self.dictionary! + let copy = LocaleLanguage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + hi = try container.decode(Language.self, forKey: .hi) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ar = try container.decode(Language.self, forKey: .ar) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enUs = try container.decode(Language.self, forKey: .enUs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(hi, forKey: .hi) + + try? container.encodeIfPresent(ar, forKey: .ar) + + try? container.encodeIfPresent(enUs, forKey: .enUs) + } + } + + /* + Model: Language + Used By: Content + */ + class Language: Codable { + public var display: String? + + public enum CodingKeys: String, CodingKey { + case display + } + + public init(display: String?) { + self.display = display + } + + public func duplicate() -> Language { + let dict = self.dictionary! + let copy = Language(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(display, forKey: .display) + } + } + + /* + Model: Action + Used By: Content + */ + class Action: Codable { + public var page: ActionPage? + + public var popup: ActionPage? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case page + + case popup + + case type + } + + public init(page: ActionPage?, popup: ActionPage?, type: String?) { + self.page = page + + self.popup = popup + + self.type = type + } + + public func duplicate() -> Action { + let dict = self.dictionary! + let copy = Action(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(ActionPage.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + popup = try container.decode(ActionPage.self, forKey: .popup) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(popup, forKey: .popup) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: ActionPage + Used By: Content + */ + class ActionPage: Codable { + public var params: [String: [String]]? + + public var query: [String: [String]]? + + public var url: String? + + public var type: PageType + + public enum CodingKeys: String, CodingKey { + case params + + case query + + case url + + case type + } + + public init(params: [String: [String]]?, query: [String: [String]]?, type: PageType, url: String?) { + self.params = params + + self.query = query + + self.url = url + + self.type = type + } + + public func duplicate() -> ActionPage { + let dict = self.dictionary! + let copy = ActionPage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + params = try container.decode([String: [String]].self, forKey: .params) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode([String: [String]].self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + type = try container.decode(PageType.self, forKey: .type) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(params, forKey: .params) + + try? container.encodeIfPresent(query, forKey: .query) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: NavigationReference + Used By: Content + */ + class NavigationReference: Codable { + public var acl: [String]? + + public var tags: [String]? + + public var localeLanguage: LocaleLanguage? + + public var image: String? + + public var type: String? + + public var action: Action? + + public var active: Bool? + + public var display: String? + + public var sortOrder: Int? + + public var subNavigation: [NavigationReference]? + + public enum CodingKeys: String, CodingKey { + case acl + + case tags + + case localeLanguage = "_locale_language" + + case image + + case type + + case action + + case active + + case display + + case sortOrder = "sort_order" + + case subNavigation = "sub_navigation" + } + + public init(acl: [String]?, action: Action?, active: Bool?, display: String?, image: String?, sortOrder: Int?, subNavigation: [NavigationReference]?, tags: [String]?, type: String?, localeLanguage: LocaleLanguage?) { + self.acl = acl + + self.tags = tags + + self.localeLanguage = localeLanguage + + self.image = image + + self.type = type + + self.action = action + + self.active = active + + self.display = display + + self.sortOrder = sortOrder + + self.subNavigation = subNavigation + } + + public func duplicate() -> NavigationReference { + let dict = self.dictionary! + let copy = NavigationReference(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + acl = try container.decode([String].self, forKey: .acl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + localeLanguage = try container.decode(LocaleLanguage.self, forKey: .localeLanguage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + image = try container.decode(String.self, forKey: .image) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(Action.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sortOrder = try container.decode(Int.self, forKey: .sortOrder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subNavigation = try container.decode([NavigationReference].self, forKey: .subNavigation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(acl, forKey: .acl) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(localeLanguage, forKey: .localeLanguage) + + try? container.encodeIfPresent(image, forKey: .image) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(sortOrder, forKey: .sortOrder) + + try? container.encodeIfPresent(subNavigation, forKey: .subNavigation) + } + } + + /* + Model: LandingPage + Used By: Content + */ + class LandingPage: Codable { + public var data: LandingPageSchema? + + public var success: Bool? + + public enum CodingKeys: String, CodingKey { + case data + + case success + } + + public init(data: LandingPageSchema?, success: Bool?) { + self.data = data + + self.success = success + } + + public func duplicate() -> LandingPage { + let dict = self.dictionary! + let copy = LandingPage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode(LandingPageSchema.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: ConfigurationSchema + Used By: Content + */ + class ConfigurationSchema: Codable { + public var sleepTime: Int? + + public var startOnLaunch: Bool? + + public var duration: Int? + + public var slideDirection: String? + + public enum CodingKeys: String, CodingKey { + case sleepTime = "sleep_time" + + case startOnLaunch = "start_on_launch" + + case duration + + case slideDirection = "slide_direction" + } + + public init(duration: Int?, sleepTime: Int?, slideDirection: String?, startOnLaunch: Bool?) { + self.sleepTime = sleepTime + + self.startOnLaunch = startOnLaunch + + self.duration = duration + + self.slideDirection = slideDirection + } + + public func duplicate() -> ConfigurationSchema { + let dict = self.dictionary! + let copy = ConfigurationSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + sleepTime = try container.decode(Int.self, forKey: .sleepTime) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + startOnLaunch = try container.decode(Bool.self, forKey: .startOnLaunch) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + duration = try container.decode(Int.self, forKey: .duration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slideDirection = try container.decode(String.self, forKey: .slideDirection) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(sleepTime, forKey: .sleepTime) + + try? container.encodeIfPresent(startOnLaunch, forKey: .startOnLaunch) + + try? container.encodeIfPresent(duration, forKey: .duration) + + try? container.encodeIfPresent(slideDirection, forKey: .slideDirection) + } + } + + /* + Model: SlideshowMedia + Used By: Content + */ + class SlideshowMedia: Codable { + public var type: String? + + public var url: String? + + public var bgColor: String? + + public var duration: Int? + + public var autoDecideDuration: Bool? + + public var action: Action? + + public enum CodingKeys: String, CodingKey { + case type + + case url + + case bgColor = "bg_color" + + case duration + + case autoDecideDuration = "auto_decide_duration" + + case action + } + + public init(action: Action?, autoDecideDuration: Bool?, bgColor: String?, duration: Int?, type: String?, url: String?) { + self.type = type + + self.url = url + + self.bgColor = bgColor + + self.duration = duration + + self.autoDecideDuration = autoDecideDuration + + self.action = action + } + + public func duplicate() -> SlideshowMedia { + let dict = self.dictionary! + let copy = SlideshowMedia(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bgColor = try container.decode(String.self, forKey: .bgColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + duration = try container.decode(Int.self, forKey: .duration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + autoDecideDuration = try container.decode(Bool.self, forKey: .autoDecideDuration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(Action.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(bgColor, forKey: .bgColor) + + try? container.encodeIfPresent(duration, forKey: .duration) + + try? container.encodeIfPresent(autoDecideDuration, forKey: .autoDecideDuration) + + try? container.encodeIfPresent(action, forKey: .action) + } + } + + /* + Model: Slideshow + Used By: Content + */ + class Slideshow: Codable { + public var data: SlideshowSchema? + + public var success: Bool? + + public enum CodingKeys: String, CodingKey { + case data + + case success + } + + public init(data: SlideshowSchema?, success: Bool?) { + self.data = data + + self.success = success + } + + public func duplicate() -> Slideshow { + let dict = self.dictionary! + let copy = Slideshow(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode(SlideshowSchema.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: AnnouncementsResponseSchema + Used By: Content + */ + class AnnouncementsResponseSchema: Codable { + public var announcements: [String: [AnnouncementSchema]]? + + public var refreshRate: Int? + + public var refreshPages: [String]? + + public enum CodingKeys: String, CodingKey { + case announcements + + case refreshRate = "refresh_rate" + + case refreshPages = "refresh_pages" + } + + public init(announcements: [String: [AnnouncementSchema]]?, refreshPages: [String]?, refreshRate: Int?) { + self.announcements = announcements + + self.refreshRate = refreshRate + + self.refreshPages = refreshPages + } + + public func duplicate() -> AnnouncementsResponseSchema { + let dict = self.dictionary! + let copy = AnnouncementsResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + announcements = try container.decode([String: [AnnouncementSchema]].self, forKey: .announcements) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refreshRate = try container.decode(Int.self, forKey: .refreshRate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refreshPages = try container.decode([String].self, forKey: .refreshPages) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(announcements, forKey: .announcements) + + try? container.encodeIfPresent(refreshRate, forKey: .refreshRate) + + try? container.encodeIfPresent(refreshPages, forKey: .refreshPages) + } + } + + /* + Model: FaqResponseSchema + Used By: Content + */ + class FaqResponseSchema: Codable { + public var faqs: [FaqSchema]? + + public enum CodingKeys: String, CodingKey { + case faqs + } + + public init(faqs: [FaqSchema]?) { + self.faqs = faqs + } + + public func duplicate() -> FaqResponseSchema { + let dict = self.dictionary! + let copy = FaqResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + faqs = try container.decode([FaqSchema].self, forKey: .faqs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(faqs, forKey: .faqs) + } + } + + /* + Model: UpdateHandpickedSchema + Used By: Content + */ + class UpdateHandpickedSchema: Codable { + public var tag: HandpickedTagSchema? + + public enum CodingKeys: String, CodingKey { + case tag + } + + public init(tag: HandpickedTagSchema?) { + self.tag = tag + } + + public func duplicate() -> UpdateHandpickedSchema { + let dict = self.dictionary! + let copy = UpdateHandpickedSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + tag = try container.decode(HandpickedTagSchema.self, forKey: .tag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(tag, forKey: .tag) + } + } + + /* + Model: HandpickedTagSchema + Used By: Content + */ + class HandpickedTagSchema: Codable { + public var position: String? + + public var attributes: [String: Any]? + + public var name: String? + + public var url: String? + + public var type: String? + + public var subType: String? + + public var content: String? + + public enum CodingKeys: String, CodingKey { + case position + + case attributes + + case name + + case url + + case type + + case subType = "sub_type" + + case content + } + + public init(attributes: [String: Any]?, content: String?, name: String?, position: String?, subType: String?, type: String?, url: String?) { + self.position = position + + self.attributes = attributes + + self.name = name + + self.url = url + + self.type = type + + self.subType = subType + + self.content = content + } + + public func duplicate() -> HandpickedTagSchema { + let dict = self.dictionary! + let copy = HandpickedTagSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + position = try container.decode(String.self, forKey: .position) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributes = try container.decode([String: Any].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subType = try container.decode(String.self, forKey: .subType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode(String.self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(position, forKey: .position) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(subType, forKey: .subType) + + try? container.encodeIfPresent(content, forKey: .content) + } + } + + /* + Model: RemoveHandpickedSchema + Used By: Content + */ + class RemoveHandpickedSchema: Codable { + public var tags: [String]? + + public enum CodingKeys: String, CodingKey { + case tags + } + + public init(tags: [String]?) { + self.tags = tags + } + + public func duplicate() -> RemoveHandpickedSchema { + let dict = self.dictionary! + let copy = RemoveHandpickedSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: CreateTagSchema + Used By: Content + */ + class CreateTagSchema: Codable { + public var name: String? + + public var subType: String? + + public var id: String? + + public var type: String? + + public var url: String? + + public var position: String? + + public var attributes: [String: Any]? + + public var content: String? + + public enum CodingKeys: String, CodingKey { + case name + + case subType = "sub_type" + + case id = "_id" + + case type + + case url + + case position + + case attributes + + case content + } + + public init(attributes: [String: Any]?, content: String?, name: String?, position: String?, subType: String?, type: String?, url: String?, id: String?) { + self.name = name + + self.subType = subType + + self.id = id + + self.type = type + + self.url = url + + self.position = position + + self.attributes = attributes + + self.content = content + } + + public func duplicate() -> CreateTagSchema { + let dict = self.dictionary! + let copy = CreateTagSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subType = try container.decode(String.self, forKey: .subType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + position = try container.decode(String.self, forKey: .position) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributes = try container.decode([String: Any].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode(String.self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(subType, forKey: .subType) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(position, forKey: .position) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + + try? container.encodeIfPresent(content, forKey: .content) + } + } + + /* + Model: CreateTagRequestSchema + Used By: Content + */ + class CreateTagRequestSchema: Codable { + public var tags: [CreateTagSchema]? + + public enum CodingKeys: String, CodingKey { + case tags + } + + public init(tags: [CreateTagSchema]?) { + self.tags = tags + } + + public func duplicate() -> CreateTagRequestSchema { + let dict = self.dictionary! + let copy = CreateTagRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + tags = try container.decode([CreateTagSchema].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: DataLoaderSchema + Used By: Content + */ + class DataLoaderSchema: Codable { + public var name: String? + + public var service: String? + + public var operationId: String? + + public var type: String? + + public var url: String? + + public var content: String? + + public var source: DataLoaderSourceSchema? + + public enum CodingKeys: String, CodingKey { + case name + + case service + + case operationId = "operation_id" + + case type + + case url + + case content + + case source = "__source" + } + + public init(content: String?, name: String?, operationId: String?, service: String?, type: String?, url: String?, source: DataLoaderSourceSchema?) { + self.name = name + + self.service = service + + self.operationId = operationId + + self.type = type + + self.url = url + + self.content = content + + self.source = source + } + + public func duplicate() -> DataLoaderSchema { + let dict = self.dictionary! + let copy = DataLoaderSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + service = try container.decode(String.self, forKey: .service) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + operationId = try container.decode(String.self, forKey: .operationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode(String.self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + source = try container.decode(DataLoaderSourceSchema.self, forKey: .source) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(service, forKey: .service) + + try? container.encodeIfPresent(operationId, forKey: .operationId) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(source, forKey: .source) + } + } + + /* + Model: DataLoaderSourceSchema + Used By: Content + */ + class DataLoaderSourceSchema: Codable { + public var type: String? + + public var id: String? + + public enum CodingKeys: String, CodingKey { + case type + + case id + } + + public init(id: String?, type: String?) { + self.type = type + + self.id = id + } + + public func duplicate() -> DataLoaderSourceSchema { + let dict = self.dictionary! + let copy = DataLoaderSourceSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: DataLoadersSchema + Used By: Content + */ + class DataLoadersSchema: Codable { + public var items: [DataLoaderSchema]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [DataLoaderSchema]?) { + self.items = items + } + + public func duplicate() -> DataLoadersSchema { + let dict = self.dictionary! + let copy = DataLoadersSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([DataLoaderSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: TagDeleteSuccessResponse + Used By: Content + */ + class TagDeleteSuccessResponse: Codable { + public var success: Bool? + + public enum CodingKeys: String, CodingKey { + case success + } + + public init(success: Bool?) { + self.success = success + } + + public func duplicate() -> TagDeleteSuccessResponse { + let dict = self.dictionary! + let copy = TagDeleteSuccessResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: ContentAPIError + Used By: Content + */ + class ContentAPIError: Codable { + public var message: String? + + public var status: Double? + + public var code: String? + + public var exception: String? + + public var info: String? + + public var requestId: String? + + public var stackTrace: String? + + public var meta: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case message + + case status + + case code + + case exception + + case info + + case requestId = "request_id" + + case stackTrace = "stack_trace" + + case meta + } + + public init(code: String?, exception: String?, info: String?, message: String?, meta: [String: Any]?, requestId: String?, stackTrace: String?, status: Double?) { + self.message = message + + self.status = status + + self.code = code + + self.exception = exception + + self.info = info + + self.requestId = requestId + + self.stackTrace = stackTrace + + self.meta = meta + } + + public func duplicate() -> ContentAPIError { + let dict = self.dictionary! + let copy = ContentAPIError(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Double.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + exception = try container.decode(String.self, forKey: .exception) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + info = try container.decode(String.self, forKey: .info) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stackTrace = try container.decode(String.self, forKey: .stackTrace) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(exception, forKey: .exception) + + try? container.encodeIfPresent(info, forKey: .info) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(stackTrace, forKey: .stackTrace) + + try? container.encodeIfPresent(meta, forKey: .meta) + } + } + + /* + Model: CategorySchema + Used By: Content + */ + class CategorySchema: Codable { + public var index: Int? + + public var title: String? + + public var description: String? + + public var children: [String]? + + public var id: String? + + public var slug: String? + + public var application: String? + + public var iconUrl: String? + + public var customJson: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case index + + case title + + case description + + case children + + case id = "_id" + + case slug + + case application + + case iconUrl = "icon_url" + + case customJson = "_custom_json" + } + + public init(application: String?, children: [String]?, description: String?, iconUrl: String?, index: Int?, slug: String?, title: String?, customJson: [String: Any]?, id: String?) { + self.index = index + + self.title = title + + self.description = description + + self.children = children + + self.id = id + + self.slug = slug + + self.application = application + + self.iconUrl = iconUrl + + self.customJson = customJson + } + + public func duplicate() -> CategorySchema { + let dict = self.dictionary! + let copy = CategorySchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + index = try container.decode(Int.self, forKey: .index) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + children = try container.decode([String].self, forKey: .children) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + iconUrl = try container.decode(String.self, forKey: .iconUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(index, forKey: .index) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(children, forKey: .children) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(iconUrl, forKey: .iconUrl) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + } + } + + /* + Model: ChildrenSchema + Used By: Content + */ + class ChildrenSchema: Codable { + public var question: String? + + public var answer: String? + + public var slug: String? + + public var application: String? + + public var id: String? + + public enum CodingKeys: String, CodingKey { + case question + + case answer + + case slug + + case application + + case id = "_id" + } + + public init(answer: String?, application: String?, question: String?, slug: String?, id: String?) { + self.question = question + + self.answer = answer + + self.slug = slug + + self.application = application + + self.id = id + } + + public func duplicate() -> ChildrenSchema { + let dict = self.dictionary! + let copy = ChildrenSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + question = try container.decode(String.self, forKey: .question) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + answer = try container.decode(String.self, forKey: .answer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(question, forKey: .question) + + try? container.encodeIfPresent(answer, forKey: .answer) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: CategoryRequestSchema + Used By: Content + */ + class CategoryRequestSchema: Codable { + public var slug: String? + + public var title: String? + + public enum CodingKeys: String, CodingKey { + case slug + + case title + } + + public init(slug: String?, title: String?) { + self.slug = slug + + self.title = title + } + + public func duplicate() -> CategoryRequestSchema { + let dict = self.dictionary! + let copy = CategoryRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(title, forKey: .title) + } + } + + /* + Model: FAQCategorySchema + Used By: Content + */ + class FAQCategorySchema: Codable { + public var index: Int? + + public var title: String? + + public var description: String? + + public var children: [ChildrenSchema]? + + public var id: String? + + public var slug: String? + + public var application: String? + + public var iconUrl: String? + + public var customJson: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case index + + case title + + case description + + case children + + case id = "_id" + + case slug + + case application + + case iconUrl = "icon_url" + + case customJson = "_custom_json" + } + + public init(application: String?, children: [ChildrenSchema]?, description: String?, iconUrl: String?, index: Int?, slug: String?, title: String?, customJson: [String: Any]?, id: String?) { + self.index = index + + self.title = title + + self.description = description + + self.children = children + + self.id = id + + self.slug = slug + + self.application = application + + self.iconUrl = iconUrl + + self.customJson = customJson + } + + public func duplicate() -> FAQCategorySchema { + let dict = self.dictionary! + let copy = FAQCategorySchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + index = try container.decode(Int.self, forKey: .index) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + children = try container.decode([ChildrenSchema].self, forKey: .children) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + iconUrl = try container.decode(String.self, forKey: .iconUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(index, forKey: .index) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(children, forKey: .children) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(iconUrl, forKey: .iconUrl) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + } + } + + /* + Model: FaqSchema + Used By: Content + */ + class FaqSchema: Codable { + public var slug: String? + + public var application: String? + + public var id: String? + + public var question: String? + + public var answer: String? + + public enum CodingKeys: String, CodingKey { + case slug + + case application + + case id = "_id" + + case question + + case answer + } + + public init(answer: String?, application: String?, question: String?, slug: String?, id: String?) { + self.slug = slug + + self.application = application + + self.id = id + + self.question = question + + self.answer = answer + } + + public func duplicate() -> FaqSchema { + let dict = self.dictionary! + let copy = FaqSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + question = try container.decode(String.self, forKey: .question) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + answer = try container.decode(String.self, forKey: .answer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(question, forKey: .question) + + try? container.encodeIfPresent(answer, forKey: .answer) + } + } + + /* + Model: FAQ + Used By: Content + */ + class FAQ: Codable { + public var slug: String? + + public var question: String? + + public var answer: String? + + public enum CodingKeys: String, CodingKey { + case slug + + case question + + case answer + } + + public init(answer: String?, question: String?, slug: String?) { + self.slug = slug + + self.question = question + + self.answer = answer + } + + public func duplicate() -> FAQ { + let dict = self.dictionary! + let copy = FAQ(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + question = try container.decode(String.self, forKey: .question) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + answer = try container.decode(String.self, forKey: .answer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(question, forKey: .question) + + try? container.encodeIfPresent(answer, forKey: .answer) + } + } + + /* + Model: CreateFaqResponseSchema + Used By: Content + */ + class CreateFaqResponseSchema: Codable { + public var faq: FaqSchema? + + public enum CodingKeys: String, CodingKey { + case faq + } + + public init(faq: FaqSchema?) { + self.faq = faq + } + + public func duplicate() -> CreateFaqResponseSchema { + let dict = self.dictionary! + let copy = CreateFaqResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + faq = try container.decode(FaqSchema.self, forKey: .faq) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(faq, forKey: .faq) + } + } + + /* + Model: CreateFaqSchema + Used By: Content + */ + class CreateFaqSchema: Codable { + public var faq: FAQ? + + public enum CodingKeys: String, CodingKey { + case faq + } + + public init(faq: FAQ?) { + self.faq = faq + } + + public func duplicate() -> CreateFaqSchema { + let dict = self.dictionary! + let copy = CreateFaqSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + faq = try container.decode(FAQ.self, forKey: .faq) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(faq, forKey: .faq) + } + } + + /* + Model: GetFaqSchema + Used By: Content + */ + class GetFaqSchema: Codable { + public var faqs: [FaqSchema]? + + public enum CodingKeys: String, CodingKey { + case faqs + } + + public init(faqs: [FaqSchema]?) { + self.faqs = faqs + } + + public func duplicate() -> GetFaqSchema { + let dict = self.dictionary! + let copy = GetFaqSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + faqs = try container.decode([FaqSchema].self, forKey: .faqs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(faqs, forKey: .faqs) + } + } + + /* + Model: UpdateFaqCategoryRequestSchema + Used By: Content + */ + class UpdateFaqCategoryRequestSchema: Codable { + public var category: CategorySchema? + + public enum CodingKeys: String, CodingKey { + case category + } + + public init(category: CategorySchema?) { + self.category = category + } + + public func duplicate() -> UpdateFaqCategoryRequestSchema { + let dict = self.dictionary! + let copy = UpdateFaqCategoryRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + category = try container.decode(CategorySchema.self, forKey: .category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(category, forKey: .category) + } + } + + /* + Model: CreateFaqCategoryRequestSchema + Used By: Content + */ + class CreateFaqCategoryRequestSchema: Codable { + public var category: CategoryRequestSchema? + + public enum CodingKeys: String, CodingKey { + case category + } + + public init(category: CategoryRequestSchema?) { + self.category = category + } + + public func duplicate() -> CreateFaqCategoryRequestSchema { + let dict = self.dictionary! + let copy = CreateFaqCategoryRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + category = try container.decode(CategoryRequestSchema.self, forKey: .category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(category, forKey: .category) + } + } + + /* + Model: CreateFaqCategorySchema + Used By: Content + */ + class CreateFaqCategorySchema: Codable { + public var category: CategorySchema? + + public enum CodingKeys: String, CodingKey { + case category + } + + public init(category: CategorySchema?) { + self.category = category + } + + public func duplicate() -> CreateFaqCategorySchema { + let dict = self.dictionary! + let copy = CreateFaqCategorySchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + category = try container.decode(CategorySchema.self, forKey: .category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(category, forKey: .category) + } + } + + /* + Model: GetFaqCategoriesSchema + Used By: Content + */ + class GetFaqCategoriesSchema: Codable { + public var categories: [CategorySchema]? + + public enum CodingKeys: String, CodingKey { + case categories + } + + public init(categories: [CategorySchema]?) { + self.categories = categories + } + + public func duplicate() -> GetFaqCategoriesSchema { + let dict = self.dictionary! + let copy = GetFaqCategoriesSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + categories = try container.decode([CategorySchema].self, forKey: .categories) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(categories, forKey: .categories) + } + } + + /* + Model: GetFaqCategoryBySlugSchema + Used By: Content + */ + class GetFaqCategoryBySlugSchema: Codable { + public var category: FAQCategorySchema? + + public enum CodingKeys: String, CodingKey { + case category + } + + public init(category: FAQCategorySchema?) { + self.category = category + } + + public func duplicate() -> GetFaqCategoryBySlugSchema { + let dict = self.dictionary! + let copy = GetFaqCategoryBySlugSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + category = try container.decode(FAQCategorySchema.self, forKey: .category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(category, forKey: .category) + } + } + + /* + Model: LandingPageGetResponse + Used By: Content + */ + class LandingPageGetResponse: Codable { + public var items: [LandingPageSchema]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [LandingPageSchema]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> LandingPageGetResponse { + let dict = self.dictionary! + let copy = LandingPageGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([LandingPageSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: LandingPageSchema + Used By: Content + */ + class LandingPageSchema: Codable { + public var slug: String? + + public var action: Action? + + public var platform: [String]? + + public var createdBy: CreatedBySchema? + + public var dateMeta: DateMeta? + + public var id: String? + + public var application: String? + + public var archived: Bool? + + public var customJson: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case slug + + case action + + case platform + + case createdBy = "created_by" + + case dateMeta = "date_meta" + + case id = "_id" + + case application + + case archived + + case customJson = "_custom_json" + } + + public init(action: Action?, application: String?, archived: Bool?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, platform: [String]?, slug: String?, customJson: [String: Any]?, id: String?) { + self.slug = slug + + self.action = action + + self.platform = platform + + self.createdBy = createdBy + + self.dateMeta = dateMeta + + self.id = id + + self.application = application + + self.archived = archived + + self.customJson = customJson + } + + public func duplicate() -> LandingPageSchema { + let dict = self.dictionary! + let copy = LandingPageSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(Action.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode([String].self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archived = try container.decode(Bool.self, forKey: .archived) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(platform, forKey: .platform) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(archived, forKey: .archived) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + } + } + + /* + Model: DefaultNavigationResponse + Used By: Content + */ + class DefaultNavigationResponse: Codable { + public var items: [NavigationSchema]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [NavigationSchema]?) { + self.items = items + } + + public func duplicate() -> DefaultNavigationResponse { + let dict = self.dictionary! + let copy = DefaultNavigationResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([NavigationSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: NavigationGetResponse + Used By: Content + */ + class NavigationGetResponse: Codable { + public var items: [NavigationSchema]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [NavigationSchema]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> NavigationGetResponse { + let dict = self.dictionary! + let copy = NavigationGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([NavigationSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: Orientation + Used By: Content + */ + class Orientation: Codable { + public var portrait: [String]? + + public var landscape: [String]? + + public enum CodingKeys: String, CodingKey { + case portrait + + case landscape + } + + public init(landscape: [String]?, portrait: [String]?) { + self.portrait = portrait + + self.landscape = landscape + } + + public func duplicate() -> Orientation { + let dict = self.dictionary! + let copy = Orientation(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + portrait = try container.decode([String].self, forKey: .portrait) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + landscape = try container.decode([String].self, forKey: .landscape) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(portrait, forKey: .portrait) + + try? container.encodeIfPresent(landscape, forKey: .landscape) + } + } + + /* + Model: NavigationSchema + Used By: Content + */ + class NavigationSchema: Codable { + public var id: String? + + public var application: String? + + public var archived: Bool? + + public var name: String? + + public var slug: String? + + public var platform: [String]? + + public var createdBy: CreatedBySchema? + + public var dateMeta: DateMeta? + + public var orientation: Orientation? + + public var version: Double? + + public var navigation: [NavigationReference]? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case application + + case archived + + case name + + case slug + + case platform + + case createdBy = "created_by" + + case dateMeta = "date_meta" + + case orientation + + case version + + case navigation + } + + public init(application: String?, archived: Bool?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, name: String?, navigation: [NavigationReference]?, orientation: Orientation?, platform: [String]?, slug: String?, version: Double?, id: String?) { + self.id = id + + self.application = application + + self.archived = archived + + self.name = name + + self.slug = slug + + self.platform = platform + + self.createdBy = createdBy + + self.dateMeta = dateMeta + + self.orientation = orientation + + self.version = version + + self.navigation = navigation + } + + public func duplicate() -> NavigationSchema { + let dict = self.dictionary! + let copy = NavigationSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archived = try container.decode(Bool.self, forKey: .archived) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode([String].self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orientation = try container.decode(Orientation.self, forKey: .orientation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + version = try container.decode(Double.self, forKey: .version) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + navigation = try container.decode([NavigationReference].self, forKey: .navigation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(archived, forKey: .archived) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(platform, forKey: .platform) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(orientation, forKey: .orientation) + + try? container.encodeIfPresent(version, forKey: .version) + + try? container.encodeIfPresent(navigation, forKey: .navigation) + } + } + + /* + Model: NavigationRequest + Used By: Content + */ + class NavigationRequest: Codable { + public var name: String? + + public var slug: String? + + public var platform: [String]? + + public var orientation: Orientation? + + public var navigation: [NavigationReference]? + + public enum CodingKeys: String, CodingKey { + case name + + case slug + + case platform + + case orientation + + case navigation + } + + public init(name: String?, navigation: [NavigationReference]?, orientation: Orientation?, platform: [String]?, slug: String?) { + self.name = name + + self.slug = slug + + self.platform = platform + + self.orientation = orientation + + self.navigation = navigation + } + + public func duplicate() -> NavigationRequest { + let dict = self.dictionary! + let copy = NavigationRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode([String].self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orientation = try container.decode(Orientation.self, forKey: .orientation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + navigation = try container.decode([NavigationReference].self, forKey: .navigation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(platform, forKey: .platform) + + try? container.encodeIfPresent(orientation, forKey: .orientation) + + try? container.encodeIfPresent(navigation, forKey: .navigation) + } + } + + /* + Model: CustomPageSchema + Used By: Content + */ + class CustomPageSchema: Codable { + public var id: String? + + public var platform: String? + + public var title: String? + + public var slug: String? + + public var type: String? + + public var orientation: String? + + public var application: String? + + public var description: String? + + public var published: Bool? + + public var tags: [String]? + + public var content: [[String: Any]]? + + public var createdBy: CreatedBySchema? + + public var dateMeta: DateMeta? + + public var schedule: ScheduleSchema? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case platform + + case title + + case slug + + case type + + case orientation + + case application + + case description + + case published + + case tags + + case content + + case createdBy = "created_by" + + case dateMeta = "date_meta" + + case schedule = "_schedule" + } + + public init(application: String?, content: [[String: Any]]?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, description: String?, orientation: String?, platform: String?, published: Bool?, slug: String?, tags: [String]?, title: String?, type: String?, id: String?, schedule: ScheduleSchema?) { + self.id = id + + self.platform = platform + + self.title = title + + self.slug = slug + + self.type = type + + self.orientation = orientation + + self.application = application + + self.description = description + + self.published = published + + self.tags = tags + + self.content = content + + self.createdBy = createdBy + + self.dateMeta = dateMeta + + self.schedule = schedule + } + + public func duplicate() -> CustomPageSchema { + let dict = self.dictionary! + let copy = CustomPageSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode(String.self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orientation = try container.decode(String.self, forKey: .orientation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode([[String: Any]].self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode(ScheduleSchema.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(platform, forKey: .platform) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(orientation, forKey: .orientation) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + } + } + + /* + Model: ContentSchema + Used By: Content + */ + class ContentSchema: Codable { + public var type: String? + + public var value: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case type + + case value + } + + public init(type: String?, value: [String: Any]?) { + self.type = type + + self.value = value + } + + public func duplicate() -> ContentSchema { + let dict = self.dictionary! + let copy = ContentSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode([String: Any].self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: CustomPage + Used By: Content + */ + class CustomPage: Codable { + public var data: CustomPageSchema? + + public enum CodingKeys: String, CodingKey { + case data + } + + public init(data: CustomPageSchema?) { + self.data = data + } + + public func duplicate() -> CustomPage { + let dict = self.dictionary! + let copy = CustomPage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode(CustomPageSchema.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: FeatureImage + Used By: Content + */ + class FeatureImage: Codable { + public var secureUrl: String? + + public enum CodingKeys: String, CodingKey { + case secureUrl = "secure_url" + } + + public init(secureUrl: String?) { + self.secureUrl = secureUrl + } + + public func duplicate() -> FeatureImage { + let dict = self.dictionary! + let copy = FeatureImage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + secureUrl = try container.decode(String.self, forKey: .secureUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) + } + } + + /* + Model: PageGetResponse + Used By: Content + */ + class PageGetResponse: Codable { + public var items: [PageSchema]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [PageSchema]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> PageGetResponse { + let dict = self.dictionary! + let copy = PageGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([PageSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: PageSpec + Used By: Content + */ + class PageSpec: Codable { + public var specifications: [PageSpecItem]? + + public enum CodingKeys: String, CodingKey { + case specifications + } + + public init(specifications: [PageSpecItem]?) { + self.specifications = specifications + } + + public func duplicate() -> PageSpec { + let dict = self.dictionary! + let copy = PageSpec(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + specifications = try container.decode([PageSpecItem].self, forKey: .specifications) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(specifications, forKey: .specifications) + } + } + + /* + Model: PageSpecParam + Used By: Content + */ + class PageSpecParam: Codable { + public var key: String? + + public var required: Bool? + + public enum CodingKeys: String, CodingKey { + case key + + case required + } + + public init(key: String?, required: Bool?) { + self.key = key + + self.required = required + } + + public func duplicate() -> PageSpecParam { + let dict = self.dictionary! + let copy = PageSpecParam(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + required = try container.decode(Bool.self, forKey: .required) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(required, forKey: .required) + } + } + + /* + Model: PageSpecItem + Used By: Content + */ + class PageSpecItem: Codable { + public var pageType: String? + + public var displayName: String? + + public var params: [PageSpecParam]? + + public var query: [PageSpecParam]? + + public enum CodingKeys: String, CodingKey { + case pageType = "page_type" + + case displayName = "display_name" + + case params + + case query + } + + public init(displayName: String?, pageType: String?, params: [PageSpecParam]?, query: [PageSpecParam]?) { + self.pageType = pageType + + self.displayName = displayName + + self.params = params + + self.query = query + } + + public func duplicate() -> PageSpecItem { + let dict = self.dictionary! + let copy = PageSpecItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + pageType = try container.decode(String.self, forKey: .pageType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + params = try container.decode([PageSpecParam].self, forKey: .params) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode([PageSpecParam].self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pageType, forKey: .pageType) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(params, forKey: .params) + + try? container.encodeIfPresent(query, forKey: .query) + } + } + + /* + Model: PageSchema + Used By: Content + */ + class PageSchema: Codable { + public var id: String? + + public var application: String? + + public var componentIds: [String]? + + public var content: [[String: Any]]? + + public var contentPath: String? + + public var createdBy: CreatedBySchema? + + public var dateMeta: DateMeta? + + public var description: String? + + public var featureImage: Asset? + + public var pageMeta: [[String: Any]]? + + public var schedule: ScheduleSchema? + + public var customJson: [String: Any]? + + public var orientation: String? + + public var platform: String? + + public var published: Bool? + + public var slug: String? + + public var tags: [String]? + + public var title: String? + + public var type: String? + + public var seo: SEO? + + public var visibility: [String: Any]? + + public var archived: Bool? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case application + + case componentIds = "component_ids" + + case content + + case contentPath = "content_path" + + case createdBy = "created_by" + + case dateMeta = "date_meta" + + case description + + case featureImage = "feature_image" + + case pageMeta = "page_meta" + + case schedule = "_schedule" + + case customJson = "_custom_json" + + case orientation + + case platform + + case published + + case slug + + case tags + + case title + + case type + + case seo + + case visibility + + case archived + } + + public init(application: String?, archived: Bool?, componentIds: [String]?, content: [[String: Any]]?, contentPath: String?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, description: String?, featureImage: Asset?, orientation: String?, pageMeta: [[String: Any]]?, platform: String?, published: Bool?, seo: SEO?, slug: String?, tags: [String]?, title: String?, type: String?, visibility: [String: Any]?, customJson: [String: Any]?, id: String?, schedule: ScheduleSchema?) { + self.id = id + + self.application = application + + self.componentIds = componentIds + + self.content = content + + self.contentPath = contentPath + + self.createdBy = createdBy + + self.dateMeta = dateMeta + + self.description = description + + self.featureImage = featureImage + + self.pageMeta = pageMeta + + self.schedule = schedule + + self.customJson = customJson + + self.orientation = orientation + + self.platform = platform + + self.published = published + + self.slug = slug + + self.tags = tags + + self.title = title + + self.type = type + + self.seo = seo + + self.visibility = visibility + + self.archived = archived + } + + public func duplicate() -> PageSchema { + let dict = self.dictionary! + let copy = PageSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + componentIds = try container.decode([String].self, forKey: .componentIds) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode([[String: Any]].self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contentPath = try container.decode(String.self, forKey: .contentPath) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + featureImage = try container.decode(Asset.self, forKey: .featureImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pageMeta = try container.decode([[String: Any]].self, forKey: .pageMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode(ScheduleSchema.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orientation = try container.decode(String.self, forKey: .orientation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode(String.self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + seo = try container.decode(SEO.self, forKey: .seo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + visibility = try container.decode([String: Any].self, forKey: .visibility) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archived = try container.decode(Bool.self, forKey: .archived) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(componentIds, forKey: .componentIds) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(contentPath, forKey: .contentPath) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(featureImage, forKey: .featureImage) + + try? container.encodeIfPresent(pageMeta, forKey: .pageMeta) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(orientation, forKey: .orientation) + + try? container.encodeIfPresent(platform, forKey: .platform) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(seo, forKey: .seo) + + try? container.encodeIfPresent(visibility, forKey: .visibility) + + try? container.encodeIfPresent(archived, forKey: .archived) + } + } + + /* + Model: CreatedBySchema + Used By: Content + */ + class CreatedBySchema: Codable { + public var id: String? + + public enum CodingKeys: String, CodingKey { + case id + } + + public init(id: String?) { + self.id = id + } + + public func duplicate() -> CreatedBySchema { + let dict = self.dictionary! + let copy = CreatedBySchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: PageContent + Used By: Content + */ + class PageContent: Codable { + public var type: String? + + public var value: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case type + + case value + } + + public init(type: String?, value: [String: Any]?) { + self.type = type + + self.value = value + } + + public func duplicate() -> PageContent { + let dict = self.dictionary! + let copy = PageContent(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode([String: Any].self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: PageMeta + Used By: Content + */ + class PageMeta: Codable { + public var key: String? + + public var value: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case key + + case value + } + + public init(key: String?, value: [String: Any]?) { + self.key = key + + self.value = value + } + + public func duplicate() -> PageMeta { + let dict = self.dictionary! + let copy = PageMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode([String: Any].self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: PageRequest + Used By: Content + */ + class PageRequest: Codable { + public var schedule: CronSchedule? + + public var application: String? + + public var author: Author? + + public var customJson: [String: Any]? + + public var orientation: String? + + public var content: [[String: Any]]? + + public var featureImage: Asset? + + public var published: Bool? + + public var readingTime: String? + + public var slug: String? + + public var tags: [String]? + + public var seo: SEO? + + public var title: String? + + public enum CodingKeys: String, CodingKey { + case schedule = "_schedule" + + case application + + case author + + case customJson = "_custom_json" + + case orientation + + case content + + case featureImage = "feature_image" + + case published + + case readingTime = "reading_time" + + case slug + + case tags + + case seo + + case title + } + + public init(application: String?, author: Author?, content: [[String: Any]]?, featureImage: Asset?, orientation: String?, published: Bool?, readingTime: String?, seo: SEO?, slug: String?, tags: [String]?, title: String?, customJson: [String: Any]?, schedule: CronSchedule?) { + self.schedule = schedule + + self.application = application + + self.author = author + + self.customJson = customJson + + self.orientation = orientation + + self.content = content + + self.featureImage = featureImage + + self.published = published + + self.readingTime = readingTime + + self.slug = slug + + self.tags = tags + + self.seo = seo + + self.title = title + } + + public func duplicate() -> PageRequest { + let dict = self.dictionary! + let copy = PageRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + schedule = try container.decode(CronSchedule.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + author = try container.decode(Author.self, forKey: .author) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orientation = try container.decode(String.self, forKey: .orientation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode([[String: Any]].self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + featureImage = try container.decode(Asset.self, forKey: .featureImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + readingTime = try container.decode(String.self, forKey: .readingTime) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + seo = try container.decode(SEO.self, forKey: .seo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(author, forKey: .author) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(orientation, forKey: .orientation) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(featureImage, forKey: .featureImage) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(readingTime, forKey: .readingTime) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(seo, forKey: .seo) + + try? container.encodeIfPresent(title, forKey: .title) + } + } + + /* + Model: CronSchedule + Used By: Content + */ + class CronSchedule: Codable { + public var cron: String? + + public var start: String? + + public var end: String? + + public var duration: Double? + + public enum CodingKeys: String, CodingKey { + case cron + + case start + + case end + + case duration + } + + public init(cron: String?, duration: Double?, end: String?, start: String?) { + self.cron = cron + + self.start = start + + self.end = end + + self.duration = duration + } + + public func duplicate() -> CronSchedule { + let dict = self.dictionary! + let copy = CronSchedule(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + cron = try container.decode(String.self, forKey: .cron) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + start = try container.decode(String.self, forKey: .start) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + end = try container.decode(String.self, forKey: .end) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + duration = try container.decode(Double.self, forKey: .duration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(cron, forKey: .cron) + + try? container.encodeIfPresent(start, forKey: .start) + + try? container.encodeIfPresent(end, forKey: .end) + + try? container.encodeIfPresent(duration, forKey: .duration) + } + } + + /* + Model: PagePublishRequest + Used By: Content + */ + class PagePublishRequest: Codable { + public var publish: Bool? + + public enum CodingKeys: String, CodingKey { + case publish + } + + public init(publish: Bool?) { + self.publish = publish + } + + public func duplicate() -> PagePublishRequest { + let dict = self.dictionary! + let copy = PagePublishRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + publish = try container.decode(Bool.self, forKey: .publish) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(publish, forKey: .publish) + } + } + + /* + Model: PageMetaSchema + Used By: Content + */ + class PageMetaSchema: Codable { + public var systemPages: [NavigationSchema]? + + public var customPages: [PageSchema]? + + public var applicationId: String? + + public enum CodingKeys: String, CodingKey { + case systemPages = "system_pages" + + case customPages = "custom_pages" + + case applicationId = "application_id" + } + + public init(applicationId: String?, customPages: [PageSchema]?, systemPages: [NavigationSchema]?) { + self.systemPages = systemPages + + self.customPages = customPages + + self.applicationId = applicationId + } + + public func duplicate() -> PageMetaSchema { + let dict = self.dictionary! + let copy = PageMetaSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + systemPages = try container.decode([NavigationSchema].self, forKey: .systemPages) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customPages = try container.decode([PageSchema].self, forKey: .customPages) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + applicationId = try container.decode(String.self, forKey: .applicationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(systemPages, forKey: .systemPages) + + try? container.encodeIfPresent(customPages, forKey: .customPages) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + } + } + + /* + Model: SlideshowGetResponse + Used By: Content + */ + class SlideshowGetResponse: Codable { + public var items: [SlideshowSchema]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [SlideshowSchema]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> SlideshowGetResponse { + let dict = self.dictionary! + let copy = SlideshowGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([SlideshowSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: SlideshowSchema + Used By: Content + */ + class SlideshowSchema: Codable { + public var id: String? + + public var slug: String? + + public var dateMeta: DateMeta? + + public var application: String? + + public var platform: String? + + public var configuration: ConfigurationSchema? + + public var media: [SlideshowMedia]? + + public var active: Bool? + + public var archived: Bool? + + public var customJson: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case slug + + case dateMeta = "date_meta" + + case application + + case platform + + case configuration + + case media + + case active + + case archived + + case customJson = "_custom_json" + } + + public init(active: Bool?, application: String?, archived: Bool?, configuration: ConfigurationSchema?, dateMeta: DateMeta?, media: [SlideshowMedia]?, platform: String?, slug: String?, customJson: [String: Any]?, id: String?) { + self.id = id + + self.slug = slug + + self.dateMeta = dateMeta + + self.application = application + + self.platform = platform + + self.configuration = configuration + + self.media = media + + self.active = active + + self.archived = archived + + self.customJson = customJson + } + + public func duplicate() -> SlideshowSchema { + let dict = self.dictionary! + let copy = SlideshowSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode(String.self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + configuration = try container.decode(ConfigurationSchema.self, forKey: .configuration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + media = try container.decode([SlideshowMedia].self, forKey: .media) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archived = try container.decode(Bool.self, forKey: .archived) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(platform, forKey: .platform) + + try? container.encodeIfPresent(configuration, forKey: .configuration) + + try? container.encodeIfPresent(media, forKey: .media) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(archived, forKey: .archived) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + } + } + + /* + Model: SlideshowRequest + Used By: Content + */ + class SlideshowRequest: Codable { + public var slug: String? + + public var platform: String? + + public var configuration: ConfigurationSchema? + + public var media: SlideshowMedia? + + public var active: Bool? + + public enum CodingKeys: String, CodingKey { + case slug + + case platform + + case configuration + + case media + + case active + } + + public init(active: Bool?, configuration: ConfigurationSchema?, media: SlideshowMedia?, platform: String?, slug: String?) { + self.slug = slug + + self.platform = platform + + self.configuration = configuration + + self.media = media + + self.active = active + } + + public func duplicate() -> SlideshowRequest { + let dict = self.dictionary! + let copy = SlideshowRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode(String.self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + configuration = try container.decode(ConfigurationSchema.self, forKey: .configuration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + media = try container.decode(SlideshowMedia.self, forKey: .media) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(platform, forKey: .platform) + + try? container.encodeIfPresent(configuration, forKey: .configuration) + + try? container.encodeIfPresent(media, forKey: .media) + + try? container.encodeIfPresent(active, forKey: .active) + } + } + + /* + Model: Support + Used By: Content + */ + class Support: Codable { + public var created: Bool? + + public var id: String? + + public var configType: String? + + public var application: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var contact: ContactSchema? + + public enum CodingKeys: String, CodingKey { + case created + + case id = "_id" + + case configType = "config_type" + + case application + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case contact + } + + public init(application: String?, configType: String?, contact: ContactSchema?, created: Bool?, createdAt: String?, updatedAt: String?, id: String?) { + self.created = created + + self.id = id + + self.configType = configType + + self.application = application + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.contact = contact + } + + public func duplicate() -> Support { + let dict = self.dictionary! + let copy = Support(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + created = try container.decode(Bool.self, forKey: .created) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + configType = try container.decode(String.self, forKey: .configType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contact = try container.decode(ContactSchema.self, forKey: .contact) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(created, forKey: .created) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(configType, forKey: .configType) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(contact, forKey: .contact) + } + } + + /* + Model: PhoneProperties + Used By: Content + */ + class PhoneProperties: Codable { + public var key: String? + + public var code: String? + + public var number: String? + + public enum CodingKeys: String, CodingKey { + case key + + case code + + case number + } + + public init(code: String?, key: String?, number: String?) { + self.key = key + + self.code = code + + self.number = number + } + + public func duplicate() -> PhoneProperties { + let dict = self.dictionary! + let copy = PhoneProperties(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + number = try container.decode(String.self, forKey: .number) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(number, forKey: .number) + } + } + + /* + Model: PhoneSchema + Used By: Content + */ + class PhoneSchema: Codable { + public var active: Bool? + + public var phone: [PhoneProperties]? + + public enum CodingKeys: String, CodingKey { + case active + + case phone + } + + public init(active: Bool?, phone: [PhoneProperties]?) { + self.active = active + + self.phone = phone + } + + public func duplicate() -> PhoneSchema { + let dict = self.dictionary! + let copy = PhoneSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode([PhoneProperties].self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(phone, forKey: .phone) + } + } + + /* + Model: EmailProperties + Used By: Content + */ + class EmailProperties: Codable { + public var key: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case key + + case value + } + + public init(key: String?, value: String?) { + self.key = key + + self.value = value + } + + public func duplicate() -> EmailProperties { + let dict = self.dictionary! + let copy = EmailProperties(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: EmailSchema + Used By: Content + */ + class EmailSchema: Codable { + public var active: Bool? + + public var email: [EmailProperties]? + + public enum CodingKeys: String, CodingKey { + case active + + case email + } + + public init(active: Bool?, email: [EmailProperties]?) { + self.active = active + + self.email = email + } + + public func duplicate() -> EmailSchema { + let dict = self.dictionary! + let copy = EmailSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode([EmailProperties].self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(email, forKey: .email) + } + } + + /* + Model: ContactSchema + Used By: Content + */ + class ContactSchema: Codable { + public var phone: PhoneSchema? + + public var email: EmailSchema? + + public enum CodingKeys: String, CodingKey { + case phone + + case email + } + + public init(email: EmailSchema?, phone: PhoneSchema?) { + self.phone = phone + + self.email = email + } + + public func duplicate() -> ContactSchema { + let dict = self.dictionary! + let copy = ContactSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + phone = try container.decode(PhoneSchema.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(EmailSchema.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(email, forKey: .email) + } + } + + /* + Model: TagsSchema + Used By: Content + */ + class TagsSchema: Codable { + public var application: String? + + public var id: String? + + public var tags: [TagSchema]? + + public enum CodingKeys: String, CodingKey { + case application + + case id = "_id" + + case tags + } + + public init(application: String?, tags: [TagSchema]?, id: String?) { + self.application = application + + self.id = id + + self.tags = tags + } + + public func duplicate() -> TagsSchema { + let dict = self.dictionary! + let copy = TagsSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([TagSchema].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: TagSchema + Used By: Content + */ + class TagSchema: Codable { + public var name: String? + + public var url: String? + + public var type: String? + + public var subType: String? + + public var id: String? + + public var position: String? + + public var attributes: [String: Any]? + + public var content: String? + + public var source: TagSourceSchema? + + public enum CodingKeys: String, CodingKey { + case name + + case url + + case type + + case subType = "sub_type" + + case id = "_id" + + case position + + case attributes + + case content + + case source = "__source" + } + + public init(attributes: [String: Any]?, content: String?, name: String?, position: String?, subType: String?, type: String?, url: String?, id: String?, source: TagSourceSchema?) { + self.name = name + + self.url = url + + self.type = type + + self.subType = subType + + self.id = id + + self.position = position + + self.attributes = attributes + + self.content = content + + self.source = source + } + + public func duplicate() -> TagSchema { + let dict = self.dictionary! + let copy = TagSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subType = try container.decode(String.self, forKey: .subType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + position = try container.decode(String.self, forKey: .position) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributes = try container.decode([String: Any].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode(String.self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + source = try container.decode(TagSourceSchema.self, forKey: .source) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(subType, forKey: .subType) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(position, forKey: .position) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(source, forKey: .source) + } + } + + /* + Model: TagSourceSchema + Used By: Content + */ + class TagSourceSchema: Codable { + public var type: String? + + public var id: String? + + public enum CodingKeys: String, CodingKey { + case type + + case id + } + + public init(id: String?, type: String?) { + self.type = type + + self.id = id + } + + public func duplicate() -> TagSourceSchema { + let dict = self.dictionary! + let copy = TagSourceSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(id, forKey: .id) + } + } +} diff --git a/Sources/code/application/models/FeedbackAppModelClass.swift b/Sources/code/application/models/FeedbackAppModelClass.swift new file mode 100644 index 0000000000..ae07a7044a --- /dev/null +++ b/Sources/code/application/models/FeedbackAppModelClass.swift @@ -0,0 +1,6764 @@ +import Foundation + +import Foundation +public extension ApplicationClient { + /* + Model: AbuseReport + Used By: Feedback + */ + class AbuseReport: Codable { + public var abused: Bool? + + public var dateMeta: DateMeta? + + public var description: String? + + public var entity: Entity? + + public var id: String? + + public var name: String? + + public var state: FeedbackState? + + public var tags: [TagMeta]? + + public enum CodingKeys: String, CodingKey { + case abused + + case dateMeta = "date_meta" + + case description + + case entity + + case id + + case name + + case state + + case tags + } + + public init(abused: Bool?, dateMeta: DateMeta?, description: String?, entity: Entity?, id: String?, name: String?, state: FeedbackState?, tags: [TagMeta]?) { + self.abused = abused + + self.dateMeta = dateMeta + + self.description = description + + self.entity = entity + + self.id = id + + self.name = name + + self.state = state + + self.tags = tags + } + + public func duplicate() -> AbuseReport { + let dict = self.dictionary! + let copy = AbuseReport(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + abused = try container.decode(Bool.self, forKey: .abused) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entity = try container.decode(Entity.self, forKey: .entity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(FeedbackState.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([TagMeta].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(abused, forKey: .abused) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(entity, forKey: .entity) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: Access + Used By: Feedback + */ + class Access: Codable { + public var answer: Bool? + + public var askQuestion: Bool? + + public var comment: Bool? + + public var rnr: Bool? + + public enum CodingKeys: String, CodingKey { + case answer + + case askQuestion = "ask_question" + + case comment + + case rnr + } + + public init(answer: Bool?, askQuestion: Bool?, comment: Bool?, rnr: Bool?) { + self.answer = answer + + self.askQuestion = askQuestion + + self.comment = comment + + self.rnr = rnr + } + + public func duplicate() -> Access { + let dict = self.dictionary! + let copy = Access(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + answer = try container.decode(Bool.self, forKey: .answer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + askQuestion = try container.decode(Bool.self, forKey: .askQuestion) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + comment = try container.decode(Bool.self, forKey: .comment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rnr = try container.decode(Bool.self, forKey: .rnr) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(answer, forKey: .answer) + + try? container.encodeIfPresent(askQuestion, forKey: .askQuestion) + + try? container.encodeIfPresent(comment, forKey: .comment) + + try? container.encodeIfPresent(rnr, forKey: .rnr) + } + } + + /* + Model: AddMediaListRequest + Used By: Feedback + */ + class AddMediaListRequest: Codable { + public var entityId: String? + + public var entityType: String? + + public var mediaList: [AddMediaRequest]? + + public var refId: String? + + public var refType: String? + + public enum CodingKeys: String, CodingKey { + case entityId = "entity_id" + + case entityType = "entity_type" + + case mediaList = "media_list" + + case refId = "ref_id" + + case refType = "ref_type" + } + + public init(entityId: String?, entityType: String?, mediaList: [AddMediaRequest]?, refId: String?, refType: String?) { + self.entityId = entityId + + self.entityType = entityType + + self.mediaList = mediaList + + self.refId = refId + + self.refType = refType + } + + public func duplicate() -> AddMediaListRequest { + let dict = self.dictionary! + let copy = AddMediaListRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + entityId = try container.decode(String.self, forKey: .entityId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entityType = try container.decode(String.self, forKey: .entityType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mediaList = try container.decode([AddMediaRequest].self, forKey: .mediaList) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refId = try container.decode(String.self, forKey: .refId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refType = try container.decode(String.self, forKey: .refType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(entityId, forKey: .entityId) + + try? container.encodeIfPresent(entityType, forKey: .entityType) + + try? container.encodeIfPresent(mediaList, forKey: .mediaList) + + try? container.encodeIfPresent(refId, forKey: .refId) + + try? container.encodeIfPresent(refType, forKey: .refType) + } + } + + /* + Model: AddMediaRequest + Used By: Feedback + */ + class AddMediaRequest: Codable { + public var cloudId: String? + + public var cloudName: String? + + public var cloudProvider: String? + + public var entityId: String? + + public var entityType: String? + + public var mediaUrl: String? + + public var refId: String? + + public var refType: String? + + public var tags: [String]? + + public var thumbnailUrl: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case cloudId = "cloud_id" + + case cloudName = "cloud_name" + + case cloudProvider = "cloud_provider" + + case entityId = "entity_id" + + case entityType = "entity_type" + + case mediaUrl = "media_url" + + case refId = "ref_id" + + case refType = "ref_type" + + case tags + + case thumbnailUrl = "thumbnail_url" + + case type + } + + public init(cloudId: String?, cloudName: String?, cloudProvider: String?, entityId: String?, entityType: String?, mediaUrl: String?, refId: String?, refType: String?, tags: [String]?, thumbnailUrl: String?, type: String?) { + self.cloudId = cloudId + + self.cloudName = cloudName + + self.cloudProvider = cloudProvider + + self.entityId = entityId + + self.entityType = entityType + + self.mediaUrl = mediaUrl + + self.refId = refId + + self.refType = refType + + self.tags = tags + + self.thumbnailUrl = thumbnailUrl + + self.type = type + } + + public func duplicate() -> AddMediaRequest { + let dict = self.dictionary! + let copy = AddMediaRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + cloudId = try container.decode(String.self, forKey: .cloudId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cloudName = try container.decode(String.self, forKey: .cloudName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cloudProvider = try container.decode(String.self, forKey: .cloudProvider) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entityId = try container.decode(String.self, forKey: .entityId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entityType = try container.decode(String.self, forKey: .entityType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mediaUrl = try container.decode(String.self, forKey: .mediaUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refId = try container.decode(String.self, forKey: .refId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refType = try container.decode(String.self, forKey: .refType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + thumbnailUrl = try container.decode(String.self, forKey: .thumbnailUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(cloudId, forKey: .cloudId) + + try? container.encodeIfPresent(cloudName, forKey: .cloudName) + + try? container.encodeIfPresent(cloudProvider, forKey: .cloudProvider) + + try? container.encodeIfPresent(entityId, forKey: .entityId) + + try? container.encodeIfPresent(entityType, forKey: .entityType) + + try? container.encodeIfPresent(mediaUrl, forKey: .mediaUrl) + + try? container.encodeIfPresent(refId, forKey: .refId) + + try? container.encodeIfPresent(refType, forKey: .refType) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(thumbnailUrl, forKey: .thumbnailUrl) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: ApplicationSchema + Used By: Feedback + */ + class ApplicationSchema: Codable { + public var id: String? + + public enum CodingKeys: String, CodingKey { + case id + } + + public init(id: String?) { + self.id = id + } + + public func duplicate() -> ApplicationSchema { + let dict = self.dictionary! + let copy = ApplicationSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: Attribute + Used By: Feedback + */ + class Attribute: Codable { + public var dateMeta: DateMeta? + + public var description: String? + + public var id: String? + + public var name: String? + + public var slug: String? + + public var tags: [TagMeta]? + + public enum CodingKeys: String, CodingKey { + case dateMeta = "date_meta" + + case description + + case id + + case name + + case slug + + case tags + } + + public init(dateMeta: DateMeta?, description: String?, id: String?, name: String?, slug: String?, tags: [TagMeta]?) { + self.dateMeta = dateMeta + + self.description = description + + self.id = id + + self.name = name + + self.slug = slug + + self.tags = tags + } + + public func duplicate() -> Attribute { + let dict = self.dictionary! + let copy = Attribute(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([TagMeta].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: AttributeObject + Used By: Feedback + */ + class AttributeObject: Codable { + public var description: String? + + public var name: String + + public var slug: String? + + public var title: String? + + public var type: String + + public var value: Double + + public enum CodingKeys: String, CodingKey { + case description + + case name + + case slug + + case title + + case type + + case value + } + + public init(description: String?, name: String, slug: String?, title: String?, type: String, value: Double) { + self.description = description + + self.name = name + + self.slug = slug + + self.title = title + + self.type = type + + self.value = value + } + + public func duplicate() -> AttributeObject { + let dict = self.dictionary! + let copy = AttributeObject(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + name = try container.decode(String.self, forKey: .name) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + type = try container.decode(String.self, forKey: .type) + + value = try container.decode(Double.self, forKey: .value) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: AttributeResponse + Used By: Feedback + */ + class AttributeResponse: Codable { + public var items: [Attribute]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [Attribute]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> AttributeResponse { + let dict = self.dictionary! + let copy = AttributeResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Attribute].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: AutoDetectors + Used By: Feedback + */ + class AutoDetectors: Codable { + public var textDetector: [TextDetector]? + + public enum CodingKeys: String, CodingKey { + case textDetector = "text_detector" + } + + public init(textDetector: [TextDetector]?) { + self.textDetector = textDetector + } + + public func duplicate() -> AutoDetectors { + let dict = self.dictionary! + let copy = AutoDetectors(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + textDetector = try container.decode([TextDetector].self, forKey: .textDetector) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(textDetector, forKey: .textDetector) + } + } + + /* + Model: CheckEligibilityResponse + Used By: Feedback + */ + class CheckEligibilityResponse: Codable { + public var access: Access? + + public enum CodingKeys: String, CodingKey { + case access + } + + public init(access: Access?) { + self.access = access + } + + public func duplicate() -> CheckEligibilityResponse { + let dict = self.dictionary! + let copy = CheckEligibilityResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + access = try container.decode(Access.self, forKey: .access) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(access, forKey: .access) + } + } + + /* + Model: Cloud + Used By: Feedback + */ + class Cloud: Codable { + public var id: String? + + public var name: String? + + public var provider: String? + + public enum CodingKeys: String, CodingKey { + case id + + case name + + case provider + } + + public init(id: String?, name: String?, provider: String?) { + self.id = id + + self.name = name + + self.provider = provider + } + + public func duplicate() -> Cloud { + let dict = self.dictionary! + let copy = Cloud(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + provider = try container.decode(String.self, forKey: .provider) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(provider, forKey: .provider) + } + } + + /* + Model: Comment + Used By: Feedback + */ + class Comment: Codable { + public var comment: [String]? + + public var dateMeta: DateMeta? + + public var entity: Entity? + + public var id: String? + + public var name: String? + + public var state: FeedbackState? + + public var tags: [TagMeta]? + + public var voteCount: VoteCount? + + public enum CodingKeys: String, CodingKey { + case comment + + case dateMeta = "date_meta" + + case entity + + case id + + case name + + case state + + case tags + + case voteCount = "vote_count" + } + + public init(comment: [String]?, dateMeta: DateMeta?, entity: Entity?, id: String?, name: String?, state: FeedbackState?, tags: [TagMeta]?, voteCount: VoteCount?) { + self.comment = comment + + self.dateMeta = dateMeta + + self.entity = entity + + self.id = id + + self.name = name + + self.state = state + + self.tags = tags + + self.voteCount = voteCount + } + + public func duplicate() -> Comment { + let dict = self.dictionary! + let copy = Comment(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + comment = try container.decode([String].self, forKey: .comment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entity = try container.decode(Entity.self, forKey: .entity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(FeedbackState.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([TagMeta].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + voteCount = try container.decode(VoteCount.self, forKey: .voteCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(comment, forKey: .comment) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(entity, forKey: .entity) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(voteCount, forKey: .voteCount) + } + } + + /* + Model: CommentGetResponse + Used By: Feedback + */ + class CommentGetResponse: Codable { + public var items: [Comment]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [Comment]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> CommentGetResponse { + let dict = self.dictionary! + let copy = CommentGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Comment].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: CommentRequest + Used By: Feedback + */ + class CommentRequest: Codable { + public var comment: [String] + + public var entityId: String + + public var entityType: String + + public enum CodingKeys: String, CodingKey { + case comment + + case entityId = "entity_id" + + case entityType = "entity_type" + } + + public init(comment: [String], entityId: String, entityType: String) { + self.comment = comment + + self.entityId = entityId + + self.entityType = entityType + } + + public func duplicate() -> CommentRequest { + let dict = self.dictionary! + let copy = CommentRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + comment = try container.decode([String].self, forKey: .comment) + + entityId = try container.decode(String.self, forKey: .entityId) + + entityType = try container.decode(String.self, forKey: .entityType) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(comment, forKey: .comment) + + try? container.encodeIfPresent(entityId, forKey: .entityId) + + try? container.encodeIfPresent(entityType, forKey: .entityType) + } + } + + /* + Model: CreateQNARequest + Used By: Feedback + */ + class CreateQNARequest: Codable { + public var choices: [String]? + + public var entityId: String + + public var entityType: String + + public var maxLen: Int? + + public var sortPriority: Int? + + public var tags: [String]? + + public var text: String + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case choices + + case entityId = "entity_id" + + case entityType = "entity_type" + + case maxLen = "max_len" + + case sortPriority = "sort_priority" + + case tags + + case text + + case type + } + + public init(choices: [String]?, entityId: String, entityType: String, maxLen: Int?, sortPriority: Int?, tags: [String]?, text: String, type: String?) { + self.choices = choices + + self.entityId = entityId + + self.entityType = entityType + + self.maxLen = maxLen + + self.sortPriority = sortPriority + + self.tags = tags + + self.text = text + + self.type = type + } + + public func duplicate() -> CreateQNARequest { + let dict = self.dictionary! + let copy = CreateQNARequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + choices = try container.decode([String].self, forKey: .choices) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + entityId = try container.decode(String.self, forKey: .entityId) + + entityType = try container.decode(String.self, forKey: .entityType) + + do { + maxLen = try container.decode(Int.self, forKey: .maxLen) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sortPriority = try container.decode(Int.self, forKey: .sortPriority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + text = try container.decode(String.self, forKey: .text) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(choices, forKey: .choices) + + try? container.encodeIfPresent(entityId, forKey: .entityId) + + try? container.encodeIfPresent(entityType, forKey: .entityType) + + try? container.encodeIfPresent(maxLen, forKey: .maxLen) + + try? container.encodeIfPresent(sortPriority, forKey: .sortPriority) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: CreatedBy + Used By: Feedback + */ + class CreatedBy: Codable { + public var id: String? + + public var name: String? + + public var tags: [TagMeta]? + + public enum CodingKeys: String, CodingKey { + case id + + case name + + case tags + } + + public init(id: String?, name: String?, tags: [TagMeta]?) { + self.id = id + + self.name = name + + self.tags = tags + } + + public func duplicate() -> CreatedBy { + let dict = self.dictionary! + let copy = CreatedBy(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([TagMeta].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: CursorGetResponse + Used By: Feedback + */ + class CursorGetResponse: Codable { + public var items: [[String: Any]]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [[String: Any]]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> CursorGetResponse { + let dict = self.dictionary! + let copy = CursorGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([[String: Any]].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: CustomerReview + Used By: Feedback + */ + class CustomerReview: Codable { + public var autoDetectors: AutoDetectors? + + public var createdOn: String? + + public var deviceMeta: DeviceMeta? + + public var entity: ProductEntity? + + public var id: String? + + public var locationMeta: LocationMeta? + + public var modifiedOn: String? + + public var name: String? + + public var rating: ReviewRating? + + public var review: Review? + + public var slug: String? + + public var state: State? + + public var tags: [TagMeta]? + + public var template: Template? + + public var voteCount: VoteCount? + + public enum CodingKeys: String, CodingKey { + case autoDetectors = "auto_detectors" + + case createdOn = "created_on" + + case deviceMeta = "device_meta" + + case entity + + case id + + case locationMeta = "location_meta" + + case modifiedOn = "modified_on" + + case name + + case rating + + case review + + case slug + + case state + + case tags + + case template + + case voteCount = "vote_count" + } + + public init(autoDetectors: AutoDetectors?, createdOn: String?, deviceMeta: DeviceMeta?, entity: ProductEntity?, id: String?, locationMeta: LocationMeta?, modifiedOn: String?, name: String?, rating: ReviewRating?, review: Review?, slug: String?, state: State?, tags: [TagMeta]?, template: Template?, voteCount: VoteCount?) { + self.autoDetectors = autoDetectors + + self.createdOn = createdOn + + self.deviceMeta = deviceMeta + + self.entity = entity + + self.id = id + + self.locationMeta = locationMeta + + self.modifiedOn = modifiedOn + + self.name = name + + self.rating = rating + + self.review = review + + self.slug = slug + + self.state = state + + self.tags = tags + + self.template = template + + self.voteCount = voteCount + } + + public func duplicate() -> CustomerReview { + let dict = self.dictionary! + let copy = CustomerReview(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + autoDetectors = try container.decode(AutoDetectors.self, forKey: .autoDetectors) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deviceMeta = try container.decode(DeviceMeta.self, forKey: .deviceMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entity = try container.decode(ProductEntity.self, forKey: .entity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + locationMeta = try container.decode(LocationMeta.self, forKey: .locationMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rating = try container.decode(ReviewRating.self, forKey: .rating) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + review = try container.decode(Review.self, forKey: .review) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(State.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([TagMeta].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + template = try container.decode(Template.self, forKey: .template) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + voteCount = try container.decode(VoteCount.self, forKey: .voteCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(autoDetectors, forKey: .autoDetectors) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(deviceMeta, forKey: .deviceMeta) + + try? container.encodeIfPresent(entity, forKey: .entity) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(locationMeta, forKey: .locationMeta) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(rating, forKey: .rating) + + try? container.encodeIfPresent(review, forKey: .review) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(template, forKey: .template) + + try? container.encodeIfPresent(voteCount, forKey: .voteCount) + } + } + + /* + Model: DeviceMeta + Used By: Feedback + */ + class DeviceMeta: Codable { + public var appVersion: String? + + public var platform: String? + + public enum CodingKeys: String, CodingKey { + case appVersion = "app_version" + + case platform + } + + public init(appVersion: String?, platform: String?) { + self.appVersion = appVersion + + self.platform = platform + } + + public func duplicate() -> DeviceMeta { + let dict = self.dictionary! + let copy = DeviceMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + appVersion = try container.decode(String.self, forKey: .appVersion) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode(String.self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appVersion, forKey: .appVersion) + + try? container.encodeIfPresent(platform, forKey: .platform) + } + } + + /* + Model: Entity + Used By: Feedback + */ + class Entity: Codable { + public var id: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case id + + case type + } + + public init(id: String?, type: String?) { + self.id = id + + self.type = type + } + + public func duplicate() -> Entity { + let dict = self.dictionary! + let copy = Entity(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: EntityMeta + Used By: Feedback + */ + class EntityMeta: Codable { + public var orderId: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case orderId = "order_id" + + case type + } + + public init(orderId: String?, type: String?) { + self.orderId = orderId + + self.type = type + } + + public func duplicate() -> EntityMeta { + let dict = self.dictionary! + let copy = EntityMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + orderId = try container.decode(String.self, forKey: .orderId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: FeedbackError + Used By: Feedback + */ + class FeedbackError: Codable { + public var code: String? + + public var exception: String? + + public var info: String? + + public var message: String? + + public var meta: [String: Any]? + + public var requestId: String? + + public var stackTrace: String? + + public var status: Int? + + public enum CodingKeys: String, CodingKey { + case code + + case exception + + case info + + case message + + case meta + + case requestId = "request_id" + + case stackTrace = "stack_trace" + + case status + } + + public init(code: String?, exception: String?, info: String?, message: String?, meta: [String: Any]?, requestId: String?, stackTrace: String?, status: Int?) { + self.code = code + + self.exception = exception + + self.info = info + + self.message = message + + self.meta = meta + + self.requestId = requestId + + self.stackTrace = stackTrace + + self.status = status + } + + public func duplicate() -> FeedbackError { + let dict = self.dictionary! + let copy = FeedbackError(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + exception = try container.decode(String.self, forKey: .exception) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + info = try container.decode(String.self, forKey: .info) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stackTrace = try container.decode(String.self, forKey: .stackTrace) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Int.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(exception, forKey: .exception) + + try? container.encodeIfPresent(info, forKey: .info) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(stackTrace, forKey: .stackTrace) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: FeedbackMedia + Used By: Feedback + */ + class FeedbackMedia: Codable { + public var application: ApplicationSchema? + + public var cloud: Cloud? + + public var createdBy: CreatedBy? + + public var dateMeta: DateMeta? + + public var description: String? + + public var entity: Entity? + + public var id: String? + + public var name: String? + + public var reference: Entity? + + public var state: MediaState? + + public var tags: [TagMeta]? + + public var type: String? + + public var url: Url? + + public enum CodingKeys: String, CodingKey { + case application + + case cloud + + case createdBy = "created_by" + + case dateMeta = "date_meta" + + case description + + case entity + + case id + + case name + + case reference + + case state + + case tags + + case type + + case url + } + + public init(application: ApplicationSchema?, cloud: Cloud?, createdBy: CreatedBy?, dateMeta: DateMeta?, description: String?, entity: Entity?, id: String?, name: String?, reference: Entity?, state: MediaState?, tags: [TagMeta]?, type: String?, url: Url?) { + self.application = application + + self.cloud = cloud + + self.createdBy = createdBy + + self.dateMeta = dateMeta + + self.description = description + + self.entity = entity + + self.id = id + + self.name = name + + self.reference = reference + + self.state = state + + self.tags = tags + + self.type = type + + self.url = url + } + + public func duplicate() -> FeedbackMedia { + let dict = self.dictionary! + let copy = FeedbackMedia(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(ApplicationSchema.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cloud = try container.decode(Cloud.self, forKey: .cloud) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(CreatedBy.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entity = try container.decode(Entity.self, forKey: .entity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + reference = try container.decode(Entity.self, forKey: .reference) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(MediaState.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([TagMeta].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(Url.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(cloud, forKey: .cloud) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(entity, forKey: .entity) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(reference, forKey: .reference) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(url, forKey: .url) + } + } + + /* + Model: FeedbackState + Used By: Feedback + */ + class FeedbackState: Codable { + public var active: Bool? + + public var archive: Bool? + + public var media: String? + + public var qna: Bool? + + public var rating: Bool? + + public var review: Bool? + + public enum CodingKeys: String, CodingKey { + case active + + case archive + + case media + + case qna + + case rating + + case review + } + + public init(active: Bool?, archive: Bool?, media: String?, qna: Bool?, rating: Bool?, review: Bool?) { + self.active = active + + self.archive = archive + + self.media = media + + self.qna = qna + + self.rating = rating + + self.review = review + } + + public func duplicate() -> FeedbackState { + let dict = self.dictionary! + let copy = FeedbackState(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archive = try container.decode(Bool.self, forKey: .archive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + media = try container.decode(String.self, forKey: .media) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + qna = try container.decode(Bool.self, forKey: .qna) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rating = try container.decode(Bool.self, forKey: .rating) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + review = try container.decode(Bool.self, forKey: .review) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(archive, forKey: .archive) + + try? container.encodeIfPresent(media, forKey: .media) + + try? container.encodeIfPresent(qna, forKey: .qna) + + try? container.encodeIfPresent(rating, forKey: .rating) + + try? container.encodeIfPresent(review, forKey: .review) + } + } + + /* + Model: GeoLoc + Used By: Feedback + */ + class GeoLoc: Codable { + public var latitude: String? + + public var longitude: String? + + public enum CodingKeys: String, CodingKey { + case latitude + + case longitude + } + + public init(latitude: String?, longitude: String?) { + self.latitude = latitude + + self.longitude = longitude + } + + public func duplicate() -> GeoLoc { + let dict = self.dictionary! + let copy = GeoLoc(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + latitude = try container.decode(String.self, forKey: .latitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + longitude = try container.decode(String.self, forKey: .longitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(latitude, forKey: .latitude) + + try? container.encodeIfPresent(longitude, forKey: .longitude) + } + } + + /* + Model: InsertResponse + Used By: Feedback + */ + class InsertResponse: Codable { + public var ids: String? + + public enum CodingKeys: String, CodingKey { + case ids + } + + public init(ids: String?) { + self.ids = ids + } + + public func duplicate() -> InsertResponse { + let dict = self.dictionary! + let copy = InsertResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + ids = try container.decode(String.self, forKey: .ids) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(ids, forKey: .ids) + } + } + + /* + Model: Location + Used By: Feedback + */ + class Location: Codable { + public var countryCode: String? + + public var flagUrl: String? + + public var geoLoc: GeoLoc? + + public var name: String? + + public var pincode: String? + + public enum CodingKeys: String, CodingKey { + case countryCode = "country_code" + + case flagUrl = "flag_url" + + case geoLoc = "geo_loc" + + case name + + case pincode + } + + public init(countryCode: String?, flagUrl: String?, geoLoc: GeoLoc?, name: String?, pincode: String?) { + self.countryCode = countryCode + + self.flagUrl = flagUrl + + self.geoLoc = geoLoc + + self.name = name + + self.pincode = pincode + } + + public func duplicate() -> Location { + let dict = self.dictionary! + let copy = Location(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + flagUrl = try container.decode(String.self, forKey: .flagUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + geoLoc = try container.decode(GeoLoc.self, forKey: .geoLoc) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(String.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(flagUrl, forKey: .flagUrl) + + try? container.encodeIfPresent(geoLoc, forKey: .geoLoc) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + } + } + + /* + Model: LocationMeta + Used By: Feedback + */ + class LocationMeta: Codable { + public var demand: Location? + + public var supply: Location? + + public enum CodingKeys: String, CodingKey { + case demand + + case supply + } + + public init(demand: Location?, supply: Location?) { + self.demand = demand + + self.supply = supply + } + + public func duplicate() -> LocationMeta { + let dict = self.dictionary! + let copy = LocationMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + demand = try container.decode(Location.self, forKey: .demand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + supply = try container.decode(Location.self, forKey: .supply) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(demand, forKey: .demand) + + try? container.encodeIfPresent(supply, forKey: .supply) + } + } + + /* + Model: MediaGetResponse + Used By: Feedback + */ + class MediaGetResponse: Codable { + public var items: [FeedbackMedia]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [FeedbackMedia]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> MediaGetResponse { + let dict = self.dictionary! + let copy = MediaGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([FeedbackMedia].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: MediaMeta + Used By: Feedback + */ + class MediaMeta: Codable { + public var cloud: Cloud? + + public var comment: [String]? + + public var description: String? + + public var id: String? + + public var type: String? + + public var url: Url? + + public enum CodingKeys: String, CodingKey { + case cloud + + case comment + + case description + + case id + + case type + + case url + } + + public init(cloud: Cloud?, comment: [String]?, description: String?, id: String?, type: String?, url: Url?) { + self.cloud = cloud + + self.comment = comment + + self.description = description + + self.id = id + + self.type = type + + self.url = url + } + + public func duplicate() -> MediaMeta { + let dict = self.dictionary! + let copy = MediaMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + cloud = try container.decode(Cloud.self, forKey: .cloud) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + comment = try container.decode([String].self, forKey: .comment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(Url.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(cloud, forKey: .cloud) + + try? container.encodeIfPresent(comment, forKey: .comment) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(url, forKey: .url) + } + } + + /* + Model: MediaState + Used By: Feedback + */ + class MediaState: Codable { + public var approve: Bool? + + public var archive: Bool? + + public enum CodingKeys: String, CodingKey { + case approve + + case archive + } + + public init(approve: Bool?, archive: Bool?) { + self.approve = approve + + self.archive = archive + } + + public func duplicate() -> MediaState { + let dict = self.dictionary! + let copy = MediaState(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + approve = try container.decode(Bool.self, forKey: .approve) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archive = try container.decode(Bool.self, forKey: .archive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(approve, forKey: .approve) + + try? container.encodeIfPresent(archive, forKey: .archive) + } + } + + /* + Model: NumberGetResponse + Used By: Feedback + */ + class NumberGetResponse: Codable { + public var items: [[String: Any]]? + + public var page: PageNumber? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [[String: Any]]?, page: PageNumber?) { + self.items = items + + self.page = page + } + + public func duplicate() -> NumberGetResponse { + let dict = self.dictionary! + let copy = NumberGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([[String: Any]].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(PageNumber.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: PageNumber + Used By: Feedback + */ + class PageNumber: Codable { + public var current: Int? + + public var hasNext: Bool? + + public var itemTotal: Int? + + public var size: Int? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case current + + case hasNext = "has_next" + + case itemTotal = "item_total" + + case size + + case type + } + + public init(current: Int?, hasNext: Bool?, itemTotal: Int?, size: Int?, type: String?) { + self.current = current + + self.hasNext = hasNext + + self.itemTotal = itemTotal + + self.size = size + + self.type = type + } + + public func duplicate() -> PageNumber { + let dict = self.dictionary! + let copy = PageNumber(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + current = try container.decode(Int.self, forKey: .current) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasNext = try container.decode(Bool.self, forKey: .hasNext) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemTotal = try container.decode(Int.self, forKey: .itemTotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(Int.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(current, forKey: .current) + + try? container.encodeIfPresent(hasNext, forKey: .hasNext) + + try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: ProductEntity + Used By: Feedback + */ + class ProductEntity: Codable { + public var id: String? + + public var meta: EntityMeta? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case id + + case meta + + case type + } + + public init(id: String?, meta: EntityMeta?, type: String?) { + self.id = id + + self.meta = meta + + self.type = type + } + + public func duplicate() -> ProductEntity { + let dict = self.dictionary! + let copy = ProductEntity(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode(EntityMeta.self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: QNA + Used By: Feedback + */ + class QNA: Codable { + public var comments: [Comment]? + + public var dateMeta: DateMeta? + + public var entity: Entity? + + public var id: String? + + public var name: String? + + public var question: Question? + + public var state: QNAState? + + public var tag: [String]? + + public var tags: [TagMeta]? + + public enum CodingKeys: String, CodingKey { + case comments + + case dateMeta = "date_meta" + + case entity + + case id + + case name + + case question + + case state + + case tag + + case tags + } + + public init(comments: [Comment]?, dateMeta: DateMeta?, entity: Entity?, id: String?, name: String?, question: Question?, state: QNAState?, tag: [String]?, tags: [TagMeta]?) { + self.comments = comments + + self.dateMeta = dateMeta + + self.entity = entity + + self.id = id + + self.name = name + + self.question = question + + self.state = state + + self.tag = tag + + self.tags = tags + } + + public func duplicate() -> QNA { + let dict = self.dictionary! + let copy = QNA(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + comments = try container.decode([Comment].self, forKey: .comments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entity = try container.decode(Entity.self, forKey: .entity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + question = try container.decode(Question.self, forKey: .question) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(QNAState.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tag = try container.decode([String].self, forKey: .tag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([TagMeta].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(comments, forKey: .comments) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(entity, forKey: .entity) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(question, forKey: .question) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(tag, forKey: .tag) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: QNAGetResponse + Used By: Feedback + */ + class QNAGetResponse: Codable { + public var items: [QNA]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [QNA]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> QNAGetResponse { + let dict = self.dictionary! + let copy = QNAGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([QNA].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: QNAState + Used By: Feedback + */ + class QNAState: Codable { + public var active: Bool? + + public var approve: Bool? + + public var modify: Bool? + + public var priority: Int? + + public var reply: Bool? + + public var vote: Bool? + + public enum CodingKeys: String, CodingKey { + case active + + case approve + + case modify + + case priority + + case reply + + case vote + } + + public init(active: Bool?, approve: Bool?, modify: Bool?, priority: Int?, reply: Bool?, vote: Bool?) { + self.active = active + + self.approve = approve + + self.modify = modify + + self.priority = priority + + self.reply = reply + + self.vote = vote + } + + public func duplicate() -> QNAState { + let dict = self.dictionary! + let copy = QNAState(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + approve = try container.decode(Bool.self, forKey: .approve) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modify = try container.decode(Bool.self, forKey: .modify) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(Int.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + reply = try container.decode(Bool.self, forKey: .reply) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + vote = try container.decode(Bool.self, forKey: .vote) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(approve, forKey: .approve) + + try? container.encodeIfPresent(modify, forKey: .modify) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(reply, forKey: .reply) + + try? container.encodeIfPresent(vote, forKey: .vote) + } + } + + /* + Model: Question + Used By: Feedback + */ + class Question: Codable { + public var choices: [String]? + + public var maxLen: Int? + + public var text: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case choices + + case maxLen = "max_len" + + case text + + case type + } + + public init(choices: [String]?, maxLen: Int?, text: String?, type: String?) { + self.choices = choices + + self.maxLen = maxLen + + self.text = text + + self.type = type + } + + public func duplicate() -> Question { + let dict = self.dictionary! + let copy = Question(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + choices = try container.decode([String].self, forKey: .choices) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + maxLen = try container.decode(Int.self, forKey: .maxLen) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text = try container.decode(String.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(choices, forKey: .choices) + + try? container.encodeIfPresent(maxLen, forKey: .maxLen) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: Rating + Used By: Feedback + */ + class Rating: Codable { + public var attributes: [Attribute]? + + public var attributesSlugs: [String]? + + public var ui: UI? + + public enum CodingKeys: String, CodingKey { + case attributes + + case attributesSlugs = "attributes_slugs" + + case ui + } + + public init(attributes: [Attribute]?, attributesSlugs: [String]?, ui: UI?) { + self.attributes = attributes + + self.attributesSlugs = attributesSlugs + + self.ui = ui + } + + public func duplicate() -> Rating { + let dict = self.dictionary! + let copy = Rating(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + attributes = try container.decode([Attribute].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributesSlugs = try container.decode([String].self, forKey: .attributesSlugs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ui = try container.decode(UI.self, forKey: .ui) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + + try? container.encodeIfPresent(attributesSlugs, forKey: .attributesSlugs) + + try? container.encodeIfPresent(ui, forKey: .ui) + } + } + + /* + Model: RatingGetResponse + Used By: Feedback + */ + class RatingGetResponse: Codable { + public var items: [Rating]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [Rating]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> RatingGetResponse { + let dict = self.dictionary! + let copy = RatingGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Rating].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: RatingMetric + Used By: Feedback + */ + class RatingMetric: Codable { + public var avg: Double? + + public var count: Int? + + public var name: String? + + public var slug: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case avg + + case count + + case name + + case slug + + case type + } + + public init(avg: Double?, count: Int?, name: String?, slug: String?, type: String?) { + self.avg = avg + + self.count = count + + self.name = name + + self.slug = slug + + self.type = type + } + + public func duplicate() -> RatingMetric { + let dict = self.dictionary! + let copy = RatingMetric(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + avg = try container.decode(Double.self, forKey: .avg) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(avg, forKey: .avg) + + try? container.encodeIfPresent(count, forKey: .count) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: ReportAbuseGetResponse + Used By: Feedback + */ + class ReportAbuseGetResponse: Codable { + public var items: [AbuseReport]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [AbuseReport]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> ReportAbuseGetResponse { + let dict = self.dictionary! + let copy = ReportAbuseGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([AbuseReport].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: ReportAbuseRequest + Used By: Feedback + */ + class ReportAbuseRequest: Codable { + public var description: String? + + public var entityId: String + + public var entityType: String + + public enum CodingKeys: String, CodingKey { + case description + + case entityId = "entity_id" + + case entityType = "entity_type" + } + + public init(description: String?, entityId: String, entityType: String) { + self.description = description + + self.entityId = entityId + + self.entityType = entityType + } + + public func duplicate() -> ReportAbuseRequest { + let dict = self.dictionary! + let copy = ReportAbuseRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + entityId = try container.decode(String.self, forKey: .entityId) + + entityType = try container.decode(String.self, forKey: .entityType) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(entityId, forKey: .entityId) + + try? container.encodeIfPresent(entityType, forKey: .entityType) + } + } + + /* + Model: Review + Used By: Feedback + */ + class Review: Codable { + public var answerIds: [String]? + + public var comments: [String]? + + public var description: String? + + public var mediaMeta: [MediaMeta]? + + public var title: String? + + public enum CodingKeys: String, CodingKey { + case answerIds = "answer_ids" + + case comments + + case description + + case mediaMeta = "media_meta" + + case title + } + + public init(answerIds: [String]?, comments: [String]?, description: String?, mediaMeta: [MediaMeta]?, title: String?) { + self.answerIds = answerIds + + self.comments = comments + + self.description = description + + self.mediaMeta = mediaMeta + + self.title = title + } + + public func duplicate() -> Review { + let dict = self.dictionary! + let copy = Review(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + answerIds = try container.decode([String].self, forKey: .answerIds) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + comments = try container.decode([String].self, forKey: .comments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mediaMeta = try container.decode([MediaMeta].self, forKey: .mediaMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(answerIds, forKey: .answerIds) + + try? container.encodeIfPresent(comments, forKey: .comments) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(mediaMeta, forKey: .mediaMeta) + + try? container.encodeIfPresent(title, forKey: .title) + } + } + + /* + Model: ReviewFacet + Used By: Feedback + */ + class ReviewFacet: Codable { + public var display: String? + + public var name: String? + + public var selected: Bool? + + public var slug: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case display + + case name + + case selected + + case slug + + case type + } + + public init(display: String?, name: String?, selected: Bool?, slug: String?, type: String?) { + self.display = display + + self.name = name + + self.selected = selected + + self.slug = slug + + self.type = type + } + + public func duplicate() -> ReviewFacet { + let dict = self.dictionary! + let copy = ReviewFacet(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + selected = try container.decode(Bool.self, forKey: .selected) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(selected, forKey: .selected) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: ReviewGetResponse + Used By: Feedback + */ + class ReviewGetResponse: Codable { + public var facets: [ReviewFacet]? + + public var items: [CustomerReview]? + + public var page: Page? + + public var sort: [SortMethod]? + + public enum CodingKeys: String, CodingKey { + case facets + + case items + + case page + + case sort + } + + public init(facets: [ReviewFacet]?, items: [CustomerReview]?, page: Page?, sort: [SortMethod]?) { + self.facets = facets + + self.items = items + + self.page = page + + self.sort = sort + } + + public func duplicate() -> ReviewGetResponse { + let dict = self.dictionary! + let copy = ReviewGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + facets = try container.decode([ReviewFacet].self, forKey: .facets) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([CustomerReview].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sort = try container.decode([SortMethod].self, forKey: .sort) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(facets, forKey: .facets) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(sort, forKey: .sort) + } + } + + /* + Model: ReviewMediaMeta + Used By: Feedback + */ + class ReviewMediaMeta: Codable { + public var maxCount: Double? + + public var size: Double? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case maxCount = "max_count" + + case size + + case type + } + + public init(maxCount: Double?, size: Double?, type: String?) { + self.maxCount = maxCount + + self.size = size + + self.type = type + } + + public func duplicate() -> ReviewMediaMeta { + let dict = self.dictionary! + let copy = ReviewMediaMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + maxCount = try container.decode(Double.self, forKey: .maxCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(Double.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(maxCount, forKey: .maxCount) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: ReviewMetric + Used By: Feedback + */ + class ReviewMetric: Codable { + public var attributeMetric: [RatingMetric]? + + public var createdOn: String? + + public var entity: Entity? + + public var id: String? + + public var modifiedOn: String? + + public var ratingAvg: Double? + + public var ratingCount: Int? + + public var ratingMetric: [RatingMetric]? + + public var reviewCount: Int? + + public enum CodingKeys: String, CodingKey { + case attributeMetric = "attribute_metric" + + case createdOn = "created_on" + + case entity + + case id + + case modifiedOn = "modified_on" + + case ratingAvg = "rating_avg" + + case ratingCount = "rating_count" + + case ratingMetric = "rating_metric" + + case reviewCount = "review_count" + } + + public init(attributeMetric: [RatingMetric]?, createdOn: String?, entity: Entity?, id: String?, modifiedOn: String?, ratingAvg: Double?, ratingCount: Int?, ratingMetric: [RatingMetric]?, reviewCount: Int?) { + self.attributeMetric = attributeMetric + + self.createdOn = createdOn + + self.entity = entity + + self.id = id + + self.modifiedOn = modifiedOn + + self.ratingAvg = ratingAvg + + self.ratingCount = ratingCount + + self.ratingMetric = ratingMetric + + self.reviewCount = reviewCount + } + + public func duplicate() -> ReviewMetric { + let dict = self.dictionary! + let copy = ReviewMetric(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + attributeMetric = try container.decode([RatingMetric].self, forKey: .attributeMetric) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entity = try container.decode(Entity.self, forKey: .entity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ratingAvg = try container.decode(Double.self, forKey: .ratingAvg) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ratingCount = try container.decode(Int.self, forKey: .ratingCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ratingMetric = try container.decode([RatingMetric].self, forKey: .ratingMetric) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + reviewCount = try container.decode(Int.self, forKey: .reviewCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(attributeMetric, forKey: .attributeMetric) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(entity, forKey: .entity) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(ratingAvg, forKey: .ratingAvg) + + try? container.encodeIfPresent(ratingCount, forKey: .ratingCount) + + try? container.encodeIfPresent(ratingMetric, forKey: .ratingMetric) + + try? container.encodeIfPresent(reviewCount, forKey: .reviewCount) + } + } + + /* + Model: ReviewMetricGetResponse + Used By: Feedback + */ + class ReviewMetricGetResponse: Codable { + public var items: [ReviewMetric]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [ReviewMetric]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> ReviewMetricGetResponse { + let dict = self.dictionary! + let copy = ReviewMetricGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([ReviewMetric].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: ReviewRating + Used By: Feedback + */ + class ReviewRating: Codable { + public var attributes: [AttributeObject]? + + public var value: Double? + + public enum CodingKeys: String, CodingKey { + case attributes + + case value + } + + public init(attributes: [AttributeObject]?, value: Double?) { + self.attributes = attributes + + self.value = value + } + + public func duplicate() -> ReviewRating { + let dict = self.dictionary! + let copy = ReviewRating(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + attributes = try container.decode([AttributeObject].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(Double.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: SaveAttributeRequest + Used By: Feedback + */ + class SaveAttributeRequest: Codable { + public var description: String? + + public var name: String + + public var slug: String + + public enum CodingKeys: String, CodingKey { + case description + + case name + + case slug + } + + public init(description: String?, name: String, slug: String) { + self.description = description + + self.name = name + + self.slug = slug + } + + public func duplicate() -> SaveAttributeRequest { + let dict = self.dictionary! + let copy = SaveAttributeRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + name = try container.decode(String.self, forKey: .name) + + slug = try container.decode(String.self, forKey: .slug) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(slug, forKey: .slug) + } + } + + /* + Model: SortMethod + Used By: Feedback + */ + class SortMethod: Codable { + public var name: String? + + public var selected: Bool? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case name + + case selected + + case type + } + + public init(name: String?, selected: Bool?, type: String?) { + self.name = name + + self.selected = selected + + self.type = type + } + + public func duplicate() -> SortMethod { + let dict = self.dictionary! + let copy = SortMethod(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + selected = try container.decode(Bool.self, forKey: .selected) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(selected, forKey: .selected) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: State + Used By: Feedback + */ + class State: Codable { + public var active: Bool? + + public var approve: Bool? + + public var autoDecided: Bool? + + public var status: Int? + + public enum CodingKeys: String, CodingKey { + case active + + case approve + + case autoDecided = "auto_decided" + + case status + } + + public init(active: Bool?, approve: Bool?, autoDecided: Bool?, status: Int?) { + self.active = active + + self.approve = approve + + self.autoDecided = autoDecided + + self.status = status + } + + public func duplicate() -> State { + let dict = self.dictionary! + let copy = State(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + approve = try container.decode(Bool.self, forKey: .approve) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + autoDecided = try container.decode(Bool.self, forKey: .autoDecided) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Int.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(approve, forKey: .approve) + + try? container.encodeIfPresent(autoDecided, forKey: .autoDecided) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: TagMeta + Used By: Feedback + */ + class TagMeta: Codable { + public var media: [MediaMeta]? + + public var name: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case media + + case name + + case type + } + + public init(media: [MediaMeta]?, name: String?, type: String?) { + self.media = media + + self.name = name + + self.type = type + } + + public func duplicate() -> TagMeta { + let dict = self.dictionary! + let copy = TagMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + media = try container.decode([MediaMeta].self, forKey: .media) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(media, forKey: .media) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: Template + Used By: Feedback + */ + class Template: Codable { + public var dateMeta: DateMeta? + + public var entity: Entity? + + public var id: String? + + public var name: String? + + public var rating: Rating? + + public var review: TemplateReview? + + public var state: FeedbackState? + + public enum CodingKeys: String, CodingKey { + case dateMeta = "date_meta" + + case entity + + case id + + case name + + case rating + + case review + + case state + } + + public init(dateMeta: DateMeta?, entity: Entity?, id: String?, name: String?, rating: Rating?, review: TemplateReview?, state: FeedbackState?) { + self.dateMeta = dateMeta + + self.entity = entity + + self.id = id + + self.name = name + + self.rating = rating + + self.review = review + + self.state = state + } + + public func duplicate() -> Template { + let dict = self.dictionary! + let copy = Template(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entity = try container.decode(Entity.self, forKey: .entity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rating = try container.decode(Rating.self, forKey: .rating) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + review = try container.decode(TemplateReview.self, forKey: .review) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(FeedbackState.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(entity, forKey: .entity) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(rating, forKey: .rating) + + try? container.encodeIfPresent(review, forKey: .review) + + try? container.encodeIfPresent(state, forKey: .state) + } + } + + /* + Model: TemplateGetResponse + Used By: Feedback + */ + class TemplateGetResponse: Codable { + public var items: [Template]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [Template]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> TemplateGetResponse { + let dict = self.dictionary! + let copy = TemplateGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Template].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: TemplateReview + Used By: Feedback + */ + class TemplateReview: Codable { + public var description: String? + + public var header: String? + + public var imageMeta: ReviewMediaMeta? + + public var title: String? + + public var videoMeta: ReviewMediaMeta? + + public var voteAllowed: Bool? + + public enum CodingKeys: String, CodingKey { + case description + + case header + + case imageMeta = "image_meta" + + case title + + case videoMeta = "video_meta" + + case voteAllowed = "vote_allowed" + } + + public init(description: String?, header: String?, imageMeta: ReviewMediaMeta?, title: String?, videoMeta: ReviewMediaMeta?, voteAllowed: Bool?) { + self.description = description + + self.header = header + + self.imageMeta = imageMeta + + self.title = title + + self.videoMeta = videoMeta + + self.voteAllowed = voteAllowed + } + + public func duplicate() -> TemplateReview { + let dict = self.dictionary! + let copy = TemplateReview(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + header = try container.decode(String.self, forKey: .header) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + imageMeta = try container.decode(ReviewMediaMeta.self, forKey: .imageMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + videoMeta = try container.decode(ReviewMediaMeta.self, forKey: .videoMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + voteAllowed = try container.decode(Bool.self, forKey: .voteAllowed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(header, forKey: .header) + + try? container.encodeIfPresent(imageMeta, forKey: .imageMeta) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(videoMeta, forKey: .videoMeta) + + try? container.encodeIfPresent(voteAllowed, forKey: .voteAllowed) + } + } + + /* + Model: TextDetector + Used By: Feedback + */ + class TextDetector: Codable { + public var confidence: Double? + + public var text: String? + + public var textClass: String? + + public var textType: String? + + public enum CodingKeys: String, CodingKey { + case confidence + + case text + + case textClass = "text_class" + + case textType = "text_type" + } + + public init(confidence: Double?, text: String?, textClass: String?, textType: String?) { + self.confidence = confidence + + self.text = text + + self.textClass = textClass + + self.textType = textType + } + + public func duplicate() -> TextDetector { + let dict = self.dictionary! + let copy = TextDetector(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + confidence = try container.decode(Double.self, forKey: .confidence) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text = try container.decode(String.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + textClass = try container.decode(String.self, forKey: .textClass) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + textType = try container.decode(String.self, forKey: .textType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(confidence, forKey: .confidence) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(textClass, forKey: .textClass) + + try? container.encodeIfPresent(textType, forKey: .textType) + } + } + + /* + Model: UI + Used By: Feedback + */ + class UI: Codable { + public var feedbackQuestion: [String]? + + public var icon: UIIcon? + + public var text: [String]? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case feedbackQuestion = "feedback_question" + + case icon + + case text + + case type + } + + public init(feedbackQuestion: [String]?, icon: UIIcon?, text: [String]?, type: String?) { + self.feedbackQuestion = feedbackQuestion + + self.icon = icon + + self.text = text + + self.type = type + } + + public func duplicate() -> UI { + let dict = self.dictionary! + let copy = UI(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + feedbackQuestion = try container.decode([String].self, forKey: .feedbackQuestion) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(UIIcon.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text = try container.decode([String].self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(feedbackQuestion, forKey: .feedbackQuestion) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: UIIcon + Used By: Feedback + */ + class UIIcon: Codable { + public var active: String? + + public var inactive: String? + + public var selected: [String]? + + public enum CodingKeys: String, CodingKey { + case active + + case inactive + + case selected + } + + public init(active: String?, inactive: String?, selected: [String]?) { + self.active = active + + self.inactive = inactive + + self.selected = selected + } + + public func duplicate() -> UIIcon { + let dict = self.dictionary! + let copy = UIIcon(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(String.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + inactive = try container.decode(String.self, forKey: .inactive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + selected = try container.decode([String].self, forKey: .selected) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(inactive, forKey: .inactive) + + try? container.encodeIfPresent(selected, forKey: .selected) + } + } + + /* + Model: UpdateAbuseStatusRequest + Used By: Feedback + */ + class UpdateAbuseStatusRequest: Codable { + public var abusive: Bool? + + public var active: Bool? + + public var approve: Bool? + + public var description: String? + + public var entityId: String? + + public var entityType: String? + + public var id: String? + + public enum CodingKeys: String, CodingKey { + case abusive + + case active + + case approve + + case description + + case entityId = "entity_id" + + case entityType = "entity_type" + + case id + } + + public init(abusive: Bool?, active: Bool?, approve: Bool?, description: String?, entityId: String?, entityType: String?, id: String?) { + self.abusive = abusive + + self.active = active + + self.approve = approve + + self.description = description + + self.entityId = entityId + + self.entityType = entityType + + self.id = id + } + + public func duplicate() -> UpdateAbuseStatusRequest { + let dict = self.dictionary! + let copy = UpdateAbuseStatusRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + abusive = try container.decode(Bool.self, forKey: .abusive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + approve = try container.decode(Bool.self, forKey: .approve) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entityId = try container.decode(String.self, forKey: .entityId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entityType = try container.decode(String.self, forKey: .entityType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(abusive, forKey: .abusive) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(approve, forKey: .approve) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(entityId, forKey: .entityId) + + try? container.encodeIfPresent(entityType, forKey: .entityType) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: UpdateAttributeRequest + Used By: Feedback + */ + class UpdateAttributeRequest: Codable { + public var description: String? + + public var name: String + + public var slug: String? + + public enum CodingKeys: String, CodingKey { + case description + + case name + + case slug + } + + public init(description: String?, name: String, slug: String?) { + self.description = description + + self.name = name + + self.slug = slug + } + + public func duplicate() -> UpdateAttributeRequest { + let dict = self.dictionary! + let copy = UpdateAttributeRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + name = try container.decode(String.self, forKey: .name) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(slug, forKey: .slug) + } + } + + /* + Model: UpdateCommentRequest + Used By: Feedback + */ + class UpdateCommentRequest: Codable { + public var active: Bool? + + public var approve: Bool? + + public var comment: [String] + + public var id: String + + public enum CodingKeys: String, CodingKey { + case active + + case approve + + case comment + + case id + } + + public init(active: Bool?, approve: Bool?, comment: [String], id: String) { + self.active = active + + self.approve = approve + + self.comment = comment + + self.id = id + } + + public func duplicate() -> UpdateCommentRequest { + let dict = self.dictionary! + let copy = UpdateCommentRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + approve = try container.decode(Bool.self, forKey: .approve) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + comment = try container.decode([String].self, forKey: .comment) + + id = try container.decode(String.self, forKey: .id) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(approve, forKey: .approve) + + try? container.encodeIfPresent(comment, forKey: .comment) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: UpdateMediaListRequest + Used By: Feedback + */ + class UpdateMediaListRequest: Codable { + public var approve: Bool? + + public var archive: Bool? + + public var entityType: String? + + public var ids: [String]? + + public enum CodingKeys: String, CodingKey { + case approve + + case archive + + case entityType = "entity_type" + + case ids + } + + public init(approve: Bool?, archive: Bool?, entityType: String?, ids: [String]?) { + self.approve = approve + + self.archive = archive + + self.entityType = entityType + + self.ids = ids + } + + public func duplicate() -> UpdateMediaListRequest { + let dict = self.dictionary! + let copy = UpdateMediaListRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + approve = try container.decode(Bool.self, forKey: .approve) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archive = try container.decode(Bool.self, forKey: .archive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entityType = try container.decode(String.self, forKey: .entityType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ids = try container.decode([String].self, forKey: .ids) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(approve, forKey: .approve) + + try? container.encodeIfPresent(archive, forKey: .archive) + + try? container.encodeIfPresent(entityType, forKey: .entityType) + + try? container.encodeIfPresent(ids, forKey: .ids) + } + } + + /* + Model: UpdateQNARequest + Used By: Feedback + */ + class UpdateQNARequest: Codable { + public var active: Bool? + + public var approve: Bool? + + public var choices: [String]? + + public var id: String? + + public var tags: [String]? + + public enum CodingKeys: String, CodingKey { + case active + + case approve + + case choices + + case id + + case tags + } + + public init(active: Bool?, approve: Bool?, choices: [String]?, id: String?, tags: [String]?) { + self.active = active + + self.approve = approve + + self.choices = choices + + self.id = id + + self.tags = tags + } + + public func duplicate() -> UpdateQNARequest { + let dict = self.dictionary! + let copy = UpdateQNARequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + approve = try container.decode(Bool.self, forKey: .approve) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + choices = try container.decode([String].self, forKey: .choices) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(approve, forKey: .approve) + + try? container.encodeIfPresent(choices, forKey: .choices) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: UpdateResponse + Used By: Feedback + */ + class UpdateResponse: Codable { + public var id: String? + + public enum CodingKeys: String, CodingKey { + case id + } + + public init(id: String?) { + self.id = id + } + + public func duplicate() -> UpdateResponse { + let dict = self.dictionary! + let copy = UpdateResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: UpdateReviewRequest + Used By: Feedback + */ + class UpdateReviewRequest: Codable { + public var active: Bool? + + public var application: String? + + public var approve: Bool? + + public var archive: Bool? + + public var attributesRating: [AttributeObject]? + + public var description: String? + + public var deviceMeta: DeviceMeta? + + public var entityId: String? + + public var entityType: String? + + public var mediaResource: [MediaMeta]? + + public var rating: Double? + + public var reviewId: String? + + public var templateId: String? + + public var title: String? + + public enum CodingKeys: String, CodingKey { + case active + + case application + + case approve + + case archive + + case attributesRating = "attributes_rating" + + case description + + case deviceMeta = "device_meta" + + case entityId = "entity_id" + + case entityType = "entity_type" + + case mediaResource = "media_resource" + + case rating + + case reviewId = "review_id" + + case templateId = "template_id" + + case title + } + + public init(active: Bool?, application: String?, approve: Bool?, archive: Bool?, attributesRating: [AttributeObject]?, description: String?, deviceMeta: DeviceMeta?, entityId: String?, entityType: String?, mediaResource: [MediaMeta]?, rating: Double?, reviewId: String?, templateId: String?, title: String?) { + self.active = active + + self.application = application + + self.approve = approve + + self.archive = archive + + self.attributesRating = attributesRating + + self.description = description + + self.deviceMeta = deviceMeta + + self.entityId = entityId + + self.entityType = entityType + + self.mediaResource = mediaResource + + self.rating = rating + + self.reviewId = reviewId + + self.templateId = templateId + + self.title = title + } + + public func duplicate() -> UpdateReviewRequest { + let dict = self.dictionary! + let copy = UpdateReviewRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + approve = try container.decode(Bool.self, forKey: .approve) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archive = try container.decode(Bool.self, forKey: .archive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributesRating = try container.decode([AttributeObject].self, forKey: .attributesRating) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deviceMeta = try container.decode(DeviceMeta.self, forKey: .deviceMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entityId = try container.decode(String.self, forKey: .entityId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entityType = try container.decode(String.self, forKey: .entityType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mediaResource = try container.decode([MediaMeta].self, forKey: .mediaResource) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rating = try container.decode(Double.self, forKey: .rating) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + reviewId = try container.decode(String.self, forKey: .reviewId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + templateId = try container.decode(String.self, forKey: .templateId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(approve, forKey: .approve) + + try? container.encodeIfPresent(archive, forKey: .archive) + + try? container.encodeIfPresent(attributesRating, forKey: .attributesRating) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(deviceMeta, forKey: .deviceMeta) + + try? container.encodeIfPresent(entityId, forKey: .entityId) + + try? container.encodeIfPresent(entityType, forKey: .entityType) + + try? container.encodeIfPresent(mediaResource, forKey: .mediaResource) + + try? container.encodeIfPresent(rating, forKey: .rating) + + try? container.encodeIfPresent(reviewId, forKey: .reviewId) + + try? container.encodeIfPresent(templateId, forKey: .templateId) + + try? container.encodeIfPresent(title, forKey: .title) + } + } + + /* + Model: UpdateVoteRequest + Used By: Feedback + */ + class UpdateVoteRequest: Codable { + public var action: String? + + public var active: Bool? + + public var id: String? + + public var refId: String? + + public var refType: String? + + public enum CodingKeys: String, CodingKey { + case action + + case active + + case id + + case refId = "ref_id" + + case refType = "ref_type" + } + + public init(action: String?, active: Bool?, id: String?, refId: String?, refType: String?) { + self.action = action + + self.active = active + + self.id = id + + self.refId = refId + + self.refType = refType + } + + public func duplicate() -> UpdateVoteRequest { + let dict = self.dictionary! + let copy = UpdateVoteRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + action = try container.decode(String.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refId = try container.decode(String.self, forKey: .refId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refType = try container.decode(String.self, forKey: .refType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(refId, forKey: .refId) + + try? container.encodeIfPresent(refType, forKey: .refType) + } + } + + /* + Model: Url + Used By: Feedback + */ + class Url: Codable { + public var main: String? + + public var thumbnail: String? + + public enum CodingKeys: String, CodingKey { + case main + + case thumbnail + } + + public init(main: String?, thumbnail: String?) { + self.main = main + + self.thumbnail = thumbnail + } + + public func duplicate() -> Url { + let dict = self.dictionary! + let copy = Url(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + main = try container.decode(String.self, forKey: .main) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + thumbnail = try container.decode(String.self, forKey: .thumbnail) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(main, forKey: .main) + + try? container.encodeIfPresent(thumbnail, forKey: .thumbnail) + } + } + + /* + Model: Vote + Used By: Feedback + */ + class Vote: Codable { + public var action: String? + + public var dateMeta: DateMeta? + + public var entity: Entity? + + public var id: String? + + public var name: String? + + public var reference: Entity? + + public var state: FeedbackState? + + public var tags: [TagMeta]? + + public enum CodingKeys: String, CodingKey { + case action + + case dateMeta = "date_meta" + + case entity + + case id + + case name + + case reference + + case state + + case tags + } + + public init(action: String?, dateMeta: DateMeta?, entity: Entity?, id: String?, name: String?, reference: Entity?, state: FeedbackState?, tags: [TagMeta]?) { + self.action = action + + self.dateMeta = dateMeta + + self.entity = entity + + self.id = id + + self.name = name + + self.reference = reference + + self.state = state + + self.tags = tags + } + + public func duplicate() -> Vote { + let dict = self.dictionary! + let copy = Vote(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + action = try container.decode(String.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entity = try container.decode(Entity.self, forKey: .entity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + reference = try container.decode(Entity.self, forKey: .reference) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(FeedbackState.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([TagMeta].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(entity, forKey: .entity) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(reference, forKey: .reference) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: VoteCount + Used By: Feedback + */ + class VoteCount: Codable { + public var downvote: Int? + + public var upvote: Int? + + public enum CodingKeys: String, CodingKey { + case downvote + + case upvote + } + + public init(downvote: Int?, upvote: Int?) { + self.downvote = downvote + + self.upvote = upvote + } + + public func duplicate() -> VoteCount { + let dict = self.dictionary! + let copy = VoteCount(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + downvote = try container.decode(Int.self, forKey: .downvote) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + upvote = try container.decode(Int.self, forKey: .upvote) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(downvote, forKey: .downvote) + + try? container.encodeIfPresent(upvote, forKey: .upvote) + } + } + + /* + Model: VoteRequest + Used By: Feedback + */ + class VoteRequest: Codable { + public var action: String? + + public var entityId: String? + + public var entityType: String? + + public var refId: String? + + public var refType: String? + + public enum CodingKeys: String, CodingKey { + case action + + case entityId = "entity_id" + + case entityType = "entity_type" + + case refId = "ref_id" + + case refType = "ref_type" + } + + public init(action: String?, entityId: String?, entityType: String?, refId: String?, refType: String?) { + self.action = action + + self.entityId = entityId + + self.entityType = entityType + + self.refId = refId + + self.refType = refType + } + + public func duplicate() -> VoteRequest { + let dict = self.dictionary! + let copy = VoteRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + action = try container.decode(String.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entityId = try container.decode(String.self, forKey: .entityId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entityType = try container.decode(String.self, forKey: .entityType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refId = try container.decode(String.self, forKey: .refId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refType = try container.decode(String.self, forKey: .refType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(entityId, forKey: .entityId) + + try? container.encodeIfPresent(entityType, forKey: .entityType) + + try? container.encodeIfPresent(refId, forKey: .refId) + + try? container.encodeIfPresent(refType, forKey: .refType) + } + } + + /* + Model: VoteResponse + Used By: Feedback + */ + class VoteResponse: Codable { + public var items: [Vote]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [Vote]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> VoteResponse { + let dict = self.dictionary! + let copy = VoteResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Vote].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } +} diff --git a/Sources/code/application/models/FileStorageAppModelClass.swift b/Sources/code/application/models/FileStorageAppModelClass.swift new file mode 100644 index 0000000000..f252ca2c40 --- /dev/null +++ b/Sources/code/application/models/FileStorageAppModelClass.swift @@ -0,0 +1,1244 @@ +import Foundation + +import Foundation +public extension ApplicationClient { + /* + Model: FailedResponse + Used By: FileStorage + */ + class FailedResponse: Codable { + public var message: String + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String) { + self.message = message + } + + public func duplicate() -> FailedResponse { + let dict = self.dictionary! + let copy = FailedResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + message = try container.decode(String.self, forKey: .message) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: CDN + Used By: FileStorage + */ + class CDN: Codable { + public var url: String + + public enum CodingKeys: String, CodingKey { + case url + } + + public init(url: String) { + self.url = url + } + + public func duplicate() -> CDN { + let dict = self.dictionary! + let copy = CDN(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + url = try container.decode(String.self, forKey: .url) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(url, forKey: .url) + } + } + + /* + Model: Upload + Used By: FileStorage + */ + class Upload: Codable { + public var expiry: Int + + public var url: String + + public enum CodingKeys: String, CodingKey { + case expiry + + case url + } + + public init(expiry: Int, url: String) { + self.expiry = expiry + + self.url = url + } + + public func duplicate() -> Upload { + let dict = self.dictionary! + let copy = Upload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + expiry = try container.decode(Int.self, forKey: .expiry) + + url = try container.decode(String.self, forKey: .url) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(expiry, forKey: .expiry) + + try? container.encodeIfPresent(url, forKey: .url) + } + } + + /* + Model: StartResponse + Used By: FileStorage + */ + class StartResponse: Codable { + public var fileName: String + + public var filePath: String + + public var contentType: String + + public var method: String + + public var namespace: String + + public var operation: String + + public var size: Int + + public var upload: Upload + + public var cdn: CDN + + public var tags: [String]? + + public enum CodingKeys: String, CodingKey { + case fileName = "file_name" + + case filePath = "file_path" + + case contentType = "content_type" + + case method + + case namespace + + case operation + + case size + + case upload + + case cdn + + case tags + } + + public init(cdn: CDN, contentType: String, fileName: String, filePath: String, method: String, namespace: String, operation: String, size: Int, tags: [String]?, upload: Upload) { + self.fileName = fileName + + self.filePath = filePath + + self.contentType = contentType + + self.method = method + + self.namespace = namespace + + self.operation = operation + + self.size = size + + self.upload = upload + + self.cdn = cdn + + self.tags = tags + } + + public func duplicate() -> StartResponse { + let dict = self.dictionary! + let copy = StartResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + fileName = try container.decode(String.self, forKey: .fileName) + + filePath = try container.decode(String.self, forKey: .filePath) + + contentType = try container.decode(String.self, forKey: .contentType) + + method = try container.decode(String.self, forKey: .method) + + namespace = try container.decode(String.self, forKey: .namespace) + + operation = try container.decode(String.self, forKey: .operation) + + size = try container.decode(Int.self, forKey: .size) + + upload = try container.decode(Upload.self, forKey: .upload) + + cdn = try container.decode(CDN.self, forKey: .cdn) + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(fileName, forKey: .fileName) + + try? container.encodeIfPresent(filePath, forKey: .filePath) + + try? container.encodeIfPresent(contentType, forKey: .contentType) + + try? container.encodeIfPresent(method, forKey: .method) + + try? container.encodeIfPresent(namespace, forKey: .namespace) + + try? container.encodeIfPresent(operation, forKey: .operation) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(upload, forKey: .upload) + + try? container.encodeIfPresent(cdn, forKey: .cdn) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: StartRequest + Used By: FileStorage + */ + class StartRequest: Codable { + public var fileName: String + + public var contentType: String + + public var size: Int + + public var tags: [String]? + + public var params: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case fileName = "file_name" + + case contentType = "content_type" + + case size + + case tags + + case params + } + + public init(contentType: String, fileName: String, params: [String: Any]?, size: Int, tags: [String]?) { + self.fileName = fileName + + self.contentType = contentType + + self.size = size + + self.tags = tags + + self.params = params + } + + public func duplicate() -> StartRequest { + let dict = self.dictionary! + let copy = StartRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + fileName = try container.decode(String.self, forKey: .fileName) + + contentType = try container.decode(String.self, forKey: .contentType) + + size = try container.decode(Int.self, forKey: .size) + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + params = try container.decode([String: Any].self, forKey: .params) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(fileName, forKey: .fileName) + + try? container.encodeIfPresent(contentType, forKey: .contentType) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(params, forKey: .params) + } + } + + /* + Model: CompleteResponse + Used By: FileStorage + */ + class CompleteResponse: Codable { + public var id: String + + public var fileName: String + + public var filePath: String + + public var contentType: String + + public var method: String + + public var namespace: String + + public var operation: String + + public var size: Int + + public var upload: Upload + + public var cdn: CDN + + public var success: String + + public var tags: [String]? + + public var createdOn: String + + public var modifiedOn: String + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case fileName = "file_name" + + case filePath = "file_path" + + case contentType = "content_type" + + case method + + case namespace + + case operation + + case size + + case upload + + case cdn + + case success + + case tags + + case createdOn = "created_on" + + case modifiedOn = "modified_on" + } + + public init(cdn: CDN, contentType: String, createdOn: String, fileName: String, filePath: String, method: String, modifiedOn: String, namespace: String, operation: String, size: Int, success: String, tags: [String]?, upload: Upload, id: String) { + self.id = id + + self.fileName = fileName + + self.filePath = filePath + + self.contentType = contentType + + self.method = method + + self.namespace = namespace + + self.operation = operation + + self.size = size + + self.upload = upload + + self.cdn = cdn + + self.success = success + + self.tags = tags + + self.createdOn = createdOn + + self.modifiedOn = modifiedOn + } + + public func duplicate() -> CompleteResponse { + let dict = self.dictionary! + let copy = CompleteResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + id = try container.decode(String.self, forKey: .id) + + fileName = try container.decode(String.self, forKey: .fileName) + + filePath = try container.decode(String.self, forKey: .filePath) + + contentType = try container.decode(String.self, forKey: .contentType) + + method = try container.decode(String.self, forKey: .method) + + namespace = try container.decode(String.self, forKey: .namespace) + + operation = try container.decode(String.self, forKey: .operation) + + size = try container.decode(Int.self, forKey: .size) + + upload = try container.decode(Upload.self, forKey: .upload) + + cdn = try container.decode(CDN.self, forKey: .cdn) + + success = try container.decode(String.self, forKey: .success) + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + createdOn = try container.decode(String.self, forKey: .createdOn) + + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(fileName, forKey: .fileName) + + try? container.encodeIfPresent(filePath, forKey: .filePath) + + try? container.encodeIfPresent(contentType, forKey: .contentType) + + try? container.encodeIfPresent(method, forKey: .method) + + try? container.encodeIfPresent(namespace, forKey: .namespace) + + try? container.encodeIfPresent(operation, forKey: .operation) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(upload, forKey: .upload) + + try? container.encodeIfPresent(cdn, forKey: .cdn) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + } + } + + /* + Model: Opts + Used By: FileStorage + */ + class Opts: Codable { + public var attempts: Int? + + public var timestamp: Int? + + public var delay: Int? + + public enum CodingKeys: String, CodingKey { + case attempts + + case timestamp + + case delay + } + + public init(attempts: Int?, delay: Int?, timestamp: Int?) { + self.attempts = attempts + + self.timestamp = timestamp + + self.delay = delay + } + + public func duplicate() -> Opts { + let dict = self.dictionary! + let copy = Opts(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + attempts = try container.decode(Int.self, forKey: .attempts) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + timestamp = try container.decode(Int.self, forKey: .timestamp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + delay = try container.decode(Int.self, forKey: .delay) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(attempts, forKey: .attempts) + + try? container.encodeIfPresent(timestamp, forKey: .timestamp) + + try? container.encodeIfPresent(delay, forKey: .delay) + } + } + + /* + Model: CopyFileTask + Used By: FileStorage + */ + class CopyFileTask: Codable { + public var id: String + + public var name: String + + public var data: BulkRequest + + public var opts: Opts + + public var progress: Int + + public var delay: Int + + public var timestamp: Int + + public var attemptsMade: Int + + public var stacktrace: [String]? + + public var finishedOn: Int + + public var processedOn: Int + + public enum CodingKeys: String, CodingKey { + case id + + case name + + case data + + case opts + + case progress + + case delay + + case timestamp + + case attemptsMade = "attempts_made" + + case stacktrace + + case finishedOn = "finished_on" + + case processedOn = "processed_on" + } + + public init(attemptsMade: Int, data: BulkRequest, delay: Int, finishedOn: Int, id: String, name: String, opts: Opts, processedOn: Int, progress: Int, stacktrace: [String]?, timestamp: Int) { + self.id = id + + self.name = name + + self.data = data + + self.opts = opts + + self.progress = progress + + self.delay = delay + + self.timestamp = timestamp + + self.attemptsMade = attemptsMade + + self.stacktrace = stacktrace + + self.finishedOn = finishedOn + + self.processedOn = processedOn + } + + public func duplicate() -> CopyFileTask { + let dict = self.dictionary! + let copy = CopyFileTask(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + id = try container.decode(String.self, forKey: .id) + + name = try container.decode(String.self, forKey: .name) + + data = try container.decode(BulkRequest.self, forKey: .data) + + opts = try container.decode(Opts.self, forKey: .opts) + + progress = try container.decode(Int.self, forKey: .progress) + + delay = try container.decode(Int.self, forKey: .delay) + + timestamp = try container.decode(Int.self, forKey: .timestamp) + + attemptsMade = try container.decode(Int.self, forKey: .attemptsMade) + + do { + stacktrace = try container.decode([String].self, forKey: .stacktrace) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + finishedOn = try container.decode(Int.self, forKey: .finishedOn) + + processedOn = try container.decode(Int.self, forKey: .processedOn) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(opts, forKey: .opts) + + try? container.encodeIfPresent(progress, forKey: .progress) + + try? container.encodeIfPresent(delay, forKey: .delay) + + try? container.encodeIfPresent(timestamp, forKey: .timestamp) + + try? container.encodeIfPresent(attemptsMade, forKey: .attemptsMade) + + try? container.encodeIfPresent(stacktrace, forKey: .stacktrace) + + try? container.encodeIfPresent(finishedOn, forKey: .finishedOn) + + try? container.encodeIfPresent(processedOn, forKey: .processedOn) + } + } + + /* + Model: BulkResponse + Used By: FileStorage + */ + class BulkResponse: Codable { + public var trackingUrl: String + + public var task: CopyFileTask + + public enum CodingKeys: String, CodingKey { + case trackingUrl = "tracking_url" + + case task + } + + public init(task: CopyFileTask, trackingUrl: String) { + self.trackingUrl = trackingUrl + + self.task = task + } + + public func duplicate() -> BulkResponse { + let dict = self.dictionary! + let copy = BulkResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + trackingUrl = try container.decode(String.self, forKey: .trackingUrl) + + task = try container.decode(CopyFileTask.self, forKey: .task) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(trackingUrl, forKey: .trackingUrl) + + try? container.encodeIfPresent(task, forKey: .task) + } + } + + /* + Model: ReqConfiguration + Used By: FileStorage + */ + class ReqConfiguration: Codable { + public var concurrency: Int? + + public enum CodingKeys: String, CodingKey { + case concurrency + } + + public init(concurrency: Int?) { + self.concurrency = concurrency + } + + public func duplicate() -> ReqConfiguration { + let dict = self.dictionary! + let copy = ReqConfiguration(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + concurrency = try container.decode(Int.self, forKey: .concurrency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(concurrency, forKey: .concurrency) + } + } + + /* + Model: Destination + Used By: FileStorage + */ + class Destination: Codable { + public var namespace: String + + public var rewrite: String + + public var basepath: String? + + public enum CodingKeys: String, CodingKey { + case namespace + + case rewrite + + case basepath + } + + public init(basepath: String?, namespace: String, rewrite: String) { + self.namespace = namespace + + self.rewrite = rewrite + + self.basepath = basepath + } + + public func duplicate() -> Destination { + let dict = self.dictionary! + let copy = Destination(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + namespace = try container.decode(String.self, forKey: .namespace) + + rewrite = try container.decode(String.self, forKey: .rewrite) + + do { + basepath = try container.decode(String.self, forKey: .basepath) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(namespace, forKey: .namespace) + + try? container.encodeIfPresent(rewrite, forKey: .rewrite) + + try? container.encodeIfPresent(basepath, forKey: .basepath) + } + } + + /* + Model: BulkRequest + Used By: FileStorage + */ + class BulkRequest: Codable { + public var urls: [String] + + public var destination: Destination + + public var configuration: ReqConfiguration? + + public enum CodingKeys: String, CodingKey { + case urls + + case destination + + case configuration + } + + public init(configuration: ReqConfiguration?, destination: Destination, urls: [String]) { + self.urls = urls + + self.destination = destination + + self.configuration = configuration + } + + public func duplicate() -> BulkRequest { + let dict = self.dictionary! + let copy = BulkRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + urls = try container.decode([String].self, forKey: .urls) + + destination = try container.decode(Destination.self, forKey: .destination) + + do { + configuration = try container.decode(ReqConfiguration.self, forKey: .configuration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(urls, forKey: .urls) + + try? container.encodeIfPresent(destination, forKey: .destination) + + try? container.encodeIfPresent(configuration, forKey: .configuration) + } + } + + /* + Model: Urls + Used By: FileStorage + */ + class Urls: Codable { + public var url: String + + public var signedUrl: String + + public var expiry: Int + + public enum CodingKeys: String, CodingKey { + case url + + case signedUrl = "signed_url" + + case expiry + } + + public init(expiry: Int, signedUrl: String, url: String) { + self.url = url + + self.signedUrl = signedUrl + + self.expiry = expiry + } + + public func duplicate() -> Urls { + let dict = self.dictionary! + let copy = Urls(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + url = try container.decode(String.self, forKey: .url) + + signedUrl = try container.decode(String.self, forKey: .signedUrl) + + expiry = try container.decode(Int.self, forKey: .expiry) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(signedUrl, forKey: .signedUrl) + + try? container.encodeIfPresent(expiry, forKey: .expiry) + } + } + + /* + Model: SignUrlResponse + Used By: FileStorage + */ + class SignUrlResponse: Codable { + public var urls: [Urls] + + public enum CodingKeys: String, CodingKey { + case urls + } + + public init(urls: [Urls]) { + self.urls = urls + } + + public func duplicate() -> SignUrlResponse { + let dict = self.dictionary! + let copy = SignUrlResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + urls = try container.decode([Urls].self, forKey: .urls) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(urls, forKey: .urls) + } + } + + /* + Model: SignUrlRequest + Used By: FileStorage + */ + class SignUrlRequest: Codable { + public var expiry: Int + + public var urls: [String] + + public enum CodingKeys: String, CodingKey { + case expiry + + case urls + } + + public init(expiry: Int, urls: [String]) { + self.expiry = expiry + + self.urls = urls + } + + public func duplicate() -> SignUrlRequest { + let dict = self.dictionary! + let copy = SignUrlRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + expiry = try container.decode(Int.self, forKey: .expiry) + + urls = try container.decode([String].self, forKey: .urls) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(expiry, forKey: .expiry) + + try? container.encodeIfPresent(urls, forKey: .urls) + } + } + + /* + Model: DbRecord + Used By: FileStorage + */ + class DbRecord: Codable { + public var success: Bool + + public var tags: [String] + + public var id: String + + public var fileName: String + + public var operation: String? + + public var namespace: String + + public var contentType: String + + public var filePath: String + + public var upload: Upload + + public var cdn: CDN + + public var createdOn: String + + public var modifiedOn: String + + public enum CodingKeys: String, CodingKey { + case success + + case tags + + case id = "_id" + + case fileName = "file_name" + + case operation + + case namespace + + case contentType = "content_type" + + case filePath = "file_path" + + case upload + + case cdn + + case createdOn = "created_on" + + case modifiedOn = "modified_on" + } + + public init(cdn: CDN, contentType: String, createdOn: String, fileName: String, filePath: String, modifiedOn: String, namespace: String, operation: String?, success: Bool, tags: [String], upload: Upload, id: String) { + self.success = success + + self.tags = tags + + self.id = id + + self.fileName = fileName + + self.operation = operation + + self.namespace = namespace + + self.contentType = contentType + + self.filePath = filePath + + self.upload = upload + + self.cdn = cdn + + self.createdOn = createdOn + + self.modifiedOn = modifiedOn + } + + public func duplicate() -> DbRecord { + let dict = self.dictionary! + let copy = DbRecord(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + tags = try container.decode([String].self, forKey: .tags) + + id = try container.decode(String.self, forKey: .id) + + fileName = try container.decode(String.self, forKey: .fileName) + + do { + operation = try container.decode(String.self, forKey: .operation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + namespace = try container.decode(String.self, forKey: .namespace) + + contentType = try container.decode(String.self, forKey: .contentType) + + filePath = try container.decode(String.self, forKey: .filePath) + + upload = try container.decode(Upload.self, forKey: .upload) + + cdn = try container.decode(CDN.self, forKey: .cdn) + + createdOn = try container.decode(String.self, forKey: .createdOn) + + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(fileName, forKey: .fileName) + + try? container.encodeIfPresent(operation, forKey: .operation) + + try? container.encodeIfPresent(namespace, forKey: .namespace) + + try? container.encodeIfPresent(contentType, forKey: .contentType) + + try? container.encodeIfPresent(filePath, forKey: .filePath) + + try? container.encodeIfPresent(upload, forKey: .upload) + + try? container.encodeIfPresent(cdn, forKey: .cdn) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + } + } + + /* + Model: BrowseResponse + Used By: FileStorage + */ + class BrowseResponse: Codable { + public var items: [DbRecord] + + public var page: Page + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [DbRecord], page: Page) { + self.items = items + + self.page = page + } + + public func duplicate() -> BrowseResponse { + let dict = self.dictionary! + let copy = BrowseResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + items = try container.decode([DbRecord].self, forKey: .items) + + page = try container.decode(Page.self, forKey: .page) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } +} diff --git a/Sources/code/application/models/LeadAppModelClass.swift b/Sources/code/application/models/LeadAppModelClass.swift new file mode 100644 index 0000000000..de55ce3a35 --- /dev/null +++ b/Sources/code/application/models/LeadAppModelClass.swift @@ -0,0 +1,3148 @@ +import Foundation + +import Foundation +public extension ApplicationClient { + /* + Model: TicketList + Used By: Lead + */ + class TicketList: Codable { + public var items: [Ticket]? + + public var filters: Filter? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case filters + + case page + } + + public init(filters: Filter?, items: [Ticket]?, page: Page?) { + self.items = items + + self.filters = filters + + self.page = page + } + + public func duplicate() -> TicketList { + let dict = self.dictionary! + let copy = TicketList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Ticket].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filters = try container.decode(Filter.self, forKey: .filters) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(filters, forKey: .filters) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: Page + Used By: Lead + */ + class Page: Codable { + public var itemTotal: Int? + + public var nextId: String? + + public var hasPrevious: Bool? + + public var hasNext: Bool? + + public var current: Int? + + public var type: String + + public var size: Int? + + public enum CodingKeys: String, CodingKey { + case itemTotal = "item_total" + + case nextId = "next_id" + + case hasPrevious = "has_previous" + + case hasNext = "has_next" + + case current + + case type + + case size + } + + public init(current: Int?, hasNext: Bool?, hasPrevious: Bool?, itemTotal: Int?, nextId: String?, size: Int?, type: String) { + self.itemTotal = itemTotal + + self.nextId = nextId + + self.hasPrevious = hasPrevious + + self.hasNext = hasNext + + self.current = current + + self.type = type + + self.size = size + } + + public func duplicate() -> Page { + let dict = self.dictionary! + let copy = Page(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + itemTotal = try container.decode(Int.self, forKey: .itemTotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + nextId = try container.decode(String.self, forKey: .nextId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasPrevious = try container.decode(Bool.self, forKey: .hasPrevious) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasNext = try container.decode(Bool.self, forKey: .hasNext) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + current = try container.decode(Int.self, forKey: .current) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + type = try container.decode(String.self, forKey: .type) + + do { + size = try container.decode(Int.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) + + try? container.encodeIfPresent(nextId, forKey: .nextId) + + try? container.encodeIfPresent(hasPrevious, forKey: .hasPrevious) + + try? container.encodeIfPresent(hasNext, forKey: .hasNext) + + try? container.encodeIfPresent(current, forKey: .current) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(size, forKey: .size) + } + } + + /* + Model: TicketHistoryList + Used By: Lead + */ + class TicketHistoryList: Codable { + public var items: [TicketHistory]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [TicketHistory]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> TicketHistoryList { + let dict = self.dictionary! + let copy = TicketHistoryList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([TicketHistory].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: CustomFormList + Used By: Lead + */ + class CustomFormList: Codable { + public var items: [CustomForm]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [CustomForm]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> CustomFormList { + let dict = self.dictionary! + let copy = CustomFormList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([CustomForm].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: CreateCustomFormPayload + Used By: Lead + */ + class CreateCustomFormPayload: Codable { + public var slug: String + + public var title: String + + public var inputs: [[String: Any]] + + public var description: String? + + public var headerImage: String? + + public var priority: PriorityEnum + + public var shouldNotify: Bool? + + public var successMessage: String? + + public var pollForAssignment: PollForAssignment? + + public enum CodingKeys: String, CodingKey { + case slug + + case title + + case inputs + + case description + + case headerImage = "header_image" + + case priority + + case shouldNotify = "should_notify" + + case successMessage = "success_message" + + case pollForAssignment = "poll_for_assignment" + } + + public init(description: String?, headerImage: String?, inputs: [[String: Any]], pollForAssignment: PollForAssignment?, priority: PriorityEnum, shouldNotify: Bool?, slug: String, successMessage: String?, title: String) { + self.slug = slug + + self.title = title + + self.inputs = inputs + + self.description = description + + self.headerImage = headerImage + + self.priority = priority + + self.shouldNotify = shouldNotify + + self.successMessage = successMessage + + self.pollForAssignment = pollForAssignment + } + + public func duplicate() -> CreateCustomFormPayload { + let dict = self.dictionary! + let copy = CreateCustomFormPayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + slug = try container.decode(String.self, forKey: .slug) + + title = try container.decode(String.self, forKey: .title) + + inputs = try container.decode([[String: Any]].self, forKey: .inputs) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + headerImage = try container.decode(String.self, forKey: .headerImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + priority = try container.decode(PriorityEnum.self, forKey: .priority) + + do { + shouldNotify = try container.decode(Bool.self, forKey: .shouldNotify) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + successMessage = try container.decode(String.self, forKey: .successMessage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pollForAssignment = try container.decode(PollForAssignment.self, forKey: .pollForAssignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(inputs, forKey: .inputs) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(headerImage, forKey: .headerImage) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(shouldNotify, forKey: .shouldNotify) + + try? container.encodeIfPresent(successMessage, forKey: .successMessage) + + try? container.encodeIfPresent(pollForAssignment, forKey: .pollForAssignment) + } + } + + /* + Model: EditCustomFormPayload + Used By: Lead + */ + class EditCustomFormPayload: Codable { + public var title: String + + public var inputs: [[String: Any]] + + public var description: String? + + public var priority: PriorityEnum + + public var headerImage: String? + + public var shouldNotify: Bool? + + public var loginRequired: Bool? + + public var successMessage: String? + + public var pollForAssignment: PollForAssignment? + + public enum CodingKeys: String, CodingKey { + case title + + case inputs + + case description + + case priority + + case headerImage = "header_image" + + case shouldNotify = "should_notify" + + case loginRequired = "login_required" + + case successMessage = "success_message" + + case pollForAssignment = "poll_for_assignment" + } + + public init(description: String?, headerImage: String?, inputs: [[String: Any]], loginRequired: Bool?, pollForAssignment: PollForAssignment?, priority: PriorityEnum, shouldNotify: Bool?, successMessage: String?, title: String) { + self.title = title + + self.inputs = inputs + + self.description = description + + self.priority = priority + + self.headerImage = headerImage + + self.shouldNotify = shouldNotify + + self.loginRequired = loginRequired + + self.successMessage = successMessage + + self.pollForAssignment = pollForAssignment + } + + public func duplicate() -> EditCustomFormPayload { + let dict = self.dictionary! + let copy = EditCustomFormPayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + title = try container.decode(String.self, forKey: .title) + + inputs = try container.decode([[String: Any]].self, forKey: .inputs) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + priority = try container.decode(PriorityEnum.self, forKey: .priority) + + do { + headerImage = try container.decode(String.self, forKey: .headerImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shouldNotify = try container.decode(Bool.self, forKey: .shouldNotify) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + loginRequired = try container.decode(Bool.self, forKey: .loginRequired) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + successMessage = try container.decode(String.self, forKey: .successMessage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pollForAssignment = try container.decode(PollForAssignment.self, forKey: .pollForAssignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(inputs, forKey: .inputs) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(headerImage, forKey: .headerImage) + + try? container.encodeIfPresent(shouldNotify, forKey: .shouldNotify) + + try? container.encodeIfPresent(loginRequired, forKey: .loginRequired) + + try? container.encodeIfPresent(successMessage, forKey: .successMessage) + + try? container.encodeIfPresent(pollForAssignment, forKey: .pollForAssignment) + } + } + + /* + Model: EditTicketPayload + Used By: Lead + */ + class EditTicketPayload: Codable { + public var content: TicketContent? + + public var category: String? + + public var subCategory: String? + + public var source: String? + + public var status: String? + + public var priority: PriorityEnum? + + public var assignedTo: AgentChangePayload? + + public var tags: [String]? + + public enum CodingKeys: String, CodingKey { + case content + + case category + + case subCategory = "sub_category" + + case source + + case status + + case priority + + case assignedTo = "assigned_to" + + case tags + } + + public init(assignedTo: AgentChangePayload?, category: String?, content: TicketContent?, priority: PriorityEnum?, source: String?, status: String?, subCategory: String?, tags: [String]?) { + self.content = content + + self.category = category + + self.subCategory = subCategory + + self.source = source + + self.status = status + + self.priority = priority + + self.assignedTo = assignedTo + + self.tags = tags + } + + public func duplicate() -> EditTicketPayload { + let dict = self.dictionary! + let copy = EditTicketPayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + content = try container.decode(TicketContent.self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + category = try container.decode(String.self, forKey: .category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subCategory = try container.decode(String.self, forKey: .subCategory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + source = try container.decode(String.self, forKey: .source) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(PriorityEnum.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + assignedTo = try container.decode(AgentChangePayload.self, forKey: .assignedTo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(category, forKey: .category) + + try? container.encodeIfPresent(subCategory, forKey: .subCategory) + + try? container.encodeIfPresent(source, forKey: .source) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(assignedTo, forKey: .assignedTo) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: AgentChangePayload + Used By: Lead + */ + class AgentChangePayload: Codable { + public var agentId: String + + public enum CodingKeys: String, CodingKey { + case agentId = "agent_id" + } + + public init(agentId: String) { + self.agentId = agentId + } + + public func duplicate() -> AgentChangePayload { + let dict = self.dictionary! + let copy = AgentChangePayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + agentId = try container.decode(String.self, forKey: .agentId) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(agentId, forKey: .agentId) + } + } + + /* + Model: CreateVideoRoomResponse + Used By: Lead + */ + class CreateVideoRoomResponse: Codable { + public var uniqueName: String + + public enum CodingKeys: String, CodingKey { + case uniqueName = "unique_name" + } + + public init(uniqueName: String) { + self.uniqueName = uniqueName + } + + public func duplicate() -> CreateVideoRoomResponse { + let dict = self.dictionary! + let copy = CreateVideoRoomResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + uniqueName = try container.decode(String.self, forKey: .uniqueName) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uniqueName, forKey: .uniqueName) + } + } + + /* + Model: CloseVideoRoomResponse + Used By: Lead + */ + class CloseVideoRoomResponse: Codable { + public var success: Bool + + public enum CodingKeys: String, CodingKey { + case success + } + + public init(success: Bool) { + self.success = success + } + + public func duplicate() -> CloseVideoRoomResponse { + let dict = self.dictionary! + let copy = CloseVideoRoomResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: CreateVideoRoomPayload + Used By: Lead + */ + class CreateVideoRoomPayload: Codable { + public var uniqueName: String + + public var notify: [NotifyUser]? + + public enum CodingKeys: String, CodingKey { + case uniqueName = "unique_name" + + case notify + } + + public init(notify: [NotifyUser]?, uniqueName: String) { + self.uniqueName = uniqueName + + self.notify = notify + } + + public func duplicate() -> CreateVideoRoomPayload { + let dict = self.dictionary! + let copy = CreateVideoRoomPayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + uniqueName = try container.decode(String.self, forKey: .uniqueName) + + do { + notify = try container.decode([NotifyUser].self, forKey: .notify) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uniqueName, forKey: .uniqueName) + + try? container.encodeIfPresent(notify, forKey: .notify) + } + } + + /* + Model: NotifyUser + Used By: Lead + */ + class NotifyUser: Codable { + public var countryCode: String + + public var phoneNumber: String + + public enum CodingKeys: String, CodingKey { + case countryCode = "country_code" + + case phoneNumber = "phone_number" + } + + public init(countryCode: String, phoneNumber: String) { + self.countryCode = countryCode + + self.phoneNumber = phoneNumber + } + + public func duplicate() -> NotifyUser { + let dict = self.dictionary! + let copy = NotifyUser(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + countryCode = try container.decode(String.self, forKey: .countryCode) + + phoneNumber = try container.decode(String.self, forKey: .phoneNumber) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(phoneNumber, forKey: .phoneNumber) + } + } + + /* + Model: Filter + Used By: Lead + */ + class Filter: Codable { + public var priorities: [Priority] + + public var categories: [TicketCategory]? + + public var statuses: [Status] + + public var assignees: [[String: Any]] + + public enum CodingKeys: String, CodingKey { + case priorities + + case categories + + case statuses + + case assignees + } + + public init(assignees: [[String: Any]], categories: [TicketCategory]?, priorities: [Priority], statuses: [Status]) { + self.priorities = priorities + + self.categories = categories + + self.statuses = statuses + + self.assignees = assignees + } + + public func duplicate() -> Filter { + let dict = self.dictionary! + let copy = Filter(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + priorities = try container.decode([Priority].self, forKey: .priorities) + + do { + categories = try container.decode([TicketCategory].self, forKey: .categories) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + statuses = try container.decode([Status].self, forKey: .statuses) + + assignees = try container.decode([[String: Any]].self, forKey: .assignees) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(priorities, forKey: .priorities) + + try? container.encodeIfPresent(categories, forKey: .categories) + + try? container.encodeIfPresent(statuses, forKey: .statuses) + + try? container.encodeIfPresent(assignees, forKey: .assignees) + } + } + + /* + Model: TicketHistoryPayload + Used By: Lead + */ + class TicketHistoryPayload: Codable { + public var value: [String: Any] + + public var type: HistoryTypeEnum + + public enum CodingKeys: String, CodingKey { + case value + + case type + } + + public init(type: HistoryTypeEnum, value: [String: Any]) { + self.value = value + + self.type = type + } + + public func duplicate() -> TicketHistoryPayload { + let dict = self.dictionary! + let copy = TicketHistoryPayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + value = try container.decode([String: Any].self, forKey: .value) + + type = try container.decode(HistoryTypeEnum.self, forKey: .type) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: CustomFormSubmissionPayload + Used By: Lead + */ + class CustomFormSubmissionPayload: Codable { + public var response: [[String: Any]] + + public var attachments: [TicketAsset]? + + public enum CodingKeys: String, CodingKey { + case response + + case attachments + } + + public init(attachments: [TicketAsset]?, response: [[String: Any]]) { + self.response = response + + self.attachments = attachments + } + + public func duplicate() -> CustomFormSubmissionPayload { + let dict = self.dictionary! + let copy = CustomFormSubmissionPayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + response = try container.decode([[String: Any]].self, forKey: .response) + + do { + attachments = try container.decode([TicketAsset].self, forKey: .attachments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(response, forKey: .response) + + try? container.encodeIfPresent(attachments, forKey: .attachments) + } + } + + /* + Model: GetTokenForVideoRoomResponse + Used By: Lead + */ + class GetTokenForVideoRoomResponse: Codable { + public var accessToken: String + + public enum CodingKeys: String, CodingKey { + case accessToken = "access_token" + } + + public init(accessToken: String) { + self.accessToken = accessToken + } + + public func duplicate() -> GetTokenForVideoRoomResponse { + let dict = self.dictionary! + let copy = GetTokenForVideoRoomResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + accessToken = try container.decode(String.self, forKey: .accessToken) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(accessToken, forKey: .accessToken) + } + } + + /* + Model: GetParticipantsInsideVideoRoomResponse + Used By: Lead + */ + class GetParticipantsInsideVideoRoomResponse: Codable { + public var participants: [Participant] + + public enum CodingKeys: String, CodingKey { + case participants + } + + public init(participants: [Participant]) { + self.participants = participants + } + + public func duplicate() -> GetParticipantsInsideVideoRoomResponse { + let dict = self.dictionary! + let copy = GetParticipantsInsideVideoRoomResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + participants = try container.decode([Participant].self, forKey: .participants) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(participants, forKey: .participants) + } + } + + /* + Model: Participant + Used By: Lead + */ + class Participant: Codable { + public var user: UserSchema? + + public var identity: String? + + public var status: String? + + public enum CodingKeys: String, CodingKey { + case user + + case identity + + case status + } + + public init(identity: String?, status: String?, user: UserSchema?) { + self.user = user + + self.identity = identity + + self.status = status + } + + public func duplicate() -> Participant { + let dict = self.dictionary! + let copy = Participant(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode(UserSchema.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + identity = try container.decode(String.self, forKey: .identity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(identity, forKey: .identity) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: PhoneNumber + Used By: Lead + */ + class PhoneNumber: Codable { + public var active: Bool? + + public var primary: Bool? + + public var verified: Bool? + + public var phone: String? + + public var countryCode: Int? + + public enum CodingKeys: String, CodingKey { + case active + + case primary + + case verified + + case phone + + case countryCode = "country_code" + } + + public init(active: Bool?, countryCode: Int?, phone: String?, primary: Bool?, verified: Bool?) { + self.active = active + + self.primary = primary + + self.verified = verified + + self.phone = phone + + self.countryCode = countryCode + } + + public func duplicate() -> PhoneNumber { + let dict = self.dictionary! + let copy = PhoneNumber(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + primary = try container.decode(Bool.self, forKey: .primary) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verified = try container.decode(Bool.self, forKey: .verified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(Int.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(primary, forKey: .primary) + + try? container.encodeIfPresent(verified, forKey: .verified) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + } + } + + /* + Model: Email + Used By: Lead + */ + class Email: Codable { + public var primary: Bool? + + public var verified: Bool? + + public var email: String? + + public var active: Bool? + + public enum CodingKeys: String, CodingKey { + case primary + + case verified + + case email + + case active + } + + public init(active: Bool?, email: String?, primary: Bool?, verified: Bool?) { + self.primary = primary + + self.verified = verified + + self.email = email + + self.active = active + } + + public func duplicate() -> Email { + let dict = self.dictionary! + let copy = Email(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + primary = try container.decode(Bool.self, forKey: .primary) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verified = try container.decode(Bool.self, forKey: .verified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(primary, forKey: .primary) + + try? container.encodeIfPresent(verified, forKey: .verified) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(active, forKey: .active) + } + } + + /* + Model: Debug + Used By: Lead + */ + class Debug: Codable { + public var source: String? + + public var platform: String? + + public enum CodingKeys: String, CodingKey { + case source + + case platform + } + + public init(platform: String?, source: String?) { + self.source = source + + self.platform = platform + } + + public func duplicate() -> Debug { + let dict = self.dictionary! + let copy = Debug(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + source = try container.decode(String.self, forKey: .source) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode(String.self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(source, forKey: .source) + + try? container.encodeIfPresent(platform, forKey: .platform) + } + } + + /* + Model: SubmitCustomFormResponse + Used By: Lead + */ + class SubmitCustomFormResponse: Codable { + public var ticket: Ticket + + public enum CodingKeys: String, CodingKey { + case ticket + } + + public init(ticket: Ticket) { + self.ticket = ticket + } + + public func duplicate() -> SubmitCustomFormResponse { + let dict = self.dictionary! + let copy = SubmitCustomFormResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + ticket = try container.decode(Ticket.self, forKey: .ticket) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(ticket, forKey: .ticket) + } + } + + /* + Model: TicketContext + Used By: Lead + */ + class TicketContext: Codable { + public var applicationId: String? + + public var companyId: String + + public enum CodingKeys: String, CodingKey { + case applicationId = "application_id" + + case companyId = "company_id" + } + + public init(applicationId: String?, companyId: String) { + self.applicationId = applicationId + + self.companyId = companyId + } + + public func duplicate() -> TicketContext { + let dict = self.dictionary! + let copy = TicketContext(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + applicationId = try container.decode(String.self, forKey: .applicationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + companyId = try container.decode(String.self, forKey: .companyId) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + } + } + + /* + Model: CreatedOn + Used By: Lead + */ + class CreatedOn: Codable { + public var userAgent: String + + public enum CodingKeys: String, CodingKey { + case userAgent = "user_agent" + } + + public init(userAgent: String) { + self.userAgent = userAgent + } + + public func duplicate() -> CreatedOn { + let dict = self.dictionary! + let copy = CreatedOn(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + userAgent = try container.decode(String.self, forKey: .userAgent) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(userAgent, forKey: .userAgent) + } + } + + /* + Model: TicketAsset + Used By: Lead + */ + class TicketAsset: Codable { + public var display: String? + + public var value: String + + public var type: TicketAssetTypeEnum + + public enum CodingKeys: String, CodingKey { + case display + + case value + + case type + } + + public init(display: String?, type: TicketAssetTypeEnum, value: String) { + self.display = display + + self.value = value + + self.type = type + } + + public func duplicate() -> TicketAsset { + let dict = self.dictionary! + let copy = TicketAsset(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + value = try container.decode(String.self, forKey: .value) + + type = try container.decode(TicketAssetTypeEnum.self, forKey: .type) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: TicketContent + Used By: Lead + */ + class TicketContent: Codable { + public var title: String + + public var description: String? + + public var attachments: [TicketAsset]? + + public enum CodingKeys: String, CodingKey { + case title + + case description + + case attachments + } + + public init(attachments: [TicketAsset]?, description: String?, title: String) { + self.title = title + + self.description = description + + self.attachments = attachments + } + + public func duplicate() -> TicketContent { + let dict = self.dictionary! + let copy = TicketContent(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + title = try container.decode(String.self, forKey: .title) + + do { + description = try container.decode(String.self, forKey: .description) + + if let strong_description = description, + let descriptionData = Data(base64Encoded: strong_description) + { + description = String(data: descriptionData, encoding: .utf8) ?? description + } + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attachments = try container.decode([TicketAsset].self, forKey: .attachments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(description?.asBase64, forKey: .description) + + try? container.encodeIfPresent(attachments, forKey: .attachments) + } + } + + /* + Model: AddTicketPayload + Used By: Lead + */ + class AddTicketPayload: Codable { + public var createdBy: [String: Any]? + + public var status: String? + + public var priority: PriorityEnum? + + public var category: String + + public var content: TicketContent + + public enum CodingKeys: String, CodingKey { + case createdBy = "created_by" + + case status + + case priority + + case category + + case content + } + + public init(category: String, content: TicketContent, createdBy: [String: Any]?, priority: PriorityEnum?, status: String?) { + self.createdBy = createdBy + + self.status = status + + self.priority = priority + + self.category = category + + self.content = content + } + + public func duplicate() -> AddTicketPayload { + let dict = self.dictionary! + let copy = AddTicketPayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + createdBy = try container.decode([String: Any].self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(PriorityEnum.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + category = try container.decode(String.self, forKey: .category) + + content = try container.decode(TicketContent.self, forKey: .content) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(category, forKey: .category) + + try? container.encodeIfPresent(content, forKey: .content) + } + } + + /* + Model: Priority + Used By: Lead + */ + class Priority: Codable { + public var key: PriorityEnum + + public var display: String + + public var color: String + + public enum CodingKeys: String, CodingKey { + case key + + case display + + case color + } + + public init(color: String, display: String, key: PriorityEnum) { + self.key = key + + self.display = display + + self.color = color + } + + public func duplicate() -> Priority { + let dict = self.dictionary! + let copy = Priority(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + key = try container.decode(PriorityEnum.self, forKey: .key) + + display = try container.decode(String.self, forKey: .display) + + color = try container.decode(String.self, forKey: .color) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(color, forKey: .color) + } + } + + /* + Model: Status + Used By: Lead + */ + class Status: Codable { + public var key: String + + public var display: String + + public var color: String + + public enum CodingKeys: String, CodingKey { + case key + + case display + + case color + } + + public init(color: String, display: String, key: String) { + self.key = key + + self.display = display + + self.color = color + } + + public func duplicate() -> Status { + let dict = self.dictionary! + let copy = Status(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + key = try container.decode(String.self, forKey: .key) + + display = try container.decode(String.self, forKey: .display) + + color = try container.decode(String.self, forKey: .color) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(color, forKey: .color) + } + } + + /* + Model: TicketCategory + Used By: Lead + */ + class TicketCategory: Codable { + public var key: String + + public var display: String + + public var form: CustomForm? + + public var subCategories: [TicketSubCategory]? + + public var feedbackForm: TicketFeedbackForm? + + public enum CodingKeys: String, CodingKey { + case key + + case display + + case form + + case subCategories = "sub_categories" + + case feedbackForm = "feedback_form" + } + + public init(display: String, feedbackForm: TicketFeedbackForm?, form: CustomForm?, key: String, subCategories: [TicketSubCategory]?) { + self.key = key + + self.display = display + + self.form = form + + self.subCategories = subCategories + + self.feedbackForm = feedbackForm + } + + public func duplicate() -> TicketCategory { + let dict = self.dictionary! + let copy = TicketCategory(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + key = try container.decode(String.self, forKey: .key) + + display = try container.decode(String.self, forKey: .display) + + do { + form = try container.decode(CustomForm.self, forKey: .form) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subCategories = try container.decode([TicketSubCategory].self, forKey: .subCategories) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + feedbackForm = try container.decode(TicketFeedbackForm.self, forKey: .feedbackForm) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(form, forKey: .form) + + try? container.encodeIfPresent(subCategories, forKey: .subCategories) + + try? container.encodeIfPresent(feedbackForm, forKey: .feedbackForm) + } + } + + /* + Model: TicketSubCategory + Used By: Lead + */ + class TicketSubCategory: Codable { + public var key: String + + public var display: String + + public enum CodingKeys: String, CodingKey { + case key + + case display + } + + public init(display: String, key: String) { + self.key = key + + self.display = display + } + + public func duplicate() -> TicketSubCategory { + let dict = self.dictionary! + let copy = TicketSubCategory(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + key = try container.decode(String.self, forKey: .key) + + display = try container.decode(String.self, forKey: .display) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(display, forKey: .display) + } + } + + /* + Model: TicketFeedbackForm + Used By: Lead + */ + class TicketFeedbackForm: Codable { + public var title: String + + public var display: [[String: Any]]? + + public enum CodingKeys: String, CodingKey { + case title + + case display + } + + public init(display: [[String: Any]]?, title: String) { + self.title = title + + self.display = display + } + + public func duplicate() -> TicketFeedbackForm { + let dict = self.dictionary! + let copy = TicketFeedbackForm(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + title = try container.decode(String.self, forKey: .title) + + do { + display = try container.decode([[String: Any]].self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(display, forKey: .display) + } + } + + /* + Model: TicketFeedbackList + Used By: Lead + */ + class TicketFeedbackList: Codable { + public var items: [TicketFeedback]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [TicketFeedback]?) { + self.items = items + } + + public func duplicate() -> TicketFeedbackList { + let dict = self.dictionary! + let copy = TicketFeedbackList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([TicketFeedback].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: TicketFeedbackPayload + Used By: Lead + */ + class TicketFeedbackPayload: Codable { + public var formResponse: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case formResponse = "form_response" + } + + public init(formResponse: [String: Any]?) { + self.formResponse = formResponse + } + + public func duplicate() -> TicketFeedbackPayload { + let dict = self.dictionary! + let copy = TicketFeedbackPayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + formResponse = try container.decode([String: Any].self, forKey: .formResponse) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(formResponse, forKey: .formResponse) + } + } + + /* + Model: SubmitButton + Used By: Lead + */ + class SubmitButton: Codable { + public var title: String + + public var titleColor: String + + public var backgroundColor: String + + public enum CodingKeys: String, CodingKey { + case title + + case titleColor = "title_color" + + case backgroundColor = "background_color" + } + + public init(backgroundColor: String, title: String, titleColor: String) { + self.title = title + + self.titleColor = titleColor + + self.backgroundColor = backgroundColor + } + + public func duplicate() -> SubmitButton { + let dict = self.dictionary! + let copy = SubmitButton(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + title = try container.decode(String.self, forKey: .title) + + titleColor = try container.decode(String.self, forKey: .titleColor) + + backgroundColor = try container.decode(String.self, forKey: .backgroundColor) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(titleColor, forKey: .titleColor) + + try? container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) + } + } + + /* + Model: PollForAssignment + Used By: Lead + */ + class PollForAssignment: Codable { + public var duration: Double + + public var message: String + + public var successMessage: String + + public var failureMessage: String + + public enum CodingKeys: String, CodingKey { + case duration + + case message + + case successMessage = "success_message" + + case failureMessage = "failure_message" + } + + public init(duration: Double, failureMessage: String, message: String, successMessage: String) { + self.duration = duration + + self.message = message + + self.successMessage = successMessage + + self.failureMessage = failureMessage + } + + public func duplicate() -> PollForAssignment { + let dict = self.dictionary! + let copy = PollForAssignment(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + duration = try container.decode(Double.self, forKey: .duration) + + message = try container.decode(String.self, forKey: .message) + + successMessage = try container.decode(String.self, forKey: .successMessage) + + failureMessage = try container.decode(String.self, forKey: .failureMessage) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(duration, forKey: .duration) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(successMessage, forKey: .successMessage) + + try? container.encodeIfPresent(failureMessage, forKey: .failureMessage) + } + } + + /* + Model: CustomForm + Used By: Lead + */ + class CustomForm: Codable { + public var applicationId: String + + public var slug: String + + public var headerImage: String? + + public var title: String + + public var description: String? + + public var priority: Priority + + public var loginRequired: Bool + + public var shouldNotify: Bool + + public var successMessage: String? + + public var submitButton: SubmitButton? + + public var inputs: [[String: Any]] + + public var createdOn: CreatedOn? + + public var createdBy: [String: Any]? + + public var pollForAssignment: PollForAssignment? + + public var id: String + + public enum CodingKeys: String, CodingKey { + case applicationId = "application_id" + + case slug + + case headerImage = "header_image" + + case title + + case description + + case priority + + case loginRequired = "login_required" + + case shouldNotify = "should_notify" + + case successMessage = "success_message" + + case submitButton = "submit_button" + + case inputs + + case createdOn = "created_on" + + case createdBy = "created_by" + + case pollForAssignment = "poll_for_assignment" + + case id = "_id" + } + + public init(applicationId: String, createdBy: [String: Any]?, createdOn: CreatedOn?, description: String?, headerImage: String?, inputs: [[String: Any]], loginRequired: Bool, pollForAssignment: PollForAssignment?, priority: Priority, shouldNotify: Bool, slug: String, submitButton: SubmitButton?, successMessage: String?, title: String, id: String) { + self.applicationId = applicationId + + self.slug = slug + + self.headerImage = headerImage + + self.title = title + + self.description = description + + self.priority = priority + + self.loginRequired = loginRequired + + self.shouldNotify = shouldNotify + + self.successMessage = successMessage + + self.submitButton = submitButton + + self.inputs = inputs + + self.createdOn = createdOn + + self.createdBy = createdBy + + self.pollForAssignment = pollForAssignment + + self.id = id + } + + public func duplicate() -> CustomForm { + let dict = self.dictionary! + let copy = CustomForm(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + applicationId = try container.decode(String.self, forKey: .applicationId) + + slug = try container.decode(String.self, forKey: .slug) + + do { + headerImage = try container.decode(String.self, forKey: .headerImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + title = try container.decode(String.self, forKey: .title) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + priority = try container.decode(Priority.self, forKey: .priority) + + loginRequired = try container.decode(Bool.self, forKey: .loginRequired) + + shouldNotify = try container.decode(Bool.self, forKey: .shouldNotify) + + do { + successMessage = try container.decode(String.self, forKey: .successMessage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + submitButton = try container.decode(SubmitButton.self, forKey: .submitButton) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + inputs = try container.decode([[String: Any]].self, forKey: .inputs) + + do { + createdOn = try container.decode(CreatedOn.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode([String: Any].self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pollForAssignment = try container.decode(PollForAssignment.self, forKey: .pollForAssignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + id = try container.decode(String.self, forKey: .id) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(headerImage, forKey: .headerImage) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(loginRequired, forKey: .loginRequired) + + try? container.encodeIfPresent(shouldNotify, forKey: .shouldNotify) + + try? container.encodeIfPresent(successMessage, forKey: .successMessage) + + try? container.encodeIfPresent(submitButton, forKey: .submitButton) + + try? container.encodeIfPresent(inputs, forKey: .inputs) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(pollForAssignment, forKey: .pollForAssignment) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: FeedbackResponseItem + Used By: Lead + */ + class FeedbackResponseItem: Codable { + public var display: String + + public var key: String + + public var value: String + + public enum CodingKeys: String, CodingKey { + case display + + case key + + case value + } + + public init(display: String, key: String, value: String) { + self.display = display + + self.key = key + + self.value = value + } + + public func duplicate() -> FeedbackResponseItem { + let dict = self.dictionary! + let copy = FeedbackResponseItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + display = try container.decode(String.self, forKey: .display) + + key = try container.decode(String.self, forKey: .key) + + value = try container.decode(String.self, forKey: .value) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: TicketFeedback + Used By: Lead + */ + class TicketFeedback: Codable { + public var id: String + + public var ticketId: String + + public var companyId: String + + public var response: [FeedbackResponseItem] + + public var category: String? + + public var user: [String: Any]? + + public var updatedAt: String? + + public var createdAt: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case ticketId = "ticket_id" + + case companyId = "company_id" + + case response + + case category + + case user + + case updatedAt = "updated_at" + + case createdAt = "created_at" + } + + public init(category: String?, companyId: String, createdAt: String?, response: [FeedbackResponseItem], ticketId: String, updatedAt: String?, user: [String: Any]?, id: String) { + self.id = id + + self.ticketId = ticketId + + self.companyId = companyId + + self.response = response + + self.category = category + + self.user = user + + self.updatedAt = updatedAt + + self.createdAt = createdAt + } + + public func duplicate() -> TicketFeedback { + let dict = self.dictionary! + let copy = TicketFeedback(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + id = try container.decode(String.self, forKey: .id) + + ticketId = try container.decode(String.self, forKey: .ticketId) + + companyId = try container.decode(String.self, forKey: .companyId) + + response = try container.decode([FeedbackResponseItem].self, forKey: .response) + + do { + category = try container.decode(String.self, forKey: .category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + user = try container.decode([String: Any].self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(ticketId, forKey: .ticketId) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(response, forKey: .response) + + try? container.encodeIfPresent(category, forKey: .category) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + } + } + + /* + Model: TicketHistory + Used By: Lead + */ + class TicketHistory: Codable { + public var type: String + + public var value: [String: Any] + + public var ticketId: String + + public var createdOn: CreatedOn? + + public var createdBy: [String: Any]? + + public var id: String + + public var updatedAt: String? + + public var createdAt: String? + + public enum CodingKeys: String, CodingKey { + case type + + case value + + case ticketId = "ticket_id" + + case createdOn = "created_on" + + case createdBy = "created_by" + + case id = "_id" + + case updatedAt = "updated_at" + + case createdAt = "created_at" + } + + public init(createdAt: String?, createdBy: [String: Any]?, createdOn: CreatedOn?, ticketId: String, type: String, updatedAt: String?, value: [String: Any], id: String) { + self.type = type + + self.value = value + + self.ticketId = ticketId + + self.createdOn = createdOn + + self.createdBy = createdBy + + self.id = id + + self.updatedAt = updatedAt + + self.createdAt = createdAt + } + + public func duplicate() -> TicketHistory { + let dict = self.dictionary! + let copy = TicketHistory(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + type = try container.decode(String.self, forKey: .type) + + value = try container.decode([String: Any].self, forKey: .value) + + ticketId = try container.decode(String.self, forKey: .ticketId) + + do { + createdOn = try container.decode(CreatedOn.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode([String: Any].self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + id = try container.decode(String.self, forKey: .id) + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(ticketId, forKey: .ticketId) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + } + } + + /* + Model: Ticket + Used By: Lead + */ + class Ticket: Codable { + public var context: TicketContext? + + public var createdOn: CreatedOn? + + public var responseId: String? + + public var content: TicketContent? + + public var ticketId: String + + public var category: TicketCategory + + public var subCategory: TicketSubCategory? + + public var source: TicketSourceEnum + + public var status: Status + + public var priority: Priority + + public var createdBy: [String: Any]? + + public var assignedTo: [String: Any]? + + public var tags: [String]? + + public var customJson: [String: Any]? + + public var isFeedbackPending: Bool? + + public var id: String + + public var updatedAt: String? + + public var createdAt: String? + + public enum CodingKeys: String, CodingKey { + case context + + case createdOn = "created_on" + + case responseId = "response_id" + + case content + + case ticketId = "ticket_id" + + case category + + case subCategory = "sub_category" + + case source + + case status + + case priority + + case createdBy = "created_by" + + case assignedTo = "assigned_to" + + case tags + + case customJson = "_custom_json" + + case isFeedbackPending = "is_feedback_pending" + + case id = "_id" + + case updatedAt = "updated_at" + + case createdAt = "created_at" + } + + public init(assignedTo: [String: Any]?, category: TicketCategory, content: TicketContent?, context: TicketContext?, createdAt: String?, createdBy: [String: Any]?, createdOn: CreatedOn?, isFeedbackPending: Bool?, priority: Priority, responseId: String?, source: TicketSourceEnum, status: Status, subCategory: TicketSubCategory?, tags: [String]?, ticketId: String, updatedAt: String?, customJson: [String: Any]?, id: String) { + self.context = context + + self.createdOn = createdOn + + self.responseId = responseId + + self.content = content + + self.ticketId = ticketId + + self.category = category + + self.subCategory = subCategory + + self.source = source + + self.status = status + + self.priority = priority + + self.createdBy = createdBy + + self.assignedTo = assignedTo + + self.tags = tags + + self.customJson = customJson + + self.isFeedbackPending = isFeedbackPending + + self.id = id + + self.updatedAt = updatedAt + + self.createdAt = createdAt + } + + public func duplicate() -> Ticket { + let dict = self.dictionary! + let copy = Ticket(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + context = try container.decode(TicketContext.self, forKey: .context) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(CreatedOn.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + responseId = try container.decode(String.self, forKey: .responseId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode(TicketContent.self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + ticketId = try container.decode(String.self, forKey: .ticketId) + + category = try container.decode(TicketCategory.self, forKey: .category) + + do { + subCategory = try container.decode(TicketSubCategory.self, forKey: .subCategory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + source = try container.decode(TicketSourceEnum.self, forKey: .source) + + status = try container.decode(Status.self, forKey: .status) + + priority = try container.decode(Priority.self, forKey: .priority) + + do { + createdBy = try container.decode([String: Any].self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + assignedTo = try container.decode([String: Any].self, forKey: .assignedTo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isFeedbackPending = try container.decode(Bool.self, forKey: .isFeedbackPending) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + id = try container.decode(String.self, forKey: .id) + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(context, forKey: .context) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(responseId, forKey: .responseId) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(ticketId, forKey: .ticketId) + + try? container.encodeIfPresent(category, forKey: .category) + + try? container.encodeIfPresent(subCategory, forKey: .subCategory) + + try? container.encodeIfPresent(source, forKey: .source) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(assignedTo, forKey: .assignedTo) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(isFeedbackPending, forKey: .isFeedbackPending) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + } + } +} diff --git a/Sources/code/application/models/LogisticAppModelClass.swift b/Sources/code/application/models/LogisticAppModelClass.swift new file mode 100644 index 0000000000..70126a3198 --- /dev/null +++ b/Sources/code/application/models/LogisticAppModelClass.swift @@ -0,0 +1,1150 @@ +import Foundation + +import Foundation +public extension ApplicationClient { + /* + Model: GetPincodeCityResponse + Used By: Logistic + */ + class GetPincodeCityResponse: Codable { + public var requestUuid: String + + public var stormbreakerUuid: String + + public var success: Bool + + public var data: [LogisticPincodeData] + + public enum CodingKeys: String, CodingKey { + case requestUuid = "request_uuid" + + case stormbreakerUuid = "stormbreaker_uuid" + + case success + + case data + } + + public init(data: [LogisticPincodeData], requestUuid: String, stormbreakerUuid: String, success: Bool) { + self.requestUuid = requestUuid + + self.stormbreakerUuid = stormbreakerUuid + + self.success = success + + self.data = data + } + + public func duplicate() -> GetPincodeCityResponse { + let dict = self.dictionary! + let copy = GetPincodeCityResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + requestUuid = try container.decode(String.self, forKey: .requestUuid) + + stormbreakerUuid = try container.decode(String.self, forKey: .stormbreakerUuid) + + success = try container.decode(Bool.self, forKey: .success) + + data = try container.decode([LogisticPincodeData].self, forKey: .data) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(requestUuid, forKey: .requestUuid) + + try? container.encodeIfPresent(stormbreakerUuid, forKey: .stormbreakerUuid) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: LogisticPincodeData + Used By: Logistic + */ + class LogisticPincodeData: Codable { + public var meta: LogisticMeta? + + public var parents: [LogisticParents]? + + public var subType: String? + + public var name: String? + + public var error: LogisticError? + + public var uid: String? + + public var displayName: String? + + public enum CodingKeys: String, CodingKey { + case meta + + case parents + + case subType = "sub_type" + + case name + + case error + + case uid + + case displayName = "display_name" + } + + public init(displayName: String?, error: LogisticError?, meta: LogisticMeta?, name: String?, parents: [LogisticParents]?, subType: String?, uid: String?) { + self.meta = meta + + self.parents = parents + + self.subType = subType + + self.name = name + + self.error = error + + self.uid = uid + + self.displayName = displayName + } + + public func duplicate() -> LogisticPincodeData { + let dict = self.dictionary! + let copy = LogisticPincodeData(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + meta = try container.decode(LogisticMeta.self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + parents = try container.decode([LogisticParents].self, forKey: .parents) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subType = try container.decode(String.self, forKey: .subType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + error = try container.decode(LogisticError.self, forKey: .error) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(parents, forKey: .parents) + + try? container.encodeIfPresent(subType, forKey: .subType) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(error, forKey: .error) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + } + } + + /* + Model: LogisticMeta + Used By: Logistic + */ + class LogisticMeta: Codable { + public var zone: String? + + public var deliverables: [[String: Any]]? + + public enum CodingKeys: String, CodingKey { + case zone + + case deliverables + } + + public init(deliverables: [[String: Any]]?, zone: String?) { + self.zone = zone + + self.deliverables = deliverables + } + + public func duplicate() -> LogisticMeta { + let dict = self.dictionary! + let copy = LogisticMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + zone = try container.decode(String.self, forKey: .zone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliverables = try container.decode([[String: Any]].self, forKey: .deliverables) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(zone, forKey: .zone) + + try? container.encodeIfPresent(deliverables, forKey: .deliverables) + } + } + + /* + Model: LogisticParents + Used By: Logistic + */ + class LogisticParents: Codable { + public var subType: String? + + public var name: String? + + public var displayName: String? + + public var uid: String? + + public enum CodingKeys: String, CodingKey { + case subType = "sub_type" + + case name + + case displayName = "display_name" + + case uid + } + + public init(displayName: String?, name: String?, subType: String?, uid: String?) { + self.subType = subType + + self.name = name + + self.displayName = displayName + + self.uid = uid + } + + public func duplicate() -> LogisticParents { + let dict = self.dictionary! + let copy = LogisticParents(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + subType = try container.decode(String.self, forKey: .subType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(subType, forKey: .subType) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(uid, forKey: .uid) + } + } + + /* + Model: LogisticError + Used By: Logistic + */ + class LogisticError: Codable { + public var type: String? + + public var value: String? + + public var message: String? + + public enum CodingKeys: String, CodingKey { + case type + + case value + + case message + } + + public init(message: String?, type: String?, value: String?) { + self.type = type + + self.value = value + + self.message = message + } + + public func duplicate() -> LogisticError { + let dict = self.dictionary! + let copy = LogisticError(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: GetTatProductReqBody + Used By: Logistic + */ + class GetTatProductReqBody: Codable { + public var locationDetails: [LocationDetailsReq] + + public var toPincode: String + + public var action: String? + + public enum CodingKeys: String, CodingKey { + case locationDetails = "location_details" + + case toPincode = "to_pincode" + + case action + } + + public init(action: String?, locationDetails: [LocationDetailsReq], toPincode: String) { + self.locationDetails = locationDetails + + self.toPincode = toPincode + + self.action = action + } + + public func duplicate() -> GetTatProductReqBody { + let dict = self.dictionary! + let copy = GetTatProductReqBody(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + locationDetails = try container.decode([LocationDetailsReq].self, forKey: .locationDetails) + + toPincode = try container.decode(String.self, forKey: .toPincode) + + do { + action = try container.decode(String.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(locationDetails, forKey: .locationDetails) + + try? container.encodeIfPresent(toPincode, forKey: .toPincode) + + try? container.encodeIfPresent(action, forKey: .action) + } + } + + /* + Model: LocationDetailsReq + Used By: Logistic + */ + class LocationDetailsReq: Codable { + public var fromPincode: String? + + public var articles: [TatReqProductArticles]? + + public var fulfillmentId: Int? + + public enum CodingKeys: String, CodingKey { + case fromPincode = "from_pincode" + + case articles + + case fulfillmentId = "fulfillment_id" + } + + public init(articles: [TatReqProductArticles]?, fromPincode: String?, fulfillmentId: Int?) { + self.fromPincode = fromPincode + + self.articles = articles + + self.fulfillmentId = fulfillmentId + } + + public func duplicate() -> LocationDetailsReq { + let dict = self.dictionary! + let copy = LocationDetailsReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + fromPincode = try container.decode(String.self, forKey: .fromPincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + articles = try container.decode([TatReqProductArticles].self, forKey: .articles) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fulfillmentId = try container.decode(Int.self, forKey: .fulfillmentId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(fromPincode, forKey: .fromPincode) + + try? container.encodeIfPresent(articles, forKey: .articles) + + try? container.encodeIfPresent(fulfillmentId, forKey: .fulfillmentId) + } + } + + /* + Model: TatReqProductArticles + Used By: Logistic + */ + class TatReqProductArticles: Codable { + public var category: LogisticRequestCategory? + + public enum CodingKeys: String, CodingKey { + case category + } + + public init(category: LogisticRequestCategory?) { + self.category = category + } + + public func duplicate() -> TatReqProductArticles { + let dict = self.dictionary! + let copy = TatReqProductArticles(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + category = try container.decode(LogisticRequestCategory.self, forKey: .category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(category, forKey: .category) + } + } + + /* + Model: LogisticRequestCategory + Used By: Logistic + */ + class LogisticRequestCategory: Codable { + public var id: Int? + + public var level: String? + + public enum CodingKeys: String, CodingKey { + case id + + case level + } + + public init(id: Int?, level: String?) { + self.id = id + + self.level = level + } + + public func duplicate() -> LogisticRequestCategory { + let dict = self.dictionary! + let copy = LogisticRequestCategory(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + level = try container.decode(String.self, forKey: .level) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(level, forKey: .level) + } + } + + /* + Model: GetTatProductResponse + Used By: Logistic + */ + class GetTatProductResponse: Codable { + public var locationDetails: [LocationDetails] + + public var requestUuid: String + + public var error: [String: Any] + + public var toCity: String + + public var source: String + + public var toPincode: String + + public var action: String + + public var stormbreakerUuid: String + + public var success: Bool + + public var identifier: String + + public var journey: String + + public enum CodingKeys: String, CodingKey { + case locationDetails = "location_details" + + case requestUuid = "request_uuid" + + case error + + case toCity = "to_city" + + case source + + case toPincode = "to_pincode" + + case action + + case stormbreakerUuid = "stormbreaker_uuid" + + case success + + case identifier + + case journey + } + + public init(action: String, error: [String: Any], identifier: String, journey: String, locationDetails: [LocationDetails], requestUuid: String, source: String, stormbreakerUuid: String, success: Bool, toCity: String, toPincode: String) { + self.locationDetails = locationDetails + + self.requestUuid = requestUuid + + self.error = error + + self.toCity = toCity + + self.source = source + + self.toPincode = toPincode + + self.action = action + + self.stormbreakerUuid = stormbreakerUuid + + self.success = success + + self.identifier = identifier + + self.journey = journey + } + + public func duplicate() -> GetTatProductResponse { + let dict = self.dictionary! + let copy = GetTatProductResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + locationDetails = try container.decode([LocationDetails].self, forKey: .locationDetails) + + requestUuid = try container.decode(String.self, forKey: .requestUuid) + + error = try container.decode([String: Any].self, forKey: .error) + + toCity = try container.decode(String.self, forKey: .toCity) + + source = try container.decode(String.self, forKey: .source) + + toPincode = try container.decode(String.self, forKey: .toPincode) + + action = try container.decode(String.self, forKey: .action) + + stormbreakerUuid = try container.decode(String.self, forKey: .stormbreakerUuid) + + success = try container.decode(Bool.self, forKey: .success) + + identifier = try container.decode(String.self, forKey: .identifier) + + journey = try container.decode(String.self, forKey: .journey) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(locationDetails, forKey: .locationDetails) + + try? container.encodeIfPresent(requestUuid, forKey: .requestUuid) + + try? container.encodeIfPresent(error, forKey: .error) + + try? container.encodeIfPresent(toCity, forKey: .toCity) + + try? container.encodeIfPresent(source, forKey: .source) + + try? container.encodeIfPresent(toPincode, forKey: .toPincode) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(stormbreakerUuid, forKey: .stormbreakerUuid) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(identifier, forKey: .identifier) + + try? container.encodeIfPresent(journey, forKey: .journey) + } + } + + /* + Model: LocationDetails + Used By: Logistic + */ + class LocationDetails: Codable { + public var fromPincode: String? + + public var articles: [TatProductArticles]? + + public var fulfillmentId: Int? + + public enum CodingKeys: String, CodingKey { + case fromPincode = "from_pincode" + + case articles + + case fulfillmentId = "fulfillment_id" + } + + public init(articles: [TatProductArticles]?, fromPincode: String?, fulfillmentId: Int?) { + self.fromPincode = fromPincode + + self.articles = articles + + self.fulfillmentId = fulfillmentId + } + + public func duplicate() -> LocationDetails { + let dict = self.dictionary! + let copy = LocationDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + fromPincode = try container.decode(String.self, forKey: .fromPincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + articles = try container.decode([TatProductArticles].self, forKey: .articles) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fulfillmentId = try container.decode(Int.self, forKey: .fulfillmentId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(fromPincode, forKey: .fromPincode) + + try? container.encodeIfPresent(articles, forKey: .articles) + + try? container.encodeIfPresent(fulfillmentId, forKey: .fulfillmentId) + } + } + + /* + Model: TatProductArticles + Used By: Logistic + */ + class TatProductArticles: Codable { + public var error: [String: Any]? + + public var category: LogisticResponseCategory? + + public var promise: LogisticPromise? + + public enum CodingKeys: String, CodingKey { + case error + + case category + + case promise + } + + public init(category: LogisticResponseCategory?, error: [String: Any]?, promise: LogisticPromise?) { + self.error = error + + self.category = category + + self.promise = promise + } + + public func duplicate() -> TatProductArticles { + let dict = self.dictionary! + let copy = TatProductArticles(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + error = try container.decode([String: Any].self, forKey: .error) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + category = try container.decode(LogisticResponseCategory.self, forKey: .category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + promise = try container.decode(LogisticPromise.self, forKey: .promise) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(error, forKey: .error) + + try? container.encodeIfPresent(category, forKey: .category) + + try? container.encodeIfPresent(promise, forKey: .promise) + } + } + + /* + Model: LogisticResponseCategory + Used By: Logistic + */ + class LogisticResponseCategory: Codable { + public var id: Int? + + public var level: String? + + public enum CodingKeys: String, CodingKey { + case id + + case level + } + + public init(id: Int?, level: String?) { + self.id = id + + self.level = level + } + + public func duplicate() -> LogisticResponseCategory { + let dict = self.dictionary! + let copy = LogisticResponseCategory(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + level = try container.decode(String.self, forKey: .level) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(level, forKey: .level) + } + } + + /* + Model: LogisticPromise + Used By: Logistic + */ + class LogisticPromise: Codable { + public var timestamp: LogisticTimestamp? + + public var formatted: Formatted? + + public enum CodingKeys: String, CodingKey { + case timestamp + + case formatted + } + + public init(formatted: Formatted?, timestamp: LogisticTimestamp?) { + self.timestamp = timestamp + + self.formatted = formatted + } + + public func duplicate() -> LogisticPromise { + let dict = self.dictionary! + let copy = LogisticPromise(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + timestamp = try container.decode(LogisticTimestamp.self, forKey: .timestamp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + formatted = try container.decode(Formatted.self, forKey: .formatted) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(timestamp, forKey: .timestamp) + + try? container.encodeIfPresent(formatted, forKey: .formatted) + } + } + + /* + Model: LogisticTimestamp + Used By: Logistic + */ + class LogisticTimestamp: Codable { + public var min: Int? + + public var max: Int? + + public enum CodingKeys: String, CodingKey { + case min + + case max + } + + public init(max: Int?, min: Int?) { + self.min = min + + self.max = max + } + + public func duplicate() -> LogisticTimestamp { + let dict = self.dictionary! + let copy = LogisticTimestamp(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + min = try container.decode(Int.self, forKey: .min) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + max = try container.decode(Int.self, forKey: .max) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(min, forKey: .min) + + try? container.encodeIfPresent(max, forKey: .max) + } + } + + /* + Model: Formatted + Used By: Logistic + */ + class Formatted: Codable { + public var min: String? + + public var max: String? + + public enum CodingKeys: String, CodingKey { + case min + + case max + } + + public init(max: String?, min: String?) { + self.min = min + + self.max = max + } + + public func duplicate() -> Formatted { + let dict = self.dictionary! + let copy = Formatted(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + min = try container.decode(String.self, forKey: .min) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + max = try container.decode(String.self, forKey: .max) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(min, forKey: .min) + + try? container.encodeIfPresent(max, forKey: .max) + } + } +} diff --git a/Sources/code/application/models/OrderAppModelClass.swift b/Sources/code/application/models/OrderAppModelClass.swift new file mode 100644 index 0000000000..971c98cb76 --- /dev/null +++ b/Sources/code/application/models/OrderAppModelClass.swift @@ -0,0 +1,4292 @@ +import Foundation + +import Foundation +public extension ApplicationClient { + /* + Model: OrderById + Used By: Order + */ + class OrderById: Codable { + public var order: OrderSchema + + public enum CodingKeys: String, CodingKey { + case order + } + + public init(order: OrderSchema) { + self.order = order + } + + public func duplicate() -> OrderById { + let dict = self.dictionary! + let copy = OrderById(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + order = try container.decode(OrderSchema.self, forKey: .order) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(order, forKey: .order) + } + } + + /* + Model: OrderList + Used By: Order + */ + class OrderList: Codable { + public var items: [OrderSchema] + + public var page: OrderPage + + public var filters: OrderFilters + + public enum CodingKeys: String, CodingKey { + case items + + case page + + case filters + } + + public init(filters: OrderFilters, items: [OrderSchema], page: OrderPage) { + self.items = items + + self.page = page + + self.filters = filters + } + + public func duplicate() -> OrderList { + let dict = self.dictionary! + let copy = OrderList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + items = try container.decode([OrderSchema].self, forKey: .items) + + page = try container.decode(OrderPage.self, forKey: .page) + + filters = try container.decode(OrderFilters.self, forKey: .filters) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(filters, forKey: .filters) + } + } + + /* + Model: OrderPage + Used By: Order + */ + class OrderPage: Codable { + public var itemTotal: Int? + + public var type: String? + + public var size: Int? + + public var current: Int? + + public var hasNext: Bool? + + public enum CodingKeys: String, CodingKey { + case itemTotal = "item_total" + + case type + + case size + + case current + + case hasNext = "has_next" + } + + public init(current: Int?, hasNext: Bool?, itemTotal: Int?, size: Int?, type: String?) { + self.itemTotal = itemTotal + + self.type = type + + self.size = size + + self.current = current + + self.hasNext = hasNext + } + + public func duplicate() -> OrderPage { + let dict = self.dictionary! + let copy = OrderPage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + itemTotal = try container.decode(Int.self, forKey: .itemTotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(Int.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + current = try container.decode(Int.self, forKey: .current) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasNext = try container.decode(Bool.self, forKey: .hasNext) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(current, forKey: .current) + + try? container.encodeIfPresent(hasNext, forKey: .hasNext) + } + } + + /* + Model: OrderFilters + Used By: Order + */ + class OrderFilters: Codable { + public var statuses: [OrderStatuses]? + + public enum CodingKeys: String, CodingKey { + case statuses + } + + public init(statuses: [OrderStatuses]?) { + self.statuses = statuses + } + + public func duplicate() -> OrderFilters { + let dict = self.dictionary! + let copy = OrderFilters(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + statuses = try container.decode([OrderStatuses].self, forKey: .statuses) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(statuses, forKey: .statuses) + } + } + + /* + Model: OrderStatuses + Used By: Order + */ + class OrderStatuses: Codable { + public var display: String? + + public var value: Int? + + public var isSelected: Bool? + + public enum CodingKeys: String, CodingKey { + case display + + case value + + case isSelected = "is_selected" + } + + public init(display: String?, isSelected: Bool?, value: Int?) { + self.display = display + + self.value = value + + self.isSelected = isSelected + } + + public func duplicate() -> OrderStatuses { + let dict = self.dictionary! + let copy = OrderStatuses(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(Int.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isSelected = try container.decode(Bool.self, forKey: .isSelected) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(isSelected, forKey: .isSelected) + } + } + + /* + Model: ReqBodyVerifyOTPShipment + Used By: Order + */ + class ReqBodyVerifyOTPShipment: Codable { + public var requestId: String + + public var otpCode: String + + public enum CodingKeys: String, CodingKey { + case requestId = "request_id" + + case otpCode = "otp_code" + } + + public init(otpCode: String, requestId: String) { + self.requestId = requestId + + self.otpCode = otpCode + } + + public func duplicate() -> ReqBodyVerifyOTPShipment { + let dict = self.dictionary! + let copy = ReqBodyVerifyOTPShipment(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + requestId = try container.decode(String.self, forKey: .requestId) + + otpCode = try container.decode(String.self, forKey: .otpCode) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(otpCode, forKey: .otpCode) + } + } + + /* + Model: ResponseVerifyOTPShipment + Used By: Order + */ + class ResponseVerifyOTPShipment: Codable { + public var success: Bool + + public enum CodingKeys: String, CodingKey { + case success + } + + public init(success: Bool) { + self.success = success + } + + public func duplicate() -> ResponseVerifyOTPShipment { + let dict = self.dictionary! + let copy = ResponseVerifyOTPShipment(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: sendOTPApplicationResponse + Used By: Order + */ + class sendOTPApplicationResponse: Codable { + public var success: Bool + + public var requestId: String + + public var message: String + + public var resendTimer: Int + + public enum CodingKeys: String, CodingKey { + case success + + case requestId = "request_id" + + case message + + case resendTimer = "resend_timer" + } + + public init(message: String, requestId: String, resendTimer: Int, success: Bool) { + self.success = success + + self.requestId = requestId + + self.message = message + + self.resendTimer = resendTimer + } + + public func duplicate() -> sendOTPApplicationResponse { + let dict = self.dictionary! + let copy = sendOTPApplicationResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + requestId = try container.decode(String.self, forKey: .requestId) + + message = try container.decode(String.self, forKey: .message) + + resendTimer = try container.decode(Int.self, forKey: .resendTimer) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(resendTimer, forKey: .resendTimer) + } + } + + /* + Model: ShipmentById + Used By: Order + */ + class ShipmentById: Codable { + public var shipment: Shipments + + public enum CodingKeys: String, CodingKey { + case shipment + } + + public init(shipment: Shipments) { + self.shipment = shipment + } + + public func duplicate() -> ShipmentById { + let dict = self.dictionary! + let copy = ShipmentById(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + shipment = try container.decode(Shipments.self, forKey: .shipment) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(shipment, forKey: .shipment) + } + } + + /* + Model: CustomerDetailsByShipmentId + Used By: Order + */ + class CustomerDetailsByShipmentId: Codable { + public var orderId: String + + public var shipmentId: String + + public var name: String + + public var phone: String + + public var country: String + + public enum CodingKeys: String, CodingKey { + case orderId = "order_id" + + case shipmentId = "shipment_id" + + case name + + case phone + + case country + } + + public init(country: String, name: String, orderId: String, phone: String, shipmentId: String) { + self.orderId = orderId + + self.shipmentId = shipmentId + + self.name = name + + self.phone = phone + + self.country = country + } + + public func duplicate() -> CustomerDetailsByShipmentId { + let dict = self.dictionary! + let copy = CustomerDetailsByShipmentId(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + orderId = try container.decode(String.self, forKey: .orderId) + + shipmentId = try container.decode(String.self, forKey: .shipmentId) + + name = try container.decode(String.self, forKey: .name) + + phone = try container.decode(String.self, forKey: .phone) + + country = try container.decode(String.self, forKey: .country) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + + try? container.encodeIfPresent(shipmentId, forKey: .shipmentId) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(country, forKey: .country) + } + } + + /* + Model: ShipmentReasons + Used By: Order + */ + class ShipmentReasons: Codable { + public var reasons: [Reasons] + + public enum CodingKeys: String, CodingKey { + case reasons + } + + public init(reasons: [Reasons]) { + self.reasons = reasons + } + + public func duplicate() -> ShipmentReasons { + let dict = self.dictionary! + let copy = ShipmentReasons(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + reasons = try container.decode([Reasons].self, forKey: .reasons) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(reasons, forKey: .reasons) + } + } + + /* + Model: ShipmentStatusUpdateBody + Used By: Order + */ + class ShipmentStatusUpdateBody: Codable { + public var statuses: [StatusesBody] + + public var forceTransition: Bool + + public enum CodingKeys: String, CodingKey { + case statuses + + case forceTransition = "force_transition" + } + + public init(forceTransition: Bool, statuses: [StatusesBody]) { + self.statuses = statuses + + self.forceTransition = forceTransition + } + + public func duplicate() -> ShipmentStatusUpdateBody { + let dict = self.dictionary! + let copy = ShipmentStatusUpdateBody(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + statuses = try container.decode([StatusesBody].self, forKey: .statuses) + + forceTransition = try container.decode(Bool.self, forKey: .forceTransition) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(statuses, forKey: .statuses) + + try? container.encodeIfPresent(forceTransition, forKey: .forceTransition) + } + } + + /* + Model: StatusesBody + Used By: Order + */ + class StatusesBody: Codable { + public var status: String? + + public var shipments: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case status + + case shipments + } + + public init(shipments: [String: Any]?, status: String?) { + self.status = status + + self.shipments = shipments + } + + public func duplicate() -> StatusesBody { + let dict = self.dictionary! + let copy = StatusesBody(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shipments = try container.decode([String: Any].self, forKey: .shipments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(shipments, forKey: .shipments) + } + } + + /* + Model: ShipmentStatusUpdate + Used By: Order + */ + class ShipmentStatusUpdate: Codable { + public var message: [[String: Any]] + + public var status: Bool + + public enum CodingKeys: String, CodingKey { + case message + + case status + } + + public init(message: [[String: Any]], status: Bool) { + self.message = message + + self.status = status + } + + public func duplicate() -> ShipmentStatusUpdate { + let dict = self.dictionary! + let copy = ShipmentStatusUpdate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + message = try container.decode([[String: Any]].self, forKey: .message) + + status = try container.decode(Bool.self, forKey: .status) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: ShipmentTrack + Used By: Order + */ + class ShipmentTrack: Codable { + public var results: [Track] + + public enum CodingKeys: String, CodingKey { + case results + } + + public init(results: [Track]) { + self.results = results + } + + public func duplicate() -> ShipmentTrack { + let dict = self.dictionary! + let copy = ShipmentTrack(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + results = try container.decode([Track].self, forKey: .results) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(results, forKey: .results) + } + } + + /* + Model: OrderSchema + Used By: Order + */ + class OrderSchema: Codable { + public var orderId: String? + + public var breakupValues: [BreakupValues]? + + public var orderCreatedTime: String? + + public var shipments: [Shipments]? + + public var totalShipmentsInOrder: Int? + + public var userInfo: UserInfo? + + public var bagsForReorder: [BagsForReorder]? + + public enum CodingKeys: String, CodingKey { + case orderId = "order_id" + + case breakupValues = "breakup_values" + + case orderCreatedTime = "order_created_time" + + case shipments + + case totalShipmentsInOrder = "total_shipments_in_order" + + case userInfo = "user_info" + + case bagsForReorder = "bags_for_reorder" + } + + public init(bagsForReorder: [BagsForReorder]?, breakupValues: [BreakupValues]?, orderCreatedTime: String?, orderId: String?, shipments: [Shipments]?, totalShipmentsInOrder: Int?, userInfo: UserInfo?) { + self.orderId = orderId + + self.breakupValues = breakupValues + + self.orderCreatedTime = orderCreatedTime + + self.shipments = shipments + + self.totalShipmentsInOrder = totalShipmentsInOrder + + self.userInfo = userInfo + + self.bagsForReorder = bagsForReorder + } + + public func duplicate() -> OrderSchema { + let dict = self.dictionary! + let copy = OrderSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + orderId = try container.decode(String.self, forKey: .orderId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + breakupValues = try container.decode([BreakupValues].self, forKey: .breakupValues) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderCreatedTime = try container.decode(String.self, forKey: .orderCreatedTime) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shipments = try container.decode([Shipments].self, forKey: .shipments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalShipmentsInOrder = try container.decode(Int.self, forKey: .totalShipmentsInOrder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userInfo = try container.decode(UserInfo.self, forKey: .userInfo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bagsForReorder = try container.decode([BagsForReorder].self, forKey: .bagsForReorder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + + try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) + + try? container.encodeIfPresent(orderCreatedTime, forKey: .orderCreatedTime) + + try? container.encodeIfPresent(shipments, forKey: .shipments) + + try? container.encodeIfPresent(totalShipmentsInOrder, forKey: .totalShipmentsInOrder) + + try? container.encodeIfPresent(userInfo, forKey: .userInfo) + + try? container.encodeIfPresent(bagsForReorder, forKey: .bagsForReorder) + } + } + + /* + Model: BagsForReorder + Used By: Order + */ + class BagsForReorder: Codable { + public var itemId: Int? + + public var itemSize: String? + + public var storeId: Int? + + public var sellerId: Int? + + public var quantity: Int? + + public var articleAssignment: BagsForReorderArticleAssignment? + + public enum CodingKeys: String, CodingKey { + case itemId = "item_id" + + case itemSize = "item_size" + + case storeId = "store_id" + + case sellerId = "seller_id" + + case quantity + + case articleAssignment = "article_assignment" + } + + public init(articleAssignment: BagsForReorderArticleAssignment?, itemId: Int?, itemSize: String?, quantity: Int?, sellerId: Int?, storeId: Int?) { + self.itemId = itemId + + self.itemSize = itemSize + + self.storeId = storeId + + self.sellerId = sellerId + + self.quantity = quantity + + self.articleAssignment = articleAssignment + } + + public func duplicate() -> BagsForReorder { + let dict = self.dictionary! + let copy = BagsForReorder(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + itemId = try container.decode(Int.self, forKey: .itemId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemSize = try container.decode(String.self, forKey: .itemSize) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeId = try container.decode(Int.self, forKey: .storeId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sellerId = try container.decode(Int.self, forKey: .sellerId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + articleAssignment = try container.decode(BagsForReorderArticleAssignment.self, forKey: .articleAssignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(itemId, forKey: .itemId) + + try? container.encodeIfPresent(itemSize, forKey: .itemSize) + + try? container.encodeIfPresent(storeId, forKey: .storeId) + + try? container.encodeIfPresent(sellerId, forKey: .sellerId) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(articleAssignment, forKey: .articleAssignment) + } + } + + /* + Model: BagsForReorderArticleAssignment + Used By: Order + */ + class BagsForReorderArticleAssignment: Codable { + public var level: String? + + public var strategy: String? + + public enum CodingKeys: String, CodingKey { + case level + + case strategy + } + + public init(level: String?, strategy: String?) { + self.level = level + + self.strategy = strategy + } + + public func duplicate() -> BagsForReorderArticleAssignment { + let dict = self.dictionary! + let copy = BagsForReorderArticleAssignment(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + level = try container.decode(String.self, forKey: .level) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + strategy = try container.decode(String.self, forKey: .strategy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(level, forKey: .level) + + try? container.encodeIfPresent(strategy, forKey: .strategy) + } + } + + /* + Model: PosOrderById + Used By: Order + */ + class PosOrderById: Codable { + public var order: OrderSchema + + public enum CodingKeys: String, CodingKey { + case order + } + + public init(order: OrderSchema) { + self.order = order + } + + public func duplicate() -> PosOrderById { + let dict = self.dictionary! + let copy = PosOrderById(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + order = try container.decode(OrderSchema.self, forKey: .order) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(order, forKey: .order) + } + } + + /* + Model: Bags + Used By: Order + */ + class Bags: Codable { + public var item: Item? + + public var prices: Prices? + + public var currentStatus: CurrentStatus? + + public var id: Int? + + public var financialBreakup: [FinancialBreakup]? + + public enum CodingKeys: String, CodingKey { + case item + + case prices + + case currentStatus = "current_status" + + case id + + case financialBreakup = "financial_breakup" + } + + public init(currentStatus: CurrentStatus?, financialBreakup: [FinancialBreakup]?, id: Int?, item: Item?, prices: Prices?) { + self.item = item + + self.prices = prices + + self.currentStatus = currentStatus + + self.id = id + + self.financialBreakup = financialBreakup + } + + public func duplicate() -> Bags { + let dict = self.dictionary! + let copy = Bags(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + item = try container.decode(Item.self, forKey: .item) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + prices = try container.decode(Prices.self, forKey: .prices) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currentStatus = try container.decode(CurrentStatus.self, forKey: .currentStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + financialBreakup = try container.decode([FinancialBreakup].self, forKey: .financialBreakup) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(item, forKey: .item) + + try? container.encodeIfPresent(prices, forKey: .prices) + + try? container.encodeIfPresent(currentStatus, forKey: .currentStatus) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(financialBreakup, forKey: .financialBreakup) + } + } + + /* + Model: Item + Used By: Order + */ + class Item: Codable { + public var brand: ItemBrand? + + public var name: String? + + public var size: String? + + public var slugKey: String? + + public var image: [String]? + + public var code: String? + + public var id: Double? + + public enum CodingKeys: String, CodingKey { + case brand + + case name + + case size + + case slugKey = "slug_key" + + case image + + case code + + case id + } + + public init(brand: ItemBrand?, code: String?, id: Double?, image: [String]?, name: String?, size: String?, slugKey: String?) { + self.brand = brand + + self.name = name + + self.size = size + + self.slugKey = slugKey + + self.image = image + + self.code = code + + self.id = id + } + + public func duplicate() -> Item { + let dict = self.dictionary! + let copy = Item(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + brand = try container.decode(ItemBrand.self, forKey: .brand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(String.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slugKey = try container.decode(String.self, forKey: .slugKey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + image = try container.decode([String].self, forKey: .image) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(Double.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(brand, forKey: .brand) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(slugKey, forKey: .slugKey) + + try? container.encodeIfPresent(image, forKey: .image) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: Prices + Used By: Order + */ + class Prices: Codable { + public var amountPaidRoundoff: Double? + + public var fyndCredits: Double? + + public var codCharges: Double? + + public var cashback: Double? + + public var addedToFyndCash: Bool? + + public var priceMarked: Double? + + public var transferPrice: Double? + + public var couponValue: Double? + + public var priceEffective: Double? + + public var refundCredit: Double? + + public var amountPaid: Double? + + public var refundAmount: Double? + + public var cashbackApplied: Double? + + public var gstTaxPercentage: Double? + + public var valueOfGood: Double? + + public var brandCalculatedAmount: Double? + + public var promotionEffectiveDiscount: Double? + + public var discount: Double? + + public var couponEffectiveDiscount: Double? + + public var deliveryCharge: Double? + + public enum CodingKeys: String, CodingKey { + case amountPaidRoundoff = "amount_paid_roundoff" + + case fyndCredits = "fynd_credits" + + case codCharges = "cod_charges" + + case cashback + + case addedToFyndCash = "added_to_fynd_cash" + + case priceMarked = "price_marked" + + case transferPrice = "transfer_price" + + case couponValue = "coupon_value" + + case priceEffective = "price_effective" + + case refundCredit = "refund_credit" + + case amountPaid = "amount_paid" + + case refundAmount = "refund_amount" + + case cashbackApplied = "cashback_applied" + + case gstTaxPercentage = "gst_tax_percentage" + + case valueOfGood = "value_of_good" + + case brandCalculatedAmount = "brand_calculated_amount" + + case promotionEffectiveDiscount = "promotion_effective_discount" + + case discount + + case couponEffectiveDiscount = "coupon_effective_discount" + + case deliveryCharge = "delivery_charge" + } + + public init(addedToFyndCash: Bool?, amountPaid: Double?, amountPaidRoundoff: Double?, brandCalculatedAmount: Double?, cashback: Double?, cashbackApplied: Double?, codCharges: Double?, couponEffectiveDiscount: Double?, couponValue: Double?, deliveryCharge: Double?, discount: Double?, fyndCredits: Double?, gstTaxPercentage: Double?, priceEffective: Double?, priceMarked: Double?, promotionEffectiveDiscount: Double?, refundAmount: Double?, refundCredit: Double?, transferPrice: Double?, valueOfGood: Double?) { + self.amountPaidRoundoff = amountPaidRoundoff + + self.fyndCredits = fyndCredits + + self.codCharges = codCharges + + self.cashback = cashback + + self.addedToFyndCash = addedToFyndCash + + self.priceMarked = priceMarked + + self.transferPrice = transferPrice + + self.couponValue = couponValue + + self.priceEffective = priceEffective + + self.refundCredit = refundCredit + + self.amountPaid = amountPaid + + self.refundAmount = refundAmount + + self.cashbackApplied = cashbackApplied + + self.gstTaxPercentage = gstTaxPercentage + + self.valueOfGood = valueOfGood + + self.brandCalculatedAmount = brandCalculatedAmount + + self.promotionEffectiveDiscount = promotionEffectiveDiscount + + self.discount = discount + + self.couponEffectiveDiscount = couponEffectiveDiscount + + self.deliveryCharge = deliveryCharge + } + + public func duplicate() -> Prices { + let dict = self.dictionary! + let copy = Prices(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + amountPaidRoundoff = try container.decode(Double.self, forKey: .amountPaidRoundoff) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fyndCredits = try container.decode(Double.self, forKey: .fyndCredits) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + codCharges = try container.decode(Double.self, forKey: .codCharges) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cashback = try container.decode(Double.self, forKey: .cashback) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addedToFyndCash = try container.decode(Bool.self, forKey: .addedToFyndCash) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priceMarked = try container.decode(Double.self, forKey: .priceMarked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + transferPrice = try container.decode(Double.self, forKey: .transferPrice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + couponValue = try container.decode(Double.self, forKey: .couponValue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priceEffective = try container.decode(Double.self, forKey: .priceEffective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refundCredit = try container.decode(Double.self, forKey: .refundCredit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + amountPaid = try container.decode(Double.self, forKey: .amountPaid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refundAmount = try container.decode(Double.self, forKey: .refundAmount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cashbackApplied = try container.decode(Double.self, forKey: .cashbackApplied) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstTaxPercentage = try container.decode(Double.self, forKey: .gstTaxPercentage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + valueOfGood = try container.decode(Double.self, forKey: .valueOfGood) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandCalculatedAmount = try container.decode(Double.self, forKey: .brandCalculatedAmount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + promotionEffectiveDiscount = try container.decode(Double.self, forKey: .promotionEffectiveDiscount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discount = try container.decode(Double.self, forKey: .discount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + couponEffectiveDiscount = try container.decode(Double.self, forKey: .couponEffectiveDiscount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryCharge = try container.decode(Double.self, forKey: .deliveryCharge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amountPaidRoundoff, forKey: .amountPaidRoundoff) + + try? container.encodeIfPresent(fyndCredits, forKey: .fyndCredits) + + try? container.encodeIfPresent(codCharges, forKey: .codCharges) + + try? container.encodeIfPresent(cashback, forKey: .cashback) + + try? container.encodeIfPresent(addedToFyndCash, forKey: .addedToFyndCash) + + try? container.encodeIfPresent(priceMarked, forKey: .priceMarked) + + try? container.encodeIfPresent(transferPrice, forKey: .transferPrice) + + try? container.encodeIfPresent(couponValue, forKey: .couponValue) + + try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) + + try? container.encodeIfPresent(refundCredit, forKey: .refundCredit) + + try? container.encodeIfPresent(amountPaid, forKey: .amountPaid) + + try? container.encodeIfPresent(refundAmount, forKey: .refundAmount) + + try? container.encodeIfPresent(cashbackApplied, forKey: .cashbackApplied) + + try? container.encodeIfPresent(gstTaxPercentage, forKey: .gstTaxPercentage) + + try? container.encodeIfPresent(valueOfGood, forKey: .valueOfGood) + + try? container.encodeIfPresent(brandCalculatedAmount, forKey: .brandCalculatedAmount) + + try? container.encodeIfPresent(promotionEffectiveDiscount, forKey: .promotionEffectiveDiscount) + + try? container.encodeIfPresent(discount, forKey: .discount) + + try? container.encodeIfPresent(couponEffectiveDiscount, forKey: .couponEffectiveDiscount) + + try? container.encodeIfPresent(deliveryCharge, forKey: .deliveryCharge) + } + } + + /* + Model: CurrentStatus + Used By: Order + */ + class CurrentStatus: Codable { + public var updatedAt: String? + + public var status: String? + + public var name: String? + + public var journeyType: String? + + public enum CodingKeys: String, CodingKey { + case updatedAt = "updated_at" + + case status + + case name + + case journeyType = "journey_type" + } + + public init(journeyType: String?, name: String?, status: String?, updatedAt: String?) { + self.updatedAt = updatedAt + + self.status = status + + self.name = name + + self.journeyType = journeyType + } + + public func duplicate() -> CurrentStatus { + let dict = self.dictionary! + let copy = CurrentStatus(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + journeyType = try container.decode(String.self, forKey: .journeyType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(journeyType, forKey: .journeyType) + } + } + + /* + Model: FinancialBreakup + Used By: Order + */ + class FinancialBreakup: Codable { + public var brandCalculatedAmount: Double? + + public var couponValue: Double? + + public var amountPaidRoundoff: Double? + + public var gstFee: String? + + public var refundCredit: Double? + + public var cashback: Double? + + public var refundAmount: Double? + + public var valueOfGood: Double? + + public var promotionEffectiveDiscount: Double? + + public var size: String? + + public var totalUnits: Int? + + public var discount: Double? + + public var amountPaid: Double? + + public var fyndCredits: Double? + + public var addedToFyndCash: Bool? + + public var deliveryCharge: Double? + + public var hsnCode: String? + + public var couponEffectiveDiscount: Double? + + public var transferPrice: Double? + + public var identifiers: Identifiers? + + public var gstTag: String? + + public var priceMarked: Double? + + public var priceEffective: Double? + + public var codCharges: Double? + + public var itemName: String? + + public var cashbackApplied: Double? + + public var gstTaxPercentage: Double? + + public enum CodingKeys: String, CodingKey { + case brandCalculatedAmount = "brand_calculated_amount" + + case couponValue = "coupon_value" + + case amountPaidRoundoff = "amount_paid_roundoff" + + case gstFee = "gst_fee" + + case refundCredit = "refund_credit" + + case cashback + + case refundAmount = "refund_amount" + + case valueOfGood = "value_of_good" + + case promotionEffectiveDiscount = "promotion_effective_discount" + + case size + + case totalUnits = "total_units" + + case discount + + case amountPaid = "amount_paid" + + case fyndCredits = "fynd_credits" + + case addedToFyndCash = "added_to_fynd_cash" + + case deliveryCharge = "delivery_charge" + + case hsnCode = "hsn_code" + + case couponEffectiveDiscount = "coupon_effective_discount" + + case transferPrice = "transfer_price" + + case identifiers + + case gstTag = "gst_tag" + + case priceMarked = "price_marked" + + case priceEffective = "price_effective" + + case codCharges = "cod_charges" + + case itemName = "item_name" + + case cashbackApplied = "cashback_applied" + + case gstTaxPercentage = "gst_tax_percentage" + } + + public init(addedToFyndCash: Bool?, amountPaid: Double?, amountPaidRoundoff: Double?, brandCalculatedAmount: Double?, cashback: Double?, cashbackApplied: Double?, codCharges: Double?, couponEffectiveDiscount: Double?, couponValue: Double?, deliveryCharge: Double?, discount: Double?, fyndCredits: Double?, gstFee: String?, gstTag: String?, gstTaxPercentage: Double?, hsnCode: String?, identifiers: Identifiers?, itemName: String?, priceEffective: Double?, priceMarked: Double?, promotionEffectiveDiscount: Double?, refundAmount: Double?, refundCredit: Double?, size: String?, totalUnits: Int?, transferPrice: Double?, valueOfGood: Double?) { + self.brandCalculatedAmount = brandCalculatedAmount + + self.couponValue = couponValue + + self.amountPaidRoundoff = amountPaidRoundoff + + self.gstFee = gstFee + + self.refundCredit = refundCredit + + self.cashback = cashback + + self.refundAmount = refundAmount + + self.valueOfGood = valueOfGood + + self.promotionEffectiveDiscount = promotionEffectiveDiscount + + self.size = size + + self.totalUnits = totalUnits + + self.discount = discount + + self.amountPaid = amountPaid + + self.fyndCredits = fyndCredits + + self.addedToFyndCash = addedToFyndCash + + self.deliveryCharge = deliveryCharge + + self.hsnCode = hsnCode + + self.couponEffectiveDiscount = couponEffectiveDiscount + + self.transferPrice = transferPrice + + self.identifiers = identifiers + + self.gstTag = gstTag + + self.priceMarked = priceMarked + + self.priceEffective = priceEffective + + self.codCharges = codCharges + + self.itemName = itemName + + self.cashbackApplied = cashbackApplied + + self.gstTaxPercentage = gstTaxPercentage + } + + public func duplicate() -> FinancialBreakup { + let dict = self.dictionary! + let copy = FinancialBreakup(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + brandCalculatedAmount = try container.decode(Double.self, forKey: .brandCalculatedAmount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + couponValue = try container.decode(Double.self, forKey: .couponValue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + amountPaidRoundoff = try container.decode(Double.self, forKey: .amountPaidRoundoff) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstFee = try container.decode(String.self, forKey: .gstFee) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refundCredit = try container.decode(Double.self, forKey: .refundCredit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cashback = try container.decode(Double.self, forKey: .cashback) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refundAmount = try container.decode(Double.self, forKey: .refundAmount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + valueOfGood = try container.decode(Double.self, forKey: .valueOfGood) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + promotionEffectiveDiscount = try container.decode(Double.self, forKey: .promotionEffectiveDiscount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(String.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalUnits = try container.decode(Int.self, forKey: .totalUnits) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discount = try container.decode(Double.self, forKey: .discount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + amountPaid = try container.decode(Double.self, forKey: .amountPaid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fyndCredits = try container.decode(Double.self, forKey: .fyndCredits) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addedToFyndCash = try container.decode(Bool.self, forKey: .addedToFyndCash) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryCharge = try container.decode(Double.self, forKey: .deliveryCharge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hsnCode = try container.decode(String.self, forKey: .hsnCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + couponEffectiveDiscount = try container.decode(Double.self, forKey: .couponEffectiveDiscount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + transferPrice = try container.decode(Double.self, forKey: .transferPrice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + identifiers = try container.decode(Identifiers.self, forKey: .identifiers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstTag = try container.decode(String.self, forKey: .gstTag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priceMarked = try container.decode(Double.self, forKey: .priceMarked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priceEffective = try container.decode(Double.self, forKey: .priceEffective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + codCharges = try container.decode(Double.self, forKey: .codCharges) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemName = try container.decode(String.self, forKey: .itemName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cashbackApplied = try container.decode(Double.self, forKey: .cashbackApplied) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstTaxPercentage = try container.decode(Double.self, forKey: .gstTaxPercentage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(brandCalculatedAmount, forKey: .brandCalculatedAmount) + + try? container.encodeIfPresent(couponValue, forKey: .couponValue) + + try? container.encodeIfPresent(amountPaidRoundoff, forKey: .amountPaidRoundoff) + + try? container.encodeIfPresent(gstFee, forKey: .gstFee) + + try? container.encodeIfPresent(refundCredit, forKey: .refundCredit) + + try? container.encodeIfPresent(cashback, forKey: .cashback) + + try? container.encodeIfPresent(refundAmount, forKey: .refundAmount) + + try? container.encodeIfPresent(valueOfGood, forKey: .valueOfGood) + + try? container.encodeIfPresent(promotionEffectiveDiscount, forKey: .promotionEffectiveDiscount) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(totalUnits, forKey: .totalUnits) + + try? container.encodeIfPresent(discount, forKey: .discount) + + try? container.encodeIfPresent(amountPaid, forKey: .amountPaid) + + try? container.encodeIfPresent(fyndCredits, forKey: .fyndCredits) + + try? container.encodeIfPresent(addedToFyndCash, forKey: .addedToFyndCash) + + try? container.encodeIfPresent(deliveryCharge, forKey: .deliveryCharge) + + try? container.encodeIfPresent(hsnCode, forKey: .hsnCode) + + try? container.encodeIfPresent(couponEffectiveDiscount, forKey: .couponEffectiveDiscount) + + try? container.encodeIfPresent(transferPrice, forKey: .transferPrice) + + try? container.encodeIfPresent(identifiers, forKey: .identifiers) + + try? container.encodeIfPresent(gstTag, forKey: .gstTag) + + try? container.encodeIfPresent(priceMarked, forKey: .priceMarked) + + try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) + + try? container.encodeIfPresent(codCharges, forKey: .codCharges) + + try? container.encodeIfPresent(itemName, forKey: .itemName) + + try? container.encodeIfPresent(cashbackApplied, forKey: .cashbackApplied) + + try? container.encodeIfPresent(gstTaxPercentage, forKey: .gstTaxPercentage) + } + } + + /* + Model: Identifiers + Used By: Order + */ + class Identifiers: Codable { + public var ean: String? + + public var skuCode: String? + + public enum CodingKeys: String, CodingKey { + case ean + + case skuCode = "sku_code" + } + + public init(ean: String?, skuCode: String?) { + self.ean = ean + + self.skuCode = skuCode + } + + public func duplicate() -> Identifiers { + let dict = self.dictionary! + let copy = Identifiers(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + ean = try container.decode(String.self, forKey: .ean) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + skuCode = try container.decode(String.self, forKey: .skuCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(ean, forKey: .ean) + + try? container.encodeIfPresent(skuCode, forKey: .skuCode) + } + } + + /* + Model: ItemBrand + Used By: Order + */ + class ItemBrand: Codable { + public var name: String? + + public var logo: String? + + public enum CodingKeys: String, CodingKey { + case name + + case logo + } + + public init(logo: String?, name: String?) { + self.name = name + + self.logo = logo + } + + public func duplicate() -> ItemBrand { + let dict = self.dictionary! + let copy = ItemBrand(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(logo, forKey: .logo) + } + } + + /* + Model: BreakupValues + Used By: Order + */ + class BreakupValues: Codable { + public var display: String? + + public var value: Double? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case display + + case value + + case name + } + + public init(display: String?, name: String?, value: Double?) { + self.display = display + + self.value = value + + self.name = name + } + + public func duplicate() -> BreakupValues { + let dict = self.dictionary! + let copy = BreakupValues(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(Double.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: DeliveryAddress + Used By: Order + */ + class DeliveryAddress: Codable { + public var pincode: String? + + public var landmark: String? + + public var contactPerson: String? + + public var phone: String? + + public var state: String? + + public var version: String? + + public var address1: String? + + public var createdAt: String? + + public var addressType: String? + + public var addressCategory: String? + + public var area: String? + + public var city: String? + + public var latitude: Double? + + public var longitude: Double? + + public var email: String? + + public var country: String? + + public var address2: String? + + public var updatedAt: String? + + public var name: String? + + public var address: String? + + public enum CodingKeys: String, CodingKey { + case pincode + + case landmark + + case contactPerson = "contact_person" + + case phone + + case state + + case version + + case address1 + + case createdAt = "created_at" + + case addressType = "address_type" + + case addressCategory = "address_category" + + case area + + case city + + case latitude + + case longitude + + case email + + case country + + case address2 + + case updatedAt = "updated_at" + + case name + + case address + } + + public init(address: String?, address1: String?, address2: String?, addressCategory: String?, addressType: String?, area: String?, city: String?, contactPerson: String?, country: String?, createdAt: String?, email: String?, landmark: String?, latitude: Double?, longitude: Double?, name: String?, phone: String?, pincode: String?, state: String?, updatedAt: String?, version: String?) { + self.pincode = pincode + + self.landmark = landmark + + self.contactPerson = contactPerson + + self.phone = phone + + self.state = state + + self.version = version + + self.address1 = address1 + + self.createdAt = createdAt + + self.addressType = addressType + + self.addressCategory = addressCategory + + self.area = area + + self.city = city + + self.latitude = latitude + + self.longitude = longitude + + self.email = email + + self.country = country + + self.address2 = address2 + + self.updatedAt = updatedAt + + self.name = name + + self.address = address + } + + public func duplicate() -> DeliveryAddress { + let dict = self.dictionary! + let copy = DeliveryAddress(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + pincode = try container.decode(String.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + landmark = try container.decode(String.self, forKey: .landmark) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contactPerson = try container.decode(String.self, forKey: .contactPerson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + version = try container.decode(String.self, forKey: .version) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address1 = try container.decode(String.self, forKey: .address1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressType = try container.decode(String.self, forKey: .addressType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressCategory = try container.decode(String.self, forKey: .addressCategory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + area = try container.decode(String.self, forKey: .area) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + latitude = try container.decode(Double.self, forKey: .latitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + longitude = try container.decode(Double.self, forKey: .longitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address2 = try container.decode(String.self, forKey: .address2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address = try container.decode(String.self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(landmark, forKey: .landmark) + + try? container.encodeIfPresent(contactPerson, forKey: .contactPerson) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(version, forKey: .version) + + try? container.encodeIfPresent(address1, forKey: .address1) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(addressType, forKey: .addressType) + + try? container.encodeIfPresent(addressCategory, forKey: .addressCategory) + + try? container.encodeIfPresent(area, forKey: .area) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(latitude, forKey: .latitude) + + try? container.encodeIfPresent(longitude, forKey: .longitude) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(address2, forKey: .address2) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(address, forKey: .address) + } + } + + /* + Model: FulfillingStore + Used By: Order + */ + class FulfillingStore: Codable { + public var code: String? + + public var id: Int? + + public var name: String? + + public var companyId: Int? + + public var companyName: String? + + public enum CodingKeys: String, CodingKey { + case code + + case id + + case name + + case companyId = "company_id" + + case companyName = "company_name" + } + + public init(code: String?, companyId: Int?, companyName: String?, id: Int?, name: String?) { + self.code = code + + self.id = id + + self.name = name + + self.companyId = companyId + + self.companyName = companyName + } + + public func duplicate() -> FulfillingStore { + let dict = self.dictionary! + let copy = FulfillingStore(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyName = try container.decode(String.self, forKey: .companyName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(companyName, forKey: .companyName) + } + } + + /* + Model: Invoice + Used By: Order + */ + class Invoice: Codable { + public var updatedDate: String? + + public var invoiceUrl: String? + + public var labelUrl: String? + + public enum CodingKeys: String, CodingKey { + case updatedDate = "updated_date" + + case invoiceUrl = "invoice_url" + + case labelUrl = "label_url" + } + + public init(invoiceUrl: String?, labelUrl: String?, updatedDate: String?) { + self.updatedDate = updatedDate + + self.invoiceUrl = invoiceUrl + + self.labelUrl = labelUrl + } + + public func duplicate() -> Invoice { + let dict = self.dictionary! + let copy = Invoice(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + updatedDate = try container.decode(String.self, forKey: .updatedDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + invoiceUrl = try container.decode(String.self, forKey: .invoiceUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + labelUrl = try container.decode(String.self, forKey: .labelUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(updatedDate, forKey: .updatedDate) + + try? container.encodeIfPresent(invoiceUrl, forKey: .invoiceUrl) + + try? container.encodeIfPresent(labelUrl, forKey: .labelUrl) + } + } + + /* + Model: Promise + Used By: Order + */ + class Promise: Codable { + public var timestamp: Timestamp? + + public enum CodingKeys: String, CodingKey { + case timestamp + } + + public init(timestamp: Timestamp?) { + self.timestamp = timestamp + } + + public func duplicate() -> Promise { + let dict = self.dictionary! + let copy = Promise(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + timestamp = try container.decode(Timestamp.self, forKey: .timestamp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(timestamp, forKey: .timestamp) + } + } + + /* + Model: Timestamp + Used By: Order + */ + class Timestamp: Codable { + public var min: String? + + public var max: String? + + public enum CodingKeys: String, CodingKey { + case min + + case max + } + + public init(max: String?, min: String?) { + self.min = min + + self.max = max + } + + public func duplicate() -> Timestamp { + let dict = self.dictionary! + let copy = Timestamp(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + min = try container.decode(String.self, forKey: .min) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + max = try container.decode(String.self, forKey: .max) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(min, forKey: .min) + + try? container.encodeIfPresent(max, forKey: .max) + } + } + + /* + Model: Reasons + Used By: Order + */ + class Reasons: Codable { + public var reasonText: String? + + public var showTextArea: Bool? + + public var feedbackType: String? + + public var flow: String? + + public var reasonId: Int? + + public var priority: Int? + + public enum CodingKeys: String, CodingKey { + case reasonText = "reason_text" + + case showTextArea = "show_text_area" + + case feedbackType = "feedback_type" + + case flow + + case reasonId = "reason_id" + + case priority + } + + public init(feedbackType: String?, flow: String?, priority: Int?, reasonId: Int?, reasonText: String?, showTextArea: Bool?) { + self.reasonText = reasonText + + self.showTextArea = showTextArea + + self.feedbackType = feedbackType + + self.flow = flow + + self.reasonId = reasonId + + self.priority = priority + } + + public func duplicate() -> Reasons { + let dict = self.dictionary! + let copy = Reasons(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + reasonText = try container.decode(String.self, forKey: .reasonText) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + showTextArea = try container.decode(Bool.self, forKey: .showTextArea) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + feedbackType = try container.decode(String.self, forKey: .feedbackType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + flow = try container.decode(String.self, forKey: .flow) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + reasonId = try container.decode(Int.self, forKey: .reasonId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(Int.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(reasonText, forKey: .reasonText) + + try? container.encodeIfPresent(showTextArea, forKey: .showTextArea) + + try? container.encodeIfPresent(feedbackType, forKey: .feedbackType) + + try? container.encodeIfPresent(flow, forKey: .flow) + + try? container.encodeIfPresent(reasonId, forKey: .reasonId) + + try? container.encodeIfPresent(priority, forKey: .priority) + } + } + + /* + Model: ShipmentStatus + Used By: Order + */ + class ShipmentStatus: Codable { + public var title: String? + + public var hexCode: String? + + public enum CodingKeys: String, CodingKey { + case title + + case hexCode = "hex_code" + } + + public init(hexCode: String?, title: String?) { + self.title = title + + self.hexCode = hexCode + } + + public func duplicate() -> ShipmentStatus { + let dict = self.dictionary! + let copy = ShipmentStatus(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hexCode = try container.decode(String.self, forKey: .hexCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(hexCode, forKey: .hexCode) + } + } + + /* + Model: ShipmentUserInfo + Used By: Order + */ + class ShipmentUserInfo: Codable { + public var gender: String? + + public var mobile: String? + + public var firstName: String? + + public var lastName: String? + + public enum CodingKeys: String, CodingKey { + case gender + + case mobile + + case firstName = "first_name" + + case lastName = "last_name" + } + + public init(firstName: String?, gender: String?, lastName: String?, mobile: String?) { + self.gender = gender + + self.mobile = mobile + + self.firstName = firstName + + self.lastName = lastName + } + + public func duplicate() -> ShipmentUserInfo { + let dict = self.dictionary! + let copy = ShipmentUserInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + gender = try container.decode(String.self, forKey: .gender) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobile = try container.decode(String.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(gender, forKey: .gender) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + } + } + + /* + Model: Shipments + Used By: Order + */ + class Shipments: Codable { + public var orderId: String? + + public var breakupValues: [BreakupValues]? + + public var trackUrl: String? + + public var trakingNo: String? + + public var awbNo: String? + + public var dpName: String? + + public var trackingDetails: [TrackingDetails]? + + public var beneficiaryDetails: Bool? + + public var canReturn: Bool? + + public var canBreak: [String: Any]? + + public var prices: Prices? + + public var needHelpUrl: String? + + public var shipmentId: String? + + public var totalBags: Int? + + public var deliveryAddress: DeliveryAddress? + + public var invoice: Invoice? + + public var comment: String? + + public var orderType: String? + + public var promise: Promise? + + public var fulfillingStore: FulfillingStore? + + public var bags: [Bags]? + + public var canCancel: Bool? + + public var payment: ShipmentPayment? + + public var shipmentCreatedAt: String? + + public var shipmentStatus: ShipmentStatus? + + public var userInfo: ShipmentUserInfo? + + public var sizeInfo: [String: Any]? + + public var totalDetails: ShipmentTotalDetails? + + public enum CodingKeys: String, CodingKey { + case orderId = "order_id" + + case breakupValues = "breakup_values" + + case trackUrl = "track_url" + + case trakingNo = "traking_no" + + case awbNo = "awb_no" + + case dpName = "dp_name" + + case trackingDetails = "tracking_details" + + case beneficiaryDetails = "beneficiary_details" + + case canReturn = "can_return" + + case canBreak = "can_break" + + case prices + + case needHelpUrl = "need_help_url" + + case shipmentId = "shipment_id" + + case totalBags = "total_bags" + + case deliveryAddress = "delivery_address" + + case invoice + + case comment + + case orderType = "order_type" + + case promise + + case fulfillingStore = "fulfilling_store" + + case bags + + case canCancel = "can_cancel" + + case payment + + case shipmentCreatedAt = "shipment_created_at" + + case shipmentStatus = "shipment_status" + + case userInfo = "user_info" + + case sizeInfo = "size_info" + + case totalDetails = "total_details" + } + + public init(awbNo: String?, bags: [Bags]?, beneficiaryDetails: Bool?, breakupValues: [BreakupValues]?, canBreak: [String: Any]?, canCancel: Bool?, canReturn: Bool?, comment: String?, deliveryAddress: DeliveryAddress?, dpName: String?, fulfillingStore: FulfillingStore?, invoice: Invoice?, needHelpUrl: String?, orderId: String?, orderType: String?, payment: ShipmentPayment?, prices: Prices?, promise: Promise?, shipmentCreatedAt: String?, shipmentId: String?, shipmentStatus: ShipmentStatus?, sizeInfo: [String: Any]?, totalBags: Int?, totalDetails: ShipmentTotalDetails?, trackingDetails: [TrackingDetails]?, trackUrl: String?, trakingNo: String?, userInfo: ShipmentUserInfo?) { + self.orderId = orderId + + self.breakupValues = breakupValues + + self.trackUrl = trackUrl + + self.trakingNo = trakingNo + + self.awbNo = awbNo + + self.dpName = dpName + + self.trackingDetails = trackingDetails + + self.beneficiaryDetails = beneficiaryDetails + + self.canReturn = canReturn + + self.canBreak = canBreak + + self.prices = prices + + self.needHelpUrl = needHelpUrl + + self.shipmentId = shipmentId + + self.totalBags = totalBags + + self.deliveryAddress = deliveryAddress + + self.invoice = invoice + + self.comment = comment + + self.orderType = orderType + + self.promise = promise + + self.fulfillingStore = fulfillingStore + + self.bags = bags + + self.canCancel = canCancel + + self.payment = payment + + self.shipmentCreatedAt = shipmentCreatedAt + + self.shipmentStatus = shipmentStatus + + self.userInfo = userInfo + + self.sizeInfo = sizeInfo + + self.totalDetails = totalDetails + } + + public func duplicate() -> Shipments { + let dict = self.dictionary! + let copy = Shipments(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + orderId = try container.decode(String.self, forKey: .orderId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + breakupValues = try container.decode([BreakupValues].self, forKey: .breakupValues) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + trackUrl = try container.decode(String.self, forKey: .trackUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + trakingNo = try container.decode(String.self, forKey: .trakingNo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + awbNo = try container.decode(String.self, forKey: .awbNo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dpName = try container.decode(String.self, forKey: .dpName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + trackingDetails = try container.decode([TrackingDetails].self, forKey: .trackingDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + beneficiaryDetails = try container.decode(Bool.self, forKey: .beneficiaryDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + canReturn = try container.decode(Bool.self, forKey: .canReturn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + canBreak = try container.decode([String: Any].self, forKey: .canBreak) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + prices = try container.decode(Prices.self, forKey: .prices) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + needHelpUrl = try container.decode(String.self, forKey: .needHelpUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shipmentId = try container.decode(String.self, forKey: .shipmentId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalBags = try container.decode(Int.self, forKey: .totalBags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryAddress = try container.decode(DeliveryAddress.self, forKey: .deliveryAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + invoice = try container.decode(Invoice.self, forKey: .invoice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + comment = try container.decode(String.self, forKey: .comment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderType = try container.decode(String.self, forKey: .orderType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + promise = try container.decode(Promise.self, forKey: .promise) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fulfillingStore = try container.decode(FulfillingStore.self, forKey: .fulfillingStore) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bags = try container.decode([Bags].self, forKey: .bags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + canCancel = try container.decode(Bool.self, forKey: .canCancel) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + payment = try container.decode(ShipmentPayment.self, forKey: .payment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shipmentCreatedAt = try container.decode(String.self, forKey: .shipmentCreatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shipmentStatus = try container.decode(ShipmentStatus.self, forKey: .shipmentStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userInfo = try container.decode(ShipmentUserInfo.self, forKey: .userInfo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sizeInfo = try container.decode([String: Any].self, forKey: .sizeInfo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalDetails = try container.decode(ShipmentTotalDetails.self, forKey: .totalDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + + try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) + + try? container.encodeIfPresent(trackUrl, forKey: .trackUrl) + + try? container.encodeIfPresent(trakingNo, forKey: .trakingNo) + + try? container.encodeIfPresent(awbNo, forKey: .awbNo) + + try? container.encodeIfPresent(dpName, forKey: .dpName) + + try? container.encodeIfPresent(trackingDetails, forKey: .trackingDetails) + + try? container.encodeIfPresent(beneficiaryDetails, forKey: .beneficiaryDetails) + + try? container.encodeIfPresent(canReturn, forKey: .canReturn) + + try? container.encodeIfPresent(canBreak, forKey: .canBreak) + + try? container.encodeIfPresent(prices, forKey: .prices) + + try? container.encodeIfPresent(needHelpUrl, forKey: .needHelpUrl) + + try? container.encodeIfPresent(shipmentId, forKey: .shipmentId) + + try? container.encodeIfPresent(totalBags, forKey: .totalBags) + + try? container.encodeIfPresent(deliveryAddress, forKey: .deliveryAddress) + + try? container.encodeIfPresent(invoice, forKey: .invoice) + + try? container.encodeIfPresent(comment, forKey: .comment) + + try? container.encodeIfPresent(orderType, forKey: .orderType) + + try? container.encodeIfPresent(promise, forKey: .promise) + + try? container.encodeIfPresent(fulfillingStore, forKey: .fulfillingStore) + + try? container.encodeIfPresent(bags, forKey: .bags) + + try? container.encodeIfPresent(canCancel, forKey: .canCancel) + + try? container.encodeIfPresent(payment, forKey: .payment) + + try? container.encodeIfPresent(shipmentCreatedAt, forKey: .shipmentCreatedAt) + + try? container.encodeIfPresent(shipmentStatus, forKey: .shipmentStatus) + + try? container.encodeIfPresent(userInfo, forKey: .userInfo) + + try? container.encodeIfPresent(sizeInfo, forKey: .sizeInfo) + + try? container.encodeIfPresent(totalDetails, forKey: .totalDetails) + } + } + + /* + Model: ShipmentTotalDetails + Used By: Order + */ + class ShipmentTotalDetails: Codable { + public var totalPrice: Double? + + public var sizes: Int? + + public var pieces: Int? + + public enum CodingKeys: String, CodingKey { + case totalPrice = "total_price" + + case sizes + + case pieces + } + + public init(pieces: Int?, sizes: Int?, totalPrice: Double?) { + self.totalPrice = totalPrice + + self.sizes = sizes + + self.pieces = pieces + } + + public func duplicate() -> ShipmentTotalDetails { + let dict = self.dictionary! + let copy = ShipmentTotalDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + totalPrice = try container.decode(Double.self, forKey: .totalPrice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sizes = try container.decode(Int.self, forKey: .sizes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pieces = try container.decode(Int.self, forKey: .pieces) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(totalPrice, forKey: .totalPrice) + + try? container.encodeIfPresent(sizes, forKey: .sizes) + + try? container.encodeIfPresent(pieces, forKey: .pieces) + } + } + + /* + Model: ShipmentPayment + Used By: Order + */ + class ShipmentPayment: Codable { + public var logo: String? + + public var mode: String? + + public var status: String? + + public enum CodingKeys: String, CodingKey { + case logo + + case mode + + case status + } + + public init(logo: String?, mode: String?, status: String?) { + self.logo = logo + + self.mode = mode + + self.status = status + } + + public func duplicate() -> ShipmentPayment { + let dict = self.dictionary! + let copy = ShipmentPayment(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mode = try container.decode(String.self, forKey: .mode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(mode, forKey: .mode) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: Track + Used By: Order + */ + class Track: Codable { + public var awb: String? + + public var updatedAt: String? + + public var lastLocationRecievedAt: String? + + public var reason: String? + + public var shipmentType: String? + + public var status: String? + + public var updatedTime: String? + + public var accountName: String? + + public enum CodingKeys: String, CodingKey { + case awb + + case updatedAt = "updated_at" + + case lastLocationRecievedAt = "last_location_recieved_at" + + case reason + + case shipmentType = "shipment_type" + + case status + + case updatedTime = "updated_time" + + case accountName = "account_name" + } + + public init(accountName: String?, awb: String?, lastLocationRecievedAt: String?, reason: String?, shipmentType: String?, status: String?, updatedAt: String?, updatedTime: String?) { + self.awb = awb + + self.updatedAt = updatedAt + + self.lastLocationRecievedAt = lastLocationRecievedAt + + self.reason = reason + + self.shipmentType = shipmentType + + self.status = status + + self.updatedTime = updatedTime + + self.accountName = accountName + } + + public func duplicate() -> Track { + let dict = self.dictionary! + let copy = Track(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + awb = try container.decode(String.self, forKey: .awb) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastLocationRecievedAt = try container.decode(String.self, forKey: .lastLocationRecievedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + reason = try container.decode(String.self, forKey: .reason) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shipmentType = try container.decode(String.self, forKey: .shipmentType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedTime = try container.decode(String.self, forKey: .updatedTime) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + accountName = try container.decode(String.self, forKey: .accountName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(awb, forKey: .awb) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(lastLocationRecievedAt, forKey: .lastLocationRecievedAt) + + try? container.encodeIfPresent(reason, forKey: .reason) + + try? container.encodeIfPresent(shipmentType, forKey: .shipmentType) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(updatedTime, forKey: .updatedTime) + + try? container.encodeIfPresent(accountName, forKey: .accountName) + } + } + + /* + Model: TrackingDetails + Used By: Order + */ + class TrackingDetails: Codable { + public var isCurrent: Bool? + + public var status: String? + + public var time: String? + + public var isPassed: Bool? + + public enum CodingKeys: String, CodingKey { + case isCurrent = "is_current" + + case status + + case time + + case isPassed = "is_passed" + } + + public init(isCurrent: Bool?, isPassed: Bool?, status: String?, time: String?) { + self.isCurrent = isCurrent + + self.status = status + + self.time = time + + self.isPassed = isPassed + } + + public func duplicate() -> TrackingDetails { + let dict = self.dictionary! + let copy = TrackingDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isCurrent = try container.decode(Bool.self, forKey: .isCurrent) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + time = try container.decode(String.self, forKey: .time) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isPassed = try container.decode(Bool.self, forKey: .isPassed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isCurrent, forKey: .isCurrent) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(time, forKey: .time) + + try? container.encodeIfPresent(isPassed, forKey: .isPassed) + } + } + + /* + Model: UserInfo + Used By: Order + */ + class UserInfo: Codable { + public var gender: String? + + public var mobile: String? + + public var name: String? + + public var email: String? + + public enum CodingKeys: String, CodingKey { + case gender + + case mobile + + case name + + case email + } + + public init(email: String?, gender: String?, mobile: String?, name: String?) { + self.gender = gender + + self.mobile = mobile + + self.name = name + + self.email = email + } + + public func duplicate() -> UserInfo { + let dict = self.dictionary! + let copy = UserInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + gender = try container.decode(String.self, forKey: .gender) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobile = try container.decode(String.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(gender, forKey: .gender) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(email, forKey: .email) + } + } + + /* + Model: ApefaceApiError + Used By: Order + */ + class ApefaceApiError: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> ApefaceApiError { + let dict = self.dictionary! + let copy = ApefaceApiError(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } +} diff --git a/Sources/code/application/models/PaymentAppModelClass.swift b/Sources/code/application/models/PaymentAppModelClass.swift new file mode 100644 index 0000000000..c34517c53a --- /dev/null +++ b/Sources/code/application/models/PaymentAppModelClass.swift @@ -0,0 +1,4818 @@ +import Foundation + +import Foundation +public extension ApplicationClient { + /* + Model: AggregatorConfigDetail + Used By: Payment + */ + class AggregatorConfigDetail: Codable { + public var api: String? + + public var userId: String? + + public var merchantKey: String? + + public var sdk: Bool? + + public var pin: String? + + public var secret: String + + public var verifyApi: String? + + public var merchantId: String? + + public var configType: String + + public var key: String + + public enum CodingKeys: String, CodingKey { + case api + + case userId = "user_id" + + case merchantKey = "merchant_key" + + case sdk + + case pin + + case secret + + case verifyApi = "verify_api" + + case merchantId = "merchant_id" + + case configType = "config_type" + + case key + } + + public init(api: String?, configType: String, key: String, merchantId: String?, merchantKey: String?, pin: String?, sdk: Bool?, secret: String, userId: String?, verifyApi: String?) { + self.api = api + + self.userId = userId + + self.merchantKey = merchantKey + + self.sdk = sdk + + self.pin = pin + + self.secret = secret + + self.verifyApi = verifyApi + + self.merchantId = merchantId + + self.configType = configType + + self.key = key + } + + public func duplicate() -> AggregatorConfigDetail { + let dict = self.dictionary! + let copy = AggregatorConfigDetail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + api = try container.decode(String.self, forKey: .api) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + merchantKey = try container.decode(String.self, forKey: .merchantKey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sdk = try container.decode(Bool.self, forKey: .sdk) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pin = try container.decode(String.self, forKey: .pin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + secret = try container.decode(String.self, forKey: .secret) + + do { + verifyApi = try container.decode(String.self, forKey: .verifyApi) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + merchantId = try container.decode(String.self, forKey: .merchantId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + configType = try container.decode(String.self, forKey: .configType) + + key = try container.decode(String.self, forKey: .key) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(api, forKey: .api) + + try? container.encode(userId, forKey: .userId) + + try? container.encode(merchantKey, forKey: .merchantKey) + + try? container.encode(sdk, forKey: .sdk) + + try? container.encode(pin, forKey: .pin) + + try? container.encodeIfPresent(secret, forKey: .secret) + + try? container.encode(verifyApi, forKey: .verifyApi) + + try? container.encode(merchantId, forKey: .merchantId) + + try? container.encodeIfPresent(configType, forKey: .configType) + + try? container.encodeIfPresent(key, forKey: .key) + } + } + + /* + Model: AggregatorsConfigDetailResponse + Used By: Payment + */ + class AggregatorsConfigDetailResponse: Codable { + public var stripe: AggregatorConfigDetail? + + public var razorpay: AggregatorConfigDetail? + + public var simpl: AggregatorConfigDetail? + + public var juspay: AggregatorConfigDetail? + + public var ccavenue: AggregatorConfigDetail? + + public var rupifi: AggregatorConfigDetail? + + public var success: Bool + + public var mswipe: AggregatorConfigDetail? + + public var env: String + + public var payumoney: AggregatorConfigDetail? + + public enum CodingKeys: String, CodingKey { + case stripe + + case razorpay + + case simpl + + case juspay + + case ccavenue + + case rupifi + + case success + + case mswipe + + case env + + case payumoney + } + + public init(ccavenue: AggregatorConfigDetail?, env: String, juspay: AggregatorConfigDetail?, mswipe: AggregatorConfigDetail?, payumoney: AggregatorConfigDetail?, razorpay: AggregatorConfigDetail?, rupifi: AggregatorConfigDetail?, simpl: AggregatorConfigDetail?, stripe: AggregatorConfigDetail?, success: Bool) { + self.stripe = stripe + + self.razorpay = razorpay + + self.simpl = simpl + + self.juspay = juspay + + self.ccavenue = ccavenue + + self.rupifi = rupifi + + self.success = success + + self.mswipe = mswipe + + self.env = env + + self.payumoney = payumoney + } + + public func duplicate() -> AggregatorsConfigDetailResponse { + let dict = self.dictionary! + let copy = AggregatorsConfigDetailResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + stripe = try container.decode(AggregatorConfigDetail.self, forKey: .stripe) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + razorpay = try container.decode(AggregatorConfigDetail.self, forKey: .razorpay) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + simpl = try container.decode(AggregatorConfigDetail.self, forKey: .simpl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + juspay = try container.decode(AggregatorConfigDetail.self, forKey: .juspay) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ccavenue = try container.decode(AggregatorConfigDetail.self, forKey: .ccavenue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rupifi = try container.decode(AggregatorConfigDetail.self, forKey: .rupifi) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + success = try container.decode(Bool.self, forKey: .success) + + do { + mswipe = try container.decode(AggregatorConfigDetail.self, forKey: .mswipe) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + env = try container.decode(String.self, forKey: .env) + + do { + payumoney = try container.decode(AggregatorConfigDetail.self, forKey: .payumoney) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(stripe, forKey: .stripe) + + try? container.encodeIfPresent(razorpay, forKey: .razorpay) + + try? container.encodeIfPresent(simpl, forKey: .simpl) + + try? container.encodeIfPresent(juspay, forKey: .juspay) + + try? container.encodeIfPresent(ccavenue, forKey: .ccavenue) + + try? container.encodeIfPresent(rupifi, forKey: .rupifi) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(mswipe, forKey: .mswipe) + + try? container.encodeIfPresent(env, forKey: .env) + + try? container.encodeIfPresent(payumoney, forKey: .payumoney) + } + } + + /* + Model: ErrorCodeAndDescription + Used By: Payment + */ + class ErrorCodeAndDescription: Codable { + public var code: String + + public var description: String + + public enum CodingKeys: String, CodingKey { + case code + + case description + } + + public init(code: String, description: String) { + self.code = code + + self.description = description + } + + public func duplicate() -> ErrorCodeAndDescription { + let dict = self.dictionary! + let copy = ErrorCodeAndDescription(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + code = try container.decode(String.self, forKey: .code) + + description = try container.decode(String.self, forKey: .description) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(description, forKey: .description) + } + } + + /* + Model: HttpErrorCodeAndResponse + Used By: Payment + */ + class HttpErrorCodeAndResponse: Codable { + public var error: ErrorCodeAndDescription + + public var success: Bool + + public enum CodingKeys: String, CodingKey { + case error + + case success + } + + public init(error: ErrorCodeAndDescription, success: Bool) { + self.error = error + + self.success = success + } + + public func duplicate() -> HttpErrorCodeAndResponse { + let dict = self.dictionary! + let copy = HttpErrorCodeAndResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + error = try container.decode(ErrorCodeAndDescription.self, forKey: .error) + + success = try container.decode(Bool.self, forKey: .success) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(error, forKey: .error) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: AttachCardRequest + Used By: Payment + */ + class AttachCardRequest: Codable { + public var cardId: String + + public var nameOnCard: String? + + public var refresh: Bool? + + public var nickname: String? + + public enum CodingKeys: String, CodingKey { + case cardId = "card_id" + + case nameOnCard = "name_on_card" + + case refresh + + case nickname + } + + public init(cardId: String, nameOnCard: String?, nickname: String?, refresh: Bool?) { + self.cardId = cardId + + self.nameOnCard = nameOnCard + + self.refresh = refresh + + self.nickname = nickname + } + + public func duplicate() -> AttachCardRequest { + let dict = self.dictionary! + let copy = AttachCardRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + cardId = try container.decode(String.self, forKey: .cardId) + + do { + nameOnCard = try container.decode(String.self, forKey: .nameOnCard) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refresh = try container.decode(Bool.self, forKey: .refresh) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + nickname = try container.decode(String.self, forKey: .nickname) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(cardId, forKey: .cardId) + + try? container.encodeIfPresent(nameOnCard, forKey: .nameOnCard) + + try? container.encode(refresh, forKey: .refresh) + + try? container.encodeIfPresent(nickname, forKey: .nickname) + } + } + + /* + Model: AttachCardsResponse + Used By: Payment + */ + class AttachCardsResponse: Codable { + public var success: Bool + + public var data: [String: Any] + + public var message: String? + + public enum CodingKeys: String, CodingKey { + case success + + case data + + case message + } + + public init(data: [String: Any], message: String?, success: Bool) { + self.success = success + + self.data = data + + self.message = message + } + + public func duplicate() -> AttachCardsResponse { + let dict = self.dictionary! + let copy = AttachCardsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + data = try container.decode([String: Any].self, forKey: .data) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: CardPaymentGateway + Used By: Payment + */ + class CardPaymentGateway: Codable { + public var api: String? + + public var aggregator: String + + public var customerId: String? + + public enum CodingKeys: String, CodingKey { + case api + + case aggregator + + case customerId = "customer_id" + } + + public init(aggregator: String, api: String?, customerId: String?) { + self.api = api + + self.aggregator = aggregator + + self.customerId = customerId + } + + public func duplicate() -> CardPaymentGateway { + let dict = self.dictionary! + let copy = CardPaymentGateway(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + api = try container.decode(String.self, forKey: .api) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + aggregator = try container.decode(String.self, forKey: .aggregator) + + do { + customerId = try container.decode(String.self, forKey: .customerId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(api, forKey: .api) + + try? container.encodeIfPresent(aggregator, forKey: .aggregator) + + try? container.encode(customerId, forKey: .customerId) + } + } + + /* + Model: ActiveCardPaymentGatewayResponse + Used By: Payment + */ + class ActiveCardPaymentGatewayResponse: Codable { + public var success: Bool + + public var cards: CardPaymentGateway + + public var message: String + + public enum CodingKeys: String, CodingKey { + case success + + case cards + + case message + } + + public init(cards: CardPaymentGateway, message: String, success: Bool) { + self.success = success + + self.cards = cards + + self.message = message + } + + public func duplicate() -> ActiveCardPaymentGatewayResponse { + let dict = self.dictionary! + let copy = ActiveCardPaymentGatewayResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + cards = try container.decode(CardPaymentGateway.self, forKey: .cards) + + message = try container.decode(String.self, forKey: .message) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(cards, forKey: .cards) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: Card + Used By: Payment + */ + class Card: Codable { + public var aggregatorName: String + + public var nickname: String? + + public var cardIssuer: String? + + public var cardId: String? + + public var expMonth: Int? + + public var cardFingerprint: String? + + public var cardToken: String? + + public var cardBrandImage: String? + + public var cardReference: String? + + public var cardName: String? + + public var expired: Bool? + + public var cardType: String? + + public var cardBrand: String? + + public var expYear: Int? + + public var cardNumber: String? + + public var cardIsin: String? + + public enum CodingKeys: String, CodingKey { + case aggregatorName = "aggregator_name" + + case nickname + + case cardIssuer = "card_issuer" + + case cardId = "card_id" + + case expMonth = "exp_month" + + case cardFingerprint = "card_fingerprint" + + case cardToken = "card_token" + + case cardBrandImage = "card_brand_image" + + case cardReference = "card_reference" + + case cardName = "card_name" + + case expired + + case cardType = "card_type" + + case cardBrand = "card_brand" + + case expYear = "exp_year" + + case cardNumber = "card_number" + + case cardIsin = "card_isin" + } + + public init(aggregatorName: String, cardBrand: String?, cardBrandImage: String?, cardFingerprint: String?, cardId: String?, cardIsin: String?, cardIssuer: String?, cardName: String?, cardNumber: String?, cardReference: String?, cardToken: String?, cardType: String?, expired: Bool?, expMonth: Int?, expYear: Int?, nickname: String?) { + self.aggregatorName = aggregatorName + + self.nickname = nickname + + self.cardIssuer = cardIssuer + + self.cardId = cardId + + self.expMonth = expMonth + + self.cardFingerprint = cardFingerprint + + self.cardToken = cardToken + + self.cardBrandImage = cardBrandImage + + self.cardReference = cardReference + + self.cardName = cardName + + self.expired = expired + + self.cardType = cardType + + self.cardBrand = cardBrand + + self.expYear = expYear + + self.cardNumber = cardNumber + + self.cardIsin = cardIsin + } + + public func duplicate() -> Card { + let dict = self.dictionary! + let copy = Card(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + aggregatorName = try container.decode(String.self, forKey: .aggregatorName) + + do { + nickname = try container.decode(String.self, forKey: .nickname) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardIssuer = try container.decode(String.self, forKey: .cardIssuer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardId = try container.decode(String.self, forKey: .cardId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expMonth = try container.decode(Int.self, forKey: .expMonth) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardFingerprint = try container.decode(String.self, forKey: .cardFingerprint) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardToken = try container.decode(String.self, forKey: .cardToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardBrandImage = try container.decode(String.self, forKey: .cardBrandImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardReference = try container.decode(String.self, forKey: .cardReference) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardName = try container.decode(String.self, forKey: .cardName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expired = try container.decode(Bool.self, forKey: .expired) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardType = try container.decode(String.self, forKey: .cardType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardBrand = try container.decode(String.self, forKey: .cardBrand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expYear = try container.decode(Int.self, forKey: .expYear) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardNumber = try container.decode(String.self, forKey: .cardNumber) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardIsin = try container.decode(String.self, forKey: .cardIsin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(aggregatorName, forKey: .aggregatorName) + + try? container.encode(nickname, forKey: .nickname) + + try? container.encode(cardIssuer, forKey: .cardIssuer) + + try? container.encode(cardId, forKey: .cardId) + + try? container.encode(expMonth, forKey: .expMonth) + + try? container.encode(cardFingerprint, forKey: .cardFingerprint) + + try? container.encode(cardToken, forKey: .cardToken) + + try? container.encode(cardBrandImage, forKey: .cardBrandImage) + + try? container.encode(cardReference, forKey: .cardReference) + + try? container.encode(cardName, forKey: .cardName) + + try? container.encode(expired, forKey: .expired) + + try? container.encode(cardType, forKey: .cardType) + + try? container.encode(cardBrand, forKey: .cardBrand) + + try? container.encode(expYear, forKey: .expYear) + + try? container.encode(cardNumber, forKey: .cardNumber) + + try? container.encode(cardIsin, forKey: .cardIsin) + } + } + + /* + Model: ListCardsResponse + Used By: Payment + */ + class ListCardsResponse: Codable { + public var success: Bool + + public var data: [Card]? + + public var message: String + + public enum CodingKeys: String, CodingKey { + case success + + case data + + case message + } + + public init(data: [Card]?, message: String, success: Bool) { + self.success = success + + self.data = data + + self.message = message + } + + public func duplicate() -> ListCardsResponse { + let dict = self.dictionary! + let copy = ListCardsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + do { + data = try container.decode([Card].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + message = try container.decode(String.self, forKey: .message) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: DeletehCardRequest + Used By: Payment + */ + class DeletehCardRequest: Codable { + public var cardId: String + + public enum CodingKeys: String, CodingKey { + case cardId = "card_id" + } + + public init(cardId: String) { + self.cardId = cardId + } + + public func duplicate() -> DeletehCardRequest { + let dict = self.dictionary! + let copy = DeletehCardRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + cardId = try container.decode(String.self, forKey: .cardId) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(cardId, forKey: .cardId) + } + } + + /* + Model: DeleteCardsResponse + Used By: Payment + */ + class DeleteCardsResponse: Codable { + public var success: Bool + + public var message: String? + + public enum CodingKeys: String, CodingKey { + case success + + case message + } + + public init(message: String?, success: Bool) { + self.success = success + + self.message = message + } + + public func duplicate() -> DeleteCardsResponse { + let dict = self.dictionary! + let copy = DeleteCardsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encode(message, forKey: .message) + } + } + + /* + Model: ValidateCustomerRequest + Used By: Payment + */ + class ValidateCustomerRequest: Codable { + public var aggregator: String + + public var transactionAmountInPaise: Int + + public var phoneNumber: String + + public var merchantParams: [String: Any] + + public var payload: String + + public enum CodingKeys: String, CodingKey { + case aggregator + + case transactionAmountInPaise = "transaction_amount_in_paise" + + case phoneNumber = "phone_number" + + case merchantParams = "merchant_params" + + case payload + } + + public init(aggregator: String, merchantParams: [String: Any], payload: String, phoneNumber: String, transactionAmountInPaise: Int) { + self.aggregator = aggregator + + self.transactionAmountInPaise = transactionAmountInPaise + + self.phoneNumber = phoneNumber + + self.merchantParams = merchantParams + + self.payload = payload + } + + public func duplicate() -> ValidateCustomerRequest { + let dict = self.dictionary! + let copy = ValidateCustomerRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + aggregator = try container.decode(String.self, forKey: .aggregator) + + transactionAmountInPaise = try container.decode(Int.self, forKey: .transactionAmountInPaise) + + phoneNumber = try container.decode(String.self, forKey: .phoneNumber) + + merchantParams = try container.decode([String: Any].self, forKey: .merchantParams) + + payload = try container.decode(String.self, forKey: .payload) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(aggregator, forKey: .aggregator) + + try? container.encodeIfPresent(transactionAmountInPaise, forKey: .transactionAmountInPaise) + + try? container.encodeIfPresent(phoneNumber, forKey: .phoneNumber) + + try? container.encodeIfPresent(merchantParams, forKey: .merchantParams) + + try? container.encode(payload, forKey: .payload) + } + } + + /* + Model: ValidateCustomerResponse + Used By: Payment + */ + class ValidateCustomerResponse: Codable { + public var success: Bool + + public var data: [String: Any] + + public var message: String + + public enum CodingKeys: String, CodingKey { + case success + + case data + + case message + } + + public init(data: [String: Any], message: String, success: Bool) { + self.success = success + + self.data = data + + self.message = message + } + + public func duplicate() -> ValidateCustomerResponse { + let dict = self.dictionary! + let copy = ValidateCustomerResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + data = try container.decode([String: Any].self, forKey: .data) + + message = try container.decode(String.self, forKey: .message) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: ChargeCustomerRequest + Used By: Payment + */ + class ChargeCustomerRequest: Codable { + public var aggregator: String + + public var amount: Int + + public var verified: Bool? + + public var orderId: String + + public var transactionToken: String? + + public enum CodingKeys: String, CodingKey { + case aggregator + + case amount + + case verified + + case orderId = "order_id" + + case transactionToken = "transaction_token" + } + + public init(aggregator: String, amount: Int, orderId: String, transactionToken: String?, verified: Bool?) { + self.aggregator = aggregator + + self.amount = amount + + self.verified = verified + + self.orderId = orderId + + self.transactionToken = transactionToken + } + + public func duplicate() -> ChargeCustomerRequest { + let dict = self.dictionary! + let copy = ChargeCustomerRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + aggregator = try container.decode(String.self, forKey: .aggregator) + + amount = try container.decode(Int.self, forKey: .amount) + + do { + verified = try container.decode(Bool.self, forKey: .verified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + orderId = try container.decode(String.self, forKey: .orderId) + + do { + transactionToken = try container.decode(String.self, forKey: .transactionToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(aggregator, forKey: .aggregator) + + try? container.encode(amount, forKey: .amount) + + try? container.encode(verified, forKey: .verified) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + + try? container.encode(transactionToken, forKey: .transactionToken) + } + } + + /* + Model: ChargeCustomerResponse + Used By: Payment + */ + class ChargeCustomerResponse: Codable { + public var status: String + + public var aggregator: String + + public var cartId: String? + + public var orderId: String + + public var success: Bool + + public var deliveryAddressId: String? + + public var message: String + + public enum CodingKeys: String, CodingKey { + case status + + case aggregator + + case cartId = "cart_id" + + case orderId = "order_id" + + case success + + case deliveryAddressId = "delivery_address_id" + + case message + } + + public init(aggregator: String, cartId: String?, deliveryAddressId: String?, message: String, orderId: String, status: String, success: Bool) { + self.status = status + + self.aggregator = aggregator + + self.cartId = cartId + + self.orderId = orderId + + self.success = success + + self.deliveryAddressId = deliveryAddressId + + self.message = message + } + + public func duplicate() -> ChargeCustomerResponse { + let dict = self.dictionary! + let copy = ChargeCustomerResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + status = try container.decode(String.self, forKey: .status) + + aggregator = try container.decode(String.self, forKey: .aggregator) + + do { + cartId = try container.decode(String.self, forKey: .cartId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + orderId = try container.decode(String.self, forKey: .orderId) + + success = try container.decode(Bool.self, forKey: .success) + + do { + deliveryAddressId = try container.decode(String.self, forKey: .deliveryAddressId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + message = try container.decode(String.self, forKey: .message) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(aggregator, forKey: .aggregator) + + try? container.encode(cartId, forKey: .cartId) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encode(deliveryAddressId, forKey: .deliveryAddressId) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: PaymentInitializationRequest + Used By: Payment + */ + class PaymentInitializationRequest: Codable { + public var razorpayPaymentId: String? + + public var method: String + + public var aggregator: String + + public var email: String + + public var timeout: Int? + + public var amount: Int + + public var merchantOrderId: String + + public var vpa: String? + + public var orderId: String + + public var customerId: String + + public var contact: String + + public var currency: String + + public enum CodingKeys: String, CodingKey { + case razorpayPaymentId = "razorpay_payment_id" + + case method + + case aggregator + + case email + + case timeout + + case amount + + case merchantOrderId = "merchant_order_id" + + case vpa + + case orderId = "order_id" + + case customerId = "customer_id" + + case contact + + case currency + } + + public init(aggregator: String, amount: Int, contact: String, currency: String, customerId: String, email: String, merchantOrderId: String, method: String, orderId: String, razorpayPaymentId: String?, timeout: Int?, vpa: String?) { + self.razorpayPaymentId = razorpayPaymentId + + self.method = method + + self.aggregator = aggregator + + self.email = email + + self.timeout = timeout + + self.amount = amount + + self.merchantOrderId = merchantOrderId + + self.vpa = vpa + + self.orderId = orderId + + self.customerId = customerId + + self.contact = contact + + self.currency = currency + } + + public func duplicate() -> PaymentInitializationRequest { + let dict = self.dictionary! + let copy = PaymentInitializationRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + razorpayPaymentId = try container.decode(String.self, forKey: .razorpayPaymentId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + method = try container.decode(String.self, forKey: .method) + + aggregator = try container.decode(String.self, forKey: .aggregator) + + email = try container.decode(String.self, forKey: .email) + + do { + timeout = try container.decode(Int.self, forKey: .timeout) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + amount = try container.decode(Int.self, forKey: .amount) + + merchantOrderId = try container.decode(String.self, forKey: .merchantOrderId) + + do { + vpa = try container.decode(String.self, forKey: .vpa) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + orderId = try container.decode(String.self, forKey: .orderId) + + customerId = try container.decode(String.self, forKey: .customerId) + + contact = try container.decode(String.self, forKey: .contact) + + currency = try container.decode(String.self, forKey: .currency) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(razorpayPaymentId, forKey: .razorpayPaymentId) + + try? container.encodeIfPresent(method, forKey: .method) + + try? container.encodeIfPresent(aggregator, forKey: .aggregator) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encode(timeout, forKey: .timeout) + + try? container.encode(amount, forKey: .amount) + + try? container.encodeIfPresent(merchantOrderId, forKey: .merchantOrderId) + + try? container.encode(vpa, forKey: .vpa) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + + try? container.encodeIfPresent(customerId, forKey: .customerId) + + try? container.encodeIfPresent(contact, forKey: .contact) + + try? container.encodeIfPresent(currency, forKey: .currency) + } + } + + /* + Model: PaymentInitializationResponse + Used By: Payment + */ + class PaymentInitializationResponse: Codable { + public var status: String? + + public var merchantOrderId: String + + public var aggregator: String + + public var method: String + + public var vpa: String? + + public var amount: Int? + + public var pollingUrl: String + + public var upiPollUrl: String? + + public var razorpayPaymentId: String? + + public var virtualId: String? + + public var timeout: Int? + + public var bqrImage: String? + + public var customerId: String? + + public var success: Bool + + public var aggregatorOrderId: String? + + public var currency: String? + + public enum CodingKeys: String, CodingKey { + case status + + case merchantOrderId = "merchant_order_id" + + case aggregator + + case method + + case vpa + + case amount + + case pollingUrl = "polling_url" + + case upiPollUrl = "upi_poll_url" + + case razorpayPaymentId = "razorpay_payment_id" + + case virtualId = "virtual_id" + + case timeout + + case bqrImage = "bqr_image" + + case customerId = "customer_id" + + case success + + case aggregatorOrderId = "aggregator_order_id" + + case currency + } + + public init(aggregator: String, aggregatorOrderId: String?, amount: Int?, bqrImage: String?, currency: String?, customerId: String?, merchantOrderId: String, method: String, pollingUrl: String, razorpayPaymentId: String?, status: String?, success: Bool, timeout: Int?, upiPollUrl: String?, virtualId: String?, vpa: String?) { + self.status = status + + self.merchantOrderId = merchantOrderId + + self.aggregator = aggregator + + self.method = method + + self.vpa = vpa + + self.amount = amount + + self.pollingUrl = pollingUrl + + self.upiPollUrl = upiPollUrl + + self.razorpayPaymentId = razorpayPaymentId + + self.virtualId = virtualId + + self.timeout = timeout + + self.bqrImage = bqrImage + + self.customerId = customerId + + self.success = success + + self.aggregatorOrderId = aggregatorOrderId + + self.currency = currency + } + + public func duplicate() -> PaymentInitializationResponse { + let dict = self.dictionary! + let copy = PaymentInitializationResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + merchantOrderId = try container.decode(String.self, forKey: .merchantOrderId) + + aggregator = try container.decode(String.self, forKey: .aggregator) + + method = try container.decode(String.self, forKey: .method) + + do { + vpa = try container.decode(String.self, forKey: .vpa) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + amount = try container.decode(Int.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + pollingUrl = try container.decode(String.self, forKey: .pollingUrl) + + do { + upiPollUrl = try container.decode(String.self, forKey: .upiPollUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + razorpayPaymentId = try container.decode(String.self, forKey: .razorpayPaymentId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + virtualId = try container.decode(String.self, forKey: .virtualId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + timeout = try container.decode(Int.self, forKey: .timeout) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bqrImage = try container.decode(String.self, forKey: .bqrImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customerId = try container.decode(String.self, forKey: .customerId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + success = try container.decode(Bool.self, forKey: .success) + + do { + aggregatorOrderId = try container.decode(String.self, forKey: .aggregatorOrderId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(merchantOrderId, forKey: .merchantOrderId) + + try? container.encodeIfPresent(aggregator, forKey: .aggregator) + + try? container.encodeIfPresent(method, forKey: .method) + + try? container.encode(vpa, forKey: .vpa) + + try? container.encode(amount, forKey: .amount) + + try? container.encodeIfPresent(pollingUrl, forKey: .pollingUrl) + + try? container.encode(upiPollUrl, forKey: .upiPollUrl) + + try? container.encode(razorpayPaymentId, forKey: .razorpayPaymentId) + + try? container.encode(virtualId, forKey: .virtualId) + + try? container.encode(timeout, forKey: .timeout) + + try? container.encode(bqrImage, forKey: .bqrImage) + + try? container.encode(customerId, forKey: .customerId) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(aggregatorOrderId, forKey: .aggregatorOrderId) + + try? container.encode(currency, forKey: .currency) + } + } + + /* + Model: PaymentStatusUpdateRequest + Used By: Payment + */ + class PaymentStatusUpdateRequest: Codable { + public var status: String + + public var method: String + + public var aggregator: String + + public var email: String + + public var merchantOrderId: String + + public var amount: Int + + public var vpa: String + + public var orderId: String + + public var customerId: String + + public var contact: String + + public var currency: String + + public enum CodingKeys: String, CodingKey { + case status + + case method + + case aggregator + + case email + + case merchantOrderId = "merchant_order_id" + + case amount + + case vpa + + case orderId = "order_id" + + case customerId = "customer_id" + + case contact + + case currency + } + + public init(aggregator: String, amount: Int, contact: String, currency: String, customerId: String, email: String, merchantOrderId: String, method: String, orderId: String, status: String, vpa: String) { + self.status = status + + self.method = method + + self.aggregator = aggregator + + self.email = email + + self.merchantOrderId = merchantOrderId + + self.amount = amount + + self.vpa = vpa + + self.orderId = orderId + + self.customerId = customerId + + self.contact = contact + + self.currency = currency + } + + public func duplicate() -> PaymentStatusUpdateRequest { + let dict = self.dictionary! + let copy = PaymentStatusUpdateRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + status = try container.decode(String.self, forKey: .status) + + method = try container.decode(String.self, forKey: .method) + + aggregator = try container.decode(String.self, forKey: .aggregator) + + email = try container.decode(String.self, forKey: .email) + + merchantOrderId = try container.decode(String.self, forKey: .merchantOrderId) + + amount = try container.decode(Int.self, forKey: .amount) + + vpa = try container.decode(String.self, forKey: .vpa) + + orderId = try container.decode(String.self, forKey: .orderId) + + customerId = try container.decode(String.self, forKey: .customerId) + + contact = try container.decode(String.self, forKey: .contact) + + currency = try container.decode(String.self, forKey: .currency) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(method, forKey: .method) + + try? container.encodeIfPresent(aggregator, forKey: .aggregator) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(merchantOrderId, forKey: .merchantOrderId) + + try? container.encode(amount, forKey: .amount) + + try? container.encodeIfPresent(vpa, forKey: .vpa) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + + try? container.encodeIfPresent(customerId, forKey: .customerId) + + try? container.encodeIfPresent(contact, forKey: .contact) + + try? container.encodeIfPresent(currency, forKey: .currency) + } + } + + /* + Model: PaymentStatusUpdateResponse + Used By: Payment + */ + class PaymentStatusUpdateResponse: Codable { + public var status: String + + public var aggregatorName: String + + public var retry: Bool + + public enum CodingKeys: String, CodingKey { + case status + + case aggregatorName = "aggregator_name" + + case retry + } + + public init(aggregatorName: String, retry: Bool, status: String) { + self.status = status + + self.aggregatorName = aggregatorName + + self.retry = retry + } + + public func duplicate() -> PaymentStatusUpdateResponse { + let dict = self.dictionary! + let copy = PaymentStatusUpdateResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + status = try container.decode(String.self, forKey: .status) + + aggregatorName = try container.decode(String.self, forKey: .aggregatorName) + + retry = try container.decode(Bool.self, forKey: .retry) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(aggregatorName, forKey: .aggregatorName) + + try? container.encodeIfPresent(retry, forKey: .retry) + } + } + + /* + Model: AggregatorRoute + Used By: Payment + */ + class AggregatorRoute: Codable { + public var data: [String: Any]? + + public var paymentFlowData: String? + + public var paymentFlow: String? + + public var apiLink: String? + + public enum CodingKeys: String, CodingKey { + case data + + case paymentFlowData = "payment_flow_data" + + case paymentFlow = "payment_flow" + + case apiLink = "api_link" + } + + public init(apiLink: String?, data: [String: Any]?, paymentFlow: String?, paymentFlowData: String?) { + self.data = data + + self.paymentFlowData = paymentFlowData + + self.paymentFlow = paymentFlow + + self.apiLink = apiLink + } + + public func duplicate() -> AggregatorRoute { + let dict = self.dictionary! + let copy = AggregatorRoute(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode([String: Any].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentFlowData = try container.decode(String.self, forKey: .paymentFlowData) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentFlow = try container.decode(String.self, forKey: .paymentFlow) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + apiLink = try container.decode(String.self, forKey: .apiLink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(data, forKey: .data) + + try? container.encode(paymentFlowData, forKey: .paymentFlowData) + + try? container.encode(paymentFlow, forKey: .paymentFlow) + + try? container.encode(apiLink, forKey: .apiLink) + } + } + + /* + Model: PaymentFlow + Used By: Payment + */ + class PaymentFlow: Codable { + public var stripe: AggregatorRoute? + + public var razorpay: AggregatorRoute? + + public var upiRazorpay: AggregatorRoute? + + public var simpl: AggregatorRoute? + + public var juspay: AggregatorRoute? + + public var fynd: AggregatorRoute? + + public var ccavenue: AggregatorRoute? + + public var rupifi: AggregatorRoute? + + public var payubiz: AggregatorRoute? + + public var mswipe: AggregatorRoute? + + public var bqrRazorpay: AggregatorRoute? + + public enum CodingKeys: String, CodingKey { + case stripe + + case razorpay + + case upiRazorpay = "upi_razorpay" + + case simpl + + case juspay + + case fynd + + case ccavenue + + case rupifi + + case payubiz + + case mswipe + + case bqrRazorpay = "bqr_razorpay" + } + + public init(bqrRazorpay: AggregatorRoute?, ccavenue: AggregatorRoute?, fynd: AggregatorRoute?, juspay: AggregatorRoute?, mswipe: AggregatorRoute?, payubiz: AggregatorRoute?, razorpay: AggregatorRoute?, rupifi: AggregatorRoute?, simpl: AggregatorRoute?, stripe: AggregatorRoute?, upiRazorpay: AggregatorRoute?) { + self.stripe = stripe + + self.razorpay = razorpay + + self.upiRazorpay = upiRazorpay + + self.simpl = simpl + + self.juspay = juspay + + self.fynd = fynd + + self.ccavenue = ccavenue + + self.rupifi = rupifi + + self.payubiz = payubiz + + self.mswipe = mswipe + + self.bqrRazorpay = bqrRazorpay + } + + public func duplicate() -> PaymentFlow { + let dict = self.dictionary! + let copy = PaymentFlow(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + stripe = try container.decode(AggregatorRoute.self, forKey: .stripe) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + razorpay = try container.decode(AggregatorRoute.self, forKey: .razorpay) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + upiRazorpay = try container.decode(AggregatorRoute.self, forKey: .upiRazorpay) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + simpl = try container.decode(AggregatorRoute.self, forKey: .simpl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + juspay = try container.decode(AggregatorRoute.self, forKey: .juspay) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fynd = try container.decode(AggregatorRoute.self, forKey: .fynd) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ccavenue = try container.decode(AggregatorRoute.self, forKey: .ccavenue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rupifi = try container.decode(AggregatorRoute.self, forKey: .rupifi) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + payubiz = try container.decode(AggregatorRoute.self, forKey: .payubiz) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mswipe = try container.decode(AggregatorRoute.self, forKey: .mswipe) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bqrRazorpay = try container.decode(AggregatorRoute.self, forKey: .bqrRazorpay) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(stripe, forKey: .stripe) + + try? container.encode(razorpay, forKey: .razorpay) + + try? container.encode(upiRazorpay, forKey: .upiRazorpay) + + try? container.encode(simpl, forKey: .simpl) + + try? container.encode(juspay, forKey: .juspay) + + try? container.encode(fynd, forKey: .fynd) + + try? container.encode(ccavenue, forKey: .ccavenue) + + try? container.encode(rupifi, forKey: .rupifi) + + try? container.encode(payubiz, forKey: .payubiz) + + try? container.encode(mswipe, forKey: .mswipe) + + try? container.encode(bqrRazorpay, forKey: .bqrRazorpay) + } + } + + /* + Model: IntentAppErrorList + Used By: Payment + */ + class IntentAppErrorList: Codable { + public var packageName: String? + + public var code: String? + + public enum CodingKeys: String, CodingKey { + case packageName = "package_name" + + case code + } + + public init(code: String?, packageName: String?) { + self.packageName = packageName + + self.code = code + } + + public func duplicate() -> IntentAppErrorList { + let dict = self.dictionary! + let copy = IntentAppErrorList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + packageName = try container.decode(String.self, forKey: .packageName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(packageName, forKey: .packageName) + + try? container.encode(code, forKey: .code) + } + } + + /* + Model: PaymentModeLogo + Used By: Payment + */ + class PaymentModeLogo: Codable { + public var large: String + + public var small: String + + public enum CodingKeys: String, CodingKey { + case large + + case small + } + + public init(large: String, small: String) { + self.large = large + + self.small = small + } + + public func duplicate() -> PaymentModeLogo { + let dict = self.dictionary! + let copy = PaymentModeLogo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + large = try container.decode(String.self, forKey: .large) + + small = try container.decode(String.self, forKey: .small) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(large, forKey: .large) + + try? container.encodeIfPresent(small, forKey: .small) + } + } + + /* + Model: IntentApp + Used By: Payment + */ + class IntentApp: Codable { + public var packageName: String? + + public var logos: PaymentModeLogo? + + public var code: String? + + public var displayName: String? + + public enum CodingKeys: String, CodingKey { + case packageName = "package_name" + + case logos + + case code + + case displayName = "display_name" + } + + public init(code: String?, displayName: String?, logos: PaymentModeLogo?, packageName: String?) { + self.packageName = packageName + + self.logos = logos + + self.code = code + + self.displayName = displayName + } + + public func duplicate() -> IntentApp { + let dict = self.dictionary! + let copy = IntentApp(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + packageName = try container.decode(String.self, forKey: .packageName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logos = try container.decode(PaymentModeLogo.self, forKey: .logos) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(packageName, forKey: .packageName) + + try? container.encode(logos, forKey: .logos) + + try? container.encode(code, forKey: .code) + + try? container.encode(displayName, forKey: .displayName) + } + } + + /* + Model: PaymentModeList + Used By: Payment + */ + class PaymentModeList: Codable { + public var nickname: String? + + public var fyndVpa: String? + + public var cardId: String? + + public var expMonth: Int? + + public var cardFingerprint: String? + + public var intentAppErrorDictList: [IntentAppErrorList]? + + public var cardType: String? + + public var expYear: Int? + + public var merchantCode: String? + + public var displayName: String? + + public var cardIssuer: String? + + public var cardBrandImage: String? + + public var cardReference: String? + + public var name: String? + + public var retryCount: Int? + + public var displayPriority: Int? + + public var cardToken: String? + + public var logoUrl: PaymentModeLogo? + + public var expired: Bool? + + public var intentAppErrorList: [String]? + + public var cardIsin: String? + + public var intentFlow: Bool? + + public var aggregatorName: String + + public var timeout: Int? + + public var code: String? + + public var cardName: String? + + public var cardBrand: String? + + public var cardNumber: String? + + public var intentApp: [IntentApp]? + + public enum CodingKeys: String, CodingKey { + case nickname + + case fyndVpa = "fynd_vpa" + + case cardId = "card_id" + + case expMonth = "exp_month" + + case cardFingerprint = "card_fingerprint" + + case intentAppErrorDictList = "intent_app_error_dict_list" + + case cardType = "card_type" + + case expYear = "exp_year" + + case merchantCode = "merchant_code" + + case displayName = "display_name" + + case cardIssuer = "card_issuer" + + case cardBrandImage = "card_brand_image" + + case cardReference = "card_reference" + + case name + + case retryCount = "retry_count" + + case displayPriority = "display_priority" + + case cardToken = "card_token" + + case logoUrl = "logo_url" + + case expired + + case intentAppErrorList = "intent_app_error_list" + + case cardIsin = "card_isin" + + case intentFlow = "intent_flow" + + case aggregatorName = "aggregator_name" + + case timeout + + case code + + case cardName = "card_name" + + case cardBrand = "card_brand" + + case cardNumber = "card_number" + + case intentApp = "intent_app" + } + + public init(aggregatorName: String, cardBrand: String?, cardBrandImage: String?, cardFingerprint: String?, cardId: String?, cardIsin: String?, cardIssuer: String?, cardName: String?, cardNumber: String?, cardReference: String?, cardToken: String?, cardType: String?, code: String?, displayName: String?, displayPriority: Int?, expired: Bool?, expMonth: Int?, expYear: Int?, fyndVpa: String?, intentApp: [IntentApp]?, intentAppErrorDictList: [IntentAppErrorList]?, intentAppErrorList: [String]?, intentFlow: Bool?, logoUrl: PaymentModeLogo?, merchantCode: String?, name: String?, nickname: String?, retryCount: Int?, timeout: Int?) { + self.nickname = nickname + + self.fyndVpa = fyndVpa + + self.cardId = cardId + + self.expMonth = expMonth + + self.cardFingerprint = cardFingerprint + + self.intentAppErrorDictList = intentAppErrorDictList + + self.cardType = cardType + + self.expYear = expYear + + self.merchantCode = merchantCode + + self.displayName = displayName + + self.cardIssuer = cardIssuer + + self.cardBrandImage = cardBrandImage + + self.cardReference = cardReference + + self.name = name + + self.retryCount = retryCount + + self.displayPriority = displayPriority + + self.cardToken = cardToken + + self.logoUrl = logoUrl + + self.expired = expired + + self.intentAppErrorList = intentAppErrorList + + self.cardIsin = cardIsin + + self.intentFlow = intentFlow + + self.aggregatorName = aggregatorName + + self.timeout = timeout + + self.code = code + + self.cardName = cardName + + self.cardBrand = cardBrand + + self.cardNumber = cardNumber + + self.intentApp = intentApp + } + + public func duplicate() -> PaymentModeList { + let dict = self.dictionary! + let copy = PaymentModeList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + nickname = try container.decode(String.self, forKey: .nickname) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fyndVpa = try container.decode(String.self, forKey: .fyndVpa) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardId = try container.decode(String.self, forKey: .cardId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expMonth = try container.decode(Int.self, forKey: .expMonth) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardFingerprint = try container.decode(String.self, forKey: .cardFingerprint) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + intentAppErrorDictList = try container.decode([IntentAppErrorList].self, forKey: .intentAppErrorDictList) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardType = try container.decode(String.self, forKey: .cardType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expYear = try container.decode(Int.self, forKey: .expYear) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + merchantCode = try container.decode(String.self, forKey: .merchantCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardIssuer = try container.decode(String.self, forKey: .cardIssuer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardBrandImage = try container.decode(String.self, forKey: .cardBrandImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardReference = try container.decode(String.self, forKey: .cardReference) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + retryCount = try container.decode(Int.self, forKey: .retryCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayPriority = try container.decode(Int.self, forKey: .displayPriority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardToken = try container.decode(String.self, forKey: .cardToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logoUrl = try container.decode(PaymentModeLogo.self, forKey: .logoUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expired = try container.decode(Bool.self, forKey: .expired) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + intentAppErrorList = try container.decode([String].self, forKey: .intentAppErrorList) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardIsin = try container.decode(String.self, forKey: .cardIsin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + intentFlow = try container.decode(Bool.self, forKey: .intentFlow) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + aggregatorName = try container.decode(String.self, forKey: .aggregatorName) + + do { + timeout = try container.decode(Int.self, forKey: .timeout) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardName = try container.decode(String.self, forKey: .cardName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardBrand = try container.decode(String.self, forKey: .cardBrand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardNumber = try container.decode(String.self, forKey: .cardNumber) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + intentApp = try container.decode([IntentApp].self, forKey: .intentApp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(nickname, forKey: .nickname) + + try? container.encode(fyndVpa, forKey: .fyndVpa) + + try? container.encode(cardId, forKey: .cardId) + + try? container.encode(expMonth, forKey: .expMonth) + + try? container.encode(cardFingerprint, forKey: .cardFingerprint) + + try? container.encode(intentAppErrorDictList, forKey: .intentAppErrorDictList) + + try? container.encode(cardType, forKey: .cardType) + + try? container.encode(expYear, forKey: .expYear) + + try? container.encode(merchantCode, forKey: .merchantCode) + + try? container.encode(displayName, forKey: .displayName) + + try? container.encode(cardIssuer, forKey: .cardIssuer) + + try? container.encode(cardBrandImage, forKey: .cardBrandImage) + + try? container.encode(cardReference, forKey: .cardReference) + + try? container.encode(name, forKey: .name) + + try? container.encode(retryCount, forKey: .retryCount) + + try? container.encode(displayPriority, forKey: .displayPriority) + + try? container.encode(cardToken, forKey: .cardToken) + + try? container.encode(logoUrl, forKey: .logoUrl) + + try? container.encode(expired, forKey: .expired) + + try? container.encode(intentAppErrorList, forKey: .intentAppErrorList) + + try? container.encode(cardIsin, forKey: .cardIsin) + + try? container.encode(intentFlow, forKey: .intentFlow) + + try? container.encodeIfPresent(aggregatorName, forKey: .aggregatorName) + + try? container.encode(timeout, forKey: .timeout) + + try? container.encode(code, forKey: .code) + + try? container.encode(cardName, forKey: .cardName) + + try? container.encode(cardBrand, forKey: .cardBrand) + + try? container.encode(cardNumber, forKey: .cardNumber) + + try? container.encode(intentApp, forKey: .intentApp) + } + } + + /* + Model: RootPaymentMode + Used By: Payment + */ + class RootPaymentMode: Codable { + public var name: String + + public var aggregatorName: String? + + public var displayPriority: Int + + public var addCardEnabled: Bool? + + public var anonymousEnable: Bool? + + public var list: [PaymentModeList]? + + public var displayName: String + + public enum CodingKeys: String, CodingKey { + case name + + case aggregatorName = "aggregator_name" + + case displayPriority = "display_priority" + + case addCardEnabled = "add_card_enabled" + + case anonymousEnable = "anonymous_enable" + + case list + + case displayName = "display_name" + } + + public init(addCardEnabled: Bool?, aggregatorName: String?, anonymousEnable: Bool?, displayName: String, displayPriority: Int, list: [PaymentModeList]?, name: String) { + self.name = name + + self.aggregatorName = aggregatorName + + self.displayPriority = displayPriority + + self.addCardEnabled = addCardEnabled + + self.anonymousEnable = anonymousEnable + + self.list = list + + self.displayName = displayName + } + + public func duplicate() -> RootPaymentMode { + let dict = self.dictionary! + let copy = RootPaymentMode(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + name = try container.decode(String.self, forKey: .name) + + do { + aggregatorName = try container.decode(String.self, forKey: .aggregatorName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + displayPriority = try container.decode(Int.self, forKey: .displayPriority) + + do { + addCardEnabled = try container.decode(Bool.self, forKey: .addCardEnabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + anonymousEnable = try container.decode(Bool.self, forKey: .anonymousEnable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + list = try container.decode([PaymentModeList].self, forKey: .list) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + displayName = try container.decode(String.self, forKey: .displayName) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encode(aggregatorName, forKey: .aggregatorName) + + try? container.encodeIfPresent(displayPriority, forKey: .displayPriority) + + try? container.encode(addCardEnabled, forKey: .addCardEnabled) + + try? container.encode(anonymousEnable, forKey: .anonymousEnable) + + try? container.encodeIfPresent(list, forKey: .list) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + } + } + + /* + Model: PaymentOptionAndFlow + Used By: Payment + */ + class PaymentOptionAndFlow: Codable { + public var paymentFlows: PaymentFlow + + public var paymentOption: [RootPaymentMode] + + public enum CodingKeys: String, CodingKey { + case paymentFlows = "payment_flows" + + case paymentOption = "payment_option" + } + + public init(paymentFlows: PaymentFlow, paymentOption: [RootPaymentMode]) { + self.paymentFlows = paymentFlows + + self.paymentOption = paymentOption + } + + public func duplicate() -> PaymentOptionAndFlow { + let dict = self.dictionary! + let copy = PaymentOptionAndFlow(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + paymentFlows = try container.decode(PaymentFlow.self, forKey: .paymentFlows) + + paymentOption = try container.decode([RootPaymentMode].self, forKey: .paymentOption) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(paymentFlows, forKey: .paymentFlows) + + try? container.encodeIfPresent(paymentOption, forKey: .paymentOption) + } + } + + /* + Model: PaymentModeRouteResponse + Used By: Payment + */ + class PaymentModeRouteResponse: Codable { + public var paymentOptions: PaymentOptionAndFlow + + public var success: Bool + + public enum CodingKeys: String, CodingKey { + case paymentOptions = "payment_options" + + case success + } + + public init(paymentOptions: PaymentOptionAndFlow, success: Bool) { + self.paymentOptions = paymentOptions + + self.success = success + } + + public func duplicate() -> PaymentModeRouteResponse { + let dict = self.dictionary! + let copy = PaymentModeRouteResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + paymentOptions = try container.decode(PaymentOptionAndFlow.self, forKey: .paymentOptions) + + success = try container.decode(Bool.self, forKey: .success) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(paymentOptions, forKey: .paymentOptions) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: RupifiBannerData + Used By: Payment + */ + class RupifiBannerData: Codable { + public var status: String? + + public var kycUrl: String? + + public enum CodingKeys: String, CodingKey { + case status + + case kycUrl = "kyc_url" + } + + public init(kycUrl: String?, status: String?) { + self.status = status + + self.kycUrl = kycUrl + } + + public func duplicate() -> RupifiBannerData { + let dict = self.dictionary! + let copy = RupifiBannerData(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + kycUrl = try container.decode(String.self, forKey: .kycUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(kycUrl, forKey: .kycUrl) + } + } + + /* + Model: RupifiBannerResponse + Used By: Payment + */ + class RupifiBannerResponse: Codable { + public var success: Bool + + public var data: RupifiBannerData + + public enum CodingKeys: String, CodingKey { + case success + + case data + } + + public init(data: RupifiBannerData, success: Bool) { + self.success = success + + self.data = data + } + + public func duplicate() -> RupifiBannerResponse { + let dict = self.dictionary! + let copy = RupifiBannerResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + data = try container.decode(RupifiBannerData.self, forKey: .data) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: TransferItemsDetails + Used By: Payment + */ + class TransferItemsDetails: Codable { + public var name: String + + public var id: Int + + public var logoSmall: String + + public var logoLarge: String + + public var displayName: String? + + public enum CodingKeys: String, CodingKey { + case name + + case id + + case logoSmall = "logo_small" + + case logoLarge = "logo_large" + + case displayName = "display_name" + } + + public init(displayName: String?, id: Int, logoLarge: String, logoSmall: String, name: String) { + self.name = name + + self.id = id + + self.logoSmall = logoSmall + + self.logoLarge = logoLarge + + self.displayName = displayName + } + + public func duplicate() -> TransferItemsDetails { + let dict = self.dictionary! + let copy = TransferItemsDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + name = try container.decode(String.self, forKey: .name) + + id = try container.decode(Int.self, forKey: .id) + + logoSmall = try container.decode(String.self, forKey: .logoSmall) + + logoLarge = try container.decode(String.self, forKey: .logoLarge) + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(logoSmall, forKey: .logoSmall) + + try? container.encodeIfPresent(logoLarge, forKey: .logoLarge) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + } + } + + /* + Model: TransferModeDetails + Used By: Payment + */ + class TransferModeDetails: Codable { + public var items: [TransferItemsDetails]? + + public var displayName: String + + public enum CodingKeys: String, CodingKey { + case items + + case displayName = "display_name" + } + + public init(displayName: String, items: [TransferItemsDetails]?) { + self.items = items + + self.displayName = displayName + } + + public func duplicate() -> TransferModeDetails { + let dict = self.dictionary! + let copy = TransferModeDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([TransferItemsDetails].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + displayName = try container.decode(String.self, forKey: .displayName) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + } + } + + /* + Model: TransferModeResponse + Used By: Payment + */ + class TransferModeResponse: Codable { + public var data: [TransferModeDetails] + + public enum CodingKeys: String, CodingKey { + case data + } + + public init(data: [TransferModeDetails]) { + self.data = data + } + + public func duplicate() -> TransferModeResponse { + let dict = self.dictionary! + let copy = TransferModeResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + data = try container.decode([TransferModeDetails].self, forKey: .data) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: UpdateRefundTransferModeRequest + Used By: Payment + */ + class UpdateRefundTransferModeRequest: Codable { + public var enable: Bool + + public var transferMode: String + + public enum CodingKeys: String, CodingKey { + case enable + + case transferMode = "transfer_mode" + } + + public init(enable: Bool, transferMode: String) { + self.enable = enable + + self.transferMode = transferMode + } + + public func duplicate() -> UpdateRefundTransferModeRequest { + let dict = self.dictionary! + let copy = UpdateRefundTransferModeRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + enable = try container.decode(Bool.self, forKey: .enable) + + transferMode = try container.decode(String.self, forKey: .transferMode) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enable, forKey: .enable) + + try? container.encodeIfPresent(transferMode, forKey: .transferMode) + } + } + + /* + Model: UpdateRefundTransferModeResponse + Used By: Payment + */ + class UpdateRefundTransferModeResponse: Codable { + public var success: Bool? + + public enum CodingKeys: String, CodingKey { + case success + } + + public init(success: Bool?) { + self.success = success + } + + public func duplicate() -> UpdateRefundTransferModeResponse { + let dict = self.dictionary! + let copy = UpdateRefundTransferModeResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: OrderBeneficiaryDetails + Used By: Payment + */ + class OrderBeneficiaryDetails: Codable { + public var modifiedOn: String + + public var email: String + + public var isActive: Bool + + public var transferMode: String + + public var mobile: Bool? + + public var branchName: Bool? + + public var createdOn: String + + public var ifscCode: String + + public var comment: Bool? + + public var subtitle: String + + public var displayName: String + + public var id: Int + + public var accountHolder: String + + public var address: String + + public var bankName: String + + public var accountNo: String + + public var beneficiaryId: String + + public var title: String + + public var delightsUserName: String? + + public enum CodingKeys: String, CodingKey { + case modifiedOn = "modified_on" + + case email + + case isActive = "is_active" + + case transferMode = "transfer_mode" + + case mobile + + case branchName = "branch_name" + + case createdOn = "created_on" + + case ifscCode = "ifsc_code" + + case comment + + case subtitle + + case displayName = "display_name" + + case id + + case accountHolder = "account_holder" + + case address + + case bankName = "bank_name" + + case accountNo = "account_no" + + case beneficiaryId = "beneficiary_id" + + case title + + case delightsUserName = "delights_user_name" + } + + public init(accountHolder: String, accountNo: String, address: String, bankName: String, beneficiaryId: String, branchName: Bool?, comment: Bool?, createdOn: String, delightsUserName: String?, displayName: String, email: String, id: Int, ifscCode: String, isActive: Bool, mobile: Bool?, modifiedOn: String, subtitle: String, title: String, transferMode: String) { + self.modifiedOn = modifiedOn + + self.email = email + + self.isActive = isActive + + self.transferMode = transferMode + + self.mobile = mobile + + self.branchName = branchName + + self.createdOn = createdOn + + self.ifscCode = ifscCode + + self.comment = comment + + self.subtitle = subtitle + + self.displayName = displayName + + self.id = id + + self.accountHolder = accountHolder + + self.address = address + + self.bankName = bankName + + self.accountNo = accountNo + + self.beneficiaryId = beneficiaryId + + self.title = title + + self.delightsUserName = delightsUserName + } + + public func duplicate() -> OrderBeneficiaryDetails { + let dict = self.dictionary! + let copy = OrderBeneficiaryDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + email = try container.decode(String.self, forKey: .email) + + isActive = try container.decode(Bool.self, forKey: .isActive) + + transferMode = try container.decode(String.self, forKey: .transferMode) + + do { + mobile = try container.decode(Bool.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + branchName = try container.decode(Bool.self, forKey: .branchName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + createdOn = try container.decode(String.self, forKey: .createdOn) + + ifscCode = try container.decode(String.self, forKey: .ifscCode) + + do { + comment = try container.decode(Bool.self, forKey: .comment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + subtitle = try container.decode(String.self, forKey: .subtitle) + + displayName = try container.decode(String.self, forKey: .displayName) + + id = try container.decode(Int.self, forKey: .id) + + accountHolder = try container.decode(String.self, forKey: .accountHolder) + + address = try container.decode(String.self, forKey: .address) + + bankName = try container.decode(String.self, forKey: .bankName) + + accountNo = try container.decode(String.self, forKey: .accountNo) + + beneficiaryId = try container.decode(String.self, forKey: .beneficiaryId) + + title = try container.decode(String.self, forKey: .title) + + do { + delightsUserName = try container.decode(String.self, forKey: .delightsUserName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(transferMode, forKey: .transferMode) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + try? container.encodeIfPresent(branchName, forKey: .branchName) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(ifscCode, forKey: .ifscCode) + + try? container.encodeIfPresent(comment, forKey: .comment) + + try? container.encodeIfPresent(subtitle, forKey: .subtitle) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(accountHolder, forKey: .accountHolder) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(bankName, forKey: .bankName) + + try? container.encodeIfPresent(accountNo, forKey: .accountNo) + + try? container.encodeIfPresent(beneficiaryId, forKey: .beneficiaryId) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encode(delightsUserName, forKey: .delightsUserName) + } + } + + /* + Model: OrderBeneficiaryResponse + Used By: Payment + */ + class OrderBeneficiaryResponse: Codable { + public var beneficiaries: [OrderBeneficiaryDetails]? + + public var showBeneficiaryDetails: Bool? + + public enum CodingKeys: String, CodingKey { + case beneficiaries + + case showBeneficiaryDetails = "show_beneficiary_details" + } + + public init(beneficiaries: [OrderBeneficiaryDetails]?, showBeneficiaryDetails: Bool?) { + self.beneficiaries = beneficiaries + + self.showBeneficiaryDetails = showBeneficiaryDetails + } + + public func duplicate() -> OrderBeneficiaryResponse { + let dict = self.dictionary! + let copy = OrderBeneficiaryResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + beneficiaries = try container.decode([OrderBeneficiaryDetails].self, forKey: .beneficiaries) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + showBeneficiaryDetails = try container.decode(Bool.self, forKey: .showBeneficiaryDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(beneficiaries, forKey: .beneficiaries) + + try? container.encodeIfPresent(showBeneficiaryDetails, forKey: .showBeneficiaryDetails) + } + } + + /* + Model: NotFoundResourceError + Used By: Payment + */ + class NotFoundResourceError: Codable { + public var success: Bool + + public var code: String + + public var description: String + + public enum CodingKeys: String, CodingKey { + case success + + case code + + case description + } + + public init(code: String, description: String, success: Bool) { + self.success = success + + self.code = code + + self.description = description + } + + public func duplicate() -> NotFoundResourceError { + let dict = self.dictionary! + let copy = NotFoundResourceError(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + code = try container.decode(String.self, forKey: .code) + + description = try container.decode(String.self, forKey: .description) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(description, forKey: .description) + } + } + + /* + Model: IfscCodeResponse + Used By: Payment + */ + class IfscCodeResponse: Codable { + public var success: Bool? + + public var bankName: String + + public var branchName: String + + public enum CodingKeys: String, CodingKey { + case success + + case bankName = "bank_name" + + case branchName = "branch_name" + } + + public init(bankName: String, branchName: String, success: Bool?) { + self.success = success + + self.bankName = bankName + + self.branchName = branchName + } + + public func duplicate() -> IfscCodeResponse { + let dict = self.dictionary! + let copy = IfscCodeResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + bankName = try container.decode(String.self, forKey: .bankName) + + branchName = try container.decode(String.self, forKey: .branchName) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(bankName, forKey: .bankName) + + try? container.encodeIfPresent(branchName, forKey: .branchName) + } + } + + /* + Model: ErrorCodeDescription + Used By: Payment + */ + class ErrorCodeDescription: Codable { + public var success: Bool + + public var code: String + + public var description: String + + public enum CodingKeys: String, CodingKey { + case success + + case code + + case description + } + + public init(code: String, description: String, success: Bool) { + self.success = success + + self.code = code + + self.description = description + } + + public func duplicate() -> ErrorCodeDescription { + let dict = self.dictionary! + let copy = ErrorCodeDescription(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + code = try container.decode(String.self, forKey: .code) + + description = try container.decode(String.self, forKey: .description) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(description, forKey: .description) + } + } + + /* + Model: AddBeneficiaryViaOtpVerificationRequest + Used By: Payment + */ + class AddBeneficiaryViaOtpVerificationRequest: Codable { + public var otp: String + + public var hashKey: String + + public var requestId: String + + public enum CodingKeys: String, CodingKey { + case otp + + case hashKey = "hash_key" + + case requestId = "request_id" + } + + public init(hashKey: String, otp: String, requestId: String) { + self.otp = otp + + self.hashKey = hashKey + + self.requestId = requestId + } + + public func duplicate() -> AddBeneficiaryViaOtpVerificationRequest { + let dict = self.dictionary! + let copy = AddBeneficiaryViaOtpVerificationRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + otp = try container.decode(String.self, forKey: .otp) + + hashKey = try container.decode(String.self, forKey: .hashKey) + + requestId = try container.decode(String.self, forKey: .requestId) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(otp, forKey: .otp) + + try? container.encodeIfPresent(hashKey, forKey: .hashKey) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + } + } + + /* + Model: AddBeneficiaryViaOtpVerificationResponse + Used By: Payment + */ + class AddBeneficiaryViaOtpVerificationResponse: Codable { + public var success: Bool? + + public var message: String + + public enum CodingKeys: String, CodingKey { + case success + + case message + } + + public init(message: String, success: Bool?) { + self.success = success + + self.message = message + } + + public func duplicate() -> AddBeneficiaryViaOtpVerificationResponse { + let dict = self.dictionary! + let copy = AddBeneficiaryViaOtpVerificationResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + message = try container.decode(String.self, forKey: .message) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: WrongOtpError + Used By: Payment + */ + class WrongOtpError: Codable { + public var isVerifiedFlag: Bool + + public var success: String + + public var description: String + + public enum CodingKeys: String, CodingKey { + case isVerifiedFlag = "is_verified_flag" + + case success + + case description + } + + public init(description: String, isVerifiedFlag: Bool, success: String) { + self.isVerifiedFlag = isVerifiedFlag + + self.success = success + + self.description = description + } + + public func duplicate() -> WrongOtpError { + let dict = self.dictionary! + let copy = WrongOtpError(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + isVerifiedFlag = try container.decode(Bool.self, forKey: .isVerifiedFlag) + + success = try container.decode(String.self, forKey: .success) + + description = try container.decode(String.self, forKey: .description) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isVerifiedFlag, forKey: .isVerifiedFlag) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(description, forKey: .description) + } + } + + /* + Model: BeneficiaryModeDetails + Used By: Payment + */ + class BeneficiaryModeDetails: Codable { + public var comment: String? + + public var ifscCode: String + + public var vpa: String? + + public var email: String + + public var wallet: String? + + public var accountHolder: String + + public var mobile: String + + public var accountNo: String + + public var address: String? + + public var bankName: String + + public var branchName: String + + public enum CodingKeys: String, CodingKey { + case comment + + case ifscCode = "ifsc_code" + + case vpa + + case email + + case wallet + + case accountHolder = "account_holder" + + case mobile + + case accountNo = "account_no" + + case address + + case bankName = "bank_name" + + case branchName = "branch_name" + } + + public init(accountHolder: String, accountNo: String, address: String?, bankName: String, branchName: String, comment: String?, email: String, ifscCode: String, mobile: String, vpa: String?, wallet: String?) { + self.comment = comment + + self.ifscCode = ifscCode + + self.vpa = vpa + + self.email = email + + self.wallet = wallet + + self.accountHolder = accountHolder + + self.mobile = mobile + + self.accountNo = accountNo + + self.address = address + + self.bankName = bankName + + self.branchName = branchName + } + + public func duplicate() -> BeneficiaryModeDetails { + let dict = self.dictionary! + let copy = BeneficiaryModeDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + comment = try container.decode(String.self, forKey: .comment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + ifscCode = try container.decode(String.self, forKey: .ifscCode) + + do { + vpa = try container.decode(String.self, forKey: .vpa) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + email = try container.decode(String.self, forKey: .email) + + do { + wallet = try container.decode(String.self, forKey: .wallet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + accountHolder = try container.decode(String.self, forKey: .accountHolder) + + mobile = try container.decode(String.self, forKey: .mobile) + + accountNo = try container.decode(String.self, forKey: .accountNo) + + do { + address = try container.decode(String.self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + bankName = try container.decode(String.self, forKey: .bankName) + + branchName = try container.decode(String.self, forKey: .branchName) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(comment, forKey: .comment) + + try? container.encodeIfPresent(ifscCode, forKey: .ifscCode) + + try? container.encode(vpa, forKey: .vpa) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encode(wallet, forKey: .wallet) + + try? container.encodeIfPresent(accountHolder, forKey: .accountHolder) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + try? container.encodeIfPresent(accountNo, forKey: .accountNo) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(bankName, forKey: .bankName) + + try? container.encodeIfPresent(branchName, forKey: .branchName) + } + } + + /* + Model: AddBeneficiaryDetailsRequest + Used By: Payment + */ + class AddBeneficiaryDetailsRequest: Codable { + public var otp: String? + + public var details: BeneficiaryModeDetails + + public var shipmentId: String + + public var orderId: String + + public var delights: Bool + + public var transferMode: String + + public var requestId: String? + + public enum CodingKeys: String, CodingKey { + case otp + + case details + + case shipmentId = "shipment_id" + + case orderId = "order_id" + + case delights + + case transferMode = "transfer_mode" + + case requestId = "request_id" + } + + public init(delights: Bool, details: BeneficiaryModeDetails, orderId: String, otp: String?, requestId: String?, shipmentId: String, transferMode: String) { + self.otp = otp + + self.details = details + + self.shipmentId = shipmentId + + self.orderId = orderId + + self.delights = delights + + self.transferMode = transferMode + + self.requestId = requestId + } + + public func duplicate() -> AddBeneficiaryDetailsRequest { + let dict = self.dictionary! + let copy = AddBeneficiaryDetailsRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + otp = try container.decode(String.self, forKey: .otp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + details = try container.decode(BeneficiaryModeDetails.self, forKey: .details) + + shipmentId = try container.decode(String.self, forKey: .shipmentId) + + orderId = try container.decode(String.self, forKey: .orderId) + + delights = try container.decode(Bool.self, forKey: .delights) + + transferMode = try container.decode(String.self, forKey: .transferMode) + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(otp, forKey: .otp) + + try? container.encodeIfPresent(details, forKey: .details) + + try? container.encodeIfPresent(shipmentId, forKey: .shipmentId) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + + try? container.encodeIfPresent(delights, forKey: .delights) + + try? container.encodeIfPresent(transferMode, forKey: .transferMode) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + } + } + + /* + Model: RefundAccountResponse + Used By: Payment + */ + class RefundAccountResponse: Codable { + public var isVerifiedFlag: Bool? + + public var success: Bool + + public var data: [String: Any]? + + public var message: String + + public enum CodingKeys: String, CodingKey { + case isVerifiedFlag = "is_verified_flag" + + case success + + case data + + case message + } + + public init(data: [String: Any]?, isVerifiedFlag: Bool?, message: String, success: Bool) { + self.isVerifiedFlag = isVerifiedFlag + + self.success = success + + self.data = data + + self.message = message + } + + public func duplicate() -> RefundAccountResponse { + let dict = self.dictionary! + let copy = RefundAccountResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isVerifiedFlag = try container.decode(Bool.self, forKey: .isVerifiedFlag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + success = try container.decode(Bool.self, forKey: .success) + + do { + data = try container.decode([String: Any].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + message = try container.decode(String.self, forKey: .message) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isVerifiedFlag, forKey: .isVerifiedFlag) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: BankDetailsForOTP + Used By: Payment + */ + class BankDetailsForOTP: Codable { + public var ifscCode: String + + public var accountHolder: String + + public var accountNo: String + + public var bankName: String + + public var branchName: String + + public enum CodingKeys: String, CodingKey { + case ifscCode = "ifsc_code" + + case accountHolder = "account_holder" + + case accountNo = "account_no" + + case bankName = "bank_name" + + case branchName = "branch_name" + } + + public init(accountHolder: String, accountNo: String, bankName: String, branchName: String, ifscCode: String) { + self.ifscCode = ifscCode + + self.accountHolder = accountHolder + + self.accountNo = accountNo + + self.bankName = bankName + + self.branchName = branchName + } + + public func duplicate() -> BankDetailsForOTP { + let dict = self.dictionary! + let copy = BankDetailsForOTP(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + ifscCode = try container.decode(String.self, forKey: .ifscCode) + + accountHolder = try container.decode(String.self, forKey: .accountHolder) + + accountNo = try container.decode(String.self, forKey: .accountNo) + + bankName = try container.decode(String.self, forKey: .bankName) + + branchName = try container.decode(String.self, forKey: .branchName) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(ifscCode, forKey: .ifscCode) + + try? container.encodeIfPresent(accountHolder, forKey: .accountHolder) + + try? container.encodeIfPresent(accountNo, forKey: .accountNo) + + try? container.encodeIfPresent(bankName, forKey: .bankName) + + try? container.encodeIfPresent(branchName, forKey: .branchName) + } + } + + /* + Model: AddBeneficiaryDetailsOTPRequest + Used By: Payment + */ + class AddBeneficiaryDetailsOTPRequest: Codable { + public var details: BankDetailsForOTP + + public var orderId: String + + public enum CodingKeys: String, CodingKey { + case details + + case orderId = "order_id" + } + + public init(details: BankDetailsForOTP, orderId: String) { + self.details = details + + self.orderId = orderId + } + + public func duplicate() -> AddBeneficiaryDetailsOTPRequest { + let dict = self.dictionary! + let copy = AddBeneficiaryDetailsOTPRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + details = try container.decode(BankDetailsForOTP.self, forKey: .details) + + orderId = try container.decode(String.self, forKey: .orderId) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(details, forKey: .details) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + } + } + + /* + Model: WalletOtpRequest + Used By: Payment + */ + class WalletOtpRequest: Codable { + public var countryCode: String + + public var mobile: String + + public enum CodingKeys: String, CodingKey { + case countryCode = "country_code" + + case mobile + } + + public init(countryCode: String, mobile: String) { + self.countryCode = countryCode + + self.mobile = mobile + } + + public func duplicate() -> WalletOtpRequest { + let dict = self.dictionary! + let copy = WalletOtpRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + countryCode = try container.decode(String.self, forKey: .countryCode) + + mobile = try container.decode(String.self, forKey: .mobile) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + } + } + + /* + Model: WalletOtpResponse + Used By: Payment + */ + class WalletOtpResponse: Codable { + public var isVerifiedFlag: String + + public var success: Bool? + + public var requestId: String + + public enum CodingKeys: String, CodingKey { + case isVerifiedFlag = "is_verified_flag" + + case success + + case requestId = "request_id" + } + + public init(isVerifiedFlag: String, requestId: String, success: Bool?) { + self.isVerifiedFlag = isVerifiedFlag + + self.success = success + + self.requestId = requestId + } + + public func duplicate() -> WalletOtpResponse { + let dict = self.dictionary! + let copy = WalletOtpResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + isVerifiedFlag = try container.decode(String.self, forKey: .isVerifiedFlag) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + requestId = try container.decode(String.self, forKey: .requestId) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isVerifiedFlag, forKey: .isVerifiedFlag) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + } + } + + /* + Model: SetDefaultBeneficiaryRequest + Used By: Payment + */ + class SetDefaultBeneficiaryRequest: Codable { + public var beneficiaryId: String + + public var orderId: String + + public enum CodingKeys: String, CodingKey { + case beneficiaryId = "beneficiary_id" + + case orderId = "order_id" + } + + public init(beneficiaryId: String, orderId: String) { + self.beneficiaryId = beneficiaryId + + self.orderId = orderId + } + + public func duplicate() -> SetDefaultBeneficiaryRequest { + let dict = self.dictionary! + let copy = SetDefaultBeneficiaryRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + beneficiaryId = try container.decode(String.self, forKey: .beneficiaryId) + + orderId = try container.decode(String.self, forKey: .orderId) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(beneficiaryId, forKey: .beneficiaryId) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + } + } + + /* + Model: SetDefaultBeneficiaryResponse + Used By: Payment + */ + class SetDefaultBeneficiaryResponse: Codable { + public var success: Bool? + + public var isBeneficiarySet: Bool + + public enum CodingKeys: String, CodingKey { + case success + + case isBeneficiarySet = "is_beneficiary_set" + } + + public init(isBeneficiarySet: Bool, success: Bool?) { + self.success = success + + self.isBeneficiarySet = isBeneficiarySet + } + + public func duplicate() -> SetDefaultBeneficiaryResponse { + let dict = self.dictionary! + let copy = SetDefaultBeneficiaryResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + isBeneficiarySet = try container.decode(Bool.self, forKey: .isBeneficiarySet) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(isBeneficiarySet, forKey: .isBeneficiarySet) + } + } +} diff --git a/Sources/code/application/models/PosCartAppModelClass.swift b/Sources/code/application/models/PosCartAppModelClass.swift new file mode 100644 index 0000000000..dbc2dd889c --- /dev/null +++ b/Sources/code/application/models/PosCartAppModelClass.swift @@ -0,0 +1,834 @@ +import Foundation + +import Foundation +public extension ApplicationClient { + /* + Model: UpdateCartShipmentItem + Used By: PosCart + */ + class UpdateCartShipmentItem: Codable { + public var quantity: Int? + + public var shipmentType: String + + public var articleUid: String + + public enum CodingKeys: String, CodingKey { + case quantity + + case shipmentType = "shipment_type" + + case articleUid = "article_uid" + } + + public init(articleUid: String, quantity: Int?, shipmentType: String) { + self.quantity = quantity + + self.shipmentType = shipmentType + + self.articleUid = articleUid + } + + public func duplicate() -> UpdateCartShipmentItem { + let dict = self.dictionary! + let copy = UpdateCartShipmentItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + shipmentType = try container.decode(String.self, forKey: .shipmentType) + + articleUid = try container.decode(String.self, forKey: .articleUid) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(shipmentType, forKey: .shipmentType) + + try? container.encodeIfPresent(articleUid, forKey: .articleUid) + } + } + + /* + Model: UpdateCartShipmentRequest + Used By: PosCart + */ + class UpdateCartShipmentRequest: Codable { + public var shipments: [UpdateCartShipmentItem] + + public enum CodingKeys: String, CodingKey { + case shipments + } + + public init(shipments: [UpdateCartShipmentItem]) { + self.shipments = shipments + } + + public func duplicate() -> UpdateCartShipmentRequest { + let dict = self.dictionary! + let copy = UpdateCartShipmentRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + shipments = try container.decode([UpdateCartShipmentItem].self, forKey: .shipments) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(shipments, forKey: .shipments) + } + } + + /* + Model: Files + Used By: PosCart + */ + class Files: Codable { + public var values: [String] + + public var key: String + + public enum CodingKeys: String, CodingKey { + case values + + case key + } + + public init(key: String, values: [String]) { + self.values = values + + self.key = key + } + + public func duplicate() -> Files { + let dict = self.dictionary! + let copy = Files(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + values = try container.decode([String].self, forKey: .values) + + key = try container.decode(String.self, forKey: .key) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(values, forKey: .values) + + try? container.encodeIfPresent(key, forKey: .key) + } + } + + /* + Model: CartPosCheckoutDetailRequest + Used By: PosCart + */ + class CartPosCheckoutDetailRequest: Codable { + public var paymentAutoConfirm: Bool? + + public var merchantCode: String? + + public var pickAtStoreUid: Int? + + public var billingAddress: [String: Any]? + + public var meta: [String: Any]? + + public var aggregator: String? + + public var callbackUrl: String? + + public var orderingStore: Int? + + public var extraMeta: [String: Any]? + + public var pos: Bool? + + public var files: [Files]? + + public var staff: StaffCheckout? + + public var addressId: String? + + public var paymentParams: [String: Any]? + + public var orderType: String + + public var deliveryAddress: [String: Any]? + + public var billingAddressId: String? + + public var paymentMode: String + + public var paymentIdentifier: String? + + public enum CodingKeys: String, CodingKey { + case paymentAutoConfirm = "payment_auto_confirm" + + case merchantCode = "merchant_code" + + case pickAtStoreUid = "pick_at_store_uid" + + case billingAddress = "billing_address" + + case meta + + case aggregator + + case callbackUrl = "callback_url" + + case orderingStore = "ordering_store" + + case extraMeta = "extra_meta" + + case pos + + case files + + case staff + + case addressId = "address_id" + + case paymentParams = "payment_params" + + case orderType = "order_type" + + case deliveryAddress = "delivery_address" + + case billingAddressId = "billing_address_id" + + case paymentMode = "payment_mode" + + case paymentIdentifier = "payment_identifier" + } + + public init(addressId: String?, aggregator: String?, billingAddress: [String: Any]?, billingAddressId: String?, callbackUrl: String?, deliveryAddress: [String: Any]?, extraMeta: [String: Any]?, files: [Files]?, merchantCode: String?, meta: [String: Any]?, orderingStore: Int?, orderType: String, paymentAutoConfirm: Bool?, paymentIdentifier: String?, paymentMode: String, paymentParams: [String: Any]?, pickAtStoreUid: Int?, pos: Bool?, staff: StaffCheckout?) { + self.paymentAutoConfirm = paymentAutoConfirm + + self.merchantCode = merchantCode + + self.pickAtStoreUid = pickAtStoreUid + + self.billingAddress = billingAddress + + self.meta = meta + + self.aggregator = aggregator + + self.callbackUrl = callbackUrl + + self.orderingStore = orderingStore + + self.extraMeta = extraMeta + + self.pos = pos + + self.files = files + + self.staff = staff + + self.addressId = addressId + + self.paymentParams = paymentParams + + self.orderType = orderType + + self.deliveryAddress = deliveryAddress + + self.billingAddressId = billingAddressId + + self.paymentMode = paymentMode + + self.paymentIdentifier = paymentIdentifier + } + + public func duplicate() -> CartPosCheckoutDetailRequest { + let dict = self.dictionary! + let copy = CartPosCheckoutDetailRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + paymentAutoConfirm = try container.decode(Bool.self, forKey: .paymentAutoConfirm) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + merchantCode = try container.decode(String.self, forKey: .merchantCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pickAtStoreUid = try container.decode(Int.self, forKey: .pickAtStoreUid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + billingAddress = try container.decode([String: Any].self, forKey: .billingAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + aggregator = try container.decode(String.self, forKey: .aggregator) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + callbackUrl = try container.decode(String.self, forKey: .callbackUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderingStore = try container.decode(Int.self, forKey: .orderingStore) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + extraMeta = try container.decode([String: Any].self, forKey: .extraMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pos = try container.decode(Bool.self, forKey: .pos) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + files = try container.decode([Files].self, forKey: .files) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + staff = try container.decode(StaffCheckout.self, forKey: .staff) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressId = try container.decode(String.self, forKey: .addressId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentParams = try container.decode([String: Any].self, forKey: .paymentParams) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + orderType = try container.decode(String.self, forKey: .orderType) + + do { + deliveryAddress = try container.decode([String: Any].self, forKey: .deliveryAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + billingAddressId = try container.decode(String.self, forKey: .billingAddressId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + paymentMode = try container.decode(String.self, forKey: .paymentMode) + + do { + paymentIdentifier = try container.decode(String.self, forKey: .paymentIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(paymentAutoConfirm, forKey: .paymentAutoConfirm) + + try? container.encodeIfPresent(merchantCode, forKey: .merchantCode) + + try? container.encode(pickAtStoreUid, forKey: .pickAtStoreUid) + + try? container.encodeIfPresent(billingAddress, forKey: .billingAddress) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(aggregator, forKey: .aggregator) + + try? container.encode(callbackUrl, forKey: .callbackUrl) + + try? container.encode(orderingStore, forKey: .orderingStore) + + try? container.encodeIfPresent(extraMeta, forKey: .extraMeta) + + try? container.encodeIfPresent(pos, forKey: .pos) + + try? container.encodeIfPresent(files, forKey: .files) + + try? container.encodeIfPresent(staff, forKey: .staff) + + try? container.encodeIfPresent(addressId, forKey: .addressId) + + try? container.encode(paymentParams, forKey: .paymentParams) + + try? container.encodeIfPresent(orderType, forKey: .orderType) + + try? container.encodeIfPresent(deliveryAddress, forKey: .deliveryAddress) + + try? container.encodeIfPresent(billingAddressId, forKey: .billingAddressId) + + try? container.encodeIfPresent(paymentMode, forKey: .paymentMode) + + try? container.encode(paymentIdentifier, forKey: .paymentIdentifier) + } + } + + /* + Model: CartDeliveryModesResponse + Used By: PosCart + */ + class CartDeliveryModesResponse: Codable { + public var availableModes: [String]? + + public var pickupStores: [Int]? + + public enum CodingKeys: String, CodingKey { + case availableModes = "available_modes" + + case pickupStores = "pickup_stores" + } + + public init(availableModes: [String]?, pickupStores: [Int]?) { + self.availableModes = availableModes + + self.pickupStores = pickupStores + } + + public func duplicate() -> CartDeliveryModesResponse { + let dict = self.dictionary! + let copy = CartDeliveryModesResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + availableModes = try container.decode([String].self, forKey: .availableModes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pickupStores = try container.decode([Int].self, forKey: .pickupStores) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(availableModes, forKey: .availableModes) + + try? container.encodeIfPresent(pickupStores, forKey: .pickupStores) + } + } + + /* + Model: PickupStoreDetail + Used By: PosCart + */ + class PickupStoreDetail: Codable { + public var landmark: String? + + public var state: String? + + public var email: String? + + public var pincode: Int? + + public var name: String? + + public var uid: Int? + + public var areaCode: String? + + public var area: String? + + public var country: String? + + public var id: Int? + + public var phone: String? + + public var address: String? + + public var areaCodeSlug: String? + + public var addressType: String? + + public var city: String? + + public var storeCode: String? + + public enum CodingKeys: String, CodingKey { + case landmark + + case state + + case email + + case pincode + + case name + + case uid + + case areaCode = "area_code" + + case area + + case country + + case id + + case phone + + case address + + case areaCodeSlug = "area_code_slug" + + case addressType = "address_type" + + case city + + case storeCode = "store_code" + } + + public init(address: String?, addressType: String?, area: String?, areaCode: String?, areaCodeSlug: String?, city: String?, country: String?, email: String?, id: Int?, landmark: String?, name: String?, phone: String?, pincode: Int?, state: String?, storeCode: String?, uid: Int?) { + self.landmark = landmark + + self.state = state + + self.email = email + + self.pincode = pincode + + self.name = name + + self.uid = uid + + self.areaCode = areaCode + + self.area = area + + self.country = country + + self.id = id + + self.phone = phone + + self.address = address + + self.areaCodeSlug = areaCodeSlug + + self.addressType = addressType + + self.city = city + + self.storeCode = storeCode + } + + public func duplicate() -> PickupStoreDetail { + let dict = self.dictionary! + let copy = PickupStoreDetail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + landmark = try container.decode(String.self, forKey: .landmark) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(Int.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + areaCode = try container.decode(String.self, forKey: .areaCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + area = try container.decode(String.self, forKey: .area) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address = try container.decode(String.self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + areaCodeSlug = try container.decode(String.self, forKey: .areaCodeSlug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressType = try container.decode(String.self, forKey: .addressType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeCode = try container.decode(String.self, forKey: .storeCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(landmark, forKey: .landmark) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(areaCode, forKey: .areaCode) + + try? container.encodeIfPresent(area, forKey: .area) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(areaCodeSlug, forKey: .areaCodeSlug) + + try? container.encodeIfPresent(addressType, forKey: .addressType) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(storeCode, forKey: .storeCode) + } + } + + /* + Model: StoreDetailsResponse + Used By: PosCart + */ + class StoreDetailsResponse: Codable { + public var items: [PickupStoreDetail]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [PickupStoreDetail]?) { + self.items = items + } + + public func duplicate() -> StoreDetailsResponse { + let dict = self.dictionary! + let copy = StoreDetailsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([PickupStoreDetail].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } +} diff --git a/Sources/code/application/models/RewardsAppModelClass.swift b/Sources/code/application/models/RewardsAppModelClass.swift new file mode 100644 index 0000000000..b02d928045 --- /dev/null +++ b/Sources/code/application/models/RewardsAppModelClass.swift @@ -0,0 +1,1818 @@ +import Foundation + +import Foundation +public extension ApplicationClient { + /* + Model: ActionPageParams + Used By: Rewards + */ + class ActionPageParams: Codable { + public var slug: [String]? + + public enum CodingKeys: String, CodingKey { + case slug + } + + public init(slug: [String]?) { + self.slug = slug + } + + public func duplicate() -> ActionPageParams { + let dict = self.dictionary! + let copy = ActionPageParams(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode([String].self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + } + } + + /* + Model: CatalogueOrderRequest + Used By: Rewards + */ + class CatalogueOrderRequest: Codable { + public var articles: [RewardsArticle]? + + public enum CodingKeys: String, CodingKey { + case articles + } + + public init(articles: [RewardsArticle]?) { + self.articles = articles + } + + public func duplicate() -> CatalogueOrderRequest { + let dict = self.dictionary! + let copy = CatalogueOrderRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + articles = try container.decode([RewardsArticle].self, forKey: .articles) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(articles, forKey: .articles) + } + } + + /* + Model: CatalogueOrderResponse + Used By: Rewards + */ + class CatalogueOrderResponse: Codable { + public var articles: [RewardsArticle]? + + public enum CodingKeys: String, CodingKey { + case articles + } + + public init(articles: [RewardsArticle]?) { + self.articles = articles + } + + public func duplicate() -> CatalogueOrderResponse { + let dict = self.dictionary! + let copy = CatalogueOrderResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + articles = try container.decode([RewardsArticle].self, forKey: .articles) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(articles, forKey: .articles) + } + } + + /* + Model: DiscountProperties + Used By: Rewards + */ + class DiscountProperties: Codable { + public var absolute: Double? + + public var currency: String? + + public var displayAbsolute: String? + + public var displayPercent: String? + + public var percent: Double? + + public enum CodingKeys: String, CodingKey { + case absolute + + case currency + + case displayAbsolute = "display_absolute" + + case displayPercent = "display_percent" + + case percent + } + + public init(absolute: Double?, currency: String?, displayAbsolute: String?, displayPercent: String?, percent: Double?) { + self.absolute = absolute + + self.currency = currency + + self.displayAbsolute = displayAbsolute + + self.displayPercent = displayPercent + + self.percent = percent + } + + public func duplicate() -> DiscountProperties { + let dict = self.dictionary! + let copy = DiscountProperties(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + absolute = try container.decode(Double.self, forKey: .absolute) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayAbsolute = try container.decode(String.self, forKey: .displayAbsolute) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayPercent = try container.decode(String.self, forKey: .displayPercent) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + percent = try container.decode(Double.self, forKey: .percent) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(absolute, forKey: .absolute) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(displayAbsolute, forKey: .displayAbsolute) + + try? container.encodeIfPresent(displayPercent, forKey: .displayPercent) + + try? container.encodeIfPresent(percent, forKey: .percent) + } + } + + /* + Model: Error + Used By: Rewards + */ + class Error: Codable { + public var code: Int? + + public var exception: String? + + public var info: String? + + public var message: String? + + public enum CodingKeys: String, CodingKey { + case code + + case exception + + case info + + case message + } + + public init(code: Int?, exception: String?, info: String?, message: String?) { + self.code = code + + self.exception = exception + + self.info = info + + self.message = message + } + + public func duplicate() -> Error { + let dict = self.dictionary! + let copy = Error(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + code = try container.decode(Int.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + exception = try container.decode(String.self, forKey: .exception) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + info = try container.decode(String.self, forKey: .info) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(exception, forKey: .exception) + + try? container.encodeIfPresent(info, forKey: .info) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: Offer + Used By: Rewards + */ + class Offer: Codable { + public var schedule: Schedule? + + public var active: Bool? + + public var applicationId: String? + + public var bannerImage: Asset? + + public var createdAt: String? + + public var name: String? + + public var rule: [String: Any]? + + public var share: ShareMessages? + + public var subText: String? + + public var text: String? + + public var type: String? + + public var updatedAt: String? + + public var updatedBy: String? + + public var url: String? + + public enum CodingKeys: String, CodingKey { + case schedule = "_schedule" + + case active + + case applicationId = "application_id" + + case bannerImage = "banner_image" + + case createdAt = "created_at" + + case name + + case rule + + case share + + case subText = "sub_text" + + case text + + case type + + case updatedAt = "updated_at" + + case updatedBy = "updated_by" + + case url + } + + public init(active: Bool?, applicationId: String?, bannerImage: Asset?, createdAt: String?, name: String?, rule: [String: Any]?, share: ShareMessages?, subText: String?, text: String?, type: String?, updatedAt: String?, updatedBy: String?, url: String?, schedule: Schedule?) { + self.schedule = schedule + + self.active = active + + self.applicationId = applicationId + + self.bannerImage = bannerImage + + self.createdAt = createdAt + + self.name = name + + self.rule = rule + + self.share = share + + self.subText = subText + + self.text = text + + self.type = type + + self.updatedAt = updatedAt + + self.updatedBy = updatedBy + + self.url = url + } + + public func duplicate() -> Offer { + let dict = self.dictionary! + let copy = Offer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + schedule = try container.decode(Schedule.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + applicationId = try container.decode(String.self, forKey: .applicationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bannerImage = try container.decode(Asset.self, forKey: .bannerImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rule = try container.decode([String: Any].self, forKey: .rule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + share = try container.decode(ShareMessages.self, forKey: .share) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subText = try container.decode(String.self, forKey: .subText) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text = try container.decode(String.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedBy = try container.decode(String.self, forKey: .updatedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + + try? container.encodeIfPresent(bannerImage, forKey: .bannerImage) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(rule, forKey: .rule) + + try? container.encodeIfPresent(share, forKey: .share) + + try? container.encodeIfPresent(subText, forKey: .subText) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(updatedBy, forKey: .updatedBy) + + try? container.encodeIfPresent(url, forKey: .url) + } + } + + /* + Model: OrderDiscountRequest + Used By: Rewards + */ + class OrderDiscountRequest: Codable { + public var currency: String? + + public var orderAmount: Double + + public enum CodingKeys: String, CodingKey { + case currency + + case orderAmount = "order_amount" + } + + public init(currency: String?, orderAmount: Double) { + self.currency = currency + + self.orderAmount = orderAmount + } + + public func duplicate() -> OrderDiscountRequest { + let dict = self.dictionary! + let copy = OrderDiscountRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + orderAmount = try container.decode(Double.self, forKey: .orderAmount) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(orderAmount, forKey: .orderAmount) + } + } + + /* + Model: OrderDiscountResponse + Used By: Rewards + */ + class OrderDiscountResponse: Codable { + public var appliedRuleBucket: OrderDiscountRuleBucket? + + public var baseDiscount: DiscountProperties? + + public var discount: DiscountProperties? + + public var orderAmount: Double? + + public var points: Double? + + public enum CodingKeys: String, CodingKey { + case appliedRuleBucket = "applied_rule_bucket" + + case baseDiscount = "base_discount" + + case discount + + case orderAmount = "order_amount" + + case points + } + + public init(appliedRuleBucket: OrderDiscountRuleBucket?, baseDiscount: DiscountProperties?, discount: DiscountProperties?, orderAmount: Double?, points: Double?) { + self.appliedRuleBucket = appliedRuleBucket + + self.baseDiscount = baseDiscount + + self.discount = discount + + self.orderAmount = orderAmount + + self.points = points + } + + public func duplicate() -> OrderDiscountResponse { + let dict = self.dictionary! + let copy = OrderDiscountResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + appliedRuleBucket = try container.decode(OrderDiscountRuleBucket.self, forKey: .appliedRuleBucket) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + baseDiscount = try container.decode(DiscountProperties.self, forKey: .baseDiscount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discount = try container.decode(DiscountProperties.self, forKey: .discount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderAmount = try container.decode(Double.self, forKey: .orderAmount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + points = try container.decode(Double.self, forKey: .points) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appliedRuleBucket, forKey: .appliedRuleBucket) + + try? container.encodeIfPresent(baseDiscount, forKey: .baseDiscount) + + try? container.encodeIfPresent(discount, forKey: .discount) + + try? container.encodeIfPresent(orderAmount, forKey: .orderAmount) + + try? container.encodeIfPresent(points, forKey: .points) + } + } + + /* + Model: OrderDiscountRuleBucket + Used By: Rewards + */ + class OrderDiscountRuleBucket: Codable { + public var high: Double? + + public var low: Double? + + public var max: Double? + + public var value: Double? + + public var valueType: String? + + public enum CodingKeys: String, CodingKey { + case high + + case low + + case max + + case value + + case valueType = "value_type" + } + + public init(high: Double?, low: Double?, max: Double?, value: Double?, valueType: String?) { + self.high = high + + self.low = low + + self.max = max + + self.value = value + + self.valueType = valueType + } + + public func duplicate() -> OrderDiscountRuleBucket { + let dict = self.dictionary! + let copy = OrderDiscountRuleBucket(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + high = try container.decode(Double.self, forKey: .high) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + low = try container.decode(Double.self, forKey: .low) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + max = try container.decode(Double.self, forKey: .max) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(Double.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + valueType = try container.decode(String.self, forKey: .valueType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(high, forKey: .high) + + try? container.encodeIfPresent(low, forKey: .low) + + try? container.encodeIfPresent(max, forKey: .max) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(valueType, forKey: .valueType) + } + } + + /* + Model: PointsHistory + Used By: Rewards + */ + class PointsHistory: Codable { + public var id: String? + + public var applicationId: String? + + public var claimed: Bool? + + public var createdAt: String? + + public var expiresOn: String? + + public var meta: [String: Any]? + + public var points: Double? + + public var remainingPoints: Double? + + public var text1: String? + + public var text2: String? + + public var text3: String? + + public var txnName: String? + + public var updatedAt: String? + + public var userId: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case applicationId = "application_id" + + case claimed + + case createdAt = "created_at" + + case expiresOn = "expires_on" + + case meta + + case points + + case remainingPoints = "remaining_points" + + case text1 = "text_1" + + case text2 = "text_2" + + case text3 = "text_3" + + case txnName = "txn_name" + + case updatedAt = "updated_at" + + case userId = "user_id" + } + + public init(applicationId: String?, claimed: Bool?, createdAt: String?, expiresOn: String?, meta: [String: Any]?, points: Double?, remainingPoints: Double?, text1: String?, text2: String?, text3: String?, txnName: String?, updatedAt: String?, userId: String?, id: String?) { + self.id = id + + self.applicationId = applicationId + + self.claimed = claimed + + self.createdAt = createdAt + + self.expiresOn = expiresOn + + self.meta = meta + + self.points = points + + self.remainingPoints = remainingPoints + + self.text1 = text1 + + self.text2 = text2 + + self.text3 = text3 + + self.txnName = txnName + + self.updatedAt = updatedAt + + self.userId = userId + } + + public func duplicate() -> PointsHistory { + let dict = self.dictionary! + let copy = PointsHistory(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + applicationId = try container.decode(String.self, forKey: .applicationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + claimed = try container.decode(Bool.self, forKey: .claimed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expiresOn = try container.decode(String.self, forKey: .expiresOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + points = try container.decode(Double.self, forKey: .points) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + remainingPoints = try container.decode(Double.self, forKey: .remainingPoints) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text1 = try container.decode(String.self, forKey: .text1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text2 = try container.decode(String.self, forKey: .text2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text3 = try container.decode(String.self, forKey: .text3) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + txnName = try container.decode(String.self, forKey: .txnName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + + try? container.encodeIfPresent(claimed, forKey: .claimed) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(expiresOn, forKey: .expiresOn) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(points, forKey: .points) + + try? container.encodeIfPresent(remainingPoints, forKey: .remainingPoints) + + try? container.encodeIfPresent(text1, forKey: .text1) + + try? container.encodeIfPresent(text2, forKey: .text2) + + try? container.encodeIfPresent(text3, forKey: .text3) + + try? container.encodeIfPresent(txnName, forKey: .txnName) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(userId, forKey: .userId) + } + } + + /* + Model: PointsHistoryResponse + Used By: Rewards + */ + class PointsHistoryResponse: Codable { + public var items: [PointsHistory]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [PointsHistory]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> PointsHistoryResponse { + let dict = self.dictionary! + let copy = PointsHistoryResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([PointsHistory].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: PointsResponse + Used By: Rewards + */ + class PointsResponse: Codable { + public var points: Double? + + public enum CodingKeys: String, CodingKey { + case points + } + + public init(points: Double?) { + self.points = points + } + + public func duplicate() -> PointsResponse { + let dict = self.dictionary! + let copy = PointsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + points = try container.decode(Double.self, forKey: .points) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(points, forKey: .points) + } + } + + /* + Model: RedeemReferralCodeRequest + Used By: Rewards + */ + class RedeemReferralCodeRequest: Codable { + public var deviceId: String + + public var referralCode: String + + public enum CodingKeys: String, CodingKey { + case deviceId = "device_id" + + case referralCode = "referral_code" + } + + public init(deviceId: String, referralCode: String) { + self.deviceId = deviceId + + self.referralCode = referralCode + } + + public func duplicate() -> RedeemReferralCodeRequest { + let dict = self.dictionary! + let copy = RedeemReferralCodeRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + deviceId = try container.decode(String.self, forKey: .deviceId) + + referralCode = try container.decode(String.self, forKey: .referralCode) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(deviceId, forKey: .deviceId) + + try? container.encodeIfPresent(referralCode, forKey: .referralCode) + } + } + + /* + Model: RedeemReferralCodeResponse + Used By: Rewards + */ + class RedeemReferralCodeResponse: Codable { + public var message: String? + + public var points: Double? + + public var redeemed: Bool? + + public var referrerId: String? + + public var referrerInfo: String? + + public enum CodingKeys: String, CodingKey { + case message + + case points + + case redeemed + + case referrerId = "referrer_id" + + case referrerInfo = "referrer_info" + } + + public init(message: String?, points: Double?, redeemed: Bool?, referrerId: String?, referrerInfo: String?) { + self.message = message + + self.points = points + + self.redeemed = redeemed + + self.referrerId = referrerId + + self.referrerInfo = referrerInfo + } + + public func duplicate() -> RedeemReferralCodeResponse { + let dict = self.dictionary! + let copy = RedeemReferralCodeResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + points = try container.decode(Double.self, forKey: .points) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + redeemed = try container.decode(Bool.self, forKey: .redeemed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + referrerId = try container.decode(String.self, forKey: .referrerId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + referrerInfo = try container.decode(String.self, forKey: .referrerInfo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(points, forKey: .points) + + try? container.encodeIfPresent(redeemed, forKey: .redeemed) + + try? container.encodeIfPresent(referrerId, forKey: .referrerId) + + try? container.encodeIfPresent(referrerInfo, forKey: .referrerInfo) + } + } + + /* + Model: ReferralDetailsResponse + Used By: Rewards + */ + class ReferralDetailsResponse: Codable { + public var referral: Offer? + + public var referrerInfo: String? + + public var share: ShareMessages? + + public var user: ReferralDetailsUser? + + public enum CodingKeys: String, CodingKey { + case referral + + case referrerInfo = "referrer_info" + + case share + + case user + } + + public init(referral: Offer?, referrerInfo: String?, share: ShareMessages?, user: ReferralDetailsUser?) { + self.referral = referral + + self.referrerInfo = referrerInfo + + self.share = share + + self.user = user + } + + public func duplicate() -> ReferralDetailsResponse { + let dict = self.dictionary! + let copy = ReferralDetailsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + referral = try container.decode(Offer.self, forKey: .referral) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + referrerInfo = try container.decode(String.self, forKey: .referrerInfo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + share = try container.decode(ShareMessages.self, forKey: .share) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + user = try container.decode(ReferralDetailsUser.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(referral, forKey: .referral) + + try? container.encodeIfPresent(referrerInfo, forKey: .referrerInfo) + + try? container.encodeIfPresent(share, forKey: .share) + + try? container.encodeIfPresent(user, forKey: .user) + } + } + + /* + Model: ReferralDetailsUser + Used By: Rewards + */ + class ReferralDetailsUser: Codable { + public var blocked: Bool? + + public var points: Double? + + public var redeemed: Bool? + + public var referralCode: String? + + public enum CodingKeys: String, CodingKey { + case blocked + + case points + + case redeemed + + case referralCode = "referral_code" + } + + public init(blocked: Bool?, points: Double?, redeemed: Bool?, referralCode: String?) { + self.blocked = blocked + + self.points = points + + self.redeemed = redeemed + + self.referralCode = referralCode + } + + public func duplicate() -> ReferralDetailsUser { + let dict = self.dictionary! + let copy = ReferralDetailsUser(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + blocked = try container.decode(Bool.self, forKey: .blocked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + points = try container.decode(Double.self, forKey: .points) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + redeemed = try container.decode(Bool.self, forKey: .redeemed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + referralCode = try container.decode(String.self, forKey: .referralCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(blocked, forKey: .blocked) + + try? container.encodeIfPresent(points, forKey: .points) + + try? container.encodeIfPresent(redeemed, forKey: .redeemed) + + try? container.encodeIfPresent(referralCode, forKey: .referralCode) + } + } + + /* + Model: RewardsArticle + Used By: Rewards + */ + class RewardsArticle: Codable { + public var id: String? + + public var points: Double? + + public var price: Double? + + public enum CodingKeys: String, CodingKey { + case id + + case points + + case price + } + + public init(id: String?, points: Double?, price: Double?) { + self.id = id + + self.points = points + + self.price = price + } + + public func duplicate() -> RewardsArticle { + let dict = self.dictionary! + let copy = RewardsArticle(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + points = try container.decode(Double.self, forKey: .points) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(Double.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(points, forKey: .points) + + try? container.encodeIfPresent(price, forKey: .price) + } + } + + /* + Model: Schedule + Used By: Rewards + */ + class Schedule: Codable { + public var cron: String? + + public var duration: Int? + + public var end: String? + + public var start: String? + + public enum CodingKeys: String, CodingKey { + case cron + + case duration + + case end + + case start + } + + public init(cron: String?, duration: Int?, end: String?, start: String?) { + self.cron = cron + + self.duration = duration + + self.end = end + + self.start = start + } + + public func duplicate() -> Schedule { + let dict = self.dictionary! + let copy = Schedule(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + cron = try container.decode(String.self, forKey: .cron) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + duration = try container.decode(Int.self, forKey: .duration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + end = try container.decode(String.self, forKey: .end) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + start = try container.decode(String.self, forKey: .start) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(cron, forKey: .cron) + + try? container.encodeIfPresent(duration, forKey: .duration) + + try? container.encodeIfPresent(end, forKey: .end) + + try? container.encodeIfPresent(start, forKey: .start) + } + } + + /* + Model: ShareMessages + Used By: Rewards + */ + class ShareMessages: Codable { + public var email: String? + + public var facebook: String? + + public var fallback: String? + + public var message: String? + + public var messenger: String? + + public var sms: String? + + public var text: String? + + public var twitter: String? + + public var whatsapp: String? + + public enum CodingKeys: String, CodingKey { + case email + + case facebook + + case fallback + + case message + + case messenger + + case sms + + case text + + case twitter + + case whatsapp + } + + public init(email: String?, facebook: String?, fallback: String?, message: String?, messenger: String?, sms: String?, text: String?, twitter: String?, whatsapp: String?) { + self.email = email + + self.facebook = facebook + + self.fallback = fallback + + self.message = message + + self.messenger = messenger + + self.sms = sms + + self.text = text + + self.twitter = twitter + + self.whatsapp = whatsapp + } + + public func duplicate() -> ShareMessages { + let dict = self.dictionary! + let copy = ShareMessages(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + facebook = try container.decode(String.self, forKey: .facebook) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fallback = try container.decode(String.self, forKey: .fallback) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + messenger = try container.decode(String.self, forKey: .messenger) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sms = try container.decode(String.self, forKey: .sms) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text = try container.decode(String.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + twitter = try container.decode(String.self, forKey: .twitter) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + whatsapp = try container.decode(String.self, forKey: .whatsapp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(facebook, forKey: .facebook) + + try? container.encodeIfPresent(fallback, forKey: .fallback) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(messenger, forKey: .messenger) + + try? container.encodeIfPresent(sms, forKey: .sms) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(twitter, forKey: .twitter) + + try? container.encodeIfPresent(whatsapp, forKey: .whatsapp) + } + } +} diff --git a/Sources/code/application/models/ShareAppModelClass.swift b/Sources/code/application/models/ShareAppModelClass.swift new file mode 100644 index 0000000000..a07dc7e220 --- /dev/null +++ b/Sources/code/application/models/ShareAppModelClass.swift @@ -0,0 +1,1144 @@ +import Foundation + +import Foundation +public extension ApplicationClient { + /* + Model: QRCodeResp + Used By: Share + */ + class QRCodeResp: Codable { + public var link: String? + + public var svg: String? + + public enum CodingKeys: String, CodingKey { + case link + + case svg + } + + public init(link: String?, svg: String?) { + self.link = link + + self.svg = svg + } + + public func duplicate() -> QRCodeResp { + let dict = self.dictionary! + let copy = QRCodeResp(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + svg = try container.decode(String.self, forKey: .svg) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(link, forKey: .link) + + try? container.encodeIfPresent(svg, forKey: .svg) + } + } + + /* + Model: RedirectDevice + Used By: Share + */ + class RedirectDevice: Codable { + public var link: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case link + + case type + } + + public init(link: String?, type: String?) { + self.link = link + + self.type = type + } + + public func duplicate() -> RedirectDevice { + let dict = self.dictionary! + let copy = RedirectDevice(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(link, forKey: .link) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: WebRedirect + Used By: Share + */ + class WebRedirect: Codable { + public var link: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case link + + case type + } + + public init(link: String?, type: String?) { + self.link = link + + self.type = type + } + + public func duplicate() -> WebRedirect { + let dict = self.dictionary! + let copy = WebRedirect(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(link, forKey: .link) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: Redirects + Used By: Share + */ + class Redirects: Codable { + public var ios: RedirectDevice? + + public var android: RedirectDevice? + + public var web: WebRedirect? + + public var forceWeb: Bool? + + public enum CodingKeys: String, CodingKey { + case ios + + case android + + case web + + case forceWeb = "force_web" + } + + public init(android: RedirectDevice?, forceWeb: Bool?, ios: RedirectDevice?, web: WebRedirect?) { + self.ios = ios + + self.android = android + + self.web = web + + self.forceWeb = forceWeb + } + + public func duplicate() -> Redirects { + let dict = self.dictionary! + let copy = Redirects(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + ios = try container.decode(RedirectDevice.self, forKey: .ios) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + android = try container.decode(RedirectDevice.self, forKey: .android) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + web = try container.decode(WebRedirect.self, forKey: .web) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + forceWeb = try container.decode(Bool.self, forKey: .forceWeb) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(ios, forKey: .ios) + + try? container.encodeIfPresent(android, forKey: .android) + + try? container.encodeIfPresent(web, forKey: .web) + + try? container.encodeIfPresent(forceWeb, forKey: .forceWeb) + } + } + + /* + Model: CampaignShortLink + Used By: Share + */ + class CampaignShortLink: Codable { + public var source: String? + + public var medium: String? + + public enum CodingKeys: String, CodingKey { + case source + + case medium + } + + public init(medium: String?, source: String?) { + self.source = source + + self.medium = medium + } + + public func duplicate() -> CampaignShortLink { + let dict = self.dictionary! + let copy = CampaignShortLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + source = try container.decode(String.self, forKey: .source) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + medium = try container.decode(String.self, forKey: .medium) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(source, forKey: .source) + + try? container.encodeIfPresent(medium, forKey: .medium) + } + } + + /* + Model: Attribution + Used By: Share + */ + class Attribution: Codable { + public var campaignCookieExpiry: String? + + public enum CodingKeys: String, CodingKey { + case campaignCookieExpiry = "campaign_cookie_expiry" + } + + public init(campaignCookieExpiry: String?) { + self.campaignCookieExpiry = campaignCookieExpiry + } + + public func duplicate() -> Attribution { + let dict = self.dictionary! + let copy = Attribution(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + campaignCookieExpiry = try container.decode(String.self, forKey: .campaignCookieExpiry) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(campaignCookieExpiry, forKey: .campaignCookieExpiry) + } + } + + /* + Model: SocialMediaTags + Used By: Share + */ + class SocialMediaTags: Codable { + public var title: String? + + public var description: String? + + public var image: String? + + public enum CodingKeys: String, CodingKey { + case title + + case description + + case image + } + + public init(description: String?, image: String?, title: String?) { + self.title = title + + self.description = description + + self.image = image + } + + public func duplicate() -> SocialMediaTags { + let dict = self.dictionary! + let copy = SocialMediaTags(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + image = try container.decode(String.self, forKey: .image) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(image, forKey: .image) + } + } + + /* + Model: ShortLinkReq + Used By: Share + */ + class ShortLinkReq: Codable { + public var title: String + + public var url: String + + public var hash: String? + + public var active: Bool? + + public var expireAt: String? + + public var enableTracking: Bool? + + public var personalized: Bool? + + public var campaign: CampaignShortLink? + + public var redirects: Redirects? + + public var attribution: Attribution? + + public var socialMediaTags: SocialMediaTags? + + public var count: Int? + + public enum CodingKeys: String, CodingKey { + case title + + case url + + case hash + + case active + + case expireAt = "expire_at" + + case enableTracking = "enable_tracking" + + case personalized + + case campaign + + case redirects + + case attribution + + case socialMediaTags = "social_media_tags" + + case count + } + + public init(active: Bool?, attribution: Attribution?, campaign: CampaignShortLink?, count: Int?, enableTracking: Bool?, expireAt: String?, hash: String?, personalized: Bool?, redirects: Redirects?, socialMediaTags: SocialMediaTags?, title: String, url: String) { + self.title = title + + self.url = url + + self.hash = hash + + self.active = active + + self.expireAt = expireAt + + self.enableTracking = enableTracking + + self.personalized = personalized + + self.campaign = campaign + + self.redirects = redirects + + self.attribution = attribution + + self.socialMediaTags = socialMediaTags + + self.count = count + } + + public func duplicate() -> ShortLinkReq { + let dict = self.dictionary! + let copy = ShortLinkReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + title = try container.decode(String.self, forKey: .title) + + url = try container.decode(String.self, forKey: .url) + + do { + hash = try container.decode(String.self, forKey: .hash) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expireAt = try container.decode(String.self, forKey: .expireAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enableTracking = try container.decode(Bool.self, forKey: .enableTracking) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + personalized = try container.decode(Bool.self, forKey: .personalized) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + campaign = try container.decode(CampaignShortLink.self, forKey: .campaign) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + redirects = try container.decode(Redirects.self, forKey: .redirects) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attribution = try container.decode(Attribution.self, forKey: .attribution) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + socialMediaTags = try container.decode(SocialMediaTags.self, forKey: .socialMediaTags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(hash, forKey: .hash) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(expireAt, forKey: .expireAt) + + try? container.encodeIfPresent(enableTracking, forKey: .enableTracking) + + try? container.encodeIfPresent(personalized, forKey: .personalized) + + try? container.encodeIfPresent(campaign, forKey: .campaign) + + try? container.encodeIfPresent(redirects, forKey: .redirects) + + try? container.encodeIfPresent(attribution, forKey: .attribution) + + try? container.encodeIfPresent(socialMediaTags, forKey: .socialMediaTags) + + try? container.encodeIfPresent(count, forKey: .count) + } + } + + /* + Model: UrlInfo + Used By: Share + */ + class UrlInfo: Codable { + public var original: String? + + public var short: String? + + public var hash: String? + + public enum CodingKeys: String, CodingKey { + case original + + case short + + case hash + } + + public init(hash: String?, original: String?, short: String?) { + self.original = original + + self.short = short + + self.hash = hash + } + + public func duplicate() -> UrlInfo { + let dict = self.dictionary! + let copy = UrlInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + original = try container.decode(String.self, forKey: .original) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + short = try container.decode(String.self, forKey: .short) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hash = try container.decode(String.self, forKey: .hash) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(original, forKey: .original) + + try? container.encodeIfPresent(short, forKey: .short) + + try? container.encodeIfPresent(hash, forKey: .hash) + } + } + + /* + Model: ShortLinkRes + Used By: Share + */ + class ShortLinkRes: Codable { + public var title: String? + + public var url: UrlInfo? + + public var createdBy: String? + + public var appRedirect: Bool? + + public var fallback: String? + + public var active: Bool? + + public var id: String? + + public var enableTracking: Bool? + + public var expireAt: String? + + public var application: String? + + public var userId: String? + + public var createdAt: String? + + public var meta: [String: Any]? + + public var updatedAt: String? + + public var personalized: Bool? + + public var campaign: CampaignShortLink? + + public var redirects: Redirects? + + public var attribution: Attribution? + + public var socialMediaTags: SocialMediaTags? + + public var count: Int? + + public enum CodingKeys: String, CodingKey { + case title + + case url + + case createdBy = "created_by" + + case appRedirect = "app_redirect" + + case fallback + + case active + + case id = "_id" + + case enableTracking = "enable_tracking" + + case expireAt = "expire_at" + + case application + + case userId = "user_id" + + case createdAt = "created_at" + + case meta + + case updatedAt = "updated_at" + + case personalized + + case campaign + + case redirects + + case attribution + + case socialMediaTags = "social_media_tags" + + case count + } + + public init(active: Bool?, application: String?, appRedirect: Bool?, attribution: Attribution?, campaign: CampaignShortLink?, count: Int?, createdAt: String?, createdBy: String?, enableTracking: Bool?, expireAt: String?, fallback: String?, meta: [String: Any]?, personalized: Bool?, redirects: Redirects?, socialMediaTags: SocialMediaTags?, title: String?, updatedAt: String?, url: UrlInfo?, userId: String?, id: String?) { + self.title = title + + self.url = url + + self.createdBy = createdBy + + self.appRedirect = appRedirect + + self.fallback = fallback + + self.active = active + + self.id = id + + self.enableTracking = enableTracking + + self.expireAt = expireAt + + self.application = application + + self.userId = userId + + self.createdAt = createdAt + + self.meta = meta + + self.updatedAt = updatedAt + + self.personalized = personalized + + self.campaign = campaign + + self.redirects = redirects + + self.attribution = attribution + + self.socialMediaTags = socialMediaTags + + self.count = count + } + + public func duplicate() -> ShortLinkRes { + let dict = self.dictionary! + let copy = ShortLinkRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(UrlInfo.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(String.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appRedirect = try container.decode(Bool.self, forKey: .appRedirect) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fallback = try container.decode(String.self, forKey: .fallback) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enableTracking = try container.decode(Bool.self, forKey: .enableTracking) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expireAt = try container.decode(String.self, forKey: .expireAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + personalized = try container.decode(Bool.self, forKey: .personalized) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + campaign = try container.decode(CampaignShortLink.self, forKey: .campaign) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + redirects = try container.decode(Redirects.self, forKey: .redirects) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attribution = try container.decode(Attribution.self, forKey: .attribution) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + socialMediaTags = try container.decode(SocialMediaTags.self, forKey: .socialMediaTags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(appRedirect, forKey: .appRedirect) + + try? container.encodeIfPresent(fallback, forKey: .fallback) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(enableTracking, forKey: .enableTracking) + + try? container.encodeIfPresent(expireAt, forKey: .expireAt) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(userId, forKey: .userId) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(personalized, forKey: .personalized) + + try? container.encodeIfPresent(campaign, forKey: .campaign) + + try? container.encodeIfPresent(redirects, forKey: .redirects) + + try? container.encodeIfPresent(attribution, forKey: .attribution) + + try? container.encodeIfPresent(socialMediaTags, forKey: .socialMediaTags) + + try? container.encodeIfPresent(count, forKey: .count) + } + } + + /* + Model: ShortLinkList + Used By: Share + */ + class ShortLinkList: Codable { + public var items: [ShortLinkRes]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [ShortLinkRes]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> ShortLinkList { + let dict = self.dictionary! + let copy = ShortLinkList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([ShortLinkRes].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: ErrorRes + Used By: Share + */ + class ErrorRes: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> ErrorRes { + let dict = self.dictionary! + let copy = ErrorRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } +} diff --git a/Sources/code/application/models/ThemeAppModelClass.swift b/Sources/code/application/models/ThemeAppModelClass.swift new file mode 100644 index 0000000000..1c49f07091 --- /dev/null +++ b/Sources/code/application/models/ThemeAppModelClass.swift @@ -0,0 +1,3460 @@ +import Foundation + +import Foundation +public extension ApplicationClient { + /* + Model: AvailablePageSchema + Used By: Theme + */ + class AvailablePageSchema: Codable { + public var value: String? + + public var text: String? + + public var path: String? + + public var type: String? + + public var sections: [AvailablePageSchemaSections]? + + public var sectionsMeta: [AvailablePageSectionMetaAttributes]? + + public var theme: String? + + public var seo: AvailablePageSeo? + + public var props: [[String: Any]]? + + public var id: String? + + public enum CodingKeys: String, CodingKey { + case value + + case text + + case path + + case type + + case sections + + case sectionsMeta = "sections_meta" + + case theme + + case seo + + case props + + case id = "_id" + } + + public init(path: String?, props: [[String: Any]]?, sections: [AvailablePageSchemaSections]?, sectionsMeta: [AvailablePageSectionMetaAttributes]?, seo: AvailablePageSeo?, text: String?, theme: String?, type: String?, value: String?, id: String?) { + self.value = value + + self.text = text + + self.path = path + + self.type = type + + self.sections = sections + + self.sectionsMeta = sectionsMeta + + self.theme = theme + + self.seo = seo + + self.props = props + + self.id = id + } + + public func duplicate() -> AvailablePageSchema { + let dict = self.dictionary! + let copy = AvailablePageSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text = try container.decode(String.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + path = try container.decode(String.self, forKey: .path) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sections = try container.decode([AvailablePageSchemaSections].self, forKey: .sections) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sectionsMeta = try container.decode([AvailablePageSectionMetaAttributes].self, forKey: .sectionsMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + theme = try container.decode(String.self, forKey: .theme) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + seo = try container.decode(AvailablePageSeo.self, forKey: .seo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + props = try container.decode([[String: Any]].self, forKey: .props) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(path, forKey: .path) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(sections, forKey: .sections) + + try? container.encodeIfPresent(sectionsMeta, forKey: .sectionsMeta) + + try? container.encodeIfPresent(theme, forKey: .theme) + + try? container.encodeIfPresent(seo, forKey: .seo) + + try? container.encodeIfPresent(props, forKey: .props) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: AvailablePageSectionMetaAttributes + Used By: Theme + */ + class AvailablePageSectionMetaAttributes: Codable { + public var attributes: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case attributes + } + + public init(attributes: [String: Any]?) { + self.attributes = attributes + } + + public func duplicate() -> AvailablePageSectionMetaAttributes { + let dict = self.dictionary! + let copy = AvailablePageSectionMetaAttributes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + attributes = try container.decode([String: Any].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + } + } + + /* + Model: AvailablePageSeo + Used By: Theme + */ + class AvailablePageSeo: Codable { + public var title: String? + + public var description: String? + + public var id: String? + + public enum CodingKeys: String, CodingKey { + case title + + case description + + case id = "_id" + } + + public init(description: String?, title: String?, id: String?) { + self.title = title + + self.description = description + + self.id = id + } + + public func duplicate() -> AvailablePageSeo { + let dict = self.dictionary! + let copy = AvailablePageSeo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: AvailablePageSchemaSections + Used By: Theme + */ + class AvailablePageSchemaSections: Codable { + public var name: String? + + public var label: String? + + public var props: [String: Any]? + + public var blocks: [[String: Any]]? + + public var preset: [String: Any]? + + public var predicate: AvailablePagePredicate? + + public enum CodingKeys: String, CodingKey { + case name + + case label + + case props + + case blocks + + case preset + + case predicate + } + + public init(blocks: [[String: Any]]?, label: String?, name: String?, predicate: AvailablePagePredicate?, preset: [String: Any]?, props: [String: Any]?) { + self.name = name + + self.label = label + + self.props = props + + self.blocks = blocks + + self.preset = preset + + self.predicate = predicate + } + + public func duplicate() -> AvailablePageSchemaSections { + let dict = self.dictionary! + let copy = AvailablePageSchemaSections(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + label = try container.decode(String.self, forKey: .label) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + props = try container.decode([String: Any].self, forKey: .props) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + blocks = try container.decode([[String: Any]].self, forKey: .blocks) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + preset = try container.decode([String: Any].self, forKey: .preset) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + predicate = try container.decode(AvailablePagePredicate.self, forKey: .predicate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(label, forKey: .label) + + try? container.encodeIfPresent(props, forKey: .props) + + try? container.encodeIfPresent(blocks, forKey: .blocks) + + try? container.encodeIfPresent(preset, forKey: .preset) + + try? container.encodeIfPresent(predicate, forKey: .predicate) + } + } + + /* + Model: AvailablePageScreenPredicate + Used By: Theme + */ + class AvailablePageScreenPredicate: Codable { + public var mobile: Bool? + + public var desktop: Bool? + + public var tablet: Bool? + + public enum CodingKeys: String, CodingKey { + case mobile + + case desktop + + case tablet + } + + public init(desktop: Bool?, mobile: Bool?, tablet: Bool?) { + self.mobile = mobile + + self.desktop = desktop + + self.tablet = tablet + } + + public func duplicate() -> AvailablePageScreenPredicate { + let dict = self.dictionary! + let copy = AvailablePageScreenPredicate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + mobile = try container.decode(Bool.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + desktop = try container.decode(Bool.self, forKey: .desktop) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tablet = try container.decode(Bool.self, forKey: .tablet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + try? container.encodeIfPresent(desktop, forKey: .desktop) + + try? container.encodeIfPresent(tablet, forKey: .tablet) + } + } + + /* + Model: AvailablePageUserPredicate + Used By: Theme + */ + class AvailablePageUserPredicate: Codable { + public var authenticated: Bool? + + public var anonymous: Bool? + + public enum CodingKeys: String, CodingKey { + case authenticated + + case anonymous + } + + public init(anonymous: Bool?, authenticated: Bool?) { + self.authenticated = authenticated + + self.anonymous = anonymous + } + + public func duplicate() -> AvailablePageUserPredicate { + let dict = self.dictionary! + let copy = AvailablePageUserPredicate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + authenticated = try container.decode(Bool.self, forKey: .authenticated) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + anonymous = try container.decode(Bool.self, forKey: .anonymous) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(authenticated, forKey: .authenticated) + + try? container.encodeIfPresent(anonymous, forKey: .anonymous) + } + } + + /* + Model: AvailablePageRoutePredicate + Used By: Theme + */ + class AvailablePageRoutePredicate: Codable { + public var selected: String? + + public var exactUrl: String? + + public var query: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case selected + + case exactUrl = "exact_url" + + case query + } + + public init(exactUrl: String?, query: [String: Any]?, selected: String?) { + self.selected = selected + + self.exactUrl = exactUrl + + self.query = query + } + + public func duplicate() -> AvailablePageRoutePredicate { + let dict = self.dictionary! + let copy = AvailablePageRoutePredicate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + selected = try container.decode(String.self, forKey: .selected) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + exactUrl = try container.decode(String.self, forKey: .exactUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode([String: Any].self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(selected, forKey: .selected) + + try? container.encodeIfPresent(exactUrl, forKey: .exactUrl) + + try? container.encodeIfPresent(query, forKey: .query) + } + } + + /* + Model: AvailablePagePredicate + Used By: Theme + */ + class AvailablePagePredicate: Codable { + public var screen: AvailablePageScreenPredicate? + + public var user: AvailablePageUserPredicate? + + public var route: AvailablePageRoutePredicate? + + public enum CodingKeys: String, CodingKey { + case screen + + case user + + case route + } + + public init(route: AvailablePageRoutePredicate?, screen: AvailablePageScreenPredicate?, user: AvailablePageUserPredicate?) { + self.screen = screen + + self.user = user + + self.route = route + } + + public func duplicate() -> AvailablePagePredicate { + let dict = self.dictionary! + let copy = AvailablePagePredicate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + screen = try container.decode(AvailablePageScreenPredicate.self, forKey: .screen) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + user = try container.decode(AvailablePageUserPredicate.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + route = try container.decode(AvailablePageRoutePredicate.self, forKey: .route) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(screen, forKey: .screen) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(route, forKey: .route) + } + } + + /* + Model: AllAvailablePageSchema + Used By: Theme + */ + class AllAvailablePageSchema: Codable { + public var pages: [AvailablePageSchema]? + + public enum CodingKeys: String, CodingKey { + case pages + } + + public init(pages: [AvailablePageSchema]?) { + self.pages = pages + } + + public func duplicate() -> AllAvailablePageSchema { + let dict = self.dictionary! + let copy = AllAvailablePageSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + pages = try container.decode([AvailablePageSchema].self, forKey: .pages) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pages, forKey: .pages) + } + } + + /* + Model: PaginationSchema + Used By: Theme + */ + class PaginationSchema: Codable { + public var size: Int? + + public var itemTotal: Int? + + public var hasNext: Bool? + + public var type: String? + + public var current: Int? + + public enum CodingKeys: String, CodingKey { + case size + + case itemTotal = "item_total" + + case hasNext = "has_next" + + case type + + case current + } + + public init(current: Int?, hasNext: Bool?, itemTotal: Int?, size: Int?, type: String?) { + self.size = size + + self.itemTotal = itemTotal + + self.hasNext = hasNext + + self.type = type + + self.current = current + } + + public func duplicate() -> PaginationSchema { + let dict = self.dictionary! + let copy = PaginationSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + size = try container.decode(Int.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemTotal = try container.decode(Int.self, forKey: .itemTotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasNext = try container.decode(Bool.self, forKey: .hasNext) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + current = try container.decode(Int.self, forKey: .current) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) + + try? container.encodeIfPresent(hasNext, forKey: .hasNext) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(current, forKey: .current) + } + } + + /* + Model: ThemesListingResponseSchema + Used By: Theme + */ + class ThemesListingResponseSchema: Codable { + public var items: [ThemesSchema]? + + public var page: PaginationSchema? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [ThemesSchema]?, page: PaginationSchema?) { + self.items = items + + self.page = page + } + + public func duplicate() -> ThemesListingResponseSchema { + let dict = self.dictionary! + let copy = ThemesListingResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([ThemesSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(PaginationSchema.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: AddThemeRequestSchema + Used By: Theme + */ + class AddThemeRequestSchema: Codable { + public var themeId: String? + + public enum CodingKeys: String, CodingKey { + case themeId = "theme_id" + } + + public init(themeId: String?) { + self.themeId = themeId + } + + public func duplicate() -> AddThemeRequestSchema { + let dict = self.dictionary! + let copy = AddThemeRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + themeId = try container.decode(String.self, forKey: .themeId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(themeId, forKey: .themeId) + } + } + + /* + Model: UpgradableThemeSchema + Used By: Theme + */ + class UpgradableThemeSchema: Codable { + public var parentTheme: String? + + public var appliedTheme: String? + + public var upgrade: Bool? + + public enum CodingKeys: String, CodingKey { + case parentTheme = "parent_theme" + + case appliedTheme = "applied_theme" + + case upgrade + } + + public init(appliedTheme: String?, parentTheme: String?, upgrade: Bool?) { + self.parentTheme = parentTheme + + self.appliedTheme = appliedTheme + + self.upgrade = upgrade + } + + public func duplicate() -> UpgradableThemeSchema { + let dict = self.dictionary! + let copy = UpgradableThemeSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + parentTheme = try container.decode(String.self, forKey: .parentTheme) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appliedTheme = try container.decode(String.self, forKey: .appliedTheme) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + upgrade = try container.decode(Bool.self, forKey: .upgrade) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(parentTheme, forKey: .parentTheme) + + try? container.encodeIfPresent(appliedTheme, forKey: .appliedTheme) + + try? container.encodeIfPresent(upgrade, forKey: .upgrade) + } + } + + /* + Model: FontsSchema + Used By: Theme + */ + class FontsSchema: Codable { + public var items: FontsSchemaItems? + + public var kind: String? + + public enum CodingKeys: String, CodingKey { + case items + + case kind + } + + public init(items: FontsSchemaItems?, kind: String?) { + self.items = items + + self.kind = kind + } + + public func duplicate() -> FontsSchema { + let dict = self.dictionary! + let copy = FontsSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode(FontsSchemaItems.self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + kind = try container.decode(String.self, forKey: .kind) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(kind, forKey: .kind) + } + } + + /* + Model: BlitzkriegApiErrorSchema + Used By: Theme + */ + class BlitzkriegApiErrorSchema: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> BlitzkriegApiErrorSchema { + let dict = self.dictionary! + let copy = BlitzkriegApiErrorSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: BlitzkriegNotFoundSchema + Used By: Theme + */ + class BlitzkriegNotFoundSchema: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> BlitzkriegNotFoundSchema { + let dict = self.dictionary! + let copy = BlitzkriegNotFoundSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: BlitzkriegInternalServerErrorSchema + Used By: Theme + */ + class BlitzkriegInternalServerErrorSchema: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> BlitzkriegInternalServerErrorSchema { + let dict = self.dictionary! + let copy = BlitzkriegInternalServerErrorSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: FontsSchemaItems + Used By: Theme + */ + class FontsSchemaItems: Codable { + public var family: String? + + public var variants: [String]? + + public var subsets: [String]? + + public var version: String? + + public var lastModified: String? + + public var files: FontsSchemaItemsFiles? + + public var category: String? + + public var kind: String? + + public enum CodingKeys: String, CodingKey { + case family + + case variants + + case subsets + + case version + + case lastModified = "last_modified" + + case files + + case category + + case kind + } + + public init(category: String?, family: String?, files: FontsSchemaItemsFiles?, kind: String?, lastModified: String?, subsets: [String]?, variants: [String]?, version: String?) { + self.family = family + + self.variants = variants + + self.subsets = subsets + + self.version = version + + self.lastModified = lastModified + + self.files = files + + self.category = category + + self.kind = kind + } + + public func duplicate() -> FontsSchemaItems { + let dict = self.dictionary! + let copy = FontsSchemaItems(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + family = try container.decode(String.self, forKey: .family) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + variants = try container.decode([String].self, forKey: .variants) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subsets = try container.decode([String].self, forKey: .subsets) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + version = try container.decode(String.self, forKey: .version) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastModified = try container.decode(String.self, forKey: .lastModified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + files = try container.decode(FontsSchemaItemsFiles.self, forKey: .files) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + category = try container.decode(String.self, forKey: .category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + kind = try container.decode(String.self, forKey: .kind) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(family, forKey: .family) + + try? container.encodeIfPresent(variants, forKey: .variants) + + try? container.encodeIfPresent(subsets, forKey: .subsets) + + try? container.encodeIfPresent(version, forKey: .version) + + try? container.encodeIfPresent(lastModified, forKey: .lastModified) + + try? container.encodeIfPresent(files, forKey: .files) + + try? container.encodeIfPresent(category, forKey: .category) + + try? container.encodeIfPresent(kind, forKey: .kind) + } + } + + /* + Model: FontsSchemaItemsFiles + Used By: Theme + */ + class FontsSchemaItemsFiles: Codable { + public var regular: String? + + public var italic: String? + + public var bold: String? + + public enum CodingKeys: String, CodingKey { + case regular + + case italic + + case bold + } + + public init(bold: String?, italic: String?, regular: String?) { + self.regular = regular + + self.italic = italic + + self.bold = bold + } + + public func duplicate() -> FontsSchemaItemsFiles { + let dict = self.dictionary! + let copy = FontsSchemaItemsFiles(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + regular = try container.decode(String.self, forKey: .regular) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + italic = try container.decode(String.self, forKey: .italic) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bold = try container.decode(String.self, forKey: .bold) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(regular, forKey: .regular) + + try? container.encodeIfPresent(italic, forKey: .italic) + + try? container.encodeIfPresent(bold, forKey: .bold) + } + } + + /* + Model: ThemesSchema + Used By: Theme + */ + class ThemesSchema: Codable { + public var application: String? + + public var applied: Bool? + + public var customized: Bool? + + public var published: Bool? + + public var archived: Bool? + + public var createdAt: String? + + public var updatedAt: String? + + public var version: String? + + public var parentThemeVersion: String? + + public var parentTheme: String? + + public var information: Information? + + public var tags: [String]? + + public var src: Src? + + public var assets: AssetsSchema? + + public var availableSections: [availableSectionSchema]? + + public var constants: [String: Any]? + + public var styles: [String: Any]? + + public var config: Config? + + public var settings: [String: Any]? + + public var font: Font? + + public var id: String? + + public var v: Int? + + public var colors: Colors? + + public enum CodingKeys: String, CodingKey { + case application + + case applied + + case customized + + case published + + case archived + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case version + + case parentThemeVersion = "parent_theme_version" + + case parentTheme = "parent_theme" + + case information + + case tags + + case src + + case assets + + case availableSections = "available_sections" + + case constants + + case styles + + case config + + case settings + + case font + + case id = "_id" + + case v = "__v" + + case colors + } + + public init(application: String?, applied: Bool?, archived: Bool?, assets: AssetsSchema?, availableSections: [availableSectionSchema]?, colors: Colors?, config: Config?, constants: [String: Any]?, createdAt: String?, customized: Bool?, font: Font?, information: Information?, parentTheme: String?, parentThemeVersion: String?, published: Bool?, settings: [String: Any]?, src: Src?, styles: [String: Any]?, tags: [String]?, updatedAt: String?, version: String?, id: String?, v: Int?) { + self.application = application + + self.applied = applied + + self.customized = customized + + self.published = published + + self.archived = archived + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.version = version + + self.parentThemeVersion = parentThemeVersion + + self.parentTheme = parentTheme + + self.information = information + + self.tags = tags + + self.src = src + + self.assets = assets + + self.availableSections = availableSections + + self.constants = constants + + self.styles = styles + + self.config = config + + self.settings = settings + + self.font = font + + self.id = id + + self.v = v + + self.colors = colors + } + + public func duplicate() -> ThemesSchema { + let dict = self.dictionary! + let copy = ThemesSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + applied = try container.decode(Bool.self, forKey: .applied) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customized = try container.decode(Bool.self, forKey: .customized) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archived = try container.decode(Bool.self, forKey: .archived) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + version = try container.decode(String.self, forKey: .version) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + parentThemeVersion = try container.decode(String.self, forKey: .parentThemeVersion) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + parentTheme = try container.decode(String.self, forKey: .parentTheme) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + information = try container.decode(Information.self, forKey: .information) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + src = try container.decode(Src.self, forKey: .src) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + assets = try container.decode(AssetsSchema.self, forKey: .assets) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + availableSections = try container.decode([availableSectionSchema].self, forKey: .availableSections) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + constants = try container.decode([String: Any].self, forKey: .constants) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + styles = try container.decode([String: Any].self, forKey: .styles) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + config = try container.decode(Config.self, forKey: .config) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + settings = try container.decode([String: Any].self, forKey: .settings) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + font = try container.decode(Font.self, forKey: .font) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + colors = try container.decode(Colors.self, forKey: .colors) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(applied, forKey: .applied) + + try? container.encodeIfPresent(customized, forKey: .customized) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(archived, forKey: .archived) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(version, forKey: .version) + + try? container.encodeIfPresent(parentThemeVersion, forKey: .parentThemeVersion) + + try? container.encodeIfPresent(parentTheme, forKey: .parentTheme) + + try? container.encodeIfPresent(information, forKey: .information) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(src, forKey: .src) + + try? container.encodeIfPresent(assets, forKey: .assets) + + try? container.encodeIfPresent(availableSections, forKey: .availableSections) + + try? container.encodeIfPresent(constants, forKey: .constants) + + try? container.encodeIfPresent(styles, forKey: .styles) + + try? container.encodeIfPresent(config, forKey: .config) + + try? container.encodeIfPresent(settings, forKey: .settings) + + try? container.encodeIfPresent(font, forKey: .font) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(v, forKey: .v) + + try? container.encodeIfPresent(colors, forKey: .colors) + } + } + + /* + Model: availableSectionSchema + Used By: Theme + */ + class availableSectionSchema: Codable { + public var blocks: [Blocks]? + + public var name: String? + + public var label: String? + + public var props: [BlocksProps]? + + public enum CodingKeys: String, CodingKey { + case blocks + + case name + + case label + + case props + } + + public init(blocks: [Blocks]?, label: String?, name: String?, props: [BlocksProps]?) { + self.blocks = blocks + + self.name = name + + self.label = label + + self.props = props + } + + public func duplicate() -> availableSectionSchema { + let dict = self.dictionary! + let copy = availableSectionSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + blocks = try container.decode([Blocks].self, forKey: .blocks) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + label = try container.decode(String.self, forKey: .label) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + props = try container.decode([BlocksProps].self, forKey: .props) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(blocks, forKey: .blocks) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(label, forKey: .label) + + try? container.encodeIfPresent(props, forKey: .props) + } + } + + /* + Model: Information + Used By: Theme + */ + class Information: Codable { + public var images: Images? + + public var features: [String]? + + public var name: String? + + public var description: String? + + public enum CodingKeys: String, CodingKey { + case images + + case features + + case name + + case description + } + + public init(description: String?, features: [String]?, images: Images?, name: String?) { + self.images = images + + self.features = features + + self.name = name + + self.description = description + } + + public func duplicate() -> Information { + let dict = self.dictionary! + let copy = Information(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + images = try container.decode(Images.self, forKey: .images) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + features = try container.decode([String].self, forKey: .features) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(images, forKey: .images) + + try? container.encodeIfPresent(features, forKey: .features) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(description, forKey: .description) + } + } + + /* + Model: Images + Used By: Theme + */ + class Images: Codable { + public var desktop: [String]? + + public var android: [String]? + + public var ios: [String]? + + public var thumbnail: [String]? + + public enum CodingKeys: String, CodingKey { + case desktop + + case android + + case ios + + case thumbnail + } + + public init(android: [String]?, desktop: [String]?, ios: [String]?, thumbnail: [String]?) { + self.desktop = desktop + + self.android = android + + self.ios = ios + + self.thumbnail = thumbnail + } + + public func duplicate() -> Images { + let dict = self.dictionary! + let copy = Images(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + desktop = try container.decode([String].self, forKey: .desktop) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + android = try container.decode([String].self, forKey: .android) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ios = try container.decode([String].self, forKey: .ios) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + thumbnail = try container.decode([String].self, forKey: .thumbnail) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(desktop, forKey: .desktop) + + try? container.encodeIfPresent(android, forKey: .android) + + try? container.encodeIfPresent(ios, forKey: .ios) + + try? container.encodeIfPresent(thumbnail, forKey: .thumbnail) + } + } + + /* + Model: Src + Used By: Theme + */ + class Src: Codable { + public var link: String? + + public enum CodingKeys: String, CodingKey { + case link + } + + public init(link: String?) { + self.link = link + } + + public func duplicate() -> Src { + let dict = self.dictionary! + let copy = Src(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: AssetsSchema + Used By: Theme + */ + class AssetsSchema: Codable { + public var umdJs: UmdJs? + + public var commonJs: CommonJs? + + public var css: Css? + + public enum CodingKeys: String, CodingKey { + case umdJs = "umd_js" + + case commonJs = "common_js" + + case css + } + + public init(commonJs: CommonJs?, css: Css?, umdJs: UmdJs?) { + self.umdJs = umdJs + + self.commonJs = commonJs + + self.css = css + } + + public func duplicate() -> AssetsSchema { + let dict = self.dictionary! + let copy = AssetsSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + umdJs = try container.decode(UmdJs.self, forKey: .umdJs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + commonJs = try container.decode(CommonJs.self, forKey: .commonJs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + css = try container.decode(Css.self, forKey: .css) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(umdJs, forKey: .umdJs) + + try? container.encodeIfPresent(commonJs, forKey: .commonJs) + + try? container.encodeIfPresent(css, forKey: .css) + } + } + + /* + Model: UmdJs + Used By: Theme + */ + class UmdJs: Codable { + public var link: String? + + public enum CodingKeys: String, CodingKey { + case link + } + + public init(link: String?) { + self.link = link + } + + public func duplicate() -> UmdJs { + let dict = self.dictionary! + let copy = UmdJs(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: CommonJs + Used By: Theme + */ + class CommonJs: Codable { + public var link: String? + + public enum CodingKeys: String, CodingKey { + case link + } + + public init(link: String?) { + self.link = link + } + + public func duplicate() -> CommonJs { + let dict = self.dictionary! + let copy = CommonJs(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: Css + Used By: Theme + */ + class Css: Codable { + public var link: String? + + public enum CodingKeys: String, CodingKey { + case link + } + + public init(link: String?) { + self.link = link + } + + public func duplicate() -> Css { + let dict = self.dictionary! + let copy = Css(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: Sections + Used By: Theme + */ + class Sections: Codable { + public var attributes: String? + + public enum CodingKeys: String, CodingKey { + case attributes + } + + public init(attributes: String?) { + self.attributes = attributes + } + + public func duplicate() -> Sections { + let dict = self.dictionary! + let copy = Sections(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + attributes = try container.decode(String.self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + } + } + + /* + Model: Config + Used By: Theme + */ + class Config: Codable { + public var preset: Preset? + + public var globalSchema: GlobalSchema? + + public var current: String? + + public var list: [ListSchemaItem]? + + public enum CodingKeys: String, CodingKey { + case preset + + case globalSchema = "global_schema" + + case current + + case list + } + + public init(current: String?, globalSchema: GlobalSchema?, list: [ListSchemaItem]?, preset: Preset?) { + self.preset = preset + + self.globalSchema = globalSchema + + self.current = current + + self.list = list + } + + public func duplicate() -> Config { + let dict = self.dictionary! + let copy = Config(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + preset = try container.decode(Preset.self, forKey: .preset) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + globalSchema = try container.decode(GlobalSchema.self, forKey: .globalSchema) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + current = try container.decode(String.self, forKey: .current) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + list = try container.decode([ListSchemaItem].self, forKey: .list) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(preset, forKey: .preset) + + try? container.encodeIfPresent(globalSchema, forKey: .globalSchema) + + try? container.encodeIfPresent(current, forKey: .current) + + try? container.encodeIfPresent(list, forKey: .list) + } + } + + /* + Model: Preset + Used By: Theme + */ + class Preset: Codable { + public var pages: [AvailablePageSchema]? + + public enum CodingKeys: String, CodingKey { + case pages + } + + public init(pages: [AvailablePageSchema]?) { + self.pages = pages + } + + public func duplicate() -> Preset { + let dict = self.dictionary! + let copy = Preset(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + pages = try container.decode([AvailablePageSchema].self, forKey: .pages) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pages, forKey: .pages) + } + } + + /* + Model: GlobalSchema + Used By: Theme + */ + class GlobalSchema: Codable { + public var props: [GlobalSchemaProps]? + + public enum CodingKeys: String, CodingKey { + case props + } + + public init(props: [GlobalSchemaProps]?) { + self.props = props + } + + public func duplicate() -> GlobalSchema { + let dict = self.dictionary! + let copy = GlobalSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + props = try container.decode([GlobalSchemaProps].self, forKey: .props) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(props, forKey: .props) + } + } + + /* + Model: ListSchemaItem + Used By: Theme + */ + class ListSchemaItem: Codable { + public var globalConfig: [String: Any]? + + public var page: [ConfigPage]? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case globalConfig = "global_config" + + case page + + case name + } + + public init(globalConfig: [String: Any]?, name: String?, page: [ConfigPage]?) { + self.globalConfig = globalConfig + + self.page = page + + self.name = name + } + + public func duplicate() -> ListSchemaItem { + let dict = self.dictionary! + let copy = ListSchemaItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + globalConfig = try container.decode([String: Any].self, forKey: .globalConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode([ConfigPage].self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(globalConfig, forKey: .globalConfig) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: Colors + Used By: Theme + */ + class Colors: Codable { + public var bgColor: String? + + public var primaryColor: String? + + public var secondaryColor: String? + + public var accentColor: String? + + public var linkColor: String? + + public var buttonSecondaryColor: String? + + public enum CodingKeys: String, CodingKey { + case bgColor = "bg_color" + + case primaryColor = "primary_color" + + case secondaryColor = "secondary_color" + + case accentColor = "accent_color" + + case linkColor = "link_color" + + case buttonSecondaryColor = "button_secondary_color" + } + + public init(accentColor: String?, bgColor: String?, buttonSecondaryColor: String?, linkColor: String?, primaryColor: String?, secondaryColor: String?) { + self.bgColor = bgColor + + self.primaryColor = primaryColor + + self.secondaryColor = secondaryColor + + self.accentColor = accentColor + + self.linkColor = linkColor + + self.buttonSecondaryColor = buttonSecondaryColor + } + + public func duplicate() -> Colors { + let dict = self.dictionary! + let copy = Colors(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + bgColor = try container.decode(String.self, forKey: .bgColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + primaryColor = try container.decode(String.self, forKey: .primaryColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + secondaryColor = try container.decode(String.self, forKey: .secondaryColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + accentColor = try container.decode(String.self, forKey: .accentColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + linkColor = try container.decode(String.self, forKey: .linkColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + buttonSecondaryColor = try container.decode(String.self, forKey: .buttonSecondaryColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(bgColor, forKey: .bgColor) + + try? container.encodeIfPresent(primaryColor, forKey: .primaryColor) + + try? container.encodeIfPresent(secondaryColor, forKey: .secondaryColor) + + try? container.encodeIfPresent(accentColor, forKey: .accentColor) + + try? container.encodeIfPresent(linkColor, forKey: .linkColor) + + try? container.encodeIfPresent(buttonSecondaryColor, forKey: .buttonSecondaryColor) + } + } + + /* + Model: Custom + Used By: Theme + */ + class Custom: Codable { + public var props: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case props + } + + public init(props: [String: Any]?) { + self.props = props + } + + public func duplicate() -> Custom { + let dict = self.dictionary! + let copy = Custom(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + props = try container.decode([String: Any].self, forKey: .props) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(props, forKey: .props) + } + } + + /* + Model: ConfigPage + Used By: Theme + */ + class ConfigPage: Codable { + public var settings: [String: Any]? + + public var page: String? + + public enum CodingKeys: String, CodingKey { + case settings + + case page + } + + public init(page: String?, settings: [String: Any]?) { + self.settings = settings + + self.page = page + } + + public func duplicate() -> ConfigPage { + let dict = self.dictionary! + let copy = ConfigPage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + settings = try container.decode([String: Any].self, forKey: .settings) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(String.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(settings, forKey: .settings) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: Font + Used By: Theme + */ + class Font: Codable { + public var family: String? + + public var variants: Variants? + + public enum CodingKeys: String, CodingKey { + case family + + case variants + } + + public init(family: String?, variants: Variants?) { + self.family = family + + self.variants = variants + } + + public func duplicate() -> Font { + let dict = self.dictionary! + let copy = Font(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + family = try container.decode(String.self, forKey: .family) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + variants = try container.decode(Variants.self, forKey: .variants) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(family, forKey: .family) + + try? container.encodeIfPresent(variants, forKey: .variants) + } + } + + /* + Model: Variants + Used By: Theme + */ + class Variants: Codable { + public var medium: Medium? + + public var semiBold: SemiBold? + + public var bold: Bold? + + public var light: Light? + + public var regular: Regular? + + public enum CodingKeys: String, CodingKey { + case medium + + case semiBold = "semi_bold" + + case bold + + case light + + case regular + } + + public init(bold: Bold?, light: Light?, medium: Medium?, regular: Regular?, semiBold: SemiBold?) { + self.medium = medium + + self.semiBold = semiBold + + self.bold = bold + + self.light = light + + self.regular = regular + } + + public func duplicate() -> Variants { + let dict = self.dictionary! + let copy = Variants(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + medium = try container.decode(Medium.self, forKey: .medium) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + semiBold = try container.decode(SemiBold.self, forKey: .semiBold) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bold = try container.decode(Bold.self, forKey: .bold) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + light = try container.decode(Light.self, forKey: .light) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + regular = try container.decode(Regular.self, forKey: .regular) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(medium, forKey: .medium) + + try? container.encodeIfPresent(semiBold, forKey: .semiBold) + + try? container.encodeIfPresent(bold, forKey: .bold) + + try? container.encodeIfPresent(light, forKey: .light) + + try? container.encodeIfPresent(regular, forKey: .regular) + } + } + + /* + Model: Medium + Used By: Theme + */ + class Medium: Codable { + public var name: String? + + public var file: String? + + public enum CodingKeys: String, CodingKey { + case name + + case file + } + + public init(file: String?, name: String?) { + self.name = name + + self.file = file + } + + public func duplicate() -> Medium { + let dict = self.dictionary! + let copy = Medium(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + file = try container.decode(String.self, forKey: .file) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(file, forKey: .file) + } + } + + /* + Model: SemiBold + Used By: Theme + */ + class SemiBold: Codable { + public var name: String? + + public var file: String? + + public enum CodingKeys: String, CodingKey { + case name + + case file + } + + public init(file: String?, name: String?) { + self.name = name + + self.file = file + } + + public func duplicate() -> SemiBold { + let dict = self.dictionary! + let copy = SemiBold(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + file = try container.decode(String.self, forKey: .file) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(file, forKey: .file) + } + } + + /* + Model: Bold + Used By: Theme + */ + class Bold: Codable { + public var name: String? + + public var file: String? + + public enum CodingKeys: String, CodingKey { + case name + + case file + } + + public init(file: String?, name: String?) { + self.name = name + + self.file = file + } + + public func duplicate() -> Bold { + let dict = self.dictionary! + let copy = Bold(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + file = try container.decode(String.self, forKey: .file) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(file, forKey: .file) + } + } + + /* + Model: Light + Used By: Theme + */ + class Light: Codable { + public var name: String? + + public var file: String? + + public enum CodingKeys: String, CodingKey { + case name + + case file + } + + public init(file: String?, name: String?) { + self.name = name + + self.file = file + } + + public func duplicate() -> Light { + let dict = self.dictionary! + let copy = Light(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + file = try container.decode(String.self, forKey: .file) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(file, forKey: .file) + } + } + + /* + Model: Regular + Used By: Theme + */ + class Regular: Codable { + public var name: String? + + public var file: String? + + public enum CodingKeys: String, CodingKey { + case name + + case file + } + + public init(file: String?, name: String?) { + self.name = name + + self.file = file + } + + public func duplicate() -> Regular { + let dict = self.dictionary! + let copy = Regular(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + file = try container.decode(String.self, forKey: .file) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(file, forKey: .file) + } + } + + /* + Model: Blocks + Used By: Theme + */ + class Blocks: Codable { + public var type: String? + + public var name: String? + + public var props: [BlocksProps]? + + public enum CodingKeys: String, CodingKey { + case type + + case name + + case props + } + + public init(name: String?, props: [BlocksProps]?, type: String?) { + self.type = type + + self.name = name + + self.props = props + } + + public func duplicate() -> Blocks { + let dict = self.dictionary! + let copy = Blocks(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + props = try container.decode([BlocksProps].self, forKey: .props) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(props, forKey: .props) + } + } + + /* + Model: GlobalSchemaProps + Used By: Theme + */ + class GlobalSchemaProps: Codable { + public var id: String? + + public var label: String? + + public var type: String? + + public var category: String? + + public enum CodingKeys: String, CodingKey { + case id + + case label + + case type + + case category + } + + public init(category: String?, id: String?, label: String?, type: String?) { + self.id = id + + self.label = label + + self.type = type + + self.category = category + } + + public func duplicate() -> GlobalSchemaProps { + let dict = self.dictionary! + let copy = GlobalSchemaProps(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + label = try container.decode(String.self, forKey: .label) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + category = try container.decode(String.self, forKey: .category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(label, forKey: .label) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(category, forKey: .category) + } + } + + /* + Model: BlocksProps + Used By: Theme + */ + class BlocksProps: Codable { + public var id: String? + + public var label: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case id + + case label + + case type + } + + public init(id: String?, label: String?, type: String?) { + self.id = id + + self.label = label + + self.type = type + } + + public func duplicate() -> BlocksProps { + let dict = self.dictionary! + let copy = BlocksProps(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + label = try container.decode(String.self, forKey: .label) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(label, forKey: .label) + + try? container.encodeIfPresent(type, forKey: .type) + } + } +} diff --git a/Sources/code/application/models/UserAppModelClass.swift b/Sources/code/application/models/UserAppModelClass.swift new file mode 100644 index 0000000000..c0463c4ead --- /dev/null +++ b/Sources/code/application/models/UserAppModelClass.swift @@ -0,0 +1,5936 @@ +import Foundation + +import Foundation +public extension ApplicationClient { + /* + Model: EditEmailRequestSchema + Used By: User + */ + class EditEmailRequestSchema: Codable { + public var email: String? + + public enum CodingKeys: String, CodingKey { + case email + } + + public init(email: String?) { + self.email = email + } + + public func duplicate() -> EditEmailRequestSchema { + let dict = self.dictionary! + let copy = EditEmailRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + } + } + + /* + Model: SendVerificationLinkMobileRequestSchema + Used By: User + */ + class SendVerificationLinkMobileRequestSchema: Codable { + public var verified: Bool? + + public var active: Bool? + + public var countryCode: String? + + public var phone: String? + + public var primary: Bool? + + public enum CodingKeys: String, CodingKey { + case verified + + case active + + case countryCode = "country_code" + + case phone + + case primary + } + + public init(active: Bool?, countryCode: String?, phone: String?, primary: Bool?, verified: Bool?) { + self.verified = verified + + self.active = active + + self.countryCode = countryCode + + self.phone = phone + + self.primary = primary + } + + public func duplicate() -> SendVerificationLinkMobileRequestSchema { + let dict = self.dictionary! + let copy = SendVerificationLinkMobileRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + verified = try container.decode(Bool.self, forKey: .verified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + primary = try container.decode(Bool.self, forKey: .primary) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(verified, forKey: .verified) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(primary, forKey: .primary) + } + } + + /* + Model: EditMobileRequestSchema + Used By: User + */ + class EditMobileRequestSchema: Codable { + public var countryCode: String? + + public var phone: String? + + public enum CodingKeys: String, CodingKey { + case countryCode = "country_code" + + case phone + } + + public init(countryCode: String?, phone: String?) { + self.countryCode = countryCode + + self.phone = phone + } + + public func duplicate() -> EditMobileRequestSchema { + let dict = self.dictionary! + let copy = EditMobileRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(phone, forKey: .phone) + } + } + + /* + Model: EditProfileRequestSchema + Used By: User + */ + class EditProfileRequestSchema: Codable { + public var firstName: String? + + public var lastName: String? + + public var mobile: EditProfileMobileSchema? + + public var countryCode: String? + + public var email: String? + + public var gender: String? + + public var dob: String? + + public var profilePicUrl: String? + + public var androidHash: String? + + public var sender: String? + + public var registerToken: String? + + public enum CodingKeys: String, CodingKey { + case firstName = "first_name" + + case lastName = "last_name" + + case mobile + + case countryCode = "country_code" + + case email + + case gender + + case dob + + case profilePicUrl = "profile_pic_url" + + case androidHash = "android_hash" + + case sender + + case registerToken = "register_token" + } + + public init(androidHash: String?, countryCode: String?, dob: String?, email: String?, firstName: String?, gender: String?, lastName: String?, mobile: EditProfileMobileSchema?, profilePicUrl: String?, registerToken: String?, sender: String?) { + self.firstName = firstName + + self.lastName = lastName + + self.mobile = mobile + + self.countryCode = countryCode + + self.email = email + + self.gender = gender + + self.dob = dob + + self.profilePicUrl = profilePicUrl + + self.androidHash = androidHash + + self.sender = sender + + self.registerToken = registerToken + } + + public func duplicate() -> EditProfileRequestSchema { + let dict = self.dictionary! + let copy = EditProfileRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobile = try container.decode(EditProfileMobileSchema.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gender = try container.decode(String.self, forKey: .gender) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dob = try container.decode(String.self, forKey: .dob) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + profilePicUrl = try container.decode(String.self, forKey: .profilePicUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + androidHash = try container.decode(String.self, forKey: .androidHash) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sender = try container.decode(String.self, forKey: .sender) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(gender, forKey: .gender) + + try? container.encodeIfPresent(dob, forKey: .dob) + + try? container.encodeIfPresent(profilePicUrl, forKey: .profilePicUrl) + + try? container.encodeIfPresent(androidHash, forKey: .androidHash) + + try? container.encodeIfPresent(sender, forKey: .sender) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + } + } + + /* + Model: EditProfileMobileSchema + Used By: User + */ + class EditProfileMobileSchema: Codable { + public var phone: String? + + public var countryCode: String? + + public enum CodingKeys: String, CodingKey { + case phone + + case countryCode = "country_code" + } + + public init(countryCode: String?, phone: String?) { + self.phone = phone + + self.countryCode = countryCode + } + + public func duplicate() -> EditProfileMobileSchema { + let dict = self.dictionary! + let copy = EditProfileMobileSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + } + } + + /* + Model: SendEmailOtpRequestSchema + Used By: User + */ + class SendEmailOtpRequestSchema: Codable { + public var email: String? + + public var action: String? + + public var token: String? + + public var registerToken: String? + + public enum CodingKeys: String, CodingKey { + case email + + case action + + case token + + case registerToken = "register_token" + } + + public init(action: String?, email: String?, registerToken: String?, token: String?) { + self.email = email + + self.action = action + + self.token = token + + self.registerToken = registerToken + } + + public func duplicate() -> SendEmailOtpRequestSchema { + let dict = self.dictionary! + let copy = SendEmailOtpRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(String.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + token = try container.decode(String.self, forKey: .token) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(token, forKey: .token) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + } + } + + /* + Model: VerifyEmailOtpRequestSchema + Used By: User + */ + class VerifyEmailOtpRequestSchema: Codable { + public var email: String? + + public var action: String? + + public var registerToken: String? + + public var otp: String? + + public enum CodingKeys: String, CodingKey { + case email + + case action + + case registerToken = "register_token" + + case otp + } + + public init(action: String?, email: String?, otp: String?, registerToken: String?) { + self.email = email + + self.action = action + + self.registerToken = registerToken + + self.otp = otp + } + + public func duplicate() -> VerifyEmailOtpRequestSchema { + let dict = self.dictionary! + let copy = VerifyEmailOtpRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(String.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + otp = try container.decode(String.self, forKey: .otp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + + try? container.encodeIfPresent(otp, forKey: .otp) + } + } + + /* + Model: VerifyOtpRequestSchema + Used By: User + */ + class VerifyOtpRequestSchema: Codable { + public var requestId: String? + + public var registerToken: String? + + public var otp: String? + + public enum CodingKeys: String, CodingKey { + case requestId = "request_id" + + case registerToken = "register_token" + + case otp + } + + public init(otp: String?, registerToken: String?, requestId: String?) { + self.requestId = requestId + + self.registerToken = registerToken + + self.otp = otp + } + + public func duplicate() -> VerifyOtpRequestSchema { + let dict = self.dictionary! + let copy = VerifyOtpRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + otp = try container.decode(String.self, forKey: .otp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + + try? container.encodeIfPresent(otp, forKey: .otp) + } + } + + /* + Model: SendMobileOtpRequestSchema + Used By: User + */ + class SendMobileOtpRequestSchema: Codable { + public var mobile: String? + + public var countryCode: String? + + public var action: String? + + public var token: String? + + public var androidHash: String? + + public var force: String? + + public var captchaCode: String? + + public enum CodingKeys: String, CodingKey { + case mobile + + case countryCode = "country_code" + + case action + + case token + + case androidHash = "android_hash" + + case force + + case captchaCode = "captcha_code" + } + + public init(action: String?, androidHash: String?, captchaCode: String?, countryCode: String?, force: String?, mobile: String?, token: String?) { + self.mobile = mobile + + self.countryCode = countryCode + + self.action = action + + self.token = token + + self.androidHash = androidHash + + self.force = force + + self.captchaCode = captchaCode + } + + public func duplicate() -> SendMobileOtpRequestSchema { + let dict = self.dictionary! + let copy = SendMobileOtpRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + mobile = try container.decode(String.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(String.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + token = try container.decode(String.self, forKey: .token) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + androidHash = try container.decode(String.self, forKey: .androidHash) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + force = try container.decode(String.self, forKey: .force) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + captchaCode = try container.decode(String.self, forKey: .captchaCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(token, forKey: .token) + + try? container.encodeIfPresent(androidHash, forKey: .androidHash) + + try? container.encodeIfPresent(force, forKey: .force) + + try? container.encodeIfPresent(captchaCode, forKey: .captchaCode) + } + } + + /* + Model: UpdatePasswordRequestSchema + Used By: User + */ + class UpdatePasswordRequestSchema: Codable { + public var oldPassword: String? + + public var newPassword: String? + + public enum CodingKeys: String, CodingKey { + case oldPassword = "old_password" + + case newPassword = "new_password" + } + + public init(newPassword: String?, oldPassword: String?) { + self.oldPassword = oldPassword + + self.newPassword = newPassword + } + + public func duplicate() -> UpdatePasswordRequestSchema { + let dict = self.dictionary! + let copy = UpdatePasswordRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + oldPassword = try container.decode(String.self, forKey: .oldPassword) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + newPassword = try container.decode(String.self, forKey: .newPassword) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(oldPassword, forKey: .oldPassword) + + try? container.encodeIfPresent(newPassword, forKey: .newPassword) + } + } + + /* + Model: FormRegisterRequestSchema + Used By: User + */ + class FormRegisterRequestSchema: Codable { + public var firstName: String? + + public var lastName: String? + + public var gender: String? + + public var email: String? + + public var password: String? + + public var phone: FormRegisterRequestSchemaPhone? + + public var registerToken: String? + + public enum CodingKeys: String, CodingKey { + case firstName = "first_name" + + case lastName = "last_name" + + case gender + + case email + + case password + + case phone + + case registerToken = "register_token" + } + + public init(email: String?, firstName: String?, gender: String?, lastName: String?, password: String?, phone: FormRegisterRequestSchemaPhone?, registerToken: String?) { + self.firstName = firstName + + self.lastName = lastName + + self.gender = gender + + self.email = email + + self.password = password + + self.phone = phone + + self.registerToken = registerToken + } + + public func duplicate() -> FormRegisterRequestSchema { + let dict = self.dictionary! + let copy = FormRegisterRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gender = try container.decode(String.self, forKey: .gender) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + password = try container.decode(String.self, forKey: .password) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(FormRegisterRequestSchemaPhone.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(gender, forKey: .gender) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(password, forKey: .password) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + } + } + + /* + Model: TokenRequestBodySchema + Used By: User + */ + class TokenRequestBodySchema: Codable { + public var token: String? + + public enum CodingKeys: String, CodingKey { + case token + } + + public init(token: String?) { + self.token = token + } + + public func duplicate() -> TokenRequestBodySchema { + let dict = self.dictionary! + let copy = TokenRequestBodySchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + token = try container.decode(String.self, forKey: .token) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(token, forKey: .token) + } + } + + /* + Model: ForgotPasswordRequestSchema + Used By: User + */ + class ForgotPasswordRequestSchema: Codable { + public var code: String? + + public var password: String? + + public enum CodingKeys: String, CodingKey { + case code + + case password + } + + public init(code: String?, password: String?) { + self.code = code + + self.password = password + } + + public func duplicate() -> ForgotPasswordRequestSchema { + let dict = self.dictionary! + let copy = ForgotPasswordRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + password = try container.decode(String.self, forKey: .password) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(password, forKey: .password) + } + } + + /* + Model: CodeRequestBodySchema + Used By: User + */ + class CodeRequestBodySchema: Codable { + public var code: String? + + public enum CodingKeys: String, CodingKey { + case code + } + + public init(code: String?) { + self.code = code + } + + public func duplicate() -> CodeRequestBodySchema { + let dict = self.dictionary! + let copy = CodeRequestBodySchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: SendResetPasswordEmailRequestSchema + Used By: User + */ + class SendResetPasswordEmailRequestSchema: Codable { + public var email: String? + + public var captchaCode: String? + + public enum CodingKeys: String, CodingKey { + case email + + case captchaCode = "captcha_code" + } + + public init(captchaCode: String?, email: String?) { + self.email = email + + self.captchaCode = captchaCode + } + + public func duplicate() -> SendResetPasswordEmailRequestSchema { + let dict = self.dictionary! + let copy = SendResetPasswordEmailRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + captchaCode = try container.decode(String.self, forKey: .captchaCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(captchaCode, forKey: .captchaCode) + } + } + + /* + Model: PasswordLoginRequestSchema + Used By: User + */ + class PasswordLoginRequestSchema: Codable { + public var captchaCode: String? + + public var password: String? + + public var username: String? + + public enum CodingKeys: String, CodingKey { + case captchaCode = "captcha_code" + + case password + + case username + } + + public init(captchaCode: String?, password: String?, username: String?) { + self.captchaCode = captchaCode + + self.password = password + + self.username = username + } + + public func duplicate() -> PasswordLoginRequestSchema { + let dict = self.dictionary! + let copy = PasswordLoginRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + captchaCode = try container.decode(String.self, forKey: .captchaCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + password = try container.decode(String.self, forKey: .password) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(captchaCode, forKey: .captchaCode) + + try? container.encodeIfPresent(password, forKey: .password) + + try? container.encodeIfPresent(username, forKey: .username) + } + } + + /* + Model: SendOtpRequestSchema + Used By: User + */ + class SendOtpRequestSchema: Codable { + public var countryCode: String? + + public var captchaCode: String? + + public var mobile: String? + + public enum CodingKeys: String, CodingKey { + case countryCode = "country_code" + + case captchaCode = "captcha_code" + + case mobile + } + + public init(captchaCode: String?, countryCode: String?, mobile: String?) { + self.countryCode = countryCode + + self.captchaCode = captchaCode + + self.mobile = mobile + } + + public func duplicate() -> SendOtpRequestSchema { + let dict = self.dictionary! + let copy = SendOtpRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + captchaCode = try container.decode(String.self, forKey: .captchaCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobile = try container.decode(String.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(captchaCode, forKey: .captchaCode) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + } + } + + /* + Model: OAuthRequestSchema + Used By: User + */ + class OAuthRequestSchema: Codable { + public var isSignedIn: Bool? + + public var oauth2: OAuthRequestSchemaOauth2? + + public var profile: OAuthRequestSchemaProfile? + + public enum CodingKeys: String, CodingKey { + case isSignedIn = "is_signed_in" + + case oauth2 + + case profile + } + + public init(isSignedIn: Bool?, oauth2: OAuthRequestSchemaOauth2?, profile: OAuthRequestSchemaProfile?) { + self.isSignedIn = isSignedIn + + self.oauth2 = oauth2 + + self.profile = profile + } + + public func duplicate() -> OAuthRequestSchema { + let dict = self.dictionary! + let copy = OAuthRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isSignedIn = try container.decode(Bool.self, forKey: .isSignedIn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + oauth2 = try container.decode(OAuthRequestSchemaOauth2.self, forKey: .oauth2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + profile = try container.decode(OAuthRequestSchemaProfile.self, forKey: .profile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isSignedIn, forKey: .isSignedIn) + + try? container.encodeIfPresent(oauth2, forKey: .oauth2) + + try? container.encodeIfPresent(profile, forKey: .profile) + } + } + + /* + Model: OAuthRequestAppleSchema + Used By: User + */ + class OAuthRequestAppleSchema: Codable { + public var userIdentifier: String? + + public var oauth: OAuthRequestAppleSchemaOauth? + + public var profile: OAuthRequestAppleSchemaProfile? + + public enum CodingKeys: String, CodingKey { + case userIdentifier = "user_identifier" + + case oauth + + case profile + } + + public init(oauth: OAuthRequestAppleSchemaOauth?, profile: OAuthRequestAppleSchemaProfile?, userIdentifier: String?) { + self.userIdentifier = userIdentifier + + self.oauth = oauth + + self.profile = profile + } + + public func duplicate() -> OAuthRequestAppleSchema { + let dict = self.dictionary! + let copy = OAuthRequestAppleSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + userIdentifier = try container.decode(String.self, forKey: .userIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + oauth = try container.decode(OAuthRequestAppleSchemaOauth.self, forKey: .oauth) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + profile = try container.decode(OAuthRequestAppleSchemaProfile.self, forKey: .profile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(userIdentifier, forKey: .userIdentifier) + + try? container.encodeIfPresent(oauth, forKey: .oauth) + + try? container.encodeIfPresent(profile, forKey: .profile) + } + } + + /* + Model: UserObjectSchema + Used By: User + */ + class UserObjectSchema: Codable { + public var user: UserSchema? + + public enum CodingKeys: String, CodingKey { + case user + } + + public init(user: UserSchema?) { + self.user = user + } + + public func duplicate() -> UserObjectSchema { + let dict = self.dictionary! + let copy = UserObjectSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode(UserSchema.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + } + } + + /* + Model: AuthSuccess + Used By: User + */ + class AuthSuccess: Codable { + public var registerToken: String? + + public var userExists: Bool? + + public var user: UserSchema? + + public enum CodingKeys: String, CodingKey { + case registerToken = "register_token" + + case userExists = "user_exists" + + case user + } + + public init(registerToken: String?, user: UserSchema?, userExists: Bool?) { + self.registerToken = registerToken + + self.userExists = userExists + + self.user = user + } + + public func duplicate() -> AuthSuccess { + let dict = self.dictionary! + let copy = AuthSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userExists = try container.decode(Bool.self, forKey: .userExists) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + user = try container.decode(UserSchema.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + + try? container.encodeIfPresent(userExists, forKey: .userExists) + + try? container.encodeIfPresent(user, forKey: .user) + } + } + + /* + Model: SendOtpResponse + Used By: User + */ + class SendOtpResponse: Codable { + public var resendTimer: Int? + + public var resendToken: String? + + public var success: Bool? + + public var requestId: String? + + public var message: String? + + public var mobile: String? + + public var countryCode: String? + + public var email: String? + + public var resendEmailToken: String? + + public var registerToken: String? + + public var verifyEmailOtp: Bool? + + public var verifyMobileOtp: Bool? + + public var userExists: Bool? + + public enum CodingKeys: String, CodingKey { + case resendTimer = "resend_timer" + + case resendToken = "resend_token" + + case success + + case requestId = "request_id" + + case message + + case mobile + + case countryCode = "country_code" + + case email + + case resendEmailToken = "resend_email_token" + + case registerToken = "register_token" + + case verifyEmailOtp = "verify_email_otp" + + case verifyMobileOtp = "verify_mobile_otp" + + case userExists = "user_exists" + } + + public init(countryCode: String?, email: String?, message: String?, mobile: String?, registerToken: String?, requestId: String?, resendEmailToken: String?, resendTimer: Int?, resendToken: String?, success: Bool?, userExists: Bool?, verifyEmailOtp: Bool?, verifyMobileOtp: Bool?) { + self.resendTimer = resendTimer + + self.resendToken = resendToken + + self.success = success + + self.requestId = requestId + + self.message = message + + self.mobile = mobile + + self.countryCode = countryCode + + self.email = email + + self.resendEmailToken = resendEmailToken + + self.registerToken = registerToken + + self.verifyEmailOtp = verifyEmailOtp + + self.verifyMobileOtp = verifyMobileOtp + + self.userExists = userExists + } + + public func duplicate() -> SendOtpResponse { + let dict = self.dictionary! + let copy = SendOtpResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + resendTimer = try container.decode(Int.self, forKey: .resendTimer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + resendToken = try container.decode(String.self, forKey: .resendToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobile = try container.decode(String.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + resendEmailToken = try container.decode(String.self, forKey: .resendEmailToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyEmailOtp = try container.decode(Bool.self, forKey: .verifyEmailOtp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyMobileOtp = try container.decode(Bool.self, forKey: .verifyMobileOtp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userExists = try container.decode(Bool.self, forKey: .userExists) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(resendTimer, forKey: .resendTimer) + + try? container.encodeIfPresent(resendToken, forKey: .resendToken) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(resendEmailToken, forKey: .resendEmailToken) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + + try? container.encodeIfPresent(verifyEmailOtp, forKey: .verifyEmailOtp) + + try? container.encodeIfPresent(verifyMobileOtp, forKey: .verifyMobileOtp) + + try? container.encodeIfPresent(userExists, forKey: .userExists) + } + } + + /* + Model: ProfileEditSuccess + Used By: User + */ + class ProfileEditSuccess: Codable { + public var user: UserSchema? + + public var resendEmailToken: String? + + public var registerToken: String? + + public var userExists: Bool? + + public var verifyEmailLink: Bool? + + public var verifyEmailOtp: Bool? + + public var verifyMobileOtp: Bool? + + public var email: String? + + public var requestId: String? + + public enum CodingKeys: String, CodingKey { + case user + + case resendEmailToken = "resend_email_token" + + case registerToken = "register_token" + + case userExists = "user_exists" + + case verifyEmailLink = "verify_email_link" + + case verifyEmailOtp = "verify_email_otp" + + case verifyMobileOtp = "verify_mobile_otp" + + case email + + case requestId = "request_id" + } + + public init(email: String?, registerToken: String?, requestId: String?, resendEmailToken: String?, user: UserSchema?, userExists: Bool?, verifyEmailLink: Bool?, verifyEmailOtp: Bool?, verifyMobileOtp: Bool?) { + self.user = user + + self.resendEmailToken = resendEmailToken + + self.registerToken = registerToken + + self.userExists = userExists + + self.verifyEmailLink = verifyEmailLink + + self.verifyEmailOtp = verifyEmailOtp + + self.verifyMobileOtp = verifyMobileOtp + + self.email = email + + self.requestId = requestId + } + + public func duplicate() -> ProfileEditSuccess { + let dict = self.dictionary! + let copy = ProfileEditSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode(UserSchema.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + resendEmailToken = try container.decode(String.self, forKey: .resendEmailToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userExists = try container.decode(Bool.self, forKey: .userExists) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyEmailLink = try container.decode(Bool.self, forKey: .verifyEmailLink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyEmailOtp = try container.decode(Bool.self, forKey: .verifyEmailOtp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyMobileOtp = try container.decode(Bool.self, forKey: .verifyMobileOtp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(resendEmailToken, forKey: .resendEmailToken) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + + try? container.encodeIfPresent(userExists, forKey: .userExists) + + try? container.encodeIfPresent(verifyEmailLink, forKey: .verifyEmailLink) + + try? container.encodeIfPresent(verifyEmailOtp, forKey: .verifyEmailOtp) + + try? container.encodeIfPresent(verifyMobileOtp, forKey: .verifyMobileOtp) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + } + } + + /* + Model: LoginSuccess + Used By: User + */ + class LoginSuccess: Codable { + public var user: UserSchema? + + public var requestId: String? + + public var registerToken: String? + + public enum CodingKeys: String, CodingKey { + case user + + case requestId = "request_id" + + case registerToken = "register_token" + } + + public init(registerToken: String?, requestId: String?, user: UserSchema?) { + self.user = user + + self.requestId = requestId + + self.registerToken = registerToken + } + + public func duplicate() -> LoginSuccess { + let dict = self.dictionary! + let copy = LoginSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode(UserSchema.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + } + } + + /* + Model: VerifyOtpSuccess + Used By: User + */ + class VerifyOtpSuccess: Codable { + public var user: UserSchema? + + public var userExists: Bool? + + public var registerToken: String? + + public enum CodingKeys: String, CodingKey { + case user + + case userExists = "user_exists" + + case registerToken = "register_token" + } + + public init(registerToken: String?, user: UserSchema?, userExists: Bool?) { + self.user = user + + self.userExists = userExists + + self.registerToken = registerToken + } + + public func duplicate() -> VerifyOtpSuccess { + let dict = self.dictionary! + let copy = VerifyOtpSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode(UserSchema.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userExists = try container.decode(Bool.self, forKey: .userExists) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(userExists, forKey: .userExists) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + } + } + + /* + Model: ResetPasswordSuccess + Used By: User + */ + class ResetPasswordSuccess: Codable { + public var status: String? + + public enum CodingKeys: String, CodingKey { + case status + } + + public init(status: String?) { + self.status = status + } + + public func duplicate() -> ResetPasswordSuccess { + let dict = self.dictionary! + let copy = ResetPasswordSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: RegisterFormSuccess + Used By: User + */ + class RegisterFormSuccess: Codable { + public var email: String? + + public var resendTimer: Int? + + public var resendToken: String? + + public var resendEmailToken: String? + + public var registerToken: String? + + public var success: Bool? + + public var requestId: String? + + public var message: String? + + public var mobile: String? + + public var countryCode: String? + + public var verifyEmailOtp: Bool? + + public var verifyMobileOtp: Bool? + + public var userExists: Bool? + + public enum CodingKeys: String, CodingKey { + case email + + case resendTimer = "resend_timer" + + case resendToken = "resend_token" + + case resendEmailToken = "resend_email_token" + + case registerToken = "register_token" + + case success + + case requestId = "request_id" + + case message + + case mobile + + case countryCode = "country_code" + + case verifyEmailOtp = "verify_email_otp" + + case verifyMobileOtp = "verify_mobile_otp" + + case userExists = "user_exists" + } + + public init(countryCode: String?, email: String?, message: String?, mobile: String?, registerToken: String?, requestId: String?, resendEmailToken: String?, resendTimer: Int?, resendToken: String?, success: Bool?, userExists: Bool?, verifyEmailOtp: Bool?, verifyMobileOtp: Bool?) { + self.email = email + + self.resendTimer = resendTimer + + self.resendToken = resendToken + + self.resendEmailToken = resendEmailToken + + self.registerToken = registerToken + + self.success = success + + self.requestId = requestId + + self.message = message + + self.mobile = mobile + + self.countryCode = countryCode + + self.verifyEmailOtp = verifyEmailOtp + + self.verifyMobileOtp = verifyMobileOtp + + self.userExists = userExists + } + + public func duplicate() -> RegisterFormSuccess { + let dict = self.dictionary! + let copy = RegisterFormSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + resendTimer = try container.decode(Int.self, forKey: .resendTimer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + resendToken = try container.decode(String.self, forKey: .resendToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + resendEmailToken = try container.decode(String.self, forKey: .resendEmailToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobile = try container.decode(String.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyEmailOtp = try container.decode(Bool.self, forKey: .verifyEmailOtp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyMobileOtp = try container.decode(Bool.self, forKey: .verifyMobileOtp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userExists = try container.decode(Bool.self, forKey: .userExists) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(resendTimer, forKey: .resendTimer) + + try? container.encodeIfPresent(resendToken, forKey: .resendToken) + + try? container.encodeIfPresent(resendEmailToken, forKey: .resendEmailToken) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(verifyEmailOtp, forKey: .verifyEmailOtp) + + try? container.encodeIfPresent(verifyMobileOtp, forKey: .verifyMobileOtp) + + try? container.encodeIfPresent(userExists, forKey: .userExists) + } + } + + /* + Model: VerifyEmailSuccess + Used By: User + */ + class VerifyEmailSuccess: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> VerifyEmailSuccess { + let dict = self.dictionary! + let copy = VerifyEmailSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: HasPasswordSuccess + Used By: User + */ + class HasPasswordSuccess: Codable { + public var result: Bool? + + public enum CodingKeys: String, CodingKey { + case result + } + + public init(result: Bool?) { + self.result = result + } + + public func duplicate() -> HasPasswordSuccess { + let dict = self.dictionary! + let copy = HasPasswordSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + result = try container.decode(Bool.self, forKey: .result) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(result, forKey: .result) + } + } + + /* + Model: LogoutSuccess + Used By: User + */ + class LogoutSuccess: Codable { + public var logout: Bool? + + public enum CodingKeys: String, CodingKey { + case logout + } + + public init(logout: Bool?) { + self.logout = logout + } + + public func duplicate() -> LogoutSuccess { + let dict = self.dictionary! + let copy = LogoutSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + logout = try container.decode(Bool.self, forKey: .logout) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(logout, forKey: .logout) + } + } + + /* + Model: OtpSuccess + Used By: User + */ + class OtpSuccess: Codable { + public var resendTimer: Int? + + public var resendToken: String? + + public var registerToken: String? + + public var success: Bool? + + public var requestId: String? + + public var message: String? + + public var mobile: String? + + public var countryCode: String? + + public enum CodingKeys: String, CodingKey { + case resendTimer = "resend_timer" + + case resendToken = "resend_token" + + case registerToken = "register_token" + + case success + + case requestId = "request_id" + + case message + + case mobile + + case countryCode = "country_code" + } + + public init(countryCode: String?, message: String?, mobile: String?, registerToken: String?, requestId: String?, resendTimer: Int?, resendToken: String?, success: Bool?) { + self.resendTimer = resendTimer + + self.resendToken = resendToken + + self.registerToken = registerToken + + self.success = success + + self.requestId = requestId + + self.message = message + + self.mobile = mobile + + self.countryCode = countryCode + } + + public func duplicate() -> OtpSuccess { + let dict = self.dictionary! + let copy = OtpSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + resendTimer = try container.decode(Int.self, forKey: .resendTimer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + resendToken = try container.decode(String.self, forKey: .resendToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobile = try container.decode(String.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(resendTimer, forKey: .resendTimer) + + try? container.encodeIfPresent(resendToken, forKey: .resendToken) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + } + } + + /* + Model: EmailOtpSuccess + Used By: User + */ + class EmailOtpSuccess: Codable { + public var success: Bool? + + public enum CodingKeys: String, CodingKey { + case success + } + + public init(success: Bool?) { + self.success = success + } + + public func duplicate() -> EmailOtpSuccess { + let dict = self.dictionary! + let copy = EmailOtpSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: SessionListSuccess + Used By: User + */ + class SessionListSuccess: Codable { + public var sessions: [String]? + + public enum CodingKeys: String, CodingKey { + case sessions + } + + public init(sessions: [String]?) { + self.sessions = sessions + } + + public func duplicate() -> SessionListSuccess { + let dict = self.dictionary! + let copy = SessionListSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + sessions = try container.decode([String].self, forKey: .sessions) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(sessions, forKey: .sessions) + } + } + + /* + Model: VerifyMobileOTPSuccess + Used By: User + */ + class VerifyMobileOTPSuccess: Codable { + public var user: UserSchema? + + public var verifyMobileLink: Bool? + + public enum CodingKeys: String, CodingKey { + case user + + case verifyMobileLink = "verify_mobile_link" + } + + public init(user: UserSchema?, verifyMobileLink: Bool?) { + self.user = user + + self.verifyMobileLink = verifyMobileLink + } + + public func duplicate() -> VerifyMobileOTPSuccess { + let dict = self.dictionary! + let copy = VerifyMobileOTPSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode(UserSchema.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyMobileLink = try container.decode(Bool.self, forKey: .verifyMobileLink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(verifyMobileLink, forKey: .verifyMobileLink) + } + } + + /* + Model: VerifyEmailOTPSuccess + Used By: User + */ + class VerifyEmailOTPSuccess: Codable { + public var user: UserSchema? + + public var verifyEmailLink: Bool? + + public enum CodingKeys: String, CodingKey { + case user + + case verifyEmailLink = "verify_email_link" + } + + public init(user: UserSchema?, verifyEmailLink: Bool?) { + self.user = user + + self.verifyEmailLink = verifyEmailLink + } + + public func duplicate() -> VerifyEmailOTPSuccess { + let dict = self.dictionary! + let copy = VerifyEmailOTPSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode(UserSchema.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyEmailLink = try container.decode(Bool.self, forKey: .verifyEmailLink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(verifyEmailLink, forKey: .verifyEmailLink) + } + } + + /* + Model: SendMobileVerifyLinkSuccess + Used By: User + */ + class SendMobileVerifyLinkSuccess: Codable { + public var verifyMobileLink: Bool? + + public enum CodingKeys: String, CodingKey { + case verifyMobileLink = "verify_mobile_link" + } + + public init(verifyMobileLink: Bool?) { + self.verifyMobileLink = verifyMobileLink + } + + public func duplicate() -> SendMobileVerifyLinkSuccess { + let dict = self.dictionary! + let copy = SendMobileVerifyLinkSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + verifyMobileLink = try container.decode(Bool.self, forKey: .verifyMobileLink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(verifyMobileLink, forKey: .verifyMobileLink) + } + } + + /* + Model: SendEmailVerifyLinkSuccess + Used By: User + */ + class SendEmailVerifyLinkSuccess: Codable { + public var verifyEmailLink: Bool? + + public enum CodingKeys: String, CodingKey { + case verifyEmailLink = "verify_email_link" + } + + public init(verifyEmailLink: Bool?) { + self.verifyEmailLink = verifyEmailLink + } + + public func duplicate() -> SendEmailVerifyLinkSuccess { + let dict = self.dictionary! + let copy = SendEmailVerifyLinkSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + verifyEmailLink = try container.decode(Bool.self, forKey: .verifyEmailLink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(verifyEmailLink, forKey: .verifyEmailLink) + } + } + + /* + Model: UserSearchResponseSchema + Used By: User + */ + class UserSearchResponseSchema: Codable { + public var users: [UserSchema]? + + public enum CodingKeys: String, CodingKey { + case users + } + + public init(users: [UserSchema]?) { + self.users = users + } + + public func duplicate() -> UserSearchResponseSchema { + let dict = self.dictionary! + let copy = UserSearchResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + users = try container.decode([UserSchema].self, forKey: .users) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(users, forKey: .users) + } + } + + /* + Model: CustomerListResponseSchema + Used By: User + */ + class CustomerListResponseSchema: Codable { + public var items: [UserSchema]? + + public var page: PaginationSchema? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [UserSchema]?, page: PaginationSchema?) { + self.items = items + + self.page = page + } + + public func duplicate() -> CustomerListResponseSchema { + let dict = self.dictionary! + let copy = CustomerListResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([UserSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(PaginationSchema.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: UnauthorizedSchema + Used By: User + */ + class UnauthorizedSchema: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> UnauthorizedSchema { + let dict = self.dictionary! + let copy = UnauthorizedSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: UnauthenticatedSchema + Used By: User + */ + class UnauthenticatedSchema: Codable { + public var authenticated: Bool? + + public enum CodingKeys: String, CodingKey { + case authenticated + } + + public init(authenticated: Bool?) { + self.authenticated = authenticated + } + + public func duplicate() -> UnauthenticatedSchema { + let dict = self.dictionary! + let copy = UnauthenticatedSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + authenticated = try container.decode(Bool.self, forKey: .authenticated) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(authenticated, forKey: .authenticated) + } + } + + /* + Model: NotFoundSchema + Used By: User + */ + class NotFoundSchema: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> NotFoundSchema { + let dict = self.dictionary! + let copy = NotFoundSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: AuthenticationInternalServerErrorSchema + Used By: User + */ + class AuthenticationInternalServerErrorSchema: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> AuthenticationInternalServerErrorSchema { + let dict = self.dictionary! + let copy = AuthenticationInternalServerErrorSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: AuthenticationApiErrorSchema + Used By: User + */ + class AuthenticationApiErrorSchema: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> AuthenticationApiErrorSchema { + let dict = self.dictionary! + let copy = AuthenticationApiErrorSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: ProfileEditSuccessSchema + Used By: User + */ + class ProfileEditSuccessSchema: Codable { + public var email: String? + + public var verifyEmailOtp: Bool? + + public var verifyEmailLink: Bool? + + public var verifyMobileOtp: Bool? + + public var user: String? + + public var registerToken: String? + + public var userExists: Bool? + + public enum CodingKeys: String, CodingKey { + case email + + case verifyEmailOtp = "verify_email_otp" + + case verifyEmailLink = "verify_email_link" + + case verifyMobileOtp = "verify_mobile_otp" + + case user + + case registerToken = "register_token" + + case userExists = "user_exists" + } + + public init(email: String?, registerToken: String?, user: String?, userExists: Bool?, verifyEmailLink: Bool?, verifyEmailOtp: Bool?, verifyMobileOtp: Bool?) { + self.email = email + + self.verifyEmailOtp = verifyEmailOtp + + self.verifyEmailLink = verifyEmailLink + + self.verifyMobileOtp = verifyMobileOtp + + self.user = user + + self.registerToken = registerToken + + self.userExists = userExists + } + + public func duplicate() -> ProfileEditSuccessSchema { + let dict = self.dictionary! + let copy = ProfileEditSuccessSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyEmailOtp = try container.decode(Bool.self, forKey: .verifyEmailOtp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyEmailLink = try container.decode(Bool.self, forKey: .verifyEmailLink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyMobileOtp = try container.decode(Bool.self, forKey: .verifyMobileOtp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + user = try container.decode(String.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userExists = try container.decode(Bool.self, forKey: .userExists) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(verifyEmailOtp, forKey: .verifyEmailOtp) + + try? container.encodeIfPresent(verifyEmailLink, forKey: .verifyEmailLink) + + try? container.encodeIfPresent(verifyMobileOtp, forKey: .verifyMobileOtp) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + + try? container.encodeIfPresent(userExists, forKey: .userExists) + } + } + + /* + Model: FormRegisterRequestSchemaPhone + Used By: User + */ + class FormRegisterRequestSchemaPhone: Codable { + public var countryCode: String? + + public var mobile: String? + + public enum CodingKeys: String, CodingKey { + case countryCode = "country_code" + + case mobile + } + + public init(countryCode: String?, mobile: String?) { + self.countryCode = countryCode + + self.mobile = mobile + } + + public func duplicate() -> FormRegisterRequestSchemaPhone { + let dict = self.dictionary! + let copy = FormRegisterRequestSchemaPhone(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobile = try container.decode(String.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + } + } + + /* + Model: OAuthRequestSchemaOauth2 + Used By: User + */ + class OAuthRequestSchemaOauth2: Codable { + public var accessToken: String? + + public var expiry: Int? + + public var refreshToken: String? + + public enum CodingKeys: String, CodingKey { + case accessToken = "access_token" + + case expiry + + case refreshToken = "refresh_token" + } + + public init(accessToken: String?, expiry: Int?, refreshToken: String?) { + self.accessToken = accessToken + + self.expiry = expiry + + self.refreshToken = refreshToken + } + + public func duplicate() -> OAuthRequestSchemaOauth2 { + let dict = self.dictionary! + let copy = OAuthRequestSchemaOauth2(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + accessToken = try container.decode(String.self, forKey: .accessToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expiry = try container.decode(Int.self, forKey: .expiry) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refreshToken = try container.decode(String.self, forKey: .refreshToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(accessToken, forKey: .accessToken) + + try? container.encodeIfPresent(expiry, forKey: .expiry) + + try? container.encodeIfPresent(refreshToken, forKey: .refreshToken) + } + } + + /* + Model: OAuthRequestSchemaProfile + Used By: User + */ + class OAuthRequestSchemaProfile: Codable { + public var lastName: String? + + public var image: String? + + public var id: String? + + public var email: String? + + public var fullName: String? + + public var firstName: String? + + public enum CodingKeys: String, CodingKey { + case lastName = "last_name" + + case image + + case id + + case email + + case fullName = "full_name" + + case firstName = "first_name" + } + + public init(email: String?, firstName: String?, fullName: String?, id: String?, image: String?, lastName: String?) { + self.lastName = lastName + + self.image = image + + self.id = id + + self.email = email + + self.fullName = fullName + + self.firstName = firstName + } + + public func duplicate() -> OAuthRequestSchemaProfile { + let dict = self.dictionary! + let copy = OAuthRequestSchemaProfile(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + image = try container.decode(String.self, forKey: .image) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fullName = try container.decode(String.self, forKey: .fullName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(image, forKey: .image) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(fullName, forKey: .fullName) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + } + } + + /* + Model: OAuthRequestAppleSchemaOauth + Used By: User + */ + class OAuthRequestAppleSchemaOauth: Codable { + public var identityToken: String? + + public enum CodingKeys: String, CodingKey { + case identityToken = "identity_token" + } + + public init(identityToken: String?) { + self.identityToken = identityToken + } + + public func duplicate() -> OAuthRequestAppleSchemaOauth { + let dict = self.dictionary! + let copy = OAuthRequestAppleSchemaOauth(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + identityToken = try container.decode(String.self, forKey: .identityToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(identityToken, forKey: .identityToken) + } + } + + /* + Model: OAuthRequestAppleSchemaProfile + Used By: User + */ + class OAuthRequestAppleSchemaProfile: Codable { + public var lastName: String? + + public var fullName: String? + + public var firstName: String? + + public enum CodingKeys: String, CodingKey { + case lastName = "last_name" + + case fullName = "full_name" + + case firstName = "first_name" + } + + public init(firstName: String?, fullName: String?, lastName: String?) { + self.lastName = lastName + + self.fullName = fullName + + self.firstName = firstName + } + + public func duplicate() -> OAuthRequestAppleSchemaProfile { + let dict = self.dictionary! + let copy = OAuthRequestAppleSchemaProfile(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fullName = try container.decode(String.self, forKey: .fullName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(fullName, forKey: .fullName) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + } + } + + /* + Model: AuthSuccessUser + Used By: User + */ + class AuthSuccessUser: Codable { + public var firstName: String? + + public var lastName: String? + + public var debug: AuthSuccessUserDebug? + + public var active: Bool? + + public var emails: AuthSuccessUserEmails? + + public enum CodingKeys: String, CodingKey { + case firstName = "first_name" + + case lastName = "last_name" + + case debug + + case active + + case emails + } + + public init(active: Bool?, debug: AuthSuccessUserDebug?, emails: AuthSuccessUserEmails?, firstName: String?, lastName: String?) { + self.firstName = firstName + + self.lastName = lastName + + self.debug = debug + + self.active = active + + self.emails = emails + } + + public func duplicate() -> AuthSuccessUser { + let dict = self.dictionary! + let copy = AuthSuccessUser(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + debug = try container.decode(AuthSuccessUserDebug.self, forKey: .debug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + emails = try container.decode(AuthSuccessUserEmails.self, forKey: .emails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(debug, forKey: .debug) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(emails, forKey: .emails) + } + } + + /* + Model: AuthSuccessUserDebug + Used By: User + */ + class AuthSuccessUserDebug: Codable { + public var platform: String? + + public enum CodingKeys: String, CodingKey { + case platform + } + + public init(platform: String?) { + self.platform = platform + } + + public func duplicate() -> AuthSuccessUserDebug { + let dict = self.dictionary! + let copy = AuthSuccessUserDebug(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + platform = try container.decode(String.self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(platform, forKey: .platform) + } + } + + /* + Model: AuthSuccessUserEmails + Used By: User + */ + class AuthSuccessUserEmails: Codable { + public var email: String? + + public var verified: Bool? + + public var primary: Bool? + + public var active: Bool? + + public enum CodingKeys: String, CodingKey { + case email + + case verified + + case primary + + case active + } + + public init(active: Bool?, email: String?, primary: Bool?, verified: Bool?) { + self.email = email + + self.verified = verified + + self.primary = primary + + self.active = active + } + + public func duplicate() -> AuthSuccessUserEmails { + let dict = self.dictionary! + let copy = AuthSuccessUserEmails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verified = try container.decode(Bool.self, forKey: .verified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + primary = try container.decode(Bool.self, forKey: .primary) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(verified, forKey: .verified) + + try? container.encodeIfPresent(primary, forKey: .primary) + + try? container.encodeIfPresent(active, forKey: .active) + } + } + + /* + Model: CreateUserRequestSchema + Used By: User + */ + class CreateUserRequestSchema: Codable { + public var phoneNumber: String + + public var email: String? + + public var firstName: String? + + public var lastName: String? + + public var gender: String? + + public var username: String + + public var meta: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case phoneNumber = "phone_number" + + case email + + case firstName = "first_name" + + case lastName = "last_name" + + case gender + + case username + + case meta + } + + public init(email: String?, firstName: String?, gender: String?, lastName: String?, meta: [String: Any]?, phoneNumber: String, username: String) { + self.phoneNumber = phoneNumber + + self.email = email + + self.firstName = firstName + + self.lastName = lastName + + self.gender = gender + + self.username = username + + self.meta = meta + } + + public func duplicate() -> CreateUserRequestSchema { + let dict = self.dictionary! + let copy = CreateUserRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + phoneNumber = try container.decode(String.self, forKey: .phoneNumber) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gender = try container.decode(String.self, forKey: .gender) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + username = try container.decode(String.self, forKey: .username) + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(phoneNumber, forKey: .phoneNumber) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(gender, forKey: .gender) + + try? container.encodeIfPresent(username, forKey: .username) + + try? container.encodeIfPresent(meta, forKey: .meta) + } + } + + /* + Model: CreateUserResponseSchema + Used By: User + */ + class CreateUserResponseSchema: Codable { + public var user: UserSchema? + + public enum CodingKeys: String, CodingKey { + case user + } + + public init(user: UserSchema?) { + self.user = user + } + + public func duplicate() -> CreateUserResponseSchema { + let dict = self.dictionary! + let copy = CreateUserResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode(UserSchema.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + } + } + + /* + Model: CreateUserSessionRequestSchema + Used By: User + */ + class CreateUserSessionRequestSchema: Codable { + public var domain: String? + + public var maxAge: Double? + + public var userId: String? + + public enum CodingKeys: String, CodingKey { + case domain + + case maxAge = "max_age" + + case userId = "user_id" + } + + public init(domain: String?, maxAge: Double?, userId: String?) { + self.domain = domain + + self.maxAge = maxAge + + self.userId = userId + } + + public func duplicate() -> CreateUserSessionRequestSchema { + let dict = self.dictionary! + let copy = CreateUserSessionRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + domain = try container.decode(String.self, forKey: .domain) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + maxAge = try container.decode(Double.self, forKey: .maxAge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(domain, forKey: .domain) + + try? container.encodeIfPresent(maxAge, forKey: .maxAge) + + try? container.encodeIfPresent(userId, forKey: .userId) + } + } + + /* + Model: CreateUserSessionResponseSchema + Used By: User + */ + class CreateUserSessionResponseSchema: Codable { + public var domain: String? + + public var maxAge: Double? + + public var secure: Bool? + + public var httpOnly: Bool? + + public var cookie: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case domain + + case maxAge = "max_age" + + case secure + + case httpOnly = "http_only" + + case cookie + } + + public init(cookie: [String: Any]?, domain: String?, httpOnly: Bool?, maxAge: Double?, secure: Bool?) { + self.domain = domain + + self.maxAge = maxAge + + self.secure = secure + + self.httpOnly = httpOnly + + self.cookie = cookie + } + + public func duplicate() -> CreateUserSessionResponseSchema { + let dict = self.dictionary! + let copy = CreateUserSessionResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + domain = try container.decode(String.self, forKey: .domain) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + maxAge = try container.decode(Double.self, forKey: .maxAge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + secure = try container.decode(Bool.self, forKey: .secure) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + httpOnly = try container.decode(Bool.self, forKey: .httpOnly) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cookie = try container.decode([String: Any].self, forKey: .cookie) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(domain, forKey: .domain) + + try? container.encodeIfPresent(maxAge, forKey: .maxAge) + + try? container.encodeIfPresent(secure, forKey: .secure) + + try? container.encodeIfPresent(httpOnly, forKey: .httpOnly) + + try? container.encodeIfPresent(cookie, forKey: .cookie) + } + } + + /* + Model: PlatformSchema + Used By: User + */ + class PlatformSchema: Codable { + public var display: String? + + public var lookAndFeel: LookAndFeel? + + public var updatedAt: String? + + public var active: Bool? + + public var forgotPassword: Bool? + + public var login: Login? + + public var skipCaptcha: Bool? + + public var name: String? + + public var meta: MetaSchema? + + public var id: String? + + public var social: Social? + + public var requiredFields: RequiredFields? + + public var registerRequiredFields: RegisterRequiredFields? + + public var skipLogin: Bool? + + public var flashCard: FlashCard? + + public var subtext: String? + + public var socialTokens: SocialTokens? + + public var createdAt: String? + + public var register: Bool? + + public var mobileImage: String? + + public var desktopImage: String? + + public enum CodingKeys: String, CodingKey { + case display + + case lookAndFeel = "look_and_feel" + + case updatedAt = "updated_at" + + case active + + case forgotPassword = "forgot_password" + + case login + + case skipCaptcha = "skip_captcha" + + case name + + case meta + + case id = "_id" + + case social + + case requiredFields = "required_fields" + + case registerRequiredFields = "register_required_fields" + + case skipLogin = "skip_login" + + case flashCard = "flash_card" + + case subtext + + case socialTokens = "social_tokens" + + case createdAt = "created_at" + + case register + + case mobileImage = "mobile_image" + + case desktopImage = "desktop_image" + } + + public init(active: Bool?, createdAt: String?, desktopImage: String?, display: String?, flashCard: FlashCard?, forgotPassword: Bool?, login: Login?, lookAndFeel: LookAndFeel?, meta: MetaSchema?, mobileImage: String?, name: String?, register: Bool?, registerRequiredFields: RegisterRequiredFields?, requiredFields: RequiredFields?, skipCaptcha: Bool?, skipLogin: Bool?, social: Social?, socialTokens: SocialTokens?, subtext: String?, updatedAt: String?, id: String?) { + self.display = display + + self.lookAndFeel = lookAndFeel + + self.updatedAt = updatedAt + + self.active = active + + self.forgotPassword = forgotPassword + + self.login = login + + self.skipCaptcha = skipCaptcha + + self.name = name + + self.meta = meta + + self.id = id + + self.social = social + + self.requiredFields = requiredFields + + self.registerRequiredFields = registerRequiredFields + + self.skipLogin = skipLogin + + self.flashCard = flashCard + + self.subtext = subtext + + self.socialTokens = socialTokens + + self.createdAt = createdAt + + self.register = register + + self.mobileImage = mobileImage + + self.desktopImage = desktopImage + } + + public func duplicate() -> PlatformSchema { + let dict = self.dictionary! + let copy = PlatformSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lookAndFeel = try container.decode(LookAndFeel.self, forKey: .lookAndFeel) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + forgotPassword = try container.decode(Bool.self, forKey: .forgotPassword) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + login = try container.decode(Login.self, forKey: .login) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + skipCaptcha = try container.decode(Bool.self, forKey: .skipCaptcha) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode(MetaSchema.self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + social = try container.decode(Social.self, forKey: .social) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requiredFields = try container.decode(RequiredFields.self, forKey: .requiredFields) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerRequiredFields = try container.decode(RegisterRequiredFields.self, forKey: .registerRequiredFields) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + skipLogin = try container.decode(Bool.self, forKey: .skipLogin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + flashCard = try container.decode(FlashCard.self, forKey: .flashCard) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subtext = try container.decode(String.self, forKey: .subtext) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + socialTokens = try container.decode(SocialTokens.self, forKey: .socialTokens) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + register = try container.decode(Bool.self, forKey: .register) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobileImage = try container.decode(String.self, forKey: .mobileImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + desktopImage = try container.decode(String.self, forKey: .desktopImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(lookAndFeel, forKey: .lookAndFeel) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(forgotPassword, forKey: .forgotPassword) + + try? container.encodeIfPresent(login, forKey: .login) + + try? container.encodeIfPresent(skipCaptcha, forKey: .skipCaptcha) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(social, forKey: .social) + + try? container.encodeIfPresent(requiredFields, forKey: .requiredFields) + + try? container.encodeIfPresent(registerRequiredFields, forKey: .registerRequiredFields) + + try? container.encodeIfPresent(skipLogin, forKey: .skipLogin) + + try? container.encodeIfPresent(flashCard, forKey: .flashCard) + + try? container.encodeIfPresent(subtext, forKey: .subtext) + + try? container.encodeIfPresent(socialTokens, forKey: .socialTokens) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(register, forKey: .register) + + try? container.encodeIfPresent(mobileImage, forKey: .mobileImage) + + try? container.encodeIfPresent(desktopImage, forKey: .desktopImage) + } + } + + /* + Model: LookAndFeel + Used By: User + */ + class LookAndFeel: Codable { + public var cardPosition: String? + + public var backgroundColor: String? + + public enum CodingKeys: String, CodingKey { + case cardPosition = "card_position" + + case backgroundColor = "background_color" + } + + public init(backgroundColor: String?, cardPosition: String?) { + self.cardPosition = cardPosition + + self.backgroundColor = backgroundColor + } + + public func duplicate() -> LookAndFeel { + let dict = self.dictionary! + let copy = LookAndFeel(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + cardPosition = try container.decode(String.self, forKey: .cardPosition) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + backgroundColor = try container.decode(String.self, forKey: .backgroundColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(cardPosition, forKey: .cardPosition) + + try? container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) + } + } + + /* + Model: Login + Used By: User + */ + class Login: Codable { + public var password: Bool? + + public var otp: Bool? + + public enum CodingKeys: String, CodingKey { + case password + + case otp + } + + public init(otp: Bool?, password: Bool?) { + self.password = password + + self.otp = otp + } + + public func duplicate() -> Login { + let dict = self.dictionary! + let copy = Login(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + password = try container.decode(Bool.self, forKey: .password) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + otp = try container.decode(Bool.self, forKey: .otp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(password, forKey: .password) + + try? container.encodeIfPresent(otp, forKey: .otp) + } + } + + /* + Model: MetaSchema + Used By: User + */ + class MetaSchema: Codable { + public var fyndDefault: Bool? + + public enum CodingKeys: String, CodingKey { + case fyndDefault = "fynd_default" + } + + public init(fyndDefault: Bool?) { + self.fyndDefault = fyndDefault + } + + public func duplicate() -> MetaSchema { + let dict = self.dictionary! + let copy = MetaSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + fyndDefault = try container.decode(Bool.self, forKey: .fyndDefault) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(fyndDefault, forKey: .fyndDefault) + } + } + + /* + Model: Social + Used By: User + */ + class Social: Codable { + public var accountKit: Bool? + + public var facebook: Bool? + + public var google: Bool? + + public var apple: Bool? + + public enum CodingKeys: String, CodingKey { + case accountKit = "account_kit" + + case facebook + + case google + + case apple + } + + public init(accountKit: Bool?, apple: Bool?, facebook: Bool?, google: Bool?) { + self.accountKit = accountKit + + self.facebook = facebook + + self.google = google + + self.apple = apple + } + + public func duplicate() -> Social { + let dict = self.dictionary! + let copy = Social(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + accountKit = try container.decode(Bool.self, forKey: .accountKit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + facebook = try container.decode(Bool.self, forKey: .facebook) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + google = try container.decode(Bool.self, forKey: .google) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + apple = try container.decode(Bool.self, forKey: .apple) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(accountKit, forKey: .accountKit) + + try? container.encodeIfPresent(facebook, forKey: .facebook) + + try? container.encodeIfPresent(google, forKey: .google) + + try? container.encodeIfPresent(apple, forKey: .apple) + } + } + + /* + Model: RequiredFields + Used By: User + */ + class RequiredFields: Codable { + public var email: PlatformEmail? + + public var mobile: PlatformMobile? + + public enum CodingKeys: String, CodingKey { + case email + + case mobile + } + + public init(email: PlatformEmail?, mobile: PlatformMobile?) { + self.email = email + + self.mobile = mobile + } + + public func duplicate() -> RequiredFields { + let dict = self.dictionary! + let copy = RequiredFields(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(PlatformEmail.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobile = try container.decode(PlatformMobile.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + } + } + + /* + Model: PlatformEmail + Used By: User + */ + class PlatformEmail: Codable { + public var isRequired: Bool? + + public var level: String? + + public enum CodingKeys: String, CodingKey { + case isRequired = "is_required" + + case level + } + + public init(isRequired: Bool?, level: String?) { + self.isRequired = isRequired + + self.level = level + } + + public func duplicate() -> PlatformEmail { + let dict = self.dictionary! + let copy = PlatformEmail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isRequired = try container.decode(Bool.self, forKey: .isRequired) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + level = try container.decode(String.self, forKey: .level) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isRequired, forKey: .isRequired) + + try? container.encodeIfPresent(level, forKey: .level) + } + } + + /* + Model: PlatformMobile + Used By: User + */ + class PlatformMobile: Codable { + public var isRequired: Bool? + + public var level: String? + + public enum CodingKeys: String, CodingKey { + case isRequired = "is_required" + + case level + } + + public init(isRequired: Bool?, level: String?) { + self.isRequired = isRequired + + self.level = level + } + + public func duplicate() -> PlatformMobile { + let dict = self.dictionary! + let copy = PlatformMobile(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isRequired = try container.decode(Bool.self, forKey: .isRequired) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + level = try container.decode(String.self, forKey: .level) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isRequired, forKey: .isRequired) + + try? container.encodeIfPresent(level, forKey: .level) + } + } + + /* + Model: RegisterRequiredFields + Used By: User + */ + class RegisterRequiredFields: Codable { + public var email: RegisterRequiredFieldsEmail? + + public var mobile: RegisterRequiredFieldsMobile? + + public enum CodingKeys: String, CodingKey { + case email + + case mobile + } + + public init(email: RegisterRequiredFieldsEmail?, mobile: RegisterRequiredFieldsMobile?) { + self.email = email + + self.mobile = mobile + } + + public func duplicate() -> RegisterRequiredFields { + let dict = self.dictionary! + let copy = RegisterRequiredFields(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(RegisterRequiredFieldsEmail.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobile = try container.decode(RegisterRequiredFieldsMobile.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + } + } + + /* + Model: RegisterRequiredFieldsEmail + Used By: User + */ + class RegisterRequiredFieldsEmail: Codable { + public var isRequired: Bool? + + public var level: String? + + public enum CodingKeys: String, CodingKey { + case isRequired = "is_required" + + case level + } + + public init(isRequired: Bool?, level: String?) { + self.isRequired = isRequired + + self.level = level + } + + public func duplicate() -> RegisterRequiredFieldsEmail { + let dict = self.dictionary! + let copy = RegisterRequiredFieldsEmail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isRequired = try container.decode(Bool.self, forKey: .isRequired) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + level = try container.decode(String.self, forKey: .level) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isRequired, forKey: .isRequired) + + try? container.encodeIfPresent(level, forKey: .level) + } + } + + /* + Model: RegisterRequiredFieldsMobile + Used By: User + */ + class RegisterRequiredFieldsMobile: Codable { + public var isRequired: Bool? + + public var level: String? + + public enum CodingKeys: String, CodingKey { + case isRequired = "is_required" + + case level + } + + public init(isRequired: Bool?, level: String?) { + self.isRequired = isRequired + + self.level = level + } + + public func duplicate() -> RegisterRequiredFieldsMobile { + let dict = self.dictionary! + let copy = RegisterRequiredFieldsMobile(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isRequired = try container.decode(Bool.self, forKey: .isRequired) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + level = try container.decode(String.self, forKey: .level) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isRequired, forKey: .isRequired) + + try? container.encodeIfPresent(level, forKey: .level) + } + } + + /* + Model: FlashCard + Used By: User + */ + class FlashCard: Codable { + public var text: String? + + public var textColor: String? + + public var backgroundColor: String? + + public enum CodingKeys: String, CodingKey { + case text + + case textColor = "text_color" + + case backgroundColor = "background_color" + } + + public init(backgroundColor: String?, text: String?, textColor: String?) { + self.text = text + + self.textColor = textColor + + self.backgroundColor = backgroundColor + } + + public func duplicate() -> FlashCard { + let dict = self.dictionary! + let copy = FlashCard(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + text = try container.decode(String.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + textColor = try container.decode(String.self, forKey: .textColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + backgroundColor = try container.decode(String.self, forKey: .backgroundColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(textColor, forKey: .textColor) + + try? container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) + } + } + + /* + Model: SocialTokens + Used By: User + */ + class SocialTokens: Codable { + public var facebook: Facebook? + + public var accountKit: Accountkit? + + public var google: Google? + + public enum CodingKeys: String, CodingKey { + case facebook + + case accountKit = "account_kit" + + case google + } + + public init(accountKit: Accountkit?, facebook: Facebook?, google: Google?) { + self.facebook = facebook + + self.accountKit = accountKit + + self.google = google + } + + public func duplicate() -> SocialTokens { + let dict = self.dictionary! + let copy = SocialTokens(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + facebook = try container.decode(Facebook.self, forKey: .facebook) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + accountKit = try container.decode(Accountkit.self, forKey: .accountKit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + google = try container.decode(Google.self, forKey: .google) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(facebook, forKey: .facebook) + + try? container.encodeIfPresent(accountKit, forKey: .accountKit) + + try? container.encodeIfPresent(google, forKey: .google) + } + } + + /* + Model: Facebook + Used By: User + */ + class Facebook: Codable { + public var appId: String? + + public enum CodingKeys: String, CodingKey { + case appId = "app_id" + } + + public init(appId: String?) { + self.appId = appId + } + + public func duplicate() -> Facebook { + let dict = self.dictionary! + let copy = Facebook(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appId, forKey: .appId) + } + } + + /* + Model: Accountkit + Used By: User + */ + class Accountkit: Codable { + public var appId: String? + + public enum CodingKeys: String, CodingKey { + case appId = "app_id" + } + + public init(appId: String?) { + self.appId = appId + } + + public func duplicate() -> Accountkit { + let dict = self.dictionary! + let copy = Accountkit(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appId, forKey: .appId) + } + } + + /* + Model: Google + Used By: User + */ + class Google: Codable { + public var appId: String? + + public enum CodingKeys: String, CodingKey { + case appId = "app_id" + } + + public init(appId: String?) { + self.appId = appId + } + + public func duplicate() -> Google { + let dict = self.dictionary! + let copy = Google(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appId, forKey: .appId) + } + } + + /* + Model: UpdateUserRequestSchema + Used By: User + */ + class UpdateUserRequestSchema: Codable { + public var firstName: String? + + public var lastName: String? + + public var gender: String? + + public var meta: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case firstName = "first_name" + + case lastName = "last_name" + + case gender + + case meta + } + + public init(firstName: String?, gender: String?, lastName: String?, meta: [String: Any]?) { + self.firstName = firstName + + self.lastName = lastName + + self.gender = gender + + self.meta = meta + } + + public func duplicate() -> UpdateUserRequestSchema { + let dict = self.dictionary! + let copy = UpdateUserRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gender = try container.decode(String.self, forKey: .gender) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(gender, forKey: .gender) + + try? container.encodeIfPresent(meta, forKey: .meta) + } + } + + /* + Model: UserSchema + Used By: User + */ + class UserSchema: Codable { + public var firstName: String? + + public var meta: [String: Any]? + + public var lastName: String? + + public var phoneNumbers: [PhoneNumber]? + + public var emails: [Email]? + + public var gender: String? + + public var dob: String? + + public var active: Bool? + + public var profilePicUrl: String? + + public var username: String? + + public var accountType: String? + + public var uid: String? + + public var debug: Debug? + + public var hasOldPasswordHash: Bool? + + public var id: String? + + public var createdAt: String? + + public var updatedAt: String? + + public enum CodingKeys: String, CodingKey { + case firstName = "first_name" + + case meta + + case lastName = "last_name" + + case phoneNumbers = "phone_numbers" + + case emails + + case gender + + case dob + + case active + + case profilePicUrl = "profile_pic_url" + + case username + + case accountType = "account_type" + + case uid + + case debug + + case hasOldPasswordHash = "has_old_password_hash" + + case id = "_id" + + case createdAt = "created_at" + + case updatedAt = "updated_at" + } + + public init(accountType: String?, active: Bool?, createdAt: String?, debug: Debug?, dob: String?, emails: [Email]?, firstName: String?, gender: String?, hasOldPasswordHash: Bool?, lastName: String?, meta: [String: Any]?, phoneNumbers: [PhoneNumber]?, profilePicUrl: String?, uid: String?, updatedAt: String?, username: String?, id: String?) { + self.firstName = firstName + + self.meta = meta + + self.lastName = lastName + + self.phoneNumbers = phoneNumbers + + self.emails = emails + + self.gender = gender + + self.dob = dob + + self.active = active + + self.profilePicUrl = profilePicUrl + + self.username = username + + self.accountType = accountType + + self.uid = uid + + self.debug = debug + + self.hasOldPasswordHash = hasOldPasswordHash + + self.id = id + + self.createdAt = createdAt + + self.updatedAt = updatedAt + } + + public func duplicate() -> UserSchema { + let dict = self.dictionary! + let copy = UserSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phoneNumbers = try container.decode([PhoneNumber].self, forKey: .phoneNumbers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + emails = try container.decode([Email].self, forKey: .emails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gender = try container.decode(String.self, forKey: .gender) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dob = try container.decode(String.self, forKey: .dob) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + profilePicUrl = try container.decode(String.self, forKey: .profilePicUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + accountType = try container.decode(String.self, forKey: .accountType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + debug = try container.decode(Debug.self, forKey: .debug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasOldPasswordHash = try container.decode(Bool.self, forKey: .hasOldPasswordHash) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(phoneNumbers, forKey: .phoneNumbers) + + try? container.encodeIfPresent(emails, forKey: .emails) + + try? container.encodeIfPresent(gender, forKey: .gender) + + try? container.encodeIfPresent(dob, forKey: .dob) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(profilePicUrl, forKey: .profilePicUrl) + + try? container.encodeIfPresent(username, forKey: .username) + + try? container.encodeIfPresent(accountType, forKey: .accountType) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(debug, forKey: .debug) + + try? container.encodeIfPresent(hasOldPasswordHash, forKey: .hasOldPasswordHash) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + } + } +} diff --git a/Sources/code/common/AlmofireHelper.swift b/Sources/code/common/AlmofireHelper.swift index 5266015a7e..25ced69ff3 100644 --- a/Sources/code/common/AlmofireHelper.swift +++ b/Sources/code/common/AlmofireHelper.swift @@ -3,30 +3,31 @@ import Foundation public typealias OnResponse = (_ responseData: Data?, _ error: Swift.Error?, _ responseCode: Int?) -> Void -class AlmofireHelper { - static func request(_ path: String, - query: [String: Any]? = nil, - parameters: [String: Any]?, - type rawType: String, - headers: [(key: String, value: String)] = [], - isJsonEncoding: Bool = true, - responseType: String = "application/json", - onResponse: @escaping OnResponse) { +public enum AlmofireHelper { + public static func request(_ path: String, + query: [String: Any]? = nil, + parameters: [String: Any]?, + type rawType: String, + headers: [(key: String, value: String)] = [], + isJsonEncoding: Bool = true, + responseType: String = "application/json", + onResponse: @escaping OnResponse) + { var queryString = "" if let query = query { queryString = "?" + query.asQueryString } let urlString = path + queryString - + let signer = RequestSigner(url: urlString, reqData: parameters, type: rawType, headers: headers) let signedHeaders = signer.sign() - + var finalHeaders = HTTPHeaders() - signedHeaders.forEach { (key, value) in + signedHeaders.forEach { key, value in finalHeaders.add(name: key, value: value) } - let encoding :ParameterEncoding + let encoding: ParameterEncoding if isJsonEncoding { encoding = JSONEncoding.default } else { @@ -54,30 +55,30 @@ class AlmofireHelper { // } // } // } - if (responseType == "application/octet-stream" || responseType == "application/csv" || responseType == "text/csv" || responseType == "application/pdf") { + if responseType == "application/octet-stream" || responseType == "application/csv" || responseType == "text/csv" || responseType == "application/pdf" { AF.request(urlString, method: HTTPMethod(rawValue: rawType), parameters: parameters, encoding: encoding, headers: finalHeaders).validate() .responseString { response in - print(response.request?.curlString ?? "No Request !!!") - switch response.result { - case .success(_): - if rawType == "head" { - onResponse(response.response?.allHeaderFields.data, nil, response.response?.statusCode) - } else { - if let data = response.data { - onResponse(data, nil, response.response?.statusCode) + print(response.request?.curlString ?? "No Request !!!") + switch response.result { + case .success: + if rawType == "head" { + onResponse(response.response?.allHeaderFields.data, nil, response.response?.statusCode) } else { - onResponse(nil, nil, response.response?.statusCode) + if let data = response.data { + onResponse(data, nil, response.response?.statusCode) + } else { + onResponse(nil, nil, response.response?.statusCode) + } } + case .failure(let error): + onResponse(response.data, error, error.asAFError?.responseCode) } - case .failure(let error): - onResponse(response.data, error, error.asAFError?.responseCode) } - } } else { AF.request(urlString, method: HTTPMethod(rawValue: rawType), parameters: parameters, encoding: encoding, headers: finalHeaders).validate().responseJSON { response in print(response.request?.curlString ?? "No Request !!!") switch response.result { - case .success(_): + case .success: if rawType == "head" { onResponse(response.response?.allHeaderFields.data, nil, response.response?.statusCode) } else { @@ -89,20 +90,20 @@ class AlmofireHelper { } } } - + static func getTempPath(fileExtension: String) -> DownloadRequest.Destination { let destinationPath: DownloadRequest.Destination = { _, _ in - let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]; + let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] let fileURL = documentsURL.appendingPathComponent("\(UUID().uuidString).\(fileExtension)") return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) } return destinationPath } - + private static func getExtension(from type: String) -> String { let mapping = ["application/pdf": "pdf", "application/csv": "csv", "text/csv": "csv"] return mapping[type] ?? "txt" } -} \ No newline at end of file +} diff --git a/Sources/code/common/CryptoAlgorithm.swift b/Sources/code/common/CryptoAlgorithm.swift index b66a61c3ab..b028c44bf1 100644 --- a/Sources/code/common/CryptoAlgorithm.swift +++ b/Sources/code/common/CryptoAlgorithm.swift @@ -38,7 +38,7 @@ // } // return "" // } - + // func hmac(algorithm: CryptoAlgorithm, key: String) -> String { // let str = self.cString(using: String.Encoding.utf8) // let strLen = Int(self.lengthOfBytes(using: String.Encoding.utf8)) @@ -65,14 +65,14 @@ // public func sha256() -> String { // return hexStringFromData(input: digest(input: self as NSData)) // } - + // private func digest(input: NSData) -> NSData { // let digestLength = Int(CC_SHA256_DIGEST_LENGTH) // var hash = [UInt8](repeating: 0, count: digestLength) // CC_SHA256(input.bytes, UInt32(input.length), &hash) // return NSData(bytes: hash, length: digestLength) // } - + // private func hexStringFromData(input: NSData) -> String { // var bytes = [UInt8](repeating: 0, count: input.length) // input.getBytes(&bytes, length: input.length) diff --git a/Sources/code/common/Extensions.swift b/Sources/code/common/Extensions.swift index 717f515cad..1d269dff7b 100644 --- a/Sources/code/common/Extensions.swift +++ b/Sources/code/common/Extensions.swift @@ -1,30 +1,57 @@ import Foundation #if canImport(FoundationNetworking) -import FoundationNetworking + import FoundationNetworking #endif extension String { func trim() -> String { - return self.trimmingCharacters(in: .whitespacesAndNewlines) + self.trimmingCharacters(in: .whitespacesAndNewlines) } var asBase64: String { - return Data(self.utf8).base64EncodedString() + Data(self.utf8).base64EncodedString() } var urlEncoded: String { - return addingPercentEncoding(withAllowedCharacters: .afURLQueryAllowed) ?? self + addingPercentEncoding(withAllowedCharacters: .afURLQueryAllowed) ?? self } func appendAsPath(_ path: String) -> String { var pathToJoin = path - if (self.last == "/" && path.first == "/") { + if self.last == "/", path.first == "/" { pathToJoin.removeFirst() - } else if (self.last != "/" && path.first != "/") { + } else if self.last != "/", path.first != "/" { pathToJoin = "/" + pathToJoin } return self + pathToJoin } + + func classFromString() -> AnyClass! { + /// get namespace + let namespace = Bundle.main.infoDictionary!["CFBundleExecutable"] as! String + + /// get 'anyClass' with classname and namespace + let cls: AnyClass = NSClassFromString("\(namespace).\(self)")! + + // return AnyClass! + return cls + } +} + +extension Array { + func getIfExists(index: Int) -> Element? { + if count > index { + return self[index] + } + return nil + } + + mutating func removeIfExists(index: Int) -> Element? { + if count > index { + return remove(at: index) + } + return nil + } } extension Decodable { @@ -44,16 +71,16 @@ extension Decodable { public extension Data { var dictionary: [String: Any]? { - return try? JSONSerialization.jsonObject(with: self, options: []) as? [String: Any] + try? JSONSerialization.jsonObject(with: self, options: []) as? [String: Any] } } public extension Dictionary { var data: Data? { - return try? JSONSerialization.data(withJSONObject: self, options: .prettyPrinted) + try? JSONSerialization.data(withJSONObject: self, options: .prettyPrinted) } - var pretty: String { + var minifiedJson: String { do { let jsonData = try JSONSerialization.data(withJSONObject: self, options: []) guard let jsonString = String(data: jsonData, encoding: String.Encoding.utf8) else { @@ -68,62 +95,58 @@ public extension Dictionary { } var asQueryString: String { - get { - let paramKeys = Array(self.keys) - var queries: [String] = [] - for keyIndex in paramKeys.indices { - let key = paramKeys[keyIndex] - let value = self[key] - if let valueDict = value as? [String: Any] { - //TODO: check dict implementation for signing - if let jsonData = try? JSONSerialization.data(withJSONObject: valueDict, - options: JSONSerialization.WritingOptions(rawValue: 0)) { - let jsonString = (String(data: jsonData, encoding: .utf8) ?? "{}") - .addingPercentEncoding(withAllowedCharacters: .afURLQueryAllowed) ?? "" - queries.append("\(key)=\(jsonString)") + let paramKeys = Array(self.keys) + var queries: [String] = [] + for keyIndex in paramKeys.indices { + let key = paramKeys[keyIndex] + let value = self[key] + if let valueDict = value as? [String: Any] { + // TODO: check dict implementation for signing + if let jsonData = try? JSONSerialization.data(withJSONObject: valueDict, + options: JSONSerialization.WritingOptions(rawValue: 0)) + { + let jsonString = (String(data: jsonData, encoding: .utf8) ?? "{}") + .addingPercentEncoding(withAllowedCharacters: .afURLQueryAllowed) ?? "" + queries.append("\(key)=\(jsonString)") + } else { + queries.append("\(key)=\("{}".addingPercentEncoding(withAllowedCharacters: .afURLQueryAllowed) ?? "")") + } + } else if let valueArray = value as? [Any] { + for value1 in valueArray { + if let strValue = value1 as? String { + queries.append("\(key)=\(strValue.addingPercentEncoding(withAllowedCharacters: .afURLQueryAllowed) ?? "")") } else { - queries.append("\(key)=\("{}".addingPercentEncoding(withAllowedCharacters: .afURLQueryAllowed) ?? "")") + queries.append("\(key)=\(value1)") } - } else if let valueArray = value as? [Any] { - for value1 in valueArray { - if let strValue = value1 as? String { - queries.append("\(key)=\(strValue.addingPercentEncoding(withAllowedCharacters: .afURLQueryAllowed) ?? "")") - } else { - queries.append("\(key)=\(value1)") - } - } - } else if let value1 = value as? String { - queries.append("\(key)=\(value1.addingPercentEncoding(withAllowedCharacters: .afURLQueryAllowed) ?? "")") - } else if let value = value { - queries.append("\(key)=\(value)") } + } else if let value1 = value as? String { + queries.append("\(key)=\(value1.addingPercentEncoding(withAllowedCharacters: .afURLQueryAllowed) ?? "")") + } else if let value = value { + queries.append("\(key)=\(value)") } - queries.sort() - return queries.joined(separator: "&") } + queries.sort() + return queries.joined(separator: "&") } var asSolrString: String { - get { - var queryStrings: [String] = [] - self.keys.forEach { (key) in - guard let keyString = key as? String else { return } - var valueString: String? = nil - if let values = self[key] as? [Any] { - valueString = values.map{ "\($0)" }.joined(separator: "||") - } else if let valueOfKey = self[key] { - valueString = "\(valueOfKey)" - } - if let valueString = valueString { - queryStrings.append("\(keyString):\(valueString)") - } + var queryStrings: [String] = [] + self.keys.forEach { key in + guard let keyString = key as? String else { return } + var valueString: String? + if let values = self[key] as? [Any] { + valueString = values.map { "\($0)" }.joined(separator: "||") + } else if let valueOfKey = self[key] { + valueString = "\(valueOfKey)" + } + if let valueString = valueString { + queryStrings.append("\(keyString):\(valueString)") } - return queryStrings.joined(separator: ":::") } + return queryStrings.joined(separator: ":::") } } - extension Encodable { var dictionary: [String: Any]? { let encoder = JSONEncoder() @@ -138,7 +161,7 @@ extension KeyedDecodingContainer { return try container.decode(type) } - func decode(_ type: [[String: Any]].Type, forKey key: K) throws -> [[String: Any]] { + func decode(_: [[String: Any]].Type, forKey key: K) throws -> [[String: Any]] { var container = try self.nestedUnkeyedContainer(forKey: key) if let decodedData = try container.decode([Any].self) as? [[String: Any]] { return decodedData @@ -172,7 +195,7 @@ extension KeyedDecodingContainer { return try decode(type, forKey: key) } - func decode(_ type: [String: Any].Type) throws -> [String: Any] { + func decode(_: [String: Any].Type) throws -> [String: Any] { var dictionary = [String: Any]() for key in allKeys { @@ -184,9 +207,9 @@ extension KeyedDecodingContainer { dictionary[key.stringValue] = intValue } else if let doubleValue = try? decode(Double.self, forKey: key) { dictionary[key.stringValue] = doubleValue - } else if let nestedDictionary = try? decode(Dictionary.self, forKey: key) { + } else if let nestedDictionary = try? decode([String: Any].self, forKey: key) { dictionary[key.stringValue] = nestedDictionary - } else if let nestedArray = try? decode(Array.self, forKey: key) { + } else if let nestedArray = try? decode([Any].self, forKey: key) { dictionary[key.stringValue] = nestedArray } } @@ -195,7 +218,7 @@ extension KeyedDecodingContainer { } extension UnkeyedDecodingContainer { - mutating func decode(_ type: [Any].Type) throws -> [Any] { + mutating func decode(_: [Any].Type) throws -> [Any] { var array: [Any] = [] while isAtEnd == false { // See if the current value in the JSON array is `null` first and prevent infite recursion with nested arrays. @@ -207,9 +230,9 @@ extension UnkeyedDecodingContainer { array.append(value) } else if let value = try? decode(String.self) { array.append(value) - } else if let nestedDictionary = try? decode(Dictionary.self) { + } else if let nestedDictionary = try? decode([String: Any].self) { array.append(nestedDictionary) - } else if let nestedArray = try? decode(Array.self) { + } else if let nestedArray = try? decode([Any].self) { array.append(nestedArray) } } @@ -223,30 +246,33 @@ extension UnkeyedDecodingContainer { } extension KeyedEncodingContainer { - - mutating func encode(_ value: [String: Any], forKey key: KeyedEncodingContainer.Key) throws { + mutating func encode(_ value: [String: Any]?, forKey key: KeyedEncodingContainer.Key) throws { var container = self.nestedContainer(keyedBy: JSONCodingKeys.self, forKey: key) - for item in value { - if let val = item.value as? Int { - try container.encode(val, forKey: JSONCodingKeys(stringValue: item.key)!) - } else if let val = item.value as? String { - try container.encode(val, forKey: JSONCodingKeys(stringValue: item.key)!) - } else if let val = item.value as? Double { - try container.encode(val, forKey: JSONCodingKeys(stringValue: item.key)!) - } else if let val = item.value as? Float { - try container.encode(val, forKey: JSONCodingKeys(stringValue: item.key)!) - } else if let val = item.value as? Bool { - try container.encode(val, forKey: JSONCodingKeys(stringValue: item.key)!) - } else if let val = item.value as? [Any] { - try container.encode(val, forKey: JSONCodingKeys(stringValue: item.key)!) - } else if let val = item.value as? [String: Any] { - try container.encode(val, forKey: JSONCodingKeys(stringValue: item.key)!) - } else { - try self.encodeNil(forKey: key) + if let value = value { + for item in value { + if let val = item.value as? Int { + try container.encode(val, forKey: JSONCodingKeys(stringValue: item.key)!) + } else if let val = item.value as? String { + try container.encode(val, forKey: JSONCodingKeys(stringValue: item.key)!) + } else if let val = item.value as? Double { + try container.encode(val, forKey: JSONCodingKeys(stringValue: item.key)!) + } else if let val = item.value as? Float { + try container.encode(val, forKey: JSONCodingKeys(stringValue: item.key)!) + } else if let val = item.value as? Bool { + try container.encode(val, forKey: JSONCodingKeys(stringValue: item.key)!) + } else if let val = item.value as? [Any] { + try container.encode(val, forKey: JSONCodingKeys(stringValue: item.key)!) + } else if let val = item.value as? [String: Any] { + try container.encode(val, forKey: JSONCodingKeys(stringValue: item.key)!) + } else { + try self.encodeNil(forKey: key) + } } + } else { + try self.encodeNil(forKey: key) } } - + mutating func encodeIfPresent(_ value: [String: Any]?, forKey key: KeyedEncodingContainer.Key) throws { guard let safeValue = value, !safeValue.isEmpty else { return @@ -270,7 +296,7 @@ extension KeyedEncodingContainer { } } } - + mutating func encodeIfPresent(_ value: [Any]?, forKey key: KeyedEncodingContainer.Key) throws { guard let safeValue = value else { return @@ -290,8 +316,8 @@ extension KeyedEncodingContainer { try container.encode(contentsOf: val) } } - - mutating func encode(_ value: [Any], forKey key: KeyedEncodingContainer.Key) throws { + + mutating func encode(_ value: [Any]?, forKey key: KeyedEncodingContainer.Key) throws { if let val = value as? [Int] { try self.encode(val, forKey: key) } else if let val = value as? [String] { @@ -317,7 +343,7 @@ extension UnkeyedEncodingContainer { try self.encode(dict) } } - + mutating func encode(_ value: [String: Any]) throws { var container = self.nestedContainer(keyedBy: JSONCodingKeys.self) for item in value { @@ -340,8 +366,8 @@ extension UnkeyedEncodingContainer { } } -class Utility { - static func decode(_ decodable: T.Type, from data: Data) -> T? where T: Decodable { +enum Utility { + static func decode(_: T.Type, from data: Data) -> T? where T: Decodable { var decodedData: T? do { decodedData = try JSONDecoder().decode(T.self, from: data) @@ -378,30 +404,30 @@ struct JSONCodingKeys: CodingKey { } } -extension URLRequest { +public extension URLRequest { /** Returns a cURL command representation of this URL request. */ - public var curlString: String { + var curlString: String { guard let url = url else { return "" } var baseCommand = "curl '\(url.absoluteString)'" - + if httpMethod == "HEAD" { baseCommand += " --head" } - + var command = [baseCommand] - - if let method = httpMethod, method != "GET" && method != "HEAD" { + + if let method = httpMethod, method != "GET", method != "HEAD" { command.append("-X \(method)") } - + if let headers = allHTTPHeaderFields { for (key, value) in headers { command.append("-H '\(key): \(value)'") } } - + if let cookies = HTTPCookieStorage.shared.cookies(for: url) { var cookiesString = [String]() for (index, cookie) in cookies.enumerated() { @@ -409,19 +435,19 @@ extension URLRequest { cookiesString.append("-H 'Cookie: ") } if index == cookies.count - 1 { - cookiesString.append("\(cookie.name )=\(cookie.value)'") + cookiesString.append("\(cookie.name)=\(cookie.value)'") } else { - cookiesString.append("\(cookie.name )=\(cookie.value); ") + cookiesString.append("\(cookie.name)=\(cookie.value); ") } } let strCookie = cookiesString.joined() command.append(strCookie) } - + if let data = httpBody, let body = String(data: data, encoding: .utf8) { command.append("-d '\(body)'") } - + return command.joined(separator: " \\\n\t") } } diff --git a/Sources/code/common/FDKError.swift b/Sources/code/common/FDKError.swift index 36cf6201a6..280b5be0d2 100644 --- a/Sources/code/common/FDKError.swift +++ b/Sources/code/common/FDKError.swift @@ -1,8 +1,7 @@ import Foundation public struct FDKError: Codable { - public let message: String - public var status: Int? + public var status: Int? public let code: String? public let exception: String? public let info: String? @@ -11,22 +10,20 @@ public struct FDKError: Codable { public let meta: [String: Any]? enum CodingKeys: String, CodingKey { - - case message = "message" - case status = "status" - case code = "code" - case exception = "exception" - case info = "info" + case message + case status + case code + case exception + case info case requestID = "request_id" case stackTrace = "stack_trace" - case meta = "meta" - - + case meta } public init(message: String, status: Int?, code: String?, exception: String?, info: String?, requestID: String?, - stackTrace: String?, meta: [String: Any]?) { + stackTrace: String?, meta: [String: Any]?) + { self.message = message self.status = status self.code = code @@ -50,35 +47,35 @@ public struct FDKError: Codable { public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - + if let value = try? container.decode(String.self, forKey: .message) { message = value } else { message = "Something went wrong [sdk]" } - + status = try? container.decode(Int.self, forKey: .status) code = try? container.decode(String.self, forKey: .code) - + exception = try? container.decode(String.self, forKey: .exception) - + info = try? container.decode(String.self, forKey: .info) - + requestID = try? container.decode(String.self, forKey: .requestID) - + stackTrace = try? container.decode(String.self, forKey: .stackTrace) - + meta = try? container.decode([String: Any].self, forKey: .meta) } - + public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - + try? container.encodeIfPresent(message, forKey: .message) - + try? container.encodeIfPresent(status, forKey: .status) - + try? container.encodeIfPresent(code, forKey: .code) try? container.encodeIfPresent(exception, forKey: .exception) diff --git a/Sources/code/common/Paginator.swift b/Sources/code/common/Paginator.swift index ec6e7cad97..d985ed5c68 100644 --- a/Sources/code/common/Paginator.swift +++ b/Sources/code/common/Paginator.swift @@ -17,12 +17,12 @@ public class Paginator { self.pageNo = 1 } } - + public func next(onResponse: @escaping (_ response: T?, _ error: FDKError?) -> Void) { self.onNext = onResponse self.onPage?() } - + public func reset() { hasNext = true if type == "cursor" { diff --git a/Sources/code/common/RequestSigner.swift b/Sources/code/common/RequestSigner.swift index 062c6faa2f..90061a28b2 100644 --- a/Sources/code/common/RequestSigner.swift +++ b/Sources/code/common/RequestSigner.swift @@ -1,23 +1,23 @@ -import Foundation import CryptoSwift +import Foundation class RequestSigner { - //Constants + // Constants private let signingkey = "1234567" - ///regex of headers to be included (compare with lowercased) + /// regex of headers to be included (compare with lowercased) private let HEADERS_TO_INCLUDE = [ "host", "x\\-fp\\-.*" ] - //Properties + // Properties private let url: String private let reqData: [String: Any]? private let headers: [(key: String, value: String)] private let type: String private let dateStr: String private let components: URLComponents? - + init(url: String, reqData: [String: Any]?, type: String, headers: [(key: String, value: String)]) { self.url = url self.reqData = reqData @@ -29,36 +29,38 @@ class RequestSigner { dateformatter.timeZone = TimeZone(secondsFromGMT: 0) self.dateStr = dateformatter.string(from: Date()) } - + func sign() -> [(key: String, value: String)] { var finalHeaders = headers guard let components = self.components else { return finalHeaders } finalHeaders.append((key: "host", value: components.host ?? "api.fynd.com")) finalHeaders.append((key: "x-fp-date", value: dateStr)) + finalHeaders = finalHeaders.sorted { $0.key < $1.key } var reqHash = "".sha256() if let data = reqData { - reqHash = data.pretty.sha256() + reqHash = data.minifiedJson.sha256() } - let releventSignHeaders = finalHeaders.filter({ header -> Bool in + let releventSignHeaders = finalHeaders.filter { header -> Bool in for regex in HEADERS_TO_INCLUDE - where header.key.lowercased().range(of: regex, options: .regularExpression) != nil { + where header.key.lowercased().range(of: regex, options: .regularExpression) != nil + { return true } return false - }) + } let signingData: [String] = [type, components.percentEncodedPath, components.query?.trim() ?? "", - releventSignHeaders.reduce("", {"\($0.isEmpty ? "" : ($0+"\n"))\($1.key):\($1.value)"}) + "\n", - releventSignHeaders.reduce("", {"\($0.isEmpty ? "" : ($0+";"))\($1.key)"}), + releventSignHeaders.reduce("") { "\($0.isEmpty ? "" : ($0 + "\n"))\($1.key):\($1.value)" } + "\n", + releventSignHeaders.reduce("") { "\($0.isEmpty ? "" : ($0 + ";"))\($1.key)" }, reqHash] let finalSignatureData = [dateStr, signingData.joined(separator: "\n").sha256()] let signatureStr = finalSignatureData.joined(separator: "\n") let signature = try? HMAC(key: signingkey, variant: .sha256).authenticate(signatureStr.bytes).toHexString() - //let signature = signatureStr.hmac(algorithm: .SHA256, key: signingkey) + // let signature = signatureStr.hmac(algorithm: .SHA256, key: signingkey) if let hmacSignature = signature { - finalHeaders.append((key: "x-fp-signature", value: "v1:\(hmacSignature)")) + finalHeaders.append((key: "x-fp-signature", value: "v1.1:\(hmacSignature)")) } return finalHeaders } diff --git a/Sources/code/platform/PlatformAPIClient.swift b/Sources/code/platform/PlatformAPIClient.swift index dfa892eed6..70e2120c9e 100644 --- a/Sources/code/platform/PlatformAPIClient.swift +++ b/Sources/code/platform/PlatformAPIClient.swift @@ -1,25 +1,38 @@ import Foundation -public class PlatformAPIClient { +public enum PlatformAPIClient { public static func execute(config: PlatformConfig, - method: String, - url: String, - query: [String: Any]?, - body: [String: Any]?, - headers: [(key: String, - value: String)] = [], - responseType: String = "application/json", - onResponse: @escaping OnResponse) { - config.oauthClient.getAccessToken { (token) in + method: String, + url: String, + query: [String: Any]?, + body: [String: Any]?, + headers: [(key: String, + value: String)] = [], + responseType: String = "application/json", + onResponse: @escaping OnResponse) + { + config.oauthClient.getAccessToken { token in if let token = token { var finalHeaders = headers finalHeaders.append((key: "Authorization", value: "Bearer " + token.accessToken)) + finalHeaders.append((key: "x-fp-sdk-version", value: "0.1.15")) + finalHeaders.append(contentsOf: config.extraHeaders) + if let userAgent = config.userAgent { + finalHeaders.append((key: "User-Agent", value: userAgent)) + } + if let language = config.language { + finalHeaders.append((key: "Accept-Language", value: language)) + } + if let currency = config.currency { + finalHeaders.append((key: "x-currency-code", value: currency)) + } + AlmofireHelper.request(config.domain.appendAsPath(url), - query: query, - parameters: body, - type: method, - headers: finalHeaders, - responseType: responseType, - onResponse: onResponse) + query: query, + parameters: body, + type: method, + headers: finalHeaders, + responseType: responseType, + onResponse: onResponse) } else { onResponse(nil, NSError(domain: "No Token", code: 0, userInfo: nil), 0) } diff --git a/Sources/code/platform/PlatformClient.swift b/Sources/code/platform/PlatformClient.swift index 493845762e..1e1de6225c 100644 --- a/Sources/code/platform/PlatformClient.swift +++ b/Sources/code/platform/PlatformClient.swift @@ -35,39 +35,37 @@ public class PlatformClient { public init(config: PlatformConfig) { self.config = config - + common = Common(config: config) - + lead = Lead(config: config) - + billing = Billing(config: config) - + communication = Communication(config: config) - + payment = Payment(config: config) - + order = Order(config: config) - + catalog = Catalog(config: config) - + companyProfile = CompanyProfile(config: config) - + fileStorage = FileStorage(config: config) - + inventory = Inventory(config: config) - + configuration = Configuration(config: config) - + analytics = Analytics(config: config) - + discount = Discount(config: config) - + webhook = Webhook(config: config) - } - - - public class Common { + + public class Common { var config: PlatformConfig var companyId: String @@ -75,40 +73,79 @@ public class PlatformClient { self.config = config self.companyId = config.companyId } - - - - + /** - * - * Summary: Get countries, states, cities - * Description: - **/ - public func getLocations( - locationType: String?, - id: String?, - - onResponse: @escaping (_ response: Locations?, _ error: FDKError?) -> Void + * + * Summary: Search Application + * Description: Provide application name or domain url + **/ + public func searchApplication( + authorization: String?, + query: String?, + + onResponse: @escaping (_ response: ApplicationResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = locationType { - - xQuery["location_type"] = value - -} + if let value = query { + xQuery["query"] = value + } + var xHeaders: [(key: String, value: String)] = [] -if let value = id { - - xQuery["id"] = value - -} + if let value = authorization { + xHeaders.append((key: "authorization", value: value)) + } + + PlatformAPIClient.execute( + config: config, + method: "get", + url: "/service/common/configuration/v1.0/application/search-application", + query: xQuery, + body: nil, + headers: xHeaders, + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(ApplicationResponse.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Get countries, states, cities + * Description: + **/ + public func getLocations( + locationType: String?, + id: String?, + onResponse: @escaping (_ response: Locations?, _ error: FDKError?) -> Void + ) { + var xQuery: [String: Any] = [:] - + if let value = locationType { + xQuery["location_type"] = value + } + if let value = id { + xQuery["id"] = value + } PlatformAPIClient.execute( config: config, @@ -118,7 +155,7 @@ if let value = id { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -126,25 +163,21 @@ if let value = id { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Locations.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - - public class Lead { + + public class Lead { var config: PlatformConfig var companyId: String @@ -152,15 +185,12 @@ if let value = id { self.config = config self.companyId = config.companyId } - - - - + /** - * - * Summary: Gets the list of company level tickets and/or ticket filters depending on query params - * Description: Gets the list of company level tickets and/or ticket filters - **/ + * + * Summary: Gets the list of company level tickets and/or ticket filters depending on query params + * Description: Gets the list of company level tickets and/or ticket filters + **/ public func getTickets( items: Bool?, filters: Bool?, @@ -170,70 +200,42 @@ if let value = id { category: String?, pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: TicketList?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = items { - - xQuery["items"] = value - -} - - -if let value = filters { - - xQuery["filters"] = value - -} - - -if let value = q { - - xQuery["q"] = value - -} - - -if let value = status { - - xQuery["status"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = priority { - - xQuery["priority"] = value.rawValue - -} - - -if let value = category { - - xQuery["category"] = value - -} + if let value = items { + xQuery["items"] = value + } + if let value = filters { + xQuery["filters"] = value + } -if let value = pageNo { - - xQuery["page_no"] = value - -} + if let value = q { + xQuery["q"] = value + } + if let value = status { + xQuery["status"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = priority { + xQuery["priority"] = value.rawValue + } + if let value = category { + xQuery["category"] = value + } - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -243,7 +245,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -251,83 +253,24 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TicketList.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + /** - * - * Summary: get paginator for getTickets - * Description: fetch the next page by calling .next(...) function - **/ + * + * Summary: get paginator for getTickets + * Description: fetch the next page by calling .next(...) function + **/ public func getTicketsPaginator( items: Bool?, filters: Bool?, @@ -336,24 +279,23 @@ if let value = pageSize { priority: PriorityEnum?, category: String?, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getTickets( - - items: items, - filters: filters, - q: q, - status: status, - priority: priority, - category: category, - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + items: items, + filters: filters, + q: q, + status: status, + priority: priority, + category: category, + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -363,25 +305,16 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Creates a company level ticket - * Description: Creates a company level ticket - **/ + * + * Summary: Creates a company level ticket + * Description: Creates a company level ticket + **/ public func createTicket( body: AddTicketPayload, onResponse: @escaping (_ response: Ticket?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -390,7 +323,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -398,40 +331,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Ticket.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - + /** - * - * Summary: Retreives ticket details of a company level ticket with ticket ID - * Description: Retreives ticket details of a company level ticket - **/ + * + * Summary: Retreives ticket details of a company level ticket with ticket ID + * Description: Retreives ticket details of a company level ticket + **/ public func getTicket( id: String, - + onResponse: @escaping (_ response: Ticket?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -440,7 +362,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -448,39 +370,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Ticket.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Edits ticket details of a company level ticket - * Description: Edits ticket details of a company level ticket such as status, priority, category, tags, attachments, assigne & ticket content changes - **/ + * + * Summary: Edits ticket details of a company level ticket + * Description: Edits ticket details of a company level ticket such as status, priority, category, tags, attachments, assigne & ticket content changes + **/ public func editTicket( id: String, body: EditTicketPayload, onResponse: @escaping (_ response: Ticket?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -489,7 +401,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -497,41 +409,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Ticket.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - + /** - * - * Summary: Create history for specific company level ticket - * Description: Create history for specific company level ticket, this history is seen on ticket detail page, this can be comment, log or rating. - **/ + * + * Summary: Create history for specific company level ticket + * Description: Create history for specific company level ticket, this history is seen on ticket detail page, this can be comment, log or rating. + **/ public func createHistory( id: String, body: TicketHistoryPayload, onResponse: @escaping (_ response: TicketHistory?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -540,7 +440,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -548,39 +448,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TicketHistory.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Gets history list for specific company level ticket - * Description: Gets history list for specific company level ticket, this history is seen on ticket detail page, this can be comment, log or rating. - **/ + * + * Summary: Gets history list for specific company level ticket + * Description: Gets history list for specific company level ticket, this history is seen on ticket detail page, this can be comment, log or rating. + **/ public func getTicketHistory( id: String, - + onResponse: @escaping (_ response: TicketHistoryList?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -589,7 +479,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -597,39 +487,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TicketHistoryList.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Gets a list of feedback submitted against that ticket - * Description: Gets a list of feedback submitted against that ticket - **/ + * + * Summary: Gets a list of feedback submitted against that ticket + * Description: Gets a list of feedback submitted against that ticket + **/ public func getFeedbacks( id: String, - + onResponse: @escaping (_ response: TicketFeedbackList?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -638,7 +518,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -646,39 +526,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TicketFeedbackList.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Submit a response for feeback form against that ticket - * Description: Submit a response for feeback form against that ticket - **/ + * + * Summary: Submit a response for feeback form against that ticket + * Description: Submit a response for feeback form against that ticket + **/ public func submitFeedback( id: String, body: TicketFeedbackPayload, onResponse: @escaping (_ response: TicketFeedback?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -687,7 +557,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -695,45 +565,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TicketFeedback.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - + /** - * - * Summary: Get Token to join a specific Video Room using it's unqiue name - * Description: Get Token to join a specific Video Room using it's unqiue name, this Token is your ticket to Room and also creates your identity there. - **/ + * + * Summary: Get Token to join a specific Video Room using it's unqiue name + * Description: Get Token to join a specific Video Room using it's unqiue name, this Token is your ticket to Room and also creates your identity there. + **/ public func getTokenForVideoRoom( uniqueName: String, - + onResponse: @escaping (_ response: GetTokenForVideoRoomResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -742,7 +596,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -750,40 +604,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetTokenForVideoRoomResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - + /** - * - * Summary: Get participants of a specific Video Room using it's unique name - * Description: Get participants of a specific Video Room using it's unique name, this can be used to check if people are already there in the room and also to show their names. - **/ + * + * Summary: Get participants of a specific Video Room using it's unique name + * Description: Get participants of a specific Video Room using it's unique name, this can be used to check if people are already there in the room and also to show their names. + **/ public func getVideoParticipants( uniqueName: String, - + onResponse: @escaping (_ response: GetParticipantsInsideVideoRoomResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -792,7 +635,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -800,28 +643,21 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetParticipantsInsideVideoRoomResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - } - - - - public class Billing { + + public class Billing { var config: PlatformConfig var companyId: String @@ -829,26 +665,63 @@ if let value = pageSize { self.config = config self.companyId = config.companyId } - - - - + + /** + * + * Summary: Check coupon validity + * Description: Check coupon validity. + **/ + public func checkCouponValidity( + plan: String, + couponCode: String, + + onResponse: @escaping (_ response: CheckValidityResponse?, _ error: FDKError?) -> Void + ) { + var xQuery: [String: Any] = [:] + + xQuery["plan"] = plan + + xQuery["coupon_code"] = couponCode + + PlatformAPIClient.execute( + config: config, + method: "get", + url: "/service/platform/billing/v1.0/company/\(companyId)/coupon/check-validity", + query: xQuery, + body: nil, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(CheckValidityResponse.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + /** - * - * Summary: Create subscription charge - * Description: Register subscription charge for a seller of your extension. - **/ + * + * Summary: Create subscription charge + * Description: Register subscription charge for a seller of your extension. + **/ public func createSubscriptionCharge( extensionId: String, body: CreateSubscriptionCharge, onResponse: @escaping (_ response: CreateSubscriptionResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -857,7 +730,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -865,40 +738,30 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CreateSubscriptionResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get subscription charge details - * Description: Get created subscription charge details - **/ + * + * Summary: Get subscription charge details + * Description: Get created subscription charge details + **/ public func getSubscriptionCharge( extensionId: String, subscriptionId: String, - + onResponse: @escaping (_ response: EntitySubscription?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -907,7 +770,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -915,40 +778,30 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(EntitySubscription.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Cancel subscription charge - * Description: Cancel subscription and attached charges. - **/ + * + * Summary: Cancel subscription charge + * Description: Cancel subscription and attached charges. + **/ public func cancelSubscriptionCharge( extensionId: String, subscriptionId: String, - + onResponse: @escaping (_ response: EntitySubscription?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -957,7 +810,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -965,38 +818,27 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(EntitySubscription.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get invoices - * Description: Get invoices. - **/ + * + * Summary: Get invoices + * Description: Get invoices. + **/ public func getInvoices( - onResponse: @escaping (_ response: Invoices?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -1005,7 +847,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1013,39 +855,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Invoices.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get invoice by id - * Description: Get invoice by id. - **/ + * + * Summary: Get invoice by id + * Description: Get invoice by id. + **/ public func getInvoiceById( invoiceId: String, - + onResponse: @escaping (_ response: Invoice?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -1054,7 +886,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1062,38 +894,27 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Invoice.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get subscription customer detail - * Description: Get subscription customer detail. - **/ + * + * Summary: Get subscription customer detail + * Description: Get subscription customer detail. + **/ public func getCustomerDetail( - onResponse: @escaping (_ response: SubscriptionCustomer?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -1102,7 +923,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1110,38 +931,28 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SubscriptionCustomer.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Upsert subscription customer detail - * Description: Upsert subscription customer detail. - **/ + * + * Summary: Upsert subscription customer detail + * Description: Upsert subscription customer detail. + **/ public func upsertCustomerDetail( body: SubscriptionCustomerCreate, onResponse: @escaping (_ response: SubscriptionCustomer?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -1150,7 +961,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1158,39 +969,28 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SubscriptionCustomer.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get current subscription detail - * Description: If subscription is active then it will return is_enabled true and return subscription object. If subscription is not active then is_enabled false and message. + * + * Summary: Get current subscription detail + * Description: If subscription is active then it will return is_enabled true and return subscription object. If subscription is not active then is_enabled false and message. - **/ + **/ public func getSubscription( - onResponse: @escaping (_ response: SubscriptionStatus?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -1199,7 +999,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1207,38 +1007,27 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SubscriptionStatus.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get subscription subscription limits - * Description: Get subscription subscription limits. - **/ + * + * Summary: Get subscription subscription limits + * Description: Get subscription subscription limits. + **/ public func getFeatureLimitConfig( - onResponse: @escaping (_ response: SubscriptionLimit?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -1247,7 +1036,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1255,38 +1044,28 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SubscriptionLimit.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Activate subscription - * Description: It will activate subscription plan for customer - **/ + * + * Summary: Activate subscription + * Description: It will activate subscription plan for customer + **/ public func activateSubscriptionPlan( body: SubscriptionActivateReq, onResponse: @escaping (_ response: SubscriptionActivateRes?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -1295,7 +1074,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1303,38 +1082,28 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SubscriptionActivateRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Cancel subscription - * Description: It will cancel current active subscription. - **/ + * + * Summary: Cancel subscription + * Description: It will cancel current active subscription. + **/ public func cancelSubscriptionPlan( body: CancelSubscriptionReq, onResponse: @escaping (_ response: CancelSubscriptionRes?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -1343,7 +1112,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1351,25 +1120,21 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CancelSubscriptionRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - - public class Communication { + + public class Communication { var config: PlatformConfig var companyId: String @@ -1377,66 +1142,27 @@ if let value = pageSize { self.config = config self.companyId = config.companyId } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + /** - * - * Summary: Get system notifications - * Description: Get system notifications - **/ + * + * Summary: Get system notifications + * Description: Get system notifications + **/ public func getSystemNotifications( pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: SystemNotifications?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -1446,7 +1172,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1454,61 +1180,37 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SystemNotifications.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - - - - - - - - - - + /** - * - * Summary: get paginator for getSystemNotifications - * Description: fetch the next page by calling .next(...) function - **/ + * + * Summary: get paginator for getSystemNotifications + * Description: fetch the next page by calling .next(...) function + **/ public func getSystemNotificationsPaginator( pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getSystemNotifications( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -1518,22 +1220,9 @@ if let value = pageSize { } return paginator } - - - - - - - - - - - } - - - - public class Payment { + + public class Payment { var config: PlatformConfig var companyId: String @@ -1541,36 +1230,22 @@ if let value = pageSize { self.config = config self.companyId = config.companyId } - - - - - - - - + /** - * - * Summary: Get All Payouts - * Description: Get All Payouts - **/ + * + * Summary: Get All Payouts + * Description: Get All Payouts + **/ public func getAllPayouts( uniqueExternalId: String?, - + onResponse: @escaping (_ response: PayoutsResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = uniqueExternalId { - - xQuery["unique_external_id"] = value - -} - - - + var xQuery: [String: Any] = [:] + if let value = uniqueExternalId { + xQuery["unique_external_id"] = value + } PlatformAPIClient.execute( config: config, @@ -1580,7 +1255,7 @@ if let value = uniqueExternalId { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1588,38 +1263,28 @@ if let value = uniqueExternalId { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PayoutsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Save Payout - * Description: Save Payout - **/ + * + * Summary: Save Payout + * Description: Save Payout + **/ public func savePayout( body: PayoutRequest, onResponse: @escaping (_ response: PayoutResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -1628,7 +1293,7 @@ if let value = uniqueExternalId { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1636,39 +1301,29 @@ if let value = uniqueExternalId { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PayoutResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update Payout - * Description: Update Payout - **/ + * + * Summary: Update Payout + * Description: Update Payout + **/ public func updatePayout( uniqueTransferNo: String, body: PayoutRequest, onResponse: @escaping (_ response: UpdatePayoutResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -1677,7 +1332,7 @@ if let value = uniqueExternalId { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1685,39 +1340,29 @@ if let value = uniqueExternalId { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdatePayoutResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Partial Update Payout - * Description: Partial Update Payout - **/ + * + * Summary: Partial Update Payout + * Description: Partial Update Payout + **/ public func activateAndDectivatePayout( uniqueTransferNo: String, body: UpdatePayoutRequest, onResponse: @escaping (_ response: UpdatePayoutResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "patch", @@ -1726,7 +1371,7 @@ if let value = uniqueExternalId { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1734,39 +1379,29 @@ if let value = uniqueExternalId { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdatePayoutResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete Payout - * Description: Delete Payout - **/ + * + * Summary: Delete Payout + * Description: Delete Payout + **/ public func deletePayout( uniqueTransferNo: String, - + onResponse: @escaping (_ response: DeletePayoutResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -1775,7 +1410,7 @@ if let value = uniqueExternalId { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1783,47 +1418,44 @@ if let value = uniqueExternalId { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DeletePayoutResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: List Subscription Payment Method - * Description: Get all Subscription Payment Method - **/ + * + * Summary: List Subscription Payment Method + * Description: Get all Subscription Payment Method + **/ public func getSubscriptionPaymentMethod( - + uniqueExternalId: String?, + onResponse: @escaping (_ response: SubscriptionPaymentMethodResponse?, _ error: FDKError?) -> Void ) { - - - - + var xQuery: [String: Any] = [:] + if let value = uniqueExternalId { + xQuery["unique_external_id"] = value + } PlatformAPIClient.execute( config: config, method: "get", url: "/service/platform/payment/v1.0/company/\(companyId)/subscription/methods", - query: nil, + query: xQuery, body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1831,49 +1463,35 @@ if let value = uniqueExternalId { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SubscriptionPaymentMethodResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete Subscription Payment Method - * Description: Uses this api to Delete Subscription Payment Method - **/ + * + * Summary: Delete Subscription Payment Method + * Description: Uses this api to Delete Subscription Payment Method + **/ public func deleteSubscriptionPaymentMethod( uniqueExternalId: String, paymentMethodId: String, - + onResponse: @escaping (_ response: DeleteSubscriptionPaymentMethodResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["unique_external_id"] = uniqueExternalId + var xQuery: [String: Any] = [:] + xQuery["unique_external_id"] = uniqueExternalId - - - xQuery["payment_method_id"] = paymentMethodId - - - - - + xQuery["payment_method_id"] = paymentMethodId PlatformAPIClient.execute( config: config, @@ -1883,7 +1501,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1891,38 +1509,27 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DeleteSubscriptionPaymentMethodResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: List Subscription Config - * Description: Get all Subscription Config details - **/ + * + * Summary: List Subscription Config + * Description: Get all Subscription Config details + **/ public func getSubscriptionConfig( - onResponse: @escaping (_ response: SubscriptionConfigResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -1931,7 +1538,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1939,38 +1546,28 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SubscriptionConfigResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Save Subscription Setup Intent - * Description: Uses this api to Save Subscription Setup Intent - **/ + * + * Summary: Save Subscription Setup Intent + * Description: Uses this api to Save Subscription Setup Intent + **/ public func saveSubscriptionSetupIntent( body: SaveSubscriptionSetupIntentRequest, onResponse: @escaping (_ response: SaveSubscriptionSetupIntentResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -1979,7 +1576,7 @@ var xQuery: [String: Any] = [:] body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -1987,46 +1584,34 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SaveSubscriptionSetupIntentResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - + /** - * - * Summary: Ifsc Code Verification - * Description: Get True/False for correct IFSC Code for adding bank details for refund - **/ + * + * Summary: Ifsc Code Verification + * Description: Get True/False for correct IFSC Code for adding bank details for refund + **/ public func verifyIfscCode( ifscCode: String?, - + onResponse: @escaping (_ response: IfscCodeResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = ifscCode { - - xQuery["ifsc_code"] = value - -} - - - + var xQuery: [String: Any] = [:] + if let value = ifscCode { + xQuery["ifsc_code"] = value + } PlatformAPIClient.execute( config: config, @@ -2036,7 +1621,7 @@ if let value = ifscCode { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2044,28 +1629,21 @@ if let value = ifscCode { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(IfscCodeResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - } - - - - public class Order { + + public class Order { var config: PlatformConfig var companyId: String @@ -2073,25 +1651,16 @@ if let value = ifscCode { self.config = config self.companyId = config.companyId } - - - - + /** - * - * Summary: Update status of Shipment - * Description: Update Shipment Status - **/ + * + * Summary: Update status of Shipment + * Description: Update Shipment Status + **/ public func shipmentStatusUpdate( body: UpdateShipmentStatusBody, onResponse: @escaping (_ response: UpdateShipmentStatusResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -2100,7 +1669,7 @@ if let value = ifscCode { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2108,43 +1677,32 @@ if let value = ifscCode { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateShipmentStatusResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get Activity Status - * Description: Get Activity Status - **/ + * + * Summary: Get Activity Status + * Description: Get Activity Status + **/ public func activityStatus( bagId: String, - + onResponse: @escaping (_ response: GetActivityStatus?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["bag_id"] = bagId - - - - + var xQuery: [String: Any] = [:] + xQuery["bag_id"] = bagId PlatformAPIClient.execute( config: config, @@ -2154,7 +1712,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2162,38 +1720,28 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetActivityStatus.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update Store Process-Shipment - * Description: Update Store Process-Shipment - **/ + * + * Summary: Update Store Process-Shipment + * Description: Update Store Process-Shipment + **/ public func storeProcessShipmentUpdate( body: UpdateProcessShipmenstRequestBody, onResponse: @escaping (_ response: UpdateProcessShipmenstRequestResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -2202,7 +1750,7 @@ var xQuery: [String: Any] = [:] body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2210,39 +1758,29 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateProcessShipmenstRequestResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Check Refund is available or not - * Description: Check Refund is available or not - **/ + * + * Summary: Check Refund is available or not + * Description: Check Refund is available or not + **/ public func checkRefund( shipmentId: String, - + onResponse: @escaping (_ response: [String: Any]?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -2251,7 +1789,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2259,133 +1797,147 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = data.dictionary - + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Decides if Shipment bags can break + * Description: Decides if Shipment bags can break + **/ + public func shipmentBagsCanBreak( + body: CanBreakRequestBody, + onResponse: @escaping (_ response: CanBreakResponse?, _ error: FDKError?) -> Void + ) { + PlatformAPIClient.execute( + config: config, + method: "post", + url: "/service/platform/order/v1.0/company/\(companyId)/actions/can-break", + query: nil, + body: body.dictionary, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(CanBreakResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get Orders for company based on Company Id - * Description: Get Orders - **/ + * + * Summary: Get Orders for company based on Company Id + * Description: Get Orders + **/ public func getOrdersByCompanyId( pageNo: String?, pageSize: String?, fromDate: String?, toDate: String?, + isPrioritySort: Bool?, + lockStatus: Bool?, q: String?, stage: String?, salesChannels: String?, orderId: String?, stores: String?, + deploymentStores: String?, status: String?, + dp: String?, shortenUrls: Bool?, filterType: String?, - + onResponse: @escaping (_ response: OrderListing?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = fromDate { - - xQuery["from_date"] = value - -} - - -if let value = toDate { - - xQuery["to_date"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } -if let value = q { - - xQuery["q"] = value - -} - - -if let value = stage { - - xQuery["stage"] = value - -} - + if let value = pageSize { + xQuery["page_size"] = value + } -if let value = salesChannels { - - xQuery["sales_channels"] = value - -} + if let value = fromDate { + xQuery["from_date"] = value + } + if let value = toDate { + xQuery["to_date"] = value + } -if let value = orderId { - - xQuery["order_id"] = value - -} + if let value = isPrioritySort { + xQuery["is_priority_sort"] = value + } + if let value = lockStatus { + xQuery["lock_status"] = value + } -if let value = stores { - - xQuery["stores"] = value - -} + if let value = q { + xQuery["q"] = value + } + if let value = stage { + xQuery["stage"] = value + } -if let value = status { - - xQuery["status"] = value - -} + if let value = salesChannels { + xQuery["sales_channels"] = value + } + if let value = orderId { + xQuery["order_id"] = value + } -if let value = shortenUrls { - - xQuery["shorten_urls"] = value - -} + if let value = stores { + xQuery["stores"] = value + } + if let value = deploymentStores { + xQuery["deployment_stores"] = value + } -if let value = filterType { - - xQuery["filter_type"] = value - -} + if let value = status { + xQuery["status"] = value + } + if let value = dp { + xQuery["dp"] = value + } - + if let value = shortenUrls { + xQuery["shorten_urls"] = value + } + if let value = filterType { + xQuery["filter_type"] = value + } PlatformAPIClient.execute( config: config, @@ -2395,7 +1947,7 @@ if let value = filterType { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2403,28 +1955,24 @@ if let value = filterType { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OrderListing.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get Order Lanes Count for company based on Company Id - * Description: Get Orders Seperate Lane Count - **/ + * + * Summary: Get Order Lanes Count for company based on Company Id + * Description: Get Orders Seperate Lane Count + **/ public func getOrderLanesCountByCompanyId( pageNo: String?, pageSize: String?, @@ -2438,98 +1986,58 @@ if let value = filterType { status: String?, shortenUrls: Bool?, filterType: String?, - + onResponse: @escaping (_ response: OrderLanesCount?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = fromDate { - - xQuery["from_date"] = value - -} - - -if let value = toDate { - - xQuery["to_date"] = value - -} - - -if let value = q { - - xQuery["q"] = value - -} - - -if let value = stage { - - xQuery["stage"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } -if let value = salesChannels { - - xQuery["sales_channels"] = value - -} - - -if let value = orderId { - - xQuery["order_id"] = value - -} - + if let value = pageSize { + xQuery["page_size"] = value + } -if let value = stores { - - xQuery["stores"] = value - -} + if let value = fromDate { + xQuery["from_date"] = value + } + if let value = toDate { + xQuery["to_date"] = value + } -if let value = status { - - xQuery["status"] = value - -} + if let value = q { + xQuery["q"] = value + } + if let value = stage { + xQuery["stage"] = value + } -if let value = shortenUrls { - - xQuery["shorten_urls"] = value - -} + if let value = salesChannels { + xQuery["sales_channels"] = value + } + if let value = orderId { + xQuery["order_id"] = value + } -if let value = filterType { - - xQuery["filter_type"] = value - -} + if let value = stores { + xQuery["stores"] = value + } + if let value = status { + xQuery["status"] = value + } - + if let value = shortenUrls { + xQuery["shorten_urls"] = value + } + if let value = filterType { + xQuery["filter_type"] = value + } PlatformAPIClient.execute( config: config, @@ -2539,7 +2047,7 @@ if let value = filterType { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2547,61 +2055,44 @@ if let value = filterType { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OrderLanesCount.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get Order Details for company based on Company Id and Order Id - * Description: Get Orders - **/ + * + * Summary: Get Order Details for company based on Company Id and Order Id + * Description: Get Orders + **/ public func getOrderDetails( orderId: String?, next: String?, previous: String?, - + onResponse: @escaping (_ response: OrderDetails?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = orderId { - - xQuery["order_id"] = value - -} - - -if let value = next { - - xQuery["next"] = value - -} - - -if let value = previous { - - xQuery["previous"] = value - -} + var xQuery: [String: Any] = [:] + if let value = orderId { + xQuery["order_id"] = value + } - + if let value = next { + xQuery["next"] = value + } + if let value = previous { + xQuery["previous"] = value + } PlatformAPIClient.execute( config: config, @@ -2611,7 +2102,7 @@ if let value = previous { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2619,28 +2110,24 @@ if let value = previous { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OrderDetails.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get Orders for company based on Company Id - * Description: Get Orders - **/ + * + * Summary: Get Orders for company based on Company Id + * Description: Get Orders + **/ public func getPicklistOrdersByCompanyId( pageNo: String?, pageSize: String?, @@ -2654,98 +2141,58 @@ if let value = previous { status: String?, shortenUrls: Bool?, filterType: String?, - + onResponse: @escaping (_ response: OrderPicklistListing?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = pageNo { - - xQuery["page_no"] = value - -} + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = fromDate { + xQuery["from_date"] = value + } + if let value = toDate { + xQuery["to_date"] = value + } -if let value = fromDate { - - xQuery["from_date"] = value - -} - - -if let value = toDate { - - xQuery["to_date"] = value - -} - - -if let value = q { - - xQuery["q"] = value - -} - - -if let value = stage { - - xQuery["stage"] = value - -} - - -if let value = salesChannels { - - xQuery["sales_channels"] = value - -} - - -if let value = orderId { - - xQuery["order_id"] = value - -} - - -if let value = stores { - - xQuery["stores"] = value - -} - - -if let value = status { - - xQuery["status"] = value - -} + if let value = q { + xQuery["q"] = value + } + if let value = stage { + xQuery["stage"] = value + } -if let value = shortenUrls { - - xQuery["shorten_urls"] = value - -} + if let value = salesChannels { + xQuery["sales_channels"] = value + } + if let value = orderId { + xQuery["order_id"] = value + } -if let value = filterType { - - xQuery["filter_type"] = value - -} + if let value = stores { + xQuery["stores"] = value + } + if let value = status { + xQuery["status"] = value + } - + if let value = shortenUrls { + xQuery["shorten_urls"] = value + } + if let value = filterType { + xQuery["filter_type"] = value + } PlatformAPIClient.execute( config: config, @@ -2755,7 +2202,7 @@ if let value = filterType { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2763,47 +2210,30 @@ if let value = filterType { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OrderPicklistListing.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - + /** - * - * Summary: Use this API to get address of a shipment using its shipment ID and Address Category. - * Description: Get Shipment Address - **/ + * + * Summary: Use this API to get address of a shipment using its shipment ID and Address Category. + * Description: Get Shipment Address + **/ public func getShipmentAddress( shipmentId: String, addressCategory: String, - + onResponse: @escaping (_ response: GetShipmentAddressResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -2812,7 +2242,7 @@ if let value = filterType { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2820,40 +2250,30 @@ if let value = filterType { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetShipmentAddressResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Use this API to update address of a shipment using its shipment ID and Address Category. - * Description: Update Shipment Address - **/ + * + * Summary: Use this API to update address of a shipment using its shipment ID and Address Category. + * Description: Update Shipment Address + **/ public func updateShipmentAddress( shipmentId: String, addressCategory: String, body: UpdateShipmentAddressRequest, onResponse: @escaping (_ response: UpdateShipmentAddressResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -2862,7 +2282,7 @@ if let value = filterType { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2870,38 +2290,27 @@ if let value = filterType { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateShipmentAddressResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get Ping - * Description: Get Ping - **/ + * + * Summary: Get Ping + * Description: Get Ping + **/ public func getPing( - onResponse: @escaping (_ response: GetPingResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -2910,7 +2319,7 @@ if let value = filterType { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2918,38 +2327,27 @@ if let value = filterType { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetPingResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get Voice Callback - * Description: Voice Callback - **/ + * + * Summary: Get Voice Callback + * Description: Voice Callback + **/ public func voiceCallback( - onResponse: @escaping (_ response: GetVoiceCallbackResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -2958,7 +2356,7 @@ if let value = filterType { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -2966,49 +2364,35 @@ if let value = filterType { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetVoiceCallbackResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get Voice Click to Call - * Description: Voice Click to Call - **/ + * + * Summary: Get Voice Click to Call + * Description: Voice Click to Call + **/ public func voiceClickToCall( caller: String, receiver: String, - + onResponse: @escaping (_ response: GetClickToCallResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["caller"] = caller - - - + var xQuery: [String: Any] = [:] - xQuery["receiver"] = receiver - - - - + xQuery["caller"] = caller + xQuery["receiver"] = receiver PlatformAPIClient.execute( config: config, @@ -3018,7 +2402,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3026,25 +2410,21 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetClickToCallResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - - public class Catalog { + + public class Catalog { var config: PlatformConfig var companyId: String @@ -3052,90 +2432,27 @@ var xQuery: [String: Any] = [:] self.config = config self.companyId = config.companyId } - - - - - - - - - - - - - - - /** - * - * Summary: Create Product Bundle - * Description: Create Product Bundle. See `ProductBundleRequest` for the request body parameter need to create a product bundle. On successful request, returns in `ProductBundleRequest` with id - **/ - public func createProductBundle( - body: ProductBundleRequest, - onResponse: @escaping (_ response: GetProductBundleCreateResponse?, _ error: FDKError?) -> Void - ) { - - - - - - PlatformAPIClient.execute( - config: config, - method: "post", - url: "/service/platform/catalog/v1.0/company/\(companyId)/product-bundle/", - query: nil, - body: body.dictionary, - headers: [], - responseType: "application/json", - onResponse: { (responseData, error, responseCode) in - if let _ = error, let data = responseData { - var err = Utility.decode(FDKError.self, from: data) - if err?.status == nil { - err?.status = responseCode - } - onResponse(nil, err) - } else if let data = responseData { - - let response = Utility.decode(GetProductBundleCreateResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - /** - * - * Summary: List all Product Bundles - * Description: Get all product bundles for a particular company - **/ + * + * Summary: List all Product Bundles + * Description: Get all product bundles for a particular company + **/ public func getProductBundle( q: String?, - + slug: [String]?, + onResponse: @escaping (_ response: GetProductBundleListingResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = q { - - xQuery["q"] = value - -} - - - + if let value = q { + xQuery["q"] = value + } + if let value = slug { + xQuery["slug"] = value + } PlatformAPIClient.execute( config: config, @@ -3145,7 +2462,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3153,48 +2470,37 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetProductBundleListingResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update a Product Bundle - * Description: Update a Product Bundle by its id. On successful request, returns the updated product bundle - **/ - public func updateProductBundle( - id: String, - body: ProductBundleUpdateRequest, + * + * Summary: Create Product Bundle + * Description: Create Product Bundle. See `ProductBundleRequest` for the request body parameter need to create a product bundle. On successful request, returns in `ProductBundleRequest` with id + **/ + public func createProductBundle( + body: ProductBundleRequest, onResponse: @escaping (_ response: GetProductBundleCreateResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "put", - url: "/service/platform/catalog/v1.0/company/\(companyId)/productBundle/\(id)/", + method: "post", + url: "/service/platform/catalog/v1.0/company/\(companyId)/product-bundle/", query: nil, body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3202,39 +2508,29 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetProductBundleCreateResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get a particular Product Bundle details - * Description: Get a particular Bundle details by its `id`. If successful, returns a Product bundle resource in the response body specified in `GetProductBundleResponse` - **/ + * + * Summary: Get a particular Product Bundle details + * Description: Get a particular Bundle details by its `id`. If successful, returns a Product bundle resource in the response body specified in `GetProductBundleResponse` + **/ public func getProductBundleDetail( id: String, - + onResponse: @escaping (_ response: GetProductBundleResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -3243,7 +2539,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3251,47 +2547,38 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetProductBundleResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create a size guide. - * Description: This API allows to create a size guide associated to a brand. - **/ - public func createSizeGuide( - body: ValidateSizeGuide, - onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void + * + * Summary: Update a Product Bundle + * Description: Update a Product Bundle by its id. On successful request, returns the updated product bundle + **/ + public func updateProductBundle( + id: String, + body: ProductBundleUpdateRequest, + onResponse: @escaping (_ response: GetProductBundleCreateResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "post", - url: "/service/platform/catalog/v1.0/company/\(companyId)/sizeguide", + method: "put", + url: "/service/platform/catalog/v1.0/company/\(companyId)/productBundle/\(id)/", query: nil, body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3299,77 +2586,54 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(SuccessResponse.self, from: data) - + let response = Utility.decode(GetProductBundleCreateResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get list of size guides - * Description: This API allows to view all the size guides associated to the seller. - **/ + * + * Summary: Get list of size guides + * Description: This API allows to view all the size guides associated to the seller. + **/ public func getSizeGuides( active: Bool?, q: String?, tag: String?, pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: ListSizeGuide?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = active { - - xQuery["active"] = value - -} - - -if let value = q { - - xQuery["q"] = value - -} - - -if let value = tag { - - xQuery["tag"] = value - -} - - -if let value = pageNo { - - xQuery["page_no"] = value - -} + var xQuery: [String: Any] = [:] + if let value = active { + xQuery["active"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = q { + xQuery["q"] = value + } + if let value = tag { + xQuery["tag"] = value + } - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -3379,7 +2643,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3387,48 +2651,37 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ListSizeGuide.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Edit a size guide. - * Description: This API allows to edit a size guide. - **/ - public func updateSizeGuide( - id: String, + * + * Summary: Create a size guide. + * Description: This API allows to create a size guide associated to a brand. + **/ + public func createSizeGuide( body: ValidateSizeGuide, onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "put", - url: "/service/platform/catalog/v1.0/company/\(companyId)/sizeguide/\(id)/", + method: "post", + url: "/service/platform/catalog/v1.0/company/\(companyId)/sizeguide", query: nil, body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3436,39 +2689,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SuccessResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get a single size guide. - * Description: This API helps to get data associated to a size guide. - **/ + * + * Summary: Get a single size guide. + * Description: This API helps to get data associated to a size guide. + **/ public func getSizeGuide( id: String, - + onResponse: @escaping (_ response: SizeGuideResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -3477,7 +2720,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3485,53 +2728,68 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SizeGuideResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - - - - - + /** - * - * Summary: Analytics data of catalog and inventory that are being cross-selled. - * Description: Analytics data of catalog and inventory that are being cross-selled. - **/ - public func getSellerInsights( - sellerAppId: String, - - onResponse: @escaping (_ response: CrossSellingResponse?, _ error: FDKError?) -> Void + * + * Summary: Edit a size guide. + * Description: This API allows to edit a size guide. + **/ + public func updateSizeGuide( + id: String, + body: ValidateSizeGuide, + onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - - + PlatformAPIClient.execute( + config: config, + method: "put", + url: "/service/platform/catalog/v1.0/company/\(companyId)/sizeguide/\(id)/", + query: nil, + body: body.dictionary, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(SuccessResponse.self, from: data) - + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + /** + * + * Summary: Analytics data of catalog and inventory that are being cross-selled. + * Description: Analytics data of catalog and inventory that are being cross-selled. + **/ + public func getSellerInsights( + sellerAppId: String, + onResponse: @escaping (_ response: CrossSellingResponse?, _ error: FDKError?) -> Void + ) { PlatformAPIClient.execute( config: config, method: "get", @@ -3540,7 +2798,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3548,39 +2806,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CrossSellingResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create/Update opt-in infomation. - * Description: Use this API to create/update opt-in information for given platform. If successful, returns data in the response body as specified in `OptInPostResponseSchema` - **/ + * + * Summary: Create/Update opt-in infomation. + * Description: Use this API to create/update opt-in information for given platform. If successful, returns data in the response body as specified in `OptInPostResponseSchema` + **/ public func createMarketplaceOptin( marketplace: String, body: OptInPostRequest, onResponse: @escaping (_ response: UpdatedResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -3589,7 +2837,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3597,38 +2845,27 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdatedResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get opt-in infomation. - * Description: Use this API to fetch opt-in information for all the platforms. If successful, returns a logs in the response body as specified in `GetOptInPlatformSchema` - **/ + * + * Summary: Get opt-in infomation. + * Description: Use this API to fetch opt-in information for all the platforms. If successful, returns a logs in the response body as specified in `GetOptInPlatformSchema` + **/ public func getMarketplaceOptinDetail( - onResponse: @escaping (_ response: GetOptInPlatform?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -3637,7 +2874,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3645,38 +2882,27 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetOptInPlatform.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get the Company details. - * Description: Get the details of the company associated with the given company_id passed. - **/ + * + * Summary: Get the Company details. + * Description: Get the details of the company associated with the given company_id passed. + **/ public func getCompanyDetail( - onResponse: @escaping (_ response: OptinCompanyDetail?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -3685,7 +2911,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3693,77 +2919,54 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OptinCompanyDetail.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get the Company Brand details of Optin. - * Description: Get the details of the Brands associated with the given company_id passed. - **/ + * + * Summary: Get the Company Brand details of Optin. + * Description: Get the details of the Brands associated with the given company_id passed. + **/ public func getCompanyBrandDetail( isActive: Bool?, q: Bool?, pageNo: Int?, pageSize: Int?, marketplace: String?, - + onResponse: @escaping (_ response: OptinCompanyBrandDetailsView?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = isActive { - - xQuery["is_active"] = value - -} + var xQuery: [String: Any] = [:] + if let value = isActive { + xQuery["is_active"] = value + } -if let value = q { - - xQuery["q"] = value - -} + if let value = q { + xQuery["q"] = value + } + if let value = pageNo { + xQuery["page_no"] = value + } -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = marketplace { - - xQuery["marketplace"] = value - -} - - - + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = marketplace { + xQuery["marketplace"] = value + } PlatformAPIClient.execute( config: config, @@ -3773,7 +2976,7 @@ if let value = marketplace { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3781,38 +2984,27 @@ if let value = marketplace { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OptinCompanyBrandDetailsView.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get the Company metrics - * Description: Get the Company metrics associated with the company ID passed. - **/ + * + * Summary: Get the Company metrics + * Description: Get the Company metrics associated with the company ID passed. + **/ public func getCompanyMetrics( - onResponse: @escaping (_ response: OptinCompanyMetrics?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -3821,7 +3013,7 @@ if let value = marketplace { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3829,61 +3021,44 @@ if let value = marketplace { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OptinCompanyMetrics.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get the Store details. - * Description: Get the details of the store associated with the company ID passed. - **/ + * + * Summary: Get the Store details. + * Description: Get the details of the store associated with the company ID passed. + **/ public func getStoreDetail( q: String?, pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: OptinStoreDetails?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = q { - - xQuery["q"] = value - -} - - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} + var xQuery: [String: Any] = [:] + if let value = q { + xQuery["q"] = value + } - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -3893,7 +3068,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3901,39 +3076,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OptinStoreDetails.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get gender attribute details - * Description: This API allows to view the gender attribute details. - **/ + * + * Summary: Get gender attribute details + * Description: This API allows to view the gender attribute details. + **/ public func getGenderAttribute( attributeSlug: String, - + onResponse: @escaping (_ response: GenderDetail?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -3942,7 +3107,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -3950,49 +3115,35 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GenderDetail.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: List Department specifiec product categories - * Description: Allows you to list all product categories values for the departments specified - **/ + * + * Summary: List Department specifiec product categories + * Description: Allows you to list all product categories values for the departments specified + **/ public func listProductTemplateCategories( departments: String, itemType: String, - + onResponse: @escaping (_ response: ProdcutTemplateCategoriesResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["departments"] = departments - - - - - xQuery["item_type"] = itemType - - + var xQuery: [String: Any] = [:] - + xQuery["departments"] = departments + xQuery["item_type"] = itemType PlatformAPIClient.execute( config: config, @@ -4002,7 +3153,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4010,77 +3161,54 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ProdcutTemplateCategoriesResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: List all Departments - * Description: Allows you to list all departments, also can search using name and filter active and incative departments, and item type - **/ + * + * Summary: List all Departments + * Description: Allows you to list all departments, also can search using name and filter active and incative departments, and item type + **/ public func listDepartmentsData( pageNo: Int?, pageSize: Int?, name: String?, search: String?, isActive: Bool?, - + onResponse: @escaping (_ response: DepartmentsResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = name { - - xQuery["name"] = value - -} - - -if let value = search { - - xQuery["search"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } -if let value = isActive { - - xQuery["is_active"] = value - -} + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = name { + xQuery["name"] = value + } - + if let value = search { + xQuery["search"] = value + } + if let value = isActive { + xQuery["is_active"] = value + } PlatformAPIClient.execute( config: config, @@ -4090,7 +3218,7 @@ if let value = isActive { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4098,39 +3226,29 @@ if let value = isActive { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DepartmentsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get specific departments details by passing in unique id of the department - * Description: Allows you to get department data, by uid - **/ + * + * Summary: Get specific departments details by passing in unique id of the department + * Description: Allows you to get department data, by uid + **/ public func getDepartmentData( uid: String, - + onResponse: @escaping (_ response: DepartmentsResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -4139,7 +3257,7 @@ if let value = isActive { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4147,43 +3265,32 @@ if let value = isActive { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DepartmentsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: List all Templates - * Description: Allows you to list all product templates, also can filter by department - **/ + * + * Summary: List all Templates + * Description: Allows you to list all product templates, also can filter by department + **/ public func listProductTemplate( - departments: String, - + department: String, + onResponse: @escaping (_ response: TemplatesResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["departments"] = departments - - - - + var xQuery: [String: Any] = [:] + xQuery["department"] = department PlatformAPIClient.execute( config: config, @@ -4193,7 +3300,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4201,39 +3308,29 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TemplatesResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Validate Product Template Schema - * Description: Allows you to list all product templates validation values for all the fields present in the database - **/ + * + * Summary: Validate Product Template Schema + * Description: Allows you to list all product templates validation values for all the fields present in the database + **/ public func validateProductTemplate( slug: String, - + onResponse: @escaping (_ response: TemplatesValidationResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -4242,7 +3339,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4250,39 +3347,29 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TemplatesValidationResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Download Product Template View - * Description: Allows you to download product template data - **/ + * + * Summary: Download Product Template View + * Description: Allows you to download product template data + **/ public func downloadProductTemplateViews( slug: String, - + onResponse: @escaping (_ response: Data?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -4291,7 +3378,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "text/csv", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4299,43 +3386,32 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = data - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Download Product Template View - * Description: Allows you to download product template data - **/ + * + * Summary: Download Product Template View + * Description: Allows you to download product template data + **/ public func downloadProductTemplateView( itemType: String, - + onResponse: @escaping (_ response: Data?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["item_type"] = itemType - - - - + var xQuery: [String: Any] = [:] + xQuery["item_type"] = itemType PlatformAPIClient.execute( config: config, @@ -4345,7 +3421,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "text/csv", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4353,43 +3429,32 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = data - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Validate Product Template Schema - * Description: Allows you to list all product templates validation values for all the fields present in the database - **/ + * + * Summary: Validate Product Template Schema + * Description: Allows you to list all product templates validation values for all the fields present in the database + **/ public func validateProductTemplateSchema( itemType: String, - + onResponse: @escaping (_ response: InventoryValidationResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["item_type"] = itemType - - - - + var xQuery: [String: Any] = [:] + xQuery["item_type"] = itemType PlatformAPIClient.execute( config: config, @@ -4399,7 +3464,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4407,38 +3472,27 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(InventoryValidationResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: List HSN Codes - * Description: Allows you to list all hsn Codes - **/ + * + * Summary: List HSN Codes + * Description: Allows you to list all hsn Codes + **/ public func listHSNCodes( - onResponse: @escaping (_ response: HSNCodesResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -4447,7 +3501,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4455,38 +3509,27 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(HSNCodesResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Allows you to list all product templates export list details - * Description: Can view details including trigger data, task id , etc. - **/ + * + * Summary: Allows you to list all product templates export list details + * Description: Can view details including trigger data, task id , etc. + **/ public func listProductTemplateExportDetails( - onResponse: @escaping (_ response: ProductDownloadsResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -4495,7 +3538,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4503,43 +3546,32 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ProductDownloadsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Allows you to list all values for Templates, Brands or Type - * Description: The filter type query parameter defines what type of data to return. The type of query returns the valid values for the same - **/ + * + * Summary: Allows you to list all values for Templates, Brands or Type + * Description: The filter type query parameter defines what type of data to return. The type of query returns the valid values for the same + **/ public func listTemplateBrandTypeValues( filter: String, - + onResponse: @escaping (_ response: ProductConfigurationDownloads?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["filter"] = filter - - - - + var xQuery: [String: Any] = [:] + xQuery["filter"] = filter PlatformAPIClient.execute( config: config, @@ -4549,7 +3581,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4557,125 +3589,54 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ProductConfigurationDownloads.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - /** - * - * Summary: Create product categories - * Description: This API lets user create product categories - **/ - public func createCategories( - body: CategoryRequestBody, - onResponse: @escaping (_ response: CategoryCreateResponse?, _ error: FDKError?) -> Void - ) { - - - - - - PlatformAPIClient.execute( - config: config, - method: "post", - url: "/service/platform/catalog/v1.0/company/\(companyId)/category/", - query: nil, - body: body.dictionary, - headers: [], - responseType: "application/json", - onResponse: { (responseData, error, responseCode) in - if let _ = error, let data = responseData { - var err = Utility.decode(FDKError.self, from: data) - if err?.status == nil { - err?.status = responseCode - } - onResponse(nil, err) - } else if let data = responseData { - - let response = Utility.decode(CategoryCreateResponse.self, from: data) - onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get product categories list - * Description: This API gets meta associated to product categories. - **/ + * + * Summary: Get product categories list + * Description: This API gets meta associated to product categories. + **/ public func listCategories( level: String?, departments: String?, q: String?, pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: CategoryResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = level { - - xQuery["level"] = value - -} - - -if let value = departments { - - xQuery["departments"] = value - -} - - -if let value = q { - - xQuery["q"] = value - -} - - -if let value = pageNo { - - xQuery["page_no"] = value - -} + var xQuery: [String: Any] = [:] + if let value = level { + xQuery["level"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = departments { + xQuery["departments"] = value + } + if let value = q { + xQuery["q"] = value + } - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -4685,7 +3646,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4693,48 +3654,37 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CategoryResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update product categories - * Description: Update a product category using this apu - **/ - public func updateCategory( - uid: String, + * + * Summary: Create product categories + * Description: This API lets user create product categories + **/ + public func createCategories( body: CategoryRequestBody, - onResponse: @escaping (_ response: CategoryUpdateResponse?, _ error: FDKError?) -> Void + onResponse: @escaping (_ response: CategoryCreateResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "put", - url: "/service/platform/catalog/v1.0/company/\(companyId)/category/\(uid)/", + method: "post", + url: "/service/platform/catalog/v1.0/company/\(companyId)/category/", query: nil, body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4742,39 +3692,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(CategoryUpdateResponse.self, from: data) - + let response = Utility.decode(CategoryCreateResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get product category by uid - * Description: This API gets meta associated to product categories. - **/ + * + * Summary: Get product category by uid + * Description: This API gets meta associated to product categories. + **/ public func getCategoryData( uid: String, - + onResponse: @escaping (_ response: SingleCategoryResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -4783,7 +3723,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4791,47 +3731,38 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SingleCategoryResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create a product. - * Description: This API allows to create product. - **/ - public func createProduct( - body: ProductCreateUpdate, - onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void + * + * Summary: Update product categories + * Description: Update a product category using this apu + **/ + public func updateCategory( + uid: String, + body: CategoryRequestBody, + onResponse: @escaping (_ response: CategoryUpdateResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "post", - url: "/service/platform/catalog/v1.0/company/\(companyId)/products/", + method: "put", + url: "/service/platform/catalog/v1.0/company/\(companyId)/category/\(uid)/", query: nil, body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4839,101 +3770,74 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(SuccessResponse.self, from: data) - + let response = Utility.decode(CategoryUpdateResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get product list - * Description: This API gets meta associated to products. - **/ + * + * Summary: Get product list + * Description: This API gets meta associated to products. + **/ public func getProducts( brandIds: [Int]?, categoryIds: [Int]?, itemIds: [Int]?, departmentIds: [Int]?, - itemCode: [Double]?, + itemCode: [String]?, q: String?, + tags: [String]?, pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: ProductListingResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = brandIds { - - xQuery["brand_ids"] = value - -} - - -if let value = categoryIds { - - xQuery["category_ids"] = value - -} - - -if let value = itemIds { - - xQuery["item_ids"] = value - -} + var xQuery: [String: Any] = [:] + if let value = brandIds { + xQuery["brand_ids"] = value + } -if let value = departmentIds { - - xQuery["department_ids"] = value - -} + if let value = categoryIds { + xQuery["category_ids"] = value + } + if let value = itemIds { + xQuery["item_ids"] = value + } -if let value = itemCode { - - xQuery["item_code"] = value - -} + if let value = departmentIds { + xQuery["department_ids"] = value + } + if let value = itemCode { + xQuery["item_code"] = value + } -if let value = q { - - xQuery["q"] = value - -} + if let value = q { + xQuery["q"] = value + } + if let value = tags { + xQuery["tags"] = value + } -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -4943,7 +3847,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -4951,48 +3855,88 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ProductListingResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete a product. - * Description: This API allows to delete product. - **/ - public func deleteProduct( - itemId: Int, - + * + * Summary: Create a product. + * Description: This API allows to create product. + **/ + public func createProduct( + body: ProductCreateUpdate, onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - - + PlatformAPIClient.execute( + config: config, + method: "post", + url: "/service/platform/catalog/v1.0/company/\(companyId)/products/", + query: nil, + body: body.dictionary, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(SuccessResponse.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Get a single product. + * Description: This API helps to get data associated to a particular product. + **/ + public func getProduct( + itemCode: String?, + itemId: Int, + brandUid: Int?, + + onResponse: @escaping (_ response: Product?, _ error: FDKError?) -> Void + ) { + var xQuery: [String: Any] = [:] - + if let value = itemCode { + xQuery["item_code"] = value + } + if let value = brandUid { + xQuery["brand_uid"] = value + } PlatformAPIClient.execute( config: config, - method: "delete", + method: "get", url: "/service/platform/catalog/v1.0/company/\(companyId)/products/\(itemId)/", - query: nil, + query: xQuery, body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5000,48 +3944,38 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(SuccessResponse.self, from: data) - + let response = Utility.decode(Product.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Edit a product. - * Description: This API allows to edit product. - **/ - public func editProduct( + * + * Summary: Delete a product. + * Description: This API allows to delete product. + **/ + public func deleteProduct( itemId: Int, - body: ProductCreateUpdate, + onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "put", + method: "delete", url: "/service/platform/catalog/v1.0/company/\(companyId)/products/\(itemId)/", query: nil, - body: body.dictionary, + body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5049,72 +3983,38 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SuccessResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get a single product. - * Description: This API helps to get data associated to a particular product. - **/ - public func getProduct( - itemCode: String?, + * + * Summary: Edit a product. + * Description: This API allows to edit product. + **/ + public func editProduct( itemId: Int, - brandUid: Int?, - uid: Int?, - - onResponse: @escaping (_ response: Product?, _ error: FDKError?) -> Void + body: ProductCreateUpdate, + onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = itemCode { - - xQuery["item_code"] = value - -} - - -if let value = brandUid { - - xQuery["brand_uid"] = value - -} - - -if let value = uid { - - xQuery["uid"] = value - -} - - - - - PlatformAPIClient.execute( config: config, - method: "get", + method: "put", url: "/service/platform/catalog/v1.0/company/\(companyId)/products/\(itemId)/", - query: xQuery, - body: nil, + query: nil, + body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5122,38 +4022,27 @@ if let value = uid { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(Product.self, from: data) - + let response = Utility.decode(SuccessResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Validate product/size data - * Description: This API validates product data. - **/ + * + * Summary: Validate product/size data + * Description: This API validates product data. + **/ public func getProductValidation( - onResponse: @escaping (_ response: ValidateProduct?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -5162,7 +4051,7 @@ if let value = uid { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5170,62 +4059,45 @@ if let value = uid { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ValidateProduct.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get a single product size. - * Description: This API helps to get data associated to a particular product size. - **/ + * + * Summary: Get a single product size. + * Description: This API helps to get data associated to a particular product size. + **/ public func getProductSize( itemCode: String?, itemId: Int, brandUid: Int?, uid: Int?, - + onResponse: @escaping (_ response: ProductListingResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = itemCode { - - xQuery["item_code"] = value - -} - - -if let value = brandUid { - - xQuery["brand_uid"] = value - -} - - -if let value = uid { - - xQuery["uid"] = value - -} + var xQuery: [String: Any] = [:] + if let value = itemCode { + xQuery["item_code"] = value + } - + if let value = brandUid { + xQuery["brand_uid"] = value + } + if let value = uid { + xQuery["uid"] = value + } PlatformAPIClient.execute( config: config, @@ -5235,7 +4107,7 @@ if let value = uid { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5243,47 +4115,49 @@ if let value = uid { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ProductListingResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create a Bulk asset upload Job. - * Description: This API helps to create a bulk asset upload job. - **/ - public func updateProductAssetsInBulk( - body: BulkJob, - onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void + * + * Summary: Get a list of all bulk product upload jobs. + * Description: This API helps to get bulk product upload jobs data. + **/ + public func getProductBulkUploadHistory( + pageNo: Int?, + pageSize: Int?, + + onResponse: @escaping (_ response: ProductBulkRequestList?, _ error: FDKError?) -> Void ) { - - + var xQuery: [String: Any] = [:] - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, - method: "post", + method: "get", url: "/service/platform/catalog/v1.0/company/\(companyId)/products/bulk", - query: nil, - body: body.dictionary, + query: xQuery, + body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5291,63 +4165,37 @@ if let value = uid { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(SuccessResponse.self, from: data) - + let response = Utility.decode(ProductBulkRequestList.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get a list of all bulk product upload jobs. - * Description: This API helps to get bulk product upload jobs data. - **/ - public func getProductBulkUploadHistory( - pageNo: Int?, - pageSize: Int?, - - onResponse: @escaping (_ response: ProductBulkRequestList?, _ error: FDKError?) -> Void + * + * Summary: Create a Bulk asset upload Job. + * Description: This API helps to create a bulk asset upload job. + **/ + public func updateProductAssetsInBulk( + body: BulkJob, + onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - - - PlatformAPIClient.execute( config: config, - method: "get", + method: "post", url: "/service/platform/catalog/v1.0/company/\(companyId)/products/bulk", - query: xQuery, - body: nil, + query: nil, + body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5355,39 +4203,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(ProductBulkRequestList.self, from: data) - + let response = Utility.decode(SuccessResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete Bulk product job. - * Description: This API allows to delete bulk product job associated with company. - **/ + * + * Summary: Delete Bulk product job. + * Description: This API allows to delete bulk product job associated with company. + **/ public func deleteProductBulkJob( batchId: Int, - + onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -5396,7 +4234,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5404,39 +4242,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SuccessResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create products in bulk associated with given batch Id. - * Description: This API helps to create products in bulk push to kafka for approval/creation. - **/ + * + * Summary: Create products in bulk associated with given batch Id. + * Description: This API helps to create products in bulk push to kafka for approval/creation. + **/ public func createProductsInBulk( batchId: String, body: BulkProductRequest, onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -5445,7 +4273,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5453,38 +4281,27 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SuccessResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get a list of all tags associated with company. - * Description: This API helps to get tags data associated to a particular copmpany. - **/ - public func getCompanyTags( - + * + * Summary: Get a list of all tags associated with company. + * Description: This API helps to get tags data associated to a particular company. + **/ + public func getProductTags( onResponse: @escaping (_ response: ProductTagsViewResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -5493,7 +4310,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5501,47 +4318,49 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ProductTagsViewResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create a Bulk asset upload Job. - * Description: This API helps to create a bulk asset upload job. - **/ - public func createProductAssetsInBulk( - body: ProductBulkAssets, - onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void + * + * Summary: Get a list of all bulk asset jobs. + * Description: This API helps to get bulk asset jobs data associated to a particular company. + **/ + public func getProductAssetsInBulk( + pageNo: Int?, + pageSize: Int?, + + onResponse: @escaping (_ response: BulkAssetResponse?, _ error: FDKError?) -> Void ) { - - + var xQuery: [String: Any] = [:] - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, - method: "post", + method: "get", url: "/service/platform/catalog/v1.0/company/\(companyId)/products/assets/bulk/", - query: nil, - body: body.dictionary, + query: xQuery, + body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5549,63 +4368,37 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(SuccessResponse.self, from: data) - + let response = Utility.decode(BulkAssetResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get a list of all bulk asset jobs. - * Description: This API helps to get bulk asset jobs data associated to a particular company. - **/ - public func getProductAssetsInBulk( - pageNo: Int?, - pageSize: Int?, - - onResponse: @escaping (_ response: BulkAssetResponse?, _ error: FDKError?) -> Void + * + * Summary: Create a Bulk asset upload Job. + * Description: This API helps to create a bulk asset upload job. + **/ + public func createProductAssetsInBulk( + body: ProductBulkAssets, + onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - - - PlatformAPIClient.execute( config: config, - method: "get", + method: "post", url: "/service/platform/catalog/v1.0/company/\(companyId)/products/assets/bulk/", - query: xQuery, - body: nil, + query: nil, + body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5613,40 +4406,30 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(BulkAssetResponse.self, from: data) - + let response = Utility.decode(SuccessResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete a Size associated with product. - * Description: This API allows to delete size associated with product. - **/ + * + * Summary: Delete a Size associated with product. + * Description: This API allows to delete size associated with product. + **/ public func deleteSize( itemId: Int, size: Int, - + onResponse: @escaping (_ response: ProductSizeDeleteResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -5655,7 +4438,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5663,49 +4446,61 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ProductSizeDeleteResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Add Inventory for particular size and store. - * Description: This API allows add Inventory for particular size and store. - **/ - public func addInventory( - itemId: Double, + * + * Summary: Get Inventory for company + * Description: This API allows get Inventory data for particular company grouped by size and store. + **/ + public func getInventoryBySize( + itemId: String, size: String, - body: InventoryRequest, - onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void + pageNo: Int?, + pageSize: Int?, + q: String?, + sellable: Bool?, + + onResponse: @escaping (_ response: InventoryResponse?, _ error: FDKError?) -> Void ) { - - + var xQuery: [String: Any] = [:] - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } + + if let value = q { + xQuery["q"] = value + } + + if let value = sellable { + xQuery["sellable"] = value + } PlatformAPIClient.execute( config: config, - method: "post", + method: "get", url: "/service/platform/catalog/v1.0/company/\(companyId)/products/\(itemId)/sizes/\(size)", - query: nil, - body: body.dictionary, + query: xQuery, + body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5713,73 +4508,39 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(SuccessResponse.self, from: data) - + let response = Utility.decode(InventoryResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get Inventory for company - * Description: This API allows get Inventory data for particular company grouped by size and store. - **/ - public func getInventoryBySize( - itemId: String, + * + * Summary: Add Inventory for particular size and store. + * Description: This API allows add Inventory for particular size and store. + **/ + public func addInventory( + itemId: Double, size: String, - pageNo: Int?, - pageSize: Int?, - q: String?, - - onResponse: @escaping (_ response: InventoryResponse?, _ error: FDKError?) -> Void + body: InventoryRequest, + onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = q { - - xQuery["q"] = value - -} - - - - - PlatformAPIClient.execute( config: config, - method: "get", + method: "post", url: "/service/platform/catalog/v1.0/company/\(companyId)/products/\(itemId)/sizes/\(size)", - query: xQuery, - body: nil, + query: nil, + body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5787,28 +4548,24 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(InventoryResponse.self, from: data) - + let response = Utility.decode(SuccessResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get Inventory for company - * Description: This API allows get Inventory data for particular company grouped by size and store. - **/ + * + * Summary: Get Inventory for company + * Description: This API allows get Inventory data for particular company grouped by size and store. + **/ public func getInventoryBySizeIdentifier( itemId: String, sizeIdentifier: String, @@ -5816,42 +4573,26 @@ if let value = q { pageSize: Int?, q: String?, locationIds: [Int]?, - + onResponse: @escaping (_ response: InventoryResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = q { - - xQuery["q"] = value - -} - - -if let value = locationIds { - - xQuery["location_ids"] = value - -} + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } - + if let value = q { + xQuery["q"] = value + } + if let value = locationIds { + xQuery["location_ids"] = value + } PlatformAPIClient.execute( config: config, @@ -5861,7 +4602,7 @@ if let value = locationIds { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5869,41 +4610,31 @@ if let value = locationIds { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(InventoryResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete a Inventory. - * Description: This API allows to delete inventory of a particular product for particular company. - **/ + * + * Summary: Delete a Inventory. + * Description: This API allows to delete inventory of a particular product for particular company. + **/ public func deleteInventory( size: String, itemId: Int, locationId: Double, - + onResponse: @escaping (_ response: InventoryDelete?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -5912,7 +4643,7 @@ if let value = locationIds { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5920,47 +4651,49 @@ if let value = locationIds { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(InventoryDelete.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create a Bulk Inventory upload Job. - * Description: This API helps to create a bulk Inventory upload job. - **/ - public func createBulkInventoryJob( - body: BulkJob, - onResponse: @escaping (_ response: CommonResponse?, _ error: FDKError?) -> Void + * + * Summary: Get a list of all bulk Inventory upload jobs. + * Description: This API helps to get bulk Inventory upload jobs data. + **/ + public func getInventoryBulkUploadHistory( + pageNo: Int?, + pageSize: Int?, + + onResponse: @escaping (_ response: BulkInventoryGet?, _ error: FDKError?) -> Void ) { - - + var xQuery: [String: Any] = [:] - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, - method: "post", + method: "get", url: "/service/platform/catalog/v1.0/company/\(companyId)/inventory/bulk/", - query: nil, - body: body.dictionary, + query: xQuery, + body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -5968,63 +4701,37 @@ if let value = locationIds { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(CommonResponse.self, from: data) - + let response = Utility.decode(BulkInventoryGet.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get a list of all bulk Inventory upload jobs. - * Description: This API helps to get bulk Inventory upload jobs data. - **/ - public func getInventoryBulkUploadHistory( - pageNo: Int?, - pageSize: Int?, - - onResponse: @escaping (_ response: BulkInventoryGet?, _ error: FDKError?) -> Void + * + * Summary: Create a Bulk Inventory upload Job. + * Description: This API helps to create a bulk Inventory upload job. + **/ + public func createBulkInventoryJob( + body: BulkJob, + onResponse: @escaping (_ response: CommonResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - - - PlatformAPIClient.execute( config: config, - method: "get", + method: "post", url: "/service/platform/catalog/v1.0/company/\(companyId)/inventory/bulk/", - query: xQuery, - body: nil, + query: nil, + body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6032,39 +4739,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(BulkInventoryGet.self, from: data) - + let response = Utility.decode(CommonResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete Bulk Inventory job. - * Description: This API allows to delete bulk Inventory job associated with company. - **/ + * + * Summary: Delete Bulk Inventory job. + * Description: This API allows to delete bulk Inventory job associated with company. + **/ public func deleteBulkInventoryJob( batchId: String, - + onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -6073,7 +4770,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6081,39 +4778,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SuccessResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create products in bulk associated with given batch Id. - * Description: This API helps to create products in bulk push to kafka for approval/creation. - **/ + * + * Summary: Create products in bulk associated with given batch Id. + * Description: This API helps to create products in bulk push to kafka for approval/creation. + **/ public func createBulkInventory( batchId: String, body: InventoryBulkRequest, onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -6122,7 +4809,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6130,47 +4817,36 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SuccessResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create a Inventory export Job. - * Description: This API helps to create a Inventory export job. - **/ - public func createInventoryExportJob( - body: InventoryExportRequest, - onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void + * + * Summary: Get Inventory export history. + * Description: This API helps to get Inventory export history. + **/ + public func getInventoryExport( + onResponse: @escaping (_ response: InventoryExportJob?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "post", + method: "get", url: "/service/platform/catalog/v1.0/company/\(companyId)/inventory/download/", query: nil, - body: body.dictionary, + body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6178,47 +4854,37 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(SuccessResponse.self, from: data) - + let response = Utility.decode(InventoryExportJob.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get Inventory export history. - * Description: This API helps to get Inventory export history. - **/ - public func getInventoryExport( - - onResponse: @escaping (_ response: InventoryExportJob?, _ error: FDKError?) -> Void + * + * Summary: Create a Inventory export Job. + * Description: This API helps to create a Inventory export job. + **/ + public func createInventoryExportJob( + body: InventoryExportRequest, + onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "get", + method: "post", url: "/service/platform/catalog/v1.0/company/\(companyId)/inventory/download/", query: nil, - body: nil, + body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6226,45 +4892,34 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(InventoryExportJob.self, from: data) - + let response = Utility.decode(SuccessResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get List of different filters for inventory export - * Description: This API allows get List of different filters like brand, store, and type for inventory export. - **/ + * + * Summary: Get List of different filters for inventory export + * Description: This API allows get List of different filters like brand, store, and type for inventory export. + **/ public func exportInventoryConfig( filterType: String?, - + onResponse: @escaping (_ response: InventoryConfig?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = filterType { - - xQuery["filter_type"] = value - -} - - - + var xQuery: [String: Any] = [:] + if let value = filterType { + xQuery["filter_type"] = value + } PlatformAPIClient.execute( config: config, @@ -6274,7 +4929,7 @@ if let value = filterType { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6282,109 +4937,44 @@ if let value = filterType { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(InventoryConfig.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - /** - * - * Summary: Create Hsn Code. - * Description: Create Hsn Code. - **/ - public func createHsnCode( - body: HsnUpsert, - onResponse: @escaping (_ response: HsnCode?, _ error: FDKError?) -> Void - ) { - - - - - - PlatformAPIClient.execute( - config: config, - method: "post", - url: "/service/platform/catalog/v1.0/company/\(companyId)/hsn/", - query: nil, - body: body.dictionary, - headers: [], - responseType: "application/json", - onResponse: { (responseData, error, responseCode) in - if let _ = error, let data = responseData { - var err = Utility.decode(FDKError.self, from: data) - if err?.status == nil { - err?.status = responseCode - } - onResponse(nil, err) - } else if let data = responseData { - - let response = Utility.decode(HsnCode.self, from: data) - onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Hsn Code List. - * Description: Hsn Code List. - **/ + * + * Summary: Hsn Code List. + * Description: Hsn Code List. + **/ public func getAllHsnCodes( pageNo: Int?, pageSize: Int?, q: String?, - + onResponse: @escaping (_ response: HsnCodesListingResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = q { - - xQuery["q"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = q { + xQuery["q"] = value + } PlatformAPIClient.execute( config: config, @@ -6394,7 +4984,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6402,48 +4992,37 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(HsnCodesListingResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update Hsn Code. - * Description: Update Hsn Code. - **/ - public func updateHsnCode( - id: String, + * + * Summary: Create Hsn Code. + * Description: Create Hsn Code. + **/ + public func createHsnCode( body: HsnUpsert, onResponse: @escaping (_ response: HsnCode?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "put", - url: "/service/platform/catalog/v1.0/company/\(companyId)/hsn/\(id)/", + method: "post", + url: "/service/platform/catalog/v1.0/company/\(companyId)/hsn/", query: nil, body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6451,39 +5030,29 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(HsnCode.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Fetch Hsn Code. - * Description: Fetch Hsn Code. - **/ + * + * Summary: Fetch Hsn Code. + * Description: Fetch Hsn Code. + **/ public func getHsnCode( id: String, - + onResponse: @escaping (_ response: HsnCode?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -6492,7 +5061,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6500,47 +5069,38 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(HsnCode.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Bulk Create or Update Hsn Code. - * Description: Bulk Create or Update Hsn Code. - **/ - public func bulkHsnCode( - body: BulkHsnUpsert, - onResponse: @escaping (_ response: BulkHsnResponse?, _ error: FDKError?) -> Void + * + * Summary: Update Hsn Code. + * Description: Update Hsn Code. + **/ + public func updateHsnCode( + id: String, + body: HsnUpsert, + onResponse: @escaping (_ response: HsnCode?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "post", - url: "/service/platform/catalog/v1.0/company/\(companyId)/hsn/bulk/", + method: "put", + url: "/service/platform/catalog/v1.0/company/\(companyId)/hsn/\(id)/", query: nil, body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6548,66 +5108,75 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(BulkHsnResponse.self, from: data) - + let response = Utility.decode(HsnCode.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - } - - - - public class CompanyProfile { - var config: PlatformConfig - var companyId: String - init(config: PlatformConfig) { - self.config = config - self.companyId = config.companyId - } - - - - /** - * - * Summary: Get company profile - * Description: This API allows to view the company profile of the seller account. - **/ - public func cbsOnboardGet( - - onResponse: @escaping (_ response: GetCompanyProfileSerializerResponse?, _ error: FDKError?) -> Void + * + * Summary: Bulk Create or Update Hsn Code. + * Description: Bulk Create or Update Hsn Code. + **/ + public func bulkHsnCode( + body: BulkHsnUpsert, + onResponse: @escaping (_ response: BulkHsnResponse?, _ error: FDKError?) -> Void ) { - - - - + PlatformAPIClient.execute( + config: config, + method: "post", + url: "/service/platform/catalog/v1.0/company/\(companyId)/hsn/bulk/", + query: nil, + body: body.dictionary, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(BulkHsnResponse.self, from: data) + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + /** + * + * Summary: Location Reassignment + * Description: + **/ + public func getOptimalLocations( + body: AssignStore, + onResponse: @escaping (_ response: StoreAssignResponse?, _ error: FDKError?) -> Void + ) { PlatformAPIClient.execute( config: config, - method: "get", - url: "/service/platform/company-profile/v1.0/company/\(companyId)", + method: "post", + url: "/service/platform/catalog/v1.0/company/\(companyId)/location/reassign/", query: nil, - body: nil, + body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6615,38 +5184,38 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(GetCompanyProfileSerializerResponse.self, from: data) - + let response = Utility.decode(StoreAssignResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) + } + } + + public class CompanyProfile { + var config: PlatformConfig + var companyId: String + + init(config: PlatformConfig) { + self.config = config + self.companyId = config.companyId } - - - - - + /** - * - * Summary: Edit company profile - * Description: This API allows to edit the company profile of the seller account. - **/ + * + * Summary: Edit company profile + * Description: This API allows to edit the company profile of the seller account. + **/ public func updateCompany( body: UpdateCompany, onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "patch", @@ -6655,7 +5224,7 @@ if let value = q { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6663,38 +5232,64 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SuccessResponse.self, from: data) - + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Get company profile + * Description: This API allows to view the company profile of the seller account. + **/ + public func cbsOnboardGet( + onResponse: @escaping (_ response: GetCompanyProfileSerializerResponse?, _ error: FDKError?) -> Void + ) { + PlatformAPIClient.execute( + config: config, + method: "get", + url: "/service/platform/company-profile/v1.0/company/\(companyId)", + query: nil, + body: nil, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(GetCompanyProfileSerializerResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get company metrics - * Description: This API allows to view the company metrics, i.e. the status of its brand and stores. Also its allows to view the number of products, company documents & store documents which are verified and unverified. - **/ + * + * Summary: Get company metrics + * Description: This API allows to view the company metrics, i.e. the status of its brand and stores. Also its allows to view the number of products, company documents & store documents which are verified and unverified. + **/ public func getCompanyMetrics( - onResponse: @escaping (_ response: MetricsSerializer?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -6703,7 +5298,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6711,39 +5306,68 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(MetricsSerializer.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get a single brand. - * Description: This API helps to get data associated to a particular brand. - **/ - public func getBrand( + * + * Summary: Edit a brand. + * Description: This API allows to edit meta of a brand. + **/ + public func editBrand( brandId: String, - - onResponse: @escaping (_ response: GetBrandResponseSerializer?, _ error: FDKError?) -> Void + body: CreateUpdateBrandRequestSerializer, + onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - - + PlatformAPIClient.execute( + config: config, + method: "put", + url: "/service/platform/company-profile/v1.0/company/\(companyId)/brand/\(brandId)", + query: nil, + body: body.dictionary, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(SuccessResponse.self, from: data) - + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + /** + * + * Summary: Get a single brand. + * Description: This API helps to get data associated to a particular brand. + **/ + public func getBrand( + brandId: String, + onResponse: @escaping (_ response: GetBrandResponseSerializer?, _ error: FDKError?) -> Void + ) { PlatformAPIClient.execute( config: config, method: "get", @@ -6752,7 +5376,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6760,48 +5384,37 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetBrandResponseSerializer.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Edit a brand. - * Description: This API allows to edit meta of a brand. - **/ - public func editBrand( - brandId: String, + * + * Summary: Create a Brand. + * Description: This API allows to create a brand associated to a company. + **/ + public func createBrand( body: CreateUpdateBrandRequestSerializer, onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "put", - url: "/service/platform/company-profile/v1.0/company/\(companyId)/brand/\(brandId)", + method: "post", + url: "/service/platform/company-profile/v1.0/company/\(companyId)/brand", query: nil, body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6809,47 +5422,37 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SuccessResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create a Brand. - * Description: This API allows to create a brand associated to a company. - **/ - public func createBrand( - body: CreateUpdateBrandRequestSerializer, + * + * Summary: Create a company brand mapping. + * Description: This API allows to create a company brand mapping, for a already existing brand in the system. + **/ + public func createCompanyBrandMapping( + body: CompanyBrandPostRequestSerializer, onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", - url: "/service/platform/company-profile/v1.0/company/\(companyId)/brand", + url: "/service/platform/company-profile/v1.0/company/\(companyId)/company-brand", query: nil, body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6857,61 +5460,44 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SuccessResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get brands associated to a company - * Description: This API helps to get view brands associated to a particular company. - **/ + * + * Summary: Get brands associated to a company + * Description: This API helps to get view brands associated to a particular company. + **/ public func getBrands( pageNo: Int?, pageSize: Int?, q: String?, - + onResponse: @escaping (_ response: CompanyBrandListSerializer?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = q { - - xQuery["q"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = q { + xQuery["q"] = value + } PlatformAPIClient.execute( config: config, @@ -6921,7 +5507,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -6929,69 +5515,39 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CompanyBrandListSerializer.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + /** - * - * Summary: get paginator for getBrands - * Description: fetch the next page by calling .next(...) function - **/ + * + * Summary: get paginator for getBrands + * Description: fetch the next page by calling .next(...) function + **/ public func getBrandsPaginator( pageSize: Int?, q: String? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getBrands( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - , - q: q - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + q: q + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -7001,34 +5557,25 @@ if let value = q { } return paginator } - - - - + /** - * - * Summary: Create a company brand mapping. - * Description: This API allows to create a company brand mapping, for a already existing brand in the system. - **/ - public func createCompanyBrandMapping( - body: CompanyBrandPostRequestSerializer, + * + * Summary: Create a location asscoiated to a company. + * Description: This API allows to create a location associated to a company. + **/ + public func createLocation( + body: LocationSerializer, onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", - url: "/service/platform/company-profile/v1.0/company/\(companyId)/company-brand", + url: "/service/platform/company-profile/v1.0/company/\(companyId)/location", query: nil, body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7036,77 +5583,54 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SuccessResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get list of locations - * Description: This API allows to view all the locations asscoiated to a company. - **/ + * + * Summary: Get list of locations + * Description: This API allows to view all the locations asscoiated to a company. + **/ public func getLocations( storeType: String?, q: String?, stage: String?, pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: LocationListSerializer?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = storeType { - - xQuery["store_type"] = value - -} - - -if let value = q { - - xQuery["q"] = value - -} - - -if let value = stage { - - xQuery["stage"] = value - -} - - -if let value = pageNo { - - xQuery["page_no"] = value - -} + var xQuery: [String: Any] = [:] + if let value = storeType { + xQuery["store_type"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = q { + xQuery["q"] = value + } + if let value = stage { + xQuery["stage"] = value + } - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -7116,7 +5640,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7124,85 +5648,43 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(LocationListSerializer.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + /** - * - * Summary: get paginator for getLocations - * Description: fetch the next page by calling .next(...) function - **/ + * + * Summary: get paginator for getLocations + * Description: fetch the next page by calling .next(...) function + **/ public func getLocationsPaginator( storeType: String?, q: String?, stage: String?, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getLocations( - - storeType: storeType, - q: q, - stage: stage, - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + storeType: storeType, + q: q, + stage: stage, + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -7212,34 +5694,26 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Create a location asscoiated to a company. - * Description: This API allows to create a location associated to a company. - **/ - public func createLocation( + * + * Summary: Edit a location asscoiated to a company. + * Description: This API allows to edit a location associated to a company. + **/ + public func updateLocation( + locationId: String, body: LocationSerializer, onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "post", - url: "/service/platform/company-profile/v1.0/company/\(companyId)/location", + method: "put", + url: "/service/platform/company-profile/v1.0/company/\(companyId)/location/\(locationId)", query: nil, body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7247,39 +5721,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SuccessResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get details of a specific location. - * Description: This API helps to get data associated to a specific location. - **/ + * + * Summary: Get details of a specific location. + * Description: This API helps to get data associated to a specific location. + **/ public func getLocationDetail( locationId: String, - + onResponse: @escaping (_ response: GetLocationSerializer?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -7288,7 +5752,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7296,87 +5760,28 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetLocationSerializer.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Edit a location asscoiated to a company. - * Description: This API allows to edit a location associated to a company. - **/ - public func updateLocation( - locationId: String, - body: LocationSerializer, + * + * Summary: Create a location asscoiated to a company in bulk. + * Description: This API allows to create a location associated to a company. + **/ + public func createLocationBulk( + body: BulkLocationSerializer, onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - - - - - - - PlatformAPIClient.execute( - config: config, - method: "put", - url: "/service/platform/company-profile/v1.0/company/\(companyId)/location/\(locationId)", - query: nil, - body: body.dictionary, - headers: [], - responseType: "application/json", - onResponse: { (responseData, error, responseCode) in - if let _ = error, let data = responseData { - var err = Utility.decode(FDKError.self, from: data) - if err?.status == nil { - err?.status = responseCode - } - onResponse(nil, err) - } else if let data = responseData { - - let response = Utility.decode(SuccessResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - /** - * - * Summary: Create a location asscoiated to a company in bulk. - * Description: This API allows to create a location associated to a company. - **/ - public func createLocationBulk( - body: BulkLocationSerializer, - onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void - ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -7385,7 +5790,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7393,25 +5798,21 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SuccessResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - - public class FileStorage { + + public class FileStorage { var config: PlatformConfig var companyId: String @@ -7419,44 +5820,35 @@ if let value = pageSize { self.config = config self.companyId = config.companyId } - - - - + /** - * - * Summary: This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob. - * Description: Uploads an arbitrarily sized buffer or blob. + * + * Summary: This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob. + * Description: Uploads an arbitrarily sized buffer or blob. -It has three Major Steps: -* Start -* Upload -* Complete + It has three Major Steps: + * Start + * Upload + * Complete -### Start -Initiates the assets upload using `startUpload`. -It returns the storage link in response. + ### Start + Initiates the assets upload using `startUpload`. + It returns the storage link in response. -### Upload -Use the storage link to upload a file (Buffer or Blob) to the File Storage. -Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body. + ### Upload + Use the storage link to upload a file (Buffer or Blob) to the File Storage. + Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body. -### Complete -After successfully upload, call `completeUpload` api to complete the upload process. -This operation will return the url for the uploaded file. + ### Complete + After successfully upload, call `completeUpload` api to complete the upload process. + This operation will return the url for the uploaded file. - **/ + **/ public func startUpload( namespace: String, body: StartRequest, onResponse: @escaping (_ response: StartResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -7465,7 +5857,7 @@ This operation will return the url for the uploaded file. body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7473,57 +5865,47 @@ This operation will return the url for the uploaded file. } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(StartResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process. - * Description: Uploads an arbitrarily sized buffer or blob. + * + * Summary: This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process. + * Description: Uploads an arbitrarily sized buffer or blob. -It has three Major Steps: -* Start -* Upload -* Complete + It has three Major Steps: + * Start + * Upload + * Complete -### Start -Initiates the assets upload using `startUpload`. -It returns the storage link in response. + ### Start + Initiates the assets upload using `startUpload`. + It returns the storage link in response. -### Upload -Use the storage link to upload a file (Buffer or Blob) to the File Storage. -Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body. + ### Upload + Use the storage link to upload a file (Buffer or Blob) to the File Storage. + Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body. -### Complete -After successfully upload, call `completeUpload` api to complete the upload process. -This operation will return the url for the uploaded file. + ### Complete + After successfully upload, call `completeUpload` api to complete the upload process. + This operation will return the url for the uploaded file. - **/ + **/ public func completeUpload( namespace: String, body: StartResponse, onResponse: @escaping (_ response: CompleteResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -7532,7 +5914,7 @@ This operation will return the url for the uploaded file. body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7540,40 +5922,28 @@ This operation will return the url for the uploaded file. } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CompleteResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - + /** - * - * Summary: Explain here - * Description: Describe here - **/ + * + * Summary: Explain here + * Description: Describe here + **/ public func getSignUrls( body: SignUrlRequest, onResponse: @escaping (_ response: SignUrlResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -7582,7 +5952,7 @@ This operation will return the url for the uploaded file. body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7590,45 +5960,34 @@ This operation will return the url for the uploaded file. } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SignUrlResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Copy Files - * Description: Copy Files - **/ + * + * Summary: Copy Files + * Description: Copy Files + **/ public func copyFiles( sync: Bool?, body: BulkRequest, onResponse: @escaping (_ response: BulkResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = sync { - - xQuery["sync"] = value - -} - - - + var xQuery: [String: Any] = [:] + if let value = sync { + xQuery["sync"] = value + } PlatformAPIClient.execute( config: config, @@ -7638,7 +5997,7 @@ if let value = sync { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7646,47 +6005,35 @@ if let value = sync { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(BulkResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - + /** - * - * Summary: Browse Files - * Description: Browse Files - **/ + * + * Summary: Browse Files + * Description: Browse Files + **/ public func browse( namespace: String, pageNo: Int?, - + onResponse: @escaping (_ response: BrowseResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - - + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } PlatformAPIClient.execute( config: config, @@ -7696,7 +6043,7 @@ if let value = pageNo { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7704,60 +6051,36 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(BrowseResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - - - - - - - - - - + /** - * - * Summary: get paginator for browse - * Description: fetch the next page by calling .next(...) function - **/ + * + * Summary: get paginator for browse + * Description: fetch the next page by calling .next(...) function + **/ public func browsePaginator( namespace: String - - ) -> Paginator { + + ) -> Paginator { let pageSize = 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.browse( - - namespace: namespace, - pageNo: paginator.pageNo - - ) { response, error in + namespace: namespace, + pageNo: paginator.pageNo + + ) { response, error in if let response = response { paginator.hasNext = response.page.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -7767,31 +6090,20 @@ if let value = pageNo { } return paginator } - - - - - + /** - * - * Summary: Proxy - * Description: Proxy - **/ + * + * Summary: Proxy + * Description: Proxy + **/ public func proxy( url: String, - + onResponse: @escaping (_ response: Data?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["url"] = url - - - - + var xQuery: [String: Any] = [:] + xQuery["url"] = url PlatformAPIClient.execute( config: config, @@ -7801,7 +6113,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/octet-stream", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7809,25 +6121,21 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = data - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - - public class Inventory { + + public class Inventory { var config: PlatformConfig var companyId: String @@ -7835,40 +6143,27 @@ var xQuery: [String: Any] = [:] self.config = config self.companyId = config.companyId } - - - - + /** - * - * Summary: Get Job Configs For A Company - * Description: REST Endpoint that returns all job configs for a company - **/ + * + * Summary: Get Job Configs For A Company + * Description: REST Endpoint that returns all job configs for a company + **/ public func getJobsByCompany( pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: ResponseEnvelopeListJobConfigRawDTO?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -7878,7 +6173,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7886,38 +6181,28 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ResponseEnvelopeListJobConfigRawDTO.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Updates An Existing Job Config - * Description: REST Endpoint that updates a job config - **/ + * + * Summary: Updates An Existing Job Config + * Description: REST Endpoint that updates a job config + **/ public func updateJob( body: JobConfigDTO, onResponse: @escaping (_ response: ResponseEnvelopeString?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -7926,7 +6211,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7934,38 +6219,28 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ResponseEnvelopeString.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Creates A New Job Config - * Description: REST Endpoint that creates a new job config - **/ + * + * Summary: Creates A New Job Config + * Description: REST Endpoint that creates a new job config + **/ public func createJob( body: JobConfigDTO, onResponse: @escaping (_ response: ResponseEnvelopeString?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -7974,7 +6249,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -7982,54 +6257,79 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ResponseEnvelopeString.self, from: data) - + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Get Job Code Steps + * Description: REST Endpoint that returns Inventory Job Steps + **/ + public func getJobSteps( + jobId: Int, + + onResponse: @escaping (_ response: ResponseEnvelopeListJobStepsDTO?, _ error: FDKError?) -> Void + ) { + PlatformAPIClient.execute( + config: config, + method: "get", + url: "/service/platform/inventory/v1.0/company/\(companyId)/jobs/steps/\(jobId)", + query: nil, + body: nil, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(ResponseEnvelopeListJobStepsDTO.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get Job Configs By Company And Integration - * Description: REST Endpoint that returns all job configs by company And integration - **/ + * + * Summary: Get Job Configs By Company And Integration + * Description: REST Endpoint that returns all job configs by company And integration + **/ public func getJobByCompanyAndIntegration( integrationId: String, pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: ResponseEnvelopeListJobConfigDTO?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -8039,7 +6339,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8047,38 +6347,66 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ResponseEnvelopeListJobConfigDTO.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get Job Configs Defaults - * Description: REST Endpoint that returns default fields job configs by company And integration - **/ - public func getJobConfigDefaults( - - onResponse: @escaping (_ response: ResponseEnvelopeJobConfigDTO?, _ error: FDKError?) -> Void - ) { - - + * + * Summary: Disable Job Config + * Description: REST Endpoint that disables Inventory Job Config + **/ + public func disable( + integrationId: String, - + onResponse: @escaping (_ response: ResponseEnvelopeString?, _ error: FDKError?) -> Void + ) { + PlatformAPIClient.execute( + config: config, + method: "get", + url: "/service/platform/inventory/v1.0/company/\(companyId)/jobs/disable/integration/\(integrationId)", + query: nil, + body: nil, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(ResponseEnvelopeString.self, from: data) + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + /** + * + * Summary: Get Job Configs Defaults + * Description: REST Endpoint that returns default fields job configs by company And integration + **/ + public func getJobConfigDefaults( + onResponse: @escaping (_ response: ResponseEnvelopeJobConfigDTO?, _ error: FDKError?) -> Void + ) { PlatformAPIClient.execute( config: config, method: "get", @@ -8087,7 +6415,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8095,39 +6423,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ResponseEnvelopeJobConfigDTO.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get Job Config By Code - * Description: REST Endpoint that returns job config by code - **/ + * + * Summary: Get Job Config By Code + * Description: REST Endpoint that returns job config by code + **/ public func getJobByCode( code: String, - + onResponse: @escaping (_ response: ResponseEnvelopeJobConfigDTO?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -8136,7 +6454,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8144,54 +6462,50 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ResponseEnvelopeJobConfigDTO.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get Job Metrics - * Description: REST Endpoint that returns Inventory Run History For A Job Code - **/ + * + * Summary: Get Job Metrics + * Description: REST Endpoint that returns Inventory Run History For A Job Code + **/ public func getJobCodeMetrics( code: String, pageNo: Int?, pageSize: Int?, - + status: String?, + date: String?, + onResponse: @escaping (_ response: ResponseEnvelopeJobMetricsDto?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } - + if let value = status { + xQuery["status"] = value + } + if let value = date { + xQuery["date"] = value + } PlatformAPIClient.execute( config: config, @@ -8201,7 +6515,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8209,54 +6523,40 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ResponseEnvelopeJobMetricsDto.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get Job Codes By Company And Integration - * Description: REST Endpoint that returns all job codes by company And integration - **/ + * + * Summary: Get Job Codes By Company And Integration + * Description: REST Endpoint that returns all job codes by company And integration + **/ public func getJobCodesByCompanyAndIntegration( integrationId: String, pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: ResponseEnvelopeListJobConfigListDTO?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -8266,7 +6566,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8274,25 +6574,21 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ResponseEnvelopeListJobConfigListDTO.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - - public class Configuration { + + public class Configuration { var config: PlatformConfig var companyId: String @@ -8300,50 +6596,16 @@ if let value = pageSize { self.config = config self.companyId = config.companyId } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + /** - * - * Summary: Create application - * Description: Create new application - **/ + * + * Summary: Create application + * Description: Create new application + **/ public func createApplication( body: CreateApplicationRequest, onResponse: @escaping (_ response: CreateAppResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -8352,7 +6614,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8360,61 +6622,44 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CreateAppResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get list of application under company - * Description: Get list of application under company - **/ + * + * Summary: Get list of application under company + * Description: Get list of application under company + **/ public func getApplications( pageNo: Int?, pageSize: Int?, q: String?, - + onResponse: @escaping (_ response: ApplicationsResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = q { - - xQuery["q"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = q { + xQuery["q"] = value + } PlatformAPIClient.execute( config: config, @@ -8424,7 +6669,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8432,69 +6677,39 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ApplicationsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + /** - * - * Summary: get paginator for getApplications - * Description: fetch the next page by calling .next(...) function - **/ + * + * Summary: get paginator for getApplications + * Description: fetch the next page by calling .next(...) function + **/ public func getApplicationsPaginator( pageSize: Int?, q: String? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getApplications( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - , - q: q - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + q: q + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -8504,26 +6719,15 @@ if let value = q { } return paginator } - - - - - + /** - * - * Summary: Get all currencies - * Description: Get all currencies - **/ + * + * Summary: Get all currencies + * Description: Get all currencies + **/ public func getCurrencies( - onResponse: @escaping (_ response: CurrenciesResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -8532,7 +6736,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8540,38 +6744,28 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CurrenciesResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Check domain availibility before linking to application - * Description: Check domain availibility before linking to application. Also sends domain suggestions with similar to queried domain. \ Custom domain search is currently powered by GoDaddy provider. - **/ + * + * Summary: Check domain availibility before linking to application + * Description: Check domain availibility before linking to application. Also sends domain suggestions with similar to queried domain. \ Custom domain search is currently powered by GoDaddy provider. + **/ public func getDomainAvailibility( body: DomainSuggestionsRequest, onResponse: @escaping (_ response: DomainSuggestionsResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -8580,7 +6774,7 @@ if let value = q { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8588,39 +6782,29 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DomainSuggestionsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get integration data - * Description: Get integration data - **/ + * + * Summary: Get integration data + * Description: Get integration data + **/ public func getIntegrationById( id: Int, - + onResponse: @escaping (_ response: Integration?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -8629,7 +6813,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8637,53 +6821,39 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Integration.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get all available integration opt-ins - * Description: Get all available integration opt-ins - **/ + * + * Summary: Get all available integration opt-ins + * Description: Get all available integration opt-ins + **/ public func getAvailableOptIns( pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: GetIntegrationsOptInsResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -8693,7 +6863,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8701,61 +6871,37 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetIntegrationsOptInsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - - - - - - - - - - + /** - * - * Summary: get paginator for getAvailableOptIns - * Description: fetch the next page by calling .next(...) function - **/ + * + * Summary: get paginator for getAvailableOptIns + * Description: fetch the next page by calling .next(...) function + **/ public func getAvailableOptInsPaginator( pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getAvailableOptIns( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -8765,42 +6911,29 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Get company/store level integration opt-ins - * Description: Get company/store level integration opt-ins - **/ + * + * Summary: Get company/store level integration opt-ins + * Description: Get company/store level integration opt-ins + **/ public func getSelectedOptIns( level: String, uid: Int, pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: GetIntegrationsOptInsResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - - + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -8810,7 +6943,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8818,77 +6951,41 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetIntegrationsOptInsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + /** - * - * Summary: get paginator for getSelectedOptIns - * Description: fetch the next page by calling .next(...) function - **/ + * + * Summary: get paginator for getSelectedOptIns + * Description: fetch the next page by calling .next(...) function + **/ public func getSelectedOptInsPaginator( level: String, uid: Int, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getSelectedOptIns( - - level: level, - uid: uid, - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + level: level, + uid: uid, + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -8898,42 +6995,29 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Get integration level config - * Description: Get integration/integration-opt-in level config - **/ + * + * Summary: Get integration level config + * Description: Get integration/integration-opt-in level config + **/ public func getIntegrationLevelConfig( id: String, level: String, opted: Bool?, checkPermission: Bool?, - + onResponse: @escaping (_ response: IntegrationConfigResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = opted { - - xQuery["opted"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = checkPermission { - - xQuery["check_permission"] = value - -} - - - + if let value = opted { + xQuery["opted"] = value + } + if let value = checkPermission { + xQuery["check_permission"] = value + } PlatformAPIClient.execute( config: config, @@ -8943,7 +7027,7 @@ if let value = checkPermission { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -8951,41 +7035,71 @@ if let value = checkPermission { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(IntegrationConfigResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get level data for integration - * Description: Get level data for integration - **/ - public func getIntegrationByLevelId( + * + * Summary: Update a store level opt-in for integration + * Description: Update a store level opt-in for integration + **/ + public func updateLevelIntegration( id: String, level: String, - uid: Int, - + body: UpdateIntegrationLevelRequest, onResponse: @escaping (_ response: IntegrationLevel?, _ error: FDKError?) -> Void ) { - - + PlatformAPIClient.execute( + config: config, + method: "put", + url: "/service/platform/configuration/v1.0/company/\(companyId)/integrationOptIn/configuration/\(id)/\(level)", + query: nil, + body: body.dictionary, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(IntegrationLevel.self, from: data) - + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + /** + * + * Summary: Get level data for integration + * Description: Get level data for integration + **/ + public func getIntegrationByLevelId( + id: String, + level: String, + uid: Int, + onResponse: @escaping (_ response: IntegrationLevel?, _ error: FDKError?) -> Void + ) { PlatformAPIClient.execute( config: config, method: "get", @@ -8994,7 +7108,7 @@ if let value = checkPermission { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9002,41 +7116,72 @@ if let value = checkPermission { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(IntegrationLevel.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Check store has active integration - * Description: API checks if a store is already opted in any other integrations - **/ - public func getLevelActiveIntegrations( + * + * Summary: Update a store level opt-in for integration + * Description: Update a store level opt-in for integration + **/ + public func updateLevelUidIntegration( id: String, level: String, uid: Int, - - onResponse: @escaping (_ response: OptedStoreIntegration?, _ error: FDKError?) -> Void + body: IntegrationLevel, + onResponse: @escaping (_ response: IntegrationLevel?, _ error: FDKError?) -> Void ) { - - + PlatformAPIClient.execute( + config: config, + method: "put", + url: "/service/platform/configuration/v1.0/company/\(companyId)/integrationOptIn/configuration/\(id)/\(level)/\(uid)", + query: nil, + body: body.dictionary, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(IntegrationLevel.self, from: data) - + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + /** + * + * Summary: Check store has active integration + * Description: API checks if a store is already opted in any other integrations + **/ + public func getLevelActiveIntegrations( + id: String, + level: String, + uid: Int, + onResponse: @escaping (_ response: OptedStoreIntegration?, _ error: FDKError?) -> Void + ) { PlatformAPIClient.execute( config: config, method: "get", @@ -9045,7 +7190,7 @@ if let value = checkPermission { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9053,45 +7198,34 @@ if let value = checkPermission { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OptedStoreIntegration.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get brands by company - * Description: Get brands by company - **/ + * + * Summary: Get brands by company + * Description: Get brands by company + **/ public func getBrandsByCompany( q: String?, - + onResponse: @escaping (_ response: BrandsByCompanyResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = q { - - xQuery["q"] = value - -} - - - + var xQuery: [String: Any] = [:] + if let value = q { + xQuery["q"] = value + } PlatformAPIClient.execute( config: config, @@ -9101,7 +7235,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9109,53 +7243,39 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(BrandsByCompanyResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get company by brand uids - * Description: Get company by brand uids - **/ + * + * Summary: Get company by brand uids + * Description: Get company by brand uids + **/ public func getCompanyByBrands( pageNo: Int?, pageSize: Int?, body: CompanyByBrandsRequest, onResponse: @escaping (_ response: CompanyByBrandsResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -9165,7 +7285,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9173,61 +7293,38 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CompanyByBrandsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - - - - - - - - - - + /** - * - * Summary: get paginator for getCompanyByBrands - * Description: fetch the next page by calling .next(...) function - **/ + * + * Summary: get paginator for getCompanyByBrands + * Description: fetch the next page by calling .next(...) function + **/ public func getCompanyByBrandsPaginator( pageSize: Int?, - - body: CompanyByBrandsRequest) -> Paginator { + + body: CompanyByBrandsRequest + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getCompanyByBrands( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - ,body: body - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + body: body + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -9237,40 +7334,27 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Get stores by brand uids - * Description: Get stores by brand uids - **/ + * + * Summary: Get stores by brand uids + * Description: Get stores by brand uids + **/ public func getStoreByBrands( pageNo: Int?, pageSize: Int?, body: StoreByBrandsRequest, onResponse: @escaping (_ response: StoreByBrandsResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -9280,7 +7364,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9288,61 +7372,38 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(StoreByBrandsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - - - - - - - - - - + /** - * - * Summary: get paginator for getStoreByBrands - * Description: fetch the next page by calling .next(...) function - **/ + * + * Summary: get paginator for getStoreByBrands + * Description: fetch the next page by calling .next(...) function + **/ public func getStoreByBrandsPaginator( pageSize: Int?, - - body: StoreByBrandsRequest) -> Paginator { + + body: StoreByBrandsRequest + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getStoreByBrands( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - ,body: body - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + body: body + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -9352,40 +7413,27 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Get other seller applications - * Description: Get other seller applications who has opted current company as inventory - **/ + * + * Summary: Get other seller applications + * Description: Get other seller applications who has opted current company as inventory + **/ public func getOtherSellerApplications( pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: OtherSellerApplications?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -9395,7 +7443,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9403,61 +7451,37 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OtherSellerApplications.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - - - - - - - - - - + /** - * - * Summary: get paginator for getOtherSellerApplications - * Description: fetch the next page by calling .next(...) function - **/ + * + * Summary: get paginator for getOtherSellerApplications + * Description: fetch the next page by calling .next(...) function + **/ public func getOtherSellerApplicationsPaginator( pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getOtherSellerApplications( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -9467,26 +7491,17 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Get other seller applications - * Description: Get other seller application - **/ + * + * Summary: Get other seller applications + * Description: Get other seller application + **/ public func getOtherSellerApplicationById( id: String, - + onResponse: @escaping (_ response: OptedApplicationResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -9495,7 +7510,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9503,39 +7518,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OptedApplicationResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Opt out company or store from other seller application - * Description: Opt out company or store from other seller application - **/ + * + * Summary: Opt out company or store from other seller application + * Description: Opt out company or store from other seller application + **/ public func optOutFromApplication( id: String, body: OptOutInventory, onResponse: @escaping (_ response: SuccessMessageResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -9544,7 +7549,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9552,25 +7557,21 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SuccessMessageResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - - public class Analytics { + + public class Analytics { var config: PlatformConfig var companyId: String @@ -9578,34 +7579,17 @@ if let value = pageSize { self.config = config self.companyId = config.companyId } - - - - - - - - - - - - + /** - * - * Summary: Create data export job in required format - * Description: Create data export job in required format - **/ + * + * Summary: Create data export job in required format + * Description: Create data export job in required format + **/ public func createExportJob( exportType: String, body: ExportJobReq, onResponse: @escaping (_ response: ExportJobRes?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -9614,7 +7598,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9622,40 +7606,30 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ExportJobRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get data export job status - * Description: Get data export job status - **/ + * + * Summary: Get data export job status + * Description: Get data export job status + **/ public func getExportJobStatus( exportType: String, jobId: String, - + onResponse: @escaping (_ response: ExportJobStatusRes?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -9664,7 +7638,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9672,28 +7646,24 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ExportJobStatusRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get logs list - * Description: Get logs list - **/ + * + * Summary: Get logs list + * Description: Get logs list + **/ public func getLogsList( logType: String, pageNo: Int?, @@ -9701,25 +7671,15 @@ if let value = pageSize { body: GetLogsListReq, onResponse: @escaping (_ response: GetLogsListRes?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -9729,7 +7689,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9737,69 +7697,40 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetLogsListRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + /** - * - * Summary: get paginator for getLogsList - * Description: fetch the next page by calling .next(...) function - **/ + * + * Summary: get paginator for getLogsList + * Description: fetch the next page by calling .next(...) function + **/ public func getLogsListPaginator( logType: String, pageSize: Int?, - - body: GetLogsListReq) -> Paginator { + + body: GetLogsListReq + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getLogsList( - - logType: logType, - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - ,body: body - ) { response, error in + logType: logType, + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + body: body + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -9809,15 +7740,12 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Search logs - * Description: Search logs - **/ + * + * Summary: Search logs + * Description: Search logs + **/ public func searchLogs( pageNo: Int?, pageSize: Int?, @@ -9825,25 +7753,15 @@ if let value = pageSize { body: SearchLogReq, onResponse: @escaping (_ response: SearchLogRes?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -9853,7 +7771,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -9861,69 +7779,40 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SearchLogRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + /** - * - * Summary: get paginator for searchLogs - * Description: fetch the next page by calling .next(...) function - **/ + * + * Summary: get paginator for searchLogs + * Description: fetch the next page by calling .next(...) function + **/ public func searchLogsPaginator( pageSize: Int?, logType: String, - - body: SearchLogReq) -> Paginator { + + body: SearchLogReq + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.searchLogs( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - , - logType: logType,body: body - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + logType: logType, body: body + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -9933,12 +7822,9 @@ if let value = pageSize { } return paginator } - } - - - - public class Discount { + + public class Discount { var config: PlatformConfig var companyId: String @@ -9946,15 +7832,12 @@ if let value = pageSize { self.config = config self.companyId = config.companyId } - - - - + /** - * - * Summary: Fetch discount list. - * Description: Fetch discount list. - **/ + * + * Summary: Fetch discount list. + * Description: Fetch discount list. + **/ public func getDiscounts( view: String?, q: String?, @@ -9965,77 +7848,46 @@ if let value = pageSize { year: Int?, type: String?, appIds: [String]?, - + onResponse: @escaping (_ response: ListOrCalender?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = view { - - xQuery["view"] = value - -} + if let value = view { + xQuery["view"] = value + } + if let value = q { + xQuery["q"] = value + } -if let value = q { - - xQuery["q"] = value - -} + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } -if let value = pageNo { - - xQuery["page_no"] = value - -} + if let value = archived { + xQuery["archived"] = value + } + if let value = month { + xQuery["month"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = year { + xQuery["year"] = value + } + if let value = type { + xQuery["type"] = value + } -if let value = archived { - - xQuery["archived"] = value - -} - - -if let value = month { - - xQuery["month"] = value - -} - - -if let value = year { - - xQuery["year"] = value - -} - - -if let value = type { - - xQuery["type"] = value - -} - - -if let value = appIds { - - xQuery["app_ids"] = value - -} - - - - + if let value = appIds { + xQuery["app_ids"] = value + } PlatformAPIClient.execute( config: config, @@ -10045,7 +7897,7 @@ if let value = appIds { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10053,38 +7905,28 @@ if let value = appIds { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ListOrCalender.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create Discount. - * Description: Create Discount. - **/ + * + * Summary: Create Discount. + * Description: Create Discount. + **/ public func createDiscount( body: CreateUpdateDiscount, onResponse: @escaping (_ response: DiscountJob?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -10093,7 +7935,7 @@ if let value = appIds { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10101,39 +7943,29 @@ if let value = appIds { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DiscountJob.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Fetch discount. - * Description: Fetch discount. - **/ + * + * Summary: Fetch discount. + * Description: Fetch discount. + **/ public func getDiscount( id: String, - + onResponse: @escaping (_ response: DiscountJob?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -10142,7 +7974,7 @@ if let value = appIds { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10150,39 +7982,29 @@ if let value = appIds { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DiscountJob.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create Discount. - * Description: Create Discount. - **/ + * + * Summary: Create Discount. + * Description: Create Discount. + **/ public func updateDiscount( id: String, body: CreateUpdateDiscount, onResponse: @escaping (_ response: DiscountJob?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -10191,7 +8013,7 @@ if let value = appIds { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10199,45 +8021,34 @@ if let value = appIds { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DiscountJob.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Validate File. - * Description: Validate File. - **/ + * + * Summary: Validate File. + * Description: Validate File. + **/ public func validateDiscountFile( discount: String?, body: DiscountJob, onResponse: @escaping (_ response: FileJobResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = discount { - - xQuery["discount"] = value - -} - - - + var xQuery: [String: Any] = [:] + if let value = discount { + xQuery["discount"] = value + } PlatformAPIClient.execute( config: config, @@ -10247,7 +8058,7 @@ if let value = discount { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10255,39 +8066,29 @@ if let value = discount { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(FileJobResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Validate File. - * Description: Validate File. - **/ + * + * Summary: Validate File. + * Description: Validate File. + **/ public func downloadDiscountFile( type: String, body: DownloadFileJob, onResponse: @escaping (_ response: FileJobResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -10296,7 +8097,7 @@ if let value = discount { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10304,39 +8105,29 @@ if let value = discount { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(FileJobResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Validate File Job. - * Description: Validate File Job. - **/ + * + * Summary: Validate File Job. + * Description: Validate File Job. + **/ public func getValidationJob( id: String, - + onResponse: @escaping (_ response: FileJobResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -10345,7 +8136,7 @@ if let value = discount { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10353,39 +8144,29 @@ if let value = discount { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(FileJobResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Cancel Validation Job. - * Description: Cancel Validation Job. - **/ + * + * Summary: Cancel Validation Job. + * Description: Cancel Validation Job. + **/ public func cancelValidationJob( id: String, - + onResponse: @escaping (_ response: CancelJobResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -10394,7 +8175,7 @@ if let value = discount { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10402,39 +8183,29 @@ if let value = discount { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CancelJobResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Download File Job. - * Description: Download File Job. - **/ + * + * Summary: Download File Job. + * Description: Download File Job. + **/ public func getDownloadJob( id: String, - + onResponse: @escaping (_ response: FileJobResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -10443,7 +8214,7 @@ if let value = discount { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10451,39 +8222,29 @@ if let value = discount { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(FileJobResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Cancel Download Job. - * Description: Cancel Download Job. - **/ + * + * Summary: Cancel Download Job. + * Description: Cancel Download Job. + **/ public func cancelDownloadJob( id: String, - + onResponse: @escaping (_ response: CancelJobResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -10492,7 +8253,7 @@ if let value = discount { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10500,25 +8261,21 @@ if let value = discount { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CancelJobResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - - public class Webhook { + + public class Webhook { var config: PlatformConfig var companyId: String @@ -10526,40 +8283,32 @@ if let value = discount { self.config = config self.companyId = config.companyId } - - - - + /** - * - * Summary: Get Subscribers By Company ID - * Description: Get Subscribers By CompanyId - **/ + * + * Summary: Get Subscribers By Company ID + * Description: Get Subscribers By CompanyId + **/ public func getSubscribersByCompany( pageNo: Int?, pageSize: Int?, - + extensionId: String?, + onResponse: @escaping (_ response: SubscriberResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = extensionId { + xQuery["extension_id"] = value + } PlatformAPIClient.execute( config: config, @@ -10569,7 +8318,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10577,38 +8326,28 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SubscriberResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Register Subscriber - * Description: Register Subscriber - **/ + * + * Summary: Register Subscriber + * Description: Register Subscriber + **/ public func registerSubscriberToEvent( body: SubscriberConfig, onResponse: @escaping (_ response: SubscriberConfig?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -10617,7 +8356,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10625,38 +8364,28 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SubscriberConfig.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update Subscriber - * Description: Update Subscriber - **/ + * + * Summary: Update Subscriber + * Description: Update Subscriber + **/ public func updateSubscriberConfig( body: SubscriberConfig, onResponse: @escaping (_ response: SubscriberConfig?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -10665,7 +8394,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10673,39 +8402,80 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SubscriberConfig.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get Subscriber By Subscriber ID - * Description: Get Subscriber By Subscriber ID - **/ - public func getSubscriberById( - subscriberId: Int, - - onResponse: @escaping (_ response: SubscriberResponse?, _ error: FDKError?) -> Void + * + * Summary: Get Subscribers By Extension ID + * Description: Get Subscribers By ExtensionID + **/ + public func getSubscribersByExtensionId( + pageNo: Int?, + pageSize: Int?, + extensionId: String, + + onResponse: @escaping (_ response: SubscriberConfigList?, _ error: FDKError?) -> Void ) { - - + var xQuery: [String: Any] = [:] + + if let value = pageNo { + xQuery["page_no"] = value + } + + if let value = pageSize { + xQuery["page_size"] = value + } + + PlatformAPIClient.execute( + config: config, + method: "get", + url: "/service/platform/webhook/v1.0/company/\(companyId)/extension/\(extensionId)/subscriber", + query: xQuery, + body: nil, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(SubscriberConfigList.self, from: data) - + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + /** + * + * Summary: Get Subscriber By Subscriber ID + * Description: Get Subscriber By Subscriber ID + **/ + public func getSubscriberById( + subscriberId: Int, + onResponse: @escaping (_ response: SubscriberResponse?, _ error: FDKError?) -> Void + ) { PlatformAPIClient.execute( config: config, method: "get", @@ -10714,7 +8484,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10722,38 +8492,27 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SubscriberResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get All Webhook Events - * Description: Get All Webhook Events - **/ + * + * Summary: Get All Webhook Events + * Description: Get All Webhook Events + **/ public func fetchAllEventConfigurations( - - onResponse: @escaping (_ response: EventConfigList?, _ error: FDKError?) -> Void + onResponse: @escaping (_ response: EventConfigResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -10762,7 +8521,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10770,26 +8529,22 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(EventConfigList.self, from: data) - + let response = Utility.decode(EventConfigResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - public func applicationClient(id: String) -> ApplicationClient { - return ApplicationClient(applicationId: id, config: config) + ApplicationClient(applicationId: id, config: config) } public class ApplicationClient { @@ -10797,83 +8552,77 @@ if let value = pageSize { var companyId: String var applicationId: String - public let lead: Lead - + public let feedback: Feedback - + public let theme: Theme - + public let user: User - + public let content: Content - + public let communication: Communication - + public let payment: Payment - + public let order: Order - + public let catalog: Catalog - + public let fileStorage: FileStorage - + public let share: Share - + public let configuration: Configuration - + public let cart: Cart - + public let rewards: Rewards - + public let analytics: Analytics - + public let partner: Partner - - + public init(applicationId: String, config: PlatformConfig) { self.config = config self.companyId = config.companyId self.applicationId = applicationId - lead = Lead(config: config, applicationId: applicationId) - + feedback = Feedback(config: config, applicationId: applicationId) - + theme = Theme(config: config, applicationId: applicationId) - + user = User(config: config, applicationId: applicationId) - + content = Content(config: config, applicationId: applicationId) - + communication = Communication(config: config, applicationId: applicationId) - + payment = Payment(config: config, applicationId: applicationId) - + order = Order(config: config, applicationId: applicationId) - + catalog = Catalog(config: config, applicationId: applicationId) - + fileStorage = FileStorage(config: config, applicationId: applicationId) - + share = Share(config: config, applicationId: applicationId) - + configuration = Configuration(config: config, applicationId: applicationId) - + cart = Cart(config: config, applicationId: applicationId) - + rewards = Rewards(config: config, applicationId: applicationId) - + analytics = Analytics(config: config, applicationId: applicationId) - + partner = Partner(config: config, applicationId: applicationId) - } - - - public class Lead { + public class Lead { var config: PlatformConfig var companyId: String var applicationId: String @@ -10883,17 +8632,12 @@ if let value = pageSize { self.companyId = config.companyId self.applicationId = applicationId } - - - - - - - /** - * - * Summary: Gets the list of Application level Tickets and/or ticket filters depending on query params - * Description: Gets the list of Application level Tickets and/or ticket filters - **/ + + /** + * + * Summary: Gets the list of Application level Tickets and/or ticket filters depending on query params + * Description: Gets the list of Application level Tickets and/or ticket filters + **/ public func getTickets( items: Bool?, filters: Bool?, @@ -10901,56 +8645,34 @@ if let value = pageSize { status: String?, priority: PriorityEnum?, category: String?, - + onResponse: @escaping (_ response: TicketList?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = items { - - xQuery["items"] = value - -} - - -if let value = filters { - - xQuery["filters"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = q { - - xQuery["q"] = value - -} - - -if let value = status { - - xQuery["status"] = value - -} - - -if let value = priority { - - xQuery["priority"] = value.rawValue - -} + if let value = items { + xQuery["items"] = value + } + if let value = filters { + xQuery["filters"] = value + } -if let value = category { - - xQuery["category"] = value - -} + if let value = q { + xQuery["q"] = value + } + if let value = status { + xQuery["status"] = value + } - + if let value = priority { + xQuery["priority"] = value.rawValue + } + if let value = category { + xQuery["category"] = value + } PlatformAPIClient.execute( config: config, @@ -10960,7 +8682,7 @@ if let value = category { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -10968,41 +8690,29 @@ if let value = category { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TicketList.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - + /** - * - * Summary: Retreives ticket details of a application level ticket - * Description: Retreives ticket details of a application level ticket with ticket ID - **/ + * + * Summary: Retreives ticket details of a application level ticket + * Description: Retreives ticket details of a application level ticket with ticket ID + **/ public func getTicket( id: String, - + onResponse: @escaping (_ response: Ticket?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -11011,7 +8721,7 @@ if let value = category { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11019,39 +8729,29 @@ if let value = category { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Ticket.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Edits ticket details of a application level ticket - * Description: Edits ticket details of a application level ticket such as status, priority, category, tags, attachments, assigne & ticket content changes - **/ + * + * Summary: Edits ticket details of a application level ticket + * Description: Edits ticket details of a application level ticket such as status, priority, category, tags, attachments, assigne & ticket content changes + **/ public func editTicket( id: String, body: EditTicketPayload, onResponse: @escaping (_ response: Ticket?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -11060,7 +8760,7 @@ if let value = category { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11068,43 +8768,29 @@ if let value = category { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Ticket.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - + /** - * - * Summary: Create history for specific application level ticket - * Description: Create history for specific application level ticket, this history is seen on ticket detail page, this can be comment, log or rating. - **/ + * + * Summary: Create history for specific application level ticket + * Description: Create history for specific application level ticket, this history is seen on ticket detail page, this can be comment, log or rating. + **/ public func createHistory( id: String, body: TicketHistoryPayload, onResponse: @escaping (_ response: TicketHistory?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -11113,7 +8799,7 @@ if let value = category { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11121,39 +8807,29 @@ if let value = category { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TicketHistory.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Gets history list for specific application level ticket - * Description: Gets history list for specific application level ticket, this history is seen on ticket detail page, this can be comment, log or rating. - **/ + * + * Summary: Gets history list for specific application level ticket + * Description: Gets history list for specific application level ticket, this history is seen on ticket detail page, this can be comment, log or rating. + **/ public func getTicketHistory( id: String, - + onResponse: @escaping (_ response: TicketHistoryList?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -11162,7 +8838,7 @@ if let value = category { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11170,39 +8846,29 @@ if let value = category { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TicketHistoryList.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get specific custom form using it's slug - * Description: Get specific custom form using it's slug, this is used to view the form. - **/ + * + * Summary: Get specific custom form using it's slug + * Description: Get specific custom form using it's slug, this is used to view the form. + **/ public func getCustomForm( slug: String, - + onResponse: @escaping (_ response: CustomForm?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -11211,7 +8877,7 @@ if let value = category { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11219,39 +8885,29 @@ if let value = category { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CustomForm.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Edit the given custom form - * Description: Edit the given custom form field such as adding or deleting input, assignee, title, decription, notification and polling information. - **/ + * + * Summary: Edit the given custom form + * Description: Edit the given custom form field such as adding or deleting input, assignee, title, decription, notification and polling information. + **/ public func editCustomForm( slug: String, body: EditCustomFormPayload, onResponse: @escaping (_ response: CustomForm?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -11260,7 +8916,7 @@ if let value = category { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11268,38 +8924,27 @@ if let value = category { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CustomForm.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get list of custom form - * Description: Get list of custom form for given application - **/ + * + * Summary: Get list of custom form + * Description: Get list of custom form for given application + **/ public func getCustomForms( - onResponse: @escaping (_ response: CustomFormList?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -11308,7 +8953,7 @@ if let value = category { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11316,38 +8961,28 @@ if let value = category { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CustomFormList.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Creates a new custom form - * Description: Creates a new custom form for given application - **/ + * + * Summary: Creates a new custom form + * Description: Creates a new custom form for given application + **/ public func createCustomForm( body: CreateCustomFormPayload, onResponse: @escaping (_ response: CustomForm?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -11356,7 +8991,7 @@ if let value = category { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11364,40 +8999,29 @@ if let value = category { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CustomForm.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - + /** - * - * Summary: Get Token to join a specific Video Room using it's unqiue name - * Description: Get Token to join a specific Video Room using it's unqiue name, this Token is your ticket to Room and also creates your identity there. - **/ + * + * Summary: Get Token to join a specific Video Room using it's unqiue name + * Description: Get Token to join a specific Video Room using it's unqiue name, this Token is your ticket to Room and also creates your identity there. + **/ public func getTokenForVideoRoom( uniqueName: String, - + onResponse: @escaping (_ response: GetTokenForVideoRoomResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -11406,7 +9030,7 @@ if let value = category { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11414,40 +9038,29 @@ if let value = category { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetTokenForVideoRoomResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - + /** - * - * Summary: Get participants of a specific Video Room using it's unique name - * Description: Get participants of a specific Video Room using it's unique name, this can be used to check if people are already there in the room and also to show their names. - **/ + * + * Summary: Get participants of a specific Video Room using it's unique name + * Description: Get participants of a specific Video Room using it's unique name, this can be used to check if people are already there in the room and also to show their names. + **/ public func getVideoParticipants( uniqueName: String, - + onResponse: @escaping (_ response: GetParticipantsInsideVideoRoomResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -11456,7 +9069,7 @@ if let value = category { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11464,38 +9077,28 @@ if let value = category { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetParticipantsInsideVideoRoomResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Open a video room. - * Description: Open a video room. - **/ + * + * Summary: Open a video room. + * Description: Open a video room. + **/ public func openVideoRoom( body: CreateVideoRoomPayload, onResponse: @escaping (_ response: CreateVideoRoomResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -11504,7 +9107,7 @@ if let value = category { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11512,39 +9115,29 @@ if let value = category { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CreateVideoRoomResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Close the video room and force all participants to leave. - * Description: Close the video room and force all participants to leave. - **/ + * + * Summary: Close the video room and force all participants to leave. + * Description: Close the video room and force all participants to leave. + **/ public func closeVideoRoom( uniqueName: String, - + onResponse: @escaping (_ response: CloseVideoRoomResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -11553,7 +9146,7 @@ if let value = category { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11561,25 +9154,21 @@ if let value = category { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CloseVideoRoomResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - - public class Feedback { + + public class Feedback { var config: PlatformConfig var companyId: String var applicationId: String @@ -11589,40 +9178,27 @@ if let value = category { self.companyId = config.companyId self.applicationId = applicationId } - - - - + /** - * - * Summary: Get list of attribute data - * Description: Provides a list of all attribute data. - **/ + * + * Summary: Get list of attribute data + * Description: Provides a list of all attribute data. + **/ public func getAttributes( pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: FeedbackAttributes?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -11632,7 +9208,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11640,63 +9216,37 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(FeedbackAttributes.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getAttributes - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getAttributes + * Description: fetch the next page by calling .next(...) function + **/ public func getAttributesPaginator( pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getAttributes( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -11706,15 +9256,12 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Get list of customer reviews [admin] - * Description: The endpoint provides a list of customer reviews based on entity and provided filters - **/ + * + * Summary: Get list of customer reviews [admin] + * Description: The endpoint provides a list of customer reviews based on entity and provided filters + **/ public func getCustomerReviews( id: String?, entityId: String?, @@ -11731,119 +9278,70 @@ if let value = pageSize { count: String?, pageId: String?, pageSize: Int?, - + onResponse: @escaping (_ response: GetReviewResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = id { - - xQuery["id"] = value - -} - - -if let value = entityId { - - xQuery["entity_id"] = value - -} - - -if let value = entityType { - - xQuery["entity_type"] = value - -} - - -if let value = userId { - - xQuery["user_id"] = value - -} - - -if let value = media { - - xQuery["media"] = value - -} - - -if let value = rating { - - xQuery["rating"] = value - -} - - -if let value = attributeRating { - - xQuery["attribute_rating"] = value - -} - - -if let value = facets { - - xQuery["facets"] = value - -} - - -if let value = sort { - - xQuery["sort"] = value - -} + var xQuery: [String: Any] = [:] + if let value = id { + xQuery["id"] = value + } -if let value = next { - - xQuery["next"] = value - -} + if let value = entityId { + xQuery["entity_id"] = value + } + if let value = entityType { + xQuery["entity_type"] = value + } -if let value = start { - - xQuery["start"] = value - -} + if let value = userId { + xQuery["user_id"] = value + } + if let value = media { + xQuery["media"] = value + } -if let value = limit { - - xQuery["limit"] = value - -} + if let value = rating { + xQuery["rating"] = value + } + if let value = attributeRating { + xQuery["attribute_rating"] = value + } -if let value = count { - - xQuery["count"] = value - -} + if let value = facets { + xQuery["facets"] = value + } + if let value = sort { + xQuery["sort"] = value + } -if let value = pageId { - - xQuery["page_id"] = value - -} + if let value = next { + xQuery["next"] = value + } + if let value = start { + xQuery["start"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = limit { + xQuery["limit"] = value + } + if let value = count { + xQuery["count"] = value + } - + if let value = pageId { + xQuery["page_id"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -11853,7 +9351,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -11861,127 +9359,24 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetReviewResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getCustomerReviews - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getCustomerReviews + * Description: fetch the next page by calling .next(...) function + **/ public func getCustomerReviewsPaginator( id: String?, entityId: String?, @@ -11997,61 +9392,50 @@ if let value = pageSize { limit: String?, count: String?, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "cursor") paginator.onPage = { self.getCustomerReviews( - - id: id, - entityId: entityId, - entityType: entityType, - userId: userId, - media: media, - rating: rating, - attributeRating: attributeRating, - facets: facets, - sort: sort, - next: next, - start: start, - limit: limit, - count: count, - pageId: paginator.pageId - , - pageSize: paginator.pageSize - - ) { response, error in + id: id, + entityId: entityId, + entityType: entityType, + userId: userId, + media: media, + rating: rating, + attributeRating: attributeRating, + facets: facets, + sort: sort, + next: next, + start: start, + limit: limit, + count: count, + pageId: paginator.pageId, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageId = response.page?.nextId - } paginator.onNext?(response, error) } } return paginator } - - - - + /** - * - * Summary: update approve details - * Description: The is used to update approve details like status and description text - **/ + * + * Summary: update approve details + * Description: The is used to update approve details like status and description text + **/ public func updateApprove( reviewId: String, body: ApproveRequest, onResponse: @escaping (_ response: UpdateResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -12060,7 +9444,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12068,39 +9452,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: get history details - * Description: The is used to get the history details like status and description text - **/ + * + * Summary: get history details + * Description: The is used to get the history details like status and description text + **/ public func getHistory( reviewId: String, - + onResponse: @escaping (_ response: [ActivityDump]?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -12109,7 +9483,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12117,53 +9491,39 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode([ActivityDump].self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get list of templates - * Description: Get all templates of application - **/ + * + * Summary: Get list of templates + * Description: Get all templates of application + **/ public func getApplicationTemplates( pageId: String?, pageSize: Int?, - + onResponse: @escaping (_ response: TemplateGetResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageId { - - xQuery["page_id"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - + if let value = pageId { + xQuery["page_id"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -12173,7 +9533,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12181,95 +9541,59 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TemplateGetResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getApplicationTemplates - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getApplicationTemplates + * Description: fetch the next page by calling .next(...) function + **/ public func getApplicationTemplatesPaginator( pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "cursor") paginator.onPage = { self.getApplicationTemplates( - - pageId: paginator.pageId - , - pageSize: paginator.pageSize - - ) { response, error in + pageId: paginator.pageId, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageId = response.page?.nextId - } paginator.onNext?(response, error) } } return paginator } - - - - - /** - * - * Summary: Create a new template - * Description: Create a new template for review with following data: -- Enable media, rating and review -- Rating - active/inactive/selected rate choices, attributes, text on rate, comment for each rate, type -- Review - header, title, description, image and video meta, enable votes - **/ + + /** + * + * Summary: Create a new template + * Description: Create a new template for review with following data: + - Enable media, rating and review + - Rating - active/inactive/selected rate choices, attributes, text on rate, comment for each rate, type + - Review - header, title, description, image and video meta, enable votes + **/ public func createTemplate( body: TemplateRequestList, onResponse: @escaping (_ response: InsertResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -12278,7 +9602,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12286,39 +9610,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(InsertResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get a template by ID - * Description: Get the template for product or l3 type by ID - **/ + * + * Summary: Get a template by ID + * Description: Get the template for product or l3 type by ID + **/ public func getTemplateById( id: String, - + onResponse: @escaping (_ response: Template?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -12327,7 +9641,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12335,39 +9649,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Template.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update a template's status - * Description: Update existing template status, active/archive - **/ + * + * Summary: Update a template's status + * Description: Update existing template status, active/archive + **/ public func updateTemplate( id: String, body: UpdateTemplateRequest, onResponse: @escaping (_ response: UpdateResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -12376,7 +9680,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12384,39 +9688,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update a template's status - * Description: Update existing template status, active/archive - **/ + * + * Summary: Update a template's status + * Description: Update existing template status, active/archive + **/ public func updateTemplateStatus( id: String, body: UpdateTemplateStatusRequest, onResponse: @escaping (_ response: UpdateResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "patch", @@ -12425,7 +9719,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12433,25 +9727,21 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - - public class Theme { + + public class Theme { var config: PlatformConfig var companyId: String var applicationId: String @@ -12461,26 +9751,17 @@ if let value = pageSize { self.companyId = config.companyId self.applicationId = applicationId } - - - - + /** - * - * Summary: Get all pages of a theme - * Description: Use this API to retrieve all the available pages of a theme by its ID. - **/ + * + * Summary: Get all pages of a theme + * Description: Use this API to retrieve all the available pages of a theme by its ID. + **/ public func getAllPages( themeId: String, - + onResponse: @escaping (_ response: AllAvailablePageSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -12489,7 +9770,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12497,39 +9778,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AllAvailablePageSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create a page - * Description: Use this API to create a page for a theme by its ID. - **/ + * + * Summary: Create a page + * Description: Use this API to create a page for a theme by its ID. + **/ public func createPage( themeId: String, body: AvailablePageSchema, onResponse: @escaping (_ response: AvailablePageSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -12538,7 +9809,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12546,39 +9817,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AvailablePageSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update multiple pages of a theme - * Description: Use this API to update multiple pages of a theme by its ID. - **/ + * + * Summary: Update multiple pages of a theme + * Description: Use this API to update multiple pages of a theme by its ID. + **/ public func updateMultiplePages( themeId: String, body: AllAvailablePageSchema, onResponse: @escaping (_ response: AllAvailablePageSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -12587,7 +9848,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12595,40 +9856,30 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AllAvailablePageSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get page of a theme - * Description: Use this API to retrieve a page of a theme. - **/ + * + * Summary: Get page of a theme + * Description: Use this API to retrieve a page of a theme. + **/ public func getPage( themeId: String, pageValue: String, - + onResponse: @escaping (_ response: AvailablePageSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -12637,7 +9888,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12645,40 +9896,30 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AvailablePageSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Updates a page - * Description: Use this API to update a page for a theme by its ID. - **/ + * + * Summary: Updates a page + * Description: Use this API to update a page for a theme by its ID. + **/ public func updatePage( themeId: String, pageValue: String, body: AvailablePageSchema, onResponse: @escaping (_ response: AvailablePageSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -12687,7 +9928,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12695,40 +9936,30 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AvailablePageSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Deletes a page - * Description: Use this API to delete a page for a theme by its ID and page_value. - **/ + * + * Summary: Deletes a page + * Description: Use this API to delete a page for a theme by its ID and page_value. + **/ public func deletePage( themeId: String, pageValue: String, - + onResponse: @escaping (_ response: AvailablePageSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -12737,7 +9968,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12745,53 +9976,39 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AvailablePageSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get a list of themes from the theme library - * Description: Theme library is a personalized collection of themes that are chosen and added from the available themes. Use this API to fetch a list of themes from the library along with their configuration details. - **/ + * + * Summary: Get a list of themes from the theme library + * Description: Theme library is a personalized collection of themes that are chosen and added from the available themes. Use this API to fetch a list of themes from the library along with their configuration details. + **/ public func getThemeLibrary( pageSize: Int?, pageNo: Int?, - + onResponse: @escaping (_ response: ThemesListingResponseSchema?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = pageNo { - - xQuery["page_no"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageSize { + xQuery["page_size"] = value + } - - + if let value = pageNo { + xQuery["page_no"] = value + } PlatformAPIClient.execute( config: config, @@ -12801,7 +10018,7 @@ if let value = pageNo { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12809,38 +10026,28 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ThemesListingResponseSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Add a theme to the theme library - * Description: Theme library is a personalized collection of themes that are chosen and added from the available themes. Use this API to choose a theme and add it to the theme library. - **/ + * + * Summary: Add a theme to the theme library + * Description: Theme library is a personalized collection of themes that are chosen and added from the available themes. Use this API to choose a theme and add it to the theme library. + **/ public func addToThemeLibrary( body: AddThemeRequestSchema, onResponse: @escaping (_ response: ThemesSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -12849,7 +10056,7 @@ if let value = pageNo { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12857,38 +10064,28 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ThemesSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Apply a theme - * Description: Use this API to apply a theme to the website. - **/ + * + * Summary: Apply a theme + * Description: Use this API to apply a theme to the website. + **/ public func applyTheme( body: AddThemeRequestSchema, onResponse: @escaping (_ response: ThemesSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -12897,7 +10094,7 @@ if let value = pageNo { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12905,39 +10102,29 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ThemesSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Checks if theme is upgradable - * Description: There's always a possibility that new features get added to a theme. Use this API to check if the applied theme has an upgrade available. - **/ + * + * Summary: Checks if theme is upgradable + * Description: There's always a possibility that new features get added to a theme. Use this API to check if the applied theme has an upgrade available. + **/ public func isUpgradable( themeId: String, - + onResponse: @escaping (_ response: UpgradableThemeSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -12946,7 +10133,7 @@ if let value = pageNo { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -12954,39 +10141,29 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpgradableThemeSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Upgrade a theme - * Description: Use this API to upgrade the current theme to its latest version. - **/ + * + * Summary: Upgrade a theme + * Description: Use this API to upgrade the current theme to its latest version. + **/ public func upgradeTheme( themeId: String, - + onResponse: @escaping (_ response: ThemesSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -12995,7 +10172,7 @@ if let value = pageNo { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13003,53 +10180,39 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ThemesSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get all public themes - * Description: Use this API to get a list of free themes that you can apply to your website. - **/ + * + * Summary: Get all public themes + * Description: Use this API to get a list of free themes that you can apply to your website. + **/ public func getPublicThemes( pageSize: Int?, pageNo: Int?, - + onResponse: @escaping (_ response: ThemesListingResponseSchema?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageSize { - - xQuery["page_size"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageSize { + xQuery["page_size"] = value + } -if let value = pageNo { - - xQuery["page_no"] = value - -} - - - - + if let value = pageNo { + xQuery["page_no"] = value + } PlatformAPIClient.execute( config: config, @@ -13059,7 +10222,7 @@ if let value = pageNo { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13067,38 +10230,28 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ThemesListingResponseSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create a new theme - * Description: Themes improve the look and appearance of a website. Use this API to create a theme. - **/ + * + * Summary: Create a new theme + * Description: Themes improve the look and appearance of a website. Use this API to create a theme. + **/ public func createTheme( body: ThemesSchema, onResponse: @escaping (_ response: ThemesSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -13107,7 +10260,7 @@ if let value = pageNo { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13115,47 +10268,36 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ThemesSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get the applied theme - * Description: Use this API to retrieve the theme that is currently applied to the website along with its details. - **/ + * + * Summary: Get the applied theme + * Description: Use this API to retrieve the theme that is currently applied to the website along with its details. + **/ public func getAppliedTheme( - onResponse: @escaping (_ response: ThemesSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "put", + method: "get", url: "/service/platform/theme/v1.0/company/\(companyId)/application/\(applicationId)/", query: nil, body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13163,38 +10305,27 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ThemesSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get all the supported fonts in a theme - * Description: Font is a collection of characters with a similar design. Use this API to retrieve a list of website fonts. - **/ + * + * Summary: Get all the supported fonts in a theme + * Description: Font is a collection of characters with a similar design. Use this API to retrieve a list of website fonts. + **/ public func getFonts( - onResponse: @escaping (_ response: FontsSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -13203,7 +10334,7 @@ if let value = pageNo { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13211,39 +10342,29 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(FontsSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Gets theme by id - * Description: Use this API to retrieve the details of a specific theme by using its ID. - **/ + * + * Summary: Gets theme by id + * Description: Use this API to retrieve the details of a specific theme by using its ID. + **/ public func getThemeById( themeId: String, - + onResponse: @escaping (_ response: ThemesSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -13252,7 +10373,7 @@ if let value = pageNo { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13260,39 +10381,29 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ThemesSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update a theme - * Description: Use this API to edit an existing theme. You can customize the website font, sections, images, styles, and many more. - **/ + * + * Summary: Update a theme + * Description: Use this API to edit an existing theme. You can customize the website font, sections, images, styles, and many more. + **/ public func updateTheme( themeId: String, body: ThemesSchema, onResponse: @escaping (_ response: ThemesSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -13301,7 +10412,7 @@ if let value = pageNo { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13309,39 +10420,29 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ThemesSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete a theme - * Description: Use this API to delete a theme from the theme library. - **/ + * + * Summary: Delete a theme + * Description: Use this API to delete a theme from the theme library. + **/ public func deleteTheme( themeId: String, - + onResponse: @escaping (_ response: ThemesSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -13350,7 +10451,7 @@ if let value = pageNo { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13358,39 +10459,29 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ThemesSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get a theme preview - * Description: A theme can be previewed before applying it. Use this API to retrieve the theme preview by using its ID. - **/ + * + * Summary: Get a theme preview + * Description: A theme can be previewed before applying it. Use this API to retrieve the theme preview by using its ID. + **/ public func getThemeForPreview( themeId: String, - + onResponse: @escaping (_ response: ThemesSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -13399,7 +10490,7 @@ if let value = pageNo { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13407,39 +10498,29 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ThemesSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Publish a theme - * Description: Use this API to publish a theme that is either newly created or edited. - **/ + * + * Summary: Publish a theme + * Description: Use this API to publish a theme that is either newly created or edited. + **/ public func publishTheme( themeId: String, - + onResponse: @escaping (_ response: ThemesSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -13448,7 +10529,7 @@ if let value = pageNo { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13456,39 +10537,29 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ThemesSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Unpublish a theme - * Description: Use this API to remove an existing theme from the list of available themes. - **/ + * + * Summary: Unpublish a theme + * Description: Use this API to remove an existing theme from the list of available themes. + **/ public func unpublishTheme( themeId: String, - + onResponse: @escaping (_ response: ThemesSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -13497,7 +10568,7 @@ if let value = pageNo { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13505,39 +10576,29 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ThemesSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Archive a theme - * Description: Use this API to store an existing theme but not delete it so that it can be used in future if required. - **/ + * + * Summary: Archive a theme + * Description: Use this API to store an existing theme but not delete it so that it can be used in future if required. + **/ public func archiveTheme( themeId: String, - + onResponse: @escaping (_ response: ThemesSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -13546,7 +10607,7 @@ if let value = pageNo { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13554,39 +10615,29 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ThemesSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Unarchive a theme - * Description: Use this API to restore an archived theme and bring it back for editing or publishing. - **/ + * + * Summary: Unarchive a theme + * Description: Use this API to restore an archived theme and bring it back for editing or publishing. + **/ public func unarchiveTheme( themeId: String, - + onResponse: @escaping (_ response: ThemesSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -13595,7 +10646,7 @@ if let value = pageNo { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13603,25 +10654,21 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ThemesSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - - public class User { + + public class User { var config: PlatformConfig var companyId: String var applicationId: String @@ -13631,48 +10678,32 @@ if let value = pageNo { self.companyId = config.companyId self.applicationId = applicationId } - - - - + /** - * - * Summary: Get a list of customers - * Description: Use this API to retrieve a list of customers who have registered in the application. - **/ + * + * Summary: Get a list of customers + * Description: Use this API to retrieve a list of customers who have registered in the application. + **/ public func getCustomers( q: String?, pageSize: Int?, pageNo: Int?, - + onResponse: @escaping (_ response: CustomerListResponseSchema?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = q { - - xQuery["q"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = pageNo { - - xQuery["page_no"] = value - -} + var xQuery: [String: Any] = [:] + if let value = q { + xQuery["q"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = pageNo { + xQuery["page_no"] = value + } PlatformAPIClient.execute( config: config, @@ -13682,7 +10713,7 @@ if let value = pageNo { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13690,45 +10721,34 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CustomerListResponseSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Search an existing user. - * Description: Use this API to retrieve an existing user from a list. - **/ + * + * Summary: Search an existing user. + * Description: Use this API to retrieve an existing user from a list. + **/ public func searchUsers( - q: String?, - + q: [String: Any]?, + onResponse: @escaping (_ response: UserSearchResponseSchema?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = q { - - xQuery["q"] = value - -} - - - + var xQuery: [String: Any] = [:] + if let value = q { + xQuery["q"] = value + } PlatformAPIClient.execute( config: config, @@ -13738,7 +10758,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13746,38 +10766,28 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UserSearchResponseSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create user - * Description: Create user - **/ + * + * Summary: Create user + * Description: Create user + **/ public func createUser( body: CreateUserRequestSchema, onResponse: @escaping (_ response: CreateUserResponseSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -13786,7 +10796,7 @@ if let value = q { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13794,39 +10804,29 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CreateUserResponseSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update user - * Description: Update user - **/ + * + * Summary: Update user + * Description: Update user + **/ public func updateUser( userId: String, body: UpdateUserRequestSchema, onResponse: @escaping (_ response: CreateUserResponseSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -13835,7 +10835,7 @@ if let value = q { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13843,38 +10843,28 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CreateUserResponseSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create user session - * Description: Create user session - **/ + * + * Summary: Create user session + * Description: Create user session + **/ public func createUserSession( body: CreateUserSessionRequestSchema, onResponse: @escaping (_ response: CreateUserSessionResponseSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -13883,7 +10873,7 @@ if let value = q { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13891,38 +10881,27 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CreateUserSessionResponseSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get platform configurations - * Description: Use this API to get all the platform configurations such as mobile image, desktop image, social logins, and all other text. - **/ + * + * Summary: Get platform configurations + * Description: Use this API to get all the platform configurations such as mobile image, desktop image, social logins, and all other text. + **/ public func getPlatformConfig( - onResponse: @escaping (_ response: PlatformSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -13931,7 +10910,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13939,38 +10918,28 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PlatformSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update platform configurations - * Description: Use this API to edit the existing platform configurations such as mobile image, desktop image, social logins, and all other text. - **/ + * + * Summary: Update platform configurations + * Description: Use this API to edit the existing platform configurations such as mobile image, desktop image, social logins, and all other text. + **/ public func updatePlatformConfig( body: PlatformSchema, onResponse: @escaping (_ response: PlatformSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -13979,7 +10948,7 @@ if let value = q { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -13987,25 +10956,21 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PlatformSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - - public class Content { + + public class Content { var config: PlatformConfig var companyId: String var applicationId: String @@ -14015,40 +10980,27 @@ if let value = q { self.companyId = config.companyId self.applicationId = applicationId } - - - - + /** - * - * Summary: Get a list of announcements - * Description: Announcements are useful to highlight a message or information on top of a webpage. Use this API to retrieve a list of announcements. - **/ + * + * Summary: Get a list of announcements + * Description: Announcements are useful to highlight a message or information on top of a webpage. Use this API to retrieve a list of announcements. + **/ public func getAnnouncementsList( pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: GetAnnouncementListSchema?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - - + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -14058,7 +11010,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14066,63 +11018,37 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetAnnouncementListSchema.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getAnnouncementsList - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getAnnouncementsList + * Description: fetch the next page by calling .next(...) function + **/ public func getAnnouncementsListPaginator( pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getAnnouncementsList( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -14132,25 +11058,16 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Create an announcement - * Description: Announcements are useful to highlight a message or information on top of a webpage. Use this API to create an announcement. - **/ + * + * Summary: Create an announcement + * Description: Announcements are useful to highlight a message or information on top of a webpage. Use this API to create an announcement. + **/ public func createAnnouncement( body: AdminAnnouncementSchema, onResponse: @escaping (_ response: CreateAnnouncementSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -14159,7 +11076,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14167,39 +11084,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CreateAnnouncementSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get announcement by ID - * Description: Use this API to retrieve an announcement and its details such as the target platform and pages on which it's applicable - **/ + * + * Summary: Get announcement by ID + * Description: Use this API to retrieve an announcement and its details such as the target platform and pages on which it's applicable + **/ public func getAnnouncementById( announcementId: String, - + onResponse: @escaping (_ response: AdminAnnouncementSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -14208,7 +11115,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14216,39 +11123,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AdminAnnouncementSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update an announcement - * Description: Use this API to edit an existing announcement and its details such as the target platform and pages on which it's applicable - **/ + * + * Summary: Update an announcement + * Description: Use this API to edit an existing announcement and its details such as the target platform and pages on which it's applicable + **/ public func updateAnnouncement( announcementId: String, body: AdminAnnouncementSchema, onResponse: @escaping (_ response: CreateAnnouncementSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -14257,7 +11154,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14265,39 +11162,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CreateAnnouncementSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update the schedule and the publish status of an announcement - * Description: Use this API to edit the duration, i.e. start date-time and end date-time of an announcement. Moreover, you can enable/disable an announcement using this API. - **/ + * + * Summary: Update the schedule and the publish status of an announcement + * Description: Use this API to edit the duration, i.e. start date-time and end date-time of an announcement. Moreover, you can enable/disable an announcement using this API. + **/ public func updateAnnouncementSchedule( announcementId: String, body: ScheduleSchema, onResponse: @escaping (_ response: CreateAnnouncementSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "patch", @@ -14306,7 +11193,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14314,39 +11201,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CreateAnnouncementSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete announcement by id - * Description: Use this API to delete an existing announcement. - **/ + * + * Summary: Delete announcement by id + * Description: Use this API to delete an existing announcement. + **/ public func deleteAnnouncement( announcementId: String, - + onResponse: @escaping (_ response: CreateAnnouncementSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -14355,7 +11232,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14363,38 +11240,28 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CreateAnnouncementSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create a blog - * Description: Use this API to create a blog. - **/ + * + * Summary: Create a blog + * Description: Use this API to create a blog. + **/ public func createBlog( body: BlogRequest, onResponse: @escaping (_ response: BlogSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -14403,7 +11270,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14411,53 +11278,39 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(BlogSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get blogs - * Description: Use this API to get a list of blogs along with their details, such as the title, reading time, publish status, feature image, tags, author, etc. - **/ + * + * Summary: Get blogs + * Description: Use this API to get a list of blogs along with their details, such as the title, reading time, publish status, feature image, tags, author, etc. + **/ public func getBlogs( pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: BlogGetResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - + var xQuery: [String: Any] = [:] - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -14467,7 +11320,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14475,63 +11328,37 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(BlogGetResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getBlogs - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getBlogs + * Description: fetch the next page by calling .next(...) function + **/ public func getBlogsPaginator( pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getBlogs( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -14541,26 +11368,17 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Update a blog - * Description: Use this API to update the details of an existing blog which includes title, feature image, content, SEO details, expiry, etc. - **/ + * + * Summary: Update a blog + * Description: Use this API to update the details of an existing blog which includes title, feature image, content, SEO details, expiry, etc. + **/ public func updateBlog( id: String, body: BlogRequest, onResponse: @escaping (_ response: BlogSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -14569,7 +11387,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14577,39 +11395,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(BlogSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete blogs - * Description: Use this API to delete a blog. - **/ + * + * Summary: Delete blogs + * Description: Use this API to delete a blog. + **/ public func deleteBlog( id: String, - + onResponse: @escaping (_ response: BlogSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -14618,7 +11426,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14626,48 +11434,113 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(BlogSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get components of a blog - * Description: Use this API to retrieve the components of a blog, such as title, slug, feature image, content, schedule, publish status, author, etc. - **/ + * + * Summary: Get components of a blog + * Description: Use this API to retrieve the components of a blog, such as title, slug, feature image, content, schedule, publish status, author, etc. + **/ public func getComponentById( slug: String, - + onResponse: @escaping (_ response: BlogSchema?, _ error: FDKError?) -> Void ) { - - + PlatformAPIClient.execute( + config: config, + method: "get", + url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/blogs/\(slug)", + query: nil, + body: nil, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(BlogSchema.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } - + /** + * + * Summary: Adds a data loader + * Description: Use this API to add data loader. This includes the data loader name, operationId, service name and its type (url/function) with corresponding value. + **/ + public func addDataLoader( + body: DataLoaderSchema, + onResponse: @escaping (_ response: DataLoaderResponseSchema?, _ error: FDKError?) -> Void + ) { + PlatformAPIClient.execute( + config: config, + method: "post", + url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/data-loader", + query: nil, + body: body.dictionary, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(DataLoaderResponseSchema.self, from: data) + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + /** + * + * Summary: Get all the data loaders in an application + * Description: Use this to get all data loaders of an application + **/ + public func getDataLoaders( + onResponse: @escaping (_ response: DataLoadersSchema?, _ error: FDKError?) -> Void + ) { PlatformAPIClient.execute( config: config, method: "get", - url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/blogs/\(slug)", + url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/data-loader", query: nil, body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14675,38 +11548,223 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(BlogSchema.self, from: data) - + let response = Utility.decode(DataLoadersSchema.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get a list of FAQ categories - * Description: FAQs can be divided into categories. Use this API to get a list of FAQ categories. - **/ - public func getFaqCategories( - - onResponse: @escaping (_ response: GetFaqCategoriesSchema?, _ error: FDKError?) -> Void + * + * Summary: Delete data loader in application + * Description: Use this API to delete data loader. + **/ + public func deleteDataLoader( + dataLoaderId: String, + + onResponse: @escaping (_ response: DataLoaderResponseSchema?, _ error: FDKError?) -> Void ) { - - + PlatformAPIClient.execute( + config: config, + method: "delete", + url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/dataLoader/\(dataLoaderId)", + query: nil, + body: nil, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(DataLoaderResponseSchema.self, from: data) - + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + /** + * + * Summary: Edit a data loader by id + * Description: Use this API to edit the details of an existing data loader by its ID. + **/ + public func editDataLoader( + dataLoaderId: String, + body: DataLoaderSchema, + onResponse: @escaping (_ response: DataLoaderResponseSchema?, _ error: FDKError?) -> Void + ) { + PlatformAPIClient.execute( + config: config, + method: "put", + url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/dataLoader/\(dataLoaderId)", + query: nil, + body: body.dictionary, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(DataLoaderResponseSchema.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + /** + * + * Summary: Get all the data loaders in an application by service name + * Description: Use this to get all data loaders of an application by service name + **/ + public func getDataLoadersByService( + serviceName _: String, + + onResponse: @escaping (_ response: DataLoadersSchema?, _ error: FDKError?) -> Void + ) { + PlatformAPIClient.execute( + config: config, + method: "get", + url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/data-loader/service/:service_name", + query: nil, + body: nil, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(DataLoadersSchema.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Select a data loader by id + * Description: Use this API to select a data loader to be used in applications. + **/ + public func selectDataLoader( + dataLoaderId: String, + + onResponse: @escaping (_ response: DataLoaderResponseSchema?, _ error: FDKError?) -> Void + ) { + PlatformAPIClient.execute( + config: config, + method: "put", + url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/dataLoader/\(dataLoaderId)/select", + query: nil, + body: nil, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(DataLoaderResponseSchema.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Reset a data loader by serive name and operation Id + * Description: Use this API to reselect a data loader. + **/ + public func resetDataLoader( + service: String, + operationId: String, + + onResponse: @escaping (_ response: DataLoaderResetResponseSchema?, _ error: FDKError?) -> Void + ) { + PlatformAPIClient.execute( + config: config, + method: "put", + url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/dataLoader/\(service)/\(operationId)/reset", + query: nil, + body: nil, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(DataLoaderResetResponseSchema.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Get a list of FAQ categories + * Description: FAQs can be divided into categories. Use this API to get a list of FAQ categories. + **/ + public func getFaqCategories( + onResponse: @escaping (_ response: GetFaqCategoriesSchema?, _ error: FDKError?) -> Void + ) { PlatformAPIClient.execute( config: config, method: "get", @@ -14715,7 +11773,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14723,39 +11781,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetFaqCategoriesSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get an FAQ category by slug or id - * Description: FAQs can be divided into categories. Use this API to get an FAQ categories using its slug or ID. - **/ + * + * Summary: Get an FAQ category by slug or id + * Description: FAQs can be divided into categories. Use this API to get an FAQ categories using its slug or ID. + **/ public func getFaqCategoryBySlugOrId( idOrSlug: String, - + onResponse: @escaping (_ response: GetFaqCategoryBySlugSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -14764,7 +11812,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14772,38 +11820,28 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetFaqCategoryBySlugSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create an FAQ category - * Description: FAQs help users to solve an issue or know more about a process. FAQs can be categorized separately, for e.g. some questions can be related to payment, some could be related to purchase, shipping, navigating, etc. Use this API to create an FAQ category. - **/ + * + * Summary: Create an FAQ category + * Description: FAQs help users to solve an issue or know more about a process. FAQs can be categorized separately, for e.g. some questions can be related to payment, some could be related to purchase, shipping, navigating, etc. Use this API to create an FAQ category. + **/ public func createFaqCategory( body: CreateFaqCategoryRequestSchema, onResponse: @escaping (_ response: CreateFaqCategorySchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -14812,7 +11850,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14820,39 +11858,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CreateFaqCategorySchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update an FAQ category - * Description: Use this API to edit an existing FAQ category. - **/ + * + * Summary: Update an FAQ category + * Description: Use this API to edit an existing FAQ category. + **/ public func updateFaqCategory( id: String, body: UpdateFaqCategoryRequestSchema, onResponse: @escaping (_ response: CreateFaqCategorySchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -14861,7 +11889,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14869,39 +11897,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CreateFaqCategorySchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete an FAQ category - * Description: Use this API to delete an FAQ category. - **/ + * + * Summary: Delete an FAQ category + * Description: Use this API to delete an FAQ category. + **/ public func deleteFaqCategory( id: String, - + onResponse: @escaping (_ response: FaqSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -14910,7 +11928,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14918,39 +11936,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(FaqSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get question and answers within an FAQ category - * Description: Use this API to retrieve all the commonly asked question and answers belonging to an FAQ category. - **/ + * + * Summary: Get question and answers within an FAQ category + * Description: Use this API to retrieve all the commonly asked question and answers belonging to an FAQ category. + **/ public func getFaqsByCategoryIdOrSlug( idOrSlug: String, - + onResponse: @escaping (_ response: GetFaqSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -14959,7 +11967,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -14967,39 +11975,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetFaqSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create an FAQ - * Description: FAQs help users to solve an issue or know more about a process. Use this API to create an FAQ for a given FAQ category. - **/ + * + * Summary: Create an FAQ + * Description: FAQs help users to solve an issue or know more about a process. Use this API to create an FAQ for a given FAQ category. + **/ public func addFaq( categoryId: String, body: CreateFaqSchema, onResponse: @escaping (_ response: CreateFaqResponseSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -15008,7 +12006,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -15016,40 +12014,30 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CreateFaqResponseSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update an FAQ - * Description: Use this API to edit an existing FAQ. - **/ + * + * Summary: Update an FAQ + * Description: Use this API to edit an existing FAQ. + **/ public func updateFaq( categoryId: String, faqId: String, body: CreateFaqSchema, onResponse: @escaping (_ response: CreateFaqResponseSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -15058,7 +12046,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -15066,40 +12054,30 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CreateFaqResponseSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete an FAQ - * Description: Use this API to delete an existing FAQ. - **/ + * + * Summary: Delete an FAQ + * Description: Use this API to delete an existing FAQ. + **/ public func deleteFaq( categoryId: String, faqId: String, - + onResponse: @escaping (_ response: CreateFaqResponseSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -15108,7 +12086,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -15116,39 +12094,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CreateFaqResponseSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get an FAQ - * Description: Use this API to retrieve a specific FAQ. You will get the question and answer of that FAQ. - **/ + * + * Summary: Get an FAQ + * Description: Use this API to retrieve a specific FAQ. You will get the question and answer of that FAQ. + **/ public func getFaqByIdOrSlug( idOrSlug: String, - + onResponse: @escaping (_ response: CreateFaqResponseSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -15157,7 +12125,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -15165,53 +12133,39 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CreateFaqResponseSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get landing pages - * Description: Landing page is the first page that a prospect lands upon while visiting a website. Use this API to fetch a list of landing pages. - **/ + * + * Summary: Get landing pages + * Description: Landing page is the first page that a prospect lands upon while visiting a website. Use this API to fetch a list of landing pages. + **/ public func getLandingPages( pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: LandingPageGetResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -15221,7 +12175,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -15229,63 +12183,37 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(LandingPageGetResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getLandingPages - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getLandingPages + * Description: fetch the next page by calling .next(...) function + **/ public func getLandingPagesPaginator( pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getLandingPages( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -15295,25 +12223,16 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Create a landing page - * Description: Landing page is the first page that a prospect lands upon while visiting a website. Use this API to create a landing page. - **/ + * + * Summary: Create a landing page + * Description: Landing page is the first page that a prospect lands upon while visiting a website. Use this API to create a landing page. + **/ public func createLandingPage( body: LandingPageSchema, onResponse: @escaping (_ response: LandingPageSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -15322,7 +12241,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -15330,39 +12249,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(LandingPageSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update a landing page - * Description: Use this API to edit the details of an existing landing page. - **/ + * + * Summary: Update a landing page + * Description: Use this API to edit the details of an existing landing page. + **/ public func updateLandingPage( id: String, body: LandingPageSchema, onResponse: @escaping (_ response: LandingPageSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -15371,7 +12280,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -15379,39 +12288,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(LandingPageSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete a landing page - * Description: Use this API to delete an existing landing page. - **/ + * + * Summary: Delete a landing page + * Description: Use this API to delete an existing landing page. + **/ public func deleteLandingPage( id: String, - + onResponse: @escaping (_ response: LandingPageSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -15420,7 +12319,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -15428,38 +12327,27 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(LandingPageSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get legal information - * Description: Use this API to get the legal information of an application, which includes Policy, Terms and Conditions, Shipping Policy and FAQ regarding the application. - **/ + * + * Summary: Get legal information + * Description: Use this API to get the legal information of an application, which includes Policy, Terms and Conditions, Shipping Policy and FAQ regarding the application. + **/ public func getLegalInformation( - onResponse: @escaping (_ response: ApplicationLegal?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -15468,7 +12356,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -15476,38 +12364,28 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ApplicationLegal.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Save legal information - * Description: Use this API to edit, update and save the legal information of an application, which includes Policy, Terms and Conditions, Shipping Policy and FAQ regarding the application. - **/ + * + * Summary: Save legal information + * Description: Use this API to edit, update and save the legal information of an application, which includes Policy, Terms and Conditions, Shipping Policy and FAQ regarding the application. + **/ public func updateLegalInformation( body: ApplicationLegal, onResponse: @escaping (_ response: ApplicationLegal?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -15516,7 +12394,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -15524,59 +12402,42 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ApplicationLegal.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get navigations - * Description: Use this API to fetch the navigations details which includes the items of the navigation pane. It also shows the orientation, links, sub-navigations, etc. - **/ + * + * Summary: Get navigations + * Description: Use this API to fetch the navigations details which includes the items of the navigation pane. It also shows the orientation, links, sub-navigations, etc. + **/ public func getNavigations( devicePlatform: String, pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: NavigationGetResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["device_platform"] = devicePlatform - - - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} + var xQuery: [String: Any] = [:] + xQuery["device_platform"] = devicePlatform - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -15586,7 +12447,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -15594,71 +12455,39 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(NavigationGetResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getNavigations - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getNavigations + * Description: fetch the next page by calling .next(...) function + **/ public func getNavigationsPaginator( devicePlatform: String, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getNavigations( - - devicePlatform: devicePlatform, - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + devicePlatform: devicePlatform, + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -15668,25 +12497,16 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Create a navigation - * Description: Navigation is the arrangement of navigational items to ease the accessibility of resources for users on a website. Use this API to create a navigation. - **/ + * + * Summary: Create a navigation + * Description: Navigation is the arrangement of navigational items to ease the accessibility of resources for users on a website. Use this API to create a navigation. + **/ public func createNavigation( body: NavigationRequest, onResponse: @escaping (_ response: NavigationSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -15695,7 +12515,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -15703,38 +12523,27 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(NavigationSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get default navigations - * Description: On any website (application), there are navigations that are present by default. Use this API to retrieve those default navigations. - **/ + * + * Summary: Get default navigations + * Description: On any website (application), there are navigations that are present by default. Use this API to retrieve those default navigations. + **/ public func getDefaultNavigations( - onResponse: @escaping (_ response: DefaultNavigationResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -15743,7 +12552,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -15751,44 +12560,33 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DefaultNavigationResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get a navigation by slug - * Description: Use this API to retrieve a navigation by its slug. - **/ + * + * Summary: Get a navigation by slug + * Description: Use this API to retrieve a navigation by its slug. + **/ public func getNavigationBySlug( slug: String, devicePlatform: String, - + onResponse: @escaping (_ response: NavigationSchema?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["device_platform"] = devicePlatform - - - - + var xQuery: [String: Any] = [:] + xQuery["device_platform"] = devicePlatform PlatformAPIClient.execute( config: config, @@ -15798,7 +12596,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -15806,39 +12604,29 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(NavigationSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update a navigation - * Description: Use this API to edit the details of an existing navigation. - **/ + * + * Summary: Update a navigation + * Description: Use this API to edit the details of an existing navigation. + **/ public func updateNavigation( id: String, body: NavigationRequest, onResponse: @escaping (_ response: NavigationSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -15847,7 +12635,7 @@ var xQuery: [String: Any] = [:] body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -15855,39 +12643,29 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(NavigationSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete a navigation - * Description: Use this API to delete an existing navigation. - **/ + * + * Summary: Delete a navigation + * Description: Use this API to delete an existing navigation. + **/ public func deleteNavigation( id: String, - + onResponse: @escaping (_ response: NavigationSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -15896,7 +12674,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -15904,38 +12682,27 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(NavigationSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get page meta - * Description: Use this API to get the meta of custom pages (blog, page) and default system pages (e.g. home/brand/category/collection). - **/ + * + * Summary: Get page meta + * Description: Use this API to get the meta of custom pages (blog, page) and default system pages (e.g. home/brand/category/collection). + **/ public func getPageMeta( - onResponse: @escaping (_ response: PageMetaSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -15944,7 +12711,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -15952,38 +12719,27 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PageMetaSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get page spec - * Description: Use this API to get the specifications of a page, such as page type, display name, params and query. - **/ + * + * Summary: Get page spec + * Description: Use this API to get the specifications of a page, such as page type, display name, params and query. + **/ public func getPageSpec( - onResponse: @escaping (_ response: PageSpec?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -15992,7 +12748,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -16000,203 +12756,28 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PageSpec.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - /** - * - * Summary: Create a page - * Description: Use this API to create a custom page using a title, seo, publish status, feature image, tags, meta, etc. - **/ - public func createPage( - body: PageRequest, - onResponse: @escaping (_ response: PageSchema?, _ error: FDKError?) -> Void - ) { - - - - - - PlatformAPIClient.execute( - config: config, - method: "post", - url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/pages/", - query: nil, - body: body.dictionary, - headers: [], - responseType: "application/json", - onResponse: { (responseData, error, responseCode) in - if let _ = error, let data = responseData { - var err = Utility.decode(FDKError.self, from: data) - if err?.status == nil { - err?.status = responseCode - } - onResponse(nil, err) - } else if let data = responseData { - - let response = Utility.decode(PageSchema.self, from: data) - onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); - } - - - - - - /** - * - * Summary: Get a list of pages - * Description: Use this API to retrieve a list of pages. - **/ - public func getPages( - pageNo: Int?, - pageSize: Int?, - - onResponse: @escaping (_ response: PageGetResponse?, _ error: FDKError?) -> Void - ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - - - - PlatformAPIClient.execute( - config: config, - method: "get", - url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/pages/", - query: xQuery, - body: nil, - headers: [], - responseType: "application/json", - onResponse: { (responseData, error, responseCode) in - if let _ = error, let data = responseData { - var err = Utility.decode(FDKError.self, from: data) - if err?.status == nil { - err?.status = responseCode - } - onResponse(nil, err) - } else if let data = responseData { - - let response = Utility.decode(PageGetResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getPages - * Description: fetch the next page by calling .next(...) function - **/ - public func getPagesPaginator( - pageSize: Int? - - ) -> Paginator { - let pageSize = pageSize ?? 20 - let paginator = Paginator(pageSize: pageSize, type: "number") - paginator.onPage = { - self.getPages( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in - if let response = response { - paginator.hasNext = response.page?.hasNext ?? false - paginator.pageNo = (paginator.pageNo ?? 0) + 1 - } - paginator.onNext?(response, error) } - } - return paginator + ) } - - - - + /** - * - * Summary: Create a page preview - * Description: Use this API to create a page preview to check the appearance of a custom page. - **/ + * + * Summary: Create a page preview + * Description: Use this API to create a page preview to check the appearance of a custom page. + **/ public func createPagePreview( body: PageRequest, onResponse: @escaping (_ response: PageSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -16205,7 +12786,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -16213,39 +12794,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PageSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Change the publish status of a page - * Description: Use this API to change the publish status of an existing page. Allows you to publish and unpublish the page. - **/ + * + * Summary: Change the publish status of a page + * Description: Use this API to change the publish status of an existing page. Allows you to publish and unpublish the page. + **/ public func updatePagePreview( slug: String, body: PagePublishRequest, onResponse: @escaping (_ response: PageSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -16254,7 +12825,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -16262,48 +12833,38 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PageSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update a page - * Description: Use this API to edit the details of an existing page, such as its title, seo, publish status, feature image, tags, schedule, etc. - **/ - public func updatePage( + * + * Summary: Delete a page + * Description: Use this API to delete an existing page. + **/ + public func deletePage( id: String, - body: PageSchema, + onResponse: @escaping (_ response: PageSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "put", + method: "delete", url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/pages/\(id)", query: nil, - body: body.dictionary, + body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -16311,48 +12872,37 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PageSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete a page - * Description: Use this API to delete an existing page. - **/ - public func deletePage( - id: String, - - onResponse: @escaping (_ response: PageSchema?, _ error: FDKError?) -> Void + * + * Summary: Save path based redirection rules + * Description: Use this API to add, update or delete path-based redirection rules + **/ + public func updatePathRedirectionRules( + body: PathMappingSchema, + onResponse: @escaping (_ response: PathMappingSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "delete", - url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/pages/\(id)", + method: "post", + url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/path-mappings", query: nil, - body: nil, + body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -16360,48 +12910,36 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(PageSchema.self, from: data) - + let response = Utility.decode(PathMappingSchema.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get pages by component Id - * Description: Use this API to retrieve the components of a page, such as its title, seo, publish status, feature image, tags, schedule, etc. - **/ - public func getPageBySlug( - slug: String, - - onResponse: @escaping (_ response: PageSchema?, _ error: FDKError?) -> Void + * + * Summary: Get path based redirection rules + * Description: Use this API to get path based redirection rules. + **/ + public func getPathRedirectionRules( + onResponse: @escaping (_ response: PathMappingSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", - url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/pages/\(slug)", + url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/path-mappings", query: nil, body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -16409,38 +12947,27 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(PageSchema.self, from: data) - + let response = Utility.decode(PathMappingSchema.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get SEO configuration of an application - * Description: Use this API to know how the SEO is configured in the application. This includes the sitemap, robot.txt, custom meta tags, etc. - **/ + * + * Summary: Get SEO configuration of an application + * Description: Use this API to know how the SEO is configured in the application. This includes the sitemap, robot.txt, custom meta tags, etc. + **/ public func getSEOConfiguration( - onResponse: @escaping (_ response: SeoComponent?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -16449,7 +12976,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -16457,38 +12984,28 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SeoComponent.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update SEO of application - * Description: Use this API to edit the SEO details of an application. This includes the sitemap, robot.txt, custom meta tags, etc. - **/ + * + * Summary: Update SEO of application + * Description: Use this API to edit the SEO details of an application. This includes the sitemap, robot.txt, custom meta tags, etc. + **/ public func updateSEOConfiguration( body: SeoComponent, onResponse: @escaping (_ response: SeoSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -16497,7 +13014,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -16505,59 +13022,42 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SeoSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get slideshows - * Description: A slideshow is a group of images, videos or a combination of both that are shown on the website in the form of slides. Use this API to fetch a list of slideshows. - **/ + * + * Summary: Get slideshows + * Description: A slideshow is a group of images, videos or a combination of both that are shown on the website in the form of slides. Use this API to fetch a list of slideshows. + **/ public func getSlideshows( devicePlatform: String, pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: SlideshowGetResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["device_platform"] = devicePlatform - + var xQuery: [String: Any] = [:] + xQuery["device_platform"] = devicePlatform -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -16567,7 +13067,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -16575,71 +13075,39 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SlideshowGetResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getSlideshows - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getSlideshows + * Description: fetch the next page by calling .next(...) function + **/ public func getSlideshowsPaginator( devicePlatform: String, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getSlideshows( - - devicePlatform: devicePlatform, - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + devicePlatform: devicePlatform, + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -16649,25 +13117,16 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Create a slideshow - * Description: A slideshow is a group of images, videos or a combination of both that are shown on the website in the form of slides. Use this API to create a slideshow. - **/ + * + * Summary: Create a slideshow + * Description: A slideshow is a group of images, videos or a combination of both that are shown on the website in the form of slides. Use this API to create a slideshow. + **/ public func createSlideshow( body: SlideshowRequest, onResponse: @escaping (_ response: SlideshowSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -16676,7 +13135,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -16684,44 +13143,33 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SlideshowSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get slideshow by slug - * Description: Use this API to retrieve the details of a slideshow by its slug. - **/ + * + * Summary: Get slideshow by slug + * Description: Use this API to retrieve the details of a slideshow by its slug. + **/ public func getSlideshowBySlug( slug: String, devicePlatform: String, - + onResponse: @escaping (_ response: SlideshowSchema?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["device_platform"] = devicePlatform - - - - + var xQuery: [String: Any] = [:] + xQuery["device_platform"] = devicePlatform PlatformAPIClient.execute( config: config, @@ -16731,7 +13179,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -16739,39 +13187,29 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SlideshowSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update a slideshow - * Description: Use this API to edit the details of an existing slideshow. - **/ + * + * Summary: Update a slideshow + * Description: Use this API to edit the details of an existing slideshow. + **/ public func updateSlideshow( id: String, body: SlideshowRequest, onResponse: @escaping (_ response: SlideshowSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -16780,7 +13218,7 @@ var xQuery: [String: Any] = [:] body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -16788,39 +13226,29 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SlideshowSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete a slideshow - * Description: Use this API to delete an existing slideshow. - **/ + * + * Summary: Delete a slideshow + * Description: Use this API to delete an existing slideshow. + **/ public func deleteSlideshow( id: String, - + onResponse: @escaping (_ response: SlideshowSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -16829,7 +13257,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -16837,38 +13265,27 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SlideshowSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get support information - * Description: Use this API to get the contact details for customer support, including emails and phone numbers. - **/ + * + * Summary: Get support information + * Description: Use this API to get the contact details for customer support, including emails and phone numbers. + **/ public func getSupportInformation( - onResponse: @escaping (_ response: Support?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -16877,7 +13294,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -16885,38 +13302,28 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Support.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update the support data of an application - * Description: Use this API to edit the existing contact details for customer support, including emails and phone numbers. - **/ + * + * Summary: Update the support data of an application + * Description: Use this API to edit the existing contact details for customer support, including emails and phone numbers. + **/ public func updateSupportInformation( body: Support, onResponse: @escaping (_ response: Support?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -16925,7 +13332,7 @@ var xQuery: [String: Any] = [:] body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -16933,38 +13340,28 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Support.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update a tag - * Description: Use this API to edit the details of an existing tag. This includes the tag name, tag type (css/js), url and position of the tag. - **/ + * + * Summary: Update a tag + * Description: Use this API to edit the details of an existing tag. This includes the tag name, tag type (css/js), url and position of the tag. + **/ public func updateInjectableTag( body: CreateTagRequestSchema, onResponse: @escaping (_ response: TagsSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -16973,7 +13370,7 @@ var xQuery: [String: Any] = [:] body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -16981,38 +13378,27 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TagsSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete tags in application - * Description: Use this API to delete all the existing tags at once. - **/ + * + * Summary: Delete tags in application + * Description: Use this API to delete all the existing tags at once. + **/ public func deleteAllInjectableTags( - onResponse: @escaping (_ response: TagsSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -17021,7 +13407,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -17029,38 +13415,27 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TagsSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get all the tags in an application - * Description: Use this API to get all the CSS and JS injected in the application in the form of tags. - **/ + * + * Summary: Get all the tags in an application + * Description: Use this API to get all the CSS and JS injected in the application in the form of tags. + **/ public func getInjectableTags( - onResponse: @escaping (_ response: TagsSchema?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -17069,7 +13444,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -17077,47 +13452,202 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TagsSchema.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Add a tag - * Description: CSS and JS can be injected in the application (website) with the help of tags. Use this API to create such tags by entering the tag name, tag type (css/js), url and position of the tag. - **/ + * + * Summary: Add a tag + * Description: CSS and JS can be injected in the application (website) with the help of tags. Use this API to create such tags by entering the tag name, tag type (css/js), url and position of the tag. + **/ public func addInjectableTag( body: CreateTagRequestSchema, onResponse: @escaping (_ response: TagsSchema?, _ error: FDKError?) -> Void ) { - - + PlatformAPIClient.execute( + config: config, + method: "put", + url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/tags/add", + query: nil, + body: body.dictionary, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(TagsSchema.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Remove a tag + * Description: Use this API to delete an existing tag. + **/ + public func removeInjectableTag( + body: RemoveHandpickedSchema, + onResponse: @escaping (_ response: TagDeleteSuccessResponse?, _ error: FDKError?) -> Void + ) { + PlatformAPIClient.execute( + config: config, + method: "put", + url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/tags/remove/handpicked", + query: nil, + body: body.dictionary, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(TagDeleteSuccessResponse.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Edit a tag by id + * Description: Use this API to edit the details of an existing tag by its ID. + **/ + public func editInjectableTag( + tagId: String, + body: UpdateHandpickedSchema, + onResponse: @escaping (_ response: TagsSchema?, _ error: FDKError?) -> Void + ) { + PlatformAPIClient.execute( + config: config, + method: "put", + url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/tags/edit/handpicked/\(tagId)", + query: nil, + body: body.dictionary, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(TagsSchema.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Create a page + * Description: Use this API to create a custom page using a title, seo, publish status, feature image, tags, meta, etc. + **/ + public func createPage( + body: PageRequest, + onResponse: @escaping (_ response: PageSchema?, _ error: FDKError?) -> Void + ) { + PlatformAPIClient.execute( + config: config, + method: "post", + url: "/service/platform/content/v2.0/company/\(companyId)/application/\(applicationId)/pages/", + query: nil, + body: body.dictionary, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(PageSchema.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Get a list of pages + * Description: Use this API to retrieve a list of pages. + **/ + public func getPages( + pageNo: Int?, + pageSize: Int?, + + onResponse: @escaping (_ response: PageGetResponse?, _ error: FDKError?) -> Void + ) { + var xQuery: [String: Any] = [:] - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, - method: "put", - url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/tags/add", - query: nil, - body: body.dictionary, + method: "get", + url: "/service/platform/content/v2.0/company/\(companyId)/application/\(applicationId)/pages/", + query: xQuery, + body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -17125,47 +13655,66 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(TagsSchema.self, from: data) - + let response = Utility.decode(PageGetResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Remove a tag - * Description: Use this API to delete an existing tag. - **/ - public func removeInjectableTag( - body: RemoveHandpickedSchema, - onResponse: @escaping (_ response: TagDeleteSuccessResponse?, _ error: FDKError?) -> Void - ) { - - + * + * Summary: get paginator for getPages + * Description: fetch the next page by calling .next(...) function + **/ + public func getPagesPaginator( + pageSize: Int? + + ) -> Paginator { + let pageSize = pageSize ?? 20 + let paginator = Paginator(pageSize: pageSize, type: "number") + paginator.onPage = { + self.getPages( + pageNo: paginator.pageNo, - + pageSize: paginator.pageSize + ) { response, error in + if let response = response { + paginator.hasNext = response.page?.hasNext ?? false + paginator.pageNo = (paginator.pageNo ?? 0) + 1 + } + paginator.onNext?(response, error) + } + } + return paginator + } + /** + * + * Summary: Update a page + * Description: Use this API to edit the details of an existing page, such as its title, seo, publish status, feature image, tags, schedule, etc. + **/ + public func updatePage( + id: String, + body: PageSchema, + onResponse: @escaping (_ response: PageSchema?, _ error: FDKError?) -> Void + ) { PlatformAPIClient.execute( config: config, method: "put", - url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/tags/remove/handpicked", + url: "/service/platform/content/v2.0/company/\(companyId)/application/\(applicationId)/pages/\(id)", query: nil, body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -17173,48 +13722,38 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(TagDeleteSuccessResponse.self, from: data) - + let response = Utility.decode(PageSchema.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - /** - * - * Summary: Edit a tag by id - * Description: Use this API to edit the details of an existing tag by its ID. - **/ - public func editInjectableTag( - tagId: String, - body: UpdateHandpickedSchema, - onResponse: @escaping (_ response: TagsSchema?, _ error: FDKError?) -> Void - ) { - - - - + /** + * + * Summary: Get pages by component Id + * Description: Use this API to retrieve the components of a page, such as its title, seo, publish status, feature image, tags, schedule, etc. + **/ + public func getPageBySlug( + slug: String, + onResponse: @escaping (_ response: PageSchema?, _ error: FDKError?) -> Void + ) { PlatformAPIClient.execute( config: config, - method: "put", - url: "/service/platform/content/v1.0/company/\(companyId)/application/\(applicationId)/tags/edit/handpicked/\(tagId)", + method: "get", + url: "/service/platform/content/v2.0/company/\(companyId)/application/\(applicationId)/pages/\(slug)", query: nil, - body: body.dictionary, + body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -17222,25 +13761,21 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(TagsSchema.self, from: data) - + let response = Utility.decode(PageSchema.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - - public class Communication { + + public class Communication { var config: PlatformConfig var companyId: String var applicationId: String @@ -17250,48 +13785,32 @@ var xQuery: [String: Any] = [:] self.companyId = config.companyId self.applicationId = applicationId } - - - - + /** - * - * Summary: Get campaigns - * Description: Get campaigns - **/ + * + * Summary: Get campaigns + * Description: Get campaigns + **/ public func getCampaigns( pageNo: Int?, pageSize: Int?, sort: [String: Any]?, - + onResponse: @escaping (_ response: Campaigns?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = sort { - - xQuery["sort"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = sort { + xQuery["sort"] = value + } PlatformAPIClient.execute( config: config, @@ -17301,7 +13820,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -17309,71 +13828,39 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Campaigns.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getCampaigns - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getCampaigns + * Description: fetch the next page by calling .next(...) function + **/ public func getCampaignsPaginator( pageSize: Int?, sort: [String: Any]? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getCampaigns( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - , - sort: sort - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + sort: sort + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -17383,25 +13870,16 @@ if let value = sort { } return paginator } - - - - + /** - * - * Summary: Create campaign - * Description: Create campaign - **/ + * + * Summary: Create campaign + * Description: Create campaign + **/ public func createCampaign( body: CampaignReq, onResponse: @escaping (_ response: Campaign?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -17410,7 +13888,7 @@ if let value = sort { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -17418,39 +13896,29 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Campaign.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get campaign by id - * Description: Get campaign by id - **/ + * + * Summary: Get campaign by id + * Description: Get campaign by id + **/ public func getCampaignById( id: String, - + onResponse: @escaping (_ response: Campaign?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -17459,7 +13927,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -17467,39 +13935,29 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Campaign.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update campaign by id - * Description: Update campaign by id - **/ + * + * Summary: Update campaign by id + * Description: Update campaign by id + **/ public func updateCampaignById( id: String, body: CampaignReq, onResponse: @escaping (_ response: Campaign?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -17508,7 +13966,7 @@ if let value = sort { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -17516,39 +13974,29 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Campaign.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get stats of campaign by id - * Description: Get stats of campaign by id - **/ + * + * Summary: Get stats of campaign by id + * Description: Get stats of campaign by id + **/ public func getStatsOfCampaignById( id: String, - + onResponse: @escaping (_ response: GetStats?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -17557,7 +14005,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -17565,61 +14013,44 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetStats.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get audiences - * Description: Get audiences - **/ + * + * Summary: Get audiences + * Description: Get audiences + **/ public func getAudiences( pageNo: Int?, pageSize: Int?, sort: [String: Any]?, - + onResponse: @escaping (_ response: Audiences?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = sort { - - xQuery["sort"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = sort { + xQuery["sort"] = value + } PlatformAPIClient.execute( config: config, @@ -17629,7 +14060,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -17637,71 +14068,39 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Audiences.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getAudiences - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getAudiences + * Description: fetch the next page by calling .next(...) function + **/ public func getAudiencesPaginator( pageSize: Int?, sort: [String: Any]? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getAudiences( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - , - sort: sort - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + sort: sort + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -17711,25 +14110,16 @@ if let value = sort { } return paginator } - - - - + /** - * - * Summary: Create audience - * Description: Create audience - **/ + * + * Summary: Create audience + * Description: Create audience + **/ public func createAudience( body: AudienceReq, onResponse: @escaping (_ response: Audience?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -17738,7 +14128,7 @@ if let value = sort { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -17746,38 +14136,28 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Audience.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get bigquery headers - * Description: Get bigquery headers - **/ + * + * Summary: Get bigquery headers + * Description: Get bigquery headers + **/ public func getBigqueryHeaders( body: BigqueryHeadersReq, onResponse: @escaping (_ response: BigqueryHeadersRes?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -17786,7 +14166,7 @@ if let value = sort { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -17794,39 +14174,29 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(BigqueryHeadersRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get audience by id - * Description: Get audience by id - **/ + * + * Summary: Get audience by id + * Description: Get audience by id + **/ public func getAudienceById( id: String, - + onResponse: @escaping (_ response: Audience?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -17835,7 +14205,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -17843,39 +14213,29 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Audience.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update audience by id - * Description: Update audience by id - **/ + * + * Summary: Update audience by id + * Description: Update audience by id + **/ public func updateAudienceById( id: String, body: AudienceReq, onResponse: @escaping (_ response: Audience?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -17884,7 +14244,7 @@ if let value = sort { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -17892,38 +14252,28 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Audience.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get n sample records from csv - * Description: Get n sample records from csv - **/ + * + * Summary: Get n sample records from csv + * Description: Get n sample records from csv + **/ public func getNSampleRecordsFromCsv( body: GetNRecordsCsvReq, onResponse: @escaping (_ response: GetNRecordsCsvRes?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -17932,7 +14282,7 @@ if let value = sort { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -17940,61 +14290,44 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetNRecordsCsvRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get email providers - * Description: Get email providers - **/ + * + * Summary: Get email providers + * Description: Get email providers + **/ public func getEmailProviders( pageNo: Int?, pageSize: Int?, sort: [String: Any]?, - + onResponse: @escaping (_ response: EmailProviders?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = sort { - - xQuery["sort"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = sort { + xQuery["sort"] = value + } PlatformAPIClient.execute( config: config, @@ -18004,7 +14337,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -18012,71 +14345,39 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(EmailProviders.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getEmailProviders - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getEmailProviders + * Description: fetch the next page by calling .next(...) function + **/ public func getEmailProvidersPaginator( pageSize: Int?, sort: [String: Any]? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getEmailProviders( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - , - sort: sort - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + sort: sort + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -18086,25 +14387,16 @@ if let value = sort { } return paginator } - - - - + /** - * - * Summary: Create email provider - * Description: Create email provider - **/ + * + * Summary: Create email provider + * Description: Create email provider + **/ public func createEmailProvider( body: EmailProviderReq, onResponse: @escaping (_ response: EmailProvider?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -18113,7 +14405,7 @@ if let value = sort { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -18121,39 +14413,29 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(EmailProvider.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get email provider by id - * Description: Get email provider by id - **/ + * + * Summary: Get email provider by id + * Description: Get email provider by id + **/ public func getEmailProviderById( id: String, - + onResponse: @escaping (_ response: EmailProvider?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -18162,7 +14444,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -18170,39 +14452,29 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(EmailProvider.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update email provider by id - * Description: Update email provider by id - **/ + * + * Summary: Update email provider by id + * Description: Update email provider by id + **/ public func updateEmailProviderById( id: String, body: EmailProviderReq, onResponse: @escaping (_ response: EmailProvider?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -18211,7 +14483,7 @@ if let value = sort { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -18219,61 +14491,44 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(EmailProvider.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get email templates - * Description: Get email templates - **/ + * + * Summary: Get email templates + * Description: Get email templates + **/ public func getEmailTemplates( pageNo: Int?, pageSize: Int?, sort: [String: Any]?, - + onResponse: @escaping (_ response: EmailTemplates?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = sort { - - xQuery["sort"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = sort { + xQuery["sort"] = value + } PlatformAPIClient.execute( config: config, @@ -18283,7 +14538,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -18291,71 +14546,39 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(EmailTemplates.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getEmailTemplates - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getEmailTemplates + * Description: fetch the next page by calling .next(...) function + **/ public func getEmailTemplatesPaginator( pageSize: Int?, sort: [String: Any]? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getEmailTemplates( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - , - sort: sort - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + sort: sort + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -18365,25 +14588,16 @@ if let value = sort { } return paginator } - - - - + /** - * - * Summary: Create email template - * Description: Create email template - **/ + * + * Summary: Create email template + * Description: Create email template + **/ public func createEmailTemplate( body: EmailTemplateReq, onResponse: @escaping (_ response: EmailTemplateRes?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -18392,7 +14606,7 @@ if let value = sort { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -18400,61 +14614,44 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(EmailTemplateRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get system email templates - * Description: Get system email templates - **/ + * + * Summary: Get system email templates + * Description: Get system email templates + **/ public func getSystemEmailTemplates( pageNo: Int?, pageSize: Int?, sort: [String: Any]?, - + onResponse: @escaping (_ response: SystemEmailTemplates?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = sort { - - xQuery["sort"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = sort { + xQuery["sort"] = value + } PlatformAPIClient.execute( config: config, @@ -18464,7 +14661,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -18472,71 +14669,39 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SystemEmailTemplates.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getSystemEmailTemplates - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getSystemEmailTemplates + * Description: fetch the next page by calling .next(...) function + **/ public func getSystemEmailTemplatesPaginator( pageSize: Int?, sort: [String: Any]? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getSystemEmailTemplates( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - , - sort: sort - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + sort: sort + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -18546,26 +14711,17 @@ if let value = sort { } return paginator } - - - - + /** - * - * Summary: Get email template by id - * Description: Get email template by id - **/ + * + * Summary: Get email template by id + * Description: Get email template by id + **/ public func getEmailTemplateById( id: String, - + onResponse: @escaping (_ response: EmailTemplate?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -18574,7 +14730,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -18582,39 +14738,29 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(EmailTemplate.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update email template by id - * Description: Update email template by id - **/ + * + * Summary: Update email template by id + * Description: Update email template by id + **/ public func updateEmailTemplateById( id: String, body: EmailTemplateReq, onResponse: @escaping (_ response: EmailTemplateRes?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -18623,7 +14769,7 @@ if let value = sort { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -18631,39 +14777,29 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(EmailTemplateRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete email template by id - * Description: Delete email template by id - **/ + * + * Summary: Delete email template by id + * Description: Delete email template by id + **/ public func deleteEmailTemplateById( id: String, - + onResponse: @escaping (_ response: EmailTemplateDeleteSuccessRes?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -18672,7 +14808,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -18680,61 +14816,120 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(EmailTemplateDeleteSuccessRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get event subscriptions - * Description: Get event subscriptions - **/ - public func getEventSubscriptions( - pageNo: Int?, - pageSize: Int?, - populate: String?, - - onResponse: @escaping (_ response: EventSubscriptions?, _ error: FDKError?) -> Void + * + * Summary: Send email or sms synchronously + * Description: Send email or sms synchronously + **/ + public func sendCommunicationSynchronously( + body: EngineRequest, + onResponse: @escaping (_ response: EngineResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + PlatformAPIClient.execute( + config: config, + method: "post", + url: "/service/platform/communication/v1.0/company/\(companyId)/application/\(applicationId)/engine/send-instant", + query: nil, + body: body.dictionary, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(EngineResponse.self, from: data) -if let value = pageNo { - - xQuery["page_no"] = value - -} + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + /** + * + * Summary: Send email or sms asynchronously + * Description: Send email or sms asynchronously + **/ + public func sendCommunicationAsynchronously( + body: EngineRequest, + onResponse: @escaping (_ response: EngineResponse?, _ error: FDKError?) -> Void + ) { + PlatformAPIClient.execute( + config: config, + method: "post", + url: "/service/platform/communication/v1.0/company/\(companyId)/application/\(applicationId)/engine/send-async", + query: nil, + body: body.dictionary, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(EngineResponse.self, from: data) -if let value = pageSize { - - xQuery["page_size"] = value - -} + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + /** + * + * Summary: Get event subscriptions + * Description: Get event subscriptions + **/ + public func getEventSubscriptions( + pageNo: Int?, + pageSize: Int?, + populate: String?, -if let value = populate { - - xQuery["populate"] = value - -} + onResponse: @escaping (_ response: EventSubscriptions?, _ error: FDKError?) -> Void + ) { + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = populate { + xQuery["populate"] = value + } PlatformAPIClient.execute( config: config, @@ -18744,7 +14939,7 @@ if let value = populate { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -18752,71 +14947,39 @@ if let value = populate { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(EventSubscriptions.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getEventSubscriptions - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getEventSubscriptions + * Description: fetch the next page by calling .next(...) function + **/ public func getEventSubscriptionsPaginator( pageSize: Int?, populate: String? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getEventSubscriptions( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - , - populate: populate - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + populate: populate + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -18826,48 +14989,32 @@ if let value = populate { } return paginator } - - - - + /** - * - * Summary: Get jobs - * Description: Get jobs - **/ + * + * Summary: Get jobs + * Description: Get jobs + **/ public func getJobs( pageNo: Int?, pageSize: Int?, sort: [String: Any]?, - + onResponse: @escaping (_ response: Jobs?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = sort { - - xQuery["sort"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = sort { + xQuery["sort"] = value + } PlatformAPIClient.execute( config: config, @@ -18877,7 +15024,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -18885,71 +15032,39 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Jobs.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getJobs - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getJobs + * Description: fetch the next page by calling .next(...) function + **/ public func getJobsPaginator( pageSize: Int?, sort: [String: Any]? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getJobs( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - , - sort: sort - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + sort: sort + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -18959,25 +15074,16 @@ if let value = sort { } return paginator } - - - - + /** - * - * Summary: Trigger campaign job - * Description: Trigger campaign job - **/ + * + * Summary: Trigger campaign job + * Description: Trigger campaign job + **/ public func triggerCampaignJob( body: TriggerJobRequest, onResponse: @escaping (_ response: TriggerJobResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -18986,7 +15092,7 @@ if let value = sort { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -18994,61 +15100,44 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TriggerJobResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get job logs - * Description: Get job logs - **/ + * + * Summary: Get job logs + * Description: Get job logs + **/ public func getJobLogs( pageNo: Int?, pageSize: Int?, sort: [String: Any]?, - + onResponse: @escaping (_ response: JobLogs?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = sort { - - xQuery["sort"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = sort { + xQuery["sort"] = value + } PlatformAPIClient.execute( config: config, @@ -19058,7 +15147,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -19066,71 +15155,39 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(JobLogs.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getJobLogs - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getJobLogs + * Description: fetch the next page by calling .next(...) function + **/ public func getJobLogsPaginator( pageSize: Int?, sort: [String: Any]? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getJobLogs( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - , - sort: sort - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + sort: sort + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -19140,56 +15197,37 @@ if let value = sort { } return paginator } - - - - + /** - * - * Summary: Get communication logs - * Description: Get communication logs - **/ + * + * Summary: Get communication logs + * Description: Get communication logs + **/ public func getCommunicationLogs( pageId: String?, pageSize: Int?, sort: [String: Any]?, query: [String: Any]?, - + onResponse: @escaping (_ response: Logs?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageId { - - xQuery["page_id"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = sort { - - xQuery["sort"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = query { - - xQuery["query"] = value - -} + if let value = pageId { + xQuery["page_id"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } - + if let value = sort { + xQuery["sort"] = value + } + if let value = query { + xQuery["query"] = value + } PlatformAPIClient.execute( config: config, @@ -19199,7 +15237,7 @@ if let value = query { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -19207,132 +15245,76 @@ if let value = query { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Logs.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getCommunicationLogs - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getCommunicationLogs + * Description: fetch the next page by calling .next(...) function + **/ public func getCommunicationLogsPaginator( pageSize: Int?, sort: [String: Any]?, query: [String: Any]? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "cursor") paginator.onPage = { self.getCommunicationLogs( - - pageId: paginator.pageId - , - pageSize: paginator.pageSize - , - sort: sort, - query: query - ) { response, error in + pageId: paginator.pageId, + + pageSize: paginator.pageSize, + + sort: sort, + query: query + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageId = response.page?.nextId - } paginator.onNext?(response, error) } } return paginator } - - - - - + /** - * - * Summary: Get sms providers - * Description: Get sms providers - **/ + * + * Summary: Get sms providers + * Description: Get sms providers + **/ public func getSmsProviders( pageNo: Int?, pageSize: Int?, sort: [String: Any]?, - + onResponse: @escaping (_ response: SmsProviders?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = sort { - - xQuery["sort"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = sort { + xQuery["sort"] = value + } PlatformAPIClient.execute( config: config, @@ -19342,7 +15324,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -19350,71 +15332,39 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SmsProviders.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getSmsProviders - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getSmsProviders + * Description: fetch the next page by calling .next(...) function + **/ public func getSmsProvidersPaginator( pageSize: Int?, sort: [String: Any]? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getSmsProviders( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - , - sort: sort - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + sort: sort + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -19424,25 +15374,16 @@ if let value = sort { } return paginator } - - - - + /** - * - * Summary: Create sms provider - * Description: Create sms provider - **/ + * + * Summary: Create sms provider + * Description: Create sms provider + **/ public func createSmsProvider( body: SmsProviderReq, onResponse: @escaping (_ response: SmsProvider?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -19451,7 +15392,7 @@ if let value = sort { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -19459,39 +15400,29 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SmsProvider.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get sms provider by id - * Description: Get sms provider by id - **/ + * + * Summary: Get sms provider by id + * Description: Get sms provider by id + **/ public func getSmsProviderById( id: String, - + onResponse: @escaping (_ response: SmsProvider?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -19500,7 +15431,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -19508,39 +15439,29 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SmsProvider.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update sms provider by id - * Description: Update sms provider by id - **/ + * + * Summary: Update sms provider by id + * Description: Update sms provider by id + **/ public func updateSmsProviderById( id: String, body: SmsProviderReq, onResponse: @escaping (_ response: SmsProvider?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -19549,7 +15470,7 @@ if let value = sort { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -19557,61 +15478,44 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SmsProvider.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get sms templates - * Description: Get sms templates - **/ + * + * Summary: Get sms templates + * Description: Get sms templates + **/ public func getSmsTemplates( pageNo: Int?, pageSize: Int?, sort: [String: Any]?, - + onResponse: @escaping (_ response: SmsTemplates?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = sort { - - xQuery["sort"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = sort { + xQuery["sort"] = value + } PlatformAPIClient.execute( config: config, @@ -19621,7 +15525,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -19629,71 +15533,39 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SmsTemplates.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getSmsTemplates - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getSmsTemplates + * Description: fetch the next page by calling .next(...) function + **/ public func getSmsTemplatesPaginator( pageSize: Int?, sort: [String: Any]? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getSmsTemplates( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - , - sort: sort - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + sort: sort + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -19703,25 +15575,16 @@ if let value = sort { } return paginator } - - - - + /** - * - * Summary: Create sms template - * Description: Create sms template - **/ + * + * Summary: Create sms template + * Description: Create sms template + **/ public func createSmsTemplate( body: SmsTemplateReq, onResponse: @escaping (_ response: SmsTemplateRes?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -19730,7 +15593,7 @@ if let value = sort { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -19738,39 +15601,29 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SmsTemplateRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get sms template by id - * Description: Get sms template by id - **/ + * + * Summary: Get sms template by id + * Description: Get sms template by id + **/ public func getSmsTemplateById( id: String, - + onResponse: @escaping (_ response: SmsTemplate?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -19779,7 +15632,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -19787,39 +15640,29 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SmsTemplate.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update sms template by id - * Description: Update sms template by id - **/ + * + * Summary: Update sms template by id + * Description: Update sms template by id + **/ public func updateSmsTemplateById( id: String, body: SmsTemplateReq, onResponse: @escaping (_ response: SmsTemplateRes?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -19828,7 +15671,7 @@ if let value = sort { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -19836,39 +15679,29 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SmsTemplateRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete sms template by id - * Description: Delete sms template by id - **/ + * + * Summary: Delete sms template by id + * Description: Delete sms template by id + **/ public func deleteSmsTemplateById( id: String, - + onResponse: @escaping (_ response: SmsTemplateDeleteSuccessRes?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -19877,7 +15710,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -19885,61 +15718,44 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SmsTemplateDeleteSuccessRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get system sms templates - * Description: Get system sms templates - **/ + * + * Summary: Get system sms templates + * Description: Get system sms templates + **/ public func getSystemSystemTemplates( pageNo: Int?, pageSize: Int?, sort: [String: Any]?, - + onResponse: @escaping (_ response: SystemSmsTemplates?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = sort { - - xQuery["sort"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = sort { + xQuery["sort"] = value + } PlatformAPIClient.execute( config: config, @@ -19949,7 +15765,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -19957,71 +15773,39 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SystemSmsTemplates.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getSystemSystemTemplates - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getSystemSystemTemplates + * Description: fetch the next page by calling .next(...) function + **/ public func getSystemSystemTemplatesPaginator( pageSize: Int?, sort: [String: Any]? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getSystemSystemTemplates( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - , - sort: sort - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + sort: sort + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -20031,12 +15815,9 @@ if let value = sort { } return paginator } - } - - - - public class Payment { + + public class Payment { var config: PlatformConfig var companyId: String var applicationId: String @@ -20046,25 +15827,15 @@ if let value = sort { self.companyId = config.companyId self.applicationId = applicationId } - - - - + /** - * - * Summary: Get All Brand Payment Gateway Config Secret - * Description: Get All Brand Payment Gateway Config Secret - **/ + * + * Summary: Get All Brand Payment Gateway Config Secret + * Description: Get All Brand Payment Gateway Config Secret + **/ public func getBrandPaymentGatewayConfig( - onResponse: @escaping (_ response: PaymentGatewayConfigResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -20073,7 +15844,7 @@ if let value = sort { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -20081,38 +15852,28 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PaymentGatewayConfigResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Save Config Secret For Brand Payment Gateway - * Description: Save Config Secret For Brand Payment Gateway - **/ + * + * Summary: Save Config Secret For Brand Payment Gateway + * Description: Save Config Secret For Brand Payment Gateway + **/ public func saveBrandPaymentGatewayConfig( body: PaymentGatewayConfigRequest, onResponse: @escaping (_ response: PaymentGatewayToBeReviewed?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -20121,7 +15882,7 @@ if let value = sort { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -20129,38 +15890,28 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PaymentGatewayToBeReviewed.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Save Config Secret For Brand Payment Gateway - * Description: Save Config Secret For Brand Payment Gateway - **/ + * + * Summary: Save Config Secret For Brand Payment Gateway + * Description: Save Config Secret For Brand Payment Gateway + **/ public func updateBrandPaymentGatewayConfig( body: PaymentGatewayConfigRequest, onResponse: @escaping (_ response: PaymentGatewayToBeReviewed?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -20169,7 +15920,7 @@ if let value = sort { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -20177,49 +15928,35 @@ if let value = sort { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PaymentGatewayToBeReviewed.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get All Valid Payment Options - * Description: Use this API to get Get All Valid Payment Options for making payment - **/ + * + * Summary: Get All Valid Payment Options + * Description: Use this API to get Get All Valid Payment Options for making payment + **/ public func getPaymentModeRoutes( refresh: Bool, requestType: String, - + onResponse: @escaping (_ response: PaymentOptionsResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["refresh"] = refresh - - - - - xQuery["request_type"] = requestType + var xQuery: [String: Any] = [:] + xQuery["refresh"] = refresh - - - + xQuery["request_type"] = requestType PlatformAPIClient.execute( config: config, @@ -20229,7 +15966,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -20237,47 +15974,28 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PaymentOptionsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - + /** - * - * Summary: Save bank details for cancelled/returned order - * Description: Use this API to save bank details for returned/cancelled order to refund amount in his account. - **/ + * + * Summary: Save bank details for cancelled/returned order + * Description: Use this API to save bank details for returned/cancelled order to refund amount in his account. + **/ public func addBeneficiaryDetails( body: AddBeneficiaryDetailsRequest, onResponse: @escaping (_ response: RefundAccountResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -20286,7 +16004,7 @@ var xQuery: [String: Any] = [:] body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -20294,44 +16012,32 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(RefundAccountResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - + /** - * - * Summary: List Order Beneficiary - * Description: Get all active beneficiary details added by the user for refund - **/ + * + * Summary: List Order Beneficiary + * Description: Get all active beneficiary details added by the user for refund + **/ public func getUserOrderBeneficiaries( orderId: String, - + onResponse: @escaping (_ response: OrderBeneficiaryResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["order_id"] = orderId - - - - + var xQuery: [String: Any] = [:] + xQuery["order_id"] = orderId PlatformAPIClient.execute( config: config, @@ -20341,7 +16047,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -20349,43 +16055,32 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OrderBeneficiaryResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: List User Beneficiary - * Description: Get all active beneficiary details added by the user for refund - **/ + * + * Summary: List User Beneficiary + * Description: Get all active beneficiary details added by the user for refund + **/ public func getUserBeneficiaries( orderId: String, - + onResponse: @escaping (_ response: OrderBeneficiaryResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - - - xQuery["order_id"] = orderId - - - - + var xQuery: [String: Any] = [:] + xQuery["order_id"] = orderId PlatformAPIClient.execute( config: config, @@ -20395,7 +16090,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -20403,38 +16098,28 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OrderBeneficiaryResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Confirm payment after successful payment from payment gateway - * Description: Use this API to confirm payment after payment gateway accepted payment. - **/ + * + * Summary: Confirm payment after successful payment from payment gateway + * Description: Use this API to confirm payment after payment gateway accepted payment. + **/ public func confirmPayment( body: PaymentConfirmationRequest, onResponse: @escaping (_ response: PaymentConfirmationResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -20443,7 +16128,7 @@ var xQuery: [String: Any] = [:] body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -20451,25 +16136,21 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PaymentConfirmationResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - - public class Order { + + public class Order { var config: PlatformConfig var companyId: String var applicationId: String @@ -20479,34 +16160,72 @@ var xQuery: [String: Any] = [:] self.companyId = config.companyId self.applicationId = applicationId } - - - - - - - - - - - - - /** - * - * Summary: Track Shipment by shipment id, for application based on application Id - * Description: Shipment Track - **/ - public func trackShipmentPlatform( - shipmentId: String, - - onResponse: @escaping (_ response: PlatformShipmentTrack?, _ error: FDKError?) -> Void + + /** + * + * Summary: Get Order Details for company based on Company Id and Order Id + * Description: Get Orders + **/ + public func getOrderDetails( + orderId: String?, + next: String?, + previous: String?, + + onResponse: @escaping (_ response: OrderDetails?, _ error: FDKError?) -> Void ) { - - + var xQuery: [String: Any] = [:] + + if let value = orderId { + xQuery["order_id"] = value + } + + if let value = next { + xQuery["next"] = value + } + + if let value = previous { + xQuery["previous"] = value + } + + PlatformAPIClient.execute( + config: config, + method: "get", + url: "/service/platform/order/v1.0/company/\(companyId)/application/\(applicationId)/orders/details", + query: xQuery, + body: nil, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(OrderDetails.self, from: data) - + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + /** + * + * Summary: Track Shipment by shipment id, for application based on application Id + * Description: Shipment Track + **/ + public func trackShipmentPlatform( + shipmentId: String, + onResponse: @escaping (_ response: PlatformShipmentTrack?, _ error: FDKError?) -> Void + ) { PlatformAPIClient.execute( config: config, method: "get", @@ -20515,7 +16234,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -20523,39 +16242,29 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PlatformShipmentTrack.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Track Order by order id, for application based on application Id - * Description: Order Track - **/ + * + * Summary: Track Order by order id, for application based on application Id + * Description: Order Track + **/ public func trackOrder( orderId: String, - + onResponse: @escaping (_ response: PlatformOrderTrack?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -20564,7 +16273,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -20572,38 +16281,27 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(PlatformOrderTrack.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get all failed orders application wise - * Description: Failed Orders - **/ + * + * Summary: Get all failed orders application wise + * Description: Failed Orders + **/ public func failedOrders( - onResponse: @escaping (_ response: FailedOrders?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -20612,7 +16310,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -20620,48 +16318,116 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(FailedOrders.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Reprocess order by order id - * Description: Order Reprocess - **/ + * + * Summary: Reprocess order by order id + * Description: Order Reprocess + **/ public func reprocessOrder( orderId: String, - + onResponse: @escaping (_ response: UpdateOrderReprocessResponse?, _ error: FDKError?) -> Void ) { - - - - + PlatformAPIClient.execute( + config: config, + method: "post", + url: "/service/platform/order/v1.0/company/\(companyId)/application/\(applicationId)/orders/\(orderId)/reprocess", + query: nil, + body: nil, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(UpdateOrderReprocessResponse.self, from: data) + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + /** + * + * Summary: Use this API to update the shipment using its shipment ID. + * Description: Update the shipment + **/ + public func updateShipment( + shipmentId: String, + body: ShipmentUpdateRequest, + onResponse: @escaping (_ response: ShipmentUpdateResponse?, _ error: FDKError?) -> Void + ) { PlatformAPIClient.execute( config: config, method: "post", - url: "/service/platform/order/v1.0/company/\(companyId)/application/\(applicationId)/orders/\(orderId)/reprocess", + url: "/service/platform/order/v1.0/company/\(companyId)/application/\(applicationId)/orders/shipments/\(shipmentId)/update", + query: nil, + body: body.dictionary, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(ShipmentUpdateResponse.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Use this API to retrieve the issues that led to the cancellation of bags within a shipment. + * Description: Get reasons behind full or partial cancellation of a shipment + **/ + public func getPlatformShipmentReasons( + action: String, + + onResponse: @escaping (_ response: ShipmentReasonsResponse?, _ error: FDKError?) -> Void + ) { + PlatformAPIClient.execute( + config: config, + method: "get", + url: "/service/platform/order/v1.0/company/\(companyId)/application/\(applicationId)/orders/shipments/reasons/\(action)", query: nil, body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -20669,48 +16435,39 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(UpdateOrderReprocessResponse.self, from: data) - + let response = Utility.decode(ShipmentReasonsResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Use this API to update the shipment using its shipment ID. - * Description: Update the shipment - **/ - public func updateShipment( + * + * Summary: Use this API to track a shipment using its shipment ID. + * Description: Track shipment + **/ + public func getShipmentTrackDetails( + orderId: String, shipmentId: String, - body: ShipmentUpdateRequest, - onResponse: @escaping (_ response: ShipmentUpdateResponse?, _ error: FDKError?) -> Void - ) { - - - - - + onResponse: @escaping (_ response: ShipmentTrackResponse?, _ error: FDKError?) -> Void + ) { PlatformAPIClient.execute( config: config, - method: "post", - url: "/service/platform/order/v1.0/company/\(companyId)/application/\(applicationId)/orders/shipments/\(shipmentId)/update", + method: "get", + url: "/service/platform/order/v1.0/company/\(companyId)/application/\(applicationId)/orders/\(orderId)/shipments/\(shipmentId)/track", query: nil, - body: body.dictionary, + body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -20718,48 +16475,104 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(ShipmentUpdateResponse.self, from: data) - + let response = Utility.decode(ShipmentTrackResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Use this API to retrieve the issues that led to the cancellation of bags within a shipment. - * Description: Get reasons behind full or partial cancellation of a shipment - **/ - public func getPlatformShipmentReasons( - action: String, - - onResponse: @escaping (_ response: ShipmentReasonsResponse?, _ error: FDKError?) -> Void + * + * Summary: Get Orders for company based on Company Id + * Description: Get Orders at Application Level + **/ + public func getOrdersByApplicationId( + pageNo: String?, + pageSize: String?, + fromDate: String?, + toDate: String?, + q: String?, + stage: String?, + salesChannels: String?, + orderId: String?, + stores: String?, + status: String?, + dp: String?, + shortenUrls: Bool?, + filterType: String?, + + onResponse: @escaping (_ response: OrderListing?, _ error: FDKError?) -> Void ) { - - + var xQuery: [String: Any] = [:] + + if let value = pageNo { + xQuery["page_no"] = value + } + + if let value = pageSize { + xQuery["page_size"] = value + } + + if let value = fromDate { + xQuery["from_date"] = value + } + + if let value = toDate { + xQuery["to_date"] = value + } + + if let value = q { + xQuery["q"] = value + } + + if let value = stage { + xQuery["stage"] = value + } + + if let value = salesChannels { + xQuery["sales_channels"] = value + } + + if let value = orderId { + xQuery["order_id"] = value + } + + if let value = stores { + xQuery["stores"] = value + } + + if let value = status { + xQuery["status"] = value + } + + if let value = dp { + xQuery["dp"] = value + } - + if let value = shortenUrls { + xQuery["shorten_urls"] = value + } + if let value = filterType { + xQuery["filter_type"] = value + } PlatformAPIClient.execute( config: config, method: "get", - url: "/service/platform/order/v1.0/company/\(companyId)/application/\(applicationId)/orders/shipments/reasons/\(action)", - query: nil, + url: "/service/platform/order/v1.0/company/\(companyId)/application/\(applicationId)/orders", + query: xQuery, body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -20767,49 +16580,50 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(ShipmentReasonsResponse.self, from: data) - + let response = Utility.decode(OrderListing.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - /** - * - * Summary: Use this API to track a shipment using its shipment ID. - * Description: Track shipment - **/ - public func getShipmentTrackDetails( - orderId: String, - shipmentId: String, - - onResponse: @escaping (_ response: ShipmentTrackResponse?, _ error: FDKError?) -> Void - ) { - - + } - + public class Catalog { + var config: PlatformConfig + var companyId: String + var applicationId: String + + init(config: PlatformConfig, applicationId: String) { + self.config = config + self.companyId = config.companyId + self.applicationId = applicationId + } + /** + * + * Summary: Get a Search Keywords Details + * Description: Get the details of a words by its `id`. If successful, returns a Collection resource in the response body specified in `GetSearchWordsDetailResponseSchema` + **/ + public func getSearchKeywords( + id: String, + onResponse: @escaping (_ response: GetSearchWordsDetailResponse?, _ error: FDKError?) -> Void + ) { PlatformAPIClient.execute( config: config, method: "get", - url: "/service/platform/order/v1.0/company/\(companyId)/application/\(applicationId)/orders/\(orderId)/shipments/\(shipmentId)/track", + url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/search/keyword/\(id)/", query: nil, body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -20817,59 +16631,29 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(ShipmentTrackResponse.self, from: data) - + let response = Utility.decode(GetSearchWordsDetailResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - } - - - - public class Catalog { - var config: PlatformConfig - var companyId: String - var applicationId: String - init(config: PlatformConfig, applicationId: String) { - self.config = config - self.companyId = config.companyId - self.applicationId = applicationId - } - - - - /** - * - * Summary: Delete a Search Keywords - * Description: Delete a keywords by it's id. Returns an object that tells whether the keywords was deleted successfully - **/ + * + * Summary: Delete a Search Keywords + * Description: Delete a keywords by it's id. Returns an object that tells whether the keywords was deleted successfully + **/ public func deleteSearchKeywords( id: String, - + onResponse: @escaping (_ response: DeleteResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -20878,7 +16662,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -20886,39 +16670,29 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DeleteResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update Search Keyword - * Description: Update Search Keyword by its id. On successful request, returns the updated collection - **/ + * + * Summary: Update Search Keyword + * Description: Update Search Keyword by its id. On successful request, returns the updated collection + **/ public func updateSearchKeywords( id: String, body: CreateSearchKeyword, onResponse: @escaping (_ response: GetSearchWordsData?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -20927,7 +16701,7 @@ var xQuery: [String: Any] = [:] body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -20935,48 +16709,36 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetSearchWordsData.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get a Search Keywords Details - * Description: Get the details of a words by its `id`. If successful, returns a Collection resource in the response body specified in `GetSearchWordsDetailResponseSchema` - **/ - public func getSearchKeywords( - id: String, - - onResponse: @escaping (_ response: GetSearchWordsDetailResponse?, _ error: FDKError?) -> Void + * + * Summary: List all Search Custom Keyword Listing + * Description: Custom Search Keyword allows you to map conditions with keywords to give you the ultimate results + **/ + public func getAllSearchKeyword( + onResponse: @escaping (_ response: GetSearchWordsResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", - url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/search/keyword/\(id)/", + url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/search/keyword/", query: nil, body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -20984,38 +16746,28 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(GetSearchWordsDetailResponse.self, from: data) - + let response = Utility.decode(GetSearchWordsResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Add a Custom Search Keywords - * Description: Create a Custom Search Keywords. See `CreateSearchKeywordSchema` for the list of attributes needed to create a mapping and /collections/query-options for the available options to create a rule. On successful request, returns a paginated list of collections specified in `CreateSearchKeywordSchema` - **/ + * + * Summary: Add a Custom Search Keywords + * Description: Create a Custom Search Keywords. See `CreateSearchKeywordSchema` for the list of attributes needed to create a mapping and /collections/query-options for the available options to create a rule. On successful request, returns a paginated list of collections specified in `CreateSearchKeywordSchema` + **/ public func createCustomKeyword( body: CreateSearchKeyword, onResponse: @escaping (_ response: GetSearchWordsData?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -21024,7 +16776,7 @@ var xQuery: [String: Any] = [:] body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21032,47 +16784,38 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetSearchWordsData.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - /** - * - * Summary: List all Search Custom Keyword Listing - * Description: Custom Search Keyword allows you to map conditions with keywords to give you the ultimate results - **/ - public func getAllSearchKeyword( - - onResponse: @escaping (_ response: GetSearchWordsResponse?, _ error: FDKError?) -> Void - ) { - - - - + /** + * + * Summary: Get a Autocomplete Keywords Details + * Description: Get the details of a words by its `id`. If successful, returns a keywords resource in the response body specified in `GetAutocompleteWordsResponseSchema` + **/ + public func getAutocompleteKeywordDetail( + id: String, + onResponse: @escaping (_ response: GetAutocompleteWordsResponse?, _ error: FDKError?) -> Void + ) { PlatformAPIClient.execute( config: config, method: "get", - url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/search/keyword/", + url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/search/autocomplete/\(id)/", query: nil, body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21080,39 +16823,29 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(GetSearchWordsResponse.self, from: data) - + let response = Utility.decode(GetAutocompleteWordsResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete a Autocomplete Keywords - * Description: Delete a keywords by it's id. Returns an object that tells whether the keywords was deleted successfully - **/ + * + * Summary: Delete a Autocomplete Keywords + * Description: Delete a keywords by it's id. Returns an object that tells whether the keywords was deleted successfully + **/ public func deleteAutocompleteKeyword( id: String, - + onResponse: @escaping (_ response: DeleteResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -21121,7 +16854,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21129,39 +16862,29 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DeleteResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create & Update Autocomplete Keyword - * Description: Update a mapping by it's id. On successful request, returns the updated Keyword mapping - **/ + * + * Summary: Create & Update Autocomplete Keyword + * Description: Update a mapping by it's id. On successful request, returns the updated Keyword mapping + **/ public func updateAutocompleteKeyword( id: String, body: CreateAutocompleteKeyword, onResponse: @escaping (_ response: GetAutocompleteWordsResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -21170,7 +16893,7 @@ var xQuery: [String: Any] = [:] body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21178,48 +16901,36 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetAutocompleteWordsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get a Autocomplete Keywords Details - * Description: Get the details of a words by its `id`. If successful, returns a keywords resource in the response body specified in `GetAutocompleteWordsResponseSchema` - **/ - public func getAutocompleteKeywordDetail( - id: String, - + * + * Summary: List all Autocomplete Keyword Listing + * Description: Custom Autocomplete Keyword allows you to map conditions with keywords to give you the ultimate results + **/ + public func getAutocompleteConfig( onResponse: @escaping (_ response: GetAutocompleteWordsResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", - url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/search/autocomplete/\(id)/", + url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/search/autocomplete/", query: nil, body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21227,38 +16938,28 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetAutocompleteWordsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Add a Custom Autocomplete Keywords - * Description: Create a Custom Autocomplete Keywords. See `CreateAutocompleteKeywordSchema` for the list of attributes needed to create a mapping and /collections/query-options for the available options to create a rule. On successful request, returns a paginated list of collections specified in `CreateAutocompleteKeywordSchema` - **/ + * + * Summary: Add a Custom Autocomplete Keywords + * Description: Create a Custom Autocomplete Keywords. See `CreateAutocompleteKeywordSchema` for the list of attributes needed to create a mapping and /collections/query-options for the available options to create a rule. On successful request, returns a paginated list of collections specified in `CreateAutocompleteKeywordSchema` + **/ public func createCustomAutocompleteRule( body: CreateAutocompleteKeyword, onResponse: @escaping (_ response: CreateAutocompleteWordsResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -21267,7 +16968,7 @@ var xQuery: [String: Any] = [:] body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21275,47 +16976,38 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CreateAutocompleteWordsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: List all Autocomplete Keyword Listing - * Description: Custom Autocomplete Keyword allows you to map conditions with keywords to give you the ultimate results - **/ - public func getAutocompleteConfig( - - onResponse: @escaping (_ response: GetAutocompleteWordsResponse?, _ error: FDKError?) -> Void + * + * Summary: Update a single custom meta. + * Description: This API helps to update data associated to a item custom meta. + **/ + public func updateAppProduct( + itemId: String, + body: ApplicationItemMeta, + onResponse: @escaping (_ response: SuccessResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "get", - url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/search/autocomplete/", + method: "patch", + url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/product/\(itemId)/", query: nil, - body: nil, + body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21323,46 +17015,27 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(GetAutocompleteWordsResponse.self, from: data) - + let response = Utility.decode(SuccessResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - + /** - * - * Summary: Get configuration meta details for catalog for admin panel - * Description: configuration meta details for catalog. - **/ + * + * Summary: Get configuration meta details for catalog for admin panel + * Description: configuration meta details for catalog. + **/ public func getCatalogConfiguration( - onResponse: @escaping (_ response: GetCatalogConfigurationMetaData?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -21371,7 +17044,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21379,47 +17052,36 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetCatalogConfigurationMetaData.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Add configuration for products & listings - * Description: Add configuration for products & listing. - **/ - public func createConfigurationProductListing( - body: AppConfiguration, + * + * Summary: Get configured details for catalog + * Description: configured details for catalog. + **/ + public func getConfigurations( onResponse: @escaping (_ response: GetAppCatalogConfiguration?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "post", + method: "get", url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/product-configuration/", query: nil, - body: body.dictionary, + body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21427,47 +17089,37 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetAppCatalogConfiguration.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get configured details for catalog - * Description: configured details for catalog. - **/ - public func getConfigurations( - + * + * Summary: Add configuration for products & listings + * Description: Add configuration for products & listing. + **/ + public func createConfigurationProductListing( + body: AppConfiguration, onResponse: @escaping (_ response: GetAppCatalogConfiguration?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "get", + method: "post", url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/product-configuration/", query: nil, - body: nil, + body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21475,48 +17127,38 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetAppCatalogConfiguration.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Add configuration for categories and brands - * Description: Add configuration for categories & brands. - **/ - public func createConfigurationByType( + * + * Summary: Get configured details for catalog + * Description: configured details for catalog. + **/ + public func getConfigurationByType( type: String, - body: AppConfiguration, - onResponse: @escaping (_ response: GetAppCatalogConfiguration?, _ error: FDKError?) -> Void - ) { - - - - - + onResponse: @escaping (_ response: GetAppCatalogEntityConfiguration?, _ error: FDKError?) -> Void + ) { PlatformAPIClient.execute( config: config, - method: "post", + method: "get", url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/productConfiguration/\(type)/", query: nil, - body: body.dictionary, + body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21524,48 +17166,38 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(GetAppCatalogConfiguration.self, from: data) - + let response = Utility.decode(GetAppCatalogEntityConfiguration.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get configured details for catalog - * Description: configured details for catalog. - **/ - public func getConfigurationByType( + * + * Summary: Add configuration for categories and brands + * Description: Add configuration for categories & brands. + **/ + public func createConfigurationByType( type: String, - - onResponse: @escaping (_ response: GetAppCatalogEntityConfiguration?, _ error: FDKError?) -> Void + body: AppConfiguration, + onResponse: @escaping (_ response: GetAppCatalogConfiguration?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "get", + method: "post", url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/productConfiguration/\(type)/", query: nil, - body: nil, + body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21573,38 +17205,27 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(GetAppCatalogEntityConfiguration.self, from: data) - + let response = Utility.decode(GetAppCatalogConfiguration.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get query filters to configure a collection - * Description: Get query filters to configure a collection - **/ + * + * Summary: Get query filters to configure a collection + * Description: Get query filters to configure a collection + **/ public func getQueryFilters( - onResponse: @escaping (_ response: GetCollectionQueryOptionResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -21613,7 +17234,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21621,47 +17242,64 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GetCollectionQueryOptionResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Add a Collection - * Description: Create a collection. See `CreateCollectionRequestSchema` for the list of attributes needed to create a collection and collections/query-options for the available options to create a collection. On successful request, returns a paginated list of collections specified in `CollectionCreateResponse` - **/ - public func createCollection( - body: CreateCollection, - onResponse: @escaping (_ response: CollectionCreateResponse?, _ error: FDKError?) -> Void + * + * Summary: List all the collections + * Description: A Collection allows you to organize your products into hierarchical groups. For example, a dress might be in the category _Clothing_, the individual product might also be in the collection _Summer_. On successful request, returns all the collections as specified in `CollectionListingSchema` + **/ + public func getAllCollections( + q: String?, + tags: [String]?, + isActive: Bool?, + pageNo: Int?, + pageSize: Int?, + + onResponse: @escaping (_ response: GetCollectionListingResponse?, _ error: FDKError?) -> Void ) { - - + var xQuery: [String: Any] = [:] + + if let value = q { + xQuery["q"] = value + } + + if let value = tags { + xQuery["tags"] = value + } + + if let value = isActive { + xQuery["is_active"] = value + } - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, - method: "post", + method: "get", url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/collections/", - query: nil, - body: body.dictionary, + query: xQuery, + body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21669,47 +17307,37 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(CollectionCreateResponse.self, from: data) - + let response = Utility.decode(GetCollectionListingResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: List all the collections - * Description: A Collection allows you to organize your products into hierarchical groups. For example, a dress might be in the category _Clothing_, the individual product might also be in the collection _Summer_. On successful request, returns all the collections as specified in `CollectionListingSchema` - **/ - public func getAllCollections( - - onResponse: @escaping (_ response: GetCollectionListingResponse?, _ error: FDKError?) -> Void + * + * Summary: Add a Collection + * Description: Create a collection. See `CreateCollectionRequestSchema` for the list of attributes needed to create a collection and collections/query-options for the available options to create a collection. On successful request, returns a paginated list of collections specified in `CollectionCreateResponse` + **/ + public func createCollection( + body: CreateCollection, + onResponse: @escaping (_ response: CollectionCreateResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, - method: "get", + method: "post", url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/collections/", query: nil, - body: nil, + body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21717,39 +17345,29 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(GetCollectionListingResponse.self, from: data) - + let response = Utility.decode(CollectionCreateResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get a particular collection - * Description: Get the details of a collection by its `slug`. If successful, returns a Collection resource in the response body specified in `CollectionDetailResponse` - **/ + * + * Summary: Get a particular collection + * Description: Get the details of a collection by its `slug`. If successful, returns a Collection resource in the response body specified in `CollectionDetailResponse` + **/ public func getCollectionDetail( slug: String, - + onResponse: @escaping (_ response: CollectionDetailResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -21758,7 +17376,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21766,39 +17384,29 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CollectionDetailResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Delete a Collection - * Description: Delete a collection by it's id. Returns an object that tells whether the collection was deleted successfully - **/ + * + * Summary: Delete a Collection + * Description: Delete a collection by it's id. Returns an object that tells whether the collection was deleted successfully + **/ public func deleteCollection( id: String, - + onResponse: @escaping (_ response: DeleteResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -21807,7 +17415,7 @@ var xQuery: [String: Any] = [:] body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21815,39 +17423,29 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DeleteResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update a collection - * Description: Update a collection by it's id. On successful request, returns the updated collection - **/ + * + * Summary: Update a collection + * Description: Update a collection by it's id. On successful request, returns the updated collection + **/ public func updateCollection( id: String, body: UpdateCollection, onResponse: @escaping (_ response: UpdateCollection?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -21856,7 +17454,7 @@ var xQuery: [String: Any] = [:] body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21864,48 +17462,55 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UpdateCollection.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Add items to a collection - * Description: Adds items to a collection specified by its `id`. See `CollectionItemRequest` for the list of attributes needed to add items to an collection. - **/ - public func addCollectionItems( + * + * Summary: Get the items for a collection + * Description: Get items from a collection specified by its `id`. + **/ + public func getCollectionItems( id: String, - body: CollectionItemRequest, - onResponse: @escaping (_ response: UpdatedResponse?, _ error: FDKError?) -> Void + sortOn: String?, + pageId: String?, + pageSize: Int?, + + onResponse: @escaping (_ response: GetCollectionItemsResponse?, _ error: FDKError?) -> Void ) { - - + var xQuery: [String: Any] = [:] + + if let value = sortOn { + xQuery["sort_on"] = value + } - + if let value = pageId { + xQuery["page_id"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, - method: "post", + method: "get", url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/collections/\(id)/items/", - query: nil, - body: body.dictionary, + query: xQuery, + body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21913,72 +17518,83 @@ var xQuery: [String: Any] = [:] } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(UpdatedResponse.self, from: data) - + let response = Utility.decode(GetCollectionItemsResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get the items for a collection - * Description: Get items from a collection specified by its `id`. - **/ - public func getCollectionItems( + * + * Summary: Add items to a collection + * Description: Adds items to a collection specified by its `id`. See `CollectionItemRequest` for the list of attributes needed to add items to an collection. + **/ + public func addCollectionItems( id: String, - sortOn: String?, - pageId: String?, - pageSize: Int?, - - onResponse: @escaping (_ response: GetCollectionItemsResponse?, _ error: FDKError?) -> Void + body: CollectionItemRequest, + onResponse: @escaping (_ response: UpdatedResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = sortOn { - - xQuery["sort_on"] = value - -} - - -if let value = pageId { - - xQuery["page_id"] = value - -} - + PlatformAPIClient.execute( + config: config, + method: "post", + url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/collections/\(id)/items/", + query: nil, + body: body.dictionary, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(UpdatedResponse.self, from: data) -if let value = pageSize { - - xQuery["page_size"] = value - -} + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + /** + * + * Summary: Analytics data of catalog and inventory. + * Description: Catalog Insights api returns the count of catalog related data like products, brands, departments and categories that have been made live as per configuration of the app. + **/ + public func getCatalogInsights( + brand: String?, - + onResponse: @escaping (_ response: CatalogInsightResponse?, _ error: FDKError?) -> Void + ) { + var xQuery: [String: Any] = [:] + if let value = brand { + xQuery["brand"] = value + } PlatformAPIClient.execute( config: config, method: "get", - url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/collections/\(id)/items/", + url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/analytics/insights/", query: xQuery, body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -21986,55 +17602,61 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(GetCollectionItemsResponse.self, from: data) - + let response = Utility.decode(CatalogInsightResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Analytics data of catalog and inventory. - * Description: Catalog Insights api returns the count of catalog related data like products, brands, departments and categories that have been made live as per configuration of the app. - **/ - public func getCatalogInsights( - brand: String?, - - onResponse: @escaping (_ response: CatalogInsightResponse?, _ error: FDKError?) -> Void + * + * Summary: Get Inventory for company + * Description: This API allows get Inventory data for particular company grouped by size and store. + **/ + public func getDiscountedInventoryBySizeIdentifier( + itemId: Int, + sizeIdentifier: String, + pageNo: Int?, + pageSize: Int?, + q: String?, + locationIds: [Int]?, + + onResponse: @escaping (_ response: InventoryResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = brand { - - xQuery["brand"] = value - -} + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } - + if let value = q { + xQuery["q"] = value + } + if let value = locationIds { + xQuery["location_ids"] = value + } PlatformAPIClient.execute( config: config, method: "get", - url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/analytics/insights/", + url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/products/\(itemId)/inventory/\(sizeIdentifier)", query: xQuery, body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -22042,115 +17664,54 @@ if let value = brand { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(CatalogInsightResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: List all the brands - * Description: A brand is the name under which a product is being sold. Use this API to list all the brands. You can pass optionally filter the brands by the department. If successful, returns a paginated list of brands specified in `BrandListingResponse` - **/ + let response = Utility.decode(InventoryResponse.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: List all the brands + * Description: A brand is the name under which a product is being sold. Use this API to list all the brands. You can pass optionally filter the brands by the department. If successful, returns a paginated list of brands specified in `BrandListingResponse` + **/ public func getApplicationBrands( department: String?, pageNo: Int?, pageSize: Int?, - + q: String?, + brandId: [Int]?, + onResponse: @escaping (_ response: BrandListingResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = department { - - xQuery["department"] = value - -} - - -if let value = pageNo { - - xQuery["page_no"] = value - -} + var xQuery: [String: Any] = [:] + if let value = department { + xQuery["department"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } - + if let value = q { + xQuery["q"] = value + } + if let value = brandId { + xQuery["brand_id"] = value + } PlatformAPIClient.execute( config: config, @@ -22160,7 +17721,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -22168,71 +17729,43 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(BrandListingResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getApplicationBrands - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getApplicationBrands + * Description: fetch the next page by calling .next(...) function + **/ public func getApplicationBrandsPaginator( department: String?, - pageSize: Int? - - ) -> Paginator { + pageSize: Int?, + q: String?, + brandId: [Int]? + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getApplicationBrands( - - department: department, - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + department: department, + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + q: q, + brandId: brandId + ) { response, error in if let response = response { paginator.hasNext = response.page.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -22242,25 +17775,15 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: List all the departments - * Description: Departments are a way to categorise similar products. A product can lie in multiple departments. For example, a skirt can below to the 'Women's Fashion' Department while a handbag can lie in 'Women's Accessories' Department. Use this API to list all the departments. If successful, returns the list of departments specified in `DepartmentResponse` - **/ + * + * Summary: List all the departments + * Description: Departments are a way to categorise similar products. A product can lie in multiple departments. For example, a skirt can below to the 'Women's Fashion' Department while a handbag can lie in 'Women's Accessories' Department. Use this API to list all the departments. If successful, returns the list of departments specified in `DepartmentResponse` + **/ public func getDepartments( - onResponse: @escaping (_ response: DepartmentResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -22269,7 +17792,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -22277,45 +17800,34 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DepartmentResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: List all the categories - * Description: List all the categories. You can optionally pass filter the brands by the department. If successful, returns a paginated list of brands specified in `CategoryListingResponse` - **/ + * + * Summary: List all the categories + * Description: List all the categories. You can optionally pass filter the brands by the department. If successful, returns a paginated list of brands specified in `CategoryListingResponse` + **/ public func getCategories( department: String?, - + onResponse: @escaping (_ response: CategoryListingResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = department { - - xQuery["department"] = value - -} - - - + var xQuery: [String: Any] = [:] + if let value = department { + xQuery["department"] = value + } PlatformAPIClient.execute( config: config, @@ -22325,7 +17837,7 @@ if let value = department { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -22333,28 +17845,24 @@ if let value = department { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CategoryListingResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: List the products - * Description: List all the products associated with a brand, collection or category in a requested sort order. The API additionally supports arbitrary search queries that may refer the name of any product, brand, category or collection. If successful, returns a paginated list of products specified in `ApplicationProductListingResponse` - **/ + * + * Summary: List the products + * Description: List all the products associated with a brand, collection or category in a requested sort order. The API additionally supports arbitrary search queries that may refer the name of any product, brand, category or collection. If successful, returns a paginated list of products specified in `ApplicationProductListingResponse` + **/ public func getAppicationProducts( q: String?, f: String?, @@ -22364,70 +17872,47 @@ if let value = department { pageSize: Int?, pageNo: Int?, pageType: String?, - + itemIds: [Int]?, + onResponse: @escaping (_ response: ApplicationProductListingResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = q { - - xQuery["q"] = value - -} - - -if let value = f { - - xQuery["f"] = value - -} - - -if let value = filters { - - xQuery["filters"] = value - -} - - -if let value = sortOn { - - xQuery["sort_on"] = value - -} - - -if let value = pageId { - - xQuery["page_id"] = value - -} + var xQuery: [String: Any] = [:] + if let value = q { + xQuery["q"] = value + } -if let value = pageSize { - - xQuery["page_size"] = value - -} + if let value = f { + xQuery["f"] = value + } + if let value = filters { + xQuery["filters"] = value + } -if let value = pageNo { - - xQuery["page_no"] = value - -} + if let value = sortOn { + xQuery["sort_on"] = value + } + if let value = pageId { + xQuery["page_id"] = value + } -if let value = pageType { - - xQuery["page_type"] = value - -} + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = pageNo { + xQuery["page_no"] = value + } - + if let value = pageType { + xQuery["page_type"] = value + } + if let value = itemIds { + xQuery["item_ids"] = value + } PlatformAPIClient.execute( config: config, @@ -22437,149 +17922,79 @@ if let value = pageType { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { err?.status = responseCode } onResponse(nil, err) - } else if let data = responseData { - - let response = Utility.decode(ApplicationProductListingResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getAppicationProducts - * Description: fetch the next page by calling .next(...) function - **/ + } else if let data = responseData { + let response = Utility.decode(ApplicationProductListingResponse.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getAppicationProducts + * Description: fetch the next page by calling .next(...) function + **/ public func getAppicationProductsPaginator( q: String?, f: String?, filters: Bool?, sortOn: String?, - pageSize: Int? - - ) -> Paginator { + pageSize: Int?, + itemIds: [Int]? + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "cursor") paginator.onPage = { self.getAppicationProducts( - - q: q, - f: f, - filters: filters, - sortOn: sortOn, - pageId: paginator.pageId - , - pageSize: paginator.pageSize - , - pageNo: paginator.pageNo - , - pageType: paginator.type - - ) { response, error in + q: q, + f: f, + filters: filters, + sortOn: sortOn, + pageId: paginator.pageId, + + pageSize: paginator.pageSize, + + pageNo: paginator.pageNo, + + pageType: paginator.type, + + itemIds: itemIds + ) { response, error in if let response = response { paginator.hasNext = response.page.hasNext ?? false paginator.pageId = response.page.nextId - } paginator.onNext?(response, error) } } return paginator } - - - - + /** - * - * Summary: Get a product - * Description: Products are the core resource of an application. Products can be associated by categories, collections, brands and more. This API retrieves the product specified by the given **slug**. If successful, returns a Product resource in the response body specified in `ProductDetail` - **/ + * + * Summary: Get a product + * Description: Products are the core resource of an application. Products can be associated by categories, collections, brands and more. This API retrieves the product specified by the given **slug**. If successful, returns a Product resource in the response body specified in `ProductDetail` + **/ public func getProductDetailBySlug( slug: String, - + onResponse: @escaping (_ response: ProductDetail?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -22588,7 +18003,7 @@ if let value = pageType { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -22596,95 +18011,144 @@ if let value = pageType { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ProductDetail.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get applicationwise products - * Description: Products are the core resource of an application. Products can be associated by categories, collections, brands and more. If successful, returns a Product resource in the response body specified in `ApplicationProductListingResponseDatabasePowered` - **/ + * + * Summary: Get applicationwise products + * Description: Products are the core resource of an application. Products can be associated by categories, collections, brands and more. If successful, returns a Product resource in the response body specified in `ApplicationProductListingResponseDatabasePowered` + **/ public func getAppProducts( brandIds: [Int]?, categoryIds: [Int]?, departmentIds: [Int]?, + tags: [String]?, pageNo: Int?, pageSize: Int?, q: String?, - + onResponse: @escaping (_ response: ProductListingResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] + var xQuery: [String: Any] = [:] -if let value = brandIds { - - xQuery["brand_ids"] = value - -} + if let value = brandIds { + xQuery["brand_ids"] = value + } + if let value = categoryIds { + xQuery["category_ids"] = value + } -if let value = categoryIds { - - xQuery["category_ids"] = value - -} + if let value = departmentIds { + xQuery["department_ids"] = value + } + if let value = tags { + xQuery["tags"] = value + } -if let value = departmentIds { - - xQuery["department_ids"] = value - -} + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } -if let value = pageNo { - - xQuery["page_no"] = value - -} + if let value = q { + xQuery["q"] = value + } + + PlatformAPIClient.execute( + config: config, + method: "get", + url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/raw-products/", + query: xQuery, + body: nil, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(ProductListingResponse.self, from: data) + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } -if let value = pageSize { - - xQuery["page_size"] = value - -} + /** + * + * Summary: Get list of locations + * Description: This API allows to view all the locations asscoiated to a application. + **/ + public func getAppLocations( + storeType: String?, + uid: [Int]?, + q: String?, + stage: String?, + pageNo: Int?, + pageSize: Int?, + onResponse: @escaping (_ response: LocationListSerializer?, _ error: FDKError?) -> Void + ) { + var xQuery: [String: Any] = [:] -if let value = q { - - xQuery["q"] = value - -} + if let value = storeType { + xQuery["store_type"] = value + } + + if let value = uid { + xQuery["uid"] = value + } + + if let value = q { + xQuery["q"] = value + } + if let value = stage { + xQuery["stage"] = value + } - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, method: "get", - url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/raw-products/", + url: "/service/platform/catalog/v1.0/company/\(companyId)/application/\(applicationId)/locations", query: xQuery, body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -22692,25 +18156,57 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - - let response = Utility.decode(ProductListingResponse.self, from: data) - + let response = Utility.decode(LocationListSerializer.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) + } + + /** + * + * Summary: get paginator for getAppLocations + * Description: fetch the next page by calling .next(...) function + **/ + public func getAppLocationsPaginator( + storeType: String?, + uid: [Int]?, + q: String?, + stage: String?, + pageSize: Int? + + ) -> Paginator { + let pageSize = pageSize ?? 20 + let paginator = Paginator(pageSize: pageSize, type: "number") + paginator.onPage = { + self.getAppLocations( + storeType: storeType, + uid: uid, + q: q, + stage: stage, + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in + if let response = response { + paginator.hasNext = response.page?.hasNext ?? false + paginator.pageNo = (paginator.pageNo ?? 0) + 1 + } + paginator.onNext?(response, error) + } + } + return paginator } - - } - - - - public class FileStorage { + + public class FileStorage { var config: PlatformConfig var companyId: String var applicationId: String @@ -22720,46 +18216,35 @@ if let value = q { self.companyId = config.companyId self.applicationId = applicationId } - - - - - - + /** - * - * Summary: This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob. - * Description: Uploads an arbitrarily sized buffer or blob. + * + * Summary: This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob. + * Description: Uploads an arbitrarily sized buffer or blob. -It has three Major Steps: -* Start -* Upload -* Complete + It has three Major Steps: + * Start + * Upload + * Complete -### Start -Initiates the assets upload using `appStartUpload`. -It returns the storage link in response. + ### Start + Initiates the assets upload using `appStartUpload`. + It returns the storage link in response. -### Upload -Use the storage link to upload a file (Buffer or Blob) to the File Storage. -Make a `PUT` request on storage link received from `appStartUpload` api with file (Buffer or Blob) as a request body. + ### Upload + Use the storage link to upload a file (Buffer or Blob) to the File Storage. + Make a `PUT` request on storage link received from `appStartUpload` api with file (Buffer or Blob) as a request body. -### Complete -After successfully upload, call `appCompleteUpload` api to complete the upload process. -This operation will return the url for the uploaded file. + ### Complete + After successfully upload, call `appCompleteUpload` api to complete the upload process. + This operation will return the url for the uploaded file. - **/ + **/ public func appStartUpload( namespace: String, body: StartRequest, onResponse: @escaping (_ response: StartResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -22768,7 +18253,7 @@ This operation will return the url for the uploaded file. body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -22776,57 +18261,47 @@ This operation will return the url for the uploaded file. } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(StartResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process. - * Description: Uploads an arbitrarily sized buffer or blob. + * + * Summary: This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process. + * Description: Uploads an arbitrarily sized buffer or blob. -It has three Major Steps: -* Start -* Upload -* Complete + It has three Major Steps: + * Start + * Upload + * Complete -### Start -Initiates the assets upload using `appStartUpload`. -It returns the storage link in response. + ### Start + Initiates the assets upload using `appStartUpload`. + It returns the storage link in response. -### Upload -Use the storage link to upload a file (Buffer or Blob) to the File Storage. -Make a `PUT` request on storage link received from `appStartUpload` api with file (Buffer or Blob) as a request body. + ### Upload + Use the storage link to upload a file (Buffer or Blob) to the File Storage. + Make a `PUT` request on storage link received from `appStartUpload` api with file (Buffer or Blob) as a request body. -### Complete -After successfully upload, call `appCompleteUpload` api to complete the upload process. -This operation will return the url for the uploaded file. + ### Complete + After successfully upload, call `appCompleteUpload` api to complete the upload process. + This operation will return the url for the uploaded file. - **/ + **/ public func appCompleteUpload( namespace: String, body: StartResponse, onResponse: @escaping (_ response: CompleteResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -22835,7 +18310,7 @@ This operation will return the url for the uploaded file. body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -22843,47 +18318,34 @@ This operation will return the url for the uploaded file. } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CompleteResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - + /** - * - * Summary: Copy Files - * Description: Copy Files - **/ + * + * Summary: Copy Files + * Description: Copy Files + **/ public func appCopyFiles( sync: Bool?, body: BulkRequest, onResponse: @escaping (_ response: BulkResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = sync { - - xQuery["sync"] = value - -} - - - + var xQuery: [String: Any] = [:] + if let value = sync { + xQuery["sync"] = value + } PlatformAPIClient.execute( config: config, @@ -22893,7 +18355,7 @@ if let value = sync { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -22901,47 +18363,35 @@ if let value = sync { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(BulkResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - + /** - * - * Summary: Browse Files - * Description: Browse Files - **/ + * + * Summary: Browse Files + * Description: Browse Files + **/ public func browse( namespace: String, pageNo: Int?, - + onResponse: @escaping (_ response: BrowseResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - - + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } PlatformAPIClient.execute( config: config, @@ -22951,7 +18401,7 @@ if let value = pageNo { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -22959,62 +18409,36 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(BrowseResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for browse - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for browse + * Description: fetch the next page by calling .next(...) function + **/ public func browsePaginator( namespace: String - - ) -> Paginator { + + ) -> Paginator { let pageSize = 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.browse( - - namespace: namespace, - pageNo: paginator.pageNo - - ) { response, error in + namespace: namespace, + pageNo: paginator.pageNo + + ) { response, error in if let response = response { paginator.hasNext = response.page.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -23024,13 +18448,9 @@ if let value = pageNo { } return paginator } - - } - - - - public class Share { + + public class Share { var config: PlatformConfig var companyId: String var applicationId: String @@ -23040,25 +18460,16 @@ if let value = pageNo { self.companyId = config.companyId self.applicationId = applicationId } - - - - + /** - * - * Summary: Create short link - * Description: Create short link - **/ + * + * Summary: Create short link + * Description: Create short link + **/ public func createShortLink( body: ShortLinkReq, onResponse: @escaping (_ response: ShortLinkRes?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -23067,7 +18478,7 @@ if let value = pageNo { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -23075,77 +18486,54 @@ if let value = pageNo { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ShortLinkRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get short links - * Description: Get short links - **/ + * + * Summary: Get short links + * Description: Get short links + **/ public func getShortLinks( pageNo: Int?, pageSize: Int?, createdBy: String?, active: String?, q: String?, - + onResponse: @escaping (_ response: ShortLinkList?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = createdBy { - - xQuery["created_by"] = value - -} - - -if let value = active { - - xQuery["active"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } -if let value = q { - - xQuery["q"] = value - -} + if let value = pageSize { + xQuery["page_size"] = value + } + if let value = createdBy { + xQuery["created_by"] = value + } - + if let value = active { + xQuery["active"] = value + } + if let value = q { + xQuery["q"] = value + } PlatformAPIClient.execute( config: config, @@ -23155,7 +18543,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -23163,87 +18551,43 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ShortLinkList.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getShortLinks - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getShortLinks + * Description: fetch the next page by calling .next(...) function + **/ public func getShortLinksPaginator( pageSize: Int?, createdBy: String?, active: String?, q: String? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getShortLinks( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - , - createdBy: createdBy, - active: active, - q: q - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + createdBy: createdBy, + active: active, + q: q + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -23253,26 +18597,17 @@ if let value = q { } return paginator } - - - - + /** - * - * Summary: Get short link by hash - * Description: Get short link by hash - **/ + * + * Summary: Get short link by hash + * Description: Get short link by hash + **/ public func getShortLinkByHash( hash: String, - + onResponse: @escaping (_ response: ShortLinkRes?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -23281,7 +18616,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -23289,39 +18624,29 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ShortLinkRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update short link by id - * Description: Update short link by id - **/ + * + * Summary: Update short link by id + * Description: Update short link by id + **/ public func updateShortLinkById( id: String, body: ShortLinkReq, onResponse: @escaping (_ response: ShortLinkRes?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "patch", @@ -23330,7 +18655,7 @@ if let value = q { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -23338,25 +18663,21 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ShortLinkRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - - public class Configuration { + + public class Configuration { var config: PlatformConfig var companyId: String var applicationId: String @@ -23366,26 +18687,17 @@ if let value = q { self.companyId = config.companyId self.applicationId = applicationId } - - - - + /** - * - * Summary: Get latest build config - * Description: Get latest build config - **/ + * + * Summary: Get latest build config + * Description: Get latest build config + **/ public func getBuildConfig( platformType: String, - + onResponse: @escaping (_ response: MobileAppConfiguration?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -23394,7 +18706,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -23402,39 +18714,29 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(MobileAppConfiguration.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update build config for next build - * Description: Update build config for next build - **/ + * + * Summary: Update build config for next build + * Description: Update build config for next build + **/ public func updateBuildConfig( platformType: String, body: MobileAppConfigRequest, onResponse: @escaping (_ response: MobileAppConfiguration?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -23443,7 +18745,7 @@ if let value = q { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -23451,39 +18753,29 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(MobileAppConfiguration.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get previous build versions - * Description: Get previous build versions - **/ + * + * Summary: Get previous build versions + * Description: Get previous build versions + **/ public func getPreviousVersions( platformType: String, - + onResponse: @escaping (_ response: BuildVersionHistory?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -23492,7 +18784,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -23500,38 +18792,27 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(BuildVersionHistory.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get features of application - * Description: Get features of application - **/ + * + * Summary: Get features of application + * Description: Get features of application + **/ public func getAppFeatures( - onResponse: @escaping (_ response: AppFeatureResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -23540,7 +18821,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -23548,38 +18829,28 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AppFeatureResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update features of application - * Description: Update features of application - **/ + * + * Summary: Update features of application + * Description: Update features of application + **/ public func updateAppFeatures( body: AppFeatureRequest, onResponse: @escaping (_ response: AppFeature?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -23588,7 +18859,7 @@ if let value = q { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -23596,38 +18867,27 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AppFeature.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get basic application details - * Description: Get basic application details like name - **/ + * + * Summary: Get basic application details + * Description: Get basic application details like name + **/ public func getAppBasicDetails( - onResponse: @escaping (_ response: ApplicationDetail?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -23636,7 +18896,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -23644,38 +18904,28 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ApplicationDetail.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Add or update application's basic details - * Description: Add or update application's basic details - **/ + * + * Summary: Add or update application's basic details + * Description: Add or update application's basic details + **/ public func updateAppBasicDetails( body: ApplicationDetail, onResponse: @escaping (_ response: ApplicationDetail?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -23684,7 +18934,7 @@ if let value = q { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -23692,38 +18942,27 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ApplicationDetail.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get application information - * Description: Get Application Current Information. This includes information about social links, address and contact information of company/seller/brand of the application. - **/ + * + * Summary: Get application information + * Description: Get Application Current Information. This includes information about social links, address and contact information of company/seller/brand of the application. + **/ public func getAppContactInfo( - onResponse: @escaping (_ response: ApplicationInformation?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -23732,7 +18971,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -23740,38 +18979,28 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ApplicationInformation.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get application information - * Description: Save Application Current Information. This includes information about social links, address and contact information of an application. - **/ + * + * Summary: Get application information + * Description: Save Application Current Information. This includes information about social links, address and contact information of an application. + **/ public func updateAppContactInfo( body: ApplicationInformation, onResponse: @escaping (_ response: ApplicationInformation?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -23780,7 +19009,7 @@ if let value = q { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -23788,38 +19017,27 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ApplicationInformation.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get social tokens - * Description: Get social tokens. - **/ + * + * Summary: Get social tokens + * Description: Get social tokens. + **/ public func getAppApiTokens( - onResponse: @escaping (_ response: TokenResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -23828,7 +19046,7 @@ if let value = q { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -23836,38 +19054,28 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TokenResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Add social tokens - * Description: Add social tokens. - **/ + * + * Summary: Add social tokens + * Description: Add social tokens. + **/ public func updateAppApiTokens( body: TokenResponse, onResponse: @escaping (_ response: TokenResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -23876,7 +19084,7 @@ if let value = q { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -23884,53 +19092,44 @@ if let value = q { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(TokenResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Application inventory enabled companies - * Description: Application inventory enabled companies. - **/ + * + * Summary: Application inventory enabled companies + * Description: Application inventory enabled companies. + **/ public func getAppCompanies( + uid: Int?, pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: CompaniesResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} + var xQuery: [String: Any] = [:] + if let value = uid { + xQuery["uid"] = value + } - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -23940,7 +19139,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -23948,63 +19147,39 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CompaniesResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getAppCompanies - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getAppCompanies + * Description: fetch the next page by calling .next(...) function + **/ public func getAppCompaniesPaginator( + uid: Int?, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getAppCompanies( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + uid: uid, + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -24014,40 +19189,27 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Application inventory enabled stores - * Description: Application inventory enabled stores. - **/ + * + * Summary: Application inventory enabled stores + * Description: Application inventory enabled stores. + **/ public func getAppStores( pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: StoresResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageNo { + xQuery["page_no"] = value + } - - + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -24057,7 +19219,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -24065,63 +19227,37 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(StoresResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getAppStores - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getAppStores + * Description: fetch the next page by calling .next(...) function + **/ public func getAppStoresPaginator( pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getAppStores( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -24131,25 +19267,15 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Get application configuration - * Description: Get application configuration for various features and data - **/ + * + * Summary: Get application configuration + * Description: Get application configuration for various features and data + **/ public func getInventoryConfig( - onResponse: @escaping (_ response: ApplicationInventory?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -24158,7 +19284,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -24166,38 +19292,28 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ApplicationInventory.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update application configuration - * Description: Update application configuration for various features and data - **/ + * + * Summary: Update application configuration + * Description: Update application configuration for various features and data + **/ public func updateInventoryConfig( body: ApplicationInventory, onResponse: @escaping (_ response: ApplicationInventory?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -24206,7 +19322,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -24214,38 +19330,28 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ApplicationInventory.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Partially update application configuration - * Description: Partially update application configuration for various features and data - **/ + * + * Summary: Partially update application configuration + * Description: Partially update application configuration for various features and data + **/ public func partiallyUpdateInventoryConfig( body: AppInventoryPartialUpdate, onResponse: @escaping (_ response: ApplicationInventory?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "patch", @@ -24254,7 +19360,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -24262,38 +19368,27 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(ApplicationInventory.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get application enabled currency list - * Description: Get application enabled currency list - **/ + * + * Summary: Get application enabled currency list + * Description: Get application enabled currency list + **/ public func getAppCurrencyConfig( - onResponse: @escaping (_ response: AppSupportedCurrency?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -24302,7 +19397,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -24310,38 +19405,28 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AppSupportedCurrency.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Add initial application supported currency - * Description: Add initial application supported currency for various features and data. Default INR will be enabled. - **/ + * + * Summary: Add initial application supported currency + * Description: Add initial application supported currency for various features and data. Default INR will be enabled. + **/ public func updateAppCurrencyConfig( body: AppSupportedCurrency, onResponse: @escaping (_ response: AppSupportedCurrency?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -24350,7 +19435,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -24358,53 +19443,76 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AppSupportedCurrency.self, from: data) - + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Get currencies enabled in the application + * Description: Use this API to get a list of currencies allowed in the current application. Moreover, get the name, code, symbol, and the decimal digits of the currencies. + **/ + public func getAppSupportedCurrency( + onResponse: @escaping (_ response: AppCurrencyResponse?, _ error: FDKError?) -> Void + ) { + PlatformAPIClient.execute( + config: config, + method: "get", + url: "/service/platform/configuration/v1.0/company/\(companyId)/application/\(applicationId)/currency/supported", + query: nil, + body: nil, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(AppCurrencyResponse.self, from: data) + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get ordering store by filter - * Description: Get ordering store by filter - **/ + * + * Summary: Get ordering store by filter + * Description: Get ordering store by filter + **/ public func getOrderingStoresByFilter( pageNo: Int?, pageSize: Int?, body: FilterOrderingStoreRequest, onResponse: @escaping (_ response: OrderingStores?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -24414,7 +19522,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -24422,63 +19530,38 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OrderingStores.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getOrderingStoresByFilter - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getOrderingStoresByFilter + * Description: fetch the next page by calling .next(...) function + **/ public func getOrderingStoresByFilterPaginator( pageSize: Int?, - - body: FilterOrderingStoreRequest) -> Paginator { + + body: FilterOrderingStoreRequest + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getOrderingStoresByFilter( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - ,body: body - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + body: body + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -24488,25 +19571,16 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Add/Update ordering store config - * Description: Add/Update ordering store config. - **/ + * + * Summary: Add/Update ordering store config + * Description: Add/Update ordering store config. + **/ public func updateOrderingStoreConfig( body: OrderingStoreConfig, onResponse: @escaping (_ response: DeploymentMeta?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -24515,7 +19589,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -24523,38 +19597,112 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DeploymentMeta.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get attached domain list - * Description: Get attached domain list. - **/ - public func getDomains( - - onResponse: @escaping (_ response: DomainsResponse?, _ error: FDKError?) -> Void + * + * Summary: Get deployment stores + * Description: Use this API to retrieve the details of all stores access given to the staff member (the selling locations where the application will be utilized for placing orders). + **/ + public func getStaffOrderingStores( + pageNo: Int?, + pageSize: Int?, + q: String?, + + onResponse: @escaping (_ response: OrderingStoresResponse?, _ error: FDKError?) -> Void ) { - - + var xQuery: [String: Any] = [:] + + if let value = pageNo { + xQuery["page_no"] = value + } + + if let value = pageSize { + xQuery["page_size"] = value + } + + if let value = q { + xQuery["q"] = value + } + + PlatformAPIClient.execute( + config: config, + method: "get", + url: "/service/platform/configuration/v1.0/company/\(companyId)/application/\(applicationId)/ordering-store/staff-stores", + query: xQuery, + body: nil, + headers: [], + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(OrderingStoresResponse.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getStaffOrderingStores + * Description: fetch the next page by calling .next(...) function + **/ + public func getStaffOrderingStoresPaginator( + pageSize: Int?, + q: String? + + ) -> Paginator { + let pageSize = pageSize ?? 20 + let paginator = Paginator(pageSize: pageSize, type: "number") + paginator.onPage = { + self.getStaffOrderingStores( + pageNo: paginator.pageNo, - + pageSize: paginator.pageSize, + q: q + ) { response, error in + if let response = response { + paginator.hasNext = response.page?.hasNext ?? false + paginator.pageNo = (paginator.pageNo ?? 0) + 1 + } + paginator.onNext?(response, error) + } + } + return paginator + } + /** + * + * Summary: Get attached domain list + * Description: Get attached domain list. + **/ + public func getDomains( + onResponse: @escaping (_ response: DomainsResponse?, _ error: FDKError?) -> Void + ) { PlatformAPIClient.execute( config: config, method: "get", @@ -24563,7 +19711,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -24571,38 +19719,28 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DomainsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Add new domain to application - * Description: Add new domain to application. - **/ + * + * Summary: Add new domain to application + * Description: Add new domain to application. + **/ public func addDomain( body: DomainAddRequest, onResponse: @escaping (_ response: Domain?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -24611,7 +19749,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -24619,39 +19757,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Domain.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Remove attached domain - * Description: Remove attached domain. - **/ + * + * Summary: Remove attached domain + * Description: Remove attached domain. + **/ public func removeDomainById( id: String, - + onResponse: @escaping (_ response: SuccessMessageResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -24660,7 +19788,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -24668,38 +19796,28 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SuccessMessageResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Change domain type - * Description: Change a domain to Primary or Shortlink domain - **/ + * + * Summary: Change domain type + * Description: Change a domain to Primary or Shortlink domain + **/ public func changeDomainType( body: UpdateDomainTypeRequest, onResponse: @escaping (_ response: DomainsResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -24708,7 +19826,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -24716,38 +19834,28 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DomainsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get domain connected status. - * Description: Get domain connected status. Check if domain is live and mapped to appropriate IP to fynd servers. - **/ + * + * Summary: Get domain connected status. + * Description: Get domain connected status. Check if domain is live and mapped to appropriate IP to fynd servers. + **/ public func getDomainStatus( body: DomainStatusRequest, onResponse: @escaping (_ response: DomainStatusResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -24756,7 +19864,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -24764,40 +19872,27 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(DomainStatusResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - + /** - * - * Summary: Get application data from id - * Description: Get application data from id - **/ + * + * Summary: Get application data from id + * Description: Get application data from id + **/ public func getApplicationById( - onResponse: @escaping (_ response: Application?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -24806,7 +19901,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -24814,39 +19909,21 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Application.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - - - - - - - - - - - } - - - - public class Cart { + + public class Cart { var config: PlatformConfig var companyId: String var applicationId: String @@ -24856,15 +19933,12 @@ if let value = pageSize { self.companyId = config.companyId self.applicationId = applicationId } - - - - + /** - * - * Summary: Get with single coupon details or coupon list - * Description: Get coupon list with pagination - **/ + * + * Summary: Get with single coupon details or coupon list + * Description: Get coupon list with pagination + **/ public func getCoupons( pageNo: Int?, pageSize: Int?, @@ -24874,70 +19948,42 @@ if let value = pageSize { isDisplay: Bool?, typeSlug: String?, code: String?, - + onResponse: @escaping (_ response: CouponsResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} - - -if let value = isArchived { - - xQuery["is_archived"] = value - -} - - -if let value = title { - - xQuery["title"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = isPublic { - - xQuery["is_public"] = value - -} - - -if let value = isDisplay { - - xQuery["is_display"] = value - -} + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } -if let value = typeSlug { - - xQuery["type_slug"] = value - -} + if let value = isArchived { + xQuery["is_archived"] = value + } + if let value = title { + xQuery["title"] = value + } -if let value = code { - - xQuery["code"] = value - -} + if let value = isPublic { + xQuery["is_public"] = value + } + if let value = isDisplay { + xQuery["is_display"] = value + } - + if let value = typeSlug { + xQuery["type_slug"] = value + } + if let value = code { + xQuery["code"] = value + } PlatformAPIClient.execute( config: config, @@ -24947,7 +19993,7 @@ if let value = code { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -24955,85 +20001,24 @@ if let value = code { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CouponsResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getCoupons - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getCoupons + * Description: fetch the next page by calling .next(...) function + **/ public func getCouponsPaginator( pageSize: Int?, isArchived: Bool?, @@ -25042,24 +20027,23 @@ if let value = code { isDisplay: Bool?, typeSlug: String?, code: String? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getCoupons( - - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - , - isArchived: isArchived, - title: title, - isPublic: isPublic, - isDisplay: isDisplay, - typeSlug: typeSlug, - code: code - ) { response, error in + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize, + + isArchived: isArchived, + title: title, + isPublic: isPublic, + isDisplay: isDisplay, + typeSlug: typeSlug, + code: code + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -25069,25 +20053,16 @@ if let value = code { } return paginator } - - - - + /** - * - * Summary: Create new coupon - * Description: Create new coupon - **/ + * + * Summary: Create new coupon + * Description: Create new coupon + **/ public func createCoupon( body: CouponAdd, onResponse: @escaping (_ response: SuccessMessage?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -25096,7 +20071,7 @@ if let value = code { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -25104,39 +20079,29 @@ if let value = code { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SuccessMessage.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get with single coupon details or coupon list - * Description: Get single coupon details with `id` in path param - **/ + * + * Summary: Get with single coupon details or coupon list + * Description: Get single coupon details with `id` in path param + **/ public func getCouponById( id: String, - + onResponse: @escaping (_ response: CouponUpdate?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -25145,7 +20110,7 @@ if let value = code { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -25153,39 +20118,29 @@ if let value = code { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(CouponUpdate.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update existing coupon configuration - * Description: Update coupon with id sent in `id` - **/ + * + * Summary: Update existing coupon configuration + * Description: Update coupon with id sent in `id` + **/ public func updateCoupon( id: String, body: CouponUpdate, onResponse: @escaping (_ response: SuccessMessage?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -25194,7 +20149,7 @@ if let value = code { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -25202,39 +20157,29 @@ if let value = code { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SuccessMessage.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update coupon archive state and schedule - * Description: Update archive/unarchive and change schedule for coupon - **/ + * + * Summary: Update coupon archive state and schedule + * Description: Update archive/unarchive and change schedule for coupon + **/ public func updateCouponPartially( id: String, body: CouponPartialUpdate, onResponse: @escaping (_ response: SuccessMessage?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "patch", @@ -25243,7 +20188,7 @@ if let value = code { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -25251,38 +20196,28 @@ if let value = code { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(SuccessMessage.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Fetch Cart Details - * Description: Get all the details of cart for a list of provided `cart_items` - **/ + * + * Summary: Fetch Cart Details + * Description: Get all the details of cart for a list of provided `cart_items` + **/ public func fetchAndvalidateCartItems( body: OpenapiCartDetailsRequest, onResponse: @escaping (_ response: OpenapiCartDetailsResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -25291,7 +20226,7 @@ if let value = code { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -25299,38 +20234,28 @@ if let value = code { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OpenapiCartDetailsResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Check Pincode Serviceability - * Description: Check Pincode serviceability for cart items provided in `cart_items` and address pincode in `shipping_address` - **/ + * + * Summary: Check Pincode Serviceability + * Description: Check Pincode serviceability for cart items provided in `cart_items` and address pincode in `shipping_address` + **/ public func checkCartServiceability( body: OpenApiCartServiceabilityRequest, onResponse: @escaping (_ response: OpenApiCartServiceabilityResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -25339,7 +20264,7 @@ if let value = code { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -25347,38 +20272,28 @@ if let value = code { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OpenApiCartServiceabilityResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Create Fynd order with cart details - * Description: Generate Fynd order for cart details send with provided `cart_items` - **/ + * + * Summary: Create Fynd order with cart details + * Description: Generate Fynd order for cart details send with provided `cart_items` + **/ public func checkoutCart( body: OpenApiPlatformCheckoutReq, onResponse: @escaping (_ response: OpenApiCheckoutResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -25387,7 +20302,7 @@ if let value = code { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -25395,25 +20310,21 @@ if let value = code { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(OpenApiCheckoutResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - - - public class Rewards { + + public class Rewards { var config: PlatformConfig var companyId: String var applicationId: String @@ -25423,40 +20334,27 @@ if let value = code { self.companyId = config.companyId self.applicationId = applicationId } - - - - + /** - * - * Summary: List of giveaways of the current application. - * Description: List of giveaways of the current application. - **/ + * + * Summary: List of giveaways of the current application. + * Description: List of giveaways of the current application. + **/ public func getGiveaways( pageId: String?, pageSize: Int?, - + onResponse: @escaping (_ response: GiveawayResponse?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageId { - - xQuery["page_id"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - + if let value = pageId { + xQuery["page_id"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -25466,7 +20364,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -25474,92 +20372,56 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(GiveawayResponse.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getGiveaways - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getGiveaways + * Description: fetch the next page by calling .next(...) function + **/ public func getGiveawaysPaginator( pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "cursor") paginator.onPage = { self.getGiveaways( - - pageId: paginator.pageId - , - pageSize: paginator.pageSize - - ) { response, error in + pageId: paginator.pageId, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageId = response.page?.nextId - } paginator.onNext?(response, error) } } return paginator } - - - - + /** - * - * Summary: Adds a new giveaway. - * Description: Adds a new giveaway. - **/ + * + * Summary: Adds a new giveaway. + * Description: Adds a new giveaway. + **/ public func createGiveaway( body: Giveaway, onResponse: @escaping (_ response: Giveaway?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -25568,7 +20430,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -25576,39 +20438,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Giveaway.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get giveaway by ID. - * Description: Get giveaway by ID. - **/ + * + * Summary: Get giveaway by ID. + * Description: Get giveaway by ID. + **/ public func getGiveawayByID( id: String, - + onResponse: @escaping (_ response: Giveaway?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -25617,7 +20469,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -25625,39 +20477,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Giveaway.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Updates the giveaway by it's ID. - * Description: Updates the giveaway by it's ID. - **/ + * + * Summary: Updates the giveaway by it's ID. + * Description: Updates the giveaway by it's ID. + **/ public func updateGiveaway( id: String, body: Giveaway, onResponse: @escaping (_ response: Giveaway?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -25666,7 +20508,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -25674,38 +20516,27 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Giveaway.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: List of offer of the current application. - * Description: List of offer of the current application. - **/ + * + * Summary: List of offer of the current application. + * Description: List of offer of the current application. + **/ public func getOffers( - onResponse: @escaping (_ response: [Offer]?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -25714,7 +20545,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -25722,44 +20553,33 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode([Offer].self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get offer by name. - * Description: Get offer by name. - **/ + * + * Summary: Get offer by name. + * Description: Get offer by name. + **/ public func getOfferByName( cookie: String, name: String, - + onResponse: @escaping (_ response: Offer?, _ error: FDKError?) -> Void ) { - - - -var xHeaders: [(key: String, value: String)] = [] - - -xHeaders.append((key: "cookie", value: cookie)) - - + var xHeaders: [(key: String, value: String)] = [] + xHeaders.append((key: "cookie", value: cookie)) PlatformAPIClient.execute( config: config, @@ -25769,7 +20589,7 @@ xHeaders.append((key: "cookie", value: cookie)) body: nil, headers: xHeaders, responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -25777,39 +20597,29 @@ xHeaders.append((key: "cookie", value: cookie)) } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Offer.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Updates the offer by name. - * Description: Updates the offer by name. - **/ + * + * Summary: Updates the offer by name. + * Description: Updates the offer by name. + **/ public func updateOfferByName( name: String, body: Offer, onResponse: @escaping (_ response: Offer?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "put", @@ -25818,7 +20628,7 @@ xHeaders.append((key: "cookie", value: cookie)) body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -25826,39 +20636,29 @@ xHeaders.append((key: "cookie", value: cookie)) } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(Offer.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: User's reward details. - * Description: User's reward details. - **/ + * + * Summary: User's reward details. + * Description: User's reward details. + **/ public func getUserAvailablePoints( userId: String, - + onResponse: @escaping (_ response: UserRes?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -25867,7 +20667,7 @@ xHeaders.append((key: "cookie", value: cookie)) body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -25875,39 +20675,29 @@ xHeaders.append((key: "cookie", value: cookie)) } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(UserRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Update User status - * Description: Update user status, active/archive - **/ + * + * Summary: Update User status + * Description: Update user status, active/archive + **/ public func updateUserStatus( userId: String, body: AppUser, onResponse: @escaping (_ response: AppUser?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "patch", @@ -25916,7 +20706,7 @@ xHeaders.append((key: "cookie", value: cookie)) body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -25924,63 +20714,46 @@ xHeaders.append((key: "cookie", value: cookie)) } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AppUser.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get list of points transactions. - * Description: Get list of points transactions. -The list of points history is paginated. - **/ + * + * Summary: Get list of points transactions. + * Description: Get list of points transactions. + The list of points history is paginated. + **/ public func getUserPointsHistory( userId: String, pageId: String?, pageLimit: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: HistoryRes?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageId { - - xQuery["page_id"] = value - -} - - -if let value = pageLimit { - - xQuery["page_limit"] = value - -} - - -if let value = pageSize { - - xQuery["page_size"] = value - -} + var xQuery: [String: Any] = [:] + if let value = pageId { + xQuery["page_id"] = value + } - + if let value = pageLimit { + xQuery["page_limit"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -25990,7 +20763,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -25998,95 +20771,53 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(HistoryRes.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getUserPointsHistory - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getUserPointsHistory + * Description: fetch the next page by calling .next(...) function + **/ public func getUserPointsHistoryPaginator( userId: String, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "cursor") paginator.onPage = { self.getUserPointsHistory( - - userId: userId, - pageId: paginator.pageId - , - pageLimit: nil - , - pageSize: paginator.pageSize - - ) { response, error in + userId: userId, + pageId: paginator.pageId, + + pageLimit: nil, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageId = response.page?.nextId - } paginator.onNext?(response, error) } } return paginator } - } - - - - public class Analytics { + + public class Analytics { var config: PlatformConfig var companyId: String var applicationId: String @@ -26096,25 +20827,15 @@ if let value = pageSize { self.companyId = config.companyId self.applicationId = applicationId } - - - - + /** - * - * Summary: Get statistics groups - * Description: Get statistics groups - **/ + * + * Summary: Get statistics groups + * Description: Get statistics groups + **/ public func getStatiscticsGroups( - onResponse: @escaping (_ response: StatsGroups?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -26123,7 +20844,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -26131,39 +20852,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(StatsGroups.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get statistics group components - * Description: Get statistics group components - **/ + * + * Summary: Get statistics group components + * Description: Get statistics group components + **/ public func getStatiscticsGroupComponents( groupName: String, - + onResponse: @escaping (_ response: StatsGroupComponents?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -26172,7 +20883,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -26180,39 +20891,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(StatsGroupComponents.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get component statistics csv - * Description: Get component statistics csv - **/ + * + * Summary: Get component statistics csv + * Description: Get component statistics csv + **/ public func getComponentStatsCSV( componentName: String, - + onResponse: @escaping (_ response: Data?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -26221,7 +20922,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/csv", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -26229,39 +20930,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = data - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get component statistics pdf - * Description: Get component statistics pdf - **/ + * + * Summary: Get component statistics pdf + * Description: Get component statistics pdf + **/ public func getComponentStatsPDF( componentName: String, - + onResponse: @escaping (_ response: Data?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -26270,7 +20961,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/pdf", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -26278,39 +20969,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = data - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get component statistics - * Description: Get component statistics - **/ + * + * Summary: Get component statistics + * Description: Get component statistics + **/ public func getComponentStats( componentName: String, - + onResponse: @escaping (_ response: StatsRes?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -26319,7 +21000,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -26327,55 +21008,41 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(StatsRes.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get abandon carts list - * Description: Get abandon carts list - **/ + * + * Summary: Get abandon carts list + * Description: Get abandon carts list + **/ public func getAbandonCartList( fromDate: String, toDate: String, pageNo: Int?, pageSize: Int?, - + onResponse: @escaping (_ response: AbandonCartsList?, _ error: FDKError?) -> Void ) { - -var xQuery: [String: Any] = [:] - -if let value = pageNo { - - xQuery["page_no"] = value - -} - + var xQuery: [String: Any] = [:] -if let value = pageSize { - - xQuery["page_size"] = value - -} - - - + if let value = pageNo { + xQuery["page_no"] = value + } + if let value = pageSize { + xQuery["page_size"] = value + } PlatformAPIClient.execute( config: config, @@ -26385,7 +21052,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -26393,79 +21060,41 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AbandonCartsList.self, from: data) - - onResponse(response, nil) - } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] - let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) - onResponse(nil, err) - } - }); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** - * - * Summary: get paginator for getAbandonCartList - * Description: fetch the next page by calling .next(...) function - **/ + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: get paginator for getAbandonCartList + * Description: fetch the next page by calling .next(...) function + **/ public func getAbandonCartListPaginator( fromDate: String, toDate: String, pageSize: Int? - - ) -> Paginator { + + ) -> Paginator { let pageSize = pageSize ?? 20 let paginator = Paginator(pageSize: pageSize, type: "number") paginator.onPage = { self.getAbandonCartList( - - fromDate: fromDate, - toDate: toDate, - pageNo: paginator.pageNo - , - pageSize: paginator.pageSize - - ) { response, error in + fromDate: fromDate, + toDate: toDate, + pageNo: paginator.pageNo, + + pageSize: paginator.pageSize + + ) { response, error in if let response = response { paginator.hasNext = response.page?.hasNext ?? false paginator.pageNo = (paginator.pageNo ?? 0) + 1 @@ -26475,27 +21104,18 @@ if let value = pageSize { } return paginator } - - - - + /** - * - * Summary: Get abandon carts csv - * Description: Get abandon carts csv - **/ + * + * Summary: Get abandon carts csv + * Description: Get abandon carts csv + **/ public func getAbandonCartsCSV( fromDate: String, toDate: String, - + onResponse: @escaping (_ response: Data?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -26504,7 +21124,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/csv", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -26512,39 +21132,29 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = data - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Get abandon carts details - * Description: Get abandon cart details - **/ + * + * Summary: Get abandon carts details + * Description: Get abandon cart details + **/ public func getAbandonCartDetail( cartId: String, - + onResponse: @escaping (_ response: AbandonCartDetail?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "get", @@ -26553,7 +21163,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -26561,29 +21171,21 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AbandonCartDetail.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - - } - - - - public class Partner { + + public class Partner { var config: PlatformConfig var companyId: String var applicationId: String @@ -26593,26 +21195,17 @@ if let value = pageSize { self.companyId = config.companyId self.applicationId = applicationId } - - - - + /** - * - * Summary: Add proxy path for external url - * Description: Add proxy path for external url - **/ + * + * Summary: Add proxy path for external url + * Description: Add proxy path for external url + **/ public func addProxyPath( extensionId: String, body: AddProxyReq, onResponse: @escaping (_ response: AddProxyResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "post", @@ -26621,7 +21214,7 @@ if let value = pageSize { body: body.dictionary, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -26629,40 +21222,30 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(AddProxyResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - - - - + /** - * - * Summary: Remove proxy path for external url - * Description: Remove proxy path for external url - **/ + * + * Summary: Remove proxy path for external url + * Description: Remove proxy path for external url + **/ public func removeProxyPath( extensionId: String, attachedPath: String, - + onResponse: @escaping (_ response: RemoveProxyResponse?, _ error: FDKError?) -> Void ) { - - - - - - PlatformAPIClient.execute( config: config, method: "delete", @@ -26671,7 +21254,7 @@ if let value = pageSize { body: nil, headers: [], responseType: "application/json", - onResponse: { (responseData, error, responseCode) in + onResponse: { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { @@ -26679,22 +21262,18 @@ if let value = pageSize { } onResponse(nil, err) } else if let data = responseData { - let response = Utility.decode(RemoveProxyResponse.self, from: data) - + onResponse(response, nil) } else { - let userInfo: [String: Any] = [ NSLocalizedDescriptionKey : NSLocalizedString("Unidentified", value: "Please try after sometime", comment: "") , - NSLocalizedFailureReasonErrorKey : NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) onResponse(nil, err) } - }); + } + ) } - - } - - } -} \ No newline at end of file +} diff --git a/Sources/code/platform/PlatformConfig.swift b/Sources/code/platform/PlatformConfig.swift index 8f7219a4b5..cc55bce3e3 100644 --- a/Sources/code/platform/PlatformConfig.swift +++ b/Sources/code/platform/PlatformConfig.swift @@ -4,17 +4,30 @@ public class PlatformConfig { var apiKey: String? var apiSecret: String? var domain: String + var userAgent: String? + var language: String? + var currency: String? + var extraHeaders: [(key: String, value: String)] = [] + public lazy var oauthClient = PlatformOAuthClient(config: self) - public init?(companyId: String, domain: String = "https://api.fynd.com") { + public init?(companyId: String, domain: String = "https://api.fynd.com", userAgent: String? = nil, language: String? = "en-IN", currency: String? = "INR", extraHeaders: [(key: String, value: String)] = []) { self.companyId = companyId self.domain = domain + self.userAgent = userAgent + self.language = language + self.currency = currency + self.extraHeaders = extraHeaders } - - public init?(companyId: String, apiKey: String, apiSecret: String, domain: String = "https://api.fynd.com") { + + public init?(companyId: String, apiKey: String, apiSecret: String, domain: String = "https://api.fynd.com", userAgent: String? = nil, language: String? = "en-IN", currency: String? = "INR", extraHeaders: [(key: String, value: String)] = []) { self.companyId = companyId self.domain = domain self.apiKey = apiKey self.apiSecret = apiSecret + self.userAgent = userAgent + self.language = language + self.currency = currency + self.extraHeaders = extraHeaders } -} \ No newline at end of file +} diff --git a/Sources/code/platform/PlatformEnums.swift b/Sources/code/platform/PlatformEnums.swift index 6d89793a89..8f21197ed3 100644 --- a/Sources/code/platform/PlatformEnums.swift +++ b/Sources/code/platform/PlatformEnums.swift @@ -1,117 +1,75 @@ import Foundation public extension PlatformClient { - - - - /* - Enum: PriorityEnum - Used By: Lead - */ + Enum: PriorityEnum + Used By: Lead + */ enum PriorityEnum: String, Codable { - - case low = "low" - - case medium = "medium" - - case high = "high" - - case urgent = "urgent" - + case low + + case medium + + case high + + case urgent } - - /* - Enum: HistoryTypeEnum - Used By: Lead - */ + Enum: HistoryTypeEnum + Used By: Lead + */ enum HistoryTypeEnum: String, Codable { - - case rating = "rating" - - case log = "log" - - case comment = "comment" - + case rating + + case log + + case comment } - - /* - Enum: TicketAssetType - Used By: Lead - */ - enum TicketAssetType: String, Codable { - - case image = "image" - - case video = "video" - - case file = "file" - - case youtube = "youtube" - - case product = "product" - - case collection = "collection" - - case brand = "brand" - - case shipment = "shipment" - - case order = "order" - + Enum: TicketAssetTypeEnum + Used By: Lead + */ + enum TicketAssetTypeEnum: String, Codable { + case image + + case video + + case file + + case youtube + + case product + + case collection + + case brand + + case shipment + + case order } - - /* - Enum: TicketSourceEnum - Used By: Lead - */ + Enum: TicketSourceEnum + Used By: Lead + */ enum TicketSourceEnum: String, Codable { - case platformPanel = "platform_panel" - + case salesChannel = "sales_channel" - } - - - - - - - - - - - - - - - - - - - - - - /* - Enum: SubscriberStatus - Used By: Webhook - */ + Enum: SubscriberStatus + Used By: Webhook + */ enum SubscriberStatus: String, Codable { - - case active = "active" - - case inactive = "inactive" - - } + case active - -} \ No newline at end of file + case inactive + + case blocked + } +} diff --git a/Sources/code/platform/PlatformModels.swift b/Sources/code/platform/PlatformModels.swift deleted file mode 100644 index cfcac1cee7..0000000000 --- a/Sources/code/platform/PlatformModels.swift +++ /dev/null @@ -1,161626 +0,0 @@ -import Foundation - -public extension PlatformClient { - - - /* - Model: LocationDefaultLanguage - Used By: Common - */ - - class LocationDefaultLanguage: Codable { - - - public var name: String? - - public var code: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case code = "code" - - } - - public init(code: String?, name: String?) { - - self.name = name - - self.code = code - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - } - - } - - /* - Model: LocationDefaultCurrency - Used By: Common - */ - - class LocationDefaultCurrency: Codable { - - - public var name: String? - - public var symbol: String? - - public var code: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case symbol = "symbol" - - case code = "code" - - } - - public init(code: String?, name: String?, symbol: String?) { - - self.name = name - - self.symbol = symbol - - self.code = code - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - symbol = try container.decode(String.self, forKey: .symbol) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(symbol, forKey: .symbol) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - } - - } - - /* - Model: LocationCountry - Used By: Common - */ - - class LocationCountry: Codable { - - - public var capital: String? - - public var currency: String? - - public var iso2: String? - - public var iso3: String? - - public var name: String? - - public var parent: String? - - public var phoneCode: String? - - public var type: String? - - public var uid: Int? - - public var v: Int? - - public var id: String? - - public var defaultCurrency: LocationDefaultCurrency? - - public var defaultLanguage: LocationDefaultLanguage? - - - public enum CodingKeys: String, CodingKey { - - case capital = "capital" - - case currency = "currency" - - case iso2 = "iso2" - - case iso3 = "iso3" - - case name = "name" - - case parent = "parent" - - case phoneCode = "phone_code" - - case type = "type" - - case uid = "uid" - - case v = "__v" - - case id = "_id" - - case defaultCurrency = "default_currency" - - case defaultLanguage = "default_language" - - } - - public init(capital: String?, currency: String?, defaultCurrency: LocationDefaultCurrency?, defaultLanguage: LocationDefaultLanguage?, iso2: String?, iso3: String?, name: String?, parent: String?, phoneCode: String?, type: String?, uid: Int?, id: String?, v: Int?) { - - self.capital = capital - - self.currency = currency - - self.iso2 = iso2 - - self.iso3 = iso3 - - self.name = name - - self.parent = parent - - self.phoneCode = phoneCode - - self.type = type - - self.uid = uid - - self.v = v - - self.id = id - - self.defaultCurrency = defaultCurrency - - self.defaultLanguage = defaultLanguage - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - capital = try container.decode(String.self, forKey: .capital) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(String.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - iso2 = try container.decode(String.self, forKey: .iso2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - iso3 = try container.decode(String.self, forKey: .iso3) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - parent = try container.decode(String.self, forKey: .parent) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phoneCode = try container.decode(String.self, forKey: .phoneCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - defaultCurrency = try container.decode(LocationDefaultCurrency.self, forKey: .defaultCurrency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - defaultLanguage = try container.decode(LocationDefaultLanguage.self, forKey: .defaultLanguage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(capital, forKey: .capital) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(iso2, forKey: .iso2) - - - - try? container.encodeIfPresent(iso3, forKey: .iso3) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(parent, forKey: .parent) - - - - try? container.encodeIfPresent(phoneCode, forKey: .phoneCode) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(defaultCurrency, forKey: .defaultCurrency) - - - - try? container.encodeIfPresent(defaultLanguage, forKey: .defaultLanguage) - - - } - - } - - /* - Model: Locations - Used By: Common - */ - - class Locations: Codable { - - - public var items: [[String: Any]]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - } - - public init(items: [[String: Any]]?) { - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([[String: Any]].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - - - /* - Model: TicketList - Used By: Lead - */ - - class TicketList: Codable { - - - public var items: [Ticket]? - - public var filters: Filter? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case filters = "filters" - - case page = "page" - - } - - public init(filters: Filter?, items: [Ticket]?, page: Page?) { - - self.items = items - - self.filters = filters - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Ticket].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - filters = try container.decode(Filter.self, forKey: .filters) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(filters, forKey: .filters) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: Page - Used By: Lead - */ - - class Page: Codable { - - - public var itemTotal: Int? - - public var nextId: String? - - public var hasPrevious: Bool? - - public var hasNext: Bool? - - public var current: Int? - - public var type: String - - public var size: Int? - - - public enum CodingKeys: String, CodingKey { - - case itemTotal = "item_total" - - case nextId = "next_id" - - case hasPrevious = "has_previous" - - case hasNext = "has_next" - - case current = "current" - - case type = "type" - - case size = "size" - - } - - public init(current: Int?, hasNext: Bool?, hasPrevious: Bool?, itemTotal: Int?, nextId: String?, size: Int?, type: String) { - - self.itemTotal = itemTotal - - self.nextId = nextId - - self.hasPrevious = hasPrevious - - self.hasNext = hasNext - - self.current = current - - self.type = type - - self.size = size - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - itemTotal = try container.decode(Int.self, forKey: .itemTotal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - nextId = try container.decode(String.self, forKey: .nextId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasPrevious = try container.decode(Bool.self, forKey: .hasPrevious) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasNext = try container.decode(Bool.self, forKey: .hasNext) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - current = try container.decode(Int.self, forKey: .current) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - type = try container.decode(String.self, forKey: .type) - - - - - do { - size = try container.decode(Int.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) - - - - try? container.encodeIfPresent(nextId, forKey: .nextId) - - - - try? container.encodeIfPresent(hasPrevious, forKey: .hasPrevious) - - - - try? container.encodeIfPresent(hasNext, forKey: .hasNext) - - - - try? container.encodeIfPresent(current, forKey: .current) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - } - - } - - /* - Model: TicketHistoryList - Used By: Lead - */ - - class TicketHistoryList: Codable { - - - public var items: [TicketHistory]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [TicketHistory]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([TicketHistory].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: CustomFormList - Used By: Lead - */ - - class CustomFormList: Codable { - - - public var items: [CustomForm]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [CustomForm]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([CustomForm].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: CreateCustomFormPayload - Used By: Lead - */ - - class CreateCustomFormPayload: Codable { - - - public var slug: String - - public var title: String - - public var inputs: [[String: Any]] - - public var description: String? - - public var headerImage: String? - - public var priority: [String: Any] - - public var shouldNotify: Bool? - - public var successMessage: String? - - public var pollForAssignment: PollForAssignment? - - - public enum CodingKeys: String, CodingKey { - - case slug = "slug" - - case title = "title" - - case inputs = "inputs" - - case description = "description" - - case headerImage = "header_image" - - case priority = "priority" - - case shouldNotify = "should_notify" - - case successMessage = "success_message" - - case pollForAssignment = "poll_for_assignment" - - } - - public init(description: String?, headerImage: String?, inputs: [[String: Any]], pollForAssignment: PollForAssignment?, priority: [String: Any], shouldNotify: Bool?, slug: String, successMessage: String?, title: String) { - - self.slug = slug - - self.title = title - - self.inputs = inputs - - self.description = description - - self.headerImage = headerImage - - self.priority = priority - - self.shouldNotify = shouldNotify - - self.successMessage = successMessage - - self.pollForAssignment = pollForAssignment - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - slug = try container.decode(String.self, forKey: .slug) - - - - - title = try container.decode(String.self, forKey: .title) - - - - - inputs = try container.decode([[String: Any]].self, forKey: .inputs) - - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - headerImage = try container.decode(String.self, forKey: .headerImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - priority = try container.decode([String: Any].self, forKey: .priority) - - - - - do { - shouldNotify = try container.decode(Bool.self, forKey: .shouldNotify) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - successMessage = try container.decode(String.self, forKey: .successMessage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pollForAssignment = try container.decode(PollForAssignment.self, forKey: .pollForAssignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(inputs, forKey: .inputs) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(headerImage, forKey: .headerImage) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(shouldNotify, forKey: .shouldNotify) - - - - try? container.encodeIfPresent(successMessage, forKey: .successMessage) - - - - try? container.encodeIfPresent(pollForAssignment, forKey: .pollForAssignment) - - - } - - } - - /* - Model: EditCustomFormPayload - Used By: Lead - */ - - class EditCustomFormPayload: Codable { - - - public var title: String - - public var inputs: [[String: Any]] - - public var description: String? - - public var priority: [String: Any] - - public var headerImage: String? - - public var shouldNotify: Bool? - - public var loginRequired: Bool? - - public var successMessage: String? - - public var pollForAssignment: PollForAssignment? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case inputs = "inputs" - - case description = "description" - - case priority = "priority" - - case headerImage = "header_image" - - case shouldNotify = "should_notify" - - case loginRequired = "login_required" - - case successMessage = "success_message" - - case pollForAssignment = "poll_for_assignment" - - } - - public init(description: String?, headerImage: String?, inputs: [[String: Any]], loginRequired: Bool?, pollForAssignment: PollForAssignment?, priority: [String: Any], shouldNotify: Bool?, successMessage: String?, title: String) { - - self.title = title - - self.inputs = inputs - - self.description = description - - self.priority = priority - - self.headerImage = headerImage - - self.shouldNotify = shouldNotify - - self.loginRequired = loginRequired - - self.successMessage = successMessage - - self.pollForAssignment = pollForAssignment - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - title = try container.decode(String.self, forKey: .title) - - - - - inputs = try container.decode([[String: Any]].self, forKey: .inputs) - - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - priority = try container.decode([String: Any].self, forKey: .priority) - - - - - do { - headerImage = try container.decode(String.self, forKey: .headerImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shouldNotify = try container.decode(Bool.self, forKey: .shouldNotify) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - loginRequired = try container.decode(Bool.self, forKey: .loginRequired) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - successMessage = try container.decode(String.self, forKey: .successMessage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pollForAssignment = try container.decode(PollForAssignment.self, forKey: .pollForAssignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(inputs, forKey: .inputs) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(headerImage, forKey: .headerImage) - - - - try? container.encodeIfPresent(shouldNotify, forKey: .shouldNotify) - - - - try? container.encodeIfPresent(loginRequired, forKey: .loginRequired) - - - - try? container.encodeIfPresent(successMessage, forKey: .successMessage) - - - - try? container.encodeIfPresent(pollForAssignment, forKey: .pollForAssignment) - - - } - - } - - /* - Model: EditTicketPayload - Used By: Lead - */ - - class EditTicketPayload: Codable { - - - public var content: TicketContent? - - public var category: String? - - public var subCategory: String? - - public var source: String? - - public var status: String? - - public var priority: [String: Any]? - - public var assignedTo: AgentChangePayload? - - public var tags: [String]? - - - public enum CodingKeys: String, CodingKey { - - case content = "content" - - case category = "category" - - case subCategory = "sub_category" - - case source = "source" - - case status = "status" - - case priority = "priority" - - case assignedTo = "assigned_to" - - case tags = "tags" - - } - - public init(assignedTo: AgentChangePayload?, category: String?, content: TicketContent?, priority: [String: Any]?, source: String?, status: String?, subCategory: String?, tags: [String]?) { - - self.content = content - - self.category = category - - self.subCategory = subCategory - - self.source = source - - self.status = status - - self.priority = priority - - self.assignedTo = assignedTo - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - content = try container.decode(TicketContent.self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - category = try container.decode(String.self, forKey: .category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subCategory = try container.decode(String.self, forKey: .subCategory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - source = try container.decode(String.self, forKey: .source) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priority = try container.decode([String: Any].self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - assignedTo = try container.decode(AgentChangePayload.self, forKey: .assignedTo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(content, forKey: .content) - - - - try? container.encodeIfPresent(category, forKey: .category) - - - - try? container.encodeIfPresent(subCategory, forKey: .subCategory) - - - - try? container.encodeIfPresent(source, forKey: .source) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(assignedTo, forKey: .assignedTo) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: AgentChangePayload - Used By: Lead - */ - - class AgentChangePayload: Codable { - - - public var agentId: String - - - public enum CodingKeys: String, CodingKey { - - case agentId = "agent_id" - - } - - public init(agentId: String) { - - self.agentId = agentId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - agentId = try container.decode(String.self, forKey: .agentId) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(agentId, forKey: .agentId) - - - } - - } - - /* - Model: CreateVideoRoomResponse - Used By: Lead - */ - - class CreateVideoRoomResponse: Codable { - - - public var uniqueName: String - - - public enum CodingKeys: String, CodingKey { - - case uniqueName = "unique_name" - - } - - public init(uniqueName: String) { - - self.uniqueName = uniqueName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - uniqueName = try container.decode(String.self, forKey: .uniqueName) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uniqueName, forKey: .uniqueName) - - - } - - } - - /* - Model: CloseVideoRoomResponse - Used By: Lead - */ - - class CloseVideoRoomResponse: Codable { - - - public var success: Bool - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - } - - public init(success: Bool) { - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: CreateVideoRoomPayload - Used By: Lead - */ - - class CreateVideoRoomPayload: Codable { - - - public var uniqueName: String - - public var notify: [NotifyUser]? - - - public enum CodingKeys: String, CodingKey { - - case uniqueName = "unique_name" - - case notify = "notify" - - } - - public init(notify: [NotifyUser]?, uniqueName: String) { - - self.uniqueName = uniqueName - - self.notify = notify - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - uniqueName = try container.decode(String.self, forKey: .uniqueName) - - - - - do { - notify = try container.decode([NotifyUser].self, forKey: .notify) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uniqueName, forKey: .uniqueName) - - - - try? container.encodeIfPresent(notify, forKey: .notify) - - - } - - } - - /* - Model: NotifyUser - Used By: Lead - */ - - class NotifyUser: Codable { - - - public var countryCode: String - - public var phoneNumber: String - - - public enum CodingKeys: String, CodingKey { - - case countryCode = "country_code" - - case phoneNumber = "phone_number" - - } - - public init(countryCode: String, phoneNumber: String) { - - self.countryCode = countryCode - - self.phoneNumber = phoneNumber - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - countryCode = try container.decode(String.self, forKey: .countryCode) - - - - - phoneNumber = try container.decode(String.self, forKey: .phoneNumber) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(phoneNumber, forKey: .phoneNumber) - - - } - - } - - /* - Model: Filter - Used By: Lead - */ - - class Filter: Codable { - - - public var priorities: [Priority] - - public var categories: [TicketCategory]? - - public var statuses: [Status] - - public var assignees: [[String: Any]] - - - public enum CodingKeys: String, CodingKey { - - case priorities = "priorities" - - case categories = "categories" - - case statuses = "statuses" - - case assignees = "assignees" - - } - - public init(assignees: [[String: Any]], categories: [TicketCategory]?, priorities: [Priority], statuses: [Status]) { - - self.priorities = priorities - - self.categories = categories - - self.statuses = statuses - - self.assignees = assignees - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - priorities = try container.decode([Priority].self, forKey: .priorities) - - - - - do { - categories = try container.decode([TicketCategory].self, forKey: .categories) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - statuses = try container.decode([Status].self, forKey: .statuses) - - - - - assignees = try container.decode([[String: Any]].self, forKey: .assignees) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(priorities, forKey: .priorities) - - - - try? container.encodeIfPresent(categories, forKey: .categories) - - - - try? container.encodeIfPresent(statuses, forKey: .statuses) - - - - try? container.encodeIfPresent(assignees, forKey: .assignees) - - - } - - } - - /* - Model: TicketHistoryPayload - Used By: Lead - */ - - class TicketHistoryPayload: Codable { - - - public var value: [String: Any] - - public var type: [String: Any] - - - public enum CodingKeys: String, CodingKey { - - case value = "value" - - case type = "type" - - } - - public init(type: [String: Any], value: [String: Any]) { - - self.value = value - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - value = try container.decode([String: Any].self, forKey: .value) - - - - - type = try container.decode([String: Any].self, forKey: .type) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: CustomFormSubmissionPayload - Used By: Lead - */ - - class CustomFormSubmissionPayload: Codable { - - - public var response: [KeyValue] - - public var attachments: [TicketAsset]? - - - public enum CodingKeys: String, CodingKey { - - case response = "response" - - case attachments = "attachments" - - } - - public init(attachments: [TicketAsset]?, response: [KeyValue]) { - - self.response = response - - self.attachments = attachments - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - response = try container.decode([KeyValue].self, forKey: .response) - - - - - do { - attachments = try container.decode([TicketAsset].self, forKey: .attachments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(response, forKey: .response) - - - - try? container.encodeIfPresent(attachments, forKey: .attachments) - - - } - - } - - /* - Model: KeyValue - Used By: Lead - */ - - class KeyValue: Codable { - - - public var key: String - - public var value: [String: Any] - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case value = "value" - - } - - public init(key: String, value: [String: Any]) { - - self.key = key - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - key = try container.decode(String.self, forKey: .key) - - - - - value = try container.decode([String: Any].self, forKey: .value) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: GetTokenForVideoRoomResponse - Used By: Lead - */ - - class GetTokenForVideoRoomResponse: Codable { - - - public var accessToken: String - - - public enum CodingKeys: String, CodingKey { - - case accessToken = "access_token" - - } - - public init(accessToken: String) { - - self.accessToken = accessToken - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - accessToken = try container.decode(String.self, forKey: .accessToken) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(accessToken, forKey: .accessToken) - - - } - - } - - /* - Model: GetParticipantsInsideVideoRoomResponse - Used By: Lead - */ - - class GetParticipantsInsideVideoRoomResponse: Codable { - - - public var participants: [Participant] - - - public enum CodingKeys: String, CodingKey { - - case participants = "participants" - - } - - public init(participants: [Participant]) { - - self.participants = participants - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - participants = try container.decode([Participant].self, forKey: .participants) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(participants, forKey: .participants) - - - } - - } - - /* - Model: Participant - Used By: Lead - */ - - class Participant: Codable { - - - public var user: UserSchema? - - public var identity: String? - - public var status: String? - - - public enum CodingKeys: String, CodingKey { - - case user = "user" - - case identity = "identity" - - case status = "status" - - } - - public init(identity: String?, status: String?, user: UserSchema?) { - - self.user = user - - self.identity = identity - - self.status = status - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - user = try container.decode(UserSchema.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - identity = try container.decode(String.self, forKey: .identity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(identity, forKey: .identity) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - } - - } - - /* - Model: PhoneNumber - Used By: Lead - */ - - class PhoneNumber: Codable { - - - public var active: Bool? - - public var primary: Bool? - - public var verified: Bool? - - public var phone: String? - - public var countryCode: Int? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case primary = "primary" - - case verified = "verified" - - case phone = "phone" - - case countryCode = "country_code" - - } - - public init(active: Bool?, countryCode: Int?, phone: String?, primary: Bool?, verified: Bool?) { - - self.active = active - - self.primary = primary - - self.verified = verified - - self.phone = phone - - self.countryCode = countryCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - primary = try container.decode(Bool.self, forKey: .primary) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verified = try container.decode(Bool.self, forKey: .verified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(Int.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(primary, forKey: .primary) - - - - try? container.encodeIfPresent(verified, forKey: .verified) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - } - - } - - /* - Model: Email - Used By: Lead - */ - - class Email: Codable { - - - public var primary: Bool? - - public var verified: Bool? - - public var email: String? - - public var active: Bool? - - - public enum CodingKeys: String, CodingKey { - - case primary = "primary" - - case verified = "verified" - - case email = "email" - - case active = "active" - - } - - public init(active: Bool?, email: String?, primary: Bool?, verified: Bool?) { - - self.primary = primary - - self.verified = verified - - self.email = email - - self.active = active - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - primary = try container.decode(Bool.self, forKey: .primary) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verified = try container.decode(Bool.self, forKey: .verified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(primary, forKey: .primary) - - - - try? container.encodeIfPresent(verified, forKey: .verified) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - } - - } - - /* - Model: Debug - Used By: Lead - */ - - class Debug: Codable { - - - public var source: String? - - public var platform: String? - - - public enum CodingKeys: String, CodingKey { - - case source = "source" - - case platform = "platform" - - } - - public init(platform: String?, source: String?) { - - self.source = source - - self.platform = platform - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - source = try container.decode(String.self, forKey: .source) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode(String.self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(source, forKey: .source) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - } - - } - - /* - Model: SubmitCustomFormResponse - Used By: Lead - */ - - class SubmitCustomFormResponse: Codable { - - - public var ticket: Ticket - - - public enum CodingKeys: String, CodingKey { - - case ticket = "ticket" - - } - - public init(ticket: Ticket) { - - self.ticket = ticket - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - ticket = try container.decode(Ticket.self, forKey: .ticket) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(ticket, forKey: .ticket) - - - } - - } - - /* - Model: TicketContext - Used By: Lead - */ - - class TicketContext: Codable { - - - public var applicationId: String? - - public var companyId: String - - - public enum CodingKeys: String, CodingKey { - - case applicationId = "application_id" - - case companyId = "company_id" - - } - - public init(applicationId: String?, companyId: String) { - - self.applicationId = applicationId - - self.companyId = companyId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - applicationId = try container.decode(String.self, forKey: .applicationId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - companyId = try container.decode(String.self, forKey: .companyId) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(applicationId, forKey: .applicationId) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - } - - } - - /* - Model: CreatedOn - Used By: Lead - */ - - class CreatedOn: Codable { - - - public var userAgent: String - - - public enum CodingKeys: String, CodingKey { - - case userAgent = "user_agent" - - } - - public init(userAgent: String) { - - self.userAgent = userAgent - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - userAgent = try container.decode(String.self, forKey: .userAgent) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(userAgent, forKey: .userAgent) - - - } - - } - - /* - Model: TicketAsset - Used By: Lead - */ - - class TicketAsset: Codable { - - - public var display: String? - - public var value: String - - public var type: [String: Any] - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case value = "value" - - case type = "type" - - } - - public init(display: String?, type: [String: Any], value: String) { - - self.display = display - - self.value = value - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - value = try container.decode(String.self, forKey: .value) - - - - - type = try container.decode([String: Any].self, forKey: .type) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: TicketContent - Used By: Lead - */ - - class TicketContent: Codable { - - - public var title: String - - public var description: String? - - public var attachments: [TicketAsset]? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case description = "description" - - case attachments = "attachments" - - } - - public init(attachments: [TicketAsset]?, description: String?, title: String) { - - self.title = title - - self.description = description - - self.attachments = attachments - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - title = try container.decode(String.self, forKey: .title) - - - - - do { - description = try container.decode(String.self, forKey: .description) - - if let strong_description = description, - let descriptionData = Data(base64Encoded: strong_description) { - description = String(data: descriptionData, encoding: .utf8) ?? description - } - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attachments = try container.decode([TicketAsset].self, forKey: .attachments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - - try? container.encodeIfPresent(description?.asBase64, forKey: .description) - - - - - try? container.encodeIfPresent(attachments, forKey: .attachments) - - - } - - } - - /* - Model: AddTicketPayload - Used By: Lead - */ - - class AddTicketPayload: Codable { - - - public var createdBy: [String: Any]? - - public var status: String? - - public var priority: [String: Any]? - - public var category: String - - public var content: TicketContent - - - public enum CodingKeys: String, CodingKey { - - case createdBy = "created_by" - - case status = "status" - - case priority = "priority" - - case category = "category" - - case content = "content" - - } - - public init(category: String, content: TicketContent, createdBy: [String: Any]?, priority: [String: Any]?, status: String?) { - - self.createdBy = createdBy - - self.status = status - - self.priority = priority - - self.category = category - - self.content = content - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdBy = try container.decode([String: Any].self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priority = try container.decode([String: Any].self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - category = try container.decode(String.self, forKey: .category) - - - - - content = try container.decode(TicketContent.self, forKey: .content) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(category, forKey: .category) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - } - - } - - /* - Model: Priority - Used By: Lead - */ - - class Priority: Codable { - - - public var key: PriorityEnum - - public var display: String - - public var color: String - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case display = "display" - - case color = "color" - - } - - public init(color: String, display: String, key: PriorityEnum) { - - self.key = key - - self.display = display - - self.color = color - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - key = try container.decode(PriorityEnum.self, forKey: .key) - - - - - display = try container.decode(String.self, forKey: .display) - - - - - color = try container.decode(String.self, forKey: .color) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(color, forKey: .color) - - - } - - } - - /* - Model: Status - Used By: Lead - */ - - class Status: Codable { - - - public var key: String - - public var display: String - - public var color: String - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case display = "display" - - case color = "color" - - } - - public init(color: String, display: String, key: String) { - - self.key = key - - self.display = display - - self.color = color - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - key = try container.decode(String.self, forKey: .key) - - - - - display = try container.decode(String.self, forKey: .display) - - - - - color = try container.decode(String.self, forKey: .color) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(color, forKey: .color) - - - } - - } - - /* - Model: TicketCategory - Used By: Lead - */ - - class TicketCategory: Codable { - - - public var key: String - - public var display: String - - public var form: CustomForm? - - public var subCategories: [TicketSubCategory]? - - public var feedbackForm: TicketFeedbackForm? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case display = "display" - - case form = "form" - - case subCategories = "sub_categories" - - case feedbackForm = "feedback_form" - - } - - public init(display: String, feedbackForm: TicketFeedbackForm?, form: CustomForm?, key: String, subCategories: [TicketSubCategory]?) { - - self.key = key - - self.display = display - - self.form = form - - self.subCategories = subCategories - - self.feedbackForm = feedbackForm - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - key = try container.decode(String.self, forKey: .key) - - - - - display = try container.decode(String.self, forKey: .display) - - - - - do { - form = try container.decode(CustomForm.self, forKey: .form) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subCategories = try container.decode([TicketSubCategory].self, forKey: .subCategories) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - feedbackForm = try container.decode(TicketFeedbackForm.self, forKey: .feedbackForm) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(form, forKey: .form) - - - - try? container.encodeIfPresent(subCategories, forKey: .subCategories) - - - - try? container.encodeIfPresent(feedbackForm, forKey: .feedbackForm) - - - } - - } - - /* - Model: TicketSubCategory - Used By: Lead - */ - - class TicketSubCategory: Codable { - - - public var key: String - - public var display: String - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case display = "display" - - } - - public init(display: String, key: String) { - - self.key = key - - self.display = display - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - key = try container.decode(String.self, forKey: .key) - - - - - display = try container.decode(String.self, forKey: .display) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - } - - } - - /* - Model: TicketFeedbackForm - Used By: Lead - */ - - class TicketFeedbackForm: Codable { - - - public var title: String - - public var display: [[String: Any]]? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case display = "display" - - } - - public init(display: [[String: Any]]?, title: String) { - - self.title = title - - self.display = display - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - title = try container.decode(String.self, forKey: .title) - - - - - do { - display = try container.decode([[String: Any]].self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - } - - } - - /* - Model: TicketFeedbackList - Used By: Lead - */ - - class TicketFeedbackList: Codable { - - - public var items: [TicketFeedback]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - } - - public init(items: [TicketFeedback]?) { - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([TicketFeedback].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: TicketFeedbackPayload - Used By: Lead - */ - - class TicketFeedbackPayload: Codable { - - - public var formResponse: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case formResponse = "form_response" - - } - - public init(formResponse: [String: Any]?) { - - self.formResponse = formResponse - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - formResponse = try container.decode([String: Any].self, forKey: .formResponse) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(formResponse, forKey: .formResponse) - - - } - - } - - /* - Model: SubmitButton - Used By: Lead - */ - - class SubmitButton: Codable { - - - public var title: String - - public var titleColor: String - - public var backgroundColor: String - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case titleColor = "title_color" - - case backgroundColor = "background_color" - - } - - public init(backgroundColor: String, title: String, titleColor: String) { - - self.title = title - - self.titleColor = titleColor - - self.backgroundColor = backgroundColor - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - title = try container.decode(String.self, forKey: .title) - - - - - titleColor = try container.decode(String.self, forKey: .titleColor) - - - - - backgroundColor = try container.decode(String.self, forKey: .backgroundColor) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(titleColor, forKey: .titleColor) - - - - try? container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) - - - } - - } - - /* - Model: PollForAssignment - Used By: Lead - */ - - class PollForAssignment: Codable { - - - public var duration: Double - - public var message: String - - public var successMessage: String - - public var failureMessage: String - - - public enum CodingKeys: String, CodingKey { - - case duration = "duration" - - case message = "message" - - case successMessage = "success_message" - - case failureMessage = "failure_message" - - } - - public init(duration: Double, failureMessage: String, message: String, successMessage: String) { - - self.duration = duration - - self.message = message - - self.successMessage = successMessage - - self.failureMessage = failureMessage - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - duration = try container.decode(Double.self, forKey: .duration) - - - - - message = try container.decode(String.self, forKey: .message) - - - - - successMessage = try container.decode(String.self, forKey: .successMessage) - - - - - failureMessage = try container.decode(String.self, forKey: .failureMessage) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(duration, forKey: .duration) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(successMessage, forKey: .successMessage) - - - - try? container.encodeIfPresent(failureMessage, forKey: .failureMessage) - - - } - - } - - /* - Model: CustomForm - Used By: Lead - */ - - class CustomForm: Codable { - - - public var applicationId: String - - public var slug: String - - public var headerImage: String? - - public var title: String - - public var description: String? - - public var priority: Priority - - public var loginRequired: Bool - - public var shouldNotify: Bool - - public var successMessage: String? - - public var submitButton: SubmitButton? - - public var inputs: [[String: Any]] - - public var createdOn: CreatedOn? - - public var createdBy: [String: Any]? - - public var pollForAssignment: PollForAssignment? - - public var id: String - - - public enum CodingKeys: String, CodingKey { - - case applicationId = "application_id" - - case slug = "slug" - - case headerImage = "header_image" - - case title = "title" - - case description = "description" - - case priority = "priority" - - case loginRequired = "login_required" - - case shouldNotify = "should_notify" - - case successMessage = "success_message" - - case submitButton = "submit_button" - - case inputs = "inputs" - - case createdOn = "created_on" - - case createdBy = "created_by" - - case pollForAssignment = "poll_for_assignment" - - case id = "_id" - - } - - public init(applicationId: String, createdBy: [String: Any]?, createdOn: CreatedOn?, description: String?, headerImage: String?, inputs: [[String: Any]], loginRequired: Bool, pollForAssignment: PollForAssignment?, priority: Priority, shouldNotify: Bool, slug: String, submitButton: SubmitButton?, successMessage: String?, title: String, id: String) { - - self.applicationId = applicationId - - self.slug = slug - - self.headerImage = headerImage - - self.title = title - - self.description = description - - self.priority = priority - - self.loginRequired = loginRequired - - self.shouldNotify = shouldNotify - - self.successMessage = successMessage - - self.submitButton = submitButton - - self.inputs = inputs - - self.createdOn = createdOn - - self.createdBy = createdBy - - self.pollForAssignment = pollForAssignment - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - applicationId = try container.decode(String.self, forKey: .applicationId) - - - - - slug = try container.decode(String.self, forKey: .slug) - - - - - do { - headerImage = try container.decode(String.self, forKey: .headerImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - title = try container.decode(String.self, forKey: .title) - - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - priority = try container.decode(Priority.self, forKey: .priority) - - - - - loginRequired = try container.decode(Bool.self, forKey: .loginRequired) - - - - - shouldNotify = try container.decode(Bool.self, forKey: .shouldNotify) - - - - - do { - successMessage = try container.decode(String.self, forKey: .successMessage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - submitButton = try container.decode(SubmitButton.self, forKey: .submitButton) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - inputs = try container.decode([[String: Any]].self, forKey: .inputs) - - - - - do { - createdOn = try container.decode(CreatedOn.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode([String: Any].self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pollForAssignment = try container.decode(PollForAssignment.self, forKey: .pollForAssignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - id = try container.decode(String.self, forKey: .id) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(applicationId, forKey: .applicationId) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(headerImage, forKey: .headerImage) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(loginRequired, forKey: .loginRequired) - - - - try? container.encodeIfPresent(shouldNotify, forKey: .shouldNotify) - - - - try? container.encodeIfPresent(successMessage, forKey: .successMessage) - - - - try? container.encodeIfPresent(submitButton, forKey: .submitButton) - - - - try? container.encodeIfPresent(inputs, forKey: .inputs) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(pollForAssignment, forKey: .pollForAssignment) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: FeedbackResponseItem - Used By: Lead - */ - - class FeedbackResponseItem: Codable { - - - public var display: String - - public var key: String - - public var value: String - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case key = "key" - - case value = "value" - - } - - public init(display: String, key: String, value: String) { - - self.display = display - - self.key = key - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - display = try container.decode(String.self, forKey: .display) - - - - - key = try container.decode(String.self, forKey: .key) - - - - - value = try container.decode(String.self, forKey: .value) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: TicketFeedback - Used By: Lead - */ - - class TicketFeedback: Codable { - - - public var id: String - - public var ticketId: String - - public var companyId: String - - public var response: [FeedbackResponseItem] - - public var category: String? - - public var user: [String: Any]? - - public var updatedAt: String? - - public var createdAt: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case ticketId = "ticket_id" - - case companyId = "company_id" - - case response = "response" - - case category = "category" - - case user = "user" - - case updatedAt = "updated_at" - - case createdAt = "created_at" - - } - - public init(category: String?, companyId: String, createdAt: String?, response: [FeedbackResponseItem], ticketId: String, updatedAt: String?, user: [String: Any]?, id: String) { - - self.id = id - - self.ticketId = ticketId - - self.companyId = companyId - - self.response = response - - self.category = category - - self.user = user - - self.updatedAt = updatedAt - - self.createdAt = createdAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - id = try container.decode(String.self, forKey: .id) - - - - - ticketId = try container.decode(String.self, forKey: .ticketId) - - - - - companyId = try container.decode(String.self, forKey: .companyId) - - - - - response = try container.decode([FeedbackResponseItem].self, forKey: .response) - - - - - do { - category = try container.decode(String.self, forKey: .category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - user = try container.decode([String: Any].self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(ticketId, forKey: .ticketId) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(response, forKey: .response) - - - - try? container.encodeIfPresent(category, forKey: .category) - - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - } - - } - - /* - Model: TicketHistory - Used By: Lead - */ - - class TicketHistory: Codable { - - - public var type: String - - public var value: [String: Any] - - public var ticketId: String - - public var createdOn: CreatedOn? - - public var createdBy: [String: Any]? - - public var id: String - - public var updatedAt: String? - - public var createdAt: String? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case value = "value" - - case ticketId = "ticket_id" - - case createdOn = "created_on" - - case createdBy = "created_by" - - case id = "_id" - - case updatedAt = "updated_at" - - case createdAt = "created_at" - - } - - public init(createdAt: String?, createdBy: [String: Any]?, createdOn: CreatedOn?, ticketId: String, type: String, updatedAt: String?, value: [String: Any], id: String) { - - self.type = type - - self.value = value - - self.ticketId = ticketId - - self.createdOn = createdOn - - self.createdBy = createdBy - - self.id = id - - self.updatedAt = updatedAt - - self.createdAt = createdAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - type = try container.decode(String.self, forKey: .type) - - - - - value = try container.decode([String: Any].self, forKey: .value) - - - - - ticketId = try container.decode(String.self, forKey: .ticketId) - - - - - do { - createdOn = try container.decode(CreatedOn.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode([String: Any].self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - id = try container.decode(String.self, forKey: .id) - - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(ticketId, forKey: .ticketId) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - } - - } - - /* - Model: Ticket - Used By: Lead - */ - - class Ticket: Codable { - - - public var context: TicketContext? - - public var createdOn: CreatedOn? - - public var responseId: String? - - public var content: TicketContent? - - public var ticketId: String - - public var category: TicketCategory - - public var subCategory: TicketSubCategory? - - public var source: [String: Any] - - public var status: Status - - public var priority: Priority - - public var createdBy: [String: Any]? - - public var assignedTo: [String: Any]? - - public var tags: [String]? - - public var customJson: [String: Any]? - - public var isFeedbackPending: Bool? - - public var id: String - - public var updatedAt: String? - - public var createdAt: String? - - - public enum CodingKeys: String, CodingKey { - - case context = "context" - - case createdOn = "created_on" - - case responseId = "response_id" - - case content = "content" - - case ticketId = "ticket_id" - - case category = "category" - - case subCategory = "sub_category" - - case source = "source" - - case status = "status" - - case priority = "priority" - - case createdBy = "created_by" - - case assignedTo = "assigned_to" - - case tags = "tags" - - case customJson = "_custom_json" - - case isFeedbackPending = "is_feedback_pending" - - case id = "_id" - - case updatedAt = "updated_at" - - case createdAt = "created_at" - - } - - public init(assignedTo: [String: Any]?, category: TicketCategory, content: TicketContent?, context: TicketContext?, createdAt: String?, createdBy: [String: Any]?, createdOn: CreatedOn?, isFeedbackPending: Bool?, priority: Priority, responseId: String?, source: [String: Any], status: Status, subCategory: TicketSubCategory?, tags: [String]?, ticketId: String, updatedAt: String?, customJson: [String: Any]?, id: String) { - - self.context = context - - self.createdOn = createdOn - - self.responseId = responseId - - self.content = content - - self.ticketId = ticketId - - self.category = category - - self.subCategory = subCategory - - self.source = source - - self.status = status - - self.priority = priority - - self.createdBy = createdBy - - self.assignedTo = assignedTo - - self.tags = tags - - self.customJson = customJson - - self.isFeedbackPending = isFeedbackPending - - self.id = id - - self.updatedAt = updatedAt - - self.createdAt = createdAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - context = try container.decode(TicketContext.self, forKey: .context) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(CreatedOn.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - responseId = try container.decode(String.self, forKey: .responseId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode(TicketContent.self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - ticketId = try container.decode(String.self, forKey: .ticketId) - - - - - category = try container.decode(TicketCategory.self, forKey: .category) - - - - - do { - subCategory = try container.decode(TicketSubCategory.self, forKey: .subCategory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - source = try container.decode([String: Any].self, forKey: .source) - - - - - status = try container.decode(Status.self, forKey: .status) - - - - - priority = try container.decode(Priority.self, forKey: .priority) - - - - - do { - createdBy = try container.decode([String: Any].self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - assignedTo = try container.decode([String: Any].self, forKey: .assignedTo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isFeedbackPending = try container.decode(Bool.self, forKey: .isFeedbackPending) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - id = try container.decode(String.self, forKey: .id) - - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(context, forKey: .context) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(responseId, forKey: .responseId) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - - try? container.encodeIfPresent(ticketId, forKey: .ticketId) - - - - try? container.encodeIfPresent(category, forKey: .category) - - - - try? container.encodeIfPresent(subCategory, forKey: .subCategory) - - - - try? container.encodeIfPresent(source, forKey: .source) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(assignedTo, forKey: .assignedTo) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(isFeedbackPending, forKey: .isFeedbackPending) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - } - - } - - - - /* - Model: Activity - Used By: Feedback - */ - - class Activity: Codable { - - - public var currentState: [String: Any]? - - public var documentId: String? - - public var previousState: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case currentState = "current_state" - - case documentId = "document_id" - - case previousState = "previous_state" - - } - - public init(currentState: [String: Any]?, documentId: String?, previousState: [String: Any]?) { - - self.currentState = currentState - - self.documentId = documentId - - self.previousState = previousState - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - currentState = try container.decode([String: Any].self, forKey: .currentState) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - documentId = try container.decode(String.self, forKey: .documentId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - previousState = try container.decode([String: Any].self, forKey: .previousState) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(currentState, forKey: .currentState) - - - - try? container.encodeIfPresent(documentId, forKey: .documentId) - - - - try? container.encodeIfPresent(previousState, forKey: .previousState) - - - } - - } - - /* - Model: ActivityDump - Used By: Feedback - */ - - class ActivityDump: Codable { - - - public var activity: Activity? - - public var createdBy: CreatedBy? - - public var dateMeta: DateMeta? - - public var id: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case activity = "activity" - - case createdBy = "created_by" - - case dateMeta = "date_meta" - - case id = "id" - - case type = "type" - - } - - public init(activity: Activity?, createdBy: CreatedBy?, dateMeta: DateMeta?, id: String?, type: String?) { - - self.activity = activity - - self.createdBy = createdBy - - self.dateMeta = dateMeta - - self.id = id - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - activity = try container.decode(Activity.self, forKey: .activity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(CreatedBy.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(activity, forKey: .activity) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: AddMediaListRequest - Used By: Feedback - */ - - class AddMediaListRequest: Codable { - - - public var entityId: String? - - public var entityType: String? - - public var mediaList: [AddMediaRequest]? - - public var refId: String? - - public var refType: String? - - - public enum CodingKeys: String, CodingKey { - - case entityId = "entity_id" - - case entityType = "entity_type" - - case mediaList = "media_list" - - case refId = "ref_id" - - case refType = "ref_type" - - } - - public init(entityId: String?, entityType: String?, mediaList: [AddMediaRequest]?, refId: String?, refType: String?) { - - self.entityId = entityId - - self.entityType = entityType - - self.mediaList = mediaList - - self.refId = refId - - self.refType = refType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - entityId = try container.decode(String.self, forKey: .entityId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entityType = try container.decode(String.self, forKey: .entityType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mediaList = try container.decode([AddMediaRequest].self, forKey: .mediaList) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refId = try container.decode(String.self, forKey: .refId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refType = try container.decode(String.self, forKey: .refType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(entityId, forKey: .entityId) - - - - try? container.encodeIfPresent(entityType, forKey: .entityType) - - - - try? container.encodeIfPresent(mediaList, forKey: .mediaList) - - - - try? container.encodeIfPresent(refId, forKey: .refId) - - - - try? container.encodeIfPresent(refType, forKey: .refType) - - - } - - } - - /* - Model: AddMediaRequest - Used By: Feedback - */ - - class AddMediaRequest: Codable { - - - public var cloudId: String? - - public var cloudName: String? - - public var cloudProvider: String? - - public var entityId: String? - - public var entityType: String? - - public var mediaUrl: String? - - public var refId: String? - - public var refType: String? - - public var tags: [String]? - - public var thumbnailUrl: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case cloudId = "cloud_id" - - case cloudName = "cloud_name" - - case cloudProvider = "cloud_provider" - - case entityId = "entity_id" - - case entityType = "entity_type" - - case mediaUrl = "media_url" - - case refId = "ref_id" - - case refType = "ref_type" - - case tags = "tags" - - case thumbnailUrl = "thumbnail_url" - - case type = "type" - - } - - public init(cloudId: String?, cloudName: String?, cloudProvider: String?, entityId: String?, entityType: String?, mediaUrl: String?, refId: String?, refType: String?, tags: [String]?, thumbnailUrl: String?, type: String?) { - - self.cloudId = cloudId - - self.cloudName = cloudName - - self.cloudProvider = cloudProvider - - self.entityId = entityId - - self.entityType = entityType - - self.mediaUrl = mediaUrl - - self.refId = refId - - self.refType = refType - - self.tags = tags - - self.thumbnailUrl = thumbnailUrl - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cloudId = try container.decode(String.self, forKey: .cloudId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cloudName = try container.decode(String.self, forKey: .cloudName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cloudProvider = try container.decode(String.self, forKey: .cloudProvider) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entityId = try container.decode(String.self, forKey: .entityId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entityType = try container.decode(String.self, forKey: .entityType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mediaUrl = try container.decode(String.self, forKey: .mediaUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refId = try container.decode(String.self, forKey: .refId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refType = try container.decode(String.self, forKey: .refType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - thumbnailUrl = try container.decode(String.self, forKey: .thumbnailUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cloudId, forKey: .cloudId) - - - - try? container.encodeIfPresent(cloudName, forKey: .cloudName) - - - - try? container.encodeIfPresent(cloudProvider, forKey: .cloudProvider) - - - - try? container.encodeIfPresent(entityId, forKey: .entityId) - - - - try? container.encodeIfPresent(entityType, forKey: .entityType) - - - - try? container.encodeIfPresent(mediaUrl, forKey: .mediaUrl) - - - - try? container.encodeIfPresent(refId, forKey: .refId) - - - - try? container.encodeIfPresent(refType, forKey: .refType) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(thumbnailUrl, forKey: .thumbnailUrl) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ApproveRequest - Used By: Feedback - */ - - class ApproveRequest: Codable { - - - public var approve: Bool? - - public var entityType: String? - - public var id: String - - public var reason: String? - - - public enum CodingKeys: String, CodingKey { - - case approve = "approve" - - case entityType = "entity_type" - - case id = "id" - - case reason = "reason" - - } - - public init(approve: Bool?, entityType: String?, id: String, reason: String?) { - - self.approve = approve - - self.entityType = entityType - - self.id = id - - self.reason = reason - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - approve = try container.decode(Bool.self, forKey: .approve) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entityType = try container.decode(String.self, forKey: .entityType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - id = try container.decode(String.self, forKey: .id) - - - - - do { - reason = try container.decode(String.self, forKey: .reason) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(approve, forKey: .approve) - - - - try? container.encodeIfPresent(entityType, forKey: .entityType) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(reason, forKey: .reason) - - - } - - } - - /* - Model: Attribute - Used By: Feedback - */ - - class Attribute: Codable { - - - public var dateMeta: DateMeta? - - public var description: String? - - public var id: String? - - public var name: String? - - public var slug: String? - - public var tags: [TagMeta]? - - - public enum CodingKeys: String, CodingKey { - - case dateMeta = "date_meta" - - case description = "description" - - case id = "id" - - case name = "name" - - case slug = "slug" - - case tags = "tags" - - } - - public init(dateMeta: DateMeta?, description: String?, id: String?, name: String?, slug: String?, tags: [TagMeta]?) { - - self.dateMeta = dateMeta - - self.description = description - - self.id = id - - self.name = name - - self.slug = slug - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([TagMeta].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: AttributeObject - Used By: Feedback - */ - - class AttributeObject: Codable { - - - public var description: String? - - public var name: String - - public var slug: String? - - public var title: String? - - public var type: String - - public var value: Double - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case name = "name" - - case slug = "slug" - - case title = "title" - - case type = "type" - - case value = "value" - - } - - public init(description: String?, name: String, slug: String?, title: String?, type: String, value: Double) { - - self.description = description - - self.name = name - - self.slug = slug - - self.title = title - - self.type = type - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - type = try container.decode(String.self, forKey: .type) - - - - - value = try container.decode(Double.self, forKey: .value) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: CreatedBy - Used By: Feedback - */ - - class CreatedBy: Codable { - - - public var id: String? - - public var name: String? - - public var tags: [TagMeta]? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case name = "name" - - case tags = "tags" - - } - - public init(id: String?, name: String?, tags: [TagMeta]?) { - - self.id = id - - self.name = name - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([TagMeta].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: CursorGetResponse - Used By: Feedback - */ - - class CursorGetResponse: Codable { - - - public var items: [[String: Any]]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [[String: Any]]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([[String: Any]].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: DateMeta - Used By: Feedback - */ - - class DateMeta: Codable { - - - public var createdOn: String? - - public var modifiedOn: String? - - - public enum CodingKeys: String, CodingKey { - - case createdOn = "created_on" - - case modifiedOn = "modified_on" - - } - - public init(createdOn: String?, modifiedOn: String?) { - - self.createdOn = createdOn - - self.modifiedOn = modifiedOn - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - } - - } - - /* - Model: DeviceMeta - Used By: Feedback - */ - - class DeviceMeta: Codable { - - - public var appVersion: String? - - public var platform: String? - - - public enum CodingKeys: String, CodingKey { - - case appVersion = "app_version" - - case platform = "platform" - - } - - public init(appVersion: String?, platform: String?) { - - self.appVersion = appVersion - - self.platform = platform - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - appVersion = try container.decode(String.self, forKey: .appVersion) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode(String.self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(appVersion, forKey: .appVersion) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - } - - } - - /* - Model: Entity - Used By: Feedback - */ - - class Entity: Codable { - - - public var id: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case type = "type" - - } - - public init(id: String?, type: String?) { - - self.id = id - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: EntityRequest - Used By: Feedback - */ - - class EntityRequest: Codable { - - - public var entityId: String? - - public var entityType: String? - - - public enum CodingKeys: String, CodingKey { - - case entityId = "entity_id" - - case entityType = "entity_type" - - } - - public init(entityId: String?, entityType: String?) { - - self.entityId = entityId - - self.entityType = entityType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - entityId = try container.decode(String.self, forKey: .entityId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entityType = try container.decode(String.self, forKey: .entityType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(entityId, forKey: .entityId) - - - - try? container.encodeIfPresent(entityType, forKey: .entityType) - - - } - - } - - /* - Model: FeedbackAttributes - Used By: Feedback - */ - - class FeedbackAttributes: Codable { - - - public var items: [Attribute]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [Attribute]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Attribute].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: FeedbackError - Used By: Feedback - */ - - class FeedbackError: Codable { - - - public var code: [String: Any]? - - public var exception: String? - - public var info: String? - - public var message: String? - - public var meta: [String: Any]? - - public var requestId: String? - - public var stackTrace: String? - - public var status: Int? - - - public enum CodingKeys: String, CodingKey { - - case code = "code" - - case exception = "exception" - - case info = "info" - - case message = "message" - - case meta = "meta" - - case requestId = "request_id" - - case stackTrace = "stack_trace" - - case status = "status" - - } - - public init(code: [String: Any]?, exception: String?, info: String?, message: String?, meta: [String: Any]?, requestId: String?, stackTrace: String?, status: Int?) { - - self.code = code - - self.exception = exception - - self.info = info - - self.message = message - - self.meta = meta - - self.requestId = requestId - - self.stackTrace = stackTrace - - self.status = status - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - code = try container.decode([String: Any].self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - exception = try container.decode(String.self, forKey: .exception) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - info = try container.decode(String.self, forKey: .info) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requestId = try container.decode(String.self, forKey: .requestId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stackTrace = try container.decode(String.self, forKey: .stackTrace) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(Int.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(exception, forKey: .exception) - - - - try? container.encodeIfPresent(info, forKey: .info) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(stackTrace, forKey: .stackTrace) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - } - - } - - /* - Model: FeedbackState - Used By: Feedback - */ - - class FeedbackState: Codable { - - - public var active: Bool? - - public var archive: Bool? - - public var media: String? - - public var qna: Bool? - - public var rating: Bool? - - public var review: Bool? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case archive = "archive" - - case media = "media" - - case qna = "qna" - - case rating = "rating" - - case review = "review" - - } - - public init(active: Bool?, archive: Bool?, media: String?, qna: Bool?, rating: Bool?, review: Bool?) { - - self.active = active - - self.archive = archive - - self.media = media - - self.qna = qna - - self.rating = rating - - self.review = review - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archive = try container.decode(Bool.self, forKey: .archive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - media = try container.decode(String.self, forKey: .media) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - qna = try container.decode(Bool.self, forKey: .qna) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rating = try container.decode(Bool.self, forKey: .rating) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - review = try container.decode(Bool.self, forKey: .review) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(archive, forKey: .archive) - - - - try? container.encodeIfPresent(media, forKey: .media) - - - - try? container.encodeIfPresent(qna, forKey: .qna) - - - - try? container.encodeIfPresent(rating, forKey: .rating) - - - - try? container.encodeIfPresent(review, forKey: .review) - - - } - - } - - /* - Model: GetResponse - Used By: Feedback - */ - - class GetResponse: Codable { - - - public var data: [String: Any]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case data = "data" - - case page = "page" - - } - - public init(data: [String: Any]?, page: Page?) { - - self.data = data - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - data = try container.decode([String: Any].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(data, forKey: .data) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: GetReviewResponse - Used By: Feedback - */ - - class GetReviewResponse: Codable { - - - public var facets: [ReviewFacet]? - - public var items: [[String: Any]]? - - public var page: Page? - - public var sort: [SortMethod]? - - - public enum CodingKeys: String, CodingKey { - - case facets = "facets" - - case items = "items" - - case page = "page" - - case sort = "sort" - - } - - public init(facets: [ReviewFacet]?, items: [[String: Any]]?, page: Page?, sort: [SortMethod]?) { - - self.facets = facets - - self.items = items - - self.page = page - - self.sort = sort - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - facets = try container.decode([ReviewFacet].self, forKey: .facets) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([[String: Any]].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sort = try container.decode([SortMethod].self, forKey: .sort) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(facets, forKey: .facets) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(sort, forKey: .sort) - - - } - - } - - /* - Model: InsertResponse - Used By: Feedback - */ - - class InsertResponse: Codable { - - - public var count: Int? - - - public enum CodingKeys: String, CodingKey { - - case count = "count" - - } - - public init(count: Int?) { - - self.count = count - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(count, forKey: .count) - - - } - - } - - /* - Model: MediaMeta - Used By: Feedback - */ - - class MediaMeta: Codable { - - - public var maxCount: Int? - - public var size: Int? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case maxCount = "max_count" - - case size = "size" - - case type = "type" - - } - - public init(maxCount: Int?, size: Int?, type: String?) { - - self.maxCount = maxCount - - self.size = size - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - maxCount = try container.decode(Int.self, forKey: .maxCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - size = try container.decode(Int.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(maxCount, forKey: .maxCount) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: MediaMetaRequest - Used By: Feedback - */ - - class MediaMetaRequest: Codable { - - - public var maxCount: Int - - public var size: Int - - - public enum CodingKeys: String, CodingKey { - - case maxCount = "max_count" - - case size = "size" - - } - - public init(maxCount: Int, size: Int) { - - self.maxCount = maxCount - - self.size = size - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - maxCount = try container.decode(Int.self, forKey: .maxCount) - - - - - size = try container.decode(Int.self, forKey: .size) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(maxCount, forKey: .maxCount) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - } - - } - - /* - Model: NumberGetResponse - Used By: Feedback - */ - - class NumberGetResponse: Codable { - - - public var items: [[String: Any]]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [[String: Any]]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([[String: Any]].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: PageCursor - Used By: Feedback - */ - - class PageCursor: Codable { - - - public var current: Int? - - public var hasNext: Bool? - - public var hasPrevious: Bool? - - public var itemTotal: Int? - - public var nextId: String? - - public var size: Int - - public var type: String - - - public enum CodingKeys: String, CodingKey { - - case current = "current" - - case hasNext = "has_next" - - case hasPrevious = "has_previous" - - case itemTotal = "item_total" - - case nextId = "next_id" - - case size = "size" - - case type = "type" - - } - - public init(current: Int?, hasNext: Bool?, hasPrevious: Bool?, itemTotal: Int?, nextId: String?, size: Int, type: String) { - - self.current = current - - self.hasNext = hasNext - - self.hasPrevious = hasPrevious - - self.itemTotal = itemTotal - - self.nextId = nextId - - self.size = size - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - current = try container.decode(Int.self, forKey: .current) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasNext = try container.decode(Bool.self, forKey: .hasNext) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasPrevious = try container.decode(Bool.self, forKey: .hasPrevious) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemTotal = try container.decode(Int.self, forKey: .itemTotal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - nextId = try container.decode(String.self, forKey: .nextId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - size = try container.decode(Int.self, forKey: .size) - - - - - type = try container.decode(String.self, forKey: .type) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(current, forKey: .current) - - - - try? container.encodeIfPresent(hasNext, forKey: .hasNext) - - - - try? container.encodeIfPresent(hasPrevious, forKey: .hasPrevious) - - - - try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) - - - - try? container.encodeIfPresent(nextId, forKey: .nextId) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: PageNumber - Used By: Feedback - */ - - class PageNumber: Codable { - - - public var current: Int? - - public var hasNext: Bool? - - public var itemTotal: Int? - - public var size: Int? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case current = "current" - - case hasNext = "has_next" - - case itemTotal = "item_total" - - case size = "size" - - case type = "type" - - } - - public init(current: Int?, hasNext: Bool?, itemTotal: Int?, size: Int?, type: String?) { - - self.current = current - - self.hasNext = hasNext - - self.itemTotal = itemTotal - - self.size = size - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - current = try container.decode(Int.self, forKey: .current) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasNext = try container.decode(Bool.self, forKey: .hasNext) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemTotal = try container.decode(Int.self, forKey: .itemTotal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - size = try container.decode(Int.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(current, forKey: .current) - - - - try? container.encodeIfPresent(hasNext, forKey: .hasNext) - - - - try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: Rating - Used By: Feedback - */ - - class Rating: Codable { - - - public var attributes: [Attribute]? - - public var attributesSlugs: [String]? - - public var ui: UI? - - - public enum CodingKeys: String, CodingKey { - - case attributes = "attributes" - - case attributesSlugs = "attributes_slugs" - - case ui = "ui" - - } - - public init(attributes: [Attribute]?, attributesSlugs: [String]?, ui: UI?) { - - self.attributes = attributes - - self.attributesSlugs = attributesSlugs - - self.ui = ui - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - attributes = try container.decode([Attribute].self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attributesSlugs = try container.decode([String].self, forKey: .attributesSlugs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ui = try container.decode(UI.self, forKey: .ui) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - - try? container.encodeIfPresent(attributesSlugs, forKey: .attributesSlugs) - - - - try? container.encodeIfPresent(ui, forKey: .ui) - - - } - - } - - /* - Model: RatingRequest - Used By: Feedback - */ - - class RatingRequest: Codable { - - - public var attributes: [String] - - public var ui: UI? - - - public enum CodingKeys: String, CodingKey { - - case attributes = "attributes" - - case ui = "ui" - - } - - public init(attributes: [String], ui: UI?) { - - self.attributes = attributes - - self.ui = ui - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - attributes = try container.decode([String].self, forKey: .attributes) - - - - - do { - ui = try container.decode(UI.self, forKey: .ui) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - - try? container.encodeIfPresent(ui, forKey: .ui) - - - } - - } - - /* - Model: ReportAbuseRequest - Used By: Feedback - */ - - class ReportAbuseRequest: Codable { - - - public var description: String? - - public var entityId: String - - public var entityType: String - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case entityId = "entity_id" - - case entityType = "entity_type" - - } - - public init(description: String?, entityId: String, entityType: String) { - - self.description = description - - self.entityId = entityId - - self.entityType = entityType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - entityId = try container.decode(String.self, forKey: .entityId) - - - - - entityType = try container.decode(String.self, forKey: .entityType) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(entityId, forKey: .entityId) - - - - try? container.encodeIfPresent(entityType, forKey: .entityType) - - - } - - } - - /* - Model: Review - Used By: Feedback - */ - - class Review: Codable { - - - public var description: String? - - public var header: String? - - public var imageMeta: MediaMeta? - - public var title: String? - - public var videoMeta: MediaMeta? - - public var voteAllowed: Bool? - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case header = "header" - - case imageMeta = "image_meta" - - case title = "title" - - case videoMeta = "video_meta" - - case voteAllowed = "vote_allowed" - - } - - public init(description: String?, header: String?, imageMeta: MediaMeta?, title: String?, videoMeta: MediaMeta?, voteAllowed: Bool?) { - - self.description = description - - self.header = header - - self.imageMeta = imageMeta - - self.title = title - - self.videoMeta = videoMeta - - self.voteAllowed = voteAllowed - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - header = try container.decode(String.self, forKey: .header) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - imageMeta = try container.decode(MediaMeta.self, forKey: .imageMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - videoMeta = try container.decode(MediaMeta.self, forKey: .videoMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - voteAllowed = try container.decode(Bool.self, forKey: .voteAllowed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(header, forKey: .header) - - - - try? container.encodeIfPresent(imageMeta, forKey: .imageMeta) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(videoMeta, forKey: .videoMeta) - - - - try? container.encodeIfPresent(voteAllowed, forKey: .voteAllowed) - - - } - - } - - /* - Model: ReviewFacet - Used By: Feedback - */ - - class ReviewFacet: Codable { - - - public var display: String? - - public var name: String? - - public var selected: Bool? - - public var slug: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case name = "name" - - case selected = "selected" - - case slug = "slug" - - case type = "type" - - } - - public init(display: String?, name: String?, selected: Bool?, slug: String?, type: String?) { - - self.display = display - - self.name = name - - self.selected = selected - - self.slug = slug - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - selected = try container.decode(Bool.self, forKey: .selected) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(selected, forKey: .selected) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ReviewRequest - Used By: Feedback - */ - - class ReviewRequest: Codable { - - - public var description: String - - public var header: String - - public var imageMeta: MediaMetaRequest - - public var isVoteAllowed: Bool - - public var title: String - - public var videoMeta: MediaMetaRequest - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case header = "header" - - case imageMeta = "image_meta" - - case isVoteAllowed = "is_vote_allowed" - - case title = "title" - - case videoMeta = "video_meta" - - } - - public init(description: String, header: String, imageMeta: MediaMetaRequest, isVoteAllowed: Bool, title: String, videoMeta: MediaMetaRequest) { - - self.description = description - - self.header = header - - self.imageMeta = imageMeta - - self.isVoteAllowed = isVoteAllowed - - self.title = title - - self.videoMeta = videoMeta - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - description = try container.decode(String.self, forKey: .description) - - - - - header = try container.decode(String.self, forKey: .header) - - - - - imageMeta = try container.decode(MediaMetaRequest.self, forKey: .imageMeta) - - - - - isVoteAllowed = try container.decode(Bool.self, forKey: .isVoteAllowed) - - - - - title = try container.decode(String.self, forKey: .title) - - - - - videoMeta = try container.decode(MediaMetaRequest.self, forKey: .videoMeta) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(header, forKey: .header) - - - - try? container.encodeIfPresent(imageMeta, forKey: .imageMeta) - - - - try? container.encodeIfPresent(isVoteAllowed, forKey: .isVoteAllowed) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(videoMeta, forKey: .videoMeta) - - - } - - } - - /* - Model: SaveAttributeRequest - Used By: Feedback - */ - - class SaveAttributeRequest: Codable { - - - public var description: String? - - public var name: String - - public var slug: String - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case name = "name" - - case slug = "slug" - - } - - public init(description: String?, name: String, slug: String) { - - self.description = description - - self.name = name - - self.slug = slug - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - - slug = try container.decode(String.self, forKey: .slug) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - } - - } - - /* - Model: SortMethod - Used By: Feedback - */ - - class SortMethod: Codable { - - - public var name: String? - - public var selected: Bool? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case selected = "selected" - - case type = "type" - - } - - public init(name: String?, selected: Bool?, type: String?) { - - self.name = name - - self.selected = selected - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - selected = try container.decode(Bool.self, forKey: .selected) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(selected, forKey: .selected) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: TagMeta - Used By: Feedback - */ - - class TagMeta: Codable { - - - public var media: [MediaMeta]? - - public var name: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case media = "media" - - case name = "name" - - case type = "type" - - } - - public init(media: [MediaMeta]?, name: String?, type: String?) { - - self.media = media - - self.name = name - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - media = try container.decode([MediaMeta].self, forKey: .media) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(media, forKey: .media) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: Template - Used By: Feedback - */ - - class Template: Codable { - - - public var dateMeta: DateMeta? - - public var entity: Entity? - - public var id: String? - - public var name: String? - - public var rating: Rating? - - public var review: Review? - - public var state: FeedbackState? - - public var tags: [TagMeta]? - - - public enum CodingKeys: String, CodingKey { - - case dateMeta = "date_meta" - - case entity = "entity" - - case id = "id" - - case name = "name" - - case rating = "rating" - - case review = "review" - - case state = "state" - - case tags = "tags" - - } - - public init(dateMeta: DateMeta?, entity: Entity?, id: String?, name: String?, rating: Rating?, review: Review?, state: FeedbackState?, tags: [TagMeta]?) { - - self.dateMeta = dateMeta - - self.entity = entity - - self.id = id - - self.name = name - - self.rating = rating - - self.review = review - - self.state = state - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entity = try container.decode(Entity.self, forKey: .entity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rating = try container.decode(Rating.self, forKey: .rating) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - review = try container.decode(Review.self, forKey: .review) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(FeedbackState.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([TagMeta].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(entity, forKey: .entity) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(rating, forKey: .rating) - - - - try? container.encodeIfPresent(review, forKey: .review) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: TemplateGetResponse - Used By: Feedback - */ - - class TemplateGetResponse: Codable { - - - public var items: [Template]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [Template]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Template].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: TemplateRequest - Used By: Feedback - */ - - class TemplateRequest: Codable { - - - public var active: Bool - - public var enableMediaType: String? - - public var enableQna: Bool? - - public var enableRating: Bool - - public var enableReview: Bool - - public var entity: EntityRequest - - public var rating: RatingRequest - - public var review: ReviewRequest - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case enableMediaType = "enable_media_type" - - case enableQna = "enable_qna" - - case enableRating = "enable_rating" - - case enableReview = "enable_review" - - case entity = "entity" - - case rating = "rating" - - case review = "review" - - } - - public init(active: Bool, enableMediaType: String?, enableQna: Bool?, enableRating: Bool, enableReview: Bool, entity: EntityRequest, rating: RatingRequest, review: ReviewRequest) { - - self.active = active - - self.enableMediaType = enableMediaType - - self.enableQna = enableQna - - self.enableRating = enableRating - - self.enableReview = enableReview - - self.entity = entity - - self.rating = rating - - self.review = review - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - active = try container.decode(Bool.self, forKey: .active) - - - - - do { - enableMediaType = try container.decode(String.self, forKey: .enableMediaType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enableQna = try container.decode(Bool.self, forKey: .enableQna) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - enableRating = try container.decode(Bool.self, forKey: .enableRating) - - - - - enableReview = try container.decode(Bool.self, forKey: .enableReview) - - - - - entity = try container.decode(EntityRequest.self, forKey: .entity) - - - - - rating = try container.decode(RatingRequest.self, forKey: .rating) - - - - - review = try container.decode(ReviewRequest.self, forKey: .review) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(enableMediaType, forKey: .enableMediaType) - - - - try? container.encodeIfPresent(enableQna, forKey: .enableQna) - - - - try? container.encodeIfPresent(enableRating, forKey: .enableRating) - - - - try? container.encodeIfPresent(enableReview, forKey: .enableReview) - - - - try? container.encodeIfPresent(entity, forKey: .entity) - - - - try? container.encodeIfPresent(rating, forKey: .rating) - - - - try? container.encodeIfPresent(review, forKey: .review) - - - } - - } - - /* - Model: TemplateRequestList - Used By: Feedback - */ - - class TemplateRequestList: Codable { - - - public var templateList: [TemplateRequest] - - - public enum CodingKeys: String, CodingKey { - - case templateList = "template_list" - - } - - public init(templateList: [TemplateRequest]) { - - self.templateList = templateList - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - templateList = try container.decode([TemplateRequest].self, forKey: .templateList) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(templateList, forKey: .templateList) - - - } - - } - - /* - Model: UI - Used By: Feedback - */ - - class UI: Codable { - - - public var feedbackQuestion: [String]? - - public var icon: UIIcon? - - public var text: [String]? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case feedbackQuestion = "feedback_question" - - case icon = "icon" - - case text = "text" - - case type = "type" - - } - - public init(feedbackQuestion: [String]?, icon: UIIcon?, text: [String]?, type: String?) { - - self.feedbackQuestion = feedbackQuestion - - self.icon = icon - - self.text = text - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - feedbackQuestion = try container.decode([String].self, forKey: .feedbackQuestion) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(UIIcon.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text = try container.decode([String].self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(feedbackQuestion, forKey: .feedbackQuestion) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: UIIcon - Used By: Feedback - */ - - class UIIcon: Codable { - - - public var active: String? - - public var inactive: String? - - public var selected: [String]? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case inactive = "inactive" - - case selected = "selected" - - } - - public init(active: String?, inactive: String?, selected: [String]?) { - - self.active = active - - self.inactive = inactive - - self.selected = selected - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(String.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - inactive = try container.decode(String.self, forKey: .inactive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - selected = try container.decode([String].self, forKey: .selected) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(inactive, forKey: .inactive) - - - - try? container.encodeIfPresent(selected, forKey: .selected) - - - } - - } - - /* - Model: UpdateAttributeRequest - Used By: Feedback - */ - - class UpdateAttributeRequest: Codable { - - - public var description: String? - - public var name: String - - public var slug: String? - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case name = "name" - - case slug = "slug" - - } - - public init(description: String?, name: String, slug: String?) { - - self.description = description - - self.name = name - - self.slug = slug - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - } - - } - - /* - Model: UpdateResponse - Used By: Feedback - */ - - class UpdateResponse: Codable { - - - public var count: Int? - - - public enum CodingKeys: String, CodingKey { - - case count = "count" - - } - - public init(count: Int?) { - - self.count = count - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(count, forKey: .count) - - - } - - } - - /* - Model: UpdateReviewRequest - Used By: Feedback - */ - - class UpdateReviewRequest: Codable { - - - public var active: Bool? - - public var application: String? - - public var approve: Bool? - - public var archive: Bool? - - public var attributesRating: [AttributeObject]? - - public var description: String? - - public var deviceMeta: DeviceMeta? - - public var entityId: String? - - public var entityType: String? - - public var mediaResource: [MediaMeta]? - - public var rating: Double? - - public var reviewId: String? - - public var templateId: String? - - public var title: String? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case application = "application" - - case approve = "approve" - - case archive = "archive" - - case attributesRating = "attributes_rating" - - case description = "description" - - case deviceMeta = "device_meta" - - case entityId = "entity_id" - - case entityType = "entity_type" - - case mediaResource = "media_resource" - - case rating = "rating" - - case reviewId = "review_id" - - case templateId = "template_id" - - case title = "title" - - } - - public init(active: Bool?, application: String?, approve: Bool?, archive: Bool?, attributesRating: [AttributeObject]?, description: String?, deviceMeta: DeviceMeta?, entityId: String?, entityType: String?, mediaResource: [MediaMeta]?, rating: Double?, reviewId: String?, templateId: String?, title: String?) { - - self.active = active - - self.application = application - - self.approve = approve - - self.archive = archive - - self.attributesRating = attributesRating - - self.description = description - - self.deviceMeta = deviceMeta - - self.entityId = entityId - - self.entityType = entityType - - self.mediaResource = mediaResource - - self.rating = rating - - self.reviewId = reviewId - - self.templateId = templateId - - self.title = title - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - approve = try container.decode(Bool.self, forKey: .approve) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archive = try container.decode(Bool.self, forKey: .archive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attributesRating = try container.decode([AttributeObject].self, forKey: .attributesRating) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deviceMeta = try container.decode(DeviceMeta.self, forKey: .deviceMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entityId = try container.decode(String.self, forKey: .entityId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - entityType = try container.decode(String.self, forKey: .entityType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mediaResource = try container.decode([MediaMeta].self, forKey: .mediaResource) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rating = try container.decode(Double.self, forKey: .rating) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - reviewId = try container.decode(String.self, forKey: .reviewId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - templateId = try container.decode(String.self, forKey: .templateId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(approve, forKey: .approve) - - - - try? container.encodeIfPresent(archive, forKey: .archive) - - - - try? container.encodeIfPresent(attributesRating, forKey: .attributesRating) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(deviceMeta, forKey: .deviceMeta) - - - - try? container.encodeIfPresent(entityId, forKey: .entityId) - - - - try? container.encodeIfPresent(entityType, forKey: .entityType) - - - - try? container.encodeIfPresent(mediaResource, forKey: .mediaResource) - - - - try? container.encodeIfPresent(rating, forKey: .rating) - - - - try? container.encodeIfPresent(reviewId, forKey: .reviewId) - - - - try? container.encodeIfPresent(templateId, forKey: .templateId) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - } - - } - - /* - Model: UpdateTemplateRequest - Used By: Feedback - */ - - class UpdateTemplateRequest: Codable { - - - public var active: Bool - - public var enableMediaType: String? - - public var enableQna: Bool? - - public var enableRating: Bool - - public var enableReview: Bool - - public var entity: EntityRequest - - public var rating: RatingRequest - - public var review: ReviewRequest - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case enableMediaType = "enable_media_type" - - case enableQna = "enable_qna" - - case enableRating = "enable_rating" - - case enableReview = "enable_review" - - case entity = "entity" - - case rating = "rating" - - case review = "review" - - } - - public init(active: Bool, enableMediaType: String?, enableQna: Bool?, enableRating: Bool, enableReview: Bool, entity: EntityRequest, rating: RatingRequest, review: ReviewRequest) { - - self.active = active - - self.enableMediaType = enableMediaType - - self.enableQna = enableQna - - self.enableRating = enableRating - - self.enableReview = enableReview - - self.entity = entity - - self.rating = rating - - self.review = review - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - active = try container.decode(Bool.self, forKey: .active) - - - - - do { - enableMediaType = try container.decode(String.self, forKey: .enableMediaType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enableQna = try container.decode(Bool.self, forKey: .enableQna) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - enableRating = try container.decode(Bool.self, forKey: .enableRating) - - - - - enableReview = try container.decode(Bool.self, forKey: .enableReview) - - - - - entity = try container.decode(EntityRequest.self, forKey: .entity) - - - - - rating = try container.decode(RatingRequest.self, forKey: .rating) - - - - - review = try container.decode(ReviewRequest.self, forKey: .review) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(enableMediaType, forKey: .enableMediaType) - - - - try? container.encodeIfPresent(enableQna, forKey: .enableQna) - - - - try? container.encodeIfPresent(enableRating, forKey: .enableRating) - - - - try? container.encodeIfPresent(enableReview, forKey: .enableReview) - - - - try? container.encodeIfPresent(entity, forKey: .entity) - - - - try? container.encodeIfPresent(rating, forKey: .rating) - - - - try? container.encodeIfPresent(review, forKey: .review) - - - } - - } - - /* - Model: UpdateTemplateStatusRequest - Used By: Feedback - */ - - class UpdateTemplateStatusRequest: Codable { - - - public var active: Bool? - - public var archive: Bool? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case archive = "archive" - - } - - public init(active: Bool?, archive: Bool?) { - - self.active = active - - self.archive = archive - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archive = try container.decode(Bool.self, forKey: .archive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(archive, forKey: .archive) - - - } - - } - - - - /* - Model: AvailablePageSchema - Used By: Theme - */ - - class AvailablePageSchema: Codable { - - - public var value: String? - - public var text: String? - - public var path: String? - - public var type: String? - - public var sections: [AvailablePageSchemaSections]? - - public var sectionsMeta: [AvailablePageSectionMetaAttributes]? - - public var theme: String? - - public var seo: AvailablePageSeo? - - public var props: [[String: Any]]? - - public var id: String? - - - public enum CodingKeys: String, CodingKey { - - case value = "value" - - case text = "text" - - case path = "path" - - case type = "type" - - case sections = "sections" - - case sectionsMeta = "sections_meta" - - case theme = "theme" - - case seo = "seo" - - case props = "props" - - case id = "_id" - - } - - public init(path: String?, props: [[String: Any]]?, sections: [AvailablePageSchemaSections]?, sectionsMeta: [AvailablePageSectionMetaAttributes]?, seo: AvailablePageSeo?, text: String?, theme: String?, type: String?, value: String?, id: String?) { - - self.value = value - - self.text = text - - self.path = path - - self.type = type - - self.sections = sections - - self.sectionsMeta = sectionsMeta - - self.theme = theme - - self.seo = seo - - self.props = props - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text = try container.decode(String.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - path = try container.decode(String.self, forKey: .path) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sections = try container.decode([AvailablePageSchemaSections].self, forKey: .sections) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sectionsMeta = try container.decode([AvailablePageSectionMetaAttributes].self, forKey: .sectionsMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - theme = try container.decode(String.self, forKey: .theme) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - seo = try container.decode(AvailablePageSeo.self, forKey: .seo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - props = try container.decode([[String: Any]].self, forKey: .props) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(path, forKey: .path) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(sections, forKey: .sections) - - - - try? container.encodeIfPresent(sectionsMeta, forKey: .sectionsMeta) - - - - try? container.encodeIfPresent(theme, forKey: .theme) - - - - try? container.encodeIfPresent(seo, forKey: .seo) - - - - try? container.encodeIfPresent(props, forKey: .props) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: AvailablePageSectionMetaAttributes - Used By: Theme - */ - - class AvailablePageSectionMetaAttributes: Codable { - - - public var attributes: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case attributes = "attributes" - - } - - public init(attributes: [String: Any]?) { - - self.attributes = attributes - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - attributes = try container.decode([String: Any].self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - } - - } - - /* - Model: AvailablePageSeo - Used By: Theme - */ - - class AvailablePageSeo: Codable { - - - public var title: String? - - public var description: String? - - public var id: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case description = "description" - - case id = "_id" - - } - - public init(description: String?, title: String?, id: String?) { - - self.title = title - - self.description = description - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: AvailablePageSchemaSections - Used By: Theme - */ - - class AvailablePageSchemaSections: Codable { - - - public var name: String? - - public var label: String? - - public var props: [String: Any]? - - public var blocks: [[String: Any]]? - - public var preset: [String: Any]? - - public var predicate: AvailablePagePredicate? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case label = "label" - - case props = "props" - - case blocks = "blocks" - - case preset = "preset" - - case predicate = "predicate" - - } - - public init(blocks: [[String: Any]]?, label: String?, name: String?, predicate: AvailablePagePredicate?, preset: [String: Any]?, props: [String: Any]?) { - - self.name = name - - self.label = label - - self.props = props - - self.blocks = blocks - - self.preset = preset - - self.predicate = predicate - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - label = try container.decode(String.self, forKey: .label) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - props = try container.decode([String: Any].self, forKey: .props) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - blocks = try container.decode([[String: Any]].self, forKey: .blocks) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - preset = try container.decode([String: Any].self, forKey: .preset) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - predicate = try container.decode(AvailablePagePredicate.self, forKey: .predicate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(label, forKey: .label) - - - - try? container.encodeIfPresent(props, forKey: .props) - - - - try? container.encodeIfPresent(blocks, forKey: .blocks) - - - - try? container.encodeIfPresent(preset, forKey: .preset) - - - - try? container.encodeIfPresent(predicate, forKey: .predicate) - - - } - - } - - /* - Model: AvailablePageScreenPredicate - Used By: Theme - */ - - class AvailablePageScreenPredicate: Codable { - - - public var mobile: Bool? - - public var desktop: Bool? - - public var tablet: Bool? - - - public enum CodingKeys: String, CodingKey { - - case mobile = "mobile" - - case desktop = "desktop" - - case tablet = "tablet" - - } - - public init(desktop: Bool?, mobile: Bool?, tablet: Bool?) { - - self.mobile = mobile - - self.desktop = desktop - - self.tablet = tablet - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - mobile = try container.decode(Bool.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - desktop = try container.decode(Bool.self, forKey: .desktop) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tablet = try container.decode(Bool.self, forKey: .tablet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(desktop, forKey: .desktop) - - - - try? container.encodeIfPresent(tablet, forKey: .tablet) - - - } - - } - - /* - Model: AvailablePageUserPredicate - Used By: Theme - */ - - class AvailablePageUserPredicate: Codable { - - - public var authenticated: Bool? - - public var anonymous: Bool? - - - public enum CodingKeys: String, CodingKey { - - case authenticated = "authenticated" - - case anonymous = "anonymous" - - } - - public init(anonymous: Bool?, authenticated: Bool?) { - - self.authenticated = authenticated - - self.anonymous = anonymous - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - authenticated = try container.decode(Bool.self, forKey: .authenticated) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - anonymous = try container.decode(Bool.self, forKey: .anonymous) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(authenticated, forKey: .authenticated) - - - - try? container.encodeIfPresent(anonymous, forKey: .anonymous) - - - } - - } - - /* - Model: AvailablePageRoutePredicate - Used By: Theme - */ - - class AvailablePageRoutePredicate: Codable { - - - public var selected: String? - - public var exactUrl: String? - - public var query: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case selected = "selected" - - case exactUrl = "exact_url" - - case query = "query" - - } - - public init(exactUrl: String?, query: [String: Any]?, selected: String?) { - - self.selected = selected - - self.exactUrl = exactUrl - - self.query = query - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - selected = try container.decode(String.self, forKey: .selected) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - exactUrl = try container.decode(String.self, forKey: .exactUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - query = try container.decode([String: Any].self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(selected, forKey: .selected) - - - - try? container.encodeIfPresent(exactUrl, forKey: .exactUrl) - - - - try? container.encodeIfPresent(query, forKey: .query) - - - } - - } - - /* - Model: AvailablePagePredicate - Used By: Theme - */ - - class AvailablePagePredicate: Codable { - - - public var screen: AvailablePageScreenPredicate? - - public var user: AvailablePageUserPredicate? - - public var route: AvailablePageRoutePredicate? - - - public enum CodingKeys: String, CodingKey { - - case screen = "screen" - - case user = "user" - - case route = "route" - - } - - public init(route: AvailablePageRoutePredicate?, screen: AvailablePageScreenPredicate?, user: AvailablePageUserPredicate?) { - - self.screen = screen - - self.user = user - - self.route = route - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - screen = try container.decode(AvailablePageScreenPredicate.self, forKey: .screen) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - user = try container.decode(AvailablePageUserPredicate.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - route = try container.decode(AvailablePageRoutePredicate.self, forKey: .route) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(screen, forKey: .screen) - - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(route, forKey: .route) - - - } - - } - - /* - Model: AllAvailablePageSchema - Used By: Theme - */ - - class AllAvailablePageSchema: Codable { - - - public var pages: [AvailablePageSchema]? - - - public enum CodingKeys: String, CodingKey { - - case pages = "pages" - - } - - public init(pages: [AvailablePageSchema]?) { - - self.pages = pages - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pages = try container.decode([AvailablePageSchema].self, forKey: .pages) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pages, forKey: .pages) - - - } - - } - - /* - Model: PaginationSchema - Used By: Theme - */ - - class PaginationSchema: Codable { - - - public var size: Int? - - public var itemTotal: Int? - - public var hasNext: Bool? - - public var type: String? - - public var current: Int? - - - public enum CodingKeys: String, CodingKey { - - case size = "size" - - case itemTotal = "item_total" - - case hasNext = "has_next" - - case type = "type" - - case current = "current" - - } - - public init(current: Int?, hasNext: Bool?, itemTotal: Int?, size: Int?, type: String?) { - - self.size = size - - self.itemTotal = itemTotal - - self.hasNext = hasNext - - self.type = type - - self.current = current - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - size = try container.decode(Int.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemTotal = try container.decode(Int.self, forKey: .itemTotal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasNext = try container.decode(Bool.self, forKey: .hasNext) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - current = try container.decode(Int.self, forKey: .current) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) - - - - try? container.encodeIfPresent(hasNext, forKey: .hasNext) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(current, forKey: .current) - - - } - - } - - /* - Model: ThemesListingResponseSchema - Used By: Theme - */ - - class ThemesListingResponseSchema: Codable { - - - public var items: [ThemesSchema]? - - public var page: PaginationSchema? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [ThemesSchema]?, page: PaginationSchema?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([ThemesSchema].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(PaginationSchema.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: AddThemeRequestSchema - Used By: Theme - */ - - class AddThemeRequestSchema: Codable { - - - public var themeId: String? - - - public enum CodingKeys: String, CodingKey { - - case themeId = "theme_id" - - } - - public init(themeId: String?) { - - self.themeId = themeId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - themeId = try container.decode(String.self, forKey: .themeId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(themeId, forKey: .themeId) - - - } - - } - - /* - Model: UpgradableThemeSchema - Used By: Theme - */ - - class UpgradableThemeSchema: Codable { - - - public var parentTheme: String? - - public var appliedTheme: String? - - public var upgrade: Bool? - - - public enum CodingKeys: String, CodingKey { - - case parentTheme = "parent_theme" - - case appliedTheme = "applied_theme" - - case upgrade = "upgrade" - - } - - public init(appliedTheme: String?, parentTheme: String?, upgrade: Bool?) { - - self.parentTheme = parentTheme - - self.appliedTheme = appliedTheme - - self.upgrade = upgrade - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - parentTheme = try container.decode(String.self, forKey: .parentTheme) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appliedTheme = try container.decode(String.self, forKey: .appliedTheme) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - upgrade = try container.decode(Bool.self, forKey: .upgrade) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(parentTheme, forKey: .parentTheme) - - - - try? container.encodeIfPresent(appliedTheme, forKey: .appliedTheme) - - - - try? container.encodeIfPresent(upgrade, forKey: .upgrade) - - - } - - } - - /* - Model: FontsSchema - Used By: Theme - */ - - class FontsSchema: Codable { - - - public var items: FontsSchemaItems? - - public var kind: String? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case kind = "kind" - - } - - public init(items: FontsSchemaItems?, kind: String?) { - - self.items = items - - self.kind = kind - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode(FontsSchemaItems.self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - kind = try container.decode(String.self, forKey: .kind) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(kind, forKey: .kind) - - - } - - } - - /* - Model: BlitzkriegApiErrorSchema - Used By: Theme - */ - - class BlitzkriegApiErrorSchema: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: BlitzkriegNotFoundSchema - Used By: Theme - */ - - class BlitzkriegNotFoundSchema: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: BlitzkriegInternalServerErrorSchema - Used By: Theme - */ - - class BlitzkriegInternalServerErrorSchema: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: FontsSchemaItems - Used By: Theme - */ - - class FontsSchemaItems: Codable { - - - public var family: String? - - public var variants: [String]? - - public var subsets: [String]? - - public var version: String? - - public var lastModified: String? - - public var files: FontsSchemaItemsFiles? - - public var category: String? - - public var kind: String? - - - public enum CodingKeys: String, CodingKey { - - case family = "family" - - case variants = "variants" - - case subsets = "subsets" - - case version = "version" - - case lastModified = "last_modified" - - case files = "files" - - case category = "category" - - case kind = "kind" - - } - - public init(category: String?, family: String?, files: FontsSchemaItemsFiles?, kind: String?, lastModified: String?, subsets: [String]?, variants: [String]?, version: String?) { - - self.family = family - - self.variants = variants - - self.subsets = subsets - - self.version = version - - self.lastModified = lastModified - - self.files = files - - self.category = category - - self.kind = kind - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - family = try container.decode(String.self, forKey: .family) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - variants = try container.decode([String].self, forKey: .variants) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subsets = try container.decode([String].self, forKey: .subsets) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - version = try container.decode(String.self, forKey: .version) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastModified = try container.decode(String.self, forKey: .lastModified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - files = try container.decode(FontsSchemaItemsFiles.self, forKey: .files) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - category = try container.decode(String.self, forKey: .category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - kind = try container.decode(String.self, forKey: .kind) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(family, forKey: .family) - - - - try? container.encodeIfPresent(variants, forKey: .variants) - - - - try? container.encodeIfPresent(subsets, forKey: .subsets) - - - - try? container.encodeIfPresent(version, forKey: .version) - - - - try? container.encodeIfPresent(lastModified, forKey: .lastModified) - - - - try? container.encodeIfPresent(files, forKey: .files) - - - - try? container.encodeIfPresent(category, forKey: .category) - - - - try? container.encodeIfPresent(kind, forKey: .kind) - - - } - - } - - /* - Model: FontsSchemaItemsFiles - Used By: Theme - */ - - class FontsSchemaItemsFiles: Codable { - - - public var regular: String? - - public var italic: String? - - public var bold: String? - - - public enum CodingKeys: String, CodingKey { - - case regular = "regular" - - case italic = "italic" - - case bold = "bold" - - } - - public init(bold: String?, italic: String?, regular: String?) { - - self.regular = regular - - self.italic = italic - - self.bold = bold - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - regular = try container.decode(String.self, forKey: .regular) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - italic = try container.decode(String.self, forKey: .italic) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bold = try container.decode(String.self, forKey: .bold) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(regular, forKey: .regular) - - - - try? container.encodeIfPresent(italic, forKey: .italic) - - - - try? container.encodeIfPresent(bold, forKey: .bold) - - - } - - } - - /* - Model: ThemesSchema - Used By: Theme - */ - - class ThemesSchema: Codable { - - - public var application: String? - - public var applied: Bool? - - public var customized: Bool? - - public var published: Bool? - - public var archived: Bool? - - public var createdAt: String? - - public var updatedAt: String? - - public var version: String? - - public var parentThemeVersion: String? - - public var parentTheme: String? - - public var information: Information? - - public var tags: [String]? - - public var src: Src? - - public var assets: AssetsSchema? - - public var availableSections: [availableSectionSchema]? - - public var constants: [String: Any]? - - public var styles: [String: Any]? - - public var config: Config? - - public var settings: [String: Any]? - - public var font: Font? - - public var id: String? - - public var v: Int? - - public var colors: Colors? - - - public enum CodingKeys: String, CodingKey { - - case application = "application" - - case applied = "applied" - - case customized = "customized" - - case published = "published" - - case archived = "archived" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case version = "version" - - case parentThemeVersion = "parent_theme_version" - - case parentTheme = "parent_theme" - - case information = "information" - - case tags = "tags" - - case src = "src" - - case assets = "assets" - - case availableSections = "available_sections" - - case constants = "constants" - - case styles = "styles" - - case config = "config" - - case settings = "settings" - - case font = "font" - - case id = "_id" - - case v = "__v" - - case colors = "colors" - - } - - public init(application: String?, applied: Bool?, archived: Bool?, assets: AssetsSchema?, availableSections: [availableSectionSchema]?, colors: Colors?, config: Config?, constants: [String: Any]?, createdAt: String?, customized: Bool?, font: Font?, information: Information?, parentTheme: String?, parentThemeVersion: String?, published: Bool?, settings: [String: Any]?, src: Src?, styles: [String: Any]?, tags: [String]?, updatedAt: String?, version: String?, id: String?, v: Int?) { - - self.application = application - - self.applied = applied - - self.customized = customized - - self.published = published - - self.archived = archived - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.version = version - - self.parentThemeVersion = parentThemeVersion - - self.parentTheme = parentTheme - - self.information = information - - self.tags = tags - - self.src = src - - self.assets = assets - - self.availableSections = availableSections - - self.constants = constants - - self.styles = styles - - self.config = config - - self.settings = settings - - self.font = font - - self.id = id - - self.v = v - - self.colors = colors - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - applied = try container.decode(Bool.self, forKey: .applied) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customized = try container.decode(Bool.self, forKey: .customized) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archived = try container.decode(Bool.self, forKey: .archived) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - version = try container.decode(String.self, forKey: .version) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - parentThemeVersion = try container.decode(String.self, forKey: .parentThemeVersion) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - parentTheme = try container.decode(String.self, forKey: .parentTheme) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - information = try container.decode(Information.self, forKey: .information) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - src = try container.decode(Src.self, forKey: .src) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - assets = try container.decode(AssetsSchema.self, forKey: .assets) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - availableSections = try container.decode([availableSectionSchema].self, forKey: .availableSections) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - constants = try container.decode([String: Any].self, forKey: .constants) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - styles = try container.decode([String: Any].self, forKey: .styles) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - config = try container.decode(Config.self, forKey: .config) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - settings = try container.decode([String: Any].self, forKey: .settings) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - font = try container.decode(Font.self, forKey: .font) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - colors = try container.decode(Colors.self, forKey: .colors) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(applied, forKey: .applied) - - - - try? container.encodeIfPresent(customized, forKey: .customized) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(archived, forKey: .archived) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(version, forKey: .version) - - - - try? container.encodeIfPresent(parentThemeVersion, forKey: .parentThemeVersion) - - - - try? container.encodeIfPresent(parentTheme, forKey: .parentTheme) - - - - try? container.encodeIfPresent(information, forKey: .information) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(src, forKey: .src) - - - - try? container.encodeIfPresent(assets, forKey: .assets) - - - - try? container.encodeIfPresent(availableSections, forKey: .availableSections) - - - - try? container.encodeIfPresent(constants, forKey: .constants) - - - - try? container.encodeIfPresent(styles, forKey: .styles) - - - - try? container.encodeIfPresent(config, forKey: .config) - - - - try? container.encodeIfPresent(settings, forKey: .settings) - - - - try? container.encodeIfPresent(font, forKey: .font) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - - try? container.encodeIfPresent(colors, forKey: .colors) - - - } - - } - - /* - Model: availableSectionSchema - Used By: Theme - */ - - class availableSectionSchema: Codable { - - - public var blocks: [Blocks]? - - public var name: String? - - public var label: String? - - public var props: [BlocksProps]? - - - public enum CodingKeys: String, CodingKey { - - case blocks = "blocks" - - case name = "name" - - case label = "label" - - case props = "props" - - } - - public init(blocks: [Blocks]?, label: String?, name: String?, props: [BlocksProps]?) { - - self.blocks = blocks - - self.name = name - - self.label = label - - self.props = props - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - blocks = try container.decode([Blocks].self, forKey: .blocks) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - label = try container.decode(String.self, forKey: .label) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - props = try container.decode([BlocksProps].self, forKey: .props) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(blocks, forKey: .blocks) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(label, forKey: .label) - - - - try? container.encodeIfPresent(props, forKey: .props) - - - } - - } - - /* - Model: Information - Used By: Theme - */ - - class Information: Codable { - - - public var images: Images? - - public var features: [String]? - - public var name: String? - - public var description: String? - - - public enum CodingKeys: String, CodingKey { - - case images = "images" - - case features = "features" - - case name = "name" - - case description = "description" - - } - - public init(description: String?, features: [String]?, images: Images?, name: String?) { - - self.images = images - - self.features = features - - self.name = name - - self.description = description - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - images = try container.decode(Images.self, forKey: .images) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - features = try container.decode([String].self, forKey: .features) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(images, forKey: .images) - - - - try? container.encodeIfPresent(features, forKey: .features) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - } - - } - - /* - Model: Images - Used By: Theme - */ - - class Images: Codable { - - - public var desktop: [String]? - - public var android: [String]? - - public var ios: [String]? - - public var thumbnail: [String]? - - - public enum CodingKeys: String, CodingKey { - - case desktop = "desktop" - - case android = "android" - - case ios = "ios" - - case thumbnail = "thumbnail" - - } - - public init(android: [String]?, desktop: [String]?, ios: [String]?, thumbnail: [String]?) { - - self.desktop = desktop - - self.android = android - - self.ios = ios - - self.thumbnail = thumbnail - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - desktop = try container.decode([String].self, forKey: .desktop) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - android = try container.decode([String].self, forKey: .android) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ios = try container.decode([String].self, forKey: .ios) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - thumbnail = try container.decode([String].self, forKey: .thumbnail) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(desktop, forKey: .desktop) - - - - try? container.encodeIfPresent(android, forKey: .android) - - - - try? container.encodeIfPresent(ios, forKey: .ios) - - - - try? container.encodeIfPresent(thumbnail, forKey: .thumbnail) - - - } - - } - - /* - Model: Src - Used By: Theme - */ - - class Src: Codable { - - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case link = "link" - - } - - public init(link: String?) { - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: AssetsSchema - Used By: Theme - */ - - class AssetsSchema: Codable { - - - public var umdJs: UmdJs? - - public var commonJs: CommonJs? - - public var css: Css? - - - public enum CodingKeys: String, CodingKey { - - case umdJs = "umd_js" - - case commonJs = "common_js" - - case css = "css" - - } - - public init(commonJs: CommonJs?, css: Css?, umdJs: UmdJs?) { - - self.umdJs = umdJs - - self.commonJs = commonJs - - self.css = css - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - umdJs = try container.decode(UmdJs.self, forKey: .umdJs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - commonJs = try container.decode(CommonJs.self, forKey: .commonJs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - css = try container.decode(Css.self, forKey: .css) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(umdJs, forKey: .umdJs) - - - - try? container.encodeIfPresent(commonJs, forKey: .commonJs) - - - - try? container.encodeIfPresent(css, forKey: .css) - - - } - - } - - /* - Model: UmdJs - Used By: Theme - */ - - class UmdJs: Codable { - - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case link = "link" - - } - - public init(link: String?) { - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: CommonJs - Used By: Theme - */ - - class CommonJs: Codable { - - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case link = "link" - - } - - public init(link: String?) { - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: Css - Used By: Theme - */ - - class Css: Codable { - - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case link = "link" - - } - - public init(link: String?) { - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: Seo - Used By: Theme - */ - - class Seo: Codable { - - - public var title: String? - - public var description: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case description = "description" - - } - - public init(description: String?, title: String?) { - - self.title = title - - self.description = description - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - } - - } - - /* - Model: Sections - Used By: Theme - */ - - class Sections: Codable { - - - public var attributes: String? - - - public enum CodingKeys: String, CodingKey { - - case attributes = "attributes" - - } - - public init(attributes: String?) { - - self.attributes = attributes - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - attributes = try container.decode(String.self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - } - - } - - /* - Model: Config - Used By: Theme - */ - - class Config: Codable { - - - public var preset: Preset? - - public var globalSchema: GlobalSchema? - - public var current: String? - - public var list: [ListSchemaItem]? - - - public enum CodingKeys: String, CodingKey { - - case preset = "preset" - - case globalSchema = "global_schema" - - case current = "current" - - case list = "list" - - } - - public init(current: String?, globalSchema: GlobalSchema?, list: [ListSchemaItem]?, preset: Preset?) { - - self.preset = preset - - self.globalSchema = globalSchema - - self.current = current - - self.list = list - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - preset = try container.decode(Preset.self, forKey: .preset) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - globalSchema = try container.decode(GlobalSchema.self, forKey: .globalSchema) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - current = try container.decode(String.self, forKey: .current) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - list = try container.decode([ListSchemaItem].self, forKey: .list) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(preset, forKey: .preset) - - - - try? container.encodeIfPresent(globalSchema, forKey: .globalSchema) - - - - try? container.encodeIfPresent(current, forKey: .current) - - - - try? container.encodeIfPresent(list, forKey: .list) - - - } - - } - - /* - Model: Preset - Used By: Theme - */ - - class Preset: Codable { - - - public var pages: [AvailablePageSchema]? - - - public enum CodingKeys: String, CodingKey { - - case pages = "pages" - - } - - public init(pages: [AvailablePageSchema]?) { - - self.pages = pages - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pages = try container.decode([AvailablePageSchema].self, forKey: .pages) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pages, forKey: .pages) - - - } - - } - - /* - Model: GlobalSchema - Used By: Theme - */ - - class GlobalSchema: Codable { - - - public var props: [GlobalSchemaProps]? - - - public enum CodingKeys: String, CodingKey { - - case props = "props" - - } - - public init(props: [GlobalSchemaProps]?) { - - self.props = props - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - props = try container.decode([GlobalSchemaProps].self, forKey: .props) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(props, forKey: .props) - - - } - - } - - /* - Model: ListSchemaItem - Used By: Theme - */ - - class ListSchemaItem: Codable { - - - public var global: [String: Any]? - - public var page: [ConfigPage]? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case global = "global" - - case page = "page" - - case name = "name" - - } - - public init(global: [String: Any]?, name: String?, page: [ConfigPage]?) { - - self.global = global - - self.page = page - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - global = try container.decode([String: Any].self, forKey: .global) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode([ConfigPage].self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(global, forKey: .global) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: Colors - Used By: Theme - */ - - class Colors: Codable { - - - public var bgColor: String? - - public var primaryColor: String? - - public var secondaryColor: String? - - public var accentColor: String? - - public var linkColor: String? - - public var buttonSecondaryColor: String? - - - public enum CodingKeys: String, CodingKey { - - case bgColor = "bg_color" - - case primaryColor = "primary_color" - - case secondaryColor = "secondary_color" - - case accentColor = "accent_color" - - case linkColor = "link_color" - - case buttonSecondaryColor = "button_secondary_color" - - } - - public init(accentColor: String?, bgColor: String?, buttonSecondaryColor: String?, linkColor: String?, primaryColor: String?, secondaryColor: String?) { - - self.bgColor = bgColor - - self.primaryColor = primaryColor - - self.secondaryColor = secondaryColor - - self.accentColor = accentColor - - self.linkColor = linkColor - - self.buttonSecondaryColor = buttonSecondaryColor - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - bgColor = try container.decode(String.self, forKey: .bgColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - primaryColor = try container.decode(String.self, forKey: .primaryColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - secondaryColor = try container.decode(String.self, forKey: .secondaryColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - accentColor = try container.decode(String.self, forKey: .accentColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - linkColor = try container.decode(String.self, forKey: .linkColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - buttonSecondaryColor = try container.decode(String.self, forKey: .buttonSecondaryColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(bgColor, forKey: .bgColor) - - - - try? container.encodeIfPresent(primaryColor, forKey: .primaryColor) - - - - try? container.encodeIfPresent(secondaryColor, forKey: .secondaryColor) - - - - try? container.encodeIfPresent(accentColor, forKey: .accentColor) - - - - try? container.encodeIfPresent(linkColor, forKey: .linkColor) - - - - try? container.encodeIfPresent(buttonSecondaryColor, forKey: .buttonSecondaryColor) - - - } - - } - - /* - Model: Custom - Used By: Theme - */ - - class Custom: Codable { - - - public var props: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case props = "props" - - } - - public init(props: [String: Any]?) { - - self.props = props - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - props = try container.decode([String: Any].self, forKey: .props) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(props, forKey: .props) - - - } - - } - - /* - Model: ConfigPage - Used By: Theme - */ - - class ConfigPage: Codable { - - - public var settings: [String: Any]? - - public var page: String? - - - public enum CodingKeys: String, CodingKey { - - case settings = "settings" - - case page = "page" - - } - - public init(page: String?, settings: [String: Any]?) { - - self.settings = settings - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - settings = try container.decode([String: Any].self, forKey: .settings) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(String.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(settings, forKey: .settings) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: Font - Used By: Theme - */ - - class Font: Codable { - - - public var family: String? - - public var variants: Variants? - - - public enum CodingKeys: String, CodingKey { - - case family = "family" - - case variants = "variants" - - } - - public init(family: String?, variants: Variants?) { - - self.family = family - - self.variants = variants - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - family = try container.decode(String.self, forKey: .family) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - variants = try container.decode(Variants.self, forKey: .variants) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(family, forKey: .family) - - - - try? container.encodeIfPresent(variants, forKey: .variants) - - - } - - } - - /* - Model: Variants - Used By: Theme - */ - - class Variants: Codable { - - - public var medium: Medium? - - public var semiBold: SemiBold? - - public var bold: Bold? - - public var light: Light? - - public var regular: Regular? - - - public enum CodingKeys: String, CodingKey { - - case medium = "medium" - - case semiBold = "semi_bold" - - case bold = "bold" - - case light = "light" - - case regular = "regular" - - } - - public init(bold: Bold?, light: Light?, medium: Medium?, regular: Regular?, semiBold: SemiBold?) { - - self.medium = medium - - self.semiBold = semiBold - - self.bold = bold - - self.light = light - - self.regular = regular - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - medium = try container.decode(Medium.self, forKey: .medium) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - semiBold = try container.decode(SemiBold.self, forKey: .semiBold) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bold = try container.decode(Bold.self, forKey: .bold) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - light = try container.decode(Light.self, forKey: .light) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - regular = try container.decode(Regular.self, forKey: .regular) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(medium, forKey: .medium) - - - - try? container.encodeIfPresent(semiBold, forKey: .semiBold) - - - - try? container.encodeIfPresent(bold, forKey: .bold) - - - - try? container.encodeIfPresent(light, forKey: .light) - - - - try? container.encodeIfPresent(regular, forKey: .regular) - - - } - - } - - /* - Model: Medium - Used By: Theme - */ - - class Medium: Codable { - - - public var name: String? - - public var file: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case file = "file" - - } - - public init(file: String?, name: String?) { - - self.name = name - - self.file = file - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - file = try container.decode(String.self, forKey: .file) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(file, forKey: .file) - - - } - - } - - /* - Model: SemiBold - Used By: Theme - */ - - class SemiBold: Codable { - - - public var name: String? - - public var file: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case file = "file" - - } - - public init(file: String?, name: String?) { - - self.name = name - - self.file = file - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - file = try container.decode(String.self, forKey: .file) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(file, forKey: .file) - - - } - - } - - /* - Model: Bold - Used By: Theme - */ - - class Bold: Codable { - - - public var name: String? - - public var file: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case file = "file" - - } - - public init(file: String?, name: String?) { - - self.name = name - - self.file = file - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - file = try container.decode(String.self, forKey: .file) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(file, forKey: .file) - - - } - - } - - /* - Model: Light - Used By: Theme - */ - - class Light: Codable { - - - public var name: String? - - public var file: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case file = "file" - - } - - public init(file: String?, name: String?) { - - self.name = name - - self.file = file - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - file = try container.decode(String.self, forKey: .file) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(file, forKey: .file) - - - } - - } - - /* - Model: Regular - Used By: Theme - */ - - class Regular: Codable { - - - public var name: String? - - public var file: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case file = "file" - - } - - public init(file: String?, name: String?) { - - self.name = name - - self.file = file - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - file = try container.decode(String.self, forKey: .file) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(file, forKey: .file) - - - } - - } - - /* - Model: Blocks - Used By: Theme - */ - - class Blocks: Codable { - - - public var type: String? - - public var name: String? - - public var props: [BlocksProps]? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case name = "name" - - case props = "props" - - } - - public init(name: String?, props: [BlocksProps]?, type: String?) { - - self.type = type - - self.name = name - - self.props = props - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - props = try container.decode([BlocksProps].self, forKey: .props) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(props, forKey: .props) - - - } - - } - - /* - Model: GlobalSchemaProps - Used By: Theme - */ - - class GlobalSchemaProps: Codable { - - - public var id: String? - - public var label: String? - - public var type: String? - - public var category: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case label = "label" - - case type = "type" - - case category = "category" - - } - - public init(category: String?, id: String?, label: String?, type: String?) { - - self.id = id - - self.label = label - - self.type = type - - self.category = category - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - label = try container.decode(String.self, forKey: .label) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - category = try container.decode(String.self, forKey: .category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(label, forKey: .label) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(category, forKey: .category) - - - } - - } - - /* - Model: BlocksProps - Used By: Theme - */ - - class BlocksProps: Codable { - - - public var id: String? - - public var label: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case label = "label" - - case type = "type" - - } - - public init(id: String?, label: String?, type: String?) { - - self.id = id - - self.label = label - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - label = try container.decode(String.self, forKey: .label) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(label, forKey: .label) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - - - /* - Model: EditEmailRequestSchema - Used By: User - */ - - class EditEmailRequestSchema: Codable { - - - public var email: String? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - } - - public init(email: String?) { - - self.email = email - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - } - - } - - /* - Model: SendVerificationLinkMobileRequestSchema - Used By: User - */ - - class SendVerificationLinkMobileRequestSchema: Codable { - - - public var verified: Bool? - - public var active: Bool? - - public var countryCode: String? - - public var phone: String? - - public var primary: Bool? - - - public enum CodingKeys: String, CodingKey { - - case verified = "verified" - - case active = "active" - - case countryCode = "country_code" - - case phone = "phone" - - case primary = "primary" - - } - - public init(active: Bool?, countryCode: String?, phone: String?, primary: Bool?, verified: Bool?) { - - self.verified = verified - - self.active = active - - self.countryCode = countryCode - - self.phone = phone - - self.primary = primary - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - verified = try container.decode(Bool.self, forKey: .verified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - primary = try container.decode(Bool.self, forKey: .primary) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(verified, forKey: .verified) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(primary, forKey: .primary) - - - } - - } - - /* - Model: EditMobileRequestSchema - Used By: User - */ - - class EditMobileRequestSchema: Codable { - - - public var countryCode: String? - - public var phone: String? - - - public enum CodingKeys: String, CodingKey { - - case countryCode = "country_code" - - case phone = "phone" - - } - - public init(countryCode: String?, phone: String?) { - - self.countryCode = countryCode - - self.phone = phone - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - } - - } - - /* - Model: EditProfileRequestSchema - Used By: User - */ - - class EditProfileRequestSchema: Codable { - - - public var firstName: String? - - public var lastName: String? - - public var mobile: EditProfileMobileSchema? - - public var countryCode: String? - - public var email: String? - - public var gender: String? - - public var dob: String? - - public var profilePicUrl: String? - - public var androidHash: String? - - public var sender: String? - - public var registerToken: String? - - - public enum CodingKeys: String, CodingKey { - - case firstName = "first_name" - - case lastName = "last_name" - - case mobile = "mobile" - - case countryCode = "country_code" - - case email = "email" - - case gender = "gender" - - case dob = "dob" - - case profilePicUrl = "profile_pic_url" - - case androidHash = "android_hash" - - case sender = "sender" - - case registerToken = "register_token" - - } - - public init(androidHash: String?, countryCode: String?, dob: String?, email: String?, firstName: String?, gender: String?, lastName: String?, mobile: EditProfileMobileSchema?, profilePicUrl: String?, registerToken: String?, sender: String?) { - - self.firstName = firstName - - self.lastName = lastName - - self.mobile = mobile - - self.countryCode = countryCode - - self.email = email - - self.gender = gender - - self.dob = dob - - self.profilePicUrl = profilePicUrl - - self.androidHash = androidHash - - self.sender = sender - - self.registerToken = registerToken - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobile = try container.decode(EditProfileMobileSchema.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gender = try container.decode(String.self, forKey: .gender) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dob = try container.decode(String.self, forKey: .dob) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - profilePicUrl = try container.decode(String.self, forKey: .profilePicUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - androidHash = try container.decode(String.self, forKey: .androidHash) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sender = try container.decode(String.self, forKey: .sender) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(gender, forKey: .gender) - - - - try? container.encodeIfPresent(dob, forKey: .dob) - - - - try? container.encodeIfPresent(profilePicUrl, forKey: .profilePicUrl) - - - - try? container.encodeIfPresent(androidHash, forKey: .androidHash) - - - - try? container.encodeIfPresent(sender, forKey: .sender) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - } - - } - - /* - Model: EditProfileMobileSchema - Used By: User - */ - - class EditProfileMobileSchema: Codable { - - - public var phone: String? - - public var countryCode: String? - - - public enum CodingKeys: String, CodingKey { - - case phone = "phone" - - case countryCode = "country_code" - - } - - public init(countryCode: String?, phone: String?) { - - self.phone = phone - - self.countryCode = countryCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - } - - } - - /* - Model: SendEmailOtpRequestSchema - Used By: User - */ - - class SendEmailOtpRequestSchema: Codable { - - - public var email: String? - - public var action: String? - - public var token: String? - - public var registerToken: String? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case action = "action" - - case token = "token" - - case registerToken = "register_token" - - } - - public init(action: String?, email: String?, registerToken: String?, token: String?) { - - self.email = email - - self.action = action - - self.token = token - - self.registerToken = registerToken - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(String.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - token = try container.decode(String.self, forKey: .token) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(token, forKey: .token) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - } - - } - - /* - Model: VerifyEmailOtpRequestSchema - Used By: User - */ - - class VerifyEmailOtpRequestSchema: Codable { - - - public var email: String? - - public var action: String? - - public var registerToken: String? - - public var otp: String? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case action = "action" - - case registerToken = "register_token" - - case otp = "otp" - - } - - public init(action: String?, email: String?, otp: String?, registerToken: String?) { - - self.email = email - - self.action = action - - self.registerToken = registerToken - - self.otp = otp - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(String.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - otp = try container.decode(String.self, forKey: .otp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - - try? container.encodeIfPresent(otp, forKey: .otp) - - - } - - } - - /* - Model: VerifyOtpRequestSchema - Used By: User - */ - - class VerifyOtpRequestSchema: Codable { - - - public var requestId: String? - - public var registerToken: String? - - public var otp: String? - - - public enum CodingKeys: String, CodingKey { - - case requestId = "request_id" - - case registerToken = "register_token" - - case otp = "otp" - - } - - public init(otp: String?, registerToken: String?, requestId: String?) { - - self.requestId = requestId - - self.registerToken = registerToken - - self.otp = otp - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - requestId = try container.decode(String.self, forKey: .requestId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - otp = try container.decode(String.self, forKey: .otp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - - try? container.encodeIfPresent(otp, forKey: .otp) - - - } - - } - - /* - Model: SendMobileOtpRequestSchema - Used By: User - */ - - class SendMobileOtpRequestSchema: Codable { - - - public var mobile: String? - - public var countryCode: String? - - public var action: String? - - public var token: String? - - public var androidHash: String? - - public var force: String? - - public var captchaCode: String? - - - public enum CodingKeys: String, CodingKey { - - case mobile = "mobile" - - case countryCode = "country_code" - - case action = "action" - - case token = "token" - - case androidHash = "android_hash" - - case force = "force" - - case captchaCode = "captcha_code" - - } - - public init(action: String?, androidHash: String?, captchaCode: String?, countryCode: String?, force: String?, mobile: String?, token: String?) { - - self.mobile = mobile - - self.countryCode = countryCode - - self.action = action - - self.token = token - - self.androidHash = androidHash - - self.force = force - - self.captchaCode = captchaCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - mobile = try container.decode(String.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(String.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - token = try container.decode(String.self, forKey: .token) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - androidHash = try container.decode(String.self, forKey: .androidHash) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - force = try container.decode(String.self, forKey: .force) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - captchaCode = try container.decode(String.self, forKey: .captchaCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(token, forKey: .token) - - - - try? container.encodeIfPresent(androidHash, forKey: .androidHash) - - - - try? container.encodeIfPresent(force, forKey: .force) - - - - try? container.encodeIfPresent(captchaCode, forKey: .captchaCode) - - - } - - } - - /* - Model: UpdatePasswordRequestSchema - Used By: User - */ - - class UpdatePasswordRequestSchema: Codable { - - - public var oldPassword: String? - - public var newPassword: String? - - - public enum CodingKeys: String, CodingKey { - - case oldPassword = "old_password" - - case newPassword = "new_password" - - } - - public init(newPassword: String?, oldPassword: String?) { - - self.oldPassword = oldPassword - - self.newPassword = newPassword - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - oldPassword = try container.decode(String.self, forKey: .oldPassword) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - newPassword = try container.decode(String.self, forKey: .newPassword) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(oldPassword, forKey: .oldPassword) - - - - try? container.encodeIfPresent(newPassword, forKey: .newPassword) - - - } - - } - - /* - Model: FormRegisterRequestSchema - Used By: User - */ - - class FormRegisterRequestSchema: Codable { - - - public var firstName: String? - - public var lastName: String? - - public var gender: String? - - public var email: String? - - public var password: String? - - public var phone: FormRegisterRequestSchemaPhone? - - public var registerToken: String? - - - public enum CodingKeys: String, CodingKey { - - case firstName = "first_name" - - case lastName = "last_name" - - case gender = "gender" - - case email = "email" - - case password = "password" - - case phone = "phone" - - case registerToken = "register_token" - - } - - public init(email: String?, firstName: String?, gender: String?, lastName: String?, password: String?, phone: FormRegisterRequestSchemaPhone?, registerToken: String?) { - - self.firstName = firstName - - self.lastName = lastName - - self.gender = gender - - self.email = email - - self.password = password - - self.phone = phone - - self.registerToken = registerToken - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gender = try container.decode(String.self, forKey: .gender) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - password = try container.decode(String.self, forKey: .password) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(FormRegisterRequestSchemaPhone.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(gender, forKey: .gender) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(password, forKey: .password) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - } - - } - - /* - Model: TokenRequestBodySchema - Used By: User - */ - - class TokenRequestBodySchema: Codable { - - - public var token: String? - - - public enum CodingKeys: String, CodingKey { - - case token = "token" - - } - - public init(token: String?) { - - self.token = token - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - token = try container.decode(String.self, forKey: .token) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(token, forKey: .token) - - - } - - } - - /* - Model: ForgotPasswordRequestSchema - Used By: User - */ - - class ForgotPasswordRequestSchema: Codable { - - - public var code: String? - - public var password: String? - - - public enum CodingKeys: String, CodingKey { - - case code = "code" - - case password = "password" - - } - - public init(code: String?, password: String?) { - - self.code = code - - self.password = password - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - password = try container.decode(String.self, forKey: .password) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(password, forKey: .password) - - - } - - } - - /* - Model: CodeRequestBodySchema - Used By: User - */ - - class CodeRequestBodySchema: Codable { - - - public var code: String? - - - public enum CodingKeys: String, CodingKey { - - case code = "code" - - } - - public init(code: String?) { - - self.code = code - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(code, forKey: .code) - - - } - - } - - /* - Model: SendResetPasswordEmailRequestSchema - Used By: User - */ - - class SendResetPasswordEmailRequestSchema: Codable { - - - public var email: String? - - public var captchaCode: String? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case captchaCode = "captcha_code" - - } - - public init(captchaCode: String?, email: String?) { - - self.email = email - - self.captchaCode = captchaCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - captchaCode = try container.decode(String.self, forKey: .captchaCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(captchaCode, forKey: .captchaCode) - - - } - - } - - /* - Model: PasswordLoginRequestSchema - Used By: User - */ - - class PasswordLoginRequestSchema: Codable { - - - public var captchaCode: String? - - public var password: String? - - public var username: String? - - - public enum CodingKeys: String, CodingKey { - - case captchaCode = "captcha_code" - - case password = "password" - - case username = "username" - - } - - public init(captchaCode: String?, password: String?, username: String?) { - - self.captchaCode = captchaCode - - self.password = password - - self.username = username - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - captchaCode = try container.decode(String.self, forKey: .captchaCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - password = try container.decode(String.self, forKey: .password) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - username = try container.decode(String.self, forKey: .username) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(captchaCode, forKey: .captchaCode) - - - - try? container.encodeIfPresent(password, forKey: .password) - - - - try? container.encodeIfPresent(username, forKey: .username) - - - } - - } - - /* - Model: SendOtpRequestSchema - Used By: User - */ - - class SendOtpRequestSchema: Codable { - - - public var countryCode: String? - - public var captchaCode: String? - - public var mobile: String? - - - public enum CodingKeys: String, CodingKey { - - case countryCode = "country_code" - - case captchaCode = "captcha_code" - - case mobile = "mobile" - - } - - public init(captchaCode: String?, countryCode: String?, mobile: String?) { - - self.countryCode = countryCode - - self.captchaCode = captchaCode - - self.mobile = mobile - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - captchaCode = try container.decode(String.self, forKey: .captchaCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobile = try container.decode(String.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(captchaCode, forKey: .captchaCode) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - } - - } - - /* - Model: OAuthRequestSchema - Used By: User - */ - - class OAuthRequestSchema: Codable { - - - public var isSignedIn: Bool? - - public var oauth2: OAuthRequestSchemaOauth2? - - public var profile: OAuthRequestSchemaProfile? - - - public enum CodingKeys: String, CodingKey { - - case isSignedIn = "is_signed_in" - - case oauth2 = "oauth2" - - case profile = "profile" - - } - - public init(isSignedIn: Bool?, oauth2: OAuthRequestSchemaOauth2?, profile: OAuthRequestSchemaProfile?) { - - self.isSignedIn = isSignedIn - - self.oauth2 = oauth2 - - self.profile = profile - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isSignedIn = try container.decode(Bool.self, forKey: .isSignedIn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - oauth2 = try container.decode(OAuthRequestSchemaOauth2.self, forKey: .oauth2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - profile = try container.decode(OAuthRequestSchemaProfile.self, forKey: .profile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isSignedIn, forKey: .isSignedIn) - - - - try? container.encodeIfPresent(oauth2, forKey: .oauth2) - - - - try? container.encodeIfPresent(profile, forKey: .profile) - - - } - - } - - /* - Model: UserObjectSchema - Used By: User - */ - - class UserObjectSchema: Codable { - - - public var user: UserSchema? - - - public enum CodingKeys: String, CodingKey { - - case user = "user" - - } - - public init(user: UserSchema?) { - - self.user = user - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - user = try container.decode(UserSchema.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(user, forKey: .user) - - - } - - } - - /* - Model: AuthSuccess - Used By: User - */ - - class AuthSuccess: Codable { - - - public var registerToken: String? - - public var userExists: Bool? - - public var user: UserSchema? - - - public enum CodingKeys: String, CodingKey { - - case registerToken = "register_token" - - case userExists = "user_exists" - - case user = "user" - - } - - public init(registerToken: String?, user: UserSchema?, userExists: Bool?) { - - self.registerToken = registerToken - - self.userExists = userExists - - self.user = user - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userExists = try container.decode(Bool.self, forKey: .userExists) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - user = try container.decode(UserSchema.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - - try? container.encodeIfPresent(userExists, forKey: .userExists) - - - - try? container.encodeIfPresent(user, forKey: .user) - - - } - - } - - /* - Model: SendOtpResponse - Used By: User - */ - - class SendOtpResponse: Codable { - - - public var resendTimer: Int? - - public var resendToken: String? - - public var success: Bool? - - public var requestId: String? - - public var message: String? - - public var mobile: String? - - public var countryCode: String? - - public var email: String? - - public var resendEmailToken: String? - - public var registerToken: String? - - public var verifyEmailOtp: Bool? - - public var verifyMobileOtp: Bool? - - public var userExists: Bool? - - - public enum CodingKeys: String, CodingKey { - - case resendTimer = "resend_timer" - - case resendToken = "resend_token" - - case success = "success" - - case requestId = "request_id" - - case message = "message" - - case mobile = "mobile" - - case countryCode = "country_code" - - case email = "email" - - case resendEmailToken = "resend_email_token" - - case registerToken = "register_token" - - case verifyEmailOtp = "verify_email_otp" - - case verifyMobileOtp = "verify_mobile_otp" - - case userExists = "user_exists" - - } - - public init(countryCode: String?, email: String?, message: String?, mobile: String?, registerToken: String?, requestId: String?, resendEmailToken: String?, resendTimer: Int?, resendToken: String?, success: Bool?, userExists: Bool?, verifyEmailOtp: Bool?, verifyMobileOtp: Bool?) { - - self.resendTimer = resendTimer - - self.resendToken = resendToken - - self.success = success - - self.requestId = requestId - - self.message = message - - self.mobile = mobile - - self.countryCode = countryCode - - self.email = email - - self.resendEmailToken = resendEmailToken - - self.registerToken = registerToken - - self.verifyEmailOtp = verifyEmailOtp - - self.verifyMobileOtp = verifyMobileOtp - - self.userExists = userExists - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - resendTimer = try container.decode(Int.self, forKey: .resendTimer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - resendToken = try container.decode(String.self, forKey: .resendToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requestId = try container.decode(String.self, forKey: .requestId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobile = try container.decode(String.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - resendEmailToken = try container.decode(String.self, forKey: .resendEmailToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyEmailOtp = try container.decode(Bool.self, forKey: .verifyEmailOtp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyMobileOtp = try container.decode(Bool.self, forKey: .verifyMobileOtp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userExists = try container.decode(Bool.self, forKey: .userExists) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(resendTimer, forKey: .resendTimer) - - - - try? container.encodeIfPresent(resendToken, forKey: .resendToken) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(resendEmailToken, forKey: .resendEmailToken) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - - try? container.encodeIfPresent(verifyEmailOtp, forKey: .verifyEmailOtp) - - - - try? container.encodeIfPresent(verifyMobileOtp, forKey: .verifyMobileOtp) - - - - try? container.encodeIfPresent(userExists, forKey: .userExists) - - - } - - } - - /* - Model: ProfileEditSuccess - Used By: User - */ - - class ProfileEditSuccess: Codable { - - - public var user: UserSchema? - - public var registerToken: String? - - public var userExists: Bool? - - public var verifyEmailLink: Bool? - - public var verifyEmailOtp: Bool? - - public var verifyMobileOtp: Bool? - - public var email: String? - - - public enum CodingKeys: String, CodingKey { - - case user = "user" - - case registerToken = "register_token" - - case userExists = "user_exists" - - case verifyEmailLink = "verify_email_link" - - case verifyEmailOtp = "verify_email_otp" - - case verifyMobileOtp = "verify_mobile_otp" - - case email = "email" - - } - - public init(email: String?, registerToken: String?, user: UserSchema?, userExists: Bool?, verifyEmailLink: Bool?, verifyEmailOtp: Bool?, verifyMobileOtp: Bool?) { - - self.user = user - - self.registerToken = registerToken - - self.userExists = userExists - - self.verifyEmailLink = verifyEmailLink - - self.verifyEmailOtp = verifyEmailOtp - - self.verifyMobileOtp = verifyMobileOtp - - self.email = email - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - user = try container.decode(UserSchema.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userExists = try container.decode(Bool.self, forKey: .userExists) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyEmailLink = try container.decode(Bool.self, forKey: .verifyEmailLink) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyEmailOtp = try container.decode(Bool.self, forKey: .verifyEmailOtp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyMobileOtp = try container.decode(Bool.self, forKey: .verifyMobileOtp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - - try? container.encodeIfPresent(userExists, forKey: .userExists) - - - - try? container.encodeIfPresent(verifyEmailLink, forKey: .verifyEmailLink) - - - - try? container.encodeIfPresent(verifyEmailOtp, forKey: .verifyEmailOtp) - - - - try? container.encodeIfPresent(verifyMobileOtp, forKey: .verifyMobileOtp) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - } - - } - - /* - Model: LoginSuccess - Used By: User - */ - - class LoginSuccess: Codable { - - - public var user: UserSchema? - - public var requestId: String? - - public var registerToken: String? - - - public enum CodingKeys: String, CodingKey { - - case user = "user" - - case requestId = "request_id" - - case registerToken = "register_token" - - } - - public init(registerToken: String?, requestId: String?, user: UserSchema?) { - - self.user = user - - self.requestId = requestId - - self.registerToken = registerToken - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - user = try container.decode(UserSchema.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requestId = try container.decode(String.self, forKey: .requestId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - } - - } - - /* - Model: VerifyOtpSuccess - Used By: User - */ - - class VerifyOtpSuccess: Codable { - - - public var user: UserSchema? - - public var userExists: Bool? - - public var registerToken: String? - - - public enum CodingKeys: String, CodingKey { - - case user = "user" - - case userExists = "user_exists" - - case registerToken = "register_token" - - } - - public init(registerToken: String?, user: UserSchema?, userExists: Bool?) { - - self.user = user - - self.userExists = userExists - - self.registerToken = registerToken - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - user = try container.decode(UserSchema.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userExists = try container.decode(Bool.self, forKey: .userExists) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(userExists, forKey: .userExists) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - } - - } - - /* - Model: ResetPasswordSuccess - Used By: User - */ - - class ResetPasswordSuccess: Codable { - - - public var status: String? - - - public enum CodingKeys: String, CodingKey { - - case status = "status" - - } - - public init(status: String?) { - - self.status = status - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(status, forKey: .status) - - - } - - } - - /* - Model: RegisterFormSuccess - Used By: User - */ - - class RegisterFormSuccess: Codable { - - - public var email: String? - - public var resendTimer: Int? - - public var resendToken: String? - - public var resendEmailToken: String? - - public var registerToken: String? - - public var success: Bool? - - public var requestId: String? - - public var message: String? - - public var mobile: String? - - public var countryCode: String? - - public var verifyEmailOtp: Bool? - - public var verifyMobileOtp: Bool? - - public var userExists: Bool? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case resendTimer = "resend_timer" - - case resendToken = "resend_token" - - case resendEmailToken = "resend_email_token" - - case registerToken = "register_token" - - case success = "success" - - case requestId = "request_id" - - case message = "message" - - case mobile = "mobile" - - case countryCode = "country_code" - - case verifyEmailOtp = "verify_email_otp" - - case verifyMobileOtp = "verify_mobile_otp" - - case userExists = "user_exists" - - } - - public init(countryCode: String?, email: String?, message: String?, mobile: String?, registerToken: String?, requestId: String?, resendEmailToken: String?, resendTimer: Int?, resendToken: String?, success: Bool?, userExists: Bool?, verifyEmailOtp: Bool?, verifyMobileOtp: Bool?) { - - self.email = email - - self.resendTimer = resendTimer - - self.resendToken = resendToken - - self.resendEmailToken = resendEmailToken - - self.registerToken = registerToken - - self.success = success - - self.requestId = requestId - - self.message = message - - self.mobile = mobile - - self.countryCode = countryCode - - self.verifyEmailOtp = verifyEmailOtp - - self.verifyMobileOtp = verifyMobileOtp - - self.userExists = userExists - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - resendTimer = try container.decode(Int.self, forKey: .resendTimer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - resendToken = try container.decode(String.self, forKey: .resendToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - resendEmailToken = try container.decode(String.self, forKey: .resendEmailToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requestId = try container.decode(String.self, forKey: .requestId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobile = try container.decode(String.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyEmailOtp = try container.decode(Bool.self, forKey: .verifyEmailOtp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyMobileOtp = try container.decode(Bool.self, forKey: .verifyMobileOtp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userExists = try container.decode(Bool.self, forKey: .userExists) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(resendTimer, forKey: .resendTimer) - - - - try? container.encodeIfPresent(resendToken, forKey: .resendToken) - - - - try? container.encodeIfPresent(resendEmailToken, forKey: .resendEmailToken) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(verifyEmailOtp, forKey: .verifyEmailOtp) - - - - try? container.encodeIfPresent(verifyMobileOtp, forKey: .verifyMobileOtp) - - - - try? container.encodeIfPresent(userExists, forKey: .userExists) - - - } - - } - - /* - Model: VerifyEmailSuccess - Used By: User - */ - - class VerifyEmailSuccess: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: HasPasswordSuccess - Used By: User - */ - - class HasPasswordSuccess: Codable { - - - public var result: Bool? - - - public enum CodingKeys: String, CodingKey { - - case result = "result" - - } - - public init(result: Bool?) { - - self.result = result - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - result = try container.decode(Bool.self, forKey: .result) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(result, forKey: .result) - - - } - - } - - /* - Model: LogoutSuccess - Used By: User - */ - - class LogoutSuccess: Codable { - - - public var logout: Bool? - - - public enum CodingKeys: String, CodingKey { - - case logout = "logout" - - } - - public init(logout: Bool?) { - - self.logout = logout - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - logout = try container.decode(Bool.self, forKey: .logout) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(logout, forKey: .logout) - - - } - - } - - /* - Model: OtpSuccess - Used By: User - */ - - class OtpSuccess: Codable { - - - public var resendTimer: Int? - - public var resendToken: String? - - public var registerToken: String? - - public var success: Bool? - - public var requestId: String? - - public var message: String? - - public var mobile: String? - - public var countryCode: String? - - - public enum CodingKeys: String, CodingKey { - - case resendTimer = "resend_timer" - - case resendToken = "resend_token" - - case registerToken = "register_token" - - case success = "success" - - case requestId = "request_id" - - case message = "message" - - case mobile = "mobile" - - case countryCode = "country_code" - - } - - public init(countryCode: String?, message: String?, mobile: String?, registerToken: String?, requestId: String?, resendTimer: Int?, resendToken: String?, success: Bool?) { - - self.resendTimer = resendTimer - - self.resendToken = resendToken - - self.registerToken = registerToken - - self.success = success - - self.requestId = requestId - - self.message = message - - self.mobile = mobile - - self.countryCode = countryCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - resendTimer = try container.decode(Int.self, forKey: .resendTimer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - resendToken = try container.decode(String.self, forKey: .resendToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requestId = try container.decode(String.self, forKey: .requestId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobile = try container.decode(String.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(resendTimer, forKey: .resendTimer) - - - - try? container.encodeIfPresent(resendToken, forKey: .resendToken) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - } - - } - - /* - Model: EmailOtpSuccess - Used By: User - */ - - class EmailOtpSuccess: Codable { - - - public var success: Bool? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - } - - public init(success: Bool?) { - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: SessionListSuccess - Used By: User - */ - - class SessionListSuccess: Codable { - - - public var sessions: [String]? - - - public enum CodingKeys: String, CodingKey { - - case sessions = "sessions" - - } - - public init(sessions: [String]?) { - - self.sessions = sessions - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - sessions = try container.decode([String].self, forKey: .sessions) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(sessions, forKey: .sessions) - - - } - - } - - /* - Model: VerifyMobileOTPSuccess - Used By: User - */ - - class VerifyMobileOTPSuccess: Codable { - - - public var user: UserSchema? - - public var verifyMobileLink: Bool? - - - public enum CodingKeys: String, CodingKey { - - case user = "user" - - case verifyMobileLink = "verify_mobile_link" - - } - - public init(user: UserSchema?, verifyMobileLink: Bool?) { - - self.user = user - - self.verifyMobileLink = verifyMobileLink - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - user = try container.decode(UserSchema.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyMobileLink = try container.decode(Bool.self, forKey: .verifyMobileLink) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(verifyMobileLink, forKey: .verifyMobileLink) - - - } - - } - - /* - Model: VerifyEmailOTPSuccess - Used By: User - */ - - class VerifyEmailOTPSuccess: Codable { - - - public var user: UserSchema? - - public var verifyEmailLink: Bool? - - - public enum CodingKeys: String, CodingKey { - - case user = "user" - - case verifyEmailLink = "verify_email_link" - - } - - public init(user: UserSchema?, verifyEmailLink: Bool?) { - - self.user = user - - self.verifyEmailLink = verifyEmailLink - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - user = try container.decode(UserSchema.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyEmailLink = try container.decode(Bool.self, forKey: .verifyEmailLink) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(verifyEmailLink, forKey: .verifyEmailLink) - - - } - - } - - /* - Model: SendMobileVerifyLinkSuccess - Used By: User - */ - - class SendMobileVerifyLinkSuccess: Codable { - - - public var verifyMobileLink: Bool? - - - public enum CodingKeys: String, CodingKey { - - case verifyMobileLink = "verify_mobile_link" - - } - - public init(verifyMobileLink: Bool?) { - - self.verifyMobileLink = verifyMobileLink - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - verifyMobileLink = try container.decode(Bool.self, forKey: .verifyMobileLink) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(verifyMobileLink, forKey: .verifyMobileLink) - - - } - - } - - /* - Model: SendEmailVerifyLinkSuccess - Used By: User - */ - - class SendEmailVerifyLinkSuccess: Codable { - - - public var verifyEmailLink: Bool? - - - public enum CodingKeys: String, CodingKey { - - case verifyEmailLink = "verify_email_link" - - } - - public init(verifyEmailLink: Bool?) { - - self.verifyEmailLink = verifyEmailLink - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - verifyEmailLink = try container.decode(Bool.self, forKey: .verifyEmailLink) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(verifyEmailLink, forKey: .verifyEmailLink) - - - } - - } - - /* - Model: UserSearchResponseSchema - Used By: User - */ - - class UserSearchResponseSchema: Codable { - - - public var users: [UserSchema]? - - - public enum CodingKeys: String, CodingKey { - - case users = "users" - - } - - public init(users: [UserSchema]?) { - - self.users = users - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - users = try container.decode([UserSchema].self, forKey: .users) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(users, forKey: .users) - - - } - - } - - /* - Model: CustomerListResponseSchema - Used By: User - */ - - class CustomerListResponseSchema: Codable { - - - public var items: [UserSchema]? - - public var page: PaginationSchema? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [UserSchema]?, page: PaginationSchema?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([UserSchema].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(PaginationSchema.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: UnauthorizedSchema - Used By: User - */ - - class UnauthorizedSchema: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: UnauthenticatedSchema - Used By: User - */ - - class UnauthenticatedSchema: Codable { - - - public var authenticated: Bool? - - - public enum CodingKeys: String, CodingKey { - - case authenticated = "authenticated" - - } - - public init(authenticated: Bool?) { - - self.authenticated = authenticated - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - authenticated = try container.decode(Bool.self, forKey: .authenticated) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(authenticated, forKey: .authenticated) - - - } - - } - - /* - Model: NotFoundSchema - Used By: User - */ - - class NotFoundSchema: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: AuthenticationInternalServerErrorSchema - Used By: User - */ - - class AuthenticationInternalServerErrorSchema: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: AuthenticationApiErrorSchema - Used By: User - */ - - class AuthenticationApiErrorSchema: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: ProfileEditSuccessSchema - Used By: User - */ - - class ProfileEditSuccessSchema: Codable { - - - public var email: String? - - public var verifyEmailOtp: Bool? - - public var verifyEmailLink: Bool? - - public var verifyMobileOtp: Bool? - - public var user: String? - - public var registerToken: String? - - public var userExists: Bool? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case verifyEmailOtp = "verify_email_otp" - - case verifyEmailLink = "verify_email_link" - - case verifyMobileOtp = "verify_mobile_otp" - - case user = "user" - - case registerToken = "register_token" - - case userExists = "user_exists" - - } - - public init(email: String?, registerToken: String?, user: String?, userExists: Bool?, verifyEmailLink: Bool?, verifyEmailOtp: Bool?, verifyMobileOtp: Bool?) { - - self.email = email - - self.verifyEmailOtp = verifyEmailOtp - - self.verifyEmailLink = verifyEmailLink - - self.verifyMobileOtp = verifyMobileOtp - - self.user = user - - self.registerToken = registerToken - - self.userExists = userExists - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyEmailOtp = try container.decode(Bool.self, forKey: .verifyEmailOtp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyEmailLink = try container.decode(Bool.self, forKey: .verifyEmailLink) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifyMobileOtp = try container.decode(Bool.self, forKey: .verifyMobileOtp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - user = try container.decode(String.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerToken = try container.decode(String.self, forKey: .registerToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userExists = try container.decode(Bool.self, forKey: .userExists) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(verifyEmailOtp, forKey: .verifyEmailOtp) - - - - try? container.encodeIfPresent(verifyEmailLink, forKey: .verifyEmailLink) - - - - try? container.encodeIfPresent(verifyMobileOtp, forKey: .verifyMobileOtp) - - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(registerToken, forKey: .registerToken) - - - - try? container.encodeIfPresent(userExists, forKey: .userExists) - - - } - - } - - /* - Model: FormRegisterRequestSchemaPhone - Used By: User - */ - - class FormRegisterRequestSchemaPhone: Codable { - - - public var countryCode: String? - - public var mobile: String? - - - public enum CodingKeys: String, CodingKey { - - case countryCode = "country_code" - - case mobile = "mobile" - - } - - public init(countryCode: String?, mobile: String?) { - - self.countryCode = countryCode - - self.mobile = mobile - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobile = try container.decode(String.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - } - - } - - /* - Model: OAuthRequestSchemaOauth2 - Used By: User - */ - - class OAuthRequestSchemaOauth2: Codable { - - - public var accessToken: String? - - public var expiry: Int? - - public var refreshToken: String? - - - public enum CodingKeys: String, CodingKey { - - case accessToken = "access_token" - - case expiry = "expiry" - - case refreshToken = "refresh_token" - - } - - public init(accessToken: String?, expiry: Int?, refreshToken: String?) { - - self.accessToken = accessToken - - self.expiry = expiry - - self.refreshToken = refreshToken - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - accessToken = try container.decode(String.self, forKey: .accessToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expiry = try container.decode(Int.self, forKey: .expiry) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refreshToken = try container.decode(String.self, forKey: .refreshToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(accessToken, forKey: .accessToken) - - - - try? container.encodeIfPresent(expiry, forKey: .expiry) - - - - try? container.encodeIfPresent(refreshToken, forKey: .refreshToken) - - - } - - } - - /* - Model: OAuthRequestSchemaProfile - Used By: User - */ - - class OAuthRequestSchemaProfile: Codable { - - - public var lastName: String? - - public var image: String? - - public var id: String? - - public var email: String? - - public var fullName: String? - - public var firstName: String? - - - public enum CodingKeys: String, CodingKey { - - case lastName = "last_name" - - case image = "image" - - case id = "id" - - case email = "email" - - case fullName = "full_name" - - case firstName = "first_name" - - } - - public init(email: String?, firstName: String?, fullName: String?, id: String?, image: String?, lastName: String?) { - - self.lastName = lastName - - self.image = image - - self.id = id - - self.email = email - - self.fullName = fullName - - self.firstName = firstName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - image = try container.decode(String.self, forKey: .image) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fullName = try container.decode(String.self, forKey: .fullName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(image, forKey: .image) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(fullName, forKey: .fullName) - - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - } - - } - - /* - Model: AuthSuccessUser - Used By: User - */ - - class AuthSuccessUser: Codable { - - - public var firstName: String? - - public var lastName: String? - - public var debug: AuthSuccessUserDebug? - - public var active: Bool? - - public var emails: AuthSuccessUserEmails? - - - public enum CodingKeys: String, CodingKey { - - case firstName = "first_name" - - case lastName = "last_name" - - case debug = "debug" - - case active = "active" - - case emails = "emails" - - } - - public init(active: Bool?, debug: AuthSuccessUserDebug?, emails: AuthSuccessUserEmails?, firstName: String?, lastName: String?) { - - self.firstName = firstName - - self.lastName = lastName - - self.debug = debug - - self.active = active - - self.emails = emails - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - debug = try container.decode(AuthSuccessUserDebug.self, forKey: .debug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - emails = try container.decode(AuthSuccessUserEmails.self, forKey: .emails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(debug, forKey: .debug) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(emails, forKey: .emails) - - - } - - } - - /* - Model: AuthSuccessUserDebug - Used By: User - */ - - class AuthSuccessUserDebug: Codable { - - - public var platform: String? - - - public enum CodingKeys: String, CodingKey { - - case platform = "platform" - - } - - public init(platform: String?) { - - self.platform = platform - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - platform = try container.decode(String.self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - } - - } - - /* - Model: AuthSuccessUserEmails - Used By: User - */ - - class AuthSuccessUserEmails: Codable { - - - public var email: String? - - public var verified: Bool? - - public var primary: Bool? - - public var active: Bool? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case verified = "verified" - - case primary = "primary" - - case active = "active" - - } - - public init(active: Bool?, email: String?, primary: Bool?, verified: Bool?) { - - self.email = email - - self.verified = verified - - self.primary = primary - - self.active = active - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verified = try container.decode(Bool.self, forKey: .verified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - primary = try container.decode(Bool.self, forKey: .primary) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(verified, forKey: .verified) - - - - try? container.encodeIfPresent(primary, forKey: .primary) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - } - - } - - /* - Model: CreateUserRequestSchema - Used By: User - */ - - class CreateUserRequestSchema: Codable { - - - public var phoneNumber: String - - public var email: String? - - public var firstName: String? - - public var lastName: String? - - public var gender: String? - - public var username: String - - public var meta: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case phoneNumber = "phone_number" - - case email = "email" - - case firstName = "first_name" - - case lastName = "last_name" - - case gender = "gender" - - case username = "username" - - case meta = "meta" - - } - - public init(email: String?, firstName: String?, gender: String?, lastName: String?, meta: [String: Any]?, phoneNumber: String, username: String) { - - self.phoneNumber = phoneNumber - - self.email = email - - self.firstName = firstName - - self.lastName = lastName - - self.gender = gender - - self.username = username - - self.meta = meta - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - phoneNumber = try container.decode(String.self, forKey: .phoneNumber) - - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gender = try container.decode(String.self, forKey: .gender) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - username = try container.decode(String.self, forKey: .username) - - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(phoneNumber, forKey: .phoneNumber) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(gender, forKey: .gender) - - - - try? container.encodeIfPresent(username, forKey: .username) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - } - - } - - /* - Model: CreateUserResponseSchema - Used By: User - */ - - class CreateUserResponseSchema: Codable { - - - public var user: UserSchema? - - - public enum CodingKeys: String, CodingKey { - - case user = "user" - - } - - public init(user: UserSchema?) { - - self.user = user - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - user = try container.decode(UserSchema.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(user, forKey: .user) - - - } - - } - - /* - Model: CreateUserSessionRequestSchema - Used By: User - */ - - class CreateUserSessionRequestSchema: Codable { - - - public var domain: String? - - public var maxAge: Double? - - public var userId: String? - - - public enum CodingKeys: String, CodingKey { - - case domain = "domain" - - case maxAge = "max_age" - - case userId = "user_id" - - } - - public init(domain: String?, maxAge: Double?, userId: String?) { - - self.domain = domain - - self.maxAge = maxAge - - self.userId = userId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - domain = try container.decode(String.self, forKey: .domain) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - maxAge = try container.decode(Double.self, forKey: .maxAge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(domain, forKey: .domain) - - - - try? container.encodeIfPresent(maxAge, forKey: .maxAge) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - } - - } - - /* - Model: CreateUserSessionResponseSchema - Used By: User - */ - - class CreateUserSessionResponseSchema: Codable { - - - public var domain: String? - - public var maxAge: Double? - - public var secure: Bool? - - public var httpOnly: Bool? - - public var cookie: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case domain = "domain" - - case maxAge = "max_age" - - case secure = "secure" - - case httpOnly = "http_only" - - case cookie = "cookie" - - } - - public init(cookie: [String: Any]?, domain: String?, httpOnly: Bool?, maxAge: Double?, secure: Bool?) { - - self.domain = domain - - self.maxAge = maxAge - - self.secure = secure - - self.httpOnly = httpOnly - - self.cookie = cookie - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - domain = try container.decode(String.self, forKey: .domain) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - maxAge = try container.decode(Double.self, forKey: .maxAge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - secure = try container.decode(Bool.self, forKey: .secure) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - httpOnly = try container.decode(Bool.self, forKey: .httpOnly) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cookie = try container.decode([String: Any].self, forKey: .cookie) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(domain, forKey: .domain) - - - - try? container.encodeIfPresent(maxAge, forKey: .maxAge) - - - - try? container.encodeIfPresent(secure, forKey: .secure) - - - - try? container.encodeIfPresent(httpOnly, forKey: .httpOnly) - - - - try? container.encodeIfPresent(cookie, forKey: .cookie) - - - } - - } - - /* - Model: PlatformSchema - Used By: User - */ - - class PlatformSchema: Codable { - - - public var display: String? - - public var lookAndFeel: LookAndFeel? - - public var updatedAt: String? - - public var active: Bool? - - public var forgotPassword: Bool? - - public var login: Login? - - public var skipCaptcha: Bool? - - public var name: String? - - public var meta: MetaSchema? - - public var id: String? - - public var social: Social? - - public var requiredFields: RequiredFields? - - public var registerRequiredFields: RegisterRequiredFields? - - public var skipLogin: Bool? - - public var flashCard: FlashCard? - - public var subtext: String? - - public var socialTokens: SocialTokens? - - public var createdAt: String? - - public var register: Bool? - - public var mobileImage: String? - - public var desktopImage: String? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case lookAndFeel = "look_and_feel" - - case updatedAt = "updated_at" - - case active = "active" - - case forgotPassword = "forgot_password" - - case login = "login" - - case skipCaptcha = "skip_captcha" - - case name = "name" - - case meta = "meta" - - case id = "_id" - - case social = "social" - - case requiredFields = "required_fields" - - case registerRequiredFields = "register_required_fields" - - case skipLogin = "skip_login" - - case flashCard = "flash_card" - - case subtext = "subtext" - - case socialTokens = "social_tokens" - - case createdAt = "created_at" - - case register = "register" - - case mobileImage = "mobile_image" - - case desktopImage = "desktop_image" - - } - - public init(active: Bool?, createdAt: String?, desktopImage: String?, display: String?, flashCard: FlashCard?, forgotPassword: Bool?, login: Login?, lookAndFeel: LookAndFeel?, meta: MetaSchema?, mobileImage: String?, name: String?, register: Bool?, registerRequiredFields: RegisterRequiredFields?, requiredFields: RequiredFields?, skipCaptcha: Bool?, skipLogin: Bool?, social: Social?, socialTokens: SocialTokens?, subtext: String?, updatedAt: String?, id: String?) { - - self.display = display - - self.lookAndFeel = lookAndFeel - - self.updatedAt = updatedAt - - self.active = active - - self.forgotPassword = forgotPassword - - self.login = login - - self.skipCaptcha = skipCaptcha - - self.name = name - - self.meta = meta - - self.id = id - - self.social = social - - self.requiredFields = requiredFields - - self.registerRequiredFields = registerRequiredFields - - self.skipLogin = skipLogin - - self.flashCard = flashCard - - self.subtext = subtext - - self.socialTokens = socialTokens - - self.createdAt = createdAt - - self.register = register - - self.mobileImage = mobileImage - - self.desktopImage = desktopImage - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lookAndFeel = try container.decode(LookAndFeel.self, forKey: .lookAndFeel) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - forgotPassword = try container.decode(Bool.self, forKey: .forgotPassword) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - login = try container.decode(Login.self, forKey: .login) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - skipCaptcha = try container.decode(Bool.self, forKey: .skipCaptcha) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode(MetaSchema.self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - social = try container.decode(Social.self, forKey: .social) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requiredFields = try container.decode(RequiredFields.self, forKey: .requiredFields) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registerRequiredFields = try container.decode(RegisterRequiredFields.self, forKey: .registerRequiredFields) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - skipLogin = try container.decode(Bool.self, forKey: .skipLogin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - flashCard = try container.decode(FlashCard.self, forKey: .flashCard) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subtext = try container.decode(String.self, forKey: .subtext) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - socialTokens = try container.decode(SocialTokens.self, forKey: .socialTokens) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - register = try container.decode(Bool.self, forKey: .register) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobileImage = try container.decode(String.self, forKey: .mobileImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - desktopImage = try container.decode(String.self, forKey: .desktopImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(lookAndFeel, forKey: .lookAndFeel) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(forgotPassword, forKey: .forgotPassword) - - - - try? container.encodeIfPresent(login, forKey: .login) - - - - try? container.encodeIfPresent(skipCaptcha, forKey: .skipCaptcha) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(social, forKey: .social) - - - - try? container.encodeIfPresent(requiredFields, forKey: .requiredFields) - - - - try? container.encodeIfPresent(registerRequiredFields, forKey: .registerRequiredFields) - - - - try? container.encodeIfPresent(skipLogin, forKey: .skipLogin) - - - - try? container.encodeIfPresent(flashCard, forKey: .flashCard) - - - - try? container.encodeIfPresent(subtext, forKey: .subtext) - - - - try? container.encodeIfPresent(socialTokens, forKey: .socialTokens) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(register, forKey: .register) - - - - try? container.encodeIfPresent(mobileImage, forKey: .mobileImage) - - - - try? container.encodeIfPresent(desktopImage, forKey: .desktopImage) - - - } - - } - - /* - Model: LookAndFeel - Used By: User - */ - - class LookAndFeel: Codable { - - - public var cardPosition: String? - - public var backgroundColor: String? - - - public enum CodingKeys: String, CodingKey { - - case cardPosition = "card_position" - - case backgroundColor = "background_color" - - } - - public init(backgroundColor: String?, cardPosition: String?) { - - self.cardPosition = cardPosition - - self.backgroundColor = backgroundColor - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cardPosition = try container.decode(String.self, forKey: .cardPosition) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - backgroundColor = try container.decode(String.self, forKey: .backgroundColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cardPosition, forKey: .cardPosition) - - - - try? container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) - - - } - - } - - /* - Model: Login - Used By: User - */ - - class Login: Codable { - - - public var password: Bool? - - public var otp: Bool? - - - public enum CodingKeys: String, CodingKey { - - case password = "password" - - case otp = "otp" - - } - - public init(otp: Bool?, password: Bool?) { - - self.password = password - - self.otp = otp - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - password = try container.decode(Bool.self, forKey: .password) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - otp = try container.decode(Bool.self, forKey: .otp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(password, forKey: .password) - - - - try? container.encodeIfPresent(otp, forKey: .otp) - - - } - - } - - /* - Model: MetaSchema - Used By: User - */ - - class MetaSchema: Codable { - - - public var fyndDefault: Bool? - - - public enum CodingKeys: String, CodingKey { - - case fyndDefault = "fynd_default" - - } - - public init(fyndDefault: Bool?) { - - self.fyndDefault = fyndDefault - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - fyndDefault = try container.decode(Bool.self, forKey: .fyndDefault) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(fyndDefault, forKey: .fyndDefault) - - - } - - } - - /* - Model: Social - Used By: User - */ - - class Social: Codable { - - - public var accountKit: Bool? - - public var facebook: Bool? - - public var google: Bool? - - - public enum CodingKeys: String, CodingKey { - - case accountKit = "account_kit" - - case facebook = "facebook" - - case google = "google" - - } - - public init(accountKit: Bool?, facebook: Bool?, google: Bool?) { - - self.accountKit = accountKit - - self.facebook = facebook - - self.google = google - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - accountKit = try container.decode(Bool.self, forKey: .accountKit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - facebook = try container.decode(Bool.self, forKey: .facebook) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - google = try container.decode(Bool.self, forKey: .google) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(accountKit, forKey: .accountKit) - - - - try? container.encodeIfPresent(facebook, forKey: .facebook) - - - - try? container.encodeIfPresent(google, forKey: .google) - - - } - - } - - /* - Model: RequiredFields - Used By: User - */ - - class RequiredFields: Codable { - - - public var email: PlatformEmail? - - public var mobile: PlatformMobile? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case mobile = "mobile" - - } - - public init(email: PlatformEmail?, mobile: PlatformMobile?) { - - self.email = email - - self.mobile = mobile - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(PlatformEmail.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobile = try container.decode(PlatformMobile.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - } - - } - - /* - Model: PlatformEmail - Used By: User - */ - - class PlatformEmail: Codable { - - - public var isRequired: Bool? - - public var level: String? - - - public enum CodingKeys: String, CodingKey { - - case isRequired = "is_required" - - case level = "level" - - } - - public init(isRequired: Bool?, level: String?) { - - self.isRequired = isRequired - - self.level = level - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isRequired = try container.decode(Bool.self, forKey: .isRequired) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - level = try container.decode(String.self, forKey: .level) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isRequired, forKey: .isRequired) - - - - try? container.encodeIfPresent(level, forKey: .level) - - - } - - } - - /* - Model: PlatformMobile - Used By: User - */ - - class PlatformMobile: Codable { - - - public var isRequired: Bool? - - public var level: String? - - - public enum CodingKeys: String, CodingKey { - - case isRequired = "is_required" - - case level = "level" - - } - - public init(isRequired: Bool?, level: String?) { - - self.isRequired = isRequired - - self.level = level - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isRequired = try container.decode(Bool.self, forKey: .isRequired) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - level = try container.decode(String.self, forKey: .level) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isRequired, forKey: .isRequired) - - - - try? container.encodeIfPresent(level, forKey: .level) - - - } - - } - - /* - Model: RegisterRequiredFields - Used By: User - */ - - class RegisterRequiredFields: Codable { - - - public var email: RegisterRequiredFieldsEmail? - - public var mobile: RegisterRequiredFieldsMobile? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case mobile = "mobile" - - } - - public init(email: RegisterRequiredFieldsEmail?, mobile: RegisterRequiredFieldsMobile?) { - - self.email = email - - self.mobile = mobile - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(RegisterRequiredFieldsEmail.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobile = try container.decode(RegisterRequiredFieldsMobile.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - } - - } - - /* - Model: RegisterRequiredFieldsEmail - Used By: User - */ - - class RegisterRequiredFieldsEmail: Codable { - - - public var isRequired: Bool? - - public var level: String? - - - public enum CodingKeys: String, CodingKey { - - case isRequired = "is_required" - - case level = "level" - - } - - public init(isRequired: Bool?, level: String?) { - - self.isRequired = isRequired - - self.level = level - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isRequired = try container.decode(Bool.self, forKey: .isRequired) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - level = try container.decode(String.self, forKey: .level) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isRequired, forKey: .isRequired) - - - - try? container.encodeIfPresent(level, forKey: .level) - - - } - - } - - /* - Model: RegisterRequiredFieldsMobile - Used By: User - */ - - class RegisterRequiredFieldsMobile: Codable { - - - public var isRequired: Bool? - - public var level: String? - - - public enum CodingKeys: String, CodingKey { - - case isRequired = "is_required" - - case level = "level" - - } - - public init(isRequired: Bool?, level: String?) { - - self.isRequired = isRequired - - self.level = level - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isRequired = try container.decode(Bool.self, forKey: .isRequired) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - level = try container.decode(String.self, forKey: .level) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isRequired, forKey: .isRequired) - - - - try? container.encodeIfPresent(level, forKey: .level) - - - } - - } - - /* - Model: FlashCard - Used By: User - */ - - class FlashCard: Codable { - - - public var text: String? - - public var textColor: String? - - public var backgroundColor: String? - - - public enum CodingKeys: String, CodingKey { - - case text = "text" - - case textColor = "text_color" - - case backgroundColor = "background_color" - - } - - public init(backgroundColor: String?, text: String?, textColor: String?) { - - self.text = text - - self.textColor = textColor - - self.backgroundColor = backgroundColor - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - text = try container.decode(String.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - textColor = try container.decode(String.self, forKey: .textColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - backgroundColor = try container.decode(String.self, forKey: .backgroundColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(textColor, forKey: .textColor) - - - - try? container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) - - - } - - } - - /* - Model: SocialTokens - Used By: User - */ - - class SocialTokens: Codable { - - - public var facebook: Facebook? - - public var accountKit: Accountkit? - - public var google: Google? - - - public enum CodingKeys: String, CodingKey { - - case facebook = "facebook" - - case accountKit = "account_kit" - - case google = "google" - - } - - public init(accountKit: Accountkit?, facebook: Facebook?, google: Google?) { - - self.facebook = facebook - - self.accountKit = accountKit - - self.google = google - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - facebook = try container.decode(Facebook.self, forKey: .facebook) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - accountKit = try container.decode(Accountkit.self, forKey: .accountKit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - google = try container.decode(Google.self, forKey: .google) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(facebook, forKey: .facebook) - - - - try? container.encodeIfPresent(accountKit, forKey: .accountKit) - - - - try? container.encodeIfPresent(google, forKey: .google) - - - } - - } - - /* - Model: Facebook - Used By: User - */ - - class Facebook: Codable { - - - public var appId: String? - - - public enum CodingKeys: String, CodingKey { - - case appId = "app_id" - - } - - public init(appId: String?) { - - self.appId = appId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - } - - } - - /* - Model: Accountkit - Used By: User - */ - - class Accountkit: Codable { - - - public var appId: String? - - - public enum CodingKeys: String, CodingKey { - - case appId = "app_id" - - } - - public init(appId: String?) { - - self.appId = appId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - } - - } - - /* - Model: Google - Used By: User - */ - - class Google: Codable { - - - public var appId: String? - - - public enum CodingKeys: String, CodingKey { - - case appId = "app_id" - - } - - public init(appId: String?) { - - self.appId = appId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - } - - } - - /* - Model: UpdateUserRequestSchema - Used By: User - */ - - class UpdateUserRequestSchema: Codable { - - - public var firstName: String? - - public var lastName: String? - - public var gender: String? - - public var meta: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case firstName = "first_name" - - case lastName = "last_name" - - case gender = "gender" - - case meta = "meta" - - } - - public init(firstName: String?, gender: String?, lastName: String?, meta: [String: Any]?) { - - self.firstName = firstName - - self.lastName = lastName - - self.gender = gender - - self.meta = meta - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gender = try container.decode(String.self, forKey: .gender) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(gender, forKey: .gender) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - } - - } - - /* - Model: UserSchema - Used By: User - */ - - class UserSchema: Codable { - - - public var firstName: String? - - public var meta: [String: Any]? - - public var lastName: String? - - public var phoneNumbers: [PhoneNumber]? - - public var emails: [Email]? - - public var gender: String? - - public var dob: String? - - public var active: Bool? - - public var profilePicUrl: String? - - public var username: String? - - public var accountType: String? - - public var uid: String? - - public var debug: Debug? - - public var hasOldPasswordHash: Bool? - - public var id: String? - - public var createdAt: String? - - public var updatedAt: String? - - - public enum CodingKeys: String, CodingKey { - - case firstName = "first_name" - - case meta = "meta" - - case lastName = "last_name" - - case phoneNumbers = "phone_numbers" - - case emails = "emails" - - case gender = "gender" - - case dob = "dob" - - case active = "active" - - case profilePicUrl = "profile_pic_url" - - case username = "username" - - case accountType = "account_type" - - case uid = "uid" - - case debug = "debug" - - case hasOldPasswordHash = "has_old_password_hash" - - case id = "_id" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - } - - public init(accountType: String?, active: Bool?, createdAt: String?, debug: Debug?, dob: String?, emails: [Email]?, firstName: String?, gender: String?, hasOldPasswordHash: Bool?, lastName: String?, meta: [String: Any]?, phoneNumbers: [PhoneNumber]?, profilePicUrl: String?, uid: String?, updatedAt: String?, username: String?, id: String?) { - - self.firstName = firstName - - self.meta = meta - - self.lastName = lastName - - self.phoneNumbers = phoneNumbers - - self.emails = emails - - self.gender = gender - - self.dob = dob - - self.active = active - - self.profilePicUrl = profilePicUrl - - self.username = username - - self.accountType = accountType - - self.uid = uid - - self.debug = debug - - self.hasOldPasswordHash = hasOldPasswordHash - - self.id = id - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phoneNumbers = try container.decode([PhoneNumber].self, forKey: .phoneNumbers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - emails = try container.decode([Email].self, forKey: .emails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gender = try container.decode(String.self, forKey: .gender) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dob = try container.decode(String.self, forKey: .dob) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - profilePicUrl = try container.decode(String.self, forKey: .profilePicUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - username = try container.decode(String.self, forKey: .username) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - accountType = try container.decode(String.self, forKey: .accountType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - debug = try container.decode(Debug.self, forKey: .debug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasOldPasswordHash = try container.decode(Bool.self, forKey: .hasOldPasswordHash) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(phoneNumbers, forKey: .phoneNumbers) - - - - try? container.encodeIfPresent(emails, forKey: .emails) - - - - try? container.encodeIfPresent(gender, forKey: .gender) - - - - try? container.encodeIfPresent(dob, forKey: .dob) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(profilePicUrl, forKey: .profilePicUrl) - - - - try? container.encodeIfPresent(username, forKey: .username) - - - - try? container.encodeIfPresent(accountType, forKey: .accountType) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(debug, forKey: .debug) - - - - try? container.encodeIfPresent(hasOldPasswordHash, forKey: .hasOldPasswordHash) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - } - - } - - - - /* - Model: ApplicationLegal - Used By: Content - */ - - class ApplicationLegal: Codable { - - - public var application: String? - - public var tnc: String? - - public var policy: String? - - public var shipping: String? - - public var faq: [ApplicationLegalFAQ]? - - public var id: String? - - public var updatedAt: String? - - public var createdAt: String? - - - public enum CodingKeys: String, CodingKey { - - case application = "application" - - case tnc = "tnc" - - case policy = "policy" - - case shipping = "shipping" - - case faq = "faq" - - case id = "_id" - - case updatedAt = "updated_at" - - case createdAt = "created_at" - - } - - public init(application: String?, createdAt: String?, faq: [ApplicationLegalFAQ]?, policy: String?, shipping: String?, tnc: String?, updatedAt: String?, id: String?) { - - self.application = application - - self.tnc = tnc - - self.policy = policy - - self.shipping = shipping - - self.faq = faq - - self.id = id - - self.updatedAt = updatedAt - - self.createdAt = createdAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tnc = try container.decode(String.self, forKey: .tnc) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - policy = try container.decode(String.self, forKey: .policy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shipping = try container.decode(String.self, forKey: .shipping) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - faq = try container.decode([ApplicationLegalFAQ].self, forKey: .faq) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(tnc, forKey: .tnc) - - - - try? container.encodeIfPresent(policy, forKey: .policy) - - - - try? container.encodeIfPresent(shipping, forKey: .shipping) - - - - try? container.encodeIfPresent(faq, forKey: .faq) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - } - - } - - /* - Model: ApplicationLegalFAQ - Used By: Content - */ - - class ApplicationLegalFAQ: Codable { - - - public var question: String? - - public var answer: String? - - - public enum CodingKeys: String, CodingKey { - - case question = "question" - - case answer = "answer" - - } - - public init(answer: String?, question: String?) { - - self.question = question - - self.answer = answer - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - question = try container.decode(String.self, forKey: .question) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - answer = try container.decode(String.self, forKey: .answer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(question, forKey: .question) - - - - try? container.encodeIfPresent(answer, forKey: .answer) - - - } - - } - - /* - Model: SeoComponent - Used By: Content - */ - - class SeoComponent: Codable { - - - public var seo: SeoSchema? - - - public enum CodingKeys: String, CodingKey { - - case seo = "seo" - - } - - public init(seo: SeoSchema?) { - - self.seo = seo - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - seo = try container.decode(SeoSchema.self, forKey: .seo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(seo, forKey: .seo) - - - } - - } - - /* - Model: SeoSchema - Used By: Content - */ - - class SeoSchema: Codable { - - - public var app: String? - - public var id: String? - - public var robotsTxt: String? - - public var sitemapEnabled: Bool? - - public var customMetaTags: [CustomMetaTag]? - - public var details: Detail? - - public var createdAt: String? - - public var updatedAt: String? - - - public enum CodingKeys: String, CodingKey { - - case app = "app" - - case id = "_id" - - case robotsTxt = "robots_txt" - - case sitemapEnabled = "sitemap_enabled" - - case customMetaTags = "custom_meta_tags" - - case details = "details" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - } - - public init(app: String?, createdAt: String?, customMetaTags: [CustomMetaTag]?, details: Detail?, robotsTxt: String?, sitemapEnabled: Bool?, updatedAt: String?, id: String?) { - - self.app = app - - self.id = id - - self.robotsTxt = robotsTxt - - self.sitemapEnabled = sitemapEnabled - - self.customMetaTags = customMetaTags - - self.details = details - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - app = try container.decode(String.self, forKey: .app) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - robotsTxt = try container.decode(String.self, forKey: .robotsTxt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sitemapEnabled = try container.decode(Bool.self, forKey: .sitemapEnabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customMetaTags = try container.decode([CustomMetaTag].self, forKey: .customMetaTags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - details = try container.decode(Detail.self, forKey: .details) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(app, forKey: .app) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(robotsTxt, forKey: .robotsTxt) - - - - try? container.encodeIfPresent(sitemapEnabled, forKey: .sitemapEnabled) - - - - try? container.encodeIfPresent(customMetaTags, forKey: .customMetaTags) - - - - try? container.encodeIfPresent(details, forKey: .details) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - } - - } - - /* - Model: CustomMetaTag - Used By: Content - */ - - class CustomMetaTag: Codable { - - - public var name: String? - - public var content: String? - - public var id: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case content = "content" - - case id = "_id" - - } - - public init(content: String?, name: String?, id: String?) { - - self.name = name - - self.content = content - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode(String.self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: Detail - Used By: Content - */ - - class Detail: Codable { - - - public var title: String? - - public var description: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case description = "description" - - } - - public init(description: String?, title: String?) { - - self.title = title - - self.description = description - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - } - - } - - /* - Model: AnnouncementPageSchema - Used By: Content - */ - - class AnnouncementPageSchema: Codable { - - - public var pageSlug: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case pageSlug = "page_slug" - - case type = "type" - - } - - public init(pageSlug: String?, type: String?) { - - self.pageSlug = pageSlug - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pageSlug = try container.decode(String.self, forKey: .pageSlug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pageSlug, forKey: .pageSlug) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: EditorMeta - Used By: Content - */ - - class EditorMeta: Codable { - - - public var foregroundColor: String? - - public var backgroundColor: String? - - public var contentType: String? - - public var content: String? - - - public enum CodingKeys: String, CodingKey { - - case foregroundColor = "foreground_color" - - case backgroundColor = "background_color" - - case contentType = "content_type" - - case content = "content" - - } - - public init(backgroundColor: String?, content: String?, contentType: String?, foregroundColor: String?) { - - self.foregroundColor = foregroundColor - - self.backgroundColor = backgroundColor - - self.contentType = contentType - - self.content = content - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - foregroundColor = try container.decode(String.self, forKey: .foregroundColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - backgroundColor = try container.decode(String.self, forKey: .backgroundColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contentType = try container.decode(String.self, forKey: .contentType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode(String.self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(foregroundColor, forKey: .foregroundColor) - - - - try? container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) - - - - try? container.encodeIfPresent(contentType, forKey: .contentType) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - } - - } - - /* - Model: AnnouncementAuthorSchema - Used By: Content - */ - - class AnnouncementAuthorSchema: Codable { - - - public var createdBy: String? - - public var modifiedBy: String? - - - public enum CodingKeys: String, CodingKey { - - case createdBy = "created_by" - - case modifiedBy = "modified_by" - - } - - public init(createdBy: String?, modifiedBy: String?) { - - self.createdBy = createdBy - - self.modifiedBy = modifiedBy - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdBy = try container.decode(String.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode(String.self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - } - - } - - /* - Model: AdminAnnouncementSchema - Used By: Content - */ - - class AdminAnnouncementSchema: Codable { - - - public var id: String? - - public var platforms: [String]? - - public var title: String? - - public var announcement: String? - - public var pages: [AnnouncementPageSchema]? - - public var editorMeta: EditorMeta? - - public var author: AnnouncementAuthorSchema? - - public var createdAt: String? - - public var app: String? - - public var modifiedAt: String? - - public var schedule: ScheduleSchema? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case platforms = "platforms" - - case title = "title" - - case announcement = "announcement" - - case pages = "pages" - - case editorMeta = "editor_meta" - - case author = "author" - - case createdAt = "created_at" - - case app = "app" - - case modifiedAt = "modified_at" - - case schedule = "_schedule" - - } - - public init(announcement: String?, app: String?, author: AnnouncementAuthorSchema?, createdAt: String?, editorMeta: EditorMeta?, modifiedAt: String?, pages: [AnnouncementPageSchema]?, platforms: [String]?, title: String?, id: String?, schedule: ScheduleSchema?) { - - self.id = id - - self.platforms = platforms - - self.title = title - - self.announcement = announcement - - self.pages = pages - - self.editorMeta = editorMeta - - self.author = author - - self.createdAt = createdAt - - self.app = app - - self.modifiedAt = modifiedAt - - self.schedule = schedule - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platforms = try container.decode([String].self, forKey: .platforms) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - announcement = try container.decode(String.self, forKey: .announcement) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pages = try container.decode([AnnouncementPageSchema].self, forKey: .pages) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - editorMeta = try container.decode(EditorMeta.self, forKey: .editorMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - author = try container.decode(AnnouncementAuthorSchema.self, forKey: .author) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - app = try container.decode(String.self, forKey: .app) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedAt = try container.decode(String.self, forKey: .modifiedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode(ScheduleSchema.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(platforms, forKey: .platforms) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(announcement, forKey: .announcement) - - - - try? container.encodeIfPresent(pages, forKey: .pages) - - - - try? container.encodeIfPresent(editorMeta, forKey: .editorMeta) - - - - try? container.encodeIfPresent(author, forKey: .author) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(app, forKey: .app) - - - - try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - } - - } - - /* - Model: ScheduleSchema - Used By: Content - */ - - class ScheduleSchema: Codable { - - - public var cron: String? - - public var start: String? - - public var end: String? - - public var duration: Double? - - public var nextSchedule: [NextSchedule]? - - - public enum CodingKeys: String, CodingKey { - - case cron = "cron" - - case start = "start" - - case end = "end" - - case duration = "duration" - - case nextSchedule = "next_schedule" - - } - - public init(cron: String?, duration: Double?, end: String?, nextSchedule: [NextSchedule]?, start: String?) { - - self.cron = cron - - self.start = start - - self.end = end - - self.duration = duration - - self.nextSchedule = nextSchedule - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cron = try container.decode(String.self, forKey: .cron) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - start = try container.decode(String.self, forKey: .start) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - end = try container.decode(String.self, forKey: .end) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - duration = try container.decode(Double.self, forKey: .duration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - nextSchedule = try container.decode([NextSchedule].self, forKey: .nextSchedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cron, forKey: .cron) - - - - try? container.encodeIfPresent(start, forKey: .start) - - - - try? container.encodeIfPresent(end, forKey: .end) - - - - try? container.encodeIfPresent(duration, forKey: .duration) - - - - try? container.encodeIfPresent(nextSchedule, forKey: .nextSchedule) - - - } - - } - - /* - Model: NextSchedule - Used By: Content - */ - - class NextSchedule: Codable { - - - public var start: String? - - public var end: String? - - - public enum CodingKeys: String, CodingKey { - - case start = "start" - - case end = "end" - - } - - public init(end: String?, start: String?) { - - self.start = start - - self.end = end - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - start = try container.decode(String.self, forKey: .start) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - end = try container.decode(String.self, forKey: .end) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(start, forKey: .start) - - - - try? container.encodeIfPresent(end, forKey: .end) - - - } - - } - - /* - Model: AnnouncementSchema - Used By: Content - */ - - class AnnouncementSchema: Codable { - - - public var announcement: String? - - public var schedule: ScheduleStartSchema? - - - public enum CodingKeys: String, CodingKey { - - case announcement = "announcement" - - case schedule = "schedule" - - } - - public init(announcement: String?, schedule: ScheduleStartSchema?) { - - self.announcement = announcement - - self.schedule = schedule - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - announcement = try container.decode(String.self, forKey: .announcement) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode(ScheduleStartSchema.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(announcement, forKey: .announcement) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - } - - } - - /* - Model: ScheduleStartSchema - Used By: Content - */ - - class ScheduleStartSchema: Codable { - - - public var start: String? - - public var end: String? - - - public enum CodingKeys: String, CodingKey { - - case start = "start" - - case end = "end" - - } - - public init(end: String?, start: String?) { - - self.start = start - - self.end = end - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - start = try container.decode(String.self, forKey: .start) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - end = try container.decode(String.self, forKey: .end) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(start, forKey: .start) - - - - try? container.encodeIfPresent(end, forKey: .end) - - - } - - } - - /* - Model: BlogGetResponse - Used By: Content - */ - - class BlogGetResponse: Codable { - - - public var items: [BlogSchema]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [BlogSchema]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([BlogSchema].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: ResourceContent - Used By: Content - */ - - class ResourceContent: Codable { - - - public var type: String? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case value = "value" - - } - - public init(type: String?, value: String?) { - - self.type = type - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: Asset - Used By: Content - */ - - class Asset: Codable { - - - public var aspectRatio: String? - - public var id: String? - - public var secureUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case aspectRatio = "aspect_ratio" - - case id = "id" - - case secureUrl = "secure_url" - - } - - public init(aspectRatio: String?, id: String?, secureUrl: String?) { - - self.aspectRatio = aspectRatio - - self.id = id - - self.secureUrl = secureUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - aspectRatio = try container.decode(String.self, forKey: .aspectRatio) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - secureUrl = try container.decode(String.self, forKey: .secureUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) - - - } - - } - - /* - Model: Author - Used By: Content - */ - - class Author: Codable { - - - public var designation: String? - - public var id: String? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case designation = "designation" - - case id = "id" - - case name = "name" - - } - - public init(designation: String?, id: String?, name: String?) { - - self.designation = designation - - self.id = id - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - designation = try container.decode(String.self, forKey: .designation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(designation, forKey: .designation) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: BlogSchema - Used By: Content - */ - - class BlogSchema: Codable { - - - public var id: String? - - public var customJson: [String: Any]? - - public var application: String? - - public var archived: Bool? - - public var author: Author? - - public var content: [ResourceContent]? - - public var featureImage: Asset? - - public var published: Bool? - - public var readingTime: String? - - public var slug: String? - - public var tags: [String]? - - public var seo: SEO? - - public var schedule: CronSchedule? - - public var title: String? - - public var dateMeta: DateMeta? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case customJson = "_custom_json" - - case application = "application" - - case archived = "archived" - - case author = "author" - - case content = "content" - - case featureImage = "feature_image" - - case published = "published" - - case readingTime = "reading_time" - - case slug = "slug" - - case tags = "tags" - - case seo = "seo" - - case schedule = "_schedule" - - case title = "title" - - case dateMeta = "date_meta" - - } - - public init(application: String?, archived: Bool?, author: Author?, content: [ResourceContent]?, dateMeta: DateMeta?, featureImage: Asset?, published: Bool?, readingTime: String?, seo: SEO?, slug: String?, tags: [String]?, title: String?, customJson: [String: Any]?, id: String?, schedule: CronSchedule?) { - - self.id = id - - self.customJson = customJson - - self.application = application - - self.archived = archived - - self.author = author - - self.content = content - - self.featureImage = featureImage - - self.published = published - - self.readingTime = readingTime - - self.slug = slug - - self.tags = tags - - self.seo = seo - - self.schedule = schedule - - self.title = title - - self.dateMeta = dateMeta - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archived = try container.decode(Bool.self, forKey: .archived) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - author = try container.decode(Author.self, forKey: .author) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode([ResourceContent].self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - featureImage = try container.decode(Asset.self, forKey: .featureImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - readingTime = try container.decode(String.self, forKey: .readingTime) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - seo = try container.decode(SEO.self, forKey: .seo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode(CronSchedule.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(archived, forKey: .archived) - - - - try? container.encodeIfPresent(author, forKey: .author) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - - try? container.encodeIfPresent(featureImage, forKey: .featureImage) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(readingTime, forKey: .readingTime) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(seo, forKey: .seo) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - } - - } - - /* - Model: SEO - Used By: Content - */ - - class SEO: Codable { - - - public var description: String? - - public var image: SEOImage? - - public var title: String? - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case image = "image" - - case title = "title" - - } - - public init(description: String?, image: SEOImage?, title: String?) { - - self.description = description - - self.image = image - - self.title = title - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - image = try container.decode(SEOImage.self, forKey: .image) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(image, forKey: .image) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - } - - } - - /* - Model: SEOImage - Used By: Content - */ - - class SEOImage: Codable { - - - public var url: String? - - - public enum CodingKeys: String, CodingKey { - - case url = "url" - - } - - public init(url: String?) { - - self.url = url - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(url, forKey: .url) - - - } - - } - - /* - Model: BlogRequest - Used By: Content - */ - - class BlogRequest: Codable { - - - public var application: String? - - public var customJson: [String: Any]? - - public var author: Author? - - public var content: [ResourceContent]? - - public var featureImage: Asset? - - public var published: Bool? - - public var readingTime: String? - - public var slug: String? - - public var tags: [String]? - - public var title: String? - - public var seo: SEO? - - public var schedule: CronSchedule? - - - public enum CodingKeys: String, CodingKey { - - case application = "application" - - case customJson = "_custom_json" - - case author = "author" - - case content = "content" - - case featureImage = "feature_image" - - case published = "published" - - case readingTime = "reading_time" - - case slug = "slug" - - case tags = "tags" - - case title = "title" - - case seo = "seo" - - case schedule = "_schedule" - - } - - public init(application: String?, author: Author?, content: [ResourceContent]?, featureImage: Asset?, published: Bool?, readingTime: String?, seo: SEO?, slug: String?, tags: [String]?, title: String?, customJson: [String: Any]?, schedule: CronSchedule?) { - - self.application = application - - self.customJson = customJson - - self.author = author - - self.content = content - - self.featureImage = featureImage - - self.published = published - - self.readingTime = readingTime - - self.slug = slug - - self.tags = tags - - self.title = title - - self.seo = seo - - self.schedule = schedule - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - author = try container.decode(Author.self, forKey: .author) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode([ResourceContent].self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - featureImage = try container.decode(Asset.self, forKey: .featureImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - readingTime = try container.decode(String.self, forKey: .readingTime) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - seo = try container.decode(SEO.self, forKey: .seo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode(CronSchedule.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(author, forKey: .author) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - - try? container.encodeIfPresent(featureImage, forKey: .featureImage) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(readingTime, forKey: .readingTime) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(seo, forKey: .seo) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - } - - } - - /* - Model: GetAnnouncementListSchema - Used By: Content - */ - - class GetAnnouncementListSchema: Codable { - - - public var items: [AdminAnnouncementSchema]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [AdminAnnouncementSchema]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([AdminAnnouncementSchema].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: CreateAnnouncementSchema - Used By: Content - */ - - class CreateAnnouncementSchema: Codable { - - - public var message: String? - - public var data: AdminAnnouncementSchema? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - case data = "data" - - } - - public init(data: AdminAnnouncementSchema?, message: String?) { - - self.message = message - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode(AdminAnnouncementSchema.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: Navigation - Used By: Content - */ - - class Navigation: Codable { - - - public var name: String? - - public var slug: String? - - public var orientation: String? - - public var createdBy: CreatedBySchema? - - public var dateMeta: DateMeta? - - public var id: String? - - public var position: String? - - public var application: String? - - public var platform: String? - - public var navigation: NavigationReference? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case slug = "slug" - - case orientation = "orientation" - - case createdBy = "created_by" - - case dateMeta = "date_meta" - - case id = "_id" - - case position = "position" - - case application = "application" - - case platform = "platform" - - case navigation = "navigation" - - } - - public init(application: String?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, name: String?, navigation: NavigationReference?, orientation: String?, platform: String?, position: String?, slug: String?, id: String?) { - - self.name = name - - self.slug = slug - - self.orientation = orientation - - self.createdBy = createdBy - - self.dateMeta = dateMeta - - self.id = id - - self.position = position - - self.application = application - - self.platform = platform - - self.navigation = navigation - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orientation = try container.decode(String.self, forKey: .orientation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - position = try container.decode(String.self, forKey: .position) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode(String.self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - navigation = try container.decode(NavigationReference.self, forKey: .navigation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(orientation, forKey: .orientation) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(position, forKey: .position) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - - try? container.encodeIfPresent(navigation, forKey: .navigation) - - - } - - } - - /* - Model: LocaleLanguage - Used By: Content - */ - - class LocaleLanguage: Codable { - - - public var hi: Language? - - public var ar: Language? - - public var enUs: Language? - - - public enum CodingKeys: String, CodingKey { - - case hi = "hi" - - case ar = "ar" - - case enUs = "en_us" - - } - - public init(ar: Language?, enUs: Language?, hi: Language?) { - - self.hi = hi - - self.ar = ar - - self.enUs = enUs - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - hi = try container.decode(Language.self, forKey: .hi) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ar = try container.decode(Language.self, forKey: .ar) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enUs = try container.decode(Language.self, forKey: .enUs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(hi, forKey: .hi) - - - - try? container.encodeIfPresent(ar, forKey: .ar) - - - - try? container.encodeIfPresent(enUs, forKey: .enUs) - - - } - - } - - /* - Model: Language - Used By: Content - */ - - class Language: Codable { - - - public var display: String? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - } - - public init(display: String?) { - - self.display = display - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - } - - } - - /* - Model: Action - Used By: Content - */ - - class Action: Codable { - - - public var page: ActionPage? - - public var popup: ActionPage? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case page = "page" - - case popup = "popup" - - case type = "type" - - } - - public init(page: ActionPage?, popup: ActionPage?, type: String?) { - - self.page = page - - self.popup = popup - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - page = try container.decode(ActionPage.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - popup = try container.decode(ActionPage.self, forKey: .popup) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(popup, forKey: .popup) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ActionPage - Used By: Content - */ - - class ActionPage: Codable { - - - public var params: [String: [String]]? - - public var query: [String: [String]]? - - public var url: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case params = "params" - - case query = "query" - - case url = "url" - - case type = "type" - - } - - public init(params: [String: [String]]?, query: [String: [String]]?, type: String?, url: String?) { - - self.params = params - - self.query = query - - self.url = url - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - params = try container.decode([String: [String]].self, forKey: .params) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - query = try container.decode([String: [String]].self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(params, forKey: .params) - - - - try? container.encodeIfPresent(query, forKey: .query) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: NavigationReference - Used By: Content - */ - - class NavigationReference: Codable { - - - public var acl: [String]? - - public var tags: [String]? - - public var localeLanguage: LocaleLanguage? - - public var image: String? - - public var type: String? - - public var action: Action? - - public var active: Bool? - - public var display: String? - - public var sortOrder: Int? - - public var subNavigation: [NavigationReference]? - - - public enum CodingKeys: String, CodingKey { - - case acl = "acl" - - case tags = "tags" - - case localeLanguage = "_locale_language" - - case image = "image" - - case type = "type" - - case action = "action" - - case active = "active" - - case display = "display" - - case sortOrder = "sort_order" - - case subNavigation = "sub_navigation" - - } - - public init(acl: [String]?, action: Action?, active: Bool?, display: String?, image: String?, sortOrder: Int?, subNavigation: [NavigationReference]?, tags: [String]?, type: String?, localeLanguage: LocaleLanguage?) { - - self.acl = acl - - self.tags = tags - - self.localeLanguage = localeLanguage - - self.image = image - - self.type = type - - self.action = action - - self.active = active - - self.display = display - - self.sortOrder = sortOrder - - self.subNavigation = subNavigation - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - acl = try container.decode([String].self, forKey: .acl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - localeLanguage = try container.decode(LocaleLanguage.self, forKey: .localeLanguage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - image = try container.decode(String.self, forKey: .image) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(Action.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sortOrder = try container.decode(Int.self, forKey: .sortOrder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subNavigation = try container.decode([NavigationReference].self, forKey: .subNavigation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(acl, forKey: .acl) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(localeLanguage, forKey: .localeLanguage) - - - - try? container.encodeIfPresent(image, forKey: .image) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(sortOrder, forKey: .sortOrder) - - - - try? container.encodeIfPresent(subNavigation, forKey: .subNavigation) - - - } - - } - - /* - Model: LandingPage - Used By: Content - */ - - class LandingPage: Codable { - - - public var data: LandingPageSchema? - - public var success: Bool? - - - public enum CodingKeys: String, CodingKey { - - case data = "data" - - case success = "success" - - } - - public init(data: LandingPageSchema?, success: Bool?) { - - self.data = data - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - data = try container.decode(LandingPageSchema.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(data, forKey: .data) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: ConfigurationSchema - Used By: Content - */ - - class ConfigurationSchema: Codable { - - - public var sleepTime: Int? - - public var startOnLaunch: Bool? - - public var duration: Int? - - public var slideDirection: String? - - - public enum CodingKeys: String, CodingKey { - - case sleepTime = "sleep_time" - - case startOnLaunch = "start_on_launch" - - case duration = "duration" - - case slideDirection = "slide_direction" - - } - - public init(duration: Int?, sleepTime: Int?, slideDirection: String?, startOnLaunch: Bool?) { - - self.sleepTime = sleepTime - - self.startOnLaunch = startOnLaunch - - self.duration = duration - - self.slideDirection = slideDirection - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - sleepTime = try container.decode(Int.self, forKey: .sleepTime) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - startOnLaunch = try container.decode(Bool.self, forKey: .startOnLaunch) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - duration = try container.decode(Int.self, forKey: .duration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slideDirection = try container.decode(String.self, forKey: .slideDirection) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(sleepTime, forKey: .sleepTime) - - - - try? container.encodeIfPresent(startOnLaunch, forKey: .startOnLaunch) - - - - try? container.encodeIfPresent(duration, forKey: .duration) - - - - try? container.encodeIfPresent(slideDirection, forKey: .slideDirection) - - - } - - } - - /* - Model: SlideshowMedia - Used By: Content - */ - - class SlideshowMedia: Codable { - - - public var type: String? - - public var url: String? - - public var bgColor: String? - - public var duration: Int? - - public var autoDecideDuration: Bool? - - public var action: Action? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case url = "url" - - case bgColor = "bg_color" - - case duration = "duration" - - case autoDecideDuration = "auto_decide_duration" - - case action = "action" - - } - - public init(action: Action?, autoDecideDuration: Bool?, bgColor: String?, duration: Int?, type: String?, url: String?) { - - self.type = type - - self.url = url - - self.bgColor = bgColor - - self.duration = duration - - self.autoDecideDuration = autoDecideDuration - - self.action = action - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bgColor = try container.decode(String.self, forKey: .bgColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - duration = try container.decode(Int.self, forKey: .duration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - autoDecideDuration = try container.decode(Bool.self, forKey: .autoDecideDuration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(Action.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(bgColor, forKey: .bgColor) - - - - try? container.encodeIfPresent(duration, forKey: .duration) - - - - try? container.encodeIfPresent(autoDecideDuration, forKey: .autoDecideDuration) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - } - - } - - /* - Model: Slideshow - Used By: Content - */ - - class Slideshow: Codable { - - - public var data: SlideshowSchema? - - public var success: Bool? - - - public enum CodingKeys: String, CodingKey { - - case data = "data" - - case success = "success" - - } - - public init(data: SlideshowSchema?, success: Bool?) { - - self.data = data - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - data = try container.decode(SlideshowSchema.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(data, forKey: .data) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: AnnouncementsResponseSchema - Used By: Content - */ - - class AnnouncementsResponseSchema: Codable { - - - public var announcements: [String: [AnnouncementSchema]]? - - public var refreshRate: Int? - - public var refreshPages: [String]? - - - public enum CodingKeys: String, CodingKey { - - case announcements = "announcements" - - case refreshRate = "refresh_rate" - - case refreshPages = "refresh_pages" - - } - - public init(announcements: [String: [AnnouncementSchema]]?, refreshPages: [String]?, refreshRate: Int?) { - - self.announcements = announcements - - self.refreshRate = refreshRate - - self.refreshPages = refreshPages - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - announcements = try container.decode([String: [AnnouncementSchema]].self, forKey: .announcements) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refreshRate = try container.decode(Int.self, forKey: .refreshRate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refreshPages = try container.decode([String].self, forKey: .refreshPages) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(announcements, forKey: .announcements) - - - - try? container.encodeIfPresent(refreshRate, forKey: .refreshRate) - - - - try? container.encodeIfPresent(refreshPages, forKey: .refreshPages) - - - } - - } - - /* - Model: FaqResponseSchema - Used By: Content - */ - - class FaqResponseSchema: Codable { - - - public var faqs: [FaqSchema]? - - - public enum CodingKeys: String, CodingKey { - - case faqs = "faqs" - - } - - public init(faqs: [FaqSchema]?) { - - self.faqs = faqs - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - faqs = try container.decode([FaqSchema].self, forKey: .faqs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(faqs, forKey: .faqs) - - - } - - } - - /* - Model: UpdateHandpickedSchema - Used By: Content - */ - - class UpdateHandpickedSchema: Codable { - - - public var tag: HandpickedTagSchema? - - - public enum CodingKeys: String, CodingKey { - - case tag = "tag" - - } - - public init(tag: HandpickedTagSchema?) { - - self.tag = tag - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - tag = try container.decode(HandpickedTagSchema.self, forKey: .tag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(tag, forKey: .tag) - - - } - - } - - /* - Model: HandpickedTagSchema - Used By: Content - */ - - class HandpickedTagSchema: Codable { - - - public var position: String? - - public var attributes: [String: Any]? - - public var name: String? - - public var url: String? - - public var type: String? - - public var subType: String? - - public var content: String? - - - public enum CodingKeys: String, CodingKey { - - case position = "position" - - case attributes = "attributes" - - case name = "name" - - case url = "url" - - case type = "type" - - case subType = "sub_type" - - case content = "content" - - } - - public init(attributes: [String: Any]?, content: String?, name: String?, position: String?, subType: String?, type: String?, url: String?) { - - self.position = position - - self.attributes = attributes - - self.name = name - - self.url = url - - self.type = type - - self.subType = subType - - self.content = content - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - position = try container.decode(String.self, forKey: .position) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attributes = try container.decode([String: Any].self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subType = try container.decode(String.self, forKey: .subType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode(String.self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(position, forKey: .position) - - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(subType, forKey: .subType) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - } - - } - - /* - Model: RemoveHandpickedSchema - Used By: Content - */ - - class RemoveHandpickedSchema: Codable { - - - public var tags: [String]? - - - public enum CodingKeys: String, CodingKey { - - case tags = "tags" - - } - - public init(tags: [String]?) { - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: CreateTagSchema - Used By: Content - */ - - class CreateTagSchema: Codable { - - - public var name: String? - - public var subType: String? - - public var id: String? - - public var type: String? - - public var url: String? - - public var position: String? - - public var attributes: [String: Any]? - - public var content: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case subType = "sub_type" - - case id = "_id" - - case type = "type" - - case url = "url" - - case position = "position" - - case attributes = "attributes" - - case content = "content" - - } - - public init(attributes: [String: Any]?, content: String?, name: String?, position: String?, subType: String?, type: String?, url: String?, id: String?) { - - self.name = name - - self.subType = subType - - self.id = id - - self.type = type - - self.url = url - - self.position = position - - self.attributes = attributes - - self.content = content - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subType = try container.decode(String.self, forKey: .subType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - position = try container.decode(String.self, forKey: .position) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attributes = try container.decode([String: Any].self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode(String.self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(subType, forKey: .subType) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(position, forKey: .position) - - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - } - - } - - /* - Model: CreateTagRequestSchema - Used By: Content - */ - - class CreateTagRequestSchema: Codable { - - - public var tags: [CreateTagSchema]? - - - public enum CodingKeys: String, CodingKey { - - case tags = "tags" - - } - - public init(tags: [CreateTagSchema]?) { - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - tags = try container.decode([CreateTagSchema].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: TagDeleteSuccessResponse - Used By: Content - */ - - class TagDeleteSuccessResponse: Codable { - - - public var success: Bool? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - } - - public init(success: Bool?) { - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: APIError - Used By: Content - */ - - class APIError: Codable { - - - public var message: String? - - public var status: Double? - - public var code: String? - - public var exception: String? - - public var info: String? - - public var requestId: String? - - public var stackTrace: String? - - public var meta: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - case status = "status" - - case code = "code" - - case exception = "exception" - - case info = "info" - - case requestId = "request_id" - - case stackTrace = "stack_trace" - - case meta = "meta" - - } - - public init(code: String?, exception: String?, info: String?, message: String?, meta: [String: Any]?, requestId: String?, stackTrace: String?, status: Double?) { - - self.message = message - - self.status = status - - self.code = code - - self.exception = exception - - self.info = info - - self.requestId = requestId - - self.stackTrace = stackTrace - - self.meta = meta - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(Double.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - exception = try container.decode(String.self, forKey: .exception) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - info = try container.decode(String.self, forKey: .info) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requestId = try container.decode(String.self, forKey: .requestId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stackTrace = try container.decode(String.self, forKey: .stackTrace) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(exception, forKey: .exception) - - - - try? container.encodeIfPresent(info, forKey: .info) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(stackTrace, forKey: .stackTrace) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - } - - } - - /* - Model: CategorySchema - Used By: Content - */ - - class CategorySchema: Codable { - - - public var index: Int? - - public var title: String? - - public var description: String? - - public var children: [String]? - - public var id: String? - - public var slug: String? - - public var application: String? - - public var iconUrl: String? - - public var customJson: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case index = "index" - - case title = "title" - - case description = "description" - - case children = "children" - - case id = "_id" - - case slug = "slug" - - case application = "application" - - case iconUrl = "icon_url" - - case customJson = "_custom_json" - - } - - public init(application: String?, children: [String]?, description: String?, iconUrl: String?, index: Int?, slug: String?, title: String?, customJson: [String: Any]?, id: String?) { - - self.index = index - - self.title = title - - self.description = description - - self.children = children - - self.id = id - - self.slug = slug - - self.application = application - - self.iconUrl = iconUrl - - self.customJson = customJson - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - index = try container.decode(Int.self, forKey: .index) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - children = try container.decode([String].self, forKey: .children) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - iconUrl = try container.decode(String.self, forKey: .iconUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(index, forKey: .index) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(children, forKey: .children) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(iconUrl, forKey: .iconUrl) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - } - - } - - /* - Model: ChildrenSchema - Used By: Content - */ - - class ChildrenSchema: Codable { - - - public var question: String? - - public var answer: String? - - public var slug: String? - - public var application: String? - - public var id: String? - - - public enum CodingKeys: String, CodingKey { - - case question = "question" - - case answer = "answer" - - case slug = "slug" - - case application = "application" - - case id = "_id" - - } - - public init(answer: String?, application: String?, question: String?, slug: String?, id: String?) { - - self.question = question - - self.answer = answer - - self.slug = slug - - self.application = application - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - question = try container.decode(String.self, forKey: .question) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - answer = try container.decode(String.self, forKey: .answer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(question, forKey: .question) - - - - try? container.encodeIfPresent(answer, forKey: .answer) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: CategoryRequestSchema - Used By: Content - */ - - class CategoryRequestSchema: Codable { - - - public var slug: String? - - public var title: String? - - - public enum CodingKeys: String, CodingKey { - - case slug = "slug" - - case title = "title" - - } - - public init(slug: String?, title: String?) { - - self.slug = slug - - self.title = title - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - } - - } - - /* - Model: FAQCategorySchema - Used By: Content - */ - - class FAQCategorySchema: Codable { - - - public var index: Int? - - public var title: String? - - public var description: String? - - public var children: [ChildrenSchema]? - - public var id: String? - - public var slug: String? - - public var application: String? - - public var iconUrl: String? - - public var customJson: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case index = "index" - - case title = "title" - - case description = "description" - - case children = "children" - - case id = "_id" - - case slug = "slug" - - case application = "application" - - case iconUrl = "icon_url" - - case customJson = "_custom_json" - - } - - public init(application: String?, children: [ChildrenSchema]?, description: String?, iconUrl: String?, index: Int?, slug: String?, title: String?, customJson: [String: Any]?, id: String?) { - - self.index = index - - self.title = title - - self.description = description - - self.children = children - - self.id = id - - self.slug = slug - - self.application = application - - self.iconUrl = iconUrl - - self.customJson = customJson - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - index = try container.decode(Int.self, forKey: .index) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - children = try container.decode([ChildrenSchema].self, forKey: .children) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - iconUrl = try container.decode(String.self, forKey: .iconUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(index, forKey: .index) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(children, forKey: .children) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(iconUrl, forKey: .iconUrl) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - } - - } - - /* - Model: FaqSchema - Used By: Content - */ - - class FaqSchema: Codable { - - - public var slug: String? - - public var application: String? - - public var id: String? - - public var question: String? - - public var answer: String? - - - public enum CodingKeys: String, CodingKey { - - case slug = "slug" - - case application = "application" - - case id = "_id" - - case question = "question" - - case answer = "answer" - - } - - public init(answer: String?, application: String?, question: String?, slug: String?, id: String?) { - - self.slug = slug - - self.application = application - - self.id = id - - self.question = question - - self.answer = answer - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - question = try container.decode(String.self, forKey: .question) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - answer = try container.decode(String.self, forKey: .answer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(question, forKey: .question) - - - - try? container.encodeIfPresent(answer, forKey: .answer) - - - } - - } - - /* - Model: FAQ - Used By: Content - */ - - class FAQ: Codable { - - - public var slug: String? - - public var question: String? - - public var answer: String? - - - public enum CodingKeys: String, CodingKey { - - case slug = "slug" - - case question = "question" - - case answer = "answer" - - } - - public init(answer: String?, question: String?, slug: String?) { - - self.slug = slug - - self.question = question - - self.answer = answer - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - question = try container.decode(String.self, forKey: .question) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - answer = try container.decode(String.self, forKey: .answer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(question, forKey: .question) - - - - try? container.encodeIfPresent(answer, forKey: .answer) - - - } - - } - - /* - Model: CreateFaqResponseSchema - Used By: Content - */ - - class CreateFaqResponseSchema: Codable { - - - public var faq: FaqSchema? - - - public enum CodingKeys: String, CodingKey { - - case faq = "faq" - - } - - public init(faq: FaqSchema?) { - - self.faq = faq - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - faq = try container.decode(FaqSchema.self, forKey: .faq) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(faq, forKey: .faq) - - - } - - } - - /* - Model: CreateFaqSchema - Used By: Content - */ - - class CreateFaqSchema: Codable { - - - public var faq: FAQ? - - - public enum CodingKeys: String, CodingKey { - - case faq = "faq" - - } - - public init(faq: FAQ?) { - - self.faq = faq - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - faq = try container.decode(FAQ.self, forKey: .faq) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(faq, forKey: .faq) - - - } - - } - - /* - Model: GetFaqSchema - Used By: Content - */ - - class GetFaqSchema: Codable { - - - public var faqs: [FaqSchema]? - - - public enum CodingKeys: String, CodingKey { - - case faqs = "faqs" - - } - - public init(faqs: [FaqSchema]?) { - - self.faqs = faqs - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - faqs = try container.decode([FaqSchema].self, forKey: .faqs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(faqs, forKey: .faqs) - - - } - - } - - /* - Model: UpdateFaqCategoryRequestSchema - Used By: Content - */ - - class UpdateFaqCategoryRequestSchema: Codable { - - - public var category: CategorySchema? - - - public enum CodingKeys: String, CodingKey { - - case category = "category" - - } - - public init(category: CategorySchema?) { - - self.category = category - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - category = try container.decode(CategorySchema.self, forKey: .category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(category, forKey: .category) - - - } - - } - - /* - Model: CreateFaqCategoryRequestSchema - Used By: Content - */ - - class CreateFaqCategoryRequestSchema: Codable { - - - public var category: CategoryRequestSchema? - - - public enum CodingKeys: String, CodingKey { - - case category = "category" - - } - - public init(category: CategoryRequestSchema?) { - - self.category = category - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - category = try container.decode(CategoryRequestSchema.self, forKey: .category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(category, forKey: .category) - - - } - - } - - /* - Model: CreateFaqCategorySchema - Used By: Content - */ - - class CreateFaqCategorySchema: Codable { - - - public var category: CategorySchema? - - - public enum CodingKeys: String, CodingKey { - - case category = "category" - - } - - public init(category: CategorySchema?) { - - self.category = category - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - category = try container.decode(CategorySchema.self, forKey: .category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(category, forKey: .category) - - - } - - } - - /* - Model: GetFaqCategoriesSchema - Used By: Content - */ - - class GetFaqCategoriesSchema: Codable { - - - public var categories: [CategorySchema]? - - - public enum CodingKeys: String, CodingKey { - - case categories = "categories" - - } - - public init(categories: [CategorySchema]?) { - - self.categories = categories - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - categories = try container.decode([CategorySchema].self, forKey: .categories) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(categories, forKey: .categories) - - - } - - } - - /* - Model: GetFaqCategoryBySlugSchema - Used By: Content - */ - - class GetFaqCategoryBySlugSchema: Codable { - - - public var category: FAQCategorySchema? - - - public enum CodingKeys: String, CodingKey { - - case category = "category" - - } - - public init(category: FAQCategorySchema?) { - - self.category = category - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - category = try container.decode(FAQCategorySchema.self, forKey: .category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(category, forKey: .category) - - - } - - } - - /* - Model: LandingPageGetResponse - Used By: Content - */ - - class LandingPageGetResponse: Codable { - - - public var items: [LandingPageSchema]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [LandingPageSchema]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([LandingPageSchema].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: LandingPageSchema - Used By: Content - */ - - class LandingPageSchema: Codable { - - - public var slug: String? - - public var action: Action? - - public var platform: [String]? - - public var createdBy: CreatedBySchema? - - public var dateMeta: DateMeta? - - public var id: String? - - public var application: String? - - public var archived: Bool? - - public var customJson: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case slug = "slug" - - case action = "action" - - case platform = "platform" - - case createdBy = "created_by" - - case dateMeta = "date_meta" - - case id = "_id" - - case application = "application" - - case archived = "archived" - - case customJson = "_custom_json" - - } - - public init(action: Action?, application: String?, archived: Bool?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, platform: [String]?, slug: String?, customJson: [String: Any]?, id: String?) { - - self.slug = slug - - self.action = action - - self.platform = platform - - self.createdBy = createdBy - - self.dateMeta = dateMeta - - self.id = id - - self.application = application - - self.archived = archived - - self.customJson = customJson - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(Action.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode([String].self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archived = try container.decode(Bool.self, forKey: .archived) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(archived, forKey: .archived) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - } - - } - - /* - Model: DefaultNavigationResponse - Used By: Content - */ - - class DefaultNavigationResponse: Codable { - - - public var items: [NavigationSchema]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - } - - public init(items: [NavigationSchema]?) { - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([NavigationSchema].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: NavigationGetResponse - Used By: Content - */ - - class NavigationGetResponse: Codable { - - - public var items: [NavigationSchema]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [NavigationSchema]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([NavigationSchema].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: Orientation - Used By: Content - */ - - class Orientation: Codable { - - - public var portrait: [String]? - - public var landscape: [String]? - - - public enum CodingKeys: String, CodingKey { - - case portrait = "portrait" - - case landscape = "landscape" - - } - - public init(landscape: [String]?, portrait: [String]?) { - - self.portrait = portrait - - self.landscape = landscape - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - portrait = try container.decode([String].self, forKey: .portrait) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - landscape = try container.decode([String].self, forKey: .landscape) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(portrait, forKey: .portrait) - - - - try? container.encodeIfPresent(landscape, forKey: .landscape) - - - } - - } - - /* - Model: NavigationSchema - Used By: Content - */ - - class NavigationSchema: Codable { - - - public var id: String? - - public var application: String? - - public var archived: Bool? - - public var name: String? - - public var slug: String? - - public var platform: [String]? - - public var createdBy: CreatedBySchema? - - public var dateMeta: DateMeta? - - public var orientation: Orientation? - - public var version: Double? - - public var navigation: [NavigationReference]? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case application = "application" - - case archived = "archived" - - case name = "name" - - case slug = "slug" - - case platform = "platform" - - case createdBy = "created_by" - - case dateMeta = "date_meta" - - case orientation = "orientation" - - case version = "version" - - case navigation = "navigation" - - } - - public init(application: String?, archived: Bool?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, name: String?, navigation: [NavigationReference]?, orientation: Orientation?, platform: [String]?, slug: String?, version: Double?, id: String?) { - - self.id = id - - self.application = application - - self.archived = archived - - self.name = name - - self.slug = slug - - self.platform = platform - - self.createdBy = createdBy - - self.dateMeta = dateMeta - - self.orientation = orientation - - self.version = version - - self.navigation = navigation - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archived = try container.decode(Bool.self, forKey: .archived) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode([String].self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orientation = try container.decode(Orientation.self, forKey: .orientation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - version = try container.decode(Double.self, forKey: .version) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - navigation = try container.decode([NavigationReference].self, forKey: .navigation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(archived, forKey: .archived) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(orientation, forKey: .orientation) - - - - try? container.encodeIfPresent(version, forKey: .version) - - - - try? container.encodeIfPresent(navigation, forKey: .navigation) - - - } - - } - - /* - Model: NavigationRequest - Used By: Content - */ - - class NavigationRequest: Codable { - - - public var name: String? - - public var slug: String? - - public var platform: [String]? - - public var orientation: Orientation? - - public var navigation: [NavigationReference]? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case slug = "slug" - - case platform = "platform" - - case orientation = "orientation" - - case navigation = "navigation" - - } - - public init(name: String?, navigation: [NavigationReference]?, orientation: Orientation?, platform: [String]?, slug: String?) { - - self.name = name - - self.slug = slug - - self.platform = platform - - self.orientation = orientation - - self.navigation = navigation - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode([String].self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orientation = try container.decode(Orientation.self, forKey: .orientation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - navigation = try container.decode([NavigationReference].self, forKey: .navigation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - - try? container.encodeIfPresent(orientation, forKey: .orientation) - - - - try? container.encodeIfPresent(navigation, forKey: .navigation) - - - } - - } - - /* - Model: CustomPageSchema - Used By: Content - */ - - class CustomPageSchema: Codable { - - - public var id: String? - - public var platform: String? - - public var title: String? - - public var slug: String? - - public var type: String? - - public var orientation: String? - - public var application: String? - - public var description: String? - - public var published: Bool? - - public var tags: [String]? - - public var content: [[String: Any]]? - - public var createdBy: CreatedBySchema? - - public var dateMeta: DateMeta? - - public var schedule: ScheduleSchema? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case platform = "platform" - - case title = "title" - - case slug = "slug" - - case type = "type" - - case orientation = "orientation" - - case application = "application" - - case description = "description" - - case published = "published" - - case tags = "tags" - - case content = "content" - - case createdBy = "created_by" - - case dateMeta = "date_meta" - - case schedule = "_schedule" - - } - - public init(application: String?, content: [[String: Any]]?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, description: String?, orientation: String?, platform: String?, published: Bool?, slug: String?, tags: [String]?, title: String?, type: String?, id: String?, schedule: ScheduleSchema?) { - - self.id = id - - self.platform = platform - - self.title = title - - self.slug = slug - - self.type = type - - self.orientation = orientation - - self.application = application - - self.description = description - - self.published = published - - self.tags = tags - - self.content = content - - self.createdBy = createdBy - - self.dateMeta = dateMeta - - self.schedule = schedule - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode(String.self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orientation = try container.decode(String.self, forKey: .orientation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode([[String: Any]].self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode(ScheduleSchema.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(orientation, forKey: .orientation) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - } - - } - - /* - Model: ContentSchema - Used By: Content - */ - - class ContentSchema: Codable { - - - public var type: String? - - public var value: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case value = "value" - - } - - public init(type: String?, value: [String: Any]?) { - - self.type = type - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode([String: Any].self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: CustomPage - Used By: Content - */ - - class CustomPage: Codable { - - - public var data: CustomPageSchema? - - - public enum CodingKeys: String, CodingKey { - - case data = "data" - - } - - public init(data: CustomPageSchema?) { - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - data = try container.decode(CustomPageSchema.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: FeatureImage - Used By: Content - */ - - class FeatureImage: Codable { - - - public var secureUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case secureUrl = "secure_url" - - } - - public init(secureUrl: String?) { - - self.secureUrl = secureUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - secureUrl = try container.decode(String.self, forKey: .secureUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) - - - } - - } - - /* - Model: PageGetResponse - Used By: Content - */ - - class PageGetResponse: Codable { - - - public var items: [PageSchema]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [PageSchema]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([PageSchema].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: PageSpec - Used By: Content - */ - - class PageSpec: Codable { - - - public var specifications: [PageSpecItem]? - - - public enum CodingKeys: String, CodingKey { - - case specifications = "specifications" - - } - - public init(specifications: [PageSpecItem]?) { - - self.specifications = specifications - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - specifications = try container.decode([PageSpecItem].self, forKey: .specifications) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(specifications, forKey: .specifications) - - - } - - } - - /* - Model: PageSpecParam - Used By: Content - */ - - class PageSpecParam: Codable { - - - public var key: String? - - public var required: Bool? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case required = "required" - - } - - public init(key: String?, required: Bool?) { - - self.key = key - - self.required = required - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - required = try container.decode(Bool.self, forKey: .required) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(required, forKey: .required) - - - } - - } - - /* - Model: PageSpecItem - Used By: Content - */ - - class PageSpecItem: Codable { - - - public var pageType: String? - - public var displayName: String? - - public var params: [PageSpecParam]? - - public var query: [PageSpecParam]? - - - public enum CodingKeys: String, CodingKey { - - case pageType = "page_type" - - case displayName = "display_name" - - case params = "params" - - case query = "query" - - } - - public init(displayName: String?, pageType: String?, params: [PageSpecParam]?, query: [PageSpecParam]?) { - - self.pageType = pageType - - self.displayName = displayName - - self.params = params - - self.query = query - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pageType = try container.decode(String.self, forKey: .pageType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - params = try container.decode([PageSpecParam].self, forKey: .params) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - query = try container.decode([PageSpecParam].self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pageType, forKey: .pageType) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(params, forKey: .params) - - - - try? container.encodeIfPresent(query, forKey: .query) - - - } - - } - - /* - Model: PageSchema - Used By: Content - */ - - class PageSchema: Codable { - - - public var id: String? - - public var application: String? - - public var componentIds: [String]? - - public var content: [[String: Any]]? - - public var createdBy: CreatedBySchema? - - public var dateMeta: DateMeta? - - public var description: String? - - public var featureImage: Asset? - - public var pageMeta: [[String: Any]]? - - public var schedule: ScheduleSchema? - - public var customJson: [String: Any]? - - public var orientation: String? - - public var platform: String? - - public var published: Bool? - - public var slug: String? - - public var tags: [String]? - - public var title: String? - - public var type: String? - - public var seo: SEO? - - public var visibility: [String: Any]? - - public var archived: Bool? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case application = "application" - - case componentIds = "component_ids" - - case content = "content" - - case createdBy = "created_by" - - case dateMeta = "date_meta" - - case description = "description" - - case featureImage = "feature_image" - - case pageMeta = "page_meta" - - case schedule = "_schedule" - - case customJson = "_custom_json" - - case orientation = "orientation" - - case platform = "platform" - - case published = "published" - - case slug = "slug" - - case tags = "tags" - - case title = "title" - - case type = "type" - - case seo = "seo" - - case visibility = "visibility" - - case archived = "archived" - - } - - public init(application: String?, archived: Bool?, componentIds: [String]?, content: [[String: Any]]?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, description: String?, featureImage: Asset?, orientation: String?, pageMeta: [[String: Any]]?, platform: String?, published: Bool?, seo: SEO?, slug: String?, tags: [String]?, title: String?, type: String?, visibility: [String: Any]?, customJson: [String: Any]?, id: String?, schedule: ScheduleSchema?) { - - self.id = id - - self.application = application - - self.componentIds = componentIds - - self.content = content - - self.createdBy = createdBy - - self.dateMeta = dateMeta - - self.description = description - - self.featureImage = featureImage - - self.pageMeta = pageMeta - - self.schedule = schedule - - self.customJson = customJson - - self.orientation = orientation - - self.platform = platform - - self.published = published - - self.slug = slug - - self.tags = tags - - self.title = title - - self.type = type - - self.seo = seo - - self.visibility = visibility - - self.archived = archived - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - componentIds = try container.decode([String].self, forKey: .componentIds) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode([[String: Any]].self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - featureImage = try container.decode(Asset.self, forKey: .featureImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pageMeta = try container.decode([[String: Any]].self, forKey: .pageMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode(ScheduleSchema.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orientation = try container.decode(String.self, forKey: .orientation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode(String.self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - seo = try container.decode(SEO.self, forKey: .seo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - visibility = try container.decode([String: Any].self, forKey: .visibility) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archived = try container.decode(Bool.self, forKey: .archived) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(componentIds, forKey: .componentIds) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(featureImage, forKey: .featureImage) - - - - try? container.encodeIfPresent(pageMeta, forKey: .pageMeta) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(orientation, forKey: .orientation) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(seo, forKey: .seo) - - - - try? container.encodeIfPresent(visibility, forKey: .visibility) - - - - try? container.encodeIfPresent(archived, forKey: .archived) - - - } - - } - - /* - Model: CreatedBySchema - Used By: Content - */ - - class CreatedBySchema: Codable { - - - public var id: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - } - - public init(id: String?) { - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: PageContent - Used By: Content - */ - - class PageContent: Codable { - - - public var type: String? - - public var value: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case value = "value" - - } - - public init(type: String?, value: [String: Any]?) { - - self.type = type - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode([String: Any].self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: PageMeta - Used By: Content - */ - - class PageMeta: Codable { - - - public var key: String? - - public var value: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case value = "value" - - } - - public init(key: String?, value: [String: Any]?) { - - self.key = key - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode([String: Any].self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: PageRequest - Used By: Content - */ - - class PageRequest: Codable { - - - public var schedule: CronSchedule? - - public var application: String? - - public var author: Author? - - public var customJson: [String: Any]? - - public var orientation: String? - - public var content: [[String: Any]]? - - public var featureImage: Asset? - - public var published: Bool? - - public var readingTime: String? - - public var slug: String? - - public var tags: [String]? - - public var seo: SEO? - - public var title: String? - - - public enum CodingKeys: String, CodingKey { - - case schedule = "_schedule" - - case application = "application" - - case author = "author" - - case customJson = "_custom_json" - - case orientation = "orientation" - - case content = "content" - - case featureImage = "feature_image" - - case published = "published" - - case readingTime = "reading_time" - - case slug = "slug" - - case tags = "tags" - - case seo = "seo" - - case title = "title" - - } - - public init(application: String?, author: Author?, content: [[String: Any]]?, featureImage: Asset?, orientation: String?, published: Bool?, readingTime: String?, seo: SEO?, slug: String?, tags: [String]?, title: String?, customJson: [String: Any]?, schedule: CronSchedule?) { - - self.schedule = schedule - - self.application = application - - self.author = author - - self.customJson = customJson - - self.orientation = orientation - - self.content = content - - self.featureImage = featureImage - - self.published = published - - self.readingTime = readingTime - - self.slug = slug - - self.tags = tags - - self.seo = seo - - self.title = title - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - schedule = try container.decode(CronSchedule.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - author = try container.decode(Author.self, forKey: .author) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orientation = try container.decode(String.self, forKey: .orientation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode([[String: Any]].self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - featureImage = try container.decode(Asset.self, forKey: .featureImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - readingTime = try container.decode(String.self, forKey: .readingTime) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - seo = try container.decode(SEO.self, forKey: .seo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(author, forKey: .author) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(orientation, forKey: .orientation) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - - try? container.encodeIfPresent(featureImage, forKey: .featureImage) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(readingTime, forKey: .readingTime) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(seo, forKey: .seo) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - } - - } - - /* - Model: CronSchedule - Used By: Content - */ - - class CronSchedule: Codable { - - - public var cron: String? - - public var start: String? - - public var end: String? - - public var duration: Double? - - - public enum CodingKeys: String, CodingKey { - - case cron = "cron" - - case start = "start" - - case end = "end" - - case duration = "duration" - - } - - public init(cron: String?, duration: Double?, end: String?, start: String?) { - - self.cron = cron - - self.start = start - - self.end = end - - self.duration = duration - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cron = try container.decode(String.self, forKey: .cron) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - start = try container.decode(String.self, forKey: .start) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - end = try container.decode(String.self, forKey: .end) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - duration = try container.decode(Double.self, forKey: .duration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cron, forKey: .cron) - - - - try? container.encodeIfPresent(start, forKey: .start) - - - - try? container.encodeIfPresent(end, forKey: .end) - - - - try? container.encodeIfPresent(duration, forKey: .duration) - - - } - - } - - /* - Model: PagePublishRequest - Used By: Content - */ - - class PagePublishRequest: Codable { - - - public var publish: Bool? - - - public enum CodingKeys: String, CodingKey { - - case publish = "publish" - - } - - public init(publish: Bool?) { - - self.publish = publish - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - publish = try container.decode(Bool.self, forKey: .publish) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(publish, forKey: .publish) - - - } - - } - - /* - Model: PageMetaSchema - Used By: Content - */ - - class PageMetaSchema: Codable { - - - public var systemPages: [NavigationSchema]? - - public var customPages: [PageSchema]? - - public var applicationId: String? - - - public enum CodingKeys: String, CodingKey { - - case systemPages = "system_pages" - - case customPages = "custom_pages" - - case applicationId = "application_id" - - } - - public init(applicationId: String?, customPages: [PageSchema]?, systemPages: [NavigationSchema]?) { - - self.systemPages = systemPages - - self.customPages = customPages - - self.applicationId = applicationId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - systemPages = try container.decode([NavigationSchema].self, forKey: .systemPages) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customPages = try container.decode([PageSchema].self, forKey: .customPages) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - applicationId = try container.decode(String.self, forKey: .applicationId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(systemPages, forKey: .systemPages) - - - - try? container.encodeIfPresent(customPages, forKey: .customPages) - - - - try? container.encodeIfPresent(applicationId, forKey: .applicationId) - - - } - - } - - /* - Model: SlideshowGetResponse - Used By: Content - */ - - class SlideshowGetResponse: Codable { - - - public var items: [SlideshowSchema]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [SlideshowSchema]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([SlideshowSchema].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: SlideshowSchema - Used By: Content - */ - - class SlideshowSchema: Codable { - - - public var id: String? - - public var slug: String? - - public var dateMeta: DateMeta? - - public var application: String? - - public var platform: String? - - public var configuration: ConfigurationSchema? - - public var media: [SlideshowMedia]? - - public var active: Bool? - - public var archived: Bool? - - public var customJson: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case slug = "slug" - - case dateMeta = "date_meta" - - case application = "application" - - case platform = "platform" - - case configuration = "configuration" - - case media = "media" - - case active = "active" - - case archived = "archived" - - case customJson = "_custom_json" - - } - - public init(active: Bool?, application: String?, archived: Bool?, configuration: ConfigurationSchema?, dateMeta: DateMeta?, media: [SlideshowMedia]?, platform: String?, slug: String?, customJson: [String: Any]?, id: String?) { - - self.id = id - - self.slug = slug - - self.dateMeta = dateMeta - - self.application = application - - self.platform = platform - - self.configuration = configuration - - self.media = media - - self.active = active - - self.archived = archived - - self.customJson = customJson - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode(String.self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - configuration = try container.decode(ConfigurationSchema.self, forKey: .configuration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - media = try container.decode([SlideshowMedia].self, forKey: .media) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archived = try container.decode(Bool.self, forKey: .archived) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - - try? container.encodeIfPresent(configuration, forKey: .configuration) - - - - try? container.encodeIfPresent(media, forKey: .media) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(archived, forKey: .archived) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - } - - } - - /* - Model: SlideshowRequest - Used By: Content - */ - - class SlideshowRequest: Codable { - - - public var slug: String? - - public var platform: String? - - public var configuration: ConfigurationSchema? - - public var media: SlideshowMedia? - - public var active: Bool? - - - public enum CodingKeys: String, CodingKey { - - case slug = "slug" - - case platform = "platform" - - case configuration = "configuration" - - case media = "media" - - case active = "active" - - } - - public init(active: Bool?, configuration: ConfigurationSchema?, media: SlideshowMedia?, platform: String?, slug: String?) { - - self.slug = slug - - self.platform = platform - - self.configuration = configuration - - self.media = media - - self.active = active - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode(String.self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - configuration = try container.decode(ConfigurationSchema.self, forKey: .configuration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - media = try container.decode(SlideshowMedia.self, forKey: .media) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - - try? container.encodeIfPresent(configuration, forKey: .configuration) - - - - try? container.encodeIfPresent(media, forKey: .media) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - } - - } - - /* - Model: Support - Used By: Content - */ - - class Support: Codable { - - - public var created: Bool? - - public var id: String? - - public var configType: String? - - public var application: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var contact: ContactSchema? - - - public enum CodingKeys: String, CodingKey { - - case created = "created" - - case id = "_id" - - case configType = "config_type" - - case application = "application" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case contact = "contact" - - } - - public init(application: String?, configType: String?, contact: ContactSchema?, created: Bool?, createdAt: String?, updatedAt: String?, id: String?) { - - self.created = created - - self.id = id - - self.configType = configType - - self.application = application - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.contact = contact - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - created = try container.decode(Bool.self, forKey: .created) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - configType = try container.decode(String.self, forKey: .configType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contact = try container.decode(ContactSchema.self, forKey: .contact) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(created, forKey: .created) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(configType, forKey: .configType) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(contact, forKey: .contact) - - - } - - } - - /* - Model: PhoneProperties - Used By: Content - */ - - class PhoneProperties: Codable { - - - public var key: String? - - public var code: String? - - public var number: String? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case code = "code" - - case number = "number" - - } - - public init(code: String?, key: String?, number: String?) { - - self.key = key - - self.code = code - - self.number = number - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - number = try container.decode(String.self, forKey: .number) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(number, forKey: .number) - - - } - - } - - /* - Model: PhoneSchema - Used By: Content - */ - - class PhoneSchema: Codable { - - - public var active: Bool? - - public var phone: [PhoneProperties]? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case phone = "phone" - - } - - public init(active: Bool?, phone: [PhoneProperties]?) { - - self.active = active - - self.phone = phone - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode([PhoneProperties].self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - } - - } - - /* - Model: EmailProperties - Used By: Content - */ - - class EmailProperties: Codable { - - - public var key: String? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case value = "value" - - } - - public init(key: String?, value: String?) { - - self.key = key - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: EmailSchema - Used By: Content - */ - - class EmailSchema: Codable { - - - public var active: Bool? - - public var email: [EmailProperties]? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case email = "email" - - } - - public init(active: Bool?, email: [EmailProperties]?) { - - self.active = active - - self.email = email - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode([EmailProperties].self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - } - - } - - /* - Model: ContactSchema - Used By: Content - */ - - class ContactSchema: Codable { - - - public var phone: PhoneSchema? - - public var email: EmailSchema? - - - public enum CodingKeys: String, CodingKey { - - case phone = "phone" - - case email = "email" - - } - - public init(email: EmailSchema?, phone: PhoneSchema?) { - - self.phone = phone - - self.email = email - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - phone = try container.decode(PhoneSchema.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(EmailSchema.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - } - - } - - /* - Model: TagsSchema - Used By: Content - */ - - class TagsSchema: Codable { - - - public var application: String? - - public var id: String? - - public var tags: [TagSchema]? - - - public enum CodingKeys: String, CodingKey { - - case application = "application" - - case id = "_id" - - case tags = "tags" - - } - - public init(application: String?, tags: [TagSchema]?, id: String?) { - - self.application = application - - self.id = id - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([TagSchema].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: TagSchema - Used By: Content - */ - - class TagSchema: Codable { - - - public var name: String? - - public var url: String? - - public var type: String? - - public var subType: String? - - public var id: String? - - public var position: String? - - public var attributes: [String: Any]? - - public var content: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case url = "url" - - case type = "type" - - case subType = "sub_type" - - case id = "_id" - - case position = "position" - - case attributes = "attributes" - - case content = "content" - - } - - public init(attributes: [String: Any]?, content: String?, name: String?, position: String?, subType: String?, type: String?, url: String?, id: String?) { - - self.name = name - - self.url = url - - self.type = type - - self.subType = subType - - self.id = id - - self.position = position - - self.attributes = attributes - - self.content = content - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subType = try container.decode(String.self, forKey: .subType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - position = try container.decode(String.self, forKey: .position) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attributes = try container.decode([String: Any].self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - content = try container.decode(String.self, forKey: .content) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(subType, forKey: .subType) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(position, forKey: .position) - - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - - try? container.encodeIfPresent(content, forKey: .content) - - - } - - } - - - - /* - Model: UnauthenticatedUser - Used By: Billing - */ - - class UnauthenticatedUser: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: UnauthenticatedApplication - Used By: Billing - */ - - class UnauthenticatedApplication: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: BadRequest - Used By: Billing - */ - - class BadRequest: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: ResourceNotFound - Used By: Billing - */ - - class ResourceNotFound: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: InternalServerError - Used By: Billing - */ - - class InternalServerError: Codable { - - - public var message: String? - - public var code: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - case code = "code" - - } - - public init(code: String?, message: String?) { - - self.message = message - - self.code = code - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - } - - } - - /* - Model: PlanRecurring - Used By: Billing - */ - - class PlanRecurring: Codable { - - - public var interval: String? - - public var intervalCount: Double? - - - public enum CodingKeys: String, CodingKey { - - case interval = "interval" - - case intervalCount = "interval_count" - - } - - public init(interval: String?, intervalCount: Double?) { - - self.interval = interval - - self.intervalCount = intervalCount - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - interval = try container.decode(String.self, forKey: .interval) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - intervalCount = try container.decode(Double.self, forKey: .intervalCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(interval, forKey: .interval) - - - - try? container.encodeIfPresent(intervalCount, forKey: .intervalCount) - - - } - - } - - /* - Model: Plan - Used By: Billing - */ - - class Plan: Codable { - - - public var recurring: PlanRecurring? - - public var isTrialPlan: Bool? - - public var planGroup: String? - - public var tagLines: [String]? - - public var currency: String? - - public var isActive: Bool? - - public var isVisible: Bool? - - public var trialPeriod: Double? - - public var addons: [String]? - - public var tags: [String]? - - public var type: String? - - public var country: String? - - public var id: String? - - public var name: String? - - public var description: String? - - public var amount: Double? - - public var productSuiteId: String? - - public var createdAt: String? - - public var modifiedAt: String? - - - public enum CodingKeys: String, CodingKey { - - case recurring = "recurring" - - case isTrialPlan = "is_trial_plan" - - case planGroup = "plan_group" - - case tagLines = "tag_lines" - - case currency = "currency" - - case isActive = "is_active" - - case isVisible = "is_visible" - - case trialPeriod = "trial_period" - - case addons = "addons" - - case tags = "tags" - - case type = "type" - - case country = "country" - - case id = "_id" - - case name = "name" - - case description = "description" - - case amount = "amount" - - case productSuiteId = "product_suite_id" - - case createdAt = "created_at" - - case modifiedAt = "modified_at" - - } - - public init(addons: [String]?, amount: Double?, country: String?, createdAt: String?, currency: String?, description: String?, isActive: Bool?, isTrialPlan: Bool?, isVisible: Bool?, modifiedAt: String?, name: String?, planGroup: String?, productSuiteId: String?, recurring: PlanRecurring?, tags: [String]?, tagLines: [String]?, trialPeriod: Double?, type: String?, id: String?) { - - self.recurring = recurring - - self.isTrialPlan = isTrialPlan - - self.planGroup = planGroup - - self.tagLines = tagLines - - self.currency = currency - - self.isActive = isActive - - self.isVisible = isVisible - - self.trialPeriod = trialPeriod - - self.addons = addons - - self.tags = tags - - self.type = type - - self.country = country - - self.id = id - - self.name = name - - self.description = description - - self.amount = amount - - self.productSuiteId = productSuiteId - - self.createdAt = createdAt - - self.modifiedAt = modifiedAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - recurring = try container.decode(PlanRecurring.self, forKey: .recurring) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isTrialPlan = try container.decode(Bool.self, forKey: .isTrialPlan) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - planGroup = try container.decode(String.self, forKey: .planGroup) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tagLines = try container.decode([String].self, forKey: .tagLines) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(String.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isVisible = try container.decode(Bool.self, forKey: .isVisible) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - trialPeriod = try container.decode(Double.self, forKey: .trialPeriod) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addons = try container.decode([String].self, forKey: .addons) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - amount = try container.decode(Double.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productSuiteId = try container.decode(String.self, forKey: .productSuiteId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedAt = try container.decode(String.self, forKey: .modifiedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(recurring, forKey: .recurring) - - - - try? container.encodeIfPresent(isTrialPlan, forKey: .isTrialPlan) - - - - try? container.encodeIfPresent(planGroup, forKey: .planGroup) - - - - try? container.encodeIfPresent(tagLines, forKey: .tagLines) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(isVisible, forKey: .isVisible) - - - - try? container.encodeIfPresent(trialPeriod, forKey: .trialPeriod) - - - - try? container.encodeIfPresent(addons, forKey: .addons) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(productSuiteId, forKey: .productSuiteId) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) - - - } - - } - - /* - Model: DetailedPlanComponents - Used By: Billing - */ - - class DetailedPlanComponents: Codable { - - - public var name: String? - - public var slug: String? - - public var description: String? - - public var group: String? - - public var icon: String? - - public var links: [String: Any]? - - public var enabled: Bool? - - public var displayText: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case slug = "slug" - - case description = "description" - - case group = "group" - - case icon = "icon" - - case links = "links" - - case enabled = "enabled" - - case displayText = "display_text" - - } - - public init(description: String?, displayText: String?, enabled: Bool?, group: String?, icon: String?, links: [String: Any]?, name: String?, slug: String?) { - - self.name = name - - self.slug = slug - - self.description = description - - self.group = group - - self.icon = icon - - self.links = links - - self.enabled = enabled - - self.displayText = displayText - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - group = try container.decode(String.self, forKey: .group) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - links = try container.decode([String: Any].self, forKey: .links) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayText = try container.decode(String.self, forKey: .displayText) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(group, forKey: .group) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(links, forKey: .links) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(displayText, forKey: .displayText) - - - } - - } - - /* - Model: DetailedPlan - Used By: Billing - */ - - class DetailedPlan: Codable { - - - public var recurring: PlanRecurring? - - public var isTrialPlan: Bool? - - public var planGroup: String? - - public var tagLines: [String]? - - public var currency: String? - - public var isActive: Bool? - - public var isVisible: Bool? - - public var trialPeriod: Double? - - public var addons: [String]? - - public var tags: [String]? - - public var type: String? - - public var country: String? - - public var id: String? - - public var name: String? - - public var description: String? - - public var amount: Double? - - public var productSuiteId: String? - - public var createdAt: String? - - public var modifiedAt: String? - - public var components: [DetailedPlanComponents]? - - - public enum CodingKeys: String, CodingKey { - - case recurring = "recurring" - - case isTrialPlan = "is_trial_plan" - - case planGroup = "plan_group" - - case tagLines = "tag_lines" - - case currency = "currency" - - case isActive = "is_active" - - case isVisible = "is_visible" - - case trialPeriod = "trial_period" - - case addons = "addons" - - case tags = "tags" - - case type = "type" - - case country = "country" - - case id = "_id" - - case name = "name" - - case description = "description" - - case amount = "amount" - - case productSuiteId = "product_suite_id" - - case createdAt = "created_at" - - case modifiedAt = "modified_at" - - case components = "components" - - } - - public init(addons: [String]?, amount: Double?, components: [DetailedPlanComponents]?, country: String?, createdAt: String?, currency: String?, description: String?, isActive: Bool?, isTrialPlan: Bool?, isVisible: Bool?, modifiedAt: String?, name: String?, planGroup: String?, productSuiteId: String?, recurring: PlanRecurring?, tags: [String]?, tagLines: [String]?, trialPeriod: Double?, type: String?, id: String?) { - - self.recurring = recurring - - self.isTrialPlan = isTrialPlan - - self.planGroup = planGroup - - self.tagLines = tagLines - - self.currency = currency - - self.isActive = isActive - - self.isVisible = isVisible - - self.trialPeriod = trialPeriod - - self.addons = addons - - self.tags = tags - - self.type = type - - self.country = country - - self.id = id - - self.name = name - - self.description = description - - self.amount = amount - - self.productSuiteId = productSuiteId - - self.createdAt = createdAt - - self.modifiedAt = modifiedAt - - self.components = components - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - recurring = try container.decode(PlanRecurring.self, forKey: .recurring) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isTrialPlan = try container.decode(Bool.self, forKey: .isTrialPlan) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - planGroup = try container.decode(String.self, forKey: .planGroup) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tagLines = try container.decode([String].self, forKey: .tagLines) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(String.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isVisible = try container.decode(Bool.self, forKey: .isVisible) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - trialPeriod = try container.decode(Double.self, forKey: .trialPeriod) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addons = try container.decode([String].self, forKey: .addons) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - amount = try container.decode(Double.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productSuiteId = try container.decode(String.self, forKey: .productSuiteId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedAt = try container.decode(String.self, forKey: .modifiedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - components = try container.decode([DetailedPlanComponents].self, forKey: .components) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(recurring, forKey: .recurring) - - - - try? container.encodeIfPresent(isTrialPlan, forKey: .isTrialPlan) - - - - try? container.encodeIfPresent(planGroup, forKey: .planGroup) - - - - try? container.encodeIfPresent(tagLines, forKey: .tagLines) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(isVisible, forKey: .isVisible) - - - - try? container.encodeIfPresent(trialPeriod, forKey: .trialPeriod) - - - - try? container.encodeIfPresent(addons, forKey: .addons) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(productSuiteId, forKey: .productSuiteId) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) - - - - try? container.encodeIfPresent(components, forKey: .components) - - - } - - } - - /* - Model: SubscriptionTrialPeriod - Used By: Billing - */ - - class SubscriptionTrialPeriod: Codable { - - - public var startDate: String? - - public var endDate: String? - - - public enum CodingKeys: String, CodingKey { - - case startDate = "start_date" - - case endDate = "end_date" - - } - - public init(endDate: String?, startDate: String?) { - - self.startDate = startDate - - self.endDate = endDate - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - startDate = try container.decode(String.self, forKey: .startDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - endDate = try container.decode(String.self, forKey: .endDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(startDate, forKey: .startDate) - - - - try? container.encodeIfPresent(endDate, forKey: .endDate) - - - } - - } - - /* - Model: EntityChargePrice - Used By: Billing - */ - - class EntityChargePrice: Codable { - - - public var amount: Double - - public var currencyCode: String - - - public enum CodingKeys: String, CodingKey { - - case amount = "amount" - - case currencyCode = "currency_code" - - } - - public init(amount: Double, currencyCode: String) { - - self.amount = amount - - self.currencyCode = currencyCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - amount = try container.decode(Double.self, forKey: .amount) - - - - - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - } - - } - - /* - Model: EntityChargeRecurring - Used By: Billing - */ - - class EntityChargeRecurring: Codable { - - - public var interval: String - - - public enum CodingKeys: String, CodingKey { - - case interval = "interval" - - } - - public init(interval: String) { - - self.interval = interval - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - interval = try container.decode(String.self, forKey: .interval) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(interval, forKey: .interval) - - - } - - } - - /* - Model: ChargeLineItem - Used By: Billing - */ - - class ChargeLineItem: Codable { - - - public var name: String - - public var term: String - - public var pricingType: String - - public var price: EntityChargePrice - - public var recurring: EntityChargeRecurring? - - public var cappedAmount: Double? - - public var trialDays: Int? - - public var isTest: Bool? - - public var metadata: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case term = "term" - - case pricingType = "pricing_type" - - case price = "price" - - case recurring = "recurring" - - case cappedAmount = "capped_amount" - - case trialDays = "trial_days" - - case isTest = "is_test" - - case metadata = "metadata" - - } - - public init(cappedAmount: Double?, isTest: Bool?, metadata: [String: Any]?, name: String, price: EntityChargePrice, pricingType: String, recurring: EntityChargeRecurring?, term: String, trialDays: Int?) { - - self.name = name - - self.term = term - - self.pricingType = pricingType - - self.price = price - - self.recurring = recurring - - self.cappedAmount = cappedAmount - - self.trialDays = trialDays - - self.isTest = isTest - - self.metadata = metadata - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - name = try container.decode(String.self, forKey: .name) - - - - - term = try container.decode(String.self, forKey: .term) - - - - - pricingType = try container.decode(String.self, forKey: .pricingType) - - - - - price = try container.decode(EntityChargePrice.self, forKey: .price) - - - - - do { - recurring = try container.decode(EntityChargeRecurring.self, forKey: .recurring) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cappedAmount = try container.decode(Double.self, forKey: .cappedAmount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - trialDays = try container.decode(Int.self, forKey: .trialDays) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isTest = try container.decode(Bool.self, forKey: .isTest) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - metadata = try container.decode([String: Any].self, forKey: .metadata) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(term, forKey: .term) - - - - try? container.encodeIfPresent(pricingType, forKey: .pricingType) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(recurring, forKey: .recurring) - - - - try? container.encodeIfPresent(cappedAmount, forKey: .cappedAmount) - - - - try? container.encodeIfPresent(trialDays, forKey: .trialDays) - - - - try? container.encodeIfPresent(isTest, forKey: .isTest) - - - - try? container.encodeIfPresent(metadata, forKey: .metadata) - - - } - - } - - /* - Model: CreateSubscriptionCharge - Used By: Billing - */ - - class CreateSubscriptionCharge: Codable { - - - public var name: String - - public var trialDays: Int? - - public var lineItems: [ChargeLineItem] - - public var isTest: Bool? - - public var returnUrl: String - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case trialDays = "trial_days" - - case lineItems = "line_items" - - case isTest = "is_test" - - case returnUrl = "return_url" - - } - - public init(isTest: Bool?, lineItems: [ChargeLineItem], name: String, returnUrl: String, trialDays: Int?) { - - self.name = name - - self.trialDays = trialDays - - self.lineItems = lineItems - - self.isTest = isTest - - self.returnUrl = returnUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - name = try container.decode(String.self, forKey: .name) - - - - - do { - trialDays = try container.decode(Int.self, forKey: .trialDays) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - lineItems = try container.decode([ChargeLineItem].self, forKey: .lineItems) - - - - - do { - isTest = try container.decode(Bool.self, forKey: .isTest) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - returnUrl = try container.decode(String.self, forKey: .returnUrl) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(trialDays, forKey: .trialDays) - - - - try? container.encodeIfPresent(lineItems, forKey: .lineItems) - - - - try? container.encodeIfPresent(isTest, forKey: .isTest) - - - - try? container.encodeIfPresent(returnUrl, forKey: .returnUrl) - - - } - - } - - /* - Model: CurrentPeriod - Used By: Billing - */ - - class CurrentPeriod: Codable { - - - public var startDate: String? - - public var endDate: String? - - - public enum CodingKeys: String, CodingKey { - - case startDate = "start_date" - - case endDate = "end_date" - - } - - public init(endDate: String?, startDate: String?) { - - self.startDate = startDate - - self.endDate = endDate - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - startDate = try container.decode(String.self, forKey: .startDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - endDate = try container.decode(String.self, forKey: .endDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(startDate, forKey: .startDate) - - - - try? container.encodeIfPresent(endDate, forKey: .endDate) - - - } - - } - - /* - Model: SubscriptionCharge - Used By: Billing - */ - - class SubscriptionCharge: Codable { - - - public var id: String? - - public var name: String? - - public var term: String? - - public var pricingType: String? - - public var price: EntityChargePrice? - - public var recurring: EntityChargeRecurring? - - public var cappedAmount: Double? - - public var activatedOn: String? - - public var cancelledOn: String? - - public var billingDate: String? - - public var currentPeriod: CurrentPeriod? - - public var status: String? - - public var isTest: Bool? - - public var metadata: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case name = "name" - - case term = "term" - - case pricingType = "pricing_type" - - case price = "price" - - case recurring = "recurring" - - case cappedAmount = "capped_amount" - - case activatedOn = "activated_on" - - case cancelledOn = "cancelled_on" - - case billingDate = "billing_date" - - case currentPeriod = "current_period" - - case status = "status" - - case isTest = "is_test" - - case metadata = "metadata" - - } - - public init(activatedOn: String?, billingDate: String?, cancelledOn: String?, cappedAmount: Double?, currentPeriod: CurrentPeriod?, isTest: Bool?, metadata: [String: Any]?, name: String?, price: EntityChargePrice?, pricingType: String?, recurring: EntityChargeRecurring?, status: String?, term: String?, id: String?) { - - self.id = id - - self.name = name - - self.term = term - - self.pricingType = pricingType - - self.price = price - - self.recurring = recurring - - self.cappedAmount = cappedAmount - - self.activatedOn = activatedOn - - self.cancelledOn = cancelledOn - - self.billingDate = billingDate - - self.currentPeriod = currentPeriod - - self.status = status - - self.isTest = isTest - - self.metadata = metadata - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - term = try container.decode(String.self, forKey: .term) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pricingType = try container.decode(String.self, forKey: .pricingType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(EntityChargePrice.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - recurring = try container.decode(EntityChargeRecurring.self, forKey: .recurring) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cappedAmount = try container.decode(Double.self, forKey: .cappedAmount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - activatedOn = try container.decode(String.self, forKey: .activatedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cancelledOn = try container.decode(String.self, forKey: .cancelledOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - billingDate = try container.decode(String.self, forKey: .billingDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currentPeriod = try container.decode(CurrentPeriod.self, forKey: .currentPeriod) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isTest = try container.decode(Bool.self, forKey: .isTest) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - metadata = try container.decode([String: Any].self, forKey: .metadata) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(term, forKey: .term) - - - - try? container.encodeIfPresent(pricingType, forKey: .pricingType) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(recurring, forKey: .recurring) - - - - try? container.encodeIfPresent(cappedAmount, forKey: .cappedAmount) - - - - try? container.encodeIfPresent(activatedOn, forKey: .activatedOn) - - - - try? container.encodeIfPresent(cancelledOn, forKey: .cancelledOn) - - - - try? container.encodeIfPresent(billingDate, forKey: .billingDate) - - - - try? container.encodeIfPresent(currentPeriod, forKey: .currentPeriod) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(isTest, forKey: .isTest) - - - - try? container.encodeIfPresent(metadata, forKey: .metadata) - - - } - - } - - /* - Model: EntitySubscription - Used By: Billing - */ - - class EntitySubscription: Codable { - - - public var id: String? - - public var name: String? - - public var status: String? - - public var companyId: Int? - - public var activatedOn: String? - - public var cancelledOn: String? - - public var trialDays: Int? - - public var trialPeriod: SubscriptionTrialPeriod? - - public var metadata: [String: Any]? - - public var lineItems: [SubscriptionCharge]? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case name = "name" - - case status = "status" - - case companyId = "company_id" - - case activatedOn = "activated_on" - - case cancelledOn = "cancelled_on" - - case trialDays = "trial_days" - - case trialPeriod = "trial_period" - - case metadata = "metadata" - - case lineItems = "line_items" - - } - - public init(activatedOn: String?, cancelledOn: String?, companyId: Int?, lineItems: [SubscriptionCharge]?, metadata: [String: Any]?, name: String?, status: String?, trialDays: Int?, trialPeriod: SubscriptionTrialPeriod?, id: String?) { - - self.id = id - - self.name = name - - self.status = status - - self.companyId = companyId - - self.activatedOn = activatedOn - - self.cancelledOn = cancelledOn - - self.trialDays = trialDays - - self.trialPeriod = trialPeriod - - self.metadata = metadata - - self.lineItems = lineItems - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - activatedOn = try container.decode(String.self, forKey: .activatedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cancelledOn = try container.decode(String.self, forKey: .cancelledOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - trialDays = try container.decode(Int.self, forKey: .trialDays) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - trialPeriod = try container.decode(SubscriptionTrialPeriod.self, forKey: .trialPeriod) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - metadata = try container.decode([String: Any].self, forKey: .metadata) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lineItems = try container.decode([SubscriptionCharge].self, forKey: .lineItems) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(activatedOn, forKey: .activatedOn) - - - - try? container.encodeIfPresent(cancelledOn, forKey: .cancelledOn) - - - - try? container.encodeIfPresent(trialDays, forKey: .trialDays) - - - - try? container.encodeIfPresent(trialPeriod, forKey: .trialPeriod) - - - - try? container.encodeIfPresent(metadata, forKey: .metadata) - - - - try? container.encodeIfPresent(lineItems, forKey: .lineItems) - - - } - - } - - /* - Model: CreateSubscriptionResponse - Used By: Billing - */ - - class CreateSubscriptionResponse: Codable { - - - public var subscription: EntitySubscription? - - public var confirmUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case subscription = "subscription" - - case confirmUrl = "confirm_url" - - } - - public init(confirmUrl: String?, subscription: EntitySubscription?) { - - self.subscription = subscription - - self.confirmUrl = confirmUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - subscription = try container.decode(EntitySubscription.self, forKey: .subscription) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - confirmUrl = try container.decode(String.self, forKey: .confirmUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(subscription, forKey: .subscription) - - - - try? container.encodeIfPresent(confirmUrl, forKey: .confirmUrl) - - - } - - } - - /* - Model: InvoiceDetailsPeriod - Used By: Billing - */ - - class InvoiceDetailsPeriod: Codable { - - - public var start: String? - - public var end: String? - - - public enum CodingKeys: String, CodingKey { - - case start = "start" - - case end = "end" - - } - - public init(end: String?, start: String?) { - - self.start = start - - self.end = end - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - start = try container.decode(String.self, forKey: .start) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - end = try container.decode(String.self, forKey: .end) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(start, forKey: .start) - - - - try? container.encodeIfPresent(end, forKey: .end) - - - } - - } - - /* - Model: InvoiceDetailsClient - Used By: Billing - */ - - class InvoiceDetailsClient: Codable { - - - public var addressLines: [String]? - - public var name: String? - - public var email: String? - - public var phone: String? - - - public enum CodingKeys: String, CodingKey { - - case addressLines = "address_lines" - - case name = "name" - - case email = "email" - - case phone = "phone" - - } - - public init(addressLines: [String]?, email: String?, name: String?, phone: String?) { - - self.addressLines = addressLines - - self.name = name - - self.email = email - - self.phone = phone - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - addressLines = try container.decode([String].self, forKey: .addressLines) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(addressLines, forKey: .addressLines) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - } - - } - - /* - Model: InvoiceDetailsStatusTrail - Used By: Billing - */ - - class InvoiceDetailsStatusTrail: Codable { - - - public var id: String? - - public var value: String? - - public var timestamp: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case value = "value" - - case timestamp = "timestamp" - - } - - public init(timestamp: String?, value: String?, id: String?) { - - self.id = id - - self.value = value - - self.timestamp = timestamp - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - timestamp = try container.decode(String.self, forKey: .timestamp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(timestamp, forKey: .timestamp) - - - } - - } - - /* - Model: InvoiceDetailsPaymentMethodsDataChecks - Used By: Billing - */ - - class InvoiceDetailsPaymentMethodsDataChecks: Codable { - - - public var cvcCheck: String? - - public var addressLine1Check: String? - - public var addressPostalCodeCheck: String? - - - public enum CodingKeys: String, CodingKey { - - case cvcCheck = "cvc_check" - - case addressLine1Check = "address_line1_check" - - case addressPostalCodeCheck = "address_postal_code_check" - - } - - public init(addressLine1Check: String?, addressPostalCodeCheck: String?, cvcCheck: String?) { - - self.cvcCheck = cvcCheck - - self.addressLine1Check = addressLine1Check - - self.addressPostalCodeCheck = addressPostalCodeCheck - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cvcCheck = try container.decode(String.self, forKey: .cvcCheck) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressLine1Check = try container.decode(String.self, forKey: .addressLine1Check) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressPostalCodeCheck = try container.decode(String.self, forKey: .addressPostalCodeCheck) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cvcCheck, forKey: .cvcCheck) - - - - try? container.encodeIfPresent(addressLine1Check, forKey: .addressLine1Check) - - - - try? container.encodeIfPresent(addressPostalCodeCheck, forKey: .addressPostalCodeCheck) - - - } - - } - - /* - Model: InvoiceDetailsPaymentMethodsDataNetworks - Used By: Billing - */ - - class InvoiceDetailsPaymentMethodsDataNetworks: Codable { - - - public var available: [String]? - - public var preferred: String? - - - public enum CodingKeys: String, CodingKey { - - case available = "available" - - case preferred = "preferred" - - } - - public init(available: [String]?, preferred: String?) { - - self.available = available - - self.preferred = preferred - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - available = try container.decode([String].self, forKey: .available) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - preferred = try container.decode(String.self, forKey: .preferred) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(available, forKey: .available) - - - - try? container.encodeIfPresent(preferred, forKey: .preferred) - - - } - - } - - /* - Model: InvoiceDetailsPaymentMethodsDataThreeDSecureUsage - Used By: Billing - */ - - class InvoiceDetailsPaymentMethodsDataThreeDSecureUsage: Codable { - - - public var supported: Bool? - - - public enum CodingKeys: String, CodingKey { - - case supported = "supported" - - } - - public init(supported: Bool?) { - - self.supported = supported - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - supported = try container.decode(Bool.self, forKey: .supported) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(supported, forKey: .supported) - - - } - - } - - /* - Model: InvoiceDetailsPaymentMethodsData - Used By: Billing - */ - - class InvoiceDetailsPaymentMethodsData: Codable { - - - public var brand: String? - - public var last4: String? - - public var checks: InvoiceDetailsPaymentMethodsDataChecks? - - public var wallet: String? - - public var country: String? - - public var funding: String? - - public var expYear: Int? - - public var networks: InvoiceDetailsPaymentMethodsDataNetworks? - - public var expMonth: Int? - - public var fingerprint: String? - - public var generatedFrom: String? - - public var threeDSecureUsage: InvoiceDetailsPaymentMethodsDataThreeDSecureUsage? - - - public enum CodingKeys: String, CodingKey { - - case brand = "brand" - - case last4 = "last4" - - case checks = "checks" - - case wallet = "wallet" - - case country = "country" - - case funding = "funding" - - case expYear = "exp_year" - - case networks = "networks" - - case expMonth = "exp_month" - - case fingerprint = "fingerprint" - - case generatedFrom = "generated_from" - - case threeDSecureUsage = "three_d_secure_usage" - - } - - public init(brand: String?, checks: InvoiceDetailsPaymentMethodsDataChecks?, country: String?, expMonth: Int?, expYear: Int?, fingerprint: String?, funding: String?, generatedFrom: String?, last4: String?, networks: InvoiceDetailsPaymentMethodsDataNetworks?, threeDSecureUsage: InvoiceDetailsPaymentMethodsDataThreeDSecureUsage?, wallet: String?) { - - self.brand = brand - - self.last4 = last4 - - self.checks = checks - - self.wallet = wallet - - self.country = country - - self.funding = funding - - self.expYear = expYear - - self.networks = networks - - self.expMonth = expMonth - - self.fingerprint = fingerprint - - self.generatedFrom = generatedFrom - - self.threeDSecureUsage = threeDSecureUsage - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - brand = try container.decode(String.self, forKey: .brand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - last4 = try container.decode(String.self, forKey: .last4) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - checks = try container.decode(InvoiceDetailsPaymentMethodsDataChecks.self, forKey: .checks) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - wallet = try container.decode(String.self, forKey: .wallet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - funding = try container.decode(String.self, forKey: .funding) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expYear = try container.decode(Int.self, forKey: .expYear) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - networks = try container.decode(InvoiceDetailsPaymentMethodsDataNetworks.self, forKey: .networks) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expMonth = try container.decode(Int.self, forKey: .expMonth) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fingerprint = try container.decode(String.self, forKey: .fingerprint) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - generatedFrom = try container.decode(String.self, forKey: .generatedFrom) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - threeDSecureUsage = try container.decode(InvoiceDetailsPaymentMethodsDataThreeDSecureUsage.self, forKey: .threeDSecureUsage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(brand, forKey: .brand) - - - - try? container.encodeIfPresent(last4, forKey: .last4) - - - - try? container.encodeIfPresent(checks, forKey: .checks) - - - - try? container.encodeIfPresent(wallet, forKey: .wallet) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(funding, forKey: .funding) - - - - try? container.encodeIfPresent(expYear, forKey: .expYear) - - - - try? container.encodeIfPresent(networks, forKey: .networks) - - - - try? container.encodeIfPresent(expMonth, forKey: .expMonth) - - - - try? container.encodeIfPresent(fingerprint, forKey: .fingerprint) - - - - try? container.encodeIfPresent(generatedFrom, forKey: .generatedFrom) - - - - try? container.encodeIfPresent(threeDSecureUsage, forKey: .threeDSecureUsage) - - - } - - } - - /* - Model: InvoiceDetailsPaymentMethods - Used By: Billing - */ - - class InvoiceDetailsPaymentMethods: Codable { - - - public var id: Int? - - public var type: String? - - public var pgPaymentMethodId: String? - - public var data: InvoiceDetailsPaymentMethodsData? - - public var isDefault: Bool? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case type = "type" - - case pgPaymentMethodId = "pg_payment_method_id" - - case data = "data" - - case isDefault = "is_default" - - } - - public init(data: InvoiceDetailsPaymentMethodsData?, id: Int?, isDefault: Bool?, pgPaymentMethodId: String?, type: String?) { - - self.id = id - - self.type = type - - self.pgPaymentMethodId = pgPaymentMethodId - - self.data = data - - self.isDefault = isDefault - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pgPaymentMethodId = try container.decode(String.self, forKey: .pgPaymentMethodId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode(InvoiceDetailsPaymentMethodsData.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isDefault = try container.decode(Bool.self, forKey: .isDefault) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(pgPaymentMethodId, forKey: .pgPaymentMethodId) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - - try? container.encodeIfPresent(isDefault, forKey: .isDefault) - - - } - - } - - /* - Model: InvoicePaymentMethod - Used By: Billing - */ - - class InvoicePaymentMethod: Codable { - - - public var pgPaymentMethodId: String? - - - public enum CodingKeys: String, CodingKey { - - case pgPaymentMethodId = "pg_payment_method_id" - - } - - public init(pgPaymentMethodId: String?) { - - self.pgPaymentMethodId = pgPaymentMethodId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pgPaymentMethodId = try container.decode(String.self, forKey: .pgPaymentMethodId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pgPaymentMethodId, forKey: .pgPaymentMethodId) - - - } - - } - - /* - Model: InvoiceDetails - Used By: Billing - */ - - class InvoiceDetails: Codable { - - - public var period: InvoiceDetailsPeriod? - - public var client: InvoiceDetailsClient? - - public var autoAdvance: Bool? - - public var currency: String? - - public var paid: Bool? - - public var attemp: Int? - - public var id: String? - - public var collectionMethod: String? - - public var subscriberId: String? - - public var invoiceUrl: String? - - public var number: String? - - public var pgData: [String: Any]? - - public var receiptNumber: String? - - public var statementDescriptor: String? - - public var currentStatus: String? - - public var statusTrail: [InvoiceDetailsStatusTrail]? - - public var subtotal: Double? - - public var total: Double? - - public var subscription: String? - - public var nextActionTime: String? - - public var createdAt: String? - - public var modifiedAt: String? - - public var hashIdentifier: String? - - public var paymentMethod: InvoicePaymentMethod? - - - public enum CodingKeys: String, CodingKey { - - case period = "period" - - case client = "client" - - case autoAdvance = "auto_advance" - - case currency = "currency" - - case paid = "paid" - - case attemp = "attemp" - - case id = "_id" - - case collectionMethod = "collection_method" - - case subscriberId = "subscriber_id" - - case invoiceUrl = "invoice_url" - - case number = "number" - - case pgData = "pg_data" - - case receiptNumber = "receipt_number" - - case statementDescriptor = "statement_descriptor" - - case currentStatus = "current_status" - - case statusTrail = "status_trail" - - case subtotal = "subtotal" - - case total = "total" - - case subscription = "subscription" - - case nextActionTime = "next_action_time" - - case createdAt = "created_at" - - case modifiedAt = "modified_at" - - case hashIdentifier = "hash_identifier" - - case paymentMethod = "payment_method" - - } - - public init(attemp: Int?, autoAdvance: Bool?, client: InvoiceDetailsClient?, collectionMethod: String?, createdAt: String?, currency: String?, currentStatus: String?, hashIdentifier: String?, invoiceUrl: String?, modifiedAt: String?, nextActionTime: String?, number: String?, paid: Bool?, paymentMethod: InvoicePaymentMethod?, period: InvoiceDetailsPeriod?, pgData: [String: Any]?, receiptNumber: String?, statementDescriptor: String?, statusTrail: [InvoiceDetailsStatusTrail]?, subscriberId: String?, subscription: String?, subtotal: Double?, total: Double?, id: String?) { - - self.period = period - - self.client = client - - self.autoAdvance = autoAdvance - - self.currency = currency - - self.paid = paid - - self.attemp = attemp - - self.id = id - - self.collectionMethod = collectionMethod - - self.subscriberId = subscriberId - - self.invoiceUrl = invoiceUrl - - self.number = number - - self.pgData = pgData - - self.receiptNumber = receiptNumber - - self.statementDescriptor = statementDescriptor - - self.currentStatus = currentStatus - - self.statusTrail = statusTrail - - self.subtotal = subtotal - - self.total = total - - self.subscription = subscription - - self.nextActionTime = nextActionTime - - self.createdAt = createdAt - - self.modifiedAt = modifiedAt - - self.hashIdentifier = hashIdentifier - - self.paymentMethod = paymentMethod - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - period = try container.decode(InvoiceDetailsPeriod.self, forKey: .period) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - client = try container.decode(InvoiceDetailsClient.self, forKey: .client) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - autoAdvance = try container.decode(Bool.self, forKey: .autoAdvance) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(String.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paid = try container.decode(Bool.self, forKey: .paid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attemp = try container.decode(Int.self, forKey: .attemp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - collectionMethod = try container.decode(String.self, forKey: .collectionMethod) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subscriberId = try container.decode(String.self, forKey: .subscriberId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - invoiceUrl = try container.decode(String.self, forKey: .invoiceUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - number = try container.decode(String.self, forKey: .number) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pgData = try container.decode([String: Any].self, forKey: .pgData) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - receiptNumber = try container.decode(String.self, forKey: .receiptNumber) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - statementDescriptor = try container.decode(String.self, forKey: .statementDescriptor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currentStatus = try container.decode(String.self, forKey: .currentStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - statusTrail = try container.decode([InvoiceDetailsStatusTrail].self, forKey: .statusTrail) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subtotal = try container.decode(Double.self, forKey: .subtotal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - total = try container.decode(Double.self, forKey: .total) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subscription = try container.decode(String.self, forKey: .subscription) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - nextActionTime = try container.decode(String.self, forKey: .nextActionTime) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedAt = try container.decode(String.self, forKey: .modifiedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hashIdentifier = try container.decode(String.self, forKey: .hashIdentifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentMethod = try container.decode(InvoicePaymentMethod.self, forKey: .paymentMethod) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(period, forKey: .period) - - - - try? container.encodeIfPresent(client, forKey: .client) - - - - try? container.encodeIfPresent(autoAdvance, forKey: .autoAdvance) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(paid, forKey: .paid) - - - - try? container.encodeIfPresent(attemp, forKey: .attemp) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(collectionMethod, forKey: .collectionMethod) - - - - try? container.encodeIfPresent(subscriberId, forKey: .subscriberId) - - - - try? container.encodeIfPresent(invoiceUrl, forKey: .invoiceUrl) - - - - try? container.encodeIfPresent(number, forKey: .number) - - - - try? container.encodeIfPresent(pgData, forKey: .pgData) - - - - try? container.encodeIfPresent(receiptNumber, forKey: .receiptNumber) - - - - try? container.encodeIfPresent(statementDescriptor, forKey: .statementDescriptor) - - - - try? container.encodeIfPresent(currentStatus, forKey: .currentStatus) - - - - try? container.encodeIfPresent(statusTrail, forKey: .statusTrail) - - - - try? container.encodeIfPresent(subtotal, forKey: .subtotal) - - - - try? container.encodeIfPresent(total, forKey: .total) - - - - try? container.encodeIfPresent(subscription, forKey: .subscription) - - - - try? container.encodeIfPresent(nextActionTime, forKey: .nextActionTime) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) - - - - try? container.encodeIfPresent(hashIdentifier, forKey: .hashIdentifier) - - - - try? container.encodeIfPresent(paymentMethod, forKey: .paymentMethod) - - - } - - } - - /* - Model: InvoiceItemsPlanRecurring - Used By: Billing - */ - - class InvoiceItemsPlanRecurring: Codable { - - - public var interval: String? - - public var intervalCount: Int? - - - public enum CodingKeys: String, CodingKey { - - case interval = "interval" - - case intervalCount = "interval_count" - - } - - public init(interval: String?, intervalCount: Int?) { - - self.interval = interval - - self.intervalCount = intervalCount - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - interval = try container.decode(String.self, forKey: .interval) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - intervalCount = try container.decode(Int.self, forKey: .intervalCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(interval, forKey: .interval) - - - - try? container.encodeIfPresent(intervalCount, forKey: .intervalCount) - - - } - - } - - /* - Model: InvoiceItemsPlan - Used By: Billing - */ - - class InvoiceItemsPlan: Codable { - - - public var recurring: InvoiceItemsPlanRecurring? - - public var isTrialPlan: Bool? - - public var planGroup: String? - - public var tagLines: [String]? - - public var currency: String? - - public var isActive: Bool? - - public var isVisible: Bool? - - public var trialPeriod: Int? - - public var addons: [String]? - - public var tags: [String]? - - public var type: String? - - public var country: String? - - public var id: String? - - public var name: String? - - public var description: String? - - public var amount: Int? - - public var productSuiteId: String? - - public var createdAt: String? - - public var modifiedAt: String? - - - public enum CodingKeys: String, CodingKey { - - case recurring = "recurring" - - case isTrialPlan = "is_trial_plan" - - case planGroup = "plan_group" - - case tagLines = "tag_lines" - - case currency = "currency" - - case isActive = "is_active" - - case isVisible = "is_visible" - - case trialPeriod = "trial_period" - - case addons = "addons" - - case tags = "tags" - - case type = "type" - - case country = "country" - - case id = "_id" - - case name = "name" - - case description = "description" - - case amount = "amount" - - case productSuiteId = "product_suite_id" - - case createdAt = "created_at" - - case modifiedAt = "modified_at" - - } - - public init(addons: [String]?, amount: Int?, country: String?, createdAt: String?, currency: String?, description: String?, isActive: Bool?, isTrialPlan: Bool?, isVisible: Bool?, modifiedAt: String?, name: String?, planGroup: String?, productSuiteId: String?, recurring: InvoiceItemsPlanRecurring?, tags: [String]?, tagLines: [String]?, trialPeriod: Int?, type: String?, id: String?) { - - self.recurring = recurring - - self.isTrialPlan = isTrialPlan - - self.planGroup = planGroup - - self.tagLines = tagLines - - self.currency = currency - - self.isActive = isActive - - self.isVisible = isVisible - - self.trialPeriod = trialPeriod - - self.addons = addons - - self.tags = tags - - self.type = type - - self.country = country - - self.id = id - - self.name = name - - self.description = description - - self.amount = amount - - self.productSuiteId = productSuiteId - - self.createdAt = createdAt - - self.modifiedAt = modifiedAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - recurring = try container.decode(InvoiceItemsPlanRecurring.self, forKey: .recurring) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isTrialPlan = try container.decode(Bool.self, forKey: .isTrialPlan) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - planGroup = try container.decode(String.self, forKey: .planGroup) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tagLines = try container.decode([String].self, forKey: .tagLines) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(String.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isVisible = try container.decode(Bool.self, forKey: .isVisible) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - trialPeriod = try container.decode(Int.self, forKey: .trialPeriod) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addons = try container.decode([String].self, forKey: .addons) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - amount = try container.decode(Int.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productSuiteId = try container.decode(String.self, forKey: .productSuiteId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedAt = try container.decode(String.self, forKey: .modifiedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(recurring, forKey: .recurring) - - - - try? container.encodeIfPresent(isTrialPlan, forKey: .isTrialPlan) - - - - try? container.encodeIfPresent(planGroup, forKey: .planGroup) - - - - try? container.encodeIfPresent(tagLines, forKey: .tagLines) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(isVisible, forKey: .isVisible) - - - - try? container.encodeIfPresent(trialPeriod, forKey: .trialPeriod) - - - - try? container.encodeIfPresent(addons, forKey: .addons) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(productSuiteId, forKey: .productSuiteId) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) - - - } - - } - - /* - Model: InvoiceItemsPeriod - Used By: Billing - */ - - class InvoiceItemsPeriod: Codable { - - - public var start: String? - - public var end: String? - - - public enum CodingKeys: String, CodingKey { - - case start = "start" - - case end = "end" - - } - - public init(end: String?, start: String?) { - - self.start = start - - self.end = end - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - start = try container.decode(String.self, forKey: .start) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - end = try container.decode(String.self, forKey: .end) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(start, forKey: .start) - - - - try? container.encodeIfPresent(end, forKey: .end) - - - } - - } - - /* - Model: InvoiceItems - Used By: Billing - */ - - class InvoiceItems: Codable { - - - public var id: String? - - public var currency: String? - - public var plan: InvoiceItemsPlan? - - public var name: String? - - public var quantity: Int? - - public var description: String? - - public var period: InvoiceItemsPeriod? - - public var unitAmount: Double? - - public var amount: Double? - - public var type: String? - - public var invoiceId: String? - - public var createdAt: String? - - public var modifiedAt: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case currency = "currency" - - case plan = "plan" - - case name = "name" - - case quantity = "quantity" - - case description = "description" - - case period = "period" - - case unitAmount = "unit_amount" - - case amount = "amount" - - case type = "type" - - case invoiceId = "invoice_id" - - case createdAt = "created_at" - - case modifiedAt = "modified_at" - - } - - public init(amount: Double?, createdAt: String?, currency: String?, description: String?, invoiceId: String?, modifiedAt: String?, name: String?, period: InvoiceItemsPeriod?, plan: InvoiceItemsPlan?, quantity: Int?, type: String?, unitAmount: Double?, id: String?) { - - self.id = id - - self.currency = currency - - self.plan = plan - - self.name = name - - self.quantity = quantity - - self.description = description - - self.period = period - - self.unitAmount = unitAmount - - self.amount = amount - - self.type = type - - self.invoiceId = invoiceId - - self.createdAt = createdAt - - self.modifiedAt = modifiedAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(String.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - plan = try container.decode(InvoiceItemsPlan.self, forKey: .plan) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - period = try container.decode(InvoiceItemsPeriod.self, forKey: .period) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - unitAmount = try container.decode(Double.self, forKey: .unitAmount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - amount = try container.decode(Double.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - invoiceId = try container.decode(String.self, forKey: .invoiceId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedAt = try container.decode(String.self, forKey: .modifiedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(plan, forKey: .plan) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(period, forKey: .period) - - - - try? container.encodeIfPresent(unitAmount, forKey: .unitAmount) - - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(invoiceId, forKey: .invoiceId) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) - - - } - - } - - /* - Model: Invoice - Used By: Billing - */ - - class Invoice: Codable { - - - public var invoice: InvoiceDetails? - - public var invoiceItems: [InvoiceItems]? - - - public enum CodingKeys: String, CodingKey { - - case invoice = "invoice" - - case invoiceItems = "invoice_items" - - } - - public init(invoice: InvoiceDetails?, invoiceItems: [InvoiceItems]?) { - - self.invoice = invoice - - self.invoiceItems = invoiceItems - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - invoice = try container.decode(InvoiceDetails.self, forKey: .invoice) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - invoiceItems = try container.decode([InvoiceItems].self, forKey: .invoiceItems) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(invoice, forKey: .invoice) - - - - try? container.encodeIfPresent(invoiceItems, forKey: .invoiceItems) - - - } - - } - - /* - Model: InvoicesDataClient - Used By: Billing - */ - - class InvoicesDataClient: Codable { - - - public var name: String? - - public var email: String? - - public var phone: String? - - public var addressLines: [String]? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case email = "email" - - case phone = "phone" - - case addressLines = "address_lines" - - } - - public init(addressLines: [String]?, email: String?, name: String?, phone: String?) { - - self.name = name - - self.email = email - - self.phone = phone - - self.addressLines = addressLines - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressLines = try container.decode([String].self, forKey: .addressLines) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(addressLines, forKey: .addressLines) - - - } - - } - - /* - Model: InvoicesDataPeriod - Used By: Billing - */ - - class InvoicesDataPeriod: Codable { - - - public var start: String? - - public var end: String? - - - public enum CodingKeys: String, CodingKey { - - case start = "start" - - case end = "end" - - } - - public init(end: String?, start: String?) { - - self.start = start - - self.end = end - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - start = try container.decode(String.self, forKey: .start) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - end = try container.decode(String.self, forKey: .end) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(start, forKey: .start) - - - - try? container.encodeIfPresent(end, forKey: .end) - - - } - - } - - /* - Model: InvoicesDataPaymentMethod - Used By: Billing - */ - - class InvoicesDataPaymentMethod: Codable { - - - public var pgPaymentMethodId: String? - - - public enum CodingKeys: String, CodingKey { - - case pgPaymentMethodId = "pg_payment_method_id" - - } - - public init(pgPaymentMethodId: String?) { - - self.pgPaymentMethodId = pgPaymentMethodId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pgPaymentMethodId = try container.decode(String.self, forKey: .pgPaymentMethodId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pgPaymentMethodId, forKey: .pgPaymentMethodId) - - - } - - } - - /* - Model: InvoicesData - Used By: Billing - */ - - class InvoicesData: Codable { - - - public var id: String? - - public var client: InvoicesDataClient? - - public var autoAdvance: Bool? - - public var currency: String? - - public var paid: Bool? - - public var attemp: Int? - - public var collectionMethod: String? - - public var subscriberId: String? - - public var invoiceUrl: String? - - public var number: String? - - public var pgData: [String: Any]? - - public var period: InvoicesDataPeriod? - - public var receiptNumber: String? - - public var statementDescriptor: String? - - public var currentStatus: String? - - public var statusTrail: [InvoiceDetailsStatusTrail]? - - public var subtotal: Double? - - public var total: Double? - - public var subscription: String? - - public var nextActionTime: String? - - public var createdAt: String? - - public var modifiedAt: String? - - public var hashIdentifier: String? - - public var paymentMethod: InvoicesDataPaymentMethod? - - public var invoiceItems: [InvoiceItems]? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case client = "client" - - case autoAdvance = "auto_advance" - - case currency = "currency" - - case paid = "paid" - - case attemp = "attemp" - - case collectionMethod = "collection_method" - - case subscriberId = "subscriber_id" - - case invoiceUrl = "invoice_url" - - case number = "number" - - case pgData = "pg_data" - - case period = "period" - - case receiptNumber = "receipt_number" - - case statementDescriptor = "statement_descriptor" - - case currentStatus = "current_status" - - case statusTrail = "status_trail" - - case subtotal = "subtotal" - - case total = "total" - - case subscription = "subscription" - - case nextActionTime = "next_action_time" - - case createdAt = "created_at" - - case modifiedAt = "modified_at" - - case hashIdentifier = "hash_identifier" - - case paymentMethod = "payment_method" - - case invoiceItems = "invoice_items" - - } - - public init(attemp: Int?, autoAdvance: Bool?, client: InvoicesDataClient?, collectionMethod: String?, createdAt: String?, currency: String?, currentStatus: String?, hashIdentifier: String?, invoiceItems: [InvoiceItems]?, invoiceUrl: String?, modifiedAt: String?, nextActionTime: String?, number: String?, paid: Bool?, paymentMethod: InvoicesDataPaymentMethod?, period: InvoicesDataPeriod?, pgData: [String: Any]?, receiptNumber: String?, statementDescriptor: String?, statusTrail: [InvoiceDetailsStatusTrail]?, subscriberId: String?, subscription: String?, subtotal: Double?, total: Double?, id: String?) { - - self.id = id - - self.client = client - - self.autoAdvance = autoAdvance - - self.currency = currency - - self.paid = paid - - self.attemp = attemp - - self.collectionMethod = collectionMethod - - self.subscriberId = subscriberId - - self.invoiceUrl = invoiceUrl - - self.number = number - - self.pgData = pgData - - self.period = period - - self.receiptNumber = receiptNumber - - self.statementDescriptor = statementDescriptor - - self.currentStatus = currentStatus - - self.statusTrail = statusTrail - - self.subtotal = subtotal - - self.total = total - - self.subscription = subscription - - self.nextActionTime = nextActionTime - - self.createdAt = createdAt - - self.modifiedAt = modifiedAt - - self.hashIdentifier = hashIdentifier - - self.paymentMethod = paymentMethod - - self.invoiceItems = invoiceItems - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - client = try container.decode(InvoicesDataClient.self, forKey: .client) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - autoAdvance = try container.decode(Bool.self, forKey: .autoAdvance) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(String.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paid = try container.decode(Bool.self, forKey: .paid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attemp = try container.decode(Int.self, forKey: .attemp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - collectionMethod = try container.decode(String.self, forKey: .collectionMethod) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subscriberId = try container.decode(String.self, forKey: .subscriberId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - invoiceUrl = try container.decode(String.self, forKey: .invoiceUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - number = try container.decode(String.self, forKey: .number) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pgData = try container.decode([String: Any].self, forKey: .pgData) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - period = try container.decode(InvoicesDataPeriod.self, forKey: .period) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - receiptNumber = try container.decode(String.self, forKey: .receiptNumber) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - statementDescriptor = try container.decode(String.self, forKey: .statementDescriptor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currentStatus = try container.decode(String.self, forKey: .currentStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - statusTrail = try container.decode([InvoiceDetailsStatusTrail].self, forKey: .statusTrail) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subtotal = try container.decode(Double.self, forKey: .subtotal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - total = try container.decode(Double.self, forKey: .total) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subscription = try container.decode(String.self, forKey: .subscription) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - nextActionTime = try container.decode(String.self, forKey: .nextActionTime) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedAt = try container.decode(String.self, forKey: .modifiedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hashIdentifier = try container.decode(String.self, forKey: .hashIdentifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentMethod = try container.decode(InvoicesDataPaymentMethod.self, forKey: .paymentMethod) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - invoiceItems = try container.decode([InvoiceItems].self, forKey: .invoiceItems) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(client, forKey: .client) - - - - try? container.encodeIfPresent(autoAdvance, forKey: .autoAdvance) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(paid, forKey: .paid) - - - - try? container.encodeIfPresent(attemp, forKey: .attemp) - - - - try? container.encodeIfPresent(collectionMethod, forKey: .collectionMethod) - - - - try? container.encodeIfPresent(subscriberId, forKey: .subscriberId) - - - - try? container.encodeIfPresent(invoiceUrl, forKey: .invoiceUrl) - - - - try? container.encodeIfPresent(number, forKey: .number) - - - - try? container.encodeIfPresent(pgData, forKey: .pgData) - - - - try? container.encodeIfPresent(period, forKey: .period) - - - - try? container.encodeIfPresent(receiptNumber, forKey: .receiptNumber) - - - - try? container.encodeIfPresent(statementDescriptor, forKey: .statementDescriptor) - - - - try? container.encodeIfPresent(currentStatus, forKey: .currentStatus) - - - - try? container.encodeIfPresent(statusTrail, forKey: .statusTrail) - - - - try? container.encodeIfPresent(subtotal, forKey: .subtotal) - - - - try? container.encodeIfPresent(total, forKey: .total) - - - - try? container.encodeIfPresent(subscription, forKey: .subscription) - - - - try? container.encodeIfPresent(nextActionTime, forKey: .nextActionTime) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) - - - - try? container.encodeIfPresent(hashIdentifier, forKey: .hashIdentifier) - - - - try? container.encodeIfPresent(paymentMethod, forKey: .paymentMethod) - - - - try? container.encodeIfPresent(invoiceItems, forKey: .invoiceItems) - - - } - - } - - /* - Model: Invoices - Used By: Billing - */ - - class Invoices: Codable { - - - public var data: [InvoicesData]? - - public var start: Int? - - public var end: Int? - - public var limit: Int? - - public var page: Int? - - public var total: Int? - - - public enum CodingKeys: String, CodingKey { - - case data = "data" - - case start = "start" - - case end = "end" - - case limit = "limit" - - case page = "page" - - case total = "total" - - } - - public init(data: [InvoicesData]?, end: Int?, limit: Int?, page: Int?, start: Int?, total: Int?) { - - self.data = data - - self.start = start - - self.end = end - - self.limit = limit - - self.page = page - - self.total = total - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - data = try container.decode([InvoicesData].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - start = try container.decode(Int.self, forKey: .start) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - end = try container.decode(Int.self, forKey: .end) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - limit = try container.decode(Int.self, forKey: .limit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Int.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - total = try container.decode(Int.self, forKey: .total) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(data, forKey: .data) - - - - try? container.encodeIfPresent(start, forKey: .start) - - - - try? container.encodeIfPresent(end, forKey: .end) - - - - try? container.encodeIfPresent(limit, forKey: .limit) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(total, forKey: .total) - - - } - - } - - /* - Model: Phone - Used By: Billing - */ - - class Phone: Codable { - - - public var phoneNumber: String? - - public var phoneCountryCode: String? - - - public enum CodingKeys: String, CodingKey { - - case phoneNumber = "phone_number" - - case phoneCountryCode = "phone_country_code" - - } - - public init(phoneCountryCode: String?, phoneNumber: String?) { - - self.phoneNumber = phoneNumber - - self.phoneCountryCode = phoneCountryCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - phoneNumber = try container.decode(String.self, forKey: .phoneNumber) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phoneCountryCode = try container.decode(String.self, forKey: .phoneCountryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(phoneNumber, forKey: .phoneNumber) - - - - try? container.encodeIfPresent(phoneCountryCode, forKey: .phoneCountryCode) - - - } - - } - - /* - Model: SubscriptionBillingAddress - Used By: Billing - */ - - class SubscriptionBillingAddress: Codable { - - - public var country: String? - - public var state: String? - - public var city: String? - - public var line1: String? - - public var line2: String? - - public var postalCode: String? - - - public enum CodingKeys: String, CodingKey { - - case country = "country" - - case state = "state" - - case city = "city" - - case line1 = "line1" - - case line2 = "line2" - - case postalCode = "postal_code" - - } - - public init(city: String?, country: String?, line1: String?, line2: String?, postalCode: String?, state: String?) { - - self.country = country - - self.state = state - - self.city = city - - self.line1 = line1 - - self.line2 = line2 - - self.postalCode = postalCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(String.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - line1 = try container.decode(String.self, forKey: .line1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - line2 = try container.decode(String.self, forKey: .line2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - postalCode = try container.decode(String.self, forKey: .postalCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(line1, forKey: .line1) - - - - try? container.encodeIfPresent(line2, forKey: .line2) - - - - try? container.encodeIfPresent(postalCode, forKey: .postalCode) - - - } - - } - - /* - Model: SubscriptionCustomer - Used By: Billing - */ - - class SubscriptionCustomer: Codable { - - - public var phone: Phone? - - public var billingAddress: SubscriptionBillingAddress? - - public var id: String? - - public var uniqueId: String? - - public var type: String? - - public var name: String? - - public var email: String? - - public var createdAt: String? - - public var modifiedAt: String? - - public var data: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case phone = "phone" - - case billingAddress = "billing_address" - - case id = "_id" - - case uniqueId = "unique_id" - - case type = "type" - - case name = "name" - - case email = "email" - - case createdAt = "created_at" - - case modifiedAt = "modified_at" - - case data = "data" - - } - - public init(billingAddress: SubscriptionBillingAddress?, createdAt: String?, data: [String: Any]?, email: String?, modifiedAt: String?, name: String?, phone: Phone?, type: String?, uniqueId: String?, id: String?) { - - self.phone = phone - - self.billingAddress = billingAddress - - self.id = id - - self.uniqueId = uniqueId - - self.type = type - - self.name = name - - self.email = email - - self.createdAt = createdAt - - self.modifiedAt = modifiedAt - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - phone = try container.decode(Phone.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - billingAddress = try container.decode(SubscriptionBillingAddress.self, forKey: .billingAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uniqueId = try container.decode(String.self, forKey: .uniqueId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedAt = try container.decode(String.self, forKey: .modifiedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode([String: Any].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(billingAddress, forKey: .billingAddress) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(uniqueId, forKey: .uniqueId) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: SubscriptionCustomerCreate - Used By: Billing - */ - - class SubscriptionCustomerCreate: Codable { - - - public var phone: Phone? - - public var billingAddress: SubscriptionBillingAddress? - - public var uniqueId: String? - - public var type: String? - - public var name: String? - - public var email: String? - - - public enum CodingKeys: String, CodingKey { - - case phone = "phone" - - case billingAddress = "billing_address" - - case uniqueId = "unique_id" - - case type = "type" - - case name = "name" - - case email = "email" - - } - - public init(billingAddress: SubscriptionBillingAddress?, email: String?, name: String?, phone: Phone?, type: String?, uniqueId: String?) { - - self.phone = phone - - self.billingAddress = billingAddress - - self.uniqueId = uniqueId - - self.type = type - - self.name = name - - self.email = email - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - phone = try container.decode(Phone.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - billingAddress = try container.decode(SubscriptionBillingAddress.self, forKey: .billingAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uniqueId = try container.decode(String.self, forKey: .uniqueId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(billingAddress, forKey: .billingAddress) - - - - try? container.encodeIfPresent(uniqueId, forKey: .uniqueId) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - } - - } - - /* - Model: SubscriptionCurrentPeriod - Used By: Billing - */ - - class SubscriptionCurrentPeriod: Codable { - - - public var start: String? - - public var end: String? - - - public enum CodingKeys: String, CodingKey { - - case start = "start" - - case end = "end" - - } - - public init(end: String?, start: String?) { - - self.start = start - - self.end = end - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - start = try container.decode(String.self, forKey: .start) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - end = try container.decode(String.self, forKey: .end) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(start, forKey: .start) - - - - try? container.encodeIfPresent(end, forKey: .end) - - - } - - } - - /* - Model: SubscriptionPauseCollection - Used By: Billing - */ - - class SubscriptionPauseCollection: Codable { - - - public var behavior: String? - - public var resumeAt: String? - - - public enum CodingKeys: String, CodingKey { - - case behavior = "behavior" - - case resumeAt = "resume_at" - - } - - public init(behavior: String?, resumeAt: String?) { - - self.behavior = behavior - - self.resumeAt = resumeAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - behavior = try container.decode(String.self, forKey: .behavior) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - resumeAt = try container.decode(String.self, forKey: .resumeAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(behavior, forKey: .behavior) - - - - try? container.encodeIfPresent(resumeAt, forKey: .resumeAt) - - - } - - } - - /* - Model: SubscriptionTrial - Used By: Billing - */ - - class SubscriptionTrial: Codable { - - - public var start: String? - - public var end: String? - - - public enum CodingKeys: String, CodingKey { - - case start = "start" - - case end = "end" - - } - - public init(end: String?, start: String?) { - - self.start = start - - self.end = end - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - start = try container.decode(String.self, forKey: .start) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - end = try container.decode(String.self, forKey: .end) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(start, forKey: .start) - - - - try? container.encodeIfPresent(end, forKey: .end) - - - } - - } - - /* - Model: SubscriptionInvoiceSettings - Used By: Billing - */ - - class SubscriptionInvoiceSettings: Codable { - - - public var generation: Bool? - - public var charging: Bool? - - - public enum CodingKeys: String, CodingKey { - - case generation = "generation" - - case charging = "charging" - - } - - public init(charging: Bool?, generation: Bool?) { - - self.generation = generation - - self.charging = charging - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - generation = try container.decode(Bool.self, forKey: .generation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - charging = try container.decode(Bool.self, forKey: .charging) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(generation, forKey: .generation) - - - - try? container.encodeIfPresent(charging, forKey: .charging) - - - } - - } - - /* - Model: Subscription - Used By: Billing - */ - - class Subscription: Codable { - - - public var currentPeriod: SubscriptionCurrentPeriod? - - public var pauseCollection: SubscriptionPauseCollection? - - public var trial: SubscriptionTrial? - - public var invoiceSettings: SubscriptionInvoiceSettings? - - public var isActive: Bool? - - public var cancelAtPeriodEnd: Bool? - - public var id: String? - - public var subscriberId: String? - - public var planId: String? - - public var productSuiteId: String? - - public var planData: Plan? - - public var currentStatus: String? - - public var collectionMethod: String? - - public var createdAt: String? - - public var modifiedAt: String? - - public var latestInvoice: String? - - - public enum CodingKeys: String, CodingKey { - - case currentPeriod = "current_period" - - case pauseCollection = "pause_collection" - - case trial = "trial" - - case invoiceSettings = "invoice_settings" - - case isActive = "is_active" - - case cancelAtPeriodEnd = "cancel_at_period_end" - - case id = "_id" - - case subscriberId = "subscriber_id" - - case planId = "plan_id" - - case productSuiteId = "product_suite_id" - - case planData = "plan_data" - - case currentStatus = "current_status" - - case collectionMethod = "collection_method" - - case createdAt = "created_at" - - case modifiedAt = "modified_at" - - case latestInvoice = "latest_invoice" - - } - - public init(cancelAtPeriodEnd: Bool?, collectionMethod: String?, createdAt: String?, currentPeriod: SubscriptionCurrentPeriod?, currentStatus: String?, invoiceSettings: SubscriptionInvoiceSettings?, isActive: Bool?, latestInvoice: String?, modifiedAt: String?, pauseCollection: SubscriptionPauseCollection?, planData: Plan?, planId: String?, productSuiteId: String?, subscriberId: String?, trial: SubscriptionTrial?, id: String?) { - - self.currentPeriod = currentPeriod - - self.pauseCollection = pauseCollection - - self.trial = trial - - self.invoiceSettings = invoiceSettings - - self.isActive = isActive - - self.cancelAtPeriodEnd = cancelAtPeriodEnd - - self.id = id - - self.subscriberId = subscriberId - - self.planId = planId - - self.productSuiteId = productSuiteId - - self.planData = planData - - self.currentStatus = currentStatus - - self.collectionMethod = collectionMethod - - self.createdAt = createdAt - - self.modifiedAt = modifiedAt - - self.latestInvoice = latestInvoice - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - currentPeriod = try container.decode(SubscriptionCurrentPeriod.self, forKey: .currentPeriod) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pauseCollection = try container.decode(SubscriptionPauseCollection.self, forKey: .pauseCollection) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - trial = try container.decode(SubscriptionTrial.self, forKey: .trial) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - invoiceSettings = try container.decode(SubscriptionInvoiceSettings.self, forKey: .invoiceSettings) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cancelAtPeriodEnd = try container.decode(Bool.self, forKey: .cancelAtPeriodEnd) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subscriberId = try container.decode(String.self, forKey: .subscriberId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - planId = try container.decode(String.self, forKey: .planId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productSuiteId = try container.decode(String.self, forKey: .productSuiteId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - planData = try container.decode(Plan.self, forKey: .planData) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currentStatus = try container.decode(String.self, forKey: .currentStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - collectionMethod = try container.decode(String.self, forKey: .collectionMethod) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedAt = try container.decode(String.self, forKey: .modifiedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - latestInvoice = try container.decode(String.self, forKey: .latestInvoice) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(currentPeriod, forKey: .currentPeriod) - - - - try? container.encodeIfPresent(pauseCollection, forKey: .pauseCollection) - - - - try? container.encodeIfPresent(trial, forKey: .trial) - - - - try? container.encodeIfPresent(invoiceSettings, forKey: .invoiceSettings) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(cancelAtPeriodEnd, forKey: .cancelAtPeriodEnd) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(subscriberId, forKey: .subscriberId) - - - - try? container.encodeIfPresent(planId, forKey: .planId) - - - - try? container.encodeIfPresent(productSuiteId, forKey: .productSuiteId) - - - - try? container.encodeIfPresent(planData, forKey: .planData) - - - - try? container.encodeIfPresent(currentStatus, forKey: .currentStatus) - - - - try? container.encodeIfPresent(collectionMethod, forKey: .collectionMethod) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) - - - - try? container.encodeIfPresent(latestInvoice, forKey: .latestInvoice) - - - } - - } - - /* - Model: SubscriptionStatus - Used By: Billing - */ - - class SubscriptionStatus: Codable { - - - public var isEnabled: Bool? - - public var subscription: Subscription? - - - public enum CodingKeys: String, CodingKey { - - case isEnabled = "is_enabled" - - case subscription = "subscription" - - } - - public init(isEnabled: Bool?, subscription: Subscription?) { - - self.isEnabled = isEnabled - - self.subscription = subscription - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isEnabled = try container.decode(Bool.self, forKey: .isEnabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subscription = try container.decode(Subscription.self, forKey: .subscription) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isEnabled, forKey: .isEnabled) - - - - try? container.encodeIfPresent(subscription, forKey: .subscription) - - - } - - } - - /* - Model: SubscriptionLimitApplication - Used By: Billing - */ - - class SubscriptionLimitApplication: Codable { - - - public var enabled: Bool? - - public var hardLimit: Int? - - public var softLimit: Int? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - case hardLimit = "hard_limit" - - case softLimit = "soft_limit" - - } - - public init(enabled: Bool?, hardLimit: Int?, softLimit: Int?) { - - self.enabled = enabled - - self.hardLimit = hardLimit - - self.softLimit = softLimit - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hardLimit = try container.decode(Int.self, forKey: .hardLimit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - softLimit = try container.decode(Int.self, forKey: .softLimit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(hardLimit, forKey: .hardLimit) - - - - try? container.encodeIfPresent(softLimit, forKey: .softLimit) - - - } - - } - - /* - Model: SubscriptionLimitMarketplace - Used By: Billing - */ - - class SubscriptionLimitMarketplace: Codable { - - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - } - - public init(enabled: Bool?) { - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: SubscriptionLimitOtherPlatform - Used By: Billing - */ - - class SubscriptionLimitOtherPlatform: Codable { - - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - } - - public init(enabled: Bool?) { - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: SubscriptionLimitTeam - Used By: Billing - */ - - class SubscriptionLimitTeam: Codable { - - - public var limit: Int? - - - public enum CodingKeys: String, CodingKey { - - case limit = "limit" - - } - - public init(limit: Int?) { - - self.limit = limit - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - limit = try container.decode(Int.self, forKey: .limit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(limit, forKey: .limit) - - - } - - } - - /* - Model: SubscriptionLimitProducts - Used By: Billing - */ - - class SubscriptionLimitProducts: Codable { - - - public var bulk: Bool? - - public var limit: Int? - - - public enum CodingKeys: String, CodingKey { - - case bulk = "bulk" - - case limit = "limit" - - } - - public init(bulk: Bool?, limit: Int?) { - - self.bulk = bulk - - self.limit = limit - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - bulk = try container.decode(Bool.self, forKey: .bulk) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - limit = try container.decode(Int.self, forKey: .limit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(bulk, forKey: .bulk) - - - - try? container.encodeIfPresent(limit, forKey: .limit) - - - } - - } - - /* - Model: SubscriptionLimitExtensions - Used By: Billing - */ - - class SubscriptionLimitExtensions: Codable { - - - public var enabled: Bool? - - public var limit: Int? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - case limit = "limit" - - } - - public init(enabled: Bool?, limit: Int?) { - - self.enabled = enabled - - self.limit = limit - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - limit = try container.decode(Int.self, forKey: .limit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(limit, forKey: .limit) - - - } - - } - - /* - Model: SubscriptionLimitIntegrations - Used By: Billing - */ - - class SubscriptionLimitIntegrations: Codable { - - - public var enabled: Bool? - - public var limit: Int? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - case limit = "limit" - - } - - public init(enabled: Bool?, limit: Int?) { - - self.enabled = enabled - - self.limit = limit - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - limit = try container.decode(Int.self, forKey: .limit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(limit, forKey: .limit) - - - } - - } - - /* - Model: SubscriptionLimit - Used By: Billing - */ - - class SubscriptionLimit: Codable { - - - public var application: SubscriptionLimitApplication? - - public var marketplace: SubscriptionLimitMarketplace? - - public var otherPlatform: SubscriptionLimitOtherPlatform? - - public var team: SubscriptionLimitTeam? - - public var products: SubscriptionLimitProducts? - - public var extensions: SubscriptionLimitExtensions? - - public var integrations: SubscriptionLimitIntegrations? - - public var isTrialPlan: Bool? - - - public enum CodingKeys: String, CodingKey { - - case application = "application" - - case marketplace = "marketplace" - - case otherPlatform = "other_platform" - - case team = "team" - - case products = "products" - - case extensions = "extensions" - - case integrations = "integrations" - - case isTrialPlan = "is_trial_plan" - - } - - public init(application: SubscriptionLimitApplication?, extensions: SubscriptionLimitExtensions?, integrations: SubscriptionLimitIntegrations?, isTrialPlan: Bool?, marketplace: SubscriptionLimitMarketplace?, otherPlatform: SubscriptionLimitOtherPlatform?, products: SubscriptionLimitProducts?, team: SubscriptionLimitTeam?) { - - self.application = application - - self.marketplace = marketplace - - self.otherPlatform = otherPlatform - - self.team = team - - self.products = products - - self.extensions = extensions - - self.integrations = integrations - - self.isTrialPlan = isTrialPlan - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - application = try container.decode(SubscriptionLimitApplication.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - marketplace = try container.decode(SubscriptionLimitMarketplace.self, forKey: .marketplace) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - otherPlatform = try container.decode(SubscriptionLimitOtherPlatform.self, forKey: .otherPlatform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - team = try container.decode(SubscriptionLimitTeam.self, forKey: .team) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - products = try container.decode(SubscriptionLimitProducts.self, forKey: .products) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - extensions = try container.decode(SubscriptionLimitExtensions.self, forKey: .extensions) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - integrations = try container.decode(SubscriptionLimitIntegrations.self, forKey: .integrations) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isTrialPlan = try container.decode(Bool.self, forKey: .isTrialPlan) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(marketplace, forKey: .marketplace) - - - - try? container.encodeIfPresent(otherPlatform, forKey: .otherPlatform) - - - - try? container.encodeIfPresent(team, forKey: .team) - - - - try? container.encodeIfPresent(products, forKey: .products) - - - - try? container.encodeIfPresent(extensions, forKey: .extensions) - - - - try? container.encodeIfPresent(integrations, forKey: .integrations) - - - - try? container.encodeIfPresent(isTrialPlan, forKey: .isTrialPlan) - - - } - - } - - /* - Model: SubscriptionActivateReq - Used By: Billing - */ - - class SubscriptionActivateReq: Codable { - - - public var uniqueId: String? - - public var type: String? - - public var productSuite: String? - - public var planId: String? - - public var paymentMethod: String? - - - public enum CodingKeys: String, CodingKey { - - case uniqueId = "unique_id" - - case type = "type" - - case productSuite = "product_suite" - - case planId = "plan_id" - - case paymentMethod = "payment_method" - - } - - public init(paymentMethod: String?, planId: String?, productSuite: String?, type: String?, uniqueId: String?) { - - self.uniqueId = uniqueId - - self.type = type - - self.productSuite = productSuite - - self.planId = planId - - self.paymentMethod = paymentMethod - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - uniqueId = try container.decode(String.self, forKey: .uniqueId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productSuite = try container.decode(String.self, forKey: .productSuite) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - planId = try container.decode(String.self, forKey: .planId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentMethod = try container.decode(String.self, forKey: .paymentMethod) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uniqueId, forKey: .uniqueId) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(productSuite, forKey: .productSuite) - - - - try? container.encodeIfPresent(planId, forKey: .planId) - - - - try? container.encodeIfPresent(paymentMethod, forKey: .paymentMethod) - - - } - - } - - /* - Model: SubscriptionActivateRes - Used By: Billing - */ - - class SubscriptionActivateRes: Codable { - - - public var success: Bool? - - public var data: Subscription? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case data = "data" - - } - - public init(data: Subscription?, success: Bool?) { - - self.success = success - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode(Subscription.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: CancelSubscriptionReq - Used By: Billing - */ - - class CancelSubscriptionReq: Codable { - - - public var uniqueId: String? - - public var type: String? - - public var productSuite: String? - - public var subscriptionId: String? - - - public enum CodingKeys: String, CodingKey { - - case uniqueId = "unique_id" - - case type = "type" - - case productSuite = "product_suite" - - case subscriptionId = "subscription_id" - - } - - public init(productSuite: String?, subscriptionId: String?, type: String?, uniqueId: String?) { - - self.uniqueId = uniqueId - - self.type = type - - self.productSuite = productSuite - - self.subscriptionId = subscriptionId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - uniqueId = try container.decode(String.self, forKey: .uniqueId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productSuite = try container.decode(String.self, forKey: .productSuite) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subscriptionId = try container.decode(String.self, forKey: .subscriptionId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uniqueId, forKey: .uniqueId) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(productSuite, forKey: .productSuite) - - - - try? container.encodeIfPresent(subscriptionId, forKey: .subscriptionId) - - - } - - } - - /* - Model: CancelSubscriptionRes - Used By: Billing - */ - - class CancelSubscriptionRes: Codable { - - - public var success: Bool? - - public var data: Subscription? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case data = "data" - - } - - public init(data: Subscription?, success: Bool?) { - - self.success = success - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode(Subscription.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - - - /* - Model: StatsImported - Used By: Communication - */ - - class StatsImported: Codable { - - - public var count: Int? - - - public enum CodingKeys: String, CodingKey { - - case count = "count" - - } - - public init(count: Int?) { - - self.count = count - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(count, forKey: .count) - - - } - - } - - /* - Model: StatsProcessedEmail - Used By: Communication - */ - - class StatsProcessedEmail: Codable { - - - public var success: Int? - - public var failed: Int? - - public var suppressed: Int? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case failed = "failed" - - case suppressed = "suppressed" - - } - - public init(failed: Int?, success: Int?, suppressed: Int?) { - - self.success = success - - self.failed = failed - - self.suppressed = suppressed - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Int.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - failed = try container.decode(Int.self, forKey: .failed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - suppressed = try container.decode(Int.self, forKey: .suppressed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(failed, forKey: .failed) - - - - try? container.encodeIfPresent(suppressed, forKey: .suppressed) - - - } - - } - - /* - Model: StatsProcessedSms - Used By: Communication - */ - - class StatsProcessedSms: Codable { - - - public var success: Int? - - public var failed: Int? - - public var suppressed: Int? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case failed = "failed" - - case suppressed = "suppressed" - - } - - public init(failed: Int?, success: Int?, suppressed: Int?) { - - self.success = success - - self.failed = failed - - self.suppressed = suppressed - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Int.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - failed = try container.decode(Int.self, forKey: .failed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - suppressed = try container.decode(Int.self, forKey: .suppressed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(failed, forKey: .failed) - - - - try? container.encodeIfPresent(suppressed, forKey: .suppressed) - - - } - - } - - /* - Model: StatsProcessed - Used By: Communication - */ - - class StatsProcessed: Codable { - - - public var email: StatsProcessedEmail? - - public var sms: StatsProcessedSms? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case sms = "sms" - - } - - public init(email: StatsProcessedEmail?, sms: StatsProcessedSms?) { - - self.email = email - - self.sms = sms - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(StatsProcessedEmail.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sms = try container.decode(StatsProcessedSms.self, forKey: .sms) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(sms, forKey: .sms) - - - } - - } - - /* - Model: Stats - Used By: Communication - */ - - class Stats: Codable { - - - public var id: String? - - public var imported: [String: Any]? - - public var processed: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case imported = "imported" - - case processed = "processed" - - } - - public init(imported: [String: Any]?, processed: [String: Any]?, id: String?) { - - self.id = id - - self.imported = imported - - self.processed = processed - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - imported = try container.decode([String: Any].self, forKey: .imported) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - processed = try container.decode([String: Any].self, forKey: .processed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(imported, forKey: .imported) - - - - try? container.encodeIfPresent(processed, forKey: .processed) - - - } - - } - - /* - Model: GetStats - Used By: Communication - */ - - class GetStats: Codable { - - - public var items: [Stats]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - } - - public init(items: [Stats]?) { - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Stats].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: CampaignReq - Used By: Communication - */ - - class CampaignReq: Codable { - - - public var description: String? - - public var tags: [String]? - - public var headers: [String]? - - public var isActive: Bool? - - public var name: String? - - public var fileUrl: String? - - public var type: String? - - public var recordsCount: Int? - - public var application: String? - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case tags = "tags" - - case headers = "headers" - - case isActive = "is_active" - - case name = "name" - - case fileUrl = "file_url" - - case type = "type" - - case recordsCount = "records_count" - - case application = "application" - - } - - public init(application: String?, description: String?, fileUrl: String?, headers: [String]?, isActive: Bool?, name: String?, recordsCount: Int?, tags: [String]?, type: String?) { - - self.description = description - - self.tags = tags - - self.headers = headers - - self.isActive = isActive - - self.name = name - - self.fileUrl = fileUrl - - self.type = type - - self.recordsCount = recordsCount - - self.application = application - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - headers = try container.decode([String].self, forKey: .headers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fileUrl = try container.decode(String.self, forKey: .fileUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - recordsCount = try container.decode(Int.self, forKey: .recordsCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(headers, forKey: .headers) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(fileUrl, forKey: .fileUrl) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(recordsCount, forKey: .recordsCount) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - } - - } - - /* - Model: RecipientHeaders - Used By: Communication - */ - - class RecipientHeaders: Codable { - - - public var email: String? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - } - - public init(email: String?) { - - self.email = email - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - } - - } - - /* - Model: CampaignEmailTemplate - Used By: Communication - */ - - class CampaignEmailTemplate: Codable { - - - public var key: String? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case value = "value" - - } - - public init(key: String?, value: String?) { - - self.key = key - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: CampignEmailProvider - Used By: Communication - */ - - class CampignEmailProvider: Codable { - - - public var id: String? - - public var fromName: String? - - public var fromEmail: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case fromName = "from_name" - - case fromEmail = "from_email" - - } - - public init(fromEmail: String?, fromName: String?, id: String?) { - - self.id = id - - self.fromName = fromName - - self.fromEmail = fromEmail - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fromName = try container.decode(String.self, forKey: .fromName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fromEmail = try container.decode(String.self, forKey: .fromEmail) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(fromName, forKey: .fromName) - - - - try? container.encodeIfPresent(fromEmail, forKey: .fromEmail) - - - } - - } - - /* - Model: CampaignEmail - Used By: Communication - */ - - class CampaignEmail: Codable { - - - public var template: CampaignEmailTemplate? - - public var provider: CampignEmailProvider? - - - public enum CodingKeys: String, CodingKey { - - case template = "template" - - case provider = "provider" - - } - - public init(provider: CampignEmailProvider?, template: CampaignEmailTemplate?) { - - self.template = template - - self.provider = provider - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - template = try container.decode(CampaignEmailTemplate.self, forKey: .template) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - provider = try container.decode(CampignEmailProvider.self, forKey: .provider) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(template, forKey: .template) - - - - try? container.encodeIfPresent(provider, forKey: .provider) - - - } - - } - - /* - Model: Campaign - Used By: Communication - */ - - class Campaign: Codable { - - - public var recipientHeaders: RecipientHeaders? - - public var email: CampaignEmail? - - public var description: String? - - public var tags: [[String: Any]]? - - public var isActive: Bool? - - public var id: String? - - public var datasource: String? - - public var type: String? - - public var name: String? - - public var application: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var slug: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case recipientHeaders = "recipient_headers" - - case email = "email" - - case description = "description" - - case tags = "tags" - - case isActive = "is_active" - - case id = "_id" - - case datasource = "datasource" - - case type = "type" - - case name = "name" - - case application = "application" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case slug = "slug" - - case v = "__v" - - } - - public init(application: String?, createdAt: String?, datasource: String?, description: String?, email: CampaignEmail?, isActive: Bool?, name: String?, recipientHeaders: RecipientHeaders?, slug: String?, tags: [[String: Any]]?, type: String?, updatedAt: String?, id: String?, v: Int?) { - - self.recipientHeaders = recipientHeaders - - self.email = email - - self.description = description - - self.tags = tags - - self.isActive = isActive - - self.id = id - - self.datasource = datasource - - self.type = type - - self.name = name - - self.application = application - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.slug = slug - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - recipientHeaders = try container.decode(RecipientHeaders.self, forKey: .recipientHeaders) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(CampaignEmail.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([[String: Any]].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - datasource = try container.decode(String.self, forKey: .datasource) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(recipientHeaders, forKey: .recipientHeaders) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(datasource, forKey: .datasource) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: Campaigns - Used By: Communication - */ - - class Campaigns: Codable { - - - public var items: [Campaign]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [Campaign]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Campaign].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: BigqueryHeadersReq - Used By: Communication - */ - - class BigqueryHeadersReq: Codable { - - - public var query: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case query = "query" - - case type = "type" - - } - - public init(query: String?, type: String?) { - - self.query = query - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - query = try container.decode(String.self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(query, forKey: .query) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: BigqueryHeadersResHeaders - Used By: Communication - */ - - class BigqueryHeadersResHeaders: Codable { - - - public var name: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case type = "type" - - } - - public init(name: String?, type: String?) { - - self.name = name - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: BigqueryHeadersRes - Used By: Communication - */ - - class BigqueryHeadersRes: Codable { - - - public var headers: [BigqueryHeadersResHeaders]? - - - public enum CodingKeys: String, CodingKey { - - case headers = "headers" - - } - - public init(headers: [BigqueryHeadersResHeaders]?) { - - self.headers = headers - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - headers = try container.decode([BigqueryHeadersResHeaders].self, forKey: .headers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(headers, forKey: .headers) - - - } - - } - - /* - Model: GetNRecordsCsvReq - Used By: Communication - */ - - class GetNRecordsCsvReq: Codable { - - - public var url: String? - - public var header: Bool? - - public var count: Int? - - - public enum CodingKeys: String, CodingKey { - - case url = "url" - - case header = "header" - - case count = "count" - - } - - public init(count: Int?, header: Bool?, url: String?) { - - self.url = url - - self.header = header - - self.count = count - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - header = try container.decode(Bool.self, forKey: .header) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(header, forKey: .header) - - - - try? container.encodeIfPresent(count, forKey: .count) - - - } - - } - - /* - Model: GetNRecordsCsvResItems - Used By: Communication - */ - - class GetNRecordsCsvResItems: Codable { - - - public var phoneNumber: String? - - public var email: String? - - public var firstname: String? - - public var lastname: String? - - public var orderid: String? - - - public enum CodingKeys: String, CodingKey { - - case phoneNumber = "phone_number" - - case email = "email" - - case firstname = "firstname" - - case lastname = "lastname" - - case orderid = "orderid" - - } - - public init(email: String?, firstname: String?, lastname: String?, orderid: String?, phoneNumber: String?) { - - self.phoneNumber = phoneNumber - - self.email = email - - self.firstname = firstname - - self.lastname = lastname - - self.orderid = orderid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - phoneNumber = try container.decode(String.self, forKey: .phoneNumber) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - firstname = try container.decode(String.self, forKey: .firstname) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastname = try container.decode(String.self, forKey: .lastname) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderid = try container.decode(String.self, forKey: .orderid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(phoneNumber, forKey: .phoneNumber) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(firstname, forKey: .firstname) - - - - try? container.encodeIfPresent(lastname, forKey: .lastname) - - - - try? container.encodeIfPresent(orderid, forKey: .orderid) - - - } - - } - - /* - Model: GetNRecordsCsvRes - Used By: Communication - */ - - class GetNRecordsCsvRes: Codable { - - - public var items: [GetNRecordsCsvResItems]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - } - - public init(items: [GetNRecordsCsvResItems]?) { - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([GetNRecordsCsvResItems].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: AudienceReq - Used By: Communication - */ - - class AudienceReq: Codable { - - - public var description: String? - - public var tags: [String]? - - public var headers: [String]? - - public var isActive: Bool? - - public var name: String? - - public var fileUrl: String? - - public var type: String? - - public var recordsCount: Int? - - public var application: String? - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case tags = "tags" - - case headers = "headers" - - case isActive = "is_active" - - case name = "name" - - case fileUrl = "file_url" - - case type = "type" - - case recordsCount = "records_count" - - case application = "application" - - } - - public init(application: String?, description: String?, fileUrl: String?, headers: [String]?, isActive: Bool?, name: String?, recordsCount: Int?, tags: [String]?, type: String?) { - - self.description = description - - self.tags = tags - - self.headers = headers - - self.isActive = isActive - - self.name = name - - self.fileUrl = fileUrl - - self.type = type - - self.recordsCount = recordsCount - - self.application = application - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - headers = try container.decode([String].self, forKey: .headers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fileUrl = try container.decode(String.self, forKey: .fileUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - recordsCount = try container.decode(Int.self, forKey: .recordsCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(headers, forKey: .headers) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(fileUrl, forKey: .fileUrl) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(recordsCount, forKey: .recordsCount) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - } - - } - - /* - Model: Audience - Used By: Communication - */ - - class Audience: Codable { - - - public var description: String? - - public var tags: [String]? - - public var headers: [String]? - - public var isActive: Bool? - - public var id: String? - - public var name: String? - - public var fileUrl: String? - - public var type: String? - - public var recordsCount: Int? - - public var application: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var slug: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case tags = "tags" - - case headers = "headers" - - case isActive = "is_active" - - case id = "_id" - - case name = "name" - - case fileUrl = "file_url" - - case type = "type" - - case recordsCount = "records_count" - - case application = "application" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case slug = "slug" - - case v = "__v" - - } - - public init(application: String?, createdAt: String?, description: String?, fileUrl: String?, headers: [String]?, isActive: Bool?, name: String?, recordsCount: Int?, slug: String?, tags: [String]?, type: String?, updatedAt: String?, id: String?, v: Int?) { - - self.description = description - - self.tags = tags - - self.headers = headers - - self.isActive = isActive - - self.id = id - - self.name = name - - self.fileUrl = fileUrl - - self.type = type - - self.recordsCount = recordsCount - - self.application = application - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.slug = slug - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - headers = try container.decode([String].self, forKey: .headers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fileUrl = try container.decode(String.self, forKey: .fileUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - recordsCount = try container.decode(Int.self, forKey: .recordsCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(headers, forKey: .headers) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(fileUrl, forKey: .fileUrl) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(recordsCount, forKey: .recordsCount) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: Audiences - Used By: Communication - */ - - class Audiences: Codable { - - - public var items: [Audience]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [Audience]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Audience].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: EmailProviderReqFrom - Used By: Communication - */ - - class EmailProviderReqFrom: Codable { - - - public var name: String? - - public var email: String? - - public var isDefault: Bool? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case email = "email" - - case isDefault = "is_default" - - } - - public init(email: String?, isDefault: Bool?, name: String?) { - - self.name = name - - self.email = email - - self.isDefault = isDefault - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isDefault = try container.decode(Bool.self, forKey: .isDefault) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(isDefault, forKey: .isDefault) - - - } - - } - - /* - Model: EmailProviderReq - Used By: Communication - */ - - class EmailProviderReq: Codable { - - - public var name: String? - - public var description: String? - - public var apiKey: String? - - public var type: String? - - public var provider: String? - - public var from: [EmailProviderReqFrom]? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case description = "description" - - case apiKey = "api_key" - - case type = "type" - - case provider = "provider" - - case from = "from" - - } - - public init(apiKey: String?, description: String?, from: [EmailProviderReqFrom]?, name: String?, provider: String?, type: String?) { - - self.name = name - - self.description = description - - self.apiKey = apiKey - - self.type = type - - self.provider = provider - - self.from = from - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - apiKey = try container.decode(String.self, forKey: .apiKey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - provider = try container.decode(String.self, forKey: .provider) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - from = try container.decode([EmailProviderReqFrom].self, forKey: .from) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(apiKey, forKey: .apiKey) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(provider, forKey: .provider) - - - - try? container.encodeIfPresent(from, forKey: .from) - - - } - - } - - /* - Model: EmailProvider - Used By: Communication - */ - - class EmailProvider: Codable { - - - public var type: String? - - public var provider: String? - - public var from: [EmailProviderReqFrom]? - - public var id: String? - - public var name: String? - - public var description: String? - - public var apiKey: String? - - public var application: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var slug: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case provider = "provider" - - case from = "from" - - case id = "_id" - - case name = "name" - - case description = "description" - - case apiKey = "api_key" - - case application = "application" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case slug = "slug" - - case v = "__v" - - } - - public init(apiKey: String?, application: String?, createdAt: String?, description: String?, from: [EmailProviderReqFrom]?, name: String?, provider: String?, slug: String?, type: String?, updatedAt: String?, id: String?, v: Int?) { - - self.type = type - - self.provider = provider - - self.from = from - - self.id = id - - self.name = name - - self.description = description - - self.apiKey = apiKey - - self.application = application - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.slug = slug - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - provider = try container.decode(String.self, forKey: .provider) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - from = try container.decode([EmailProviderReqFrom].self, forKey: .from) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - apiKey = try container.decode(String.self, forKey: .apiKey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(provider, forKey: .provider) - - - - try? container.encodeIfPresent(from, forKey: .from) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(apiKey, forKey: .apiKey) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: EmailProviders - Used By: Communication - */ - - class EmailProviders: Codable { - - - public var items: [EmailProvider]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [EmailProvider]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([EmailProvider].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: EmailTemplateDeleteSuccessRes - Used By: Communication - */ - - class EmailTemplateDeleteSuccessRes: Codable { - - - public var success: Bool? - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case message = "message" - - } - - public init(message: String?, success: Bool?) { - - self.success = success - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: EmailTemplateDeleteFailureRes - Used By: Communication - */ - - class EmailTemplateDeleteFailureRes: Codable { - - - public var success: Bool? - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case message = "message" - - } - - public init(message: String?, success: Bool?) { - - self.success = success - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: EmailTemplateKeys - Used By: Communication - */ - - class EmailTemplateKeys: Codable { - - - public var to: String? - - public var cc: String? - - public var bcc: String? - - - public enum CodingKeys: String, CodingKey { - - case to = "to" - - case cc = "cc" - - case bcc = "bcc" - - } - - public init(bcc: String?, cc: String?, to: String?) { - - self.to = to - - self.cc = cc - - self.bcc = bcc - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - to = try container.decode(String.self, forKey: .to) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cc = try container.decode(String.self, forKey: .cc) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bcc = try container.decode(String.self, forKey: .bcc) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(to, forKey: .to) - - - - try? container.encodeIfPresent(cc, forKey: .cc) - - - - try? container.encodeIfPresent(bcc, forKey: .bcc) - - - } - - } - - /* - Model: EmailTemplateHeaders - Used By: Communication - */ - - class EmailTemplateHeaders: Codable { - - - public var key: String? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case value = "value" - - } - - public init(key: String?, value: String?) { - - self.key = key - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: EmailTemplateReq - Used By: Communication - */ - - class EmailTemplateReq: Codable { - - - public var name: String? - - public var description: String? - - public var keys: EmailTemplateKeys? - - public var from: String? - - public var staticTo: [String]? - - public var staticCc: [String]? - - public var staticBcc: [String]? - - public var replyTo: String? - - public var headers: [EmailTemplateHeaders]? - - public var subject: TemplateAndType? - - public var html: TemplateAndType? - - public var text: TemplateAndType? - - public var attachments: [[String: Any]]? - - public var priority: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case description = "description" - - case keys = "keys" - - case from = "from" - - case staticTo = "static_to" - - case staticCc = "static_cc" - - case staticBcc = "static_bcc" - - case replyTo = "reply_to" - - case headers = "headers" - - case subject = "subject" - - case html = "html" - - case text = "text" - - case attachments = "attachments" - - case priority = "priority" - - } - - public init(attachments: [[String: Any]]?, description: String?, from: String?, headers: [EmailTemplateHeaders]?, html: TemplateAndType?, keys: EmailTemplateKeys?, name: String?, priority: String?, replyTo: String?, staticBcc: [String]?, staticCc: [String]?, staticTo: [String]?, subject: TemplateAndType?, text: TemplateAndType?) { - - self.name = name - - self.description = description - - self.keys = keys - - self.from = from - - self.staticTo = staticTo - - self.staticCc = staticCc - - self.staticBcc = staticBcc - - self.replyTo = replyTo - - self.headers = headers - - self.subject = subject - - self.html = html - - self.text = text - - self.attachments = attachments - - self.priority = priority - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - keys = try container.decode(EmailTemplateKeys.self, forKey: .keys) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - from = try container.decode(String.self, forKey: .from) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - staticTo = try container.decode([String].self, forKey: .staticTo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - staticCc = try container.decode([String].self, forKey: .staticCc) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - staticBcc = try container.decode([String].self, forKey: .staticBcc) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - replyTo = try container.decode(String.self, forKey: .replyTo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - headers = try container.decode([EmailTemplateHeaders].self, forKey: .headers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subject = try container.decode(TemplateAndType.self, forKey: .subject) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - html = try container.decode(TemplateAndType.self, forKey: .html) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text = try container.decode(TemplateAndType.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attachments = try container.decode([[String: Any]].self, forKey: .attachments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priority = try container.decode(String.self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(keys, forKey: .keys) - - - - try? container.encodeIfPresent(from, forKey: .from) - - - - try? container.encodeIfPresent(staticTo, forKey: .staticTo) - - - - try? container.encodeIfPresent(staticCc, forKey: .staticCc) - - - - try? container.encodeIfPresent(staticBcc, forKey: .staticBcc) - - - - try? container.encodeIfPresent(replyTo, forKey: .replyTo) - - - - try? container.encodeIfPresent(headers, forKey: .headers) - - - - try? container.encodeIfPresent(subject, forKey: .subject) - - - - try? container.encodeIfPresent(html, forKey: .html) - - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(attachments, forKey: .attachments) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - } - - } - - /* - Model: TemplateAndType - Used By: Communication - */ - - class TemplateAndType: Codable { - - - public var templateType: String? - - public var template: String? - - - public enum CodingKeys: String, CodingKey { - - case templateType = "template_type" - - case template = "template" - - } - - public init(template: String?, templateType: String?) { - - self.templateType = templateType - - self.template = template - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - templateType = try container.decode(String.self, forKey: .templateType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - template = try container.decode(String.self, forKey: .template) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(templateType, forKey: .templateType) - - - - try? container.encodeIfPresent(template, forKey: .template) - - - } - - } - - /* - Model: EmailTemplateRes - Used By: Communication - */ - - class EmailTemplateRes: Codable { - - - public var isSystem: Bool? - - public var isInternal: Bool? - - public var description: String? - - public var staticTo: [String]? - - public var staticCc: [String]? - - public var staticBcc: [String]? - - public var tags: [[String: Any]]? - - public var priority: String? - - public var published: Bool? - - public var id: String? - - public var name: String? - - public var keys: EmailTemplateKeys? - - public var from: String? - - public var replyTo: String? - - public var headers: [EmailTemplateHeaders]? - - public var subject: TemplateAndType? - - public var html: TemplateAndType? - - public var text: TemplateAndType? - - public var attachments: [[String: Any]]? - - public var createdAt: String? - - public var updatedAt: String? - - public var slug: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case isSystem = "is_system" - - case isInternal = "is_internal" - - case description = "description" - - case staticTo = "static_to" - - case staticCc = "static_cc" - - case staticBcc = "static_bcc" - - case tags = "tags" - - case priority = "priority" - - case published = "published" - - case id = "_id" - - case name = "name" - - case keys = "keys" - - case from = "from" - - case replyTo = "reply_to" - - case headers = "headers" - - case subject = "subject" - - case html = "html" - - case text = "text" - - case attachments = "attachments" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case slug = "slug" - - case v = "__v" - - } - - public init(attachments: [[String: Any]]?, createdAt: String?, description: String?, from: String?, headers: [EmailTemplateHeaders]?, html: TemplateAndType?, isInternal: Bool?, isSystem: Bool?, keys: EmailTemplateKeys?, name: String?, priority: String?, published: Bool?, replyTo: String?, slug: String?, staticBcc: [String]?, staticCc: [String]?, staticTo: [String]?, subject: TemplateAndType?, tags: [[String: Any]]?, text: TemplateAndType?, updatedAt: String?, id: String?, v: Int?) { - - self.isSystem = isSystem - - self.isInternal = isInternal - - self.description = description - - self.staticTo = staticTo - - self.staticCc = staticCc - - self.staticBcc = staticBcc - - self.tags = tags - - self.priority = priority - - self.published = published - - self.id = id - - self.name = name - - self.keys = keys - - self.from = from - - self.replyTo = replyTo - - self.headers = headers - - self.subject = subject - - self.html = html - - self.text = text - - self.attachments = attachments - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.slug = slug - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isSystem = try container.decode(Bool.self, forKey: .isSystem) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isInternal = try container.decode(Bool.self, forKey: .isInternal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - staticTo = try container.decode([String].self, forKey: .staticTo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - staticCc = try container.decode([String].self, forKey: .staticCc) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - staticBcc = try container.decode([String].self, forKey: .staticBcc) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([[String: Any]].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priority = try container.decode(String.self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - keys = try container.decode(EmailTemplateKeys.self, forKey: .keys) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - from = try container.decode(String.self, forKey: .from) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - replyTo = try container.decode(String.self, forKey: .replyTo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - headers = try container.decode([EmailTemplateHeaders].self, forKey: .headers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subject = try container.decode(TemplateAndType.self, forKey: .subject) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - html = try container.decode(TemplateAndType.self, forKey: .html) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text = try container.decode(TemplateAndType.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attachments = try container.decode([[String: Any]].self, forKey: .attachments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isSystem, forKey: .isSystem) - - - - try? container.encodeIfPresent(isInternal, forKey: .isInternal) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(staticTo, forKey: .staticTo) - - - - try? container.encodeIfPresent(staticCc, forKey: .staticCc) - - - - try? container.encodeIfPresent(staticBcc, forKey: .staticBcc) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(keys, forKey: .keys) - - - - try? container.encodeIfPresent(from, forKey: .from) - - - - try? container.encodeIfPresent(replyTo, forKey: .replyTo) - - - - try? container.encodeIfPresent(headers, forKey: .headers) - - - - try? container.encodeIfPresent(subject, forKey: .subject) - - - - try? container.encodeIfPresent(html, forKey: .html) - - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(attachments, forKey: .attachments) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: EmailTemplate - Used By: Communication - */ - - class EmailTemplate: Codable { - - - public var isSystem: Bool? - - public var isInternal: Bool? - - public var description: String? - - public var staticTo: [[String: Any]]? - - public var staticCc: [[String: Any]]? - - public var staticBcc: [[String: Any]]? - - public var tags: [[String: Any]]? - - public var priority: String? - - public var published: Bool? - - public var id: String? - - public var slug: String? - - public var name: String? - - public var from: String? - - public var fromName: String? - - public var subject: TemplateAndType? - - public var html: TemplateAndType? - - public var text: TemplateAndType? - - public var headers: [[String: Any]]? - - public var attachments: [[String: Any]]? - - public var createdAt: String? - - public var updatedAt: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case isSystem = "is_system" - - case isInternal = "is_internal" - - case description = "description" - - case staticTo = "static_to" - - case staticCc = "static_cc" - - case staticBcc = "static_bcc" - - case tags = "tags" - - case priority = "priority" - - case published = "published" - - case id = "_id" - - case slug = "slug" - - case name = "name" - - case from = "from" - - case fromName = "from_name" - - case subject = "subject" - - case html = "html" - - case text = "text" - - case headers = "headers" - - case attachments = "attachments" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case v = "__v" - - } - - public init(attachments: [[String: Any]]?, createdAt: String?, description: String?, from: String?, fromName: String?, headers: [[String: Any]]?, html: TemplateAndType?, isInternal: Bool?, isSystem: Bool?, name: String?, priority: String?, published: Bool?, slug: String?, staticBcc: [[String: Any]]?, staticCc: [[String: Any]]?, staticTo: [[String: Any]]?, subject: TemplateAndType?, tags: [[String: Any]]?, text: TemplateAndType?, updatedAt: String?, id: String?, v: Int?) { - - self.isSystem = isSystem - - self.isInternal = isInternal - - self.description = description - - self.staticTo = staticTo - - self.staticCc = staticCc - - self.staticBcc = staticBcc - - self.tags = tags - - self.priority = priority - - self.published = published - - self.id = id - - self.slug = slug - - self.name = name - - self.from = from - - self.fromName = fromName - - self.subject = subject - - self.html = html - - self.text = text - - self.headers = headers - - self.attachments = attachments - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isSystem = try container.decode(Bool.self, forKey: .isSystem) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isInternal = try container.decode(Bool.self, forKey: .isInternal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - staticTo = try container.decode([[String: Any]].self, forKey: .staticTo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - staticCc = try container.decode([[String: Any]].self, forKey: .staticCc) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - staticBcc = try container.decode([[String: Any]].self, forKey: .staticBcc) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([[String: Any]].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priority = try container.decode(String.self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - from = try container.decode(String.self, forKey: .from) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fromName = try container.decode(String.self, forKey: .fromName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subject = try container.decode(TemplateAndType.self, forKey: .subject) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - html = try container.decode(TemplateAndType.self, forKey: .html) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text = try container.decode(TemplateAndType.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - headers = try container.decode([[String: Any]].self, forKey: .headers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attachments = try container.decode([[String: Any]].self, forKey: .attachments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isSystem, forKey: .isSystem) - - - - try? container.encodeIfPresent(isInternal, forKey: .isInternal) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(staticTo, forKey: .staticTo) - - - - try? container.encodeIfPresent(staticCc, forKey: .staticCc) - - - - try? container.encodeIfPresent(staticBcc, forKey: .staticBcc) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(from, forKey: .from) - - - - try? container.encodeIfPresent(fromName, forKey: .fromName) - - - - try? container.encodeIfPresent(subject, forKey: .subject) - - - - try? container.encodeIfPresent(html, forKey: .html) - - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(headers, forKey: .headers) - - - - try? container.encodeIfPresent(attachments, forKey: .attachments) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: SystemEmailTemplate - Used By: Communication - */ - - class SystemEmailTemplate: Codable { - - - public var isSystem: Bool? - - public var isInternal: Bool? - - public var description: String? - - public var staticTo: [[String: Any]]? - - public var staticCc: [[String: Any]]? - - public var staticBcc: [[String: Any]]? - - public var tags: [[String: Any]]? - - public var priority: String? - - public var published: Bool? - - public var id: String? - - public var slug: String? - - public var name: String? - - public var from: String? - - public var fromName: String? - - public var subject: TemplateAndType? - - public var html: TemplateAndType? - - public var text: TemplateAndType? - - public var headers: [[String: Any]]? - - public var attachments: [[String: Any]]? - - public var createdAt: String? - - public var updatedAt: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case isSystem = "is_system" - - case isInternal = "is_internal" - - case description = "description" - - case staticTo = "static_to" - - case staticCc = "static_cc" - - case staticBcc = "static_bcc" - - case tags = "tags" - - case priority = "priority" - - case published = "published" - - case id = "_id" - - case slug = "slug" - - case name = "name" - - case from = "from" - - case fromName = "from_name" - - case subject = "subject" - - case html = "html" - - case text = "text" - - case headers = "headers" - - case attachments = "attachments" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case v = "__v" - - } - - public init(attachments: [[String: Any]]?, createdAt: String?, description: String?, from: String?, fromName: String?, headers: [[String: Any]]?, html: TemplateAndType?, isInternal: Bool?, isSystem: Bool?, name: String?, priority: String?, published: Bool?, slug: String?, staticBcc: [[String: Any]]?, staticCc: [[String: Any]]?, staticTo: [[String: Any]]?, subject: TemplateAndType?, tags: [[String: Any]]?, text: TemplateAndType?, updatedAt: String?, id: String?, v: Int?) { - - self.isSystem = isSystem - - self.isInternal = isInternal - - self.description = description - - self.staticTo = staticTo - - self.staticCc = staticCc - - self.staticBcc = staticBcc - - self.tags = tags - - self.priority = priority - - self.published = published - - self.id = id - - self.slug = slug - - self.name = name - - self.from = from - - self.fromName = fromName - - self.subject = subject - - self.html = html - - self.text = text - - self.headers = headers - - self.attachments = attachments - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isSystem = try container.decode(Bool.self, forKey: .isSystem) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isInternal = try container.decode(Bool.self, forKey: .isInternal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - staticTo = try container.decode([[String: Any]].self, forKey: .staticTo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - staticCc = try container.decode([[String: Any]].self, forKey: .staticCc) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - staticBcc = try container.decode([[String: Any]].self, forKey: .staticBcc) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([[String: Any]].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priority = try container.decode(String.self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - from = try container.decode(String.self, forKey: .from) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fromName = try container.decode(String.self, forKey: .fromName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subject = try container.decode(TemplateAndType.self, forKey: .subject) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - html = try container.decode(TemplateAndType.self, forKey: .html) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text = try container.decode(TemplateAndType.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - headers = try container.decode([[String: Any]].self, forKey: .headers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attachments = try container.decode([[String: Any]].self, forKey: .attachments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isSystem, forKey: .isSystem) - - - - try? container.encodeIfPresent(isInternal, forKey: .isInternal) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(staticTo, forKey: .staticTo) - - - - try? container.encodeIfPresent(staticCc, forKey: .staticCc) - - - - try? container.encodeIfPresent(staticBcc, forKey: .staticBcc) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(from, forKey: .from) - - - - try? container.encodeIfPresent(fromName, forKey: .fromName) - - - - try? container.encodeIfPresent(subject, forKey: .subject) - - - - try? container.encodeIfPresent(html, forKey: .html) - - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(headers, forKey: .headers) - - - - try? container.encodeIfPresent(attachments, forKey: .attachments) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: EmailTemplates - Used By: Communication - */ - - class EmailTemplates: Codable { - - - public var items: [EmailTemplate]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [EmailTemplate]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([EmailTemplate].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: SystemEmailTemplates - Used By: Communication - */ - - class SystemEmailTemplates: Codable { - - - public var items: [SystemEmailTemplate]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [SystemEmailTemplate]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([SystemEmailTemplate].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: EventSubscriptionTemplateSms - Used By: Communication - */ - - class EventSubscriptionTemplateSms: Codable { - - - public var subscribed: Bool? - - public var template: String? - - - public enum CodingKeys: String, CodingKey { - - case subscribed = "subscribed" - - case template = "template" - - } - - public init(subscribed: Bool?, template: String?) { - - self.subscribed = subscribed - - self.template = template - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - subscribed = try container.decode(Bool.self, forKey: .subscribed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - template = try container.decode(String.self, forKey: .template) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(subscribed, forKey: .subscribed) - - - - try? container.encodeIfPresent(template, forKey: .template) - - - } - - } - - /* - Model: EventSubscriptionTemplateEmail - Used By: Communication - */ - - class EventSubscriptionTemplateEmail: Codable { - - - public var subscribed: Bool? - - public var template: String? - - - public enum CodingKeys: String, CodingKey { - - case subscribed = "subscribed" - - case template = "template" - - } - - public init(subscribed: Bool?, template: String?) { - - self.subscribed = subscribed - - self.template = template - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - subscribed = try container.decode(Bool.self, forKey: .subscribed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - template = try container.decode(String.self, forKey: .template) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(subscribed, forKey: .subscribed) - - - - try? container.encodeIfPresent(template, forKey: .template) - - - } - - } - - /* - Model: EventSubscriptionTemplate - Used By: Communication - */ - - class EventSubscriptionTemplate: Codable { - - - public var sms: EventSubscriptionTemplateSms? - - public var email: EventSubscriptionTemplateEmail? - - - public enum CodingKeys: String, CodingKey { - - case sms = "sms" - - case email = "email" - - } - - public init(email: EventSubscriptionTemplateEmail?, sms: EventSubscriptionTemplateSms?) { - - self.sms = sms - - self.email = email - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - sms = try container.decode(EventSubscriptionTemplateSms.self, forKey: .sms) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(EventSubscriptionTemplateEmail.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(sms, forKey: .sms) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - } - - } - - /* - Model: EventSubscription - Used By: Communication - */ - - class EventSubscription: Codable { - - - public var template: EventSubscriptionTemplate? - - public var isDefault: Bool? - - public var id: String? - - public var application: String? - - public var event: String? - - public var slug: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case template = "template" - - case isDefault = "is_default" - - case id = "_id" - - case application = "application" - - case event = "event" - - case slug = "slug" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case v = "__v" - - } - - public init(application: String?, createdAt: String?, event: String?, isDefault: Bool?, slug: String?, template: EventSubscriptionTemplate?, updatedAt: String?, id: String?, v: Int?) { - - self.template = template - - self.isDefault = isDefault - - self.id = id - - self.application = application - - self.event = event - - self.slug = slug - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - template = try container.decode(EventSubscriptionTemplate.self, forKey: .template) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isDefault = try container.decode(Bool.self, forKey: .isDefault) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - event = try container.decode(String.self, forKey: .event) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(template, forKey: .template) - - - - try? container.encodeIfPresent(isDefault, forKey: .isDefault) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(event, forKey: .event) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: EventSubscriptions - Used By: Communication - */ - - class EventSubscriptions: Codable { - - - public var items: [EventSubscription]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [EventSubscription]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([EventSubscription].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: TriggerJobResponse - Used By: Communication - */ - - class TriggerJobResponse: Codable { - - - public var status: Int? - - - public enum CodingKeys: String, CodingKey { - - case status = "status" - - } - - public init(status: Int?) { - - self.status = status - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - status = try container.decode(Int.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(status, forKey: .status) - - - } - - } - - /* - Model: TriggerJobRequest - Used By: Communication - */ - - class TriggerJobRequest: Codable { - - - public var jobId: String? - - - public enum CodingKeys: String, CodingKey { - - case jobId = "job_id" - - } - - public init(jobId: String?) { - - self.jobId = jobId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - jobId = try container.decode(String.self, forKey: .jobId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(jobId, forKey: .jobId) - - - } - - } - - /* - Model: Job - Used By: Communication - */ - - class Job: Codable { - - - public var completed: Bool? - - public var isActive: Bool? - - public var id: String? - - public var campaign: String? - - public var application: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case completed = "completed" - - case isActive = "is_active" - - case id = "_id" - - case campaign = "campaign" - - case application = "application" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case v = "__v" - - } - - public init(application: String?, campaign: String?, completed: Bool?, createdAt: String?, isActive: Bool?, updatedAt: String?, id: String?, v: Int?) { - - self.completed = completed - - self.isActive = isActive - - self.id = id - - self.campaign = campaign - - self.application = application - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - completed = try container.decode(Bool.self, forKey: .completed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - campaign = try container.decode(String.self, forKey: .campaign) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(completed, forKey: .completed) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(campaign, forKey: .campaign) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: Jobs - Used By: Communication - */ - - class Jobs: Codable { - - - public var items: [Job]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [Job]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Job].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: JobLog - Used By: Communication - */ - - class JobLog: Codable { - - - public var imported: [String: Any]? - - public var processed: [String: Any]? - - public var id: String? - - public var job: String? - - public var campaign: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case imported = "imported" - - case processed = "processed" - - case id = "_id" - - case job = "job" - - case campaign = "campaign" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case v = "__v" - - } - - public init(campaign: String?, createdAt: String?, imported: [String: Any]?, job: String?, processed: [String: Any]?, updatedAt: String?, id: String?, v: Int?) { - - self.imported = imported - - self.processed = processed - - self.id = id - - self.job = job - - self.campaign = campaign - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - imported = try container.decode([String: Any].self, forKey: .imported) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - processed = try container.decode([String: Any].self, forKey: .processed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - job = try container.decode(String.self, forKey: .job) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - campaign = try container.decode(String.self, forKey: .campaign) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(imported, forKey: .imported) - - - - try? container.encodeIfPresent(processed, forKey: .processed) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(job, forKey: .job) - - - - try? container.encodeIfPresent(campaign, forKey: .campaign) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: JobLogs - Used By: Communication - */ - - class JobLogs: Codable { - - - public var items: [JobLog]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [JobLog]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([JobLog].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: LogEmail - Used By: Communication - */ - - class LogEmail: Codable { - - - public var template: String? - - - public enum CodingKeys: String, CodingKey { - - case template = "template" - - } - - public init(template: String?) { - - self.template = template - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - template = try container.decode(String.self, forKey: .template) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(template, forKey: .template) - - - } - - } - - /* - Model: LogPushnotification - Used By: Communication - */ - - class LogPushnotification: Codable { - - - public var pushtokens: [String]? - - - public enum CodingKeys: String, CodingKey { - - case pushtokens = "pushtokens" - - } - - public init(pushtokens: [String]?) { - - self.pushtokens = pushtokens - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pushtokens = try container.decode([String].self, forKey: .pushtokens) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pushtokens, forKey: .pushtokens) - - - } - - } - - /* - Model: LogMeta - Used By: Communication - */ - - class LogMeta: Codable { - - - public var type: String? - - public var identifier: String? - - public var key: String? - - public var offset: String? - - public var partition: String? - - public var topic: String? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case identifier = "identifier" - - case key = "key" - - case offset = "offset" - - case partition = "partition" - - case topic = "topic" - - } - - public init(identifier: String?, key: String?, offset: String?, partition: String?, topic: String?, type: String?) { - - self.type = type - - self.identifier = identifier - - self.key = key - - self.offset = offset - - self.partition = partition - - self.topic = topic - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - identifier = try container.decode(String.self, forKey: .identifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - offset = try container.decode(String.self, forKey: .offset) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - partition = try container.decode(String.self, forKey: .partition) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - topic = try container.decode(String.self, forKey: .topic) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(identifier, forKey: .identifier) - - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(offset, forKey: .offset) - - - - try? container.encodeIfPresent(partition, forKey: .partition) - - - - try? container.encodeIfPresent(topic, forKey: .topic) - - - } - - } - - /* - Model: Log - Used By: Communication - */ - - class Log: Codable { - - - public var email: LogEmail? - - public var pushnotification: LogPushnotification? - - public var meta: LogMeta? - - public var id: String? - - public var application: String? - - public var service: String? - - public var step: String? - - public var status: String? - - public var data: [String: Any]? - - public var expireAt: String? - - public var createdAt: String? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case pushnotification = "pushnotification" - - case meta = "meta" - - case id = "_id" - - case application = "application" - - case service = "service" - - case step = "step" - - case status = "status" - - case data = "data" - - case expireAt = "expire_at" - - case createdAt = "created_at" - - } - - public init(application: String?, createdAt: String?, data: [String: Any]?, email: LogEmail?, expireAt: String?, meta: LogMeta?, pushnotification: LogPushnotification?, service: String?, status: String?, step: String?, id: String?) { - - self.email = email - - self.pushnotification = pushnotification - - self.meta = meta - - self.id = id - - self.application = application - - self.service = service - - self.step = step - - self.status = status - - self.data = data - - self.expireAt = expireAt - - self.createdAt = createdAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(LogEmail.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pushnotification = try container.decode(LogPushnotification.self, forKey: .pushnotification) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode(LogMeta.self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - service = try container.decode(String.self, forKey: .service) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - step = try container.decode(String.self, forKey: .step) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode([String: Any].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expireAt = try container.decode(String.self, forKey: .expireAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(pushnotification, forKey: .pushnotification) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(service, forKey: .service) - - - - try? container.encodeIfPresent(step, forKey: .step) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - - try? container.encodeIfPresent(expireAt, forKey: .expireAt) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - } - - } - - /* - Model: Logs - Used By: Communication - */ - - class Logs: Codable { - - - public var items: [Log]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [Log]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Log].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: PushtokenReq - Used By: Communication - */ - - class PushtokenReq: Codable { - - - public var action: String? - - public var bundleIdentifier: String? - - public var pushToken: String? - - public var uniqueDeviceId: String? - - - public enum CodingKeys: String, CodingKey { - - case action = "action" - - case bundleIdentifier = "bundle_identifier" - - case pushToken = "push_token" - - case uniqueDeviceId = "unique_device_id" - - } - - public init(action: String?, bundleIdentifier: String?, pushToken: String?, uniqueDeviceId: String?) { - - self.action = action - - self.bundleIdentifier = bundleIdentifier - - self.pushToken = pushToken - - self.uniqueDeviceId = uniqueDeviceId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - action = try container.decode(String.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bundleIdentifier = try container.decode(String.self, forKey: .bundleIdentifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pushToken = try container.decode(String.self, forKey: .pushToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uniqueDeviceId = try container.decode(String.self, forKey: .uniqueDeviceId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(bundleIdentifier, forKey: .bundleIdentifier) - - - - try? container.encodeIfPresent(pushToken, forKey: .pushToken) - - - - try? container.encodeIfPresent(uniqueDeviceId, forKey: .uniqueDeviceId) - - - } - - } - - /* - Model: PushtokenRes - Used By: Communication - */ - - class PushtokenRes: Codable { - - - public var id: String? - - public var bundleIdentifier: String? - - public var pushToken: String? - - public var uniqueDeviceId: String? - - public var type: String? - - public var platform: String? - - public var applicationId: String? - - public var userId: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var expiredAt: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case bundleIdentifier = "bundle_identifier" - - case pushToken = "push_token" - - case uniqueDeviceId = "unique_device_id" - - case type = "type" - - case platform = "platform" - - case applicationId = "application_id" - - case userId = "user_id" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case expiredAt = "expired_at" - - } - - public init(applicationId: String?, bundleIdentifier: String?, createdAt: String?, expiredAt: String?, platform: String?, pushToken: String?, type: String?, uniqueDeviceId: String?, updatedAt: String?, userId: String?, id: String?) { - - self.id = id - - self.bundleIdentifier = bundleIdentifier - - self.pushToken = pushToken - - self.uniqueDeviceId = uniqueDeviceId - - self.type = type - - self.platform = platform - - self.applicationId = applicationId - - self.userId = userId - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.expiredAt = expiredAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bundleIdentifier = try container.decode(String.self, forKey: .bundleIdentifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pushToken = try container.decode(String.self, forKey: .pushToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uniqueDeviceId = try container.decode(String.self, forKey: .uniqueDeviceId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platform = try container.decode(String.self, forKey: .platform) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - applicationId = try container.decode(String.self, forKey: .applicationId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expiredAt = try container.decode(String.self, forKey: .expiredAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(bundleIdentifier, forKey: .bundleIdentifier) - - - - try? container.encodeIfPresent(pushToken, forKey: .pushToken) - - - - try? container.encodeIfPresent(uniqueDeviceId, forKey: .uniqueDeviceId) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - - try? container.encodeIfPresent(applicationId, forKey: .applicationId) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(expiredAt, forKey: .expiredAt) - - - } - - } - - /* - Model: SmsProviderReq - Used By: Communication - */ - - class SmsProviderReq: Codable { - - - public var name: String? - - public var description: String? - - public var sender: String? - - public var username: String? - - public var authkey: String? - - public var type: String? - - public var provider: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case description = "description" - - case sender = "sender" - - case username = "username" - - case authkey = "authkey" - - case type = "type" - - case provider = "provider" - - } - - public init(authkey: String?, description: String?, name: String?, provider: String?, sender: String?, type: String?, username: String?) { - - self.name = name - - self.description = description - - self.sender = sender - - self.username = username - - self.authkey = authkey - - self.type = type - - self.provider = provider - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sender = try container.decode(String.self, forKey: .sender) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - username = try container.decode(String.self, forKey: .username) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - authkey = try container.decode(String.self, forKey: .authkey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - provider = try container.decode(String.self, forKey: .provider) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(sender, forKey: .sender) - - - - try? container.encodeIfPresent(username, forKey: .username) - - - - try? container.encodeIfPresent(authkey, forKey: .authkey) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(provider, forKey: .provider) - - - } - - } - - /* - Model: SmsProvider - Used By: Communication - */ - - class SmsProvider: Codable { - - - public var rpt: Int? - - public var type: String? - - public var provider: String? - - public var id: String? - - public var name: String? - - public var description: String? - - public var sender: String? - - public var username: String? - - public var authkey: String? - - public var application: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var slug: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case rpt = "rpt" - - case type = "type" - - case provider = "provider" - - case id = "_id" - - case name = "name" - - case description = "description" - - case sender = "sender" - - case username = "username" - - case authkey = "authkey" - - case application = "application" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case slug = "slug" - - case v = "__v" - - } - - public init(application: String?, authkey: String?, createdAt: String?, description: String?, name: String?, provider: String?, rpt: Int?, sender: String?, slug: String?, type: String?, updatedAt: String?, username: String?, id: String?, v: Int?) { - - self.rpt = rpt - - self.type = type - - self.provider = provider - - self.id = id - - self.name = name - - self.description = description - - self.sender = sender - - self.username = username - - self.authkey = authkey - - self.application = application - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.slug = slug - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - rpt = try container.decode(Int.self, forKey: .rpt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - provider = try container.decode(String.self, forKey: .provider) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sender = try container.decode(String.self, forKey: .sender) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - username = try container.decode(String.self, forKey: .username) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - authkey = try container.decode(String.self, forKey: .authkey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(rpt, forKey: .rpt) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(provider, forKey: .provider) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(sender, forKey: .sender) - - - - try? container.encodeIfPresent(username, forKey: .username) - - - - try? container.encodeIfPresent(authkey, forKey: .authkey) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: SmsProviders - Used By: Communication - */ - - class SmsProviders: Codable { - - - public var items: [SmsProvider]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [SmsProvider]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([SmsProvider].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: SmsTemplateDeleteSuccessRes - Used By: Communication - */ - - class SmsTemplateDeleteSuccessRes: Codable { - - - public var success: Bool? - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case message = "message" - - } - - public init(message: String?, success: Bool?) { - - self.success = success - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: SmsTemplateDeleteFailureRes - Used By: Communication - */ - - class SmsTemplateDeleteFailureRes: Codable { - - - public var success: Bool? - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case message = "message" - - } - - public init(message: String?, success: Bool?) { - - self.success = success - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: SmsTemplateMessage - Used By: Communication - */ - - class SmsTemplateMessage: Codable { - - - public var templateType: String? - - public var template: String? - - - public enum CodingKeys: String, CodingKey { - - case templateType = "template_type" - - case template = "template" - - } - - public init(template: String?, templateType: String?) { - - self.templateType = templateType - - self.template = template - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - templateType = try container.decode(String.self, forKey: .templateType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - template = try container.decode(String.self, forKey: .template) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(templateType, forKey: .templateType) - - - - try? container.encodeIfPresent(template, forKey: .template) - - - } - - } - - /* - Model: SmsTemplateReq - Used By: Communication - */ - - class SmsTemplateReq: Codable { - - - public var name: String? - - public var description: String? - - public var message: SmsTemplateMessage? - - public var templateVariables: [String: Any]? - - public var attachments: [[String: Any]]? - - public var priority: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case description = "description" - - case message = "message" - - case templateVariables = "template_variables" - - case attachments = "attachments" - - case priority = "priority" - - } - - public init(attachments: [[String: Any]]?, description: String?, message: SmsTemplateMessage?, name: String?, priority: String?, templateVariables: [String: Any]?) { - - self.name = name - - self.description = description - - self.message = message - - self.templateVariables = templateVariables - - self.attachments = attachments - - self.priority = priority - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(SmsTemplateMessage.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - templateVariables = try container.decode([String: Any].self, forKey: .templateVariables) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attachments = try container.decode([[String: Any]].self, forKey: .attachments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priority = try container.decode(String.self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(templateVariables, forKey: .templateVariables) - - - - try? container.encodeIfPresent(attachments, forKey: .attachments) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - } - - } - - /* - Model: SmsTemplateRes - Used By: Communication - */ - - class SmsTemplateRes: Codable { - - - public var isSystem: Bool? - - public var isInternal: Bool? - - public var description: String? - - public var tags: [[String: Any]]? - - public var priority: String? - - public var published: Bool? - - public var id: String? - - public var name: String? - - public var message: SmsTemplateMessage? - - public var templateVariables: [String: Any]? - - public var createdAt: String? - - public var updatedAt: String? - - public var slug: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case isSystem = "is_system" - - case isInternal = "is_internal" - - case description = "description" - - case tags = "tags" - - case priority = "priority" - - case published = "published" - - case id = "_id" - - case name = "name" - - case message = "message" - - case templateVariables = "template_variables" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case slug = "slug" - - case v = "__v" - - } - - public init(createdAt: String?, description: String?, isInternal: Bool?, isSystem: Bool?, message: SmsTemplateMessage?, name: String?, priority: String?, published: Bool?, slug: String?, tags: [[String: Any]]?, templateVariables: [String: Any]?, updatedAt: String?, id: String?, v: Int?) { - - self.isSystem = isSystem - - self.isInternal = isInternal - - self.description = description - - self.tags = tags - - self.priority = priority - - self.published = published - - self.id = id - - self.name = name - - self.message = message - - self.templateVariables = templateVariables - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.slug = slug - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isSystem = try container.decode(Bool.self, forKey: .isSystem) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isInternal = try container.decode(Bool.self, forKey: .isInternal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([[String: Any]].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priority = try container.decode(String.self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(SmsTemplateMessage.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - templateVariables = try container.decode([String: Any].self, forKey: .templateVariables) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isSystem, forKey: .isSystem) - - - - try? container.encodeIfPresent(isInternal, forKey: .isInternal) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(templateVariables, forKey: .templateVariables) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: SmsTemplate - Used By: Communication - */ - - class SmsTemplate: Codable { - - - public var isSystem: Bool? - - public var isInternal: Bool? - - public var description: String? - - public var priority: String? - - public var tags: [[String: Any]]? - - public var published: Bool? - - public var id: String? - - public var slug: String? - - public var name: String? - - public var message: SmsTemplateMessage? - - public var templateVariables: [String: Any]? - - public var createdAt: String? - - public var updatedAt: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case isSystem = "is_system" - - case isInternal = "is_internal" - - case description = "description" - - case priority = "priority" - - case tags = "tags" - - case published = "published" - - case id = "_id" - - case slug = "slug" - - case name = "name" - - case message = "message" - - case templateVariables = "template_variables" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case v = "__v" - - } - - public init(createdAt: String?, description: String?, isInternal: Bool?, isSystem: Bool?, message: SmsTemplateMessage?, name: String?, priority: String?, published: Bool?, slug: String?, tags: [[String: Any]]?, templateVariables: [String: Any]?, updatedAt: String?, id: String?, v: Int?) { - - self.isSystem = isSystem - - self.isInternal = isInternal - - self.description = description - - self.priority = priority - - self.tags = tags - - self.published = published - - self.id = id - - self.slug = slug - - self.name = name - - self.message = message - - self.templateVariables = templateVariables - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isSystem = try container.decode(Bool.self, forKey: .isSystem) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isInternal = try container.decode(Bool.self, forKey: .isInternal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priority = try container.decode(String.self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([[String: Any]].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(SmsTemplateMessage.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - templateVariables = try container.decode([String: Any].self, forKey: .templateVariables) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isSystem, forKey: .isSystem) - - - - try? container.encodeIfPresent(isInternal, forKey: .isInternal) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(templateVariables, forKey: .templateVariables) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: SystemSmsTemplate - Used By: Communication - */ - - class SystemSmsTemplate: Codable { - - - public var isSystem: Bool? - - public var isInternal: Bool? - - public var description: String? - - public var tags: [[String: Any]]? - - public var priority: String? - - public var published: Bool? - - public var id: String? - - public var slug: String? - - public var name: String? - - public var message: SmsTemplateMessage? - - public var templateVariables: [String: Any]? - - public var createdAt: String? - - public var updatedAt: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case isSystem = "is_system" - - case isInternal = "is_internal" - - case description = "description" - - case tags = "tags" - - case priority = "priority" - - case published = "published" - - case id = "_id" - - case slug = "slug" - - case name = "name" - - case message = "message" - - case templateVariables = "template_variables" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case v = "__v" - - } - - public init(createdAt: String?, description: String?, isInternal: Bool?, isSystem: Bool?, message: SmsTemplateMessage?, name: String?, priority: String?, published: Bool?, slug: String?, tags: [[String: Any]]?, templateVariables: [String: Any]?, updatedAt: String?, id: String?, v: Int?) { - - self.isSystem = isSystem - - self.isInternal = isInternal - - self.description = description - - self.tags = tags - - self.priority = priority - - self.published = published - - self.id = id - - self.slug = slug - - self.name = name - - self.message = message - - self.templateVariables = templateVariables - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isSystem = try container.decode(Bool.self, forKey: .isSystem) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isInternal = try container.decode(Bool.self, forKey: .isInternal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([[String: Any]].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priority = try container.decode(String.self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(SmsTemplateMessage.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - templateVariables = try container.decode([String: Any].self, forKey: .templateVariables) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isSystem, forKey: .isSystem) - - - - try? container.encodeIfPresent(isInternal, forKey: .isInternal) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(templateVariables, forKey: .templateVariables) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: SmsTemplates - Used By: Communication - */ - - class SmsTemplates: Codable { - - - public var items: [SmsTemplate]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [SmsTemplate]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([SmsTemplate].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: SystemSmsTemplates - Used By: Communication - */ - - class SystemSmsTemplates: Codable { - - - public var items: [SystemSmsTemplate]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [SystemSmsTemplate]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([SystemSmsTemplate].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: Notification - Used By: Communication - */ - - class Notification: Codable { - - - public var title: String? - - public var body: String? - - public var subtitle: String? - - public var icon: String? - - public var deeplink: String? - - public var clickAction: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case body = "body" - - case subtitle = "subtitle" - - case icon = "icon" - - case deeplink = "deeplink" - - case clickAction = "click_action" - - } - - public init(body: String?, clickAction: String?, deeplink: String?, icon: String?, subtitle: String?, title: String?) { - - self.title = title - - self.body = body - - self.subtitle = subtitle - - self.icon = icon - - self.deeplink = deeplink - - self.clickAction = clickAction - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - body = try container.decode(String.self, forKey: .body) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subtitle = try container.decode(String.self, forKey: .subtitle) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deeplink = try container.decode(String.self, forKey: .deeplink) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - clickAction = try container.decode(String.self, forKey: .clickAction) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(body, forKey: .body) - - - - try? container.encodeIfPresent(subtitle, forKey: .subtitle) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(deeplink, forKey: .deeplink) - - - - try? container.encodeIfPresent(clickAction, forKey: .clickAction) - - - } - - } - - /* - Model: SystemNotificationUser - Used By: Communication - */ - - class SystemNotificationUser: Codable { - - - public var type: String? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case value = "value" - - } - - public init(type: String?, value: String?) { - - self.type = type - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: SystemNotificationSettings - Used By: Communication - */ - - class SystemNotificationSettings: Codable { - - - public var sound: Bool? - - public var priority: String? - - public var timeToLive: String? - - - public enum CodingKeys: String, CodingKey { - - case sound = "sound" - - case priority = "priority" - - case timeToLive = "time_to_live" - - } - - public init(priority: String?, sound: Bool?, timeToLive: String?) { - - self.sound = sound - - self.priority = priority - - self.timeToLive = timeToLive - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - sound = try container.decode(Bool.self, forKey: .sound) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priority = try container.decode(String.self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - timeToLive = try container.decode(String.self, forKey: .timeToLive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(sound, forKey: .sound) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(timeToLive, forKey: .timeToLive) - - - } - - } - - /* - Model: SystemNotification - Used By: Communication - */ - - class SystemNotification: Codable { - - - public var notification: Notification? - - public var user: SystemNotificationUser? - - public var settings: SystemNotificationUser? - - public var id: String? - - public var group: String? - - public var createdAt: String? - - - public enum CodingKeys: String, CodingKey { - - case notification = "notification" - - case user = "user" - - case settings = "settings" - - case id = "_id" - - case group = "group" - - case createdAt = "created_at" - - } - - public init(createdAt: String?, group: String?, notification: Notification?, settings: SystemNotificationUser?, user: SystemNotificationUser?, id: String?) { - - self.notification = notification - - self.user = user - - self.settings = settings - - self.id = id - - self.group = group - - self.createdAt = createdAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - notification = try container.decode(Notification.self, forKey: .notification) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - user = try container.decode(SystemNotificationUser.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - settings = try container.decode(SystemNotificationUser.self, forKey: .settings) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - group = try container.decode(String.self, forKey: .group) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(notification, forKey: .notification) - - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(settings, forKey: .settings) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(group, forKey: .group) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - } - - } - - /* - Model: SystemNotificationsPage - Used By: Communication - */ - - class SystemNotificationsPage: Codable { - - - public var type: String? - - public var current: Int? - - public var size: Int? - - public var itemTotal: Int? - - public var hasNext: Bool? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case current = "current" - - case size = "size" - - case itemTotal = "item_total" - - case hasNext = "has_next" - - } - - public init(current: Int?, hasNext: Bool?, itemTotal: Int?, size: Int?, type: String?) { - - self.type = type - - self.current = current - - self.size = size - - self.itemTotal = itemTotal - - self.hasNext = hasNext - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - current = try container.decode(Int.self, forKey: .current) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - size = try container.decode(Int.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemTotal = try container.decode(Int.self, forKey: .itemTotal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasNext = try container.decode(Bool.self, forKey: .hasNext) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(current, forKey: .current) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) - - - - try? container.encodeIfPresent(hasNext, forKey: .hasNext) - - - } - - } - - /* - Model: SystemNotifications - Used By: Communication - */ - - class SystemNotifications: Codable { - - - public var items: [SystemNotification]? - - public var lastReadAnchor: Int? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case lastReadAnchor = "last_read_anchor" - - case page = "page" - - } - - public init(items: [SystemNotification]?, lastReadAnchor: Int?, page: Page?) { - - self.items = items - - self.lastReadAnchor = lastReadAnchor - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([SystemNotification].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastReadAnchor = try container.decode(Int.self, forKey: .lastReadAnchor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(lastReadAnchor, forKey: .lastReadAnchor) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - - - /* - Model: PaymentGatewayConfigResponse - Used By: Payment - */ - - class PaymentGatewayConfigResponse: Codable { - - - public var success: Bool - - public var created: Bool - - public var appId: String - - public var displayFields: [String] - - public var excludedFields: [String] - - public var aggregators: [[String: Any]]? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case created = "created" - - case appId = "app_id" - - case displayFields = "display_fields" - - case excludedFields = "excluded_fields" - - case aggregators = "aggregators" - - } - - public init(aggregators: [[String: Any]]?, appId: String, created: Bool, displayFields: [String], excludedFields: [String], success: Bool) { - - self.success = success - - self.created = created - - self.appId = appId - - self.displayFields = displayFields - - self.excludedFields = excludedFields - - self.aggregators = aggregators - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - created = try container.decode(Bool.self, forKey: .created) - - - - - appId = try container.decode(String.self, forKey: .appId) - - - - - displayFields = try container.decode([String].self, forKey: .displayFields) - - - - - excludedFields = try container.decode([String].self, forKey: .excludedFields) - - - - - do { - aggregators = try container.decode([[String: Any]].self, forKey: .aggregators) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(created, forKey: .created) - - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(displayFields, forKey: .displayFields) - - - - try? container.encodeIfPresent(excludedFields, forKey: .excludedFields) - - - - try? container.encodeIfPresent(aggregators, forKey: .aggregators) - - - } - - } - - /* - Model: ErrorCodeDescription - Used By: Payment - */ - - class ErrorCodeDescription: Codable { - - - public var success: Bool - - public var description: String - - public var code: String - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case description = "description" - - case code = "code" - - } - - public init(code: String, description: String, success: Bool) { - - self.success = success - - self.description = description - - self.code = code - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - description = try container.decode(String.self, forKey: .description) - - - - - code = try container.decode(String.self, forKey: .code) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - } - - } - - /* - Model: PaymentGatewayConfig - Used By: Payment - */ - - class PaymentGatewayConfig: Codable { - - - public var key: String - - public var configType: String - - public var secret: String - - public var isActive: Bool? - - public var merchantSalt: String - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case configType = "config_type" - - case secret = "secret" - - case isActive = "is_active" - - case merchantSalt = "merchant_salt" - - } - - public init(configType: String, isActive: Bool?, key: String, merchantSalt: String, secret: String) { - - self.key = key - - self.configType = configType - - self.secret = secret - - self.isActive = isActive - - self.merchantSalt = merchantSalt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - key = try container.decode(String.self, forKey: .key) - - - - - configType = try container.decode(String.self, forKey: .configType) - - - - - secret = try container.decode(String.self, forKey: .secret) - - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - merchantSalt = try container.decode(String.self, forKey: .merchantSalt) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(configType, forKey: .configType) - - - - try? container.encodeIfPresent(secret, forKey: .secret) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(merchantSalt, forKey: .merchantSalt) - - - } - - } - - /* - Model: PaymentGatewayConfigRequest - Used By: Payment - */ - - class PaymentGatewayConfigRequest: Codable { - - - public var isActive: Bool? - - public var appId: String - - public var aggregatorName: PaymentGatewayConfig? - - - public enum CodingKeys: String, CodingKey { - - case isActive = "is_active" - - case appId = "app_id" - - case aggregatorName = "aggregator_name" - - } - - public init(aggregatorName: PaymentGatewayConfig?, appId: String, isActive: Bool?) { - - self.isActive = isActive - - self.appId = appId - - self.aggregatorName = aggregatorName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - appId = try container.decode(String.self, forKey: .appId) - - - - - do { - aggregatorName = try container.decode(PaymentGatewayConfig.self, forKey: .aggregatorName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(aggregatorName, forKey: .aggregatorName) - - - } - - } - - /* - Model: PaymentGatewayToBeReviewed - Used By: Payment - */ - - class PaymentGatewayToBeReviewed: Codable { - - - public var success: Bool - - public var aggregator: [String] - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case aggregator = "aggregator" - - } - - public init(aggregator: [String], success: Bool) { - - self.success = success - - self.aggregator = aggregator - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - aggregator = try container.decode([String].self, forKey: .aggregator) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(aggregator, forKey: .aggregator) - - - } - - } - - /* - Model: ErrorCodeAndDescription - Used By: Payment - */ - - class ErrorCodeAndDescription: Codable { - - - public var description: String - - public var code: String - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case code = "code" - - } - - public init(code: String, description: String) { - - self.description = description - - self.code = code - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - description = try container.decode(String.self, forKey: .description) - - - - - code = try container.decode(String.self, forKey: .code) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - } - - } - - /* - Model: HttpErrorCodeAndResponse - Used By: Payment - */ - - class HttpErrorCodeAndResponse: Codable { - - - public var success: Bool - - public var error: ErrorCodeAndDescription - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case error = "error" - - } - - public init(error: ErrorCodeAndDescription, success: Bool) { - - self.success = success - - self.error = error - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - error = try container.decode(ErrorCodeAndDescription.self, forKey: .error) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(error, forKey: .error) - - - } - - } - - /* - Model: PaymentModeLogo - Used By: Payment - */ - - class PaymentModeLogo: Codable { - - - public var large: String - - public var small: String - - - public enum CodingKeys: String, CodingKey { - - case large = "large" - - case small = "small" - - } - - public init(large: String, small: String) { - - self.large = large - - self.small = small - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - large = try container.decode(String.self, forKey: .large) - - - - - small = try container.decode(String.self, forKey: .small) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(large, forKey: .large) - - - - try? container.encodeIfPresent(small, forKey: .small) - - - } - - } - - /* - Model: PaymentModeList - Used By: Payment - */ - - class PaymentModeList: Codable { - - - public var logoUrl: PaymentModeLogo? - - public var aggregatorName: String - - public var cardToken: String? - - public var code: String? - - public var name: String? - - public var expired: Bool? - - public var nickname: String? - - public var fyndVpa: String? - - public var displayPriority: Int? - - public var cardBrand: String? - - public var cardBrandImage: String? - - public var intentAppErrorList: [String]? - - public var cardIssuer: String? - - public var timeout: Int? - - public var cardType: String? - - public var merchantCode: String? - - public var retryCount: Int? - - public var cardFingerprint: String? - - public var cardName: String? - - public var cardId: String? - - public var intentFlow: String? - - public var displayName: String? - - public var expYear: Int? - - public var cardReference: String? - - public var cardNumber: String? - - public var cardIsin: String? - - public var expMonth: Int? - - - public enum CodingKeys: String, CodingKey { - - case logoUrl = "logo_url" - - case aggregatorName = "aggregator_name" - - case cardToken = "card_token" - - case code = "code" - - case name = "name" - - case expired = "expired" - - case nickname = "nickname" - - case fyndVpa = "fynd_vpa" - - case displayPriority = "display_priority" - - case cardBrand = "card_brand" - - case cardBrandImage = "card_brand_image" - - case intentAppErrorList = "intent_app_error_list" - - case cardIssuer = "card_issuer" - - case timeout = "timeout" - - case cardType = "card_type" - - case merchantCode = "merchant_code" - - case retryCount = "retry_count" - - case cardFingerprint = "card_fingerprint" - - case cardName = "card_name" - - case cardId = "card_id" - - case intentFlow = "intent_flow" - - case displayName = "display_name" - - case expYear = "exp_year" - - case cardReference = "card_reference" - - case cardNumber = "card_number" - - case cardIsin = "card_isin" - - case expMonth = "exp_month" - - } - - public init(aggregatorName: String, cardBrand: String?, cardBrandImage: String?, cardFingerprint: String?, cardId: String?, cardIsin: String?, cardIssuer: String?, cardName: String?, cardNumber: String?, cardReference: String?, cardToken: String?, cardType: String?, code: String?, displayName: String?, displayPriority: Int?, expired: Bool?, expMonth: Int?, expYear: Int?, fyndVpa: String?, intentAppErrorList: [String]?, intentFlow: String?, logoUrl: PaymentModeLogo?, merchantCode: String?, name: String?, nickname: String?, retryCount: Int?, timeout: Int?) { - - self.logoUrl = logoUrl - - self.aggregatorName = aggregatorName - - self.cardToken = cardToken - - self.code = code - - self.name = name - - self.expired = expired - - self.nickname = nickname - - self.fyndVpa = fyndVpa - - self.displayPriority = displayPriority - - self.cardBrand = cardBrand - - self.cardBrandImage = cardBrandImage - - self.intentAppErrorList = intentAppErrorList - - self.cardIssuer = cardIssuer - - self.timeout = timeout - - self.cardType = cardType - - self.merchantCode = merchantCode - - self.retryCount = retryCount - - self.cardFingerprint = cardFingerprint - - self.cardName = cardName - - self.cardId = cardId - - self.intentFlow = intentFlow - - self.displayName = displayName - - self.expYear = expYear - - self.cardReference = cardReference - - self.cardNumber = cardNumber - - self.cardIsin = cardIsin - - self.expMonth = expMonth - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - logoUrl = try container.decode(PaymentModeLogo.self, forKey: .logoUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - aggregatorName = try container.decode(String.self, forKey: .aggregatorName) - - - - - do { - cardToken = try container.decode(String.self, forKey: .cardToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expired = try container.decode(Bool.self, forKey: .expired) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - nickname = try container.decode(String.self, forKey: .nickname) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fyndVpa = try container.decode(String.self, forKey: .fyndVpa) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayPriority = try container.decode(Int.self, forKey: .displayPriority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardBrand = try container.decode(String.self, forKey: .cardBrand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardBrandImage = try container.decode(String.self, forKey: .cardBrandImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - intentAppErrorList = try container.decode([String].self, forKey: .intentAppErrorList) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardIssuer = try container.decode(String.self, forKey: .cardIssuer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - timeout = try container.decode(Int.self, forKey: .timeout) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardType = try container.decode(String.self, forKey: .cardType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - merchantCode = try container.decode(String.self, forKey: .merchantCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - retryCount = try container.decode(Int.self, forKey: .retryCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardFingerprint = try container.decode(String.self, forKey: .cardFingerprint) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardName = try container.decode(String.self, forKey: .cardName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardId = try container.decode(String.self, forKey: .cardId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - intentFlow = try container.decode(String.self, forKey: .intentFlow) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expYear = try container.decode(Int.self, forKey: .expYear) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardReference = try container.decode(String.self, forKey: .cardReference) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardNumber = try container.decode(String.self, forKey: .cardNumber) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cardIsin = try container.decode(String.self, forKey: .cardIsin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expMonth = try container.decode(Int.self, forKey: .expMonth) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(logoUrl, forKey: .logoUrl) - - - - try? container.encodeIfPresent(aggregatorName, forKey: .aggregatorName) - - - - try? container.encodeIfPresent(cardToken, forKey: .cardToken) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(expired, forKey: .expired) - - - - try? container.encodeIfPresent(nickname, forKey: .nickname) - - - - try? container.encodeIfPresent(fyndVpa, forKey: .fyndVpa) - - - - try? container.encodeIfPresent(displayPriority, forKey: .displayPriority) - - - - try? container.encodeIfPresent(cardBrand, forKey: .cardBrand) - - - - try? container.encodeIfPresent(cardBrandImage, forKey: .cardBrandImage) - - - - try? container.encodeIfPresent(intentAppErrorList, forKey: .intentAppErrorList) - - - - try? container.encodeIfPresent(cardIssuer, forKey: .cardIssuer) - - - - try? container.encodeIfPresent(timeout, forKey: .timeout) - - - - try? container.encodeIfPresent(cardType, forKey: .cardType) - - - - try? container.encodeIfPresent(merchantCode, forKey: .merchantCode) - - - - try? container.encodeIfPresent(retryCount, forKey: .retryCount) - - - - try? container.encodeIfPresent(cardFingerprint, forKey: .cardFingerprint) - - - - try? container.encodeIfPresent(cardName, forKey: .cardName) - - - - try? container.encodeIfPresent(cardId, forKey: .cardId) - - - - try? container.encodeIfPresent(intentFlow, forKey: .intentFlow) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(expYear, forKey: .expYear) - - - - try? container.encodeIfPresent(cardReference, forKey: .cardReference) - - - - try? container.encodeIfPresent(cardNumber, forKey: .cardNumber) - - - - try? container.encodeIfPresent(cardIsin, forKey: .cardIsin) - - - - try? container.encodeIfPresent(expMonth, forKey: .expMonth) - - - } - - } - - /* - Model: RootPaymentMode - Used By: Payment - */ - - class RootPaymentMode: Codable { - - - public var anonymousEnable: Bool? - - public var addCardEnabled: Bool? - - public var aggregatorName: String? - - public var displayPriority: Int - - public var displayName: String - - public var name: String - - public var list: [PaymentModeList]? - - - public enum CodingKeys: String, CodingKey { - - case anonymousEnable = "anonymous_enable" - - case addCardEnabled = "add_card_enabled" - - case aggregatorName = "aggregator_name" - - case displayPriority = "display_priority" - - case displayName = "display_name" - - case name = "name" - - case list = "list" - - } - - public init(addCardEnabled: Bool?, aggregatorName: String?, anonymousEnable: Bool?, displayName: String, displayPriority: Int, list: [PaymentModeList]?, name: String) { - - self.anonymousEnable = anonymousEnable - - self.addCardEnabled = addCardEnabled - - self.aggregatorName = aggregatorName - - self.displayPriority = displayPriority - - self.displayName = displayName - - self.name = name - - self.list = list - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - anonymousEnable = try container.decode(Bool.self, forKey: .anonymousEnable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addCardEnabled = try container.decode(Bool.self, forKey: .addCardEnabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - aggregatorName = try container.decode(String.self, forKey: .aggregatorName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - displayPriority = try container.decode(Int.self, forKey: .displayPriority) - - - - - displayName = try container.decode(String.self, forKey: .displayName) - - - - - name = try container.decode(String.self, forKey: .name) - - - - - do { - list = try container.decode([PaymentModeList].self, forKey: .list) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(anonymousEnable, forKey: .anonymousEnable) - - - - try? container.encodeIfPresent(addCardEnabled, forKey: .addCardEnabled) - - - - try? container.encodeIfPresent(aggregatorName, forKey: .aggregatorName) - - - - try? container.encodeIfPresent(displayPriority, forKey: .displayPriority) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(list, forKey: .list) - - - } - - } - - /* - Model: PaymentOptions - Used By: Payment - */ - - class PaymentOptions: Codable { - - - public var paymentOption: [RootPaymentMode] - - - public enum CodingKeys: String, CodingKey { - - case paymentOption = "payment_option" - - } - - public init(paymentOption: [RootPaymentMode]) { - - self.paymentOption = paymentOption - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - paymentOption = try container.decode([RootPaymentMode].self, forKey: .paymentOption) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(paymentOption, forKey: .paymentOption) - - - } - - } - - /* - Model: PaymentOptionsResponse - Used By: Payment - */ - - class PaymentOptionsResponse: Codable { - - - public var success: Bool - - public var paymentOptions: PaymentOptions - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case paymentOptions = "payment_options" - - } - - public init(paymentOptions: PaymentOptions, success: Bool) { - - self.success = success - - self.paymentOptions = paymentOptions - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - paymentOptions = try container.decode(PaymentOptions.self, forKey: .paymentOptions) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(paymentOptions, forKey: .paymentOptions) - - - } - - } - - /* - Model: PayoutsResponse - Used By: Payment - */ - - class PayoutsResponse: Codable { - - - public var moreAttributes: [String: Any] - - public var isDefault: Bool - - public var transferType: String - - public var uniqueTransferNo: [String: Any] - - public var isActive: Bool - - public var customers: [String: Any] - - public var payoutsAggregators: [[String: Any]] - - - public enum CodingKeys: String, CodingKey { - - case moreAttributes = "more_attributes" - - case isDefault = "is_default" - - case transferType = "transfer_type" - - case uniqueTransferNo = "unique_transfer_no" - - case isActive = "is_active" - - case customers = "customers" - - case payoutsAggregators = "payouts_aggregators" - - } - - public init(customers: [String: Any], isActive: Bool, isDefault: Bool, moreAttributes: [String: Any], payoutsAggregators: [[String: Any]], transferType: String, uniqueTransferNo: [String: Any]) { - - self.moreAttributes = moreAttributes - - self.isDefault = isDefault - - self.transferType = transferType - - self.uniqueTransferNo = uniqueTransferNo - - self.isActive = isActive - - self.customers = customers - - self.payoutsAggregators = payoutsAggregators - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - moreAttributes = try container.decode([String: Any].self, forKey: .moreAttributes) - - - - - isDefault = try container.decode(Bool.self, forKey: .isDefault) - - - - - transferType = try container.decode(String.self, forKey: .transferType) - - - - - uniqueTransferNo = try container.decode([String: Any].self, forKey: .uniqueTransferNo) - - - - - isActive = try container.decode(Bool.self, forKey: .isActive) - - - - - customers = try container.decode([String: Any].self, forKey: .customers) - - - - - payoutsAggregators = try container.decode([[String: Any]].self, forKey: .payoutsAggregators) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(moreAttributes, forKey: .moreAttributes) - - - - try? container.encodeIfPresent(isDefault, forKey: .isDefault) - - - - try? container.encodeIfPresent(transferType, forKey: .transferType) - - - - try? container.encodeIfPresent(uniqueTransferNo, forKey: .uniqueTransferNo) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(customers, forKey: .customers) - - - - try? container.encodeIfPresent(payoutsAggregators, forKey: .payoutsAggregators) - - - } - - } - - /* - Model: PayoutBankDetails - Used By: Payment - */ - - class PayoutBankDetails: Codable { - - - public var ifscCode: String - - public var country: String? - - public var bankName: String? - - public var branchName: String? - - public var accountType: String - - public var state: String? - - public var pincode: Int? - - public var city: String? - - public var accountHolder: String? - - public var accountNo: String? - - - public enum CodingKeys: String, CodingKey { - - case ifscCode = "ifsc_code" - - case country = "country" - - case bankName = "bank_name" - - case branchName = "branch_name" - - case accountType = "account_type" - - case state = "state" - - case pincode = "pincode" - - case city = "city" - - case accountHolder = "account_holder" - - case accountNo = "account_no" - - } - - public init(accountHolder: String?, accountNo: String?, accountType: String, bankName: String?, branchName: String?, city: String?, country: String?, ifscCode: String, pincode: Int?, state: String?) { - - self.ifscCode = ifscCode - - self.country = country - - self.bankName = bankName - - self.branchName = branchName - - self.accountType = accountType - - self.state = state - - self.pincode = pincode - - self.city = city - - self.accountHolder = accountHolder - - self.accountNo = accountNo - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - ifscCode = try container.decode(String.self, forKey: .ifscCode) - - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bankName = try container.decode(String.self, forKey: .bankName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - branchName = try container.decode(String.self, forKey: .branchName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - accountType = try container.decode(String.self, forKey: .accountType) - - - - - do { - state = try container.decode(String.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(Int.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - accountHolder = try container.decode(String.self, forKey: .accountHolder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - accountNo = try container.decode(String.self, forKey: .accountNo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(ifscCode, forKey: .ifscCode) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(bankName, forKey: .bankName) - - - - try? container.encodeIfPresent(branchName, forKey: .branchName) - - - - try? container.encodeIfPresent(accountType, forKey: .accountType) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(accountHolder, forKey: .accountHolder) - - - - try? container.encodeIfPresent(accountNo, forKey: .accountNo) - - - } - - } - - /* - Model: PayoutRequest - Used By: Payment - */ - - class PayoutRequest: Codable { - - - public var bankDetails: PayoutBankDetails - - public var transferType: String - - public var users: [String: Any] - - public var isActive: Bool - - public var aggregator: String - - public var uniqueExternalId: String - - - public enum CodingKeys: String, CodingKey { - - case bankDetails = "bank_details" - - case transferType = "transfer_type" - - case users = "users" - - case isActive = "is_active" - - case aggregator = "aggregator" - - case uniqueExternalId = "unique_external_id" - - } - - public init(aggregator: String, bankDetails: PayoutBankDetails, isActive: Bool, transferType: String, uniqueExternalId: String, users: [String: Any]) { - - self.bankDetails = bankDetails - - self.transferType = transferType - - self.users = users - - self.isActive = isActive - - self.aggregator = aggregator - - self.uniqueExternalId = uniqueExternalId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - bankDetails = try container.decode(PayoutBankDetails.self, forKey: .bankDetails) - - - - - transferType = try container.decode(String.self, forKey: .transferType) - - - - - users = try container.decode([String: Any].self, forKey: .users) - - - - - isActive = try container.decode(Bool.self, forKey: .isActive) - - - - - aggregator = try container.decode(String.self, forKey: .aggregator) - - - - - uniqueExternalId = try container.decode(String.self, forKey: .uniqueExternalId) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(bankDetails, forKey: .bankDetails) - - - - try? container.encodeIfPresent(transferType, forKey: .transferType) - - - - try? container.encodeIfPresent(users, forKey: .users) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(aggregator, forKey: .aggregator) - - - - try? container.encodeIfPresent(uniqueExternalId, forKey: .uniqueExternalId) - - - } - - } - - /* - Model: PayoutResponse - Used By: Payment - */ - - class PayoutResponse: Codable { - - - public var success: Bool - - public var bankDetails: [String: Any] - - public var created: Bool - - public var transferType: String - - public var uniqueTransferNo: String - - public var users: [String: Any] - - public var isActive: Bool - - public var paymentStatus: String - - public var aggregator: String - - public var payouts: [String: Any] - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case bankDetails = "bank_details" - - case created = "created" - - case transferType = "transfer_type" - - case uniqueTransferNo = "unique_transfer_no" - - case users = "users" - - case isActive = "is_active" - - case paymentStatus = "payment_status" - - case aggregator = "aggregator" - - case payouts = "payouts" - - } - - public init(aggregator: String, bankDetails: [String: Any], created: Bool, isActive: Bool, paymentStatus: String, payouts: [String: Any], success: Bool, transferType: String, uniqueTransferNo: String, users: [String: Any]) { - - self.success = success - - self.bankDetails = bankDetails - - self.created = created - - self.transferType = transferType - - self.uniqueTransferNo = uniqueTransferNo - - self.users = users - - self.isActive = isActive - - self.paymentStatus = paymentStatus - - self.aggregator = aggregator - - self.payouts = payouts - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - bankDetails = try container.decode([String: Any].self, forKey: .bankDetails) - - - - - created = try container.decode(Bool.self, forKey: .created) - - - - - transferType = try container.decode(String.self, forKey: .transferType) - - - - - uniqueTransferNo = try container.decode(String.self, forKey: .uniqueTransferNo) - - - - - users = try container.decode([String: Any].self, forKey: .users) - - - - - isActive = try container.decode(Bool.self, forKey: .isActive) - - - - - paymentStatus = try container.decode(String.self, forKey: .paymentStatus) - - - - - aggregator = try container.decode(String.self, forKey: .aggregator) - - - - - payouts = try container.decode([String: Any].self, forKey: .payouts) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(bankDetails, forKey: .bankDetails) - - - - try? container.encodeIfPresent(created, forKey: .created) - - - - try? container.encodeIfPresent(transferType, forKey: .transferType) - - - - try? container.encodeIfPresent(uniqueTransferNo, forKey: .uniqueTransferNo) - - - - try? container.encodeIfPresent(users, forKey: .users) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(paymentStatus, forKey: .paymentStatus) - - - - try? container.encodeIfPresent(aggregator, forKey: .aggregator) - - - - try? container.encodeIfPresent(payouts, forKey: .payouts) - - - } - - } - - /* - Model: UpdatePayoutResponse - Used By: Payment - */ - - class UpdatePayoutResponse: Codable { - - - public var success: Bool - - public var isActive: Bool - - public var isDefault: Bool - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case isActive = "is_active" - - case isDefault = "is_default" - - } - - public init(isActive: Bool, isDefault: Bool, success: Bool) { - - self.success = success - - self.isActive = isActive - - self.isDefault = isDefault - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - isActive = try container.decode(Bool.self, forKey: .isActive) - - - - - isDefault = try container.decode(Bool.self, forKey: .isDefault) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(isDefault, forKey: .isDefault) - - - } - - } - - /* - Model: UpdatePayoutRequest - Used By: Payment - */ - - class UpdatePayoutRequest: Codable { - - - public var isActive: Bool - - public var isDefault: Bool - - public var uniqueExternalId: String - - - public enum CodingKeys: String, CodingKey { - - case isActive = "is_active" - - case isDefault = "is_default" - - case uniqueExternalId = "unique_external_id" - - } - - public init(isActive: Bool, isDefault: Bool, uniqueExternalId: String) { - - self.isActive = isActive - - self.isDefault = isDefault - - self.uniqueExternalId = uniqueExternalId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - isActive = try container.decode(Bool.self, forKey: .isActive) - - - - - isDefault = try container.decode(Bool.self, forKey: .isDefault) - - - - - uniqueExternalId = try container.decode(String.self, forKey: .uniqueExternalId) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(isDefault, forKey: .isDefault) - - - - try? container.encodeIfPresent(uniqueExternalId, forKey: .uniqueExternalId) - - - } - - } - - /* - Model: DeletePayoutResponse - Used By: Payment - */ - - class DeletePayoutResponse: Codable { - - - public var success: Bool - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - } - - public init(success: Bool) { - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: SubscriptionPaymentMethodResponse - Used By: Payment - */ - - class SubscriptionPaymentMethodResponse: Codable { - - - public var success: Bool - - public var data: [[String: Any]] - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case data = "data" - - } - - public init(data: [[String: Any]], success: Bool) { - - self.success = success - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - data = try container.decode([[String: Any]].self, forKey: .data) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: DeleteSubscriptionPaymentMethodResponse - Used By: Payment - */ - - class DeleteSubscriptionPaymentMethodResponse: Codable { - - - public var success: Bool - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - } - - public init(success: Bool) { - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: SubscriptionConfigResponse - Used By: Payment - */ - - class SubscriptionConfigResponse: Codable { - - - public var success: Bool - - public var config: [String: Any] - - public var aggregator: String - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case config = "config" - - case aggregator = "aggregator" - - } - - public init(aggregator: String, config: [String: Any], success: Bool) { - - self.success = success - - self.config = config - - self.aggregator = aggregator - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - config = try container.decode([String: Any].self, forKey: .config) - - - - - aggregator = try container.decode(String.self, forKey: .aggregator) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(config, forKey: .config) - - - - try? container.encodeIfPresent(aggregator, forKey: .aggregator) - - - } - - } - - /* - Model: SaveSubscriptionSetupIntentRequest - Used By: Payment - */ - - class SaveSubscriptionSetupIntentRequest: Codable { - - - public var uniqueExternalId: String - - - public enum CodingKeys: String, CodingKey { - - case uniqueExternalId = "unique_external_id" - - } - - public init(uniqueExternalId: String) { - - self.uniqueExternalId = uniqueExternalId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - uniqueExternalId = try container.decode(String.self, forKey: .uniqueExternalId) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uniqueExternalId, forKey: .uniqueExternalId) - - - } - - } - - /* - Model: SaveSubscriptionSetupIntentResponse - Used By: Payment - */ - - class SaveSubscriptionSetupIntentResponse: Codable { - - - public var success: Bool - - public var data: [String: Any] - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case data = "data" - - } - - public init(data: [String: Any], success: Bool) { - - self.success = success - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - data = try container.decode([String: Any].self, forKey: .data) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: BeneficiaryModeDetails - Used By: Payment - */ - - class BeneficiaryModeDetails: Codable { - - - public var wallet: String? - - public var address: String? - - public var ifscCode: String - - public var bankName: String - - public var mobile: String - - public var branchName: String - - public var email: String - - public var vpa: String? - - public var accountHolder: String - - public var accountNo: String - - public var comment: String? - - - public enum CodingKeys: String, CodingKey { - - case wallet = "wallet" - - case address = "address" - - case ifscCode = "ifsc_code" - - case bankName = "bank_name" - - case mobile = "mobile" - - case branchName = "branch_name" - - case email = "email" - - case vpa = "vpa" - - case accountHolder = "account_holder" - - case accountNo = "account_no" - - case comment = "comment" - - } - - public init(accountHolder: String, accountNo: String, address: String?, bankName: String, branchName: String, comment: String?, email: String, ifscCode: String, mobile: String, vpa: String?, wallet: String?) { - - self.wallet = wallet - - self.address = address - - self.ifscCode = ifscCode - - self.bankName = bankName - - self.mobile = mobile - - self.branchName = branchName - - self.email = email - - self.vpa = vpa - - self.accountHolder = accountHolder - - self.accountNo = accountNo - - self.comment = comment - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - wallet = try container.decode(String.self, forKey: .wallet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address = try container.decode(String.self, forKey: .address) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - ifscCode = try container.decode(String.self, forKey: .ifscCode) - - - - - bankName = try container.decode(String.self, forKey: .bankName) - - - - - mobile = try container.decode(String.self, forKey: .mobile) - - - - - branchName = try container.decode(String.self, forKey: .branchName) - - - - - email = try container.decode(String.self, forKey: .email) - - - - - do { - vpa = try container.decode(String.self, forKey: .vpa) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - accountHolder = try container.decode(String.self, forKey: .accountHolder) - - - - - accountNo = try container.decode(String.self, forKey: .accountNo) - - - - - do { - comment = try container.decode(String.self, forKey: .comment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(wallet, forKey: .wallet) - - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(ifscCode, forKey: .ifscCode) - - - - try? container.encodeIfPresent(bankName, forKey: .bankName) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(branchName, forKey: .branchName) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(vpa, forKey: .vpa) - - - - try? container.encodeIfPresent(accountHolder, forKey: .accountHolder) - - - - try? container.encodeIfPresent(accountNo, forKey: .accountNo) - - - - try? container.encodeIfPresent(comment, forKey: .comment) - - - } - - } - - /* - Model: AddBeneficiaryDetailsRequest - Used By: Payment - */ - - class AddBeneficiaryDetailsRequest: Codable { - - - public var shipmentId: String - - public var transferMode: String - - public var delights: Bool - - public var requestId: String? - - public var otp: String? - - public var orderId: String - - public var details: BeneficiaryModeDetails - - - public enum CodingKeys: String, CodingKey { - - case shipmentId = "shipment_id" - - case transferMode = "transfer_mode" - - case delights = "delights" - - case requestId = "request_id" - - case otp = "otp" - - case orderId = "order_id" - - case details = "details" - - } - - public init(delights: Bool, details: BeneficiaryModeDetails, orderId: String, otp: String?, requestId: String?, shipmentId: String, transferMode: String) { - - self.shipmentId = shipmentId - - self.transferMode = transferMode - - self.delights = delights - - self.requestId = requestId - - self.otp = otp - - self.orderId = orderId - - self.details = details - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - shipmentId = try container.decode(String.self, forKey: .shipmentId) - - - - - transferMode = try container.decode(String.self, forKey: .transferMode) - - - - - delights = try container.decode(Bool.self, forKey: .delights) - - - - - do { - requestId = try container.decode(String.self, forKey: .requestId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - otp = try container.decode(String.self, forKey: .otp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - orderId = try container.decode(String.self, forKey: .orderId) - - - - - details = try container.decode(BeneficiaryModeDetails.self, forKey: .details) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(shipmentId, forKey: .shipmentId) - - - - try? container.encodeIfPresent(transferMode, forKey: .transferMode) - - - - try? container.encodeIfPresent(delights, forKey: .delights) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(otp, forKey: .otp) - - - - try? container.encodeIfPresent(orderId, forKey: .orderId) - - - - try? container.encodeIfPresent(details, forKey: .details) - - - } - - } - - /* - Model: RefundAccountResponse - Used By: Payment - */ - - class RefundAccountResponse: Codable { - - - public var success: Bool - - public var data: [String: Any]? - - public var message: String - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case data = "data" - - case message = "message" - - } - - public init(data: [String: Any]?, message: String, success: Bool) { - - self.success = success - - self.data = data - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - do { - data = try container.decode([String: Any].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - message = try container.decode(String.self, forKey: .message) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: NotFoundResourceError - Used By: Payment - */ - - class NotFoundResourceError: Codable { - - - public var success: Bool - - public var description: String - - public var code: String - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case description = "description" - - case code = "code" - - } - - public init(code: String, description: String, success: Bool) { - - self.success = success - - self.description = description - - self.code = code - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - description = try container.decode(String.self, forKey: .description) - - - - - code = try container.decode(String.self, forKey: .code) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - } - - } - - /* - Model: IfscCodeResponse - Used By: Payment - */ - - class IfscCodeResponse: Codable { - - - public var success: Bool? - - public var bankName: String - - public var branchName: String - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case bankName = "bank_name" - - case branchName = "branch_name" - - } - - public init(bankName: String, branchName: String, success: Bool?) { - - self.success = success - - self.bankName = bankName - - self.branchName = branchName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - bankName = try container.decode(String.self, forKey: .bankName) - - - - - branchName = try container.decode(String.self, forKey: .branchName) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(bankName, forKey: .bankName) - - - - try? container.encodeIfPresent(branchName, forKey: .branchName) - - - } - - } - - /* - Model: OrderBeneficiaryDetails - Used By: Payment - */ - - class OrderBeneficiaryDetails: Codable { - - - public var address: String - - public var modifiedOn: String - - public var bankName: String - - public var email: String - - public var isActive: Bool - - public var branchName: Bool? - - public var beneficiaryId: String - - public var createdOn: String - - public var transferMode: String - - public var accountHolder: String - - public var mobile: Bool? - - public var delightsUserName: String - - public var title: String - - public var accountNo: String - - public var id: Int - - public var displayName: String - - public var subtitle: String - - public var ifscCode: String - - public var comment: Bool? - - - public enum CodingKeys: String, CodingKey { - - case address = "address" - - case modifiedOn = "modified_on" - - case bankName = "bank_name" - - case email = "email" - - case isActive = "is_active" - - case branchName = "branch_name" - - case beneficiaryId = "beneficiary_id" - - case createdOn = "created_on" - - case transferMode = "transfer_mode" - - case accountHolder = "account_holder" - - case mobile = "mobile" - - case delightsUserName = "delights_user_name" - - case title = "title" - - case accountNo = "account_no" - - case id = "id" - - case displayName = "display_name" - - case subtitle = "subtitle" - - case ifscCode = "ifsc_code" - - case comment = "comment" - - } - - public init(accountHolder: String, accountNo: String, address: String, bankName: String, beneficiaryId: String, branchName: Bool?, comment: Bool?, createdOn: String, delightsUserName: String, displayName: String, email: String, id: Int, ifscCode: String, isActive: Bool, mobile: Bool?, modifiedOn: String, subtitle: String, title: String, transferMode: String) { - - self.address = address - - self.modifiedOn = modifiedOn - - self.bankName = bankName - - self.email = email - - self.isActive = isActive - - self.branchName = branchName - - self.beneficiaryId = beneficiaryId - - self.createdOn = createdOn - - self.transferMode = transferMode - - self.accountHolder = accountHolder - - self.mobile = mobile - - self.delightsUserName = delightsUserName - - self.title = title - - self.accountNo = accountNo - - self.id = id - - self.displayName = displayName - - self.subtitle = subtitle - - self.ifscCode = ifscCode - - self.comment = comment - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - address = try container.decode(String.self, forKey: .address) - - - - - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - - - - bankName = try container.decode(String.self, forKey: .bankName) - - - - - email = try container.decode(String.self, forKey: .email) - - - - - isActive = try container.decode(Bool.self, forKey: .isActive) - - - - - do { - branchName = try container.decode(Bool.self, forKey: .branchName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - beneficiaryId = try container.decode(String.self, forKey: .beneficiaryId) - - - - - createdOn = try container.decode(String.self, forKey: .createdOn) - - - - - transferMode = try container.decode(String.self, forKey: .transferMode) - - - - - accountHolder = try container.decode(String.self, forKey: .accountHolder) - - - - - do { - mobile = try container.decode(Bool.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - delightsUserName = try container.decode(String.self, forKey: .delightsUserName) - - - - - title = try container.decode(String.self, forKey: .title) - - - - - accountNo = try container.decode(String.self, forKey: .accountNo) - - - - - id = try container.decode(Int.self, forKey: .id) - - - - - displayName = try container.decode(String.self, forKey: .displayName) - - - - - subtitle = try container.decode(String.self, forKey: .subtitle) - - - - - ifscCode = try container.decode(String.self, forKey: .ifscCode) - - - - - do { - comment = try container.decode(Bool.self, forKey: .comment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(bankName, forKey: .bankName) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(branchName, forKey: .branchName) - - - - try? container.encodeIfPresent(beneficiaryId, forKey: .beneficiaryId) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(transferMode, forKey: .transferMode) - - - - try? container.encodeIfPresent(accountHolder, forKey: .accountHolder) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(delightsUserName, forKey: .delightsUserName) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(accountNo, forKey: .accountNo) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(subtitle, forKey: .subtitle) - - - - try? container.encodeIfPresent(ifscCode, forKey: .ifscCode) - - - - try? container.encodeIfPresent(comment, forKey: .comment) - - - } - - } - - /* - Model: OrderBeneficiaryResponse - Used By: Payment - */ - - class OrderBeneficiaryResponse: Codable { - - - public var showBeneficiaryDetails: Bool? - - public var beneficiaries: [OrderBeneficiaryDetails] - - - public enum CodingKeys: String, CodingKey { - - case showBeneficiaryDetails = "show_beneficiary_details" - - case beneficiaries = "beneficiaries" - - } - - public init(beneficiaries: [OrderBeneficiaryDetails], showBeneficiaryDetails: Bool?) { - - self.showBeneficiaryDetails = showBeneficiaryDetails - - self.beneficiaries = beneficiaries - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - showBeneficiaryDetails = try container.decode(Bool.self, forKey: .showBeneficiaryDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - beneficiaries = try container.decode([OrderBeneficiaryDetails].self, forKey: .beneficiaries) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(showBeneficiaryDetails, forKey: .showBeneficiaryDetails) - - - - try? container.encodeIfPresent(beneficiaries, forKey: .beneficiaries) - - - } - - } - - /* - Model: PaymentConfirmationMode - Used By: Payment - */ - - class PaymentConfirmationMode: Codable { - - - public var name: String? - - public var meta: [String: Any]? - - public var amount: Double - - public var mode: String - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case meta = "meta" - - case amount = "amount" - - case mode = "mode" - - } - - public init(amount: Double, meta: [String: Any]?, mode: String, name: String?) { - - self.name = name - - self.meta = meta - - self.amount = amount - - self.mode = mode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - amount = try container.decode(Double.self, forKey: .amount) - - - - - mode = try container.decode(String.self, forKey: .mode) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(mode, forKey: .mode) - - - } - - } - - /* - Model: PaymentConfirmationRequest - Used By: Payment - */ - - class PaymentConfirmationRequest: Codable { - - - public var paymentMethods: [PaymentConfirmationMode] - - public var orderId: String - - - public enum CodingKeys: String, CodingKey { - - case paymentMethods = "payment_methods" - - case orderId = "order_id" - - } - - public init(orderId: String, paymentMethods: [PaymentConfirmationMode]) { - - self.paymentMethods = paymentMethods - - self.orderId = orderId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - paymentMethods = try container.decode([PaymentConfirmationMode].self, forKey: .paymentMethods) - - - - - orderId = try container.decode(String.self, forKey: .orderId) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(paymentMethods, forKey: .paymentMethods) - - - - try? container.encodeIfPresent(orderId, forKey: .orderId) - - - } - - } - - /* - Model: PaymentConfirmationResponse - Used By: Payment - */ - - class PaymentConfirmationResponse: Codable { - - - public var success: Bool - - public var orderId: String - - public var message: String - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case orderId = "order_id" - - case message = "message" - - } - - public init(message: String, orderId: String, success: Bool) { - - self.success = success - - self.orderId = orderId - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - orderId = try container.decode(String.self, forKey: .orderId) - - - - - message = try container.decode(String.self, forKey: .message) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(orderId, forKey: .orderId) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - - - /* - Model: GetActivityStatus - Used By: Order - */ - - class GetActivityStatus: Codable { - - - public var activityHistory: ActivityHistory - - - public enum CodingKeys: String, CodingKey { - - case activityHistory = "activity_history" - - } - - public init(activityHistory: ActivityHistory) { - - self.activityHistory = activityHistory - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - activityHistory = try container.decode(ActivityHistory.self, forKey: .activityHistory) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(activityHistory, forKey: .activityHistory) - - - } - - } - - /* - Model: ActivityHistory - Used By: Order - */ - - class ActivityHistory: Codable { - - - public var createdat: String? - - public var message: String? - - public var type: String? - - public var user: String? - - - public enum CodingKeys: String, CodingKey { - - case createdat = "createdat" - - case message = "message" - - case type = "type" - - case user = "user" - - } - - public init(createdat: String?, message: String?, type: String?, user: String?) { - - self.createdat = createdat - - self.message = message - - self.type = type - - self.user = user - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdat = try container.decode(String.self, forKey: .createdat) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - user = try container.decode(String.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdat, forKey: .createdat) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(user, forKey: .user) - - - } - - } - - /* - Model: FailedOrders - Used By: Order - */ - - class FailedOrders: Codable { - - - public var orders: FailOrder - - - public enum CodingKeys: String, CodingKey { - - case orders = "orders" - - } - - public init(orders: FailOrder) { - - self.orders = orders - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - orders = try container.decode(FailOrder.self, forKey: .orders) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(orders, forKey: .orders) - - - } - - } - - /* - Model: FailOrder - Used By: Order - */ - - class FailOrder: Codable { - - - public var updatedAt: String? - - public var id: String? - - public var reason: String? - - public var marketplaceOrder: MarketplaceOrder? - - public var marketplaceOrderId: String? - - public var createdAt: String? - - public var appId: String? - - public var marketplace: String? - - public var companyId: Int? - - - public enum CodingKeys: String, CodingKey { - - case updatedAt = "updated_at" - - case id = "_id" - - case reason = "reason" - - case marketplaceOrder = "marketplace_order" - - case marketplaceOrderId = "marketplace_order_id" - - case createdAt = "created_at" - - case appId = "app_id" - - case marketplace = "marketplace" - - case companyId = "company_id" - - } - - public init(appId: String?, companyId: Int?, createdAt: String?, marketplace: String?, marketplaceOrder: MarketplaceOrder?, marketplaceOrderId: String?, reason: String?, updatedAt: String?, id: String?) { - - self.updatedAt = updatedAt - - self.id = id - - self.reason = reason - - self.marketplaceOrder = marketplaceOrder - - self.marketplaceOrderId = marketplaceOrderId - - self.createdAt = createdAt - - self.appId = appId - - self.marketplace = marketplace - - self.companyId = companyId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - reason = try container.decode(String.self, forKey: .reason) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - marketplaceOrder = try container.decode(MarketplaceOrder.self, forKey: .marketplaceOrder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - marketplaceOrderId = try container.decode(String.self, forKey: .marketplaceOrderId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - marketplace = try container.decode(String.self, forKey: .marketplace) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(reason, forKey: .reason) - - - - try? container.encodeIfPresent(marketplaceOrder, forKey: .marketplaceOrder) - - - - try? container.encodeIfPresent(marketplaceOrderId, forKey: .marketplaceOrderId) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(marketplace, forKey: .marketplace) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - } - - } - - /* - Model: MarketplaceOrder - Used By: Order - */ - - class MarketplaceOrder: Codable { - - - public var orderStatusUrl: String? - - public var adminGraphqlApiId: String? - - public var email: String? - - public var test: Bool? - - public var note: String? - - public var totalPrice: String? - - public var appId: Int? - - public var totalDiscountsSet: TotalDiscountsSet? - - public var totalPriceSet: TotalPriceSet? - - public var totalTaxSet: TotalTaxSet? - - public var gateway: String? - - public var name: String? - - public var subtotalPriceSet: SubtotalPriceSet? - - public var number: Int? - - public var buyerAcceptsMarketing: Bool? - - public var contactEmail: String? - - public var token: String? - - public var sourceName: String? - - public var paymentGatewayNames: [[String: Any]]? - - public var presentmentCurrency: String? - - public var subtotalPrice: String? - - public var processedAt: String? - - public var orderNumber: Int? - - public var totalTipReceived: String? - - public var id: Int? - - public var confirmed: Bool? - - public var currency: String? - - public var totalLineItemsPrice: String? - - public var lineItems: LineItems? - - public var createdAt: String? - - public var updatedAt: String? - - public var totalWeight: Int? - - public var billingAddress: BillingAddress? - - public var totalShippingPriceSet: TotalShippingPriceSet? - - public var customer: Customer? - - public var totalDiscounts: String? - - public var totalLineItemsPriceSet: TotalLineItemsPriceSet? - - public var tags: String? - - public var totalPriceUsd: String? - - public var userId: Int? - - public var totalTax: String? - - public var processingMethod: String? - - public var shippingAddress: OrderShippingAddress? - - public var taxesIncluded: Bool? - - public var financialStatus: String? - - - public enum CodingKeys: String, CodingKey { - - case orderStatusUrl = "order_status_url" - - case adminGraphqlApiId = "admin_graphql_api_id" - - case email = "email" - - case test = "test" - - case note = "note" - - case totalPrice = "total_price" - - case appId = "app_id" - - case totalDiscountsSet = "total_discounts_set" - - case totalPriceSet = "total_price_set" - - case totalTaxSet = "total_tax_set" - - case gateway = "gateway" - - case name = "name" - - case subtotalPriceSet = "subtotal_price_set" - - case number = "number" - - case buyerAcceptsMarketing = "buyer_accepts_marketing" - - case contactEmail = "contact_email" - - case token = "token" - - case sourceName = "source_name" - - case paymentGatewayNames = "payment_gateway_names" - - case presentmentCurrency = "presentment_currency" - - case subtotalPrice = "subtotal_price" - - case processedAt = "processed_at" - - case orderNumber = "order_number" - - case totalTipReceived = "total_tip_received" - - case id = "id" - - case confirmed = "confirmed" - - case currency = "currency" - - case totalLineItemsPrice = "total_line_items_price" - - case lineItems = "line_items" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case totalWeight = "total_weight" - - case billingAddress = "billing_address" - - case totalShippingPriceSet = "total_shipping_price_set" - - case customer = "customer" - - case totalDiscounts = "total_discounts" - - case totalLineItemsPriceSet = "total_line_items_price_set" - - case tags = "tags" - - case totalPriceUsd = "total_price_usd" - - case userId = "user_id" - - case totalTax = "total_tax" - - case processingMethod = "processing_method" - - case shippingAddress = "shipping_address" - - case taxesIncluded = "taxes_included" - - case financialStatus = "financial_status" - - } - - public init(adminGraphqlApiId: String?, appId: Int?, billingAddress: BillingAddress?, buyerAcceptsMarketing: Bool?, confirmed: Bool?, contactEmail: String?, createdAt: String?, currency: String?, customer: Customer?, email: String?, financialStatus: String?, gateway: String?, id: Int?, lineItems: LineItems?, name: String?, note: String?, number: Int?, orderNumber: Int?, orderStatusUrl: String?, paymentGatewayNames: [[String: Any]]?, presentmentCurrency: String?, processedAt: String?, processingMethod: String?, shippingAddress: OrderShippingAddress?, sourceName: String?, subtotalPrice: String?, subtotalPriceSet: SubtotalPriceSet?, tags: String?, taxesIncluded: Bool?, test: Bool?, token: String?, totalDiscounts: String?, totalDiscountsSet: TotalDiscountsSet?, totalLineItemsPrice: String?, totalLineItemsPriceSet: TotalLineItemsPriceSet?, totalPrice: String?, totalPriceSet: TotalPriceSet?, totalPriceUsd: String?, totalShippingPriceSet: TotalShippingPriceSet?, totalTax: String?, totalTaxSet: TotalTaxSet?, totalTipReceived: String?, totalWeight: Int?, updatedAt: String?, userId: Int?) { - - self.orderStatusUrl = orderStatusUrl - - self.adminGraphqlApiId = adminGraphqlApiId - - self.email = email - - self.test = test - - self.note = note - - self.totalPrice = totalPrice - - self.appId = appId - - self.totalDiscountsSet = totalDiscountsSet - - self.totalPriceSet = totalPriceSet - - self.totalTaxSet = totalTaxSet - - self.gateway = gateway - - self.name = name - - self.subtotalPriceSet = subtotalPriceSet - - self.number = number - - self.buyerAcceptsMarketing = buyerAcceptsMarketing - - self.contactEmail = contactEmail - - self.token = token - - self.sourceName = sourceName - - self.paymentGatewayNames = paymentGatewayNames - - self.presentmentCurrency = presentmentCurrency - - self.subtotalPrice = subtotalPrice - - self.processedAt = processedAt - - self.orderNumber = orderNumber - - self.totalTipReceived = totalTipReceived - - self.id = id - - self.confirmed = confirmed - - self.currency = currency - - self.totalLineItemsPrice = totalLineItemsPrice - - self.lineItems = lineItems - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.totalWeight = totalWeight - - self.billingAddress = billingAddress - - self.totalShippingPriceSet = totalShippingPriceSet - - self.customer = customer - - self.totalDiscounts = totalDiscounts - - self.totalLineItemsPriceSet = totalLineItemsPriceSet - - self.tags = tags - - self.totalPriceUsd = totalPriceUsd - - self.userId = userId - - self.totalTax = totalTax - - self.processingMethod = processingMethod - - self.shippingAddress = shippingAddress - - self.taxesIncluded = taxesIncluded - - self.financialStatus = financialStatus - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - orderStatusUrl = try container.decode(String.self, forKey: .orderStatusUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - adminGraphqlApiId = try container.decode(String.self, forKey: .adminGraphqlApiId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - test = try container.decode(Bool.self, forKey: .test) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - note = try container.decode(String.self, forKey: .note) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalPrice = try container.decode(String.self, forKey: .totalPrice) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appId = try container.decode(Int.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalDiscountsSet = try container.decode(TotalDiscountsSet.self, forKey: .totalDiscountsSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalPriceSet = try container.decode(TotalPriceSet.self, forKey: .totalPriceSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalTaxSet = try container.decode(TotalTaxSet.self, forKey: .totalTaxSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gateway = try container.decode(String.self, forKey: .gateway) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subtotalPriceSet = try container.decode(SubtotalPriceSet.self, forKey: .subtotalPriceSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - number = try container.decode(Int.self, forKey: .number) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - buyerAcceptsMarketing = try container.decode(Bool.self, forKey: .buyerAcceptsMarketing) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contactEmail = try container.decode(String.self, forKey: .contactEmail) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - token = try container.decode(String.self, forKey: .token) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sourceName = try container.decode(String.self, forKey: .sourceName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentGatewayNames = try container.decode([[String: Any]].self, forKey: .paymentGatewayNames) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - presentmentCurrency = try container.decode(String.self, forKey: .presentmentCurrency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subtotalPrice = try container.decode(String.self, forKey: .subtotalPrice) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - processedAt = try container.decode(String.self, forKey: .processedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderNumber = try container.decode(Int.self, forKey: .orderNumber) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalTipReceived = try container.decode(String.self, forKey: .totalTipReceived) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - confirmed = try container.decode(Bool.self, forKey: .confirmed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(String.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalLineItemsPrice = try container.decode(String.self, forKey: .totalLineItemsPrice) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lineItems = try container.decode(LineItems.self, forKey: .lineItems) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalWeight = try container.decode(Int.self, forKey: .totalWeight) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - billingAddress = try container.decode(BillingAddress.self, forKey: .billingAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalShippingPriceSet = try container.decode(TotalShippingPriceSet.self, forKey: .totalShippingPriceSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customer = try container.decode(Customer.self, forKey: .customer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalDiscounts = try container.decode(String.self, forKey: .totalDiscounts) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalLineItemsPriceSet = try container.decode(TotalLineItemsPriceSet.self, forKey: .totalLineItemsPriceSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode(String.self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalPriceUsd = try container.decode(String.self, forKey: .totalPriceUsd) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(Int.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalTax = try container.decode(String.self, forKey: .totalTax) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - processingMethod = try container.decode(String.self, forKey: .processingMethod) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shippingAddress = try container.decode(OrderShippingAddress.self, forKey: .shippingAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - taxesIncluded = try container.decode(Bool.self, forKey: .taxesIncluded) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - financialStatus = try container.decode(String.self, forKey: .financialStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(orderStatusUrl, forKey: .orderStatusUrl) - - - - try? container.encodeIfPresent(adminGraphqlApiId, forKey: .adminGraphqlApiId) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(test, forKey: .test) - - - - try? container.encodeIfPresent(note, forKey: .note) - - - - try? container.encodeIfPresent(totalPrice, forKey: .totalPrice) - - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(totalDiscountsSet, forKey: .totalDiscountsSet) - - - - try? container.encodeIfPresent(totalPriceSet, forKey: .totalPriceSet) - - - - try? container.encodeIfPresent(totalTaxSet, forKey: .totalTaxSet) - - - - try? container.encodeIfPresent(gateway, forKey: .gateway) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(subtotalPriceSet, forKey: .subtotalPriceSet) - - - - try? container.encodeIfPresent(number, forKey: .number) - - - - try? container.encodeIfPresent(buyerAcceptsMarketing, forKey: .buyerAcceptsMarketing) - - - - try? container.encodeIfPresent(contactEmail, forKey: .contactEmail) - - - - try? container.encodeIfPresent(token, forKey: .token) - - - - try? container.encodeIfPresent(sourceName, forKey: .sourceName) - - - - try? container.encodeIfPresent(paymentGatewayNames, forKey: .paymentGatewayNames) - - - - try? container.encodeIfPresent(presentmentCurrency, forKey: .presentmentCurrency) - - - - try? container.encodeIfPresent(subtotalPrice, forKey: .subtotalPrice) - - - - try? container.encodeIfPresent(processedAt, forKey: .processedAt) - - - - try? container.encodeIfPresent(orderNumber, forKey: .orderNumber) - - - - try? container.encodeIfPresent(totalTipReceived, forKey: .totalTipReceived) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(confirmed, forKey: .confirmed) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(totalLineItemsPrice, forKey: .totalLineItemsPrice) - - - - try? container.encodeIfPresent(lineItems, forKey: .lineItems) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(totalWeight, forKey: .totalWeight) - - - - try? container.encodeIfPresent(billingAddress, forKey: .billingAddress) - - - - try? container.encodeIfPresent(totalShippingPriceSet, forKey: .totalShippingPriceSet) - - - - try? container.encodeIfPresent(customer, forKey: .customer) - - - - try? container.encodeIfPresent(totalDiscounts, forKey: .totalDiscounts) - - - - try? container.encodeIfPresent(totalLineItemsPriceSet, forKey: .totalLineItemsPriceSet) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(totalPriceUsd, forKey: .totalPriceUsd) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - - try? container.encodeIfPresent(totalTax, forKey: .totalTax) - - - - try? container.encodeIfPresent(processingMethod, forKey: .processingMethod) - - - - try? container.encodeIfPresent(shippingAddress, forKey: .shippingAddress) - - - - try? container.encodeIfPresent(taxesIncluded, forKey: .taxesIncluded) - - - - try? container.encodeIfPresent(financialStatus, forKey: .financialStatus) - - - } - - } - - /* - Model: TotalDiscountsSet - Used By: Order - */ - - class TotalDiscountsSet: Codable { - - - public var presentmentMoney: PresentmentMoney? - - public var shopMoney: ShopMoney? - - - public enum CodingKeys: String, CodingKey { - - case presentmentMoney = "presentment_money" - - case shopMoney = "shop_money" - - } - - public init(presentmentMoney: PresentmentMoney?, shopMoney: ShopMoney?) { - - self.presentmentMoney = presentmentMoney - - self.shopMoney = shopMoney - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - presentmentMoney = try container.decode(PresentmentMoney.self, forKey: .presentmentMoney) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shopMoney = try container.decode(ShopMoney.self, forKey: .shopMoney) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(presentmentMoney, forKey: .presentmentMoney) - - - - try? container.encodeIfPresent(shopMoney, forKey: .shopMoney) - - - } - - } - - /* - Model: PresentmentMoney - Used By: Order - */ - - class PresentmentMoney: Codable { - - - public var amount: String? - - public var currencyCode: String? - - - public enum CodingKeys: String, CodingKey { - - case amount = "amount" - - case currencyCode = "currency_code" - - } - - public init(amount: String?, currencyCode: String?) { - - self.amount = amount - - self.currencyCode = currencyCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - amount = try container.decode(String.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - } - - } - - /* - Model: ShopMoney - Used By: Order - */ - - class ShopMoney: Codable { - - - public var amount: String? - - public var currencyCode: String? - - - public enum CodingKeys: String, CodingKey { - - case amount = "amount" - - case currencyCode = "currency_code" - - } - - public init(amount: String?, currencyCode: String?) { - - self.amount = amount - - self.currencyCode = currencyCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - amount = try container.decode(String.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - } - - } - - /* - Model: TotalPriceSet - Used By: Order - */ - - class TotalPriceSet: Codable { - - - public var shopMoney: TotalPriceSetShopMoney? - - public var presentmentMoney: TotalPriceSetPresentmentMoney? - - - public enum CodingKeys: String, CodingKey { - - case shopMoney = "shop_money" - - case presentmentMoney = "presentment_money" - - } - - public init(presentmentMoney: TotalPriceSetPresentmentMoney?, shopMoney: TotalPriceSetShopMoney?) { - - self.shopMoney = shopMoney - - self.presentmentMoney = presentmentMoney - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - shopMoney = try container.decode(TotalPriceSetShopMoney.self, forKey: .shopMoney) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - presentmentMoney = try container.decode(TotalPriceSetPresentmentMoney.self, forKey: .presentmentMoney) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(shopMoney, forKey: .shopMoney) - - - - try? container.encodeIfPresent(presentmentMoney, forKey: .presentmentMoney) - - - } - - } - - /* - Model: TotalPriceSetShopMoney - Used By: Order - */ - - class TotalPriceSetShopMoney: Codable { - - - public var amount: String? - - public var currencyCode: String? - - - public enum CodingKeys: String, CodingKey { - - case amount = "amount" - - case currencyCode = "currency_code" - - } - - public init(amount: String?, currencyCode: String?) { - - self.amount = amount - - self.currencyCode = currencyCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - amount = try container.decode(String.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - } - - } - - /* - Model: TotalPriceSetPresentmentMoney - Used By: Order - */ - - class TotalPriceSetPresentmentMoney: Codable { - - - public var amount: String? - - public var currencyCode: String? - - - public enum CodingKeys: String, CodingKey { - - case amount = "amount" - - case currencyCode = "currency_code" - - } - - public init(amount: String?, currencyCode: String?) { - - self.amount = amount - - self.currencyCode = currencyCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - amount = try container.decode(String.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - } - - } - - /* - Model: TotalTaxSet - Used By: Order - */ - - class TotalTaxSet: Codable { - - - public var shopMoney: TotalTaxSetShopMoney? - - public var presentmentMoney: TotalTaxSetPresentmentMoney? - - - public enum CodingKeys: String, CodingKey { - - case shopMoney = "shop_money" - - case presentmentMoney = "presentment_money" - - } - - public init(presentmentMoney: TotalTaxSetPresentmentMoney?, shopMoney: TotalTaxSetShopMoney?) { - - self.shopMoney = shopMoney - - self.presentmentMoney = presentmentMoney - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - shopMoney = try container.decode(TotalTaxSetShopMoney.self, forKey: .shopMoney) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - presentmentMoney = try container.decode(TotalTaxSetPresentmentMoney.self, forKey: .presentmentMoney) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(shopMoney, forKey: .shopMoney) - - - - try? container.encodeIfPresent(presentmentMoney, forKey: .presentmentMoney) - - - } - - } - - /* - Model: TotalTaxSetShopMoney - Used By: Order - */ - - class TotalTaxSetShopMoney: Codable { - - - public var amount: String? - - public var currencyCode: String? - - - public enum CodingKeys: String, CodingKey { - - case amount = "amount" - - case currencyCode = "currency_code" - - } - - public init(amount: String?, currencyCode: String?) { - - self.amount = amount - - self.currencyCode = currencyCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - amount = try container.decode(String.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - } - - } - - /* - Model: TotalTaxSetPresentmentMoney - Used By: Order - */ - - class TotalTaxSetPresentmentMoney: Codable { - - - public var amount: String? - - public var currencyCode: String? - - - public enum CodingKeys: String, CodingKey { - - case amount = "amount" - - case currencyCode = "currency_code" - - } - - public init(amount: String?, currencyCode: String?) { - - self.amount = amount - - self.currencyCode = currencyCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - amount = try container.decode(String.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - } - - } - - /* - Model: SubtotalPriceSet - Used By: Order - */ - - class SubtotalPriceSet: Codable { - - - public var shopMoney: SubtotalPriceSetShopMoney? - - public var presentmentMoney: SubtotalPriceSetPresentmentMoney? - - - public enum CodingKeys: String, CodingKey { - - case shopMoney = "shop_money" - - case presentmentMoney = "presentment_money" - - } - - public init(presentmentMoney: SubtotalPriceSetPresentmentMoney?, shopMoney: SubtotalPriceSetShopMoney?) { - - self.shopMoney = shopMoney - - self.presentmentMoney = presentmentMoney - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - shopMoney = try container.decode(SubtotalPriceSetShopMoney.self, forKey: .shopMoney) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - presentmentMoney = try container.decode(SubtotalPriceSetPresentmentMoney.self, forKey: .presentmentMoney) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(shopMoney, forKey: .shopMoney) - - - - try? container.encodeIfPresent(presentmentMoney, forKey: .presentmentMoney) - - - } - - } - - /* - Model: SubtotalPriceSetShopMoney - Used By: Order - */ - - class SubtotalPriceSetShopMoney: Codable { - - - public var amount: String? - - public var currencyCode: String? - - - public enum CodingKeys: String, CodingKey { - - case amount = "amount" - - case currencyCode = "currency_code" - - } - - public init(amount: String?, currencyCode: String?) { - - self.amount = amount - - self.currencyCode = currencyCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - amount = try container.decode(String.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - } - - } - - /* - Model: SubtotalPriceSetPresentmentMoney - Used By: Order - */ - - class SubtotalPriceSetPresentmentMoney: Codable { - - - public var amount: String? - - public var currencyCode: String? - - - public enum CodingKeys: String, CodingKey { - - case amount = "amount" - - case currencyCode = "currency_code" - - } - - public init(amount: String?, currencyCode: String?) { - - self.amount = amount - - self.currencyCode = currencyCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - amount = try container.decode(String.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - } - - } - - /* - Model: LineItems - Used By: Order - */ - - class LineItems: Codable { - - - public var sku: String? - - public var fulfillableQuantity: Int? - - public var grams: Int? - - public var totalDiscount: String? - - public var article: LineItemsArticle? - - public var title: String? - - public var variantInventoryManagement: String? - - public var id: Int? - - public var variantId: Int? - - public var variantTitle: String? - - public var productExists: Bool? - - public var price: String? - - public var adminGraphqlApiId: String? - - public var quantity: Int? - - public var vendor: String? - - public var fulfillmentService: String? - - public var taxable: Bool? - - public var name: String? - - public var productId: Int? - - public var priceSet: PriceSet? - - public var taxLines: TaxLines? - - public var requiresShipping: Bool? - - public var giftCard: Bool? - - public var totalDiscountSet: TotalDiscountSet? - - - public enum CodingKeys: String, CodingKey { - - case sku = "sku" - - case fulfillableQuantity = "fulfillable_quantity" - - case grams = "grams" - - case totalDiscount = "total_discount" - - case article = "article" - - case title = "title" - - case variantInventoryManagement = "variant_inventory_management" - - case id = "id" - - case variantId = "variant_id" - - case variantTitle = "variant_title" - - case productExists = "product_exists" - - case price = "price" - - case adminGraphqlApiId = "admin_graphql_api_id" - - case quantity = "quantity" - - case vendor = "vendor" - - case fulfillmentService = "fulfillment_service" - - case taxable = "taxable" - - case name = "name" - - case productId = "product_id" - - case priceSet = "price_set" - - case taxLines = "tax_lines" - - case requiresShipping = "requires_shipping" - - case giftCard = "gift_card" - - case totalDiscountSet = "total_discount_set" - - } - - public init(adminGraphqlApiId: String?, article: LineItemsArticle?, fulfillableQuantity: Int?, fulfillmentService: String?, giftCard: Bool?, grams: Int?, id: Int?, name: String?, price: String?, priceSet: PriceSet?, productExists: Bool?, productId: Int?, quantity: Int?, requiresShipping: Bool?, sku: String?, taxable: Bool?, taxLines: TaxLines?, title: String?, totalDiscount: String?, totalDiscountSet: TotalDiscountSet?, variantId: Int?, variantInventoryManagement: String?, variantTitle: String?, vendor: String?) { - - self.sku = sku - - self.fulfillableQuantity = fulfillableQuantity - - self.grams = grams - - self.totalDiscount = totalDiscount - - self.article = article - - self.title = title - - self.variantInventoryManagement = variantInventoryManagement - - self.id = id - - self.variantId = variantId - - self.variantTitle = variantTitle - - self.productExists = productExists - - self.price = price - - self.adminGraphqlApiId = adminGraphqlApiId - - self.quantity = quantity - - self.vendor = vendor - - self.fulfillmentService = fulfillmentService - - self.taxable = taxable - - self.name = name - - self.productId = productId - - self.priceSet = priceSet - - self.taxLines = taxLines - - self.requiresShipping = requiresShipping - - self.giftCard = giftCard - - self.totalDiscountSet = totalDiscountSet - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - sku = try container.decode(String.self, forKey: .sku) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fulfillableQuantity = try container.decode(Int.self, forKey: .fulfillableQuantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - grams = try container.decode(Int.self, forKey: .grams) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalDiscount = try container.decode(String.self, forKey: .totalDiscount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - article = try container.decode(LineItemsArticle.self, forKey: .article) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - variantInventoryManagement = try container.decode(String.self, forKey: .variantInventoryManagement) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - variantId = try container.decode(Int.self, forKey: .variantId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - variantTitle = try container.decode(String.self, forKey: .variantTitle) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productExists = try container.decode(Bool.self, forKey: .productExists) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(String.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - adminGraphqlApiId = try container.decode(String.self, forKey: .adminGraphqlApiId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - vendor = try container.decode(String.self, forKey: .vendor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fulfillmentService = try container.decode(String.self, forKey: .fulfillmentService) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - taxable = try container.decode(Bool.self, forKey: .taxable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productId = try container.decode(Int.self, forKey: .productId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priceSet = try container.decode(PriceSet.self, forKey: .priceSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - taxLines = try container.decode(TaxLines.self, forKey: .taxLines) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requiresShipping = try container.decode(Bool.self, forKey: .requiresShipping) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - giftCard = try container.decode(Bool.self, forKey: .giftCard) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalDiscountSet = try container.decode(TotalDiscountSet.self, forKey: .totalDiscountSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(sku, forKey: .sku) - - - - try? container.encodeIfPresent(fulfillableQuantity, forKey: .fulfillableQuantity) - - - - try? container.encodeIfPresent(grams, forKey: .grams) - - - - try? container.encodeIfPresent(totalDiscount, forKey: .totalDiscount) - - - - try? container.encodeIfPresent(article, forKey: .article) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(variantInventoryManagement, forKey: .variantInventoryManagement) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(variantId, forKey: .variantId) - - - - try? container.encodeIfPresent(variantTitle, forKey: .variantTitle) - - - - try? container.encodeIfPresent(productExists, forKey: .productExists) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(adminGraphqlApiId, forKey: .adminGraphqlApiId) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - - try? container.encodeIfPresent(vendor, forKey: .vendor) - - - - try? container.encodeIfPresent(fulfillmentService, forKey: .fulfillmentService) - - - - try? container.encodeIfPresent(taxable, forKey: .taxable) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(productId, forKey: .productId) - - - - try? container.encodeIfPresent(priceSet, forKey: .priceSet) - - - - try? container.encodeIfPresent(taxLines, forKey: .taxLines) - - - - try? container.encodeIfPresent(requiresShipping, forKey: .requiresShipping) - - - - try? container.encodeIfPresent(giftCard, forKey: .giftCard) - - - - try? container.encodeIfPresent(totalDiscountSet, forKey: .totalDiscountSet) - - - } - - } - - /* - Model: LineItemsArticle - Used By: Order - */ - - class LineItemsArticle: Codable { - - - public var quantities: Quantities? - - public var oldArticleUid: String? - - public var totalQuantity: Int? - - public var manufacturer: Manufacturer? - - public var price: ArticlePrice? - - public var trackInventory: Bool? - - public var company: Company? - - public var isActive: Bool? - - public var dateMeta: FailOrderDateMeta? - - public var fragile: Bool? - - public var marketplaceIdentifiers: MarketplaceIdentifiers? - - public var size: String? - - public var isSet: Bool? - - public var dimension: Dimension? - - public var weight: Weight? - - public var store: Store? - - public var meta: ArticleMeta? - - public var uid: String? - - public var brand: ArticleBrand? - - public var itemId: Int? - - public var fyndArticleCode: String? - - public var id: String? - - public var identifier: LineItemsArticleIdentifier? - - public var sellerIdentifier: String? - - public var fyndItemCode: String? - - public var countryOfOrigin: String? - - - public enum CodingKeys: String, CodingKey { - - case quantities = "quantities" - - case oldArticleUid = "old_article_uid" - - case totalQuantity = "total_quantity" - - case manufacturer = "manufacturer" - - case price = "price" - - case trackInventory = "track_inventory" - - case company = "company" - - case isActive = "is_active" - - case dateMeta = "date_meta" - - case fragile = "fragile" - - case marketplaceIdentifiers = "marketplace_identifiers" - - case size = "size" - - case isSet = "is_set" - - case dimension = "dimension" - - case weight = "weight" - - case store = "store" - - case meta = "meta" - - case uid = "uid" - - case brand = "brand" - - case itemId = "item_id" - - case fyndArticleCode = "fynd_article_code" - - case id = "_id" - - case identifier = "identifier" - - case sellerIdentifier = "seller_identifier" - - case fyndItemCode = "fynd_item_code" - - case countryOfOrigin = "country_of_origin" - - } - - public init(brand: ArticleBrand?, company: Company?, countryOfOrigin: String?, dateMeta: FailOrderDateMeta?, dimension: Dimension?, fragile: Bool?, fyndArticleCode: String?, fyndItemCode: String?, identifier: LineItemsArticleIdentifier?, isActive: Bool?, isSet: Bool?, itemId: Int?, manufacturer: Manufacturer?, marketplaceIdentifiers: MarketplaceIdentifiers?, meta: ArticleMeta?, oldArticleUid: String?, price: ArticlePrice?, quantities: Quantities?, sellerIdentifier: String?, size: String?, store: Store?, totalQuantity: Int?, trackInventory: Bool?, uid: String?, weight: Weight?, id: String?) { - - self.quantities = quantities - - self.oldArticleUid = oldArticleUid - - self.totalQuantity = totalQuantity - - self.manufacturer = manufacturer - - self.price = price - - self.trackInventory = trackInventory - - self.company = company - - self.isActive = isActive - - self.dateMeta = dateMeta - - self.fragile = fragile - - self.marketplaceIdentifiers = marketplaceIdentifiers - - self.size = size - - self.isSet = isSet - - self.dimension = dimension - - self.weight = weight - - self.store = store - - self.meta = meta - - self.uid = uid - - self.brand = brand - - self.itemId = itemId - - self.fyndArticleCode = fyndArticleCode - - self.id = id - - self.identifier = identifier - - self.sellerIdentifier = sellerIdentifier - - self.fyndItemCode = fyndItemCode - - self.countryOfOrigin = countryOfOrigin - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - quantities = try container.decode(Quantities.self, forKey: .quantities) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - oldArticleUid = try container.decode(String.self, forKey: .oldArticleUid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalQuantity = try container.decode(Int.self, forKey: .totalQuantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - manufacturer = try container.decode(Manufacturer.self, forKey: .manufacturer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(ArticlePrice.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - trackInventory = try container.decode(Bool.self, forKey: .trackInventory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - company = try container.decode(Company.self, forKey: .company) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(FailOrderDateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fragile = try container.decode(Bool.self, forKey: .fragile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - marketplaceIdentifiers = try container.decode(MarketplaceIdentifiers.self, forKey: .marketplaceIdentifiers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - size = try container.decode(String.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isSet = try container.decode(Bool.self, forKey: .isSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dimension = try container.decode(Dimension.self, forKey: .dimension) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - weight = try container.decode(Weight.self, forKey: .weight) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - store = try container.decode(Store.self, forKey: .store) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode(ArticleMeta.self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brand = try container.decode(ArticleBrand.self, forKey: .brand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemId = try container.decode(Int.self, forKey: .itemId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fyndArticleCode = try container.decode(String.self, forKey: .fyndArticleCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - identifier = try container.decode(LineItemsArticleIdentifier.self, forKey: .identifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sellerIdentifier = try container.decode(String.self, forKey: .sellerIdentifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fyndItemCode = try container.decode(String.self, forKey: .fyndItemCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryOfOrigin = try container.decode(String.self, forKey: .countryOfOrigin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(quantities, forKey: .quantities) - - - - try? container.encodeIfPresent(oldArticleUid, forKey: .oldArticleUid) - - - - try? container.encodeIfPresent(totalQuantity, forKey: .totalQuantity) - - - - try? container.encodeIfPresent(manufacturer, forKey: .manufacturer) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(trackInventory, forKey: .trackInventory) - - - - try? container.encodeIfPresent(company, forKey: .company) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(fragile, forKey: .fragile) - - - - try? container.encodeIfPresent(marketplaceIdentifiers, forKey: .marketplaceIdentifiers) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(isSet, forKey: .isSet) - - - - try? container.encodeIfPresent(dimension, forKey: .dimension) - - - - try? container.encodeIfPresent(weight, forKey: .weight) - - - - try? container.encodeIfPresent(store, forKey: .store) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(brand, forKey: .brand) - - - - try? container.encodeIfPresent(itemId, forKey: .itemId) - - - - try? container.encodeIfPresent(fyndArticleCode, forKey: .fyndArticleCode) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(identifier, forKey: .identifier) - - - - try? container.encodeIfPresent(sellerIdentifier, forKey: .sellerIdentifier) - - - - try? container.encodeIfPresent(fyndItemCode, forKey: .fyndItemCode) - - - - try? container.encodeIfPresent(countryOfOrigin, forKey: .countryOfOrigin) - - - } - - } - - /* - Model: Quantities - Used By: Order - */ - - class Quantities: Codable { - - - public var notAvailable: NotAvailable? - - public var sellable: Sellable? - - public var orderCommitted: OrderCommitted? - - public var damaged: Damaged? - - - public enum CodingKeys: String, CodingKey { - - case notAvailable = "not_available" - - case sellable = "sellable" - - case orderCommitted = "order_committed" - - case damaged = "damaged" - - } - - public init(damaged: Damaged?, notAvailable: NotAvailable?, orderCommitted: OrderCommitted?, sellable: Sellable?) { - - self.notAvailable = notAvailable - - self.sellable = sellable - - self.orderCommitted = orderCommitted - - self.damaged = damaged - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - notAvailable = try container.decode(NotAvailable.self, forKey: .notAvailable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sellable = try container.decode(Sellable.self, forKey: .sellable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderCommitted = try container.decode(OrderCommitted.self, forKey: .orderCommitted) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - damaged = try container.decode(Damaged.self, forKey: .damaged) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(notAvailable, forKey: .notAvailable) - - - - try? container.encodeIfPresent(sellable, forKey: .sellable) - - - - try? container.encodeIfPresent(orderCommitted, forKey: .orderCommitted) - - - - try? container.encodeIfPresent(damaged, forKey: .damaged) - - - } - - } - - /* - Model: NotAvailable - Used By: Order - */ - - class NotAvailable: Codable { - - - public var count: Int? - - public var updatedAt: String? - - - public enum CodingKeys: String, CodingKey { - - case count = "count" - - case updatedAt = "updated_at" - - } - - public init(count: Int?, updatedAt: String?) { - - self.count = count - - self.updatedAt = updatedAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(count, forKey: .count) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - } - - } - - /* - Model: Sellable - Used By: Order - */ - - class Sellable: Codable { - - - public var count: Int? - - public var updatedAt: String? - - - public enum CodingKeys: String, CodingKey { - - case count = "count" - - case updatedAt = "updated_at" - - } - - public init(count: Int?, updatedAt: String?) { - - self.count = count - - self.updatedAt = updatedAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(count, forKey: .count) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - } - - } - - /* - Model: OrderCommitted - Used By: Order - */ - - class OrderCommitted: Codable { - - - public var count: Int? - - public var updatedAt: String? - - - public enum CodingKeys: String, CodingKey { - - case count = "count" - - case updatedAt = "updated_at" - - } - - public init(count: Int?, updatedAt: String?) { - - self.count = count - - self.updatedAt = updatedAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(count, forKey: .count) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - } - - } - - /* - Model: Damaged - Used By: Order - */ - - class Damaged: Codable { - - - public var updatedAt: String? - - public var count: Int? - - - public enum CodingKeys: String, CodingKey { - - case updatedAt = "updated_at" - - case count = "count" - - } - - public init(count: Int?, updatedAt: String?) { - - self.updatedAt = updatedAt - - self.count = count - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(count, forKey: .count) - - - } - - } - - /* - Model: Manufacturer - Used By: Order - */ - - class Manufacturer: Codable { - - - public var isDefault: Bool? - - public var address: String? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case isDefault = "is_default" - - case address = "address" - - case name = "name" - - } - - public init(address: String?, isDefault: Bool?, name: String?) { - - self.isDefault = isDefault - - self.address = address - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isDefault = try container.decode(Bool.self, forKey: .isDefault) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address = try container.decode(String.self, forKey: .address) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isDefault, forKey: .isDefault) - - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: ArticlePrice - Used By: Order - */ - - class ArticlePrice: Codable { - - - public var marked: Int? - - public var currency: String? - - public var effective: Int? - - public var transfer: Int? - - - public enum CodingKeys: String, CodingKey { - - case marked = "marked" - - case currency = "currency" - - case effective = "effective" - - case transfer = "transfer" - - } - - public init(currency: String?, effective: Int?, marked: Int?, transfer: Int?) { - - self.marked = marked - - self.currency = currency - - self.effective = effective - - self.transfer = transfer - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - marked = try container.decode(Int.self, forKey: .marked) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(String.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - effective = try container.decode(Int.self, forKey: .effective) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - transfer = try container.decode(Int.self, forKey: .transfer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(marked, forKey: .marked) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(effective, forKey: .effective) - - - - try? container.encodeIfPresent(transfer, forKey: .transfer) - - - } - - } - - /* - Model: Company - Used By: Order - */ - - class Company: Codable { - - - public var id: Int? - - public var companyType: String? - - public var businessType: String? - - public var companyName: String? - - public var createdOn: String? - - public var panNo: String? - - public var returnAllowed: Bool? - - public var meta: String? - - public var exchangeAllowed: Bool? - - public var agreementStartDate: String? - - public var exchangeWithinDays: Int? - - public var paymentProcesingCharge: Int? - - public var fyndAFitAvailable: Bool? - - public var modifiedOn: String? - - public var returnWithinDays: Int? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case companyType = "company_type" - - case businessType = "business_type" - - case companyName = "company_name" - - case createdOn = "created_on" - - case panNo = "pan_no" - - case returnAllowed = "return_allowed" - - case meta = "meta" - - case exchangeAllowed = "exchange_allowed" - - case agreementStartDate = "agreement_start_date" - - case exchangeWithinDays = "exchange_within_days" - - case paymentProcesingCharge = "payment_procesing_charge" - - case fyndAFitAvailable = "fynd_a_fit_available" - - case modifiedOn = "modified_on" - - case returnWithinDays = "return_within_days" - - } - - public init(agreementStartDate: String?, businessType: String?, companyName: String?, companyType: String?, createdOn: String?, exchangeAllowed: Bool?, exchangeWithinDays: Int?, fyndAFitAvailable: Bool?, id: Int?, meta: String?, modifiedOn: String?, panNo: String?, paymentProcesingCharge: Int?, returnAllowed: Bool?, returnWithinDays: Int?) { - - self.id = id - - self.companyType = companyType - - self.businessType = businessType - - self.companyName = companyName - - self.createdOn = createdOn - - self.panNo = panNo - - self.returnAllowed = returnAllowed - - self.meta = meta - - self.exchangeAllowed = exchangeAllowed - - self.agreementStartDate = agreementStartDate - - self.exchangeWithinDays = exchangeWithinDays - - self.paymentProcesingCharge = paymentProcesingCharge - - self.fyndAFitAvailable = fyndAFitAvailable - - self.modifiedOn = modifiedOn - - self.returnWithinDays = returnWithinDays - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyType = try container.decode(String.self, forKey: .companyType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - businessType = try container.decode(String.self, forKey: .businessType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyName = try container.decode(String.self, forKey: .companyName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - panNo = try container.decode(String.self, forKey: .panNo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - returnAllowed = try container.decode(Bool.self, forKey: .returnAllowed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode(String.self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - exchangeAllowed = try container.decode(Bool.self, forKey: .exchangeAllowed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - agreementStartDate = try container.decode(String.self, forKey: .agreementStartDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - exchangeWithinDays = try container.decode(Int.self, forKey: .exchangeWithinDays) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentProcesingCharge = try container.decode(Int.self, forKey: .paymentProcesingCharge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fyndAFitAvailable = try container.decode(Bool.self, forKey: .fyndAFitAvailable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - returnWithinDays = try container.decode(Int.self, forKey: .returnWithinDays) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(companyType, forKey: .companyType) - - - - try? container.encodeIfPresent(businessType, forKey: .businessType) - - - - try? container.encodeIfPresent(companyName, forKey: .companyName) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(panNo, forKey: .panNo) - - - - try? container.encodeIfPresent(returnAllowed, forKey: .returnAllowed) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(exchangeAllowed, forKey: .exchangeAllowed) - - - - try? container.encodeIfPresent(agreementStartDate, forKey: .agreementStartDate) - - - - try? container.encodeIfPresent(exchangeWithinDays, forKey: .exchangeWithinDays) - - - - try? container.encodeIfPresent(paymentProcesingCharge, forKey: .paymentProcesingCharge) - - - - try? container.encodeIfPresent(fyndAFitAvailable, forKey: .fyndAFitAvailable) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(returnWithinDays, forKey: .returnWithinDays) - - - } - - } - - /* - Model: FailOrderDateMeta - Used By: Order - */ - - class FailOrderDateMeta: Codable { - - - public var addedOnStore: String? - - public var inventoryUpdatedOn: String? - - public var createdOn: String? - - public var modifiedOn: String? - - - public enum CodingKeys: String, CodingKey { - - case addedOnStore = "added_on_store" - - case inventoryUpdatedOn = "inventory_updated_on" - - case createdOn = "created_on" - - case modifiedOn = "modified_on" - - } - - public init(addedOnStore: String?, createdOn: String?, inventoryUpdatedOn: String?, modifiedOn: String?) { - - self.addedOnStore = addedOnStore - - self.inventoryUpdatedOn = inventoryUpdatedOn - - self.createdOn = createdOn - - self.modifiedOn = modifiedOn - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - addedOnStore = try container.decode(String.self, forKey: .addedOnStore) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - inventoryUpdatedOn = try container.decode(String.self, forKey: .inventoryUpdatedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(addedOnStore, forKey: .addedOnStore) - - - - try? container.encodeIfPresent(inventoryUpdatedOn, forKey: .inventoryUpdatedOn) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - } - - } - - /* - Model: MarketplaceIdentifiers - Used By: Order - */ - - class MarketplaceIdentifiers: Codable { - - - public var tatacliqLuxury: TatacliqLuxury? - - - public enum CodingKeys: String, CodingKey { - - case tatacliqLuxury = "tatacliq_luxury" - - } - - public init(tatacliqLuxury: TatacliqLuxury?) { - - self.tatacliqLuxury = tatacliqLuxury - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - tatacliqLuxury = try container.decode(TatacliqLuxury.self, forKey: .tatacliqLuxury) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(tatacliqLuxury, forKey: .tatacliqLuxury) - - - } - - } - - /* - Model: TatacliqLuxury - Used By: Order - */ - - class TatacliqLuxury: Codable { - - - public var sku: String? - - - public enum CodingKeys: String, CodingKey { - - case sku = "sku" - - } - - public init(sku: String?) { - - self.sku = sku - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - sku = try container.decode(String.self, forKey: .sku) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(sku, forKey: .sku) - - - } - - } - - /* - Model: Dimension - Used By: Order - */ - - class Dimension: Codable { - - - public var height: Int? - - public var width: Int? - - public var unit: String? - - public var length: Int? - - public var isDefault: Bool? - - - public enum CodingKeys: String, CodingKey { - - case height = "height" - - case width = "width" - - case unit = "unit" - - case length = "length" - - case isDefault = "is_default" - - } - - public init(height: Int?, isDefault: Bool?, length: Int?, unit: String?, width: Int?) { - - self.height = height - - self.width = width - - self.unit = unit - - self.length = length - - self.isDefault = isDefault - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - height = try container.decode(Int.self, forKey: .height) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - width = try container.decode(Int.self, forKey: .width) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - unit = try container.decode(String.self, forKey: .unit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - length = try container.decode(Int.self, forKey: .length) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isDefault = try container.decode(Bool.self, forKey: .isDefault) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(height, forKey: .height) - - - - try? container.encodeIfPresent(width, forKey: .width) - - - - try? container.encodeIfPresent(unit, forKey: .unit) - - - - try? container.encodeIfPresent(length, forKey: .length) - - - - try? container.encodeIfPresent(isDefault, forKey: .isDefault) - - - } - - } - - /* - Model: Weight - Used By: Order - */ - - class Weight: Codable { - - - public var isDefault: Bool? - - public var unit: String? - - public var shipping: Int? - - - public enum CodingKeys: String, CodingKey { - - case isDefault = "is_default" - - case unit = "unit" - - case shipping = "shipping" - - } - - public init(isDefault: Bool?, shipping: Int?, unit: String?) { - - self.isDefault = isDefault - - self.unit = unit - - self.shipping = shipping - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isDefault = try container.decode(Bool.self, forKey: .isDefault) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - unit = try container.decode(String.self, forKey: .unit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shipping = try container.decode(Int.self, forKey: .shipping) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isDefault, forKey: .isDefault) - - - - try? container.encodeIfPresent(unit, forKey: .unit) - - - - try? container.encodeIfPresent(shipping, forKey: .shipping) - - - } - - } - - /* - Model: Store - Used By: Order - */ - - class Store: Codable { - - - public var id: Int? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - } - - public init(id: Int?) { - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: ArticleMeta - Used By: Order - */ - - class ArticleMeta: Codable { - - - public var service: String? - - - public enum CodingKeys: String, CodingKey { - - case service = "service" - - } - - public init(service: String?) { - - self.service = service - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - service = try container.decode(String.self, forKey: .service) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(service, forKey: .service) - - - } - - } - - /* - Model: ArticleBrand - Used By: Order - */ - - class ArticleBrand: Codable { - - - public var name: String? - - public var id: Int? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case id = "id" - - } - - public init(id: Int?, name: String?) { - - self.name = name - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: LineItemsArticleIdentifier - Used By: Order - */ - - class LineItemsArticleIdentifier: Codable { - - - public var skuCode: String? - - - public enum CodingKeys: String, CodingKey { - - case skuCode = "sku_code" - - } - - public init(skuCode: String?) { - - self.skuCode = skuCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - skuCode = try container.decode(String.self, forKey: .skuCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(skuCode, forKey: .skuCode) - - - } - - } - - /* - Model: PriceSet - Used By: Order - */ - - class PriceSet: Codable { - - - public var shopMoney: PriceSetShopMoney? - - public var presentmentMoney: PriceSetPresentmentMoney? - - - public enum CodingKeys: String, CodingKey { - - case shopMoney = "shop_money" - - case presentmentMoney = "presentment_money" - - } - - public init(presentmentMoney: PriceSetPresentmentMoney?, shopMoney: PriceSetShopMoney?) { - - self.shopMoney = shopMoney - - self.presentmentMoney = presentmentMoney - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - shopMoney = try container.decode(PriceSetShopMoney.self, forKey: .shopMoney) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - presentmentMoney = try container.decode(PriceSetPresentmentMoney.self, forKey: .presentmentMoney) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(shopMoney, forKey: .shopMoney) - - - - try? container.encodeIfPresent(presentmentMoney, forKey: .presentmentMoney) - - - } - - } - - /* - Model: PriceSetShopMoney - Used By: Order - */ - - class PriceSetShopMoney: Codable { - - - public var amount: String? - - public var currencyCode: String? - - - public enum CodingKeys: String, CodingKey { - - case amount = "amount" - - case currencyCode = "currency_code" - - } - - public init(amount: String?, currencyCode: String?) { - - self.amount = amount - - self.currencyCode = currencyCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - amount = try container.decode(String.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - } - - } - - /* - Model: PriceSetPresentmentMoney - Used By: Order - */ - - class PriceSetPresentmentMoney: Codable { - - - public var amount: String? - - public var currencyCode: String? - - - public enum CodingKeys: String, CodingKey { - - case amount = "amount" - - case currencyCode = "currency_code" - - } - - public init(amount: String?, currencyCode: String?) { - - self.amount = amount - - self.currencyCode = currencyCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - amount = try container.decode(String.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - } - - } - - /* - Model: TaxLines - Used By: Order - */ - - class TaxLines: Codable { - - - public var title: String? - - public var price: String? - - public var rate: Int? - - public var priceSet: TaxLinesPriceSet? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case price = "price" - - case rate = "rate" - - case priceSet = "price_set" - - } - - public init(price: String?, priceSet: TaxLinesPriceSet?, rate: Int?, title: String?) { - - self.title = title - - self.price = price - - self.rate = rate - - self.priceSet = priceSet - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(String.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rate = try container.decode(Int.self, forKey: .rate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priceSet = try container.decode(TaxLinesPriceSet.self, forKey: .priceSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(rate, forKey: .rate) - - - - try? container.encodeIfPresent(priceSet, forKey: .priceSet) - - - } - - } - - /* - Model: TaxLinesPriceSet - Used By: Order - */ - - class TaxLinesPriceSet: Codable { - - - public var shopMoney: TaxLinesPriceSetShopMoney? - - public var presentmentMoney: TaxLinesPriceSetPresentmentMoney? - - - public enum CodingKeys: String, CodingKey { - - case shopMoney = "shop_money" - - case presentmentMoney = "presentment_money" - - } - - public init(presentmentMoney: TaxLinesPriceSetPresentmentMoney?, shopMoney: TaxLinesPriceSetShopMoney?) { - - self.shopMoney = shopMoney - - self.presentmentMoney = presentmentMoney - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - shopMoney = try container.decode(TaxLinesPriceSetShopMoney.self, forKey: .shopMoney) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - presentmentMoney = try container.decode(TaxLinesPriceSetPresentmentMoney.self, forKey: .presentmentMoney) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(shopMoney, forKey: .shopMoney) - - - - try? container.encodeIfPresent(presentmentMoney, forKey: .presentmentMoney) - - - } - - } - - /* - Model: TaxLinesPriceSetShopMoney - Used By: Order - */ - - class TaxLinesPriceSetShopMoney: Codable { - - - public var amount: String? - - public var currencyCode: String? - - - public enum CodingKeys: String, CodingKey { - - case amount = "amount" - - case currencyCode = "currency_code" - - } - - public init(amount: String?, currencyCode: String?) { - - self.amount = amount - - self.currencyCode = currencyCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - amount = try container.decode(String.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - } - - } - - /* - Model: TaxLinesPriceSetPresentmentMoney - Used By: Order - */ - - class TaxLinesPriceSetPresentmentMoney: Codable { - - - public var currencyCode: String? - - public var amount: String? - - - public enum CodingKeys: String, CodingKey { - - case currencyCode = "currency_code" - - case amount = "amount" - - } - - public init(amount: String?, currencyCode: String?) { - - self.currencyCode = currencyCode - - self.amount = amount - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - amount = try container.decode(String.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - } - - } - - /* - Model: TotalDiscountSet - Used By: Order - */ - - class TotalDiscountSet: Codable { - - - public var presentmentMoney: TotalDiscountSetPresentmentMoney? - - public var shopMoney: TotalDiscountSetShopMoney? - - - public enum CodingKeys: String, CodingKey { - - case presentmentMoney = "presentment_money" - - case shopMoney = "shop_money" - - } - - public init(presentmentMoney: TotalDiscountSetPresentmentMoney?, shopMoney: TotalDiscountSetShopMoney?) { - - self.presentmentMoney = presentmentMoney - - self.shopMoney = shopMoney - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - presentmentMoney = try container.decode(TotalDiscountSetPresentmentMoney.self, forKey: .presentmentMoney) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shopMoney = try container.decode(TotalDiscountSetShopMoney.self, forKey: .shopMoney) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(presentmentMoney, forKey: .presentmentMoney) - - - - try? container.encodeIfPresent(shopMoney, forKey: .shopMoney) - - - } - - } - - /* - Model: TotalDiscountSetPresentmentMoney - Used By: Order - */ - - class TotalDiscountSetPresentmentMoney: Codable { - - - public var amount: String? - - public var currencyCode: String? - - - public enum CodingKeys: String, CodingKey { - - case amount = "amount" - - case currencyCode = "currency_code" - - } - - public init(amount: String?, currencyCode: String?) { - - self.amount = amount - - self.currencyCode = currencyCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - amount = try container.decode(String.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - } - - } - - /* - Model: TotalDiscountSetShopMoney - Used By: Order - */ - - class TotalDiscountSetShopMoney: Codable { - - - public var amount: String? - - public var currencyCode: String? - - - public enum CodingKeys: String, CodingKey { - - case amount = "amount" - - case currencyCode = "currency_code" - - } - - public init(amount: String?, currencyCode: String?) { - - self.amount = amount - - self.currencyCode = currencyCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - amount = try container.decode(String.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - } - - } - - /* - Model: BillingAddress - Used By: Order - */ - - class BillingAddress: Codable { - - - public var address1: String? - - public var city: String? - - public var zip: String? - - public var lastName: String? - - public var address2: String? - - public var longitude: Double? - - public var provinceCode: String? - - public var phone: String? - - public var company: String? - - public var latitude: Double? - - public var name: String? - - public var country: String? - - public var countryCode: String? - - public var firstName: String? - - public var province: String? - - - public enum CodingKeys: String, CodingKey { - - case address1 = "address1" - - case city = "city" - - case zip = "zip" - - case lastName = "last_name" - - case address2 = "address2" - - case longitude = "longitude" - - case provinceCode = "province_code" - - case phone = "phone" - - case company = "company" - - case latitude = "latitude" - - case name = "name" - - case country = "country" - - case countryCode = "country_code" - - case firstName = "first_name" - - case province = "province" - - } - - public init(address1: String?, address2: String?, city: String?, company: String?, country: String?, countryCode: String?, firstName: String?, lastName: String?, latitude: Double?, longitude: Double?, name: String?, phone: String?, province: String?, provinceCode: String?, zip: String?) { - - self.address1 = address1 - - self.city = city - - self.zip = zip - - self.lastName = lastName - - self.address2 = address2 - - self.longitude = longitude - - self.provinceCode = provinceCode - - self.phone = phone - - self.company = company - - self.latitude = latitude - - self.name = name - - self.country = country - - self.countryCode = countryCode - - self.firstName = firstName - - self.province = province - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - address1 = try container.decode(String.self, forKey: .address1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - zip = try container.decode(String.self, forKey: .zip) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address2 = try container.decode(String.self, forKey: .address2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - longitude = try container.decode(Double.self, forKey: .longitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - provinceCode = try container.decode(String.self, forKey: .provinceCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - company = try container.decode(String.self, forKey: .company) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - latitude = try container.decode(Double.self, forKey: .latitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - province = try container.decode(String.self, forKey: .province) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(address1, forKey: .address1) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(zip, forKey: .zip) - - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(address2, forKey: .address2) - - - - try? container.encodeIfPresent(longitude, forKey: .longitude) - - - - try? container.encodeIfPresent(provinceCode, forKey: .provinceCode) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(company, forKey: .company) - - - - try? container.encodeIfPresent(latitude, forKey: .latitude) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(province, forKey: .province) - - - } - - } - - /* - Model: TotalShippingPriceSet - Used By: Order - */ - - class TotalShippingPriceSet: Codable { - - - public var shopMoney: TotalShippingPriceSetShopMoney? - - public var presentmentMoney: TotalShippingPriceSetPresentmentMoney? - - - public enum CodingKeys: String, CodingKey { - - case shopMoney = "shop_money" - - case presentmentMoney = "presentment_money" - - } - - public init(presentmentMoney: TotalShippingPriceSetPresentmentMoney?, shopMoney: TotalShippingPriceSetShopMoney?) { - - self.shopMoney = shopMoney - - self.presentmentMoney = presentmentMoney - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - shopMoney = try container.decode(TotalShippingPriceSetShopMoney.self, forKey: .shopMoney) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - presentmentMoney = try container.decode(TotalShippingPriceSetPresentmentMoney.self, forKey: .presentmentMoney) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(shopMoney, forKey: .shopMoney) - - - - try? container.encodeIfPresent(presentmentMoney, forKey: .presentmentMoney) - - - } - - } - - /* - Model: TotalShippingPriceSetShopMoney - Used By: Order - */ - - class TotalShippingPriceSetShopMoney: Codable { - - - public var amount: String? - - public var currencyCode: String? - - - public enum CodingKeys: String, CodingKey { - - case amount = "amount" - - case currencyCode = "currency_code" - - } - - public init(amount: String?, currencyCode: String?) { - - self.amount = amount - - self.currencyCode = currencyCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - amount = try container.decode(String.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - } - - } - - /* - Model: TotalShippingPriceSetPresentmentMoney - Used By: Order - */ - - class TotalShippingPriceSetPresentmentMoney: Codable { - - - public var amount: String? - - public var currencyCode: String? - - - public enum CodingKeys: String, CodingKey { - - case amount = "amount" - - case currencyCode = "currency_code" - - } - - public init(amount: String?, currencyCode: String?) { - - self.amount = amount - - self.currencyCode = currencyCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - amount = try container.decode(String.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - } - - } - - /* - Model: Customer - Used By: Order - */ - - class Customer: Codable { - - - public var createdAt: String? - - public var id: Int? - - public var lastName: String? - - public var state: String? - - public var lastOrderId: Int? - - public var note: String? - - public var verifiedEmail: Bool? - - public var phone: String? - - public var acceptsMarketing: Bool? - - public var firstName: String? - - public var tags: String? - - public var lastOrderName: String? - - public var ordersCount: Int? - - public var totalSpent: String? - - public var taxExempt: Bool? - - public var currency: String? - - public var acceptsMarketingUpdatedAt: String? - - public var email: String? - - public var updatedAt: String? - - public var adminGraphqlApiId: String? - - public var defaultAddress: DefaultAddress? - - - public enum CodingKeys: String, CodingKey { - - case createdAt = "created_at" - - case id = "id" - - case lastName = "last_name" - - case state = "state" - - case lastOrderId = "last_order_id" - - case note = "note" - - case verifiedEmail = "verified_email" - - case phone = "phone" - - case acceptsMarketing = "accepts_marketing" - - case firstName = "first_name" - - case tags = "tags" - - case lastOrderName = "last_order_name" - - case ordersCount = "orders_count" - - case totalSpent = "total_spent" - - case taxExempt = "tax_exempt" - - case currency = "currency" - - case acceptsMarketingUpdatedAt = "accepts_marketing_updated_at" - - case email = "email" - - case updatedAt = "updated_at" - - case adminGraphqlApiId = "admin_graphql_api_id" - - case defaultAddress = "default_address" - - } - - public init(acceptsMarketing: Bool?, acceptsMarketingUpdatedAt: String?, adminGraphqlApiId: String?, createdAt: String?, currency: String?, defaultAddress: DefaultAddress?, email: String?, firstName: String?, id: Int?, lastName: String?, lastOrderId: Int?, lastOrderName: String?, note: String?, ordersCount: Int?, phone: String?, state: String?, tags: String?, taxExempt: Bool?, totalSpent: String?, updatedAt: String?, verifiedEmail: Bool?) { - - self.createdAt = createdAt - - self.id = id - - self.lastName = lastName - - self.state = state - - self.lastOrderId = lastOrderId - - self.note = note - - self.verifiedEmail = verifiedEmail - - self.phone = phone - - self.acceptsMarketing = acceptsMarketing - - self.firstName = firstName - - self.tags = tags - - self.lastOrderName = lastOrderName - - self.ordersCount = ordersCount - - self.totalSpent = totalSpent - - self.taxExempt = taxExempt - - self.currency = currency - - self.acceptsMarketingUpdatedAt = acceptsMarketingUpdatedAt - - self.email = email - - self.updatedAt = updatedAt - - self.adminGraphqlApiId = adminGraphqlApiId - - self.defaultAddress = defaultAddress - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(String.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastOrderId = try container.decode(Int.self, forKey: .lastOrderId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - note = try container.decode(String.self, forKey: .note) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifiedEmail = try container.decode(Bool.self, forKey: .verifiedEmail) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - acceptsMarketing = try container.decode(Bool.self, forKey: .acceptsMarketing) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode(String.self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastOrderName = try container.decode(String.self, forKey: .lastOrderName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ordersCount = try container.decode(Int.self, forKey: .ordersCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalSpent = try container.decode(String.self, forKey: .totalSpent) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - taxExempt = try container.decode(Bool.self, forKey: .taxExempt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(String.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - acceptsMarketingUpdatedAt = try container.decode(String.self, forKey: .acceptsMarketingUpdatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - adminGraphqlApiId = try container.decode(String.self, forKey: .adminGraphqlApiId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - defaultAddress = try container.decode(DefaultAddress.self, forKey: .defaultAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(lastOrderId, forKey: .lastOrderId) - - - - try? container.encodeIfPresent(note, forKey: .note) - - - - try? container.encodeIfPresent(verifiedEmail, forKey: .verifiedEmail) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(acceptsMarketing, forKey: .acceptsMarketing) - - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(lastOrderName, forKey: .lastOrderName) - - - - try? container.encodeIfPresent(ordersCount, forKey: .ordersCount) - - - - try? container.encodeIfPresent(totalSpent, forKey: .totalSpent) - - - - try? container.encodeIfPresent(taxExempt, forKey: .taxExempt) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(acceptsMarketingUpdatedAt, forKey: .acceptsMarketingUpdatedAt) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(adminGraphqlApiId, forKey: .adminGraphqlApiId) - - - - try? container.encodeIfPresent(defaultAddress, forKey: .defaultAddress) - - - } - - } - - /* - Model: DefaultAddress - Used By: Order - */ - - class DefaultAddress: Codable { - - - public var lastName: String? - - public var name: String? - - public var provinceCode: String? - - public var countryCode: String? - - public var isDefault: Bool? - - public var id: Int? - - public var customerId: Int? - - public var firstName: String? - - public var address1: String? - - public var phone: String? - - public var countryName: String? - - public var company: String? - - public var address2: String? - - public var city: String? - - public var province: String? - - public var country: String? - - public var zip: String? - - - public enum CodingKeys: String, CodingKey { - - case lastName = "last_name" - - case name = "name" - - case provinceCode = "province_code" - - case countryCode = "country_code" - - case isDefault = "is_default" - - case id = "id" - - case customerId = "customer_id" - - case firstName = "first_name" - - case address1 = "address1" - - case phone = "phone" - - case countryName = "country_name" - - case company = "company" - - case address2 = "address2" - - case city = "city" - - case province = "province" - - case country = "country" - - case zip = "zip" - - } - - public init(address1: String?, address2: String?, city: String?, company: String?, country: String?, countryCode: String?, countryName: String?, customerId: Int?, firstName: String?, id: Int?, isDefault: Bool?, lastName: String?, name: String?, phone: String?, province: String?, provinceCode: String?, zip: String?) { - - self.lastName = lastName - - self.name = name - - self.provinceCode = provinceCode - - self.countryCode = countryCode - - self.isDefault = isDefault - - self.id = id - - self.customerId = customerId - - self.firstName = firstName - - self.address1 = address1 - - self.phone = phone - - self.countryName = countryName - - self.company = company - - self.address2 = address2 - - self.city = city - - self.province = province - - self.country = country - - self.zip = zip - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - provinceCode = try container.decode(String.self, forKey: .provinceCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isDefault = try container.decode(Bool.self, forKey: .isDefault) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customerId = try container.decode(Int.self, forKey: .customerId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address1 = try container.decode(String.self, forKey: .address1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryName = try container.decode(String.self, forKey: .countryName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - company = try container.decode(String.self, forKey: .company) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address2 = try container.decode(String.self, forKey: .address2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - province = try container.decode(String.self, forKey: .province) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - zip = try container.decode(String.self, forKey: .zip) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(provinceCode, forKey: .provinceCode) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(isDefault, forKey: .isDefault) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(customerId, forKey: .customerId) - - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(address1, forKey: .address1) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(countryName, forKey: .countryName) - - - - try? container.encodeIfPresent(company, forKey: .company) - - - - try? container.encodeIfPresent(address2, forKey: .address2) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(province, forKey: .province) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(zip, forKey: .zip) - - - } - - } - - /* - Model: TotalLineItemsPriceSet - Used By: Order - */ - - class TotalLineItemsPriceSet: Codable { - - - public var shopMoney: TotalLineItemsPriceSetShopMoney? - - public var presentmentMoney: TotalLineItemsPriceSetPresentmentMoney? - - - public enum CodingKeys: String, CodingKey { - - case shopMoney = "shop_money" - - case presentmentMoney = "presentment_money" - - } - - public init(presentmentMoney: TotalLineItemsPriceSetPresentmentMoney?, shopMoney: TotalLineItemsPriceSetShopMoney?) { - - self.shopMoney = shopMoney - - self.presentmentMoney = presentmentMoney - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - shopMoney = try container.decode(TotalLineItemsPriceSetShopMoney.self, forKey: .shopMoney) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - presentmentMoney = try container.decode(TotalLineItemsPriceSetPresentmentMoney.self, forKey: .presentmentMoney) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(shopMoney, forKey: .shopMoney) - - - - try? container.encodeIfPresent(presentmentMoney, forKey: .presentmentMoney) - - - } - - } - - /* - Model: TotalLineItemsPriceSetShopMoney - Used By: Order - */ - - class TotalLineItemsPriceSetShopMoney: Codable { - - - public var amount: String? - - public var currencyCode: String? - - - public enum CodingKeys: String, CodingKey { - - case amount = "amount" - - case currencyCode = "currency_code" - - } - - public init(amount: String?, currencyCode: String?) { - - self.amount = amount - - self.currencyCode = currencyCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - amount = try container.decode(String.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - } - - } - - /* - Model: TotalLineItemsPriceSetPresentmentMoney - Used By: Order - */ - - class TotalLineItemsPriceSetPresentmentMoney: Codable { - - - public var amount: String? - - public var currencyCode: String? - - - public enum CodingKeys: String, CodingKey { - - case amount = "amount" - - case currencyCode = "currency_code" - - } - - public init(amount: String?, currencyCode: String?) { - - self.amount = amount - - self.currencyCode = currencyCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - amount = try container.decode(String.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - } - - } - - /* - Model: OrderShippingAddress - Used By: Order - */ - - class OrderShippingAddress: Codable { - - - public var address1: String? - - public var zip: String? - - public var address2: String? - - public var countryCode: String? - - public var country: String? - - public var lastName: String? - - public var latitude: Double? - - public var provinceCode: String? - - public var firstName: String? - - public var phone: String? - - public var province: String? - - public var longitude: Double? - - public var city: String? - - public var company: String? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case address1 = "address1" - - case zip = "zip" - - case address2 = "address2" - - case countryCode = "country_code" - - case country = "country" - - case lastName = "last_name" - - case latitude = "latitude" - - case provinceCode = "province_code" - - case firstName = "first_name" - - case phone = "phone" - - case province = "province" - - case longitude = "longitude" - - case city = "city" - - case company = "company" - - case name = "name" - - } - - public init(address1: String?, address2: String?, city: String?, company: String?, country: String?, countryCode: String?, firstName: String?, lastName: String?, latitude: Double?, longitude: Double?, name: String?, phone: String?, province: String?, provinceCode: String?, zip: String?) { - - self.address1 = address1 - - self.zip = zip - - self.address2 = address2 - - self.countryCode = countryCode - - self.country = country - - self.lastName = lastName - - self.latitude = latitude - - self.provinceCode = provinceCode - - self.firstName = firstName - - self.phone = phone - - self.province = province - - self.longitude = longitude - - self.city = city - - self.company = company - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - address1 = try container.decode(String.self, forKey: .address1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - zip = try container.decode(String.self, forKey: .zip) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address2 = try container.decode(String.self, forKey: .address2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - latitude = try container.decode(Double.self, forKey: .latitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - provinceCode = try container.decode(String.self, forKey: .provinceCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - province = try container.decode(String.self, forKey: .province) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - longitude = try container.decode(Double.self, forKey: .longitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - company = try container.decode(String.self, forKey: .company) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(address1, forKey: .address1) - - - - try? container.encodeIfPresent(zip, forKey: .zip) - - - - try? container.encodeIfPresent(address2, forKey: .address2) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(latitude, forKey: .latitude) - - - - try? container.encodeIfPresent(provinceCode, forKey: .provinceCode) - - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(province, forKey: .province) - - - - try? container.encodeIfPresent(longitude, forKey: .longitude) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(company, forKey: .company) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: OrderListing - Used By: Order - */ - - class OrderListing: Codable { - - - public var items: [OrderItems] - - public var filters: Filters - - public var nextOrderStatus: [String: Any] - - public var page: PlatformOrderPage - - public var appliedFilters: AppliedFilters - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case filters = "filters" - - case nextOrderStatus = "next_order_status" - - case page = "page" - - case appliedFilters = "applied_filters" - - } - - public init(appliedFilters: AppliedFilters, filters: Filters, items: [OrderItems], nextOrderStatus: [String: Any], page: PlatformOrderPage) { - - self.items = items - - self.filters = filters - - self.nextOrderStatus = nextOrderStatus - - self.page = page - - self.appliedFilters = appliedFilters - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - items = try container.decode([OrderItems].self, forKey: .items) - - - - - filters = try container.decode(Filters.self, forKey: .filters) - - - - - nextOrderStatus = try container.decode([String: Any].self, forKey: .nextOrderStatus) - - - - - page = try container.decode(PlatformOrderPage.self, forKey: .page) - - - - - appliedFilters = try container.decode(AppliedFilters.self, forKey: .appliedFilters) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(filters, forKey: .filters) - - - - try? container.encodeIfPresent(nextOrderStatus, forKey: .nextOrderStatus) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(appliedFilters, forKey: .appliedFilters) - - - } - - } - - /* - Model: OrderItems - Used By: Order - */ - - class OrderItems: Codable { - - - public var user: PlatformOrderUserInfo? - - public var deliveryAddress: PlatformDeliveryAddress? - - public var channel: Channel? - - public var id: String? - - public var application: PlatformApplication? - - public var shipments: PlatformShipment? - - public var createdAt: String? - - public var totalShipmentsInOrder: Int? - - - public enum CodingKeys: String, CodingKey { - - case user = "user" - - case deliveryAddress = "delivery_address" - - case channel = "channel" - - case id = "id" - - case application = "application" - - case shipments = "shipments" - - case createdAt = "created_at" - - case totalShipmentsInOrder = "total_shipments_in_order" - - } - - public init(application: PlatformApplication?, channel: Channel?, createdAt: String?, deliveryAddress: PlatformDeliveryAddress?, id: String?, shipments: PlatformShipment?, totalShipmentsInOrder: Int?, user: PlatformOrderUserInfo?) { - - self.user = user - - self.deliveryAddress = deliveryAddress - - self.channel = channel - - self.id = id - - self.application = application - - self.shipments = shipments - - self.createdAt = createdAt - - self.totalShipmentsInOrder = totalShipmentsInOrder - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - user = try container.decode(PlatformOrderUserInfo.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryAddress = try container.decode(PlatformDeliveryAddress.self, forKey: .deliveryAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - channel = try container.decode(Channel.self, forKey: .channel) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(PlatformApplication.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shipments = try container.decode(PlatformShipment.self, forKey: .shipments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalShipmentsInOrder = try container.decode(Int.self, forKey: .totalShipmentsInOrder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(deliveryAddress, forKey: .deliveryAddress) - - - - try? container.encodeIfPresent(channel, forKey: .channel) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(shipments, forKey: .shipments) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(totalShipmentsInOrder, forKey: .totalShipmentsInOrder) - - - } - - } - - /* - Model: PlatformOrderUserInfo - Used By: Order - */ - - class PlatformOrderUserInfo: Codable { - - - public var mobile: String? - - public var firstName: String? - - public var gender: String? - - public var email: String? - - public var lastName: String? - - public var isAnonymousUser: Bool? - - public var uid: Int? - - public var avisUserId: String? - - - public enum CodingKeys: String, CodingKey { - - case mobile = "mobile" - - case firstName = "first_name" - - case gender = "gender" - - case email = "email" - - case lastName = "last_name" - - case isAnonymousUser = "is_anonymous_user" - - case uid = "uid" - - case avisUserId = "avis_user_id" - - } - - public init(avisUserId: String?, email: String?, firstName: String?, gender: String?, isAnonymousUser: Bool?, lastName: String?, mobile: String?, uid: Int?) { - - self.mobile = mobile - - self.firstName = firstName - - self.gender = gender - - self.email = email - - self.lastName = lastName - - self.isAnonymousUser = isAnonymousUser - - self.uid = uid - - self.avisUserId = avisUserId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - mobile = try container.decode(String.self, forKey: .mobile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - firstName = try container.decode(String.self, forKey: .firstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gender = try container.decode(String.self, forKey: .gender) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastName = try container.decode(String.self, forKey: .lastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isAnonymousUser = try container.decode(Bool.self, forKey: .isAnonymousUser) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - avisUserId = try container.decode(String.self, forKey: .avisUserId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(firstName, forKey: .firstName) - - - - try? container.encodeIfPresent(gender, forKey: .gender) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(lastName, forKey: .lastName) - - - - try? container.encodeIfPresent(isAnonymousUser, forKey: .isAnonymousUser) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(avisUserId, forKey: .avisUserId) - - - } - - } - - /* - Model: PlatformDeliveryAddress - Used By: Order - */ - - class PlatformDeliveryAddress: Codable { - - - public var area: String? - - public var state: String? - - public var country: String? - - public var version: String? - - public var address1: String? - - public var latitude: Double? - - public var updatedAt: String? - - public var city: String? - - public var landmark: String? - - public var createdAt: String? - - public var name: String? - - public var address: String? - - public var phone: String? - - public var longitude: Double? - - public var addressType: String? - - public var email: String? - - public var pincode: String? - - public var address2: String? - - public var contactPerson: String? - - public var addressCategory: String? - - - public enum CodingKeys: String, CodingKey { - - case area = "area" - - case state = "state" - - case country = "country" - - case version = "version" - - case address1 = "address1" - - case latitude = "latitude" - - case updatedAt = "updated_at" - - case city = "city" - - case landmark = "landmark" - - case createdAt = "created_at" - - case name = "name" - - case address = "address" - - case phone = "phone" - - case longitude = "longitude" - - case addressType = "address_type" - - case email = "email" - - case pincode = "pincode" - - case address2 = "address2" - - case contactPerson = "contact_person" - - case addressCategory = "address_category" - - } - - public init(address: String?, address1: String?, address2: String?, addressCategory: String?, addressType: String?, area: String?, city: String?, contactPerson: String?, country: String?, createdAt: String?, email: String?, landmark: String?, latitude: Double?, longitude: Double?, name: String?, phone: String?, pincode: String?, state: String?, updatedAt: String?, version: String?) { - - self.area = area - - self.state = state - - self.country = country - - self.version = version - - self.address1 = address1 - - self.latitude = latitude - - self.updatedAt = updatedAt - - self.city = city - - self.landmark = landmark - - self.createdAt = createdAt - - self.name = name - - self.address = address - - self.phone = phone - - self.longitude = longitude - - self.addressType = addressType - - self.email = email - - self.pincode = pincode - - self.address2 = address2 - - self.contactPerson = contactPerson - - self.addressCategory = addressCategory - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - area = try container.decode(String.self, forKey: .area) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(String.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - version = try container.decode(String.self, forKey: .version) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address1 = try container.decode(String.self, forKey: .address1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - latitude = try container.decode(Double.self, forKey: .latitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - landmark = try container.decode(String.self, forKey: .landmark) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address = try container.decode(String.self, forKey: .address) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - longitude = try container.decode(Double.self, forKey: .longitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressType = try container.decode(String.self, forKey: .addressType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(String.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address2 = try container.decode(String.self, forKey: .address2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contactPerson = try container.decode(String.self, forKey: .contactPerson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressCategory = try container.decode(String.self, forKey: .addressCategory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(area, forKey: .area) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(version, forKey: .version) - - - - try? container.encodeIfPresent(address1, forKey: .address1) - - - - try? container.encodeIfPresent(latitude, forKey: .latitude) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(landmark, forKey: .landmark) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(longitude, forKey: .longitude) - - - - try? container.encodeIfPresent(addressType, forKey: .addressType) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(address2, forKey: .address2) - - - - try? container.encodeIfPresent(contactPerson, forKey: .contactPerson) - - - - try? container.encodeIfPresent(addressCategory, forKey: .addressCategory) - - - } - - } - - /* - Model: Channel - Used By: Order - */ - - class Channel: Codable { - - - public var name: String? - - public var logo: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case logo = "logo" - - } - - public init(logo: String?, name: String?) { - - self.name = name - - self.logo = logo - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - } - - } - - /* - Model: PlatformApplication - Used By: Order - */ - - class PlatformApplication: Codable { - - - public var id: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - } - - public init(id: String?) { - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: PlatformShipment - Used By: Order - */ - - class PlatformShipment: Codable { - - - public var status: PlatformShipmentStatus? - - public var bags: Bags? - - public var prices: ShipmentPrices? - - public var id: String? - - public var gst: ShipmentGst? - - public var totalShipmentBags: Int? - - - public enum CodingKeys: String, CodingKey { - - case status = "status" - - case bags = "bags" - - case prices = "prices" - - case id = "id" - - case gst = "gst" - - case totalShipmentBags = "total_shipment_bags" - - } - - public init(bags: Bags?, gst: ShipmentGst?, id: String?, prices: ShipmentPrices?, status: PlatformShipmentStatus?, totalShipmentBags: Int?) { - - self.status = status - - self.bags = bags - - self.prices = prices - - self.id = id - - self.gst = gst - - self.totalShipmentBags = totalShipmentBags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - status = try container.decode(PlatformShipmentStatus.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bags = try container.decode(Bags.self, forKey: .bags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - prices = try container.decode(ShipmentPrices.self, forKey: .prices) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gst = try container.decode(ShipmentGst.self, forKey: .gst) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalShipmentBags = try container.decode(Int.self, forKey: .totalShipmentBags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(bags, forKey: .bags) - - - - try? container.encodeIfPresent(prices, forKey: .prices) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(gst, forKey: .gst) - - - - try? container.encodeIfPresent(totalShipmentBags, forKey: .totalShipmentBags) - - - } - - } - - /* - Model: PlatformShipmentStatus - Used By: Order - */ - - class PlatformShipmentStatus: Codable { - - - public var id: Int? - - public var bagList: [Int]? - - public var createdAt: String? - - public var status: String? - - public var name: String? - - public var progress: Int? - - public var shipmentId: String? - - public var currentShipmentStatus: String? - - public var colorCode: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case bagList = "bag_list" - - case createdAt = "created_at" - - case status = "status" - - case name = "name" - - case progress = "progress" - - case shipmentId = "shipment_id" - - case currentShipmentStatus = "current_shipment_status" - - case colorCode = "color_code" - - } - - public init(bagList: [Int]?, colorCode: String?, createdAt: String?, currentShipmentStatus: String?, id: Int?, name: String?, progress: Int?, shipmentId: String?, status: String?) { - - self.id = id - - self.bagList = bagList - - self.createdAt = createdAt - - self.status = status - - self.name = name - - self.progress = progress - - self.shipmentId = shipmentId - - self.currentShipmentStatus = currentShipmentStatus - - self.colorCode = colorCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bagList = try container.decode([Int].self, forKey: .bagList) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - progress = try container.decode(Int.self, forKey: .progress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shipmentId = try container.decode(String.self, forKey: .shipmentId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currentShipmentStatus = try container.decode(String.self, forKey: .currentShipmentStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - colorCode = try container.decode(String.self, forKey: .colorCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(bagList, forKey: .bagList) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(progress, forKey: .progress) - - - - try? container.encodeIfPresent(shipmentId, forKey: .shipmentId) - - - - try? container.encodeIfPresent(currentShipmentStatus, forKey: .currentShipmentStatus) - - - - try? container.encodeIfPresent(colorCode, forKey: .colorCode) - - - } - - } - - /* - Model: Bags - Used By: Order - */ - - class Bags: Codable { - - - public var item: BagItem? - - public var id: Int? - - - public enum CodingKeys: String, CodingKey { - - case item = "item" - - case id = "id" - - } - - public init(id: Int?, item: BagItem?) { - - self.item = item - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - item = try container.decode(BagItem.self, forKey: .item) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(item, forKey: .item) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: BagItem - Used By: Order - */ - - class BagItem: Codable { - - - public var id: Int? - - public var size: String? - - public var slugKey: String? - - public var canReturn: Bool? - - public var brandId: Int? - - public var l2Category: [String]? - - public var name: String? - - public var code: String? - - public var canCancel: Bool? - - public var attributes: BagItemAttributes? - - public var l3CategoryName: String? - - public var l3Category: Int? - - public var l1Category: [String]? - - public var image: [String]? - - public var brand: String? - - public var lastUpdatedAt: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case size = "size" - - case slugKey = "slug_key" - - case canReturn = "can_return" - - case brandId = "brand_id" - - case l2Category = "l2_category" - - case name = "name" - - case code = "code" - - case canCancel = "can_cancel" - - case attributes = "attributes" - - case l3CategoryName = "l3_category_name" - - case l3Category = "l3_category" - - case l1Category = "l1_category" - - case image = "image" - - case brand = "brand" - - case lastUpdatedAt = "last_updated_at" - - } - - public init(attributes: BagItemAttributes?, brand: String?, brandId: Int?, canCancel: Bool?, canReturn: Bool?, code: String?, id: Int?, image: [String]?, l1Category: [String]?, l2Category: [String]?, l3Category: Int?, l3CategoryName: String?, lastUpdatedAt: String?, name: String?, size: String?, slugKey: String?) { - - self.id = id - - self.size = size - - self.slugKey = slugKey - - self.canReturn = canReturn - - self.brandId = brandId - - self.l2Category = l2Category - - self.name = name - - self.code = code - - self.canCancel = canCancel - - self.attributes = attributes - - self.l3CategoryName = l3CategoryName - - self.l3Category = l3Category - - self.l1Category = l1Category - - self.image = image - - self.brand = brand - - self.lastUpdatedAt = lastUpdatedAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - size = try container.decode(String.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slugKey = try container.decode(String.self, forKey: .slugKey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - canReturn = try container.decode(Bool.self, forKey: .canReturn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandId = try container.decode(Int.self, forKey: .brandId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - l2Category = try container.decode([String].self, forKey: .l2Category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - canCancel = try container.decode(Bool.self, forKey: .canCancel) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attributes = try container.decode(BagItemAttributes.self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - l3CategoryName = try container.decode(String.self, forKey: .l3CategoryName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - l3Category = try container.decode(Int.self, forKey: .l3Category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - l1Category = try container.decode([String].self, forKey: .l1Category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - image = try container.decode([String].self, forKey: .image) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brand = try container.decode(String.self, forKey: .brand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastUpdatedAt = try container.decode(String.self, forKey: .lastUpdatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(slugKey, forKey: .slugKey) - - - - try? container.encodeIfPresent(canReturn, forKey: .canReturn) - - - - try? container.encodeIfPresent(brandId, forKey: .brandId) - - - - try? container.encodeIfPresent(l2Category, forKey: .l2Category) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(canCancel, forKey: .canCancel) - - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - - try? container.encodeIfPresent(l3CategoryName, forKey: .l3CategoryName) - - - - try? container.encodeIfPresent(l3Category, forKey: .l3Category) - - - - try? container.encodeIfPresent(l1Category, forKey: .l1Category) - - - - try? container.encodeIfPresent(image, forKey: .image) - - - - try? container.encodeIfPresent(brand, forKey: .brand) - - - - try? container.encodeIfPresent(lastUpdatedAt, forKey: .lastUpdatedAt) - - - } - - } - - /* - Model: BagItemAttributes - Used By: Order - */ - - class BagItemAttributes: Codable { - - - public var itemCode: String? - - public var brandName: String? - - public var countryOfOrigin: String? - - - public enum CodingKeys: String, CodingKey { - - case itemCode = "item_code" - - case brandName = "brand_name" - - case countryOfOrigin = "country_of_origin" - - } - - public init(brandName: String?, countryOfOrigin: String?, itemCode: String?) { - - self.itemCode = itemCode - - self.brandName = brandName - - self.countryOfOrigin = countryOfOrigin - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - itemCode = try container.decode(String.self, forKey: .itemCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandName = try container.decode(String.self, forKey: .brandName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryOfOrigin = try container.decode(String.self, forKey: .countryOfOrigin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(itemCode, forKey: .itemCode) - - - - try? container.encodeIfPresent(brandName, forKey: .brandName) - - - - try? container.encodeIfPresent(countryOfOrigin, forKey: .countryOfOrigin) - - - } - - } - - /* - Model: ShipmentPrices - Used By: Order - */ - - class ShipmentPrices: Codable { - - - public var refundAmount: Double? - - public var cashbackApplied: Double? - - public var transferPrice: Double? - - public var couponValue: Double? - - public var amountPaid: Double? - - public var deliveryCharge: Double? - - public var couponEffectiveDiscount: Double? - - public var codCharges: Double? - - public var refundCredit: Double? - - public var addedToFyndCash: Bool? - - public var gstTaxPercentage: Double? - - public var priceMarked: Double? - - public var priceEffective: Double? - - public var discount: Double? - - public var promotionEffectiveDiscount: Double? - - public var amountPaidRoundoff: Double? - - public var fyndCredits: Double? - - public var brandCalculatedAmount: Double? - - public var cashback: Double? - - public var valueOfGood: Double? - - - public enum CodingKeys: String, CodingKey { - - case refundAmount = "refund_amount" - - case cashbackApplied = "cashback_applied" - - case transferPrice = "transfer_price" - - case couponValue = "coupon_value" - - case amountPaid = "amount_paid" - - case deliveryCharge = "delivery_charge" - - case couponEffectiveDiscount = "coupon_effective_discount" - - case codCharges = "cod_charges" - - case refundCredit = "refund_credit" - - case addedToFyndCash = "added_to_fynd_cash" - - case gstTaxPercentage = "gst_tax_percentage" - - case priceMarked = "price_marked" - - case priceEffective = "price_effective" - - case discount = "discount" - - case promotionEffectiveDiscount = "promotion_effective_discount" - - case amountPaidRoundoff = "amount_paid_roundoff" - - case fyndCredits = "fynd_credits" - - case brandCalculatedAmount = "brand_calculated_amount" - - case cashback = "cashback" - - case valueOfGood = "value_of_good" - - } - - public init(addedToFyndCash: Bool?, amountPaid: Double?, amountPaidRoundoff: Double?, brandCalculatedAmount: Double?, cashback: Double?, cashbackApplied: Double?, codCharges: Double?, couponEffectiveDiscount: Double?, couponValue: Double?, deliveryCharge: Double?, discount: Double?, fyndCredits: Double?, gstTaxPercentage: Double?, priceEffective: Double?, priceMarked: Double?, promotionEffectiveDiscount: Double?, refundAmount: Double?, refundCredit: Double?, transferPrice: Double?, valueOfGood: Double?) { - - self.refundAmount = refundAmount - - self.cashbackApplied = cashbackApplied - - self.transferPrice = transferPrice - - self.couponValue = couponValue - - self.amountPaid = amountPaid - - self.deliveryCharge = deliveryCharge - - self.couponEffectiveDiscount = couponEffectiveDiscount - - self.codCharges = codCharges - - self.refundCredit = refundCredit - - self.addedToFyndCash = addedToFyndCash - - self.gstTaxPercentage = gstTaxPercentage - - self.priceMarked = priceMarked - - self.priceEffective = priceEffective - - self.discount = discount - - self.promotionEffectiveDiscount = promotionEffectiveDiscount - - self.amountPaidRoundoff = amountPaidRoundoff - - self.fyndCredits = fyndCredits - - self.brandCalculatedAmount = brandCalculatedAmount - - self.cashback = cashback - - self.valueOfGood = valueOfGood - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - refundAmount = try container.decode(Double.self, forKey: .refundAmount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cashbackApplied = try container.decode(Double.self, forKey: .cashbackApplied) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - transferPrice = try container.decode(Double.self, forKey: .transferPrice) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - couponValue = try container.decode(Double.self, forKey: .couponValue) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - amountPaid = try container.decode(Double.self, forKey: .amountPaid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryCharge = try container.decode(Double.self, forKey: .deliveryCharge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - couponEffectiveDiscount = try container.decode(Double.self, forKey: .couponEffectiveDiscount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - codCharges = try container.decode(Double.self, forKey: .codCharges) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refundCredit = try container.decode(Double.self, forKey: .refundCredit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addedToFyndCash = try container.decode(Bool.self, forKey: .addedToFyndCash) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstTaxPercentage = try container.decode(Double.self, forKey: .gstTaxPercentage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priceMarked = try container.decode(Double.self, forKey: .priceMarked) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priceEffective = try container.decode(Double.self, forKey: .priceEffective) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discount = try container.decode(Double.self, forKey: .discount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - promotionEffectiveDiscount = try container.decode(Double.self, forKey: .promotionEffectiveDiscount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - amountPaidRoundoff = try container.decode(Double.self, forKey: .amountPaidRoundoff) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fyndCredits = try container.decode(Double.self, forKey: .fyndCredits) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandCalculatedAmount = try container.decode(Double.self, forKey: .brandCalculatedAmount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cashback = try container.decode(Double.self, forKey: .cashback) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - valueOfGood = try container.decode(Double.self, forKey: .valueOfGood) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(refundAmount, forKey: .refundAmount) - - - - try? container.encodeIfPresent(cashbackApplied, forKey: .cashbackApplied) - - - - try? container.encodeIfPresent(transferPrice, forKey: .transferPrice) - - - - try? container.encodeIfPresent(couponValue, forKey: .couponValue) - - - - try? container.encodeIfPresent(amountPaid, forKey: .amountPaid) - - - - try? container.encodeIfPresent(deliveryCharge, forKey: .deliveryCharge) - - - - try? container.encodeIfPresent(couponEffectiveDiscount, forKey: .couponEffectiveDiscount) - - - - try? container.encodeIfPresent(codCharges, forKey: .codCharges) - - - - try? container.encodeIfPresent(refundCredit, forKey: .refundCredit) - - - - try? container.encodeIfPresent(addedToFyndCash, forKey: .addedToFyndCash) - - - - try? container.encodeIfPresent(gstTaxPercentage, forKey: .gstTaxPercentage) - - - - try? container.encodeIfPresent(priceMarked, forKey: .priceMarked) - - - - try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - - try? container.encodeIfPresent(promotionEffectiveDiscount, forKey: .promotionEffectiveDiscount) - - - - try? container.encodeIfPresent(amountPaidRoundoff, forKey: .amountPaidRoundoff) - - - - try? container.encodeIfPresent(fyndCredits, forKey: .fyndCredits) - - - - try? container.encodeIfPresent(brandCalculatedAmount, forKey: .brandCalculatedAmount) - - - - try? container.encodeIfPresent(cashback, forKey: .cashback) - - - - try? container.encodeIfPresent(valueOfGood, forKey: .valueOfGood) - - - } - - } - - /* - Model: Payments - Used By: Order - */ - - class Payments: Codable { - - - public var isActive: Bool? - - public var displayName: String? - - public var logo: String? - - public var source: String? - - public var sourceNickname: String? - - public var displayPriority: Int? - - public var id: Int? - - public var mode: String? - - public var paymentIdentifier: String? - - - public enum CodingKeys: String, CodingKey { - - case isActive = "is_active" - - case displayName = "display_name" - - case logo = "logo" - - case source = "source" - - case sourceNickname = "source_nickname" - - case displayPriority = "display_priority" - - case id = "id" - - case mode = "mode" - - case paymentIdentifier = "payment_identifier" - - } - - public init(displayName: String?, displayPriority: Int?, id: Int?, isActive: Bool?, logo: String?, mode: String?, paymentIdentifier: String?, source: String?, sourceNickname: String?) { - - self.isActive = isActive - - self.displayName = displayName - - self.logo = logo - - self.source = source - - self.sourceNickname = sourceNickname - - self.displayPriority = displayPriority - - self.id = id - - self.mode = mode - - self.paymentIdentifier = paymentIdentifier - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - source = try container.decode(String.self, forKey: .source) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sourceNickname = try container.decode(String.self, forKey: .sourceNickname) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayPriority = try container.decode(Int.self, forKey: .displayPriority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mode = try container.decode(String.self, forKey: .mode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentIdentifier = try container.decode(String.self, forKey: .paymentIdentifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(source, forKey: .source) - - - - try? container.encodeIfPresent(sourceNickname, forKey: .sourceNickname) - - - - try? container.encodeIfPresent(displayPriority, forKey: .displayPriority) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(mode, forKey: .mode) - - - - try? container.encodeIfPresent(paymentIdentifier, forKey: .paymentIdentifier) - - - } - - } - - /* - Model: Filters - Used By: Order - */ - - class Filters: Codable { - - - public var stage: Stage? - - public var stages: Stages? - - - public enum CodingKeys: String, CodingKey { - - case stage = "stage" - - case stages = "stages" - - } - - public init(stage: Stage?, stages: Stages?) { - - self.stage = stage - - self.stages = stages - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - stage = try container.decode(Stage.self, forKey: .stage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stages = try container.decode(Stages.self, forKey: .stages) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(stage, forKey: .stage) - - - - try? container.encodeIfPresent(stages, forKey: .stages) - - - } - - } - - /* - Model: Stage - Used By: Order - */ - - class Stage: Codable { - - - public var text: String? - - public var value: String? - - public var isDefault: Bool? - - public var filters: StagesFilters? - - - public enum CodingKeys: String, CodingKey { - - case text = "text" - - case value = "value" - - case isDefault = "is_default" - - case filters = "filters" - - } - - public init(filters: StagesFilters?, isDefault: Bool?, text: String?, value: String?) { - - self.text = text - - self.value = value - - self.isDefault = isDefault - - self.filters = filters - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - text = try container.decode(String.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isDefault = try container.decode(Bool.self, forKey: .isDefault) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - filters = try container.decode(StagesFilters.self, forKey: .filters) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(isDefault, forKey: .isDefault) - - - - try? container.encodeIfPresent(filters, forKey: .filters) - - - } - - } - - /* - Model: StagesFilters - Used By: Order - */ - - class StagesFilters: Codable { - - - public var text: String? - - public var value: String? - - public var type: String? - - public var options: Options? - - - public enum CodingKeys: String, CodingKey { - - case text = "text" - - case value = "value" - - case type = "type" - - case options = "options" - - } - - public init(options: Options?, text: String?, type: String?, value: String?) { - - self.text = text - - self.value = value - - self.type = type - - self.options = options - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - text = try container.decode(String.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - options = try container.decode(Options.self, forKey: .options) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(options, forKey: .options) - - - } - - } - - /* - Model: Options - Used By: Order - */ - - class Options: Codable { - - - public var text: String? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case text = "text" - - case value = "value" - - } - - public init(text: String?, value: String?) { - - self.text = text - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - text = try container.decode(String.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: PlatformOrderPage - Used By: Order - */ - - class PlatformOrderPage: Codable { - - - public var next: String? - - public var previous: String? - - public var type: String? - - public var size: Int? - - public var current: Int? - - public var hasNext: Bool? - - public var total: Int? - - public var itemTotal: ItemTotal? - - - public enum CodingKeys: String, CodingKey { - - case next = "next" - - case previous = "previous" - - case type = "type" - - case size = "size" - - case current = "current" - - case hasNext = "has_next" - - case total = "total" - - case itemTotal = "item_total" - - } - - public init(current: Int?, hasNext: Bool?, itemTotal: ItemTotal?, next: String?, previous: String?, size: Int?, total: Int?, type: String?) { - - self.next = next - - self.previous = previous - - self.type = type - - self.size = size - - self.current = current - - self.hasNext = hasNext - - self.total = total - - self.itemTotal = itemTotal - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - next = try container.decode(String.self, forKey: .next) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - previous = try container.decode(String.self, forKey: .previous) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - size = try container.decode(Int.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - current = try container.decode(Int.self, forKey: .current) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasNext = try container.decode(Bool.self, forKey: .hasNext) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - total = try container.decode(Int.self, forKey: .total) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemTotal = try container.decode(ItemTotal.self, forKey: .itemTotal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(next, forKey: .next) - - - - try? container.encodeIfPresent(previous, forKey: .previous) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(current, forKey: .current) - - - - try? container.encodeIfPresent(hasNext, forKey: .hasNext) - - - - try? container.encodeIfPresent(total, forKey: .total) - - - - try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) - - - } - - } - - /* - Model: AppliedFilters - Used By: Order - */ - - class AppliedFilters: Codable { - - - public var stage: String? - - public var stores: [String]? - - public var fromDate: String? - - public var toDate: String? - - - public enum CodingKeys: String, CodingKey { - - case stage = "stage" - - case stores = "stores" - - case fromDate = "from_date" - - case toDate = "to_date" - - } - - public init(fromDate: String?, stage: String?, stores: [String]?, toDate: String?) { - - self.stage = stage - - self.stores = stores - - self.fromDate = fromDate - - self.toDate = toDate - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - stage = try container.decode(String.self, forKey: .stage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stores = try container.decode([String].self, forKey: .stores) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fromDate = try container.decode(String.self, forKey: .fromDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - toDate = try container.decode(String.self, forKey: .toDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(stage, forKey: .stage) - - - - try? container.encodeIfPresent(stores, forKey: .stores) - - - - try? container.encodeIfPresent(fromDate, forKey: .fromDate) - - - - try? container.encodeIfPresent(toDate, forKey: .toDate) - - - } - - } - - /* - Model: OrderDetails - Used By: Order - */ - - class OrderDetails: Codable { - - - public var items: [OrderPicklistListing] - - public var page: PlatformOrderPage - - public var filters: Filters - - public var nextOrderStatus: [String: Any] - - public var appliedFilters: AppliedFilters - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - case filters = "filters" - - case nextOrderStatus = "next_order_status" - - case appliedFilters = "applied_filters" - - } - - public init(appliedFilters: AppliedFilters, filters: Filters, items: [OrderPicklistListing], nextOrderStatus: [String: Any], page: PlatformOrderPage) { - - self.items = items - - self.page = page - - self.filters = filters - - self.nextOrderStatus = nextOrderStatus - - self.appliedFilters = appliedFilters - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - items = try container.decode([OrderPicklistListing].self, forKey: .items) - - - - - page = try container.decode(PlatformOrderPage.self, forKey: .page) - - - - - filters = try container.decode(Filters.self, forKey: .filters) - - - - - nextOrderStatus = try container.decode([String: Any].self, forKey: .nextOrderStatus) - - - - - appliedFilters = try container.decode(AppliedFilters.self, forKey: .appliedFilters) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(filters, forKey: .filters) - - - - try? container.encodeIfPresent(nextOrderStatus, forKey: .nextOrderStatus) - - - - try? container.encodeIfPresent(appliedFilters, forKey: .appliedFilters) - - - } - - } - - /* - Model: OrderDetailsItem - Used By: Order - */ - - class OrderDetailsItem: Codable { - - - public var user: PlatformOrderUserInfo? - - public var deliveryAddress: PlatformDeliveryAddress? - - public var channel: Channel? - - public var fyndstoreEmp: [String: Any]? - - public var orderingStore: [String: Any]? - - public var breakupValues: PlatformBreakupValues? - - public var id: String? - - public var application: PlatformApplication? - - public var shipments: PlatformShipmentDetails? - - public var createdAt: String? - - public var totalShipmentsInOrder: Int? - - public var payments: ItemsPayments? - - - public enum CodingKeys: String, CodingKey { - - case user = "user" - - case deliveryAddress = "delivery_address" - - case channel = "channel" - - case fyndstoreEmp = "fyndstore_emp" - - case orderingStore = "ordering_store" - - case breakupValues = "breakup_values" - - case id = "id" - - case application = "application" - - case shipments = "shipments" - - case createdAt = "created_at" - - case totalShipmentsInOrder = "total_shipments_in_order" - - case payments = "payments" - - } - - public init(application: PlatformApplication?, breakupValues: PlatformBreakupValues?, channel: Channel?, createdAt: String?, deliveryAddress: PlatformDeliveryAddress?, fyndstoreEmp: [String: Any]?, id: String?, orderingStore: [String: Any]?, payments: ItemsPayments?, shipments: PlatformShipmentDetails?, totalShipmentsInOrder: Int?, user: PlatformOrderUserInfo?) { - - self.user = user - - self.deliveryAddress = deliveryAddress - - self.channel = channel - - self.fyndstoreEmp = fyndstoreEmp - - self.orderingStore = orderingStore - - self.breakupValues = breakupValues - - self.id = id - - self.application = application - - self.shipments = shipments - - self.createdAt = createdAt - - self.totalShipmentsInOrder = totalShipmentsInOrder - - self.payments = payments - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - user = try container.decode(PlatformOrderUserInfo.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryAddress = try container.decode(PlatformDeliveryAddress.self, forKey: .deliveryAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - channel = try container.decode(Channel.self, forKey: .channel) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fyndstoreEmp = try container.decode([String: Any].self, forKey: .fyndstoreEmp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderingStore = try container.decode([String: Any].self, forKey: .orderingStore) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - breakupValues = try container.decode(PlatformBreakupValues.self, forKey: .breakupValues) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(PlatformApplication.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shipments = try container.decode(PlatformShipmentDetails.self, forKey: .shipments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalShipmentsInOrder = try container.decode(Int.self, forKey: .totalShipmentsInOrder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - payments = try container.decode(ItemsPayments.self, forKey: .payments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(deliveryAddress, forKey: .deliveryAddress) - - - - try? container.encodeIfPresent(channel, forKey: .channel) - - - - try? container.encodeIfPresent(fyndstoreEmp, forKey: .fyndstoreEmp) - - - - try? container.encodeIfPresent(orderingStore, forKey: .orderingStore) - - - - try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(shipments, forKey: .shipments) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(totalShipmentsInOrder, forKey: .totalShipmentsInOrder) - - - - try? container.encodeIfPresent(payments, forKey: .payments) - - - } - - } - - /* - Model: PlatformBreakupValues - Used By: Order - */ - - class PlatformBreakupValues: Codable { - - - public var display: String? - - public var value: Double? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case value = "value" - - case name = "name" - - } - - public init(display: String?, name: String?, value: Double?) { - - self.display = display - - self.value = value - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(Double.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: ArticleAssignment - Used By: Order - */ - - class ArticleAssignment: Codable { - - - public var strategy: String? - - public var level: String? - - - public enum CodingKeys: String, CodingKey { - - case strategy = "strategy" - - case level = "level" - - } - - public init(level: String?, strategy: String?) { - - self.strategy = strategy - - self.level = level - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - strategy = try container.decode(String.self, forKey: .strategy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - level = try container.decode(String.self, forKey: .level) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(strategy, forKey: .strategy) - - - - try? container.encodeIfPresent(level, forKey: .level) - - - } - - } - - /* - Model: PlatformShipmentDetails - Used By: Order - */ - - class PlatformShipmentDetails: Codable { - - - public var status: PlatformShipmentDetailsStatus? - - public var bags: BagsDetails? - - public var prices: ShipmentPrices? - - public var breakupValues: ShipmentBreakupValues? - - public var id: String? - - public var dpDetails: DpDetails? - - public var invoice: ShipmentInvoice? - - public var fulfillingStore: PlatformFulfillingStore? - - public var payments: Payments? - - public var gst: ShipmentGst? - - public var company: Company? - - public var brand: PlatformShipmentDetailsBrand? - - public var coupon: [String: Any]? - - public var orderSource: String? - - public var isNotFyndSource: Bool? - - public var comment: String? - - public var promise: Promise? - - public var trackingDetails: ShipmentTrackingDetails? - - public var isFyndCoupon: Bool? - - public var orderType: String? - - public var totalShipmentBags: Int? - - public var pod: [String: Any]? - - public var lockStatus: Bool? - - public var orderingChannel: String? - - - public enum CodingKeys: String, CodingKey { - - case status = "status" - - case bags = "bags" - - case prices = "prices" - - case breakupValues = "breakup_values" - - case id = "id" - - case dpDetails = "dp_details" - - case invoice = "invoice" - - case fulfillingStore = "fulfilling_store" - - case payments = "payments" - - case gst = "gst" - - case company = "company" - - case brand = "brand" - - case coupon = "coupon" - - case orderSource = "order_source" - - case isNotFyndSource = "is_not_fynd_source" - - case comment = "comment" - - case promise = "promise" - - case trackingDetails = "tracking_details" - - case isFyndCoupon = "is_fynd_coupon" - - case orderType = "order_type" - - case totalShipmentBags = "total_shipment_bags" - - case pod = "pod" - - case lockStatus = "lock_status" - - case orderingChannel = "ordering_channel" - - } - - public init(bags: BagsDetails?, brand: PlatformShipmentDetailsBrand?, breakupValues: ShipmentBreakupValues?, comment: String?, company: Company?, coupon: [String: Any]?, dpDetails: DpDetails?, fulfillingStore: PlatformFulfillingStore?, gst: ShipmentGst?, id: String?, invoice: ShipmentInvoice?, isFyndCoupon: Bool?, isNotFyndSource: Bool?, lockStatus: Bool?, orderingChannel: String?, orderSource: String?, orderType: String?, payments: Payments?, pod: [String: Any]?, prices: ShipmentPrices?, promise: Promise?, status: PlatformShipmentDetailsStatus?, totalShipmentBags: Int?, trackingDetails: ShipmentTrackingDetails?) { - - self.status = status - - self.bags = bags - - self.prices = prices - - self.breakupValues = breakupValues - - self.id = id - - self.dpDetails = dpDetails - - self.invoice = invoice - - self.fulfillingStore = fulfillingStore - - self.payments = payments - - self.gst = gst - - self.company = company - - self.brand = brand - - self.coupon = coupon - - self.orderSource = orderSource - - self.isNotFyndSource = isNotFyndSource - - self.comment = comment - - self.promise = promise - - self.trackingDetails = trackingDetails - - self.isFyndCoupon = isFyndCoupon - - self.orderType = orderType - - self.totalShipmentBags = totalShipmentBags - - self.pod = pod - - self.lockStatus = lockStatus - - self.orderingChannel = orderingChannel - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - status = try container.decode(PlatformShipmentDetailsStatus.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bags = try container.decode(BagsDetails.self, forKey: .bags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - prices = try container.decode(ShipmentPrices.self, forKey: .prices) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - breakupValues = try container.decode(ShipmentBreakupValues.self, forKey: .breakupValues) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dpDetails = try container.decode(DpDetails.self, forKey: .dpDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - invoice = try container.decode(ShipmentInvoice.self, forKey: .invoice) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fulfillingStore = try container.decode(PlatformFulfillingStore.self, forKey: .fulfillingStore) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - payments = try container.decode(Payments.self, forKey: .payments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gst = try container.decode(ShipmentGst.self, forKey: .gst) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - company = try container.decode(Company.self, forKey: .company) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brand = try container.decode(PlatformShipmentDetailsBrand.self, forKey: .brand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - coupon = try container.decode([String: Any].self, forKey: .coupon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderSource = try container.decode(String.self, forKey: .orderSource) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isNotFyndSource = try container.decode(Bool.self, forKey: .isNotFyndSource) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - comment = try container.decode(String.self, forKey: .comment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - promise = try container.decode(Promise.self, forKey: .promise) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - trackingDetails = try container.decode(ShipmentTrackingDetails.self, forKey: .trackingDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isFyndCoupon = try container.decode(Bool.self, forKey: .isFyndCoupon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderType = try container.decode(String.self, forKey: .orderType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalShipmentBags = try container.decode(Int.self, forKey: .totalShipmentBags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pod = try container.decode([String: Any].self, forKey: .pod) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lockStatus = try container.decode(Bool.self, forKey: .lockStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderingChannel = try container.decode(String.self, forKey: .orderingChannel) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(bags, forKey: .bags) - - - - try? container.encodeIfPresent(prices, forKey: .prices) - - - - try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(dpDetails, forKey: .dpDetails) - - - - try? container.encodeIfPresent(invoice, forKey: .invoice) - - - - try? container.encodeIfPresent(fulfillingStore, forKey: .fulfillingStore) - - - - try? container.encodeIfPresent(payments, forKey: .payments) - - - - try? container.encodeIfPresent(gst, forKey: .gst) - - - - try? container.encodeIfPresent(company, forKey: .company) - - - - try? container.encodeIfPresent(brand, forKey: .brand) - - - - try? container.encodeIfPresent(coupon, forKey: .coupon) - - - - try? container.encodeIfPresent(orderSource, forKey: .orderSource) - - - - try? container.encodeIfPresent(isNotFyndSource, forKey: .isNotFyndSource) - - - - try? container.encodeIfPresent(comment, forKey: .comment) - - - - try? container.encodeIfPresent(promise, forKey: .promise) - - - - try? container.encodeIfPresent(trackingDetails, forKey: .trackingDetails) - - - - try? container.encodeIfPresent(isFyndCoupon, forKey: .isFyndCoupon) - - - - try? container.encodeIfPresent(orderType, forKey: .orderType) - - - - try? container.encodeIfPresent(totalShipmentBags, forKey: .totalShipmentBags) - - - - try? container.encodeIfPresent(pod, forKey: .pod) - - - - try? container.encodeIfPresent(lockStatus, forKey: .lockStatus) - - - - try? container.encodeIfPresent(orderingChannel, forKey: .orderingChannel) - - - } - - } - - /* - Model: PlatformShipmentDetailsStatus - Used By: Order - */ - - class PlatformShipmentDetailsStatus: Codable { - - - public var id: Int? - - public var bagList: [Int]? - - public var createdAt: String? - - public var status: String? - - public var name: String? - - public var progress: Int? - - public var shipmentId: String? - - public var currentShipmentStatus: String? - - public var colorCode: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case bagList = "bag_list" - - case createdAt = "created_at" - - case status = "status" - - case name = "name" - - case progress = "progress" - - case shipmentId = "shipment_id" - - case currentShipmentStatus = "current_shipment_status" - - case colorCode = "color_code" - - } - - public init(bagList: [Int]?, colorCode: String?, createdAt: String?, currentShipmentStatus: String?, id: Int?, name: String?, progress: Int?, shipmentId: String?, status: String?) { - - self.id = id - - self.bagList = bagList - - self.createdAt = createdAt - - self.status = status - - self.name = name - - self.progress = progress - - self.shipmentId = shipmentId - - self.currentShipmentStatus = currentShipmentStatus - - self.colorCode = colorCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bagList = try container.decode([Int].self, forKey: .bagList) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - progress = try container.decode(Int.self, forKey: .progress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shipmentId = try container.decode(String.self, forKey: .shipmentId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currentShipmentStatus = try container.decode(String.self, forKey: .currentShipmentStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - colorCode = try container.decode(String.self, forKey: .colorCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(bagList, forKey: .bagList) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(progress, forKey: .progress) - - - - try? container.encodeIfPresent(shipmentId, forKey: .shipmentId) - - - - try? container.encodeIfPresent(currentShipmentStatus, forKey: .currentShipmentStatus) - - - - try? container.encodeIfPresent(colorCode, forKey: .colorCode) - - - } - - } - - /* - Model: BagsDetails - Used By: Order - */ - - class BagsDetails: Codable { - - - public var financialBreakup: [BagFinancialBreakup]? - - public var status: BagCurrStatus? - - public var item: BagItem? - - public var article: BagArticle? - - public var id: Int? - - public var prices: BagPrices? - - public var gstDetails: GstDetails? - - public var breakupValues: BagBreakupValues? - - public var updateTime: Int? - - public var currentStatus: BagCurrentStatus? - - public var bagStatus: BagStatus? - - - public enum CodingKeys: String, CodingKey { - - case financialBreakup = "financial_breakup" - - case status = "status" - - case item = "item" - - case article = "article" - - case id = "id" - - case prices = "prices" - - case gstDetails = "gst_details" - - case breakupValues = "breakup_values" - - case updateTime = "update_time" - - case currentStatus = "current_status" - - case bagStatus = "bag_status" - - } - - public init(article: BagArticle?, bagStatus: BagStatus?, breakupValues: BagBreakupValues?, currentStatus: BagCurrentStatus?, financialBreakup: [BagFinancialBreakup]?, gstDetails: GstDetails?, id: Int?, item: BagItem?, prices: BagPrices?, status: BagCurrStatus?, updateTime: Int?) { - - self.financialBreakup = financialBreakup - - self.status = status - - self.item = item - - self.article = article - - self.id = id - - self.prices = prices - - self.gstDetails = gstDetails - - self.breakupValues = breakupValues - - self.updateTime = updateTime - - self.currentStatus = currentStatus - - self.bagStatus = bagStatus - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - financialBreakup = try container.decode([BagFinancialBreakup].self, forKey: .financialBreakup) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(BagCurrStatus.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - item = try container.decode(BagItem.self, forKey: .item) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - article = try container.decode(BagArticle.self, forKey: .article) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - prices = try container.decode(BagPrices.self, forKey: .prices) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstDetails = try container.decode(GstDetails.self, forKey: .gstDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - breakupValues = try container.decode(BagBreakupValues.self, forKey: .breakupValues) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updateTime = try container.decode(Int.self, forKey: .updateTime) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currentStatus = try container.decode(BagCurrentStatus.self, forKey: .currentStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bagStatus = try container.decode(BagStatus.self, forKey: .bagStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(financialBreakup, forKey: .financialBreakup) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(item, forKey: .item) - - - - try? container.encodeIfPresent(article, forKey: .article) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(prices, forKey: .prices) - - - - try? container.encodeIfPresent(gstDetails, forKey: .gstDetails) - - - - try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) - - - - try? container.encodeIfPresent(updateTime, forKey: .updateTime) - - - - try? container.encodeIfPresent(currentStatus, forKey: .currentStatus) - - - - try? container.encodeIfPresent(bagStatus, forKey: .bagStatus) - - - } - - } - - /* - Model: BagFinancialBreakup - Used By: Order - */ - - class BagFinancialBreakup: Codable { - - - public var valueOfGood: Double? - - public var hsnCode: String? - - public var priceEffective: Double? - - public var codCharges: Double? - - public var gstFee: String? - - public var fyndCredits: Double? - - public var refundAmount: Double? - - public var cashbackApplied: Double? - - public var transferPrice: Double? - - public var amountPaidRoundoff: Double? - - public var couponValue: Double? - - public var amountPaid: Double? - - public var gstTaxPercentage: Double? - - public var size: String? - - public var totalUnits: Int? - - public var discount: Double? - - public var couponEffectiveDiscount: Double? - - public var cashback: Double? - - public var promotionEffectiveDiscount: Double? - - public var gstTag: String? - - public var deliveryCharge: Double? - - public var refundCredit: Double? - - public var priceMarked: Double? - - public var identifiers: Identifiers? - - public var itemName: String? - - public var addedToFyndCash: Bool? - - public var brandCalculatedAmount: Double? - - - public enum CodingKeys: String, CodingKey { - - case valueOfGood = "value_of_good" - - case hsnCode = "hsn_code" - - case priceEffective = "price_effective" - - case codCharges = "cod_charges" - - case gstFee = "gst_fee" - - case fyndCredits = "fynd_credits" - - case refundAmount = "refund_amount" - - case cashbackApplied = "cashback_applied" - - case transferPrice = "transfer_price" - - case amountPaidRoundoff = "amount_paid_roundoff" - - case couponValue = "coupon_value" - - case amountPaid = "amount_paid" - - case gstTaxPercentage = "gst_tax_percentage" - - case size = "size" - - case totalUnits = "total_units" - - case discount = "discount" - - case couponEffectiveDiscount = "coupon_effective_discount" - - case cashback = "cashback" - - case promotionEffectiveDiscount = "promotion_effective_discount" - - case gstTag = "gst_tag" - - case deliveryCharge = "delivery_charge" - - case refundCredit = "refund_credit" - - case priceMarked = "price_marked" - - case identifiers = "identifiers" - - case itemName = "item_name" - - case addedToFyndCash = "added_to_fynd_cash" - - case brandCalculatedAmount = "brand_calculated_amount" - - } - - public init(addedToFyndCash: Bool?, amountPaid: Double?, amountPaidRoundoff: Double?, brandCalculatedAmount: Double?, cashback: Double?, cashbackApplied: Double?, codCharges: Double?, couponEffectiveDiscount: Double?, couponValue: Double?, deliveryCharge: Double?, discount: Double?, fyndCredits: Double?, gstFee: String?, gstTag: String?, gstTaxPercentage: Double?, hsnCode: String?, identifiers: Identifiers?, itemName: String?, priceEffective: Double?, priceMarked: Double?, promotionEffectiveDiscount: Double?, refundAmount: Double?, refundCredit: Double?, size: String?, totalUnits: Int?, transferPrice: Double?, valueOfGood: Double?) { - - self.valueOfGood = valueOfGood - - self.hsnCode = hsnCode - - self.priceEffective = priceEffective - - self.codCharges = codCharges - - self.gstFee = gstFee - - self.fyndCredits = fyndCredits - - self.refundAmount = refundAmount - - self.cashbackApplied = cashbackApplied - - self.transferPrice = transferPrice - - self.amountPaidRoundoff = amountPaidRoundoff - - self.couponValue = couponValue - - self.amountPaid = amountPaid - - self.gstTaxPercentage = gstTaxPercentage - - self.size = size - - self.totalUnits = totalUnits - - self.discount = discount - - self.couponEffectiveDiscount = couponEffectiveDiscount - - self.cashback = cashback - - self.promotionEffectiveDiscount = promotionEffectiveDiscount - - self.gstTag = gstTag - - self.deliveryCharge = deliveryCharge - - self.refundCredit = refundCredit - - self.priceMarked = priceMarked - - self.identifiers = identifiers - - self.itemName = itemName - - self.addedToFyndCash = addedToFyndCash - - self.brandCalculatedAmount = brandCalculatedAmount - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - valueOfGood = try container.decode(Double.self, forKey: .valueOfGood) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hsnCode = try container.decode(String.self, forKey: .hsnCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priceEffective = try container.decode(Double.self, forKey: .priceEffective) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - codCharges = try container.decode(Double.self, forKey: .codCharges) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstFee = try container.decode(String.self, forKey: .gstFee) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fyndCredits = try container.decode(Double.self, forKey: .fyndCredits) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refundAmount = try container.decode(Double.self, forKey: .refundAmount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cashbackApplied = try container.decode(Double.self, forKey: .cashbackApplied) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - transferPrice = try container.decode(Double.self, forKey: .transferPrice) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - amountPaidRoundoff = try container.decode(Double.self, forKey: .amountPaidRoundoff) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - couponValue = try container.decode(Double.self, forKey: .couponValue) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - amountPaid = try container.decode(Double.self, forKey: .amountPaid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstTaxPercentage = try container.decode(Double.self, forKey: .gstTaxPercentage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - size = try container.decode(String.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalUnits = try container.decode(Int.self, forKey: .totalUnits) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discount = try container.decode(Double.self, forKey: .discount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - couponEffectiveDiscount = try container.decode(Double.self, forKey: .couponEffectiveDiscount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cashback = try container.decode(Double.self, forKey: .cashback) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - promotionEffectiveDiscount = try container.decode(Double.self, forKey: .promotionEffectiveDiscount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstTag = try container.decode(String.self, forKey: .gstTag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryCharge = try container.decode(Double.self, forKey: .deliveryCharge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refundCredit = try container.decode(Double.self, forKey: .refundCredit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priceMarked = try container.decode(Double.self, forKey: .priceMarked) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - identifiers = try container.decode(Identifiers.self, forKey: .identifiers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemName = try container.decode(String.self, forKey: .itemName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addedToFyndCash = try container.decode(Bool.self, forKey: .addedToFyndCash) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandCalculatedAmount = try container.decode(Double.self, forKey: .brandCalculatedAmount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(valueOfGood, forKey: .valueOfGood) - - - - try? container.encodeIfPresent(hsnCode, forKey: .hsnCode) - - - - try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) - - - - try? container.encodeIfPresent(codCharges, forKey: .codCharges) - - - - try? container.encodeIfPresent(gstFee, forKey: .gstFee) - - - - try? container.encodeIfPresent(fyndCredits, forKey: .fyndCredits) - - - - try? container.encodeIfPresent(refundAmount, forKey: .refundAmount) - - - - try? container.encodeIfPresent(cashbackApplied, forKey: .cashbackApplied) - - - - try? container.encodeIfPresent(transferPrice, forKey: .transferPrice) - - - - try? container.encodeIfPresent(amountPaidRoundoff, forKey: .amountPaidRoundoff) - - - - try? container.encodeIfPresent(couponValue, forKey: .couponValue) - - - - try? container.encodeIfPresent(amountPaid, forKey: .amountPaid) - - - - try? container.encodeIfPresent(gstTaxPercentage, forKey: .gstTaxPercentage) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(totalUnits, forKey: .totalUnits) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - - try? container.encodeIfPresent(couponEffectiveDiscount, forKey: .couponEffectiveDiscount) - - - - try? container.encodeIfPresent(cashback, forKey: .cashback) - - - - try? container.encodeIfPresent(promotionEffectiveDiscount, forKey: .promotionEffectiveDiscount) - - - - try? container.encodeIfPresent(gstTag, forKey: .gstTag) - - - - try? container.encodeIfPresent(deliveryCharge, forKey: .deliveryCharge) - - - - try? container.encodeIfPresent(refundCredit, forKey: .refundCredit) - - - - try? container.encodeIfPresent(priceMarked, forKey: .priceMarked) - - - - try? container.encodeIfPresent(identifiers, forKey: .identifiers) - - - - try? container.encodeIfPresent(itemName, forKey: .itemName) - - - - try? container.encodeIfPresent(addedToFyndCash, forKey: .addedToFyndCash) - - - - try? container.encodeIfPresent(brandCalculatedAmount, forKey: .brandCalculatedAmount) - - - } - - } - - /* - Model: Identifiers - Used By: Order - */ - - class Identifiers: Codable { - - - public var ean: String? - - - public enum CodingKeys: String, CodingKey { - - case ean = "ean" - - } - - public init(ean: String?) { - - self.ean = ean - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - ean = try container.decode(String.self, forKey: .ean) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(ean, forKey: .ean) - - - } - - } - - /* - Model: BagCurrStatus - Used By: Order - */ - - class BagCurrStatus: Codable { - - - public var enableTracking: Bool? - - public var isCustomerReturnAllowed: Bool? - - public var isActive: Bool? - - public var isReturnable: Bool? - - public var canBeCancelled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case enableTracking = "enable_tracking" - - case isCustomerReturnAllowed = "is_customer_return_allowed" - - case isActive = "is_active" - - case isReturnable = "is_returnable" - - case canBeCancelled = "can_be_cancelled" - - } - - public init(canBeCancelled: Bool?, enableTracking: Bool?, isActive: Bool?, isCustomerReturnAllowed: Bool?, isReturnable: Bool?) { - - self.enableTracking = enableTracking - - self.isCustomerReturnAllowed = isCustomerReturnAllowed - - self.isActive = isActive - - self.isReturnable = isReturnable - - self.canBeCancelled = canBeCancelled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enableTracking = try container.decode(Bool.self, forKey: .enableTracking) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isCustomerReturnAllowed = try container.decode(Bool.self, forKey: .isCustomerReturnAllowed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isReturnable = try container.decode(Bool.self, forKey: .isReturnable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - canBeCancelled = try container.decode(Bool.self, forKey: .canBeCancelled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enableTracking, forKey: .enableTracking) - - - - try? container.encodeIfPresent(isCustomerReturnAllowed, forKey: .isCustomerReturnAllowed) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(isReturnable, forKey: .isReturnable) - - - - try? container.encodeIfPresent(canBeCancelled, forKey: .canBeCancelled) - - - } - - } - - /* - Model: BagArticle - Used By: Order - */ - - class BagArticle: Codable { - - - public var identifiers: ArticleIdentifiers? - - public var espModified: Bool? - - public var isSet: Bool? - - public var size: String? - - public var code: String? - - public var set: Set? - - public var sellerIdentifier: String? - - public var returnConfig: BagArticleReturnConfig? - - public var id: String? - - public var uid: String? - - public var childDetails: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case identifiers = "identifiers" - - case espModified = "esp_modified" - - case isSet = "is_set" - - case size = "size" - - case code = "code" - - case set = "set" - - case sellerIdentifier = "seller_identifier" - - case returnConfig = "return_config" - - case id = "_id" - - case uid = "uid" - - case childDetails = "child_details" - - } - - public init(childDetails: [String: Any]?, code: String?, espModified: Bool?, identifiers: ArticleIdentifiers?, isSet: Bool?, returnConfig: BagArticleReturnConfig?, sellerIdentifier: String?, set: Set?, size: String?, uid: String?, id: String?) { - - self.identifiers = identifiers - - self.espModified = espModified - - self.isSet = isSet - - self.size = size - - self.code = code - - self.set = set - - self.sellerIdentifier = sellerIdentifier - - self.returnConfig = returnConfig - - self.id = id - - self.uid = uid - - self.childDetails = childDetails - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - identifiers = try container.decode(ArticleIdentifiers.self, forKey: .identifiers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - espModified = try container.decode(Bool.self, forKey: .espModified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isSet = try container.decode(Bool.self, forKey: .isSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - size = try container.decode(String.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - set = try container.decode(Set.self, forKey: .set) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sellerIdentifier = try container.decode(String.self, forKey: .sellerIdentifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - returnConfig = try container.decode(BagArticleReturnConfig.self, forKey: .returnConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - childDetails = try container.decode([String: Any].self, forKey: .childDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(identifiers, forKey: .identifiers) - - - - try? container.encodeIfPresent(espModified, forKey: .espModified) - - - - try? container.encodeIfPresent(isSet, forKey: .isSet) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(set, forKey: .set) - - - - try? container.encodeIfPresent(sellerIdentifier, forKey: .sellerIdentifier) - - - - try? container.encodeIfPresent(returnConfig, forKey: .returnConfig) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(childDetails, forKey: .childDetails) - - - } - - } - - /* - Model: ArticleIdentifiers - Used By: Order - */ - - class ArticleIdentifiers: Codable { - - - public var ean: String? - - - public enum CodingKeys: String, CodingKey { - - case ean = "ean" - - } - - public init(ean: String?) { - - self.ean = ean - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - ean = try container.decode(String.self, forKey: .ean) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(ean, forKey: .ean) - - - } - - } - - /* - Model: Set - Used By: Order - */ - - class Set: Codable { - - - public var quantity: Int? - - public var sizeDistribution: SetSizeDistribution? - - - public enum CodingKeys: String, CodingKey { - - case quantity = "quantity" - - case sizeDistribution = "size_distribution" - - } - - public init(quantity: Int?, sizeDistribution: SetSizeDistribution?) { - - self.quantity = quantity - - self.sizeDistribution = sizeDistribution - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sizeDistribution = try container.decode(SetSizeDistribution.self, forKey: .sizeDistribution) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - - try? container.encodeIfPresent(sizeDistribution, forKey: .sizeDistribution) - - - } - - } - - /* - Model: SetSizeDistribution - Used By: Order - */ - - class SetSizeDistribution: Codable { - - - public var sizes: Sizes? - - - public enum CodingKeys: String, CodingKey { - - case sizes = "sizes" - - } - - public init(sizes: Sizes?) { - - self.sizes = sizes - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - sizes = try container.decode(Sizes.self, forKey: .sizes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(sizes, forKey: .sizes) - - - } - - } - - /* - Model: Sizes - Used By: Order - */ - - class Sizes: Codable { - - - public var size: String? - - public var pieces: Int? - - - public enum CodingKeys: String, CodingKey { - - case size = "size" - - case pieces = "pieces" - - } - - public init(pieces: Int?, size: String?) { - - self.size = size - - self.pieces = pieces - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - size = try container.decode(String.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pieces = try container.decode(Int.self, forKey: .pieces) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(pieces, forKey: .pieces) - - - } - - } - - /* - Model: BagArticleReturnConfig - Used By: Order - */ - - class BagArticleReturnConfig: Codable { - - - public var time: Int? - - public var unit: String? - - public var returnable: Bool? - - - public enum CodingKeys: String, CodingKey { - - case time = "time" - - case unit = "unit" - - case returnable = "returnable" - - } - - public init(returnable: Bool?, time: Int?, unit: String?) { - - self.time = time - - self.unit = unit - - self.returnable = returnable - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - time = try container.decode(Int.self, forKey: .time) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - unit = try container.decode(String.self, forKey: .unit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - returnable = try container.decode(Bool.self, forKey: .returnable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(time, forKey: .time) - - - - try? container.encodeIfPresent(unit, forKey: .unit) - - - - try? container.encodeIfPresent(returnable, forKey: .returnable) - - - } - - } - - /* - Model: GstDetails - Used By: Order - */ - - class GstDetails: Codable { - - - public var brandCalculatedAmount: Double? - - public var gstFee: String? - - public var gstTag: String? - - public var hsnCode: String? - - public var valueOfGood: Double? - - public var gstTaxPercentage: Double? - - public var isDefaultHsnCode: Bool? - - - public enum CodingKeys: String, CodingKey { - - case brandCalculatedAmount = "brand_calculated_amount" - - case gstFee = "gst_fee" - - case gstTag = "gst_tag" - - case hsnCode = "hsn_code" - - case valueOfGood = "value_of_good" - - case gstTaxPercentage = "gst_tax_percentage" - - case isDefaultHsnCode = "is_default_hsn_code" - - } - - public init(brandCalculatedAmount: Double?, gstFee: String?, gstTag: String?, gstTaxPercentage: Double?, hsnCode: String?, isDefaultHsnCode: Bool?, valueOfGood: Double?) { - - self.brandCalculatedAmount = brandCalculatedAmount - - self.gstFee = gstFee - - self.gstTag = gstTag - - self.hsnCode = hsnCode - - self.valueOfGood = valueOfGood - - self.gstTaxPercentage = gstTaxPercentage - - self.isDefaultHsnCode = isDefaultHsnCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - brandCalculatedAmount = try container.decode(Double.self, forKey: .brandCalculatedAmount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstFee = try container.decode(String.self, forKey: .gstFee) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstTag = try container.decode(String.self, forKey: .gstTag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hsnCode = try container.decode(String.self, forKey: .hsnCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - valueOfGood = try container.decode(Double.self, forKey: .valueOfGood) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstTaxPercentage = try container.decode(Double.self, forKey: .gstTaxPercentage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isDefaultHsnCode = try container.decode(Bool.self, forKey: .isDefaultHsnCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(brandCalculatedAmount, forKey: .brandCalculatedAmount) - - - - try? container.encodeIfPresent(gstFee, forKey: .gstFee) - - - - try? container.encodeIfPresent(gstTag, forKey: .gstTag) - - - - try? container.encodeIfPresent(hsnCode, forKey: .hsnCode) - - - - try? container.encodeIfPresent(valueOfGood, forKey: .valueOfGood) - - - - try? container.encodeIfPresent(gstTaxPercentage, forKey: .gstTaxPercentage) - - - - try? container.encodeIfPresent(isDefaultHsnCode, forKey: .isDefaultHsnCode) - - - } - - } - - /* - Model: BagBreakupValues - Used By: Order - */ - - class BagBreakupValues: Codable { - - - public var name: String? - - public var display: String? - - public var value: Double? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case display = "display" - - case value = "value" - - } - - public init(display: String?, name: String?, value: Double?) { - - self.name = name - - self.display = display - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(Double.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: BagCurrentStatus - Used By: Order - */ - - class BagCurrentStatus: Codable { - - - public var updatedAt: String? - - public var bagStateMapper: BagStateMapper? - - public var status: String? - - public var stateType: String? - - - public enum CodingKeys: String, CodingKey { - - case updatedAt = "updated_at" - - case bagStateMapper = "bag_state_mapper" - - case status = "status" - - case stateType = "state_type" - - } - - public init(bagStateMapper: BagStateMapper?, stateType: String?, status: String?, updatedAt: String?) { - - self.updatedAt = updatedAt - - self.bagStateMapper = bagStateMapper - - self.status = status - - self.stateType = stateType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bagStateMapper = try container.decode(BagStateMapper.self, forKey: .bagStateMapper) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stateType = try container.decode(String.self, forKey: .stateType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(bagStateMapper, forKey: .bagStateMapper) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(stateType, forKey: .stateType) - - - } - - } - - /* - Model: BagStateMapper - Used By: Order - */ - - class BagStateMapper: Codable { - - - public var appStateName: String? - - public var isActive: Bool? - - public var displayName: String? - - public var name: String? - - public var appDisplayName: String? - - - public enum CodingKeys: String, CodingKey { - - case appStateName = "app_state_name" - - case isActive = "is_active" - - case displayName = "display_name" - - case name = "name" - - case appDisplayName = "app_display_name" - - } - - public init(appDisplayName: String?, appStateName: String?, displayName: String?, isActive: Bool?, name: String?) { - - self.appStateName = appStateName - - self.isActive = isActive - - self.displayName = displayName - - self.name = name - - self.appDisplayName = appDisplayName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - appStateName = try container.decode(String.self, forKey: .appStateName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appDisplayName = try container.decode(String.self, forKey: .appDisplayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(appStateName, forKey: .appStateName) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(appDisplayName, forKey: .appDisplayName) - - - } - - } - - /* - Model: BagStatus - Used By: Order - */ - - class BagStatus: Codable { - - - public var status: String? - - public var stateType: String? - - public var updatedAt: String? - - public var bagStateMapper: BagStatusBagStateMapper? - - - public enum CodingKeys: String, CodingKey { - - case status = "status" - - case stateType = "state_type" - - case updatedAt = "updated_at" - - case bagStateMapper = "bag_state_mapper" - - } - - public init(bagStateMapper: BagStatusBagStateMapper?, stateType: String?, status: String?, updatedAt: String?) { - - self.status = status - - self.stateType = stateType - - self.updatedAt = updatedAt - - self.bagStateMapper = bagStateMapper - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stateType = try container.decode(String.self, forKey: .stateType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bagStateMapper = try container.decode(BagStatusBagStateMapper.self, forKey: .bagStateMapper) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(stateType, forKey: .stateType) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(bagStateMapper, forKey: .bagStateMapper) - - - } - - } - - /* - Model: BagStatusBagStateMapper - Used By: Order - */ - - class BagStatusBagStateMapper: Codable { - - - public var isActive: Bool? - - public var displayName: String? - - public var name: String? - - public var appDisplayName: String? - - public var appStateName: String? - - - public enum CodingKeys: String, CodingKey { - - case isActive = "is_active" - - case displayName = "display_name" - - case name = "name" - - case appDisplayName = "app_display_name" - - case appStateName = "app_state_name" - - } - - public init(appDisplayName: String?, appStateName: String?, displayName: String?, isActive: Bool?, name: String?) { - - self.isActive = isActive - - self.displayName = displayName - - self.name = name - - self.appDisplayName = appDisplayName - - self.appStateName = appStateName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appDisplayName = try container.decode(String.self, forKey: .appDisplayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appStateName = try container.decode(String.self, forKey: .appStateName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(appDisplayName, forKey: .appDisplayName) - - - - try? container.encodeIfPresent(appStateName, forKey: .appStateName) - - - } - - } - - /* - Model: BagPrices - Used By: Order - */ - - class BagPrices: Codable { - - - public var cashback: Double? - - public var refundCredit: Double? - - public var couponValue: Double? - - public var deliveryCharge: Double? - - public var fyndCredits: Double? - - public var priceMarked: Double? - - public var cashbackApplied: Double? - - public var valueOfGood: Double? - - public var amountPaidRoundoff: Double? - - public var amountPaid: Double? - - public var codCharges: Double? - - public var priceEffective: Double? - - public var refundAmount: Double? - - public var discount: Double? - - - public enum CodingKeys: String, CodingKey { - - case cashback = "cashback" - - case refundCredit = "refund_credit" - - case couponValue = "coupon_value" - - case deliveryCharge = "delivery_charge" - - case fyndCredits = "fynd_credits" - - case priceMarked = "price_marked" - - case cashbackApplied = "cashback_applied" - - case valueOfGood = "value_of_good" - - case amountPaidRoundoff = "amount_paid_roundoff" - - case amountPaid = "amount_paid" - - case codCharges = "cod_charges" - - case priceEffective = "price_effective" - - case refundAmount = "refund_amount" - - case discount = "discount" - - } - - public init(amountPaid: Double?, amountPaidRoundoff: Double?, cashback: Double?, cashbackApplied: Double?, codCharges: Double?, couponValue: Double?, deliveryCharge: Double?, discount: Double?, fyndCredits: Double?, priceEffective: Double?, priceMarked: Double?, refundAmount: Double?, refundCredit: Double?, valueOfGood: Double?) { - - self.cashback = cashback - - self.refundCredit = refundCredit - - self.couponValue = couponValue - - self.deliveryCharge = deliveryCharge - - self.fyndCredits = fyndCredits - - self.priceMarked = priceMarked - - self.cashbackApplied = cashbackApplied - - self.valueOfGood = valueOfGood - - self.amountPaidRoundoff = amountPaidRoundoff - - self.amountPaid = amountPaid - - self.codCharges = codCharges - - self.priceEffective = priceEffective - - self.refundAmount = refundAmount - - self.discount = discount - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cashback = try container.decode(Double.self, forKey: .cashback) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refundCredit = try container.decode(Double.self, forKey: .refundCredit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - couponValue = try container.decode(Double.self, forKey: .couponValue) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryCharge = try container.decode(Double.self, forKey: .deliveryCharge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fyndCredits = try container.decode(Double.self, forKey: .fyndCredits) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priceMarked = try container.decode(Double.self, forKey: .priceMarked) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cashbackApplied = try container.decode(Double.self, forKey: .cashbackApplied) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - valueOfGood = try container.decode(Double.self, forKey: .valueOfGood) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - amountPaidRoundoff = try container.decode(Double.self, forKey: .amountPaidRoundoff) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - amountPaid = try container.decode(Double.self, forKey: .amountPaid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - codCharges = try container.decode(Double.self, forKey: .codCharges) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priceEffective = try container.decode(Double.self, forKey: .priceEffective) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - refundAmount = try container.decode(Double.self, forKey: .refundAmount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discount = try container.decode(Double.self, forKey: .discount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cashback, forKey: .cashback) - - - - try? container.encodeIfPresent(refundCredit, forKey: .refundCredit) - - - - try? container.encodeIfPresent(couponValue, forKey: .couponValue) - - - - try? container.encodeIfPresent(deliveryCharge, forKey: .deliveryCharge) - - - - try? container.encodeIfPresent(fyndCredits, forKey: .fyndCredits) - - - - try? container.encodeIfPresent(priceMarked, forKey: .priceMarked) - - - - try? container.encodeIfPresent(cashbackApplied, forKey: .cashbackApplied) - - - - try? container.encodeIfPresent(valueOfGood, forKey: .valueOfGood) - - - - try? container.encodeIfPresent(amountPaidRoundoff, forKey: .amountPaidRoundoff) - - - - try? container.encodeIfPresent(amountPaid, forKey: .amountPaid) - - - - try? container.encodeIfPresent(codCharges, forKey: .codCharges) - - - - try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) - - - - try? container.encodeIfPresent(refundAmount, forKey: .refundAmount) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - } - - } - - /* - Model: ShipmentBreakupValues - Used By: Order - */ - - class ShipmentBreakupValues: Codable { - - - public var name: String? - - public var display: String? - - public var value: Double? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case display = "display" - - case value = "value" - - } - - public init(display: String?, name: String?, value: Double?) { - - self.name = name - - self.display = display - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(Double.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: DpDetails - Used By: Order - */ - - class DpDetails: Codable { - - - public var gstTag: String? - - - public enum CodingKeys: String, CodingKey { - - case gstTag = "gst_tag" - - } - - public init(gstTag: String?) { - - self.gstTag = gstTag - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - gstTag = try container.decode(String.self, forKey: .gstTag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(gstTag, forKey: .gstTag) - - - } - - } - - /* - Model: ShipmentInvoice - Used By: Order - */ - - class ShipmentInvoice: Codable { - - - public var paymentType: String? - - public var updatedDate: String? - - public var invoiceUrl: String? - - public var labelUrl: String? - - public var paymentMode: String? - - public var amountToCollect: Double? - - public var rtoAddress: RtoAddress? - - - public enum CodingKeys: String, CodingKey { - - case paymentType = "payment_type" - - case updatedDate = "updated_date" - - case invoiceUrl = "invoice_url" - - case labelUrl = "label_url" - - case paymentMode = "payment_mode" - - case amountToCollect = "amount_to_collect" - - case rtoAddress = "rto_address" - - } - - public init(amountToCollect: Double?, invoiceUrl: String?, labelUrl: String?, paymentMode: String?, paymentType: String?, rtoAddress: RtoAddress?, updatedDate: String?) { - - self.paymentType = paymentType - - self.updatedDate = updatedDate - - self.invoiceUrl = invoiceUrl - - self.labelUrl = labelUrl - - self.paymentMode = paymentMode - - self.amountToCollect = amountToCollect - - self.rtoAddress = rtoAddress - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - paymentType = try container.decode(String.self, forKey: .paymentType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedDate = try container.decode(String.self, forKey: .updatedDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - invoiceUrl = try container.decode(String.self, forKey: .invoiceUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - labelUrl = try container.decode(String.self, forKey: .labelUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentMode = try container.decode(String.self, forKey: .paymentMode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - amountToCollect = try container.decode(Double.self, forKey: .amountToCollect) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rtoAddress = try container.decode(RtoAddress.self, forKey: .rtoAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(paymentType, forKey: .paymentType) - - - - try? container.encodeIfPresent(updatedDate, forKey: .updatedDate) - - - - try? container.encodeIfPresent(invoiceUrl, forKey: .invoiceUrl) - - - - try? container.encodeIfPresent(labelUrl, forKey: .labelUrl) - - - - try? container.encodeIfPresent(paymentMode, forKey: .paymentMode) - - - - try? container.encodeIfPresent(amountToCollect, forKey: .amountToCollect) - - - - try? container.encodeIfPresent(rtoAddress, forKey: .rtoAddress) - - - } - - } - - /* - Model: RtoAddress - Used By: Order - */ - - class RtoAddress: Codable { - - - public var name: String? - - public var id: Int? - - public var phone: String? - - public var locationType: String? - - public var storeAddressJson: StoreAddressJson? - - public var code: String? - - public var address1: String? - - public var city: String? - - public var country: String? - - public var pincode: String? - - public var companyId: Int? - - public var contactPerson: String? - - public var state: String? - - public var storeEmail: String? - - public var address2: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case id = "id" - - case phone = "phone" - - case locationType = "location_type" - - case storeAddressJson = "store_address_json" - - case code = "code" - - case address1 = "address1" - - case city = "city" - - case country = "country" - - case pincode = "pincode" - - case companyId = "company_id" - - case contactPerson = "contact_person" - - case state = "state" - - case storeEmail = "store_email" - - case address2 = "address2" - - } - - public init(address1: String?, address2: String?, city: String?, code: String?, companyId: Int?, contactPerson: String?, country: String?, id: Int?, locationType: String?, name: String?, phone: String?, pincode: String?, state: String?, storeAddressJson: StoreAddressJson?, storeEmail: String?) { - - self.name = name - - self.id = id - - self.phone = phone - - self.locationType = locationType - - self.storeAddressJson = storeAddressJson - - self.code = code - - self.address1 = address1 - - self.city = city - - self.country = country - - self.pincode = pincode - - self.companyId = companyId - - self.contactPerson = contactPerson - - self.state = state - - self.storeEmail = storeEmail - - self.address2 = address2 - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - locationType = try container.decode(String.self, forKey: .locationType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeAddressJson = try container.decode(StoreAddressJson.self, forKey: .storeAddressJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address1 = try container.decode(String.self, forKey: .address1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(String.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contactPerson = try container.decode(String.self, forKey: .contactPerson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(String.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeEmail = try container.decode(String.self, forKey: .storeEmail) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address2 = try container.decode(String.self, forKey: .address2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(locationType, forKey: .locationType) - - - - try? container.encodeIfPresent(storeAddressJson, forKey: .storeAddressJson) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(address1, forKey: .address1) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(contactPerson, forKey: .contactPerson) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(storeEmail, forKey: .storeEmail) - - - - try? container.encodeIfPresent(address2, forKey: .address2) - - - } - - } - - /* - Model: StoreAddressJson - Used By: Order - */ - - class StoreAddressJson: Codable { - - - public var country: String? - - public var latitude: Double? - - public var updatedAt: String? - - public var area: String? - - public var state: String? - - public var addressType: String? - - public var city: String? - - public var pincode: String? - - public var address1: String? - - public var address2: String? - - public var longitude: Double? - - public var email: String? - - public var phone: String? - - public var createdAt: String? - - public var contactPerson: String? - - public var addressCategory: String? - - public var version: String? - - public var landmark: String? - - - public enum CodingKeys: String, CodingKey { - - case country = "country" - - case latitude = "latitude" - - case updatedAt = "updated_at" - - case area = "area" - - case state = "state" - - case addressType = "address_type" - - case city = "city" - - case pincode = "pincode" - - case address1 = "address1" - - case address2 = "address2" - - case longitude = "longitude" - - case email = "email" - - case phone = "phone" - - case createdAt = "created_at" - - case contactPerson = "contact_person" - - case addressCategory = "address_category" - - case version = "version" - - case landmark = "landmark" - - } - - public init(address1: String?, address2: String?, addressCategory: String?, addressType: String?, area: String?, city: String?, contactPerson: String?, country: String?, createdAt: String?, email: String?, landmark: String?, latitude: Double?, longitude: Double?, phone: String?, pincode: String?, state: String?, updatedAt: String?, version: String?) { - - self.country = country - - self.latitude = latitude - - self.updatedAt = updatedAt - - self.area = area - - self.state = state - - self.addressType = addressType - - self.city = city - - self.pincode = pincode - - self.address1 = address1 - - self.address2 = address2 - - self.longitude = longitude - - self.email = email - - self.phone = phone - - self.createdAt = createdAt - - self.contactPerson = contactPerson - - self.addressCategory = addressCategory - - self.version = version - - self.landmark = landmark - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - latitude = try container.decode(Double.self, forKey: .latitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - area = try container.decode(String.self, forKey: .area) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(String.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressType = try container.decode(String.self, forKey: .addressType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(String.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address1 = try container.decode(String.self, forKey: .address1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address2 = try container.decode(String.self, forKey: .address2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - longitude = try container.decode(Double.self, forKey: .longitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contactPerson = try container.decode(String.self, forKey: .contactPerson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressCategory = try container.decode(String.self, forKey: .addressCategory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - version = try container.decode(String.self, forKey: .version) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - landmark = try container.decode(String.self, forKey: .landmark) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(latitude, forKey: .latitude) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(area, forKey: .area) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(addressType, forKey: .addressType) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(address1, forKey: .address1) - - - - try? container.encodeIfPresent(address2, forKey: .address2) - - - - try? container.encodeIfPresent(longitude, forKey: .longitude) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(contactPerson, forKey: .contactPerson) - - - - try? container.encodeIfPresent(addressCategory, forKey: .addressCategory) - - - - try? container.encodeIfPresent(version, forKey: .version) - - - - try? container.encodeIfPresent(landmark, forKey: .landmark) - - - } - - } - - /* - Model: PlatformFulfillingStore - Used By: Order - */ - - class PlatformFulfillingStore: Codable { - - - public var packagingMaterialCount: Int? - - public var locationType: String? - - public var code: String? - - public var city: String? - - public var meta: FulfillingStoreMeta? - - public var name: String? - - public var isActive: Bool? - - public var address1: String? - - public var storeEmail: String? - - public var isArchived: Bool? - - public var state: String? - - public var address2: String? - - public var contactPerson: String? - - public var phone: String? - - public var isEnabledForRecon: Bool? - - public var fulfillmentChannel: String? - - public var createdAt: String? - - public var id: Int? - - public var pincode: String? - - public var brandStoreTags: [String]? - - public var companyId: Int? - - public var storeAddressJson: FulfillingStoreStoreAddressJson? - - public var updatedAt: String? - - public var loginUsername: String? - - public var country: String? - - - public enum CodingKeys: String, CodingKey { - - case packagingMaterialCount = "packaging_material_count" - - case locationType = "location_type" - - case code = "code" - - case city = "city" - - case meta = "meta" - - case name = "name" - - case isActive = "is_active" - - case address1 = "address1" - - case storeEmail = "store_email" - - case isArchived = "is_archived" - - case state = "state" - - case address2 = "address2" - - case contactPerson = "contact_person" - - case phone = "phone" - - case isEnabledForRecon = "is_enabled_for_recon" - - case fulfillmentChannel = "fulfillment_channel" - - case createdAt = "created_at" - - case id = "id" - - case pincode = "pincode" - - case brandStoreTags = "brand_store_tags" - - case companyId = "company_id" - - case storeAddressJson = "store_address_json" - - case updatedAt = "updated_at" - - case loginUsername = "login_username" - - case country = "country" - - } - - public init(address1: String?, address2: String?, brandStoreTags: [String]?, city: String?, code: String?, companyId: Int?, contactPerson: String?, country: String?, createdAt: String?, fulfillmentChannel: String?, id: Int?, isActive: Bool?, isArchived: Bool?, isEnabledForRecon: Bool?, locationType: String?, loginUsername: String?, meta: FulfillingStoreMeta?, name: String?, packagingMaterialCount: Int?, phone: String?, pincode: String?, state: String?, storeAddressJson: FulfillingStoreStoreAddressJson?, storeEmail: String?, updatedAt: String?) { - - self.packagingMaterialCount = packagingMaterialCount - - self.locationType = locationType - - self.code = code - - self.city = city - - self.meta = meta - - self.name = name - - self.isActive = isActive - - self.address1 = address1 - - self.storeEmail = storeEmail - - self.isArchived = isArchived - - self.state = state - - self.address2 = address2 - - self.contactPerson = contactPerson - - self.phone = phone - - self.isEnabledForRecon = isEnabledForRecon - - self.fulfillmentChannel = fulfillmentChannel - - self.createdAt = createdAt - - self.id = id - - self.pincode = pincode - - self.brandStoreTags = brandStoreTags - - self.companyId = companyId - - self.storeAddressJson = storeAddressJson - - self.updatedAt = updatedAt - - self.loginUsername = loginUsername - - self.country = country - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - packagingMaterialCount = try container.decode(Int.self, forKey: .packagingMaterialCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - locationType = try container.decode(String.self, forKey: .locationType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode(FulfillingStoreMeta.self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address1 = try container.decode(String.self, forKey: .address1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeEmail = try container.decode(String.self, forKey: .storeEmail) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isArchived = try container.decode(Bool.self, forKey: .isArchived) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(String.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address2 = try container.decode(String.self, forKey: .address2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contactPerson = try container.decode(String.self, forKey: .contactPerson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isEnabledForRecon = try container.decode(Bool.self, forKey: .isEnabledForRecon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fulfillmentChannel = try container.decode(String.self, forKey: .fulfillmentChannel) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(String.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandStoreTags = try container.decode([String].self, forKey: .brandStoreTags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeAddressJson = try container.decode(FulfillingStoreStoreAddressJson.self, forKey: .storeAddressJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - loginUsername = try container.decode(String.self, forKey: .loginUsername) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(packagingMaterialCount, forKey: .packagingMaterialCount) - - - - try? container.encodeIfPresent(locationType, forKey: .locationType) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(address1, forKey: .address1) - - - - try? container.encodeIfPresent(storeEmail, forKey: .storeEmail) - - - - try? container.encodeIfPresent(isArchived, forKey: .isArchived) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(address2, forKey: .address2) - - - - try? container.encodeIfPresent(contactPerson, forKey: .contactPerson) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(isEnabledForRecon, forKey: .isEnabledForRecon) - - - - try? container.encodeIfPresent(fulfillmentChannel, forKey: .fulfillmentChannel) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(brandStoreTags, forKey: .brandStoreTags) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(storeAddressJson, forKey: .storeAddressJson) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(loginUsername, forKey: .loginUsername) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - } - - } - - /* - Model: FulfillingStoreMeta - Used By: Order - */ - - class FulfillingStoreMeta: Codable { - - - public var additionalContactDetails: AdditionalContactDetails? - - public var documents: Documents? - - public var gstNumber: String? - - public var displayName: String? - - public var productReturnConfig: ProductReturnConfig? - - public var allowDpAssignmentFromFynd: Bool? - - public var stage: String? - - public var timing: Timing? - - - public enum CodingKeys: String, CodingKey { - - case additionalContactDetails = "additional_contact_details" - - case documents = "documents" - - case gstNumber = "gst_number" - - case displayName = "display_name" - - case productReturnConfig = "product_return_config" - - case allowDpAssignmentFromFynd = "allow_dp_assignment_from_fynd" - - case stage = "stage" - - case timing = "timing" - - } - - public init(additionalContactDetails: AdditionalContactDetails?, allowDpAssignmentFromFynd: Bool?, displayName: String?, documents: Documents?, gstNumber: String?, productReturnConfig: ProductReturnConfig?, stage: String?, timing: Timing?) { - - self.additionalContactDetails = additionalContactDetails - - self.documents = documents - - self.gstNumber = gstNumber - - self.displayName = displayName - - self.productReturnConfig = productReturnConfig - - self.allowDpAssignmentFromFynd = allowDpAssignmentFromFynd - - self.stage = stage - - self.timing = timing - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - additionalContactDetails = try container.decode(AdditionalContactDetails.self, forKey: .additionalContactDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - documents = try container.decode(Documents.self, forKey: .documents) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstNumber = try container.decode(String.self, forKey: .gstNumber) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productReturnConfig = try container.decode(ProductReturnConfig.self, forKey: .productReturnConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allowDpAssignmentFromFynd = try container.decode(Bool.self, forKey: .allowDpAssignmentFromFynd) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stage = try container.decode(String.self, forKey: .stage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - timing = try container.decode(Timing.self, forKey: .timing) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(additionalContactDetails, forKey: .additionalContactDetails) - - - - try? container.encodeIfPresent(documents, forKey: .documents) - - - - try? container.encodeIfPresent(gstNumber, forKey: .gstNumber) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(productReturnConfig, forKey: .productReturnConfig) - - - - try? container.encodeIfPresent(allowDpAssignmentFromFynd, forKey: .allowDpAssignmentFromFynd) - - - - try? container.encodeIfPresent(stage, forKey: .stage) - - - - try? container.encodeIfPresent(timing, forKey: .timing) - - - } - - } - - /* - Model: AdditionalContactDetails - Used By: Order - */ - - class AdditionalContactDetails: Codable { - - - public var number: [String]? - - - public enum CodingKeys: String, CodingKey { - - case number = "number" - - } - - public init(number: [String]?) { - - self.number = number - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - number = try container.decode([String].self, forKey: .number) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(number, forKey: .number) - - - } - - } - - /* - Model: Documents - Used By: Order - */ - - class Documents: Codable { - - - public var gst: Gst? - - - public enum CodingKeys: String, CodingKey { - - case gst = "gst" - - } - - public init(gst: Gst?) { - - self.gst = gst - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - gst = try container.decode(Gst.self, forKey: .gst) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(gst, forKey: .gst) - - - } - - } - - /* - Model: Gst - Used By: Order - */ - - class Gst: Codable { - - - public var legalName: String? - - public var type: String? - - public var value: String? - - public var verified: Bool? - - - public enum CodingKeys: String, CodingKey { - - case legalName = "legal_name" - - case type = "type" - - case value = "value" - - case verified = "verified" - - } - - public init(legalName: String?, type: String?, value: String?, verified: Bool?) { - - self.legalName = legalName - - self.type = type - - self.value = value - - self.verified = verified - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - legalName = try container.decode(String.self, forKey: .legalName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verified = try container.decode(Bool.self, forKey: .verified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(legalName, forKey: .legalName) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(verified, forKey: .verified) - - - } - - } - - /* - Model: ProductReturnConfig - Used By: Order - */ - - class ProductReturnConfig: Codable { - - - public var onSameStore: Bool? - - - public enum CodingKeys: String, CodingKey { - - case onSameStore = "on_same_store" - - } - - public init(onSameStore: Bool?) { - - self.onSameStore = onSameStore - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - onSameStore = try container.decode(Bool.self, forKey: .onSameStore) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(onSameStore, forKey: .onSameStore) - - - } - - } - - /* - Model: Timing - Used By: Order - */ - - class Timing: Codable { - - - public var opening: Opening? - - public var weekday: String? - - public var open: Bool? - - public var closing: Closing? - - - public enum CodingKeys: String, CodingKey { - - case opening = "opening" - - case weekday = "weekday" - - case open = "open" - - case closing = "closing" - - } - - public init(closing: Closing?, open: Bool?, opening: Opening?, weekday: String?) { - - self.opening = opening - - self.weekday = weekday - - self.open = open - - self.closing = closing - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - opening = try container.decode(Opening.self, forKey: .opening) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - weekday = try container.decode(String.self, forKey: .weekday) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - open = try container.decode(Bool.self, forKey: .open) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - closing = try container.decode(Closing.self, forKey: .closing) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(opening, forKey: .opening) - - - - try? container.encodeIfPresent(weekday, forKey: .weekday) - - - - try? container.encodeIfPresent(open, forKey: .open) - - - - try? container.encodeIfPresent(closing, forKey: .closing) - - - } - - } - - /* - Model: Opening - Used By: Order - */ - - class Opening: Codable { - - - public var minute: Int? - - public var hour: Int? - - - public enum CodingKeys: String, CodingKey { - - case minute = "minute" - - case hour = "hour" - - } - - public init(hour: Int?, minute: Int?) { - - self.minute = minute - - self.hour = hour - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - minute = try container.decode(Int.self, forKey: .minute) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hour = try container.decode(Int.self, forKey: .hour) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(minute, forKey: .minute) - - - - try? container.encodeIfPresent(hour, forKey: .hour) - - - } - - } - - /* - Model: Closing - Used By: Order - */ - - class Closing: Codable { - - - public var hour: Int? - - public var minute: Int? - - - public enum CodingKeys: String, CodingKey { - - case hour = "hour" - - case minute = "minute" - - } - - public init(hour: Int?, minute: Int?) { - - self.hour = hour - - self.minute = minute - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - hour = try container.decode(Int.self, forKey: .hour) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - minute = try container.decode(Int.self, forKey: .minute) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(hour, forKey: .hour) - - - - try? container.encodeIfPresent(minute, forKey: .minute) - - - } - - } - - /* - Model: FulfillingStoreStoreAddressJson - Used By: Order - */ - - class FulfillingStoreStoreAddressJson: Codable { - - - public var address2: String? - - public var area: String? - - public var email: String? - - public var phone: String? - - public var state: String? - - public var contactPerson: String? - - public var country: String? - - public var pincode: String? - - public var version: String? - - public var createdAt: String? - - public var addressType: String? - - public var city: String? - - public var address1: String? - - public var landmark: String? - - public var latitude: Double? - - public var longitude: Double? - - public var updatedAt: String? - - public var addressCategory: String? - - - public enum CodingKeys: String, CodingKey { - - case address2 = "address2" - - case area = "area" - - case email = "email" - - case phone = "phone" - - case state = "state" - - case contactPerson = "contact_person" - - case country = "country" - - case pincode = "pincode" - - case version = "version" - - case createdAt = "created_at" - - case addressType = "address_type" - - case city = "city" - - case address1 = "address1" - - case landmark = "landmark" - - case latitude = "latitude" - - case longitude = "longitude" - - case updatedAt = "updated_at" - - case addressCategory = "address_category" - - } - - public init(address1: String?, address2: String?, addressCategory: String?, addressType: String?, area: String?, city: String?, contactPerson: String?, country: String?, createdAt: String?, email: String?, landmark: String?, latitude: Double?, longitude: Double?, phone: String?, pincode: String?, state: String?, updatedAt: String?, version: String?) { - - self.address2 = address2 - - self.area = area - - self.email = email - - self.phone = phone - - self.state = state - - self.contactPerson = contactPerson - - self.country = country - - self.pincode = pincode - - self.version = version - - self.createdAt = createdAt - - self.addressType = addressType - - self.city = city - - self.address1 = address1 - - self.landmark = landmark - - self.latitude = latitude - - self.longitude = longitude - - self.updatedAt = updatedAt - - self.addressCategory = addressCategory - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - address2 = try container.decode(String.self, forKey: .address2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - area = try container.decode(String.self, forKey: .area) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(String.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contactPerson = try container.decode(String.self, forKey: .contactPerson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(String.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - version = try container.decode(String.self, forKey: .version) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressType = try container.decode(String.self, forKey: .addressType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address1 = try container.decode(String.self, forKey: .address1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - landmark = try container.decode(String.self, forKey: .landmark) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - latitude = try container.decode(Double.self, forKey: .latitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - longitude = try container.decode(Double.self, forKey: .longitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressCategory = try container.decode(String.self, forKey: .addressCategory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(address2, forKey: .address2) - - - - try? container.encodeIfPresent(area, forKey: .area) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(contactPerson, forKey: .contactPerson) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(version, forKey: .version) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(addressType, forKey: .addressType) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(address1, forKey: .address1) - - - - try? container.encodeIfPresent(landmark, forKey: .landmark) - - - - try? container.encodeIfPresent(latitude, forKey: .latitude) - - - - try? container.encodeIfPresent(longitude, forKey: .longitude) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(addressCategory, forKey: .addressCategory) - - - } - - } - - /* - Model: ShipmentGst - Used By: Order - */ - - class ShipmentGst: Codable { - - - public var brandCalculatedAmount: Double? - - public var valueOfGood: Double? - - public var gstFee: Double? - - - public enum CodingKeys: String, CodingKey { - - case brandCalculatedAmount = "brand_calculated_amount" - - case valueOfGood = "value_of_good" - - case gstFee = "gst_fee" - - } - - public init(brandCalculatedAmount: Double?, gstFee: Double?, valueOfGood: Double?) { - - self.brandCalculatedAmount = brandCalculatedAmount - - self.valueOfGood = valueOfGood - - self.gstFee = gstFee - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - brandCalculatedAmount = try container.decode(Double.self, forKey: .brandCalculatedAmount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - valueOfGood = try container.decode(Double.self, forKey: .valueOfGood) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstFee = try container.decode(Double.self, forKey: .gstFee) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(brandCalculatedAmount, forKey: .brandCalculatedAmount) - - - - try? container.encodeIfPresent(valueOfGood, forKey: .valueOfGood) - - - - try? container.encodeIfPresent(gstFee, forKey: .gstFee) - - - } - - } - - /* - Model: PlatformShipmentDetailsBrand - Used By: Order - */ - - class PlatformShipmentDetailsBrand: Codable { - - - public var creditNoteAllowed: Bool? - - public var brandName: String? - - public var modifiedOn: String? - - public var id: Int? - - public var isVirtualInvoice: Bool? - - public var createdOn: String? - - public var logo: String? - - - public enum CodingKeys: String, CodingKey { - - case creditNoteAllowed = "credit_note_allowed" - - case brandName = "brand_name" - - case modifiedOn = "modified_on" - - case id = "id" - - case isVirtualInvoice = "is_virtual_invoice" - - case createdOn = "created_on" - - case logo = "logo" - - } - - public init(brandName: String?, createdOn: String?, creditNoteAllowed: Bool?, id: Int?, isVirtualInvoice: Bool?, logo: String?, modifiedOn: String?) { - - self.creditNoteAllowed = creditNoteAllowed - - self.brandName = brandName - - self.modifiedOn = modifiedOn - - self.id = id - - self.isVirtualInvoice = isVirtualInvoice - - self.createdOn = createdOn - - self.logo = logo - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - creditNoteAllowed = try container.decode(Bool.self, forKey: .creditNoteAllowed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandName = try container.decode(String.self, forKey: .brandName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isVirtualInvoice = try container.decode(Bool.self, forKey: .isVirtualInvoice) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(creditNoteAllowed, forKey: .creditNoteAllowed) - - - - try? container.encodeIfPresent(brandName, forKey: .brandName) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(isVirtualInvoice, forKey: .isVirtualInvoice) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - } - - } - - /* - Model: Promise - Used By: Order - */ - - class Promise: Codable { - - - public var timestamp: Timestamp? - - - public enum CodingKeys: String, CodingKey { - - case timestamp = "timestamp" - - } - - public init(timestamp: Timestamp?) { - - self.timestamp = timestamp - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - timestamp = try container.decode(Timestamp.self, forKey: .timestamp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(timestamp, forKey: .timestamp) - - - } - - } - - /* - Model: Timestamp - Used By: Order - */ - - class Timestamp: Codable { - - - public var min: String? - - public var max: String? - - - public enum CodingKeys: String, CodingKey { - - case min = "min" - - case max = "max" - - } - - public init(max: String?, min: String?) { - - self.min = min - - self.max = max - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - min = try container.decode(String.self, forKey: .min) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - max = try container.decode(String.self, forKey: .max) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(min, forKey: .min) - - - - try? container.encodeIfPresent(max, forKey: .max) - - - } - - } - - /* - Model: ShipmentTrackingDetails - Used By: Order - */ - - class ShipmentTrackingDetails: Codable { - - - public var status: String? - - public var time: String? - - public var isPassed: Bool? - - public var isCurrent: Bool? - - - public enum CodingKeys: String, CodingKey { - - case status = "status" - - case time = "time" - - case isPassed = "is_passed" - - case isCurrent = "is_current" - - } - - public init(isCurrent: Bool?, isPassed: Bool?, status: String?, time: String?) { - - self.status = status - - self.time = time - - self.isPassed = isPassed - - self.isCurrent = isCurrent - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - time = try container.decode(String.self, forKey: .time) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isPassed = try container.decode(Bool.self, forKey: .isPassed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isCurrent = try container.decode(Bool.self, forKey: .isCurrent) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(time, forKey: .time) - - - - try? container.encodeIfPresent(isPassed, forKey: .isPassed) - - - - try? container.encodeIfPresent(isCurrent, forKey: .isCurrent) - - - } - - } - - /* - Model: ItemsPayments - Used By: Order - */ - - class ItemsPayments: Codable { - - - public var displayPriority: Int? - - public var id: Int? - - public var isActive: Bool? - - public var displayName: String? - - public var logo: String? - - public var paymentIdentifier: String? - - public var sourceNickname: String? - - public var mode: String? - - public var source: String? - - - public enum CodingKeys: String, CodingKey { - - case displayPriority = "display_priority" - - case id = "id" - - case isActive = "is_active" - - case displayName = "display_name" - - case logo = "logo" - - case paymentIdentifier = "payment_identifier" - - case sourceNickname = "source_nickname" - - case mode = "mode" - - case source = "source" - - } - - public init(displayName: String?, displayPriority: Int?, id: Int?, isActive: Bool?, logo: String?, mode: String?, paymentIdentifier: String?, source: String?, sourceNickname: String?) { - - self.displayPriority = displayPriority - - self.id = id - - self.isActive = isActive - - self.displayName = displayName - - self.logo = logo - - self.paymentIdentifier = paymentIdentifier - - self.sourceNickname = sourceNickname - - self.mode = mode - - self.source = source - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - displayPriority = try container.decode(Int.self, forKey: .displayPriority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentIdentifier = try container.decode(String.self, forKey: .paymentIdentifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sourceNickname = try container.decode(String.self, forKey: .sourceNickname) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mode = try container.decode(String.self, forKey: .mode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - source = try container.decode(String.self, forKey: .source) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(displayPriority, forKey: .displayPriority) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(paymentIdentifier, forKey: .paymentIdentifier) - - - - try? container.encodeIfPresent(sourceNickname, forKey: .sourceNickname) - - - - try? container.encodeIfPresent(mode, forKey: .mode) - - - - try? container.encodeIfPresent(source, forKey: .source) - - - } - - } - - /* - Model: PlatformOrderDetailsPage - Used By: Order - */ - - class PlatformOrderDetailsPage: Codable { - - - public var next: String? - - public var previous: String? - - - public enum CodingKeys: String, CodingKey { - - case next = "next" - - case previous = "previous" - - } - - public init(next: String?, previous: String?) { - - self.next = next - - self.previous = previous - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - next = try container.decode(String.self, forKey: .next) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - previous = try container.decode(String.self, forKey: .previous) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(next, forKey: .next) - - - - try? container.encodeIfPresent(previous, forKey: .previous) - - - } - - } - - /* - Model: OrderLanesCount - Used By: Order - */ - - class OrderLanesCount: Codable { - - - public var stages: [StageItem] - - - public enum CodingKeys: String, CodingKey { - - case stages = "stages" - - } - - public init(stages: [StageItem]) { - - self.stages = stages - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - stages = try container.decode([StageItem].self, forKey: .stages) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(stages, forKey: .stages) - - - } - - } - - /* - Model: StageItem - Used By: Order - */ - - class StageItem: Codable { - - - public var count: Int? - - public var text: String? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case count = "count" - - case text = "text" - - case value = "value" - - } - - public init(count: Int?, text: String?, value: String?) { - - self.count = count - - self.text = text - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text = try container.decode(String.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(count, forKey: .count) - - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: UpdateOrderReprocessResponse - Used By: Order - */ - - class UpdateOrderReprocessResponse: Codable { - - - public var status: String - - - public enum CodingKeys: String, CodingKey { - - case status = "status" - - } - - public init(status: String) { - - self.status = status - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - status = try container.decode(String.self, forKey: .status) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(status, forKey: .status) - - - } - - } - - /* - Model: PlatformOrderTrack - Used By: Order - */ - - class PlatformOrderTrack: Codable { - - - public var success: Bool - - public var requestId: String - - public var message: String - - public var mobile: String - - public var countryCode: String - - public var resendTimer: Int - - public var resendToken: String? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case requestId = "request_id" - - case message = "message" - - case mobile = "mobile" - - case countryCode = "country_code" - - case resendTimer = "resend_timer" - - case resendToken = "resend_token" - - } - - public init(countryCode: String, message: String, mobile: String, requestId: String, resendTimer: Int, resendToken: String?, success: Bool) { - - self.success = success - - self.requestId = requestId - - self.message = message - - self.mobile = mobile - - self.countryCode = countryCode - - self.resendTimer = resendTimer - - self.resendToken = resendToken - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - requestId = try container.decode(String.self, forKey: .requestId) - - - - - message = try container.decode(String.self, forKey: .message) - - - - - mobile = try container.decode(String.self, forKey: .mobile) - - - - - countryCode = try container.decode(String.self, forKey: .countryCode) - - - - - resendTimer = try container.decode(Int.self, forKey: .resendTimer) - - - - - do { - resendToken = try container.decode(String.self, forKey: .resendToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(mobile, forKey: .mobile) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(resendTimer, forKey: .resendTimer) - - - - try? container.encodeIfPresent(resendToken, forKey: .resendToken) - - - } - - } - - /* - Model: OrderPicklistListing - Used By: Order - */ - - class OrderPicklistListing: Codable { - - - public var user: PlatformOrderUserInfo? - - public var deliveryAddress: PlatformDeliveryAddress? - - public var channel: Channel? - - public var fyndstoreEmp: [String: Any]? - - public var orderingStore: [String: Any]? - - public var breakupValues: PlatformBreakupValues? - - public var id: String? - - public var application: PlatformApplication? - - public var shipments: PlatformShipmentDetails? - - public var createdAt: String? - - public var totalShipmentsInOrder: Int? - - public var payments: ItemsPayments? - - - public enum CodingKeys: String, CodingKey { - - case user = "user" - - case deliveryAddress = "delivery_address" - - case channel = "channel" - - case fyndstoreEmp = "fyndstore_emp" - - case orderingStore = "ordering_store" - - case breakupValues = "breakup_values" - - case id = "id" - - case application = "application" - - case shipments = "shipments" - - case createdAt = "created_at" - - case totalShipmentsInOrder = "total_shipments_in_order" - - case payments = "payments" - - } - - public init(application: PlatformApplication?, breakupValues: PlatformBreakupValues?, channel: Channel?, createdAt: String?, deliveryAddress: PlatformDeliveryAddress?, fyndstoreEmp: [String: Any]?, id: String?, orderingStore: [String: Any]?, payments: ItemsPayments?, shipments: PlatformShipmentDetails?, totalShipmentsInOrder: Int?, user: PlatformOrderUserInfo?) { - - self.user = user - - self.deliveryAddress = deliveryAddress - - self.channel = channel - - self.fyndstoreEmp = fyndstoreEmp - - self.orderingStore = orderingStore - - self.breakupValues = breakupValues - - self.id = id - - self.application = application - - self.shipments = shipments - - self.createdAt = createdAt - - self.totalShipmentsInOrder = totalShipmentsInOrder - - self.payments = payments - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - user = try container.decode(PlatformOrderUserInfo.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryAddress = try container.decode(PlatformDeliveryAddress.self, forKey: .deliveryAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - channel = try container.decode(Channel.self, forKey: .channel) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fyndstoreEmp = try container.decode([String: Any].self, forKey: .fyndstoreEmp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderingStore = try container.decode([String: Any].self, forKey: .orderingStore) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - breakupValues = try container.decode(PlatformBreakupValues.self, forKey: .breakupValues) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(PlatformApplication.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shipments = try container.decode(PlatformShipmentDetails.self, forKey: .shipments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalShipmentsInOrder = try container.decode(Int.self, forKey: .totalShipmentsInOrder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - payments = try container.decode(ItemsPayments.self, forKey: .payments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(deliveryAddress, forKey: .deliveryAddress) - - - - try? container.encodeIfPresent(channel, forKey: .channel) - - - - try? container.encodeIfPresent(fyndstoreEmp, forKey: .fyndstoreEmp) - - - - try? container.encodeIfPresent(orderingStore, forKey: .orderingStore) - - - - try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(shipments, forKey: .shipments) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(totalShipmentsInOrder, forKey: .totalShipmentsInOrder) - - - - try? container.encodeIfPresent(payments, forKey: .payments) - - - } - - } - - /* - Model: Stages - Used By: Order - */ - - class Stages: Codable { - - - public var text: String? - - public var value: String? - - public var isDefault: Bool? - - public var filters: StagesFilters? - - - public enum CodingKeys: String, CodingKey { - - case text = "text" - - case value = "value" - - case isDefault = "is_default" - - case filters = "filters" - - } - - public init(filters: StagesFilters?, isDefault: Bool?, text: String?, value: String?) { - - self.text = text - - self.value = value - - self.isDefault = isDefault - - self.filters = filters - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - text = try container.decode(String.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isDefault = try container.decode(Bool.self, forKey: .isDefault) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - filters = try container.decode(StagesFilters.self, forKey: .filters) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(isDefault, forKey: .isDefault) - - - - try? container.encodeIfPresent(filters, forKey: .filters) - - - } - - } - - /* - Model: ItemTotal - Used By: Order - */ - - class ItemTotal: Codable { - - - public var new: Int? - - public var processing: Int? - - public var returns: Int? - - public var all: Int? - - - public enum CodingKeys: String, CodingKey { - - case new = "new" - - case processing = "processing" - - case returns = "returns" - - case all = "all" - - } - - public init(all: Int?, new: Int?, processing: Int?, returns: Int?) { - - self.new = new - - self.processing = processing - - self.returns = returns - - self.all = all - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - new = try container.decode(Int.self, forKey: .new) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - processing = try container.decode(Int.self, forKey: .processing) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - returns = try container.decode(Int.self, forKey: .returns) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - all = try container.decode(Int.self, forKey: .all) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(new, forKey: .new) - - - - try? container.encodeIfPresent(processing, forKey: .processing) - - - - try? container.encodeIfPresent(returns, forKey: .returns) - - - - try? container.encodeIfPresent(all, forKey: .all) - - - } - - } - - /* - Model: GetPingResponse - Used By: Order - */ - - class GetPingResponse: Codable { - - - public var ping: String - - - public enum CodingKeys: String, CodingKey { - - case ping = "ping" - - } - - public init(ping: String) { - - self.ping = ping - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - ping = try container.decode(String.self, forKey: .ping) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(ping, forKey: .ping) - - - } - - } - - /* - Model: GetShipmentAddressResponse - Used By: Order - */ - - class GetShipmentAddressResponse: Codable { - - - public var message: String - - public var data: DataShipmentAddress - - public var success: Bool - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - case data = "data" - - case success = "success" - - } - - public init(data: DataShipmentAddress, message: String, success: Bool) { - - self.message = message - - self.data = data - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - message = try container.decode(String.self, forKey: .message) - - - - - data = try container.decode(DataShipmentAddress.self, forKey: .data) - - - - - success = try container.decode(Bool.self, forKey: .success) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: DataShipmentAddress - Used By: Order - */ - - class DataShipmentAddress: Codable { - - - public var city: String? - - public var country: String? - - public var pincode: String? - - public var phone: String? - - public var area: String? - - public var address: String? - - public var landmark: String? - - public var state: String? - - public var addressType: String? - - public var addressCategory: String? - - public var email: String? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case city = "city" - - case country = "country" - - case pincode = "pincode" - - case phone = "phone" - - case area = "area" - - case address = "address" - - case landmark = "landmark" - - case state = "state" - - case addressType = "address_type" - - case addressCategory = "address_category" - - case email = "email" - - case name = "name" - - } - - public init(address: String?, addressCategory: String?, addressType: String?, area: String?, city: String?, country: String?, email: String?, landmark: String?, name: String?, phone: String?, pincode: String?, state: String?) { - - self.city = city - - self.country = country - - self.pincode = pincode - - self.phone = phone - - self.area = area - - self.address = address - - self.landmark = landmark - - self.state = state - - self.addressType = addressType - - self.addressCategory = addressCategory - - self.email = email - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(String.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - area = try container.decode(String.self, forKey: .area) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address = try container.decode(String.self, forKey: .address) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - landmark = try container.decode(String.self, forKey: .landmark) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(String.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressType = try container.decode(String.self, forKey: .addressType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressCategory = try container.decode(String.self, forKey: .addressCategory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(area, forKey: .area) - - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(landmark, forKey: .landmark) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(addressType, forKey: .addressType) - - - - try? container.encodeIfPresent(addressCategory, forKey: .addressCategory) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: UpdateShipmentAddressRequest - Used By: Order - */ - - class UpdateShipmentAddressRequest: Codable { - - - public var email: String - - public var address: String - - public var pincode: String - - public var state: String - - public var addressType: String - - public var country: String - - public var name: String - - public var phone: String - - public var area: String - - public var landmark: String - - public var city: String - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case address = "address" - - case pincode = "pincode" - - case state = "state" - - case addressType = "address_type" - - case country = "country" - - case name = "name" - - case phone = "phone" - - case area = "area" - - case landmark = "landmark" - - case city = "city" - - } - - public init(address: String, addressType: String, area: String, city: String, country: String, email: String, landmark: String, name: String, phone: String, pincode: String, state: String) { - - self.email = email - - self.address = address - - self.pincode = pincode - - self.state = state - - self.addressType = addressType - - self.country = country - - self.name = name - - self.phone = phone - - self.area = area - - self.landmark = landmark - - self.city = city - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - email = try container.decode(String.self, forKey: .email) - - - - - address = try container.decode(String.self, forKey: .address) - - - - - pincode = try container.decode(String.self, forKey: .pincode) - - - - - state = try container.decode(String.self, forKey: .state) - - - - - addressType = try container.decode(String.self, forKey: .addressType) - - - - - country = try container.decode(String.self, forKey: .country) - - - - - name = try container.decode(String.self, forKey: .name) - - - - - phone = try container.decode(String.self, forKey: .phone) - - - - - area = try container.decode(String.self, forKey: .area) - - - - - landmark = try container.decode(String.self, forKey: .landmark) - - - - - city = try container.decode(String.self, forKey: .city) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(addressType, forKey: .addressType) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(area, forKey: .area) - - - - try? container.encodeIfPresent(landmark, forKey: .landmark) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - } - - } - - /* - Model: UpdateShipmentAddressResponse - Used By: Order - */ - - class UpdateShipmentAddressResponse: Codable { - - - public var success: Bool - - public var message: String - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case message = "message" - - } - - public init(message: String, success: Bool) { - - self.success = success - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - message = try container.decode(String.self, forKey: .message) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: ShipmentTrackResponse - Used By: Order - */ - - class ShipmentTrackResponse: Codable { - - - public var bagList: [ShipmentTrackResponseBagListItem] - - public var message: String - - public var orderValue: Int - - - public enum CodingKeys: String, CodingKey { - - case bagList = "bag_list" - - case message = "message" - - case orderValue = "order_value" - - } - - public init(bagList: [ShipmentTrackResponseBagListItem], message: String, orderValue: Int) { - - self.bagList = bagList - - self.message = message - - self.orderValue = orderValue - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - bagList = try container.decode([ShipmentTrackResponseBagListItem].self, forKey: .bagList) - - - - - message = try container.decode(String.self, forKey: .message) - - - - - orderValue = try container.decode(Int.self, forKey: .orderValue) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(bagList, forKey: .bagList) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(orderValue, forKey: .orderValue) - - - } - - } - - /* - Model: ShipmentTrackResponseBagListItem - Used By: Order - */ - - class ShipmentTrackResponseBagListItem: Codable { - - - public var enableTracking: Bool? - - public var price: String? - - public var timeSlot: String? - - public var productName: String? - - public var canReturn: Bool? - - public var orderDate: String? - - public var isTryAtHome: Bool? - - public var breakupValues: [ShipmentTrackResponseBagListItemBreakValues]? - - public var statuses: [ShipmentTrackResponseBagListItemStatuses]? - - public var isActive: Bool? - - public var bagId: String? - - public var orderId: String? - - public var size: String? - - public var paymentModeSource: String? - - public var dpDetails: ShipmentTrackResponseBagListItemDpDetails? - - public var productId: Int? - - public var productImage: ShipmentTrackResponseBagListItemsProductImage? - - public var brandName: String? - - public var priceMarked: String? - - public var status: String? - - public var canCancel: Bool? - - public var paymentMode: String? - - public var fyndCashMsg: String? - - public var deliveryAddress: String? - - - public enum CodingKeys: String, CodingKey { - - case enableTracking = "enable_tracking" - - case price = "price" - - case timeSlot = "time_slot" - - case productName = "product_name" - - case canReturn = "can_return" - - case orderDate = "order_date" - - case isTryAtHome = "is_try_at_home" - - case breakupValues = "breakup_values" - - case statuses = "statuses" - - case isActive = "is_active" - - case bagId = "bag_id" - - case orderId = "order_id" - - case size = "size" - - case paymentModeSource = "payment_mode_source" - - case dpDetails = "dp_details" - - case productId = "product_id" - - case productImage = "product_image" - - case brandName = "brand_name" - - case priceMarked = "price_marked" - - case status = "status" - - case canCancel = "can_cancel" - - case paymentMode = "payment_mode" - - case fyndCashMsg = "fynd_cash_msg" - - case deliveryAddress = "delivery_address" - - } - - public init(bagId: String?, brandName: String?, breakupValues: [ShipmentTrackResponseBagListItemBreakValues]?, canCancel: Bool?, canReturn: Bool?, deliveryAddress: String?, dpDetails: ShipmentTrackResponseBagListItemDpDetails?, enableTracking: Bool?, fyndCashMsg: String?, isActive: Bool?, isTryAtHome: Bool?, orderDate: String?, orderId: String?, paymentMode: String?, paymentModeSource: String?, price: String?, priceMarked: String?, productId: Int?, productImage: ShipmentTrackResponseBagListItemsProductImage?, productName: String?, size: String?, status: String?, statuses: [ShipmentTrackResponseBagListItemStatuses]?, timeSlot: String?) { - - self.enableTracking = enableTracking - - self.price = price - - self.timeSlot = timeSlot - - self.productName = productName - - self.canReturn = canReturn - - self.orderDate = orderDate - - self.isTryAtHome = isTryAtHome - - self.breakupValues = breakupValues - - self.statuses = statuses - - self.isActive = isActive - - self.bagId = bagId - - self.orderId = orderId - - self.size = size - - self.paymentModeSource = paymentModeSource - - self.dpDetails = dpDetails - - self.productId = productId - - self.productImage = productImage - - self.brandName = brandName - - self.priceMarked = priceMarked - - self.status = status - - self.canCancel = canCancel - - self.paymentMode = paymentMode - - self.fyndCashMsg = fyndCashMsg - - self.deliveryAddress = deliveryAddress - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enableTracking = try container.decode(Bool.self, forKey: .enableTracking) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(String.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - timeSlot = try container.decode(String.self, forKey: .timeSlot) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productName = try container.decode(String.self, forKey: .productName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - canReturn = try container.decode(Bool.self, forKey: .canReturn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderDate = try container.decode(String.self, forKey: .orderDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isTryAtHome = try container.decode(Bool.self, forKey: .isTryAtHome) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - breakupValues = try container.decode([ShipmentTrackResponseBagListItemBreakValues].self, forKey: .breakupValues) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - statuses = try container.decode([ShipmentTrackResponseBagListItemStatuses].self, forKey: .statuses) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bagId = try container.decode(String.self, forKey: .bagId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderId = try container.decode(String.self, forKey: .orderId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - size = try container.decode(String.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentModeSource = try container.decode(String.self, forKey: .paymentModeSource) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dpDetails = try container.decode(ShipmentTrackResponseBagListItemDpDetails.self, forKey: .dpDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productId = try container.decode(Int.self, forKey: .productId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productImage = try container.decode(ShipmentTrackResponseBagListItemsProductImage.self, forKey: .productImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandName = try container.decode(String.self, forKey: .brandName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priceMarked = try container.decode(String.self, forKey: .priceMarked) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - canCancel = try container.decode(Bool.self, forKey: .canCancel) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentMode = try container.decode(String.self, forKey: .paymentMode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fyndCashMsg = try container.decode(String.self, forKey: .fyndCashMsg) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryAddress = try container.decode(String.self, forKey: .deliveryAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enableTracking, forKey: .enableTracking) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(timeSlot, forKey: .timeSlot) - - - - try? container.encodeIfPresent(productName, forKey: .productName) - - - - try? container.encodeIfPresent(canReturn, forKey: .canReturn) - - - - try? container.encodeIfPresent(orderDate, forKey: .orderDate) - - - - try? container.encodeIfPresent(isTryAtHome, forKey: .isTryAtHome) - - - - try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) - - - - try? container.encodeIfPresent(statuses, forKey: .statuses) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(bagId, forKey: .bagId) - - - - try? container.encodeIfPresent(orderId, forKey: .orderId) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(paymentModeSource, forKey: .paymentModeSource) - - - - try? container.encodeIfPresent(dpDetails, forKey: .dpDetails) - - - - try? container.encodeIfPresent(productId, forKey: .productId) - - - - try? container.encodeIfPresent(productImage, forKey: .productImage) - - - - try? container.encodeIfPresent(brandName, forKey: .brandName) - - - - try? container.encodeIfPresent(priceMarked, forKey: .priceMarked) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(canCancel, forKey: .canCancel) - - - - try? container.encodeIfPresent(paymentMode, forKey: .paymentMode) - - - - try? container.encodeIfPresent(fyndCashMsg, forKey: .fyndCashMsg) - - - - try? container.encodeIfPresent(deliveryAddress, forKey: .deliveryAddress) - - - } - - } - - /* - Model: ShipmentTrackResponseBagListItemBreakValues - Used By: Order - */ - - class ShipmentTrackResponseBagListItemBreakValues: Codable { - - - public var name: String? - - public var display: String? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case display = "display" - - case value = "value" - - } - - public init(display: String?, name: String?, value: String?) { - - self.name = name - - self.display = display - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: ShipmentTrackResponseBagListItemStatuses - Used By: Order - */ - - class ShipmentTrackResponseBagListItemStatuses: Codable { - - - public var npsRating: Int? - - public var npsString: String? - - public var progressStatus: [ShipmentTrackResponseBagListItemStatusesProgress]? - - public var flowType: String? - - public var statusProgress: Int? - - public var isNpsDone: Bool? - - public var headerMessage: String? - - public var isDelayed: String? - - public var trackingList: [ShipmentTrackResponseBagListItemStatusesTrack]? - - - public enum CodingKeys: String, CodingKey { - - case npsRating = "nps_rating" - - case npsString = "nps_string" - - case progressStatus = "progress_status" - - case flowType = "flow_type" - - case statusProgress = "status_progress" - - case isNpsDone = "is_nps_done" - - case headerMessage = "header_message" - - case isDelayed = "is_delayed" - - case trackingList = "tracking_list" - - } - - public init(flowType: String?, headerMessage: String?, isDelayed: String?, isNpsDone: Bool?, npsRating: Int?, npsString: String?, progressStatus: [ShipmentTrackResponseBagListItemStatusesProgress]?, statusProgress: Int?, trackingList: [ShipmentTrackResponseBagListItemStatusesTrack]?) { - - self.npsRating = npsRating - - self.npsString = npsString - - self.progressStatus = progressStatus - - self.flowType = flowType - - self.statusProgress = statusProgress - - self.isNpsDone = isNpsDone - - self.headerMessage = headerMessage - - self.isDelayed = isDelayed - - self.trackingList = trackingList - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - npsRating = try container.decode(Int.self, forKey: .npsRating) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - npsString = try container.decode(String.self, forKey: .npsString) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - progressStatus = try container.decode([ShipmentTrackResponseBagListItemStatusesProgress].self, forKey: .progressStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - flowType = try container.decode(String.self, forKey: .flowType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - statusProgress = try container.decode(Int.self, forKey: .statusProgress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isNpsDone = try container.decode(Bool.self, forKey: .isNpsDone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - headerMessage = try container.decode(String.self, forKey: .headerMessage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isDelayed = try container.decode(String.self, forKey: .isDelayed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - trackingList = try container.decode([ShipmentTrackResponseBagListItemStatusesTrack].self, forKey: .trackingList) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(npsRating, forKey: .npsRating) - - - - try? container.encodeIfPresent(npsString, forKey: .npsString) - - - - try? container.encodeIfPresent(progressStatus, forKey: .progressStatus) - - - - try? container.encodeIfPresent(flowType, forKey: .flowType) - - - - try? container.encodeIfPresent(statusProgress, forKey: .statusProgress) - - - - try? container.encodeIfPresent(isNpsDone, forKey: .isNpsDone) - - - - try? container.encodeIfPresent(headerMessage, forKey: .headerMessage) - - - - try? container.encodeIfPresent(isDelayed, forKey: .isDelayed) - - - - try? container.encodeIfPresent(trackingList, forKey: .trackingList) - - - } - - } - - /* - Model: ShipmentTrackResponseBagListItemStatusesProgress - Used By: Order - */ - - class ShipmentTrackResponseBagListItemStatusesProgress: Codable { - - - public var title: String? - - public var type: String? - - public var state: Bool? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case type = "type" - - case state = "state" - - } - - public init(state: Bool?, title: String?, type: String?) { - - self.title = title - - self.type = type - - self.state = state - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(Bool.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - } - - } - - /* - Model: ShipmentTrackResponseBagListItemStatusesTrack - Used By: Order - */ - - class ShipmentTrackResponseBagListItemStatusesTrack: Codable { - - - public var status: String? - - public var time: String? - - public var isPassed: Bool? - - public var isCurrent: Bool? - - - public enum CodingKeys: String, CodingKey { - - case status = "status" - - case time = "time" - - case isPassed = "is_passed" - - case isCurrent = "is_current" - - } - - public init(isCurrent: Bool?, isPassed: Bool?, status: String?, time: String?) { - - self.status = status - - self.time = time - - self.isPassed = isPassed - - self.isCurrent = isCurrent - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - time = try container.decode(String.self, forKey: .time) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isPassed = try container.decode(Bool.self, forKey: .isPassed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isCurrent = try container.decode(Bool.self, forKey: .isCurrent) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(time, forKey: .time) - - - - try? container.encodeIfPresent(isPassed, forKey: .isPassed) - - - - try? container.encodeIfPresent(isCurrent, forKey: .isCurrent) - - - } - - } - - /* - Model: ShipmentTrackResponseBagListItemDpDetails - Used By: Order - */ - - class ShipmentTrackResponseBagListItemDpDetails: Codable { - - - public var trackingNo: String? - - public var courier: String? - - - public enum CodingKeys: String, CodingKey { - - case trackingNo = "tracking_no" - - case courier = "courier" - - } - - public init(courier: String?, trackingNo: String?) { - - self.trackingNo = trackingNo - - self.courier = courier - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - trackingNo = try container.decode(String.self, forKey: .trackingNo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - courier = try container.decode(String.self, forKey: .courier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(trackingNo, forKey: .trackingNo) - - - - try? container.encodeIfPresent(courier, forKey: .courier) - - - } - - } - - /* - Model: ShipmentTrackResponseBagListItemsProductImage - Used By: Order - */ - - class ShipmentTrackResponseBagListItemsProductImage: Codable { - - - public var aspectRatio: String? - - public var url: String? - - - public enum CodingKeys: String, CodingKey { - - case aspectRatio = "aspect_ratio" - - case url = "url" - - } - - public init(aspectRatio: String?, url: String?) { - - self.aspectRatio = aspectRatio - - self.url = url - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - aspectRatio = try container.decode(String.self, forKey: .aspectRatio) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - } - - } - - /* - Model: UpdateShipmentStatusResponse - Used By: Order - */ - - class UpdateShipmentStatusResponse: Codable { - - - public var shipments: [String: Any] - - public var errorShipments: [[String: Any]]? - - - public enum CodingKeys: String, CodingKey { - - case shipments = "shipments" - - case errorShipments = "error_shipments" - - } - - public init(errorShipments: [[String: Any]]?, shipments: [String: Any]) { - - self.shipments = shipments - - self.errorShipments = errorShipments - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - shipments = try container.decode([String: Any].self, forKey: .shipments) - - - - - do { - errorShipments = try container.decode([[String: Any]].self, forKey: .errorShipments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(shipments, forKey: .shipments) - - - - try? container.encodeIfPresent(errorShipments, forKey: .errorShipments) - - - } - - } - - /* - Model: UpdateShipmentStatusBody - Used By: Order - */ - - class UpdateShipmentStatusBody: Codable { - - - public var shipments: [String: Any] - - public var forceTransition: Bool - - public var task: Bool - - - public enum CodingKeys: String, CodingKey { - - case shipments = "shipments" - - case forceTransition = "force_transition" - - case task = "task" - - } - - public init(forceTransition: Bool, shipments: [String: Any], task: Bool) { - - self.shipments = shipments - - self.forceTransition = forceTransition - - self.task = task - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - shipments = try container.decode([String: Any].self, forKey: .shipments) - - - - - forceTransition = try container.decode(Bool.self, forKey: .forceTransition) - - - - - task = try container.decode(Bool.self, forKey: .task) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(shipments, forKey: .shipments) - - - - try? container.encodeIfPresent(forceTransition, forKey: .forceTransition) - - - - try? container.encodeIfPresent(task, forKey: .task) - - - } - - } - - /* - Model: ShipmentReasonsResponse - Used By: Order - */ - - class ShipmentReasonsResponse: Codable { - - - public var success: Bool - - public var message: String - - public var reasons: [ShipmentResponseReasons] - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case message = "message" - - case reasons = "reasons" - - } - - public init(message: String, reasons: [ShipmentResponseReasons], success: Bool) { - - self.success = success - - self.message = message - - self.reasons = reasons - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - message = try container.decode(String.self, forKey: .message) - - - - - reasons = try container.decode([ShipmentResponseReasons].self, forKey: .reasons) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(reasons, forKey: .reasons) - - - } - - } - - /* - Model: ShipmentResponseReasons - Used By: Order - */ - - class ShipmentResponseReasons: Codable { - - - public var reasonId: Double? - - public var reason: String? - - - public enum CodingKeys: String, CodingKey { - - case reasonId = "reason_id" - - case reason = "reason" - - } - - public init(reason: String?, reasonId: Double?) { - - self.reasonId = reasonId - - self.reason = reason - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - reasonId = try container.decode(Double.self, forKey: .reasonId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - reason = try container.decode(String.self, forKey: .reason) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(reasonId, forKey: .reasonId) - - - - try? container.encodeIfPresent(reason, forKey: .reason) - - - } - - } - - /* - Model: PlatformShipmentTrack - Used By: Order - */ - - class PlatformShipmentTrack: Codable { - - - public var results: Results - - - public enum CodingKeys: String, CodingKey { - - case results = "results" - - } - - public init(results: Results) { - - self.results = results - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - results = try container.decode(Results.self, forKey: .results) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(results, forKey: .results) - - - } - - } - - /* - Model: Results - Used By: Order - */ - - class Results: Codable { - - - public var awb: String? - - public var updatedAt: String? - - public var lastLocationRecievedAt: String? - - public var reason: String? - - public var shipmentType: String? - - public var status: String? - - public var updatedTime: String? - - public var accountName: String? - - - public enum CodingKeys: String, CodingKey { - - case awb = "awb" - - case updatedAt = "updated_at" - - case lastLocationRecievedAt = "last_location_recieved_at" - - case reason = "reason" - - case shipmentType = "shipment_type" - - case status = "status" - - case updatedTime = "updated_time" - - case accountName = "account_name" - - } - - public init(accountName: String?, awb: String?, lastLocationRecievedAt: String?, reason: String?, shipmentType: String?, status: String?, updatedAt: String?, updatedTime: String?) { - - self.awb = awb - - self.updatedAt = updatedAt - - self.lastLocationRecievedAt = lastLocationRecievedAt - - self.reason = reason - - self.shipmentType = shipmentType - - self.status = status - - self.updatedTime = updatedTime - - self.accountName = accountName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - awb = try container.decode(String.self, forKey: .awb) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastLocationRecievedAt = try container.decode(String.self, forKey: .lastLocationRecievedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - reason = try container.decode(String.self, forKey: .reason) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - shipmentType = try container.decode(String.self, forKey: .shipmentType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedTime = try container.decode(String.self, forKey: .updatedTime) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - accountName = try container.decode(String.self, forKey: .accountName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(awb, forKey: .awb) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(lastLocationRecievedAt, forKey: .lastLocationRecievedAt) - - - - try? container.encodeIfPresent(reason, forKey: .reason) - - - - try? container.encodeIfPresent(shipmentType, forKey: .shipmentType) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(updatedTime, forKey: .updatedTime) - - - - try? container.encodeIfPresent(accountName, forKey: .accountName) - - - } - - } - - /* - Model: ShipmentUpdateRequest - Used By: Order - */ - - class ShipmentUpdateRequest: Codable { - - - public var bags: [String] - - public var reason: [String: Any] - - public var comments: String - - public var action: String - - - public enum CodingKeys: String, CodingKey { - - case bags = "bags" - - case reason = "reason" - - case comments = "comments" - - case action = "action" - - } - - public init(action: String, bags: [String], comments: String, reason: [String: Any]) { - - self.bags = bags - - self.reason = reason - - self.comments = comments - - self.action = action - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - bags = try container.decode([String].self, forKey: .bags) - - - - - reason = try container.decode([String: Any].self, forKey: .reason) - - - - - comments = try container.decode(String.self, forKey: .comments) - - - - - action = try container.decode(String.self, forKey: .action) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(bags, forKey: .bags) - - - - try? container.encodeIfPresent(reason, forKey: .reason) - - - - try? container.encodeIfPresent(comments, forKey: .comments) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - } - - } - - /* - Model: ShipmentUpdateResponse - Used By: Order - */ - - class ShipmentUpdateResponse: Codable { - - - public var success: Bool - - public var message: String - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case message = "message" - - } - - public init(message: String, success: Bool) { - - self.success = success - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - message = try container.decode(String.self, forKey: .message) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: UpdateProcessShipmenstRequestBody - Used By: Order - */ - - class UpdateProcessShipmenstRequestBody: Codable { - - - public var shipmentIds: [String] - - public var expectedStatus: String - - - public enum CodingKeys: String, CodingKey { - - case shipmentIds = "shipment_ids" - - case expectedStatus = "expected_status" - - } - - public init(expectedStatus: String, shipmentIds: [String]) { - - self.shipmentIds = shipmentIds - - self.expectedStatus = expectedStatus - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - shipmentIds = try container.decode([String].self, forKey: .shipmentIds) - - - - - expectedStatus = try container.decode(String.self, forKey: .expectedStatus) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(shipmentIds, forKey: .shipmentIds) - - - - try? container.encodeIfPresent(expectedStatus, forKey: .expectedStatus) - - - } - - } - - /* - Model: UpdateProcessShipmenstRequestResponse - Used By: Order - */ - - class UpdateProcessShipmenstRequestResponse: Codable { - - - public var success: Bool - - public var message: String - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case message = "message" - - } - - public init(message: String, success: Bool) { - - self.success = success - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - message = try container.decode(String.self, forKey: .message) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: GetVoiceCallbackResponse - Used By: Order - */ - - class GetVoiceCallbackResponse: Codable { - - - public var message: String - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - message = try container.decode(String.self, forKey: .message) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: GetClickToCallResponse - Used By: Order - */ - - class GetClickToCallResponse: Codable { - - - public var message: String - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - message = try container.decode(String.self, forKey: .message) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: ApefaceApiError - Used By: Order - */ - - class ApefaceApiError: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - - - /* - Model: DeleteResponse - Used By: Catalog - */ - - class DeleteResponse: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: ErrorResponse - Used By: Catalog - */ - - class ErrorResponse: Codable { - - - public var meta: [String: Any]? - - public var message: String? - - public var status: Int? - - public var code: String? - - - public enum CodingKeys: String, CodingKey { - - case meta = "meta" - - case message = "message" - - case status = "status" - - case code = "code" - - } - - public init(code: String?, message: String?, meta: [String: Any]?, status: Int?) { - - self.meta = meta - - self.message = message - - self.status = status - - self.code = code - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(Int.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - } - - } - - /* - Model: SearchKeywordResult - Used By: Catalog - */ - - class SearchKeywordResult: Codable { - - - public var query: [String: Any] - - public var sortOn: String - - - public enum CodingKeys: String, CodingKey { - - case query = "query" - - case sortOn = "sort_on" - - } - - public init(query: [String: Any], sortOn: String) { - - self.query = query - - self.sortOn = sortOn - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - query = try container.decode([String: Any].self, forKey: .query) - - - - - sortOn = try container.decode(String.self, forKey: .sortOn) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(query, forKey: .query) - - - - try? container.encodeIfPresent(sortOn, forKey: .sortOn) - - - } - - } - - /* - Model: CreateSearchKeyword - Used By: Catalog - */ - - class CreateSearchKeyword: Codable { - - - public var result: SearchKeywordResult - - public var isActive: Bool? - - public var appId: String? - - public var customJson: [String: Any]? - - public var words: [String]? - - - public enum CodingKeys: String, CodingKey { - - case result = "result" - - case isActive = "is_active" - - case appId = "app_id" - - case customJson = "_custom_json" - - case words = "words" - - } - - public init(appId: String?, isActive: Bool?, result: SearchKeywordResult, words: [String]?, customJson: [String: Any]?) { - - self.result = result - - self.isActive = isActive - - self.appId = appId - - self.customJson = customJson - - self.words = words - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - result = try container.decode(SearchKeywordResult.self, forKey: .result) - - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - words = try container.decode([String].self, forKey: .words) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(result, forKey: .result) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(words, forKey: .words) - - - } - - } - - /* - Model: GetSearchWordsData - Used By: Catalog - */ - - class GetSearchWordsData: Codable { - - - public var result: [String: Any]? - - public var appId: String? - - public var customJson: [String: Any]? - - public var words: [String]? - - public var uid: String? - - - public enum CodingKeys: String, CodingKey { - - case result = "result" - - case appId = "app_id" - - case customJson = "_custom_json" - - case words = "words" - - case uid = "uid" - - } - - public init(appId: String?, result: [String: Any]?, uid: String?, words: [String]?, customJson: [String: Any]?) { - - self.result = result - - self.appId = appId - - self.customJson = customJson - - self.words = words - - self.uid = uid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - result = try container.decode([String: Any].self, forKey: .result) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - words = try container.decode([String].self, forKey: .words) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(result, forKey: .result) - - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(words, forKey: .words) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - } - - } - - /* - Model: GetSearchWordsDetailResponse - Used By: Catalog - */ - - class GetSearchWordsDetailResponse: Codable { - - - public var items: GetSearchWordsData? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: GetSearchWordsData?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode(GetSearchWordsData.self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: GetSearchWordsResponse - Used By: Catalog - */ - - class GetSearchWordsResponse: Codable { - - - public var items: [GetSearchWordsData]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [GetSearchWordsData]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([GetSearchWordsData].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: Media - Used By: Catalog - */ - - class Media: Codable { - - - public var url: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case url = "url" - - case type = "type" - - } - - public init(type: String?, url: String?) { - - self.url = url - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: AutocompletePageAction - Used By: Catalog - */ - - class AutocompletePageAction: Codable { - - - public var query: [String: Any] - - public var url: String? - - public var params: [String: Any]? - - public var type: String - - - public enum CodingKeys: String, CodingKey { - - case query = "query" - - case url = "url" - - case params = "params" - - case type = "type" - - } - - public init(params: [String: Any]?, query: [String: Any], type: String, url: String?) { - - self.query = query - - self.url = url - - self.params = params - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - query = try container.decode([String: Any].self, forKey: .query) - - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - params = try container.decode([String: Any].self, forKey: .params) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - type = try container.decode(String.self, forKey: .type) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(query, forKey: .query) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(params, forKey: .params) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: AutocompleteAction - Used By: Catalog - */ - - class AutocompleteAction: Codable { - - - public var page: AutocompletePageAction? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case page = "page" - - case type = "type" - - } - - public init(page: AutocompletePageAction?, type: String?) { - - self.page = page - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - page = try container.decode(AutocompletePageAction.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: AutocompleteResult - Used By: Catalog - */ - - class AutocompleteResult: Codable { - - - public var customJson: [String: Any]? - - public var logo: Media? - - public var display: String? - - public var action: AutocompleteAction? - - - public enum CodingKeys: String, CodingKey { - - case customJson = "_custom_json" - - case logo = "logo" - - case display = "display" - - case action = "action" - - } - - public init(action: AutocompleteAction?, display: String?, logo: Media?, customJson: [String: Any]?) { - - self.customJson = customJson - - self.logo = logo - - self.display = display - - self.action = action - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(Media.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(AutocompleteAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - } - - } - - /* - Model: CreateAutocompleteKeyword - Used By: Catalog - */ - - class CreateAutocompleteKeyword: Codable { - - - public var isActive: Bool? - - public var results: [AutocompleteResult]? - - public var appId: String? - - public var customJson: [String: Any]? - - public var words: [String]? - - - public enum CodingKeys: String, CodingKey { - - case isActive = "is_active" - - case results = "results" - - case appId = "app_id" - - case customJson = "_custom_json" - - case words = "words" - - } - - public init(appId: String?, isActive: Bool?, results: [AutocompleteResult]?, words: [String]?, customJson: [String: Any]?) { - - self.isActive = isActive - - self.results = results - - self.appId = appId - - self.customJson = customJson - - self.words = words - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - results = try container.decode([AutocompleteResult].self, forKey: .results) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - words = try container.decode([String].self, forKey: .words) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(results, forKey: .results) - - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(words, forKey: .words) - - - } - - } - - /* - Model: GetAutocompleteWordsData - Used By: Catalog - */ - - class GetAutocompleteWordsData: Codable { - - - public var results: [[String: Any]]? - - public var appId: String? - - public var customJson: [String: Any]? - - public var words: [String]? - - public var uid: String? - - - public enum CodingKeys: String, CodingKey { - - case results = "results" - - case appId = "app_id" - - case customJson = "_custom_json" - - case words = "words" - - case uid = "uid" - - } - - public init(appId: String?, results: [[String: Any]]?, uid: String?, words: [String]?, customJson: [String: Any]?) { - - self.results = results - - self.appId = appId - - self.customJson = customJson - - self.words = words - - self.uid = uid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - results = try container.decode([[String: Any]].self, forKey: .results) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - words = try container.decode([String].self, forKey: .words) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(results, forKey: .results) - - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(words, forKey: .words) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - } - - } - - /* - Model: GetAutocompleteWordsResponse - Used By: Catalog - */ - - class GetAutocompleteWordsResponse: Codable { - - - public var items: [GetAutocompleteWordsData]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [GetAutocompleteWordsData]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([GetAutocompleteWordsData].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: CreateAutocompleteWordsResponse - Used By: Catalog - */ - - class CreateAutocompleteWordsResponse: Codable { - - - public var appId: String? - - public var customJson: [String: Any]? - - public var words: [String]? - - public var results: [[String: Any]]? - - - public enum CodingKeys: String, CodingKey { - - case appId = "app_id" - - case customJson = "_custom_json" - - case words = "words" - - case results = "results" - - } - - public init(appId: String?, results: [[String: Any]]?, words: [String]?, customJson: [String: Any]?) { - - self.appId = appId - - self.customJson = customJson - - self.words = words - - self.results = results - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - words = try container.decode([String].self, forKey: .words) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - results = try container.decode([[String: Any]].self, forKey: .results) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(words, forKey: .words) - - - - try? container.encodeIfPresent(results, forKey: .results) - - - } - - } - - /* - Model: ProductBundleItem - Used By: Catalog - */ - - class ProductBundleItem: Codable { - - - public var minQuantity: Int - - public var autoAddToCart: Bool? - - public var allowRemove: Bool? - - public var maxQuantity: Int - - public var autoSelect: Bool? - - public var productUid: Int - - - public enum CodingKeys: String, CodingKey { - - case minQuantity = "min_quantity" - - case autoAddToCart = "auto_add_to_cart" - - case allowRemove = "allow_remove" - - case maxQuantity = "max_quantity" - - case autoSelect = "auto_select" - - case productUid = "product_uid" - - } - - public init(allowRemove: Bool?, autoAddToCart: Bool?, autoSelect: Bool?, maxQuantity: Int, minQuantity: Int, productUid: Int) { - - self.minQuantity = minQuantity - - self.autoAddToCart = autoAddToCart - - self.allowRemove = allowRemove - - self.maxQuantity = maxQuantity - - self.autoSelect = autoSelect - - self.productUid = productUid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - minQuantity = try container.decode(Int.self, forKey: .minQuantity) - - - - - do { - autoAddToCart = try container.decode(Bool.self, forKey: .autoAddToCart) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allowRemove = try container.decode(Bool.self, forKey: .allowRemove) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - maxQuantity = try container.decode(Int.self, forKey: .maxQuantity) - - - - - do { - autoSelect = try container.decode(Bool.self, forKey: .autoSelect) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - productUid = try container.decode(Int.self, forKey: .productUid) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(minQuantity, forKey: .minQuantity) - - - - try? container.encodeIfPresent(autoAddToCart, forKey: .autoAddToCart) - - - - try? container.encodeIfPresent(allowRemove, forKey: .allowRemove) - - - - try? container.encodeIfPresent(maxQuantity, forKey: .maxQuantity) - - - - try? container.encodeIfPresent(autoSelect, forKey: .autoSelect) - - - - try? container.encodeIfPresent(productUid, forKey: .productUid) - - - } - - } - - /* - Model: ProductBundleRequest - Used By: Catalog - */ - - class ProductBundleRequest: Codable { - - - public var createdBy: [String: Any]? - - public var choice: String - - public var pageVisibility: [String]? - - public var createdOn: String? - - public var slug: String - - public var products: [ProductBundleItem] - - public var meta: [String: Any]? - - public var logo: String? - - public var modifiedBy: [String: Any]? - - public var isActive: Bool - - public var modifiedOn: String? - - public var sameStoreAssignment: Bool? - - public var name: String - - - public enum CodingKeys: String, CodingKey { - - case createdBy = "created_by" - - case choice = "choice" - - case pageVisibility = "page_visibility" - - case createdOn = "created_on" - - case slug = "slug" - - case products = "products" - - case meta = "meta" - - case logo = "logo" - - case modifiedBy = "modified_by" - - case isActive = "is_active" - - case modifiedOn = "modified_on" - - case sameStoreAssignment = "same_store_assignment" - - case name = "name" - - } - - public init(choice: String, createdBy: [String: Any]?, createdOn: String?, isActive: Bool, logo: String?, meta: [String: Any]?, modifiedBy: [String: Any]?, modifiedOn: String?, name: String, pageVisibility: [String]?, products: [ProductBundleItem], sameStoreAssignment: Bool?, slug: String) { - - self.createdBy = createdBy - - self.choice = choice - - self.pageVisibility = pageVisibility - - self.createdOn = createdOn - - self.slug = slug - - self.products = products - - self.meta = meta - - self.logo = logo - - self.modifiedBy = modifiedBy - - self.isActive = isActive - - self.modifiedOn = modifiedOn - - self.sameStoreAssignment = sameStoreAssignment - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdBy = try container.decode([String: Any].self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - choice = try container.decode(String.self, forKey: .choice) - - - - - do { - pageVisibility = try container.decode([String].self, forKey: .pageVisibility) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - slug = try container.decode(String.self, forKey: .slug) - - - - - products = try container.decode([ProductBundleItem].self, forKey: .products) - - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode([String: Any].self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - isActive = try container.decode(Bool.self, forKey: .isActive) - - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sameStoreAssignment = try container.decode(Bool.self, forKey: .sameStoreAssignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(choice, forKey: .choice) - - - - try? container.encodeIfPresent(pageVisibility, forKey: .pageVisibility) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(products, forKey: .products) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(sameStoreAssignment, forKey: .sameStoreAssignment) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: GetProductBundleCreateResponse - Used By: Catalog - */ - - class GetProductBundleCreateResponse: Codable { - - - public var createdBy: [String: Any]? - - public var choice: String - - public var companyId: Int? - - public var pageVisibility: [String]? - - public var createdOn: String? - - public var slug: String - - public var products: [ProductBundleItem] - - public var meta: [String: Any]? - - public var logo: String? - - public var modifiedBy: [String: Any]? - - public var isActive: Bool - - public var modifiedOn: String? - - public var sameStoreAssignment: Bool? - - public var id: String? - - public var name: String - - - public enum CodingKeys: String, CodingKey { - - case createdBy = "created_by" - - case choice = "choice" - - case companyId = "company_id" - - case pageVisibility = "page_visibility" - - case createdOn = "created_on" - - case slug = "slug" - - case products = "products" - - case meta = "meta" - - case logo = "logo" - - case modifiedBy = "modified_by" - - case isActive = "is_active" - - case modifiedOn = "modified_on" - - case sameStoreAssignment = "same_store_assignment" - - case id = "id" - - case name = "name" - - } - - public init(choice: String, companyId: Int?, createdBy: [String: Any]?, createdOn: String?, id: String?, isActive: Bool, logo: String?, meta: [String: Any]?, modifiedBy: [String: Any]?, modifiedOn: String?, name: String, pageVisibility: [String]?, products: [ProductBundleItem], sameStoreAssignment: Bool?, slug: String) { - - self.createdBy = createdBy - - self.choice = choice - - self.companyId = companyId - - self.pageVisibility = pageVisibility - - self.createdOn = createdOn - - self.slug = slug - - self.products = products - - self.meta = meta - - self.logo = logo - - self.modifiedBy = modifiedBy - - self.isActive = isActive - - self.modifiedOn = modifiedOn - - self.sameStoreAssignment = sameStoreAssignment - - self.id = id - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdBy = try container.decode([String: Any].self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - choice = try container.decode(String.self, forKey: .choice) - - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pageVisibility = try container.decode([String].self, forKey: .pageVisibility) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - slug = try container.decode(String.self, forKey: .slug) - - - - - products = try container.decode([ProductBundleItem].self, forKey: .products) - - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode([String: Any].self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - isActive = try container.decode(Bool.self, forKey: .isActive) - - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sameStoreAssignment = try container.decode(Bool.self, forKey: .sameStoreAssignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(choice, forKey: .choice) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(pageVisibility, forKey: .pageVisibility) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(products, forKey: .products) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(sameStoreAssignment, forKey: .sameStoreAssignment) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: GetProductBundleListingResponse - Used By: Catalog - */ - - class GetProductBundleListingResponse: Codable { - - - public var items: [GetProductBundleCreateResponse]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [GetProductBundleCreateResponse]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([GetProductBundleCreateResponse].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: ProductBundleUpdateRequest - Used By: Catalog - */ - - class ProductBundleUpdateRequest: Codable { - - - public var choice: String - - public var pageVisibility: [String]? - - public var slug: String - - public var products: [ProductBundleItem] - - public var meta: [String: Any]? - - public var logo: String? - - public var modifiedBy: [String: Any]? - - public var isActive: Bool - - public var modifiedOn: String? - - public var sameStoreAssignment: Bool? - - public var name: String - - - public enum CodingKeys: String, CodingKey { - - case choice = "choice" - - case pageVisibility = "page_visibility" - - case slug = "slug" - - case products = "products" - - case meta = "meta" - - case logo = "logo" - - case modifiedBy = "modified_by" - - case isActive = "is_active" - - case modifiedOn = "modified_on" - - case sameStoreAssignment = "same_store_assignment" - - case name = "name" - - } - - public init(choice: String, isActive: Bool, logo: String?, meta: [String: Any]?, modifiedBy: [String: Any]?, modifiedOn: String?, name: String, pageVisibility: [String]?, products: [ProductBundleItem], sameStoreAssignment: Bool?, slug: String) { - - self.choice = choice - - self.pageVisibility = pageVisibility - - self.slug = slug - - self.products = products - - self.meta = meta - - self.logo = logo - - self.modifiedBy = modifiedBy - - self.isActive = isActive - - self.modifiedOn = modifiedOn - - self.sameStoreAssignment = sameStoreAssignment - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - choice = try container.decode(String.self, forKey: .choice) - - - - - do { - pageVisibility = try container.decode([String].self, forKey: .pageVisibility) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - slug = try container.decode(String.self, forKey: .slug) - - - - - products = try container.decode([ProductBundleItem].self, forKey: .products) - - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode([String: Any].self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - isActive = try container.decode(Bool.self, forKey: .isActive) - - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sameStoreAssignment = try container.decode(Bool.self, forKey: .sameStoreAssignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(choice, forKey: .choice) - - - - try? container.encodeIfPresent(pageVisibility, forKey: .pageVisibility) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(products, forKey: .products) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(sameStoreAssignment, forKey: .sameStoreAssignment) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: LimitedProductData - Used By: Catalog - */ - - class LimitedProductData: Codable { - - - public var shortDescription: String? - - public var name: String? - - public var images: [String]? - - public var attributes: [String: Any]? - - public var itemCode: String? - - public var countryOfOrigin: String? - - public var quantity: Int? - - public var sizes: [String]? - - public var slug: String? - - public var uid: Int? - - public var identifier: [String: Any]? - - public var price: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case shortDescription = "short_description" - - case name = "name" - - case images = "images" - - case attributes = "attributes" - - case itemCode = "item_code" - - case countryOfOrigin = "country_of_origin" - - case quantity = "quantity" - - case sizes = "sizes" - - case slug = "slug" - - case uid = "uid" - - case identifier = "identifier" - - case price = "price" - - } - - public init(attributes: [String: Any]?, countryOfOrigin: String?, identifier: [String: Any]?, images: [String]?, itemCode: String?, name: String?, price: [String: Any]?, quantity: Int?, shortDescription: String?, sizes: [String]?, slug: String?, uid: Int?) { - - self.shortDescription = shortDescription - - self.name = name - - self.images = images - - self.attributes = attributes - - self.itemCode = itemCode - - self.countryOfOrigin = countryOfOrigin - - self.quantity = quantity - - self.sizes = sizes - - self.slug = slug - - self.uid = uid - - self.identifier = identifier - - self.price = price - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - shortDescription = try container.decode(String.self, forKey: .shortDescription) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - images = try container.decode([String].self, forKey: .images) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attributes = try container.decode([String: Any].self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemCode = try container.decode(String.self, forKey: .itemCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryOfOrigin = try container.decode(String.self, forKey: .countryOfOrigin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sizes = try container.decode([String].self, forKey: .sizes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - identifier = try container.decode([String: Any].self, forKey: .identifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode([String: Any].self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(shortDescription, forKey: .shortDescription) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(images, forKey: .images) - - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - - try? container.encodeIfPresent(itemCode, forKey: .itemCode) - - - - try? container.encodeIfPresent(countryOfOrigin, forKey: .countryOfOrigin) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - - try? container.encodeIfPresent(sizes, forKey: .sizes) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(identifier, forKey: .identifier) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - } - - } - - /* - Model: Size - Used By: Catalog - */ - - class Size: Codable { - - - public var isAvailable: Bool? - - public var display: String? - - public var quantity: Int? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case isAvailable = "is_available" - - case display = "display" - - case quantity = "quantity" - - case value = "value" - - } - - public init(display: String?, isAvailable: Bool?, quantity: Int?, value: String?) { - - self.isAvailable = isAvailable - - self.display = display - - self.quantity = quantity - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isAvailable = try container.decode(Bool.self, forKey: .isAvailable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isAvailable, forKey: .isAvailable) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: Price - Used By: Catalog - */ - - class Price: Codable { - - - public var minEffective: Double? - - public var minMarked: Double? - - public var maxMarked: Double? - - public var currency: String? - - public var maxEffective: Double? - - - public enum CodingKeys: String, CodingKey { - - case minEffective = "min_effective" - - case minMarked = "min_marked" - - case maxMarked = "max_marked" - - case currency = "currency" - - case maxEffective = "max_effective" - - } - - public init(currency: String?, maxEffective: Double?, maxMarked: Double?, minEffective: Double?, minMarked: Double?) { - - self.minEffective = minEffective - - self.minMarked = minMarked - - self.maxMarked = maxMarked - - self.currency = currency - - self.maxEffective = maxEffective - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - minEffective = try container.decode(Double.self, forKey: .minEffective) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - minMarked = try container.decode(Double.self, forKey: .minMarked) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - maxMarked = try container.decode(Double.self, forKey: .maxMarked) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(String.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - maxEffective = try container.decode(Double.self, forKey: .maxEffective) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(minEffective, forKey: .minEffective) - - - - try? container.encodeIfPresent(minMarked, forKey: .minMarked) - - - - try? container.encodeIfPresent(maxMarked, forKey: .maxMarked) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(maxEffective, forKey: .maxEffective) - - - } - - } - - /* - Model: GetProducts - Used By: Catalog - */ - - class GetProducts: Codable { - - - public var minQuantity: Int? - - public var autoAddToCart: Bool? - - public var allowRemove: Bool? - - public var maxQuantity: Int? - - public var productDetails: LimitedProductData? - - public var sizes: [Size]? - - public var autoSelect: Bool? - - public var productUid: Int? - - public var price: Price? - - - public enum CodingKeys: String, CodingKey { - - case minQuantity = "min_quantity" - - case autoAddToCart = "auto_add_to_cart" - - case allowRemove = "allow_remove" - - case maxQuantity = "max_quantity" - - case productDetails = "product_details" - - case sizes = "sizes" - - case autoSelect = "auto_select" - - case productUid = "product_uid" - - case price = "price" - - } - - public init(allowRemove: Bool?, autoAddToCart: Bool?, autoSelect: Bool?, maxQuantity: Int?, minQuantity: Int?, price: Price?, productDetails: LimitedProductData?, productUid: Int?, sizes: [Size]?) { - - self.minQuantity = minQuantity - - self.autoAddToCart = autoAddToCart - - self.allowRemove = allowRemove - - self.maxQuantity = maxQuantity - - self.productDetails = productDetails - - self.sizes = sizes - - self.autoSelect = autoSelect - - self.productUid = productUid - - self.price = price - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - minQuantity = try container.decode(Int.self, forKey: .minQuantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - autoAddToCart = try container.decode(Bool.self, forKey: .autoAddToCart) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allowRemove = try container.decode(Bool.self, forKey: .allowRemove) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - maxQuantity = try container.decode(Int.self, forKey: .maxQuantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productDetails = try container.decode(LimitedProductData.self, forKey: .productDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sizes = try container.decode([Size].self, forKey: .sizes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - autoSelect = try container.decode(Bool.self, forKey: .autoSelect) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productUid = try container.decode(Int.self, forKey: .productUid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(Price.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(minQuantity, forKey: .minQuantity) - - - - try? container.encodeIfPresent(autoAddToCart, forKey: .autoAddToCart) - - - - try? container.encodeIfPresent(allowRemove, forKey: .allowRemove) - - - - try? container.encodeIfPresent(maxQuantity, forKey: .maxQuantity) - - - - try? container.encodeIfPresent(productDetails, forKey: .productDetails) - - - - try? container.encodeIfPresent(sizes, forKey: .sizes) - - - - try? container.encodeIfPresent(autoSelect, forKey: .autoSelect) - - - - try? container.encodeIfPresent(productUid, forKey: .productUid) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - } - - } - - /* - Model: GetProductBundleResponse - Used By: Catalog - */ - - class GetProductBundleResponse: Codable { - - - public var choice: String? - - public var companyId: Int? - - public var pageVisibility: [String]? - - public var slug: String? - - public var products: [GetProducts]? - - public var meta: [String: Any]? - - public var logo: String? - - public var isActive: Bool? - - public var sameStoreAssignment: Bool? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case choice = "choice" - - case companyId = "company_id" - - case pageVisibility = "page_visibility" - - case slug = "slug" - - case products = "products" - - case meta = "meta" - - case logo = "logo" - - case isActive = "is_active" - - case sameStoreAssignment = "same_store_assignment" - - case name = "name" - - } - - public init(choice: String?, companyId: Int?, isActive: Bool?, logo: String?, meta: [String: Any]?, name: String?, pageVisibility: [String]?, products: [GetProducts]?, sameStoreAssignment: Bool?, slug: String?) { - - self.choice = choice - - self.companyId = companyId - - self.pageVisibility = pageVisibility - - self.slug = slug - - self.products = products - - self.meta = meta - - self.logo = logo - - self.isActive = isActive - - self.sameStoreAssignment = sameStoreAssignment - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - choice = try container.decode(String.self, forKey: .choice) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pageVisibility = try container.decode([String].self, forKey: .pageVisibility) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - products = try container.decode([GetProducts].self, forKey: .products) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sameStoreAssignment = try container.decode(Bool.self, forKey: .sameStoreAssignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(choice, forKey: .choice) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(pageVisibility, forKey: .pageVisibility) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(products, forKey: .products) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(sameStoreAssignment, forKey: .sameStoreAssignment) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: Meta - Used By: Catalog - */ - - class Meta: Codable { - - - public var values: [[String: Any]]? - - public var unit: String? - - public var headers: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case values = "values" - - case unit = "unit" - - case headers = "headers" - - } - - public init(headers: [String: Any]?, unit: String?, values: [[String: Any]]?) { - - self.values = values - - self.unit = unit - - self.headers = headers - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - values = try container.decode([[String: Any]].self, forKey: .values) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - unit = try container.decode(String.self, forKey: .unit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - headers = try container.decode([String: Any].self, forKey: .headers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(values, forKey: .values) - - - - try? container.encodeIfPresent(unit, forKey: .unit) - - - - try? container.encodeIfPresent(headers, forKey: .headers) - - - } - - } - - /* - Model: Guide - Used By: Catalog - */ - - class Guide: Codable { - - - public var meta: Meta? - - - public enum CodingKeys: String, CodingKey { - - case meta = "meta" - - } - - public init(meta: Meta?) { - - self.meta = meta - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - meta = try container.decode(Meta.self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - } - - } - - /* - Model: ValidateSizeGuide - Used By: Catalog - */ - - class ValidateSizeGuide: Codable { - - - public var description: String? - - public var createdBy: [String: Any]? - - public var tag: String? - - public var companyId: Int? - - public var createdOn: String? - - public var guide: Guide? - - public var active: Bool? - - public var modifiedOn: String? - - public var image: String? - - public var id: String? - - public var modifiedBy: [String: Any]? - - public var title: String - - public var subtitle: String? - - public var name: String - - public var brandId: Int? - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case createdBy = "created_by" - - case tag = "tag" - - case companyId = "company_id" - - case createdOn = "created_on" - - case guide = "guide" - - case active = "active" - - case modifiedOn = "modified_on" - - case image = "image" - - case id = "id" - - case modifiedBy = "modified_by" - - case title = "title" - - case subtitle = "subtitle" - - case name = "name" - - case brandId = "brand_id" - - } - - public init(active: Bool?, brandId: Int?, companyId: Int?, createdBy: [String: Any]?, createdOn: String?, description: String?, guide: Guide?, id: String?, image: String?, modifiedBy: [String: Any]?, modifiedOn: String?, name: String, subtitle: String?, tag: String?, title: String) { - - self.description = description - - self.createdBy = createdBy - - self.tag = tag - - self.companyId = companyId - - self.createdOn = createdOn - - self.guide = guide - - self.active = active - - self.modifiedOn = modifiedOn - - self.image = image - - self.id = id - - self.modifiedBy = modifiedBy - - self.title = title - - self.subtitle = subtitle - - self.name = name - - self.brandId = brandId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode([String: Any].self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tag = try container.decode(String.self, forKey: .tag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - guide = try container.decode(Guide.self, forKey: .guide) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - image = try container.decode(String.self, forKey: .image) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode([String: Any].self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - title = try container.decode(String.self, forKey: .title) - - - - - do { - subtitle = try container.decode(String.self, forKey: .subtitle) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - - do { - brandId = try container.decode(Int.self, forKey: .brandId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(tag, forKey: .tag) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(guide, forKey: .guide) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(image, forKey: .image) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(subtitle, forKey: .subtitle) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(brandId, forKey: .brandId) - - - } - - } - - /* - Model: SuccessResponse - Used By: Catalog - */ - - class SuccessResponse: Codable { - - - public var uid: Int? - - public var success: Bool? - - - public enum CodingKeys: String, CodingKey { - - case uid = "uid" - - case success = "success" - - } - - public init(success: Bool?, uid: Int?) { - - self.uid = uid - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: ListSizeGuide - Used By: Catalog - */ - - class ListSizeGuide: Codable { - - - public var items: [[String: Any]]? - - public var page: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [[String: Any]]?, page: [String: Any]?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([[String: Any]].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode([String: Any].self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: SizeGuideResponse - Used By: Catalog - */ - - class SizeGuideResponse: Codable { - - - public var createdBy: [String: Any]? - - public var tag: String? - - public var companyId: Int? - - public var createdOn: String? - - public var guide: [String: Any]? - - public var active: Bool? - - public var modifiedOn: String? - - public var id: String? - - public var modifiedBy: [String: Any]? - - public var title: String? - - public var subtitle: String? - - public var name: String? - - public var brandId: Int? - - - public enum CodingKeys: String, CodingKey { - - case createdBy = "created_by" - - case tag = "tag" - - case companyId = "company_id" - - case createdOn = "created_on" - - case guide = "guide" - - case active = "active" - - case modifiedOn = "modified_on" - - case id = "id" - - case modifiedBy = "modified_by" - - case title = "title" - - case subtitle = "subtitle" - - case name = "name" - - case brandId = "brand_id" - - } - - public init(active: Bool?, brandId: Int?, companyId: Int?, createdBy: [String: Any]?, createdOn: String?, guide: [String: Any]?, id: String?, modifiedBy: [String: Any]?, modifiedOn: String?, name: String?, subtitle: String?, tag: String?, title: String?) { - - self.createdBy = createdBy - - self.tag = tag - - self.companyId = companyId - - self.createdOn = createdOn - - self.guide = guide - - self.active = active - - self.modifiedOn = modifiedOn - - self.id = id - - self.modifiedBy = modifiedBy - - self.title = title - - self.subtitle = subtitle - - self.name = name - - self.brandId = brandId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdBy = try container.decode([String: Any].self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tag = try container.decode(String.self, forKey: .tag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - guide = try container.decode([String: Any].self, forKey: .guide) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode([String: Any].self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subtitle = try container.decode(String.self, forKey: .subtitle) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandId = try container.decode(Int.self, forKey: .brandId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(tag, forKey: .tag) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(guide, forKey: .guide) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(subtitle, forKey: .subtitle) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(brandId, forKey: .brandId) - - - } - - } - - /* - Model: MetaDataListingFilterMetaResponse - Used By: Catalog - */ - - class MetaDataListingFilterMetaResponse: Codable { - - - public var filterTypes: [String]? - - public var display: String? - - public var key: String? - - public var units: [[String: Any]]? - - - public enum CodingKeys: String, CodingKey { - - case filterTypes = "filter_types" - - case display = "display" - - case key = "key" - - case units = "units" - - } - - public init(display: String?, filterTypes: [String]?, key: String?, units: [[String: Any]]?) { - - self.filterTypes = filterTypes - - self.display = display - - self.key = key - - self.units = units - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - filterTypes = try container.decode([String].self, forKey: .filterTypes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - units = try container.decode([[String: Any]].self, forKey: .units) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(filterTypes, forKey: .filterTypes) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(units, forKey: .units) - - - } - - } - - /* - Model: MetaDataListingFilterResponse - Used By: Catalog - */ - - class MetaDataListingFilterResponse: Codable { - - - public var data: [MetaDataListingFilterMetaResponse]? - - - public enum CodingKeys: String, CodingKey { - - case data = "data" - - } - - public init(data: [MetaDataListingFilterMetaResponse]?) { - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - data = try container.decode([MetaDataListingFilterMetaResponse].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: MetaDataListingSortMetaResponse - Used By: Catalog - */ - - class MetaDataListingSortMetaResponse: Codable { - - - public var display: String? - - public var key: String? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case key = "key" - - } - - public init(display: String?, key: String?) { - - self.display = display - - self.key = key - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(key, forKey: .key) - - - } - - } - - /* - Model: MetaDataListingSortResponse - Used By: Catalog - */ - - class MetaDataListingSortResponse: Codable { - - - public var data: [MetaDataListingSortMetaResponse]? - - - public enum CodingKeys: String, CodingKey { - - case data = "data" - - } - - public init(data: [MetaDataListingSortMetaResponse]?) { - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - data = try container.decode([MetaDataListingSortMetaResponse].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: MetaDataListingResponse - Used By: Catalog - */ - - class MetaDataListingResponse: Codable { - - - public var filter: MetaDataListingFilterResponse - - public var sort: MetaDataListingSortResponse - - - public enum CodingKeys: String, CodingKey { - - case filter = "filter" - - case sort = "sort" - - } - - public init(filter: MetaDataListingFilterResponse, sort: MetaDataListingSortResponse) { - - self.filter = filter - - self.sort = sort - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - filter = try container.decode(MetaDataListingFilterResponse.self, forKey: .filter) - - - - - sort = try container.decode(MetaDataListingSortResponse.self, forKey: .sort) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(filter, forKey: .filter) - - - - try? container.encodeIfPresent(sort, forKey: .sort) - - - } - - } - - /* - Model: GetCatalogConfigurationDetailsProduct - Used By: Catalog - */ - - class GetCatalogConfigurationDetailsProduct: Codable { - - - public var variant: [String: Any]? - - public var detail: [String: Any]? - - public var compare: [String: Any]? - - public var similar: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case variant = "variant" - - case detail = "detail" - - case compare = "compare" - - case similar = "similar" - - } - - public init(compare: [String: Any]?, detail: [String: Any]?, similar: [String: Any]?, variant: [String: Any]?) { - - self.variant = variant - - self.detail = detail - - self.compare = compare - - self.similar = similar - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - variant = try container.decode([String: Any].self, forKey: .variant) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - detail = try container.decode([String: Any].self, forKey: .detail) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - compare = try container.decode([String: Any].self, forKey: .compare) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - similar = try container.decode([String: Any].self, forKey: .similar) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(variant, forKey: .variant) - - - - try? container.encodeIfPresent(detail, forKey: .detail) - - - - try? container.encodeIfPresent(compare, forKey: .compare) - - - - try? container.encodeIfPresent(similar, forKey: .similar) - - - } - - } - - /* - Model: GetCatalogConfigurationMetaData - Used By: Catalog - */ - - class GetCatalogConfigurationMetaData: Codable { - - - public var listing: MetaDataListingResponse? - - public var product: GetCatalogConfigurationDetailsProduct? - - - public enum CodingKeys: String, CodingKey { - - case listing = "listing" - - case product = "product" - - } - - public init(listing: MetaDataListingResponse?, product: GetCatalogConfigurationDetailsProduct?) { - - self.listing = listing - - self.product = product - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - listing = try container.decode(MetaDataListingResponse.self, forKey: .listing) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - product = try container.decode(GetCatalogConfigurationDetailsProduct.self, forKey: .product) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(listing, forKey: .listing) - - - - try? container.encodeIfPresent(product, forKey: .product) - - - } - - } - - /* - Model: ProductSize - Used By: Catalog - */ - - class ProductSize: Codable { - - - public var max: Int - - public var min: Int - - - public enum CodingKeys: String, CodingKey { - - case max = "max" - - case min = "min" - - } - - public init(max: Int, min: Int) { - - self.max = max - - self.min = min - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - max = try container.decode(Int.self, forKey: .max) - - - - - min = try container.decode(Int.self, forKey: .min) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(max, forKey: .max) - - - - try? container.encodeIfPresent(min, forKey: .min) - - - } - - } - - /* - Model: ConfigurationProductVariantConfig - Used By: Catalog - */ - - class ConfigurationProductVariantConfig: Codable { - - - public var key: String - - public var logo: String? - - public var isActive: Bool - - public var size: ProductSize - - public var displayType: String - - public var priority: Int - - public var name: String - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case logo = "logo" - - case isActive = "is_active" - - case size = "size" - - case displayType = "display_type" - - case priority = "priority" - - case name = "name" - - } - - public init(displayType: String, isActive: Bool, key: String, logo: String?, name: String, priority: Int, size: ProductSize) { - - self.key = key - - self.logo = logo - - self.isActive = isActive - - self.size = size - - self.displayType = displayType - - self.priority = priority - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - key = try container.decode(String.self, forKey: .key) - - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - isActive = try container.decode(Bool.self, forKey: .isActive) - - - - - size = try container.decode(ProductSize.self, forKey: .size) - - - - - displayType = try container.decode(String.self, forKey: .displayType) - - - - - priority = try container.decode(Int.self, forKey: .priority) - - - - - name = try container.decode(String.self, forKey: .name) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(displayType, forKey: .displayType) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: ConfigurationProductVariant - Used By: Catalog - */ - - class ConfigurationProductVariant: Codable { - - - public var config: [ConfigurationProductVariantConfig]? - - - public enum CodingKeys: String, CodingKey { - - case config = "config" - - } - - public init(config: [ConfigurationProductVariantConfig]?) { - - self.config = config - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - config = try container.decode([ConfigurationProductVariantConfig].self, forKey: .config) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(config, forKey: .config) - - - } - - } - - /* - Model: ConfigurationProductConfig - Used By: Catalog - */ - - class ConfigurationProductConfig: Codable { - - - public var key: String - - public var logo: String? - - public var isActive: Bool - - public var size: ProductSize? - - public var priority: Int - - public var title: String? - - public var subtitle: String? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case logo = "logo" - - case isActive = "is_active" - - case size = "size" - - case priority = "priority" - - case title = "title" - - case subtitle = "subtitle" - - } - - public init(isActive: Bool, key: String, logo: String?, priority: Int, size: ProductSize?, subtitle: String?, title: String?) { - - self.key = key - - self.logo = logo - - self.isActive = isActive - - self.size = size - - self.priority = priority - - self.title = title - - self.subtitle = subtitle - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - key = try container.decode(String.self, forKey: .key) - - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - isActive = try container.decode(Bool.self, forKey: .isActive) - - - - - do { - size = try container.decode(ProductSize.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - priority = try container.decode(Int.self, forKey: .priority) - - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subtitle = try container.decode(String.self, forKey: .subtitle) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(subtitle, forKey: .subtitle) - - - } - - } - - /* - Model: ConfigurationProductSimilar - Used By: Catalog - */ - - class ConfigurationProductSimilar: Codable { - - - public var config: [ConfigurationProductConfig]? - - - public enum CodingKeys: String, CodingKey { - - case config = "config" - - } - - public init(config: [ConfigurationProductConfig]?) { - - self.config = config - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - config = try container.decode([ConfigurationProductConfig].self, forKey: .config) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(config, forKey: .config) - - - } - - } - - /* - Model: ConfigurationProduct - Used By: Catalog - */ - - class ConfigurationProduct: Codable { - - - public var variant: ConfigurationProductVariant - - public var similar: ConfigurationProductSimilar - - - public enum CodingKeys: String, CodingKey { - - case variant = "variant" - - case similar = "similar" - - } - - public init(similar: ConfigurationProductSimilar, variant: ConfigurationProductVariant) { - - self.variant = variant - - self.similar = similar - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - variant = try container.decode(ConfigurationProductVariant.self, forKey: .variant) - - - - - similar = try container.decode(ConfigurationProductSimilar.self, forKey: .similar) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(variant, forKey: .variant) - - - - try? container.encodeIfPresent(similar, forKey: .similar) - - - } - - } - - /* - Model: ConfigurationBucketPoints - Used By: Catalog - */ - - class ConfigurationBucketPoints: Codable { - - - public var end: Double? - - public var start: Double? - - - public enum CodingKeys: String, CodingKey { - - case end = "end" - - case start = "start" - - } - - public init(end: Double?, start: Double?) { - - self.end = end - - self.start = start - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - end = try container.decode(Double.self, forKey: .end) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - start = try container.decode(Double.self, forKey: .start) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(end, forKey: .end) - - - - try? container.encodeIfPresent(start, forKey: .start) - - - } - - } - - /* - Model: ConfigurationListingFilterValue - Used By: Catalog - */ - - class ConfigurationListingFilterValue: Codable { - - - public var map: [String: Any]? - - public var condition: String? - - public var bucketPoints: [ConfigurationBucketPoints]? - - public var sort: String? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case map = "map" - - case condition = "condition" - - case bucketPoints = "bucket_points" - - case sort = "sort" - - case value = "value" - - } - - public init(bucketPoints: [ConfigurationBucketPoints]?, condition: String?, map: [String: Any]?, sort: String?, value: String?) { - - self.map = map - - self.condition = condition - - self.bucketPoints = bucketPoints - - self.sort = sort - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - map = try container.decode([String: Any].self, forKey: .map) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - condition = try container.decode(String.self, forKey: .condition) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bucketPoints = try container.decode([ConfigurationBucketPoints].self, forKey: .bucketPoints) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sort = try container.decode(String.self, forKey: .sort) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(map, forKey: .map) - - - - try? container.encodeIfPresent(condition, forKey: .condition) - - - - try? container.encodeIfPresent(bucketPoints, forKey: .bucketPoints) - - - - try? container.encodeIfPresent(sort, forKey: .sort) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: ConfigurationListingFilterConfig - Used By: Catalog - */ - - class ConfigurationListingFilterConfig: Codable { - - - public var valueConfig: ConfigurationListingFilterValue? - - public var type: String - - public var key: String - - public var logo: String? - - public var isActive: Bool - - public var priority: Int - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case valueConfig = "value_config" - - case type = "type" - - case key = "key" - - case logo = "logo" - - case isActive = "is_active" - - case priority = "priority" - - case name = "name" - - } - - public init(isActive: Bool, key: String, logo: String?, name: String?, priority: Int, type: String, valueConfig: ConfigurationListingFilterValue?) { - - self.valueConfig = valueConfig - - self.type = type - - self.key = key - - self.logo = logo - - self.isActive = isActive - - self.priority = priority - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - valueConfig = try container.decode(ConfigurationListingFilterValue.self, forKey: .valueConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - type = try container.decode(String.self, forKey: .type) - - - - - key = try container.decode(String.self, forKey: .key) - - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - isActive = try container.decode(Bool.self, forKey: .isActive) - - - - - priority = try container.decode(Int.self, forKey: .priority) - - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(valueConfig, forKey: .valueConfig) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: ConfigurationListingFilter - Used By: Catalog - */ - - class ConfigurationListingFilter: Codable { - - - public var allowSingle: Bool - - public var attributeConfig: [ConfigurationListingFilterConfig]? - - - public enum CodingKeys: String, CodingKey { - - case allowSingle = "allow_single" - - case attributeConfig = "attribute_config" - - } - - public init(allowSingle: Bool, attributeConfig: [ConfigurationListingFilterConfig]?) { - - self.allowSingle = allowSingle - - self.attributeConfig = attributeConfig - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - allowSingle = try container.decode(Bool.self, forKey: .allowSingle) - - - - - do { - attributeConfig = try container.decode([ConfigurationListingFilterConfig].self, forKey: .attributeConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(allowSingle, forKey: .allowSingle) - - - - try? container.encodeIfPresent(attributeConfig, forKey: .attributeConfig) - - - } - - } - - /* - Model: ConfigurationListingSortConfig - Used By: Catalog - */ - - class ConfigurationListingSortConfig: Codable { - - - public var key: String - - public var logo: String? - - public var isActive: Bool - - public var priority: Int - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case logo = "logo" - - case isActive = "is_active" - - case priority = "priority" - - case name = "name" - - } - - public init(isActive: Bool, key: String, logo: String?, name: String?, priority: Int) { - - self.key = key - - self.logo = logo - - self.isActive = isActive - - self.priority = priority - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - key = try container.decode(String.self, forKey: .key) - - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - isActive = try container.decode(Bool.self, forKey: .isActive) - - - - - priority = try container.decode(Int.self, forKey: .priority) - - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: ConfigurationListingSort - Used By: Catalog - */ - - class ConfigurationListingSort: Codable { - - - public var defaultKey: String - - public var config: [ConfigurationListingSortConfig]? - - - public enum CodingKeys: String, CodingKey { - - case defaultKey = "default_key" - - case config = "config" - - } - - public init(config: [ConfigurationListingSortConfig]?, defaultKey: String) { - - self.defaultKey = defaultKey - - self.config = config - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - defaultKey = try container.decode(String.self, forKey: .defaultKey) - - - - - do { - config = try container.decode([ConfigurationListingSortConfig].self, forKey: .config) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(defaultKey, forKey: .defaultKey) - - - - try? container.encodeIfPresent(config, forKey: .config) - - - } - - } - - /* - Model: ConfigurationListing - Used By: Catalog - */ - - class ConfigurationListing: Codable { - - - public var filter: ConfigurationListingFilter - - public var sort: ConfigurationListingSort - - - public enum CodingKeys: String, CodingKey { - - case filter = "filter" - - case sort = "sort" - - } - - public init(filter: ConfigurationListingFilter, sort: ConfigurationListingSort) { - - self.filter = filter - - self.sort = sort - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - filter = try container.decode(ConfigurationListingFilter.self, forKey: .filter) - - - - - sort = try container.decode(ConfigurationListingSort.self, forKey: .sort) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(filter, forKey: .filter) - - - - try? container.encodeIfPresent(sort, forKey: .sort) - - - } - - } - - /* - Model: AppConfiguration - Used By: Catalog - */ - - class AppConfiguration: Codable { - - - public var product: ConfigurationProduct? - - public var configId: String? - - public var configType: String - - public var appId: String - - public var listing: ConfigurationListing? - - - public enum CodingKeys: String, CodingKey { - - case product = "product" - - case configId = "config_id" - - case configType = "config_type" - - case appId = "app_id" - - case listing = "listing" - - } - - public init(appId: String, configId: String?, configType: String, listing: ConfigurationListing?, product: ConfigurationProduct?) { - - self.product = product - - self.configId = configId - - self.configType = configType - - self.appId = appId - - self.listing = listing - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - product = try container.decode(ConfigurationProduct.self, forKey: .product) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - configId = try container.decode(String.self, forKey: .configId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - configType = try container.decode(String.self, forKey: .configType) - - - - - appId = try container.decode(String.self, forKey: .appId) - - - - - do { - listing = try container.decode(ConfigurationListing.self, forKey: .listing) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(product, forKey: .product) - - - - try? container.encodeIfPresent(configId, forKey: .configId) - - - - try? container.encodeIfPresent(configType, forKey: .configType) - - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(listing, forKey: .listing) - - - } - - } - - /* - Model: AppCatalogConfiguration - Used By: Catalog - */ - - class AppCatalogConfiguration: Codable { - - - public var product: ConfigurationProduct? - - public var configId: String? - - public var configType: String - - public var id: String? - - public var appId: String - - public var listing: ConfigurationListing? - - - public enum CodingKeys: String, CodingKey { - - case product = "product" - - case configId = "config_id" - - case configType = "config_type" - - case id = "id" - - case appId = "app_id" - - case listing = "listing" - - } - - public init(appId: String, configId: String?, configType: String, id: String?, listing: ConfigurationListing?, product: ConfigurationProduct?) { - - self.product = product - - self.configId = configId - - self.configType = configType - - self.id = id - - self.appId = appId - - self.listing = listing - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - product = try container.decode(ConfigurationProduct.self, forKey: .product) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - configId = try container.decode(String.self, forKey: .configId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - configType = try container.decode(String.self, forKey: .configType) - - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - appId = try container.decode(String.self, forKey: .appId) - - - - - do { - listing = try container.decode(ConfigurationListing.self, forKey: .listing) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(product, forKey: .product) - - - - try? container.encodeIfPresent(configId, forKey: .configId) - - - - try? container.encodeIfPresent(configType, forKey: .configType) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(listing, forKey: .listing) - - - } - - } - - /* - Model: GetAppCatalogConfiguration - Used By: Catalog - */ - - class GetAppCatalogConfiguration: Codable { - - - public var isDefault: Bool? - - public var data: AppCatalogConfiguration? - - - public enum CodingKeys: String, CodingKey { - - case isDefault = "is_default" - - case data = "data" - - } - - public init(data: AppCatalogConfiguration?, isDefault: Bool?) { - - self.isDefault = isDefault - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isDefault = try container.decode(Bool.self, forKey: .isDefault) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode(AppCatalogConfiguration.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isDefault, forKey: .isDefault) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: GetCatalogConfigurationDetailsSchemaListing - Used By: Catalog - */ - - class GetCatalogConfigurationDetailsSchemaListing: Codable { - - - public var filter: [String: Any]? - - public var sort: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case filter = "filter" - - case sort = "sort" - - } - - public init(filter: [String: Any]?, sort: [String: Any]?) { - - self.filter = filter - - self.sort = sort - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - filter = try container.decode([String: Any].self, forKey: .filter) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sort = try container.decode([String: Any].self, forKey: .sort) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(filter, forKey: .filter) - - - - try? container.encodeIfPresent(sort, forKey: .sort) - - - } - - } - - /* - Model: EntityConfiguration - Used By: Catalog - */ - - class EntityConfiguration: Codable { - - - public var product: GetCatalogConfigurationDetailsProduct? - - public var configId: String? - - public var configType: String - - public var id: String? - - public var appId: String - - public var listing: GetCatalogConfigurationDetailsSchemaListing? - - - public enum CodingKeys: String, CodingKey { - - case product = "product" - - case configId = "config_id" - - case configType = "config_type" - - case id = "id" - - case appId = "app_id" - - case listing = "listing" - - } - - public init(appId: String, configId: String?, configType: String, id: String?, listing: GetCatalogConfigurationDetailsSchemaListing?, product: GetCatalogConfigurationDetailsProduct?) { - - self.product = product - - self.configId = configId - - self.configType = configType - - self.id = id - - self.appId = appId - - self.listing = listing - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - product = try container.decode(GetCatalogConfigurationDetailsProduct.self, forKey: .product) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - configId = try container.decode(String.self, forKey: .configId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - configType = try container.decode(String.self, forKey: .configType) - - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - appId = try container.decode(String.self, forKey: .appId) - - - - - do { - listing = try container.decode(GetCatalogConfigurationDetailsSchemaListing.self, forKey: .listing) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(product, forKey: .product) - - - - try? container.encodeIfPresent(configId, forKey: .configId) - - - - try? container.encodeIfPresent(configType, forKey: .configType) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(listing, forKey: .listing) - - - } - - } - - /* - Model: GetAppCatalogEntityConfiguration - Used By: Catalog - */ - - class GetAppCatalogEntityConfiguration: Codable { - - - public var isDefault: Bool? - - public var data: EntityConfiguration? - - - public enum CodingKeys: String, CodingKey { - - case isDefault = "is_default" - - case data = "data" - - } - - public init(data: EntityConfiguration?, isDefault: Bool?) { - - self.isDefault = isDefault - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isDefault = try container.decode(Bool.self, forKey: .isDefault) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode(EntityConfiguration.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isDefault, forKey: .isDefault) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: ProductSortOn - Used By: Catalog - */ - - class ProductSortOn: Codable { - - - public var isSelected: Bool? - - public var name: String? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case isSelected = "is_selected" - - case name = "name" - - case value = "value" - - } - - public init(isSelected: Bool?, name: String?, value: String?) { - - self.isSelected = isSelected - - self.name = name - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isSelected = try container.decode(Bool.self, forKey: .isSelected) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isSelected, forKey: .isSelected) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: ProductFiltersValue - Used By: Catalog - */ - - class ProductFiltersValue: Codable { - - - public var currencyCode: String? - - public var queryFormat: String? - - public var selectedMax: Int? - - public var currencySymbol: String? - - public var display: String - - public var displayFormat: String? - - public var max: Int? - - public var isSelected: Bool - - public var count: Int? - - public var min: Int? - - public var selectedMin: Int? - - public var value: String - - - public enum CodingKeys: String, CodingKey { - - case currencyCode = "currency_code" - - case queryFormat = "query_format" - - case selectedMax = "selected_max" - - case currencySymbol = "currency_symbol" - - case display = "display" - - case displayFormat = "display_format" - - case max = "max" - - case isSelected = "is_selected" - - case count = "count" - - case min = "min" - - case selectedMin = "selected_min" - - case value = "value" - - } - - public init(count: Int?, currencyCode: String?, currencySymbol: String?, display: String, displayFormat: String?, isSelected: Bool, max: Int?, min: Int?, queryFormat: String?, selectedMax: Int?, selectedMin: Int?, value: String) { - - self.currencyCode = currencyCode - - self.queryFormat = queryFormat - - self.selectedMax = selectedMax - - self.currencySymbol = currencySymbol - - self.display = display - - self.displayFormat = displayFormat - - self.max = max - - self.isSelected = isSelected - - self.count = count - - self.min = min - - self.selectedMin = selectedMin - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - queryFormat = try container.decode(String.self, forKey: .queryFormat) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - selectedMax = try container.decode(Int.self, forKey: .selectedMax) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencySymbol = try container.decode(String.self, forKey: .currencySymbol) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - display = try container.decode(String.self, forKey: .display) - - - - - do { - displayFormat = try container.decode(String.self, forKey: .displayFormat) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - max = try container.decode(Int.self, forKey: .max) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - isSelected = try container.decode(Bool.self, forKey: .isSelected) - - - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - min = try container.decode(Int.self, forKey: .min) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - selectedMin = try container.decode(Int.self, forKey: .selectedMin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - value = try container.decode(String.self, forKey: .value) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - - try? container.encodeIfPresent(queryFormat, forKey: .queryFormat) - - - - try? container.encodeIfPresent(selectedMax, forKey: .selectedMax) - - - - try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(displayFormat, forKey: .displayFormat) - - - - try? container.encodeIfPresent(max, forKey: .max) - - - - try? container.encodeIfPresent(isSelected, forKey: .isSelected) - - - - try? container.encodeIfPresent(count, forKey: .count) - - - - try? container.encodeIfPresent(min, forKey: .min) - - - - try? container.encodeIfPresent(selectedMin, forKey: .selectedMin) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: ProductFiltersKey - Used By: Catalog - */ - - class ProductFiltersKey: Codable { - - - public var logo: String? - - public var display: String - - public var kind: String? - - public var name: String - - - public enum CodingKeys: String, CodingKey { - - case logo = "logo" - - case display = "display" - - case kind = "kind" - - case name = "name" - - } - - public init(display: String, kind: String?, logo: String?, name: String) { - - self.logo = logo - - self.display = display - - self.kind = kind - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - display = try container.decode(String.self, forKey: .display) - - - - - do { - kind = try container.decode(String.self, forKey: .kind) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(kind, forKey: .kind) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: ProductFilters - Used By: Catalog - */ - - class ProductFilters: Codable { - - - public var values: [ProductFiltersValue] - - public var key: ProductFiltersKey - - - public enum CodingKeys: String, CodingKey { - - case values = "values" - - case key = "key" - - } - - public init(key: ProductFiltersKey, values: [ProductFiltersValue]) { - - self.values = values - - self.key = key - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - values = try container.decode([ProductFiltersValue].self, forKey: .values) - - - - - key = try container.decode(ProductFiltersKey.self, forKey: .key) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(values, forKey: .values) - - - - try? container.encodeIfPresent(key, forKey: .key) - - - } - - } - - /* - Model: GetCollectionQueryOptionResponse - Used By: Catalog - */ - - class GetCollectionQueryOptionResponse: Codable { - - - public var sortOn: [ProductSortOn]? - - public var filters: [ProductFilters]? - - - public enum CodingKeys: String, CodingKey { - - case sortOn = "sort_on" - - case filters = "filters" - - } - - public init(filters: [ProductFilters]?, sortOn: [ProductSortOn]?) { - - self.sortOn = sortOn - - self.filters = filters - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - sortOn = try container.decode([ProductSortOn].self, forKey: .sortOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - filters = try container.decode([ProductFilters].self, forKey: .filters) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(sortOn, forKey: .sortOn) - - - - try? container.encodeIfPresent(filters, forKey: .filters) - - - } - - } - - /* - Model: CollectionBadge - Used By: Catalog - */ - - class CollectionBadge: Codable { - - - public var text: String? - - public var color: String? - - - public enum CodingKeys: String, CodingKey { - - case text = "text" - - case color = "color" - - } - - public init(color: String?, text: String?) { - - self.text = text - - self.color = color - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - text = try container.decode(String.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - color = try container.decode(String.self, forKey: .color) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(color, forKey: .color) - - - } - - } - - /* - Model: CollectionImage - Used By: Catalog - */ - - class CollectionImage: Codable { - - - public var url: String - - public var aspectRatio: String - - - public enum CodingKeys: String, CodingKey { - - case url = "url" - - case aspectRatio = "aspect_ratio" - - } - - public init(aspectRatio: String, url: String) { - - self.url = url - - self.aspectRatio = aspectRatio - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - url = try container.decode(String.self, forKey: .url) - - - - - aspectRatio = try container.decode(String.self, forKey: .aspectRatio) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) - - - } - - } - - /* - Model: CollectionBanner - Used By: Catalog - */ - - class CollectionBanner: Codable { - - - public var landscape: CollectionImage - - public var portrait: CollectionImage - - - public enum CodingKeys: String, CodingKey { - - case landscape = "landscape" - - case portrait = "portrait" - - } - - public init(landscape: CollectionImage, portrait: CollectionImage) { - - self.landscape = landscape - - self.portrait = portrait - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - landscape = try container.decode(CollectionImage.self, forKey: .landscape) - - - - - portrait = try container.decode(CollectionImage.self, forKey: .portrait) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(landscape, forKey: .landscape) - - - - try? container.encodeIfPresent(portrait, forKey: .portrait) - - - } - - } - - /* - Model: SeoDetail - Used By: Catalog - */ - - class SeoDetail: Codable { - - - public var description: String? - - public var title: String? - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case title = "title" - - } - - public init(description: String?, title: String?) { - - self.description = description - - self.title = title - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - } - - } - - /* - Model: UserInfo - Used By: Catalog - */ - - class UserInfo: Codable { - - - public var uid: String? - - public var email: String? - - public var username: String? - - public var userId: String? - - - public enum CodingKeys: String, CodingKey { - - case uid = "uid" - - case email = "email" - - case username = "username" - - case userId = "user_id" - - } - - public init(email: String?, uid: String?, username: String?, userId: String?) { - - self.uid = uid - - self.email = email - - self.username = username - - self.userId = userId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - username = try container.decode(String.self, forKey: .username) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(username, forKey: .username) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - } - - } - - /* - Model: Schedule - Used By: Catalog - */ - - class Schedule: Codable { - - - public var cron: String? - - public var end: String? - - public var start: String? - - public var duration: Int? - - - public enum CodingKeys: String, CodingKey { - - case cron = "cron" - - case end = "end" - - case start = "start" - - case duration = "duration" - - } - - public init(cron: String?, duration: Int?, end: String?, start: String?) { - - self.cron = cron - - self.end = end - - self.start = start - - self.duration = duration - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cron = try container.decode(String.self, forKey: .cron) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - end = try container.decode(String.self, forKey: .end) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - start = try container.decode(String.self, forKey: .start) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - duration = try container.decode(Int.self, forKey: .duration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cron, forKey: .cron) - - - - try? container.encodeIfPresent(end, forKey: .end) - - - - try? container.encodeIfPresent(start, forKey: .start) - - - - try? container.encodeIfPresent(duration, forKey: .duration) - - - } - - } - - /* - Model: CreateCollection - Used By: Catalog - */ - - class CreateCollection: Codable { - - - public var localeLanguage: [String: Any]? - - public var allowSort: Bool? - - public var visibleFacetsKeys: [String]? - - public var badge: CollectionBadge? - - public var published: Bool? - - public var isActive: Bool? - - public var banners: CollectionBanner - - public var seo: SeoDetail? - - public var modifiedBy: UserInfo? - - public var appId: String - - public var sortOn: String? - - public var allowFacets: Bool? - - public var customJson: [String: Any]? - - public var query: [String: Any]? - - public var createdBy: UserInfo? - - public var description: String? - - public var logo: CollectionImage - - public var meta: [String: Any]? - - public var name: String - - public var type: String - - public var slug: String - - public var schedule: Schedule? - - public var tags: [String]? - - - public enum CodingKeys: String, CodingKey { - - case localeLanguage = "_locale_language" - - case allowSort = "allow_sort" - - case visibleFacetsKeys = "visible_facets_keys" - - case badge = "badge" - - case published = "published" - - case isActive = "is_active" - - case banners = "banners" - - case seo = "seo" - - case modifiedBy = "modified_by" - - case appId = "app_id" - - case sortOn = "sort_on" - - case allowFacets = "allow_facets" - - case customJson = "_custom_json" - - case query = "query" - - case createdBy = "created_by" - - case description = "description" - - case logo = "logo" - - case meta = "meta" - - case name = "name" - - case type = "type" - - case slug = "slug" - - case schedule = "_schedule" - - case tags = "tags" - - } - - public init(allowFacets: Bool?, allowSort: Bool?, appId: String, badge: CollectionBadge?, banners: CollectionBanner, createdBy: UserInfo?, description: String?, isActive: Bool?, logo: CollectionImage, meta: [String: Any]?, modifiedBy: UserInfo?, name: String, published: Bool?, query: [String: Any]?, seo: SeoDetail?, slug: String, sortOn: String?, tags: [String]?, type: String, visibleFacetsKeys: [String]?, customJson: [String: Any]?, localeLanguage: [String: Any]?, schedule: Schedule?) { - - self.localeLanguage = localeLanguage - - self.allowSort = allowSort - - self.visibleFacetsKeys = visibleFacetsKeys - - self.badge = badge - - self.published = published - - self.isActive = isActive - - self.banners = banners - - self.seo = seo - - self.modifiedBy = modifiedBy - - self.appId = appId - - self.sortOn = sortOn - - self.allowFacets = allowFacets - - self.customJson = customJson - - self.query = query - - self.createdBy = createdBy - - self.description = description - - self.logo = logo - - self.meta = meta - - self.name = name - - self.type = type - - self.slug = slug - - self.schedule = schedule - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - localeLanguage = try container.decode([String: Any].self, forKey: .localeLanguage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allowSort = try container.decode(Bool.self, forKey: .allowSort) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - visibleFacetsKeys = try container.decode([String].self, forKey: .visibleFacetsKeys) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - badge = try container.decode(CollectionBadge.self, forKey: .badge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - banners = try container.decode(CollectionBanner.self, forKey: .banners) - - - - - do { - seo = try container.decode(SeoDetail.self, forKey: .seo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode(UserInfo.self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - appId = try container.decode(String.self, forKey: .appId) - - - - - do { - sortOn = try container.decode(String.self, forKey: .sortOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allowFacets = try container.decode(Bool.self, forKey: .allowFacets) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - query = try container.decode([String: Any].self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(UserInfo.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - logo = try container.decode(CollectionImage.self, forKey: .logo) - - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - - type = try container.decode(String.self, forKey: .type) - - - - - slug = try container.decode(String.self, forKey: .slug) - - - - - do { - schedule = try container.decode(Schedule.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(localeLanguage, forKey: .localeLanguage) - - - - try? container.encodeIfPresent(allowSort, forKey: .allowSort) - - - - try? container.encodeIfPresent(visibleFacetsKeys, forKey: .visibleFacetsKeys) - - - - try? container.encodeIfPresent(badge, forKey: .badge) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(banners, forKey: .banners) - - - - try? container.encodeIfPresent(seo, forKey: .seo) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(sortOn, forKey: .sortOn) - - - - try? container.encodeIfPresent(allowFacets, forKey: .allowFacets) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(query, forKey: .query) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: BannerImage - Used By: Catalog - */ - - class BannerImage: Codable { - - - public var url: String? - - public var aspectRatio: String? - - - public enum CodingKeys: String, CodingKey { - - case url = "url" - - case aspectRatio = "aspect_ratio" - - } - - public init(aspectRatio: String?, url: String?) { - - self.url = url - - self.aspectRatio = aspectRatio - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - aspectRatio = try container.decode(String.self, forKey: .aspectRatio) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) - - - } - - } - - /* - Model: ImageUrls - Used By: Catalog - */ - - class ImageUrls: Codable { - - - public var landscape: BannerImage? - - public var portrait: BannerImage? - - - public enum CodingKeys: String, CodingKey { - - case landscape = "landscape" - - case portrait = "portrait" - - } - - public init(landscape: BannerImage?, portrait: BannerImage?) { - - self.landscape = landscape - - self.portrait = portrait - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - landscape = try container.decode(BannerImage.self, forKey: .landscape) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - portrait = try container.decode(BannerImage.self, forKey: .portrait) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(landscape, forKey: .landscape) - - - - try? container.encodeIfPresent(portrait, forKey: .portrait) - - - } - - } - - /* - Model: CollectionCreateResponse - Used By: Catalog - */ - - class CollectionCreateResponse: Codable { - - - public var description: String? - - public var banners: ImageUrls? - - public var query: [String: Any]? - - public var tag: [String]? - - public var type: String? - - public var allowSort: Bool? - - public var visibleFacetsKeys: [String]? - - public var badge: [String: Any]? - - public var slug: String? - - public var schedule: [String: Any]? - - public var logo: BannerImage? - - public var meta: [String: Any]? - - public var isActive: Bool? - - public var appId: String? - - public var cron: [String: Any]? - - public var allowFacets: Bool? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case banners = "banners" - - case query = "query" - - case tag = "tag" - - case type = "type" - - case allowSort = "allow_sort" - - case visibleFacetsKeys = "visible_facets_keys" - - case badge = "badge" - - case slug = "slug" - - case schedule = "_schedule" - - case logo = "logo" - - case meta = "meta" - - case isActive = "is_active" - - case appId = "app_id" - - case cron = "cron" - - case allowFacets = "allow_facets" - - case name = "name" - - } - - public init(allowFacets: Bool?, allowSort: Bool?, appId: String?, badge: [String: Any]?, banners: ImageUrls?, cron: [String: Any]?, description: String?, isActive: Bool?, logo: BannerImage?, meta: [String: Any]?, name: String?, query: [String: Any]?, slug: String?, tag: [String]?, type: String?, visibleFacetsKeys: [String]?, schedule: [String: Any]?) { - - self.description = description - - self.banners = banners - - self.query = query - - self.tag = tag - - self.type = type - - self.allowSort = allowSort - - self.visibleFacetsKeys = visibleFacetsKeys - - self.badge = badge - - self.slug = slug - - self.schedule = schedule - - self.logo = logo - - self.meta = meta - - self.isActive = isActive - - self.appId = appId - - self.cron = cron - - self.allowFacets = allowFacets - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - banners = try container.decode(ImageUrls.self, forKey: .banners) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - query = try container.decode([String: Any].self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tag = try container.decode([String].self, forKey: .tag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allowSort = try container.decode(Bool.self, forKey: .allowSort) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - visibleFacetsKeys = try container.decode([String].self, forKey: .visibleFacetsKeys) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - badge = try container.decode([String: Any].self, forKey: .badge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode([String: Any].self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(BannerImage.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cron = try container.decode([String: Any].self, forKey: .cron) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allowFacets = try container.decode(Bool.self, forKey: .allowFacets) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(banners, forKey: .banners) - - - - try? container.encodeIfPresent(query, forKey: .query) - - - - try? container.encodeIfPresent(tag, forKey: .tag) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(allowSort, forKey: .allowSort) - - - - try? container.encodeIfPresent(visibleFacetsKeys, forKey: .visibleFacetsKeys) - - - - try? container.encodeIfPresent(badge, forKey: .badge) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(cron, forKey: .cron) - - - - try? container.encodeIfPresent(allowFacets, forKey: .allowFacets) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: Media1 - Used By: Catalog - */ - - class Media1: Codable { - - - public var meta: [String: Any]? - - public var url: String - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case meta = "meta" - - case url = "url" - - case type = "type" - - } - - public init(meta: [String: Any]?, type: String?, url: String) { - - self.meta = meta - - self.url = url - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - url = try container.decode(String.self, forKey: .url) - - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ProductListingActionPage - Used By: Catalog - */ - - class ProductListingActionPage: Codable { - - - public var query: [String: Any]? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case query = "query" - - case type = "type" - - } - - public init(query: [String: Any]?, type: String?) { - - self.query = query - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - query = try container.decode([String: Any].self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(query, forKey: .query) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ProductListingAction - Used By: Catalog - */ - - class ProductListingAction: Codable { - - - public var page: ProductListingActionPage? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case page = "page" - - case type = "type" - - } - - public init(page: ProductListingActionPage?, type: String?) { - - self.page = page - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - page = try container.decode(ProductListingActionPage.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: GetCollectionDetailNest - Used By: Catalog - */ - - class GetCollectionDetailNest: Codable { - - - public var allowSort: Bool? - - public var visibleFacetsKeys: [String]? - - public var badge: [String: Any]? - - public var isActive: Bool? - - public var banners: ImageUrls? - - public var appId: String? - - public var allowFacets: Bool? - - public var description: String? - - public var query: [String: Any]? - - public var tag: [String]? - - public var logo: Media1? - - public var meta: [String: Any]? - - public var uid: String? - - public var name: String? - - public var type: String? - - public var action: ProductListingAction? - - public var slug: String? - - public var schedule: [String: Any]? - - public var cron: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case allowSort = "allow_sort" - - case visibleFacetsKeys = "visible_facets_keys" - - case badge = "badge" - - case isActive = "is_active" - - case banners = "banners" - - case appId = "app_id" - - case allowFacets = "allow_facets" - - case description = "description" - - case query = "query" - - case tag = "tag" - - case logo = "logo" - - case meta = "meta" - - case uid = "uid" - - case name = "name" - - case type = "type" - - case action = "action" - - case slug = "slug" - - case schedule = "_schedule" - - case cron = "cron" - - } - - public init(action: ProductListingAction?, allowFacets: Bool?, allowSort: Bool?, appId: String?, badge: [String: Any]?, banners: ImageUrls?, cron: [String: Any]?, description: String?, isActive: Bool?, logo: Media1?, meta: [String: Any]?, name: String?, query: [String: Any]?, slug: String?, tag: [String]?, type: String?, uid: String?, visibleFacetsKeys: [String]?, schedule: [String: Any]?) { - - self.allowSort = allowSort - - self.visibleFacetsKeys = visibleFacetsKeys - - self.badge = badge - - self.isActive = isActive - - self.banners = banners - - self.appId = appId - - self.allowFacets = allowFacets - - self.description = description - - self.query = query - - self.tag = tag - - self.logo = logo - - self.meta = meta - - self.uid = uid - - self.name = name - - self.type = type - - self.action = action - - self.slug = slug - - self.schedule = schedule - - self.cron = cron - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - allowSort = try container.decode(Bool.self, forKey: .allowSort) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - visibleFacetsKeys = try container.decode([String].self, forKey: .visibleFacetsKeys) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - badge = try container.decode([String: Any].self, forKey: .badge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - banners = try container.decode(ImageUrls.self, forKey: .banners) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allowFacets = try container.decode(Bool.self, forKey: .allowFacets) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - query = try container.decode([String: Any].self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tag = try container.decode([String].self, forKey: .tag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(Media1.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(ProductListingAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode([String: Any].self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cron = try container.decode([String: Any].self, forKey: .cron) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(allowSort, forKey: .allowSort) - - - - try? container.encodeIfPresent(visibleFacetsKeys, forKey: .visibleFacetsKeys) - - - - try? container.encodeIfPresent(badge, forKey: .badge) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(banners, forKey: .banners) - - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(allowFacets, forKey: .allowFacets) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(query, forKey: .query) - - - - try? container.encodeIfPresent(tag, forKey: .tag) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - - try? container.encodeIfPresent(cron, forKey: .cron) - - - } - - } - - /* - Model: CollectionListingFilterTag - Used By: Catalog - */ - - class CollectionListingFilterTag: Codable { - - - public var isSelected: Bool? - - public var display: String? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case isSelected = "is_selected" - - case display = "display" - - case name = "name" - - } - - public init(display: String?, isSelected: Bool?, name: String?) { - - self.isSelected = isSelected - - self.display = display - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isSelected = try container.decode(Bool.self, forKey: .isSelected) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isSelected, forKey: .isSelected) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: CollectionListingFilterType - Used By: Catalog - */ - - class CollectionListingFilterType: Codable { - - - public var isSelected: Bool? - - public var display: String? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case isSelected = "is_selected" - - case display = "display" - - case name = "name" - - } - - public init(display: String?, isSelected: Bool?, name: String?) { - - self.isSelected = isSelected - - self.display = display - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isSelected = try container.decode(Bool.self, forKey: .isSelected) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isSelected, forKey: .isSelected) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: CollectionListingFilter - Used By: Catalog - */ - - class CollectionListingFilter: Codable { - - - public var tags: [CollectionListingFilterTag]? - - public var type: [CollectionListingFilterType]? - - - public enum CodingKeys: String, CodingKey { - - case tags = "tags" - - case type = "type" - - } - - public init(tags: [CollectionListingFilterTag]?, type: [CollectionListingFilterType]?) { - - self.tags = tags - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - tags = try container.decode([CollectionListingFilterTag].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode([CollectionListingFilterType].self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: GetCollectionListingResponse - Used By: Catalog - */ - - class GetCollectionListingResponse: Codable { - - - public var items: [GetCollectionDetailNest]? - - public var page: Page? - - public var filters: CollectionListingFilter? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - case filters = "filters" - - } - - public init(filters: CollectionListingFilter?, items: [GetCollectionDetailNest]?, page: Page?) { - - self.items = items - - self.page = page - - self.filters = filters - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([GetCollectionDetailNest].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - filters = try container.decode(CollectionListingFilter.self, forKey: .filters) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(filters, forKey: .filters) - - - } - - } - - /* - Model: CollectionDetailResponse - Used By: Catalog - */ - - class CollectionDetailResponse: Codable { - - - public var description: String? - - public var banners: ImageUrls? - - public var query: [String: Any]? - - public var tag: [String]? - - public var type: String? - - public var allowSort: Bool? - - public var visibleFacetsKeys: [String]? - - public var badge: [String: Any]? - - public var slug: String? - - public var schedule: [String: Any]? - - public var logo: Media1? - - public var meta: [String: Any]? - - public var isActive: Bool? - - public var appId: String? - - public var cron: [String: Any]? - - public var allowFacets: Bool? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case banners = "banners" - - case query = "query" - - case tag = "tag" - - case type = "type" - - case allowSort = "allow_sort" - - case visibleFacetsKeys = "visible_facets_keys" - - case badge = "badge" - - case slug = "slug" - - case schedule = "_schedule" - - case logo = "logo" - - case meta = "meta" - - case isActive = "is_active" - - case appId = "app_id" - - case cron = "cron" - - case allowFacets = "allow_facets" - - case name = "name" - - } - - public init(allowFacets: Bool?, allowSort: Bool?, appId: String?, badge: [String: Any]?, banners: ImageUrls?, cron: [String: Any]?, description: String?, isActive: Bool?, logo: Media1?, meta: [String: Any]?, name: String?, query: [String: Any]?, slug: String?, tag: [String]?, type: String?, visibleFacetsKeys: [String]?, schedule: [String: Any]?) { - - self.description = description - - self.banners = banners - - self.query = query - - self.tag = tag - - self.type = type - - self.allowSort = allowSort - - self.visibleFacetsKeys = visibleFacetsKeys - - self.badge = badge - - self.slug = slug - - self.schedule = schedule - - self.logo = logo - - self.meta = meta - - self.isActive = isActive - - self.appId = appId - - self.cron = cron - - self.allowFacets = allowFacets - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - banners = try container.decode(ImageUrls.self, forKey: .banners) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - query = try container.decode([String: Any].self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tag = try container.decode([String].self, forKey: .tag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allowSort = try container.decode(Bool.self, forKey: .allowSort) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - visibleFacetsKeys = try container.decode([String].self, forKey: .visibleFacetsKeys) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - badge = try container.decode([String: Any].self, forKey: .badge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode([String: Any].self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(Media1.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cron = try container.decode([String: Any].self, forKey: .cron) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allowFacets = try container.decode(Bool.self, forKey: .allowFacets) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(banners, forKey: .banners) - - - - try? container.encodeIfPresent(query, forKey: .query) - - - - try? container.encodeIfPresent(tag, forKey: .tag) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(allowSort, forKey: .allowSort) - - - - try? container.encodeIfPresent(visibleFacetsKeys, forKey: .visibleFacetsKeys) - - - - try? container.encodeIfPresent(badge, forKey: .badge) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(cron, forKey: .cron) - - - - try? container.encodeIfPresent(allowFacets, forKey: .allowFacets) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: UpdateCollection - Used By: Catalog - */ - - class UpdateCollection: Codable { - - - public var localeLanguage: [String: Any]? - - public var allowSort: Bool? - - public var badge: CollectionBadge? - - public var visibleFacetsKeys: [String]? - - public var published: Bool? - - public var isActive: Bool? - - public var banners: CollectionBanner? - - public var seo: SeoDetail? - - public var modifiedBy: UserInfo? - - public var sortOn: String? - - public var customJson: [String: Any]? - - public var allowFacets: Bool? - - public var description: String? - - public var query: [String: Any]? - - public var logo: CollectionImage? - - public var meta: [String: Any]? - - public var name: String? - - public var slug: String? - - public var schedule: Schedule? - - public var tags: [String]? - - - public enum CodingKeys: String, CodingKey { - - case localeLanguage = "_locale_language" - - case allowSort = "allow_sort" - - case badge = "badge" - - case visibleFacetsKeys = "visible_facets_keys" - - case published = "published" - - case isActive = "is_active" - - case banners = "banners" - - case seo = "seo" - - case modifiedBy = "modified_by" - - case sortOn = "sort_on" - - case customJson = "_custom_json" - - case allowFacets = "allow_facets" - - case description = "description" - - case query = "query" - - case logo = "logo" - - case meta = "meta" - - case name = "name" - - case slug = "slug" - - case schedule = "_schedule" - - case tags = "tags" - - } - - public init(allowFacets: Bool?, allowSort: Bool?, badge: CollectionBadge?, banners: CollectionBanner?, description: String?, isActive: Bool?, logo: CollectionImage?, meta: [String: Any]?, modifiedBy: UserInfo?, name: String?, published: Bool?, query: [String: Any]?, seo: SeoDetail?, slug: String?, sortOn: String?, tags: [String]?, visibleFacetsKeys: [String]?, customJson: [String: Any]?, localeLanguage: [String: Any]?, schedule: Schedule?) { - - self.localeLanguage = localeLanguage - - self.allowSort = allowSort - - self.badge = badge - - self.visibleFacetsKeys = visibleFacetsKeys - - self.published = published - - self.isActive = isActive - - self.banners = banners - - self.seo = seo - - self.modifiedBy = modifiedBy - - self.sortOn = sortOn - - self.customJson = customJson - - self.allowFacets = allowFacets - - self.description = description - - self.query = query - - self.logo = logo - - self.meta = meta - - self.name = name - - self.slug = slug - - self.schedule = schedule - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - localeLanguage = try container.decode([String: Any].self, forKey: .localeLanguage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allowSort = try container.decode(Bool.self, forKey: .allowSort) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - badge = try container.decode(CollectionBadge.self, forKey: .badge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - visibleFacetsKeys = try container.decode([String].self, forKey: .visibleFacetsKeys) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - published = try container.decode(Bool.self, forKey: .published) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - banners = try container.decode(CollectionBanner.self, forKey: .banners) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - seo = try container.decode(SeoDetail.self, forKey: .seo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode(UserInfo.self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sortOn = try container.decode(String.self, forKey: .sortOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allowFacets = try container.decode(Bool.self, forKey: .allowFacets) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - query = try container.decode([String: Any].self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(CollectionImage.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode(Schedule.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(localeLanguage, forKey: .localeLanguage) - - - - try? container.encodeIfPresent(allowSort, forKey: .allowSort) - - - - try? container.encodeIfPresent(badge, forKey: .badge) - - - - try? container.encodeIfPresent(visibleFacetsKeys, forKey: .visibleFacetsKeys) - - - - try? container.encodeIfPresent(published, forKey: .published) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(banners, forKey: .banners) - - - - try? container.encodeIfPresent(seo, forKey: .seo) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(sortOn, forKey: .sortOn) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(allowFacets, forKey: .allowFacets) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(query, forKey: .query) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: CollectionItemRequest - Used By: Catalog - */ - - class CollectionItemRequest: Codable { - - - public var pageNo: Int - - public var pageSize: Int - - - public enum CodingKeys: String, CodingKey { - - case pageNo = "page_no" - - case pageSize = "page_size" - - } - - public init(pageNo: Int, pageSize: Int) { - - self.pageNo = pageNo - - self.pageSize = pageSize - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - pageNo = try container.decode(Int.self, forKey: .pageNo) - - - - - pageSize = try container.decode(Int.self, forKey: .pageSize) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pageNo, forKey: .pageNo) - - - - try? container.encodeIfPresent(pageSize, forKey: .pageSize) - - - } - - } - - /* - Model: UpdatedResponse - Used By: Catalog - */ - - class UpdatedResponse: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: ProductBrand - Used By: Catalog - */ - - class ProductBrand: Codable { - - - public var uid: Int? - - public var logo: Media1? - - public var name: String? - - public var action: ProductListingAction? - - - public enum CodingKeys: String, CodingKey { - - case uid = "uid" - - case logo = "logo" - - case name = "name" - - case action = "action" - - } - - public init(action: ProductListingAction?, logo: Media1?, name: String?, uid: Int?) { - - self.uid = uid - - self.logo = logo - - self.name = name - - self.action = action - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(Media1.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(ProductListingAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - } - - } - - /* - Model: ProductDetailAttribute - Used By: Catalog - */ - - class ProductDetailAttribute: Codable { - - - public var type: String? - - public var key: String? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case key = "key" - - case value = "value" - - } - - public init(key: String?, type: String?, value: String?) { - - self.type = type - - self.key = key - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: ProductDetailGroupedAttribute - Used By: Catalog - */ - - class ProductDetailGroupedAttribute: Codable { - - - public var title: String? - - public var details: [ProductDetailAttribute]? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case details = "details" - - } - - public init(details: [ProductDetailAttribute]?, title: String?) { - - self.title = title - - self.details = details - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - details = try container.decode([ProductDetailAttribute].self, forKey: .details) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(details, forKey: .details) - - - } - - } - - /* - Model: Price1 - Used By: Catalog - */ - - class Price1: Codable { - - - public var max: Double? - - public var currencySymbol: String? - - public var min: Double? - - public var currencyCode: String? - - - public enum CodingKeys: String, CodingKey { - - case max = "max" - - case currencySymbol = "currency_symbol" - - case min = "min" - - case currencyCode = "currency_code" - - } - - public init(currencyCode: String?, currencySymbol: String?, max: Double?, min: Double?) { - - self.max = max - - self.currencySymbol = currencySymbol - - self.min = min - - self.currencyCode = currencyCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - max = try container.decode(Double.self, forKey: .max) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencySymbol = try container.decode(String.self, forKey: .currencySymbol) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - min = try container.decode(Double.self, forKey: .min) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(max, forKey: .max) - - - - try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) - - - - try? container.encodeIfPresent(min, forKey: .min) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - } - - } - - /* - Model: ProductListingPrice - Used By: Catalog - */ - - class ProductListingPrice: Codable { - - - public var marked: Price1? - - public var effective: Price1? - - - public enum CodingKeys: String, CodingKey { - - case marked = "marked" - - case effective = "effective" - - } - - public init(effective: Price1?, marked: Price1?) { - - self.marked = marked - - self.effective = effective - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - marked = try container.decode(Price1.self, forKey: .marked) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - effective = try container.decode(Price1.self, forKey: .effective) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(marked, forKey: .marked) - - - - try? container.encodeIfPresent(effective, forKey: .effective) - - - } - - } - - /* - Model: ProductListingDetail - Used By: Catalog - */ - - class ProductListingDetail: Codable { - - - public var shortDescription: String? - - public var attributes: [String: Any]? - - public var hasVariant: Bool? - - public var color: String? - - public var promoMeta: [String: Any]? - - public var discount: String? - - public var productOnlineDate: String? - - public var brand: ProductBrand? - - public var highlights: [String]? - - public var groupedAttributes: [ProductDetailGroupedAttribute]? - - public var teaserTag: [String: Any]? - - public var description: String? - - public var similars: [String]? - - public var itemCode: String? - - public var medias: [Media1]? - - public var tryouts: [String]? - - public var imageNature: String? - - public var uid: Int? - - public var ratingCount: Int? - - public var name: String? - - public var sellable: Bool? - - public var type: String? - - public var itemType: String? - - public var slug: String - - public var rating: Double? - - public var price: ProductListingPrice? - - - public enum CodingKeys: String, CodingKey { - - case shortDescription = "short_description" - - case attributes = "attributes" - - case hasVariant = "has_variant" - - case color = "color" - - case promoMeta = "promo_meta" - - case discount = "discount" - - case productOnlineDate = "product_online_date" - - case brand = "brand" - - case highlights = "highlights" - - case groupedAttributes = "grouped_attributes" - - case teaserTag = "teaser_tag" - - case description = "description" - - case similars = "similars" - - case itemCode = "item_code" - - case medias = "medias" - - case tryouts = "tryouts" - - case imageNature = "image_nature" - - case uid = "uid" - - case ratingCount = "rating_count" - - case name = "name" - - case sellable = "sellable" - - case type = "type" - - case itemType = "item_type" - - case slug = "slug" - - case rating = "rating" - - case price = "price" - - } - - public init(attributes: [String: Any]?, brand: ProductBrand?, color: String?, description: String?, discount: String?, groupedAttributes: [ProductDetailGroupedAttribute]?, hasVariant: Bool?, highlights: [String]?, imageNature: String?, itemCode: String?, itemType: String?, medias: [Media1]?, name: String?, price: ProductListingPrice?, productOnlineDate: String?, promoMeta: [String: Any]?, rating: Double?, ratingCount: Int?, sellable: Bool?, shortDescription: String?, similars: [String]?, slug: String, teaserTag: [String: Any]?, tryouts: [String]?, type: String?, uid: Int?) { - - self.shortDescription = shortDescription - - self.attributes = attributes - - self.hasVariant = hasVariant - - self.color = color - - self.promoMeta = promoMeta - - self.discount = discount - - self.productOnlineDate = productOnlineDate - - self.brand = brand - - self.highlights = highlights - - self.groupedAttributes = groupedAttributes - - self.teaserTag = teaserTag - - self.description = description - - self.similars = similars - - self.itemCode = itemCode - - self.medias = medias - - self.tryouts = tryouts - - self.imageNature = imageNature - - self.uid = uid - - self.ratingCount = ratingCount - - self.name = name - - self.sellable = sellable - - self.type = type - - self.itemType = itemType - - self.slug = slug - - self.rating = rating - - self.price = price - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - shortDescription = try container.decode(String.self, forKey: .shortDescription) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attributes = try container.decode([String: Any].self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasVariant = try container.decode(Bool.self, forKey: .hasVariant) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - color = try container.decode(String.self, forKey: .color) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - promoMeta = try container.decode([String: Any].self, forKey: .promoMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discount = try container.decode(String.self, forKey: .discount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productOnlineDate = try container.decode(String.self, forKey: .productOnlineDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brand = try container.decode(ProductBrand.self, forKey: .brand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - highlights = try container.decode([String].self, forKey: .highlights) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - groupedAttributes = try container.decode([ProductDetailGroupedAttribute].self, forKey: .groupedAttributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - teaserTag = try container.decode([String: Any].self, forKey: .teaserTag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - similars = try container.decode([String].self, forKey: .similars) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemCode = try container.decode(String.self, forKey: .itemCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - medias = try container.decode([Media1].self, forKey: .medias) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tryouts = try container.decode([String].self, forKey: .tryouts) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - imageNature = try container.decode(String.self, forKey: .imageNature) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ratingCount = try container.decode(Int.self, forKey: .ratingCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sellable = try container.decode(Bool.self, forKey: .sellable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemType = try container.decode(String.self, forKey: .itemType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - slug = try container.decode(String.self, forKey: .slug) - - - - - do { - rating = try container.decode(Double.self, forKey: .rating) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(ProductListingPrice.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(shortDescription, forKey: .shortDescription) - - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - - try? container.encodeIfPresent(hasVariant, forKey: .hasVariant) - - - - try? container.encodeIfPresent(color, forKey: .color) - - - - try? container.encodeIfPresent(promoMeta, forKey: .promoMeta) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - - try? container.encodeIfPresent(productOnlineDate, forKey: .productOnlineDate) - - - - try? container.encodeIfPresent(brand, forKey: .brand) - - - - try? container.encodeIfPresent(highlights, forKey: .highlights) - - - - try? container.encodeIfPresent(groupedAttributes, forKey: .groupedAttributes) - - - - try? container.encodeIfPresent(teaserTag, forKey: .teaserTag) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(similars, forKey: .similars) - - - - try? container.encodeIfPresent(itemCode, forKey: .itemCode) - - - - try? container.encodeIfPresent(medias, forKey: .medias) - - - - try? container.encodeIfPresent(tryouts, forKey: .tryouts) - - - - try? container.encodeIfPresent(imageNature, forKey: .imageNature) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(ratingCount, forKey: .ratingCount) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(sellable, forKey: .sellable) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(itemType, forKey: .itemType) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(rating, forKey: .rating) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - } - - } - - /* - Model: GetCollectionItemsResponse - Used By: Catalog - */ - - class GetCollectionItemsResponse: Codable { - - - public var items: [ProductListingDetail]? - - public var sortOn: [ProductSortOn]? - - public var page: Page? - - public var filters: [ProductFilters]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case sortOn = "sort_on" - - case page = "page" - - case filters = "filters" - - } - - public init(filters: [ProductFilters]?, items: [ProductListingDetail]?, page: Page?, sortOn: [ProductSortOn]?) { - - self.items = items - - self.sortOn = sortOn - - self.page = page - - self.filters = filters - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([ProductListingDetail].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sortOn = try container.decode([ProductSortOn].self, forKey: .sortOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - filters = try container.decode([ProductFilters].self, forKey: .filters) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(sortOn, forKey: .sortOn) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(filters, forKey: .filters) - - - } - - } - - /* - Model: CatalogInsightBrand - Used By: Catalog - */ - - class CatalogInsightBrand: Codable { - - - public var availableSizes: Int? - - public var articleFreshness: Int? - - public var availableArticles: Int? - - public var totalSizes: Int? - - public var totalArticles: Int? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case availableSizes = "available_sizes" - - case articleFreshness = "article_freshness" - - case availableArticles = "available_articles" - - case totalSizes = "total_sizes" - - case totalArticles = "total_articles" - - case name = "name" - - } - - public init(articleFreshness: Int?, availableArticles: Int?, availableSizes: Int?, name: String?, totalArticles: Int?, totalSizes: Int?) { - - self.availableSizes = availableSizes - - self.articleFreshness = articleFreshness - - self.availableArticles = availableArticles - - self.totalSizes = totalSizes - - self.totalArticles = totalArticles - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - availableSizes = try container.decode(Int.self, forKey: .availableSizes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - articleFreshness = try container.decode(Int.self, forKey: .articleFreshness) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - availableArticles = try container.decode(Int.self, forKey: .availableArticles) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalSizes = try container.decode(Int.self, forKey: .totalSizes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalArticles = try container.decode(Int.self, forKey: .totalArticles) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(availableSizes, forKey: .availableSizes) - - - - try? container.encodeIfPresent(articleFreshness, forKey: .articleFreshness) - - - - try? container.encodeIfPresent(availableArticles, forKey: .availableArticles) - - - - try? container.encodeIfPresent(totalSizes, forKey: .totalSizes) - - - - try? container.encodeIfPresent(totalArticles, forKey: .totalArticles) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: CatalogInsightItem - Used By: Catalog - */ - - class CatalogInsightItem: Codable { - - - public var outOfStockCount: Int? - - public var sellableCount: Int? - - public var count: Int? - - - public enum CodingKeys: String, CodingKey { - - case outOfStockCount = "out_of_stock_count" - - case sellableCount = "sellable_count" - - case count = "count" - - } - - public init(count: Int?, outOfStockCount: Int?, sellableCount: Int?) { - - self.outOfStockCount = outOfStockCount - - self.sellableCount = sellableCount - - self.count = count - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - outOfStockCount = try container.decode(Int.self, forKey: .outOfStockCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sellableCount = try container.decode(Int.self, forKey: .sellableCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(outOfStockCount, forKey: .outOfStockCount) - - - - try? container.encodeIfPresent(sellableCount, forKey: .sellableCount) - - - - try? container.encodeIfPresent(count, forKey: .count) - - - } - - } - - /* - Model: CatalogInsightResponse - Used By: Catalog - */ - - class CatalogInsightResponse: Codable { - - - public var brandDistribution: CatalogInsightBrand? - - public var item: CatalogInsightItem? - - - public enum CodingKeys: String, CodingKey { - - case brandDistribution = "brand_distribution" - - case item = "item" - - } - - public init(brandDistribution: CatalogInsightBrand?, item: CatalogInsightItem?) { - - self.brandDistribution = brandDistribution - - self.item = item - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - brandDistribution = try container.decode(CatalogInsightBrand.self, forKey: .brandDistribution) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - item = try container.decode(CatalogInsightItem.self, forKey: .item) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(brandDistribution, forKey: .brandDistribution) - - - - try? container.encodeIfPresent(item, forKey: .item) - - - } - - } - - /* - Model: CrossSellingData - Used By: Catalog - */ - - class CrossSellingData: Codable { - - - public var products: Int? - - public var articles: Int? - - - public enum CodingKeys: String, CodingKey { - - case products = "products" - - case articles = "articles" - - } - - public init(articles: Int?, products: Int?) { - - self.products = products - - self.articles = articles - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - products = try container.decode(Int.self, forKey: .products) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - articles = try container.decode(Int.self, forKey: .articles) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(products, forKey: .products) - - - - try? container.encodeIfPresent(articles, forKey: .articles) - - - } - - } - - /* - Model: CrossSellingResponse - Used By: Catalog - */ - - class CrossSellingResponse: Codable { - - - public var brandDistribution: CatalogInsightBrand? - - public var data: CrossSellingData? - - - public enum CodingKeys: String, CodingKey { - - case brandDistribution = "brand_distribution" - - case data = "data" - - } - - public init(brandDistribution: CatalogInsightBrand?, data: CrossSellingData?) { - - self.brandDistribution = brandDistribution - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - brandDistribution = try container.decode(CatalogInsightBrand.self, forKey: .brandDistribution) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode(CrossSellingData.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(brandDistribution, forKey: .brandDistribution) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: OptInPostRequest - Used By: Catalog - */ - - class OptInPostRequest: Codable { - - - public var storeIds: [Int]? - - public var brandIds: [Int]? - - public var optLevel: String - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case storeIds = "store_ids" - - case brandIds = "brand_ids" - - case optLevel = "opt_level" - - case enabled = "enabled" - - } - - public init(brandIds: [Int]?, enabled: Bool?, optLevel: String, storeIds: [Int]?) { - - self.storeIds = storeIds - - self.brandIds = brandIds - - self.optLevel = optLevel - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - storeIds = try container.decode([Int].self, forKey: .storeIds) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandIds = try container.decode([Int].self, forKey: .brandIds) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - optLevel = try container.decode(String.self, forKey: .optLevel) - - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(storeIds, forKey: .storeIds) - - - - try? container.encodeIfPresent(brandIds, forKey: .brandIds) - - - - try? container.encodeIfPresent(optLevel, forKey: .optLevel) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: CompanyOptIn - Used By: Catalog - */ - - class CompanyOptIn: Codable { - - - public var createdBy: [String: Any]? - - public var optLevel: String - - public var platform: String - - public var enabled: Bool - - public var companyId: Int - - public var brandIds: [Int] - - public var createdOn: Int - - public var modifiedOn: Int - - public var modifiedBy: [String: Any]? - - public var storeIds: [Int] - - - public enum CodingKeys: String, CodingKey { - - case createdBy = "created_by" - - case optLevel = "opt_level" - - case platform = "platform" - - case enabled = "enabled" - - case companyId = "company_id" - - case brandIds = "brand_ids" - - case createdOn = "created_on" - - case modifiedOn = "modified_on" - - case modifiedBy = "modified_by" - - case storeIds = "store_ids" - - } - - public init(brandIds: [Int], companyId: Int, createdBy: [String: Any]?, createdOn: Int, enabled: Bool, modifiedBy: [String: Any]?, modifiedOn: Int, optLevel: String, platform: String, storeIds: [Int]) { - - self.createdBy = createdBy - - self.optLevel = optLevel - - self.platform = platform - - self.enabled = enabled - - self.companyId = companyId - - self.brandIds = brandIds - - self.createdOn = createdOn - - self.modifiedOn = modifiedOn - - self.modifiedBy = modifiedBy - - self.storeIds = storeIds - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdBy = try container.decode([String: Any].self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - optLevel = try container.decode(String.self, forKey: .optLevel) - - - - - platform = try container.decode(String.self, forKey: .platform) - - - - - enabled = try container.decode(Bool.self, forKey: .enabled) - - - - - companyId = try container.decode(Int.self, forKey: .companyId) - - - - - brandIds = try container.decode([Int].self, forKey: .brandIds) - - - - - createdOn = try container.decode(Int.self, forKey: .createdOn) - - - - - modifiedOn = try container.decode(Int.self, forKey: .modifiedOn) - - - - - do { - modifiedBy = try container.decode([String: Any].self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - storeIds = try container.decode([Int].self, forKey: .storeIds) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(optLevel, forKey: .optLevel) - - - - try? container.encodeIfPresent(platform, forKey: .platform) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(brandIds, forKey: .brandIds) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(storeIds, forKey: .storeIds) - - - } - - } - - /* - Model: GetOptInPlatform - Used By: Catalog - */ - - class GetOptInPlatform: Codable { - - - public var items: [CompanyOptIn] - - public var page: Page - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [CompanyOptIn], page: Page) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - items = try container.decode([CompanyOptIn].self, forKey: .items) - - - - - page = try container.decode(Page.self, forKey: .page) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: OptinCompanyDetail - Used By: Catalog - */ - - class OptinCompanyDetail: Codable { - - - public var uid: Int? - - public var businessType: String? - - public var name: String? - - public var companyType: String? - - - public enum CodingKeys: String, CodingKey { - - case uid = "uid" - - case businessType = "business_type" - - case name = "name" - - case companyType = "company_type" - - } - - public init(businessType: String?, companyType: String?, name: String?, uid: Int?) { - - self.uid = uid - - self.businessType = businessType - - self.name = name - - self.companyType = companyType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - businessType = try container.decode(String.self, forKey: .businessType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyType = try container.decode(String.self, forKey: .companyType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(businessType, forKey: .businessType) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(companyType, forKey: .companyType) - - - } - - } - - /* - Model: CompanyBrandDetail - Used By: Catalog - */ - - class CompanyBrandDetail: Codable { - - - public var companyId: Int? - - public var totalArticle: Int? - - public var brandName: String? - - public var brandId: Int? - - - public enum CodingKeys: String, CodingKey { - - case companyId = "company_id" - - case totalArticle = "total_article" - - case brandName = "brand_name" - - case brandId = "brand_id" - - } - - public init(brandId: Int?, brandName: String?, companyId: Int?, totalArticle: Int?) { - - self.companyId = companyId - - self.totalArticle = totalArticle - - self.brandName = brandName - - self.brandId = brandId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalArticle = try container.decode(Int.self, forKey: .totalArticle) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandName = try container.decode(String.self, forKey: .brandName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandId = try container.decode(Int.self, forKey: .brandId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(totalArticle, forKey: .totalArticle) - - - - try? container.encodeIfPresent(brandName, forKey: .brandName) - - - - try? container.encodeIfPresent(brandId, forKey: .brandId) - - - } - - } - - /* - Model: OptinCompanyBrandDetailsView - Used By: Catalog - */ - - class OptinCompanyBrandDetailsView: Codable { - - - public var items: [CompanyBrandDetail]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [CompanyBrandDetail]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([CompanyBrandDetail].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: OptinCompanyMetrics - Used By: Catalog - */ - - class OptinCompanyMetrics: Codable { - - - public var store: Int? - - public var brand: Int? - - public var company: String? - - - public enum CodingKeys: String, CodingKey { - - case store = "store" - - case brand = "brand" - - case company = "company" - - } - - public init(brand: Int?, company: String?, store: Int?) { - - self.store = store - - self.brand = brand - - self.company = company - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - store = try container.decode(Int.self, forKey: .store) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brand = try container.decode(Int.self, forKey: .brand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - company = try container.decode(String.self, forKey: .company) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(store, forKey: .store) - - - - try? container.encodeIfPresent(brand, forKey: .brand) - - - - try? container.encodeIfPresent(company, forKey: .company) - - - } - - } - - /* - Model: StoreDetail - Used By: Catalog - */ - - class StoreDetail: Codable { - - - public var storeType: String? - - public var documents: [[String: Any]]? - - public var displayName: String? - - public var storeCode: String? - - public var companyId: Int? - - public var createdOn: String? - - public var modifiedOn: String? - - public var additionalContacts: [[String: Any]]? - - public var uid: Int? - - public var timing: [String: Any]? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case storeType = "store_type" - - case documents = "documents" - - case displayName = "display_name" - - case storeCode = "store_code" - - case companyId = "company_id" - - case createdOn = "created_on" - - case modifiedOn = "modified_on" - - case additionalContacts = "additional_contacts" - - case uid = "uid" - - case timing = "timing" - - case name = "name" - - } - - public init(additionalContacts: [[String: Any]]?, companyId: Int?, createdOn: String?, displayName: String?, documents: [[String: Any]]?, modifiedOn: String?, name: String?, storeCode: String?, storeType: String?, timing: [String: Any]?, uid: Int?) { - - self.storeType = storeType - - self.documents = documents - - self.displayName = displayName - - self.storeCode = storeCode - - self.companyId = companyId - - self.createdOn = createdOn - - self.modifiedOn = modifiedOn - - self.additionalContacts = additionalContacts - - self.uid = uid - - self.timing = timing - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - storeType = try container.decode(String.self, forKey: .storeType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - documents = try container.decode([[String: Any]].self, forKey: .documents) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeCode = try container.decode(String.self, forKey: .storeCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - additionalContacts = try container.decode([[String: Any]].self, forKey: .additionalContacts) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - timing = try container.decode([String: Any].self, forKey: .timing) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(storeType, forKey: .storeType) - - - - try? container.encodeIfPresent(documents, forKey: .documents) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(storeCode, forKey: .storeCode) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(additionalContacts, forKey: .additionalContacts) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(timing, forKey: .timing) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: OptinStoreDetails - Used By: Catalog - */ - - class OptinStoreDetails: Codable { - - - public var items: [StoreDetail]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [StoreDetail]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([StoreDetail].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: AttributeMasterDetails - Used By: Catalog - */ - - class AttributeMasterDetails: Codable { - - - public var displayType: String - - - public enum CodingKeys: String, CodingKey { - - case displayType = "display_type" - - } - - public init(displayType: String) { - - self.displayType = displayType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - displayType = try container.decode(String.self, forKey: .displayType) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(displayType, forKey: .displayType) - - - } - - } - - /* - Model: AttributeMasterFilter - Used By: Catalog - */ - - class AttributeMasterFilter: Codable { - - - public var priority: Int? - - public var indexing: Bool - - public var dependsOn: [String]? - - - public enum CodingKeys: String, CodingKey { - - case priority = "priority" - - case indexing = "indexing" - - case dependsOn = "depends_on" - - } - - public init(dependsOn: [String]?, indexing: Bool, priority: Int?) { - - self.priority = priority - - self.indexing = indexing - - self.dependsOn = dependsOn - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - priority = try container.decode(Int.self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - indexing = try container.decode(Bool.self, forKey: .indexing) - - - - - do { - dependsOn = try container.decode([String].self, forKey: .dependsOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(indexing, forKey: .indexing) - - - - try? container.encodeIfPresent(dependsOn, forKey: .dependsOn) - - - } - - } - - /* - Model: AttributeMasterMandatoryDetails - Used By: Catalog - */ - - class AttributeMasterMandatoryDetails: Codable { - - - public var l3Keys: [String]? - - - public enum CodingKeys: String, CodingKey { - - case l3Keys = "l3_keys" - - } - - public init(l3Keys: [String]?) { - - self.l3Keys = l3Keys - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - l3Keys = try container.decode([String].self, forKey: .l3Keys) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(l3Keys, forKey: .l3Keys) - - - } - - } - - /* - Model: AttributeMasterMeta - Used By: Catalog - */ - - class AttributeMasterMeta: Codable { - - - public var enriched: Bool? - - public var mandatoryDetails: AttributeMasterMandatoryDetails - - - public enum CodingKeys: String, CodingKey { - - case enriched = "enriched" - - case mandatoryDetails = "mandatory_details" - - } - - public init(enriched: Bool?, mandatoryDetails: AttributeMasterMandatoryDetails) { - - self.enriched = enriched - - self.mandatoryDetails = mandatoryDetails - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enriched = try container.decode(Bool.self, forKey: .enriched) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - mandatoryDetails = try container.decode(AttributeMasterMandatoryDetails.self, forKey: .mandatoryDetails) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enriched, forKey: .enriched) - - - - try? container.encodeIfPresent(mandatoryDetails, forKey: .mandatoryDetails) - - - } - - } - - /* - Model: AttributeSchemaRange - Used By: Catalog - */ - - class AttributeSchemaRange: Codable { - - - public var max: Int? - - public var min: Int? - - - public enum CodingKeys: String, CodingKey { - - case max = "max" - - case min = "min" - - } - - public init(max: Int?, min: Int?) { - - self.max = max - - self.min = min - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - max = try container.decode(Int.self, forKey: .max) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - min = try container.decode(Int.self, forKey: .min) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(max, forKey: .max) - - - - try? container.encodeIfPresent(min, forKey: .min) - - - } - - } - - /* - Model: AttributeMaster - Used By: Catalog - */ - - class AttributeMaster: Codable { - - - public var type: String - - public var mandatory: Bool? - - public var allowedValues: [String]? - - public var format: String? - - public var multi: Bool? - - public var range: AttributeSchemaRange? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case mandatory = "mandatory" - - case allowedValues = "allowed_values" - - case format = "format" - - case multi = "multi" - - case range = "range" - - } - - public init(allowedValues: [String]?, format: String?, mandatory: Bool?, multi: Bool?, range: AttributeSchemaRange?, type: String) { - - self.type = type - - self.mandatory = mandatory - - self.allowedValues = allowedValues - - self.format = format - - self.multi = multi - - self.range = range - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - type = try container.decode(String.self, forKey: .type) - - - - - do { - mandatory = try container.decode(Bool.self, forKey: .mandatory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allowedValues = try container.decode([String].self, forKey: .allowedValues) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - format = try container.decode(String.self, forKey: .format) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - multi = try container.decode(Bool.self, forKey: .multi) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - range = try container.decode(AttributeSchemaRange.self, forKey: .range) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(mandatory, forKey: .mandatory) - - - - try? container.encodeIfPresent(allowedValues, forKey: .allowedValues) - - - - try? container.encodeIfPresent(format, forKey: .format) - - - - try? container.encodeIfPresent(multi, forKey: .multi) - - - - try? container.encodeIfPresent(range, forKey: .range) - - - } - - } - - /* - Model: GenderDetail - Used By: Catalog - */ - - class GenderDetail: Codable { - - - public var description: String? - - public var details: AttributeMasterDetails? - - public var departments: [String]? - - public var filters: AttributeMasterFilter? - - public var slug: String? - - public var enabledForEndConsumer: Bool? - - public var meta: AttributeMasterMeta? - - public var schema: AttributeMaster? - - public var logo: String? - - public var id: String? - - public var isNested: Bool? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case details = "details" - - case departments = "departments" - - case filters = "filters" - - case slug = "slug" - - case enabledForEndConsumer = "enabled_for_end_consumer" - - case meta = "meta" - - case schema = "schema" - - case logo = "logo" - - case id = "id" - - case isNested = "is_nested" - - case name = "name" - - } - - public init(departments: [String]?, description: String?, details: AttributeMasterDetails?, enabledForEndConsumer: Bool?, filters: AttributeMasterFilter?, id: String?, isNested: Bool?, logo: String?, meta: AttributeMasterMeta?, name: String?, schema: AttributeMaster?, slug: String?) { - - self.description = description - - self.details = details - - self.departments = departments - - self.filters = filters - - self.slug = slug - - self.enabledForEndConsumer = enabledForEndConsumer - - self.meta = meta - - self.schema = schema - - self.logo = logo - - self.id = id - - self.isNested = isNested - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - details = try container.decode(AttributeMasterDetails.self, forKey: .details) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - departments = try container.decode([String].self, forKey: .departments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - filters = try container.decode(AttributeMasterFilter.self, forKey: .filters) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabledForEndConsumer = try container.decode(Bool.self, forKey: .enabledForEndConsumer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode(AttributeMasterMeta.self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schema = try container.decode(AttributeMaster.self, forKey: .schema) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isNested = try container.decode(Bool.self, forKey: .isNested) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(details, forKey: .details) - - - - try? container.encodeIfPresent(departments, forKey: .departments) - - - - try? container.encodeIfPresent(filters, forKey: .filters) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(enabledForEndConsumer, forKey: .enabledForEndConsumer) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(schema, forKey: .schema) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(isNested, forKey: .isNested) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: ProdcutTemplateCategoriesResponse - Used By: Catalog - */ - - class ProdcutTemplateCategoriesResponse: Codable { - - - public var items: [[String: Any]]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [[String: Any]]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([[String: Any]].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: PTErrorResponse - Used By: Catalog - */ - - class PTErrorResponse: Codable { - - - public var message: String? - - public var code: String? - - public var meta: [String: Any]? - - public var status: Int? - - public var errors: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - case code = "code" - - case meta = "meta" - - case status = "status" - - case errors = "errors" - - } - - public init(code: String?, errors: [String: Any]?, message: String?, meta: [String: Any]?, status: Int?) { - - self.message = message - - self.code = code - - self.meta = meta - - self.status = status - - self.errors = errors - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(Int.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - errors = try container.decode([String: Any].self, forKey: .errors) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(errors, forKey: .errors) - - - } - - } - - /* - Model: UserSerializer - Used By: Catalog - */ - - class UserSerializer: Codable { - - - public var username: String? - - public var contact: String? - - public var userId: String? - - - public enum CodingKeys: String, CodingKey { - - case username = "username" - - case contact = "contact" - - case userId = "user_id" - - } - - public init(contact: String?, username: String?, userId: String?) { - - self.username = username - - self.contact = contact - - self.userId = userId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - username = try container.decode(String.self, forKey: .username) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contact = try container.decode(String.self, forKey: .contact) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(username, forKey: .username) - - - - try? container.encodeIfPresent(contact, forKey: .contact) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - } - - } - - /* - Model: GetDepartment - Used By: Catalog - */ - - class GetDepartment: Codable { - - - public var createdBy: UserSerializer? - - public var pageSize: Int? - - public var priorityOrder: Int? - - public var itemType: String? - - public var pageNo: Int? - - public var search: String? - - public var createdOn: String? - - public var slug: String? - - public var modifiedOn: String? - - public var logo: String? - - public var modifiedBy: UserSerializer? - - public var isActive: Bool? - - public var uid: Int? - - public var synonyms: [String]? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case createdBy = "created_by" - - case pageSize = "page_size" - - case priorityOrder = "priority_order" - - case itemType = "item_type" - - case pageNo = "page_no" - - case search = "search" - - case createdOn = "created_on" - - case slug = "slug" - - case modifiedOn = "modified_on" - - case logo = "logo" - - case modifiedBy = "modified_by" - - case isActive = "is_active" - - case uid = "uid" - - case synonyms = "synonyms" - - case name = "name" - - } - - public init(createdBy: UserSerializer?, createdOn: String?, isActive: Bool?, itemType: String?, logo: String?, modifiedBy: UserSerializer?, modifiedOn: String?, name: String?, pageNo: Int?, pageSize: Int?, priorityOrder: Int?, search: String?, slug: String?, synonyms: [String]?, uid: Int?) { - - self.createdBy = createdBy - - self.pageSize = pageSize - - self.priorityOrder = priorityOrder - - self.itemType = itemType - - self.pageNo = pageNo - - self.search = search - - self.createdOn = createdOn - - self.slug = slug - - self.modifiedOn = modifiedOn - - self.logo = logo - - self.modifiedBy = modifiedBy - - self.isActive = isActive - - self.uid = uid - - self.synonyms = synonyms - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdBy = try container.decode(UserSerializer.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pageSize = try container.decode(Int.self, forKey: .pageSize) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priorityOrder = try container.decode(Int.self, forKey: .priorityOrder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemType = try container.decode(String.self, forKey: .itemType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pageNo = try container.decode(Int.self, forKey: .pageNo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - search = try container.decode(String.self, forKey: .search) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode(UserSerializer.self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - synonyms = try container.decode([String].self, forKey: .synonyms) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(pageSize, forKey: .pageSize) - - - - try? container.encodeIfPresent(priorityOrder, forKey: .priorityOrder) - - - - try? container.encodeIfPresent(itemType, forKey: .itemType) - - - - try? container.encodeIfPresent(pageNo, forKey: .pageNo) - - - - try? container.encodeIfPresent(search, forKey: .search) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(synonyms, forKey: .synonyms) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: DepartmentsResponse - Used By: Catalog - */ - - class DepartmentsResponse: Codable { - - - public var items: [GetDepartment]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [GetDepartment]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([GetDepartment].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: DepartmentErrorResponse - Used By: Catalog - */ - - class DepartmentErrorResponse: Codable { - - - public var message: String? - - public var code: String? - - public var meta: [String: Any]? - - public var status: Int? - - public var errors: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - case code = "code" - - case meta = "meta" - - case status = "status" - - case errors = "errors" - - } - - public init(code: String?, errors: [String: Any]?, message: String?, meta: [String: Any]?, status: Int?) { - - self.message = message - - self.code = code - - self.meta = meta - - self.status = status - - self.errors = errors - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(Int.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - errors = try container.decode([String: Any].self, forKey: .errors) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(errors, forKey: .errors) - - - } - - } - - /* - Model: ProductTemplate - Used By: Catalog - */ - - class ProductTemplate: Codable { - - - public var description: String? - - public var createdBy: [String: Any]? - - public var isPhysical: Bool - - public var tag: String? - - public var categories: [String]? - - public var attributes: [String]? - - public var isArchived: Bool? - - public var departments: [String]? - - public var createdOn: String? - - public var slug: String - - public var modifiedOn: String? - - public var logo: String? - - public var modifiedBy: [String: Any]? - - public var isActive: Bool? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case createdBy = "created_by" - - case isPhysical = "is_physical" - - case tag = "tag" - - case categories = "categories" - - case attributes = "attributes" - - case isArchived = "is_archived" - - case departments = "departments" - - case createdOn = "created_on" - - case slug = "slug" - - case modifiedOn = "modified_on" - - case logo = "logo" - - case modifiedBy = "modified_by" - - case isActive = "is_active" - - case name = "name" - - } - - public init(attributes: [String]?, categories: [String]?, createdBy: [String: Any]?, createdOn: String?, departments: [String]?, description: String?, isActive: Bool?, isArchived: Bool?, isPhysical: Bool, logo: String?, modifiedBy: [String: Any]?, modifiedOn: String?, name: String?, slug: String, tag: String?) { - - self.description = description - - self.createdBy = createdBy - - self.isPhysical = isPhysical - - self.tag = tag - - self.categories = categories - - self.attributes = attributes - - self.isArchived = isArchived - - self.departments = departments - - self.createdOn = createdOn - - self.slug = slug - - self.modifiedOn = modifiedOn - - self.logo = logo - - self.modifiedBy = modifiedBy - - self.isActive = isActive - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode([String: Any].self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - isPhysical = try container.decode(Bool.self, forKey: .isPhysical) - - - - - do { - tag = try container.decode(String.self, forKey: .tag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - categories = try container.decode([String].self, forKey: .categories) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attributes = try container.decode([String].self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isArchived = try container.decode(Bool.self, forKey: .isArchived) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - departments = try container.decode([String].self, forKey: .departments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - slug = try container.decode(String.self, forKey: .slug) - - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode([String: Any].self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(isPhysical, forKey: .isPhysical) - - - - try? container.encodeIfPresent(tag, forKey: .tag) - - - - try? container.encodeIfPresent(categories, forKey: .categories) - - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - - try? container.encodeIfPresent(isArchived, forKey: .isArchived) - - - - try? container.encodeIfPresent(departments, forKey: .departments) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: TemplatesResponse - Used By: Catalog - */ - - class TemplatesResponse: Codable { - - - public var items: ProductTemplate? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: ProductTemplate?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode(ProductTemplate.self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: TemplateDetails - Used By: Catalog - */ - - class TemplateDetails: Codable { - - - public var description: String? - - public var isPhysical: Bool - - public var tag: String? - - public var categories: [String]? - - public var attributes: [String]? - - public var isArchived: Bool? - - public var departments: [String]? - - public var slug: String - - public var logo: String? - - public var id: String? - - public var isActive: Bool? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case isPhysical = "is_physical" - - case tag = "tag" - - case categories = "categories" - - case attributes = "attributes" - - case isArchived = "is_archived" - - case departments = "departments" - - case slug = "slug" - - case logo = "logo" - - case id = "id" - - case isActive = "is_active" - - case name = "name" - - } - - public init(attributes: [String]?, categories: [String]?, departments: [String]?, description: String?, id: String?, isActive: Bool?, isArchived: Bool?, isPhysical: Bool, logo: String?, name: String?, slug: String, tag: String?) { - - self.description = description - - self.isPhysical = isPhysical - - self.tag = tag - - self.categories = categories - - self.attributes = attributes - - self.isArchived = isArchived - - self.departments = departments - - self.slug = slug - - self.logo = logo - - self.id = id - - self.isActive = isActive - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - isPhysical = try container.decode(Bool.self, forKey: .isPhysical) - - - - - do { - tag = try container.decode(String.self, forKey: .tag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - categories = try container.decode([String].self, forKey: .categories) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attributes = try container.decode([String].self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isArchived = try container.decode(Bool.self, forKey: .isArchived) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - departments = try container.decode([String].self, forKey: .departments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - slug = try container.decode(String.self, forKey: .slug) - - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(isPhysical, forKey: .isPhysical) - - - - try? container.encodeIfPresent(tag, forKey: .tag) - - - - try? container.encodeIfPresent(categories, forKey: .categories) - - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - - try? container.encodeIfPresent(isArchived, forKey: .isArchived) - - - - try? container.encodeIfPresent(departments, forKey: .departments) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: Properties - Used By: Catalog - */ - - class Properties: Codable { - - - public var shortDescription: [String: Any]? - - public var countryOfOrigin: [String: Any]? - - public var categorySlug: [String: Any]? - - public var noOfBoxes: [String: Any]? - - public var isActive: [String: Any]? - - public var customOrder: [String: Any]? - - public var media: [String: Any]? - - public var command: [String: Any]? - - public var moq: [String: Any]? - - public var highlights: [String: Any]? - - public var productGroupTag: [String: Any]? - - public var sizes: [String: Any]? - - public var teaserTag: [String: Any]? - - public var multiSize: [String: Any]? - - public var description: [String: Any]? - - public var isDependent: [String: Any]? - - public var itemCode: [String: Any]? - - public var sizeGuide: [String: Any]? - - public var currency: [String: Any]? - - public var productPublish: [String: Any]? - - public var name: [String: Any]? - - public var traderType: [String: Any]? - - public var returnConfig: [String: Any]? - - public var brandUid: [String: Any]? - - public var itemType: [String: Any]? - - public var slug: [String: Any]? - - public var trader: [String: Any]? - - public var hsnCode: [String: Any]? - - public var variants: [String: Any]? - - public var tags: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case shortDescription = "short_description" - - case countryOfOrigin = "country_of_origin" - - case categorySlug = "category_slug" - - case noOfBoxes = "no_of_boxes" - - case isActive = "is_active" - - case customOrder = "custom_order" - - case media = "media" - - case command = "command" - - case moq = "moq" - - case highlights = "highlights" - - case productGroupTag = "product_group_tag" - - case sizes = "sizes" - - case teaserTag = "teaser_tag" - - case multiSize = "multi_size" - - case description = "description" - - case isDependent = "is_dependent" - - case itemCode = "item_code" - - case sizeGuide = "size_guide" - - case currency = "currency" - - case productPublish = "product_publish" - - case name = "name" - - case traderType = "trader_type" - - case returnConfig = "return_config" - - case brandUid = "brand_uid" - - case itemType = "item_type" - - case slug = "slug" - - case trader = "trader" - - case hsnCode = "hsn_code" - - case variants = "variants" - - case tags = "tags" - - } - - public init(brandUid: [String: Any]?, categorySlug: [String: Any]?, command: [String: Any]?, countryOfOrigin: [String: Any]?, currency: [String: Any]?, customOrder: [String: Any]?, description: [String: Any]?, highlights: [String: Any]?, hsnCode: [String: Any]?, isActive: [String: Any]?, isDependent: [String: Any]?, itemCode: [String: Any]?, itemType: [String: Any]?, media: [String: Any]?, moq: [String: Any]?, multiSize: [String: Any]?, name: [String: Any]?, noOfBoxes: [String: Any]?, productGroupTag: [String: Any]?, productPublish: [String: Any]?, returnConfig: [String: Any]?, shortDescription: [String: Any]?, sizes: [String: Any]?, sizeGuide: [String: Any]?, slug: [String: Any]?, tags: [String: Any]?, teaserTag: [String: Any]?, trader: [String: Any]?, traderType: [String: Any]?, variants: [String: Any]?) { - - self.shortDescription = shortDescription - - self.countryOfOrigin = countryOfOrigin - - self.categorySlug = categorySlug - - self.noOfBoxes = noOfBoxes - - self.isActive = isActive - - self.customOrder = customOrder - - self.media = media - - self.command = command - - self.moq = moq - - self.highlights = highlights - - self.productGroupTag = productGroupTag - - self.sizes = sizes - - self.teaserTag = teaserTag - - self.multiSize = multiSize - - self.description = description - - self.isDependent = isDependent - - self.itemCode = itemCode - - self.sizeGuide = sizeGuide - - self.currency = currency - - self.productPublish = productPublish - - self.name = name - - self.traderType = traderType - - self.returnConfig = returnConfig - - self.brandUid = brandUid - - self.itemType = itemType - - self.slug = slug - - self.trader = trader - - self.hsnCode = hsnCode - - self.variants = variants - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - shortDescription = try container.decode([String: Any].self, forKey: .shortDescription) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryOfOrigin = try container.decode([String: Any].self, forKey: .countryOfOrigin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - categorySlug = try container.decode([String: Any].self, forKey: .categorySlug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - noOfBoxes = try container.decode([String: Any].self, forKey: .noOfBoxes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode([String: Any].self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customOrder = try container.decode([String: Any].self, forKey: .customOrder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - media = try container.decode([String: Any].self, forKey: .media) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - command = try container.decode([String: Any].self, forKey: .command) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - moq = try container.decode([String: Any].self, forKey: .moq) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - highlights = try container.decode([String: Any].self, forKey: .highlights) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productGroupTag = try container.decode([String: Any].self, forKey: .productGroupTag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sizes = try container.decode([String: Any].self, forKey: .sizes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - teaserTag = try container.decode([String: Any].self, forKey: .teaserTag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - multiSize = try container.decode([String: Any].self, forKey: .multiSize) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode([String: Any].self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isDependent = try container.decode([String: Any].self, forKey: .isDependent) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemCode = try container.decode([String: Any].self, forKey: .itemCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sizeGuide = try container.decode([String: Any].self, forKey: .sizeGuide) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode([String: Any].self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productPublish = try container.decode([String: Any].self, forKey: .productPublish) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode([String: Any].self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - traderType = try container.decode([String: Any].self, forKey: .traderType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - returnConfig = try container.decode([String: Any].self, forKey: .returnConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandUid = try container.decode([String: Any].self, forKey: .brandUid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemType = try container.decode([String: Any].self, forKey: .itemType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode([String: Any].self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - trader = try container.decode([String: Any].self, forKey: .trader) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hsnCode = try container.decode([String: Any].self, forKey: .hsnCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - variants = try container.decode([String: Any].self, forKey: .variants) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String: Any].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(shortDescription, forKey: .shortDescription) - - - - try? container.encodeIfPresent(countryOfOrigin, forKey: .countryOfOrigin) - - - - try? container.encodeIfPresent(categorySlug, forKey: .categorySlug) - - - - try? container.encodeIfPresent(noOfBoxes, forKey: .noOfBoxes) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(customOrder, forKey: .customOrder) - - - - try? container.encodeIfPresent(media, forKey: .media) - - - - try? container.encodeIfPresent(command, forKey: .command) - - - - try? container.encodeIfPresent(moq, forKey: .moq) - - - - try? container.encodeIfPresent(highlights, forKey: .highlights) - - - - try? container.encodeIfPresent(productGroupTag, forKey: .productGroupTag) - - - - try? container.encodeIfPresent(sizes, forKey: .sizes) - - - - try? container.encodeIfPresent(teaserTag, forKey: .teaserTag) - - - - try? container.encodeIfPresent(multiSize, forKey: .multiSize) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(isDependent, forKey: .isDependent) - - - - try? container.encodeIfPresent(itemCode, forKey: .itemCode) - - - - try? container.encodeIfPresent(sizeGuide, forKey: .sizeGuide) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(productPublish, forKey: .productPublish) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(traderType, forKey: .traderType) - - - - try? container.encodeIfPresent(returnConfig, forKey: .returnConfig) - - - - try? container.encodeIfPresent(brandUid, forKey: .brandUid) - - - - try? container.encodeIfPresent(itemType, forKey: .itemType) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(trader, forKey: .trader) - - - - try? container.encodeIfPresent(hsnCode, forKey: .hsnCode) - - - - try? container.encodeIfPresent(variants, forKey: .variants) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: GlobalValidation - Used By: Catalog - */ - - class GlobalValidation: Codable { - - - public var description: String? - - public var type: String? - - public var definitions: [String: Any]? - - public var required: [String]? - - public var properties: Properties? - - public var title: String? - - - public enum CodingKeys: String, CodingKey { - - case description = "description" - - case type = "type" - - case definitions = "definitions" - - case required = "required" - - case properties = "properties" - - case title = "title" - - } - - public init(definitions: [String: Any]?, description: String?, properties: Properties?, required: [String]?, title: String?, type: String?) { - - self.description = description - - self.type = type - - self.definitions = definitions - - self.required = required - - self.properties = properties - - self.title = title - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - definitions = try container.decode([String: Any].self, forKey: .definitions) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - required = try container.decode([String].self, forKey: .required) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - properties = try container.decode(Properties.self, forKey: .properties) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(definitions, forKey: .definitions) - - - - try? container.encodeIfPresent(required, forKey: .required) - - - - try? container.encodeIfPresent(properties, forKey: .properties) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - } - - } - - /* - Model: TemplateValidationData - Used By: Catalog - */ - - class TemplateValidationData: Codable { - - - public var templateValidation: [String: Any]? - - public var globalValidation: GlobalValidation? - - - public enum CodingKeys: String, CodingKey { - - case templateValidation = "template_validation" - - case globalValidation = "global_validation" - - } - - public init(globalValidation: GlobalValidation?, templateValidation: [String: Any]?) { - - self.templateValidation = templateValidation - - self.globalValidation = globalValidation - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - templateValidation = try container.decode([String: Any].self, forKey: .templateValidation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - globalValidation = try container.decode(GlobalValidation.self, forKey: .globalValidation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(templateValidation, forKey: .templateValidation) - - - - try? container.encodeIfPresent(globalValidation, forKey: .globalValidation) - - - } - - } - - /* - Model: TemplatesValidationResponse - Used By: Catalog - */ - - class TemplatesValidationResponse: Codable { - - - public var templateDetails: TemplateDetails? - - public var data: TemplateValidationData? - - - public enum CodingKeys: String, CodingKey { - - case templateDetails = "template_details" - - case data = "data" - - } - - public init(data: TemplateValidationData?, templateDetails: TemplateDetails?) { - - self.templateDetails = templateDetails - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - templateDetails = try container.decode(TemplateDetails.self, forKey: .templateDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode(TemplateValidationData.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(templateDetails, forKey: .templateDetails) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: InventoryValidationResponse - Used By: Catalog - */ - - class InventoryValidationResponse: Codable { - - - public var message: String? - - public var data: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - case data = "data" - - } - - public init(data: [String: Any]?, message: String?) { - - self.message = message - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode([String: Any].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: HSNData - Used By: Catalog - */ - - class HSNData: Codable { - - - public var countryOfOrigin: [String]? - - public var hsnCode: [String]? - - - public enum CodingKeys: String, CodingKey { - - case countryOfOrigin = "country_of_origin" - - case hsnCode = "hsn_code" - - } - - public init(countryOfOrigin: [String]?, hsnCode: [String]?) { - - self.countryOfOrigin = countryOfOrigin - - self.hsnCode = hsnCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - countryOfOrigin = try container.decode([String].self, forKey: .countryOfOrigin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hsnCode = try container.decode([String].self, forKey: .hsnCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(countryOfOrigin, forKey: .countryOfOrigin) - - - - try? container.encodeIfPresent(hsnCode, forKey: .hsnCode) - - - } - - } - - /* - Model: HSNCodesResponse - Used By: Catalog - */ - - class HSNCodesResponse: Codable { - - - public var message: String? - - public var data: HSNData? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - case data = "data" - - } - - public init(data: HSNData?, message: String?) { - - self.message = message - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode(HSNData.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: VerifiedBy - Used By: Catalog - */ - - class VerifiedBy: Codable { - - - public var username: String? - - public var userId: String? - - - public enum CodingKeys: String, CodingKey { - - case username = "username" - - case userId = "user_id" - - } - - public init(username: String?, userId: String?) { - - self.username = username - - self.userId = userId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - username = try container.decode(String.self, forKey: .username) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(username, forKey: .username) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - } - - } - - /* - Model: ProductDownloadItemsData - Used By: Catalog - */ - - class ProductDownloadItemsData: Codable { - - - public var templates: [String]? - - public var brand: [String]? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case templates = "templates" - - case brand = "brand" - - case type = "type" - - } - - public init(brand: [String]?, templates: [String]?, type: String?) { - - self.templates = templates - - self.brand = brand - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - templates = try container.decode([String].self, forKey: .templates) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brand = try container.decode([String].self, forKey: .brand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(templates, forKey: .templates) - - - - try? container.encodeIfPresent(brand, forKey: .brand) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ProductDownloadsItems - Used By: Catalog - */ - - class ProductDownloadsItems: Codable { - - - public var createdBy: VerifiedBy? - - public var url: String? - - public var sellerId: Double? - - public var templateTags: [String: Any]? - - public var id: String? - - public var status: String? - - public var triggerOn: String? - - public var completedOn: String? - - public var data: ProductDownloadItemsData? - - public var taskId: String? - - - public enum CodingKeys: String, CodingKey { - - case createdBy = "created_by" - - case url = "url" - - case sellerId = "seller_id" - - case templateTags = "template_tags" - - case id = "id" - - case status = "status" - - case triggerOn = "trigger_on" - - case completedOn = "completed_on" - - case data = "data" - - case taskId = "task_id" - - } - - public init(completedOn: String?, createdBy: VerifiedBy?, data: ProductDownloadItemsData?, id: String?, sellerId: Double?, status: String?, taskId: String?, templateTags: [String: Any]?, triggerOn: String?, url: String?) { - - self.createdBy = createdBy - - self.url = url - - self.sellerId = sellerId - - self.templateTags = templateTags - - self.id = id - - self.status = status - - self.triggerOn = triggerOn - - self.completedOn = completedOn - - self.data = data - - self.taskId = taskId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdBy = try container.decode(VerifiedBy.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sellerId = try container.decode(Double.self, forKey: .sellerId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - templateTags = try container.decode([String: Any].self, forKey: .templateTags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - triggerOn = try container.decode(String.self, forKey: .triggerOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - completedOn = try container.decode(String.self, forKey: .completedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode(ProductDownloadItemsData.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - taskId = try container.decode(String.self, forKey: .taskId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(sellerId, forKey: .sellerId) - - - - try? container.encodeIfPresent(templateTags, forKey: .templateTags) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(triggerOn, forKey: .triggerOn) - - - - try? container.encodeIfPresent(completedOn, forKey: .completedOn) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - - try? container.encodeIfPresent(taskId, forKey: .taskId) - - - } - - } - - /* - Model: ProductDownloadsResponse - Used By: Catalog - */ - - class ProductDownloadsResponse: Codable { - - - public var items: ProductDownloadsItems? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: ProductDownloadsItems?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode(ProductDownloadsItems.self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: ProductConfigurationDownloads - Used By: Catalog - */ - - class ProductConfigurationDownloads: Codable { - - - public var data: [[String: Any]]? - - public var multivalue: Bool? - - - public enum CodingKeys: String, CodingKey { - - case data = "data" - - case multivalue = "multivalue" - - } - - public init(data: [[String: Any]]?, multivalue: Bool?) { - - self.data = data - - self.multivalue = multivalue - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - data = try container.decode([[String: Any]].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - multivalue = try container.decode(Bool.self, forKey: .multivalue) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(data, forKey: .data) - - - - try? container.encodeIfPresent(multivalue, forKey: .multivalue) - - - } - - } - - /* - Model: Hierarchy - Used By: Catalog - */ - - class Hierarchy: Codable { - - - public var l2: Int - - public var l1: Int - - public var department: Int - - - public enum CodingKeys: String, CodingKey { - - case l2 = "l2" - - case l1 = "l1" - - case department = "department" - - } - - public init(department: Int, l1: Int, l2: Int) { - - self.l2 = l2 - - self.l1 = l1 - - self.department = department - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - l2 = try container.decode(Int.self, forKey: .l2) - - - - - l1 = try container.decode(Int.self, forKey: .l1) - - - - - department = try container.decode(Int.self, forKey: .department) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(l2, forKey: .l2) - - - - try? container.encodeIfPresent(l1, forKey: .l1) - - - - try? container.encodeIfPresent(department, forKey: .department) - - - } - - } - - /* - Model: CategoryMappingValues - Used By: Catalog - */ - - class CategoryMappingValues: Codable { - - - public var catalogId: Int? - - public var name: String - - - public enum CodingKeys: String, CodingKey { - - case catalogId = "catalog_id" - - case name = "name" - - } - - public init(catalogId: Int?, name: String) { - - self.catalogId = catalogId - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - catalogId = try container.decode(Int.self, forKey: .catalogId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(catalogId, forKey: .catalogId) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: CategoryMapping - Used By: Catalog - */ - - class CategoryMapping: Codable { - - - public var facebook: CategoryMappingValues? - - public var google: CategoryMappingValues? - - public var ajio: CategoryMappingValues? - - - public enum CodingKeys: String, CodingKey { - - case facebook = "facebook" - - case google = "google" - - case ajio = "ajio" - - } - - public init(ajio: CategoryMappingValues?, facebook: CategoryMappingValues?, google: CategoryMappingValues?) { - - self.facebook = facebook - - self.google = google - - self.ajio = ajio - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - facebook = try container.decode(CategoryMappingValues.self, forKey: .facebook) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - google = try container.decode(CategoryMappingValues.self, forKey: .google) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ajio = try container.decode(CategoryMappingValues.self, forKey: .ajio) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(facebook, forKey: .facebook) - - - - try? container.encodeIfPresent(google, forKey: .google) - - - - try? container.encodeIfPresent(ajio, forKey: .ajio) - - - } - - } - - /* - Model: Media2 - Used By: Catalog - */ - - class Media2: Codable { - - - public var logo: String - - public var landscape: String - - public var portrait: String - - - public enum CodingKeys: String, CodingKey { - - case logo = "logo" - - case landscape = "landscape" - - case portrait = "portrait" - - } - - public init(landscape: String, logo: String, portrait: String) { - - self.logo = logo - - self.landscape = landscape - - self.portrait = portrait - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - logo = try container.decode(String.self, forKey: .logo) - - - - - landscape = try container.decode(String.self, forKey: .landscape) - - - - - portrait = try container.decode(String.self, forKey: .portrait) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(landscape, forKey: .landscape) - - - - try? container.encodeIfPresent(portrait, forKey: .portrait) - - - } - - } - - /* - Model: CategoryRequestBody - Used By: Catalog - */ - - class CategoryRequestBody: Codable { - - - public var hierarchy: [Hierarchy]? - - public var priority: Int? - - public var departments: [Int] - - public var level: Int - - public var marketplaces: CategoryMapping? - - public var slug: String? - - public var tryouts: [String]? - - public var isActive: Bool - - public var synonyms: [String]? - - public var media: Media2? - - public var name: String - - - public enum CodingKeys: String, CodingKey { - - case hierarchy = "hierarchy" - - case priority = "priority" - - case departments = "departments" - - case level = "level" - - case marketplaces = "marketplaces" - - case slug = "slug" - - case tryouts = "tryouts" - - case isActive = "is_active" - - case synonyms = "synonyms" - - case media = "media" - - case name = "name" - - } - - public init(departments: [Int], hierarchy: [Hierarchy]?, isActive: Bool, level: Int, marketplaces: CategoryMapping?, media: Media2?, name: String, priority: Int?, slug: String?, synonyms: [String]?, tryouts: [String]?) { - - self.hierarchy = hierarchy - - self.priority = priority - - self.departments = departments - - self.level = level - - self.marketplaces = marketplaces - - self.slug = slug - - self.tryouts = tryouts - - self.isActive = isActive - - self.synonyms = synonyms - - self.media = media - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - hierarchy = try container.decode([Hierarchy].self, forKey: .hierarchy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priority = try container.decode(Int.self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - departments = try container.decode([Int].self, forKey: .departments) - - - - - level = try container.decode(Int.self, forKey: .level) - - - - - do { - marketplaces = try container.decode(CategoryMapping.self, forKey: .marketplaces) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tryouts = try container.decode([String].self, forKey: .tryouts) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - isActive = try container.decode(Bool.self, forKey: .isActive) - - - - - do { - synonyms = try container.decode([String].self, forKey: .synonyms) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - media = try container.decode(Media2.self, forKey: .media) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(hierarchy, forKey: .hierarchy) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(departments, forKey: .departments) - - - - try? container.encodeIfPresent(level, forKey: .level) - - - - try? container.encodeIfPresent(marketplaces, forKey: .marketplaces) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(tryouts, forKey: .tryouts) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(synonyms, forKey: .synonyms) - - - - try? container.encodeIfPresent(media, forKey: .media) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: CategoryCreateResponse - Used By: Catalog - */ - - class CategoryCreateResponse: Codable { - - - public var uid: Int? - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case uid = "uid" - - case message = "message" - - } - - public init(message: String?, uid: Int?) { - - self.uid = uid - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: Category - Used By: Catalog - */ - - class Category: Codable { - - - public var createdBy: [String: Any]? - - public var hierarchy: [Hierarchy]? - - public var priority: Int? - - public var departments: [Int] - - public var createdOn: String? - - public var level: Int - - public var marketplaces: CategoryMapping? - - public var slug: String? - - public var modifiedOn: String? - - public var tryouts: [String]? - - public var isActive: Bool - - public var modifiedBy: [String: Any]? - - public var uid: Int? - - public var synonyms: [String]? - - public var media: Media2? - - public var name: String - - public var id: String? - - - public enum CodingKeys: String, CodingKey { - - case createdBy = "created_by" - - case hierarchy = "hierarchy" - - case priority = "priority" - - case departments = "departments" - - case createdOn = "created_on" - - case level = "level" - - case marketplaces = "marketplaces" - - case slug = "slug" - - case modifiedOn = "modified_on" - - case tryouts = "tryouts" - - case isActive = "is_active" - - case modifiedBy = "modified_by" - - case uid = "uid" - - case synonyms = "synonyms" - - case media = "media" - - case name = "name" - - case id = "_id" - - } - - public init(createdBy: [String: Any]?, createdOn: String?, departments: [Int], hierarchy: [Hierarchy]?, isActive: Bool, level: Int, marketplaces: CategoryMapping?, media: Media2?, modifiedBy: [String: Any]?, modifiedOn: String?, name: String, priority: Int?, slug: String?, synonyms: [String]?, tryouts: [String]?, uid: Int?, id: String?) { - - self.createdBy = createdBy - - self.hierarchy = hierarchy - - self.priority = priority - - self.departments = departments - - self.createdOn = createdOn - - self.level = level - - self.marketplaces = marketplaces - - self.slug = slug - - self.modifiedOn = modifiedOn - - self.tryouts = tryouts - - self.isActive = isActive - - self.modifiedBy = modifiedBy - - self.uid = uid - - self.synonyms = synonyms - - self.media = media - - self.name = name - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdBy = try container.decode([String: Any].self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hierarchy = try container.decode([Hierarchy].self, forKey: .hierarchy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priority = try container.decode(Int.self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - departments = try container.decode([Int].self, forKey: .departments) - - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - level = try container.decode(Int.self, forKey: .level) - - - - - do { - marketplaces = try container.decode(CategoryMapping.self, forKey: .marketplaces) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tryouts = try container.decode([String].self, forKey: .tryouts) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - isActive = try container.decode(Bool.self, forKey: .isActive) - - - - - do { - modifiedBy = try container.decode([String: Any].self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - synonyms = try container.decode([String].self, forKey: .synonyms) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - media = try container.decode(Media2.self, forKey: .media) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(hierarchy, forKey: .hierarchy) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(departments, forKey: .departments) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(level, forKey: .level) - - - - try? container.encodeIfPresent(marketplaces, forKey: .marketplaces) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(tryouts, forKey: .tryouts) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(synonyms, forKey: .synonyms) - - - - try? container.encodeIfPresent(media, forKey: .media) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: CategoryResponse - Used By: Catalog - */ - - class CategoryResponse: Codable { - - - public var items: [Category]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [Category]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Category].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: CategoryUpdateResponse - Used By: Catalog - */ - - class CategoryUpdateResponse: Codable { - - - public var success: Bool? - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case message = "message" - - } - - public init(message: String?, success: Bool?) { - - self.success = success - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: SingleCategoryResponse - Used By: Catalog - */ - - class SingleCategoryResponse: Codable { - - - public var data: Category? - - - public enum CodingKeys: String, CodingKey { - - case data = "data" - - } - - public init(data: Category?) { - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - data = try container.decode(Category.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: CustomOrder - Used By: Catalog - */ - - class CustomOrder: Codable { - - - public var manufacturingTimeUnit: String? - - public var isCustomOrder: Bool? - - public var manufacturingTime: Int? - - - public enum CodingKeys: String, CodingKey { - - case manufacturingTimeUnit = "manufacturing_time_unit" - - case isCustomOrder = "is_custom_order" - - case manufacturingTime = "manufacturing_time" - - } - - public init(isCustomOrder: Bool?, manufacturingTime: Int?, manufacturingTimeUnit: String?) { - - self.manufacturingTimeUnit = manufacturingTimeUnit - - self.isCustomOrder = isCustomOrder - - self.manufacturingTime = manufacturingTime - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - manufacturingTimeUnit = try container.decode(String.self, forKey: .manufacturingTimeUnit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isCustomOrder = try container.decode(Bool.self, forKey: .isCustomOrder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - manufacturingTime = try container.decode(Int.self, forKey: .manufacturingTime) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(manufacturingTimeUnit, forKey: .manufacturingTimeUnit) - - - - try? container.encodeIfPresent(isCustomOrder, forKey: .isCustomOrder) - - - - try? container.encodeIfPresent(manufacturingTime, forKey: .manufacturingTime) - - - } - - } - - /* - Model: OrderQuantity - Used By: Catalog - */ - - class OrderQuantity: Codable { - - - public var minimum: Int? - - public var isSet: Bool? - - public var maximum: Int? - - - public enum CodingKeys: String, CodingKey { - - case minimum = "minimum" - - case isSet = "is_set" - - case maximum = "maximum" - - } - - public init(isSet: Bool?, maximum: Int?, minimum: Int?) { - - self.minimum = minimum - - self.isSet = isSet - - self.maximum = maximum - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - minimum = try container.decode(Int.self, forKey: .minimum) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isSet = try container.decode(Bool.self, forKey: .isSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - maximum = try container.decode(Int.self, forKey: .maximum) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(minimum, forKey: .minimum) - - - - try? container.encodeIfPresent(isSet, forKey: .isSet) - - - - try? container.encodeIfPresent(maximum, forKey: .maximum) - - - } - - } - - /* - Model: TeaserTag - Used By: Catalog - */ - - class TeaserTag: Codable { - - - public var url: String? - - public var tag: String? - - - public enum CodingKeys: String, CodingKey { - - case url = "url" - - case tag = "tag" - - } - - public init(tag: String?, url: String?) { - - self.url = url - - self.tag = tag - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tag = try container.decode(String.self, forKey: .tag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(tag, forKey: .tag) - - - } - - } - - /* - Model: ProductPublish - Used By: Catalog - */ - - class ProductPublish: Codable { - - - public var productOnlineDate: String? - - public var isSet: Bool? - - - public enum CodingKeys: String, CodingKey { - - case productOnlineDate = "product_online_date" - - case isSet = "is_set" - - } - - public init(isSet: Bool?, productOnlineDate: String?) { - - self.productOnlineDate = productOnlineDate - - self.isSet = isSet - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - productOnlineDate = try container.decode(String.self, forKey: .productOnlineDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isSet = try container.decode(Bool.self, forKey: .isSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(productOnlineDate, forKey: .productOnlineDate) - - - - try? container.encodeIfPresent(isSet, forKey: .isSet) - - - } - - } - - /* - Model: ReturnConfig - Used By: Catalog - */ - - class ReturnConfig: Codable { - - - public var unit: String? - - public var time: Int? - - public var returnable: Bool? - - - public enum CodingKeys: String, CodingKey { - - case unit = "unit" - - case time = "time" - - case returnable = "returnable" - - } - - public init(returnable: Bool?, time: Int?, unit: String?) { - - self.unit = unit - - self.time = time - - self.returnable = returnable - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - unit = try container.decode(String.self, forKey: .unit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - time = try container.decode(Int.self, forKey: .time) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - returnable = try container.decode(Bool.self, forKey: .returnable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(unit, forKey: .unit) - - - - try? container.encodeIfPresent(time, forKey: .time) - - - - try? container.encodeIfPresent(returnable, forKey: .returnable) - - - } - - } - - /* - Model: Trader - Used By: Catalog - */ - - class Trader: Codable { - - - public var address: String - - public var name: String - - - public enum CodingKeys: String, CodingKey { - - case address = "address" - - case name = "name" - - } - - public init(address: String, name: String) { - - self.address = address - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - address = try container.decode(String.self, forKey: .address) - - - - - name = try container.decode(String.self, forKey: .name) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: ProductCreateUpdate - Used By: Catalog - */ - - class ProductCreateUpdate: Codable { - - - public var shortDescription: String? - - public var isImageLessProduct: Bool? - - public var companyId: Int - - public var countryOfOrigin: String - - public var changeRequestId: String? - - public var templateTag: String - - public var categorySlug: String - - public var noOfBoxes: Int? - - public var isActive: Bool? - - public var customOrder: CustomOrder? - - public var media: [Media1]? - - public var isSet: Bool? - - public var moq: OrderQuantity? - - public var highlights: [String]? - - public var productGroupTag: [String]? - - public var departments: [Int] - - public var teaserTag: TeaserTag? - - public var multiSize: Bool? - - public var customJson: [String: Any]? - - public var requester: String? - - public var description: String? - - public var isDependent: Bool? - - public var itemCode: String - - public var sizeGuide: String? - - public var currency: String - - public var productPublish: ProductPublish? - - public var uid: Int? - - public var name: String - - public var brandUid: Int - - public var traderType: String? - - public var returnConfig: ReturnConfig? - - public var itemType: String - - public var slug: String - - public var trader: Trader? - - public var hsnCode: String - - public var variants: [String: Any]? - - public var tags: [String]? - - - public enum CodingKeys: String, CodingKey { - - case shortDescription = "short_description" - - case isImageLessProduct = "is_image_less_product" - - case companyId = "company_id" - - case countryOfOrigin = "country_of_origin" - - case changeRequestId = "change_request_id" - - case templateTag = "template_tag" - - case categorySlug = "category_slug" - - case noOfBoxes = "no_of_boxes" - - case isActive = "is_active" - - case customOrder = "custom_order" - - case media = "media" - - case isSet = "is_set" - - case moq = "moq" - - case highlights = "highlights" - - case productGroupTag = "product_group_tag" - - case departments = "departments" - - case teaserTag = "teaser_tag" - - case multiSize = "multi_size" - - case customJson = "_custom_json" - - case requester = "requester" - - case description = "description" - - case isDependent = "is_dependent" - - case itemCode = "item_code" - - case sizeGuide = "size_guide" - - case currency = "currency" - - case productPublish = "product_publish" - - case uid = "uid" - - case name = "name" - - case brandUid = "brand_uid" - - case traderType = "trader_type" - - case returnConfig = "return_config" - - case itemType = "item_type" - - case slug = "slug" - - case trader = "trader" - - case hsnCode = "hsn_code" - - case variants = "variants" - - case tags = "tags" - - } - - public init(brandUid: Int, categorySlug: String, changeRequestId: String?, companyId: Int, countryOfOrigin: String, currency: String, customOrder: CustomOrder?, departments: [Int], description: String?, highlights: [String]?, hsnCode: String, isActive: Bool?, isDependent: Bool?, isImageLessProduct: Bool?, isSet: Bool?, itemCode: String, itemType: String, media: [Media1]?, moq: OrderQuantity?, multiSize: Bool?, name: String, noOfBoxes: Int?, productGroupTag: [String]?, productPublish: ProductPublish?, requester: String?, returnConfig: ReturnConfig?, shortDescription: String?, sizeGuide: String?, slug: String, tags: [String]?, teaserTag: TeaserTag?, templateTag: String, trader: Trader?, traderType: String?, uid: Int?, variants: [String: Any]?, customJson: [String: Any]?) { - - self.shortDescription = shortDescription - - self.isImageLessProduct = isImageLessProduct - - self.companyId = companyId - - self.countryOfOrigin = countryOfOrigin - - self.changeRequestId = changeRequestId - - self.templateTag = templateTag - - self.categorySlug = categorySlug - - self.noOfBoxes = noOfBoxes - - self.isActive = isActive - - self.customOrder = customOrder - - self.media = media - - self.isSet = isSet - - self.moq = moq - - self.highlights = highlights - - self.productGroupTag = productGroupTag - - self.departments = departments - - self.teaserTag = teaserTag - - self.multiSize = multiSize - - self.customJson = customJson - - self.requester = requester - - self.description = description - - self.isDependent = isDependent - - self.itemCode = itemCode - - self.sizeGuide = sizeGuide - - self.currency = currency - - self.productPublish = productPublish - - self.uid = uid - - self.name = name - - self.brandUid = brandUid - - self.traderType = traderType - - self.returnConfig = returnConfig - - self.itemType = itemType - - self.slug = slug - - self.trader = trader - - self.hsnCode = hsnCode - - self.variants = variants - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - shortDescription = try container.decode(String.self, forKey: .shortDescription) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isImageLessProduct = try container.decode(Bool.self, forKey: .isImageLessProduct) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - companyId = try container.decode(Int.self, forKey: .companyId) - - - - - countryOfOrigin = try container.decode(String.self, forKey: .countryOfOrigin) - - - - - do { - changeRequestId = try container.decode(String.self, forKey: .changeRequestId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - templateTag = try container.decode(String.self, forKey: .templateTag) - - - - - categorySlug = try container.decode(String.self, forKey: .categorySlug) - - - - - do { - noOfBoxes = try container.decode(Int.self, forKey: .noOfBoxes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customOrder = try container.decode(CustomOrder.self, forKey: .customOrder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - media = try container.decode([Media1].self, forKey: .media) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isSet = try container.decode(Bool.self, forKey: .isSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - moq = try container.decode(OrderQuantity.self, forKey: .moq) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - highlights = try container.decode([String].self, forKey: .highlights) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productGroupTag = try container.decode([String].self, forKey: .productGroupTag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - departments = try container.decode([Int].self, forKey: .departments) - - - - - do { - teaserTag = try container.decode(TeaserTag.self, forKey: .teaserTag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - multiSize = try container.decode(Bool.self, forKey: .multiSize) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requester = try container.decode(String.self, forKey: .requester) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isDependent = try container.decode(Bool.self, forKey: .isDependent) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - itemCode = try container.decode(String.self, forKey: .itemCode) - - - - - do { - sizeGuide = try container.decode(String.self, forKey: .sizeGuide) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - currency = try container.decode(String.self, forKey: .currency) - - - - - do { - productPublish = try container.decode(ProductPublish.self, forKey: .productPublish) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - - brandUid = try container.decode(Int.self, forKey: .brandUid) - - - - - do { - traderType = try container.decode(String.self, forKey: .traderType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - returnConfig = try container.decode(ReturnConfig.self, forKey: .returnConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - itemType = try container.decode(String.self, forKey: .itemType) - - - - - slug = try container.decode(String.self, forKey: .slug) - - - - - do { - trader = try container.decode(Trader.self, forKey: .trader) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - hsnCode = try container.decode(String.self, forKey: .hsnCode) - - - - - do { - variants = try container.decode([String: Any].self, forKey: .variants) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(shortDescription, forKey: .shortDescription) - - - - try? container.encodeIfPresent(isImageLessProduct, forKey: .isImageLessProduct) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(countryOfOrigin, forKey: .countryOfOrigin) - - - - try? container.encodeIfPresent(changeRequestId, forKey: .changeRequestId) - - - - try? container.encodeIfPresent(templateTag, forKey: .templateTag) - - - - try? container.encodeIfPresent(categorySlug, forKey: .categorySlug) - - - - try? container.encodeIfPresent(noOfBoxes, forKey: .noOfBoxes) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(customOrder, forKey: .customOrder) - - - - try? container.encodeIfPresent(media, forKey: .media) - - - - try? container.encodeIfPresent(isSet, forKey: .isSet) - - - - try? container.encodeIfPresent(moq, forKey: .moq) - - - - try? container.encodeIfPresent(highlights, forKey: .highlights) - - - - try? container.encodeIfPresent(productGroupTag, forKey: .productGroupTag) - - - - try? container.encodeIfPresent(departments, forKey: .departments) - - - - try? container.encodeIfPresent(teaserTag, forKey: .teaserTag) - - - - try? container.encodeIfPresent(multiSize, forKey: .multiSize) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(requester, forKey: .requester) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(isDependent, forKey: .isDependent) - - - - try? container.encodeIfPresent(itemCode, forKey: .itemCode) - - - - try? container.encodeIfPresent(sizeGuide, forKey: .sizeGuide) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(productPublish, forKey: .productPublish) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(brandUid, forKey: .brandUid) - - - - try? container.encodeIfPresent(traderType, forKey: .traderType) - - - - try? container.encodeIfPresent(returnConfig, forKey: .returnConfig) - - - - try? container.encodeIfPresent(itemType, forKey: .itemType) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(trader, forKey: .trader) - - - - try? container.encodeIfPresent(hsnCode, forKey: .hsnCode) - - - - try? container.encodeIfPresent(variants, forKey: .variants) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: Image - Used By: Catalog - */ - - class Image: Codable { - - - public var url: String? - - public var secureUrl: String? - - public var aspectRatioF: Double? - - public var aspectRatio: String? - - - public enum CodingKeys: String, CodingKey { - - case url = "url" - - case secureUrl = "secure_url" - - case aspectRatioF = "aspect_ratio_f" - - case aspectRatio = "aspect_ratio" - - } - - public init(aspectRatio: String?, aspectRatioF: Double?, secureUrl: String?, url: String?) { - - self.url = url - - self.secureUrl = secureUrl - - self.aspectRatioF = aspectRatioF - - self.aspectRatio = aspectRatio - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - secureUrl = try container.decode(String.self, forKey: .secureUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - aspectRatioF = try container.decode(Double.self, forKey: .aspectRatioF) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - aspectRatio = try container.decode(String.self, forKey: .aspectRatio) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) - - - - try? container.encodeIfPresent(aspectRatioF, forKey: .aspectRatioF) - - - - try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) - - - } - - } - - /* - Model: Logo - Used By: Catalog - */ - - class Logo: Codable { - - - public var url: String? - - public var secureUrl: String? - - public var aspectRatioF: Int? - - public var aspectRatio: String? - - - public enum CodingKeys: String, CodingKey { - - case url = "url" - - case secureUrl = "secure_url" - - case aspectRatioF = "aspect_ratio_f" - - case aspectRatio = "aspect_ratio" - - } - - public init(aspectRatio: String?, aspectRatioF: Int?, secureUrl: String?, url: String?) { - - self.url = url - - self.secureUrl = secureUrl - - self.aspectRatioF = aspectRatioF - - self.aspectRatio = aspectRatio - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - secureUrl = try container.decode(String.self, forKey: .secureUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - aspectRatioF = try container.decode(Int.self, forKey: .aspectRatioF) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - aspectRatio = try container.decode(String.self, forKey: .aspectRatio) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) - - - - try? container.encodeIfPresent(aspectRatioF, forKey: .aspectRatioF) - - - - try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) - - - } - - } - - /* - Model: Brand - Used By: Catalog - */ - - class Brand: Codable { - - - public var uid: Int? - - public var logo: Logo? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case uid = "uid" - - case logo = "logo" - - case name = "name" - - } - - public init(logo: Logo?, name: String?, uid: Int?) { - - self.uid = uid - - self.logo = logo - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(Logo.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: ProductPublished - Used By: Catalog - */ - - class ProductPublished: Codable { - - - public var productOnlineDate: Int? - - public var isSet: Bool? - - - public enum CodingKeys: String, CodingKey { - - case productOnlineDate = "product_online_date" - - case isSet = "is_set" - - } - - public init(isSet: Bool?, productOnlineDate: Int?) { - - self.productOnlineDate = productOnlineDate - - self.isSet = isSet - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - productOnlineDate = try container.decode(Int.self, forKey: .productOnlineDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isSet = try container.decode(Bool.self, forKey: .isSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(productOnlineDate, forKey: .productOnlineDate) - - - - try? container.encodeIfPresent(isSet, forKey: .isSet) - - - } - - } - - /* - Model: Product - Used By: Catalog - */ - - class Product: Codable { - - - public var shortDescription: String? - - public var images: [Image]? - - public var countryOfOrigin: String? - - public var color: String? - - public var primaryColor: String? - - public var templateTag: String? - - public var categorySlug: String? - - public var isActive: Bool? - - public var customOrder: [String: Any]? - - public var media: [Media1]? - - public var isSet: Bool? - - public var brand: Brand? - - public var moq: [String: Any]? - - public var highlights: [String]? - - public var allSizes: [[String: Any]]? - - public var departments: [Int]? - - public var sizes: [[String: Any]]? - - public var id: String? - - public var multiSize: Bool? - - public var l3Mapping: [String]? - - public var customJson: [String: Any]? - - public var description: String? - - public var isPhysical: Bool? - - public var categoryUid: Int? - - public var isDependent: Bool? - - public var itemCode: String? - - public var sizeGuide: String? - - public var currency: String? - - public var productPublish: ProductPublished? - - public var imageNature: String? - - public var uid: Int? - - public var name: String? - - public var brandUid: Int? - - public var itemType: String? - - public var slug: String? - - public var hsnCode: String? - - public var variants: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case shortDescription = "short_description" - - case images = "images" - - case countryOfOrigin = "country_of_origin" - - case color = "color" - - case primaryColor = "primary_color" - - case templateTag = "template_tag" - - case categorySlug = "category_slug" - - case isActive = "is_active" - - case customOrder = "custom_order" - - case media = "media" - - case isSet = "is_set" - - case brand = "brand" - - case moq = "moq" - - case highlights = "highlights" - - case allSizes = "all_sizes" - - case departments = "departments" - - case sizes = "sizes" - - case id = "id" - - case multiSize = "multi_size" - - case l3Mapping = "l3_mapping" - - case customJson = "_custom_json" - - case description = "description" - - case isPhysical = "is_physical" - - case categoryUid = "category_uid" - - case isDependent = "is_dependent" - - case itemCode = "item_code" - - case sizeGuide = "size_guide" - - case currency = "currency" - - case productPublish = "product_publish" - - case imageNature = "image_nature" - - case uid = "uid" - - case name = "name" - - case brandUid = "brand_uid" - - case itemType = "item_type" - - case slug = "slug" - - case hsnCode = "hsn_code" - - case variants = "variants" - - } - - public init(allSizes: [[String: Any]]?, brand: Brand?, brandUid: Int?, categorySlug: String?, categoryUid: Int?, color: String?, countryOfOrigin: String?, currency: String?, customOrder: [String: Any]?, departments: [Int]?, description: String?, highlights: [String]?, hsnCode: String?, id: String?, images: [Image]?, imageNature: String?, isActive: Bool?, isDependent: Bool?, isPhysical: Bool?, isSet: Bool?, itemCode: String?, itemType: String?, l3Mapping: [String]?, media: [Media1]?, moq: [String: Any]?, multiSize: Bool?, name: String?, primaryColor: String?, productPublish: ProductPublished?, shortDescription: String?, sizes: [[String: Any]]?, sizeGuide: String?, slug: String?, templateTag: String?, uid: Int?, variants: [String: Any]?, customJson: [String: Any]?) { - - self.shortDescription = shortDescription - - self.images = images - - self.countryOfOrigin = countryOfOrigin - - self.color = color - - self.primaryColor = primaryColor - - self.templateTag = templateTag - - self.categorySlug = categorySlug - - self.isActive = isActive - - self.customOrder = customOrder - - self.media = media - - self.isSet = isSet - - self.brand = brand - - self.moq = moq - - self.highlights = highlights - - self.allSizes = allSizes - - self.departments = departments - - self.sizes = sizes - - self.id = id - - self.multiSize = multiSize - - self.l3Mapping = l3Mapping - - self.customJson = customJson - - self.description = description - - self.isPhysical = isPhysical - - self.categoryUid = categoryUid - - self.isDependent = isDependent - - self.itemCode = itemCode - - self.sizeGuide = sizeGuide - - self.currency = currency - - self.productPublish = productPublish - - self.imageNature = imageNature - - self.uid = uid - - self.name = name - - self.brandUid = brandUid - - self.itemType = itemType - - self.slug = slug - - self.hsnCode = hsnCode - - self.variants = variants - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - shortDescription = try container.decode(String.self, forKey: .shortDescription) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - images = try container.decode([Image].self, forKey: .images) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryOfOrigin = try container.decode(String.self, forKey: .countryOfOrigin) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - color = try container.decode(String.self, forKey: .color) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - primaryColor = try container.decode(String.self, forKey: .primaryColor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - templateTag = try container.decode(String.self, forKey: .templateTag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - categorySlug = try container.decode(String.self, forKey: .categorySlug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customOrder = try container.decode([String: Any].self, forKey: .customOrder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - media = try container.decode([Media1].self, forKey: .media) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isSet = try container.decode(Bool.self, forKey: .isSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brand = try container.decode(Brand.self, forKey: .brand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - moq = try container.decode([String: Any].self, forKey: .moq) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - highlights = try container.decode([String].self, forKey: .highlights) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allSizes = try container.decode([[String: Any]].self, forKey: .allSizes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - departments = try container.decode([Int].self, forKey: .departments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sizes = try container.decode([[String: Any]].self, forKey: .sizes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - multiSize = try container.decode(Bool.self, forKey: .multiSize) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - l3Mapping = try container.decode([String].self, forKey: .l3Mapping) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isPhysical = try container.decode(Bool.self, forKey: .isPhysical) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - categoryUid = try container.decode(Int.self, forKey: .categoryUid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isDependent = try container.decode(Bool.self, forKey: .isDependent) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemCode = try container.decode(String.self, forKey: .itemCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sizeGuide = try container.decode(String.self, forKey: .sizeGuide) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(String.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productPublish = try container.decode(ProductPublished.self, forKey: .productPublish) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - imageNature = try container.decode(String.self, forKey: .imageNature) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandUid = try container.decode(Int.self, forKey: .brandUid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemType = try container.decode(String.self, forKey: .itemType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hsnCode = try container.decode(String.self, forKey: .hsnCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - variants = try container.decode([String: Any].self, forKey: .variants) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(shortDescription, forKey: .shortDescription) - - - - try? container.encodeIfPresent(images, forKey: .images) - - - - try? container.encodeIfPresent(countryOfOrigin, forKey: .countryOfOrigin) - - - - try? container.encodeIfPresent(color, forKey: .color) - - - - try? container.encodeIfPresent(primaryColor, forKey: .primaryColor) - - - - try? container.encodeIfPresent(templateTag, forKey: .templateTag) - - - - try? container.encodeIfPresent(categorySlug, forKey: .categorySlug) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(customOrder, forKey: .customOrder) - - - - try? container.encodeIfPresent(media, forKey: .media) - - - - try? container.encodeIfPresent(isSet, forKey: .isSet) - - - - try? container.encodeIfPresent(brand, forKey: .brand) - - - - try? container.encodeIfPresent(moq, forKey: .moq) - - - - try? container.encodeIfPresent(highlights, forKey: .highlights) - - - - try? container.encodeIfPresent(allSizes, forKey: .allSizes) - - - - try? container.encodeIfPresent(departments, forKey: .departments) - - - - try? container.encodeIfPresent(sizes, forKey: .sizes) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(multiSize, forKey: .multiSize) - - - - try? container.encodeIfPresent(l3Mapping, forKey: .l3Mapping) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(isPhysical, forKey: .isPhysical) - - - - try? container.encodeIfPresent(categoryUid, forKey: .categoryUid) - - - - try? container.encodeIfPresent(isDependent, forKey: .isDependent) - - - - try? container.encodeIfPresent(itemCode, forKey: .itemCode) - - - - try? container.encodeIfPresent(sizeGuide, forKey: .sizeGuide) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(productPublish, forKey: .productPublish) - - - - try? container.encodeIfPresent(imageNature, forKey: .imageNature) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(brandUid, forKey: .brandUid) - - - - try? container.encodeIfPresent(itemType, forKey: .itemType) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(hsnCode, forKey: .hsnCode) - - - - try? container.encodeIfPresent(variants, forKey: .variants) - - - } - - } - - /* - Model: ProductListingResponse - Used By: Catalog - */ - - class ProductListingResponse: Codable { - - - public var items: [Product]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [Product]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Product].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: ValidateProduct - Used By: Catalog - */ - - class ValidateProduct: Codable { - - - public var valid: Bool? - - - public enum CodingKeys: String, CodingKey { - - case valid = "valid" - - } - - public init(valid: Bool?) { - - self.valid = valid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - valid = try container.decode(Bool.self, forKey: .valid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(valid, forKey: .valid) - - - } - - } - - /* - Model: UserInfo1 - Used By: Catalog - */ - - class UserInfo1: Codable { - - - public var uid: String? - - public var email: String? - - public var username: String? - - public var userId: String? - - - public enum CodingKeys: String, CodingKey { - - case uid = "uid" - - case email = "email" - - case username = "username" - - case userId = "user_id" - - } - - public init(email: String?, uid: String?, username: String?, userId: String?) { - - self.uid = uid - - self.email = email - - self.username = username - - self.userId = userId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - username = try container.decode(String.self, forKey: .username) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(username, forKey: .username) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - } - - } - - /* - Model: BulkJob - Used By: Catalog - */ - - class BulkJob: Codable { - - - public var createdBy: UserInfo1? - - public var stage: String? - - public var failedRecords: [[String: Any]]? - - public var failed: Int? - - public var companyId: Int - - public var createdOn: String - - public var templateTag: String? - - public var modifiedOn: String? - - public var customTemplateTag: String? - - public var cancelled: Int? - - public var modifiedBy: UserInfo1? - - public var isActive: Bool? - - public var cancelledRecords: [[String: Any]]? - - public var succeed: Int? - - public var filePath: String? - - public var total: Int - - public var trackingUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case createdBy = "created_by" - - case stage = "stage" - - case failedRecords = "failed_records" - - case failed = "failed" - - case companyId = "company_id" - - case createdOn = "created_on" - - case templateTag = "template_tag" - - case modifiedOn = "modified_on" - - case customTemplateTag = "custom_template_tag" - - case cancelled = "cancelled" - - case modifiedBy = "modified_by" - - case isActive = "is_active" - - case cancelledRecords = "cancelled_records" - - case succeed = "succeed" - - case filePath = "file_path" - - case total = "total" - - case trackingUrl = "tracking_url" - - } - - public init(cancelled: Int?, cancelledRecords: [[String: Any]]?, companyId: Int, createdBy: UserInfo1?, createdOn: String, customTemplateTag: String?, failed: Int?, failedRecords: [[String: Any]]?, filePath: String?, isActive: Bool?, modifiedBy: UserInfo1?, modifiedOn: String?, stage: String?, succeed: Int?, templateTag: String?, total: Int, trackingUrl: String?) { - - self.createdBy = createdBy - - self.stage = stage - - self.failedRecords = failedRecords - - self.failed = failed - - self.companyId = companyId - - self.createdOn = createdOn - - self.templateTag = templateTag - - self.modifiedOn = modifiedOn - - self.customTemplateTag = customTemplateTag - - self.cancelled = cancelled - - self.modifiedBy = modifiedBy - - self.isActive = isActive - - self.cancelledRecords = cancelledRecords - - self.succeed = succeed - - self.filePath = filePath - - self.total = total - - self.trackingUrl = trackingUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdBy = try container.decode(UserInfo1.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stage = try container.decode(String.self, forKey: .stage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - failedRecords = try container.decode([[String: Any]].self, forKey: .failedRecords) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - failed = try container.decode(Int.self, forKey: .failed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - companyId = try container.decode(Int.self, forKey: .companyId) - - - - - createdOn = try container.decode(String.self, forKey: .createdOn) - - - - - do { - templateTag = try container.decode(String.self, forKey: .templateTag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customTemplateTag = try container.decode(String.self, forKey: .customTemplateTag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cancelled = try container.decode(Int.self, forKey: .cancelled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode(UserInfo1.self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cancelledRecords = try container.decode([[String: Any]].self, forKey: .cancelledRecords) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - succeed = try container.decode(Int.self, forKey: .succeed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - filePath = try container.decode(String.self, forKey: .filePath) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - total = try container.decode(Int.self, forKey: .total) - - - - - do { - trackingUrl = try container.decode(String.self, forKey: .trackingUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(stage, forKey: .stage) - - - - try? container.encodeIfPresent(failedRecords, forKey: .failedRecords) - - - - try? container.encodeIfPresent(failed, forKey: .failed) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(templateTag, forKey: .templateTag) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(customTemplateTag, forKey: .customTemplateTag) - - - - try? container.encodeIfPresent(cancelled, forKey: .cancelled) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(cancelledRecords, forKey: .cancelledRecords) - - - - try? container.encodeIfPresent(succeed, forKey: .succeed) - - - - try? container.encodeIfPresent(filePath, forKey: .filePath) - - - - try? container.encodeIfPresent(total, forKey: .total) - - - - try? container.encodeIfPresent(trackingUrl, forKey: .trackingUrl) - - - } - - } - - /* - Model: UserDetail - Used By: Catalog - */ - - class UserDetail: Codable { - - - public var username: String? - - public var fullName: String? - - public var userId: String? - - - public enum CodingKeys: String, CodingKey { - - case username = "username" - - case fullName = "full_name" - - case userId = "user_id" - - } - - public init(fullName: String?, username: String?, userId: String?) { - - self.username = username - - self.fullName = fullName - - self.userId = userId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - username = try container.decode(String.self, forKey: .username) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fullName = try container.decode(String.self, forKey: .fullName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(username, forKey: .username) - - - - try? container.encodeIfPresent(fullName, forKey: .fullName) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - } - - } - - /* - Model: ProductBulkRequest - Used By: Catalog - */ - - class ProductBulkRequest: Codable { - - - public var createdBy: UserDetail? - - public var stage: String? - - public var failedRecords: [String]? - - public var failed: Int? - - public var companyId: Int? - - public var template: ProductTemplate? - - public var createdOn: String? - - public var templateTag: String? - - public var modifiedOn: String? - - public var cancelled: Int? - - public var modifiedBy: UserDetail? - - public var isActive: Bool? - - public var cancelledRecords: [String]? - - public var succeed: Int? - - public var filePath: String? - - public var total: Int? - - - public enum CodingKeys: String, CodingKey { - - case createdBy = "created_by" - - case stage = "stage" - - case failedRecords = "failed_records" - - case failed = "failed" - - case companyId = "company_id" - - case template = "template" - - case createdOn = "created_on" - - case templateTag = "template_tag" - - case modifiedOn = "modified_on" - - case cancelled = "cancelled" - - case modifiedBy = "modified_by" - - case isActive = "is_active" - - case cancelledRecords = "cancelled_records" - - case succeed = "succeed" - - case filePath = "file_path" - - case total = "total" - - } - - public init(cancelled: Int?, cancelledRecords: [String]?, companyId: Int?, createdBy: UserDetail?, createdOn: String?, failed: Int?, failedRecords: [String]?, filePath: String?, isActive: Bool?, modifiedBy: UserDetail?, modifiedOn: String?, stage: String?, succeed: Int?, template: ProductTemplate?, templateTag: String?, total: Int?) { - - self.createdBy = createdBy - - self.stage = stage - - self.failedRecords = failedRecords - - self.failed = failed - - self.companyId = companyId - - self.template = template - - self.createdOn = createdOn - - self.templateTag = templateTag - - self.modifiedOn = modifiedOn - - self.cancelled = cancelled - - self.modifiedBy = modifiedBy - - self.isActive = isActive - - self.cancelledRecords = cancelledRecords - - self.succeed = succeed - - self.filePath = filePath - - self.total = total - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdBy = try container.decode(UserDetail.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stage = try container.decode(String.self, forKey: .stage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - failedRecords = try container.decode([String].self, forKey: .failedRecords) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - failed = try container.decode(Int.self, forKey: .failed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - template = try container.decode(ProductTemplate.self, forKey: .template) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - templateTag = try container.decode(String.self, forKey: .templateTag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cancelled = try container.decode(Int.self, forKey: .cancelled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode(UserDetail.self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cancelledRecords = try container.decode([String].self, forKey: .cancelledRecords) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - succeed = try container.decode(Int.self, forKey: .succeed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - filePath = try container.decode(String.self, forKey: .filePath) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - total = try container.decode(Int.self, forKey: .total) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(stage, forKey: .stage) - - - - try? container.encodeIfPresent(failedRecords, forKey: .failedRecords) - - - - try? container.encodeIfPresent(failed, forKey: .failed) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(template, forKey: .template) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(templateTag, forKey: .templateTag) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(cancelled, forKey: .cancelled) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(cancelledRecords, forKey: .cancelledRecords) - - - - try? container.encodeIfPresent(succeed, forKey: .succeed) - - - - try? container.encodeIfPresent(filePath, forKey: .filePath) - - - - try? container.encodeIfPresent(total, forKey: .total) - - - } - - } - - /* - Model: ProductBulkRequestList - Used By: Catalog - */ - - class ProductBulkRequestList: Codable { - - - public var items: ProductBulkRequest? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: ProductBulkRequest?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode(ProductBulkRequest.self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: BulkProductRequest - Used By: Catalog - */ - - class BulkProductRequest: Codable { - - - public var companyId: Int - - public var data: [[String: Any]] - - public var batchId: String - - public var templateTag: String - - - public enum CodingKeys: String, CodingKey { - - case companyId = "company_id" - - case data = "data" - - case batchId = "batch_id" - - case templateTag = "template_tag" - - } - - public init(batchId: String, companyId: Int, data: [[String: Any]], templateTag: String) { - - self.companyId = companyId - - self.data = data - - self.batchId = batchId - - self.templateTag = templateTag - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - companyId = try container.decode(Int.self, forKey: .companyId) - - - - - data = try container.decode([[String: Any]].self, forKey: .data) - - - - - batchId = try container.decode(String.self, forKey: .batchId) - - - - - templateTag = try container.decode(String.self, forKey: .templateTag) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - - try? container.encodeIfPresent(batchId, forKey: .batchId) - - - - try? container.encodeIfPresent(templateTag, forKey: .templateTag) - - - } - - } - - /* - Model: NestedTags - Used By: Catalog - */ - - class NestedTags: Codable { - - - public var tags: [String]? - - - public enum CodingKeys: String, CodingKey { - - case tags = "tags" - - } - - public init(tags: [String]?) { - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: ProductTagsViewResponse - Used By: Catalog - */ - - class ProductTagsViewResponse: Codable { - - - public var items: NestedTags? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - } - - public init(items: NestedTags?) { - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode(NestedTags.self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: ProductBulkAssets - Used By: Catalog - */ - - class ProductBulkAssets: Codable { - - - public var companyId: Int? - - public var url: String - - public var user: [String: Any] - - - public enum CodingKeys: String, CodingKey { - - case companyId = "company_id" - - case url = "url" - - case user = "user" - - } - - public init(companyId: Int?, url: String, user: [String: Any]) { - - self.companyId = companyId - - self.url = url - - self.user = user - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - url = try container.decode(String.self, forKey: .url) - - - - - user = try container.decode([String: Any].self, forKey: .user) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(user, forKey: .user) - - - } - - } - - /* - Model: UserCommon - Used By: Catalog - */ - - class UserCommon: Codable { - - - public var username: String? - - public var companyId: Int? - - public var userId: String? - - - public enum CodingKeys: String, CodingKey { - - case username = "username" - - case companyId = "company_id" - - case userId = "user_id" - - } - - public init(companyId: Int?, username: String?, userId: String?) { - - self.username = username - - self.companyId = companyId - - self.userId = userId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - username = try container.decode(String.self, forKey: .username) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(username, forKey: .username) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - } - - } - - /* - Model: Items - Used By: Catalog - */ - - class Items: Codable { - - - public var createdBy: UserCommon? - - public var stage: String? - - public var failedRecords: [String]? - - public var failed: Int? - - public var companyId: Int? - - public var createdOn: String? - - public var total: Int? - - public var modifiedOn: String? - - public var cancelled: Int? - - public var retry: Int? - - public var modifiedBy: UserCommon? - - public var isActive: Bool? - - public var cancelledRecords: [String]? - - public var id: String? - - public var filePath: String? - - public var succeed: Int? - - public var trackingUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case createdBy = "created_by" - - case stage = "stage" - - case failedRecords = "failed_records" - - case failed = "failed" - - case companyId = "company_id" - - case createdOn = "created_on" - - case total = "total" - - case modifiedOn = "modified_on" - - case cancelled = "cancelled" - - case retry = "retry" - - case modifiedBy = "modified_by" - - case isActive = "is_active" - - case cancelledRecords = "cancelled_records" - - case id = "id" - - case filePath = "file_path" - - case succeed = "succeed" - - case trackingUrl = "tracking_url" - - } - - public init(cancelled: Int?, cancelledRecords: [String]?, companyId: Int?, createdBy: UserCommon?, createdOn: String?, failed: Int?, failedRecords: [String]?, filePath: String?, id: String?, isActive: Bool?, modifiedBy: UserCommon?, modifiedOn: String?, retry: Int?, stage: String?, succeed: Int?, total: Int?, trackingUrl: String?) { - - self.createdBy = createdBy - - self.stage = stage - - self.failedRecords = failedRecords - - self.failed = failed - - self.companyId = companyId - - self.createdOn = createdOn - - self.total = total - - self.modifiedOn = modifiedOn - - self.cancelled = cancelled - - self.retry = retry - - self.modifiedBy = modifiedBy - - self.isActive = isActive - - self.cancelledRecords = cancelledRecords - - self.id = id - - self.filePath = filePath - - self.succeed = succeed - - self.trackingUrl = trackingUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdBy = try container.decode(UserCommon.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stage = try container.decode(String.self, forKey: .stage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - failedRecords = try container.decode([String].self, forKey: .failedRecords) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - failed = try container.decode(Int.self, forKey: .failed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - total = try container.decode(Int.self, forKey: .total) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cancelled = try container.decode(Int.self, forKey: .cancelled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - retry = try container.decode(Int.self, forKey: .retry) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode(UserCommon.self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cancelledRecords = try container.decode([String].self, forKey: .cancelledRecords) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - filePath = try container.decode(String.self, forKey: .filePath) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - succeed = try container.decode(Int.self, forKey: .succeed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - trackingUrl = try container.decode(String.self, forKey: .trackingUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(stage, forKey: .stage) - - - - try? container.encodeIfPresent(failedRecords, forKey: .failedRecords) - - - - try? container.encodeIfPresent(failed, forKey: .failed) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(total, forKey: .total) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(cancelled, forKey: .cancelled) - - - - try? container.encodeIfPresent(retry, forKey: .retry) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(cancelledRecords, forKey: .cancelledRecords) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(filePath, forKey: .filePath) - - - - try? container.encodeIfPresent(succeed, forKey: .succeed) - - - - try? container.encodeIfPresent(trackingUrl, forKey: .trackingUrl) - - - } - - } - - /* - Model: BulkAssetResponse - Used By: Catalog - */ - - class BulkAssetResponse: Codable { - - - public var items: [Items]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [Items]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Items].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: ProductSizeDeleteDataResponse - Used By: Catalog - */ - - class ProductSizeDeleteDataResponse: Codable { - - - public var size: String? - - public var itemId: Int? - - public var companyId: Int? - - - public enum CodingKeys: String, CodingKey { - - case size = "size" - - case itemId = "item_id" - - case companyId = "company_id" - - } - - public init(companyId: Int?, itemId: Int?, size: String?) { - - self.size = size - - self.itemId = itemId - - self.companyId = companyId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - size = try container.decode(String.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemId = try container.decode(Int.self, forKey: .itemId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(itemId, forKey: .itemId) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - } - - } - - /* - Model: ProductSizeDeleteResponse - Used By: Catalog - */ - - class ProductSizeDeleteResponse: Codable { - - - public var success: Bool? - - public var data: ProductSizeDeleteDataResponse? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case data = "data" - - } - - public init(data: ProductSizeDeleteDataResponse?, success: Bool?) { - - self.success = success - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode(ProductSizeDeleteDataResponse.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: ItemQuery - Used By: Catalog - */ - - class ItemQuery: Codable { - - - public var uid: Int? - - public var itemCode: String? - - public var brandUid: Int? - - - public enum CodingKeys: String, CodingKey { - - case uid = "uid" - - case itemCode = "item_code" - - case brandUid = "brand_uid" - - } - - public init(brandUid: Int?, itemCode: String?, uid: Int?) { - - self.uid = uid - - self.itemCode = itemCode - - self.brandUid = brandUid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemCode = try container.decode(String.self, forKey: .itemCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandUid = try container.decode(Int.self, forKey: .brandUid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(itemCode, forKey: .itemCode) - - - - try? container.encodeIfPresent(brandUid, forKey: .brandUid) - - - } - - } - - /* - Model: GTIN - Used By: Catalog - */ - - class GTIN: Codable { - - - public var gtinType: String - - public var primary: Bool? - - public var gtinValue: String - - - public enum CodingKeys: String, CodingKey { - - case gtinType = "gtin_type" - - case primary = "primary" - - case gtinValue = "gtin_value" - - } - - public init(gtinType: String, gtinValue: String, primary: Bool?) { - - self.gtinType = gtinType - - self.primary = primary - - self.gtinValue = gtinValue - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - gtinType = try container.decode(String.self, forKey: .gtinType) - - - - - do { - primary = try container.decode(Bool.self, forKey: .primary) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - gtinValue = try container.decode(String.self, forKey: .gtinValue) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(gtinType, forKey: .gtinType) - - - - try? container.encodeIfPresent(primary, forKey: .primary) - - - - try? container.encodeIfPresent(gtinValue, forKey: .gtinValue) - - - } - - } - - /* - Model: SetSize - Used By: Catalog - */ - - class SetSize: Codable { - - - public var size: String - - public var pieces: Int - - - public enum CodingKeys: String, CodingKey { - - case size = "size" - - case pieces = "pieces" - - } - - public init(pieces: Int, size: String) { - - self.size = size - - self.pieces = pieces - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - size = try container.decode(String.self, forKey: .size) - - - - - pieces = try container.decode(Int.self, forKey: .pieces) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(pieces, forKey: .pieces) - - - } - - } - - /* - Model: SizeDistribution - Used By: Catalog - */ - - class SizeDistribution: Codable { - - - public var sizes: [SetSize] - - - public enum CodingKeys: String, CodingKey { - - case sizes = "sizes" - - } - - public init(sizes: [SetSize]) { - - self.sizes = sizes - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - sizes = try container.decode([SetSize].self, forKey: .sizes) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(sizes, forKey: .sizes) - - - } - - } - - /* - Model: InventorySet - Used By: Catalog - */ - - class InventorySet: Codable { - - - public var sizeDistribution: SizeDistribution - - public var quantity: Int? - - - public enum CodingKeys: String, CodingKey { - - case sizeDistribution = "size_distribution" - - case quantity = "quantity" - - } - - public init(quantity: Int?, sizeDistribution: SizeDistribution) { - - self.sizeDistribution = sizeDistribution - - self.quantity = quantity - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - sizeDistribution = try container.decode(SizeDistribution.self, forKey: .sizeDistribution) - - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(sizeDistribution, forKey: .sizeDistribution) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - } - - } - - /* - Model: InvSize - Used By: Catalog - */ - - class InvSize: Codable { - - - public var itemHeight: Double? - - public var itemWeightUnitOfMeasure: String? - - public var storeCode: String - - public var quantity: Int - - public var itemWeight: Double? - - public var identifiers: [GTIN] - - public var itemLength: Double? - - public var currency: String - - public var priceEffective: Double - - public var itemDimensionsUnitOfMeasure: String? - - public var price: Double - - public var priceTransfer: Double? - - public var size: String - - public var isSet: Bool? - - public var set: InventorySet? - - public var itemWidth: Double? - - - public enum CodingKeys: String, CodingKey { - - case itemHeight = "item_height" - - case itemWeightUnitOfMeasure = "item_weight_unit_of_measure" - - case storeCode = "store_code" - - case quantity = "quantity" - - case itemWeight = "item_weight" - - case identifiers = "identifiers" - - case itemLength = "item_length" - - case currency = "currency" - - case priceEffective = "price_effective" - - case itemDimensionsUnitOfMeasure = "item_dimensions_unit_of_measure" - - case price = "price" - - case priceTransfer = "price_transfer" - - case size = "size" - - case isSet = "is_set" - - case set = "set" - - case itemWidth = "item_width" - - } - - public init(currency: String, identifiers: [GTIN], isSet: Bool?, itemDimensionsUnitOfMeasure: String?, itemHeight: Double?, itemLength: Double?, itemWeight: Double?, itemWeightUnitOfMeasure: String?, itemWidth: Double?, price: Double, priceEffective: Double, priceTransfer: Double?, quantity: Int, set: InventorySet?, size: String, storeCode: String) { - - self.itemHeight = itemHeight - - self.itemWeightUnitOfMeasure = itemWeightUnitOfMeasure - - self.storeCode = storeCode - - self.quantity = quantity - - self.itemWeight = itemWeight - - self.identifiers = identifiers - - self.itemLength = itemLength - - self.currency = currency - - self.priceEffective = priceEffective - - self.itemDimensionsUnitOfMeasure = itemDimensionsUnitOfMeasure - - self.price = price - - self.priceTransfer = priceTransfer - - self.size = size - - self.isSet = isSet - - self.set = set - - self.itemWidth = itemWidth - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - itemHeight = try container.decode(Double.self, forKey: .itemHeight) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemWeightUnitOfMeasure = try container.decode(String.self, forKey: .itemWeightUnitOfMeasure) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - storeCode = try container.decode(String.self, forKey: .storeCode) - - - - - quantity = try container.decode(Int.self, forKey: .quantity) - - - - - do { - itemWeight = try container.decode(Double.self, forKey: .itemWeight) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - identifiers = try container.decode([GTIN].self, forKey: .identifiers) - - - - - do { - itemLength = try container.decode(Double.self, forKey: .itemLength) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - currency = try container.decode(String.self, forKey: .currency) - - - - - priceEffective = try container.decode(Double.self, forKey: .priceEffective) - - - - - do { - itemDimensionsUnitOfMeasure = try container.decode(String.self, forKey: .itemDimensionsUnitOfMeasure) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - price = try container.decode(Double.self, forKey: .price) - - - - - do { - priceTransfer = try container.decode(Double.self, forKey: .priceTransfer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - size = try container.decode(String.self, forKey: .size) - - - - - do { - isSet = try container.decode(Bool.self, forKey: .isSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - set = try container.decode(InventorySet.self, forKey: .set) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemWidth = try container.decode(Double.self, forKey: .itemWidth) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(itemHeight, forKey: .itemHeight) - - - - try? container.encodeIfPresent(itemWeightUnitOfMeasure, forKey: .itemWeightUnitOfMeasure) - - - - try? container.encodeIfPresent(storeCode, forKey: .storeCode) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - - try? container.encodeIfPresent(itemWeight, forKey: .itemWeight) - - - - try? container.encodeIfPresent(identifiers, forKey: .identifiers) - - - - try? container.encodeIfPresent(itemLength, forKey: .itemLength) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) - - - - try? container.encodeIfPresent(itemDimensionsUnitOfMeasure, forKey: .itemDimensionsUnitOfMeasure) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(priceTransfer, forKey: .priceTransfer) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(isSet, forKey: .isSet) - - - - try? container.encodeIfPresent(set, forKey: .set) - - - - try? container.encodeIfPresent(itemWidth, forKey: .itemWidth) - - - } - - } - - /* - Model: InventoryRequest - Used By: Catalog - */ - - class InventoryRequest: Codable { - - - public var companyId: Int - - public var item: ItemQuery - - public var sizes: [InvSize] - - - public enum CodingKeys: String, CodingKey { - - case companyId = "company_id" - - case item = "item" - - case sizes = "sizes" - - } - - public init(companyId: Int, item: ItemQuery, sizes: [InvSize]) { - - self.companyId = companyId - - self.item = item - - self.sizes = sizes - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - companyId = try container.decode(Int.self, forKey: .companyId) - - - - - item = try container.decode(ItemQuery.self, forKey: .item) - - - - - sizes = try container.decode([InvSize].self, forKey: .sizes) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(item, forKey: .item) - - - - try? container.encodeIfPresent(sizes, forKey: .sizes) - - - } - - } - - /* - Model: InventoryResponse - Used By: Catalog - */ - - class InventoryResponse: Codable { - - - public var store: [String: Any]? - - public var quantity: Int? - - public var sellerIdentifier: Int? - - public var identifiers: [String: Any]? - - public var currency: String? - - public var itemId: Int? - - public var priceEffective: Int? - - public var sellableQuantity: Int? - - public var priceTransfer: Int? - - public var uid: String? - - public var size: String? - - public var inventoryUpdatedOn: String? - - public var price: Int? - - - public enum CodingKeys: String, CodingKey { - - case store = "store" - - case quantity = "quantity" - - case sellerIdentifier = "seller_identifier" - - case identifiers = "identifiers" - - case currency = "currency" - - case itemId = "item_id" - - case priceEffective = "price_effective" - - case sellableQuantity = "sellable_quantity" - - case priceTransfer = "price_transfer" - - case uid = "uid" - - case size = "size" - - case inventoryUpdatedOn = "inventory_updated_on" - - case price = "price" - - } - - public init(currency: String?, identifiers: [String: Any]?, inventoryUpdatedOn: String?, itemId: Int?, price: Int?, priceEffective: Int?, priceTransfer: Int?, quantity: Int?, sellableQuantity: Int?, sellerIdentifier: Int?, size: String?, store: [String: Any]?, uid: String?) { - - self.store = store - - self.quantity = quantity - - self.sellerIdentifier = sellerIdentifier - - self.identifiers = identifiers - - self.currency = currency - - self.itemId = itemId - - self.priceEffective = priceEffective - - self.sellableQuantity = sellableQuantity - - self.priceTransfer = priceTransfer - - self.uid = uid - - self.size = size - - self.inventoryUpdatedOn = inventoryUpdatedOn - - self.price = price - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - store = try container.decode([String: Any].self, forKey: .store) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sellerIdentifier = try container.decode(Int.self, forKey: .sellerIdentifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - identifiers = try container.decode([String: Any].self, forKey: .identifiers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(String.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemId = try container.decode(Int.self, forKey: .itemId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priceEffective = try container.decode(Int.self, forKey: .priceEffective) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sellableQuantity = try container.decode(Int.self, forKey: .sellableQuantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priceTransfer = try container.decode(Int.self, forKey: .priceTransfer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - size = try container.decode(String.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - inventoryUpdatedOn = try container.decode(String.self, forKey: .inventoryUpdatedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(Int.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(store, forKey: .store) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - - try? container.encodeIfPresent(sellerIdentifier, forKey: .sellerIdentifier) - - - - try? container.encodeIfPresent(identifiers, forKey: .identifiers) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(itemId, forKey: .itemId) - - - - try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) - - - - try? container.encodeIfPresent(sellableQuantity, forKey: .sellableQuantity) - - - - try? container.encodeIfPresent(priceTransfer, forKey: .priceTransfer) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(inventoryUpdatedOn, forKey: .inventoryUpdatedOn) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - } - - } - - /* - Model: InventoryDeleteData - Used By: Catalog - */ - - class InventoryDeleteData: Codable { - - - public var locationId: Int? - - public var size: String? - - public var itemId: Int? - - - public enum CodingKeys: String, CodingKey { - - case locationId = "location_id" - - case size = "size" - - case itemId = "item_id" - - } - - public init(itemId: Int?, locationId: Int?, size: String?) { - - self.locationId = locationId - - self.size = size - - self.itemId = itemId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - locationId = try container.decode(Int.self, forKey: .locationId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - size = try container.decode(String.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemId = try container.decode(Int.self, forKey: .itemId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(locationId, forKey: .locationId) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(itemId, forKey: .itemId) - - - } - - } - - /* - Model: InventoryDelete - Used By: Catalog - */ - - class InventoryDelete: Codable { - - - public var success: Bool? - - public var data: InventoryDeleteData? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case data = "data" - - } - - public init(data: InventoryDeleteData?, success: Bool?) { - - self.success = success - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode(InventoryDeleteData.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: CommonResponse - Used By: Catalog - */ - - class CommonResponse: Codable { - - - public var success: String? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - } - - public init(success: String?) { - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(String.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: BulkInventoryGetItems - Used By: Catalog - */ - - class BulkInventoryGetItems: Codable { - - - public var createdBy: [String: Any]? - - public var stage: String? - - public var failedRecords: [String]? - - public var failed: Int? - - public var companyId: Int? - - public var createdOn: String? - - public var total: Int? - - public var modifiedOn: String? - - public var cancelled: Int? - - public var id: String? - - public var modifiedBy: [String: Any]? - - public var isActive: Bool? - - public var cancelledRecords: [String]? - - public var filePath: String? - - public var succeed: Int? - - - public enum CodingKeys: String, CodingKey { - - case createdBy = "created_by" - - case stage = "stage" - - case failedRecords = "failed_records" - - case failed = "failed" - - case companyId = "company_id" - - case createdOn = "created_on" - - case total = "total" - - case modifiedOn = "modified_on" - - case cancelled = "cancelled" - - case id = "id" - - case modifiedBy = "modified_by" - - case isActive = "is_active" - - case cancelledRecords = "cancelled_records" - - case filePath = "file_path" - - case succeed = "succeed" - - } - - public init(cancelled: Int?, cancelledRecords: [String]?, companyId: Int?, createdBy: [String: Any]?, createdOn: String?, failed: Int?, failedRecords: [String]?, filePath: String?, id: String?, isActive: Bool?, modifiedBy: [String: Any]?, modifiedOn: String?, stage: String?, succeed: Int?, total: Int?) { - - self.createdBy = createdBy - - self.stage = stage - - self.failedRecords = failedRecords - - self.failed = failed - - self.companyId = companyId - - self.createdOn = createdOn - - self.total = total - - self.modifiedOn = modifiedOn - - self.cancelled = cancelled - - self.id = id - - self.modifiedBy = modifiedBy - - self.isActive = isActive - - self.cancelledRecords = cancelledRecords - - self.filePath = filePath - - self.succeed = succeed - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdBy = try container.decode([String: Any].self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stage = try container.decode(String.self, forKey: .stage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - failedRecords = try container.decode([String].self, forKey: .failedRecords) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - failed = try container.decode(Int.self, forKey: .failed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - total = try container.decode(Int.self, forKey: .total) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cancelled = try container.decode(Int.self, forKey: .cancelled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode([String: Any].self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cancelledRecords = try container.decode([String].self, forKey: .cancelledRecords) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - filePath = try container.decode(String.self, forKey: .filePath) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - succeed = try container.decode(Int.self, forKey: .succeed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(stage, forKey: .stage) - - - - try? container.encodeIfPresent(failedRecords, forKey: .failedRecords) - - - - try? container.encodeIfPresent(failed, forKey: .failed) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(total, forKey: .total) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(cancelled, forKey: .cancelled) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(cancelledRecords, forKey: .cancelledRecords) - - - - try? container.encodeIfPresent(filePath, forKey: .filePath) - - - - try? container.encodeIfPresent(succeed, forKey: .succeed) - - - } - - } - - /* - Model: BulkInventoryGet - Used By: Catalog - */ - - class BulkInventoryGet: Codable { - - - public var items: [BulkInventoryGetItems]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [BulkInventoryGetItems]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([BulkInventoryGetItems].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: Size1 - Used By: Catalog - */ - - class Size1: Codable { - - - public var itemHeight: Double? - - public var itemWeightUnitOfMeasure: String? - - public var storeCode: String - - public var quantity: Int - - public var sellerIdentifier: String - - public var itemWeight: Double? - - public var identifiers: [[String: Any]]? - - public var itemLength: Double? - - public var currency: String - - public var priceEffective: Double - - public var itemDimensionsUnitOfMeasure: String? - - public var price: Double - - public var priceTransfer: Double? - - public var size: String? - - public var isSet: Bool? - - public var set: InventorySet? - - public var itemWidth: Double? - - - public enum CodingKeys: String, CodingKey { - - case itemHeight = "item_height" - - case itemWeightUnitOfMeasure = "item_weight_unit_of_measure" - - case storeCode = "store_code" - - case quantity = "quantity" - - case sellerIdentifier = "seller_identifier" - - case itemWeight = "item_weight" - - case identifiers = "identifiers" - - case itemLength = "item_length" - - case currency = "currency" - - case priceEffective = "price_effective" - - case itemDimensionsUnitOfMeasure = "item_dimensions_unit_of_measure" - - case price = "price" - - case priceTransfer = "price_transfer" - - case size = "size" - - case isSet = "is_set" - - case set = "set" - - case itemWidth = "item_width" - - } - - public init(currency: String, identifiers: [[String: Any]]?, isSet: Bool?, itemDimensionsUnitOfMeasure: String?, itemHeight: Double?, itemLength: Double?, itemWeight: Double?, itemWeightUnitOfMeasure: String?, itemWidth: Double?, price: Double, priceEffective: Double, priceTransfer: Double?, quantity: Int, sellerIdentifier: String, set: InventorySet?, size: String?, storeCode: String) { - - self.itemHeight = itemHeight - - self.itemWeightUnitOfMeasure = itemWeightUnitOfMeasure - - self.storeCode = storeCode - - self.quantity = quantity - - self.sellerIdentifier = sellerIdentifier - - self.itemWeight = itemWeight - - self.identifiers = identifiers - - self.itemLength = itemLength - - self.currency = currency - - self.priceEffective = priceEffective - - self.itemDimensionsUnitOfMeasure = itemDimensionsUnitOfMeasure - - self.price = price - - self.priceTransfer = priceTransfer - - self.size = size - - self.isSet = isSet - - self.set = set - - self.itemWidth = itemWidth - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - itemHeight = try container.decode(Double.self, forKey: .itemHeight) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemWeightUnitOfMeasure = try container.decode(String.self, forKey: .itemWeightUnitOfMeasure) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - storeCode = try container.decode(String.self, forKey: .storeCode) - - - - - quantity = try container.decode(Int.self, forKey: .quantity) - - - - - sellerIdentifier = try container.decode(String.self, forKey: .sellerIdentifier) - - - - - do { - itemWeight = try container.decode(Double.self, forKey: .itemWeight) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - identifiers = try container.decode([[String: Any]].self, forKey: .identifiers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemLength = try container.decode(Double.self, forKey: .itemLength) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - currency = try container.decode(String.self, forKey: .currency) - - - - - priceEffective = try container.decode(Double.self, forKey: .priceEffective) - - - - - do { - itemDimensionsUnitOfMeasure = try container.decode(String.self, forKey: .itemDimensionsUnitOfMeasure) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - price = try container.decode(Double.self, forKey: .price) - - - - - do { - priceTransfer = try container.decode(Double.self, forKey: .priceTransfer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - size = try container.decode(String.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isSet = try container.decode(Bool.self, forKey: .isSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - set = try container.decode(InventorySet.self, forKey: .set) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemWidth = try container.decode(Double.self, forKey: .itemWidth) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(itemHeight, forKey: .itemHeight) - - - - try? container.encodeIfPresent(itemWeightUnitOfMeasure, forKey: .itemWeightUnitOfMeasure) - - - - try? container.encodeIfPresent(storeCode, forKey: .storeCode) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - - try? container.encodeIfPresent(sellerIdentifier, forKey: .sellerIdentifier) - - - - try? container.encodeIfPresent(itemWeight, forKey: .itemWeight) - - - - try? container.encodeIfPresent(identifiers, forKey: .identifiers) - - - - try? container.encodeIfPresent(itemLength, forKey: .itemLength) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) - - - - try? container.encodeIfPresent(itemDimensionsUnitOfMeasure, forKey: .itemDimensionsUnitOfMeasure) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(priceTransfer, forKey: .priceTransfer) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(isSet, forKey: .isSet) - - - - try? container.encodeIfPresent(set, forKey: .set) - - - - try? container.encodeIfPresent(itemWidth, forKey: .itemWidth) - - - } - - } - - /* - Model: InventoryBulkRequest - Used By: Catalog - */ - - class InventoryBulkRequest: Codable { - - - public var companyId: Int - - public var batchId: String - - public var user: [String: Any]? - - public var sizes: [Size1] - - - public enum CodingKeys: String, CodingKey { - - case companyId = "company_id" - - case batchId = "batch_id" - - case user = "user" - - case sizes = "sizes" - - } - - public init(batchId: String, companyId: Int, sizes: [Size1], user: [String: Any]?) { - - self.companyId = companyId - - self.batchId = batchId - - self.user = user - - self.sizes = sizes - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - companyId = try container.decode(Int.self, forKey: .companyId) - - - - - batchId = try container.decode(String.self, forKey: .batchId) - - - - - do { - user = try container.decode([String: Any].self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - sizes = try container.decode([Size1].self, forKey: .sizes) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(batchId, forKey: .batchId) - - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(sizes, forKey: .sizes) - - - } - - } - - /* - Model: InventoryExportRequest - Used By: Catalog - */ - - class InventoryExportRequest: Codable { - - - public var store: [Int]? - - public var brand: [Int]? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case store = "store" - - case brand = "brand" - - case type = "type" - - } - - public init(brand: [Int]?, store: [Int]?, type: String?) { - - self.store = store - - self.brand = brand - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - store = try container.decode([Int].self, forKey: .store) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brand = try container.decode([Int].self, forKey: .brand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(store, forKey: .store) - - - - try? container.encodeIfPresent(brand, forKey: .brand) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: InventoryExportJob - Used By: Catalog - */ - - class InventoryExportJob: Codable { - - - public var url: String? - - public var sellerId: Int - - public var status: String? - - public var triggerOn: String? - - public var requestParams: [String: Any]? - - public var completedOn: String? - - public var taskId: String - - - public enum CodingKeys: String, CodingKey { - - case url = "url" - - case sellerId = "seller_id" - - case status = "status" - - case triggerOn = "trigger_on" - - case requestParams = "request_params" - - case completedOn = "completed_on" - - case taskId = "task_id" - - } - - public init(completedOn: String?, requestParams: [String: Any]?, sellerId: Int, status: String?, taskId: String, triggerOn: String?, url: String?) { - - self.url = url - - self.sellerId = sellerId - - self.status = status - - self.triggerOn = triggerOn - - self.requestParams = requestParams - - self.completedOn = completedOn - - self.taskId = taskId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - sellerId = try container.decode(Int.self, forKey: .sellerId) - - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - triggerOn = try container.decode(String.self, forKey: .triggerOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requestParams = try container.decode([String: Any].self, forKey: .requestParams) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - completedOn = try container.decode(String.self, forKey: .completedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - taskId = try container.decode(String.self, forKey: .taskId) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(sellerId, forKey: .sellerId) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(triggerOn, forKey: .triggerOn) - - - - try? container.encodeIfPresent(requestParams, forKey: .requestParams) - - - - try? container.encodeIfPresent(completedOn, forKey: .completedOn) - - - - try? container.encodeIfPresent(taskId, forKey: .taskId) - - - } - - } - - /* - Model: FilerList - Used By: Catalog - */ - - class FilerList: Codable { - - - public var display: String? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case value = "value" - - } - - public init(display: String?, value: String?) { - - self.display = display - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: InventoryConfig - Used By: Catalog - */ - - class InventoryConfig: Codable { - - - public var multivalues: Bool? - - public var data: [FilerList]? - - - public enum CodingKeys: String, CodingKey { - - case multivalues = "multivalues" - - case data = "data" - - } - - public init(data: [FilerList]?, multivalues: Bool?) { - - self.multivalues = multivalues - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - multivalues = try container.decode(Bool.self, forKey: .multivalues) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode([FilerList].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(multivalues, forKey: .multivalues) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: HsnUpsert - Used By: Catalog - */ - - class HsnUpsert: Codable { - - - public var tax2: Double? - - public var taxOnMrp: Bool - - public var companyId: Int - - public var threshold2: Double? - - public var threshold1: Double - - public var hs2Code: String - - public var uid: Int? - - public var hsnCode: String - - public var taxOnEsp: Bool? - - public var tax1: Double - - - public enum CodingKeys: String, CodingKey { - - case tax2 = "tax2" - - case taxOnMrp = "tax_on_mrp" - - case companyId = "company_id" - - case threshold2 = "threshold2" - - case threshold1 = "threshold1" - - case hs2Code = "hs2_code" - - case uid = "uid" - - case hsnCode = "hsn_code" - - case taxOnEsp = "tax_on_esp" - - case tax1 = "tax1" - - } - - public init(companyId: Int, hs2Code: String, hsnCode: String, tax1: Double, tax2: Double?, taxOnEsp: Bool?, taxOnMrp: Bool, threshold1: Double, threshold2: Double?, uid: Int?) { - - self.tax2 = tax2 - - self.taxOnMrp = taxOnMrp - - self.companyId = companyId - - self.threshold2 = threshold2 - - self.threshold1 = threshold1 - - self.hs2Code = hs2Code - - self.uid = uid - - self.hsnCode = hsnCode - - self.taxOnEsp = taxOnEsp - - self.tax1 = tax1 - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - tax2 = try container.decode(Double.self, forKey: .tax2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - taxOnMrp = try container.decode(Bool.self, forKey: .taxOnMrp) - - - - - companyId = try container.decode(Int.self, forKey: .companyId) - - - - - do { - threshold2 = try container.decode(Double.self, forKey: .threshold2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - threshold1 = try container.decode(Double.self, forKey: .threshold1) - - - - - hs2Code = try container.decode(String.self, forKey: .hs2Code) - - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - hsnCode = try container.decode(String.self, forKey: .hsnCode) - - - - - do { - taxOnEsp = try container.decode(Bool.self, forKey: .taxOnEsp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - tax1 = try container.decode(Double.self, forKey: .tax1) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(tax2, forKey: .tax2) - - - - try? container.encodeIfPresent(taxOnMrp, forKey: .taxOnMrp) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(threshold2, forKey: .threshold2) - - - - try? container.encodeIfPresent(threshold1, forKey: .threshold1) - - - - try? container.encodeIfPresent(hs2Code, forKey: .hs2Code) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(hsnCode, forKey: .hsnCode) - - - - try? container.encodeIfPresent(taxOnEsp, forKey: .taxOnEsp) - - - - try? container.encodeIfPresent(tax1, forKey: .tax1) - - - } - - } - - /* - Model: HsnCodesObject - Used By: Catalog - */ - - class HsnCodesObject: Codable { - - - public var tax2: Double? - - public var taxOnMrp: Bool? - - public var companyId: Int? - - public var threshold2: Double? - - public var threshold1: Double? - - public var modifiedOn: String? - - public var hs2Code: String? - - public var id: String? - - public var hsnCode: String? - - public var taxOnEsp: Bool? - - public var tax1: Double? - - - public enum CodingKeys: String, CodingKey { - - case tax2 = "tax2" - - case taxOnMrp = "tax_on_mrp" - - case companyId = "company_id" - - case threshold2 = "threshold2" - - case threshold1 = "threshold1" - - case modifiedOn = "modified_on" - - case hs2Code = "hs2_code" - - case id = "id" - - case hsnCode = "hsn_code" - - case taxOnEsp = "tax_on_esp" - - case tax1 = "tax1" - - } - - public init(companyId: Int?, hs2Code: String?, hsnCode: String?, id: String?, modifiedOn: String?, tax1: Double?, tax2: Double?, taxOnEsp: Bool?, taxOnMrp: Bool?, threshold1: Double?, threshold2: Double?) { - - self.tax2 = tax2 - - self.taxOnMrp = taxOnMrp - - self.companyId = companyId - - self.threshold2 = threshold2 - - self.threshold1 = threshold1 - - self.modifiedOn = modifiedOn - - self.hs2Code = hs2Code - - self.id = id - - self.hsnCode = hsnCode - - self.taxOnEsp = taxOnEsp - - self.tax1 = tax1 - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - tax2 = try container.decode(Double.self, forKey: .tax2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - taxOnMrp = try container.decode(Bool.self, forKey: .taxOnMrp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - threshold2 = try container.decode(Double.self, forKey: .threshold2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - threshold1 = try container.decode(Double.self, forKey: .threshold1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hs2Code = try container.decode(String.self, forKey: .hs2Code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hsnCode = try container.decode(String.self, forKey: .hsnCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - taxOnEsp = try container.decode(Bool.self, forKey: .taxOnEsp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tax1 = try container.decode(Double.self, forKey: .tax1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(tax2, forKey: .tax2) - - - - try? container.encodeIfPresent(taxOnMrp, forKey: .taxOnMrp) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(threshold2, forKey: .threshold2) - - - - try? container.encodeIfPresent(threshold1, forKey: .threshold1) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(hs2Code, forKey: .hs2Code) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(hsnCode, forKey: .hsnCode) - - - - try? container.encodeIfPresent(taxOnEsp, forKey: .taxOnEsp) - - - - try? container.encodeIfPresent(tax1, forKey: .tax1) - - - } - - } - - /* - Model: HsnCode - Used By: Catalog - */ - - class HsnCode: Codable { - - - public var data: HsnCodesObject? - - - public enum CodingKeys: String, CodingKey { - - case data = "data" - - } - - public init(data: HsnCodesObject?) { - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - data = try container.decode(HsnCodesObject.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: PageResponse - Used By: Catalog - */ - - class PageResponse: Codable { - - - public var current: String? - - public var itemTotal: Int? - - public var hasNext: Bool? - - public var size: Int? - - public var hasPrevious: Bool? - - - public enum CodingKeys: String, CodingKey { - - case current = "current" - - case itemTotal = "item_total" - - case hasNext = "has_next" - - case size = "size" - - case hasPrevious = "has_previous" - - } - - public init(current: String?, hasNext: Bool?, hasPrevious: Bool?, itemTotal: Int?, size: Int?) { - - self.current = current - - self.itemTotal = itemTotal - - self.hasNext = hasNext - - self.size = size - - self.hasPrevious = hasPrevious - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - current = try container.decode(String.self, forKey: .current) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemTotal = try container.decode(Int.self, forKey: .itemTotal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasNext = try container.decode(Bool.self, forKey: .hasNext) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - size = try container.decode(Int.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasPrevious = try container.decode(Bool.self, forKey: .hasPrevious) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(current, forKey: .current) - - - - try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) - - - - try? container.encodeIfPresent(hasNext, forKey: .hasNext) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(hasPrevious, forKey: .hasPrevious) - - - } - - } - - /* - Model: HsnCodesListingResponse - Used By: Catalog - */ - - class HsnCodesListingResponse: Codable { - - - public var items: [HsnCodesObject]? - - public var page: PageResponse? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [HsnCodesObject]?, page: PageResponse?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([HsnCodesObject].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(PageResponse.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: BulkHsnUpsert - Used By: Catalog - */ - - class BulkHsnUpsert: Codable { - - - public var data: [HsnUpsert] - - - public enum CodingKeys: String, CodingKey { - - case data = "data" - - } - - public init(data: [HsnUpsert]) { - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - data = try container.decode([HsnUpsert].self, forKey: .data) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: BulkHsnResponse - Used By: Catalog - */ - - class BulkHsnResponse: Codable { - - - public var success: Bool? - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - } - - public init(success: Bool?) { - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: BrandItem - Used By: Catalog - */ - - class BrandItem: Codable { - - - public var banners: ImageUrls? - - public var departments: [String]? - - public var action: ProductListingAction? - - public var slug: String? - - public var logo: Media? - - public var discount: String? - - public var uid: Int? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case banners = "banners" - - case departments = "departments" - - case action = "action" - - case slug = "slug" - - case logo = "logo" - - case discount = "discount" - - case uid = "uid" - - case name = "name" - - } - - public init(action: ProductListingAction?, banners: ImageUrls?, departments: [String]?, discount: String?, logo: Media?, name: String?, slug: String?, uid: Int?) { - - self.banners = banners - - self.departments = departments - - self.action = action - - self.slug = slug - - self.logo = logo - - self.discount = discount - - self.uid = uid - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - banners = try container.decode(ImageUrls.self, forKey: .banners) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - departments = try container.decode([String].self, forKey: .departments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(ProductListingAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(Media.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discount = try container.decode(String.self, forKey: .discount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(banners, forKey: .banners) - - - - try? container.encodeIfPresent(departments, forKey: .departments) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: BrandListingResponse - Used By: Catalog - */ - - class BrandListingResponse: Codable { - - - public var items: [BrandItem]? - - public var page: Page - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [BrandItem]?, page: Page) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([BrandItem].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - page = try container.decode(Page.self, forKey: .page) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: Department - Used By: Catalog - */ - - class Department: Codable { - - - public var priorityOrder: Int? - - public var slug: String? - - public var logo: Media? - - public var uid: Int? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case priorityOrder = "priority_order" - - case slug = "slug" - - case logo = "logo" - - case uid = "uid" - - case name = "name" - - } - - public init(logo: Media?, name: String?, priorityOrder: Int?, slug: String?, uid: Int?) { - - self.priorityOrder = priorityOrder - - self.slug = slug - - self.logo = logo - - self.uid = uid - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - priorityOrder = try container.decode(Int.self, forKey: .priorityOrder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(Media.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(priorityOrder, forKey: .priorityOrder) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: DepartmentResponse - Used By: Catalog - */ - - class DepartmentResponse: Codable { - - - public var items: [Department]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - } - - public init(items: [Department]?) { - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Department].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: DepartmentIdentifier - Used By: Catalog - */ - - class DepartmentIdentifier: Codable { - - - public var uid: Int? - - public var slug: String? - - - public enum CodingKeys: String, CodingKey { - - case uid = "uid" - - case slug = "slug" - - } - - public init(slug: String?, uid: Int?) { - - self.uid = uid - - self.slug = slug - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - } - - } - - /* - Model: ThirdLevelChild - Used By: Catalog - */ - - class ThirdLevelChild: Codable { - - - public var banners: ImageUrls? - - public var childs: [[String: Any]]? - - public var action: ProductListingAction? - - public var slug: String? - - public var uid: Int? - - public var customJson: [String: Any]? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case banners = "banners" - - case childs = "childs" - - case action = "action" - - case slug = "slug" - - case uid = "uid" - - case customJson = "_custom_json" - - case name = "name" - - } - - public init(action: ProductListingAction?, banners: ImageUrls?, childs: [[String: Any]]?, name: String?, slug: String?, uid: Int?, customJson: [String: Any]?) { - - self.banners = banners - - self.childs = childs - - self.action = action - - self.slug = slug - - self.uid = uid - - self.customJson = customJson - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - banners = try container.decode(ImageUrls.self, forKey: .banners) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - childs = try container.decode([[String: Any]].self, forKey: .childs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(ProductListingAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(banners, forKey: .banners) - - - - try? container.encodeIfPresent(childs, forKey: .childs) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: SecondLevelChild - Used By: Catalog - */ - - class SecondLevelChild: Codable { - - - public var banners: ImageUrls? - - public var childs: [ThirdLevelChild]? - - public var action: ProductListingAction? - - public var slug: String? - - public var uid: Int? - - public var customJson: [String: Any]? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case banners = "banners" - - case childs = "childs" - - case action = "action" - - case slug = "slug" - - case uid = "uid" - - case customJson = "_custom_json" - - case name = "name" - - } - - public init(action: ProductListingAction?, banners: ImageUrls?, childs: [ThirdLevelChild]?, name: String?, slug: String?, uid: Int?, customJson: [String: Any]?) { - - self.banners = banners - - self.childs = childs - - self.action = action - - self.slug = slug - - self.uid = uid - - self.customJson = customJson - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - banners = try container.decode(ImageUrls.self, forKey: .banners) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - childs = try container.decode([ThirdLevelChild].self, forKey: .childs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(ProductListingAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(banners, forKey: .banners) - - - - try? container.encodeIfPresent(childs, forKey: .childs) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: Child - Used By: Catalog - */ - - class Child: Codable { - - - public var banners: ImageUrls? - - public var childs: [SecondLevelChild]? - - public var action: ProductListingAction? - - public var slug: String? - - public var uid: Int? - - public var customJson: [String: Any]? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case banners = "banners" - - case childs = "childs" - - case action = "action" - - case slug = "slug" - - case uid = "uid" - - case customJson = "_custom_json" - - case name = "name" - - } - - public init(action: ProductListingAction?, banners: ImageUrls?, childs: [SecondLevelChild]?, name: String?, slug: String?, uid: Int?, customJson: [String: Any]?) { - - self.banners = banners - - self.childs = childs - - self.action = action - - self.slug = slug - - self.uid = uid - - self.customJson = customJson - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - banners = try container.decode(ImageUrls.self, forKey: .banners) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - childs = try container.decode([SecondLevelChild].self, forKey: .childs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(ProductListingAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(banners, forKey: .banners) - - - - try? container.encodeIfPresent(childs, forKey: .childs) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: CategoryItems - Used By: Catalog - */ - - class CategoryItems: Codable { - - - public var banners: ImageUrls? - - public var childs: [Child]? - - public var action: ProductListingAction? - - public var slug: String? - - public var uid: Int? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case banners = "banners" - - case childs = "childs" - - case action = "action" - - case slug = "slug" - - case uid = "uid" - - case name = "name" - - } - - public init(action: ProductListingAction?, banners: ImageUrls?, childs: [Child]?, name: String?, slug: String?, uid: Int?) { - - self.banners = banners - - self.childs = childs - - self.action = action - - self.slug = slug - - self.uid = uid - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - banners = try container.decode(ImageUrls.self, forKey: .banners) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - childs = try container.decode([Child].self, forKey: .childs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(ProductListingAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(banners, forKey: .banners) - - - - try? container.encodeIfPresent(childs, forKey: .childs) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: DepartmentCategoryTree - Used By: Catalog - */ - - class DepartmentCategoryTree: Codable { - - - public var items: [CategoryItems]? - - public var department: String? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case department = "department" - - } - - public init(department: String?, items: [CategoryItems]?) { - - self.items = items - - self.department = department - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([CategoryItems].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - department = try container.decode(String.self, forKey: .department) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(department, forKey: .department) - - - } - - } - - /* - Model: CategoryListingResponse - Used By: Catalog - */ - - class CategoryListingResponse: Codable { - - - public var departments: [DepartmentIdentifier]? - - public var data: [DepartmentCategoryTree]? - - - public enum CodingKeys: String, CodingKey { - - case departments = "departments" - - case data = "data" - - } - - public init(data: [DepartmentCategoryTree]?, departments: [DepartmentIdentifier]?) { - - self.departments = departments - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - departments = try container.decode([DepartmentIdentifier].self, forKey: .departments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode([DepartmentCategoryTree].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(departments, forKey: .departments) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: ApplicationProductListingResponse - Used By: Catalog - */ - - class ApplicationProductListingResponse: Codable { - - - public var items: [ProductListingDetail]? - - public var sortOn: [ProductSortOn]? - - public var page: Page - - public var filters: [ProductFilters]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case sortOn = "sort_on" - - case page = "page" - - case filters = "filters" - - } - - public init(filters: [ProductFilters]?, items: [ProductListingDetail]?, page: Page, sortOn: [ProductSortOn]?) { - - self.items = items - - self.sortOn = sortOn - - self.page = page - - self.filters = filters - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([ProductListingDetail].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sortOn = try container.decode([ProductSortOn].self, forKey: .sortOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - page = try container.decode(Page.self, forKey: .page) - - - - - do { - filters = try container.decode([ProductFilters].self, forKey: .filters) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(sortOn, forKey: .sortOn) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(filters, forKey: .filters) - - - } - - } - - /* - Model: ProductDetail - Used By: Catalog - */ - - class ProductDetail: Codable { - - - public var shortDescription: String? - - public var attributes: [String: Any]? - - public var hasVariant: Bool? - - public var color: String? - - public var promoMeta: [String: Any]? - - public var productOnlineDate: String? - - public var brand: ProductBrand? - - public var highlights: [String]? - - public var groupedAttributes: [ProductDetailGroupedAttribute]? - - public var teaserTag: [String: Any]? - - public var description: String? - - public var similars: [String]? - - public var itemCode: String? - - public var medias: [Media1]? - - public var tryouts: [String]? - - public var imageNature: String? - - public var uid: Int? - - public var ratingCount: Int? - - public var name: String? - - public var type: String? - - public var itemType: String? - - public var slug: String - - public var rating: Double? - - - public enum CodingKeys: String, CodingKey { - - case shortDescription = "short_description" - - case attributes = "attributes" - - case hasVariant = "has_variant" - - case color = "color" - - case promoMeta = "promo_meta" - - case productOnlineDate = "product_online_date" - - case brand = "brand" - - case highlights = "highlights" - - case groupedAttributes = "grouped_attributes" - - case teaserTag = "teaser_tag" - - case description = "description" - - case similars = "similars" - - case itemCode = "item_code" - - case medias = "medias" - - case tryouts = "tryouts" - - case imageNature = "image_nature" - - case uid = "uid" - - case ratingCount = "rating_count" - - case name = "name" - - case type = "type" - - case itemType = "item_type" - - case slug = "slug" - - case rating = "rating" - - } - - public init(attributes: [String: Any]?, brand: ProductBrand?, color: String?, description: String?, groupedAttributes: [ProductDetailGroupedAttribute]?, hasVariant: Bool?, highlights: [String]?, imageNature: String?, itemCode: String?, itemType: String?, medias: [Media1]?, name: String?, productOnlineDate: String?, promoMeta: [String: Any]?, rating: Double?, ratingCount: Int?, shortDescription: String?, similars: [String]?, slug: String, teaserTag: [String: Any]?, tryouts: [String]?, type: String?, uid: Int?) { - - self.shortDescription = shortDescription - - self.attributes = attributes - - self.hasVariant = hasVariant - - self.color = color - - self.promoMeta = promoMeta - - self.productOnlineDate = productOnlineDate - - self.brand = brand - - self.highlights = highlights - - self.groupedAttributes = groupedAttributes - - self.teaserTag = teaserTag - - self.description = description - - self.similars = similars - - self.itemCode = itemCode - - self.medias = medias - - self.tryouts = tryouts - - self.imageNature = imageNature - - self.uid = uid - - self.ratingCount = ratingCount - - self.name = name - - self.type = type - - self.itemType = itemType - - self.slug = slug - - self.rating = rating - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - shortDescription = try container.decode(String.self, forKey: .shortDescription) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attributes = try container.decode([String: Any].self, forKey: .attributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hasVariant = try container.decode(Bool.self, forKey: .hasVariant) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - color = try container.decode(String.self, forKey: .color) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - promoMeta = try container.decode([String: Any].self, forKey: .promoMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productOnlineDate = try container.decode(String.self, forKey: .productOnlineDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brand = try container.decode(ProductBrand.self, forKey: .brand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - highlights = try container.decode([String].self, forKey: .highlights) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - groupedAttributes = try container.decode([ProductDetailGroupedAttribute].self, forKey: .groupedAttributes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - teaserTag = try container.decode([String: Any].self, forKey: .teaserTag) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - similars = try container.decode([String].self, forKey: .similars) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemCode = try container.decode(String.self, forKey: .itemCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - medias = try container.decode([Media1].self, forKey: .medias) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tryouts = try container.decode([String].self, forKey: .tryouts) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - imageNature = try container.decode(String.self, forKey: .imageNature) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ratingCount = try container.decode(Int.self, forKey: .ratingCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemType = try container.decode(String.self, forKey: .itemType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - slug = try container.decode(String.self, forKey: .slug) - - - - - do { - rating = try container.decode(Double.self, forKey: .rating) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(shortDescription, forKey: .shortDescription) - - - - try? container.encodeIfPresent(attributes, forKey: .attributes) - - - - try? container.encodeIfPresent(hasVariant, forKey: .hasVariant) - - - - try? container.encodeIfPresent(color, forKey: .color) - - - - try? container.encodeIfPresent(promoMeta, forKey: .promoMeta) - - - - try? container.encodeIfPresent(productOnlineDate, forKey: .productOnlineDate) - - - - try? container.encodeIfPresent(brand, forKey: .brand) - - - - try? container.encodeIfPresent(highlights, forKey: .highlights) - - - - try? container.encodeIfPresent(groupedAttributes, forKey: .groupedAttributes) - - - - try? container.encodeIfPresent(teaserTag, forKey: .teaserTag) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(similars, forKey: .similars) - - - - try? container.encodeIfPresent(itemCode, forKey: .itemCode) - - - - try? container.encodeIfPresent(medias, forKey: .medias) - - - - try? container.encodeIfPresent(tryouts, forKey: .tryouts) - - - - try? container.encodeIfPresent(imageNature, forKey: .imageNature) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(ratingCount, forKey: .ratingCount) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(itemType, forKey: .itemType) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - - try? container.encodeIfPresent(rating, forKey: .rating) - - - } - - } - - - - /* - Model: BusinessCountryInfo - Used By: CompanyProfile - */ - - class BusinessCountryInfo: Codable { - - - public var countryCode: String? - - public var country: String? - - - public enum CodingKeys: String, CodingKey { - - case countryCode = "country_code" - - case country = "country" - - } - - public init(country: String?, countryCode: String?) { - - self.countryCode = countryCode - - self.country = country - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - } - - } - - /* - Model: Website - Used By: CompanyProfile - */ - - class Website: Codable { - - - public var url: String? - - - public enum CodingKeys: String, CodingKey { - - case url = "url" - - } - - public init(url: String?) { - - self.url = url - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(url, forKey: .url) - - - } - - } - - /* - Model: BusinessDetails - Used By: CompanyProfile - */ - - class BusinessDetails: Codable { - - - public var website: Website? - - - public enum CodingKeys: String, CodingKey { - - case website = "website" - - } - - public init(website: Website?) { - - self.website = website - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - website = try container.decode(Website.self, forKey: .website) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(website, forKey: .website) - - - } - - } - - /* - Model: GetAddressSerializer - Used By: CompanyProfile - */ - - class GetAddressSerializer: Codable { - - - public var countryCode: String? - - public var landmark: String? - - public var country: String? - - public var latitude: Double? - - public var longitude: Double? - - public var state: String? - - public var addressType: String? - - public var address1: String? - - public var city: String? - - public var pincode: Int? - - public var address2: String? - - - public enum CodingKeys: String, CodingKey { - - case countryCode = "country_code" - - case landmark = "landmark" - - case country = "country" - - case latitude = "latitude" - - case longitude = "longitude" - - case state = "state" - - case addressType = "address_type" - - case address1 = "address1" - - case city = "city" - - case pincode = "pincode" - - case address2 = "address2" - - } - - public init(address1: String?, address2: String?, addressType: String?, city: String?, country: String?, countryCode: String?, landmark: String?, latitude: Double?, longitude: Double?, pincode: Int?, state: String?) { - - self.countryCode = countryCode - - self.landmark = landmark - - self.country = country - - self.latitude = latitude - - self.longitude = longitude - - self.state = state - - self.addressType = addressType - - self.address1 = address1 - - self.city = city - - self.pincode = pincode - - self.address2 = address2 - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - landmark = try container.decode(String.self, forKey: .landmark) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - latitude = try container.decode(Double.self, forKey: .latitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - longitude = try container.decode(Double.self, forKey: .longitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(String.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressType = try container.decode(String.self, forKey: .addressType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address1 = try container.decode(String.self, forKey: .address1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(Int.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address2 = try container.decode(String.self, forKey: .address2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(landmark, forKey: .landmark) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(latitude, forKey: .latitude) - - - - try? container.encodeIfPresent(longitude, forKey: .longitude) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(addressType, forKey: .addressType) - - - - try? container.encodeIfPresent(address1, forKey: .address1) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(address2, forKey: .address2) - - - } - - } - - /* - Model: Document - Used By: CompanyProfile - */ - - class Document: Codable { - - - public var legalName: String? - - public var url: String? - - public var verified: Bool? - - public var value: String - - public var type: String - - - public enum CodingKeys: String, CodingKey { - - case legalName = "legal_name" - - case url = "url" - - case verified = "verified" - - case value = "value" - - case type = "type" - - } - - public init(legalName: String?, type: String, url: String?, value: String, verified: Bool?) { - - self.legalName = legalName - - self.url = url - - self.verified = verified - - self.value = value - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - legalName = try container.decode(String.self, forKey: .legalName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verified = try container.decode(Bool.self, forKey: .verified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - value = try container.decode(String.self, forKey: .value) - - - - - type = try container.decode(String.self, forKey: .type) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(legalName, forKey: .legalName) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(verified, forKey: .verified) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: SellerPhoneNumber - Used By: CompanyProfile - */ - - class SellerPhoneNumber: Codable { - - - public var number: String - - public var countryCode: Int - - - public enum CodingKeys: String, CodingKey { - - case number = "number" - - case countryCode = "country_code" - - } - - public init(countryCode: Int, number: String) { - - self.number = number - - self.countryCode = countryCode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - number = try container.decode(String.self, forKey: .number) - - - - - countryCode = try container.decode(Int.self, forKey: .countryCode) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(number, forKey: .number) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - } - - } - - /* - Model: ContactDetails - Used By: CompanyProfile - */ - - class ContactDetails: Codable { - - - public var phone: [SellerPhoneNumber]? - - public var emails: [String]? - - - public enum CodingKeys: String, CodingKey { - - case phone = "phone" - - case emails = "emails" - - } - - public init(emails: [String]?, phone: [SellerPhoneNumber]?) { - - self.phone = phone - - self.emails = emails - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - phone = try container.decode([SellerPhoneNumber].self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - emails = try container.decode([String].self, forKey: .emails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(emails, forKey: .emails) - - - } - - } - - /* - Model: GetCompanyProfileSerializerResponse - Used By: CompanyProfile - */ - - class GetCompanyProfileSerializerResponse: Codable { - - - public var modifiedOn: String? - - public var createdOn: String? - - public var businessInfo: String? - - public var name: String? - - public var verifiedBy: UserSerializer? - - public var businessCountryInfo: BusinessCountryInfo? - - public var createdBy: UserSerializer? - - public var uid: Int - - public var warnings: [String: Any]? - - public var verifiedOn: String? - - public var modifiedBy: UserSerializer? - - public var businessDetails: BusinessDetails? - - public var mode: String? - - public var addresses: [GetAddressSerializer]? - - public var businessType: String - - public var documents: [Document]? - - public var contactDetails: ContactDetails? - - public var franchiseEnabled: Bool? - - public var companyType: String - - public var notificationEmails: [String]? - - public var stage: String? - - - public enum CodingKeys: String, CodingKey { - - case modifiedOn = "modified_on" - - case createdOn = "created_on" - - case businessInfo = "business_info" - - case name = "name" - - case verifiedBy = "verified_by" - - case businessCountryInfo = "business_country_info" - - case createdBy = "created_by" - - case uid = "uid" - - case warnings = "warnings" - - case verifiedOn = "verified_on" - - case modifiedBy = "modified_by" - - case businessDetails = "business_details" - - case mode = "mode" - - case addresses = "addresses" - - case businessType = "business_type" - - case documents = "documents" - - case contactDetails = "contact_details" - - case franchiseEnabled = "franchise_enabled" - - case companyType = "company_type" - - case notificationEmails = "notification_emails" - - case stage = "stage" - - } - - public init(addresses: [GetAddressSerializer]?, businessCountryInfo: BusinessCountryInfo?, businessDetails: BusinessDetails?, businessInfo: String?, businessType: String, companyType: String, contactDetails: ContactDetails?, createdBy: UserSerializer?, createdOn: String?, documents: [Document]?, franchiseEnabled: Bool?, mode: String?, modifiedBy: UserSerializer?, modifiedOn: String?, name: String?, notificationEmails: [String]?, stage: String?, uid: Int, verifiedBy: UserSerializer?, verifiedOn: String?, warnings: [String: Any]?) { - - self.modifiedOn = modifiedOn - - self.createdOn = createdOn - - self.businessInfo = businessInfo - - self.name = name - - self.verifiedBy = verifiedBy - - self.businessCountryInfo = businessCountryInfo - - self.createdBy = createdBy - - self.uid = uid - - self.warnings = warnings - - self.verifiedOn = verifiedOn - - self.modifiedBy = modifiedBy - - self.businessDetails = businessDetails - - self.mode = mode - - self.addresses = addresses - - self.businessType = businessType - - self.documents = documents - - self.contactDetails = contactDetails - - self.franchiseEnabled = franchiseEnabled - - self.companyType = companyType - - self.notificationEmails = notificationEmails - - self.stage = stage - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - businessInfo = try container.decode(String.self, forKey: .businessInfo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifiedBy = try container.decode(UserSerializer.self, forKey: .verifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - businessCountryInfo = try container.decode(BusinessCountryInfo.self, forKey: .businessCountryInfo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(UserSerializer.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - uid = try container.decode(Int.self, forKey: .uid) - - - - - do { - warnings = try container.decode([String: Any].self, forKey: .warnings) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifiedOn = try container.decode(String.self, forKey: .verifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode(UserSerializer.self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - businessDetails = try container.decode(BusinessDetails.self, forKey: .businessDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mode = try container.decode(String.self, forKey: .mode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addresses = try container.decode([GetAddressSerializer].self, forKey: .addresses) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - businessType = try container.decode(String.self, forKey: .businessType) - - - - - do { - documents = try container.decode([Document].self, forKey: .documents) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contactDetails = try container.decode(ContactDetails.self, forKey: .contactDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - franchiseEnabled = try container.decode(Bool.self, forKey: .franchiseEnabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - companyType = try container.decode(String.self, forKey: .companyType) - - - - - do { - notificationEmails = try container.decode([String].self, forKey: .notificationEmails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stage = try container.decode(String.self, forKey: .stage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(businessInfo, forKey: .businessInfo) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(verifiedBy, forKey: .verifiedBy) - - - - try? container.encodeIfPresent(businessCountryInfo, forKey: .businessCountryInfo) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(warnings, forKey: .warnings) - - - - try? container.encodeIfPresent(verifiedOn, forKey: .verifiedOn) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(businessDetails, forKey: .businessDetails) - - - - try? container.encodeIfPresent(mode, forKey: .mode) - - - - try? container.encodeIfPresent(addresses, forKey: .addresses) - - - - try? container.encodeIfPresent(businessType, forKey: .businessType) - - - - try? container.encodeIfPresent(documents, forKey: .documents) - - - - try? container.encodeIfPresent(contactDetails, forKey: .contactDetails) - - - - try? container.encodeIfPresent(franchiseEnabled, forKey: .franchiseEnabled) - - - - try? container.encodeIfPresent(companyType, forKey: .companyType) - - - - try? container.encodeIfPresent(notificationEmails, forKey: .notificationEmails) - - - - try? container.encodeIfPresent(stage, forKey: .stage) - - - } - - } - - /* - Model: CreateUpdateAddressSerializer - Used By: CompanyProfile - */ - - class CreateUpdateAddressSerializer: Codable { - - - public var countryCode: String? - - public var landmark: String? - - public var country: String - - public var latitude: Double - - public var longitude: Double - - public var state: String - - public var addressType: String - - public var address1: String - - public var city: String - - public var pincode: Int - - public var address2: String? - - - public enum CodingKeys: String, CodingKey { - - case countryCode = "country_code" - - case landmark = "landmark" - - case country = "country" - - case latitude = "latitude" - - case longitude = "longitude" - - case state = "state" - - case addressType = "address_type" - - case address1 = "address1" - - case city = "city" - - case pincode = "pincode" - - case address2 = "address2" - - } - - public init(address1: String, address2: String?, addressType: String, city: String, country: String, countryCode: String?, landmark: String?, latitude: Double, longitude: Double, pincode: Int, state: String) { - - self.countryCode = countryCode - - self.landmark = landmark - - self.country = country - - self.latitude = latitude - - self.longitude = longitude - - self.state = state - - self.addressType = addressType - - self.address1 = address1 - - self.city = city - - self.pincode = pincode - - self.address2 = address2 - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - landmark = try container.decode(String.self, forKey: .landmark) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - country = try container.decode(String.self, forKey: .country) - - - - - latitude = try container.decode(Double.self, forKey: .latitude) - - - - - longitude = try container.decode(Double.self, forKey: .longitude) - - - - - state = try container.decode(String.self, forKey: .state) - - - - - addressType = try container.decode(String.self, forKey: .addressType) - - - - - address1 = try container.decode(String.self, forKey: .address1) - - - - - city = try container.decode(String.self, forKey: .city) - - - - - pincode = try container.decode(Int.self, forKey: .pincode) - - - - - do { - address2 = try container.decode(String.self, forKey: .address2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(landmark, forKey: .landmark) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(latitude, forKey: .latitude) - - - - try? container.encodeIfPresent(longitude, forKey: .longitude) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(addressType, forKey: .addressType) - - - - try? container.encodeIfPresent(address1, forKey: .address1) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(address2, forKey: .address2) - - - } - - } - - /* - Model: UpdateCompany - Used By: CompanyProfile - */ - - class UpdateCompany: Codable { - - - public var businessInfo: String? - - public var businessType: String? - - public var contactDetails: ContactDetails? - - public var documents: [Document]? - - public var name: String? - - public var franchiseEnabled: Bool? - - public var companyType: String? - - public var notificationEmails: [String]? - - public var businessDetails: BusinessDetails? - - public var addresses: [CreateUpdateAddressSerializer]? - - public var warnings: [String: Any]? - - public var rejectReason: String? - - - public enum CodingKeys: String, CodingKey { - - case businessInfo = "business_info" - - case businessType = "business_type" - - case contactDetails = "contact_details" - - case documents = "documents" - - case name = "name" - - case franchiseEnabled = "franchise_enabled" - - case companyType = "company_type" - - case notificationEmails = "notification_emails" - - case businessDetails = "business_details" - - case addresses = "addresses" - - case warnings = "warnings" - - case rejectReason = "reject_reason" - - } - - public init(addresses: [CreateUpdateAddressSerializer]?, businessDetails: BusinessDetails?, businessInfo: String?, businessType: String?, companyType: String?, contactDetails: ContactDetails?, documents: [Document]?, franchiseEnabled: Bool?, name: String?, notificationEmails: [String]?, rejectReason: String?, warnings: [String: Any]?) { - - self.businessInfo = businessInfo - - self.businessType = businessType - - self.contactDetails = contactDetails - - self.documents = documents - - self.name = name - - self.franchiseEnabled = franchiseEnabled - - self.companyType = companyType - - self.notificationEmails = notificationEmails - - self.businessDetails = businessDetails - - self.addresses = addresses - - self.warnings = warnings - - self.rejectReason = rejectReason - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - businessInfo = try container.decode(String.self, forKey: .businessInfo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - businessType = try container.decode(String.self, forKey: .businessType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contactDetails = try container.decode(ContactDetails.self, forKey: .contactDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - documents = try container.decode([Document].self, forKey: .documents) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - franchiseEnabled = try container.decode(Bool.self, forKey: .franchiseEnabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyType = try container.decode(String.self, forKey: .companyType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - notificationEmails = try container.decode([String].self, forKey: .notificationEmails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - businessDetails = try container.decode(BusinessDetails.self, forKey: .businessDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addresses = try container.decode([CreateUpdateAddressSerializer].self, forKey: .addresses) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - warnings = try container.decode([String: Any].self, forKey: .warnings) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rejectReason = try container.decode(String.self, forKey: .rejectReason) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(businessInfo, forKey: .businessInfo) - - - - try? container.encodeIfPresent(businessType, forKey: .businessType) - - - - try? container.encodeIfPresent(contactDetails, forKey: .contactDetails) - - - - try? container.encodeIfPresent(documents, forKey: .documents) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(franchiseEnabled, forKey: .franchiseEnabled) - - - - try? container.encodeIfPresent(companyType, forKey: .companyType) - - - - try? container.encodeIfPresent(notificationEmails, forKey: .notificationEmails) - - - - try? container.encodeIfPresent(businessDetails, forKey: .businessDetails) - - - - try? container.encodeIfPresent(addresses, forKey: .addresses) - - - - try? container.encodeIfPresent(warnings, forKey: .warnings) - - - - try? container.encodeIfPresent(rejectReason, forKey: .rejectReason) - - - } - - } - - /* - Model: DocumentsObj - Used By: CompanyProfile - */ - - class DocumentsObj: Codable { - - - public var pending: Int? - - public var verified: Int? - - - public enum CodingKeys: String, CodingKey { - - case pending = "pending" - - case verified = "verified" - - } - - public init(pending: Int?, verified: Int?) { - - self.pending = pending - - self.verified = verified - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pending = try container.decode(Int.self, forKey: .pending) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verified = try container.decode(Int.self, forKey: .verified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pending, forKey: .pending) - - - - try? container.encodeIfPresent(verified, forKey: .verified) - - - } - - } - - /* - Model: MetricsSerializer - Used By: CompanyProfile - */ - - class MetricsSerializer: Codable { - - - public var stage: String? - - public var product: DocumentsObj? - - public var brand: DocumentsObj? - - public var companyDocuments: DocumentsObj? - - public var uid: Int? - - public var store: DocumentsObj? - - public var storeDocuments: DocumentsObj? - - - public enum CodingKeys: String, CodingKey { - - case stage = "stage" - - case product = "product" - - case brand = "brand" - - case companyDocuments = "company_documents" - - case uid = "uid" - - case store = "store" - - case storeDocuments = "store_documents" - - } - - public init(brand: DocumentsObj?, companyDocuments: DocumentsObj?, product: DocumentsObj?, stage: String?, store: DocumentsObj?, storeDocuments: DocumentsObj?, uid: Int?) { - - self.stage = stage - - self.product = product - - self.brand = brand - - self.companyDocuments = companyDocuments - - self.uid = uid - - self.store = store - - self.storeDocuments = storeDocuments - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - stage = try container.decode(String.self, forKey: .stage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - product = try container.decode(DocumentsObj.self, forKey: .product) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brand = try container.decode(DocumentsObj.self, forKey: .brand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyDocuments = try container.decode(DocumentsObj.self, forKey: .companyDocuments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - store = try container.decode(DocumentsObj.self, forKey: .store) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeDocuments = try container.decode(DocumentsObj.self, forKey: .storeDocuments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(stage, forKey: .stage) - - - - try? container.encodeIfPresent(product, forKey: .product) - - - - try? container.encodeIfPresent(brand, forKey: .brand) - - - - try? container.encodeIfPresent(companyDocuments, forKey: .companyDocuments) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(store, forKey: .store) - - - - try? container.encodeIfPresent(storeDocuments, forKey: .storeDocuments) - - - } - - } - - /* - Model: BrandBannerSerializer - Used By: CompanyProfile - */ - - class BrandBannerSerializer: Codable { - - - public var landscape: String? - - public var portrait: String? - - - public enum CodingKeys: String, CodingKey { - - case landscape = "landscape" - - case portrait = "portrait" - - } - - public init(landscape: String?, portrait: String?) { - - self.landscape = landscape - - self.portrait = portrait - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - landscape = try container.decode(String.self, forKey: .landscape) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - portrait = try container.decode(String.self, forKey: .portrait) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(landscape, forKey: .landscape) - - - - try? container.encodeIfPresent(portrait, forKey: .portrait) - - - } - - } - - /* - Model: UserSerializer1 - Used By: CompanyProfile - */ - - class UserSerializer1: Codable { - - - public var contact: String? - - public var userId: String? - - public var username: String? - - - public enum CodingKeys: String, CodingKey { - - case contact = "contact" - - case userId = "user_id" - - case username = "username" - - } - - public init(contact: String?, username: String?, userId: String?) { - - self.contact = contact - - self.userId = userId - - self.username = username - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - contact = try container.decode(String.self, forKey: .contact) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - username = try container.decode(String.self, forKey: .username) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(contact, forKey: .contact) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - - try? container.encodeIfPresent(username, forKey: .username) - - - } - - } - - /* - Model: GetBrandResponseSerializer - Used By: CompanyProfile - */ - - class GetBrandResponseSerializer: Codable { - - - public var modifiedOn: String? - - public var createdOn: String? - - public var banner: BrandBannerSerializer? - - public var stage: String? - - public var name: String - - public var createdBy: UserSerializer1? - - public var uid: Int? - - public var localeLanguage: [String: Any]? - - public var customJson: [String: Any]? - - public var logo: String? - - public var description: String? - - public var synonyms: [String]? - - public var verifiedBy: UserSerializer1? - - public var warnings: [String: Any]? - - public var verifiedOn: String? - - public var modifiedBy: UserSerializer1? - - public var slugKey: String? - - public var rejectReason: String? - - - public enum CodingKeys: String, CodingKey { - - case modifiedOn = "modified_on" - - case createdOn = "created_on" - - case banner = "banner" - - case stage = "stage" - - case name = "name" - - case createdBy = "created_by" - - case uid = "uid" - - case localeLanguage = "_locale_language" - - case customJson = "_custom_json" - - case logo = "logo" - - case description = "description" - - case synonyms = "synonyms" - - case verifiedBy = "verified_by" - - case warnings = "warnings" - - case verifiedOn = "verified_on" - - case modifiedBy = "modified_by" - - case slugKey = "slug_key" - - case rejectReason = "reject_reason" - - } - - public init(banner: BrandBannerSerializer?, createdBy: UserSerializer1?, createdOn: String?, description: String?, logo: String?, modifiedBy: UserSerializer1?, modifiedOn: String?, name: String, rejectReason: String?, slugKey: String?, stage: String?, synonyms: [String]?, uid: Int?, verifiedBy: UserSerializer1?, verifiedOn: String?, warnings: [String: Any]?, customJson: [String: Any]?, localeLanguage: [String: Any]?) { - - self.modifiedOn = modifiedOn - - self.createdOn = createdOn - - self.banner = banner - - self.stage = stage - - self.name = name - - self.createdBy = createdBy - - self.uid = uid - - self.localeLanguage = localeLanguage - - self.customJson = customJson - - self.logo = logo - - self.description = description - - self.synonyms = synonyms - - self.verifiedBy = verifiedBy - - self.warnings = warnings - - self.verifiedOn = verifiedOn - - self.modifiedBy = modifiedBy - - self.slugKey = slugKey - - self.rejectReason = rejectReason - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - banner = try container.decode(BrandBannerSerializer.self, forKey: .banner) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stage = try container.decode(String.self, forKey: .stage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - - do { - createdBy = try container.decode(UserSerializer1.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - localeLanguage = try container.decode([String: Any].self, forKey: .localeLanguage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(String.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - synonyms = try container.decode([String].self, forKey: .synonyms) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifiedBy = try container.decode(UserSerializer1.self, forKey: .verifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - warnings = try container.decode([String: Any].self, forKey: .warnings) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifiedOn = try container.decode(String.self, forKey: .verifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode(UserSerializer1.self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slugKey = try container.decode(String.self, forKey: .slugKey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rejectReason = try container.decode(String.self, forKey: .rejectReason) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(banner, forKey: .banner) - - - - try? container.encodeIfPresent(stage, forKey: .stage) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(localeLanguage, forKey: .localeLanguage) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(synonyms, forKey: .synonyms) - - - - try? container.encodeIfPresent(verifiedBy, forKey: .verifiedBy) - - - - try? container.encodeIfPresent(warnings, forKey: .warnings) - - - - try? container.encodeIfPresent(verifiedOn, forKey: .verifiedOn) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(slugKey, forKey: .slugKey) - - - - try? container.encodeIfPresent(rejectReason, forKey: .rejectReason) - - - } - - } - - /* - Model: CreateUpdateBrandRequestSerializer - Used By: CompanyProfile - */ - - class CreateUpdateBrandRequestSerializer: Codable { - - - public var banner: BrandBannerSerializer? - - public var name: String - - public var brandTier: String? - - public var localeLanguage: [String: Any]? - - public var companyId: Int? - - public var customJson: [String: Any]? - - public var logo: String - - public var description: String? - - public var uid: Int? - - public var synonyms: [String]? - - - public enum CodingKeys: String, CodingKey { - - case banner = "banner" - - case name = "name" - - case brandTier = "brand_tier" - - case localeLanguage = "_locale_language" - - case companyId = "company_id" - - case customJson = "_custom_json" - - case logo = "logo" - - case description = "description" - - case uid = "uid" - - case synonyms = "synonyms" - - } - - public init(banner: BrandBannerSerializer?, brandTier: String?, companyId: Int?, description: String?, logo: String, name: String, synonyms: [String]?, uid: Int?, customJson: [String: Any]?, localeLanguage: [String: Any]?) { - - self.banner = banner - - self.name = name - - self.brandTier = brandTier - - self.localeLanguage = localeLanguage - - self.companyId = companyId - - self.customJson = customJson - - self.logo = logo - - self.description = description - - self.uid = uid - - self.synonyms = synonyms - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - banner = try container.decode(BrandBannerSerializer.self, forKey: .banner) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - - do { - brandTier = try container.decode(String.self, forKey: .brandTier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - localeLanguage = try container.decode([String: Any].self, forKey: .localeLanguage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - logo = try container.decode(String.self, forKey: .logo) - - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - synonyms = try container.decode([String].self, forKey: .synonyms) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(banner, forKey: .banner) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(brandTier, forKey: .brandTier) - - - - try? container.encodeIfPresent(localeLanguage, forKey: .localeLanguage) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(synonyms, forKey: .synonyms) - - - } - - } - - /* - Model: GetCompanySerializer - Used By: CompanyProfile - */ - - class GetCompanySerializer: Codable { - - - public var modifiedOn: String? - - public var createdOn: String? - - public var businessType: String? - - public var stage: String? - - public var addresses: [GetAddressSerializer]? - - public var name: String? - - public var createdBy: UserSerializer? - - public var uid: Int? - - public var companyType: String? - - public var verifiedBy: UserSerializer? - - public var verifiedOn: String? - - public var modifiedBy: UserSerializer? - - public var rejectReason: String? - - - public enum CodingKeys: String, CodingKey { - - case modifiedOn = "modified_on" - - case createdOn = "created_on" - - case businessType = "business_type" - - case stage = "stage" - - case addresses = "addresses" - - case name = "name" - - case createdBy = "created_by" - - case uid = "uid" - - case companyType = "company_type" - - case verifiedBy = "verified_by" - - case verifiedOn = "verified_on" - - case modifiedBy = "modified_by" - - case rejectReason = "reject_reason" - - } - - public init(addresses: [GetAddressSerializer]?, businessType: String?, companyType: String?, createdBy: UserSerializer?, createdOn: String?, modifiedBy: UserSerializer?, modifiedOn: String?, name: String?, rejectReason: String?, stage: String?, uid: Int?, verifiedBy: UserSerializer?, verifiedOn: String?) { - - self.modifiedOn = modifiedOn - - self.createdOn = createdOn - - self.businessType = businessType - - self.stage = stage - - self.addresses = addresses - - self.name = name - - self.createdBy = createdBy - - self.uid = uid - - self.companyType = companyType - - self.verifiedBy = verifiedBy - - self.verifiedOn = verifiedOn - - self.modifiedBy = modifiedBy - - self.rejectReason = rejectReason - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - businessType = try container.decode(String.self, forKey: .businessType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stage = try container.decode(String.self, forKey: .stage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addresses = try container.decode([GetAddressSerializer].self, forKey: .addresses) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(UserSerializer.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyType = try container.decode(String.self, forKey: .companyType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifiedBy = try container.decode(UserSerializer.self, forKey: .verifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifiedOn = try container.decode(String.self, forKey: .verifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode(UserSerializer.self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rejectReason = try container.decode(String.self, forKey: .rejectReason) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(businessType, forKey: .businessType) - - - - try? container.encodeIfPresent(stage, forKey: .stage) - - - - try? container.encodeIfPresent(addresses, forKey: .addresses) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(companyType, forKey: .companyType) - - - - try? container.encodeIfPresent(verifiedBy, forKey: .verifiedBy) - - - - try? container.encodeIfPresent(verifiedOn, forKey: .verifiedOn) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(rejectReason, forKey: .rejectReason) - - - } - - } - - /* - Model: CompanyBrandSerializer - Used By: CompanyProfile - */ - - class CompanyBrandSerializer: Codable { - - - public var modifiedOn: String? - - public var createdOn: String? - - public var stage: String? - - public var createdBy: UserSerializer1? - - public var uid: Int? - - public var brand: GetBrandResponseSerializer? - - public var verifiedBy: UserSerializer1? - - public var warnings: [String: Any]? - - public var verifiedOn: String? - - public var company: GetCompanySerializer? - - public var modifiedBy: UserSerializer1? - - public var rejectReason: String? - - - public enum CodingKeys: String, CodingKey { - - case modifiedOn = "modified_on" - - case createdOn = "created_on" - - case stage = "stage" - - case createdBy = "created_by" - - case uid = "uid" - - case brand = "brand" - - case verifiedBy = "verified_by" - - case warnings = "warnings" - - case verifiedOn = "verified_on" - - case company = "company" - - case modifiedBy = "modified_by" - - case rejectReason = "reject_reason" - - } - - public init(brand: GetBrandResponseSerializer?, company: GetCompanySerializer?, createdBy: UserSerializer1?, createdOn: String?, modifiedBy: UserSerializer1?, modifiedOn: String?, rejectReason: String?, stage: String?, uid: Int?, verifiedBy: UserSerializer1?, verifiedOn: String?, warnings: [String: Any]?) { - - self.modifiedOn = modifiedOn - - self.createdOn = createdOn - - self.stage = stage - - self.createdBy = createdBy - - self.uid = uid - - self.brand = brand - - self.verifiedBy = verifiedBy - - self.warnings = warnings - - self.verifiedOn = verifiedOn - - self.company = company - - self.modifiedBy = modifiedBy - - self.rejectReason = rejectReason - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stage = try container.decode(String.self, forKey: .stage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(UserSerializer1.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brand = try container.decode(GetBrandResponseSerializer.self, forKey: .brand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifiedBy = try container.decode(UserSerializer1.self, forKey: .verifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - warnings = try container.decode([String: Any].self, forKey: .warnings) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifiedOn = try container.decode(String.self, forKey: .verifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - company = try container.decode(GetCompanySerializer.self, forKey: .company) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode(UserSerializer1.self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rejectReason = try container.decode(String.self, forKey: .rejectReason) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(stage, forKey: .stage) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(brand, forKey: .brand) - - - - try? container.encodeIfPresent(verifiedBy, forKey: .verifiedBy) - - - - try? container.encodeIfPresent(warnings, forKey: .warnings) - - - - try? container.encodeIfPresent(verifiedOn, forKey: .verifiedOn) - - - - try? container.encodeIfPresent(company, forKey: .company) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(rejectReason, forKey: .rejectReason) - - - } - - } - - /* - Model: CompanyBrandListSerializer - Used By: CompanyProfile - */ - - class CompanyBrandListSerializer: Codable { - - - public var page: Page? - - public var items: [CompanyBrandSerializer]? - - - public enum CodingKeys: String, CodingKey { - - case page = "page" - - case items = "items" - - } - - public init(items: [CompanyBrandSerializer]?, page: Page?) { - - self.page = page - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([CompanyBrandSerializer].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: CompanyBrandPostRequestSerializer - Used By: CompanyProfile - */ - - class CompanyBrandPostRequestSerializer: Codable { - - - public var brands: [Int] - - public var company: Int - - public var uid: Int? - - - public enum CodingKeys: String, CodingKey { - - case brands = "brands" - - case company = "company" - - case uid = "uid" - - } - - public init(brands: [Int], company: Int, uid: Int?) { - - self.brands = brands - - self.company = company - - self.uid = uid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - brands = try container.decode([Int].self, forKey: .brands) - - - - - company = try container.decode(Int.self, forKey: .company) - - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(brands, forKey: .brands) - - - - try? container.encodeIfPresent(company, forKey: .company) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - } - - } - - /* - Model: LocationIntegrationType - Used By: CompanyProfile - */ - - class LocationIntegrationType: Codable { - - - public var inventory: String? - - public var order: String? - - - public enum CodingKeys: String, CodingKey { - - case inventory = "inventory" - - case order = "order" - - } - - public init(inventory: String?, order: String?) { - - self.inventory = inventory - - self.order = order - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - inventory = try container.decode(String.self, forKey: .inventory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - order = try container.decode(String.self, forKey: .order) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(inventory, forKey: .inventory) - - - - try? container.encodeIfPresent(order, forKey: .order) - - - } - - } - - /* - Model: LocationManagerSerializer - Used By: CompanyProfile - */ - - class LocationManagerSerializer: Codable { - - - public var mobileNo: SellerPhoneNumber - - public var email: String? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case mobileNo = "mobile_no" - - case email = "email" - - case name = "name" - - } - - public init(email: String?, mobileNo: SellerPhoneNumber, name: String?) { - - self.mobileNo = mobileNo - - self.email = email - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - mobileNo = try container.decode(SellerPhoneNumber.self, forKey: .mobileNo) - - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(mobileNo, forKey: .mobileNo) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: InvoiceCredSerializer - Used By: CompanyProfile - */ - - class InvoiceCredSerializer: Codable { - - - public var password: String? - - public var enabled: Bool? - - public var username: String? - - - public enum CodingKeys: String, CodingKey { - - case password = "password" - - case enabled = "enabled" - - case username = "username" - - } - - public init(enabled: Bool?, password: String?, username: String?) { - - self.password = password - - self.enabled = enabled - - self.username = username - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - password = try container.decode(String.self, forKey: .password) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - username = try container.decode(String.self, forKey: .username) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(password, forKey: .password) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(username, forKey: .username) - - - } - - } - - /* - Model: InvoiceDetailsSerializer - Used By: CompanyProfile - */ - - class InvoiceDetailsSerializer: Codable { - - - public var eWaybill: InvoiceCredSerializer? - - public var eInvoice: InvoiceCredSerializer? - - - public enum CodingKeys: String, CodingKey { - - case eWaybill = "e_waybill" - - case eInvoice = "e_invoice" - - } - - public init(eInvoice: InvoiceCredSerializer?, eWaybill: InvoiceCredSerializer?) { - - self.eWaybill = eWaybill - - self.eInvoice = eInvoice - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - eWaybill = try container.decode(InvoiceCredSerializer.self, forKey: .eWaybill) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - eInvoice = try container.decode(InvoiceCredSerializer.self, forKey: .eInvoice) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(eWaybill, forKey: .eWaybill) - - - - try? container.encodeIfPresent(eInvoice, forKey: .eInvoice) - - - } - - } - - /* - Model: ProductReturnConfigSerializer - Used By: CompanyProfile - */ - - class ProductReturnConfigSerializer: Codable { - - - public var storeUid: Int? - - public var onSameStore: Bool? - - - public enum CodingKeys: String, CodingKey { - - case storeUid = "store_uid" - - case onSameStore = "on_same_store" - - } - - public init(onSameStore: Bool?, storeUid: Int?) { - - self.storeUid = storeUid - - self.onSameStore = onSameStore - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - storeUid = try container.decode(Int.self, forKey: .storeUid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - onSameStore = try container.decode(Bool.self, forKey: .onSameStore) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(storeUid, forKey: .storeUid) - - - - try? container.encodeIfPresent(onSameStore, forKey: .onSameStore) - - - } - - } - - /* - Model: LocationTimingSerializer - Used By: CompanyProfile - */ - - class LocationTimingSerializer: Codable { - - - public var minute: Int? - - public var hour: Int? - - - public enum CodingKeys: String, CodingKey { - - case minute = "minute" - - case hour = "hour" - - } - - public init(hour: Int?, minute: Int?) { - - self.minute = minute - - self.hour = hour - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - minute = try container.decode(Int.self, forKey: .minute) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hour = try container.decode(Int.self, forKey: .hour) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(minute, forKey: .minute) - - - - try? container.encodeIfPresent(hour, forKey: .hour) - - - } - - } - - /* - Model: LocationDayWiseSerializer - Used By: CompanyProfile - */ - - class LocationDayWiseSerializer: Codable { - - - public var open: Bool - - public var closing: LocationTimingSerializer? - - public var opening: LocationTimingSerializer? - - public var weekday: String - - - public enum CodingKeys: String, CodingKey { - - case open = "open" - - case closing = "closing" - - case opening = "opening" - - case weekday = "weekday" - - } - - public init(closing: LocationTimingSerializer?, open: Bool, opening: LocationTimingSerializer?, weekday: String) { - - self.open = open - - self.closing = closing - - self.opening = opening - - self.weekday = weekday - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - open = try container.decode(Bool.self, forKey: .open) - - - - - do { - closing = try container.decode(LocationTimingSerializer.self, forKey: .closing) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - opening = try container.decode(LocationTimingSerializer.self, forKey: .opening) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - weekday = try container.decode(String.self, forKey: .weekday) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(open, forKey: .open) - - - - try? container.encodeIfPresent(closing, forKey: .closing) - - - - try? container.encodeIfPresent(opening, forKey: .opening) - - - - try? container.encodeIfPresent(weekday, forKey: .weekday) - - - } - - } - - /* - Model: GetLocationSerializer - Used By: CompanyProfile - */ - - class GetLocationSerializer: Codable { - - - public var modifiedOn: String? - - public var createdOn: String? - - public var name: String - - public var verifiedBy: UserSerializer1? - - public var address: GetAddressSerializer - - public var displayName: String - - public var contactNumbers: [SellerPhoneNumber]? - - public var createdBy: UserSerializer1? - - public var uid: Int? - - public var warnings: [String: Any]? - - public var verifiedOn: String? - - public var modifiedBy: UserSerializer1? - - public var code: String - - public var integrationType: LocationIntegrationType? - - public var customJson: [String: Any]? - - public var manager: LocationManagerSerializer? - - public var gstCredentials: InvoiceDetailsSerializer? - - public var storeType: String? - - public var documents: [Document]? - - public var productReturnConfig: ProductReturnConfigSerializer? - - public var phoneNumber: String - - public var notificationEmails: [String]? - - public var company: GetCompanySerializer? - - public var stage: String? - - public var timing: [LocationDayWiseSerializer]? - - - public enum CodingKeys: String, CodingKey { - - case modifiedOn = "modified_on" - - case createdOn = "created_on" - - case name = "name" - - case verifiedBy = "verified_by" - - case address = "address" - - case displayName = "display_name" - - case contactNumbers = "contact_numbers" - - case createdBy = "created_by" - - case uid = "uid" - - case warnings = "warnings" - - case verifiedOn = "verified_on" - - case modifiedBy = "modified_by" - - case code = "code" - - case integrationType = "integration_type" - - case customJson = "_custom_json" - - case manager = "manager" - - case gstCredentials = "gst_credentials" - - case storeType = "store_type" - - case documents = "documents" - - case productReturnConfig = "product_return_config" - - case phoneNumber = "phone_number" - - case notificationEmails = "notification_emails" - - case company = "company" - - case stage = "stage" - - case timing = "timing" - - } - - public init(address: GetAddressSerializer, code: String, company: GetCompanySerializer?, contactNumbers: [SellerPhoneNumber]?, createdBy: UserSerializer1?, createdOn: String?, displayName: String, documents: [Document]?, gstCredentials: InvoiceDetailsSerializer?, integrationType: LocationIntegrationType?, manager: LocationManagerSerializer?, modifiedBy: UserSerializer1?, modifiedOn: String?, name: String, notificationEmails: [String]?, phoneNumber: String, productReturnConfig: ProductReturnConfigSerializer?, stage: String?, storeType: String?, timing: [LocationDayWiseSerializer]?, uid: Int?, verifiedBy: UserSerializer1?, verifiedOn: String?, warnings: [String: Any]?, customJson: [String: Any]?) { - - self.modifiedOn = modifiedOn - - self.createdOn = createdOn - - self.name = name - - self.verifiedBy = verifiedBy - - self.address = address - - self.displayName = displayName - - self.contactNumbers = contactNumbers - - self.createdBy = createdBy - - self.uid = uid - - self.warnings = warnings - - self.verifiedOn = verifiedOn - - self.modifiedBy = modifiedBy - - self.code = code - - self.integrationType = integrationType - - self.customJson = customJson - - self.manager = manager - - self.gstCredentials = gstCredentials - - self.storeType = storeType - - self.documents = documents - - self.productReturnConfig = productReturnConfig - - self.phoneNumber = phoneNumber - - self.notificationEmails = notificationEmails - - self.company = company - - self.stage = stage - - self.timing = timing - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - - do { - verifiedBy = try container.decode(UserSerializer1.self, forKey: .verifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - address = try container.decode(GetAddressSerializer.self, forKey: .address) - - - - - displayName = try container.decode(String.self, forKey: .displayName) - - - - - do { - contactNumbers = try container.decode([SellerPhoneNumber].self, forKey: .contactNumbers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(UserSerializer1.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - warnings = try container.decode([String: Any].self, forKey: .warnings) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verifiedOn = try container.decode(String.self, forKey: .verifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode(UserSerializer1.self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - code = try container.decode(String.self, forKey: .code) - - - - - do { - integrationType = try container.decode(LocationIntegrationType.self, forKey: .integrationType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - manager = try container.decode(LocationManagerSerializer.self, forKey: .manager) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstCredentials = try container.decode(InvoiceDetailsSerializer.self, forKey: .gstCredentials) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeType = try container.decode(String.self, forKey: .storeType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - documents = try container.decode([Document].self, forKey: .documents) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productReturnConfig = try container.decode(ProductReturnConfigSerializer.self, forKey: .productReturnConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - phoneNumber = try container.decode(String.self, forKey: .phoneNumber) - - - - - do { - notificationEmails = try container.decode([String].self, forKey: .notificationEmails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - company = try container.decode(GetCompanySerializer.self, forKey: .company) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stage = try container.decode(String.self, forKey: .stage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - timing = try container.decode([LocationDayWiseSerializer].self, forKey: .timing) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(verifiedBy, forKey: .verifiedBy) - - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(contactNumbers, forKey: .contactNumbers) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(warnings, forKey: .warnings) - - - - try? container.encodeIfPresent(verifiedOn, forKey: .verifiedOn) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(integrationType, forKey: .integrationType) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(manager, forKey: .manager) - - - - try? container.encodeIfPresent(gstCredentials, forKey: .gstCredentials) - - - - try? container.encodeIfPresent(storeType, forKey: .storeType) - - - - try? container.encodeIfPresent(documents, forKey: .documents) - - - - try? container.encodeIfPresent(productReturnConfig, forKey: .productReturnConfig) - - - - try? container.encodeIfPresent(phoneNumber, forKey: .phoneNumber) - - - - try? container.encodeIfPresent(notificationEmails, forKey: .notificationEmails) - - - - try? container.encodeIfPresent(company, forKey: .company) - - - - try? container.encodeIfPresent(stage, forKey: .stage) - - - - try? container.encodeIfPresent(timing, forKey: .timing) - - - } - - } - - /* - Model: LocationListSerializer - Used By: CompanyProfile - */ - - class LocationListSerializer: Codable { - - - public var page: Page? - - public var items: [GetLocationSerializer]? - - - public enum CodingKeys: String, CodingKey { - - case page = "page" - - case items = "items" - - } - - public init(items: [GetLocationSerializer]?, page: Page?) { - - self.page = page - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([GetLocationSerializer].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: GetAddressSerializer1 - Used By: CompanyProfile - */ - - class GetAddressSerializer1: Codable { - - - public var countryCode: String? - - public var landmark: String? - - public var country: String? - - public var latitude: Double? - - public var longitude: Double? - - public var state: String? - - public var addressType: String? - - public var address1: String? - - public var city: String? - - public var pincode: Int? - - public var address2: String? - - - public enum CodingKeys: String, CodingKey { - - case countryCode = "country_code" - - case landmark = "landmark" - - case country = "country" - - case latitude = "latitude" - - case longitude = "longitude" - - case state = "state" - - case addressType = "address_type" - - case address1 = "address1" - - case city = "city" - - case pincode = "pincode" - - case address2 = "address2" - - } - - public init(address1: String?, address2: String?, addressType: String?, city: String?, country: String?, countryCode: String?, landmark: String?, latitude: Double?, longitude: Double?, pincode: Int?, state: String?) { - - self.countryCode = countryCode - - self.landmark = landmark - - self.country = country - - self.latitude = latitude - - self.longitude = longitude - - self.state = state - - self.addressType = addressType - - self.address1 = address1 - - self.city = city - - self.pincode = pincode - - self.address2 = address2 - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - landmark = try container.decode(String.self, forKey: .landmark) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - latitude = try container.decode(Double.self, forKey: .latitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - longitude = try container.decode(Double.self, forKey: .longitude) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(String.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressType = try container.decode(String.self, forKey: .addressType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address1 = try container.decode(String.self, forKey: .address1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(Int.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address2 = try container.decode(String.self, forKey: .address2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(landmark, forKey: .landmark) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(latitude, forKey: .latitude) - - - - try? container.encodeIfPresent(longitude, forKey: .longitude) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(addressType, forKey: .addressType) - - - - try? container.encodeIfPresent(address1, forKey: .address1) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(address2, forKey: .address2) - - - } - - } - - /* - Model: LocationSerializer - Used By: CompanyProfile - */ - - class LocationSerializer: Codable { - - - public var contactNumbers: [SellerPhoneNumber]? - - public var documents: [Document]? - - public var productReturnConfig: ProductReturnConfigSerializer? - - public var name: String - - public var code: String - - public var address: GetAddressSerializer1 - - public var storeType: String? - - public var customJson: [String: Any]? - - public var manager: LocationManagerSerializer? - - public var notificationEmails: [String]? - - public var uid: Int? - - public var warnings: [String: Any]? - - public var gstCredentials: InvoiceDetailsSerializer? - - public var company: Int - - public var stage: String? - - public var displayName: String - - public var timing: [LocationDayWiseSerializer]? - - - public enum CodingKeys: String, CodingKey { - - case contactNumbers = "contact_numbers" - - case documents = "documents" - - case productReturnConfig = "product_return_config" - - case name = "name" - - case code = "code" - - case address = "address" - - case storeType = "store_type" - - case customJson = "_custom_json" - - case manager = "manager" - - case notificationEmails = "notification_emails" - - case uid = "uid" - - case warnings = "warnings" - - case gstCredentials = "gst_credentials" - - case company = "company" - - case stage = "stage" - - case displayName = "display_name" - - case timing = "timing" - - } - - public init(address: GetAddressSerializer1, code: String, company: Int, contactNumbers: [SellerPhoneNumber]?, displayName: String, documents: [Document]?, gstCredentials: InvoiceDetailsSerializer?, manager: LocationManagerSerializer?, name: String, notificationEmails: [String]?, productReturnConfig: ProductReturnConfigSerializer?, stage: String?, storeType: String?, timing: [LocationDayWiseSerializer]?, uid: Int?, warnings: [String: Any]?, customJson: [String: Any]?) { - - self.contactNumbers = contactNumbers - - self.documents = documents - - self.productReturnConfig = productReturnConfig - - self.name = name - - self.code = code - - self.address = address - - self.storeType = storeType - - self.customJson = customJson - - self.manager = manager - - self.notificationEmails = notificationEmails - - self.uid = uid - - self.warnings = warnings - - self.gstCredentials = gstCredentials - - self.company = company - - self.stage = stage - - self.displayName = displayName - - self.timing = timing - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - contactNumbers = try container.decode([SellerPhoneNumber].self, forKey: .contactNumbers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - documents = try container.decode([Document].self, forKey: .documents) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - productReturnConfig = try container.decode(ProductReturnConfigSerializer.self, forKey: .productReturnConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - name = try container.decode(String.self, forKey: .name) - - - - - code = try container.decode(String.self, forKey: .code) - - - - - address = try container.decode(GetAddressSerializer1.self, forKey: .address) - - - - - do { - storeType = try container.decode(String.self, forKey: .storeType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - customJson = try container.decode([String: Any].self, forKey: .customJson) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - manager = try container.decode(LocationManagerSerializer.self, forKey: .manager) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - notificationEmails = try container.decode([String].self, forKey: .notificationEmails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - warnings = try container.decode([String: Any].self, forKey: .warnings) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstCredentials = try container.decode(InvoiceDetailsSerializer.self, forKey: .gstCredentials) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - company = try container.decode(Int.self, forKey: .company) - - - - - do { - stage = try container.decode(String.self, forKey: .stage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - displayName = try container.decode(String.self, forKey: .displayName) - - - - - do { - timing = try container.decode([LocationDayWiseSerializer].self, forKey: .timing) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(contactNumbers, forKey: .contactNumbers) - - - - try? container.encodeIfPresent(documents, forKey: .documents) - - - - try? container.encodeIfPresent(productReturnConfig, forKey: .productReturnConfig) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(storeType, forKey: .storeType) - - - - try? container.encodeIfPresent(customJson, forKey: .customJson) - - - - try? container.encodeIfPresent(manager, forKey: .manager) - - - - try? container.encodeIfPresent(notificationEmails, forKey: .notificationEmails) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(warnings, forKey: .warnings) - - - - try? container.encodeIfPresent(gstCredentials, forKey: .gstCredentials) - - - - try? container.encodeIfPresent(company, forKey: .company) - - - - try? container.encodeIfPresent(stage, forKey: .stage) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(timing, forKey: .timing) - - - } - - } - - /* - Model: BulkLocationSerializer - Used By: CompanyProfile - */ - - class BulkLocationSerializer: Codable { - - - public var data: [LocationSerializer]? - - - public enum CodingKeys: String, CodingKey { - - case data = "data" - - } - - public init(data: [LocationSerializer]?) { - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - data = try container.decode([LocationSerializer].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - - - /* - Model: FailedResponse - Used By: FileStorage - */ - - class FailedResponse: Codable { - - - public var message: String - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - message = try container.decode(String.self, forKey: .message) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: CDN - Used By: FileStorage - */ - - class CDN: Codable { - - - public var url: String - - - public enum CodingKeys: String, CodingKey { - - case url = "url" - - } - - public init(url: String) { - - self.url = url - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - url = try container.decode(String.self, forKey: .url) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(url, forKey: .url) - - - } - - } - - /* - Model: Upload - Used By: FileStorage - */ - - class Upload: Codable { - - - public var expiry: Int - - public var url: String - - - public enum CodingKeys: String, CodingKey { - - case expiry = "expiry" - - case url = "url" - - } - - public init(expiry: Int, url: String) { - - self.expiry = expiry - - self.url = url - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - expiry = try container.decode(Int.self, forKey: .expiry) - - - - - url = try container.decode(String.self, forKey: .url) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(expiry, forKey: .expiry) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - } - - } - - /* - Model: StartResponse - Used By: FileStorage - */ - - class StartResponse: Codable { - - - public var fileName: String - - public var filePath: String - - public var contentType: String - - public var method: String - - public var namespace: String - - public var operation: String - - public var size: Int - - public var upload: Upload - - public var cdn: CDN - - public var tags: [String]? - - - public enum CodingKeys: String, CodingKey { - - case fileName = "file_name" - - case filePath = "file_path" - - case contentType = "content_type" - - case method = "method" - - case namespace = "namespace" - - case operation = "operation" - - case size = "size" - - case upload = "upload" - - case cdn = "cdn" - - case tags = "tags" - - } - - public init(cdn: CDN, contentType: String, fileName: String, filePath: String, method: String, namespace: String, operation: String, size: Int, tags: [String]?, upload: Upload) { - - self.fileName = fileName - - self.filePath = filePath - - self.contentType = contentType - - self.method = method - - self.namespace = namespace - - self.operation = operation - - self.size = size - - self.upload = upload - - self.cdn = cdn - - self.tags = tags - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - fileName = try container.decode(String.self, forKey: .fileName) - - - - - filePath = try container.decode(String.self, forKey: .filePath) - - - - - contentType = try container.decode(String.self, forKey: .contentType) - - - - - method = try container.decode(String.self, forKey: .method) - - - - - namespace = try container.decode(String.self, forKey: .namespace) - - - - - operation = try container.decode(String.self, forKey: .operation) - - - - - size = try container.decode(Int.self, forKey: .size) - - - - - upload = try container.decode(Upload.self, forKey: .upload) - - - - - cdn = try container.decode(CDN.self, forKey: .cdn) - - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(fileName, forKey: .fileName) - - - - try? container.encodeIfPresent(filePath, forKey: .filePath) - - - - try? container.encodeIfPresent(contentType, forKey: .contentType) - - - - try? container.encodeIfPresent(method, forKey: .method) - - - - try? container.encodeIfPresent(namespace, forKey: .namespace) - - - - try? container.encodeIfPresent(operation, forKey: .operation) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(upload, forKey: .upload) - - - - try? container.encodeIfPresent(cdn, forKey: .cdn) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - } - - } - - /* - Model: StartRequest - Used By: FileStorage - */ - - class StartRequest: Codable { - - - public var fileName: String - - public var contentType: String - - public var size: Int - - public var tags: [String]? - - public var params: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case fileName = "file_name" - - case contentType = "content_type" - - case size = "size" - - case tags = "tags" - - case params = "params" - - } - - public init(contentType: String, fileName: String, params: [String: Any]?, size: Int, tags: [String]?) { - - self.fileName = fileName - - self.contentType = contentType - - self.size = size - - self.tags = tags - - self.params = params - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - fileName = try container.decode(String.self, forKey: .fileName) - - - - - contentType = try container.decode(String.self, forKey: .contentType) - - - - - size = try container.decode(Int.self, forKey: .size) - - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - params = try container.decode([String: Any].self, forKey: .params) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(fileName, forKey: .fileName) - - - - try? container.encodeIfPresent(contentType, forKey: .contentType) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(params, forKey: .params) - - - } - - } - - /* - Model: CompleteResponse - Used By: FileStorage - */ - - class CompleteResponse: Codable { - - - public var id: String - - public var fileName: String - - public var filePath: String - - public var contentType: String - - public var method: String - - public var namespace: String - - public var operation: String - - public var size: Int - - public var upload: Upload - - public var cdn: CDN - - public var success: String - - public var tags: [String]? - - public var createdOn: String - - public var modifiedOn: String - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case fileName = "file_name" - - case filePath = "file_path" - - case contentType = "content_type" - - case method = "method" - - case namespace = "namespace" - - case operation = "operation" - - case size = "size" - - case upload = "upload" - - case cdn = "cdn" - - case success = "success" - - case tags = "tags" - - case createdOn = "created_on" - - case modifiedOn = "modified_on" - - } - - public init(cdn: CDN, contentType: String, createdOn: String, fileName: String, filePath: String, method: String, modifiedOn: String, namespace: String, operation: String, size: Int, success: String, tags: [String]?, upload: Upload, id: String) { - - self.id = id - - self.fileName = fileName - - self.filePath = filePath - - self.contentType = contentType - - self.method = method - - self.namespace = namespace - - self.operation = operation - - self.size = size - - self.upload = upload - - self.cdn = cdn - - self.success = success - - self.tags = tags - - self.createdOn = createdOn - - self.modifiedOn = modifiedOn - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - id = try container.decode(String.self, forKey: .id) - - - - - fileName = try container.decode(String.self, forKey: .fileName) - - - - - filePath = try container.decode(String.self, forKey: .filePath) - - - - - contentType = try container.decode(String.self, forKey: .contentType) - - - - - method = try container.decode(String.self, forKey: .method) - - - - - namespace = try container.decode(String.self, forKey: .namespace) - - - - - operation = try container.decode(String.self, forKey: .operation) - - - - - size = try container.decode(Int.self, forKey: .size) - - - - - upload = try container.decode(Upload.self, forKey: .upload) - - - - - cdn = try container.decode(CDN.self, forKey: .cdn) - - - - - success = try container.decode(String.self, forKey: .success) - - - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - createdOn = try container.decode(String.self, forKey: .createdOn) - - - - - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(fileName, forKey: .fileName) - - - - try? container.encodeIfPresent(filePath, forKey: .filePath) - - - - try? container.encodeIfPresent(contentType, forKey: .contentType) - - - - try? container.encodeIfPresent(method, forKey: .method) - - - - try? container.encodeIfPresent(namespace, forKey: .namespace) - - - - try? container.encodeIfPresent(operation, forKey: .operation) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(upload, forKey: .upload) - - - - try? container.encodeIfPresent(cdn, forKey: .cdn) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - } - - } - - /* - Model: Opts - Used By: FileStorage - */ - - class Opts: Codable { - - - public var attempts: Int? - - public var timestamp: Int? - - public var delay: Int? - - - public enum CodingKeys: String, CodingKey { - - case attempts = "attempts" - - case timestamp = "timestamp" - - case delay = "delay" - - } - - public init(attempts: Int?, delay: Int?, timestamp: Int?) { - - self.attempts = attempts - - self.timestamp = timestamp - - self.delay = delay - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - attempts = try container.decode(Int.self, forKey: .attempts) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - timestamp = try container.decode(Int.self, forKey: .timestamp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - delay = try container.decode(Int.self, forKey: .delay) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(attempts, forKey: .attempts) - - - - try? container.encodeIfPresent(timestamp, forKey: .timestamp) - - - - try? container.encodeIfPresent(delay, forKey: .delay) - - - } - - } - - /* - Model: CopyFileTask - Used By: FileStorage - */ - - class CopyFileTask: Codable { - - - public var id: String - - public var name: String - - public var data: BulkRequest - - public var opts: Opts - - public var progress: Int - - public var delay: Int - - public var timestamp: Int - - public var attemptsMade: Int - - public var stacktrace: [String]? - - public var finishedOn: Int - - public var processedOn: Int - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case name = "name" - - case data = "data" - - case opts = "opts" - - case progress = "progress" - - case delay = "delay" - - case timestamp = "timestamp" - - case attemptsMade = "attempts_made" - - case stacktrace = "stacktrace" - - case finishedOn = "finished_on" - - case processedOn = "processed_on" - - } - - public init(attemptsMade: Int, data: BulkRequest, delay: Int, finishedOn: Int, id: String, name: String, opts: Opts, processedOn: Int, progress: Int, stacktrace: [String]?, timestamp: Int) { - - self.id = id - - self.name = name - - self.data = data - - self.opts = opts - - self.progress = progress - - self.delay = delay - - self.timestamp = timestamp - - self.attemptsMade = attemptsMade - - self.stacktrace = stacktrace - - self.finishedOn = finishedOn - - self.processedOn = processedOn - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - id = try container.decode(String.self, forKey: .id) - - - - - name = try container.decode(String.self, forKey: .name) - - - - - data = try container.decode(BulkRequest.self, forKey: .data) - - - - - opts = try container.decode(Opts.self, forKey: .opts) - - - - - progress = try container.decode(Int.self, forKey: .progress) - - - - - delay = try container.decode(Int.self, forKey: .delay) - - - - - timestamp = try container.decode(Int.self, forKey: .timestamp) - - - - - attemptsMade = try container.decode(Int.self, forKey: .attemptsMade) - - - - - do { - stacktrace = try container.decode([String].self, forKey: .stacktrace) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - finishedOn = try container.decode(Int.self, forKey: .finishedOn) - - - - - processedOn = try container.decode(Int.self, forKey: .processedOn) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - - try? container.encodeIfPresent(opts, forKey: .opts) - - - - try? container.encodeIfPresent(progress, forKey: .progress) - - - - try? container.encodeIfPresent(delay, forKey: .delay) - - - - try? container.encodeIfPresent(timestamp, forKey: .timestamp) - - - - try? container.encodeIfPresent(attemptsMade, forKey: .attemptsMade) - - - - try? container.encodeIfPresent(stacktrace, forKey: .stacktrace) - - - - try? container.encodeIfPresent(finishedOn, forKey: .finishedOn) - - - - try? container.encodeIfPresent(processedOn, forKey: .processedOn) - - - } - - } - - /* - Model: BulkResponse - Used By: FileStorage - */ - - class BulkResponse: Codable { - - - public var trackingUrl: String - - public var task: CopyFileTask - - - public enum CodingKeys: String, CodingKey { - - case trackingUrl = "tracking_url" - - case task = "task" - - } - - public init(task: CopyFileTask, trackingUrl: String) { - - self.trackingUrl = trackingUrl - - self.task = task - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - trackingUrl = try container.decode(String.self, forKey: .trackingUrl) - - - - - task = try container.decode(CopyFileTask.self, forKey: .task) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(trackingUrl, forKey: .trackingUrl) - - - - try? container.encodeIfPresent(task, forKey: .task) - - - } - - } - - /* - Model: ReqConfiguration - Used By: FileStorage - */ - - class ReqConfiguration: Codable { - - - public var concurrency: Int? - - - public enum CodingKeys: String, CodingKey { - - case concurrency = "concurrency" - - } - - public init(concurrency: Int?) { - - self.concurrency = concurrency - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - concurrency = try container.decode(Int.self, forKey: .concurrency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(concurrency, forKey: .concurrency) - - - } - - } - - /* - Model: Destination - Used By: FileStorage - */ - - class Destination: Codable { - - - public var namespace: String - - public var rewrite: String - - public var basepath: String? - - - public enum CodingKeys: String, CodingKey { - - case namespace = "namespace" - - case rewrite = "rewrite" - - case basepath = "basepath" - - } - - public init(basepath: String?, namespace: String, rewrite: String) { - - self.namespace = namespace - - self.rewrite = rewrite - - self.basepath = basepath - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - namespace = try container.decode(String.self, forKey: .namespace) - - - - - rewrite = try container.decode(String.self, forKey: .rewrite) - - - - - do { - basepath = try container.decode(String.self, forKey: .basepath) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(namespace, forKey: .namespace) - - - - try? container.encodeIfPresent(rewrite, forKey: .rewrite) - - - - try? container.encodeIfPresent(basepath, forKey: .basepath) - - - } - - } - - /* - Model: BulkRequest - Used By: FileStorage - */ - - class BulkRequest: Codable { - - - public var urls: [String] - - public var destination: Destination - - public var configuration: ReqConfiguration? - - - public enum CodingKeys: String, CodingKey { - - case urls = "urls" - - case destination = "destination" - - case configuration = "configuration" - - } - - public init(configuration: ReqConfiguration?, destination: Destination, urls: [String]) { - - self.urls = urls - - self.destination = destination - - self.configuration = configuration - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - urls = try container.decode([String].self, forKey: .urls) - - - - - destination = try container.decode(Destination.self, forKey: .destination) - - - - - do { - configuration = try container.decode(ReqConfiguration.self, forKey: .configuration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(urls, forKey: .urls) - - - - try? container.encodeIfPresent(destination, forKey: .destination) - - - - try? container.encodeIfPresent(configuration, forKey: .configuration) - - - } - - } - - /* - Model: Urls - Used By: FileStorage - */ - - class Urls: Codable { - - - public var url: String - - public var signedUrl: String - - public var expiry: Int - - - public enum CodingKeys: String, CodingKey { - - case url = "url" - - case signedUrl = "signed_url" - - case expiry = "expiry" - - } - - public init(expiry: Int, signedUrl: String, url: String) { - - self.url = url - - self.signedUrl = signedUrl - - self.expiry = expiry - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - url = try container.decode(String.self, forKey: .url) - - - - - signedUrl = try container.decode(String.self, forKey: .signedUrl) - - - - - expiry = try container.decode(Int.self, forKey: .expiry) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(signedUrl, forKey: .signedUrl) - - - - try? container.encodeIfPresent(expiry, forKey: .expiry) - - - } - - } - - /* - Model: SignUrlResponse - Used By: FileStorage - */ - - class SignUrlResponse: Codable { - - - public var urls: [Urls] - - - public enum CodingKeys: String, CodingKey { - - case urls = "urls" - - } - - public init(urls: [Urls]) { - - self.urls = urls - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - urls = try container.decode([Urls].self, forKey: .urls) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(urls, forKey: .urls) - - - } - - } - - /* - Model: SignUrlRequest - Used By: FileStorage - */ - - class SignUrlRequest: Codable { - - - public var expiry: Int - - public var urls: [String] - - - public enum CodingKeys: String, CodingKey { - - case expiry = "expiry" - - case urls = "urls" - - } - - public init(expiry: Int, urls: [String]) { - - self.expiry = expiry - - self.urls = urls - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - expiry = try container.decode(Int.self, forKey: .expiry) - - - - - urls = try container.decode([String].self, forKey: .urls) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(expiry, forKey: .expiry) - - - - try? container.encodeIfPresent(urls, forKey: .urls) - - - } - - } - - /* - Model: DbRecord - Used By: FileStorage - */ - - class DbRecord: Codable { - - - public var success: Bool - - public var tags: [String] - - public var id: String - - public var fileName: String - - public var operation: String? - - public var namespace: String - - public var contentType: String - - public var filePath: String - - public var upload: Upload - - public var cdn: CDN - - public var createdOn: String - - public var modifiedOn: String - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - case tags = "tags" - - case id = "_id" - - case fileName = "file_name" - - case operation = "operation" - - case namespace = "namespace" - - case contentType = "content_type" - - case filePath = "file_path" - - case upload = "upload" - - case cdn = "cdn" - - case createdOn = "created_on" - - case modifiedOn = "modified_on" - - } - - public init(cdn: CDN, contentType: String, createdOn: String, fileName: String, filePath: String, modifiedOn: String, namespace: String, operation: String?, success: Bool, tags: [String], upload: Upload, id: String) { - - self.success = success - - self.tags = tags - - self.id = id - - self.fileName = fileName - - self.operation = operation - - self.namespace = namespace - - self.contentType = contentType - - self.filePath = filePath - - self.upload = upload - - self.cdn = cdn - - self.createdOn = createdOn - - self.modifiedOn = modifiedOn - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - - tags = try container.decode([String].self, forKey: .tags) - - - - - id = try container.decode(String.self, forKey: .id) - - - - - fileName = try container.decode(String.self, forKey: .fileName) - - - - - do { - operation = try container.decode(String.self, forKey: .operation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - namespace = try container.decode(String.self, forKey: .namespace) - - - - - contentType = try container.decode(String.self, forKey: .contentType) - - - - - filePath = try container.decode(String.self, forKey: .filePath) - - - - - upload = try container.decode(Upload.self, forKey: .upload) - - - - - cdn = try container.decode(CDN.self, forKey: .cdn) - - - - - createdOn = try container.decode(String.self, forKey: .createdOn) - - - - - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(fileName, forKey: .fileName) - - - - try? container.encodeIfPresent(operation, forKey: .operation) - - - - try? container.encodeIfPresent(namespace, forKey: .namespace) - - - - try? container.encodeIfPresent(contentType, forKey: .contentType) - - - - try? container.encodeIfPresent(filePath, forKey: .filePath) - - - - try? container.encodeIfPresent(upload, forKey: .upload) - - - - try? container.encodeIfPresent(cdn, forKey: .cdn) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - } - - } - - /* - Model: BrowseResponse - Used By: FileStorage - */ - - class BrowseResponse: Codable { - - - public var items: [DbRecord] - - public var page: Page - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [DbRecord], page: Page) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - items = try container.decode([DbRecord].self, forKey: .items) - - - - - page = try container.decode(Page.self, forKey: .page) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - - - /* - Model: RedirectDevice - Used By: Share - */ - - class RedirectDevice: Codable { - - - public var link: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case link = "link" - - case type = "type" - - } - - public init(link: String?, type: String?) { - - self.link = link - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(link, forKey: .link) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: WebRedirect - Used By: Share - */ - - class WebRedirect: Codable { - - - public var link: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case link = "link" - - case type = "type" - - } - - public init(link: String?, type: String?) { - - self.link = link - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(link, forKey: .link) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: Redirects - Used By: Share - */ - - class Redirects: Codable { - - - public var ios: RedirectDevice? - - public var android: RedirectDevice? - - public var web: WebRedirect? - - public var forceWeb: Bool? - - - public enum CodingKeys: String, CodingKey { - - case ios = "ios" - - case android = "android" - - case web = "web" - - case forceWeb = "force_web" - - } - - public init(android: RedirectDevice?, forceWeb: Bool?, ios: RedirectDevice?, web: WebRedirect?) { - - self.ios = ios - - self.android = android - - self.web = web - - self.forceWeb = forceWeb - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - ios = try container.decode(RedirectDevice.self, forKey: .ios) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - android = try container.decode(RedirectDevice.self, forKey: .android) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - web = try container.decode(WebRedirect.self, forKey: .web) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - forceWeb = try container.decode(Bool.self, forKey: .forceWeb) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(ios, forKey: .ios) - - - - try? container.encodeIfPresent(android, forKey: .android) - - - - try? container.encodeIfPresent(web, forKey: .web) - - - - try? container.encodeIfPresent(forceWeb, forKey: .forceWeb) - - - } - - } - - /* - Model: CampaignShortLink - Used By: Share - */ - - class CampaignShortLink: Codable { - - - public var source: String? - - public var medium: String? - - - public enum CodingKeys: String, CodingKey { - - case source = "source" - - case medium = "medium" - - } - - public init(medium: String?, source: String?) { - - self.source = source - - self.medium = medium - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - source = try container.decode(String.self, forKey: .source) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - medium = try container.decode(String.self, forKey: .medium) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(source, forKey: .source) - - - - try? container.encodeIfPresent(medium, forKey: .medium) - - - } - - } - - /* - Model: Attribution - Used By: Share - */ - - class Attribution: Codable { - - - public var campaignCookieExpiry: String? - - - public enum CodingKeys: String, CodingKey { - - case campaignCookieExpiry = "campaign_cookie_expiry" - - } - - public init(campaignCookieExpiry: String?) { - - self.campaignCookieExpiry = campaignCookieExpiry - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - campaignCookieExpiry = try container.decode(String.self, forKey: .campaignCookieExpiry) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(campaignCookieExpiry, forKey: .campaignCookieExpiry) - - - } - - } - - /* - Model: SocialMediaTags - Used By: Share - */ - - class SocialMediaTags: Codable { - - - public var title: String? - - public var description: String? - - public var image: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case description = "description" - - case image = "image" - - } - - public init(description: String?, image: String?, title: String?) { - - self.title = title - - self.description = description - - self.image = image - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - image = try container.decode(String.self, forKey: .image) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(image, forKey: .image) - - - } - - } - - /* - Model: ShortLinkReq - Used By: Share - */ - - class ShortLinkReq: Codable { - - - public var title: String - - public var url: String - - public var hash: String? - - public var active: Bool? - - public var expireAt: String? - - public var enableTracking: Bool? - - public var personalized: Bool? - - public var campaign: CampaignShortLink? - - public var redirects: Redirects? - - public var attribution: Attribution? - - public var socialMediaTags: SocialMediaTags? - - public var count: Int? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case url = "url" - - case hash = "hash" - - case active = "active" - - case expireAt = "expire_at" - - case enableTracking = "enable_tracking" - - case personalized = "personalized" - - case campaign = "campaign" - - case redirects = "redirects" - - case attribution = "attribution" - - case socialMediaTags = "social_media_tags" - - case count = "count" - - } - - public init(active: Bool?, attribution: Attribution?, campaign: CampaignShortLink?, count: Int?, enableTracking: Bool?, expireAt: String?, hash: String?, personalized: Bool?, redirects: Redirects?, socialMediaTags: SocialMediaTags?, title: String, url: String) { - - self.title = title - - self.url = url - - self.hash = hash - - self.active = active - - self.expireAt = expireAt - - self.enableTracking = enableTracking - - self.personalized = personalized - - self.campaign = campaign - - self.redirects = redirects - - self.attribution = attribution - - self.socialMediaTags = socialMediaTags - - self.count = count - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - title = try container.decode(String.self, forKey: .title) - - - - - url = try container.decode(String.self, forKey: .url) - - - - - do { - hash = try container.decode(String.self, forKey: .hash) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expireAt = try container.decode(String.self, forKey: .expireAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enableTracking = try container.decode(Bool.self, forKey: .enableTracking) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - personalized = try container.decode(Bool.self, forKey: .personalized) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - campaign = try container.decode(CampaignShortLink.self, forKey: .campaign) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - redirects = try container.decode(Redirects.self, forKey: .redirects) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attribution = try container.decode(Attribution.self, forKey: .attribution) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - socialMediaTags = try container.decode(SocialMediaTags.self, forKey: .socialMediaTags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(hash, forKey: .hash) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(expireAt, forKey: .expireAt) - - - - try? container.encodeIfPresent(enableTracking, forKey: .enableTracking) - - - - try? container.encodeIfPresent(personalized, forKey: .personalized) - - - - try? container.encodeIfPresent(campaign, forKey: .campaign) - - - - try? container.encodeIfPresent(redirects, forKey: .redirects) - - - - try? container.encodeIfPresent(attribution, forKey: .attribution) - - - - try? container.encodeIfPresent(socialMediaTags, forKey: .socialMediaTags) - - - - try? container.encodeIfPresent(count, forKey: .count) - - - } - - } - - /* - Model: UrlInfo - Used By: Share - */ - - class UrlInfo: Codable { - - - public var original: String? - - public var short: String? - - public var hash: String? - - - public enum CodingKeys: String, CodingKey { - - case original = "original" - - case short = "short" - - case hash = "hash" - - } - - public init(hash: String?, original: String?, short: String?) { - - self.original = original - - self.short = short - - self.hash = hash - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - original = try container.decode(String.self, forKey: .original) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - short = try container.decode(String.self, forKey: .short) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hash = try container.decode(String.self, forKey: .hash) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(original, forKey: .original) - - - - try? container.encodeIfPresent(short, forKey: .short) - - - - try? container.encodeIfPresent(hash, forKey: .hash) - - - } - - } - - /* - Model: ShortLinkRes - Used By: Share - */ - - class ShortLinkRes: Codable { - - - public var title: String? - - public var url: UrlInfo? - - public var createdBy: String? - - public var appRedirect: Bool? - - public var fallback: String? - - public var active: Bool? - - public var id: String? - - public var enableTracking: Bool? - - public var expireAt: String? - - public var application: String? - - public var userId: String? - - public var createdAt: String? - - public var meta: [String: Any]? - - public var updatedAt: String? - - public var personalized: Bool? - - public var campaign: CampaignShortLink? - - public var redirects: Redirects? - - public var attribution: Attribution? - - public var socialMediaTags: SocialMediaTags? - - public var count: Int? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case url = "url" - - case createdBy = "created_by" - - case appRedirect = "app_redirect" - - case fallback = "fallback" - - case active = "active" - - case id = "_id" - - case enableTracking = "enable_tracking" - - case expireAt = "expire_at" - - case application = "application" - - case userId = "user_id" - - case createdAt = "created_at" - - case meta = "meta" - - case updatedAt = "updated_at" - - case personalized = "personalized" - - case campaign = "campaign" - - case redirects = "redirects" - - case attribution = "attribution" - - case socialMediaTags = "social_media_tags" - - case count = "count" - - } - - public init(active: Bool?, application: String?, appRedirect: Bool?, attribution: Attribution?, campaign: CampaignShortLink?, count: Int?, createdAt: String?, createdBy: String?, enableTracking: Bool?, expireAt: String?, fallback: String?, meta: [String: Any]?, personalized: Bool?, redirects: Redirects?, socialMediaTags: SocialMediaTags?, title: String?, updatedAt: String?, url: UrlInfo?, userId: String?, id: String?) { - - self.title = title - - self.url = url - - self.createdBy = createdBy - - self.appRedirect = appRedirect - - self.fallback = fallback - - self.active = active - - self.id = id - - self.enableTracking = enableTracking - - self.expireAt = expireAt - - self.application = application - - self.userId = userId - - self.createdAt = createdAt - - self.meta = meta - - self.updatedAt = updatedAt - - self.personalized = personalized - - self.campaign = campaign - - self.redirects = redirects - - self.attribution = attribution - - self.socialMediaTags = socialMediaTags - - self.count = count - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(UrlInfo.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(String.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appRedirect = try container.decode(Bool.self, forKey: .appRedirect) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fallback = try container.decode(String.self, forKey: .fallback) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enableTracking = try container.decode(Bool.self, forKey: .enableTracking) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expireAt = try container.decode(String.self, forKey: .expireAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - personalized = try container.decode(Bool.self, forKey: .personalized) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - campaign = try container.decode(CampaignShortLink.self, forKey: .campaign) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - redirects = try container.decode(Redirects.self, forKey: .redirects) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attribution = try container.decode(Attribution.self, forKey: .attribution) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - socialMediaTags = try container.decode(SocialMediaTags.self, forKey: .socialMediaTags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - count = try container.decode(Int.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(appRedirect, forKey: .appRedirect) - - - - try? container.encodeIfPresent(fallback, forKey: .fallback) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(enableTracking, forKey: .enableTracking) - - - - try? container.encodeIfPresent(expireAt, forKey: .expireAt) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(personalized, forKey: .personalized) - - - - try? container.encodeIfPresent(campaign, forKey: .campaign) - - - - try? container.encodeIfPresent(redirects, forKey: .redirects) - - - - try? container.encodeIfPresent(attribution, forKey: .attribution) - - - - try? container.encodeIfPresent(socialMediaTags, forKey: .socialMediaTags) - - - - try? container.encodeIfPresent(count, forKey: .count) - - - } - - } - - /* - Model: ShortLinkList - Used By: Share - */ - - class ShortLinkList: Codable { - - - public var items: [ShortLinkRes]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [ShortLinkRes]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([ShortLinkRes].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: ErrorRes - Used By: Share - */ - - class ErrorRes: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - - - /* - Model: DataTresholdDTO - Used By: Inventory - */ - - class DataTresholdDTO: Codable { - - - public var minPrice: Double? - - public var safeStock: Int? - - public var periodThreshold: Int? - - public var periodThresholdType: String? - - public var periodTypeList: [GenericDTO]? - - - public enum CodingKeys: String, CodingKey { - - case minPrice = "min_price" - - case safeStock = "safe_stock" - - case periodThreshold = "period_threshold" - - case periodThresholdType = "period_threshold_type" - - case periodTypeList = "period_type_list" - - } - - public init(minPrice: Double?, periodThreshold: Int?, periodThresholdType: String?, periodTypeList: [GenericDTO]?, safeStock: Int?) { - - self.minPrice = minPrice - - self.safeStock = safeStock - - self.periodThreshold = periodThreshold - - self.periodThresholdType = periodThresholdType - - self.periodTypeList = periodTypeList - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - minPrice = try container.decode(Double.self, forKey: .minPrice) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - safeStock = try container.decode(Int.self, forKey: .safeStock) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - periodThreshold = try container.decode(Int.self, forKey: .periodThreshold) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - periodThresholdType = try container.decode(String.self, forKey: .periodThresholdType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - periodTypeList = try container.decode([GenericDTO].self, forKey: .periodTypeList) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(minPrice, forKey: .minPrice) - - - - try? container.encodeIfPresent(safeStock, forKey: .safeStock) - - - - try? container.encodeIfPresent(periodThreshold, forKey: .periodThreshold) - - - - try? container.encodeIfPresent(periodThresholdType, forKey: .periodThresholdType) - - - - try? container.encodeIfPresent(periodTypeList, forKey: .periodTypeList) - - - } - - } - - /* - Model: GenericDTO - Used By: Inventory - */ - - class GenericDTO: Codable { - - - public var text: String? - - public var value: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case text = "text" - - case value = "value" - - } - - public init(text: String?, value: [String: Any]?) { - - self.text = text - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - text = try container.decode(String.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode([String: Any].self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: JobConfigDTO - Used By: Inventory - */ - - class JobConfigDTO: Codable { - - - public var integration: String - - public var integrationData: [String: Any]? - - public var companyName: String? - - public var companyId: Int - - public var taskDetails: TaskDTO? - - public var thresholdDetails: DataTresholdDTO? - - public var jobCode: String? - - public var alias: String? - - - public enum CodingKeys: String, CodingKey { - - case integration = "integration" - - case integrationData = "integration_data" - - case companyName = "company_name" - - case companyId = "company_id" - - case taskDetails = "task_details" - - case thresholdDetails = "threshold_details" - - case jobCode = "job_code" - - case alias = "alias" - - } - - public init(alias: String?, companyId: Int, companyName: String?, integration: String, integrationData: [String: Any]?, jobCode: String?, taskDetails: TaskDTO?, thresholdDetails: DataTresholdDTO?) { - - self.integration = integration - - self.integrationData = integrationData - - self.companyName = companyName - - self.companyId = companyId - - self.taskDetails = taskDetails - - self.thresholdDetails = thresholdDetails - - self.jobCode = jobCode - - self.alias = alias - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - integration = try container.decode(String.self, forKey: .integration) - - - - - do { - integrationData = try container.decode([String: Any].self, forKey: .integrationData) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyName = try container.decode(String.self, forKey: .companyName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - companyId = try container.decode(Int.self, forKey: .companyId) - - - - - do { - taskDetails = try container.decode(TaskDTO.self, forKey: .taskDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - thresholdDetails = try container.decode(DataTresholdDTO.self, forKey: .thresholdDetails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - jobCode = try container.decode(String.self, forKey: .jobCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - alias = try container.decode(String.self, forKey: .alias) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(integration, forKey: .integration) - - - - try? container.encodeIfPresent(integrationData, forKey: .integrationData) - - - - try? container.encodeIfPresent(companyName, forKey: .companyName) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(taskDetails, forKey: .taskDetails) - - - - try? container.encodeIfPresent(thresholdDetails, forKey: .thresholdDetails) - - - - try? container.encodeIfPresent(jobCode, forKey: .jobCode) - - - - try? container.encodeIfPresent(alias, forKey: .alias) - - - } - - } - - /* - Model: TaskDTO - Used By: Inventory - */ - - class TaskDTO: Codable { - - - public var type: Int? - - public var groupList: [GenericDTO]? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case groupList = "group_list" - - } - - public init(groupList: [GenericDTO]?, type: Int?) { - - self.type = type - - self.groupList = groupList - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(Int.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - groupList = try container.decode([GenericDTO].self, forKey: .groupList) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(groupList, forKey: .groupList) - - - } - - } - - /* - Model: ResponseEnvelopeString - Used By: Inventory - */ - - class ResponseEnvelopeString: Codable { - - - public var timestamp: String? - - public var status: Int? - - public var error: String? - - public var exception: String? - - public var message: String? - - public var totalTimeTakenInMillis: Int? - - public var httpStatus: String? - - public var items: String? - - public var payload: String? - - public var traceId: String? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case timestamp = "timestamp" - - case status = "status" - - case error = "error" - - case exception = "exception" - - case message = "message" - - case totalTimeTakenInMillis = "total_time_taken_in_millis" - - case httpStatus = "http_status" - - case items = "items" - - case payload = "payload" - - case traceId = "trace_id" - - case page = "page" - - } - - public init(error: String?, exception: String?, httpStatus: String?, items: String?, message: String?, page: Page?, payload: String?, status: Int?, timestamp: String?, totalTimeTakenInMillis: Int?, traceId: String?) { - - self.timestamp = timestamp - - self.status = status - - self.error = error - - self.exception = exception - - self.message = message - - self.totalTimeTakenInMillis = totalTimeTakenInMillis - - self.httpStatus = httpStatus - - self.items = items - - self.payload = payload - - self.traceId = traceId - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - timestamp = try container.decode(String.self, forKey: .timestamp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(Int.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - error = try container.decode(String.self, forKey: .error) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - exception = try container.decode(String.self, forKey: .exception) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalTimeTakenInMillis = try container.decode(Int.self, forKey: .totalTimeTakenInMillis) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - httpStatus = try container.decode(String.self, forKey: .httpStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode(String.self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - payload = try container.decode(String.self, forKey: .payload) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - traceId = try container.decode(String.self, forKey: .traceId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(timestamp, forKey: .timestamp) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(error, forKey: .error) - - - - try? container.encodeIfPresent(exception, forKey: .exception) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(totalTimeTakenInMillis, forKey: .totalTimeTakenInMillis) - - - - try? container.encodeIfPresent(httpStatus, forKey: .httpStatus) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(payload, forKey: .payload) - - - - try? container.encodeIfPresent(traceId, forKey: .traceId) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: AWSS3config - Used By: Inventory - */ - - class AWSS3config: Codable { - - - public var bucket: String? - - public var region: String? - - public var dir: String? - - public var accessKey: String? - - public var secretKey: String? - - public var localFilePath: String? - - public var archivePath: String? - - public var archive: Bool? - - public var delete: Bool? - - public var unzip: Bool? - - public var zipFormat: String? - - public var fileRegex: String? - - public var archiveConfig: ArchiveConfig? - - - public enum CodingKeys: String, CodingKey { - - case bucket = "bucket" - - case region = "region" - - case dir = "dir" - - case accessKey = "access_key" - - case secretKey = "secret_key" - - case localFilePath = "local_file_path" - - case archivePath = "archive_path" - - case archive = "archive" - - case delete = "delete" - - case unzip = "unzip" - - case zipFormat = "zip_format" - - case fileRegex = "file_regex" - - case archiveConfig = "archive_config" - - } - - public init(accessKey: String?, archive: Bool?, archiveConfig: ArchiveConfig?, archivePath: String?, bucket: String?, delete: Bool?, dir: String?, fileRegex: String?, localFilePath: String?, region: String?, secretKey: String?, unzip: Bool?, zipFormat: String?) { - - self.bucket = bucket - - self.region = region - - self.dir = dir - - self.accessKey = accessKey - - self.secretKey = secretKey - - self.localFilePath = localFilePath - - self.archivePath = archivePath - - self.archive = archive - - self.delete = delete - - self.unzip = unzip - - self.zipFormat = zipFormat - - self.fileRegex = fileRegex - - self.archiveConfig = archiveConfig - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - bucket = try container.decode(String.self, forKey: .bucket) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - region = try container.decode(String.self, forKey: .region) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dir = try container.decode(String.self, forKey: .dir) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - accessKey = try container.decode(String.self, forKey: .accessKey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - secretKey = try container.decode(String.self, forKey: .secretKey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - localFilePath = try container.decode(String.self, forKey: .localFilePath) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archivePath = try container.decode(String.self, forKey: .archivePath) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archive = try container.decode(Bool.self, forKey: .archive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - delete = try container.decode(Bool.self, forKey: .delete) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - unzip = try container.decode(Bool.self, forKey: .unzip) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - zipFormat = try container.decode(String.self, forKey: .zipFormat) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fileRegex = try container.decode(String.self, forKey: .fileRegex) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archiveConfig = try container.decode(ArchiveConfig.self, forKey: .archiveConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(bucket, forKey: .bucket) - - - - try? container.encodeIfPresent(region, forKey: .region) - - - - try? container.encodeIfPresent(dir, forKey: .dir) - - - - try? container.encodeIfPresent(accessKey, forKey: .accessKey) - - - - try? container.encodeIfPresent(secretKey, forKey: .secretKey) - - - - try? container.encodeIfPresent(localFilePath, forKey: .localFilePath) - - - - try? container.encodeIfPresent(archivePath, forKey: .archivePath) - - - - try? container.encodeIfPresent(archive, forKey: .archive) - - - - try? container.encodeIfPresent(delete, forKey: .delete) - - - - try? container.encodeIfPresent(unzip, forKey: .unzip) - - - - try? container.encodeIfPresent(zipFormat, forKey: .zipFormat) - - - - try? container.encodeIfPresent(fileRegex, forKey: .fileRegex) - - - - try? container.encodeIfPresent(archiveConfig, forKey: .archiveConfig) - - - } - - } - - /* - Model: ArchiveConfig - Used By: Inventory - */ - - class ArchiveConfig: Codable { - - - public var delete: Bool? - - public var archive: Bool? - - public var archiveDir: String? - - - public enum CodingKeys: String, CodingKey { - - case delete = "delete" - - case archive = "archive" - - case archiveDir = "archive_dir" - - } - - public init(archive: Bool?, archiveDir: String?, delete: Bool?) { - - self.delete = delete - - self.archive = archive - - self.archiveDir = archiveDir - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - delete = try container.decode(Bool.self, forKey: .delete) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archive = try container.decode(Bool.self, forKey: .archive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archiveDir = try container.decode(String.self, forKey: .archiveDir) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(delete, forKey: .delete) - - - - try? container.encodeIfPresent(archive, forKey: .archive) - - - - try? container.encodeIfPresent(archiveDir, forKey: .archiveDir) - - - } - - } - - /* - Model: Audit - Used By: Inventory - */ - - class Audit: Codable { - - - public var createdBy: String? - - public var modifiedBy: String? - - public var createdOn: String? - - public var modifiedOn: String? - - - public enum CodingKeys: String, CodingKey { - - case createdBy = "created_by" - - case modifiedBy = "modified_by" - - case createdOn = "created_on" - - case modifiedOn = "modified_on" - - } - - public init(createdBy: String?, createdOn: String?, modifiedBy: String?, modifiedOn: String?) { - - self.createdBy = createdBy - - self.modifiedBy = modifiedBy - - self.createdOn = createdOn - - self.modifiedOn = modifiedOn - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdBy = try container.decode(String.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode(String.self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - } - - } - - /* - Model: CatalogMasterConfig - Used By: Inventory - */ - - class CatalogMasterConfig: Codable { - - - public var sourceSlug: String? - - - public enum CodingKeys: String, CodingKey { - - case sourceSlug = "source_slug" - - } - - public init(sourceSlug: String?) { - - self.sourceSlug = sourceSlug - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - sourceSlug = try container.decode(String.self, forKey: .sourceSlug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(sourceSlug, forKey: .sourceSlug) - - - } - - } - - /* - Model: CompanyConfig - Used By: Inventory - */ - - class CompanyConfig: Codable { - - - public var companyId: Int? - - public var excludeSteps: [Int]? - - public var hiddenClosetKeys: [String]? - - public var openTags: [String: Any]? - - public var taxIdentifiers: [String]? - - public var deleteQuantityThreshold: Int? - - - public enum CodingKeys: String, CodingKey { - - case companyId = "company_id" - - case excludeSteps = "exclude_steps" - - case hiddenClosetKeys = "hidden_closet_keys" - - case openTags = "open_tags" - - case taxIdentifiers = "tax_identifiers" - - case deleteQuantityThreshold = "delete_quantity_threshold" - - } - - public init(companyId: Int?, deleteQuantityThreshold: Int?, excludeSteps: [Int]?, hiddenClosetKeys: [String]?, openTags: [String: Any]?, taxIdentifiers: [String]?) { - - self.companyId = companyId - - self.excludeSteps = excludeSteps - - self.hiddenClosetKeys = hiddenClosetKeys - - self.openTags = openTags - - self.taxIdentifiers = taxIdentifiers - - self.deleteQuantityThreshold = deleteQuantityThreshold - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - excludeSteps = try container.decode([Int].self, forKey: .excludeSteps) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - hiddenClosetKeys = try container.decode([String].self, forKey: .hiddenClosetKeys) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - openTags = try container.decode([String: Any].self, forKey: .openTags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - taxIdentifiers = try container.decode([String].self, forKey: .taxIdentifiers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deleteQuantityThreshold = try container.decode(Int.self, forKey: .deleteQuantityThreshold) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(excludeSteps, forKey: .excludeSteps) - - - - try? container.encodeIfPresent(hiddenClosetKeys, forKey: .hiddenClosetKeys) - - - - try? container.encodeIfPresent(openTags, forKey: .openTags) - - - - try? container.encodeIfPresent(taxIdentifiers, forKey: .taxIdentifiers) - - - - try? container.encodeIfPresent(deleteQuantityThreshold, forKey: .deleteQuantityThreshold) - - - } - - } - - /* - Model: DBConfig - Used By: Inventory - */ - - class DBConfig: Codable { - - - public var vendor: String? - - public var host: String? - - public var port: Int? - - public var username: String? - - public var password: String? - - public var dbname: String? - - public var query: String? - - public var procedure: Bool? - - public var driverClass: String? - - public var jdbcUrl: String? - - public var optionalProperties: [String: String]? - - - public enum CodingKeys: String, CodingKey { - - case vendor = "vendor" - - case host = "host" - - case port = "port" - - case username = "username" - - case password = "password" - - case dbname = "dbname" - - case query = "query" - - case procedure = "procedure" - - case driverClass = "driver_class" - - case jdbcUrl = "jdbc_url" - - case optionalProperties = "optional_properties" - - } - - public init(dbname: String?, driverClass: String?, host: String?, jdbcUrl: String?, optionalProperties: [String: String]?, password: String?, port: Int?, procedure: Bool?, query: String?, username: String?, vendor: String?) { - - self.vendor = vendor - - self.host = host - - self.port = port - - self.username = username - - self.password = password - - self.dbname = dbname - - self.query = query - - self.procedure = procedure - - self.driverClass = driverClass - - self.jdbcUrl = jdbcUrl - - self.optionalProperties = optionalProperties - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - vendor = try container.decode(String.self, forKey: .vendor) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - host = try container.decode(String.self, forKey: .host) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - port = try container.decode(Int.self, forKey: .port) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - username = try container.decode(String.self, forKey: .username) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - password = try container.decode(String.self, forKey: .password) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dbname = try container.decode(String.self, forKey: .dbname) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - query = try container.decode(String.self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - procedure = try container.decode(Bool.self, forKey: .procedure) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - driverClass = try container.decode(String.self, forKey: .driverClass) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - jdbcUrl = try container.decode(String.self, forKey: .jdbcUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - optionalProperties = try container.decode([String: String].self, forKey: .optionalProperties) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(vendor, forKey: .vendor) - - - - try? container.encodeIfPresent(host, forKey: .host) - - - - try? container.encodeIfPresent(port, forKey: .port) - - - - try? container.encodeIfPresent(username, forKey: .username) - - - - try? container.encodeIfPresent(password, forKey: .password) - - - - try? container.encodeIfPresent(dbname, forKey: .dbname) - - - - try? container.encodeIfPresent(query, forKey: .query) - - - - try? container.encodeIfPresent(procedure, forKey: .procedure) - - - - try? container.encodeIfPresent(driverClass, forKey: .driverClass) - - - - try? container.encodeIfPresent(jdbcUrl, forKey: .jdbcUrl) - - - - try? container.encodeIfPresent(optionalProperties, forKey: .optionalProperties) - - - } - - } - - /* - Model: DBConnectionProfile - Used By: Inventory - */ - - class DBConnectionProfile: Codable { - - - public var inventory: String? - - - public enum CodingKeys: String, CodingKey { - - case inventory = "inventory" - - } - - public init(inventory: String?) { - - self.inventory = inventory - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - inventory = try container.decode(String.self, forKey: .inventory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(inventory, forKey: .inventory) - - - } - - } - - /* - Model: DBParamConfig - Used By: Inventory - */ - - class DBParamConfig: Codable { - - - public var params: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case params = "params" - - } - - public init(params: [String: Any]?) { - - self.params = params - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - params = try container.decode([String: Any].self, forKey: .params) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(params, forKey: .params) - - - } - - } - - /* - Model: DefaultHeadersDTO - Used By: Inventory - */ - - class DefaultHeadersDTO: Codable { - - - public var store: PropBeanDTO? - - public var intfArticleId: PropBeanDTO? - - public var priceEffective: PropBeanDTO? - - public var quantity: PropBeanDTO? - - - public enum CodingKeys: String, CodingKey { - - case store = "store" - - case intfArticleId = "intf_article_id" - - case priceEffective = "price_effective" - - case quantity = "quantity" - - } - - public init(intfArticleId: PropBeanDTO?, priceEffective: PropBeanDTO?, quantity: PropBeanDTO?, store: PropBeanDTO?) { - - self.store = store - - self.intfArticleId = intfArticleId - - self.priceEffective = priceEffective - - self.quantity = quantity - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - store = try container.decode(PropBeanDTO.self, forKey: .store) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - intfArticleId = try container.decode(PropBeanDTO.self, forKey: .intfArticleId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priceEffective = try container.decode(PropBeanDTO.self, forKey: .priceEffective) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - quantity = try container.decode(PropBeanDTO.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(store, forKey: .store) - - - - try? container.encodeIfPresent(intfArticleId, forKey: .intfArticleId) - - - - try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - } - - } - - /* - Model: DocMappingConfig - Used By: Inventory - */ - - class DocMappingConfig: Codable { - - - public var properties: [String: Any]? - - public var junkDataThresholdCount: Int? - - public var propBeanConfigs: [PropBeanConfig]? - - public var unwindField: String? - - public var defaultHeaders: DefaultHeadersDTO? - - - public enum CodingKeys: String, CodingKey { - - case properties = "properties" - - case junkDataThresholdCount = "junk_data_threshold_count" - - case propBeanConfigs = "prop_bean_configs" - - case unwindField = "unwind_field" - - case defaultHeaders = "default_headers" - - } - - public init(defaultHeaders: DefaultHeadersDTO?, junkDataThresholdCount: Int?, properties: [String: Any]?, propBeanConfigs: [PropBeanConfig]?, unwindField: String?) { - - self.properties = properties - - self.junkDataThresholdCount = junkDataThresholdCount - - self.propBeanConfigs = propBeanConfigs - - self.unwindField = unwindField - - self.defaultHeaders = defaultHeaders - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - properties = try container.decode([String: Any].self, forKey: .properties) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - junkDataThresholdCount = try container.decode(Int.self, forKey: .junkDataThresholdCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - propBeanConfigs = try container.decode([PropBeanConfig].self, forKey: .propBeanConfigs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - unwindField = try container.decode(String.self, forKey: .unwindField) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - defaultHeaders = try container.decode(DefaultHeadersDTO.self, forKey: .defaultHeaders) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(properties, forKey: .properties) - - - - try? container.encodeIfPresent(junkDataThresholdCount, forKey: .junkDataThresholdCount) - - - - try? container.encodeIfPresent(propBeanConfigs, forKey: .propBeanConfigs) - - - - try? container.encodeIfPresent(unwindField, forKey: .unwindField) - - - - try? container.encodeIfPresent(defaultHeaders, forKey: .defaultHeaders) - - - } - - } - - /* - Model: EmailConfig - Used By: Inventory - */ - - class EmailConfig: Codable { - - - public var recepient: String? - - public var host: String? - - public var username: String? - - public var password: String? - - public var unzip: Bool? - - public var readFromContent: Bool? - - public var filterBasedOnRecepients: Bool? - - public var pcol: String? - - public var subjectLineRegex: String? - - public var senderAddress: String? - - public var localDir: String? - - public var folderNameHierarchies: [String]? - - public var attachmentRegex: String? - - public var bodyContentRegex: String? - - public var passwordProtected: Bool? - - public var zipFormat: String? - - public var attachmentMandate: Bool? - - public var filterFilesAfterExtraction: Bool? - - public var archiveConfig: ArchiveConfig? - - public var readAllUnreadMails: Bool? - - public var contentType: String? - - public var downloadableLink: Bool? - - public var properties: [String: String]? - - - public enum CodingKeys: String, CodingKey { - - case recepient = "recepient" - - case host = "host" - - case username = "username" - - case password = "password" - - case unzip = "unzip" - - case readFromContent = "read_from_content" - - case filterBasedOnRecepients = "filter_based_on_recepients" - - case pcol = "pcol" - - case subjectLineRegex = "subject_line_regex" - - case senderAddress = "sender_address" - - case localDir = "local_dir" - - case folderNameHierarchies = "folder_name_hierarchies" - - case attachmentRegex = "attachment_regex" - - case bodyContentRegex = "body_content_regex" - - case passwordProtected = "password_protected" - - case zipFormat = "zip_format" - - case attachmentMandate = "attachment_mandate" - - case filterFilesAfterExtraction = "filter_files_after_extraction" - - case archiveConfig = "archive_config" - - case readAllUnreadMails = "read_all_unread_mails" - - case contentType = "content_type" - - case downloadableLink = "downloadable_link" - - case properties = "properties" - - } - - public init(archiveConfig: ArchiveConfig?, attachmentMandate: Bool?, attachmentRegex: String?, bodyContentRegex: String?, contentType: String?, downloadableLink: Bool?, filterBasedOnRecepients: Bool?, filterFilesAfterExtraction: Bool?, folderNameHierarchies: [String]?, host: String?, localDir: String?, password: String?, passwordProtected: Bool?, pcol: String?, properties: [String: String]?, readAllUnreadMails: Bool?, readFromContent: Bool?, recepient: String?, senderAddress: String?, subjectLineRegex: String?, unzip: Bool?, username: String?, zipFormat: String?) { - - self.recepient = recepient - - self.host = host - - self.username = username - - self.password = password - - self.unzip = unzip - - self.readFromContent = readFromContent - - self.filterBasedOnRecepients = filterBasedOnRecepients - - self.pcol = pcol - - self.subjectLineRegex = subjectLineRegex - - self.senderAddress = senderAddress - - self.localDir = localDir - - self.folderNameHierarchies = folderNameHierarchies - - self.attachmentRegex = attachmentRegex - - self.bodyContentRegex = bodyContentRegex - - self.passwordProtected = passwordProtected - - self.zipFormat = zipFormat - - self.attachmentMandate = attachmentMandate - - self.filterFilesAfterExtraction = filterFilesAfterExtraction - - self.archiveConfig = archiveConfig - - self.readAllUnreadMails = readAllUnreadMails - - self.contentType = contentType - - self.downloadableLink = downloadableLink - - self.properties = properties - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - recepient = try container.decode(String.self, forKey: .recepient) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - host = try container.decode(String.self, forKey: .host) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - username = try container.decode(String.self, forKey: .username) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - password = try container.decode(String.self, forKey: .password) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - unzip = try container.decode(Bool.self, forKey: .unzip) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - readFromContent = try container.decode(Bool.self, forKey: .readFromContent) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - filterBasedOnRecepients = try container.decode(Bool.self, forKey: .filterBasedOnRecepients) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pcol = try container.decode(String.self, forKey: .pcol) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subjectLineRegex = try container.decode(String.self, forKey: .subjectLineRegex) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - senderAddress = try container.decode(String.self, forKey: .senderAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - localDir = try container.decode(String.self, forKey: .localDir) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - folderNameHierarchies = try container.decode([String].self, forKey: .folderNameHierarchies) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attachmentRegex = try container.decode(String.self, forKey: .attachmentRegex) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bodyContentRegex = try container.decode(String.self, forKey: .bodyContentRegex) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - passwordProtected = try container.decode(Bool.self, forKey: .passwordProtected) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - zipFormat = try container.decode(String.self, forKey: .zipFormat) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attachmentMandate = try container.decode(Bool.self, forKey: .attachmentMandate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - filterFilesAfterExtraction = try container.decode(Bool.self, forKey: .filterFilesAfterExtraction) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archiveConfig = try container.decode(ArchiveConfig.self, forKey: .archiveConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - readAllUnreadMails = try container.decode(Bool.self, forKey: .readAllUnreadMails) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contentType = try container.decode(String.self, forKey: .contentType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - downloadableLink = try container.decode(Bool.self, forKey: .downloadableLink) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - properties = try container.decode([String: String].self, forKey: .properties) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(recepient, forKey: .recepient) - - - - try? container.encodeIfPresent(host, forKey: .host) - - - - try? container.encodeIfPresent(username, forKey: .username) - - - - try? container.encodeIfPresent(password, forKey: .password) - - - - try? container.encodeIfPresent(unzip, forKey: .unzip) - - - - try? container.encodeIfPresent(readFromContent, forKey: .readFromContent) - - - - try? container.encodeIfPresent(filterBasedOnRecepients, forKey: .filterBasedOnRecepients) - - - - try? container.encodeIfPresent(pcol, forKey: .pcol) - - - - try? container.encodeIfPresent(subjectLineRegex, forKey: .subjectLineRegex) - - - - try? container.encodeIfPresent(senderAddress, forKey: .senderAddress) - - - - try? container.encodeIfPresent(localDir, forKey: .localDir) - - - - try? container.encodeIfPresent(folderNameHierarchies, forKey: .folderNameHierarchies) - - - - try? container.encodeIfPresent(attachmentRegex, forKey: .attachmentRegex) - - - - try? container.encodeIfPresent(bodyContentRegex, forKey: .bodyContentRegex) - - - - try? container.encodeIfPresent(passwordProtected, forKey: .passwordProtected) - - - - try? container.encodeIfPresent(zipFormat, forKey: .zipFormat) - - - - try? container.encodeIfPresent(attachmentMandate, forKey: .attachmentMandate) - - - - try? container.encodeIfPresent(filterFilesAfterExtraction, forKey: .filterFilesAfterExtraction) - - - - try? container.encodeIfPresent(archiveConfig, forKey: .archiveConfig) - - - - try? container.encodeIfPresent(readAllUnreadMails, forKey: .readAllUnreadMails) - - - - try? container.encodeIfPresent(contentType, forKey: .contentType) - - - - try? container.encodeIfPresent(downloadableLink, forKey: .downloadableLink) - - - - try? container.encodeIfPresent(properties, forKey: .properties) - - - } - - } - - /* - Model: FTPConfig - Used By: Inventory - */ - - class FTPConfig: Codable { - - - public var host: String? - - public var port: Int? - - public var username: String? - - public var password: String? - - public var unzip: Bool? - - public var retries: Int? - - public var interval: Int? - - public var localDir: String? - - public var remoteDir: String? - - public var zipFileRegex: String? - - public var archiveConfig: ArchiveConfig? - - public var fileRegex: String? - - public var zipFormat: String? - - public var readAllFiles: Bool? - - - public enum CodingKeys: String, CodingKey { - - case host = "host" - - case port = "port" - - case username = "username" - - case password = "password" - - case unzip = "unzip" - - case retries = "retries" - - case interval = "interval" - - case localDir = "local_dir" - - case remoteDir = "remote_dir" - - case zipFileRegex = "zip_file_regex" - - case archiveConfig = "archive_config" - - case fileRegex = "file_regex" - - case zipFormat = "zip_format" - - case readAllFiles = "read_all_files" - - } - - public init(archiveConfig: ArchiveConfig?, fileRegex: String?, host: String?, interval: Int?, localDir: String?, password: String?, port: Int?, readAllFiles: Bool?, remoteDir: String?, retries: Int?, unzip: Bool?, username: String?, zipFileRegex: String?, zipFormat: String?) { - - self.host = host - - self.port = port - - self.username = username - - self.password = password - - self.unzip = unzip - - self.retries = retries - - self.interval = interval - - self.localDir = localDir - - self.remoteDir = remoteDir - - self.zipFileRegex = zipFileRegex - - self.archiveConfig = archiveConfig - - self.fileRegex = fileRegex - - self.zipFormat = zipFormat - - self.readAllFiles = readAllFiles - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - host = try container.decode(String.self, forKey: .host) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - port = try container.decode(Int.self, forKey: .port) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - username = try container.decode(String.self, forKey: .username) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - password = try container.decode(String.self, forKey: .password) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - unzip = try container.decode(Bool.self, forKey: .unzip) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - retries = try container.decode(Int.self, forKey: .retries) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - interval = try container.decode(Int.self, forKey: .interval) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - localDir = try container.decode(String.self, forKey: .localDir) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - remoteDir = try container.decode(String.self, forKey: .remoteDir) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - zipFileRegex = try container.decode(String.self, forKey: .zipFileRegex) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archiveConfig = try container.decode(ArchiveConfig.self, forKey: .archiveConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fileRegex = try container.decode(String.self, forKey: .fileRegex) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - zipFormat = try container.decode(String.self, forKey: .zipFormat) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - readAllFiles = try container.decode(Bool.self, forKey: .readAllFiles) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(host, forKey: .host) - - - - try? container.encodeIfPresent(port, forKey: .port) - - - - try? container.encodeIfPresent(username, forKey: .username) - - - - try? container.encodeIfPresent(password, forKey: .password) - - - - try? container.encodeIfPresent(unzip, forKey: .unzip) - - - - try? container.encodeIfPresent(retries, forKey: .retries) - - - - try? container.encodeIfPresent(interval, forKey: .interval) - - - - try? container.encodeIfPresent(localDir, forKey: .localDir) - - - - try? container.encodeIfPresent(remoteDir, forKey: .remoteDir) - - - - try? container.encodeIfPresent(zipFileRegex, forKey: .zipFileRegex) - - - - try? container.encodeIfPresent(archiveConfig, forKey: .archiveConfig) - - - - try? container.encodeIfPresent(fileRegex, forKey: .fileRegex) - - - - try? container.encodeIfPresent(zipFormat, forKey: .zipFormat) - - - - try? container.encodeIfPresent(readAllFiles, forKey: .readAllFiles) - - - } - - } - - /* - Model: FileConfig - Used By: Inventory - */ - - class FileConfig: Codable { - - - public var delimiter: String? - - public var charset: String? - - public var properties: [String: Any]? - - public var fileHasHeader: Bool? - - public var headerIndex: Int? - - public var headerArray: [String]? - - public var dataStartIndex: Int? - - public var propBeanConfigs: [PropBeanConfig]? - - public var junkDataThresholdCount: Int? - - public var fileType: String? - - public var lineValidityCheck: Bool? - - public var sheetNames: [String]? - - public var readAllSheets: Bool? - - public var quoteChar: String? - - public var escapeChar: String? - - public var defaultHeaders: DefaultHeadersDTO? - - - public enum CodingKeys: String, CodingKey { - - case delimiter = "delimiter" - - case charset = "charset" - - case properties = "properties" - - case fileHasHeader = "file_has_header" - - case headerIndex = "header_index" - - case headerArray = "header_array" - - case dataStartIndex = "data_start_index" - - case propBeanConfigs = "prop_bean_configs" - - case junkDataThresholdCount = "junk_data_threshold_count" - - case fileType = "file_type" - - case lineValidityCheck = "line_validity_check" - - case sheetNames = "sheet_names" - - case readAllSheets = "read_all_sheets" - - case quoteChar = "quote_char" - - case escapeChar = "escape_char" - - case defaultHeaders = "default_headers" - - } - - public init(charset: String?, dataStartIndex: Int?, defaultHeaders: DefaultHeadersDTO?, delimiter: String?, escapeChar: String?, fileHasHeader: Bool?, fileType: String?, headerArray: [String]?, headerIndex: Int?, junkDataThresholdCount: Int?, lineValidityCheck: Bool?, properties: [String: Any]?, propBeanConfigs: [PropBeanConfig]?, quoteChar: String?, readAllSheets: Bool?, sheetNames: [String]?) { - - self.delimiter = delimiter - - self.charset = charset - - self.properties = properties - - self.fileHasHeader = fileHasHeader - - self.headerIndex = headerIndex - - self.headerArray = headerArray - - self.dataStartIndex = dataStartIndex - - self.propBeanConfigs = propBeanConfigs - - self.junkDataThresholdCount = junkDataThresholdCount - - self.fileType = fileType - - self.lineValidityCheck = lineValidityCheck - - self.sheetNames = sheetNames - - self.readAllSheets = readAllSheets - - self.quoteChar = quoteChar - - self.escapeChar = escapeChar - - self.defaultHeaders = defaultHeaders - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - delimiter = try container.decode(String.self, forKey: .delimiter) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - charset = try container.decode(String.self, forKey: .charset) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - properties = try container.decode([String: Any].self, forKey: .properties) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fileHasHeader = try container.decode(Bool.self, forKey: .fileHasHeader) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - headerIndex = try container.decode(Int.self, forKey: .headerIndex) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - headerArray = try container.decode([String].self, forKey: .headerArray) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dataStartIndex = try container.decode(Int.self, forKey: .dataStartIndex) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - propBeanConfigs = try container.decode([PropBeanConfig].self, forKey: .propBeanConfigs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - junkDataThresholdCount = try container.decode(Int.self, forKey: .junkDataThresholdCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fileType = try container.decode(String.self, forKey: .fileType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lineValidityCheck = try container.decode(Bool.self, forKey: .lineValidityCheck) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sheetNames = try container.decode([String].self, forKey: .sheetNames) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - readAllSheets = try container.decode(Bool.self, forKey: .readAllSheets) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - quoteChar = try container.decode(String.self, forKey: .quoteChar) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - escapeChar = try container.decode(String.self, forKey: .escapeChar) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - defaultHeaders = try container.decode(DefaultHeadersDTO.self, forKey: .defaultHeaders) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(delimiter, forKey: .delimiter) - - - - try? container.encodeIfPresent(charset, forKey: .charset) - - - - try? container.encodeIfPresent(properties, forKey: .properties) - - - - try? container.encodeIfPresent(fileHasHeader, forKey: .fileHasHeader) - - - - try? container.encodeIfPresent(headerIndex, forKey: .headerIndex) - - - - try? container.encodeIfPresent(headerArray, forKey: .headerArray) - - - - try? container.encodeIfPresent(dataStartIndex, forKey: .dataStartIndex) - - - - try? container.encodeIfPresent(propBeanConfigs, forKey: .propBeanConfigs) - - - - try? container.encodeIfPresent(junkDataThresholdCount, forKey: .junkDataThresholdCount) - - - - try? container.encodeIfPresent(fileType, forKey: .fileType) - - - - try? container.encodeIfPresent(lineValidityCheck, forKey: .lineValidityCheck) - - - - try? container.encodeIfPresent(sheetNames, forKey: .sheetNames) - - - - try? container.encodeIfPresent(readAllSheets, forKey: .readAllSheets) - - - - try? container.encodeIfPresent(quoteChar, forKey: .quoteChar) - - - - try? container.encodeIfPresent(escapeChar, forKey: .escapeChar) - - - - try? container.encodeIfPresent(defaultHeaders, forKey: .defaultHeaders) - - - } - - } - - /* - Model: GoogleSpreadSheetConfig - Used By: Inventory - */ - - class GoogleSpreadSheetConfig: Codable { - - - public var range: String? - - public var sheetId: String? - - public var clientSecretLocation: String? - - public var credStorageDirectory: String? - - public var localDir: String? - - public var archiveConfig: ArchiveConfig? - - - public enum CodingKeys: String, CodingKey { - - case range = "range" - - case sheetId = "sheet_id" - - case clientSecretLocation = "client_secret_location" - - case credStorageDirectory = "cred_storage_directory" - - case localDir = "local_dir" - - case archiveConfig = "archive_config" - - } - - public init(archiveConfig: ArchiveConfig?, clientSecretLocation: String?, credStorageDirectory: String?, localDir: String?, range: String?, sheetId: String?) { - - self.range = range - - self.sheetId = sheetId - - self.clientSecretLocation = clientSecretLocation - - self.credStorageDirectory = credStorageDirectory - - self.localDir = localDir - - self.archiveConfig = archiveConfig - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - range = try container.decode(String.self, forKey: .range) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sheetId = try container.decode(String.self, forKey: .sheetId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - clientSecretLocation = try container.decode(String.self, forKey: .clientSecretLocation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - credStorageDirectory = try container.decode(String.self, forKey: .credStorageDirectory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - localDir = try container.decode(String.self, forKey: .localDir) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archiveConfig = try container.decode(ArchiveConfig.self, forKey: .archiveConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(range, forKey: .range) - - - - try? container.encodeIfPresent(sheetId, forKey: .sheetId) - - - - try? container.encodeIfPresent(clientSecretLocation, forKey: .clientSecretLocation) - - - - try? container.encodeIfPresent(credStorageDirectory, forKey: .credStorageDirectory) - - - - try? container.encodeIfPresent(localDir, forKey: .localDir) - - - - try? container.encodeIfPresent(archiveConfig, forKey: .archiveConfig) - - - } - - } - - /* - Model: HttpConfig - Used By: Inventory - */ - - class HttpConfig: Codable { - - - public var hosturl: String? - - public var username: String? - - public var password: String? - - public var requestParams: [String: String]? - - public var httpMethod: String? - - public var requestPayload: String? - - public var localPath: String? - - public var archiveConfig: ArchiveConfig? - - - public enum CodingKeys: String, CodingKey { - - case hosturl = "hosturl" - - case username = "username" - - case password = "password" - - case requestParams = "request_params" - - case httpMethod = "http_method" - - case requestPayload = "request_payload" - - case localPath = "local_path" - - case archiveConfig = "archive_config" - - } - - public init(archiveConfig: ArchiveConfig?, hosturl: String?, httpMethod: String?, localPath: String?, password: String?, requestParams: [String: String]?, requestPayload: String?, username: String?) { - - self.hosturl = hosturl - - self.username = username - - self.password = password - - self.requestParams = requestParams - - self.httpMethod = httpMethod - - self.requestPayload = requestPayload - - self.localPath = localPath - - self.archiveConfig = archiveConfig - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - hosturl = try container.decode(String.self, forKey: .hosturl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - username = try container.decode(String.self, forKey: .username) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - password = try container.decode(String.self, forKey: .password) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requestParams = try container.decode([String: String].self, forKey: .requestParams) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - httpMethod = try container.decode(String.self, forKey: .httpMethod) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requestPayload = try container.decode(String.self, forKey: .requestPayload) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - localPath = try container.decode(String.self, forKey: .localPath) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archiveConfig = try container.decode(ArchiveConfig.self, forKey: .archiveConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(hosturl, forKey: .hosturl) - - - - try? container.encodeIfPresent(username, forKey: .username) - - - - try? container.encodeIfPresent(password, forKey: .password) - - - - try? container.encodeIfPresent(requestParams, forKey: .requestParams) - - - - try? container.encodeIfPresent(httpMethod, forKey: .httpMethod) - - - - try? container.encodeIfPresent(requestPayload, forKey: .requestPayload) - - - - try? container.encodeIfPresent(localPath, forKey: .localPath) - - - - try? container.encodeIfPresent(archiveConfig, forKey: .archiveConfig) - - - } - - } - - /* - Model: JobConfig - Used By: Inventory - */ - - class JobConfig: Codable { - - - public var id: Int? - - public var jobCode: String? - - public var taskType: String? - - public var syncDelay: Int? - - public var cronExpression: String? - - public var storeFilter: StoreFilter? - - public var processConfig: ProcessConfig? - - public var storeConfig: [StoreConfig]? - - public var properties: [String: String]? - - public var immediateFirstRun: Bool? - - public var disable: Bool? - - public var dependentJobCodes: [String]? - - public var companyConfig: [CompanyConfig]? - - public var companyIds: [Int]? - - public var taxIdentifiers: [String]? - - public var priority: String? - - public var periodThreshold: Int? - - public var periodThresholdType: String? - - public var dbConnectionProfile: DBConnectionProfile? - - public var params: [String: Any]? - - public var openTags: [String: Any]? - - public var deleteQuantityThreshold: Int? - - public var catalogMasterConfig: CatalogMasterConfig? - - public var aggregatorTypes: [String]? - - public var integrationType: String? - - public var minPrice: Double? - - public var audit: Audit? - - public var version: Int? - - public var alias: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case jobCode = "job_code" - - case taskType = "task_type" - - case syncDelay = "sync_delay" - - case cronExpression = "cron_expression" - - case storeFilter = "store_filter" - - case processConfig = "process_config" - - case storeConfig = "store_config" - - case properties = "properties" - - case immediateFirstRun = "immediate_first_run" - - case disable = "disable" - - case dependentJobCodes = "dependent_job_codes" - - case companyConfig = "company_config" - - case companyIds = "company_ids" - - case taxIdentifiers = "tax_identifiers" - - case priority = "priority" - - case periodThreshold = "period_threshold" - - case periodThresholdType = "period_threshold_type" - - case dbConnectionProfile = "db_connection_profile" - - case params = "params" - - case openTags = "open_tags" - - case deleteQuantityThreshold = "delete_quantity_threshold" - - case catalogMasterConfig = "catalog_master_config" - - case aggregatorTypes = "aggregator_types" - - case integrationType = "integration_type" - - case minPrice = "min_price" - - case audit = "audit" - - case version = "version" - - case alias = "alias" - - } - - public init(aggregatorTypes: [String]?, alias: String?, audit: Audit?, catalogMasterConfig: CatalogMasterConfig?, companyConfig: [CompanyConfig]?, companyIds: [Int]?, cronExpression: String?, dbConnectionProfile: DBConnectionProfile?, deleteQuantityThreshold: Int?, dependentJobCodes: [String]?, disable: Bool?, immediateFirstRun: Bool?, integrationType: String?, jobCode: String?, minPrice: Double?, openTags: [String: Any]?, params: [String: Any]?, periodThreshold: Int?, periodThresholdType: String?, priority: String?, processConfig: ProcessConfig?, properties: [String: String]?, storeConfig: [StoreConfig]?, storeFilter: StoreFilter?, syncDelay: Int?, taskType: String?, taxIdentifiers: [String]?, version: Int?, id: Int?) { - - self.id = id - - self.jobCode = jobCode - - self.taskType = taskType - - self.syncDelay = syncDelay - - self.cronExpression = cronExpression - - self.storeFilter = storeFilter - - self.processConfig = processConfig - - self.storeConfig = storeConfig - - self.properties = properties - - self.immediateFirstRun = immediateFirstRun - - self.disable = disable - - self.dependentJobCodes = dependentJobCodes - - self.companyConfig = companyConfig - - self.companyIds = companyIds - - self.taxIdentifiers = taxIdentifiers - - self.priority = priority - - self.periodThreshold = periodThreshold - - self.periodThresholdType = periodThresholdType - - self.dbConnectionProfile = dbConnectionProfile - - self.params = params - - self.openTags = openTags - - self.deleteQuantityThreshold = deleteQuantityThreshold - - self.catalogMasterConfig = catalogMasterConfig - - self.aggregatorTypes = aggregatorTypes - - self.integrationType = integrationType - - self.minPrice = minPrice - - self.audit = audit - - self.version = version - - self.alias = alias - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - jobCode = try container.decode(String.self, forKey: .jobCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - taskType = try container.decode(String.self, forKey: .taskType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - syncDelay = try container.decode(Int.self, forKey: .syncDelay) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cronExpression = try container.decode(String.self, forKey: .cronExpression) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeFilter = try container.decode(StoreFilter.self, forKey: .storeFilter) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - processConfig = try container.decode(ProcessConfig.self, forKey: .processConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeConfig = try container.decode([StoreConfig].self, forKey: .storeConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - properties = try container.decode([String: String].self, forKey: .properties) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - immediateFirstRun = try container.decode(Bool.self, forKey: .immediateFirstRun) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - disable = try container.decode(Bool.self, forKey: .disable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dependentJobCodes = try container.decode([String].self, forKey: .dependentJobCodes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyConfig = try container.decode([CompanyConfig].self, forKey: .companyConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyIds = try container.decode([Int].self, forKey: .companyIds) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - taxIdentifiers = try container.decode([String].self, forKey: .taxIdentifiers) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priority = try container.decode(String.self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - periodThreshold = try container.decode(Int.self, forKey: .periodThreshold) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - periodThresholdType = try container.decode(String.self, forKey: .periodThresholdType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dbConnectionProfile = try container.decode(DBConnectionProfile.self, forKey: .dbConnectionProfile) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - params = try container.decode([String: Any].self, forKey: .params) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - openTags = try container.decode([String: Any].self, forKey: .openTags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deleteQuantityThreshold = try container.decode(Int.self, forKey: .deleteQuantityThreshold) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - catalogMasterConfig = try container.decode(CatalogMasterConfig.self, forKey: .catalogMasterConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - aggregatorTypes = try container.decode([String].self, forKey: .aggregatorTypes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - integrationType = try container.decode(String.self, forKey: .integrationType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - minPrice = try container.decode(Double.self, forKey: .minPrice) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - audit = try container.decode(Audit.self, forKey: .audit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - version = try container.decode(Int.self, forKey: .version) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - alias = try container.decode(String.self, forKey: .alias) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(jobCode, forKey: .jobCode) - - - - try? container.encodeIfPresent(taskType, forKey: .taskType) - - - - try? container.encodeIfPresent(syncDelay, forKey: .syncDelay) - - - - try? container.encodeIfPresent(cronExpression, forKey: .cronExpression) - - - - try? container.encodeIfPresent(storeFilter, forKey: .storeFilter) - - - - try? container.encodeIfPresent(processConfig, forKey: .processConfig) - - - - try? container.encodeIfPresent(storeConfig, forKey: .storeConfig) - - - - try? container.encodeIfPresent(properties, forKey: .properties) - - - - try? container.encodeIfPresent(immediateFirstRun, forKey: .immediateFirstRun) - - - - try? container.encodeIfPresent(disable, forKey: .disable) - - - - try? container.encodeIfPresent(dependentJobCodes, forKey: .dependentJobCodes) - - - - try? container.encodeIfPresent(companyConfig, forKey: .companyConfig) - - - - try? container.encodeIfPresent(companyIds, forKey: .companyIds) - - - - try? container.encodeIfPresent(taxIdentifiers, forKey: .taxIdentifiers) - - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - - try? container.encodeIfPresent(periodThreshold, forKey: .periodThreshold) - - - - try? container.encodeIfPresent(periodThresholdType, forKey: .periodThresholdType) - - - - try? container.encodeIfPresent(dbConnectionProfile, forKey: .dbConnectionProfile) - - - - try? container.encodeIfPresent(params, forKey: .params) - - - - try? container.encodeIfPresent(openTags, forKey: .openTags) - - - - try? container.encodeIfPresent(deleteQuantityThreshold, forKey: .deleteQuantityThreshold) - - - - try? container.encodeIfPresent(catalogMasterConfig, forKey: .catalogMasterConfig) - - - - try? container.encodeIfPresent(aggregatorTypes, forKey: .aggregatorTypes) - - - - try? container.encodeIfPresent(integrationType, forKey: .integrationType) - - - - try? container.encodeIfPresent(minPrice, forKey: .minPrice) - - - - try? container.encodeIfPresent(audit, forKey: .audit) - - - - try? container.encodeIfPresent(version, forKey: .version) - - - - try? container.encodeIfPresent(alias, forKey: .alias) - - - } - - } - - /* - Model: JobConfigRawDTO - Used By: Inventory - */ - - class JobConfigRawDTO: Codable { - - - public var integration: String - - public var companyName: String - - public var companyId: Int - - public var data: JobConfig? - - - public enum CodingKeys: String, CodingKey { - - case integration = "integration" - - case companyName = "company_name" - - case companyId = "company_id" - - case data = "data" - - } - - public init(companyId: Int, companyName: String, data: JobConfig?, integration: String) { - - self.integration = integration - - self.companyName = companyName - - self.companyId = companyId - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - integration = try container.decode(String.self, forKey: .integration) - - - - - companyName = try container.decode(String.self, forKey: .companyName) - - - - - companyId = try container.decode(Int.self, forKey: .companyId) - - - - - do { - data = try container.decode(JobConfig.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(integration, forKey: .integration) - - - - try? container.encodeIfPresent(companyName, forKey: .companyName) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: JsonDocConfig - Used By: Inventory - */ - - class JsonDocConfig: Codable { - - - public var propBeanConfigs: [PropBeanConfig]? - - - public enum CodingKeys: String, CodingKey { - - case propBeanConfigs = "prop_bean_configs" - - } - - public init(propBeanConfigs: [PropBeanConfig]?) { - - self.propBeanConfigs = propBeanConfigs - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - propBeanConfigs = try container.decode([PropBeanConfig].self, forKey: .propBeanConfigs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(propBeanConfigs, forKey: .propBeanConfigs) - - - } - - } - - /* - Model: LocalFileConfig - Used By: Inventory - */ - - class LocalFileConfig: Codable { - - - public var retries: Int? - - public var interval: Int? - - public var localDir: String? - - public var workingDir: String? - - public var unzip: Bool? - - public var zipFileRegex: String? - - public var fileRegex: String? - - public var zipFormat: String? - - public var archiveConfig: ArchiveConfig? - - public var readAllFiles: Bool? - - - public enum CodingKeys: String, CodingKey { - - case retries = "retries" - - case interval = "interval" - - case localDir = "local_dir" - - case workingDir = "working_dir" - - case unzip = "unzip" - - case zipFileRegex = "zip_file_regex" - - case fileRegex = "file_regex" - - case zipFormat = "zip_format" - - case archiveConfig = "archive_config" - - case readAllFiles = "read_all_files" - - } - - public init(archiveConfig: ArchiveConfig?, fileRegex: String?, interval: Int?, localDir: String?, readAllFiles: Bool?, retries: Int?, unzip: Bool?, workingDir: String?, zipFileRegex: String?, zipFormat: String?) { - - self.retries = retries - - self.interval = interval - - self.localDir = localDir - - self.workingDir = workingDir - - self.unzip = unzip - - self.zipFileRegex = zipFileRegex - - self.fileRegex = fileRegex - - self.zipFormat = zipFormat - - self.archiveConfig = archiveConfig - - self.readAllFiles = readAllFiles - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - retries = try container.decode(Int.self, forKey: .retries) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - interval = try container.decode(Int.self, forKey: .interval) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - localDir = try container.decode(String.self, forKey: .localDir) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - workingDir = try container.decode(String.self, forKey: .workingDir) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - unzip = try container.decode(Bool.self, forKey: .unzip) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - zipFileRegex = try container.decode(String.self, forKey: .zipFileRegex) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fileRegex = try container.decode(String.self, forKey: .fileRegex) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - zipFormat = try container.decode(String.self, forKey: .zipFormat) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archiveConfig = try container.decode(ArchiveConfig.self, forKey: .archiveConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - readAllFiles = try container.decode(Bool.self, forKey: .readAllFiles) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(retries, forKey: .retries) - - - - try? container.encodeIfPresent(interval, forKey: .interval) - - - - try? container.encodeIfPresent(localDir, forKey: .localDir) - - - - try? container.encodeIfPresent(workingDir, forKey: .workingDir) - - - - try? container.encodeIfPresent(unzip, forKey: .unzip) - - - - try? container.encodeIfPresent(zipFileRegex, forKey: .zipFileRegex) - - - - try? container.encodeIfPresent(fileRegex, forKey: .fileRegex) - - - - try? container.encodeIfPresent(zipFormat, forKey: .zipFormat) - - - - try? container.encodeIfPresent(archiveConfig, forKey: .archiveConfig) - - - - try? container.encodeIfPresent(readAllFiles, forKey: .readAllFiles) - - - } - - } - - /* - Model: MongoDocConfig - Used By: Inventory - */ - - class MongoDocConfig: Codable { - - - public var collectionName: String? - - public var findQuery: [String: Any]? - - public var projectionQuery: [String: Any]? - - public var propBeanConfigs: [PropBeanConfig]? - - public var aggregatePipeline: [[String: Any]]? - - public var skipSave: Bool? - - - public enum CodingKeys: String, CodingKey { - - case collectionName = "collection_name" - - case findQuery = "find_query" - - case projectionQuery = "projection_query" - - case propBeanConfigs = "prop_bean_configs" - - case aggregatePipeline = "aggregate_pipeline" - - case skipSave = "skip_save" - - } - - public init(aggregatePipeline: [[String: Any]]?, collectionName: String?, findQuery: [String: Any]?, projectionQuery: [String: Any]?, propBeanConfigs: [PropBeanConfig]?, skipSave: Bool?) { - - self.collectionName = collectionName - - self.findQuery = findQuery - - self.projectionQuery = projectionQuery - - self.propBeanConfigs = propBeanConfigs - - self.aggregatePipeline = aggregatePipeline - - self.skipSave = skipSave - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - collectionName = try container.decode(String.self, forKey: .collectionName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - findQuery = try container.decode([String: Any].self, forKey: .findQuery) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - projectionQuery = try container.decode([String: Any].self, forKey: .projectionQuery) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - propBeanConfigs = try container.decode([PropBeanConfig].self, forKey: .propBeanConfigs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - aggregatePipeline = try container.decode([[String: Any]].self, forKey: .aggregatePipeline) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - skipSave = try container.decode(Bool.self, forKey: .skipSave) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(collectionName, forKey: .collectionName) - - - - try? container.encodeIfPresent(findQuery, forKey: .findQuery) - - - - try? container.encodeIfPresent(projectionQuery, forKey: .projectionQuery) - - - - try? container.encodeIfPresent(propBeanConfigs, forKey: .propBeanConfigs) - - - - try? container.encodeIfPresent(aggregatePipeline, forKey: .aggregatePipeline) - - - - try? container.encodeIfPresent(skipSave, forKey: .skipSave) - - - } - - } - - /* - Model: OAuthConfig - Used By: Inventory - */ - - class OAuthConfig: Codable { - - - public var limit: Int? - - public var pages: Int? - - public var interval: Int? - - public var consumerKey: String? - - public var consumerSecret: String? - - public var token: String? - - public var tokenSecret: String? - - public var restUrl: String? - - public var restBaseUrl: String? - - public var functionName: String? - - - public enum CodingKeys: String, CodingKey { - - case limit = "limit" - - case pages = "pages" - - case interval = "interval" - - case consumerKey = "consumer_key" - - case consumerSecret = "consumer_secret" - - case token = "token" - - case tokenSecret = "token_secret" - - case restUrl = "rest_url" - - case restBaseUrl = "rest_base_url" - - case functionName = "function_name" - - } - - public init(consumerKey: String?, consumerSecret: String?, functionName: String?, interval: Int?, limit: Int?, pages: Int?, restBaseUrl: String?, restUrl: String?, token: String?, tokenSecret: String?) { - - self.limit = limit - - self.pages = pages - - self.interval = interval - - self.consumerKey = consumerKey - - self.consumerSecret = consumerSecret - - self.token = token - - self.tokenSecret = tokenSecret - - self.restUrl = restUrl - - self.restBaseUrl = restBaseUrl - - self.functionName = functionName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - limit = try container.decode(Int.self, forKey: .limit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pages = try container.decode(Int.self, forKey: .pages) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - interval = try container.decode(Int.self, forKey: .interval) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - consumerKey = try container.decode(String.self, forKey: .consumerKey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - consumerSecret = try container.decode(String.self, forKey: .consumerSecret) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - token = try container.decode(String.self, forKey: .token) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tokenSecret = try container.decode(String.self, forKey: .tokenSecret) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - restUrl = try container.decode(String.self, forKey: .restUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - restBaseUrl = try container.decode(String.self, forKey: .restBaseUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - functionName = try container.decode(String.self, forKey: .functionName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(limit, forKey: .limit) - - - - try? container.encodeIfPresent(pages, forKey: .pages) - - - - try? container.encodeIfPresent(interval, forKey: .interval) - - - - try? container.encodeIfPresent(consumerKey, forKey: .consumerKey) - - - - try? container.encodeIfPresent(consumerSecret, forKey: .consumerSecret) - - - - try? container.encodeIfPresent(token, forKey: .token) - - - - try? container.encodeIfPresent(tokenSecret, forKey: .tokenSecret) - - - - try? container.encodeIfPresent(restUrl, forKey: .restUrl) - - - - try? container.encodeIfPresent(restBaseUrl, forKey: .restBaseUrl) - - - - try? container.encodeIfPresent(functionName, forKey: .functionName) - - - } - - } - - /* - Model: ProcessConfig - Used By: Inventory - */ - - class ProcessConfig: Codable { - - - public var dbConfig: DBConfig? - - public var dbParamConfig: DBParamConfig? - - public var sftpConfig: SFTPConfig? - - public var awsS3Config: AWSS3config? - - public var mongoDocConfig: MongoDocConfig? - - public var ftpConfig: FTPConfig? - - public var emailConfig: EmailConfig? - - public var fileConfig: FileConfig? - - public var jsonDocConfig: JsonDocConfig? - - public var docMappingConfig: DocMappingConfig? - - public var taskStepConfig: TaskStepConfig? - - public var httpConfig: HttpConfig? - - public var localFileConfig: LocalFileConfig? - - public var oauthConfig: OAuthConfig? - - public var googleSpreadsheetConfig: GoogleSpreadSheetConfig? - - - public enum CodingKeys: String, CodingKey { - - case dbConfig = "db_config" - - case dbParamConfig = "db_param_config" - - case sftpConfig = "sftp_config" - - case awsS3Config = "aws_s3_config" - - case mongoDocConfig = "mongo_doc_config" - - case ftpConfig = "ftp_config" - - case emailConfig = "email_config" - - case fileConfig = "file_config" - - case jsonDocConfig = "json_doc_config" - - case docMappingConfig = "doc_mapping_config" - - case taskStepConfig = "task_step_config" - - case httpConfig = "http_config" - - case localFileConfig = "local_file_config" - - case oauthConfig = "oauth_config" - - case googleSpreadsheetConfig = "google_spreadsheet_config" - - } - - public init(awsS3Config: AWSS3config?, dbConfig: DBConfig?, dbParamConfig: DBParamConfig?, docMappingConfig: DocMappingConfig?, emailConfig: EmailConfig?, fileConfig: FileConfig?, ftpConfig: FTPConfig?, googleSpreadsheetConfig: GoogleSpreadSheetConfig?, httpConfig: HttpConfig?, jsonDocConfig: JsonDocConfig?, localFileConfig: LocalFileConfig?, mongoDocConfig: MongoDocConfig?, oauthConfig: OAuthConfig?, sftpConfig: SFTPConfig?, taskStepConfig: TaskStepConfig?) { - - self.dbConfig = dbConfig - - self.dbParamConfig = dbParamConfig - - self.sftpConfig = sftpConfig - - self.awsS3Config = awsS3Config - - self.mongoDocConfig = mongoDocConfig - - self.ftpConfig = ftpConfig - - self.emailConfig = emailConfig - - self.fileConfig = fileConfig - - self.jsonDocConfig = jsonDocConfig - - self.docMappingConfig = docMappingConfig - - self.taskStepConfig = taskStepConfig - - self.httpConfig = httpConfig - - self.localFileConfig = localFileConfig - - self.oauthConfig = oauthConfig - - self.googleSpreadsheetConfig = googleSpreadsheetConfig - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - dbConfig = try container.decode(DBConfig.self, forKey: .dbConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dbParamConfig = try container.decode(DBParamConfig.self, forKey: .dbParamConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sftpConfig = try container.decode(SFTPConfig.self, forKey: .sftpConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - awsS3Config = try container.decode(AWSS3config.self, forKey: .awsS3Config) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mongoDocConfig = try container.decode(MongoDocConfig.self, forKey: .mongoDocConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ftpConfig = try container.decode(FTPConfig.self, forKey: .ftpConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - emailConfig = try container.decode(EmailConfig.self, forKey: .emailConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fileConfig = try container.decode(FileConfig.self, forKey: .fileConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - jsonDocConfig = try container.decode(JsonDocConfig.self, forKey: .jsonDocConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - docMappingConfig = try container.decode(DocMappingConfig.self, forKey: .docMappingConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - taskStepConfig = try container.decode(TaskStepConfig.self, forKey: .taskStepConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - httpConfig = try container.decode(HttpConfig.self, forKey: .httpConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - localFileConfig = try container.decode(LocalFileConfig.self, forKey: .localFileConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - oauthConfig = try container.decode(OAuthConfig.self, forKey: .oauthConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - googleSpreadsheetConfig = try container.decode(GoogleSpreadSheetConfig.self, forKey: .googleSpreadsheetConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(dbConfig, forKey: .dbConfig) - - - - try? container.encodeIfPresent(dbParamConfig, forKey: .dbParamConfig) - - - - try? container.encodeIfPresent(sftpConfig, forKey: .sftpConfig) - - - - try? container.encodeIfPresent(awsS3Config, forKey: .awsS3Config) - - - - try? container.encodeIfPresent(mongoDocConfig, forKey: .mongoDocConfig) - - - - try? container.encodeIfPresent(ftpConfig, forKey: .ftpConfig) - - - - try? container.encodeIfPresent(emailConfig, forKey: .emailConfig) - - - - try? container.encodeIfPresent(fileConfig, forKey: .fileConfig) - - - - try? container.encodeIfPresent(jsonDocConfig, forKey: .jsonDocConfig) - - - - try? container.encodeIfPresent(docMappingConfig, forKey: .docMappingConfig) - - - - try? container.encodeIfPresent(taskStepConfig, forKey: .taskStepConfig) - - - - try? container.encodeIfPresent(httpConfig, forKey: .httpConfig) - - - - try? container.encodeIfPresent(localFileConfig, forKey: .localFileConfig) - - - - try? container.encodeIfPresent(oauthConfig, forKey: .oauthConfig) - - - - try? container.encodeIfPresent(googleSpreadsheetConfig, forKey: .googleSpreadsheetConfig) - - - } - - } - - /* - Model: PropBeanConfig - Used By: Inventory - */ - - class PropBeanConfig: Codable { - - - public var required: Bool? - - public var mapping: [String: PropBeanConfig]? - - public var optional: Bool? - - public var send: Send? - - public var validations: [[String: Any]]? - - public var values: [String]? - - public var include: Bool? - - public var sourceField: String? - - public var sourceFields: [String]? - - public var destinationField: String? - - public var dataType: String? - - public var defaultValue: [String: Any]? - - public var constValue: [String: Any]? - - public var concatStr: String? - - public var functionName: String? - - public var transformerName: String? - - public var allParamFunctionName: String? - - public var subSeparator: String? - - public var indexField: String? - - public var ignoreIfNotExists: Bool? - - public var identifierType: String? - - public var projectionQuery: [String: Any]? - - public var enrichFromMaster: Bool? - - - public enum CodingKeys: String, CodingKey { - - case required = "required" - - case mapping = "mapping" - - case optional = "optional" - - case send = "send" - - case validations = "validations" - - case values = "values" - - case include = "include" - - case sourceField = "source_field" - - case sourceFields = "source_fields" - - case destinationField = "destination_field" - - case dataType = "data_type" - - case defaultValue = "default_value" - - case constValue = "const_value" - - case concatStr = "concat_str" - - case functionName = "function_name" - - case transformerName = "transformer_name" - - case allParamFunctionName = "all_param_function_name" - - case subSeparator = "sub_separator" - - case indexField = "index_field" - - case ignoreIfNotExists = "ignore_if_not_exists" - - case identifierType = "identifier_type" - - case projectionQuery = "projection_query" - - case enrichFromMaster = "enrich_from_master" - - } - - public init(allParamFunctionName: String?, concatStr: String?, constValue: [String: Any]?, dataType: String?, defaultValue: [String: Any]?, destinationField: String?, enrichFromMaster: Bool?, functionName: String?, identifierType: String?, ignoreIfNotExists: Bool?, include: Bool?, indexField: String?, mapping: [String: PropBeanConfig]?, optional: Bool?, projectionQuery: [String: Any]?, required: Bool?, send: Send?, sourceField: String?, sourceFields: [String]?, subSeparator: String?, transformerName: String?, validations: [[String: Any]]?, values: [String]?) { - - self.required = required - - self.mapping = mapping - - self.optional = optional - - self.send = send - - self.validations = validations - - self.values = values - - self.include = include - - self.sourceField = sourceField - - self.sourceFields = sourceFields - - self.destinationField = destinationField - - self.dataType = dataType - - self.defaultValue = defaultValue - - self.constValue = constValue - - self.concatStr = concatStr - - self.functionName = functionName - - self.transformerName = transformerName - - self.allParamFunctionName = allParamFunctionName - - self.subSeparator = subSeparator - - self.indexField = indexField - - self.ignoreIfNotExists = ignoreIfNotExists - - self.identifierType = identifierType - - self.projectionQuery = projectionQuery - - self.enrichFromMaster = enrichFromMaster - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - required = try container.decode(Bool.self, forKey: .required) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mapping = try container.decode([String: PropBeanConfig].self, forKey: .mapping) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - optional = try container.decode(Bool.self, forKey: .optional) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - send = try container.decode(Send.self, forKey: .send) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - validations = try container.decode([[String: Any]].self, forKey: .validations) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - values = try container.decode([String].self, forKey: .values) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - include = try container.decode(Bool.self, forKey: .include) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sourceField = try container.decode(String.self, forKey: .sourceField) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sourceFields = try container.decode([String].self, forKey: .sourceFields) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - destinationField = try container.decode(String.self, forKey: .destinationField) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dataType = try container.decode(String.self, forKey: .dataType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - defaultValue = try container.decode([String: Any].self, forKey: .defaultValue) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - constValue = try container.decode([String: Any].self, forKey: .constValue) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - concatStr = try container.decode(String.self, forKey: .concatStr) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - functionName = try container.decode(String.self, forKey: .functionName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - transformerName = try container.decode(String.self, forKey: .transformerName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allParamFunctionName = try container.decode(String.self, forKey: .allParamFunctionName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subSeparator = try container.decode(String.self, forKey: .subSeparator) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - indexField = try container.decode(String.self, forKey: .indexField) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ignoreIfNotExists = try container.decode(Bool.self, forKey: .ignoreIfNotExists) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - identifierType = try container.decode(String.self, forKey: .identifierType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - projectionQuery = try container.decode([String: Any].self, forKey: .projectionQuery) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enrichFromMaster = try container.decode(Bool.self, forKey: .enrichFromMaster) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(required, forKey: .required) - - - - try? container.encodeIfPresent(mapping, forKey: .mapping) - - - - try? container.encodeIfPresent(optional, forKey: .optional) - - - - try? container.encodeIfPresent(send, forKey: .send) - - - - try? container.encodeIfPresent(validations, forKey: .validations) - - - - try? container.encodeIfPresent(values, forKey: .values) - - - - try? container.encodeIfPresent(include, forKey: .include) - - - - try? container.encodeIfPresent(sourceField, forKey: .sourceField) - - - - try? container.encodeIfPresent(sourceFields, forKey: .sourceFields) - - - - try? container.encodeIfPresent(destinationField, forKey: .destinationField) - - - - try? container.encodeIfPresent(dataType, forKey: .dataType) - - - - try? container.encodeIfPresent(defaultValue, forKey: .defaultValue) - - - - try? container.encodeIfPresent(constValue, forKey: .constValue) - - - - try? container.encodeIfPresent(concatStr, forKey: .concatStr) - - - - try? container.encodeIfPresent(functionName, forKey: .functionName) - - - - try? container.encodeIfPresent(transformerName, forKey: .transformerName) - - - - try? container.encodeIfPresent(allParamFunctionName, forKey: .allParamFunctionName) - - - - try? container.encodeIfPresent(subSeparator, forKey: .subSeparator) - - - - try? container.encodeIfPresent(indexField, forKey: .indexField) - - - - try? container.encodeIfPresent(ignoreIfNotExists, forKey: .ignoreIfNotExists) - - - - try? container.encodeIfPresent(identifierType, forKey: .identifierType) - - - - try? container.encodeIfPresent(projectionQuery, forKey: .projectionQuery) - - - - try? container.encodeIfPresent(enrichFromMaster, forKey: .enrichFromMaster) - - - } - - } - - /* - Model: PropBeanDTO - Used By: Inventory - */ - - class PropBeanDTO: Codable { - - - public var required: Bool? - - public var optional: Bool? - - public var include: Bool? - - public var sourceField: String? - - public var sourceFields: [String]? - - public var destinationField: String? - - public var dataType: String? - - public var defaultValue: [String: Any]? - - public var constValue: [String: Any]? - - public var concatStr: String? - - public var functionName: String? - - public var transformerName: String? - - public var allParamFunctionName: String? - - public var subSeparator: String? - - public var indexField: String? - - public var ignoreIfNotExists: Bool? - - public var identifierType: String? - - public var projectionQuery: [String: Any]? - - public var enrichFromMaster: Bool? - - - public enum CodingKeys: String, CodingKey { - - case required = "required" - - case optional = "optional" - - case include = "include" - - case sourceField = "source_field" - - case sourceFields = "source_fields" - - case destinationField = "destination_field" - - case dataType = "data_type" - - case defaultValue = "default_value" - - case constValue = "const_value" - - case concatStr = "concat_str" - - case functionName = "function_name" - - case transformerName = "transformer_name" - - case allParamFunctionName = "all_param_function_name" - - case subSeparator = "sub_separator" - - case indexField = "index_field" - - case ignoreIfNotExists = "ignore_if_not_exists" - - case identifierType = "identifier_type" - - case projectionQuery = "projection_query" - - case enrichFromMaster = "enrich_from_master" - - } - - public init(allParamFunctionName: String?, concatStr: String?, constValue: [String: Any]?, dataType: String?, defaultValue: [String: Any]?, destinationField: String?, enrichFromMaster: Bool?, functionName: String?, identifierType: String?, ignoreIfNotExists: Bool?, include: Bool?, indexField: String?, optional: Bool?, projectionQuery: [String: Any]?, required: Bool?, sourceField: String?, sourceFields: [String]?, subSeparator: String?, transformerName: String?) { - - self.required = required - - self.optional = optional - - self.include = include - - self.sourceField = sourceField - - self.sourceFields = sourceFields - - self.destinationField = destinationField - - self.dataType = dataType - - self.defaultValue = defaultValue - - self.constValue = constValue - - self.concatStr = concatStr - - self.functionName = functionName - - self.transformerName = transformerName - - self.allParamFunctionName = allParamFunctionName - - self.subSeparator = subSeparator - - self.indexField = indexField - - self.ignoreIfNotExists = ignoreIfNotExists - - self.identifierType = identifierType - - self.projectionQuery = projectionQuery - - self.enrichFromMaster = enrichFromMaster - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - required = try container.decode(Bool.self, forKey: .required) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - optional = try container.decode(Bool.self, forKey: .optional) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - include = try container.decode(Bool.self, forKey: .include) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sourceField = try container.decode(String.self, forKey: .sourceField) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sourceFields = try container.decode([String].self, forKey: .sourceFields) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - destinationField = try container.decode(String.self, forKey: .destinationField) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dataType = try container.decode(String.self, forKey: .dataType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - defaultValue = try container.decode([String: Any].self, forKey: .defaultValue) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - constValue = try container.decode([String: Any].self, forKey: .constValue) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - concatStr = try container.decode(String.self, forKey: .concatStr) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - functionName = try container.decode(String.self, forKey: .functionName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - transformerName = try container.decode(String.self, forKey: .transformerName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allParamFunctionName = try container.decode(String.self, forKey: .allParamFunctionName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subSeparator = try container.decode(String.self, forKey: .subSeparator) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - indexField = try container.decode(String.self, forKey: .indexField) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ignoreIfNotExists = try container.decode(Bool.self, forKey: .ignoreIfNotExists) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - identifierType = try container.decode(String.self, forKey: .identifierType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - projectionQuery = try container.decode([String: Any].self, forKey: .projectionQuery) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enrichFromMaster = try container.decode(Bool.self, forKey: .enrichFromMaster) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(required, forKey: .required) - - - - try? container.encodeIfPresent(optional, forKey: .optional) - - - - try? container.encodeIfPresent(include, forKey: .include) - - - - try? container.encodeIfPresent(sourceField, forKey: .sourceField) - - - - try? container.encodeIfPresent(sourceFields, forKey: .sourceFields) - - - - try? container.encodeIfPresent(destinationField, forKey: .destinationField) - - - - try? container.encodeIfPresent(dataType, forKey: .dataType) - - - - try? container.encodeIfPresent(defaultValue, forKey: .defaultValue) - - - - try? container.encodeIfPresent(constValue, forKey: .constValue) - - - - try? container.encodeIfPresent(concatStr, forKey: .concatStr) - - - - try? container.encodeIfPresent(functionName, forKey: .functionName) - - - - try? container.encodeIfPresent(transformerName, forKey: .transformerName) - - - - try? container.encodeIfPresent(allParamFunctionName, forKey: .allParamFunctionName) - - - - try? container.encodeIfPresent(subSeparator, forKey: .subSeparator) - - - - try? container.encodeIfPresent(indexField, forKey: .indexField) - - - - try? container.encodeIfPresent(ignoreIfNotExists, forKey: .ignoreIfNotExists) - - - - try? container.encodeIfPresent(identifierType, forKey: .identifierType) - - - - try? container.encodeIfPresent(projectionQuery, forKey: .projectionQuery) - - - - try? container.encodeIfPresent(enrichFromMaster, forKey: .enrichFromMaster) - - - } - - } - - /* - Model: ResponseEnvelopeListJobConfigRawDTO - Used By: Inventory - */ - - class ResponseEnvelopeListJobConfigRawDTO: Codable { - - - public var timestamp: String? - - public var status: Int? - - public var error: String? - - public var exception: String? - - public var message: String? - - public var totalTimeTakenInMillis: Int? - - public var httpStatus: String? - - public var items: [JobConfigRawDTO]? - - public var payload: [JobConfigRawDTO]? - - public var traceId: String? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case timestamp = "timestamp" - - case status = "status" - - case error = "error" - - case exception = "exception" - - case message = "message" - - case totalTimeTakenInMillis = "total_time_taken_in_millis" - - case httpStatus = "http_status" - - case items = "items" - - case payload = "payload" - - case traceId = "trace_id" - - case page = "page" - - } - - public init(error: String?, exception: String?, httpStatus: String?, items: [JobConfigRawDTO]?, message: String?, page: Page?, payload: [JobConfigRawDTO]?, status: Int?, timestamp: String?, totalTimeTakenInMillis: Int?, traceId: String?) { - - self.timestamp = timestamp - - self.status = status - - self.error = error - - self.exception = exception - - self.message = message - - self.totalTimeTakenInMillis = totalTimeTakenInMillis - - self.httpStatus = httpStatus - - self.items = items - - self.payload = payload - - self.traceId = traceId - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - timestamp = try container.decode(String.self, forKey: .timestamp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(Int.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - error = try container.decode(String.self, forKey: .error) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - exception = try container.decode(String.self, forKey: .exception) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalTimeTakenInMillis = try container.decode(Int.self, forKey: .totalTimeTakenInMillis) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - httpStatus = try container.decode(String.self, forKey: .httpStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([JobConfigRawDTO].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - payload = try container.decode([JobConfigRawDTO].self, forKey: .payload) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - traceId = try container.decode(String.self, forKey: .traceId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(timestamp, forKey: .timestamp) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(error, forKey: .error) - - - - try? container.encodeIfPresent(exception, forKey: .exception) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(totalTimeTakenInMillis, forKey: .totalTimeTakenInMillis) - - - - try? container.encodeIfPresent(httpStatus, forKey: .httpStatus) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(payload, forKey: .payload) - - - - try? container.encodeIfPresent(traceId, forKey: .traceId) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: SFTPConfig - Used By: Inventory - */ - - class SFTPConfig: Codable { - - - public var host: String? - - public var port: Int? - - public var username: String? - - public var password: String? - - public var unzip: Bool? - - public var retries: Int? - - public var interval: Int? - - public var privateKeyPath: String? - - public var strictHostKeyChecking: Bool? - - public var localDir: String? - - public var remoteDir: String? - - public var passwordProtected: Bool? - - public var zipFileRegex: String? - - public var fileRegex: String? - - public var zipFormat: String? - - public var archiveConfig: ArchiveConfig? - - public var readAllFiles: Bool? - - - public enum CodingKeys: String, CodingKey { - - case host = "host" - - case port = "port" - - case username = "username" - - case password = "password" - - case unzip = "unzip" - - case retries = "retries" - - case interval = "interval" - - case privateKeyPath = "private_key_path" - - case strictHostKeyChecking = "strict_host_key_checking" - - case localDir = "local_dir" - - case remoteDir = "remote_dir" - - case passwordProtected = "password_protected" - - case zipFileRegex = "zip_file_regex" - - case fileRegex = "file_regex" - - case zipFormat = "zip_format" - - case archiveConfig = "archive_config" - - case readAllFiles = "read_all_files" - - } - - public init(archiveConfig: ArchiveConfig?, fileRegex: String?, host: String?, interval: Int?, localDir: String?, password: String?, passwordProtected: Bool?, port: Int?, privateKeyPath: String?, readAllFiles: Bool?, remoteDir: String?, retries: Int?, strictHostKeyChecking: Bool?, unzip: Bool?, username: String?, zipFileRegex: String?, zipFormat: String?) { - - self.host = host - - self.port = port - - self.username = username - - self.password = password - - self.unzip = unzip - - self.retries = retries - - self.interval = interval - - self.privateKeyPath = privateKeyPath - - self.strictHostKeyChecking = strictHostKeyChecking - - self.localDir = localDir - - self.remoteDir = remoteDir - - self.passwordProtected = passwordProtected - - self.zipFileRegex = zipFileRegex - - self.fileRegex = fileRegex - - self.zipFormat = zipFormat - - self.archiveConfig = archiveConfig - - self.readAllFiles = readAllFiles - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - host = try container.decode(String.self, forKey: .host) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - port = try container.decode(Int.self, forKey: .port) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - username = try container.decode(String.self, forKey: .username) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - password = try container.decode(String.self, forKey: .password) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - unzip = try container.decode(Bool.self, forKey: .unzip) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - retries = try container.decode(Int.self, forKey: .retries) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - interval = try container.decode(Int.self, forKey: .interval) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - privateKeyPath = try container.decode(String.self, forKey: .privateKeyPath) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - strictHostKeyChecking = try container.decode(Bool.self, forKey: .strictHostKeyChecking) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - localDir = try container.decode(String.self, forKey: .localDir) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - remoteDir = try container.decode(String.self, forKey: .remoteDir) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - passwordProtected = try container.decode(Bool.self, forKey: .passwordProtected) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - zipFileRegex = try container.decode(String.self, forKey: .zipFileRegex) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fileRegex = try container.decode(String.self, forKey: .fileRegex) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - zipFormat = try container.decode(String.self, forKey: .zipFormat) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - archiveConfig = try container.decode(ArchiveConfig.self, forKey: .archiveConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - readAllFiles = try container.decode(Bool.self, forKey: .readAllFiles) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(host, forKey: .host) - - - - try? container.encodeIfPresent(port, forKey: .port) - - - - try? container.encodeIfPresent(username, forKey: .username) - - - - try? container.encodeIfPresent(password, forKey: .password) - - - - try? container.encodeIfPresent(unzip, forKey: .unzip) - - - - try? container.encodeIfPresent(retries, forKey: .retries) - - - - try? container.encodeIfPresent(interval, forKey: .interval) - - - - try? container.encodeIfPresent(privateKeyPath, forKey: .privateKeyPath) - - - - try? container.encodeIfPresent(strictHostKeyChecking, forKey: .strictHostKeyChecking) - - - - try? container.encodeIfPresent(localDir, forKey: .localDir) - - - - try? container.encodeIfPresent(remoteDir, forKey: .remoteDir) - - - - try? container.encodeIfPresent(passwordProtected, forKey: .passwordProtected) - - - - try? container.encodeIfPresent(zipFileRegex, forKey: .zipFileRegex) - - - - try? container.encodeIfPresent(fileRegex, forKey: .fileRegex) - - - - try? container.encodeIfPresent(zipFormat, forKey: .zipFormat) - - - - try? container.encodeIfPresent(archiveConfig, forKey: .archiveConfig) - - - - try? container.encodeIfPresent(readAllFiles, forKey: .readAllFiles) - - - } - - } - - /* - Model: Send - Used By: Inventory - */ - - class Send: Codable { - - - public var raw: Bool? - - public var processed: Bool? - - - public enum CodingKeys: String, CodingKey { - - case raw = "raw" - - case processed = "processed" - - } - - public init(processed: Bool?, raw: Bool?) { - - self.raw = raw - - self.processed = processed - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - raw = try container.decode(Bool.self, forKey: .raw) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - processed = try container.decode(Bool.self, forKey: .processed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(raw, forKey: .raw) - - - - try? container.encodeIfPresent(processed, forKey: .processed) - - - } - - } - - /* - Model: StoreConfig - Used By: Inventory - */ - - class StoreConfig: Codable { - - - public var jobCode: String? - - public var storeid: String? - - public var storeAlias: String? - - public var storeFileRegex: String? - - public var storeFileName: String? - - public var processConfig: ProcessConfig? - - public var properties: [String: String]? - - - public enum CodingKeys: String, CodingKey { - - case jobCode = "job_code" - - case storeid = "storeid" - - case storeAlias = "store_alias" - - case storeFileRegex = "store_file_regex" - - case storeFileName = "store_file_name" - - case processConfig = "process_config" - - case properties = "properties" - - } - - public init(jobCode: String?, processConfig: ProcessConfig?, properties: [String: String]?, storeid: String?, storeAlias: String?, storeFileName: String?, storeFileRegex: String?) { - - self.jobCode = jobCode - - self.storeid = storeid - - self.storeAlias = storeAlias - - self.storeFileRegex = storeFileRegex - - self.storeFileName = storeFileName - - self.processConfig = processConfig - - self.properties = properties - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - jobCode = try container.decode(String.self, forKey: .jobCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeid = try container.decode(String.self, forKey: .storeid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeAlias = try container.decode(String.self, forKey: .storeAlias) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeFileRegex = try container.decode(String.self, forKey: .storeFileRegex) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeFileName = try container.decode(String.self, forKey: .storeFileName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - processConfig = try container.decode(ProcessConfig.self, forKey: .processConfig) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - properties = try container.decode([String: String].self, forKey: .properties) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(jobCode, forKey: .jobCode) - - - - try? container.encodeIfPresent(storeid, forKey: .storeid) - - - - try? container.encodeIfPresent(storeAlias, forKey: .storeAlias) - - - - try? container.encodeIfPresent(storeFileRegex, forKey: .storeFileRegex) - - - - try? container.encodeIfPresent(storeFileName, forKey: .storeFileName) - - - - try? container.encodeIfPresent(processConfig, forKey: .processConfig) - - - - try? container.encodeIfPresent(properties, forKey: .properties) - - - } - - } - - /* - Model: StoreFilter - Used By: Inventory - */ - - class StoreFilter: Codable { - - - public var includeTags: [String]? - - public var excludeTags: [String]? - - public var query: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case includeTags = "include_tags" - - case excludeTags = "exclude_tags" - - case query = "query" - - } - - public init(excludeTags: [String]?, includeTags: [String]?, query: [String: Any]?) { - - self.includeTags = includeTags - - self.excludeTags = excludeTags - - self.query = query - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - includeTags = try container.decode([String].self, forKey: .includeTags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - excludeTags = try container.decode([String].self, forKey: .excludeTags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - query = try container.decode([String: Any].self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(includeTags, forKey: .includeTags) - - - - try? container.encodeIfPresent(excludeTags, forKey: .excludeTags) - - - - try? container.encodeIfPresent(query, forKey: .query) - - - } - - } - - /* - Model: TaskConfig - Used By: Inventory - */ - - class TaskConfig: Codable { - - - public var name: String? - - public var taskConfigId: Int? - - public var taskParams: [TaskParam]? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case taskConfigId = "task_config_id" - - case taskParams = "task_params" - - } - - public init(name: String?, taskConfigId: Int?, taskParams: [TaskParam]?) { - - self.name = name - - self.taskConfigId = taskConfigId - - self.taskParams = taskParams - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - taskConfigId = try container.decode(Int.self, forKey: .taskConfigId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - taskParams = try container.decode([TaskParam].self, forKey: .taskParams) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(taskConfigId, forKey: .taskConfigId) - - - - try? container.encodeIfPresent(taskParams, forKey: .taskParams) - - - } - - } - - /* - Model: TaskParam - Used By: Inventory - */ - - class TaskParam: Codable { - - - public var name: String? - - public var value: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case value = "value" - - } - - public init(name: String?, value: [String: Any]?) { - - self.name = name - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode([String: Any].self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: TaskStepConfig - Used By: Inventory - */ - - class TaskStepConfig: Codable { - - - public var taskConfigs: [TaskConfig]? - - public var taskConfigIds: [Int]? - - public var taskConfigGroupIds: [Int]? - - - public enum CodingKeys: String, CodingKey { - - case taskConfigs = "task_configs" - - case taskConfigIds = "task_config_ids" - - case taskConfigGroupIds = "task_config_group_ids" - - } - - public init(taskConfigs: [TaskConfig]?, taskConfigGroupIds: [Int]?, taskConfigIds: [Int]?) { - - self.taskConfigs = taskConfigs - - self.taskConfigIds = taskConfigIds - - self.taskConfigGroupIds = taskConfigGroupIds - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - taskConfigs = try container.decode([TaskConfig].self, forKey: .taskConfigs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - taskConfigIds = try container.decode([Int].self, forKey: .taskConfigIds) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - taskConfigGroupIds = try container.decode([Int].self, forKey: .taskConfigGroupIds) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(taskConfigs, forKey: .taskConfigs) - - - - try? container.encodeIfPresent(taskConfigIds, forKey: .taskConfigIds) - - - - try? container.encodeIfPresent(taskConfigGroupIds, forKey: .taskConfigGroupIds) - - - } - - } - - /* - Model: ResponseEnvelopeListJobConfigDTO - Used By: Inventory - */ - - class ResponseEnvelopeListJobConfigDTO: Codable { - - - public var timestamp: String? - - public var status: Int? - - public var error: String? - - public var exception: String? - - public var message: String? - - public var totalTimeTakenInMillis: Int? - - public var httpStatus: String? - - public var items: [JobConfigDTO]? - - public var payload: [JobConfigDTO]? - - public var traceId: String? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case timestamp = "timestamp" - - case status = "status" - - case error = "error" - - case exception = "exception" - - case message = "message" - - case totalTimeTakenInMillis = "total_time_taken_in_millis" - - case httpStatus = "http_status" - - case items = "items" - - case payload = "payload" - - case traceId = "trace_id" - - case page = "page" - - } - - public init(error: String?, exception: String?, httpStatus: String?, items: [JobConfigDTO]?, message: String?, page: Page?, payload: [JobConfigDTO]?, status: Int?, timestamp: String?, totalTimeTakenInMillis: Int?, traceId: String?) { - - self.timestamp = timestamp - - self.status = status - - self.error = error - - self.exception = exception - - self.message = message - - self.totalTimeTakenInMillis = totalTimeTakenInMillis - - self.httpStatus = httpStatus - - self.items = items - - self.payload = payload - - self.traceId = traceId - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - timestamp = try container.decode(String.self, forKey: .timestamp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(Int.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - error = try container.decode(String.self, forKey: .error) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - exception = try container.decode(String.self, forKey: .exception) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalTimeTakenInMillis = try container.decode(Int.self, forKey: .totalTimeTakenInMillis) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - httpStatus = try container.decode(String.self, forKey: .httpStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([JobConfigDTO].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - payload = try container.decode([JobConfigDTO].self, forKey: .payload) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - traceId = try container.decode(String.self, forKey: .traceId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(timestamp, forKey: .timestamp) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(error, forKey: .error) - - - - try? container.encodeIfPresent(exception, forKey: .exception) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(totalTimeTakenInMillis, forKey: .totalTimeTakenInMillis) - - - - try? container.encodeIfPresent(httpStatus, forKey: .httpStatus) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(payload, forKey: .payload) - - - - try? container.encodeIfPresent(traceId, forKey: .traceId) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: ResponseEnvelopeJobConfigDTO - Used By: Inventory - */ - - class ResponseEnvelopeJobConfigDTO: Codable { - - - public var timestamp: String? - - public var status: Int? - - public var error: String? - - public var exception: String? - - public var message: String? - - public var totalTimeTakenInMillis: Int? - - public var httpStatus: String? - - public var items: JobConfigDTO? - - public var payload: JobConfigDTO? - - public var traceId: String? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case timestamp = "timestamp" - - case status = "status" - - case error = "error" - - case exception = "exception" - - case message = "message" - - case totalTimeTakenInMillis = "total_time_taken_in_millis" - - case httpStatus = "http_status" - - case items = "items" - - case payload = "payload" - - case traceId = "trace_id" - - case page = "page" - - } - - public init(error: String?, exception: String?, httpStatus: String?, items: JobConfigDTO?, message: String?, page: Page?, payload: JobConfigDTO?, status: Int?, timestamp: String?, totalTimeTakenInMillis: Int?, traceId: String?) { - - self.timestamp = timestamp - - self.status = status - - self.error = error - - self.exception = exception - - self.message = message - - self.totalTimeTakenInMillis = totalTimeTakenInMillis - - self.httpStatus = httpStatus - - self.items = items - - self.payload = payload - - self.traceId = traceId - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - timestamp = try container.decode(String.self, forKey: .timestamp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(Int.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - error = try container.decode(String.self, forKey: .error) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - exception = try container.decode(String.self, forKey: .exception) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalTimeTakenInMillis = try container.decode(Int.self, forKey: .totalTimeTakenInMillis) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - httpStatus = try container.decode(String.self, forKey: .httpStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode(JobConfigDTO.self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - payload = try container.decode(JobConfigDTO.self, forKey: .payload) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - traceId = try container.decode(String.self, forKey: .traceId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(timestamp, forKey: .timestamp) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(error, forKey: .error) - - - - try? container.encodeIfPresent(exception, forKey: .exception) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(totalTimeTakenInMillis, forKey: .totalTimeTakenInMillis) - - - - try? container.encodeIfPresent(httpStatus, forKey: .httpStatus) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(payload, forKey: .payload) - - - - try? container.encodeIfPresent(traceId, forKey: .traceId) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: JobHistoryDto - Used By: Inventory - */ - - class JobHistoryDto: Codable { - - - public var totalAddedCount: Int? - - public var totalUpdatedCount: Int? - - public var totalSuppressedCount: Int? - - public var jobId: Int? - - public var status: String? - - public var jobCode: String? - - public var processedOn: String? - - public var filename: [String]? - - - public enum CodingKeys: String, CodingKey { - - case totalAddedCount = "total_added_count" - - case totalUpdatedCount = "total_updated_count" - - case totalSuppressedCount = "total_suppressed_count" - - case jobId = "job_id" - - case status = "status" - - case jobCode = "job_code" - - case processedOn = "processed_on" - - case filename = "filename" - - } - - public init(filename: [String]?, jobCode: String?, jobId: Int?, processedOn: String?, status: String?, totalAddedCount: Int?, totalSuppressedCount: Int?, totalUpdatedCount: Int?) { - - self.totalAddedCount = totalAddedCount - - self.totalUpdatedCount = totalUpdatedCount - - self.totalSuppressedCount = totalSuppressedCount - - self.jobId = jobId - - self.status = status - - self.jobCode = jobCode - - self.processedOn = processedOn - - self.filename = filename - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - totalAddedCount = try container.decode(Int.self, forKey: .totalAddedCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalUpdatedCount = try container.decode(Int.self, forKey: .totalUpdatedCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalSuppressedCount = try container.decode(Int.self, forKey: .totalSuppressedCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - jobId = try container.decode(Int.self, forKey: .jobId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - jobCode = try container.decode(String.self, forKey: .jobCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - processedOn = try container.decode(String.self, forKey: .processedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - filename = try container.decode([String].self, forKey: .filename) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(totalAddedCount, forKey: .totalAddedCount) - - - - try? container.encodeIfPresent(totalUpdatedCount, forKey: .totalUpdatedCount) - - - - try? container.encodeIfPresent(totalSuppressedCount, forKey: .totalSuppressedCount) - - - - try? container.encodeIfPresent(jobId, forKey: .jobId) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(jobCode, forKey: .jobCode) - - - - try? container.encodeIfPresent(processedOn, forKey: .processedOn) - - - - try? container.encodeIfPresent(filename, forKey: .filename) - - - } - - } - - /* - Model: JobMetricsDto - Used By: Inventory - */ - - class JobMetricsDto: Codable { - - - public var jobCode: String? - - public var isRunMoreThanUsual: String? - - public var jobHistory: [JobHistoryDto]? - - public var totalSuccessCount: Int? - - public var totalFailureCount: Int? - - public var totalWarningCount: Int? - - public var totalSuppressedCount: Int? - - public var totalJobRuns: Int? - - - public enum CodingKeys: String, CodingKey { - - case jobCode = "job_code" - - case isRunMoreThanUsual = "is_run_more_than_usual" - - case jobHistory = "job_history" - - case totalSuccessCount = "total_success_count" - - case totalFailureCount = "total_failure_count" - - case totalWarningCount = "total_warning_count" - - case totalSuppressedCount = "total_suppressed_count" - - case totalJobRuns = "total_job_runs" - - } - - public init(isRunMoreThanUsual: String?, jobCode: String?, jobHistory: [JobHistoryDto]?, totalFailureCount: Int?, totalJobRuns: Int?, totalSuccessCount: Int?, totalSuppressedCount: Int?, totalWarningCount: Int?) { - - self.jobCode = jobCode - - self.isRunMoreThanUsual = isRunMoreThanUsual - - self.jobHistory = jobHistory - - self.totalSuccessCount = totalSuccessCount - - self.totalFailureCount = totalFailureCount - - self.totalWarningCount = totalWarningCount - - self.totalSuppressedCount = totalSuppressedCount - - self.totalJobRuns = totalJobRuns - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - jobCode = try container.decode(String.self, forKey: .jobCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isRunMoreThanUsual = try container.decode(String.self, forKey: .isRunMoreThanUsual) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - jobHistory = try container.decode([JobHistoryDto].self, forKey: .jobHistory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalSuccessCount = try container.decode(Int.self, forKey: .totalSuccessCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalFailureCount = try container.decode(Int.self, forKey: .totalFailureCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalWarningCount = try container.decode(Int.self, forKey: .totalWarningCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalSuppressedCount = try container.decode(Int.self, forKey: .totalSuppressedCount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalJobRuns = try container.decode(Int.self, forKey: .totalJobRuns) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(jobCode, forKey: .jobCode) - - - - try? container.encodeIfPresent(isRunMoreThanUsual, forKey: .isRunMoreThanUsual) - - - - try? container.encodeIfPresent(jobHistory, forKey: .jobHistory) - - - - try? container.encodeIfPresent(totalSuccessCount, forKey: .totalSuccessCount) - - - - try? container.encodeIfPresent(totalFailureCount, forKey: .totalFailureCount) - - - - try? container.encodeIfPresent(totalWarningCount, forKey: .totalWarningCount) - - - - try? container.encodeIfPresent(totalSuppressedCount, forKey: .totalSuppressedCount) - - - - try? container.encodeIfPresent(totalJobRuns, forKey: .totalJobRuns) - - - } - - } - - /* - Model: ResponseEnvelopeJobMetricsDto - Used By: Inventory - */ - - class ResponseEnvelopeJobMetricsDto: Codable { - - - public var timestamp: String? - - public var status: Int? - - public var error: String? - - public var exception: String? - - public var message: String? - - public var totalTimeTakenInMillis: Int? - - public var httpStatus: String? - - public var items: JobMetricsDto? - - public var payload: JobMetricsDto? - - public var traceId: String? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case timestamp = "timestamp" - - case status = "status" - - case error = "error" - - case exception = "exception" - - case message = "message" - - case totalTimeTakenInMillis = "total_time_taken_in_millis" - - case httpStatus = "http_status" - - case items = "items" - - case payload = "payload" - - case traceId = "trace_id" - - case page = "page" - - } - - public init(error: String?, exception: String?, httpStatus: String?, items: JobMetricsDto?, message: String?, page: Page?, payload: JobMetricsDto?, status: Int?, timestamp: String?, totalTimeTakenInMillis: Int?, traceId: String?) { - - self.timestamp = timestamp - - self.status = status - - self.error = error - - self.exception = exception - - self.message = message - - self.totalTimeTakenInMillis = totalTimeTakenInMillis - - self.httpStatus = httpStatus - - self.items = items - - self.payload = payload - - self.traceId = traceId - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - timestamp = try container.decode(String.self, forKey: .timestamp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(Int.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - error = try container.decode(String.self, forKey: .error) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - exception = try container.decode(String.self, forKey: .exception) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalTimeTakenInMillis = try container.decode(Int.self, forKey: .totalTimeTakenInMillis) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - httpStatus = try container.decode(String.self, forKey: .httpStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode(JobMetricsDto.self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - payload = try container.decode(JobMetricsDto.self, forKey: .payload) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - traceId = try container.decode(String.self, forKey: .traceId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(timestamp, forKey: .timestamp) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(error, forKey: .error) - - - - try? container.encodeIfPresent(exception, forKey: .exception) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(totalTimeTakenInMillis, forKey: .totalTimeTakenInMillis) - - - - try? container.encodeIfPresent(httpStatus, forKey: .httpStatus) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(payload, forKey: .payload) - - - - try? container.encodeIfPresent(traceId, forKey: .traceId) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: JobConfigListDTO - Used By: Inventory - */ - - class JobConfigListDTO: Codable { - - - public var code: String? - - public var alias: String? - - public var modifiedBy: String? - - public var createdBy: String? - - public var modifiedOn: String? - - public var createdOn: String? - - public var active: Bool? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case code = "code" - - case alias = "alias" - - case modifiedBy = "modified_by" - - case createdBy = "created_by" - - case modifiedOn = "modified_on" - - case createdOn = "created_on" - - case active = "active" - - case type = "type" - - } - - public init(active: Bool?, alias: String?, code: String?, createdBy: String?, createdOn: String?, modifiedBy: String?, modifiedOn: String?, type: String?) { - - self.code = code - - self.alias = alias - - self.modifiedBy = modifiedBy - - self.createdBy = createdBy - - self.modifiedOn = modifiedOn - - self.createdOn = createdOn - - self.active = active - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - alias = try container.decode(String.self, forKey: .alias) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode(String.self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdBy = try container.decode(String.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(alias, forKey: .alias) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ResponseEnvelopeListJobConfigListDTO - Used By: Inventory - */ - - class ResponseEnvelopeListJobConfigListDTO: Codable { - - - public var timestamp: String? - - public var status: Int? - - public var error: String? - - public var exception: String? - - public var message: String? - - public var totalTimeTakenInMillis: Int? - - public var httpStatus: String? - - public var items: [JobConfigListDTO]? - - public var payload: [JobConfigListDTO]? - - public var traceId: String? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case timestamp = "timestamp" - - case status = "status" - - case error = "error" - - case exception = "exception" - - case message = "message" - - case totalTimeTakenInMillis = "total_time_taken_in_millis" - - case httpStatus = "http_status" - - case items = "items" - - case payload = "payload" - - case traceId = "trace_id" - - case page = "page" - - } - - public init(error: String?, exception: String?, httpStatus: String?, items: [JobConfigListDTO]?, message: String?, page: Page?, payload: [JobConfigListDTO]?, status: Int?, timestamp: String?, totalTimeTakenInMillis: Int?, traceId: String?) { - - self.timestamp = timestamp - - self.status = status - - self.error = error - - self.exception = exception - - self.message = message - - self.totalTimeTakenInMillis = totalTimeTakenInMillis - - self.httpStatus = httpStatus - - self.items = items - - self.payload = payload - - self.traceId = traceId - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - timestamp = try container.decode(String.self, forKey: .timestamp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(Int.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - error = try container.decode(String.self, forKey: .error) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - exception = try container.decode(String.self, forKey: .exception) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - totalTimeTakenInMillis = try container.decode(Int.self, forKey: .totalTimeTakenInMillis) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - httpStatus = try container.decode(String.self, forKey: .httpStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([JobConfigListDTO].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - payload = try container.decode([JobConfigListDTO].self, forKey: .payload) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - traceId = try container.decode(String.self, forKey: .traceId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(timestamp, forKey: .timestamp) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(error, forKey: .error) - - - - try? container.encodeIfPresent(exception, forKey: .exception) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(totalTimeTakenInMillis, forKey: .totalTimeTakenInMillis) - - - - try? container.encodeIfPresent(httpStatus, forKey: .httpStatus) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(payload, forKey: .payload) - - - - try? container.encodeIfPresent(traceId, forKey: .traceId) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - - - /* - Model: ApplicationInventory - Used By: Configuration - */ - - class ApplicationInventory: Codable { - - - public var inventory: AppInventoryConfig? - - public var authentication: AuthenticationConfig? - - public var articleAssignment: ArticleAssignmentConfig? - - public var rewardPoints: RewardPointsConfig? - - public var cart: AppCartConfig? - - public var payment: AppPaymentConfig? - - public var order: AppOrderConfig? - - public var logistics: AppLogisticsConfig? - - public var business: String? - - public var commsEnabled: Bool? - - public var platforms: [String]? - - public var id: String? - - public var loyaltyPoints: LoyaltyPointsConfig? - - public var app: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var modifiedBy: String? - - - public enum CodingKeys: String, CodingKey { - - case inventory = "inventory" - - case authentication = "authentication" - - case articleAssignment = "article_assignment" - - case rewardPoints = "reward_points" - - case cart = "cart" - - case payment = "payment" - - case order = "order" - - case logistics = "logistics" - - case business = "business" - - case commsEnabled = "comms_enabled" - - case platforms = "platforms" - - case id = "_id" - - case loyaltyPoints = "loyalty_points" - - case app = "app" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case modifiedBy = "modified_by" - - } - - public init(app: String?, articleAssignment: ArticleAssignmentConfig?, authentication: AuthenticationConfig?, business: String?, cart: AppCartConfig?, commsEnabled: Bool?, createdAt: String?, inventory: AppInventoryConfig?, logistics: AppLogisticsConfig?, loyaltyPoints: LoyaltyPointsConfig?, modifiedBy: String?, order: AppOrderConfig?, payment: AppPaymentConfig?, platforms: [String]?, rewardPoints: RewardPointsConfig?, updatedAt: String?, id: String?) { - - self.inventory = inventory - - self.authentication = authentication - - self.articleAssignment = articleAssignment - - self.rewardPoints = rewardPoints - - self.cart = cart - - self.payment = payment - - self.order = order - - self.logistics = logistics - - self.business = business - - self.commsEnabled = commsEnabled - - self.platforms = platforms - - self.id = id - - self.loyaltyPoints = loyaltyPoints - - self.app = app - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.modifiedBy = modifiedBy - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - inventory = try container.decode(AppInventoryConfig.self, forKey: .inventory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - authentication = try container.decode(AuthenticationConfig.self, forKey: .authentication) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - articleAssignment = try container.decode(ArticleAssignmentConfig.self, forKey: .articleAssignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rewardPoints = try container.decode(RewardPointsConfig.self, forKey: .rewardPoints) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cart = try container.decode(AppCartConfig.self, forKey: .cart) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - payment = try container.decode(AppPaymentConfig.self, forKey: .payment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - order = try container.decode(AppOrderConfig.self, forKey: .order) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logistics = try container.decode(AppLogisticsConfig.self, forKey: .logistics) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - business = try container.decode(String.self, forKey: .business) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - commsEnabled = try container.decode(Bool.self, forKey: .commsEnabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platforms = try container.decode([String].self, forKey: .platforms) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - loyaltyPoints = try container.decode(LoyaltyPointsConfig.self, forKey: .loyaltyPoints) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - app = try container.decode(String.self, forKey: .app) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode(String.self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(inventory, forKey: .inventory) - - - - try? container.encodeIfPresent(authentication, forKey: .authentication) - - - - try? container.encodeIfPresent(articleAssignment, forKey: .articleAssignment) - - - - try? container.encodeIfPresent(rewardPoints, forKey: .rewardPoints) - - - - try? container.encodeIfPresent(cart, forKey: .cart) - - - - try? container.encodeIfPresent(payment, forKey: .payment) - - - - try? container.encodeIfPresent(order, forKey: .order) - - - - try? container.encodeIfPresent(logistics, forKey: .logistics) - - - - try? container.encodeIfPresent(business, forKey: .business) - - - - try? container.encodeIfPresent(commsEnabled, forKey: .commsEnabled) - - - - try? container.encodeIfPresent(platforms, forKey: .platforms) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(loyaltyPoints, forKey: .loyaltyPoints) - - - - try? container.encodeIfPresent(app, forKey: .app) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - } - - } - - /* - Model: AppInventoryConfig - Used By: Configuration - */ - - class AppInventoryConfig: Codable { - - - public var brand: InventoryBrand? - - public var store: InventoryStore? - - public var category: InventoryCategory? - - public var price: InventoryPrice? - - public var discount: InventoryDiscount? - - public var outOfStock: Bool? - - public var franchiseEnabled: Bool? - - public var excludeCategory: [[String: Any]]? - - public var image: [String]? - - public var companyStore: [[String: Any]]? - - - public enum CodingKeys: String, CodingKey { - - case brand = "brand" - - case store = "store" - - case category = "category" - - case price = "price" - - case discount = "discount" - - case outOfStock = "out_of_stock" - - case franchiseEnabled = "franchise_enabled" - - case excludeCategory = "exclude_category" - - case image = "image" - - case companyStore = "company_store" - - } - - public init(brand: InventoryBrand?, category: InventoryCategory?, companyStore: [[String: Any]]?, discount: InventoryDiscount?, excludeCategory: [[String: Any]]?, franchiseEnabled: Bool?, image: [String]?, outOfStock: Bool?, price: InventoryPrice?, store: InventoryStore?) { - - self.brand = brand - - self.store = store - - self.category = category - - self.price = price - - self.discount = discount - - self.outOfStock = outOfStock - - self.franchiseEnabled = franchiseEnabled - - self.excludeCategory = excludeCategory - - self.image = image - - self.companyStore = companyStore - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - brand = try container.decode(InventoryBrand.self, forKey: .brand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - store = try container.decode(InventoryStore.self, forKey: .store) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - category = try container.decode(InventoryCategory.self, forKey: .category) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(InventoryPrice.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discount = try container.decode(InventoryDiscount.self, forKey: .discount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - outOfStock = try container.decode(Bool.self, forKey: .outOfStock) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - franchiseEnabled = try container.decode(Bool.self, forKey: .franchiseEnabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - excludeCategory = try container.decode([[String: Any]].self, forKey: .excludeCategory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - image = try container.decode([String].self, forKey: .image) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyStore = try container.decode([[String: Any]].self, forKey: .companyStore) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(brand, forKey: .brand) - - - - try? container.encodeIfPresent(store, forKey: .store) - - - - try? container.encodeIfPresent(category, forKey: .category) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - - try? container.encodeIfPresent(outOfStock, forKey: .outOfStock) - - - - try? container.encodeIfPresent(franchiseEnabled, forKey: .franchiseEnabled) - - - - try? container.encodeIfPresent(excludeCategory, forKey: .excludeCategory) - - - - try? container.encodeIfPresent(image, forKey: .image) - - - - try? container.encodeIfPresent(companyStore, forKey: .companyStore) - - - } - - } - - /* - Model: InventoryBrand - Used By: Configuration - */ - - class InventoryBrand: Codable { - - - public var criteria: String? - - public var brands: [[String: Any]]? - - - public enum CodingKeys: String, CodingKey { - - case criteria = "criteria" - - case brands = "brands" - - } - - public init(brands: [[String: Any]]?, criteria: String?) { - - self.criteria = criteria - - self.brands = brands - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - criteria = try container.decode(String.self, forKey: .criteria) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brands = try container.decode([[String: Any]].self, forKey: .brands) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(criteria, forKey: .criteria) - - - - try? container.encodeIfPresent(brands, forKey: .brands) - - - } - - } - - /* - Model: InventoryStore - Used By: Configuration - */ - - class InventoryStore: Codable { - - - public var criteria: String? - - public var stores: [[String: Any]]? - - public var rules: AppStoreRules? - - - public enum CodingKeys: String, CodingKey { - - case criteria = "criteria" - - case stores = "stores" - - case rules = "rules" - - } - - public init(criteria: String?, rules: AppStoreRules?, stores: [[String: Any]]?) { - - self.criteria = criteria - - self.stores = stores - - self.rules = rules - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - criteria = try container.decode(String.self, forKey: .criteria) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stores = try container.decode([[String: Any]].self, forKey: .stores) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rules = try container.decode(AppStoreRules.self, forKey: .rules) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(criteria, forKey: .criteria) - - - - try? container.encodeIfPresent(stores, forKey: .stores) - - - - try? container.encodeIfPresent(rules, forKey: .rules) - - - } - - } - - /* - Model: AppStoreRules - Used By: Configuration - */ - - class AppStoreRules: Codable { - - - public var companies: [Int]? - - public var brands: [[String: Any]]? - - - public enum CodingKeys: String, CodingKey { - - case companies = "companies" - - case brands = "brands" - - } - - public init(brands: [[String: Any]]?, companies: [Int]?) { - - self.companies = companies - - self.brands = brands - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - companies = try container.decode([Int].self, forKey: .companies) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brands = try container.decode([[String: Any]].self, forKey: .brands) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(companies, forKey: .companies) - - - - try? container.encodeIfPresent(brands, forKey: .brands) - - - } - - } - - /* - Model: InventoryCategory - Used By: Configuration - */ - - class InventoryCategory: Codable { - - - public var criteria: String? - - public var categories: [[String: Any]]? - - - public enum CodingKeys: String, CodingKey { - - case criteria = "criteria" - - case categories = "categories" - - } - - public init(categories: [[String: Any]]?, criteria: String?) { - - self.criteria = criteria - - self.categories = categories - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - criteria = try container.decode(String.self, forKey: .criteria) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - categories = try container.decode([[String: Any]].self, forKey: .categories) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(criteria, forKey: .criteria) - - - - try? container.encodeIfPresent(categories, forKey: .categories) - - - } - - } - - /* - Model: InventoryPrice - Used By: Configuration - */ - - class InventoryPrice: Codable { - - - public var min: Double? - - public var max: Double? - - - public enum CodingKeys: String, CodingKey { - - case min = "min" - - case max = "max" - - } - - public init(max: Double?, min: Double?) { - - self.min = min - - self.max = max - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - min = try container.decode(Double.self, forKey: .min) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - max = try container.decode(Double.self, forKey: .max) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(min, forKey: .min) - - - - try? container.encodeIfPresent(max, forKey: .max) - - - } - - } - - /* - Model: InventoryDiscount - Used By: Configuration - */ - - class InventoryDiscount: Codable { - - - public var min: Double? - - public var max: Double? - - - public enum CodingKeys: String, CodingKey { - - case min = "min" - - case max = "max" - - } - - public init(max: Double?, min: Double?) { - - self.min = min - - self.max = max - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - min = try container.decode(Double.self, forKey: .min) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - max = try container.decode(Double.self, forKey: .max) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(min, forKey: .min) - - - - try? container.encodeIfPresent(max, forKey: .max) - - - } - - } - - /* - Model: AuthenticationConfig - Used By: Configuration - */ - - class AuthenticationConfig: Codable { - - - public var required: Bool? - - public var provider: String? - - - public enum CodingKeys: String, CodingKey { - - case required = "required" - - case provider = "provider" - - } - - public init(provider: String?, required: Bool?) { - - self.required = required - - self.provider = provider - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - required = try container.decode(Bool.self, forKey: .required) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - provider = try container.decode(String.self, forKey: .provider) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(required, forKey: .required) - - - - try? container.encodeIfPresent(provider, forKey: .provider) - - - } - - } - - /* - Model: ArticleAssignmentConfig - Used By: Configuration - */ - - class ArticleAssignmentConfig: Codable { - - - public var rules: ArticleAssignmentRules? - - public var postOrderReassignment: Bool? - - - public enum CodingKeys: String, CodingKey { - - case rules = "rules" - - case postOrderReassignment = "post_order_reassignment" - - } - - public init(postOrderReassignment: Bool?, rules: ArticleAssignmentRules?) { - - self.rules = rules - - self.postOrderReassignment = postOrderReassignment - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - rules = try container.decode(ArticleAssignmentRules.self, forKey: .rules) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - postOrderReassignment = try container.decode(Bool.self, forKey: .postOrderReassignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(rules, forKey: .rules) - - - - try? container.encodeIfPresent(postOrderReassignment, forKey: .postOrderReassignment) - - - } - - } - - /* - Model: ArticleAssignmentRules - Used By: Configuration - */ - - class ArticleAssignmentRules: Codable { - - - public var storePriority: StorePriority? - - - public enum CodingKeys: String, CodingKey { - - case storePriority = "store_priority" - - } - - public init(storePriority: StorePriority?) { - - self.storePriority = storePriority - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - storePriority = try container.decode(StorePriority.self, forKey: .storePriority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(storePriority, forKey: .storePriority) - - - } - - } - - /* - Model: StorePriority - Used By: Configuration - */ - - class StorePriority: Codable { - - - public var enabled: Bool? - - public var storetypeOrder: [[String: Any]]? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - case storetypeOrder = "storetype_order" - - } - - public init(enabled: Bool?, storetypeOrder: [[String: Any]]?) { - - self.enabled = enabled - - self.storetypeOrder = storetypeOrder - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storetypeOrder = try container.decode([[String: Any]].self, forKey: .storetypeOrder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(storetypeOrder, forKey: .storetypeOrder) - - - } - - } - - /* - Model: AppCartConfig - Used By: Configuration - */ - - class AppCartConfig: Codable { - - - public var deliveryCharges: DeliveryCharges? - - public var enabled: Bool? - - public var maxCartItems: Int? - - public var minCartValue: Double? - - public var bulkCoupons: Bool? - - - public enum CodingKeys: String, CodingKey { - - case deliveryCharges = "delivery_charges" - - case enabled = "enabled" - - case maxCartItems = "max_cart_items" - - case minCartValue = "min_cart_value" - - case bulkCoupons = "bulk_coupons" - - } - - public init(bulkCoupons: Bool?, deliveryCharges: DeliveryCharges?, enabled: Bool?, maxCartItems: Int?, minCartValue: Double?) { - - self.deliveryCharges = deliveryCharges - - self.enabled = enabled - - self.maxCartItems = maxCartItems - - self.minCartValue = minCartValue - - self.bulkCoupons = bulkCoupons - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - deliveryCharges = try container.decode(DeliveryCharges.self, forKey: .deliveryCharges) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - maxCartItems = try container.decode(Int.self, forKey: .maxCartItems) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - minCartValue = try container.decode(Double.self, forKey: .minCartValue) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bulkCoupons = try container.decode(Bool.self, forKey: .bulkCoupons) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(deliveryCharges, forKey: .deliveryCharges) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(maxCartItems, forKey: .maxCartItems) - - - - try? container.encodeIfPresent(minCartValue, forKey: .minCartValue) - - - - try? container.encodeIfPresent(bulkCoupons, forKey: .bulkCoupons) - - - } - - } - - /* - Model: DeliveryCharges - Used By: Configuration - */ - - class DeliveryCharges: Codable { - - - public var enabled: Bool? - - public var charges: Charges? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - case charges = "charges" - - } - - public init(charges: Charges?, enabled: Bool?) { - - self.enabled = enabled - - self.charges = charges - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - charges = try container.decode(Charges.self, forKey: .charges) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(charges, forKey: .charges) - - - } - - } - - /* - Model: Charges - Used By: Configuration - */ - - class Charges: Codable { - - - public var threshold: Double? - - public var charges: Double? - - - public enum CodingKeys: String, CodingKey { - - case threshold = "threshold" - - case charges = "charges" - - } - - public init(charges: Double?, threshold: Double?) { - - self.threshold = threshold - - self.charges = charges - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - threshold = try container.decode(Double.self, forKey: .threshold) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - charges = try container.decode(Double.self, forKey: .charges) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(threshold, forKey: .threshold) - - - - try? container.encodeIfPresent(charges, forKey: .charges) - - - } - - } - - /* - Model: AppPaymentConfig - Used By: Configuration - */ - - class AppPaymentConfig: Codable { - - - public var callbackUrl: CallbackUrl? - - public var methods: Methods? - - public var paymentSelectionLock: PaymentSelectionLock? - - public var modeOfPayment: String? - - public var source: String? - - public var enabled: Bool? - - public var codAmountLimit: Double? - - public var codCharges: Double? - - - public enum CodingKeys: String, CodingKey { - - case callbackUrl = "callback_url" - - case methods = "methods" - - case paymentSelectionLock = "payment_selection_lock" - - case modeOfPayment = "mode_of_payment" - - case source = "source" - - case enabled = "enabled" - - case codAmountLimit = "cod_amount_limit" - - case codCharges = "cod_charges" - - } - - public init(callbackUrl: CallbackUrl?, codAmountLimit: Double?, codCharges: Double?, enabled: Bool?, methods: Methods?, modeOfPayment: String?, paymentSelectionLock: PaymentSelectionLock?, source: String?) { - - self.callbackUrl = callbackUrl - - self.methods = methods - - self.paymentSelectionLock = paymentSelectionLock - - self.modeOfPayment = modeOfPayment - - self.source = source - - self.enabled = enabled - - self.codAmountLimit = codAmountLimit - - self.codCharges = codCharges - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - callbackUrl = try container.decode(CallbackUrl.self, forKey: .callbackUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - methods = try container.decode(Methods.self, forKey: .methods) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentSelectionLock = try container.decode(PaymentSelectionLock.self, forKey: .paymentSelectionLock) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modeOfPayment = try container.decode(String.self, forKey: .modeOfPayment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - source = try container.decode(String.self, forKey: .source) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - codAmountLimit = try container.decode(Double.self, forKey: .codAmountLimit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - codCharges = try container.decode(Double.self, forKey: .codCharges) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(callbackUrl, forKey: .callbackUrl) - - - - try? container.encodeIfPresent(methods, forKey: .methods) - - - - try? container.encodeIfPresent(paymentSelectionLock, forKey: .paymentSelectionLock) - - - - try? container.encodeIfPresent(modeOfPayment, forKey: .modeOfPayment) - - - - try? container.encodeIfPresent(source, forKey: .source) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(codAmountLimit, forKey: .codAmountLimit) - - - - try? container.encodeIfPresent(codCharges, forKey: .codCharges) - - - } - - } - - /* - Model: CallbackUrl - Used By: Configuration - */ - - class CallbackUrl: Codable { - - - public var app: String? - - public var web: String? - - - public enum CodingKeys: String, CodingKey { - - case app = "app" - - case web = "web" - - } - - public init(app: String?, web: String?) { - - self.app = app - - self.web = web - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - app = try container.decode(String.self, forKey: .app) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - web = try container.decode(String.self, forKey: .web) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(app, forKey: .app) - - - - try? container.encodeIfPresent(web, forKey: .web) - - - } - - } - - /* - Model: Methods - Used By: Configuration - */ - - class Methods: Codable { - - - public var pl: PaymentModeConfig? - - public var card: PaymentModeConfig? - - public var nb: PaymentModeConfig? - - public var wl: PaymentModeConfig? - - public var ps: PaymentModeConfig? - - public var upi: PaymentModeConfig? - - public var qr: PaymentModeConfig? - - public var cod: PaymentModeConfig? - - public var pp: PaymentModeConfig? - - public var jp: PaymentModeConfig? - - public var pac: PaymentModeConfig? - - public var fc: PaymentModeConfig? - - public var jiopp: PaymentModeConfig? - - public var stripepg: PaymentModeConfig? - - public var juspaypg: PaymentModeConfig? - - public var payubizpg: PaymentModeConfig? - - public var payumoneypg: PaymentModeConfig? - - public var rupifipg: PaymentModeConfig? - - public var simpl: PaymentModeConfig? - - - public enum CodingKeys: String, CodingKey { - - case pl = "pl" - - case card = "card" - - case nb = "nb" - - case wl = "wl" - - case ps = "ps" - - case upi = "upi" - - case qr = "qr" - - case cod = "cod" - - case pp = "pp" - - case jp = "jp" - - case pac = "pac" - - case fc = "fc" - - case jiopp = "jiopp" - - case stripepg = "stripepg" - - case juspaypg = "juspaypg" - - case payubizpg = "payubizpg" - - case payumoneypg = "payumoneypg" - - case rupifipg = "rupifipg" - - case simpl = "simpl" - - } - - public init(card: PaymentModeConfig?, cod: PaymentModeConfig?, fc: PaymentModeConfig?, jiopp: PaymentModeConfig?, jp: PaymentModeConfig?, juspaypg: PaymentModeConfig?, nb: PaymentModeConfig?, pac: PaymentModeConfig?, payubizpg: PaymentModeConfig?, payumoneypg: PaymentModeConfig?, pl: PaymentModeConfig?, pp: PaymentModeConfig?, ps: PaymentModeConfig?, qr: PaymentModeConfig?, rupifipg: PaymentModeConfig?, simpl: PaymentModeConfig?, stripepg: PaymentModeConfig?, upi: PaymentModeConfig?, wl: PaymentModeConfig?) { - - self.pl = pl - - self.card = card - - self.nb = nb - - self.wl = wl - - self.ps = ps - - self.upi = upi - - self.qr = qr - - self.cod = cod - - self.pp = pp - - self.jp = jp - - self.pac = pac - - self.fc = fc - - self.jiopp = jiopp - - self.stripepg = stripepg - - self.juspaypg = juspaypg - - self.payubizpg = payubizpg - - self.payumoneypg = payumoneypg - - self.rupifipg = rupifipg - - self.simpl = simpl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pl = try container.decode(PaymentModeConfig.self, forKey: .pl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - card = try container.decode(PaymentModeConfig.self, forKey: .card) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - nb = try container.decode(PaymentModeConfig.self, forKey: .nb) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - wl = try container.decode(PaymentModeConfig.self, forKey: .wl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - ps = try container.decode(PaymentModeConfig.self, forKey: .ps) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - upi = try container.decode(PaymentModeConfig.self, forKey: .upi) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - qr = try container.decode(PaymentModeConfig.self, forKey: .qr) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cod = try container.decode(PaymentModeConfig.self, forKey: .cod) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pp = try container.decode(PaymentModeConfig.self, forKey: .pp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - jp = try container.decode(PaymentModeConfig.self, forKey: .jp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pac = try container.decode(PaymentModeConfig.self, forKey: .pac) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fc = try container.decode(PaymentModeConfig.self, forKey: .fc) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - jiopp = try container.decode(PaymentModeConfig.self, forKey: .jiopp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stripepg = try container.decode(PaymentModeConfig.self, forKey: .stripepg) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - juspaypg = try container.decode(PaymentModeConfig.self, forKey: .juspaypg) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - payubizpg = try container.decode(PaymentModeConfig.self, forKey: .payubizpg) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - payumoneypg = try container.decode(PaymentModeConfig.self, forKey: .payumoneypg) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rupifipg = try container.decode(PaymentModeConfig.self, forKey: .rupifipg) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - simpl = try container.decode(PaymentModeConfig.self, forKey: .simpl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pl, forKey: .pl) - - - - try? container.encodeIfPresent(card, forKey: .card) - - - - try? container.encodeIfPresent(nb, forKey: .nb) - - - - try? container.encodeIfPresent(wl, forKey: .wl) - - - - try? container.encodeIfPresent(ps, forKey: .ps) - - - - try? container.encodeIfPresent(upi, forKey: .upi) - - - - try? container.encodeIfPresent(qr, forKey: .qr) - - - - try? container.encodeIfPresent(cod, forKey: .cod) - - - - try? container.encodeIfPresent(pp, forKey: .pp) - - - - try? container.encodeIfPresent(jp, forKey: .jp) - - - - try? container.encodeIfPresent(pac, forKey: .pac) - - - - try? container.encodeIfPresent(fc, forKey: .fc) - - - - try? container.encodeIfPresent(jiopp, forKey: .jiopp) - - - - try? container.encodeIfPresent(stripepg, forKey: .stripepg) - - - - try? container.encodeIfPresent(juspaypg, forKey: .juspaypg) - - - - try? container.encodeIfPresent(payubizpg, forKey: .payubizpg) - - - - try? container.encodeIfPresent(payumoneypg, forKey: .payumoneypg) - - - - try? container.encodeIfPresent(rupifipg, forKey: .rupifipg) - - - - try? container.encodeIfPresent(simpl, forKey: .simpl) - - - } - - } - - /* - Model: PaymentModeConfig - Used By: Configuration - */ - - class PaymentModeConfig: Codable { - - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - } - - public init(enabled: Bool?) { - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: PaymentSelectionLock - Used By: Configuration - */ - - class PaymentSelectionLock: Codable { - - - public var enabled: Bool? - - public var defaultOptions: String? - - public var paymentIdentifier: String? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - case defaultOptions = "default_options" - - case paymentIdentifier = "payment_identifier" - - } - - public init(defaultOptions: String?, enabled: Bool?, paymentIdentifier: String?) { - - self.enabled = enabled - - self.defaultOptions = defaultOptions - - self.paymentIdentifier = paymentIdentifier - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - defaultOptions = try container.decode(String.self, forKey: .defaultOptions) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentIdentifier = try container.decode(String.self, forKey: .paymentIdentifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(defaultOptions, forKey: .defaultOptions) - - - - try? container.encodeIfPresent(paymentIdentifier, forKey: .paymentIdentifier) - - - } - - } - - /* - Model: AppOrderConfig - Used By: Configuration - */ - - class AppOrderConfig: Codable { - - - public var enabled: Bool? - - public var forceReassignment: Bool? - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - case forceReassignment = "force_reassignment" - - case message = "message" - - } - - public init(enabled: Bool?, forceReassignment: Bool?, message: String?) { - - self.enabled = enabled - - self.forceReassignment = forceReassignment - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - forceReassignment = try container.decode(Bool.self, forKey: .forceReassignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(forceReassignment, forKey: .forceReassignment) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: AppLogisticsConfig - Used By: Configuration - */ - - class AppLogisticsConfig: Codable { - - - public var logisticsBySeller: Bool? - - public var serviceabilityCheck: Bool? - - public var sameDayDelivery: Bool? - - public var dpAssignment: Bool? - - - public enum CodingKeys: String, CodingKey { - - case logisticsBySeller = "logistics_by_seller" - - case serviceabilityCheck = "serviceability_check" - - case sameDayDelivery = "same_day_delivery" - - case dpAssignment = "dp_assignment" - - } - - public init(dpAssignment: Bool?, logisticsBySeller: Bool?, sameDayDelivery: Bool?, serviceabilityCheck: Bool?) { - - self.logisticsBySeller = logisticsBySeller - - self.serviceabilityCheck = serviceabilityCheck - - self.sameDayDelivery = sameDayDelivery - - self.dpAssignment = dpAssignment - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - logisticsBySeller = try container.decode(Bool.self, forKey: .logisticsBySeller) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - serviceabilityCheck = try container.decode(Bool.self, forKey: .serviceabilityCheck) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sameDayDelivery = try container.decode(Bool.self, forKey: .sameDayDelivery) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dpAssignment = try container.decode(Bool.self, forKey: .dpAssignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(logisticsBySeller, forKey: .logisticsBySeller) - - - - try? container.encodeIfPresent(serviceabilityCheck, forKey: .serviceabilityCheck) - - - - try? container.encodeIfPresent(sameDayDelivery, forKey: .sameDayDelivery) - - - - try? container.encodeIfPresent(dpAssignment, forKey: .dpAssignment) - - - } - - } - - /* - Model: LoyaltyPointsConfig - Used By: Configuration - */ - - class LoyaltyPointsConfig: Codable { - - - public var enabled: Bool? - - public var autoApply: Bool? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - case autoApply = "auto_apply" - - } - - public init(autoApply: Bool?, enabled: Bool?) { - - self.enabled = enabled - - self.autoApply = autoApply - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - autoApply = try container.decode(Bool.self, forKey: .autoApply) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(autoApply, forKey: .autoApply) - - - } - - } - - /* - Model: AppInventoryPartialUpdate - Used By: Configuration - */ - - class AppInventoryPartialUpdate: Codable { - - - public var rewardPoints: RewardPointsConfig? - - public var cart: AppCartConfig? - - public var payment: AppPaymentConfig? - - public var loyaltyPoints: LoyaltyPointsConfig? - - public var commsEnabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case rewardPoints = "reward_points" - - case cart = "cart" - - case payment = "payment" - - case loyaltyPoints = "loyalty_points" - - case commsEnabled = "comms_enabled" - - } - - public init(cart: AppCartConfig?, commsEnabled: Bool?, loyaltyPoints: LoyaltyPointsConfig?, payment: AppPaymentConfig?, rewardPoints: RewardPointsConfig?) { - - self.rewardPoints = rewardPoints - - self.cart = cart - - self.payment = payment - - self.loyaltyPoints = loyaltyPoints - - self.commsEnabled = commsEnabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - rewardPoints = try container.decode(RewardPointsConfig.self, forKey: .rewardPoints) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cart = try container.decode(AppCartConfig.self, forKey: .cart) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - payment = try container.decode(AppPaymentConfig.self, forKey: .payment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - loyaltyPoints = try container.decode(LoyaltyPointsConfig.self, forKey: .loyaltyPoints) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - commsEnabled = try container.decode(Bool.self, forKey: .commsEnabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(rewardPoints, forKey: .rewardPoints) - - - - try? container.encodeIfPresent(cart, forKey: .cart) - - - - try? container.encodeIfPresent(payment, forKey: .payment) - - - - try? container.encodeIfPresent(loyaltyPoints, forKey: .loyaltyPoints) - - - - try? container.encodeIfPresent(commsEnabled, forKey: .commsEnabled) - - - } - - } - - /* - Model: BrandCompanyInfo - Used By: Configuration - */ - - class BrandCompanyInfo: Codable { - - - public var companyName: String? - - public var companyId: Int? - - - public enum CodingKeys: String, CodingKey { - - case companyName = "company_name" - - case companyId = "company_id" - - } - - public init(companyId: Int?, companyName: String?) { - - self.companyName = companyName - - self.companyId = companyId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - companyName = try container.decode(String.self, forKey: .companyName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(companyName, forKey: .companyName) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - } - - } - - /* - Model: CompanyByBrandsRequest - Used By: Configuration - */ - - class CompanyByBrandsRequest: Codable { - - - public var brands: Int - - public var searchText: String? - - - public enum CodingKeys: String, CodingKey { - - case brands = "brands" - - case searchText = "search_text" - - } - - public init(brands: Int, searchText: String?) { - - self.brands = brands - - self.searchText = searchText - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - brands = try container.decode(Int.self, forKey: .brands) - - - - - do { - searchText = try container.decode(String.self, forKey: .searchText) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(brands, forKey: .brands) - - - - try? container.encodeIfPresent(searchText, forKey: .searchText) - - - } - - } - - /* - Model: CompanyByBrandsResponse - Used By: Configuration - */ - - class CompanyByBrandsResponse: Codable { - - - public var items: [BrandCompanyInfo]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [BrandCompanyInfo]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([BrandCompanyInfo].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: StoreByBrandsRequest - Used By: Configuration - */ - - class StoreByBrandsRequest: Codable { - - - public var companyId: Int? - - public var brands: Int - - public var searchText: String? - - - public enum CodingKeys: String, CodingKey { - - case companyId = "company_id" - - case brands = "brands" - - case searchText = "search_text" - - } - - public init(brands: Int, companyId: Int?, searchText: String?) { - - self.companyId = companyId - - self.brands = brands - - self.searchText = searchText - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - brands = try container.decode(Int.self, forKey: .brands) - - - - - do { - searchText = try container.decode(String.self, forKey: .searchText) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(brands, forKey: .brands) - - - - try? container.encodeIfPresent(searchText, forKey: .searchText) - - - } - - } - - /* - Model: StoreByBrandsResponse - Used By: Configuration - */ - - class StoreByBrandsResponse: Codable { - - - public var items: [BrandStoreInfo]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [BrandStoreInfo]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([BrandStoreInfo].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: BrandStoreInfo - Used By: Configuration - */ - - class BrandStoreInfo: Codable { - - - public var storeName: String? - - public var storeId: Int? - - public var storeType: String? - - public var storeCode: String? - - public var storeAddress: OptedStoreAddress? - - public var company: OptedCompany? - - - public enum CodingKeys: String, CodingKey { - - case storeName = "store_name" - - case storeId = "store_id" - - case storeType = "store_type" - - case storeCode = "store_code" - - case storeAddress = "store_address" - - case company = "company" - - } - - public init(company: OptedCompany?, storeAddress: OptedStoreAddress?, storeCode: String?, storeId: Int?, storeName: String?, storeType: String?) { - - self.storeName = storeName - - self.storeId = storeId - - self.storeType = storeType - - self.storeCode = storeCode - - self.storeAddress = storeAddress - - self.company = company - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - storeName = try container.decode(String.self, forKey: .storeName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeId = try container.decode(Int.self, forKey: .storeId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeType = try container.decode(String.self, forKey: .storeType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeCode = try container.decode(String.self, forKey: .storeCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeAddress = try container.decode(OptedStoreAddress.self, forKey: .storeAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - company = try container.decode(OptedCompany.self, forKey: .company) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(storeName, forKey: .storeName) - - - - try? container.encodeIfPresent(storeId, forKey: .storeId) - - - - try? container.encodeIfPresent(storeType, forKey: .storeType) - - - - try? container.encodeIfPresent(storeCode, forKey: .storeCode) - - - - try? container.encodeIfPresent(storeAddress, forKey: .storeAddress) - - - - try? container.encodeIfPresent(company, forKey: .company) - - - } - - } - - /* - Model: CompanyBrandInfo - Used By: Configuration - */ - - class CompanyBrandInfo: Codable { - - - public var name: String? - - public var value: Int? - - public var brandLogoUrl: String? - - public var brandBannerUrl: String? - - public var brandBannerPortraitUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case value = "value" - - case brandLogoUrl = "brand_logo_url" - - case brandBannerUrl = "brand_banner_url" - - case brandBannerPortraitUrl = "brand_banner_portrait_url" - - } - - public init(brandBannerPortraitUrl: String?, brandBannerUrl: String?, brandLogoUrl: String?, name: String?, value: Int?) { - - self.name = name - - self.value = value - - self.brandLogoUrl = brandLogoUrl - - self.brandBannerUrl = brandBannerUrl - - self.brandBannerPortraitUrl = brandBannerPortraitUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(Int.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandLogoUrl = try container.decode(String.self, forKey: .brandLogoUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandBannerUrl = try container.decode(String.self, forKey: .brandBannerUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandBannerPortraitUrl = try container.decode(String.self, forKey: .brandBannerPortraitUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(brandLogoUrl, forKey: .brandLogoUrl) - - - - try? container.encodeIfPresent(brandBannerUrl, forKey: .brandBannerUrl) - - - - try? container.encodeIfPresent(brandBannerPortraitUrl, forKey: .brandBannerPortraitUrl) - - - } - - } - - /* - Model: BrandsByCompanyResponse - Used By: Configuration - */ - - class BrandsByCompanyResponse: Codable { - - - public var brands: CompanyBrandInfo? - - - public enum CodingKeys: String, CodingKey { - - case brands = "brands" - - } - - public init(brands: CompanyBrandInfo?) { - - self.brands = brands - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - brands = try container.decode(CompanyBrandInfo.self, forKey: .brands) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(brands, forKey: .brands) - - - } - - } - - /* - Model: CreateApplicationRequest - Used By: Configuration - */ - - class CreateApplicationRequest: Codable { - - - public var app: App? - - public var configuration: AppInventory? - - public var domain: AppDomain? - - - public enum CodingKeys: String, CodingKey { - - case app = "app" - - case configuration = "configuration" - - case domain = "domain" - - } - - public init(app: App?, configuration: AppInventory?, domain: AppDomain?) { - - self.app = app - - self.configuration = configuration - - self.domain = domain - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - app = try container.decode(App.self, forKey: .app) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - configuration = try container.decode(AppInventory.self, forKey: .configuration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - domain = try container.decode(AppDomain.self, forKey: .domain) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(app, forKey: .app) - - - - try? container.encodeIfPresent(configuration, forKey: .configuration) - - - - try? container.encodeIfPresent(domain, forKey: .domain) - - - } - - } - - /* - Model: CreateAppResponse - Used By: Configuration - */ - - class CreateAppResponse: Codable { - - - public var app: Application? - - public var configuration: ApplicationInventory? - - - public enum CodingKeys: String, CodingKey { - - case app = "app" - - case configuration = "configuration" - - } - - public init(app: Application?, configuration: ApplicationInventory?) { - - self.app = app - - self.configuration = configuration - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - app = try container.decode(Application.self, forKey: .app) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - configuration = try container.decode(ApplicationInventory.self, forKey: .configuration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(app, forKey: .app) - - - - try? container.encodeIfPresent(configuration, forKey: .configuration) - - - } - - } - - /* - Model: ApplicationsResponse - Used By: Configuration - */ - - class ApplicationsResponse: Codable { - - - public var items: [Application]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [Application]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Application].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: MobileAppConfiguration - Used By: Configuration - */ - - class MobileAppConfiguration: Codable { - - - public var isActive: Bool? - - public var id: String? - - public var appName: String? - - public var landingImage: LandingImage? - - public var splashImage: SplashImage? - - public var application: String? - - public var platformType: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var v: Int? - - public var packageName: String? - - - public enum CodingKeys: String, CodingKey { - - case isActive = "is_active" - - case id = "_id" - - case appName = "app_name" - - case landingImage = "landing_image" - - case splashImage = "splash_image" - - case application = "application" - - case platformType = "platform_type" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case v = "__v" - - case packageName = "package_name" - - } - - public init(application: String?, appName: String?, createdAt: String?, isActive: Bool?, landingImage: LandingImage?, packageName: String?, platformType: String?, splashImage: SplashImage?, updatedAt: String?, id: String?, v: Int?) { - - self.isActive = isActive - - self.id = id - - self.appName = appName - - self.landingImage = landingImage - - self.splashImage = splashImage - - self.application = application - - self.platformType = platformType - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.v = v - - self.packageName = packageName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appName = try container.decode(String.self, forKey: .appName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - landingImage = try container.decode(LandingImage.self, forKey: .landingImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - splashImage = try container.decode(SplashImage.self, forKey: .splashImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platformType = try container.decode(String.self, forKey: .platformType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - packageName = try container.decode(String.self, forKey: .packageName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(appName, forKey: .appName) - - - - try? container.encodeIfPresent(landingImage, forKey: .landingImage) - - - - try? container.encodeIfPresent(splashImage, forKey: .splashImage) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(platformType, forKey: .platformType) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - - try? container.encodeIfPresent(packageName, forKey: .packageName) - - - } - - } - - /* - Model: LandingImage - Used By: Configuration - */ - - class LandingImage: Codable { - - - public var aspectRatio: String? - - public var secureUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case aspectRatio = "aspect_ratio" - - case secureUrl = "secure_url" - - } - - public init(aspectRatio: String?, secureUrl: String?) { - - self.aspectRatio = aspectRatio - - self.secureUrl = secureUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - aspectRatio = try container.decode(String.self, forKey: .aspectRatio) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - secureUrl = try container.decode(String.self, forKey: .secureUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) - - - - try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) - - - } - - } - - /* - Model: SplashImage - Used By: Configuration - */ - - class SplashImage: Codable { - - - public var aspectRatio: String? - - public var secureUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case aspectRatio = "aspect_ratio" - - case secureUrl = "secure_url" - - } - - public init(aspectRatio: String?, secureUrl: String?) { - - self.aspectRatio = aspectRatio - - self.secureUrl = secureUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - aspectRatio = try container.decode(String.self, forKey: .aspectRatio) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - secureUrl = try container.decode(String.self, forKey: .secureUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) - - - - try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) - - - } - - } - - /* - Model: MobileAppConfigRequest - Used By: Configuration - */ - - class MobileAppConfigRequest: Codable { - - - public var appName: String? - - public var landingImage: LandingImage? - - public var splashImage: SplashImage? - - public var isActive: Bool? - - - public enum CodingKeys: String, CodingKey { - - case appName = "app_name" - - case landingImage = "landing_image" - - case splashImage = "splash_image" - - case isActive = "is_active" - - } - - public init(appName: String?, isActive: Bool?, landingImage: LandingImage?, splashImage: SplashImage?) { - - self.appName = appName - - self.landingImage = landingImage - - self.splashImage = splashImage - - self.isActive = isActive - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - appName = try container.decode(String.self, forKey: .appName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - landingImage = try container.decode(LandingImage.self, forKey: .landingImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - splashImage = try container.decode(SplashImage.self, forKey: .splashImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(appName, forKey: .appName) - - - - try? container.encodeIfPresent(landingImage, forKey: .landingImage) - - - - try? container.encodeIfPresent(splashImage, forKey: .splashImage) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - } - - } - - /* - Model: BuildVersionHistory - Used By: Configuration - */ - - class BuildVersionHistory: Codable { - - - public var versions: BuildVersion? - - public var latestAvailableVersionName: String? - - - public enum CodingKeys: String, CodingKey { - - case versions = "versions" - - case latestAvailableVersionName = "latest_available_version_name" - - } - - public init(latestAvailableVersionName: String?, versions: BuildVersion?) { - - self.versions = versions - - self.latestAvailableVersionName = latestAvailableVersionName - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - versions = try container.decode(BuildVersion.self, forKey: .versions) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - latestAvailableVersionName = try container.decode(String.self, forKey: .latestAvailableVersionName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(versions, forKey: .versions) - - - - try? container.encodeIfPresent(latestAvailableVersionName, forKey: .latestAvailableVersionName) - - - } - - } - - /* - Model: BuildVersion - Used By: Configuration - */ - - class BuildVersion: Codable { - - - public var id: String? - - public var application: String? - - public var platformType: String? - - public var buildStatus: String? - - public var versionName: String? - - public var versionCode: Int? - - public var createdAt: String? - - public var updatedAt: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case application = "application" - - case platformType = "platform_type" - - case buildStatus = "build_status" - - case versionName = "version_name" - - case versionCode = "version_code" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case v = "__v" - - } - - public init(application: String?, buildStatus: String?, createdAt: String?, platformType: String?, updatedAt: String?, versionCode: Int?, versionName: String?, id: String?, v: Int?) { - - self.id = id - - self.application = application - - self.platformType = platformType - - self.buildStatus = buildStatus - - self.versionName = versionName - - self.versionCode = versionCode - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platformType = try container.decode(String.self, forKey: .platformType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - buildStatus = try container.decode(String.self, forKey: .buildStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - versionName = try container.decode(String.self, forKey: .versionName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - versionCode = try container.decode(Int.self, forKey: .versionCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(platformType, forKey: .platformType) - - - - try? container.encodeIfPresent(buildStatus, forKey: .buildStatus) - - - - try? container.encodeIfPresent(versionName, forKey: .versionName) - - - - try? container.encodeIfPresent(versionCode, forKey: .versionCode) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: AppSupportedCurrency - Used By: Configuration - */ - - class AppSupportedCurrency: Codable { - - - public var id: String? - - public var supportedCurrency: [String]? - - public var application: String? - - public var defaultCurrency: DefaultCurrency? - - public var createdAt: String? - - public var updatedAt: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case supportedCurrency = "supported_currency" - - case application = "application" - - case defaultCurrency = "default_currency" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - } - - public init(application: String?, createdAt: String?, defaultCurrency: DefaultCurrency?, supportedCurrency: [String]?, updatedAt: String?, id: String?) { - - self.id = id - - self.supportedCurrency = supportedCurrency - - self.application = application - - self.defaultCurrency = defaultCurrency - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - supportedCurrency = try container.decode([String].self, forKey: .supportedCurrency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - defaultCurrency = try container.decode(DefaultCurrency.self, forKey: .defaultCurrency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(supportedCurrency, forKey: .supportedCurrency) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(defaultCurrency, forKey: .defaultCurrency) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - } - - } - - /* - Model: DefaultCurrency - Used By: Configuration - */ - - class DefaultCurrency: Codable { - - - public var ref: String? - - public var code: String? - - - public enum CodingKeys: String, CodingKey { - - case ref = "ref" - - case code = "code" - - } - - public init(code: String?, ref: String?) { - - self.ref = ref - - self.code = code - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - ref = try container.decode(String.self, forKey: .ref) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(ref, forKey: .ref) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - } - - } - - /* - Model: CurrencyConfig - Used By: Configuration - */ - - class CurrencyConfig: Codable { - - - public var id: String? - - public var isActive: Bool? - - public var name: String? - - public var code: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var decimalDigits: Int? - - public var symbol: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case isActive = "is_active" - - case name = "name" - - case code = "code" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case decimalDigits = "decimal_digits" - - case symbol = "symbol" - - } - - public init(code: String?, createdAt: String?, decimalDigits: Int?, isActive: Bool?, name: String?, symbol: String?, updatedAt: String?, id: String?) { - - self.id = id - - self.isActive = isActive - - self.name = name - - self.code = code - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.decimalDigits = decimalDigits - - self.symbol = symbol - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - decimalDigits = try container.decode(Int.self, forKey: .decimalDigits) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - symbol = try container.decode(String.self, forKey: .symbol) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(decimalDigits, forKey: .decimalDigits) - - - - try? container.encodeIfPresent(symbol, forKey: .symbol) - - - } - - } - - /* - Model: DomainAdd - Used By: Configuration - */ - - class DomainAdd: Codable { - - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - } - - public init(name: String?) { - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: DomainAddRequest - Used By: Configuration - */ - - class DomainAddRequest: Codable { - - - public var domain: DomainAdd? - - - public enum CodingKeys: String, CodingKey { - - case domain = "domain" - - } - - public init(domain: DomainAdd?) { - - self.domain = domain - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - domain = try container.decode(DomainAdd.self, forKey: .domain) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(domain, forKey: .domain) - - - } - - } - - /* - Model: DomainsResponse - Used By: Configuration - */ - - class DomainsResponse: Codable { - - - public var domains: [Domain]? - - - public enum CodingKeys: String, CodingKey { - - case domains = "domains" - - } - - public init(domains: [Domain]?) { - - self.domains = domains - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - domains = try container.decode([Domain].self, forKey: .domains) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(domains, forKey: .domains) - - - } - - } - - /* - Model: UpdateDomain - Used By: Configuration - */ - - class UpdateDomain: Codable { - - - public var id: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - } - - public init(id: String?) { - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: UpdateDomainTypeRequest - Used By: Configuration - */ - - class UpdateDomainTypeRequest: Codable { - - - public var domain: UpdateDomain? - - public var action: String? - - - public enum CodingKeys: String, CodingKey { - - case domain = "domain" - - case action = "action" - - } - - public init(action: String?, domain: UpdateDomain?) { - - self.domain = domain - - self.action = action - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - domain = try container.decode(UpdateDomain.self, forKey: .domain) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(String.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(domain, forKey: .domain) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - } - - } - - /* - Model: DomainStatusRequest - Used By: Configuration - */ - - class DomainStatusRequest: Codable { - - - public var domainUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case domainUrl = "domain_url" - - } - - public init(domainUrl: String?) { - - self.domainUrl = domainUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - domainUrl = try container.decode(String.self, forKey: .domainUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(domainUrl, forKey: .domainUrl) - - - } - - } - - /* - Model: DomainStatus - Used By: Configuration - */ - - class DomainStatus: Codable { - - - public var display: String? - - public var status: Bool? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case status = "status" - - } - - public init(display: String?, status: Bool?) { - - self.display = display - - self.status = status - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(Bool.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - } - - } - - /* - Model: DomainStatusResponse - Used By: Configuration - */ - - class DomainStatusResponse: Codable { - - - public var connected: Bool? - - public var status: [DomainStatus]? - - - public enum CodingKeys: String, CodingKey { - - case connected = "connected" - - case status = "status" - - } - - public init(connected: Bool?, status: [DomainStatus]?) { - - self.connected = connected - - self.status = status - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - connected = try container.decode(Bool.self, forKey: .connected) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode([DomainStatus].self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(connected, forKey: .connected) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - } - - } - - /* - Model: DomainSuggestionsRequest - Used By: Configuration - */ - - class DomainSuggestionsRequest: Codable { - - - public var domainUrl: String? - - public var custom: Bool? - - - public enum CodingKeys: String, CodingKey { - - case domainUrl = "domain_url" - - case custom = "custom" - - } - - public init(custom: Bool?, domainUrl: String?) { - - self.domainUrl = domainUrl - - self.custom = custom - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - domainUrl = try container.decode(String.self, forKey: .domainUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - custom = try container.decode(Bool.self, forKey: .custom) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(domainUrl, forKey: .domainUrl) - - - - try? container.encodeIfPresent(custom, forKey: .custom) - - - } - - } - - /* - Model: DomainSuggestion - Used By: Configuration - */ - - class DomainSuggestion: Codable { - - - public var name: String - - public var unsupported: Bool? - - public var isAvailable: Bool - - public var price: Double? - - public var currency: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case unsupported = "unsupported" - - case isAvailable = "is_available" - - case price = "price" - - case currency = "currency" - - } - - public init(currency: String?, isAvailable: Bool, name: String, price: Double?, unsupported: Bool?) { - - self.name = name - - self.unsupported = unsupported - - self.isAvailable = isAvailable - - self.price = price - - self.currency = currency - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - name = try container.decode(String.self, forKey: .name) - - - - - do { - unsupported = try container.decode(Bool.self, forKey: .unsupported) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - isAvailable = try container.decode(Bool.self, forKey: .isAvailable) - - - - - do { - price = try container.decode(Double.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(String.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(unsupported, forKey: .unsupported) - - - - try? container.encodeIfPresent(isAvailable, forKey: .isAvailable) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - } - - } - - /* - Model: DomainSuggestionsResponse - Used By: Configuration - */ - - class DomainSuggestionsResponse: Codable { - - - public var domains: [DomainSuggestion]? - - - public enum CodingKeys: String, CodingKey { - - case domains = "domains" - - } - - public init(domains: [DomainSuggestion]?) { - - self.domains = domains - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - domains = try container.decode([DomainSuggestion].self, forKey: .domains) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(domains, forKey: .domains) - - - } - - } - - /* - Model: GetIntegrationsOptInsResponse - Used By: Configuration - */ - - class GetIntegrationsOptInsResponse: Codable { - - - public var items: IntegrationOptIn? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: IntegrationOptIn?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode(IntegrationOptIn.self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: IntegrationOptIn - Used By: Configuration - */ - - class IntegrationOptIn: Codable { - - - public var validators: Validators? - - public var description: String? - - public var descriptionHtml: String? - - public var constants: String? - - public var companies: [[String: Any]]? - - public var support: [String]? - - public var id: String? - - public var name: String? - - public var meta: IntegrationMeta? - - public var icon: String? - - public var owner: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var token: String? - - public var secret: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case validators = "validators" - - case description = "description" - - case descriptionHtml = "description_html" - - case constants = "constants" - - case companies = "companies" - - case support = "support" - - case id = "_id" - - case name = "name" - - case meta = "meta" - - case icon = "icon" - - case owner = "owner" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case token = "token" - - case secret = "secret" - - case v = "__v" - - } - - public init(companies: [[String: Any]]?, constants: String?, createdAt: String?, description: String?, descriptionHtml: String?, icon: String?, meta: IntegrationMeta?, name: String?, owner: String?, secret: String?, support: [String]?, token: String?, updatedAt: String?, validators: Validators?, id: String?, v: Int?) { - - self.validators = validators - - self.description = description - - self.descriptionHtml = descriptionHtml - - self.constants = constants - - self.companies = companies - - self.support = support - - self.id = id - - self.name = name - - self.meta = meta - - self.icon = icon - - self.owner = owner - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.token = token - - self.secret = secret - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - validators = try container.decode(Validators.self, forKey: .validators) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - descriptionHtml = try container.decode(String.self, forKey: .descriptionHtml) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - constants = try container.decode(String.self, forKey: .constants) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companies = try container.decode([[String: Any]].self, forKey: .companies) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - support = try container.decode([String].self, forKey: .support) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode(IntegrationMeta.self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - owner = try container.decode(String.self, forKey: .owner) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - token = try container.decode(String.self, forKey: .token) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - secret = try container.decode(String.self, forKey: .secret) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(validators, forKey: .validators) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(descriptionHtml, forKey: .descriptionHtml) - - - - try? container.encodeIfPresent(constants, forKey: .constants) - - - - try? container.encodeIfPresent(companies, forKey: .companies) - - - - try? container.encodeIfPresent(support, forKey: .support) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(owner, forKey: .owner) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(token, forKey: .token) - - - - try? container.encodeIfPresent(secret, forKey: .secret) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: Validators - Used By: Configuration - */ - - class Validators: Codable { - - - public var company: CompanyValidator? - - public var store: StoreValidator? - - public var inventory: InventoryValidator? - - public var order: OrderValidator? - - - public enum CodingKeys: String, CodingKey { - - case company = "company" - - case store = "store" - - case inventory = "inventory" - - case order = "order" - - } - - public init(company: CompanyValidator?, inventory: InventoryValidator?, order: OrderValidator?, store: StoreValidator?) { - - self.company = company - - self.store = store - - self.inventory = inventory - - self.order = order - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - company = try container.decode(CompanyValidator.self, forKey: .company) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - store = try container.decode(StoreValidator.self, forKey: .store) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - inventory = try container.decode(InventoryValidator.self, forKey: .inventory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - order = try container.decode(OrderValidator.self, forKey: .order) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(company, forKey: .company) - - - - try? container.encodeIfPresent(store, forKey: .store) - - - - try? container.encodeIfPresent(inventory, forKey: .inventory) - - - - try? container.encodeIfPresent(order, forKey: .order) - - - } - - } - - /* - Model: CompanyValidator - Used By: Configuration - */ - - class CompanyValidator: Codable { - - - public var jsonSchema: JsonSchema? - - public var browserScript: String? - - - public enum CodingKeys: String, CodingKey { - - case jsonSchema = "json_schema" - - case browserScript = "browser_script" - - } - - public init(browserScript: String?, jsonSchema: JsonSchema?) { - - self.jsonSchema = jsonSchema - - self.browserScript = browserScript - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - jsonSchema = try container.decode(JsonSchema.self, forKey: .jsonSchema) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - browserScript = try container.decode(String.self, forKey: .browserScript) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(jsonSchema, forKey: .jsonSchema) - - - - try? container.encodeIfPresent(browserScript, forKey: .browserScript) - - - } - - } - - /* - Model: JsonSchema - Used By: Configuration - */ - - class JsonSchema: Codable { - - - public var display: String? - - public var key: String? - - public var type: String? - - public var tooltip: String? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case key = "key" - - case type = "type" - - case tooltip = "tooltip" - - } - - public init(display: String?, key: String?, tooltip: String?, type: String?) { - - self.display = display - - self.key = key - - self.type = type - - self.tooltip = tooltip - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - tooltip = try container.decode(String.self, forKey: .tooltip) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(tooltip, forKey: .tooltip) - - - } - - } - - /* - Model: StoreValidator - Used By: Configuration - */ - - class StoreValidator: Codable { - - - public var jsonSchema: [JsonSchema]? - - public var browserScript: String? - - - public enum CodingKeys: String, CodingKey { - - case jsonSchema = "json_schema" - - case browserScript = "browser_script" - - } - - public init(browserScript: String?, jsonSchema: [JsonSchema]?) { - - self.jsonSchema = jsonSchema - - self.browserScript = browserScript - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - jsonSchema = try container.decode([JsonSchema].self, forKey: .jsonSchema) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - browserScript = try container.decode(String.self, forKey: .browserScript) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(jsonSchema, forKey: .jsonSchema) - - - - try? container.encodeIfPresent(browserScript, forKey: .browserScript) - - - } - - } - - /* - Model: InventoryValidator - Used By: Configuration - */ - - class InventoryValidator: Codable { - - - public var jsonSchema: [JsonSchema]? - - public var browserScript: String? - - - public enum CodingKeys: String, CodingKey { - - case jsonSchema = "json_schema" - - case browserScript = "browser_script" - - } - - public init(browserScript: String?, jsonSchema: [JsonSchema]?) { - - self.jsonSchema = jsonSchema - - self.browserScript = browserScript - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - jsonSchema = try container.decode([JsonSchema].self, forKey: .jsonSchema) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - browserScript = try container.decode(String.self, forKey: .browserScript) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(jsonSchema, forKey: .jsonSchema) - - - - try? container.encodeIfPresent(browserScript, forKey: .browserScript) - - - } - - } - - /* - Model: OrderValidator - Used By: Configuration - */ - - class OrderValidator: Codable { - - - public var jsonSchema: [JsonSchema]? - - public var browserScript: String? - - - public enum CodingKeys: String, CodingKey { - - case jsonSchema = "json_schema" - - case browserScript = "browser_script" - - } - - public init(browserScript: String?, jsonSchema: [JsonSchema]?) { - - self.jsonSchema = jsonSchema - - self.browserScript = browserScript - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - jsonSchema = try container.decode([JsonSchema].self, forKey: .jsonSchema) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - browserScript = try container.decode(String.self, forKey: .browserScript) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(jsonSchema, forKey: .jsonSchema) - - - - try? container.encodeIfPresent(browserScript, forKey: .browserScript) - - - } - - } - - /* - Model: IntegrationMeta - Used By: Configuration - */ - - class IntegrationMeta: Codable { - - - public var isPublic: Bool? - - public var id: String? - - public var name: String? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case isPublic = "is_public" - - case id = "_id" - - case name = "name" - - case value = "value" - - } - - public init(isPublic: Bool?, name: String?, value: String?, id: String?) { - - self.isPublic = isPublic - - self.id = id - - self.name = name - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isPublic = try container.decode(Bool.self, forKey: .isPublic) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isPublic, forKey: .isPublic) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: Integration - Used By: Configuration - */ - - class Integration: Codable { - - - public var validators: Validators? - - public var description: String? - - public var descriptionHtml: String? - - public var constants: [String: Any]? - - public var companies: [[String: Any]]? - - public var support: [String]? - - public var id: String? - - public var name: String? - - public var meta: IntegrationMeta? - - public var icon: String? - - public var owner: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var token: String? - - public var secret: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case validators = "validators" - - case description = "description" - - case descriptionHtml = "description_html" - - case constants = "constants" - - case companies = "companies" - - case support = "support" - - case id = "_id" - - case name = "name" - - case meta = "meta" - - case icon = "icon" - - case owner = "owner" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case token = "token" - - case secret = "secret" - - case v = "__v" - - } - - public init(companies: [[String: Any]]?, constants: [String: Any]?, createdAt: String?, description: String?, descriptionHtml: String?, icon: String?, meta: IntegrationMeta?, name: String?, owner: String?, secret: String?, support: [String]?, token: String?, updatedAt: String?, validators: Validators?, id: String?, v: Int?) { - - self.validators = validators - - self.description = description - - self.descriptionHtml = descriptionHtml - - self.constants = constants - - self.companies = companies - - self.support = support - - self.id = id - - self.name = name - - self.meta = meta - - self.icon = icon - - self.owner = owner - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.token = token - - self.secret = secret - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - validators = try container.decode(Validators.self, forKey: .validators) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - descriptionHtml = try container.decode(String.self, forKey: .descriptionHtml) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - constants = try container.decode([String: Any].self, forKey: .constants) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companies = try container.decode([[String: Any]].self, forKey: .companies) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - support = try container.decode([String].self, forKey: .support) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode(IntegrationMeta.self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - owner = try container.decode(String.self, forKey: .owner) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - token = try container.decode(String.self, forKey: .token) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - secret = try container.decode(String.self, forKey: .secret) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(validators, forKey: .validators) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(descriptionHtml, forKey: .descriptionHtml) - - - - try? container.encodeIfPresent(constants, forKey: .constants) - - - - try? container.encodeIfPresent(companies, forKey: .companies) - - - - try? container.encodeIfPresent(support, forKey: .support) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(owner, forKey: .owner) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(token, forKey: .token) - - - - try? container.encodeIfPresent(secret, forKey: .secret) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: IntegrationConfigResponse - Used By: Configuration - */ - - class IntegrationConfigResponse: Codable { - - - public var items: IntegrationLevel? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - } - - public init(items: IntegrationLevel?) { - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode(IntegrationLevel.self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: IntegrationLevel - Used By: Configuration - */ - - class IntegrationLevel: Codable { - - - public var opted: Bool? - - public var permissions: [[String: Any]]? - - public var lastPatch: [[String: Any]]? - - public var id: String? - - public var integration: String? - - public var level: String? - - public var uid: Int? - - public var meta: [[String: Any]]? - - public var token: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var v: Int? - - public var data: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case opted = "opted" - - case permissions = "permissions" - - case lastPatch = "last_patch" - - case id = "_id" - - case integration = "integration" - - case level = "level" - - case uid = "uid" - - case meta = "meta" - - case token = "token" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case v = "__v" - - case data = "data" - - } - - public init(createdAt: String?, data: [String: Any]?, integration: String?, lastPatch: [[String: Any]]?, level: String?, meta: [[String: Any]]?, opted: Bool?, permissions: [[String: Any]]?, token: String?, uid: Int?, updatedAt: String?, id: String?, v: Int?) { - - self.opted = opted - - self.permissions = permissions - - self.lastPatch = lastPatch - - self.id = id - - self.integration = integration - - self.level = level - - self.uid = uid - - self.meta = meta - - self.token = token - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.v = v - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - opted = try container.decode(Bool.self, forKey: .opted) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - permissions = try container.decode([[String: Any]].self, forKey: .permissions) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastPatch = try container.decode([[String: Any]].self, forKey: .lastPatch) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - integration = try container.decode(String.self, forKey: .integration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - level = try container.decode(String.self, forKey: .level) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([[String: Any]].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - token = try container.decode(String.self, forKey: .token) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode([String: Any].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(opted, forKey: .opted) - - - - try? container.encodeIfPresent(permissions, forKey: .permissions) - - - - try? container.encodeIfPresent(lastPatch, forKey: .lastPatch) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(integration, forKey: .integration) - - - - try? container.encodeIfPresent(level, forKey: .level) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(token, forKey: .token) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: OptedStoreIntegration - Used By: Configuration - */ - - class OptedStoreIntegration: Codable { - - - public var otherOpted: Bool? - - public var otherIntegration: IntegrationOptIn? - - public var otherEntity: OtherEntity? - - - public enum CodingKeys: String, CodingKey { - - case otherOpted = "other_opted" - - case otherIntegration = "other_integration" - - case otherEntity = "other_entity" - - } - - public init(otherEntity: OtherEntity?, otherIntegration: IntegrationOptIn?, otherOpted: Bool?) { - - self.otherOpted = otherOpted - - self.otherIntegration = otherIntegration - - self.otherEntity = otherEntity - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - otherOpted = try container.decode(Bool.self, forKey: .otherOpted) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - otherIntegration = try container.decode(IntegrationOptIn.self, forKey: .otherIntegration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - otherEntity = try container.decode(OtherEntity.self, forKey: .otherEntity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(otherOpted, forKey: .otherOpted) - - - - try? container.encodeIfPresent(otherIntegration, forKey: .otherIntegration) - - - - try? container.encodeIfPresent(otherEntity, forKey: .otherEntity) - - - } - - } - - /* - Model: OtherEntity - Used By: Configuration - */ - - class OtherEntity: Codable { - - - public var opted: Bool? - - public var permissions: [String]? - - public var lastPatch: LastPatch? - - public var id: String? - - public var integration: String? - - public var level: String? - - public var uid: Int? - - public var data: OtherEntityData? - - public var meta: [[String: Any]]? - - public var token: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case opted = "opted" - - case permissions = "permissions" - - case lastPatch = "last_patch" - - case id = "_id" - - case integration = "integration" - - case level = "level" - - case uid = "uid" - - case data = "data" - - case meta = "meta" - - case token = "token" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case v = "__v" - - } - - public init(createdAt: String?, data: OtherEntityData?, integration: String?, lastPatch: LastPatch?, level: String?, meta: [[String: Any]]?, opted: Bool?, permissions: [String]?, token: String?, uid: Int?, updatedAt: String?, id: String?, v: Int?) { - - self.opted = opted - - self.permissions = permissions - - self.lastPatch = lastPatch - - self.id = id - - self.integration = integration - - self.level = level - - self.uid = uid - - self.data = data - - self.meta = meta - - self.token = token - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - opted = try container.decode(Bool.self, forKey: .opted) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - permissions = try container.decode([String].self, forKey: .permissions) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - lastPatch = try container.decode(LastPatch.self, forKey: .lastPatch) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - integration = try container.decode(String.self, forKey: .integration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - level = try container.decode(String.self, forKey: .level) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode(OtherEntityData.self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([[String: Any]].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - token = try container.decode(String.self, forKey: .token) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(opted, forKey: .opted) - - - - try? container.encodeIfPresent(permissions, forKey: .permissions) - - - - try? container.encodeIfPresent(lastPatch, forKey: .lastPatch) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(integration, forKey: .integration) - - - - try? container.encodeIfPresent(level, forKey: .level) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(token, forKey: .token) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: LastPatch - Used By: Configuration - */ - - class LastPatch: Codable { - - - public var op: String? - - public var path: String? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case op = "op" - - case path = "path" - - case value = "value" - - } - - public init(op: String?, path: String?, value: String?) { - - self.op = op - - self.path = path - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - op = try container.decode(String.self, forKey: .op) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - path = try container.decode(String.self, forKey: .path) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(op, forKey: .op) - - - - try? container.encodeIfPresent(path, forKey: .path) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: OtherEntityData - Used By: Configuration - */ - - class OtherEntityData: Codable { - - - public var articleIdentifier: String? - - - public enum CodingKeys: String, CodingKey { - - case articleIdentifier = "article_identifier" - - } - - public init(articleIdentifier: String?) { - - self.articleIdentifier = articleIdentifier - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - articleIdentifier = try container.decode(String.self, forKey: .articleIdentifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(articleIdentifier, forKey: .articleIdentifier) - - - } - - } - - /* - Model: App - Used By: Configuration - */ - - class App: Codable { - - - public var companyId: String? - - public var channelType: String? - - public var auth: ApplicationAuth? - - public var name: String? - - public var desc: String? - - - public enum CodingKeys: String, CodingKey { - - case companyId = "company_id" - - case channelType = "channel_type" - - case auth = "auth" - - case name = "name" - - case desc = "desc" - - } - - public init(auth: ApplicationAuth?, channelType: String?, companyId: String?, desc: String?, name: String?) { - - self.companyId = companyId - - self.channelType = channelType - - self.auth = auth - - self.name = name - - self.desc = desc - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - companyId = try container.decode(String.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - channelType = try container.decode(String.self, forKey: .channelType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - auth = try container.decode(ApplicationAuth.self, forKey: .auth) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - desc = try container.decode(String.self, forKey: .desc) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(channelType, forKey: .channelType) - - - - try? container.encodeIfPresent(auth, forKey: .auth) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(desc, forKey: .desc) - - - } - - } - - /* - Model: AppInventory - Used By: Configuration - */ - - class AppInventory: Codable { - - - public var brand: InventoryBrandRule? - - public var store: InventoryStoreRule? - - public var image: [String]? - - public var franchiseEnabled: Bool? - - public var outOfStock: Bool? - - public var payment: InventoryPaymentConfig? - - public var articleAssignment: InventoryArticleAssignment? - - - public enum CodingKeys: String, CodingKey { - - case brand = "brand" - - case store = "store" - - case image = "image" - - case franchiseEnabled = "franchise_enabled" - - case outOfStock = "out_of_stock" - - case payment = "payment" - - case articleAssignment = "article_assignment" - - } - - public init(articleAssignment: InventoryArticleAssignment?, brand: InventoryBrandRule?, franchiseEnabled: Bool?, image: [String]?, outOfStock: Bool?, payment: InventoryPaymentConfig?, store: InventoryStoreRule?) { - - self.brand = brand - - self.store = store - - self.image = image - - self.franchiseEnabled = franchiseEnabled - - self.outOfStock = outOfStock - - self.payment = payment - - self.articleAssignment = articleAssignment - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - brand = try container.decode(InventoryBrandRule.self, forKey: .brand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - store = try container.decode(InventoryStoreRule.self, forKey: .store) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - image = try container.decode([String].self, forKey: .image) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - franchiseEnabled = try container.decode(Bool.self, forKey: .franchiseEnabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - outOfStock = try container.decode(Bool.self, forKey: .outOfStock) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - payment = try container.decode(InventoryPaymentConfig.self, forKey: .payment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - articleAssignment = try container.decode(InventoryArticleAssignment.self, forKey: .articleAssignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(brand, forKey: .brand) - - - - try? container.encodeIfPresent(store, forKey: .store) - - - - try? container.encodeIfPresent(image, forKey: .image) - - - - try? container.encodeIfPresent(franchiseEnabled, forKey: .franchiseEnabled) - - - - try? container.encodeIfPresent(outOfStock, forKey: .outOfStock) - - - - try? container.encodeIfPresent(payment, forKey: .payment) - - - - try? container.encodeIfPresent(articleAssignment, forKey: .articleAssignment) - - - } - - } - - /* - Model: AppDomain - Used By: Configuration - */ - - class AppDomain: Codable { - - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - } - - public init(name: String?) { - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: CompaniesResponse - Used By: Configuration - */ - - class CompaniesResponse: Codable { - - - public var items: AppInventoryCompanies? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: AppInventoryCompanies?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode(AppInventoryCompanies.self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: AppInventoryCompanies - Used By: Configuration - */ - - class AppInventoryCompanies: Codable { - - - public var uid: Int? - - public var name: String? - - public var companyType: String? - - - public enum CodingKeys: String, CodingKey { - - case uid = "uid" - - case name = "name" - - case companyType = "company_type" - - } - - public init(companyType: String?, name: String?, uid: Int?) { - - self.uid = uid - - self.name = name - - self.companyType = companyType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyType = try container.decode(String.self, forKey: .companyType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(companyType, forKey: .companyType) - - - } - - } - - /* - Model: StoresResponse - Used By: Configuration - */ - - class StoresResponse: Codable { - - - public var items: AppInventoryStores? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: AppInventoryStores?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode(AppInventoryStores.self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: AppInventoryStores - Used By: Configuration - */ - - class AppInventoryStores: Codable { - - - public var id: String? - - public var modifiedOn: String? - - public var uid: Int? - - public var name: String? - - public var displayName: String? - - public var storeType: String? - - public var storeCode: String? - - public var companyId: Int? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case modifiedOn = "modified_on" - - case uid = "uid" - - case name = "name" - - case displayName = "display_name" - - case storeType = "store_type" - - case storeCode = "store_code" - - case companyId = "company_id" - - } - - public init(companyId: Int?, displayName: String?, modifiedOn: String?, name: String?, storeCode: String?, storeType: String?, uid: Int?, id: String?) { - - self.id = id - - self.modifiedOn = modifiedOn - - self.uid = uid - - self.name = name - - self.displayName = displayName - - self.storeType = storeType - - self.storeCode = storeCode - - self.companyId = companyId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeType = try container.decode(String.self, forKey: .storeType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeCode = try container.decode(String.self, forKey: .storeCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(storeType, forKey: .storeType) - - - - try? container.encodeIfPresent(storeCode, forKey: .storeCode) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - } - - } - - /* - Model: FilterOrderingStoreRequest - Used By: Configuration - */ - - class FilterOrderingStoreRequest: Codable { - - - public var allStores: Bool? - - public var deployedStores: [Int]? - - public var q: String? - - - public enum CodingKeys: String, CodingKey { - - case allStores = "all_stores" - - case deployedStores = "deployed_stores" - - case q = "q" - - } - - public init(allStores: Bool?, deployedStores: [Int]?, q: String?) { - - self.allStores = allStores - - self.deployedStores = deployedStores - - self.q = q - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - allStores = try container.decode(Bool.self, forKey: .allStores) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deployedStores = try container.decode([Int].self, forKey: .deployedStores) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - q = try container.decode(String.self, forKey: .q) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(allStores, forKey: .allStores) - - - - try? container.encodeIfPresent(deployedStores, forKey: .deployedStores) - - - - try? container.encodeIfPresent(q, forKey: .q) - - - } - - } - - /* - Model: DeploymentMeta - Used By: Configuration - */ - - class DeploymentMeta: Codable { - - - public var deployedStores: [Int]? - - public var allStores: Bool? - - public var enabled: Bool? - - public var type: String? - - public var id: String? - - public var app: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case deployedStores = "deployed_stores" - - case allStores = "all_stores" - - case enabled = "enabled" - - case type = "type" - - case id = "_id" - - case app = "app" - - case v = "__v" - - } - - public init(allStores: Bool?, app: String?, deployedStores: [Int]?, enabled: Bool?, type: String?, id: String?, v: Int?) { - - self.deployedStores = deployedStores - - self.allStores = allStores - - self.enabled = enabled - - self.type = type - - self.id = id - - self.app = app - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - deployedStores = try container.decode([Int].self, forKey: .deployedStores) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allStores = try container.decode(Bool.self, forKey: .allStores) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - app = try container.decode(String.self, forKey: .app) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(deployedStores, forKey: .deployedStores) - - - - try? container.encodeIfPresent(allStores, forKey: .allStores) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(app, forKey: .app) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: OrderingStoreConfig - Used By: Configuration - */ - - class OrderingStoreConfig: Codable { - - - public var deploymentMeta: DeploymentMeta? - - - public enum CodingKeys: String, CodingKey { - - case deploymentMeta = "deployment_meta" - - } - - public init(deploymentMeta: DeploymentMeta?) { - - self.deploymentMeta = deploymentMeta - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - deploymentMeta = try container.decode(DeploymentMeta.self, forKey: .deploymentMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(deploymentMeta, forKey: .deploymentMeta) - - - } - - } - - /* - Model: OtherSellerCompany - Used By: Configuration - */ - - class OtherSellerCompany: Codable { - - - public var uid: Int? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case uid = "uid" - - case name = "name" - - } - - public init(name: String?, uid: Int?) { - - self.uid = uid - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: OtherSellerApplication - Used By: Configuration - */ - - class OtherSellerApplication: Codable { - - - public var name: String? - - public var description: String? - - public var id: String? - - public var domain: String? - - public var company: OtherSellerCompany? - - public var optType: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case description = "description" - - case id = "_id" - - case domain = "domain" - - case company = "company" - - case optType = "opt_type" - - } - - public init(company: OtherSellerCompany?, description: String?, domain: String?, name: String?, optType: String?, id: String?) { - - self.name = name - - self.description = description - - self.id = id - - self.domain = domain - - self.company = company - - self.optType = optType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - domain = try container.decode(String.self, forKey: .domain) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - company = try container.decode(OtherSellerCompany.self, forKey: .company) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - optType = try container.decode(String.self, forKey: .optType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(domain, forKey: .domain) - - - - try? container.encodeIfPresent(company, forKey: .company) - - - - try? container.encodeIfPresent(optType, forKey: .optType) - - - } - - } - - /* - Model: OtherSellerApplications - Used By: Configuration - */ - - class OtherSellerApplications: Codable { - - - public var items: [OtherSellerApplication]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [OtherSellerApplication]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([OtherSellerApplication].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: OptedApplicationResponse - Used By: Configuration - */ - - class OptedApplicationResponse: Codable { - - - public var name: String? - - public var description: String? - - public var id: String? - - public var domain: String? - - public var company: OptedCompany? - - public var optedInventory: OptedInventory? - - public var optOutInventory: OptOutInventory? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case description = "description" - - case id = "_id" - - case domain = "domain" - - case company = "company" - - case optedInventory = "opted_inventory" - - case optOutInventory = "opt_out_inventory" - - } - - public init(company: OptedCompany?, description: String?, domain: String?, name: String?, optedInventory: OptedInventory?, optOutInventory: OptOutInventory?, id: String?) { - - self.name = name - - self.description = description - - self.id = id - - self.domain = domain - - self.company = company - - self.optedInventory = optedInventory - - self.optOutInventory = optOutInventory - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - domain = try container.decode(String.self, forKey: .domain) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - company = try container.decode(OptedCompany.self, forKey: .company) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - optedInventory = try container.decode(OptedInventory.self, forKey: .optedInventory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - optOutInventory = try container.decode(OptOutInventory.self, forKey: .optOutInventory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(domain, forKey: .domain) - - - - try? container.encodeIfPresent(company, forKey: .company) - - - - try? container.encodeIfPresent(optedInventory, forKey: .optedInventory) - - - - try? container.encodeIfPresent(optOutInventory, forKey: .optOutInventory) - - - } - - } - - /* - Model: OptedCompany - Used By: Configuration - */ - - class OptedCompany: Codable { - - - public var uid: Int? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case uid = "uid" - - case name = "name" - - } - - public init(name: String?, uid: Int?) { - - self.uid = uid - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: OptedInventory - Used By: Configuration - */ - - class OptedInventory: Codable { - - - public var optType: OptType? - - public var items: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case optType = "opt_type" - - case items = "items" - - } - - public init(items: [String: Any]?, optType: OptType?) { - - self.optType = optType - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - optType = try container.decode(OptType.self, forKey: .optType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([String: Any].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(optType, forKey: .optType) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: OptType - Used By: Configuration - */ - - class OptType: Codable { - - - public var key: String? - - public var display: String? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case display = "display" - - } - - public init(display: String?, key: String?) { - - self.key = key - - self.display = display - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - } - - } - - /* - Model: OptedStore - Used By: Configuration - */ - - class OptedStore: Codable { - - - public var name: String? - - public var storeCode: String? - - public var id: String? - - public var modifiedOn: String? - - public var uid: Int? - - public var address: OptedStoreAddress? - - public var displayName: String? - - public var storeType: String? - - public var companyId: Int? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case storeCode = "store_code" - - case id = "_id" - - case modifiedOn = "modified_on" - - case uid = "uid" - - case address = "address" - - case displayName = "display_name" - - case storeType = "store_type" - - case companyId = "company_id" - - } - - public init(address: OptedStoreAddress?, companyId: Int?, displayName: String?, modifiedOn: String?, name: String?, storeCode: String?, storeType: String?, uid: Int?, id: String?) { - - self.name = name - - self.storeCode = storeCode - - self.id = id - - self.modifiedOn = modifiedOn - - self.uid = uid - - self.address = address - - self.displayName = displayName - - self.storeType = storeType - - self.companyId = companyId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeCode = try container.decode(String.self, forKey: .storeCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address = try container.decode(OptedStoreAddress.self, forKey: .address) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeType = try container.decode(String.self, forKey: .storeType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(storeCode, forKey: .storeCode) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(storeType, forKey: .storeType) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - } - - } - - /* - Model: OptOutInventory - Used By: Configuration - */ - - class OptOutInventory: Codable { - - - public var store: [Int] - - public var company: [Int] - - - public enum CodingKeys: String, CodingKey { - - case store = "store" - - case company = "company" - - } - - public init(company: [Int], store: [Int]) { - - self.store = store - - self.company = company - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - store = try container.decode([Int].self, forKey: .store) - - - - - company = try container.decode([Int].self, forKey: .company) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(store, forKey: .store) - - - - try? container.encodeIfPresent(company, forKey: .company) - - - } - - } - - /* - Model: TokenResponse - Used By: Configuration - */ - - class TokenResponse: Codable { - - - public var tokens: Tokens? - - public var id: String? - - public var application: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case tokens = "tokens" - - case id = "_id" - - case application = "application" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case v = "__v" - - } - - public init(application: String?, createdAt: String?, tokens: Tokens?, updatedAt: String?, id: String?, v: Int?) { - - self.tokens = tokens - - self.id = id - - self.application = application - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - tokens = try container.decode(Tokens.self, forKey: .tokens) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(tokens, forKey: .tokens) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: Tokens - Used By: Configuration - */ - - class Tokens: Codable { - - - public var firebase: Firebase? - - public var moengage: Moengage? - - public var segment: Segment? - - public var gtm: Gtm? - - public var freshchat: Freshchat? - - public var safetynet: Safetynet? - - public var fyndRewards: FyndRewards? - - public var googleMap: GoogleMap? - - - public enum CodingKeys: String, CodingKey { - - case firebase = "firebase" - - case moengage = "moengage" - - case segment = "segment" - - case gtm = "gtm" - - case freshchat = "freshchat" - - case safetynet = "safetynet" - - case fyndRewards = "fynd_rewards" - - case googleMap = "google_map" - - } - - public init(firebase: Firebase?, freshchat: Freshchat?, fyndRewards: FyndRewards?, googleMap: GoogleMap?, gtm: Gtm?, moengage: Moengage?, safetynet: Safetynet?, segment: Segment?) { - - self.firebase = firebase - - self.moengage = moengage - - self.segment = segment - - self.gtm = gtm - - self.freshchat = freshchat - - self.safetynet = safetynet - - self.fyndRewards = fyndRewards - - self.googleMap = googleMap - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - firebase = try container.decode(Firebase.self, forKey: .firebase) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - moengage = try container.decode(Moengage.self, forKey: .moengage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - segment = try container.decode(Segment.self, forKey: .segment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gtm = try container.decode(Gtm.self, forKey: .gtm) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - freshchat = try container.decode(Freshchat.self, forKey: .freshchat) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - safetynet = try container.decode(Safetynet.self, forKey: .safetynet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fyndRewards = try container.decode(FyndRewards.self, forKey: .fyndRewards) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - googleMap = try container.decode(GoogleMap.self, forKey: .googleMap) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(firebase, forKey: .firebase) - - - - try? container.encodeIfPresent(moengage, forKey: .moengage) - - - - try? container.encodeIfPresent(segment, forKey: .segment) - - - - try? container.encodeIfPresent(gtm, forKey: .gtm) - - - - try? container.encodeIfPresent(freshchat, forKey: .freshchat) - - - - try? container.encodeIfPresent(safetynet, forKey: .safetynet) - - - - try? container.encodeIfPresent(fyndRewards, forKey: .fyndRewards) - - - - try? container.encodeIfPresent(googleMap, forKey: .googleMap) - - - } - - } - - /* - Model: Firebase - Used By: Configuration - */ - - class Firebase: Codable { - - - public var credentials: Credentials? - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case credentials = "credentials" - - case enabled = "enabled" - - } - - public init(credentials: Credentials?, enabled: Bool?) { - - self.credentials = credentials - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - credentials = try container.decode(Credentials.self, forKey: .credentials) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(credentials, forKey: .credentials) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: Credentials - Used By: Configuration - */ - - class Credentials: Codable { - - - public var ios: Ios? - - public var android: Android? - - public var projectId: String? - - public var gcmSenderId: String? - - public var applicationId: String? - - public var apiKey: String? - - - public enum CodingKeys: String, CodingKey { - - case ios = "ios" - - case android = "android" - - case projectId = "project_id" - - case gcmSenderId = "gcm_sender_id" - - case applicationId = "application_id" - - case apiKey = "api_key" - - } - - public init(android: Android?, apiKey: String?, applicationId: String?, gcmSenderId: String?, ios: Ios?, projectId: String?) { - - self.ios = ios - - self.android = android - - self.projectId = projectId - - self.gcmSenderId = gcmSenderId - - self.applicationId = applicationId - - self.apiKey = apiKey - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - ios = try container.decode(Ios.self, forKey: .ios) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - android = try container.decode(Android.self, forKey: .android) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - projectId = try container.decode(String.self, forKey: .projectId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gcmSenderId = try container.decode(String.self, forKey: .gcmSenderId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - applicationId = try container.decode(String.self, forKey: .applicationId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - apiKey = try container.decode(String.self, forKey: .apiKey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(ios, forKey: .ios) - - - - try? container.encodeIfPresent(android, forKey: .android) - - - - try? container.encodeIfPresent(projectId, forKey: .projectId) - - - - try? container.encodeIfPresent(gcmSenderId, forKey: .gcmSenderId) - - - - try? container.encodeIfPresent(applicationId, forKey: .applicationId) - - - - try? container.encodeIfPresent(apiKey, forKey: .apiKey) - - - } - - } - - /* - Model: Ios - Used By: Configuration - */ - - class Ios: Codable { - - - public var applicationId: String? - - public var apiKey: String? - - - public enum CodingKeys: String, CodingKey { - - case applicationId = "application_id" - - case apiKey = "api_key" - - } - - public init(apiKey: String?, applicationId: String?) { - - self.applicationId = applicationId - - self.apiKey = apiKey - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - applicationId = try container.decode(String.self, forKey: .applicationId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - apiKey = try container.decode(String.self, forKey: .apiKey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(applicationId, forKey: .applicationId) - - - - try? container.encodeIfPresent(apiKey, forKey: .apiKey) - - - } - - } - - /* - Model: Android - Used By: Configuration - */ - - class Android: Codable { - - - public var applicationId: String? - - public var apiKey: String? - - - public enum CodingKeys: String, CodingKey { - - case applicationId = "application_id" - - case apiKey = "api_key" - - } - - public init(apiKey: String?, applicationId: String?) { - - self.applicationId = applicationId - - self.apiKey = apiKey - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - applicationId = try container.decode(String.self, forKey: .applicationId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - apiKey = try container.decode(String.self, forKey: .apiKey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(applicationId, forKey: .applicationId) - - - - try? container.encodeIfPresent(apiKey, forKey: .apiKey) - - - } - - } - - /* - Model: Moengage - Used By: Configuration - */ - - class Moengage: Codable { - - - public var credentials: MoengageCredentials? - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case credentials = "credentials" - - case enabled = "enabled" - - } - - public init(credentials: MoengageCredentials?, enabled: Bool?) { - - self.credentials = credentials - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - credentials = try container.decode(MoengageCredentials.self, forKey: .credentials) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(credentials, forKey: .credentials) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: MoengageCredentials - Used By: Configuration - */ - - class MoengageCredentials: Codable { - - - public var appId: String? - - - public enum CodingKeys: String, CodingKey { - - case appId = "app_id" - - } - - public init(appId: String?) { - - self.appId = appId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - } - - } - - /* - Model: Segment - Used By: Configuration - */ - - class Segment: Codable { - - - public var credentials: SegmentCredentials? - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case credentials = "credentials" - - case enabled = "enabled" - - } - - public init(credentials: SegmentCredentials?, enabled: Bool?) { - - self.credentials = credentials - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - credentials = try container.decode(SegmentCredentials.self, forKey: .credentials) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(credentials, forKey: .credentials) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: SegmentCredentials - Used By: Configuration - */ - - class SegmentCredentials: Codable { - - - public var writeKey: String? - - - public enum CodingKeys: String, CodingKey { - - case writeKey = "write_key" - - } - - public init(writeKey: String?) { - - self.writeKey = writeKey - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - writeKey = try container.decode(String.self, forKey: .writeKey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(writeKey, forKey: .writeKey) - - - } - - } - - /* - Model: Gtm - Used By: Configuration - */ - - class Gtm: Codable { - - - public var credentials: GtmCredentials? - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case credentials = "credentials" - - case enabled = "enabled" - - } - - public init(credentials: GtmCredentials?, enabled: Bool?) { - - self.credentials = credentials - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - credentials = try container.decode(GtmCredentials.self, forKey: .credentials) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(credentials, forKey: .credentials) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: GtmCredentials - Used By: Configuration - */ - - class GtmCredentials: Codable { - - - public var apiKey: String? - - - public enum CodingKeys: String, CodingKey { - - case apiKey = "api_key" - - } - - public init(apiKey: String?) { - - self.apiKey = apiKey - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - apiKey = try container.decode(String.self, forKey: .apiKey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(apiKey, forKey: .apiKey) - - - } - - } - - /* - Model: Freshchat - Used By: Configuration - */ - - class Freshchat: Codable { - - - public var credentials: FreshchatCredentials? - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case credentials = "credentials" - - case enabled = "enabled" - - } - - public init(credentials: FreshchatCredentials?, enabled: Bool?) { - - self.credentials = credentials - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - credentials = try container.decode(FreshchatCredentials.self, forKey: .credentials) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(credentials, forKey: .credentials) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: FreshchatCredentials - Used By: Configuration - */ - - class FreshchatCredentials: Codable { - - - public var appId: String? - - public var appKey: String? - - public var webToken: String? - - - public enum CodingKeys: String, CodingKey { - - case appId = "app_id" - - case appKey = "app_key" - - case webToken = "web_token" - - } - - public init(appId: String?, appKey: String?, webToken: String?) { - - self.appId = appId - - self.appKey = appKey - - self.webToken = webToken - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - appId = try container.decode(String.self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appKey = try container.decode(String.self, forKey: .appKey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - webToken = try container.decode(String.self, forKey: .webToken) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(appKey, forKey: .appKey) - - - - try? container.encodeIfPresent(webToken, forKey: .webToken) - - - } - - } - - /* - Model: Safetynet - Used By: Configuration - */ - - class Safetynet: Codable { - - - public var credentials: SafetynetCredentials? - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case credentials = "credentials" - - case enabled = "enabled" - - } - - public init(credentials: SafetynetCredentials?, enabled: Bool?) { - - self.credentials = credentials - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - credentials = try container.decode(SafetynetCredentials.self, forKey: .credentials) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(credentials, forKey: .credentials) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: SafetynetCredentials - Used By: Configuration - */ - - class SafetynetCredentials: Codable { - - - public var apiKey: String? - - - public enum CodingKeys: String, CodingKey { - - case apiKey = "api_key" - - } - - public init(apiKey: String?) { - - self.apiKey = apiKey - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - apiKey = try container.decode(String.self, forKey: .apiKey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(apiKey, forKey: .apiKey) - - - } - - } - - /* - Model: FyndRewards - Used By: Configuration - */ - - class FyndRewards: Codable { - - - public var credentials: FyndRewardsCredentials? - - - public enum CodingKeys: String, CodingKey { - - case credentials = "credentials" - - } - - public init(credentials: FyndRewardsCredentials?) { - - self.credentials = credentials - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - credentials = try container.decode(FyndRewardsCredentials.self, forKey: .credentials) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(credentials, forKey: .credentials) - - - } - - } - - /* - Model: FyndRewardsCredentials - Used By: Configuration - */ - - class FyndRewardsCredentials: Codable { - - - public var publicKey: String? - - - public enum CodingKeys: String, CodingKey { - - case publicKey = "public_key" - - } - - public init(publicKey: String?) { - - self.publicKey = publicKey - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - publicKey = try container.decode(String.self, forKey: .publicKey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(publicKey, forKey: .publicKey) - - - } - - } - - /* - Model: GoogleMap - Used By: Configuration - */ - - class GoogleMap: Codable { - - - public var credentials: GoogleMapCredentials? - - - public enum CodingKeys: String, CodingKey { - - case credentials = "credentials" - - } - - public init(credentials: GoogleMapCredentials?) { - - self.credentials = credentials - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - credentials = try container.decode(GoogleMapCredentials.self, forKey: .credentials) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(credentials, forKey: .credentials) - - - } - - } - - /* - Model: GoogleMapCredentials - Used By: Configuration - */ - - class GoogleMapCredentials: Codable { - - - public var apiKey: String? - - - public enum CodingKeys: String, CodingKey { - - case apiKey = "api_key" - - } - - public init(apiKey: String?) { - - self.apiKey = apiKey - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - apiKey = try container.decode(String.self, forKey: .apiKey) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(apiKey, forKey: .apiKey) - - - } - - } - - /* - Model: RewardPointsConfig - Used By: Configuration - */ - - class RewardPointsConfig: Codable { - - - public var credit: Credit? - - public var debit: Debit? - - - public enum CodingKeys: String, CodingKey { - - case credit = "credit" - - case debit = "debit" - - } - - public init(credit: Credit?, debit: Debit?) { - - self.credit = credit - - self.debit = debit - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - credit = try container.decode(Credit.self, forKey: .credit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - debit = try container.decode(Debit.self, forKey: .debit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(credit, forKey: .credit) - - - - try? container.encodeIfPresent(debit, forKey: .debit) - - - } - - } - - /* - Model: Credit - Used By: Configuration - */ - - class Credit: Codable { - - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - } - - public init(enabled: Bool?) { - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: Debit - Used By: Configuration - */ - - class Debit: Codable { - - - public var enabled: Bool? - - public var autoApply: Bool? - - public var strategyChannel: String? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - case autoApply = "auto_apply" - - case strategyChannel = "strategy_channel" - - } - - public init(autoApply: Bool?, enabled: Bool?, strategyChannel: String?) { - - self.enabled = enabled - - self.autoApply = autoApply - - self.strategyChannel = strategyChannel - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - autoApply = try container.decode(Bool.self, forKey: .autoApply) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - strategyChannel = try container.decode(String.self, forKey: .strategyChannel) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(autoApply, forKey: .autoApply) - - - - try? container.encodeIfPresent(strategyChannel, forKey: .strategyChannel) - - - } - - } - - /* - Model: ProductDetailFeature - Used By: Configuration - */ - - class ProductDetailFeature: Codable { - - - public var similar: [String]? - - public var sellerSelection: Bool? - - public var updateProductMeta: Bool? - - public var requestProduct: Bool? - - - public enum CodingKeys: String, CodingKey { - - case similar = "similar" - - case sellerSelection = "seller_selection" - - case updateProductMeta = "update_product_meta" - - case requestProduct = "request_product" - - } - - public init(requestProduct: Bool?, sellerSelection: Bool?, similar: [String]?, updateProductMeta: Bool?) { - - self.similar = similar - - self.sellerSelection = sellerSelection - - self.updateProductMeta = updateProductMeta - - self.requestProduct = requestProduct - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - similar = try container.decode([String].self, forKey: .similar) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sellerSelection = try container.decode(Bool.self, forKey: .sellerSelection) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updateProductMeta = try container.decode(Bool.self, forKey: .updateProductMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requestProduct = try container.decode(Bool.self, forKey: .requestProduct) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(similar, forKey: .similar) - - - - try? container.encodeIfPresent(sellerSelection, forKey: .sellerSelection) - - - - try? container.encodeIfPresent(updateProductMeta, forKey: .updateProductMeta) - - - - try? container.encodeIfPresent(requestProduct, forKey: .requestProduct) - - - } - - } - - /* - Model: LaunchPage - Used By: Configuration - */ - - class LaunchPage: Codable { - - - public var pageType: String? - - public var params: [String: Any]? - - public var query: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case pageType = "page_type" - - case params = "params" - - case query = "query" - - } - - public init(pageType: String?, params: [String: Any]?, query: [String: Any]?) { - - self.pageType = pageType - - self.params = params - - self.query = query - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pageType = try container.decode(String.self, forKey: .pageType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - params = try container.decode([String: Any].self, forKey: .params) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - query = try container.decode([String: Any].self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pageType, forKey: .pageType) - - - - try? container.encodeIfPresent(params, forKey: .params) - - - - try? container.encodeIfPresent(query, forKey: .query) - - - } - - } - - /* - Model: LandingPageFeature - Used By: Configuration - */ - - class LandingPageFeature: Codable { - - - public var launchPage: LaunchPage? - - public var continueAsGuest: Bool? - - public var loginBtnText: String? - - public var showDomainTextbox: Bool? - - public var showRegisterBtn: Bool? - - - public enum CodingKeys: String, CodingKey { - - case launchPage = "launch_page" - - case continueAsGuest = "continue_as_guest" - - case loginBtnText = "login_btn_text" - - case showDomainTextbox = "show_domain_textbox" - - case showRegisterBtn = "show_register_btn" - - } - - public init(continueAsGuest: Bool?, launchPage: LaunchPage?, loginBtnText: String?, showDomainTextbox: Bool?, showRegisterBtn: Bool?) { - - self.launchPage = launchPage - - self.continueAsGuest = continueAsGuest - - self.loginBtnText = loginBtnText - - self.showDomainTextbox = showDomainTextbox - - self.showRegisterBtn = showRegisterBtn - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - launchPage = try container.decode(LaunchPage.self, forKey: .launchPage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - continueAsGuest = try container.decode(Bool.self, forKey: .continueAsGuest) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - loginBtnText = try container.decode(String.self, forKey: .loginBtnText) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - showDomainTextbox = try container.decode(Bool.self, forKey: .showDomainTextbox) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - showRegisterBtn = try container.decode(Bool.self, forKey: .showRegisterBtn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(launchPage, forKey: .launchPage) - - - - try? container.encodeIfPresent(continueAsGuest, forKey: .continueAsGuest) - - - - try? container.encodeIfPresent(loginBtnText, forKey: .loginBtnText) - - - - try? container.encodeIfPresent(showDomainTextbox, forKey: .showDomainTextbox) - - - - try? container.encodeIfPresent(showRegisterBtn, forKey: .showRegisterBtn) - - - } - - } - - /* - Model: RegistrationPageFeature - Used By: Configuration - */ - - class RegistrationPageFeature: Codable { - - - public var askStoreAddress: Bool? - - - public enum CodingKeys: String, CodingKey { - - case askStoreAddress = "ask_store_address" - - } - - public init(askStoreAddress: Bool?) { - - self.askStoreAddress = askStoreAddress - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - askStoreAddress = try container.decode(Bool.self, forKey: .askStoreAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(askStoreAddress, forKey: .askStoreAddress) - - - } - - } - - /* - Model: AppFeature - Used By: Configuration - */ - - class AppFeature: Codable { - - - public var productDetail: ProductDetailFeature? - - public var landingPage: LandingPageFeature? - - public var registrationPage: RegistrationPageFeature? - - public var homePage: HomePageFeature? - - public var common: CommonFeature? - - public var cart: CartFeature? - - public var qr: QrFeature? - - public var pcr: PcrFeature? - - public var order: OrderFeature? - - public var id: String? - - public var app: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case productDetail = "product_detail" - - case landingPage = "landing_page" - - case registrationPage = "registration_page" - - case homePage = "home_page" - - case common = "common" - - case cart = "cart" - - case qr = "qr" - - case pcr = "pcr" - - case order = "order" - - case id = "_id" - - case app = "app" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case v = "__v" - - } - - public init(app: String?, cart: CartFeature?, common: CommonFeature?, createdAt: String?, homePage: HomePageFeature?, landingPage: LandingPageFeature?, order: OrderFeature?, pcr: PcrFeature?, productDetail: ProductDetailFeature?, qr: QrFeature?, registrationPage: RegistrationPageFeature?, updatedAt: String?, id: String?, v: Int?) { - - self.productDetail = productDetail - - self.landingPage = landingPage - - self.registrationPage = registrationPage - - self.homePage = homePage - - self.common = common - - self.cart = cart - - self.qr = qr - - self.pcr = pcr - - self.order = order - - self.id = id - - self.app = app - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - productDetail = try container.decode(ProductDetailFeature.self, forKey: .productDetail) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - landingPage = try container.decode(LandingPageFeature.self, forKey: .landingPage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - registrationPage = try container.decode(RegistrationPageFeature.self, forKey: .registrationPage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - homePage = try container.decode(HomePageFeature.self, forKey: .homePage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - common = try container.decode(CommonFeature.self, forKey: .common) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cart = try container.decode(CartFeature.self, forKey: .cart) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - qr = try container.decode(QrFeature.self, forKey: .qr) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pcr = try container.decode(PcrFeature.self, forKey: .pcr) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - order = try container.decode(OrderFeature.self, forKey: .order) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - app = try container.decode(String.self, forKey: .app) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(productDetail, forKey: .productDetail) - - - - try? container.encodeIfPresent(landingPage, forKey: .landingPage) - - - - try? container.encodeIfPresent(registrationPage, forKey: .registrationPage) - - - - try? container.encodeIfPresent(homePage, forKey: .homePage) - - - - try? container.encodeIfPresent(common, forKey: .common) - - - - try? container.encodeIfPresent(cart, forKey: .cart) - - - - try? container.encodeIfPresent(qr, forKey: .qr) - - - - try? container.encodeIfPresent(pcr, forKey: .pcr) - - - - try? container.encodeIfPresent(order, forKey: .order) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(app, forKey: .app) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: HomePageFeature - Used By: Configuration - */ - - class HomePageFeature: Codable { - - - public var orderProcessing: Bool? - - - public enum CodingKeys: String, CodingKey { - - case orderProcessing = "order_processing" - - } - - public init(orderProcessing: Bool?) { - - self.orderProcessing = orderProcessing - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - orderProcessing = try container.decode(Bool.self, forKey: .orderProcessing) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(orderProcessing, forKey: .orderProcessing) - - - } - - } - - /* - Model: CommonFeature - Used By: Configuration - */ - - class CommonFeature: Codable { - - - public var communicationOptinDialog: CommunicationOptinDialogFeature? - - public var deploymentStoreSelection: DeploymentStoreSelectionFeature? - - public var listingPrice: ListingPriceFeature? - - public var currency: CurrencyFeature? - - public var revenueEngine: RevenueEngineFeature? - - public var feedback: FeedbackFeature? - - public var compareProducts: CompareProductsFeature? - - public var rewardPoints: RewardPointsConfig? - - - public enum CodingKeys: String, CodingKey { - - case communicationOptinDialog = "communication_optin_dialog" - - case deploymentStoreSelection = "deployment_store_selection" - - case listingPrice = "listing_price" - - case currency = "currency" - - case revenueEngine = "revenue_engine" - - case feedback = "feedback" - - case compareProducts = "compare_products" - - case rewardPoints = "reward_points" - - } - - public init(communicationOptinDialog: CommunicationOptinDialogFeature?, compareProducts: CompareProductsFeature?, currency: CurrencyFeature?, deploymentStoreSelection: DeploymentStoreSelectionFeature?, feedback: FeedbackFeature?, listingPrice: ListingPriceFeature?, revenueEngine: RevenueEngineFeature?, rewardPoints: RewardPointsConfig?) { - - self.communicationOptinDialog = communicationOptinDialog - - self.deploymentStoreSelection = deploymentStoreSelection - - self.listingPrice = listingPrice - - self.currency = currency - - self.revenueEngine = revenueEngine - - self.feedback = feedback - - self.compareProducts = compareProducts - - self.rewardPoints = rewardPoints - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - communicationOptinDialog = try container.decode(CommunicationOptinDialogFeature.self, forKey: .communicationOptinDialog) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deploymentStoreSelection = try container.decode(DeploymentStoreSelectionFeature.self, forKey: .deploymentStoreSelection) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - listingPrice = try container.decode(ListingPriceFeature.self, forKey: .listingPrice) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currency = try container.decode(CurrencyFeature.self, forKey: .currency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - revenueEngine = try container.decode(RevenueEngineFeature.self, forKey: .revenueEngine) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - feedback = try container.decode(FeedbackFeature.self, forKey: .feedback) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - compareProducts = try container.decode(CompareProductsFeature.self, forKey: .compareProducts) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rewardPoints = try container.decode(RewardPointsConfig.self, forKey: .rewardPoints) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(communicationOptinDialog, forKey: .communicationOptinDialog) - - - - try? container.encodeIfPresent(deploymentStoreSelection, forKey: .deploymentStoreSelection) - - - - try? container.encodeIfPresent(listingPrice, forKey: .listingPrice) - - - - try? container.encodeIfPresent(currency, forKey: .currency) - - - - try? container.encodeIfPresent(revenueEngine, forKey: .revenueEngine) - - - - try? container.encodeIfPresent(feedback, forKey: .feedback) - - - - try? container.encodeIfPresent(compareProducts, forKey: .compareProducts) - - - - try? container.encodeIfPresent(rewardPoints, forKey: .rewardPoints) - - - } - - } - - /* - Model: CommunicationOptinDialogFeature - Used By: Configuration - */ - - class CommunicationOptinDialogFeature: Codable { - - - public var visibility: Bool? - - - public enum CodingKeys: String, CodingKey { - - case visibility = "visibility" - - } - - public init(visibility: Bool?) { - - self.visibility = visibility - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - visibility = try container.decode(Bool.self, forKey: .visibility) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(visibility, forKey: .visibility) - - - } - - } - - /* - Model: DeploymentStoreSelectionFeature - Used By: Configuration - */ - - class DeploymentStoreSelectionFeature: Codable { - - - public var enabled: Bool? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - case type = "type" - - } - - public init(enabled: Bool?, type: String?) { - - self.enabled = enabled - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ListingPriceFeature - Used By: Configuration - */ - - class ListingPriceFeature: Codable { - - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case value = "value" - - } - - public init(value: String?) { - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: CurrencyFeature - Used By: Configuration - */ - - class CurrencyFeature: Codable { - - - public var value: [String]? - - public var type: String? - - public var defaultCurrency: String? - - - public enum CodingKeys: String, CodingKey { - - case value = "value" - - case type = "type" - - case defaultCurrency = "default_currency" - - } - - public init(defaultCurrency: String?, type: String?, value: [String]?) { - - self.value = value - - self.type = type - - self.defaultCurrency = defaultCurrency - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - value = try container.decode([String].self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - defaultCurrency = try container.decode(String.self, forKey: .defaultCurrency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(defaultCurrency, forKey: .defaultCurrency) - - - } - - } - - /* - Model: RevenueEngineFeature - Used By: Configuration - */ - - class RevenueEngineFeature: Codable { - - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - } - - public init(enabled: Bool?) { - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: FeedbackFeature - Used By: Configuration - */ - - class FeedbackFeature: Codable { - - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - } - - public init(enabled: Bool?) { - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: CompareProductsFeature - Used By: Configuration - */ - - class CompareProductsFeature: Codable { - - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - } - - public init(enabled: Bool?) { - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: CartFeature - Used By: Configuration - */ - - class CartFeature: Codable { - - - public var gstInput: Bool? - - public var staffSelection: Bool? - - public var placingForCustomer: Bool? - - public var googleMap: Bool? - - public var revenueEngineCoupon: Bool? - - - public enum CodingKeys: String, CodingKey { - - case gstInput = "gst_input" - - case staffSelection = "staff_selection" - - case placingForCustomer = "placing_for_customer" - - case googleMap = "google_map" - - case revenueEngineCoupon = "revenue_engine_coupon" - - } - - public init(googleMap: Bool?, gstInput: Bool?, placingForCustomer: Bool?, revenueEngineCoupon: Bool?, staffSelection: Bool?) { - - self.gstInput = gstInput - - self.staffSelection = staffSelection - - self.placingForCustomer = placingForCustomer - - self.googleMap = googleMap - - self.revenueEngineCoupon = revenueEngineCoupon - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - gstInput = try container.decode(Bool.self, forKey: .gstInput) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - staffSelection = try container.decode(Bool.self, forKey: .staffSelection) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - placingForCustomer = try container.decode(Bool.self, forKey: .placingForCustomer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - googleMap = try container.decode(Bool.self, forKey: .googleMap) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - revenueEngineCoupon = try container.decode(Bool.self, forKey: .revenueEngineCoupon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(gstInput, forKey: .gstInput) - - - - try? container.encodeIfPresent(staffSelection, forKey: .staffSelection) - - - - try? container.encodeIfPresent(placingForCustomer, forKey: .placingForCustomer) - - - - try? container.encodeIfPresent(googleMap, forKey: .googleMap) - - - - try? container.encodeIfPresent(revenueEngineCoupon, forKey: .revenueEngineCoupon) - - - } - - } - - /* - Model: QrFeature - Used By: Configuration - */ - - class QrFeature: Codable { - - - public var application: Bool? - - public var products: Bool? - - public var collections: Bool? - - - public enum CodingKeys: String, CodingKey { - - case application = "application" - - case products = "products" - - case collections = "collections" - - } - - public init(application: Bool?, collections: Bool?, products: Bool?) { - - self.application = application - - self.products = products - - self.collections = collections - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - application = try container.decode(Bool.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - products = try container.decode(Bool.self, forKey: .products) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - collections = try container.decode(Bool.self, forKey: .collections) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(products, forKey: .products) - - - - try? container.encodeIfPresent(collections, forKey: .collections) - - - } - - } - - /* - Model: PcrFeature - Used By: Configuration - */ - - class PcrFeature: Codable { - - - public var staffSelection: Bool? - - - public enum CodingKeys: String, CodingKey { - - case staffSelection = "staff_selection" - - } - - public init(staffSelection: Bool?) { - - self.staffSelection = staffSelection - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - staffSelection = try container.decode(Bool.self, forKey: .staffSelection) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(staffSelection, forKey: .staffSelection) - - - } - - } - - /* - Model: OrderFeature - Used By: Configuration - */ - - class OrderFeature: Codable { - - - public var buyAgain: Bool? - - - public enum CodingKeys: String, CodingKey { - - case buyAgain = "buy_again" - - } - - public init(buyAgain: Bool?) { - - self.buyAgain = buyAgain - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - buyAgain = try container.decode(Bool.self, forKey: .buyAgain) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(buyAgain, forKey: .buyAgain) - - - } - - } - - /* - Model: AppFeatureRequest - Used By: Configuration - */ - - class AppFeatureRequest: Codable { - - - public var feature: AppFeature? - - - public enum CodingKeys: String, CodingKey { - - case feature = "feature" - - } - - public init(feature: AppFeature?) { - - self.feature = feature - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - feature = try container.decode(AppFeature.self, forKey: .feature) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(feature, forKey: .feature) - - - } - - } - - /* - Model: AppFeatureResponse - Used By: Configuration - */ - - class AppFeatureResponse: Codable { - - - public var feature: AppFeature? - - - public enum CodingKeys: String, CodingKey { - - case feature = "feature" - - } - - public init(feature: AppFeature?) { - - self.feature = feature - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - feature = try container.decode(AppFeature.self, forKey: .feature) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(feature, forKey: .feature) - - - } - - } - - /* - Model: Currency - Used By: Configuration - */ - - class Currency: Codable { - - - public var id: String? - - public var isActive: Bool? - - public var name: String? - - public var code: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var decimalDigits: Int? - - public var symbol: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case isActive = "is_active" - - case name = "name" - - case code = "code" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case decimalDigits = "decimal_digits" - - case symbol = "symbol" - - } - - public init(code: String?, createdAt: String?, decimalDigits: Int?, isActive: Bool?, name: String?, symbol: String?, updatedAt: String?, id: String?) { - - self.id = id - - self.isActive = isActive - - self.name = name - - self.code = code - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.decimalDigits = decimalDigits - - self.symbol = symbol - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - decimalDigits = try container.decode(Int.self, forKey: .decimalDigits) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - symbol = try container.decode(String.self, forKey: .symbol) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(decimalDigits, forKey: .decimalDigits) - - - - try? container.encodeIfPresent(symbol, forKey: .symbol) - - - } - - } - - /* - Model: Domain - Used By: Configuration - */ - - class Domain: Codable { - - - public var verified: Bool? - - public var isPrimary: Bool? - - public var isDefault: Bool? - - public var isShortlink: Bool? - - public var id: String? - - public var name: String? - - - public enum CodingKeys: String, CodingKey { - - case verified = "verified" - - case isPrimary = "is_primary" - - case isDefault = "is_default" - - case isShortlink = "is_shortlink" - - case id = "_id" - - case name = "name" - - } - - public init(isDefault: Bool?, isPrimary: Bool?, isShortlink: Bool?, name: String?, verified: Bool?, id: String?) { - - self.verified = verified - - self.isPrimary = isPrimary - - self.isDefault = isDefault - - self.isShortlink = isShortlink - - self.id = id - - self.name = name - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - verified = try container.decode(Bool.self, forKey: .verified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isPrimary = try container.decode(Bool.self, forKey: .isPrimary) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isDefault = try container.decode(Bool.self, forKey: .isDefault) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isShortlink = try container.decode(Bool.self, forKey: .isShortlink) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(verified, forKey: .verified) - - - - try? container.encodeIfPresent(isPrimary, forKey: .isPrimary) - - - - try? container.encodeIfPresent(isDefault, forKey: .isDefault) - - - - try? container.encodeIfPresent(isShortlink, forKey: .isShortlink) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - } - - } - - /* - Model: ApplicationWebsite - Used By: Configuration - */ - - class ApplicationWebsite: Codable { - - - public var enabled: Bool? - - public var basepath: String? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - case basepath = "basepath" - - } - - public init(basepath: String?, enabled: Bool?) { - - self.enabled = enabled - - self.basepath = basepath - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - basepath = try container.decode(String.self, forKey: .basepath) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(basepath, forKey: .basepath) - - - } - - } - - /* - Model: ApplicationCors - Used By: Configuration - */ - - class ApplicationCors: Codable { - - - public var domains: [String]? - - - public enum CodingKeys: String, CodingKey { - - case domains = "domains" - - } - - public init(domains: [String]?) { - - self.domains = domains - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - domains = try container.decode([String].self, forKey: .domains) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(domains, forKey: .domains) - - - } - - } - - /* - Model: ApplicationAuth - Used By: Configuration - */ - - class ApplicationAuth: Codable { - - - public var enabled: Bool? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - } - - public init(enabled: Bool?) { - - self.enabled = enabled - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - } - - } - - /* - Model: ApplicationRedirections - Used By: Configuration - */ - - class ApplicationRedirections: Codable { - - - public var from: String? - - public var redirectTo: String? - - public var type: String? - - - public enum CodingKeys: String, CodingKey { - - case from = "from" - - case redirectTo = "redirect_to" - - case type = "type" - - } - - public init(from: String?, redirectTo: String?, type: String?) { - - self.from = from - - self.redirectTo = redirectTo - - self.type = type - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - from = try container.decode(String.self, forKey: .from) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - redirectTo = try container.decode(String.self, forKey: .redirectTo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(from, forKey: .from) - - - - try? container.encodeIfPresent(redirectTo, forKey: .redirectTo) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - } - - } - - /* - Model: ApplicationMeta - Used By: Configuration - */ - - class ApplicationMeta: Codable { - - - public var name: String? - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case value = "value" - - } - - public init(name: String?, value: String?) { - - self.name = name - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: SecureUrl - Used By: Configuration - */ - - class SecureUrl: Codable { - - - public var secureUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case secureUrl = "secure_url" - - } - - public init(secureUrl: String?) { - - self.secureUrl = secureUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - secureUrl = try container.decode(String.self, forKey: .secureUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) - - - } - - } - - /* - Model: Application - Used By: Configuration - */ - - class Application: Codable { - - - public var website: ApplicationWebsite? - - public var cors: ApplicationCors? - - public var auth: ApplicationAuth? - - public var description: String? - - public var channelType: String? - - public var cacheTtl: Int? - - public var isInternal: Bool? - - public var isActive: Bool? - - public var id: String? - - public var name: String? - - public var owner: String? - - public var companyId: Int? - - public var token: String? - - public var redirections: [ApplicationRedirections]? - - public var meta: [ApplicationMeta]? - - public var createdAt: String? - - public var updatedAt: String? - - public var v: Int? - - public var banner: SecureUrl? - - public var logo: SecureUrl? - - public var favicon: SecureUrl? - - public var domains: [Domain]? - - public var appType: String? - - public var mobileLogo: SecureUrl? - - public var domain: Domain? - - - public enum CodingKeys: String, CodingKey { - - case website = "website" - - case cors = "cors" - - case auth = "auth" - - case description = "description" - - case channelType = "channel_type" - - case cacheTtl = "cache_ttl" - - case isInternal = "is_internal" - - case isActive = "is_active" - - case id = "_id" - - case name = "name" - - case owner = "owner" - - case companyId = "company_id" - - case token = "token" - - case redirections = "redirections" - - case meta = "meta" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case v = "__v" - - case banner = "banner" - - case logo = "logo" - - case favicon = "favicon" - - case domains = "domains" - - case appType = "app_type" - - case mobileLogo = "mobile_logo" - - case domain = "domain" - - } - - public init(appType: String?, auth: ApplicationAuth?, banner: SecureUrl?, cacheTtl: Int?, channelType: String?, companyId: Int?, cors: ApplicationCors?, createdAt: String?, description: String?, domain: Domain?, domains: [Domain]?, favicon: SecureUrl?, isActive: Bool?, isInternal: Bool?, logo: SecureUrl?, meta: [ApplicationMeta]?, mobileLogo: SecureUrl?, name: String?, owner: String?, redirections: [ApplicationRedirections]?, token: String?, updatedAt: String?, website: ApplicationWebsite?, id: String?, v: Int?) { - - self.website = website - - self.cors = cors - - self.auth = auth - - self.description = description - - self.channelType = channelType - - self.cacheTtl = cacheTtl - - self.isInternal = isInternal - - self.isActive = isActive - - self.id = id - - self.name = name - - self.owner = owner - - self.companyId = companyId - - self.token = token - - self.redirections = redirections - - self.meta = meta - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.v = v - - self.banner = banner - - self.logo = logo - - self.favicon = favicon - - self.domains = domains - - self.appType = appType - - self.mobileLogo = mobileLogo - - self.domain = domain - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - website = try container.decode(ApplicationWebsite.self, forKey: .website) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cors = try container.decode(ApplicationCors.self, forKey: .cors) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - auth = try container.decode(ApplicationAuth.self, forKey: .auth) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - channelType = try container.decode(String.self, forKey: .channelType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cacheTtl = try container.decode(Int.self, forKey: .cacheTtl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isInternal = try container.decode(Bool.self, forKey: .isInternal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isActive = try container.decode(Bool.self, forKey: .isActive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - owner = try container.decode(String.self, forKey: .owner) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - token = try container.decode(String.self, forKey: .token) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - redirections = try container.decode([ApplicationRedirections].self, forKey: .redirections) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([ApplicationMeta].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - banner = try container.decode(SecureUrl.self, forKey: .banner) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - logo = try container.decode(SecureUrl.self, forKey: .logo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - favicon = try container.decode(SecureUrl.self, forKey: .favicon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - domains = try container.decode([Domain].self, forKey: .domains) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appType = try container.decode(String.self, forKey: .appType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mobileLogo = try container.decode(SecureUrl.self, forKey: .mobileLogo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - domain = try container.decode(Domain.self, forKey: .domain) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(website, forKey: .website) - - - - try? container.encodeIfPresent(cors, forKey: .cors) - - - - try? container.encodeIfPresent(auth, forKey: .auth) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(channelType, forKey: .channelType) - - - - try? container.encodeIfPresent(cacheTtl, forKey: .cacheTtl) - - - - try? container.encodeIfPresent(isInternal, forKey: .isInternal) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(owner, forKey: .owner) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(token, forKey: .token) - - - - try? container.encodeIfPresent(redirections, forKey: .redirections) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - - try? container.encodeIfPresent(banner, forKey: .banner) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(favicon, forKey: .favicon) - - - - try? container.encodeIfPresent(domains, forKey: .domains) - - - - try? container.encodeIfPresent(appType, forKey: .appType) - - - - try? container.encodeIfPresent(mobileLogo, forKey: .mobileLogo) - - - - try? container.encodeIfPresent(domain, forKey: .domain) - - - } - - } - - /* - Model: NotFound - Used By: Configuration - */ - - class NotFound: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: UnhandledError - Used By: Configuration - */ - - class UnhandledError: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: InvalidPayloadRequest - Used By: Configuration - */ - - class InvalidPayloadRequest: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: SuccessMessageResponse - Used By: Configuration - */ - - class SuccessMessageResponse: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: InventoryBrandRule - Used By: Configuration - */ - - class InventoryBrandRule: Codable { - - - public var criteria: String? - - public var brands: [Int]? - - - public enum CodingKeys: String, CodingKey { - - case criteria = "criteria" - - case brands = "brands" - - } - - public init(brands: [Int]?, criteria: String?) { - - self.criteria = criteria - - self.brands = brands - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - criteria = try container.decode(String.self, forKey: .criteria) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brands = try container.decode([Int].self, forKey: .brands) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(criteria, forKey: .criteria) - - - - try? container.encodeIfPresent(brands, forKey: .brands) - - - } - - } - - /* - Model: StoreCriteriaRule - Used By: Configuration - */ - - class StoreCriteriaRule: Codable { - - - public var companies: [Int]? - - public var brands: [Int]? - - - public enum CodingKeys: String, CodingKey { - - case companies = "companies" - - case brands = "brands" - - } - - public init(brands: [Int]?, companies: [Int]?) { - - self.companies = companies - - self.brands = brands - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - companies = try container.decode([Int].self, forKey: .companies) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brands = try container.decode([Int].self, forKey: .brands) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(companies, forKey: .companies) - - - - try? container.encodeIfPresent(brands, forKey: .brands) - - - } - - } - - /* - Model: InventoryStoreRule - Used By: Configuration - */ - - class InventoryStoreRule: Codable { - - - public var criteria: String? - - public var rules: [StoreCriteriaRule]? - - public var stores: [Int]? - - - public enum CodingKeys: String, CodingKey { - - case criteria = "criteria" - - case rules = "rules" - - case stores = "stores" - - } - - public init(criteria: String?, rules: [StoreCriteriaRule]?, stores: [Int]?) { - - self.criteria = criteria - - self.rules = rules - - self.stores = stores - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - criteria = try container.decode(String.self, forKey: .criteria) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rules = try container.decode([StoreCriteriaRule].self, forKey: .rules) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stores = try container.decode([Int].self, forKey: .stores) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(criteria, forKey: .criteria) - - - - try? container.encodeIfPresent(rules, forKey: .rules) - - - - try? container.encodeIfPresent(stores, forKey: .stores) - - - } - - } - - /* - Model: InventoryPaymentConfig - Used By: Configuration - */ - - class InventoryPaymentConfig: Codable { - - - public var modeOfPayment: String? - - public var source: String? - - - public enum CodingKeys: String, CodingKey { - - case modeOfPayment = "mode_of_payment" - - case source = "source" - - } - - public init(modeOfPayment: String?, source: String?) { - - self.modeOfPayment = modeOfPayment - - self.source = source - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - modeOfPayment = try container.decode(String.self, forKey: .modeOfPayment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - source = try container.decode(String.self, forKey: .source) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(modeOfPayment, forKey: .modeOfPayment) - - - - try? container.encodeIfPresent(source, forKey: .source) - - - } - - } - - /* - Model: StorePriorityRule - Used By: Configuration - */ - - class StorePriorityRule: Codable { - - - public var enabled: Bool? - - public var storetypeOrder: [String]? - - - public enum CodingKeys: String, CodingKey { - - case enabled = "enabled" - - case storetypeOrder = "storetype_order" - - } - - public init(enabled: Bool?, storetypeOrder: [String]?) { - - self.enabled = enabled - - self.storetypeOrder = storetypeOrder - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storetypeOrder = try container.decode([String].self, forKey: .storetypeOrder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(storetypeOrder, forKey: .storetypeOrder) - - - } - - } - - /* - Model: ArticleAssignmentRule - Used By: Configuration - */ - - class ArticleAssignmentRule: Codable { - - - public var storePriority: StorePriorityRule? - - - public enum CodingKeys: String, CodingKey { - - case storePriority = "store_priority" - - } - - public init(storePriority: StorePriorityRule?) { - - self.storePriority = storePriority - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - storePriority = try container.decode(StorePriorityRule.self, forKey: .storePriority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(storePriority, forKey: .storePriority) - - - } - - } - - /* - Model: InventoryArticleAssignment - Used By: Configuration - */ - - class InventoryArticleAssignment: Codable { - - - public var postOrderReassignment: Bool? - - public var rules: ArticleAssignmentRule? - - - public enum CodingKeys: String, CodingKey { - - case postOrderReassignment = "post_order_reassignment" - - case rules = "rules" - - } - - public init(postOrderReassignment: Bool?, rules: ArticleAssignmentRule?) { - - self.postOrderReassignment = postOrderReassignment - - self.rules = rules - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - postOrderReassignment = try container.decode(Bool.self, forKey: .postOrderReassignment) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rules = try container.decode(ArticleAssignmentRule.self, forKey: .rules) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(postOrderReassignment, forKey: .postOrderReassignment) - - - - try? container.encodeIfPresent(rules, forKey: .rules) - - - } - - } - - /* - Model: CompanyAboutAddress - Used By: Configuration - */ - - class CompanyAboutAddress: Codable { - - - public var pincode: Int? - - public var address1: String? - - public var address2: String? - - public var city: String? - - public var state: String? - - public var country: String? - - public var addressType: String? - - - public enum CodingKeys: String, CodingKey { - - case pincode = "pincode" - - case address1 = "address1" - - case address2 = "address2" - - case city = "city" - - case state = "state" - - case country = "country" - - case addressType = "address_type" - - } - - public init(address1: String?, address2: String?, addressType: String?, city: String?, country: String?, pincode: Int?, state: String?) { - - self.pincode = pincode - - self.address1 = address1 - - self.address2 = address2 - - self.city = city - - self.state = state - - self.country = country - - self.addressType = addressType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - pincode = try container.decode(Int.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address1 = try container.decode(String.self, forKey: .address1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address2 = try container.decode(String.self, forKey: .address2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(String.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressType = try container.decode(String.self, forKey: .addressType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(address1, forKey: .address1) - - - - try? container.encodeIfPresent(address2, forKey: .address2) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(addressType, forKey: .addressType) - - - } - - } - - /* - Model: UserEmail - Used By: Configuration - */ - - class UserEmail: Codable { - - - public var active: Bool? - - public var primary: Bool? - - public var verified: Bool? - - public var email: String? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case primary = "primary" - - case verified = "verified" - - case email = "email" - - } - - public init(active: Bool?, email: String?, primary: Bool?, verified: Bool?) { - - self.active = active - - self.primary = primary - - self.verified = verified - - self.email = email - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - primary = try container.decode(Bool.self, forKey: .primary) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verified = try container.decode(Bool.self, forKey: .verified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(primary, forKey: .primary) - - - - try? container.encodeIfPresent(verified, forKey: .verified) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - } - - } - - /* - Model: UserPhoneNumber - Used By: Configuration - */ - - class UserPhoneNumber: Codable { - - - public var active: Bool? - - public var primary: Bool? - - public var verified: Bool? - - public var countryCode: Int? - - public var phone: String? - - - public enum CodingKeys: String, CodingKey { - - case active = "active" - - case primary = "primary" - - case verified = "verified" - - case countryCode = "country_code" - - case phone = "phone" - - } - - public init(active: Bool?, countryCode: Int?, phone: String?, primary: Bool?, verified: Bool?) { - - self.active = active - - self.primary = primary - - self.verified = verified - - self.countryCode = countryCode - - self.phone = phone - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - primary = try container.decode(Bool.self, forKey: .primary) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - verified = try container.decode(Bool.self, forKey: .verified) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(Int.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(String.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(primary, forKey: .primary) - - - - try? container.encodeIfPresent(verified, forKey: .verified) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - } - - } - - /* - Model: ApplicationInformation - Used By: Configuration - */ - - class ApplicationInformation: Codable { - - - public var address: InformationAddress? - - public var support: InformationSupport? - - public var socialLinks: SocialLinks? - - public var links: Links? - - public var copyrightText: String? - - public var id: String? - - public var businessHighlights: BusinessHighlights? - - public var application: String? - - public var createdAt: String? - - public var updatedAt: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case address = "address" - - case support = "support" - - case socialLinks = "social_links" - - case links = "links" - - case copyrightText = "copyright_text" - - case id = "_id" - - case businessHighlights = "business_highlights" - - case application = "application" - - case createdAt = "created_at" - - case updatedAt = "updated_at" - - case v = "__v" - - } - - public init(address: InformationAddress?, application: String?, businessHighlights: BusinessHighlights?, copyrightText: String?, createdAt: String?, links: Links?, socialLinks: SocialLinks?, support: InformationSupport?, updatedAt: String?, id: String?, v: Int?) { - - self.address = address - - self.support = support - - self.socialLinks = socialLinks - - self.links = links - - self.copyrightText = copyrightText - - self.id = id - - self.businessHighlights = businessHighlights - - self.application = application - - self.createdAt = createdAt - - self.updatedAt = updatedAt - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - address = try container.decode(InformationAddress.self, forKey: .address) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - support = try container.decode(InformationSupport.self, forKey: .support) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - socialLinks = try container.decode(SocialLinks.self, forKey: .socialLinks) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - links = try container.decode(Links.self, forKey: .links) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - copyrightText = try container.decode(String.self, forKey: .copyrightText) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - businessHighlights = try container.decode(BusinessHighlights.self, forKey: .businessHighlights) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(support, forKey: .support) - - - - try? container.encodeIfPresent(socialLinks, forKey: .socialLinks) - - - - try? container.encodeIfPresent(links, forKey: .links) - - - - try? container.encodeIfPresent(copyrightText, forKey: .copyrightText) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(businessHighlights, forKey: .businessHighlights) - - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - /* - Model: InformationAddress - Used By: Configuration - */ - - class InformationAddress: Codable { - - - public var loc: String? - - public var addressLine: [String]? - - public var phone: InformationPhone? - - public var city: String? - - public var country: String? - - public var pincode: Int? - - - public enum CodingKeys: String, CodingKey { - - case loc = "loc" - - case addressLine = "address_line" - - case phone = "phone" - - case city = "city" - - case country = "country" - - case pincode = "pincode" - - } - - public init(addressLine: [String]?, city: String?, country: String?, loc: String?, phone: InformationPhone?, pincode: Int?) { - - self.loc = loc - - self.addressLine = addressLine - - self.phone = phone - - self.city = city - - self.country = country - - self.pincode = pincode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - loc = try container.decode(String.self, forKey: .loc) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressLine = try container.decode([String].self, forKey: .addressLine) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(InformationPhone.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(Int.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(loc, forKey: .loc) - - - - try? container.encodeIfPresent(addressLine, forKey: .addressLine) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - } - - } - - /* - Model: InformationPhone - Used By: Configuration - */ - - class InformationPhone: Codable { - - - public var code: String? - - public var number: String? - - - public enum CodingKeys: String, CodingKey { - - case code = "code" - - case number = "number" - - } - - public init(code: String?, number: String?) { - - self.code = code - - self.number = number - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - number = try container.decode(String.self, forKey: .number) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(number, forKey: .number) - - - } - - } - - /* - Model: InformationSupport - Used By: Configuration - */ - - class InformationSupport: Codable { - - - public var phone: [String]? - - public var email: [String]? - - public var timing: String? - - - public enum CodingKeys: String, CodingKey { - - case phone = "phone" - - case email = "email" - - case timing = "timing" - - } - - public init(email: [String]?, phone: [String]?, timing: String?) { - - self.phone = phone - - self.email = email - - self.timing = timing - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - phone = try container.decode([String].self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode([String].self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - timing = try container.decode(String.self, forKey: .timing) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(timing, forKey: .timing) - - - } - - } - - /* - Model: SocialLinks - Used By: Configuration - */ - - class SocialLinks: Codable { - - - public var facebook: FacebookLink? - - public var instagram: InstagramLink? - - public var twitter: TwitterLink? - - public var pinterest: PinterestLink? - - public var googlePlus: GooglePlusLink? - - public var youtube: YoutubeLink? - - public var linkedIn: LinkedInLink? - - public var vimeo: VimeoLink? - - public var blogLink: BlogLink? - - - public enum CodingKeys: String, CodingKey { - - case facebook = "facebook" - - case instagram = "instagram" - - case twitter = "twitter" - - case pinterest = "pinterest" - - case googlePlus = "google_plus" - - case youtube = "youtube" - - case linkedIn = "linked_in" - - case vimeo = "vimeo" - - case blogLink = "blog_link" - - } - - public init(blogLink: BlogLink?, facebook: FacebookLink?, googlePlus: GooglePlusLink?, instagram: InstagramLink?, linkedIn: LinkedInLink?, pinterest: PinterestLink?, twitter: TwitterLink?, vimeo: VimeoLink?, youtube: YoutubeLink?) { - - self.facebook = facebook - - self.instagram = instagram - - self.twitter = twitter - - self.pinterest = pinterest - - self.googlePlus = googlePlus - - self.youtube = youtube - - self.linkedIn = linkedIn - - self.vimeo = vimeo - - self.blogLink = blogLink - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - facebook = try container.decode(FacebookLink.self, forKey: .facebook) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - instagram = try container.decode(InstagramLink.self, forKey: .instagram) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - twitter = try container.decode(TwitterLink.self, forKey: .twitter) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pinterest = try container.decode(PinterestLink.self, forKey: .pinterest) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - googlePlus = try container.decode(GooglePlusLink.self, forKey: .googlePlus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - youtube = try container.decode(YoutubeLink.self, forKey: .youtube) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - linkedIn = try container.decode(LinkedInLink.self, forKey: .linkedIn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - vimeo = try container.decode(VimeoLink.self, forKey: .vimeo) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - blogLink = try container.decode(BlogLink.self, forKey: .blogLink) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(facebook, forKey: .facebook) - - - - try? container.encodeIfPresent(instagram, forKey: .instagram) - - - - try? container.encodeIfPresent(twitter, forKey: .twitter) - - - - try? container.encodeIfPresent(pinterest, forKey: .pinterest) - - - - try? container.encodeIfPresent(googlePlus, forKey: .googlePlus) - - - - try? container.encodeIfPresent(youtube, forKey: .youtube) - - - - try? container.encodeIfPresent(linkedIn, forKey: .linkedIn) - - - - try? container.encodeIfPresent(vimeo, forKey: .vimeo) - - - - try? container.encodeIfPresent(blogLink, forKey: .blogLink) - - - } - - } - - /* - Model: FacebookLink - Used By: Configuration - */ - - class FacebookLink: Codable { - - - public var title: String? - - public var icon: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case icon = "icon" - - case link = "link" - - } - - public init(icon: String?, link: String?, title: String?) { - - self.title = title - - self.icon = icon - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: InstagramLink - Used By: Configuration - */ - - class InstagramLink: Codable { - - - public var title: String? - - public var icon: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case icon = "icon" - - case link = "link" - - } - - public init(icon: String?, link: String?, title: String?) { - - self.title = title - - self.icon = icon - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: TwitterLink - Used By: Configuration - */ - - class TwitterLink: Codable { - - - public var title: String? - - public var icon: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case icon = "icon" - - case link = "link" - - } - - public init(icon: String?, link: String?, title: String?) { - - self.title = title - - self.icon = icon - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: PinterestLink - Used By: Configuration - */ - - class PinterestLink: Codable { - - - public var title: String? - - public var icon: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case icon = "icon" - - case link = "link" - - } - - public init(icon: String?, link: String?, title: String?) { - - self.title = title - - self.icon = icon - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: GooglePlusLink - Used By: Configuration - */ - - class GooglePlusLink: Codable { - - - public var title: String? - - public var icon: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case icon = "icon" - - case link = "link" - - } - - public init(icon: String?, link: String?, title: String?) { - - self.title = title - - self.icon = icon - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: YoutubeLink - Used By: Configuration - */ - - class YoutubeLink: Codable { - - - public var title: String? - - public var icon: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case icon = "icon" - - case link = "link" - - } - - public init(icon: String?, link: String?, title: String?) { - - self.title = title - - self.icon = icon - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: LinkedInLink - Used By: Configuration - */ - - class LinkedInLink: Codable { - - - public var title: String? - - public var icon: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case icon = "icon" - - case link = "link" - - } - - public init(icon: String?, link: String?, title: String?) { - - self.title = title - - self.icon = icon - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: VimeoLink - Used By: Configuration - */ - - class VimeoLink: Codable { - - - public var title: String? - - public var icon: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case icon = "icon" - - case link = "link" - - } - - public init(icon: String?, link: String?, title: String?) { - - self.title = title - - self.icon = icon - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: BlogLink - Used By: Configuration - */ - - class BlogLink: Codable { - - - public var title: String? - - public var icon: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case icon = "icon" - - case link = "link" - - } - - public init(icon: String?, link: String?, title: String?) { - - self.title = title - - self.icon = icon - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: Links - Used By: Configuration - */ - - class Links: Codable { - - - public var title: String? - - public var link: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case link = "link" - - } - - public init(link: String?, title: String?) { - - self.title = title - - self.link = link - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - link = try container.decode(String.self, forKey: .link) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(link, forKey: .link) - - - } - - } - - /* - Model: BusinessHighlights - Used By: Configuration - */ - - class BusinessHighlights: Codable { - - - public var id: String? - - public var title: String? - - public var icon: String? - - public var subTitle: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case title = "title" - - case icon = "icon" - - case subTitle = "sub_title" - - } - - public init(icon: String?, subTitle: String?, title: String?, id: String?) { - - self.id = id - - self.title = title - - self.icon = icon - - self.subTitle = subTitle - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - icon = try container.decode(String.self, forKey: .icon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subTitle = try container.decode(String.self, forKey: .subTitle) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(icon, forKey: .icon) - - - - try? container.encodeIfPresent(subTitle, forKey: .subTitle) - - - } - - } - - /* - Model: ApplicationDetail - Used By: Configuration - */ - - class ApplicationDetail: Codable { - - - public var name: String - - public var description: String - - public var logo: SecureUrl - - public var mobileLogo: SecureUrl - - public var favicon: SecureUrl - - public var banner: SecureUrl - - public var domain: Domain? - - public var domains: [Domain]? - - public var id: String? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case description = "description" - - case logo = "logo" - - case mobileLogo = "mobile_logo" - - case favicon = "favicon" - - case banner = "banner" - - case domain = "domain" - - case domains = "domains" - - case id = "_id" - - } - - public init(banner: SecureUrl, description: String, domain: Domain?, domains: [Domain]?, favicon: SecureUrl, logo: SecureUrl, mobileLogo: SecureUrl, name: String, id: String?) { - - self.name = name - - self.description = description - - self.logo = logo - - self.mobileLogo = mobileLogo - - self.favicon = favicon - - self.banner = banner - - self.domain = domain - - self.domains = domains - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - name = try container.decode(String.self, forKey: .name) - - - - - description = try container.decode(String.self, forKey: .description) - - - - - logo = try container.decode(SecureUrl.self, forKey: .logo) - - - - - mobileLogo = try container.decode(SecureUrl.self, forKey: .mobileLogo) - - - - - favicon = try container.decode(SecureUrl.self, forKey: .favicon) - - - - - banner = try container.decode(SecureUrl.self, forKey: .banner) - - - - - do { - domain = try container.decode(Domain.self, forKey: .domain) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - domains = try container.decode([Domain].self, forKey: .domains) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(logo, forKey: .logo) - - - - try? container.encodeIfPresent(mobileLogo, forKey: .mobileLogo) - - - - try? container.encodeIfPresent(favicon, forKey: .favicon) - - - - try? container.encodeIfPresent(banner, forKey: .banner) - - - - try? container.encodeIfPresent(domain, forKey: .domain) - - - - try? container.encodeIfPresent(domains, forKey: .domains) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: CurrenciesResponse - Used By: Configuration - */ - - class CurrenciesResponse: Codable { - - - public var items: [Currency]? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - } - - public init(items: [Currency]?) { - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Currency].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: AppCurrencyResponse - Used By: Configuration - */ - - class AppCurrencyResponse: Codable { - - - public var application: String? - - public var defaultCurrency: DefaultCurrency? - - public var supportedCurrency: [Currency]? - - - public enum CodingKeys: String, CodingKey { - - case application = "application" - - case defaultCurrency = "default_currency" - - case supportedCurrency = "supported_currency" - - } - - public init(application: String?, defaultCurrency: DefaultCurrency?, supportedCurrency: [Currency]?) { - - self.application = application - - self.defaultCurrency = defaultCurrency - - self.supportedCurrency = supportedCurrency - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - application = try container.decode(String.self, forKey: .application) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - defaultCurrency = try container.decode(DefaultCurrency.self, forKey: .defaultCurrency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - supportedCurrency = try container.decode([Currency].self, forKey: .supportedCurrency) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(application, forKey: .application) - - - - try? container.encodeIfPresent(defaultCurrency, forKey: .defaultCurrency) - - - - try? container.encodeIfPresent(supportedCurrency, forKey: .supportedCurrency) - - - } - - } - - /* - Model: StoreLatLong - Used By: Configuration - */ - - class StoreLatLong: Codable { - - - public var type: String? - - public var coordinates: [Double]? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case coordinates = "coordinates" - - } - - public init(coordinates: [Double]?, type: String?) { - - self.type = type - - self.coordinates = coordinates - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - coordinates = try container.decode([Double].self, forKey: .coordinates) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(coordinates, forKey: .coordinates) - - - } - - } - - /* - Model: OptedStoreAddress - Used By: Configuration - */ - - class OptedStoreAddress: Codable { - - - public var state: String? - - public var address1: String? - - public var latLong: StoreLatLong? - - public var address2: String? - - public var pincode: Int? - - public var country: String? - - public var city: String? - - - public enum CodingKeys: String, CodingKey { - - case state = "state" - - case address1 = "address1" - - case latLong = "lat_long" - - case address2 = "address2" - - case pincode = "pincode" - - case country = "country" - - case city = "city" - - } - - public init(address1: String?, address2: String?, city: String?, country: String?, latLong: StoreLatLong?, pincode: Int?, state: String?) { - - self.state = state - - self.address1 = address1 - - self.latLong = latLong - - self.address2 = address2 - - self.pincode = pincode - - self.country = country - - self.city = city - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - state = try container.decode(String.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address1 = try container.decode(String.self, forKey: .address1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - latLong = try container.decode(StoreLatLong.self, forKey: .latLong) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address2 = try container.decode(String.self, forKey: .address2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(Int.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - country = try container.decode(String.self, forKey: .country) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - city = try container.decode(String.self, forKey: .city) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(address1, forKey: .address1) - - - - try? container.encodeIfPresent(latLong, forKey: .latLong) - - - - try? container.encodeIfPresent(address2, forKey: .address2) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - } - - } - - /* - Model: OrderingStore - Used By: Configuration - */ - - class OrderingStore: Codable { - - - public var address: OptedStoreAddress? - - public var id: String? - - public var uid: Int? - - public var name: String? - - public var displayName: String? - - public var storeType: String? - - public var storeCode: String? - - public var pincode: Int? - - public var code: String? - - - public enum CodingKeys: String, CodingKey { - - case address = "address" - - case id = "_id" - - case uid = "uid" - - case name = "name" - - case displayName = "display_name" - - case storeType = "store_type" - - case storeCode = "store_code" - - case pincode = "pincode" - - case code = "code" - - } - - public init(address: OptedStoreAddress?, code: String?, displayName: String?, name: String?, pincode: Int?, storeCode: String?, storeType: String?, uid: Int?, id: String?) { - - self.address = address - - self.id = id - - self.uid = uid - - self.name = name - - self.displayName = displayName - - self.storeType = storeType - - self.storeCode = storeCode - - self.pincode = pincode - - self.code = code - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - address = try container.decode(OptedStoreAddress.self, forKey: .address) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeType = try container.decode(String.self, forKey: .storeType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeCode = try container.decode(String.self, forKey: .storeCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(Int.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(storeType, forKey: .storeType) - - - - try? container.encodeIfPresent(storeCode, forKey: .storeCode) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - } - - } - - /* - Model: OrderingStores - Used By: Configuration - */ - - class OrderingStores: Codable { - - - public var page: Page? - - public var items: [OrderingStore]? - - public var deployedStores: [Int]? - - public var allStores: Bool? - - public var enabled: Bool? - - public var type: String? - - public var id: String? - - public var app: String? - - public var v: Int? - - - public enum CodingKeys: String, CodingKey { - - case page = "page" - - case items = "items" - - case deployedStores = "deployed_stores" - - case allStores = "all_stores" - - case enabled = "enabled" - - case type = "type" - - case id = "_id" - - case app = "app" - - case v = "__v" - - } - - public init(allStores: Bool?, app: String?, deployedStores: [Int]?, enabled: Bool?, items: [OrderingStore]?, page: Page?, type: String?, id: String?, v: Int?) { - - self.page = page - - self.items = items - - self.deployedStores = deployedStores - - self.allStores = allStores - - self.enabled = enabled - - self.type = type - - self.id = id - - self.app = app - - self.v = v - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([OrderingStore].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deployedStores = try container.decode([Int].self, forKey: .deployedStores) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - allStores = try container.decode(Bool.self, forKey: .allStores) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - enabled = try container.decode(Bool.self, forKey: .enabled) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - app = try container.decode(String.self, forKey: .app) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - v = try container.decode(Int.self, forKey: .v) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(deployedStores, forKey: .deployedStores) - - - - try? container.encodeIfPresent(allStores, forKey: .allStores) - - - - try? container.encodeIfPresent(enabled, forKey: .enabled) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(app, forKey: .app) - - - - try? container.encodeIfPresent(v, forKey: .v) - - - } - - } - - - - /* - Model: CouponDateMeta - Used By: Cart - */ - - class CouponDateMeta: Codable { - - - public var modifiedOn: String? - - public var createdOn: String? - - - public enum CodingKeys: String, CodingKey { - - case modifiedOn = "modified_on" - - case createdOn = "created_on" - - } - - public init(createdOn: String?, modifiedOn: String?) { - - self.modifiedOn = modifiedOn - - self.createdOn = createdOn - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - } - - } - - /* - Model: Validation - Used By: Cart - */ - - class Validation: Codable { - - - public var userRegisteredAfter: String? - - public var appId: [String]? - - public var anonymous: Bool? - - - public enum CodingKeys: String, CodingKey { - - case userRegisteredAfter = "user_registered_after" - - case appId = "app_id" - - case anonymous = "anonymous" - - } - - public init(anonymous: Bool?, appId: [String]?, userRegisteredAfter: String?) { - - self.userRegisteredAfter = userRegisteredAfter - - self.appId = appId - - self.anonymous = anonymous - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - userRegisteredAfter = try container.decode(String.self, forKey: .userRegisteredAfter) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - appId = try container.decode([String].self, forKey: .appId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - anonymous = try container.decode(Bool.self, forKey: .anonymous) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(userRegisteredAfter, forKey: .userRegisteredAfter) - - - - try? container.encodeIfPresent(appId, forKey: .appId) - - - - try? container.encodeIfPresent(anonymous, forKey: .anonymous) - - - } - - } - - /* - Model: DisplayMetaDict - Used By: Cart - */ - - class DisplayMetaDict: Codable { - - - public var title: String? - - public var subtitle: String? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case subtitle = "subtitle" - - } - - public init(subtitle: String?, title: String?) { - - self.title = title - - self.subtitle = subtitle - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subtitle = try container.decode(String.self, forKey: .subtitle) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(subtitle, forKey: .subtitle) - - - } - - } - - /* - Model: DisplayMeta - Used By: Cart - */ - - class DisplayMeta: Codable { - - - public var subtitle: String? - - public var auto: DisplayMetaDict? - - public var remove: DisplayMetaDict? - - public var title: String? - - public var apply: DisplayMetaDict? - - public var description: String? - - - public enum CodingKeys: String, CodingKey { - - case subtitle = "subtitle" - - case auto = "auto" - - case remove = "remove" - - case title = "title" - - case apply = "apply" - - case description = "description" - - } - - public init(apply: DisplayMetaDict?, auto: DisplayMetaDict?, description: String?, remove: DisplayMetaDict?, subtitle: String?, title: String?) { - - self.subtitle = subtitle - - self.auto = auto - - self.remove = remove - - self.title = title - - self.apply = apply - - self.description = description - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - subtitle = try container.decode(String.self, forKey: .subtitle) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - auto = try container.decode(DisplayMetaDict.self, forKey: .auto) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - remove = try container.decode(DisplayMetaDict.self, forKey: .remove) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - apply = try container.decode(DisplayMetaDict.self, forKey: .apply) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(subtitle, forKey: .subtitle) - - - - try? container.encodeIfPresent(auto, forKey: .auto) - - - - try? container.encodeIfPresent(remove, forKey: .remove) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(apply, forKey: .apply) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - } - - } - - /* - Model: PaymentAllowValue - Used By: Cart - */ - - class PaymentAllowValue: Codable { - - - public var max: Int? - - - public enum CodingKeys: String, CodingKey { - - case max = "max" - - } - - public init(max: Int?) { - - self.max = max - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - max = try container.decode(Int.self, forKey: .max) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(max, forKey: .max) - - - } - - } - - /* - Model: PaymentModes - Used By: Cart - */ - - class PaymentModes: Codable { - - - public var types: [String]? - - public var codes: [String]? - - public var uses: PaymentAllowValue? - - public var networks: [String]? - - - public enum CodingKeys: String, CodingKey { - - case types = "types" - - case codes = "codes" - - case uses = "uses" - - case networks = "networks" - - } - - public init(codes: [String]?, networks: [String]?, types: [String]?, uses: PaymentAllowValue?) { - - self.types = types - - self.codes = codes - - self.uses = uses - - self.networks = networks - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - types = try container.decode([String].self, forKey: .types) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - codes = try container.decode([String].self, forKey: .codes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uses = try container.decode(PaymentAllowValue.self, forKey: .uses) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - networks = try container.decode([String].self, forKey: .networks) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(types, forKey: .types) - - - - try? container.encodeIfPresent(codes, forKey: .codes) - - - - try? container.encodeIfPresent(uses, forKey: .uses) - - - - try? container.encodeIfPresent(networks, forKey: .networks) - - - } - - } - - /* - Model: PaymentCodes - Used By: Cart - */ - - class PaymentCodes: Codable { - - - public var ps: PaymentModes? - - public var qr: PaymentModes? - - public var nb: PaymentModes? - - public var stripepg: PaymentModes? - - public var wl: PaymentModes? - - public var card: PaymentModes? - - public var simpl: PaymentModes? - - public var pl: PaymentModes? - - public var rupifipg: PaymentModes? - - public var upi: PaymentModes? - - - public enum CodingKeys: String, CodingKey { - - case ps = "ps" - - case qr = "qr" - - case nb = "nb" - - case stripepg = "stripepg" - - case wl = "wl" - - case card = "card" - - case simpl = "simpl" - - case pl = "pl" - - case rupifipg = "rupifipg" - - case upi = "upi" - - } - - public init(card: PaymentModes?, nb: PaymentModes?, pl: PaymentModes?, ps: PaymentModes?, qr: PaymentModes?, rupifipg: PaymentModes?, simpl: PaymentModes?, stripepg: PaymentModes?, upi: PaymentModes?, wl: PaymentModes?) { - - self.ps = ps - - self.qr = qr - - self.nb = nb - - self.stripepg = stripepg - - self.wl = wl - - self.card = card - - self.simpl = simpl - - self.pl = pl - - self.rupifipg = rupifipg - - self.upi = upi - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - ps = try container.decode(PaymentModes.self, forKey: .ps) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - qr = try container.decode(PaymentModes.self, forKey: .qr) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - nb = try container.decode(PaymentModes.self, forKey: .nb) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stripepg = try container.decode(PaymentModes.self, forKey: .stripepg) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - wl = try container.decode(PaymentModes.self, forKey: .wl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - card = try container.decode(PaymentModes.self, forKey: .card) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - simpl = try container.decode(PaymentModes.self, forKey: .simpl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pl = try container.decode(PaymentModes.self, forKey: .pl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rupifipg = try container.decode(PaymentModes.self, forKey: .rupifipg) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - upi = try container.decode(PaymentModes.self, forKey: .upi) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(ps, forKey: .ps) - - - - try? container.encodeIfPresent(qr, forKey: .qr) - - - - try? container.encodeIfPresent(nb, forKey: .nb) - - - - try? container.encodeIfPresent(stripepg, forKey: .stripepg) - - - - try? container.encodeIfPresent(wl, forKey: .wl) - - - - try? container.encodeIfPresent(card, forKey: .card) - - - - try? container.encodeIfPresent(simpl, forKey: .simpl) - - - - try? container.encodeIfPresent(pl, forKey: .pl) - - - - try? container.encodeIfPresent(rupifipg, forKey: .rupifipg) - - - - try? container.encodeIfPresent(upi, forKey: .upi) - - - } - - } - - /* - Model: PriceRange - Used By: Cart - */ - - class PriceRange: Codable { - - - public var max: Int? - - public var min: Int? - - - public enum CodingKeys: String, CodingKey { - - case max = "max" - - case min = "min" - - } - - public init(max: Int?, min: Int?) { - - self.max = max - - self.min = min - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - max = try container.decode(Int.self, forKey: .max) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - min = try container.decode(Int.self, forKey: .min) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(max, forKey: .max) - - - - try? container.encodeIfPresent(min, forKey: .min) - - - } - - } - - /* - Model: PostOrder - Used By: Cart - */ - - class PostOrder: Codable { - - - public var cancellationAllowed: Bool? - - public var returnAllowed: Bool? - - - public enum CodingKeys: String, CodingKey { - - case cancellationAllowed = "cancellation_allowed" - - case returnAllowed = "return_allowed" - - } - - public init(cancellationAllowed: Bool?, returnAllowed: Bool?) { - - self.cancellationAllowed = cancellationAllowed - - self.returnAllowed = returnAllowed - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cancellationAllowed = try container.decode(Bool.self, forKey: .cancellationAllowed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - returnAllowed = try container.decode(Bool.self, forKey: .returnAllowed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cancellationAllowed, forKey: .cancellationAllowed) - - - - try? container.encodeIfPresent(returnAllowed, forKey: .returnAllowed) - - - } - - } - - /* - Model: BulkBundleRestriction - Used By: Cart - */ - - class BulkBundleRestriction: Codable { - - - public var multiStoreAllowed: Bool - - - public enum CodingKeys: String, CodingKey { - - case multiStoreAllowed = "multi_store_allowed" - - } - - public init(multiStoreAllowed: Bool) { - - self.multiStoreAllowed = multiStoreAllowed - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - multiStoreAllowed = try container.decode(Bool.self, forKey: .multiStoreAllowed) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(multiStoreAllowed, forKey: .multiStoreAllowed) - - - } - - } - - /* - Model: UsesRemaining - Used By: Cart - */ - - class UsesRemaining: Codable { - - - public var total: Int? - - public var user: Int? - - public var app: Int? - - - public enum CodingKeys: String, CodingKey { - - case total = "total" - - case user = "user" - - case app = "app" - - } - - public init(app: Int?, total: Int?, user: Int?) { - - self.total = total - - self.user = user - - self.app = app - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - total = try container.decode(Int.self, forKey: .total) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - user = try container.decode(Int.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - app = try container.decode(Int.self, forKey: .app) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(total, forKey: .total) - - - - try? container.encodeIfPresent(user, forKey: .user) - - - - try? container.encodeIfPresent(app, forKey: .app) - - - } - - } - - /* - Model: UsesRestriction - Used By: Cart - */ - - class UsesRestriction: Codable { - - - public var remaining: UsesRemaining? - - public var maximum: UsesRemaining? - - - public enum CodingKeys: String, CodingKey { - - case remaining = "remaining" - - case maximum = "maximum" - - } - - public init(maximum: UsesRemaining?, remaining: UsesRemaining?) { - - self.remaining = remaining - - self.maximum = maximum - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - remaining = try container.decode(UsesRemaining.self, forKey: .remaining) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - maximum = try container.decode(UsesRemaining.self, forKey: .maximum) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(remaining, forKey: .remaining) - - - - try? container.encodeIfPresent(maximum, forKey: .maximum) - - - } - - } - - /* - Model: Restrictions - Used By: Cart - */ - - class Restrictions: Codable { - - - public var payments: PaymentCodes? - - public var priceRange: PriceRange? - - public var postOrder: PostOrder? - - public var bulkBundle: BulkBundleRestriction? - - public var couponAllowed: Bool? - - public var uses: UsesRestriction? - - public var platforms: [String]? - - public var orderingStores: [Int]? - - - public enum CodingKeys: String, CodingKey { - - case payments = "payments" - - case priceRange = "price_range" - - case postOrder = "post_order" - - case bulkBundle = "bulk_bundle" - - case couponAllowed = "coupon_allowed" - - case uses = "uses" - - case platforms = "platforms" - - case orderingStores = "ordering_stores" - - } - - public init(bulkBundle: BulkBundleRestriction?, couponAllowed: Bool?, orderingStores: [Int]?, payments: PaymentCodes?, platforms: [String]?, postOrder: PostOrder?, priceRange: PriceRange?, uses: UsesRestriction?) { - - self.payments = payments - - self.priceRange = priceRange - - self.postOrder = postOrder - - self.bulkBundle = bulkBundle - - self.couponAllowed = couponAllowed - - self.uses = uses - - self.platforms = platforms - - self.orderingStores = orderingStores - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - payments = try container.decode(PaymentCodes.self, forKey: .payments) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - priceRange = try container.decode(PriceRange.self, forKey: .priceRange) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - postOrder = try container.decode(PostOrder.self, forKey: .postOrder) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bulkBundle = try container.decode(BulkBundleRestriction.self, forKey: .bulkBundle) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - couponAllowed = try container.decode(Bool.self, forKey: .couponAllowed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uses = try container.decode(UsesRestriction.self, forKey: .uses) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - platforms = try container.decode([String].self, forKey: .platforms) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderingStores = try container.decode([Int].self, forKey: .orderingStores) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(payments, forKey: .payments) - - - - try? container.encodeIfPresent(priceRange, forKey: .priceRange) - - - - try? container.encodeIfPresent(postOrder, forKey: .postOrder) - - - - try? container.encodeIfPresent(bulkBundle, forKey: .bulkBundle) - - - - try? container.encodeIfPresent(couponAllowed, forKey: .couponAllowed) - - - - try? container.encodeIfPresent(uses, forKey: .uses) - - - - try? container.encodeIfPresent(platforms, forKey: .platforms) - - - - try? container.encodeIfPresent(orderingStores, forKey: .orderingStores) - - - } - - } - - /* - Model: RuleDefinition - Used By: Cart - */ - - class RuleDefinition: Codable { - - - public var valueType: String - - public var type: String - - public var applicableOn: String - - public var currencyCode: String? - - public var isExact: Bool? - - public var autoApply: Bool? - - public var scope: [String]? - - public var calculateOn: String - - - public enum CodingKeys: String, CodingKey { - - case valueType = "value_type" - - case type = "type" - - case applicableOn = "applicable_on" - - case currencyCode = "currency_code" - - case isExact = "is_exact" - - case autoApply = "auto_apply" - - case scope = "scope" - - case calculateOn = "calculate_on" - - } - - public init(applicableOn: String, autoApply: Bool?, calculateOn: String, currencyCode: String?, isExact: Bool?, scope: [String]?, type: String, valueType: String) { - - self.valueType = valueType - - self.type = type - - self.applicableOn = applicableOn - - self.currencyCode = currencyCode - - self.isExact = isExact - - self.autoApply = autoApply - - self.scope = scope - - self.calculateOn = calculateOn - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - valueType = try container.decode(String.self, forKey: .valueType) - - - - - type = try container.decode(String.self, forKey: .type) - - - - - applicableOn = try container.decode(String.self, forKey: .applicableOn) - - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isExact = try container.decode(Bool.self, forKey: .isExact) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - autoApply = try container.decode(Bool.self, forKey: .autoApply) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - scope = try container.decode([String].self, forKey: .scope) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - calculateOn = try container.decode(String.self, forKey: .calculateOn) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(valueType, forKey: .valueType) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(applicableOn, forKey: .applicableOn) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - - try? container.encodeIfPresent(isExact, forKey: .isExact) - - - - try? container.encodeIfPresent(autoApply, forKey: .autoApply) - - - - try? container.encodeIfPresent(scope, forKey: .scope) - - - - try? container.encodeIfPresent(calculateOn, forKey: .calculateOn) - - - } - - } - - /* - Model: Identifier - Used By: Cart - */ - - class Identifier: Codable { - - - public var storeId: [Int]? - - public var categoryId: [Int]? - - public var itemId: [Int]? - - public var articleId: [String]? - - public var brandId: [Int]? - - public var collectionId: [String]? - - public var companyId: [Int]? - - public var userId: [String]? - - - public enum CodingKeys: String, CodingKey { - - case storeId = "store_id" - - case categoryId = "category_id" - - case itemId = "item_id" - - case articleId = "article_id" - - case brandId = "brand_id" - - case collectionId = "collection_id" - - case companyId = "company_id" - - case userId = "user_id" - - } - - public init(articleId: [String]?, brandId: [Int]?, categoryId: [Int]?, collectionId: [String]?, companyId: [Int]?, itemId: [Int]?, storeId: [Int]?, userId: [String]?) { - - self.storeId = storeId - - self.categoryId = categoryId - - self.itemId = itemId - - self.articleId = articleId - - self.brandId = brandId - - self.collectionId = collectionId - - self.companyId = companyId - - self.userId = userId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - storeId = try container.decode([Int].self, forKey: .storeId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - categoryId = try container.decode([Int].self, forKey: .categoryId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemId = try container.decode([Int].self, forKey: .itemId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - articleId = try container.decode([String].self, forKey: .articleId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandId = try container.decode([Int].self, forKey: .brandId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - collectionId = try container.decode([String].self, forKey: .collectionId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode([Int].self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode([String].self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(storeId, forKey: .storeId) - - - - try? container.encodeIfPresent(categoryId, forKey: .categoryId) - - - - try? container.encodeIfPresent(itemId, forKey: .itemId) - - - - try? container.encodeIfPresent(articleId, forKey: .articleId) - - - - try? container.encodeIfPresent(brandId, forKey: .brandId) - - - - try? container.encodeIfPresent(collectionId, forKey: .collectionId) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - } - - } - - /* - Model: Validity - Used By: Cart - */ - - class Validity: Codable { - - - public var priority: Int? - - - public enum CodingKeys: String, CodingKey { - - case priority = "priority" - - } - - public init(priority: Int?) { - - self.priority = priority - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - priority = try container.decode(Int.self, forKey: .priority) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(priority, forKey: .priority) - - - } - - } - - /* - Model: Ownership - Used By: Cart - */ - - class Ownership: Codable { - - - public var payableCategory: String - - public var payableBy: String - - - public enum CodingKeys: String, CodingKey { - - case payableCategory = "payable_category" - - case payableBy = "payable_by" - - } - - public init(payableBy: String, payableCategory: String) { - - self.payableCategory = payableCategory - - self.payableBy = payableBy - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - payableCategory = try container.decode(String.self, forKey: .payableCategory) - - - - - payableBy = try container.decode(String.self, forKey: .payableBy) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(payableCategory, forKey: .payableCategory) - - - - try? container.encodeIfPresent(payableBy, forKey: .payableBy) - - - } - - } - - /* - Model: CouponAuthor - Used By: Cart - */ - - class CouponAuthor: Codable { - - - public var createdBy: String? - - public var modifiedBy: String? - - - public enum CodingKeys: String, CodingKey { - - case createdBy = "created_by" - - case modifiedBy = "modified_by" - - } - - public init(createdBy: String?, modifiedBy: String?) { - - self.createdBy = createdBy - - self.modifiedBy = modifiedBy - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - createdBy = try container.decode(String.self, forKey: .createdBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedBy = try container.decode(String.self, forKey: .modifiedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - } - - } - - /* - Model: State - Used By: Cart - */ - - class State: Codable { - - - public var isDisplay: Bool? - - public var isArchived: Bool? - - public var isPublic: Bool? - - - public enum CodingKeys: String, CodingKey { - - case isDisplay = "is_display" - - case isArchived = "is_archived" - - case isPublic = "is_public" - - } - - public init(isArchived: Bool?, isDisplay: Bool?, isPublic: Bool?) { - - self.isDisplay = isDisplay - - self.isArchived = isArchived - - self.isPublic = isPublic - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isDisplay = try container.decode(Bool.self, forKey: .isDisplay) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isArchived = try container.decode(Bool.self, forKey: .isArchived) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isPublic = try container.decode(Bool.self, forKey: .isPublic) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isDisplay, forKey: .isDisplay) - - - - try? container.encodeIfPresent(isArchived, forKey: .isArchived) - - - - try? container.encodeIfPresent(isPublic, forKey: .isPublic) - - - } - - } - - /* - Model: CouponAction - Used By: Cart - */ - - class CouponAction: Codable { - - - public var actionDate: String? - - public var txnMode: String? - - - public enum CodingKeys: String, CodingKey { - - case actionDate = "action_date" - - case txnMode = "txn_mode" - - } - - public init(actionDate: String?, txnMode: String?) { - - self.actionDate = actionDate - - self.txnMode = txnMode - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - actionDate = try container.decode(String.self, forKey: .actionDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - txnMode = try container.decode(String.self, forKey: .txnMode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(actionDate, forKey: .actionDate) - - - - try? container.encodeIfPresent(txnMode, forKey: .txnMode) - - - } - - } - - /* - Model: CouponSchedule - Used By: Cart - */ - - class CouponSchedule: Codable { - - - public var cron: String? - - public var end: String? - - public var nextSchedule: [[String: Any]]? - - public var duration: Int? - - public var start: String? - - - public enum CodingKeys: String, CodingKey { - - case cron = "cron" - - case end = "end" - - case nextSchedule = "next_schedule" - - case duration = "duration" - - case start = "start" - - } - - public init(cron: String?, duration: Int?, end: String?, nextSchedule: [[String: Any]]?, start: String?) { - - self.cron = cron - - self.end = end - - self.nextSchedule = nextSchedule - - self.duration = duration - - self.start = start - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cron = try container.decode(String.self, forKey: .cron) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - end = try container.decode(String.self, forKey: .end) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - nextSchedule = try container.decode([[String: Any]].self, forKey: .nextSchedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - duration = try container.decode(Int.self, forKey: .duration) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - start = try container.decode(String.self, forKey: .start) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cron, forKey: .cron) - - - - try? container.encodeIfPresent(end, forKey: .end) - - - - try? container.encodeIfPresent(nextSchedule, forKey: .nextSchedule) - - - - try? container.encodeIfPresent(duration, forKey: .duration) - - - - try? container.encodeIfPresent(start, forKey: .start) - - - } - - } - - /* - Model: Rule - Used By: Cart - */ - - class Rule: Codable { - - - public var max: Double? - - public var key: Double? - - public var value: Double? - - public var discountQty: Double? - - public var min: Double? - - - public enum CodingKeys: String, CodingKey { - - case max = "max" - - case key = "key" - - case value = "value" - - case discountQty = "discount_qty" - - case min = "min" - - } - - public init(discountQty: Double?, key: Double?, max: Double?, min: Double?, value: Double?) { - - self.max = max - - self.key = key - - self.value = value - - self.discountQty = discountQty - - self.min = min - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - max = try container.decode(Double.self, forKey: .max) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - key = try container.decode(Double.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(Double.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discountQty = try container.decode(Double.self, forKey: .discountQty) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - min = try container.decode(Double.self, forKey: .min) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(max, forKey: .max) - - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(discountQty, forKey: .discountQty) - - - - try? container.encodeIfPresent(min, forKey: .min) - - - } - - } - - /* - Model: CouponAdd - Used By: Cart - */ - - class CouponAdd: Codable { - - - public var tags: [String]? - - public var dateMeta: CouponDateMeta? - - public var validation: Validation? - - public var displayMeta: DisplayMeta - - public var typeSlug: String - - public var restrictions: Restrictions? - - public var ruleDefinition: RuleDefinition - - public var identifiers: Identifier - - public var validity: Validity - - public var ownership: Ownership - - public var author: CouponAuthor? - - public var state: State? - - public var action: CouponAction? - - public var schedule: CouponSchedule? - - public var code: String - - public var rule: [Rule] - - - public enum CodingKeys: String, CodingKey { - - case tags = "tags" - - case dateMeta = "date_meta" - - case validation = "validation" - - case displayMeta = "display_meta" - - case typeSlug = "type_slug" - - case restrictions = "restrictions" - - case ruleDefinition = "rule_definition" - - case identifiers = "identifiers" - - case validity = "validity" - - case ownership = "ownership" - - case author = "author" - - case state = "state" - - case action = "action" - - case schedule = "_schedule" - - case code = "code" - - case rule = "rule" - - } - - public init(action: CouponAction?, author: CouponAuthor?, code: String, dateMeta: CouponDateMeta?, displayMeta: DisplayMeta, identifiers: Identifier, ownership: Ownership, restrictions: Restrictions?, rule: [Rule], ruleDefinition: RuleDefinition, state: State?, tags: [String]?, typeSlug: String, validation: Validation?, validity: Validity, schedule: CouponSchedule?) { - - self.tags = tags - - self.dateMeta = dateMeta - - self.validation = validation - - self.displayMeta = displayMeta - - self.typeSlug = typeSlug - - self.restrictions = restrictions - - self.ruleDefinition = ruleDefinition - - self.identifiers = identifiers - - self.validity = validity - - self.ownership = ownership - - self.author = author - - self.state = state - - self.action = action - - self.schedule = schedule - - self.code = code - - self.rule = rule - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(CouponDateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - validation = try container.decode(Validation.self, forKey: .validation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - displayMeta = try container.decode(DisplayMeta.self, forKey: .displayMeta) - - - - - typeSlug = try container.decode(String.self, forKey: .typeSlug) - - - - - do { - restrictions = try container.decode(Restrictions.self, forKey: .restrictions) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - ruleDefinition = try container.decode(RuleDefinition.self, forKey: .ruleDefinition) - - - - - identifiers = try container.decode(Identifier.self, forKey: .identifiers) - - - - - validity = try container.decode(Validity.self, forKey: .validity) - - - - - ownership = try container.decode(Ownership.self, forKey: .ownership) - - - - - do { - author = try container.decode(CouponAuthor.self, forKey: .author) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(State.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(CouponAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode(CouponSchedule.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - code = try container.decode(String.self, forKey: .code) - - - - - rule = try container.decode([Rule].self, forKey: .rule) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(validation, forKey: .validation) - - - - try? container.encodeIfPresent(displayMeta, forKey: .displayMeta) - - - - try? container.encodeIfPresent(typeSlug, forKey: .typeSlug) - - - - try? container.encodeIfPresent(restrictions, forKey: .restrictions) - - - - try? container.encodeIfPresent(ruleDefinition, forKey: .ruleDefinition) - - - - try? container.encodeIfPresent(identifiers, forKey: .identifiers) - - - - try? container.encodeIfPresent(validity, forKey: .validity) - - - - try? container.encodeIfPresent(ownership, forKey: .ownership) - - - - try? container.encodeIfPresent(author, forKey: .author) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(rule, forKey: .rule) - - - } - - } - - /* - Model: CouponsResponse - Used By: Cart - */ - - class CouponsResponse: Codable { - - - public var page: Page? - - public var items: CouponAdd? - - - public enum CodingKeys: String, CodingKey { - - case page = "page" - - case items = "items" - - } - - public init(items: CouponAdd?, page: Page?) { - - self.page = page - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode(CouponAdd.self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: SuccessMessage - Used By: Cart - */ - - class SuccessMessage: Codable { - - - public var message: String? - - public var success: Bool? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - case success = "success" - - } - - public init(message: String?, success: Bool?) { - - self.message = message - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: OperationErrorResponse - Used By: Cart - */ - - class OperationErrorResponse: Codable { - - - public var message: String? - - public var success: Bool? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - case success = "success" - - } - - public init(message: String?, success: Bool?) { - - self.message = message - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: CouponUpdate - Used By: Cart - */ - - class CouponUpdate: Codable { - - - public var tags: [String]? - - public var dateMeta: CouponDateMeta? - - public var validation: Validation? - - public var displayMeta: DisplayMeta - - public var typeSlug: String - - public var restrictions: Restrictions? - - public var ruleDefinition: RuleDefinition - - public var identifiers: Identifier - - public var validity: Validity - - public var ownership: Ownership - - public var author: CouponAuthor? - - public var state: State? - - public var action: CouponAction? - - public var schedule: CouponSchedule? - - public var code: String - - public var rule: [Rule] - - - public enum CodingKeys: String, CodingKey { - - case tags = "tags" - - case dateMeta = "date_meta" - - case validation = "validation" - - case displayMeta = "display_meta" - - case typeSlug = "type_slug" - - case restrictions = "restrictions" - - case ruleDefinition = "rule_definition" - - case identifiers = "identifiers" - - case validity = "validity" - - case ownership = "ownership" - - case author = "author" - - case state = "state" - - case action = "action" - - case schedule = "_schedule" - - case code = "code" - - case rule = "rule" - - } - - public init(action: CouponAction?, author: CouponAuthor?, code: String, dateMeta: CouponDateMeta?, displayMeta: DisplayMeta, identifiers: Identifier, ownership: Ownership, restrictions: Restrictions?, rule: [Rule], ruleDefinition: RuleDefinition, state: State?, tags: [String]?, typeSlug: String, validation: Validation?, validity: Validity, schedule: CouponSchedule?) { - - self.tags = tags - - self.dateMeta = dateMeta - - self.validation = validation - - self.displayMeta = displayMeta - - self.typeSlug = typeSlug - - self.restrictions = restrictions - - self.ruleDefinition = ruleDefinition - - self.identifiers = identifiers - - self.validity = validity - - self.ownership = ownership - - self.author = author - - self.state = state - - self.action = action - - self.schedule = schedule - - self.code = code - - self.rule = rule - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - tags = try container.decode([String].self, forKey: .tags) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - dateMeta = try container.decode(CouponDateMeta.self, forKey: .dateMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - validation = try container.decode(Validation.self, forKey: .validation) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - displayMeta = try container.decode(DisplayMeta.self, forKey: .displayMeta) - - - - - typeSlug = try container.decode(String.self, forKey: .typeSlug) - - - - - do { - restrictions = try container.decode(Restrictions.self, forKey: .restrictions) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - ruleDefinition = try container.decode(RuleDefinition.self, forKey: .ruleDefinition) - - - - - identifiers = try container.decode(Identifier.self, forKey: .identifiers) - - - - - validity = try container.decode(Validity.self, forKey: .validity) - - - - - ownership = try container.decode(Ownership.self, forKey: .ownership) - - - - - do { - author = try container.decode(CouponAuthor.self, forKey: .author) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - state = try container.decode(State.self, forKey: .state) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(CouponAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode(CouponSchedule.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - code = try container.decode(String.self, forKey: .code) - - - - - rule = try container.decode([Rule].self, forKey: .rule) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(tags, forKey: .tags) - - - - try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) - - - - try? container.encodeIfPresent(validation, forKey: .validation) - - - - try? container.encodeIfPresent(displayMeta, forKey: .displayMeta) - - - - try? container.encodeIfPresent(typeSlug, forKey: .typeSlug) - - - - try? container.encodeIfPresent(restrictions, forKey: .restrictions) - - - - try? container.encodeIfPresent(ruleDefinition, forKey: .ruleDefinition) - - - - try? container.encodeIfPresent(identifiers, forKey: .identifiers) - - - - try? container.encodeIfPresent(validity, forKey: .validity) - - - - try? container.encodeIfPresent(ownership, forKey: .ownership) - - - - try? container.encodeIfPresent(author, forKey: .author) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(rule, forKey: .rule) - - - } - - } - - /* - Model: CouponPartialUpdate - Used By: Cart - */ - - class CouponPartialUpdate: Codable { - - - public var archive: Bool? - - public var schedule: CouponSchedule? - - - public enum CodingKeys: String, CodingKey { - - case archive = "archive" - - case schedule = "schedule" - - } - - public init(archive: Bool?, schedule: CouponSchedule?) { - - self.archive = archive - - self.schedule = schedule - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - archive = try container.decode(Bool.self, forKey: .archive) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode(CouponSchedule.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(archive, forKey: .archive) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - } - - } - - /* - Model: CartItem - Used By: Cart - */ - - class CartItem: Codable { - - - public var productId: String - - public var size: String - - public var quantity: Int? - - - public enum CodingKeys: String, CodingKey { - - case productId = "product_id" - - case size = "size" - - case quantity = "quantity" - - } - - public init(productId: String, quantity: Int?, size: String) { - - self.productId = productId - - self.size = size - - self.quantity = quantity - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - productId = try container.decode(String.self, forKey: .productId) - - - - - size = try container.decode(String.self, forKey: .size) - - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(productId, forKey: .productId) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - } - - } - - /* - Model: OpenapiCartDetailsRequest - Used By: Cart - */ - - class OpenapiCartDetailsRequest: Codable { - - - public var cartItems: CartItem? - - - public enum CodingKeys: String, CodingKey { - - case cartItems = "cart_items" - - } - - public init(cartItems: CartItem?) { - - self.cartItems = cartItems - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cartItems = try container.decode(CartItem.self, forKey: .cartItems) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cartItems, forKey: .cartItems) - - - } - - } - - /* - Model: CouponBreakup - Used By: Cart - */ - - class CouponBreakup: Codable { - - - public var isApplied: Bool? - - public var type: String? - - public var uid: String? - - public var message: String? - - public var value: Double? - - public var code: String? - - - public enum CodingKeys: String, CodingKey { - - case isApplied = "is_applied" - - case type = "type" - - case uid = "uid" - - case message = "message" - - case value = "value" - - case code = "code" - - } - - public init(code: String?, isApplied: Bool?, message: String?, type: String?, uid: String?, value: Double?) { - - self.isApplied = isApplied - - self.type = type - - self.uid = uid - - self.message = message - - self.value = value - - self.code = code - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isApplied = try container.decode(Bool.self, forKey: .isApplied) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(Double.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isApplied, forKey: .isApplied) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(code, forKey: .code) - - - } - - } - - /* - Model: DisplayBreakup - Used By: Cart - */ - - class DisplayBreakup: Codable { - - - public var display: String? - - public var currencyCode: String? - - public var message: [String]? - - public var key: String? - - public var value: Double? - - public var currencySymbol: String? - - - public enum CodingKeys: String, CodingKey { - - case display = "display" - - case currencyCode = "currency_code" - - case message = "message" - - case key = "key" - - case value = "value" - - case currencySymbol = "currency_symbol" - - } - - public init(currencyCode: String?, currencySymbol: String?, display: String?, key: String?, message: [String]?, value: Double?) { - - self.display = display - - self.currencyCode = currencyCode - - self.message = message - - self.key = key - - self.value = value - - self.currencySymbol = currencySymbol - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - display = try container.decode(String.self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode([String].self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(Double.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencySymbol = try container.decode(String.self, forKey: .currencySymbol) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) - - - } - - } - - /* - Model: RawBreakup - Used By: Cart - */ - - class RawBreakup: Codable { - - - public var total: Double? - - public var youSaved: Double? - - public var mrpTotal: String? - - public var vog: Double? - - public var subtotal: Double? - - public var convenienceFee: Double? - - public var deliveryCharge: Double? - - public var discount: Double? - - public var coupon: Double? - - public var fyndCash: Double? - - public var gstCharges: Double? - - public var codCharge: Double? - - - public enum CodingKeys: String, CodingKey { - - case total = "total" - - case youSaved = "you_saved" - - case mrpTotal = "mrp_total" - - case vog = "vog" - - case subtotal = "subtotal" - - case convenienceFee = "convenience_fee" - - case deliveryCharge = "delivery_charge" - - case discount = "discount" - - case coupon = "coupon" - - case fyndCash = "fynd_cash" - - case gstCharges = "gst_charges" - - case codCharge = "cod_charge" - - } - - public init(codCharge: Double?, convenienceFee: Double?, coupon: Double?, deliveryCharge: Double?, discount: Double?, fyndCash: Double?, gstCharges: Double?, mrpTotal: String?, subtotal: Double?, total: Double?, vog: Double?, youSaved: Double?) { - - self.total = total - - self.youSaved = youSaved - - self.mrpTotal = mrpTotal - - self.vog = vog - - self.subtotal = subtotal - - self.convenienceFee = convenienceFee - - self.deliveryCharge = deliveryCharge - - self.discount = discount - - self.coupon = coupon - - self.fyndCash = fyndCash - - self.gstCharges = gstCharges - - self.codCharge = codCharge - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - total = try container.decode(Double.self, forKey: .total) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - youSaved = try container.decode(Double.self, forKey: .youSaved) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - mrpTotal = try container.decode(String.self, forKey: .mrpTotal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - vog = try container.decode(Double.self, forKey: .vog) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subtotal = try container.decode(Double.self, forKey: .subtotal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - convenienceFee = try container.decode(Double.self, forKey: .convenienceFee) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryCharge = try container.decode(Double.self, forKey: .deliveryCharge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discount = try container.decode(Double.self, forKey: .discount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - coupon = try container.decode(Double.self, forKey: .coupon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fyndCash = try container.decode(Double.self, forKey: .fyndCash) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - gstCharges = try container.decode(Double.self, forKey: .gstCharges) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - codCharge = try container.decode(Double.self, forKey: .codCharge) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(total, forKey: .total) - - - - try? container.encodeIfPresent(youSaved, forKey: .youSaved) - - - - try? container.encodeIfPresent(mrpTotal, forKey: .mrpTotal) - - - - try? container.encodeIfPresent(vog, forKey: .vog) - - - - try? container.encodeIfPresent(subtotal, forKey: .subtotal) - - - - try? container.encodeIfPresent(convenienceFee, forKey: .convenienceFee) - - - - try? container.encodeIfPresent(deliveryCharge, forKey: .deliveryCharge) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - - try? container.encodeIfPresent(coupon, forKey: .coupon) - - - - try? container.encodeIfPresent(fyndCash, forKey: .fyndCash) - - - - try? container.encodeIfPresent(gstCharges, forKey: .gstCharges) - - - - try? container.encodeIfPresent(codCharge, forKey: .codCharge) - - - } - - } - - /* - Model: LoyaltyPoints - Used By: Cart - */ - - class LoyaltyPoints: Codable { - - - public var total: Double? - - public var isApplied: Bool? - - public var applicable: Double? - - public var description: String? - - - public enum CodingKeys: String, CodingKey { - - case total = "total" - - case isApplied = "is_applied" - - case applicable = "applicable" - - case description = "description" - - } - - public init(applicable: Double?, description: String?, isApplied: Bool?, total: Double?) { - - self.total = total - - self.isApplied = isApplied - - self.applicable = applicable - - self.description = description - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - total = try container.decode(Double.self, forKey: .total) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isApplied = try container.decode(Bool.self, forKey: .isApplied) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - applicable = try container.decode(Double.self, forKey: .applicable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(total, forKey: .total) - - - - try? container.encodeIfPresent(isApplied, forKey: .isApplied) - - - - try? container.encodeIfPresent(applicable, forKey: .applicable) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - } - - } - - /* - Model: CartBreakup - Used By: Cart - */ - - class CartBreakup: Codable { - - - public var coupon: CouponBreakup? - - public var display: [DisplayBreakup]? - - public var raw: RawBreakup? - - public var loyaltyPoints: LoyaltyPoints? - - - public enum CodingKeys: String, CodingKey { - - case coupon = "coupon" - - case display = "display" - - case raw = "raw" - - case loyaltyPoints = "loyalty_points" - - } - - public init(coupon: CouponBreakup?, display: [DisplayBreakup]?, loyaltyPoints: LoyaltyPoints?, raw: RawBreakup?) { - - self.coupon = coupon - - self.display = display - - self.raw = raw - - self.loyaltyPoints = loyaltyPoints - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - coupon = try container.decode(CouponBreakup.self, forKey: .coupon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - display = try container.decode([DisplayBreakup].self, forKey: .display) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - raw = try container.decode(RawBreakup.self, forKey: .raw) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - loyaltyPoints = try container.decode(LoyaltyPoints.self, forKey: .loyaltyPoints) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(coupon, forKey: .coupon) - - - - try? container.encodeIfPresent(display, forKey: .display) - - - - try? container.encodeIfPresent(raw, forKey: .raw) - - - - try? container.encodeIfPresent(loyaltyPoints, forKey: .loyaltyPoints) - - - } - - } - - /* - Model: BaseInfo - Used By: Cart - */ - - class BaseInfo: Codable { - - - public var name: String? - - public var uid: Int? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case uid = "uid" - - } - - public init(name: String?, uid: Int?) { - - self.name = name - - self.uid = uid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - } - - } - - /* - Model: ProductImage - Used By: Cart - */ - - class ProductImage: Codable { - - - public var secureUrl: String? - - public var aspectRatio: String? - - public var url: String? - - - public enum CodingKeys: String, CodingKey { - - case secureUrl = "secure_url" - - case aspectRatio = "aspect_ratio" - - case url = "url" - - } - - public init(aspectRatio: String?, secureUrl: String?, url: String?) { - - self.secureUrl = secureUrl - - self.aspectRatio = aspectRatio - - self.url = url - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - secureUrl = try container.decode(String.self, forKey: .secureUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - aspectRatio = try container.decode(String.self, forKey: .aspectRatio) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) - - - - try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - } - - } - - /* - Model: CategoryInfo - Used By: Cart - */ - - class CategoryInfo: Codable { - - - public var name: String? - - public var uid: Int? - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case uid = "uid" - - } - - public init(name: String?, uid: Int?) { - - self.name = name - - self.uid = uid - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - } - - } - - /* - Model: ActionQuery - Used By: Cart - */ - - class ActionQuery: Codable { - - - public var productSlug: [String]? - - - public enum CodingKeys: String, CodingKey { - - case productSlug = "product_slug" - - } - - public init(productSlug: [String]?) { - - self.productSlug = productSlug - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - productSlug = try container.decode([String].self, forKey: .productSlug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(productSlug, forKey: .productSlug) - - - } - - } - - /* - Model: ProductAction - Used By: Cart - */ - - class ProductAction: Codable { - - - public var type: String? - - public var query: ActionQuery? - - public var url: String? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case query = "query" - - case url = "url" - - } - - public init(query: ActionQuery?, type: String?, url: String?) { - - self.type = type - - self.query = query - - self.url = url - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - query = try container.decode(ActionQuery.self, forKey: .query) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(query, forKey: .query) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - } - - } - - /* - Model: CartProduct - Used By: Cart - */ - - class CartProduct: Codable { - - - public var brand: BaseInfo? - - public var images: [ProductImage]? - - public var type: String? - - public var uid: Int? - - public var categories: [CategoryInfo]? - - public var action: ProductAction? - - public var name: String? - - public var slug: String? - - - public enum CodingKeys: String, CodingKey { - - case brand = "brand" - - case images = "images" - - case type = "type" - - case uid = "uid" - - case categories = "categories" - - case action = "action" - - case name = "name" - - case slug = "slug" - - } - - public init(action: ProductAction?, brand: BaseInfo?, categories: [CategoryInfo]?, images: [ProductImage]?, name: String?, slug: String?, type: String?, uid: Int?) { - - self.brand = brand - - self.images = images - - self.type = type - - self.uid = uid - - self.categories = categories - - self.action = action - - self.name = name - - self.slug = slug - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - brand = try container.decode(BaseInfo.self, forKey: .brand) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - images = try container.decode([ProductImage].self, forKey: .images) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - categories = try container.decode([CategoryInfo].self, forKey: .categories) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - action = try container.decode(ProductAction.self, forKey: .action) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - slug = try container.decode(String.self, forKey: .slug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(brand, forKey: .brand) - - - - try? container.encodeIfPresent(images, forKey: .images) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(categories, forKey: .categories) - - - - try? container.encodeIfPresent(action, forKey: .action) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(slug, forKey: .slug) - - - } - - } - - /* - Model: BasePrice - Used By: Cart - */ - - class BasePrice: Codable { - - - public var currencyCode: String? - - public var effective: Double? - - public var marked: Double? - - public var currencySymbol: String? - - - public enum CodingKeys: String, CodingKey { - - case currencyCode = "currency_code" - - case effective = "effective" - - case marked = "marked" - - case currencySymbol = "currency_symbol" - - } - - public init(currencyCode: String?, currencySymbol: String?, effective: Double?, marked: Double?) { - - self.currencyCode = currencyCode - - self.effective = effective - - self.marked = marked - - self.currencySymbol = currencySymbol - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - effective = try container.decode(Double.self, forKey: .effective) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - marked = try container.decode(Double.self, forKey: .marked) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencySymbol = try container.decode(String.self, forKey: .currencySymbol) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - - try? container.encodeIfPresent(effective, forKey: .effective) - - - - try? container.encodeIfPresent(marked, forKey: .marked) - - - - try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) - - - } - - } - - /* - Model: ArticlePriceInfo - Used By: Cart - */ - - class ArticlePriceInfo: Codable { - - - public var base: BasePrice? - - public var converted: BasePrice? - - - public enum CodingKeys: String, CodingKey { - - case base = "base" - - case converted = "converted" - - } - - public init(base: BasePrice?, converted: BasePrice?) { - - self.base = base - - self.converted = converted - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - base = try container.decode(BasePrice.self, forKey: .base) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - converted = try container.decode(BasePrice.self, forKey: .converted) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(base, forKey: .base) - - - - try? container.encodeIfPresent(converted, forKey: .converted) - - - } - - } - - /* - Model: ProductArticle - Used By: Cart - */ - - class ProductArticle: Codable { - - - public var size: String? - - public var type: String? - - public var uid: String? - - public var quantity: Int? - - public var extraMeta: [String: Any]? - - public var price: ArticlePriceInfo? - - public var seller: BaseInfo? - - public var store: BaseInfo? - - - public enum CodingKeys: String, CodingKey { - - case size = "size" - - case type = "type" - - case uid = "uid" - - case quantity = "quantity" - - case extraMeta = "extra_meta" - - case price = "price" - - case seller = "seller" - - case store = "store" - - } - - public init(extraMeta: [String: Any]?, price: ArticlePriceInfo?, quantity: Int?, seller: BaseInfo?, size: String?, store: BaseInfo?, type: String?, uid: String?) { - - self.size = size - - self.type = type - - self.uid = uid - - self.quantity = quantity - - self.extraMeta = extraMeta - - self.price = price - - self.seller = seller - - self.store = store - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - size = try container.decode(String.self, forKey: .size) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(String.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - extraMeta = try container.decode([String: Any].self, forKey: .extraMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(ArticlePriceInfo.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - seller = try container.decode(BaseInfo.self, forKey: .seller) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - store = try container.decode(BaseInfo.self, forKey: .store) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - - try? container.encodeIfPresent(extraMeta, forKey: .extraMeta) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(seller, forKey: .seller) - - - - try? container.encodeIfPresent(store, forKey: .store) - - - } - - } - - /* - Model: ProductPrice - Used By: Cart - */ - - class ProductPrice: Codable { - - - public var marked: Double? - - public var selling: Double? - - public var currencyCode: String? - - public var effective: Double? - - public var addOn: Double? - - public var currencySymbol: String? - - - public enum CodingKeys: String, CodingKey { - - case marked = "marked" - - case selling = "selling" - - case currencyCode = "currency_code" - - case effective = "effective" - - case addOn = "add_on" - - case currencySymbol = "currency_symbol" - - } - - public init(addOn: Double?, currencyCode: String?, currencySymbol: String?, effective: Double?, marked: Double?, selling: Double?) { - - self.marked = marked - - self.selling = selling - - self.currencyCode = currencyCode - - self.effective = effective - - self.addOn = addOn - - self.currencySymbol = currencySymbol - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - marked = try container.decode(Double.self, forKey: .marked) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - selling = try container.decode(Double.self, forKey: .selling) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - effective = try container.decode(Double.self, forKey: .effective) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addOn = try container.decode(Double.self, forKey: .addOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencySymbol = try container.decode(String.self, forKey: .currencySymbol) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(marked, forKey: .marked) - - - - try? container.encodeIfPresent(selling, forKey: .selling) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - - try? container.encodeIfPresent(effective, forKey: .effective) - - - - try? container.encodeIfPresent(addOn, forKey: .addOn) - - - - try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) - - - } - - } - - /* - Model: ProductPriceInfo - Used By: Cart - */ - - class ProductPriceInfo: Codable { - - - public var base: ProductPrice? - - public var converted: ProductPrice? - - - public enum CodingKeys: String, CodingKey { - - case base = "base" - - case converted = "converted" - - } - - public init(base: ProductPrice?, converted: ProductPrice?) { - - self.base = base - - self.converted = converted - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - base = try container.decode(ProductPrice.self, forKey: .base) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - converted = try container.decode(ProductPrice.self, forKey: .converted) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(base, forKey: .base) - - - - try? container.encodeIfPresent(converted, forKey: .converted) - - - } - - } - - /* - Model: CartProductIdentifer - Used By: Cart - */ - - class CartProductIdentifer: Codable { - - - public var identifier: String? - - - public enum CodingKeys: String, CodingKey { - - case identifier = "identifier" - - } - - public init(identifier: String?) { - - self.identifier = identifier - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - identifier = try container.decode(String.self, forKey: .identifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(identifier, forKey: .identifier) - - - } - - } - - /* - Model: ProductAvailability - Used By: Cart - */ - - class ProductAvailability: Codable { - - - public var deliverable: Bool? - - public var outOfStock: Bool? - - public var isValid: Bool? - - public var otherStoreQuantity: Int? - - public var sizes: [String]? - - - public enum CodingKeys: String, CodingKey { - - case deliverable = "deliverable" - - case outOfStock = "out_of_stock" - - case isValid = "is_valid" - - case otherStoreQuantity = "other_store_quantity" - - case sizes = "sizes" - - } - - public init(deliverable: Bool?, isValid: Bool?, otherStoreQuantity: Int?, outOfStock: Bool?, sizes: [String]?) { - - self.deliverable = deliverable - - self.outOfStock = outOfStock - - self.isValid = isValid - - self.otherStoreQuantity = otherStoreQuantity - - self.sizes = sizes - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - deliverable = try container.decode(Bool.self, forKey: .deliverable) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - outOfStock = try container.decode(Bool.self, forKey: .outOfStock) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isValid = try container.decode(Bool.self, forKey: .isValid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - otherStoreQuantity = try container.decode(Int.self, forKey: .otherStoreQuantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sizes = try container.decode([String].self, forKey: .sizes) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(deliverable, forKey: .deliverable) - - - - try? container.encodeIfPresent(outOfStock, forKey: .outOfStock) - - - - try? container.encodeIfPresent(isValid, forKey: .isValid) - - - - try? container.encodeIfPresent(otherStoreQuantity, forKey: .otherStoreQuantity) - - - - try? container.encodeIfPresent(sizes, forKey: .sizes) - - - } - - } - - /* - Model: PromoMeta - Used By: Cart - */ - - class PromoMeta: Codable { - - - public var message: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String?) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - /* - Model: CartProductInfo - Used By: Cart - */ - - class CartProductInfo: Codable { - - - public var product: CartProduct? - - public var article: ProductArticle? - - public var pricePerUnit: ProductPriceInfo? - - public var identifiers: CartProductIdentifer - - public var availability: ProductAvailability? - - public var quantity: Int? - - public var bulkOffer: [String: Any]? - - public var message: String? - - public var key: String? - - public var discount: String? - - public var promoMeta: PromoMeta? - - public var price: ProductPriceInfo? - - public var isSet: Bool? - - public var couponMessage: String? - - - public enum CodingKeys: String, CodingKey { - - case product = "product" - - case article = "article" - - case pricePerUnit = "price_per_unit" - - case identifiers = "identifiers" - - case availability = "availability" - - case quantity = "quantity" - - case bulkOffer = "bulk_offer" - - case message = "message" - - case key = "key" - - case discount = "discount" - - case promoMeta = "promo_meta" - - case price = "price" - - case isSet = "is_set" - - case couponMessage = "coupon_message" - - } - - public init(article: ProductArticle?, availability: ProductAvailability?, bulkOffer: [String: Any]?, couponMessage: String?, discount: String?, identifiers: CartProductIdentifer, isSet: Bool?, key: String?, message: String?, price: ProductPriceInfo?, pricePerUnit: ProductPriceInfo?, product: CartProduct?, promoMeta: PromoMeta?, quantity: Int?) { - - self.product = product - - self.article = article - - self.pricePerUnit = pricePerUnit - - self.identifiers = identifiers - - self.availability = availability - - self.quantity = quantity - - self.bulkOffer = bulkOffer - - self.message = message - - self.key = key - - self.discount = discount - - self.promoMeta = promoMeta - - self.price = price - - self.isSet = isSet - - self.couponMessage = couponMessage - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - product = try container.decode(CartProduct.self, forKey: .product) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - article = try container.decode(ProductArticle.self, forKey: .article) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pricePerUnit = try container.decode(ProductPriceInfo.self, forKey: .pricePerUnit) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - identifiers = try container.decode(CartProductIdentifer.self, forKey: .identifiers) - - - - - do { - availability = try container.decode(ProductAvailability.self, forKey: .availability) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bulkOffer = try container.decode([String: Any].self, forKey: .bulkOffer) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discount = try container.decode(String.self, forKey: .discount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - promoMeta = try container.decode(PromoMeta.self, forKey: .promoMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - price = try container.decode(ProductPriceInfo.self, forKey: .price) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isSet = try container.decode(Bool.self, forKey: .isSet) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - couponMessage = try container.decode(String.self, forKey: .couponMessage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(product, forKey: .product) - - - - try? container.encodeIfPresent(article, forKey: .article) - - - - try? container.encodeIfPresent(pricePerUnit, forKey: .pricePerUnit) - - - - try? container.encodeIfPresent(identifiers, forKey: .identifiers) - - - - try? container.encodeIfPresent(availability, forKey: .availability) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - - try? container.encodeIfPresent(bulkOffer, forKey: .bulkOffer) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - - try? container.encodeIfPresent(promoMeta, forKey: .promoMeta) - - - - try? container.encodeIfPresent(price, forKey: .price) - - - - try? container.encodeIfPresent(isSet, forKey: .isSet) - - - - try? container.encodeIfPresent(couponMessage, forKey: .couponMessage) - - - } - - } - - /* - Model: OpenapiCartDetailsResponse - Used By: Cart - */ - - class OpenapiCartDetailsResponse: Codable { - - - public var message: String? - - public var breakupValues: CartBreakup? - - public var isValid: Bool? - - public var items: [CartProductInfo]? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - case breakupValues = "breakup_values" - - case isValid = "is_valid" - - case items = "items" - - } - - public init(breakupValues: CartBreakup?, isValid: Bool?, items: [CartProductInfo]?, message: String?) { - - self.message = message - - self.breakupValues = breakupValues - - self.isValid = isValid - - self.items = items - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - breakupValues = try container.decode(CartBreakup.self, forKey: .breakupValues) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - isValid = try container.decode(Bool.self, forKey: .isValid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([CartProductInfo].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) - - - - try? container.encodeIfPresent(isValid, forKey: .isValid) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - } - - } - - /* - Model: OpenApiErrorResponse - Used By: Cart - */ - - class OpenApiErrorResponse: Codable { - - - public var errors: [String: Any]? - - public var message: String? - - public var success: Bool? - - - public enum CodingKeys: String, CodingKey { - - case errors = "errors" - - case message = "message" - - case success = "success" - - } - - public init(errors: [String: Any]?, message: String?, success: Bool?) { - - self.errors = errors - - self.message = message - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - errors = try container.decode([String: Any].self, forKey: .errors) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(errors, forKey: .errors) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: ShippingAddress - Used By: Cart - */ - - class ShippingAddress: Codable { - - - public var areaCodeSlug: String? - - public var pincode: Int? - - public var phone: Int? - - public var city: String - - public var area: String? - - public var state: String - - public var landmark: String? - - public var meta: [String: Any]? - - public var areaCode: String - - public var name: String? - - public var addressType: String? - - public var country: String - - public var address: String? - - public var countryCode: String? - - public var email: String? - - - public enum CodingKeys: String, CodingKey { - - case areaCodeSlug = "area_code_slug" - - case pincode = "pincode" - - case phone = "phone" - - case city = "city" - - case area = "area" - - case state = "state" - - case landmark = "landmark" - - case meta = "meta" - - case areaCode = "area_code" - - case name = "name" - - case addressType = "address_type" - - case country = "country" - - case address = "address" - - case countryCode = "country_code" - - case email = "email" - - } - - public init(address: String?, addressType: String?, area: String?, areaCode: String, areaCodeSlug: String?, city: String, country: String, countryCode: String?, email: String?, landmark: String?, meta: [String: Any]?, name: String?, phone: Int?, pincode: Int?, state: String) { - - self.areaCodeSlug = areaCodeSlug - - self.pincode = pincode - - self.phone = phone - - self.city = city - - self.area = area - - self.state = state - - self.landmark = landmark - - self.meta = meta - - self.areaCode = areaCode - - self.name = name - - self.addressType = addressType - - self.country = country - - self.address = address - - self.countryCode = countryCode - - self.email = email - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - areaCodeSlug = try container.decode(String.self, forKey: .areaCodeSlug) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - pincode = try container.decode(Int.self, forKey: .pincode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - phone = try container.decode(Int.self, forKey: .phone) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - city = try container.decode(String.self, forKey: .city) - - - - - do { - area = try container.decode(String.self, forKey: .area) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - state = try container.decode(String.self, forKey: .state) - - - - - do { - landmark = try container.decode(String.self, forKey: .landmark) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - areaCode = try container.decode(String.self, forKey: .areaCode) - - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - addressType = try container.decode(String.self, forKey: .addressType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - country = try container.decode(String.self, forKey: .country) - - - - - do { - address = try container.decode(String.self, forKey: .address) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - countryCode = try container.decode(String.self, forKey: .countryCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(areaCodeSlug, forKey: .areaCodeSlug) - - - - try? container.encodeIfPresent(pincode, forKey: .pincode) - - - - try? container.encodeIfPresent(phone, forKey: .phone) - - - - try? container.encodeIfPresent(city, forKey: .city) - - - - try? container.encodeIfPresent(area, forKey: .area) - - - - try? container.encodeIfPresent(state, forKey: .state) - - - - try? container.encodeIfPresent(landmark, forKey: .landmark) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(areaCode, forKey: .areaCode) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(addressType, forKey: .addressType) - - - - try? container.encodeIfPresent(country, forKey: .country) - - - - try? container.encodeIfPresent(address, forKey: .address) - - - - try? container.encodeIfPresent(countryCode, forKey: .countryCode) - - - - try? container.encodeIfPresent(email, forKey: .email) - - - } - - } - - /* - Model: OpenApiCartServiceabilityRequest - Used By: Cart - */ - - class OpenApiCartServiceabilityRequest: Codable { - - - public var cartItems: CartItem? - - public var shippingAddress: ShippingAddress - - - public enum CodingKeys: String, CodingKey { - - case cartItems = "cart_items" - - case shippingAddress = "shipping_address" - - } - - public init(cartItems: CartItem?, shippingAddress: ShippingAddress) { - - self.cartItems = cartItems - - self.shippingAddress = shippingAddress - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - cartItems = try container.decode(CartItem.self, forKey: .cartItems) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - shippingAddress = try container.decode(ShippingAddress.self, forKey: .shippingAddress) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(cartItems, forKey: .cartItems) - - - - try? container.encodeIfPresent(shippingAddress, forKey: .shippingAddress) - - - } - - } - - /* - Model: PromiseFormatted - Used By: Cart - */ - - class PromiseFormatted: Codable { - - - public var max: String? - - public var min: String? - - - public enum CodingKeys: String, CodingKey { - - case max = "max" - - case min = "min" - - } - - public init(max: String?, min: String?) { - - self.max = max - - self.min = min - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - max = try container.decode(String.self, forKey: .max) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - min = try container.decode(String.self, forKey: .min) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(max, forKey: .max) - - - - try? container.encodeIfPresent(min, forKey: .min) - - - } - - } - - /* - Model: PromiseTimestamp - Used By: Cart - */ - - class PromiseTimestamp: Codable { - - - public var max: Double? - - public var min: Double? - - - public enum CodingKeys: String, CodingKey { - - case max = "max" - - case min = "min" - - } - - public init(max: Double?, min: Double?) { - - self.max = max - - self.min = min - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - max = try container.decode(Double.self, forKey: .max) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - min = try container.decode(Double.self, forKey: .min) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(max, forKey: .max) - - - - try? container.encodeIfPresent(min, forKey: .min) - - - } - - } - - /* - Model: ShipmentPromise - Used By: Cart - */ - - class ShipmentPromise: Codable { - - - public var formatted: PromiseFormatted? - - public var timestamp: PromiseTimestamp? - - - public enum CodingKeys: String, CodingKey { - - case formatted = "formatted" - - case timestamp = "timestamp" - - } - - public init(formatted: PromiseFormatted?, timestamp: PromiseTimestamp?) { - - self.formatted = formatted - - self.timestamp = timestamp - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - formatted = try container.decode(PromiseFormatted.self, forKey: .formatted) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - timestamp = try container.decode(PromiseTimestamp.self, forKey: .timestamp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(formatted, forKey: .formatted) - - - - try? container.encodeIfPresent(timestamp, forKey: .timestamp) - - - } - - } - - /* - Model: OpenApiCartServiceabilityResponse - Used By: Cart - */ - - class OpenApiCartServiceabilityResponse: Codable { - - - public var isValid: Bool? - - public var items: [CartProductInfo]? - - public var message: String? - - public var breakupValues: CartBreakup? - - public var deliveryPromise: ShipmentPromise? - - - public enum CodingKeys: String, CodingKey { - - case isValid = "is_valid" - - case items = "items" - - case message = "message" - - case breakupValues = "breakup_values" - - case deliveryPromise = "delivery_promise" - - } - - public init(breakupValues: CartBreakup?, deliveryPromise: ShipmentPromise?, isValid: Bool?, items: [CartProductInfo]?, message: String?) { - - self.isValid = isValid - - self.items = items - - self.message = message - - self.breakupValues = breakupValues - - self.deliveryPromise = deliveryPromise - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - isValid = try container.decode(Bool.self, forKey: .isValid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - items = try container.decode([CartProductInfo].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - breakupValues = try container.decode(CartBreakup.self, forKey: .breakupValues) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - deliveryPromise = try container.decode(ShipmentPromise.self, forKey: .deliveryPromise) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(isValid, forKey: .isValid) - - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) - - - - try? container.encodeIfPresent(deliveryPromise, forKey: .deliveryPromise) - - - } - - } - - /* - Model: OpenApiFiles - Used By: Cart - */ - - class OpenApiFiles: Codable { - - - public var key: String - - public var values: [String] - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case values = "values" - - } - - public init(key: String, values: [String]) { - - self.key = key - - self.values = values - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - key = try container.decode(String.self, forKey: .key) - - - - - values = try container.decode([String].self, forKey: .values) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(values, forKey: .values) - - - } - - } - - /* - Model: CartItemMeta - Used By: Cart - */ - - class CartItemMeta: Codable { - - - public var groupId: String? - - public var primaryItem: Bool? - - - public enum CodingKeys: String, CodingKey { - - case groupId = "group_id" - - case primaryItem = "primary_item" - - } - - public init(groupId: String?, primaryItem: Bool?) { - - self.groupId = groupId - - self.primaryItem = primaryItem - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - groupId = try container.decode(String.self, forKey: .groupId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - primaryItem = try container.decode(Bool.self, forKey: .primaryItem) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(groupId, forKey: .groupId) - - - - try? container.encodeIfPresent(primaryItem, forKey: .primaryItem) - - - } - - } - - /* - Model: MultiTenderPaymentMeta - Used By: Cart - */ - - class MultiTenderPaymentMeta: Codable { - - - public var currentStatus: String? - - public var orderId: String? - - public var paymentGateway: String? - - public var extraMeta: [String: Any]? - - public var paymentId: String? - - - public enum CodingKeys: String, CodingKey { - - case currentStatus = "current_status" - - case orderId = "order_id" - - case paymentGateway = "payment_gateway" - - case extraMeta = "extra_meta" - - case paymentId = "payment_id" - - } - - public init(currentStatus: String?, extraMeta: [String: Any]?, orderId: String?, paymentGateway: String?, paymentId: String?) { - - self.currentStatus = currentStatus - - self.orderId = orderId - - self.paymentGateway = paymentGateway - - self.extraMeta = extraMeta - - self.paymentId = paymentId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - currentStatus = try container.decode(String.self, forKey: .currentStatus) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - orderId = try container.decode(String.self, forKey: .orderId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentGateway = try container.decode(String.self, forKey: .paymentGateway) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - extraMeta = try container.decode([String: Any].self, forKey: .extraMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentId = try container.decode(String.self, forKey: .paymentId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(currentStatus, forKey: .currentStatus) - - - - try? container.encodeIfPresent(orderId, forKey: .orderId) - - - - try? container.encodeIfPresent(paymentGateway, forKey: .paymentGateway) - - - - try? container.encodeIfPresent(extraMeta, forKey: .extraMeta) - - - - try? container.encodeIfPresent(paymentId, forKey: .paymentId) - - - } - - } - - /* - Model: MultiTenderPaymentMethod - Used By: Cart - */ - - class MultiTenderPaymentMethod: Codable { - - - public var meta: MultiTenderPaymentMeta? - - public var mode: String - - public var name: String? - - public var amount: Double - - - public enum CodingKeys: String, CodingKey { - - case meta = "meta" - - case mode = "mode" - - case name = "name" - - case amount = "amount" - - } - - public init(amount: Double, meta: MultiTenderPaymentMeta?, mode: String, name: String?) { - - self.meta = meta - - self.mode = mode - - self.name = name - - self.amount = amount - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - meta = try container.decode(MultiTenderPaymentMeta.self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - mode = try container.decode(String.self, forKey: .mode) - - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - amount = try container.decode(Double.self, forKey: .amount) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(mode, forKey: .mode) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - } - - } - - /* - Model: OpenApiOrderItem - Used By: Cart - */ - - class OpenApiOrderItem: Codable { - - - public var couponEffectiveDiscount: Double - - public var codCharges: Double - - public var priceMarked: Double - - public var files: [OpenApiFiles]? - - public var productId: Int - - public var quantity: Int? - - public var cashbackApplied: Double - - public var meta: CartItemMeta? - - public var priceEffective: Double - - public var discount: Double - - public var deliveryCharges: Double - - public var loyaltyDiscount: Double? - - public var amountPaid: Double - - public var extraMeta: [String: Any]? - - public var paymentMethods: [MultiTenderPaymentMethod] - - public var size: String - - public var employeeDiscount: Double? - - - public enum CodingKeys: String, CodingKey { - - case couponEffectiveDiscount = "coupon_effective_discount" - - case codCharges = "cod_charges" - - case priceMarked = "price_marked" - - case files = "files" - - case productId = "product_id" - - case quantity = "quantity" - - case cashbackApplied = "cashback_applied" - - case meta = "meta" - - case priceEffective = "price_effective" - - case discount = "discount" - - case deliveryCharges = "delivery_charges" - - case loyaltyDiscount = "loyalty_discount" - - case amountPaid = "amount_paid" - - case extraMeta = "extra_meta" - - case paymentMethods = "payment_methods" - - case size = "size" - - case employeeDiscount = "employee_discount" - - } - - public init(amountPaid: Double, cashbackApplied: Double, codCharges: Double, couponEffectiveDiscount: Double, deliveryCharges: Double, discount: Double, employeeDiscount: Double?, extraMeta: [String: Any]?, files: [OpenApiFiles]?, loyaltyDiscount: Double?, meta: CartItemMeta?, paymentMethods: [MultiTenderPaymentMethod], priceEffective: Double, priceMarked: Double, productId: Int, quantity: Int?, size: String) { - - self.couponEffectiveDiscount = couponEffectiveDiscount - - self.codCharges = codCharges - - self.priceMarked = priceMarked - - self.files = files - - self.productId = productId - - self.quantity = quantity - - self.cashbackApplied = cashbackApplied - - self.meta = meta - - self.priceEffective = priceEffective - - self.discount = discount - - self.deliveryCharges = deliveryCharges - - self.loyaltyDiscount = loyaltyDiscount - - self.amountPaid = amountPaid - - self.extraMeta = extraMeta - - self.paymentMethods = paymentMethods - - self.size = size - - self.employeeDiscount = employeeDiscount - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - couponEffectiveDiscount = try container.decode(Double.self, forKey: .couponEffectiveDiscount) - - - - - codCharges = try container.decode(Double.self, forKey: .codCharges) - - - - - priceMarked = try container.decode(Double.self, forKey: .priceMarked) - - - - - do { - files = try container.decode([OpenApiFiles].self, forKey: .files) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - productId = try container.decode(Int.self, forKey: .productId) - - - - - do { - quantity = try container.decode(Int.self, forKey: .quantity) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - cashbackApplied = try container.decode(Double.self, forKey: .cashbackApplied) - - - - - do { - meta = try container.decode(CartItemMeta.self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - priceEffective = try container.decode(Double.self, forKey: .priceEffective) - - - - - discount = try container.decode(Double.self, forKey: .discount) - - - - - deliveryCharges = try container.decode(Double.self, forKey: .deliveryCharges) - - - - - do { - loyaltyDiscount = try container.decode(Double.self, forKey: .loyaltyDiscount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - amountPaid = try container.decode(Double.self, forKey: .amountPaid) - - - - - do { - extraMeta = try container.decode([String: Any].self, forKey: .extraMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - paymentMethods = try container.decode([MultiTenderPaymentMethod].self, forKey: .paymentMethods) - - - - - size = try container.decode(String.self, forKey: .size) - - - - - do { - employeeDiscount = try container.decode(Double.self, forKey: .employeeDiscount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(couponEffectiveDiscount, forKey: .couponEffectiveDiscount) - - - - try? container.encodeIfPresent(codCharges, forKey: .codCharges) - - - - try? container.encodeIfPresent(priceMarked, forKey: .priceMarked) - - - - try? container.encodeIfPresent(files, forKey: .files) - - - - try? container.encodeIfPresent(productId, forKey: .productId) - - - - try? container.encodeIfPresent(quantity, forKey: .quantity) - - - - try? container.encodeIfPresent(cashbackApplied, forKey: .cashbackApplied) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - - try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) - - - - try? container.encodeIfPresent(discount, forKey: .discount) - - - - try? container.encodeIfPresent(deliveryCharges, forKey: .deliveryCharges) - - - - try? container.encodeIfPresent(loyaltyDiscount, forKey: .loyaltyDiscount) - - - - try? container.encodeIfPresent(amountPaid, forKey: .amountPaid) - - - - try? container.encodeIfPresent(extraMeta, forKey: .extraMeta) - - - - try? container.encodeIfPresent(paymentMethods, forKey: .paymentMethods) - - - - try? container.encodeIfPresent(size, forKey: .size) - - - - try? container.encodeIfPresent(employeeDiscount, forKey: .employeeDiscount) - - - } - - } - - /* - Model: OpenApiPlatformCheckoutReq - Used By: Cart - */ - - class OpenApiPlatformCheckoutReq: Codable { - - - public var codCharges: Double - - public var files: [OpenApiFiles]? - - public var cashbackApplied: Double - - public var shippingAddress: ShippingAddress? - - public var couponCode: String - - public var employeeDiscount: [String: Any]? - - public var couponValue: Double - - public var cartItems: [OpenApiOrderItem] - - public var loyaltyDiscount: Double? - - public var deliveryCharges: Double - - public var paymentMethods: [MultiTenderPaymentMethod] - - public var coupon: String? - - public var currencyCode: String? - - public var paymentMode: String? - - public var affiliateOrderId: String? - - public var billingAddress: ShippingAddress - - public var orderId: String? - - public var cartValue: Double - - - public enum CodingKeys: String, CodingKey { - - case codCharges = "cod_charges" - - case files = "files" - - case cashbackApplied = "cashback_applied" - - case shippingAddress = "shipping_address" - - case couponCode = "coupon_code" - - case employeeDiscount = "employee_discount" - - case couponValue = "coupon_value" - - case cartItems = "cart_items" - - case loyaltyDiscount = "loyalty_discount" - - case deliveryCharges = "delivery_charges" - - case paymentMethods = "payment_methods" - - case coupon = "coupon" - - case currencyCode = "currency_code" - - case paymentMode = "payment_mode" - - case affiliateOrderId = "affiliate_order_id" - - case billingAddress = "billing_address" - - case orderId = "order_id" - - case cartValue = "cart_value" - - } - - public init(affiliateOrderId: String?, billingAddress: ShippingAddress, cartItems: [OpenApiOrderItem], cartValue: Double, cashbackApplied: Double, codCharges: Double, coupon: String?, couponCode: String, couponValue: Double, currencyCode: String?, deliveryCharges: Double, employeeDiscount: [String: Any]?, files: [OpenApiFiles]?, loyaltyDiscount: Double?, orderId: String?, paymentMethods: [MultiTenderPaymentMethod], paymentMode: String?, shippingAddress: ShippingAddress?) { - - self.codCharges = codCharges - - self.files = files - - self.cashbackApplied = cashbackApplied - - self.shippingAddress = shippingAddress - - self.couponCode = couponCode - - self.employeeDiscount = employeeDiscount - - self.couponValue = couponValue - - self.cartItems = cartItems - - self.loyaltyDiscount = loyaltyDiscount - - self.deliveryCharges = deliveryCharges - - self.paymentMethods = paymentMethods - - self.coupon = coupon - - self.currencyCode = currencyCode - - self.paymentMode = paymentMode - - self.affiliateOrderId = affiliateOrderId - - self.billingAddress = billingAddress - - self.orderId = orderId - - self.cartValue = cartValue - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - codCharges = try container.decode(Double.self, forKey: .codCharges) - - - - - do { - files = try container.decode([OpenApiFiles].self, forKey: .files) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - cashbackApplied = try container.decode(Double.self, forKey: .cashbackApplied) - - - - - do { - shippingAddress = try container.decode(ShippingAddress.self, forKey: .shippingAddress) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - couponCode = try container.decode(String.self, forKey: .couponCode) - - - - - do { - employeeDiscount = try container.decode([String: Any].self, forKey: .employeeDiscount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - couponValue = try container.decode(Double.self, forKey: .couponValue) - - - - - cartItems = try container.decode([OpenApiOrderItem].self, forKey: .cartItems) - - - - - do { - loyaltyDiscount = try container.decode(Double.self, forKey: .loyaltyDiscount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - deliveryCharges = try container.decode(Double.self, forKey: .deliveryCharges) - - - - - paymentMethods = try container.decode([MultiTenderPaymentMethod].self, forKey: .paymentMethods) - - - - - do { - coupon = try container.decode(String.self, forKey: .coupon) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - currencyCode = try container.decode(String.self, forKey: .currencyCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - paymentMode = try container.decode(String.self, forKey: .paymentMode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - affiliateOrderId = try container.decode(String.self, forKey: .affiliateOrderId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - billingAddress = try container.decode(ShippingAddress.self, forKey: .billingAddress) - - - - - do { - orderId = try container.decode(String.self, forKey: .orderId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - cartValue = try container.decode(Double.self, forKey: .cartValue) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(codCharges, forKey: .codCharges) - - - - try? container.encodeIfPresent(files, forKey: .files) - - - - try? container.encodeIfPresent(cashbackApplied, forKey: .cashbackApplied) - - - - try? container.encodeIfPresent(shippingAddress, forKey: .shippingAddress) - - - - try? container.encodeIfPresent(couponCode, forKey: .couponCode) - - - - try? container.encodeIfPresent(employeeDiscount, forKey: .employeeDiscount) - - - - try? container.encodeIfPresent(couponValue, forKey: .couponValue) - - - - try? container.encodeIfPresent(cartItems, forKey: .cartItems) - - - - try? container.encodeIfPresent(loyaltyDiscount, forKey: .loyaltyDiscount) - - - - try? container.encodeIfPresent(deliveryCharges, forKey: .deliveryCharges) - - - - try? container.encodeIfPresent(paymentMethods, forKey: .paymentMethods) - - - - try? container.encodeIfPresent(coupon, forKey: .coupon) - - - - try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) - - - - try? container.encodeIfPresent(paymentMode, forKey: .paymentMode) - - - - try? container.encodeIfPresent(affiliateOrderId, forKey: .affiliateOrderId) - - - - try? container.encodeIfPresent(billingAddress, forKey: .billingAddress) - - - - try? container.encodeIfPresent(orderId, forKey: .orderId) - - - - try? container.encodeIfPresent(cartValue, forKey: .cartValue) - - - } - - } - - /* - Model: OpenApiCheckoutResponse - Used By: Cart - */ - - class OpenApiCheckoutResponse: Codable { - - - public var message: String? - - public var success: Bool? - - public var orderId: String - - public var orderRefId: String? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - case success = "success" - - case orderId = "order_id" - - case orderRefId = "order_ref_id" - - } - - public init(message: String?, orderId: String, orderRefId: String?, success: Bool?) { - - self.message = message - - self.success = success - - self.orderId = orderId - - self.orderRefId = orderRefId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - success = try container.decode(Bool.self, forKey: .success) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - orderId = try container.decode(String.self, forKey: .orderId) - - - - - do { - orderRefId = try container.decode(String.self, forKey: .orderRefId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(success, forKey: .success) - - - - try? container.encodeIfPresent(orderId, forKey: .orderId) - - - - try? container.encodeIfPresent(orderRefId, forKey: .orderRefId) - - - } - - } - - - - /* - Model: AppUser - Used By: Rewards - */ - - class AppUser: Codable { - - - public var id: String? - - public var active: Bool? - - public var applicationId: String? - - public var blockReason: String? - - public var updatedAt: String? - - public var updatedBy: String? - - public var userId: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case active = "active" - - case applicationId = "application_id" - - case blockReason = "block_reason" - - case updatedAt = "updated_at" - - case updatedBy = "updated_by" - - case userId = "user_id" - - } - - public init(active: Bool?, applicationId: String?, blockReason: String?, updatedAt: String?, updatedBy: String?, userId: String?, id: String?) { - - self.id = id - - self.active = active - - self.applicationId = applicationId - - self.blockReason = blockReason - - self.updatedAt = updatedAt - - self.updatedBy = updatedBy - - self.userId = userId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - applicationId = try container.decode(String.self, forKey: .applicationId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - blockReason = try container.decode(String.self, forKey: .blockReason) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedBy = try container.decode(String.self, forKey: .updatedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(applicationId, forKey: .applicationId) - - - - try? container.encodeIfPresent(blockReason, forKey: .blockReason) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(updatedBy, forKey: .updatedBy) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - } - - } - - /* - Model: E - Used By: Rewards - */ - - class E: Codable { - - - public var code: [String: Any]? - - public var exception: String? - - public var info: String? - - public var message: String? - - public var requestId: String? - - public var stackTrace: String? - - public var status: Int? - - - public enum CodingKeys: String, CodingKey { - - case code = "code" - - case exception = "exception" - - case info = "info" - - case message = "message" - - case requestId = "request_id" - - case stackTrace = "stack_trace" - - case status = "status" - - } - - public init(code: [String: Any]?, exception: String?, info: String?, message: String?, requestId: String?, stackTrace: String?, status: Int?) { - - self.code = code - - self.exception = exception - - self.info = info - - self.message = message - - self.requestId = requestId - - self.stackTrace = stackTrace - - self.status = status - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - code = try container.decode([String: Any].self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - exception = try container.decode(String.self, forKey: .exception) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - info = try container.decode(String.self, forKey: .info) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - requestId = try container.decode(String.self, forKey: .requestId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - stackTrace = try container.decode(String.self, forKey: .stackTrace) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(Int.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(exception, forKey: .exception) - - - - try? container.encodeIfPresent(info, forKey: .info) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(requestId, forKey: .requestId) - - - - try? container.encodeIfPresent(stackTrace, forKey: .stackTrace) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - } - - } - - /* - Model: Giveaway - Used By: Rewards - */ - - class Giveaway: Codable { - - - public var id: String? - - public var schedule: Schedule? - - public var active: Bool? - - public var applicationId: String? - - public var audience: RewardsAudience? - - public var bannerImage: Asset? - - public var createdAt: String? - - public var description: String? - - public var name: String? - - public var rule: RewardsRule? - - public var title: String? - - public var updatedAt: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case schedule = "_schedule" - - case active = "active" - - case applicationId = "application_id" - - case audience = "audience" - - case bannerImage = "banner_image" - - case createdAt = "created_at" - - case description = "description" - - case name = "name" - - case rule = "rule" - - case title = "title" - - case updatedAt = "updated_at" - - } - - public init(active: Bool?, applicationId: String?, audience: RewardsAudience?, bannerImage: Asset?, createdAt: String?, description: String?, name: String?, rule: RewardsRule?, title: String?, updatedAt: String?, id: String?, schedule: Schedule?) { - - self.id = id - - self.schedule = schedule - - self.active = active - - self.applicationId = applicationId - - self.audience = audience - - self.bannerImage = bannerImage - - self.createdAt = createdAt - - self.description = description - - self.name = name - - self.rule = rule - - self.title = title - - self.updatedAt = updatedAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - schedule = try container.decode(Schedule.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - applicationId = try container.decode(String.self, forKey: .applicationId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - audience = try container.decode(RewardsAudience.self, forKey: .audience) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bannerImage = try container.decode(Asset.self, forKey: .bannerImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rule = try container.decode(RewardsRule.self, forKey: .rule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(applicationId, forKey: .applicationId) - - - - try? container.encodeIfPresent(audience, forKey: .audience) - - - - try? container.encodeIfPresent(bannerImage, forKey: .bannerImage) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(rule, forKey: .rule) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - } - - } - - /* - Model: GiveawayResponse - Used By: Rewards - */ - - class GiveawayResponse: Codable { - - - public var items: [Giveaway]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [Giveaway]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([Giveaway].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: HistoryPretty - Used By: Rewards - */ - - class HistoryPretty: Codable { - - - public var id: String? - - public var applicationId: String? - - public var claimed: Bool? - - public var createdAt: String? - - public var expiresOn: String? - - public var points: Double? - - public var remainingPoints: Double? - - public var text1: String? - - public var text2: String? - - public var text3: String? - - public var txnName: String? - - public var updatedAt: String? - - public var userId: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case applicationId = "application_id" - - case claimed = "claimed" - - case createdAt = "created_at" - - case expiresOn = "expires_on" - - case points = "points" - - case remainingPoints = "remaining_points" - - case text1 = "text_1" - - case text2 = "text_2" - - case text3 = "text_3" - - case txnName = "txn_name" - - case updatedAt = "updated_at" - - case userId = "user_id" - - } - - public init(applicationId: String?, claimed: Bool?, createdAt: String?, expiresOn: String?, points: Double?, remainingPoints: Double?, text1: String?, text2: String?, text3: String?, txnName: String?, updatedAt: String?, userId: String?, id: String?) { - - self.id = id - - self.applicationId = applicationId - - self.claimed = claimed - - self.createdAt = createdAt - - self.expiresOn = expiresOn - - self.points = points - - self.remainingPoints = remainingPoints - - self.text1 = text1 - - self.text2 = text2 - - self.text3 = text3 - - self.txnName = txnName - - self.updatedAt = updatedAt - - self.userId = userId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - applicationId = try container.decode(String.self, forKey: .applicationId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - claimed = try container.decode(Bool.self, forKey: .claimed) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - expiresOn = try container.decode(String.self, forKey: .expiresOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - points = try container.decode(Double.self, forKey: .points) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - remainingPoints = try container.decode(Double.self, forKey: .remainingPoints) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text1 = try container.decode(String.self, forKey: .text1) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text2 = try container.decode(String.self, forKey: .text2) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text3 = try container.decode(String.self, forKey: .text3) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - txnName = try container.decode(String.self, forKey: .txnName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(applicationId, forKey: .applicationId) - - - - try? container.encodeIfPresent(claimed, forKey: .claimed) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(expiresOn, forKey: .expiresOn) - - - - try? container.encodeIfPresent(points, forKey: .points) - - - - try? container.encodeIfPresent(remainingPoints, forKey: .remainingPoints) - - - - try? container.encodeIfPresent(text1, forKey: .text1) - - - - try? container.encodeIfPresent(text2, forKey: .text2) - - - - try? container.encodeIfPresent(text3, forKey: .text3) - - - - try? container.encodeIfPresent(txnName, forKey: .txnName) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - } - - } - - /* - Model: HistoryRes - Used By: Rewards - */ - - class HistoryRes: Codable { - - - public var items: [HistoryPretty]? - - public var page: Page? - - public var points: Double? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - case points = "points" - - } - - public init(items: [HistoryPretty]?, page: Page?, points: Double?) { - - self.items = items - - self.page = page - - self.points = points - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([HistoryPretty].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - points = try container.decode(Double.self, forKey: .points) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - - try? container.encodeIfPresent(points, forKey: .points) - - - } - - } - - /* - Model: Offer - Used By: Rewards - */ - - class Offer: Codable { - - - public var schedule: Schedule? - - public var active: Bool? - - public var applicationId: String? - - public var bannerImage: Asset? - - public var createdAt: String? - - public var name: String? - - public var rule: [String: Any]? - - public var share: ShareMessages? - - public var subText: String? - - public var text: String? - - public var type: String? - - public var updatedAt: String? - - public var updatedBy: String? - - public var url: String? - - - public enum CodingKeys: String, CodingKey { - - case schedule = "_schedule" - - case active = "active" - - case applicationId = "application_id" - - case bannerImage = "banner_image" - - case createdAt = "created_at" - - case name = "name" - - case rule = "rule" - - case share = "share" - - case subText = "sub_text" - - case text = "text" - - case type = "type" - - case updatedAt = "updated_at" - - case updatedBy = "updated_by" - - case url = "url" - - } - - public init(active: Bool?, applicationId: String?, bannerImage: Asset?, createdAt: String?, name: String?, rule: [String: Any]?, share: ShareMessages?, subText: String?, text: String?, type: String?, updatedAt: String?, updatedBy: String?, url: String?, schedule: Schedule?) { - - self.schedule = schedule - - self.active = active - - self.applicationId = applicationId - - self.bannerImage = bannerImage - - self.createdAt = createdAt - - self.name = name - - self.rule = rule - - self.share = share - - self.subText = subText - - self.text = text - - self.type = type - - self.updatedAt = updatedAt - - self.updatedBy = updatedBy - - self.url = url - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - schedule = try container.decode(Schedule.self, forKey: .schedule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - applicationId = try container.decode(String.self, forKey: .applicationId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - bannerImage = try container.decode(Asset.self, forKey: .bannerImage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - rule = try container.decode([String: Any].self, forKey: .rule) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - share = try container.decode(ShareMessages.self, forKey: .share) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subText = try container.decode(String.self, forKey: .subText) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text = try container.decode(String.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedBy = try container.decode(String.self, forKey: .updatedBy) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(schedule, forKey: .schedule) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(applicationId, forKey: .applicationId) - - - - try? container.encodeIfPresent(bannerImage, forKey: .bannerImage) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(rule, forKey: .rule) - - - - try? container.encodeIfPresent(share, forKey: .share) - - - - try? container.encodeIfPresent(subText, forKey: .subText) - - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(updatedBy, forKey: .updatedBy) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - } - - } - - /* - Model: Points - Used By: Rewards - */ - - class Points: Codable { - - - public var available: Double? - - - public enum CodingKeys: String, CodingKey { - - case available = "available" - - } - - public init(available: Double?) { - - self.available = available - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - available = try container.decode(Double.self, forKey: .available) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(available, forKey: .available) - - - } - - } - - /* - Model: Referral - Used By: Rewards - */ - - class Referral: Codable { - - - public var code: String? - - - public enum CodingKeys: String, CodingKey { - - case code = "code" - - } - - public init(code: String?) { - - self.code = code - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(code, forKey: .code) - - - } - - } - - /* - Model: RewardUser - Used By: Rewards - */ - - class RewardUser: Codable { - - - public var id: String? - - public var active: Bool? - - public var createdAt: String? - - public var referral: Referral? - - public var uid: Int? - - public var updatedAt: String? - - public var userBlockReason: String? - - public var userId: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case active = "active" - - case createdAt = "created_at" - - case referral = "referral" - - case uid = "uid" - - case updatedAt = "updated_at" - - case userBlockReason = "user_block_reason" - - case userId = "user_id" - - } - - public init(active: Bool?, createdAt: String?, referral: Referral?, uid: Int?, updatedAt: String?, userBlockReason: String?, userId: String?, id: String?) { - - self.id = id - - self.active = active - - self.createdAt = createdAt - - self.referral = referral - - self.uid = uid - - self.updatedAt = updatedAt - - self.userBlockReason = userBlockReason - - self.userId = userId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - active = try container.decode(Bool.self, forKey: .active) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - referral = try container.decode(Referral.self, forKey: .referral) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - uid = try container.decode(Int.self, forKey: .uid) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedAt = try container.decode(String.self, forKey: .updatedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userBlockReason = try container.decode(String.self, forKey: .userBlockReason) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(active, forKey: .active) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(referral, forKey: .referral) - - - - try? container.encodeIfPresent(uid, forKey: .uid) - - - - try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) - - - - try? container.encodeIfPresent(userBlockReason, forKey: .userBlockReason) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - } - - } - - /* - Model: RewardsAudience - Used By: Rewards - */ - - class RewardsAudience: Codable { - - - public var headerUserId: String? - - public var id: String? - - - public enum CodingKeys: String, CodingKey { - - case headerUserId = "header_user_id" - - case id = "id" - - } - - public init(headerUserId: String?, id: String?) { - - self.headerUserId = headerUserId - - self.id = id - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - headerUserId = try container.decode(String.self, forKey: .headerUserId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(headerUserId, forKey: .headerUserId) - - - - try? container.encodeIfPresent(id, forKey: .id) - - - } - - } - - /* - Model: RewardsRule - Used By: Rewards - */ - - class RewardsRule: Codable { - - - public var amount: Double? - - - public enum CodingKeys: String, CodingKey { - - case amount = "amount" - - } - - public init(amount: Double?) { - - self.amount = amount - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - amount = try container.decode(Double.self, forKey: .amount) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(amount, forKey: .amount) - - - } - - } - - /* - Model: ShareMessages - Used By: Rewards - */ - - class ShareMessages: Codable { - - - public var email: String? - - public var facebook: String? - - public var fallback: String? - - public var message: String? - - public var messenger: String? - - public var sms: String? - - public var text: String? - - public var twitter: String? - - public var whatsapp: String? - - - public enum CodingKeys: String, CodingKey { - - case email = "email" - - case facebook = "facebook" - - case fallback = "fallback" - - case message = "message" - - case messenger = "messenger" - - case sms = "sms" - - case text = "text" - - case twitter = "twitter" - - case whatsapp = "whatsapp" - - } - - public init(email: String?, facebook: String?, fallback: String?, message: String?, messenger: String?, sms: String?, text: String?, twitter: String?, whatsapp: String?) { - - self.email = email - - self.facebook = facebook - - self.fallback = fallback - - self.message = message - - self.messenger = messenger - - self.sms = sms - - self.text = text - - self.twitter = twitter - - self.whatsapp = whatsapp - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - email = try container.decode(String.self, forKey: .email) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - facebook = try container.decode(String.self, forKey: .facebook) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - fallback = try container.decode(String.self, forKey: .fallback) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - messenger = try container.decode(String.self, forKey: .messenger) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sms = try container.decode(String.self, forKey: .sms) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - text = try container.decode(String.self, forKey: .text) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - twitter = try container.decode(String.self, forKey: .twitter) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - whatsapp = try container.decode(String.self, forKey: .whatsapp) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(email, forKey: .email) - - - - try? container.encodeIfPresent(facebook, forKey: .facebook) - - - - try? container.encodeIfPresent(fallback, forKey: .fallback) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(messenger, forKey: .messenger) - - - - try? container.encodeIfPresent(sms, forKey: .sms) - - - - try? container.encodeIfPresent(text, forKey: .text) - - - - try? container.encodeIfPresent(twitter, forKey: .twitter) - - - - try? container.encodeIfPresent(whatsapp, forKey: .whatsapp) - - - } - - } - - /* - Model: UserRes - Used By: Rewards - */ - - class UserRes: Codable { - - - public var points: Points? - - public var user: RewardUser? - - - public enum CodingKeys: String, CodingKey { - - case points = "points" - - case user = "user" - - } - - public init(points: Points?, user: RewardUser?) { - - self.points = points - - self.user = user - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - points = try container.decode(Points.self, forKey: .points) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - user = try container.decode(RewardUser.self, forKey: .user) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(points, forKey: .points) - - - - try? container.encodeIfPresent(user, forKey: .user) - - - } - - } - - - - /* - Model: StatGroup - Used By: Analytics - */ - - class StatGroup: Codable { - - - public var key: String? - - public var url: String? - - public var title: String? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case url = "url" - - case title = "title" - - } - - public init(key: String?, title: String?, url: String?) { - - self.key = key - - self.url = url - - self.title = title - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - } - - } - - /* - Model: StatsGroups - Used By: Analytics - */ - - class StatsGroups: Codable { - - - public var groups: [StatGroup]? - - - public enum CodingKeys: String, CodingKey { - - case groups = "groups" - - } - - public init(groups: [StatGroup]?) { - - self.groups = groups - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - groups = try container.decode([StatGroup].self, forKey: .groups) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(groups, forKey: .groups) - - - } - - } - - /* - Model: StatsGroupComponent - Used By: Analytics - */ - - class StatsGroupComponent: Codable { - - - public var key: String? - - public var url: String? - - public var title: String? - - public var type: String? - - public var filters: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case url = "url" - - case title = "title" - - case type = "type" - - case filters = "filters" - - } - - public init(filters: [String: Any]?, key: String?, title: String?, type: String?, url: String?) { - - self.key = key - - self.url = url - - self.title = title - - self.type = type - - self.filters = filters - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - url = try container.decode(String.self, forKey: .url) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - filters = try container.decode([String: Any].self, forKey: .filters) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(url, forKey: .url) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(filters, forKey: .filters) - - - } - - } - - /* - Model: StatsGroupComponents - Used By: Analytics - */ - - class StatsGroupComponents: Codable { - - - public var title: String? - - public var components: [StatsGroupComponent]? - - - public enum CodingKeys: String, CodingKey { - - case title = "title" - - case components = "components" - - } - - public init(components: [StatsGroupComponent]?, title: String?) { - - self.title = title - - self.components = components - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - components = try container.decode([StatsGroupComponent].self, forKey: .components) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(components, forKey: .components) - - - } - - } - - /* - Model: StatsRes - Used By: Analytics - */ - - class StatsRes: Codable { - - - public var key: String? - - public var title: String? - - public var type: String? - - public var data: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case key = "key" - - case title = "title" - - case type = "type" - - case data = "data" - - } - - public init(data: [String: Any]?, key: String?, title: String?, type: String?) { - - self.key = key - - self.title = title - - self.type = type - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - key = try container.decode(String.self, forKey: .key) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - title = try container.decode(String.self, forKey: .title) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode([String: Any].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(key, forKey: .key) - - - - try? container.encodeIfPresent(title, forKey: .title) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - /* - Model: ReceivedAt - Used By: Analytics - */ - - class ReceivedAt: Codable { - - - public var value: String? - - - public enum CodingKeys: String, CodingKey { - - case value = "value" - - } - - public init(value: String?) { - - self.value = value - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - value = try container.decode(String.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(value, forKey: .value) - - - } - - } - - /* - Model: AbandonCartsDetail - Used By: Analytics - */ - - class AbandonCartsDetail: Codable { - - - public var propertiesCartId: String? - - public var contextTraitsFirstName: String? - - public var contextTraitsLastName: String? - - public var contextTraitsPhoneNumber: String? - - public var contextTraitsEmail: String? - - public var contextAppApplicationId: String? - - public var propertiesBreakupValuesRawTotal: String? - - public var receivedAt: ReceivedAt? - - - public enum CodingKeys: String, CodingKey { - - case propertiesCartId = "properties_cart_id" - - case contextTraitsFirstName = "context_traits_first_name" - - case contextTraitsLastName = "context_traits_last_name" - - case contextTraitsPhoneNumber = "context_traits_phone_number" - - case contextTraitsEmail = "context_traits_email" - - case contextAppApplicationId = "context_app_application_id" - - case propertiesBreakupValuesRawTotal = "properties_breakup_values_raw_total" - - case receivedAt = "received_at" - - } - - public init(contextAppApplicationId: String?, contextTraitsEmail: String?, contextTraitsFirstName: String?, contextTraitsLastName: String?, contextTraitsPhoneNumber: String?, propertiesBreakupValuesRawTotal: String?, propertiesCartId: String?, receivedAt: ReceivedAt?) { - - self.propertiesCartId = propertiesCartId - - self.contextTraitsFirstName = contextTraitsFirstName - - self.contextTraitsLastName = contextTraitsLastName - - self.contextTraitsPhoneNumber = contextTraitsPhoneNumber - - self.contextTraitsEmail = contextTraitsEmail - - self.contextAppApplicationId = contextAppApplicationId - - self.propertiesBreakupValuesRawTotal = propertiesBreakupValuesRawTotal - - self.receivedAt = receivedAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - propertiesCartId = try container.decode(String.self, forKey: .propertiesCartId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contextTraitsFirstName = try container.decode(String.self, forKey: .contextTraitsFirstName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contextTraitsLastName = try container.decode(String.self, forKey: .contextTraitsLastName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contextTraitsPhoneNumber = try container.decode(String.self, forKey: .contextTraitsPhoneNumber) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contextTraitsEmail = try container.decode(String.self, forKey: .contextTraitsEmail) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - contextAppApplicationId = try container.decode(String.self, forKey: .contextAppApplicationId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - propertiesBreakupValuesRawTotal = try container.decode(String.self, forKey: .propertiesBreakupValuesRawTotal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - receivedAt = try container.decode(ReceivedAt.self, forKey: .receivedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(propertiesCartId, forKey: .propertiesCartId) - - - - try? container.encodeIfPresent(contextTraitsFirstName, forKey: .contextTraitsFirstName) - - - - try? container.encodeIfPresent(contextTraitsLastName, forKey: .contextTraitsLastName) - - - - try? container.encodeIfPresent(contextTraitsPhoneNumber, forKey: .contextTraitsPhoneNumber) - - - - try? container.encodeIfPresent(contextTraitsEmail, forKey: .contextTraitsEmail) - - - - try? container.encodeIfPresent(contextAppApplicationId, forKey: .contextAppApplicationId) - - - - try? container.encodeIfPresent(propertiesBreakupValuesRawTotal, forKey: .propertiesBreakupValuesRawTotal) - - - - try? container.encodeIfPresent(receivedAt, forKey: .receivedAt) - - - } - - } - - /* - Model: AbandonCartsList - Used By: Analytics - */ - - class AbandonCartsList: Codable { - - - public var items: [AbandonCartsDetail]? - - public var cartTotal: String? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case cartTotal = "cart_total" - - case page = "page" - - } - - public init(cartTotal: String?, items: [AbandonCartsDetail]?, page: Page?) { - - self.items = items - - self.cartTotal = cartTotal - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([AbandonCartsDetail].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cartTotal = try container.decode(String.self, forKey: .cartTotal) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(cartTotal, forKey: .cartTotal) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: AbandonCartDetail - Used By: Analytics - */ - - class AbandonCartDetail: Codable { - - - public var id: String? - - public var userId: String? - - public var cartValue: String? - - public var articles: [[String: Any]]? - - public var breakup: [String: Any]? - - public var address: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case userId = "user_id" - - case cartValue = "cart_value" - - case articles = "articles" - - case breakup = "breakup" - - case address = "address" - - } - - public init(address: [String: Any]?, articles: [[String: Any]]?, breakup: [String: Any]?, cartValue: String?, userId: String?, id: String?) { - - self.id = id - - self.userId = userId - - self.cartValue = cartValue - - self.articles = articles - - self.breakup = breakup - - self.address = address - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - userId = try container.decode(String.self, forKey: .userId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - cartValue = try container.decode(String.self, forKey: .cartValue) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - articles = try container.decode([[String: Any]].self, forKey: .articles) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - breakup = try container.decode([String: Any].self, forKey: .breakup) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - address = try container.decode([String: Any].self, forKey: .address) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - - try? container.encodeIfPresent(cartValue, forKey: .cartValue) - - - - try? container.encodeIfPresent(articles, forKey: .articles) - - - - try? container.encodeIfPresent(breakup, forKey: .breakup) - - - - try? container.encodeIfPresent(address, forKey: .address) - - - } - - } - - /* - Model: ExportJobReq - Used By: Analytics - */ - - class ExportJobReq: Codable { - - - public var marketplaceName: String? - - public var startTime: String? - - public var endTime: String? - - public var eventType: String? - - public var traceId: String? - - - public enum CodingKeys: String, CodingKey { - - case marketplaceName = "marketplace_name" - - case startTime = "start_time" - - case endTime = "end_time" - - case eventType = "event_type" - - case traceId = "trace_id" - - } - - public init(endTime: String?, eventType: String?, marketplaceName: String?, startTime: String?, traceId: String?) { - - self.marketplaceName = marketplaceName - - self.startTime = startTime - - self.endTime = endTime - - self.eventType = eventType - - self.traceId = traceId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - marketplaceName = try container.decode(String.self, forKey: .marketplaceName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - startTime = try container.decode(String.self, forKey: .startTime) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - endTime = try container.decode(String.self, forKey: .endTime) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - eventType = try container.decode(String.self, forKey: .eventType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - traceId = try container.decode(String.self, forKey: .traceId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(marketplaceName, forKey: .marketplaceName) - - - - try? container.encodeIfPresent(startTime, forKey: .startTime) - - - - try? container.encodeIfPresent(endTime, forKey: .endTime) - - - - try? container.encodeIfPresent(eventType, forKey: .eventType) - - - - try? container.encodeIfPresent(traceId, forKey: .traceId) - - - } - - } - - /* - Model: ExportJobRes - Used By: Analytics - */ - - class ExportJobRes: Codable { - - - public var status: String? - - public var jobId: String? - - - public enum CodingKeys: String, CodingKey { - - case status = "status" - - case jobId = "job_id" - - } - - public init(jobId: String?, status: String?) { - - self.status = status - - self.jobId = jobId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - jobId = try container.decode(String.self, forKey: .jobId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(jobId, forKey: .jobId) - - - } - - } - - /* - Model: ExportJobStatusRes - Used By: Analytics - */ - - class ExportJobStatusRes: Codable { - - - public var status: String? - - public var jobId: String? - - public var downloadUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case status = "status" - - case jobId = "job_id" - - case downloadUrl = "download_url" - - } - - public init(downloadUrl: String?, jobId: String?, status: String?) { - - self.status = status - - self.jobId = jobId - - self.downloadUrl = downloadUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - jobId = try container.decode(String.self, forKey: .jobId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - downloadUrl = try container.decode(String.self, forKey: .downloadUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(jobId, forKey: .jobId) - - - - try? container.encodeIfPresent(downloadUrl, forKey: .downloadUrl) - - - } - - } - - /* - Model: GetLogsListReq - Used By: Analytics - */ - - class GetLogsListReq: Codable { - - - public var marketplaceName: String? - - public var startDate: String? - - public var companyId: String? - - public var endDate: String? - - - public enum CodingKeys: String, CodingKey { - - case marketplaceName = "marketplace_name" - - case startDate = "start_date" - - case companyId = "company_id" - - case endDate = "end_date" - - } - - public init(companyId: String?, endDate: String?, marketplaceName: String?, startDate: String?) { - - self.marketplaceName = marketplaceName - - self.startDate = startDate - - self.companyId = companyId - - self.endDate = endDate - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - marketplaceName = try container.decode(String.self, forKey: .marketplaceName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - startDate = try container.decode(String.self, forKey: .startDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(String.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - endDate = try container.decode(String.self, forKey: .endDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(marketplaceName, forKey: .marketplaceName) - - - - try? container.encodeIfPresent(startDate, forKey: .startDate) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(endDate, forKey: .endDate) - - - } - - } - - /* - Model: MkpLogsResp - Used By: Analytics - */ - - class MkpLogsResp: Codable { - - - public var startTimeIso: String? - - public var endTimeIso: String? - - public var eventType: String? - - public var traceId: String? - - public var count: String? - - public var status: String? - - - public enum CodingKeys: String, CodingKey { - - case startTimeIso = "start_time_iso" - - case endTimeIso = "end_time_iso" - - case eventType = "event_type" - - case traceId = "trace_id" - - case count = "count" - - case status = "status" - - } - - public init(count: String?, endTimeIso: String?, eventType: String?, startTimeIso: String?, status: String?, traceId: String?) { - - self.startTimeIso = startTimeIso - - self.endTimeIso = endTimeIso - - self.eventType = eventType - - self.traceId = traceId - - self.count = count - - self.status = status - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - startTimeIso = try container.decode(String.self, forKey: .startTimeIso) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - endTimeIso = try container.decode(String.self, forKey: .endTimeIso) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - eventType = try container.decode(String.self, forKey: .eventType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - traceId = try container.decode(String.self, forKey: .traceId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - count = try container.decode(String.self, forKey: .count) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(startTimeIso, forKey: .startTimeIso) - - - - try? container.encodeIfPresent(endTimeIso, forKey: .endTimeIso) - - - - try? container.encodeIfPresent(eventType, forKey: .eventType) - - - - try? container.encodeIfPresent(traceId, forKey: .traceId) - - - - try? container.encodeIfPresent(count, forKey: .count) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - } - - } - - /* - Model: GetLogsListRes - Used By: Analytics - */ - - class GetLogsListRes: Codable { - - - public var items: [MkpLogsResp]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [MkpLogsResp]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([MkpLogsResp].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: SearchLogReq - Used By: Analytics - */ - - class SearchLogReq: Codable { - - - public var marketplaceName: String? - - public var startDate: String? - - public var companyId: String? - - public var endDate: String? - - public var identifier: String? - - public var identifierValue: String? - - - public enum CodingKeys: String, CodingKey { - - case marketplaceName = "marketplace_name" - - case startDate = "start_date" - - case companyId = "company_id" - - case endDate = "end_date" - - case identifier = "identifier" - - case identifierValue = "identifier_value" - - } - - public init(companyId: String?, endDate: String?, identifier: String?, identifierValue: String?, marketplaceName: String?, startDate: String?) { - - self.marketplaceName = marketplaceName - - self.startDate = startDate - - self.companyId = companyId - - self.endDate = endDate - - self.identifier = identifier - - self.identifierValue = identifierValue - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - marketplaceName = try container.decode(String.self, forKey: .marketplaceName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - startDate = try container.decode(String.self, forKey: .startDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(String.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - endDate = try container.decode(String.self, forKey: .endDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - identifier = try container.decode(String.self, forKey: .identifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - identifierValue = try container.decode(String.self, forKey: .identifierValue) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(marketplaceName, forKey: .marketplaceName) - - - - try? container.encodeIfPresent(startDate, forKey: .startDate) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(endDate, forKey: .endDate) - - - - try? container.encodeIfPresent(identifier, forKey: .identifier) - - - - try? container.encodeIfPresent(identifierValue, forKey: .identifierValue) - - - } - - } - - /* - Model: LogInfo - Used By: Analytics - */ - - class LogInfo: Codable { - - - public var id: String? - - public var status: String? - - public var eventType: String? - - public var marketplaceName: String? - - public var event: String? - - public var traceId: String? - - public var companyId: Double? - - public var brandId: Double? - - public var storeCode: String? - - public var storeId: Double? - - public var itemId: Double? - - public var articleId: String? - - public var sellerIdentifier: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case status = "status" - - case eventType = "event_type" - - case marketplaceName = "marketplace_name" - - case event = "event" - - case traceId = "trace_id" - - case companyId = "company_id" - - case brandId = "brand_id" - - case storeCode = "store_code" - - case storeId = "store_id" - - case itemId = "item_id" - - case articleId = "article_id" - - case sellerIdentifier = "seller_identifier" - - } - - public init(articleId: String?, brandId: Double?, companyId: Double?, event: String?, eventType: String?, itemId: Double?, marketplaceName: String?, sellerIdentifier: String?, status: String?, storeCode: String?, storeId: Double?, traceId: String?, id: String?) { - - self.id = id - - self.status = status - - self.eventType = eventType - - self.marketplaceName = marketplaceName - - self.event = event - - self.traceId = traceId - - self.companyId = companyId - - self.brandId = brandId - - self.storeCode = storeCode - - self.storeId = storeId - - self.itemId = itemId - - self.articleId = articleId - - self.sellerIdentifier = sellerIdentifier - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(String.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - eventType = try container.decode(String.self, forKey: .eventType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - marketplaceName = try container.decode(String.self, forKey: .marketplaceName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - event = try container.decode(String.self, forKey: .event) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - traceId = try container.decode(String.self, forKey: .traceId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(Double.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandId = try container.decode(Double.self, forKey: .brandId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeCode = try container.decode(String.self, forKey: .storeCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeId = try container.decode(Double.self, forKey: .storeId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - itemId = try container.decode(Double.self, forKey: .itemId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - articleId = try container.decode(String.self, forKey: .articleId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - sellerIdentifier = try container.decode(String.self, forKey: .sellerIdentifier) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(eventType, forKey: .eventType) - - - - try? container.encodeIfPresent(marketplaceName, forKey: .marketplaceName) - - - - try? container.encodeIfPresent(event, forKey: .event) - - - - try? container.encodeIfPresent(traceId, forKey: .traceId) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(brandId, forKey: .brandId) - - - - try? container.encodeIfPresent(storeCode, forKey: .storeCode) - - - - try? container.encodeIfPresent(storeId, forKey: .storeId) - - - - try? container.encodeIfPresent(itemId, forKey: .itemId) - - - - try? container.encodeIfPresent(articleId, forKey: .articleId) - - - - try? container.encodeIfPresent(sellerIdentifier, forKey: .sellerIdentifier) - - - } - - } - - /* - Model: SearchLogRes - Used By: Analytics - */ - - class SearchLogRes: Codable { - - - public var items: [LogInfo]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [LogInfo]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([LogInfo].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - - - /* - Model: ValidityObject - Used By: Discount - */ - - class ValidityObject: Codable { - - - public var start: String - - public var end: String - - - public enum CodingKeys: String, CodingKey { - - case start = "start" - - case end = "end" - - } - - public init(end: String, start: String) { - - self.start = start - - self.end = end - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - start = try container.decode(String.self, forKey: .start) - - - - - end = try container.decode(String.self, forKey: .end) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(start, forKey: .start) - - - - try? container.encodeIfPresent(end, forKey: .end) - - - } - - } - - /* - Model: CreateUpdateDiscount - Used By: Discount - */ - - class CreateUpdateDiscount: Codable { - - - public var name: String - - public var companyId: Int - - public var isActive: Bool - - public var appIds: [String] - - public var jobType: String - - public var discountType: String - - public var discountLevel: String - - public var value: Int? - - public var filePath: String? - - public var brandIds: [Int]? - - public var storeIds: [Int]? - - public var validity: ValidityObject - - - public enum CodingKeys: String, CodingKey { - - case name = "name" - - case companyId = "company_id" - - case isActive = "is_active" - - case appIds = "app_ids" - - case jobType = "job_type" - - case discountType = "discount_type" - - case discountLevel = "discount_level" - - case value = "value" - - case filePath = "file_path" - - case brandIds = "brand_ids" - - case storeIds = "store_ids" - - case validity = "validity" - - } - - public init(appIds: [String], brandIds: [Int]?, companyId: Int, discountLevel: String, discountType: String, filePath: String?, isActive: Bool, jobType: String, name: String, storeIds: [Int]?, validity: ValidityObject, value: Int?) { - - self.name = name - - self.companyId = companyId - - self.isActive = isActive - - self.appIds = appIds - - self.jobType = jobType - - self.discountType = discountType - - self.discountLevel = discountLevel - - self.value = value - - self.filePath = filePath - - self.brandIds = brandIds - - self.storeIds = storeIds - - self.validity = validity - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - name = try container.decode(String.self, forKey: .name) - - - - - companyId = try container.decode(Int.self, forKey: .companyId) - - - - - isActive = try container.decode(Bool.self, forKey: .isActive) - - - - - appIds = try container.decode([String].self, forKey: .appIds) - - - - - jobType = try container.decode(String.self, forKey: .jobType) - - - - - discountType = try container.decode(String.self, forKey: .discountType) - - - - - discountLevel = try container.decode(String.self, forKey: .discountLevel) - - - - - do { - value = try container.decode(Int.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - filePath = try container.decode(String.self, forKey: .filePath) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandIds = try container.decode([Int].self, forKey: .brandIds) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeIds = try container.decode([Int].self, forKey: .storeIds) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - validity = try container.decode(ValidityObject.self, forKey: .validity) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(appIds, forKey: .appIds) - - - - try? container.encodeIfPresent(jobType, forKey: .jobType) - - - - try? container.encodeIfPresent(discountType, forKey: .discountType) - - - - try? container.encodeIfPresent(discountLevel, forKey: .discountLevel) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(filePath, forKey: .filePath) - - - - try? container.encodeIfPresent(brandIds, forKey: .brandIds) - - - - try? container.encodeIfPresent(storeIds, forKey: .storeIds) - - - - try? container.encodeIfPresent(validity, forKey: .validity) - - - } - - } - - /* - Model: DiscountJob - Used By: Discount - */ - - class DiscountJob: Codable { - - - public var id: String - - public var name: String - - public var companyId: Int - - public var isActive: Bool - - public var appIds: [String]? - - public var jobType: String? - - public var discountType: String? - - public var discountLevel: String? - - public var value: Int? - - public var filePath: String? - - public var brandIds: [Int]? - - public var storeIds: [Int]? - - public var validity: ValidityObject - - public var createdOn: String - - public var modifiedOn: String - - public var createdBy: UserDetails - - public var modifiedBy: UserDetails - - public var meta: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case name = "name" - - case companyId = "company_id" - - case isActive = "is_active" - - case appIds = "app_ids" - - case jobType = "job_type" - - case discountType = "discount_type" - - case discountLevel = "discount_level" - - case value = "value" - - case filePath = "file_path" - - case brandIds = "brand_ids" - - case storeIds = "store_ids" - - case validity = "validity" - - case createdOn = "created_on" - - case modifiedOn = "modified_on" - - case createdBy = "created_by" - - case modifiedBy = "modified_by" - - case meta = "meta" - - } - - public init(appIds: [String]?, brandIds: [Int]?, companyId: Int, createdBy: UserDetails, createdOn: String, discountLevel: String?, discountType: String?, filePath: String?, isActive: Bool, jobType: String?, meta: [String: Any]?, modifiedBy: UserDetails, modifiedOn: String, name: String, storeIds: [Int]?, validity: ValidityObject, value: Int?, id: String) { - - self.id = id - - self.name = name - - self.companyId = companyId - - self.isActive = isActive - - self.appIds = appIds - - self.jobType = jobType - - self.discountType = discountType - - self.discountLevel = discountLevel - - self.value = value - - self.filePath = filePath - - self.brandIds = brandIds - - self.storeIds = storeIds - - self.validity = validity - - self.createdOn = createdOn - - self.modifiedOn = modifiedOn - - self.createdBy = createdBy - - self.modifiedBy = modifiedBy - - self.meta = meta - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - id = try container.decode(String.self, forKey: .id) - - - - - name = try container.decode(String.self, forKey: .name) - - - - - companyId = try container.decode(Int.self, forKey: .companyId) - - - - - isActive = try container.decode(Bool.self, forKey: .isActive) - - - - - do { - appIds = try container.decode([String].self, forKey: .appIds) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - jobType = try container.decode(String.self, forKey: .jobType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discountType = try container.decode(String.self, forKey: .discountType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - discountLevel = try container.decode(String.self, forKey: .discountLevel) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - value = try container.decode(Int.self, forKey: .value) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - filePath = try container.decode(String.self, forKey: .filePath) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - brandIds = try container.decode([Int].self, forKey: .brandIds) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeIds = try container.decode([Int].self, forKey: .storeIds) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - validity = try container.decode(ValidityObject.self, forKey: .validity) - - - - - createdOn = try container.decode(String.self, forKey: .createdOn) - - - - - modifiedOn = try container.decode(String.self, forKey: .modifiedOn) - - - - - createdBy = try container.decode(UserDetails.self, forKey: .createdBy) - - - - - modifiedBy = try container.decode(UserDetails.self, forKey: .modifiedBy) - - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(isActive, forKey: .isActive) - - - - try? container.encodeIfPresent(appIds, forKey: .appIds) - - - - try? container.encodeIfPresent(jobType, forKey: .jobType) - - - - try? container.encodeIfPresent(discountType, forKey: .discountType) - - - - try? container.encodeIfPresent(discountLevel, forKey: .discountLevel) - - - - try? container.encodeIfPresent(value, forKey: .value) - - - - try? container.encodeIfPresent(filePath, forKey: .filePath) - - - - try? container.encodeIfPresent(brandIds, forKey: .brandIds) - - - - try? container.encodeIfPresent(storeIds, forKey: .storeIds) - - - - try? container.encodeIfPresent(validity, forKey: .validity) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) - - - - try? container.encodeIfPresent(createdBy, forKey: .createdBy) - - - - try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - } - - } - - /* - Model: ListOrCalender - Used By: Discount - */ - - class ListOrCalender: Codable { - - - public var items: [DiscountJob] - - public var page: Page - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [DiscountJob], page: Page) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - items = try container.decode([DiscountJob].self, forKey: .items) - - - - - page = try container.decode(Page.self, forKey: .page) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: FileJobResponse - Used By: Discount - */ - - class FileJobResponse: Codable { - - - public var stage: String - - public var total: Int - - public var failed: Int - - public var companyId: Int - - public var body: [String: Any]? - - public var type: String - - public var fileType: String - - - public enum CodingKeys: String, CodingKey { - - case stage = "stage" - - case total = "total" - - case failed = "failed" - - case companyId = "company_id" - - case body = "body" - - case type = "type" - - case fileType = "file_type" - - } - - public init(body: [String: Any]?, companyId: Int, failed: Int, fileType: String, stage: String, total: Int, type: String) { - - self.stage = stage - - self.total = total - - self.failed = failed - - self.companyId = companyId - - self.body = body - - self.type = type - - self.fileType = fileType - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - stage = try container.decode(String.self, forKey: .stage) - - - - - total = try container.decode(Int.self, forKey: .total) - - - - - failed = try container.decode(Int.self, forKey: .failed) - - - - - companyId = try container.decode(Int.self, forKey: .companyId) - - - - - do { - body = try container.decode([String: Any].self, forKey: .body) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - type = try container.decode(String.self, forKey: .type) - - - - - fileType = try container.decode(String.self, forKey: .fileType) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(stage, forKey: .stage) - - - - try? container.encodeIfPresent(total, forKey: .total) - - - - try? container.encodeIfPresent(failed, forKey: .failed) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(body, forKey: .body) - - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(fileType, forKey: .fileType) - - - } - - } - - /* - Model: DownloadFileJob - Used By: Discount - */ - - class DownloadFileJob: Codable { - - - public var brandIds: [Int]? - - public var storeIds: [Int]? - - - public enum CodingKeys: String, CodingKey { - - case brandIds = "brand_ids" - - case storeIds = "store_ids" - - } - - public init(brandIds: [Int]?, storeIds: [Int]?) { - - self.brandIds = brandIds - - self.storeIds = storeIds - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - brandIds = try container.decode([Int].self, forKey: .brandIds) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - storeIds = try container.decode([Int].self, forKey: .storeIds) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(brandIds, forKey: .brandIds) - - - - try? container.encodeIfPresent(storeIds, forKey: .storeIds) - - - } - - } - - /* - Model: CancelJobResponse - Used By: Discount - */ - - class CancelJobResponse: Codable { - - - public var success: Bool - - - public enum CodingKeys: String, CodingKey { - - case success = "success" - - } - - public init(success: Bool) { - - self.success = success - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - success = try container.decode(Bool.self, forKey: .success) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(success, forKey: .success) - - - } - - } - - /* - Model: UserDetails - Used By: Discount - */ - - class UserDetails: Codable { - - - public var username: String - - public var userId: String - - - public enum CodingKeys: String, CodingKey { - - case username = "username" - - case userId = "user_id" - - } - - public init(username: String, userId: String) { - - self.username = username - - self.userId = userId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - username = try container.decode(String.self, forKey: .username) - - - - - userId = try container.decode(String.self, forKey: .userId) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(username, forKey: .username) - - - - try? container.encodeIfPresent(userId, forKey: .userId) - - - } - - } - - /* - Model: BadRequestObject - Used By: Discount - */ - - class BadRequestObject: Codable { - - - public var message: String - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - } - - public init(message: String) { - - self.message = message - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - message = try container.decode(String.self, forKey: .message) - - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - } - - } - - - - /* - Model: AddProxyReq - Used By: Partner - */ - - class AddProxyReq: Codable { - - - public var attachedPath: String? - - public var proxyUrl: String? - - - public enum CodingKeys: String, CodingKey { - - case attachedPath = "attached_path" - - case proxyUrl = "proxy_url" - - } - - public init(attachedPath: String?, proxyUrl: String?) { - - self.attachedPath = attachedPath - - self.proxyUrl = proxyUrl - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - attachedPath = try container.decode(String.self, forKey: .attachedPath) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - proxyUrl = try container.decode(String.self, forKey: .proxyUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(attachedPath, forKey: .attachedPath) - - - - try? container.encodeIfPresent(proxyUrl, forKey: .proxyUrl) - - - } - - } - - /* - Model: AddProxyResponse - Used By: Partner - */ - - class AddProxyResponse: Codable { - - - public var id: String? - - public var attachedPath: String? - - public var proxyUrl: String? - - public var companyId: String? - - public var applicationId: String? - - public var extensionId: String? - - public var createdAt: String? - - public var modifiedAt: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "_id" - - case attachedPath = "attached_path" - - case proxyUrl = "proxy_url" - - case companyId = "company_id" - - case applicationId = "application_id" - - case extensionId = "extension_id" - - case createdAt = "created_at" - - case modifiedAt = "modified_at" - - } - - public init(applicationId: String?, attachedPath: String?, companyId: String?, createdAt: String?, extensionId: String?, modifiedAt: String?, proxyUrl: String?, id: String?) { - - self.id = id - - self.attachedPath = attachedPath - - self.proxyUrl = proxyUrl - - self.companyId = companyId - - self.applicationId = applicationId - - self.extensionId = extensionId - - self.createdAt = createdAt - - self.modifiedAt = modifiedAt - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(String.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attachedPath = try container.decode(String.self, forKey: .attachedPath) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - proxyUrl = try container.decode(String.self, forKey: .proxyUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - companyId = try container.decode(String.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - applicationId = try container.decode(String.self, forKey: .applicationId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - extensionId = try container.decode(String.self, forKey: .extensionId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdAt = try container.decode(String.self, forKey: .createdAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - modifiedAt = try container.decode(String.self, forKey: .modifiedAt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(attachedPath, forKey: .attachedPath) - - - - try? container.encodeIfPresent(proxyUrl, forKey: .proxyUrl) - - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(applicationId, forKey: .applicationId) - - - - try? container.encodeIfPresent(extensionId, forKey: .extensionId) - - - - try? container.encodeIfPresent(createdAt, forKey: .createdAt) - - - - try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) - - - } - - } - - /* - Model: ApiError - Used By: Partner - */ - - class ApiError: Codable { - - - public var code: String? - - public var message: String? - - public var meta: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case code = "code" - - case message = "message" - - case meta = "meta" - - } - - public init(code: String?, message: String?, meta: [String: Any]?) { - - self.code = code - - self.message = message - - self.meta = meta - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - code = try container.decode(String.self, forKey: .code) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - meta = try container.decode([String: Any].self, forKey: .meta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(code, forKey: .code) - - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(meta, forKey: .meta) - - - } - - } - - /* - Model: RemoveProxyResponse - Used By: Partner - */ - - class RemoveProxyResponse: Codable { - - - public var message: String? - - public var data: [String: Any]? - - - public enum CodingKeys: String, CodingKey { - - case message = "message" - - case data = "data" - - } - - public init(data: [String: Any]?, message: String?) { - - self.message = message - - self.data = data - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - message = try container.decode(String.self, forKey: .message) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - data = try container.decode([String: Any].self, forKey: .data) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(message, forKey: .message) - - - - try? container.encodeIfPresent(data, forKey: .data) - - - } - - } - - - - /* - Model: EventConfig - Used By: Webhook - */ - - class EventConfig: Codable { - - - public var id: Int? - - public var eventName: String? - - public var eventType: String? - - public var eventCategory: String? - - public var version: String? - - public var displayName: String? - - public var description: String? - - public var createdOn: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case eventName = "event_name" - - case eventType = "event_type" - - case eventCategory = "event_category" - - case version = "version" - - case displayName = "display_name" - - case description = "description" - - case createdOn = "created_on" - - } - - public init(createdOn: String?, description: String?, displayName: String?, eventCategory: String?, eventName: String?, eventType: String?, id: Int?, version: String?) { - - self.id = id - - self.eventName = eventName - - self.eventType = eventType - - self.eventCategory = eventCategory - - self.version = version - - self.displayName = displayName - - self.description = description - - self.createdOn = createdOn - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - eventName = try container.decode(String.self, forKey: .eventName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - eventType = try container.decode(String.self, forKey: .eventType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - eventCategory = try container.decode(String.self, forKey: .eventCategory) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - version = try container.decode(String.self, forKey: .version) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - displayName = try container.decode(String.self, forKey: .displayName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - description = try container.decode(String.self, forKey: .description) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(eventName, forKey: .eventName) - - - - try? container.encodeIfPresent(eventType, forKey: .eventType) - - - - try? container.encodeIfPresent(eventCategory, forKey: .eventCategory) - - - - try? container.encodeIfPresent(version, forKey: .version) - - - - try? container.encodeIfPresent(displayName, forKey: .displayName) - - - - try? container.encodeIfPresent(description, forKey: .description) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - } - - } - - /* - Model: EventConfigList - Used By: Webhook - */ - - class EventConfigList: Codable { - - - public var items: [EventConfig]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [EventConfig]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([EventConfig].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: SubscriberConfigList - Used By: Webhook - */ - - class SubscriberConfigList: Codable { - - - public var items: [SubscriberResponse]? - - public var page: Page? - - - public enum CodingKeys: String, CodingKey { - - case items = "items" - - case page = "page" - - } - - public init(items: [SubscriberResponse]?, page: Page?) { - - self.items = items - - self.page = page - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - items = try container.decode([SubscriberResponse].self, forKey: .items) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - page = try container.decode(Page.self, forKey: .page) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(items, forKey: .items) - - - - try? container.encodeIfPresent(page, forKey: .page) - - - } - - } - - /* - Model: EventProcessedStatus - Used By: Webhook - */ - - class EventProcessedStatus: Codable { - - - public var id: Int? - - public var subscriberId: String? - - public var attempt: Int? - - public var responseCode: String? - - public var responseMessage: String? - - public var createdOn: String? - - public var processedOn: String? - - public var status: Bool? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case subscriberId = "subscriber_id" - - case attempt = "attempt" - - case responseCode = "response_code" - - case responseMessage = "response_message" - - case createdOn = "created_on" - - case processedOn = "processed_on" - - case status = "status" - - } - - public init(attempt: Int?, createdOn: String?, id: Int?, processedOn: String?, responseCode: String?, responseMessage: String?, status: Bool?, subscriberId: String?) { - - self.id = id - - self.subscriberId = subscriberId - - self.attempt = attempt - - self.responseCode = responseCode - - self.responseMessage = responseMessage - - self.createdOn = createdOn - - self.processedOn = processedOn - - self.status = status - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subscriberId = try container.decode(String.self, forKey: .subscriberId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - attempt = try container.decode(Int.self, forKey: .attempt) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - responseCode = try container.decode(String.self, forKey: .responseCode) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - responseMessage = try container.decode(String.self, forKey: .responseMessage) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - processedOn = try container.decode(String.self, forKey: .processedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(Bool.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(subscriberId, forKey: .subscriberId) - - - - try? container.encodeIfPresent(attempt, forKey: .attempt) - - - - try? container.encodeIfPresent(responseCode, forKey: .responseCode) - - - - try? container.encodeIfPresent(responseMessage, forKey: .responseMessage) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(processedOn, forKey: .processedOn) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - } - - } - - /* - Model: EventPayload - Used By: Webhook - */ - - class EventPayload: Codable { - - - public var id: Int? - - public var eventTraceId: String? - - public var messageId: String? - - public var eventName: String? - - public var eventType: String? - - public var version: String? - - public var status: Bool? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case eventTraceId = "event_trace_id" - - case messageId = "message_id" - - case eventName = "event_name" - - case eventType = "event_type" - - case version = "version" - - case status = "status" - - } - - public init(eventName: String?, eventTraceId: String?, eventType: String?, id: Int?, messageId: String?, status: Bool?, version: String?) { - - self.id = id - - self.eventTraceId = eventTraceId - - self.messageId = messageId - - self.eventName = eventName - - self.eventType = eventType - - self.version = version - - self.status = status - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - eventTraceId = try container.decode(String.self, forKey: .eventTraceId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - messageId = try container.decode(String.self, forKey: .messageId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - eventName = try container.decode(String.self, forKey: .eventName) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - eventType = try container.decode(String.self, forKey: .eventType) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - version = try container.decode(String.self, forKey: .version) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(Bool.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(eventTraceId, forKey: .eventTraceId) - - - - try? container.encodeIfPresent(messageId, forKey: .messageId) - - - - try? container.encodeIfPresent(eventName, forKey: .eventName) - - - - try? container.encodeIfPresent(eventType, forKey: .eventType) - - - - try? container.encodeIfPresent(version, forKey: .version) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - } - - } - - /* - Model: SubscriberConfig - Used By: Webhook - */ - - class SubscriberConfig: Codable { - - - public var id: Int? - - public var name: String? - - public var webhookUrl: String? - - public var association: Association? - - public var status: SubscriberStatus? - - public var emailId: String? - - public var authMeta: AuthMeta? - - public var eventId: [Int]? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case name = "name" - - case webhookUrl = "webhook_url" - - case association = "association" - - case status = "status" - - case emailId = "email_id" - - case authMeta = "auth_meta" - - case eventId = "event_id" - - } - - public init(association: Association?, authMeta: AuthMeta?, emailId: String?, eventId: [Int]?, id: Int?, name: String?, status: SubscriberStatus?, webhookUrl: String?) { - - self.id = id - - self.name = name - - self.webhookUrl = webhookUrl - - self.association = association - - self.status = status - - self.emailId = emailId - - self.authMeta = authMeta - - self.eventId = eventId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - webhookUrl = try container.decode(String.self, forKey: .webhookUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - association = try container.decode(Association.self, forKey: .association) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(SubscriberStatus.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - emailId = try container.decode(String.self, forKey: .emailId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - authMeta = try container.decode(AuthMeta.self, forKey: .authMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - eventId = try container.decode([Int].self, forKey: .eventId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(webhookUrl, forKey: .webhookUrl) - - - - try? container.encodeIfPresent(association, forKey: .association) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(emailId, forKey: .emailId) - - - - try? container.encodeIfPresent(authMeta, forKey: .authMeta) - - - - try? container.encodeIfPresent(eventId, forKey: .eventId) - - - } - - } - - /* - Model: SubscriberResponse - Used By: Webhook - */ - - class SubscriberResponse: Codable { - - - public var id: Int? - - public var name: String? - - public var webhookUrl: String? - - public var association: Association? - - public var status: SubscriberStatus? - - public var authMeta: AuthMeta? - - public var createdOn: String? - - public var updatedOn: String? - - public var eventConfigs: [EventConfig]? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case name = "name" - - case webhookUrl = "webhook_url" - - case association = "association" - - case status = "status" - - case authMeta = "auth_meta" - - case createdOn = "created_on" - - case updatedOn = "updated_on" - - case eventConfigs = "event_configs" - - } - - public init(association: Association?, authMeta: AuthMeta?, createdOn: String?, eventConfigs: [EventConfig]?, id: Int?, name: String?, status: SubscriberStatus?, updatedOn: String?, webhookUrl: String?) { - - self.id = id - - self.name = name - - self.webhookUrl = webhookUrl - - self.association = association - - self.status = status - - self.authMeta = authMeta - - self.createdOn = createdOn - - self.updatedOn = updatedOn - - self.eventConfigs = eventConfigs - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - name = try container.decode(String.self, forKey: .name) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - webhookUrl = try container.decode(String.self, forKey: .webhookUrl) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - association = try container.decode(Association.self, forKey: .association) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - status = try container.decode(SubscriberStatus.self, forKey: .status) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - authMeta = try container.decode(AuthMeta.self, forKey: .authMeta) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdOn = try container.decode(String.self, forKey: .createdOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - updatedOn = try container.decode(String.self, forKey: .updatedOn) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - eventConfigs = try container.decode([EventConfig].self, forKey: .eventConfigs) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(name, forKey: .name) - - - - try? container.encodeIfPresent(webhookUrl, forKey: .webhookUrl) - - - - try? container.encodeIfPresent(association, forKey: .association) - - - - try? container.encodeIfPresent(status, forKey: .status) - - - - try? container.encodeIfPresent(authMeta, forKey: .authMeta) - - - - try? container.encodeIfPresent(createdOn, forKey: .createdOn) - - - - try? container.encodeIfPresent(updatedOn, forKey: .updatedOn) - - - - try? container.encodeIfPresent(eventConfigs, forKey: .eventConfigs) - - - } - - } - - /* - Model: SubscriberEvent - Used By: Webhook - */ - - class SubscriberEvent: Codable { - - - public var id: Int? - - public var subscriberId: Int? - - public var eventId: Int? - - public var createdDate: String? - - - public enum CodingKeys: String, CodingKey { - - case id = "id" - - case subscriberId = "subscriber_id" - - case eventId = "event_id" - - case createdDate = "created_date" - - } - - public init(createdDate: String?, eventId: Int?, id: Int?, subscriberId: Int?) { - - self.id = id - - self.subscriberId = subscriberId - - self.eventId = eventId - - self.createdDate = createdDate - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - id = try container.decode(Int.self, forKey: .id) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - subscriberId = try container.decode(Int.self, forKey: .subscriberId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - eventId = try container.decode(Int.self, forKey: .eventId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - createdDate = try container.decode(String.self, forKey: .createdDate) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(id, forKey: .id) - - - - try? container.encodeIfPresent(subscriberId, forKey: .subscriberId) - - - - try? container.encodeIfPresent(eventId, forKey: .eventId) - - - - try? container.encodeIfPresent(createdDate, forKey: .createdDate) - - - } - - } - - /* - Model: AuthMeta - Used By: Webhook - */ - - class AuthMeta: Codable { - - - public var type: String? - - public var secret: String? - - - public enum CodingKeys: String, CodingKey { - - case type = "type" - - case secret = "secret" - - } - - public init(secret: String?, type: String?) { - - self.type = type - - self.secret = secret - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - type = try container.decode(String.self, forKey: .type) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - secret = try container.decode(String.self, forKey: .secret) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(type, forKey: .type) - - - - try? container.encodeIfPresent(secret, forKey: .secret) - - - } - - } - - /* - Model: Association - Used By: Webhook - */ - - class Association: Codable { - - - public var companyId: Int? - - public var applicationId: [String]? - - public var extensionId: String? - - - public enum CodingKeys: String, CodingKey { - - case companyId = "company_id" - - case applicationId = "application_id" - - case extensionId = "extension_id" - - } - - public init(applicationId: [String]?, companyId: Int?, extensionId: String?) { - - self.companyId = companyId - - self.applicationId = applicationId - - self.extensionId = extensionId - - } - - required public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - - do { - companyId = try container.decode(Int.self, forKey: .companyId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - applicationId = try container.decode([String].self, forKey: .applicationId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - - do { - extensionId = try container.decode(String.self, forKey: .extensionId) - - } catch DecodingError.typeMismatch(let type, let context) { - print("Type '\(type)' mismatch:", context.debugDescription) - print("codingPath:", context.codingPath) - } catch { - - } - - - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - - - try? container.encodeIfPresent(companyId, forKey: .companyId) - - - - try? container.encodeIfPresent(applicationId, forKey: .applicationId) - - - - try? container.encodeIfPresent(extensionId, forKey: .extensionId) - - - } - - } - - -} \ No newline at end of file diff --git a/Sources/code/platform/PlatformModelsExtenstions.swift b/Sources/code/platform/PlatformModelsExtenstions.swift new file mode 100644 index 0000000000..828e573e91 --- /dev/null +++ b/Sources/code/platform/PlatformModelsExtenstions.swift @@ -0,0 +1,103 @@ +import Foundation +#if canImport(FoundationNetworking) + import FoundationNetworking +#endif + +public extension PlatformClient.ActionPage { + static func convertURLToAction(urlString: String) -> PlatformClient.ActionPage? { + PlatformClient.ActionPage(urlString: urlString) + } + + convenience init?(urlString: String) { + let url = urlString + var query: [String: [String]] = [:] + var params: [String: [String]] = [:] + var urlComp = URLComponents(string: urlString) + if urlComp?.scheme == nil { + urlComp = URLComponents(string: "https://\(urlString)") + } + guard let urlComponents = urlComp else { return nil } + guard let type = PlatformClient.PageType(path: urlComponents.percentEncodedPath) else { return nil } + for item in urlComponents.queryItems ?? [] { + if let queryValue = item.value { + if var list = query[item.name] { + list.append(queryValue) + query[item.name] = list + } else { + query[item.name] = [queryValue] + } + } + } + for param in type.queryParams { + if param.required, query[param.name] == nil { + return nil + } + } + let components = urlComponents.percentEncodedPath.components(separatedBy: "/").map { $0.removingPercentEncoding ?? $0 } + let symbolic = URLComponents(string: type.link)?.percentEncodedPath.components(separatedBy: "/") ?? [] + for paramSpec in type.pathParams { + if let i = symbolic.firstIndex(of: ":\(paramSpec.name)") { + let index = Int(i) + if let value = components.getIfExists(index: index) { + let splitVal = value.components(separatedBy: ":::") + if splitVal.count > 1 { + params[paramSpec.name] = splitVal + } else { + params[paramSpec.name] = [value] + } + } else if paramSpec.required { + return nil + } + } else if paramSpec.required { + return nil + } + } + self.init(params: params, query: query, type: type, url: url) + } + + func getURL() -> String? { + var urlParts = type.link.components(separatedBy: "/") + for paramSpec in type.pathParams { + if let index = urlParts.firstIndex(of: ":\(paramSpec.name)") { + if let value = self.params?[paramSpec.name] { + if value.isEmpty { + return nil + } else if value.count == 1 { + urlParts[index] = value[0].addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? value[0] + } else { + urlParts[index] = value + .map { $0.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? $0 } + .joined(separator: ":::") + } + } else if paramSpec.required { + return nil + } else { + urlParts.remove(at: index) + } + } else if paramSpec.required { + return nil + } + } + for q in type.queryParams { + if q.required { + if let value = self.query?[q.name], + value.isEmpty + { + return nil + } else if self.query?[q.name] == nil { + return nil + } + } + } + var queryString: String? + for (key, value) in self.query ?? [:] { + var text = "" + for val in value { + text += "\(key)=\(val.addingPercentEncoding(withAllowedCharacters: .afURLQueryAllowed) ?? "")&" + } + queryString = (queryString ?? "?") + text + } + let finalUrl = urlParts.joined(separator: "/") + (queryString?.dropLast() ?? "") + return finalUrl + } +} diff --git a/Sources/code/platform/PlatformOAuthClient.swift b/Sources/code/platform/PlatformOAuthClient.swift index d222704719..919c55e38a 100644 --- a/Sources/code/platform/PlatformOAuthClient.swift +++ b/Sources/code/platform/PlatformOAuthClient.swift @@ -1,36 +1,33 @@ import Foundation public struct AccessToken: Codable { - public let accessToken: String enum CodingKeys: String, CodingKey { - case accessToken = "access_token" } public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - + accessToken = try container.decode(String.self, forKey: .accessToken) } - + public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - + try? container.encodeIfPresent(accessToken, forKey: .accessToken) } } typealias RefreshToken = String - public class PlatformOAuthClient { var config: PlatformConfig var token: AccessToken? var refreshToken: RefreshToken? public var getCustomToken: ((@escaping (AccessToken?) -> Void) -> Void)? - + enum GrantType: String { case authorizationCode = "refresh_token" case refreshToken = "authorization_code" @@ -39,18 +36,16 @@ public class PlatformOAuthClient { init(config: PlatformConfig) { self.config = config } - + private var randomState: String { - get { - return "" - } + "" } - + func getAuthorizationURL(scope: [String], redirectUri: String, isOnline: Bool = true) throws -> String { guard let apiKey = config.apiKey else { throw NSError(domain: "API Key missing in config", code: 0, userInfo: nil) } - + let query: [String: String] = [ "client_id": apiKey, "scope": scope.joined(separator: ","), @@ -58,8 +53,8 @@ public class PlatformOAuthClient { "state": randomState, "access_mode": isOnline ? "online" : "offline" ] - - return "https://\(config.domain)/v1.0/company/\(config.companyId)/oauth/authorize?\(query.asQueryString)"; + + return "https://\(config.domain)/v1.0/company/\(config.companyId)/oauth/authorize?\(query.asQueryString)" } func getAccessToken(onToken: @escaping (AccessToken?) -> Void) { @@ -70,7 +65,7 @@ public class PlatformOAuthClient { if let getCustomToken = getCustomToken { return getCustomToken(onToken) } - + if let refreshToken = refreshToken { getToken(grant: [ "grant_type": GrantType.refreshToken.rawValue, @@ -80,17 +75,18 @@ public class PlatformOAuthClient { onToken(nil) } } - + func getToken(grant: [String: String], onToken: @escaping (AccessToken?) -> Void) { guard let apiKey = config.apiKey, - let apiSecret = config.apiSecret else { + let apiSecret = config.apiSecret + else { return onToken(nil) } let headers = [ (key: "Authorization", value: "Basic " + "\(apiKey):\(apiSecret)".asBase64) ] - - AlmofireHelper.request(config.domain.appendAsPath("service/panel/authentication/v1.0/company/\(config.companyId)/oauth/token"), query: nil, parameters: grant, type: "POST", headers: headers, isJsonEncoding: false) { (responseData, error, responseCode) in + + AlmofireHelper.request(config.domain.appendAsPath("service/panel/authentication/v1.0/company/\(config.companyId)/oauth/token"), query: nil, parameters: grant, type: "POST", headers: headers, isJsonEncoding: false) { responseData, error, responseCode in if let _ = error, let data = responseData { var err = Utility.decode(FDKError.self, from: data) if err?.status == nil { diff --git a/Sources/code/platform/PlatformPageType.swift b/Sources/code/platform/PlatformPageType.swift new file mode 100644 index 0000000000..0167198ef1 --- /dev/null +++ b/Sources/code/platform/PlatformPageType.swift @@ -0,0 +1,446 @@ +import Foundation +public extension PlatformClient { + enum PageType: String, Codable, CaseIterable { + case aboutUs = "about-us" + case addresses + case blog + case brands + case cards + case cart + case categories + case brand + case category + case collection + case collections + case contactUs = "contact-us" + case external + case faq + case freshchat + case home + case notificationSettings = "notification-settings" + case orders + case page + case policy + case product + case productReviews = "product-reviews" + case addProductReview = "add-product-review" + case productRequest = "product-request" + case products + case profile + case profileBasic = "profile-basic" + case profileCompany = "profile-company" + case profileEmails = "profile-emails" + case profilePhones = "profile-phones" + case rateUs = "rate-us" + case referEarn = "refer-earn" + case settings + case sharedCart = "shared-cart" + case tnc + case trackOrder = "track-order" + case wishlist + case sections + case form + case cartDelivery = "cart-delivery" + case cartPayment = "cart-payment" + case cartReview = "cart-review" + + init?(path: String) { + let slash = CharacterSet(charactersIn: "/") + let path = path.trimmingCharacters(in: slash) + var allPossible: [(type: PageType, link: String)] = [] + for type in PageType.allCases { + allPossible.append((type: type, link: type.link.trimmingCharacters(in: slash))) + var possibleLink = type.link + for params in type.pathParams where !params.required { + possibleLink = possibleLink.replacingOccurrences(of: ":\(params.name)", with: "") + } + possibleLink = possibleLink.replacingOccurrences(of: "//", with: "/") + allPossible.append((type: type, link: possibleLink.trimmingCharacters(in: slash))) + } + allPossible = allPossible.sorted { $0.link.count > $1.link.count } + var match = allPossible.first(where: { $0.link == path }) + for possible in allPossible { + if match != nil { + break + } + let pathComp = path.split(separator: "/") + let typeComp = possible.link.split(separator: "/") + if pathComp.count == typeComp.count { + var paramsCount = 0 + var matchCount = 0 + for i in 0 ..< pathComp.count { + if typeComp[i].starts(with: ":") { + paramsCount += 1 + } else if typeComp[i] == pathComp[i] { + matchCount += 1 + } + } + if paramsCount + matchCount == pathComp.count { + match = possible + } + } + } + if let bestMatch = match { + self = bestMatch.type + } else { + return nil + } + } + + public var link: String { + switch self { + case .aboutUs: + return "/about-us" + case .addresses: + return "/profile/address" + case .blog: + return "/blog/:slug" + case .brands: + return "/brands/:department" + case .cards: + return "/profile/my-cards" + case .cart: + return "/cart/bag/" + case .categories: + return "/categories/:department" + case .brand: + return "/brand/:slug" + case .category: + return "/category/:slug" + case .collection: + return "/collection/:slug" + case .collections: + return "/collections/" + case .contactUs: + return "/contact-us/" + case .external: + return "/external/:url" + case .faq: + return "/faq/:category" + case .freshchat: + return "/freshchat" + case .home: + return "/" + case .notificationSettings: + return "/notification-settings" + case .orders: + return "/profile/orders" + case .page: + return "/page/:slug" + case .policy: + return "/privacy-policy" + case .product: + return "/product/:slug" + case .productReviews: + return "/product/:slug/reviews" + case .addProductReview: + return "/product/:slug/add-review" + case .productRequest: + return "/product-request/" + case .products: + return "/products/" + case .profile: + return "/profile" + case .profileBasic: + return "/profile/details" + case .profileCompany: + return "/profile/company" + case .profileEmails: + return "/profile/email" + case .profilePhones: + return "/profile/phone" + case .rateUs: + return "/rate-us" + case .referEarn: + return "/profile/refer-earn" + case .settings: + return "/setting/currency" + case .sharedCart: + return "/shared-cart/:token" + case .tnc: + return "/terms-and-conditions" + case .trackOrder: + return "/order-tracking/:orderId" + case .wishlist: + return "/wishlist/" + case .sections: + return "/sections/:group" + case .form: + return "/form/:slug" + case .cartDelivery: + return "/cart/delivery" + case .cartPayment: + return "/cart/payment-info" + case .cartReview: + return "/cart/order-review" + } + } + + public var name: String { + switch self { + case .aboutUs: + return "About Us" + case .addresses: + return "Saved Addresses" + case .blog: + return "Blog" + case .brands: + return "Brands" + case .cards: + return "Saved Cards" + case .cart: + return "Cart" + case .categories: + return "Categories" + case .brand: + return "Brand" + case .category: + return "Category" + case .collection: + return "Collection" + case .collections: + return "Collections" + case .contactUs: + return "Contact Us" + case .external: + return "External Link" + case .faq: + return "FAQ" + case .freshchat: + return "Chat by Freshchat" + case .home: + return "Home" + case .notificationSettings: + return "Notification Settings" + case .orders: + return "Orders" + case .page: + return "Page" + case .policy: + return "Privacy Policy" + case .product: + return "Product" + case .productReviews: + return "Product Reviews" + case .addProductReview: + return "Add Product review" + case .productRequest: + return "Product Request" + case .products: + return "Products" + case .profile: + return "Profile" + case .profileBasic: + return "Basic Profile" + case .profileCompany: + return "Profile Company" + case .profileEmails: + return "Profile Emails" + case .profilePhones: + return "Profile Phones" + case .rateUs: + return "Rate Us" + case .referEarn: + return "Refer & Earn" + case .settings: + return "Settings" + case .sharedCart: + return "Shared Cart" + case .tnc: + return "Terms and Conditions" + case .trackOrder: + return "Track Order" + case .wishlist: + return "Wishlist" + case .sections: + return "Sections" + case .form: + return "Form" + case .cartDelivery: + return "Cart Delivery" + case .cartPayment: + return "Cart Payment Information" + case .cartReview: + return "Cart Order Review" + } + } + + public var pathParams: [(name: String, required: Bool)] { + switch self { + case .aboutUs: + return [] + case .addresses: + return [] + case .blog: + return [(name: "slug", required: false)] + case .brands: + return [(name: "department", required: false)] + case .cards: + return [] + case .cart: + return [] + case .categories: + return [(name: "department", required: false)] + case .brand: + return [(name: "slug", required: true)] + case .category: + return [(name: "slug", required: true)] + case .collection: + return [(name: "slug", required: true)] + case .collections: + return [] + case .contactUs: + return [] + case .external: + return [] + case .faq: + return [(name: "category", required: false)] + case .freshchat: + return [] + case .home: + return [] + case .notificationSettings: + return [] + case .orders: + return [] + case .page: + return [(name: "slug", required: true)] + case .policy: + return [] + case .product: + return [(name: "slug", required: true)] + case .productReviews: + return [(name: "slug", required: true)] + case .addProductReview: + return [(name: "slug", required: true)] + case .productRequest: + return [] + case .products: + return [] + case .profile: + return [] + case .profileBasic: + return [] + case .profileCompany: + return [] + case .profileEmails: + return [] + case .profilePhones: + return [] + case .rateUs: + return [] + case .referEarn: + return [] + case .settings: + return [] + case .sharedCart: + return [(name: "token", required: true)] + case .tnc: + return [] + case .trackOrder: + return [(name: "orderId", required: false)] + case .wishlist: + return [] + case .sections: + return [(name: "group", required: true)] + case .form: + return [(name: "slug", required: true)] + case .cartDelivery: + return [] + case .cartPayment: + return [] + case .cartReview: + return [] + } + } + + public var queryParams: [(name: String, required: Bool)] { + switch self { + case .aboutUs: + return [] + case .addresses: + return [] + case .blog: + return [] + case .brands: + return [] + case .cards: + return [] + case .cart: + return [] + case .categories: + return [] + case .brand: + return [] + case .category: + return [] + case .collection: + return [] + case .collections: + return [] + case .contactUs: + return [] + case .external: + return [(name: "url", required: true)] + case .faq: + return [] + case .freshchat: + return [] + case .home: + return [] + case .notificationSettings: + return [] + case .orders: + return [] + case .page: + return [] + case .policy: + return [] + case .product: + return [] + case .productReviews: + return [] + case .addProductReview: + return [] + case .productRequest: + return [] + case .products: + return [] + case .profile: + return [] + case .profileBasic: + return [] + case .profileCompany: + return [] + case .profileEmails: + return [] + case .profilePhones: + return [] + case .rateUs: + return [] + case .referEarn: + return [] + case .settings: + return [] + case .sharedCart: + return [] + case .tnc: + return [] + case .trackOrder: + return [] + case .wishlist: + return [] + case .sections: + return [] + case .form: + return [] + case .cartDelivery: + return [] + case .cartPayment: + return [] + case .cartReview: + return [] + } + } + } +} diff --git a/Sources/code/platform/models/AnalyticsPlatformModelClass.swift b/Sources/code/platform/models/AnalyticsPlatformModelClass.swift new file mode 100644 index 0000000000..c9991b635e --- /dev/null +++ b/Sources/code/platform/models/AnalyticsPlatformModelClass.swift @@ -0,0 +1,1670 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: StatGroup + Used By: Analytics + */ + + class StatGroup: Codable { + public var key: String? + + public var url: String? + + public var title: String? + + public enum CodingKeys: String, CodingKey { + case key + + case url + + case title + } + + public init(key: String?, title: String?, url: String?) { + self.key = key + + self.url = url + + self.title = title + } + + public func duplicate() -> StatGroup { + let dict = self.dictionary! + let copy = StatGroup(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(title, forKey: .title) + } + } + + /* + Model: StatsGroups + Used By: Analytics + */ + + class StatsGroups: Codable { + public var groups: [StatGroup]? + + public enum CodingKeys: String, CodingKey { + case groups + } + + public init(groups: [StatGroup]?) { + self.groups = groups + } + + public func duplicate() -> StatsGroups { + let dict = self.dictionary! + let copy = StatsGroups(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + groups = try container.decode([StatGroup].self, forKey: .groups) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(groups, forKey: .groups) + } + } + + /* + Model: StatsGroupComponent + Used By: Analytics + */ + + class StatsGroupComponent: Codable { + public var key: String? + + public var url: String? + + public var title: String? + + public var type: String? + + public var filters: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case key + + case url + + case title + + case type + + case filters + } + + public init(filters: [String: Any]?, key: String?, title: String?, type: String?, url: String?) { + self.key = key + + self.url = url + + self.title = title + + self.type = type + + self.filters = filters + } + + public func duplicate() -> StatsGroupComponent { + let dict = self.dictionary! + let copy = StatsGroupComponent(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filters = try container.decode([String: Any].self, forKey: .filters) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(filters, forKey: .filters) + } + } + + /* + Model: StatsGroupComponents + Used By: Analytics + */ + + class StatsGroupComponents: Codable { + public var title: String? + + public var components: [StatsGroupComponent]? + + public enum CodingKeys: String, CodingKey { + case title + + case components + } + + public init(components: [StatsGroupComponent]?, title: String?) { + self.title = title + + self.components = components + } + + public func duplicate() -> StatsGroupComponents { + let dict = self.dictionary! + let copy = StatsGroupComponents(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + components = try container.decode([StatsGroupComponent].self, forKey: .components) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(components, forKey: .components) + } + } + + /* + Model: StatsRes + Used By: Analytics + */ + + class StatsRes: Codable { + public var key: String? + + public var title: String? + + public var type: String? + + public var data: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case key + + case title + + case type + + case data + } + + public init(data: [String: Any]?, key: String?, title: String?, type: String?) { + self.key = key + + self.title = title + + self.type = type + + self.data = data + } + + public func duplicate() -> StatsRes { + let dict = self.dictionary! + let copy = StatsRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode([String: Any].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: ReceivedAt + Used By: Analytics + */ + + class ReceivedAt: Codable { + public var value: String? + + public enum CodingKeys: String, CodingKey { + case value + } + + public init(value: String?) { + self.value = value + } + + public func duplicate() -> ReceivedAt { + let dict = self.dictionary! + let copy = ReceivedAt(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: AbandonCartsDetail + Used By: Analytics + */ + + class AbandonCartsDetail: Codable { + public var propertiesCartId: String? + + public var contextTraitsFirstName: String? + + public var contextTraitsLastName: String? + + public var contextTraitsPhoneNumber: String? + + public var contextTraitsEmail: String? + + public var contextAppApplicationId: String? + + public var propertiesBreakupValuesRawTotal: String? + + public var receivedAt: ReceivedAt? + + public enum CodingKeys: String, CodingKey { + case propertiesCartId = "properties_cart_id" + + case contextTraitsFirstName = "context_traits_first_name" + + case contextTraitsLastName = "context_traits_last_name" + + case contextTraitsPhoneNumber = "context_traits_phone_number" + + case contextTraitsEmail = "context_traits_email" + + case contextAppApplicationId = "context_app_application_id" + + case propertiesBreakupValuesRawTotal = "properties_breakup_values_raw_total" + + case receivedAt = "received_at" + } + + public init(contextAppApplicationId: String?, contextTraitsEmail: String?, contextTraitsFirstName: String?, contextTraitsLastName: String?, contextTraitsPhoneNumber: String?, propertiesBreakupValuesRawTotal: String?, propertiesCartId: String?, receivedAt: ReceivedAt?) { + self.propertiesCartId = propertiesCartId + + self.contextTraitsFirstName = contextTraitsFirstName + + self.contextTraitsLastName = contextTraitsLastName + + self.contextTraitsPhoneNumber = contextTraitsPhoneNumber + + self.contextTraitsEmail = contextTraitsEmail + + self.contextAppApplicationId = contextAppApplicationId + + self.propertiesBreakupValuesRawTotal = propertiesBreakupValuesRawTotal + + self.receivedAt = receivedAt + } + + public func duplicate() -> AbandonCartsDetail { + let dict = self.dictionary! + let copy = AbandonCartsDetail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + propertiesCartId = try container.decode(String.self, forKey: .propertiesCartId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contextTraitsFirstName = try container.decode(String.self, forKey: .contextTraitsFirstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contextTraitsLastName = try container.decode(String.self, forKey: .contextTraitsLastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contextTraitsPhoneNumber = try container.decode(String.self, forKey: .contextTraitsPhoneNumber) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contextTraitsEmail = try container.decode(String.self, forKey: .contextTraitsEmail) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contextAppApplicationId = try container.decode(String.self, forKey: .contextAppApplicationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + propertiesBreakupValuesRawTotal = try container.decode(String.self, forKey: .propertiesBreakupValuesRawTotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + receivedAt = try container.decode(ReceivedAt.self, forKey: .receivedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(propertiesCartId, forKey: .propertiesCartId) + + try? container.encodeIfPresent(contextTraitsFirstName, forKey: .contextTraitsFirstName) + + try? container.encodeIfPresent(contextTraitsLastName, forKey: .contextTraitsLastName) + + try? container.encodeIfPresent(contextTraitsPhoneNumber, forKey: .contextTraitsPhoneNumber) + + try? container.encodeIfPresent(contextTraitsEmail, forKey: .contextTraitsEmail) + + try? container.encodeIfPresent(contextAppApplicationId, forKey: .contextAppApplicationId) + + try? container.encodeIfPresent(propertiesBreakupValuesRawTotal, forKey: .propertiesBreakupValuesRawTotal) + + try? container.encodeIfPresent(receivedAt, forKey: .receivedAt) + } + } + + /* + Model: AbandonCartsList + Used By: Analytics + */ + + class AbandonCartsList: Codable { + public var items: [AbandonCartsDetail]? + + public var cartTotal: String? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case cartTotal = "cart_total" + + case page + } + + public init(cartTotal: String?, items: [AbandonCartsDetail]?, page: Page?) { + self.items = items + + self.cartTotal = cartTotal + + self.page = page + } + + public func duplicate() -> AbandonCartsList { + let dict = self.dictionary! + let copy = AbandonCartsList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([AbandonCartsDetail].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cartTotal = try container.decode(String.self, forKey: .cartTotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(cartTotal, forKey: .cartTotal) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: AbandonCartDetail + Used By: Analytics + */ + + class AbandonCartDetail: Codable { + public var id: String? + + public var userId: String? + + public var cartValue: String? + + public var articles: [[String: Any]]? + + public var breakup: [String: Any]? + + public var address: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case userId = "user_id" + + case cartValue = "cart_value" + + case articles + + case breakup + + case address + } + + public init(address: [String: Any]?, articles: [[String: Any]]?, breakup: [String: Any]?, cartValue: String?, userId: String?, id: String?) { + self.id = id + + self.userId = userId + + self.cartValue = cartValue + + self.articles = articles + + self.breakup = breakup + + self.address = address + } + + public func duplicate() -> AbandonCartDetail { + let dict = self.dictionary! + let copy = AbandonCartDetail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cartValue = try container.decode(String.self, forKey: .cartValue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + articles = try container.decode([[String: Any]].self, forKey: .articles) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + breakup = try container.decode([String: Any].self, forKey: .breakup) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address = try container.decode([String: Any].self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(userId, forKey: .userId) + + try? container.encodeIfPresent(cartValue, forKey: .cartValue) + + try? container.encodeIfPresent(articles, forKey: .articles) + + try? container.encodeIfPresent(breakup, forKey: .breakup) + + try? container.encodeIfPresent(address, forKey: .address) + } + } + + /* + Model: ExportJobReq + Used By: Analytics + */ + + class ExportJobReq: Codable { + public var marketplaceName: String? + + public var startTime: String? + + public var endTime: String? + + public var eventType: String? + + public var traceId: String? + + public enum CodingKeys: String, CodingKey { + case marketplaceName = "marketplace_name" + + case startTime = "start_time" + + case endTime = "end_time" + + case eventType = "event_type" + + case traceId = "trace_id" + } + + public init(endTime: String?, eventType: String?, marketplaceName: String?, startTime: String?, traceId: String?) { + self.marketplaceName = marketplaceName + + self.startTime = startTime + + self.endTime = endTime + + self.eventType = eventType + + self.traceId = traceId + } + + public func duplicate() -> ExportJobReq { + let dict = self.dictionary! + let copy = ExportJobReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + marketplaceName = try container.decode(String.self, forKey: .marketplaceName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + startTime = try container.decode(String.self, forKey: .startTime) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + endTime = try container.decode(String.self, forKey: .endTime) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventType = try container.decode(String.self, forKey: .eventType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + traceId = try container.decode(String.self, forKey: .traceId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(marketplaceName, forKey: .marketplaceName) + + try? container.encodeIfPresent(startTime, forKey: .startTime) + + try? container.encodeIfPresent(endTime, forKey: .endTime) + + try? container.encodeIfPresent(eventType, forKey: .eventType) + + try? container.encodeIfPresent(traceId, forKey: .traceId) + } + } + + /* + Model: ExportJobRes + Used By: Analytics + */ + + class ExportJobRes: Codable { + public var status: String? + + public var jobId: String? + + public enum CodingKeys: String, CodingKey { + case status + + case jobId = "job_id" + } + + public init(jobId: String?, status: String?) { + self.status = status + + self.jobId = jobId + } + + public func duplicate() -> ExportJobRes { + let dict = self.dictionary! + let copy = ExportJobRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + jobId = try container.decode(String.self, forKey: .jobId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(jobId, forKey: .jobId) + } + } + + /* + Model: ExportJobStatusRes + Used By: Analytics + */ + + class ExportJobStatusRes: Codable { + public var status: String? + + public var jobId: String? + + public var downloadUrl: String? + + public enum CodingKeys: String, CodingKey { + case status + + case jobId = "job_id" + + case downloadUrl = "download_url" + } + + public init(downloadUrl: String?, jobId: String?, status: String?) { + self.status = status + + self.jobId = jobId + + self.downloadUrl = downloadUrl + } + + public func duplicate() -> ExportJobStatusRes { + let dict = self.dictionary! + let copy = ExportJobStatusRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + jobId = try container.decode(String.self, forKey: .jobId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + downloadUrl = try container.decode(String.self, forKey: .downloadUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(jobId, forKey: .jobId) + + try? container.encodeIfPresent(downloadUrl, forKey: .downloadUrl) + } + } + + /* + Model: GetLogsListReq + Used By: Analytics + */ + + class GetLogsListReq: Codable { + public var marketplaceName: String? + + public var startDate: String? + + public var companyId: String? + + public var endDate: String? + + public enum CodingKeys: String, CodingKey { + case marketplaceName = "marketplace_name" + + case startDate = "start_date" + + case companyId = "company_id" + + case endDate = "end_date" + } + + public init(companyId: String?, endDate: String?, marketplaceName: String?, startDate: String?) { + self.marketplaceName = marketplaceName + + self.startDate = startDate + + self.companyId = companyId + + self.endDate = endDate + } + + public func duplicate() -> GetLogsListReq { + let dict = self.dictionary! + let copy = GetLogsListReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + marketplaceName = try container.decode(String.self, forKey: .marketplaceName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + startDate = try container.decode(String.self, forKey: .startDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(String.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + endDate = try container.decode(String.self, forKey: .endDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(marketplaceName, forKey: .marketplaceName) + + try? container.encodeIfPresent(startDate, forKey: .startDate) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(endDate, forKey: .endDate) + } + } + + /* + Model: MkpLogsResp + Used By: Analytics + */ + + class MkpLogsResp: Codable { + public var startTimeIso: String? + + public var endTimeIso: String? + + public var eventType: String? + + public var traceId: String? + + public var count: String? + + public var status: String? + + public enum CodingKeys: String, CodingKey { + case startTimeIso = "start_time_iso" + + case endTimeIso = "end_time_iso" + + case eventType = "event_type" + + case traceId = "trace_id" + + case count + + case status + } + + public init(count: String?, endTimeIso: String?, eventType: String?, startTimeIso: String?, status: String?, traceId: String?) { + self.startTimeIso = startTimeIso + + self.endTimeIso = endTimeIso + + self.eventType = eventType + + self.traceId = traceId + + self.count = count + + self.status = status + } + + public func duplicate() -> MkpLogsResp { + let dict = self.dictionary! + let copy = MkpLogsResp(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + startTimeIso = try container.decode(String.self, forKey: .startTimeIso) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + endTimeIso = try container.decode(String.self, forKey: .endTimeIso) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventType = try container.decode(String.self, forKey: .eventType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + traceId = try container.decode(String.self, forKey: .traceId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + count = try container.decode(String.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(startTimeIso, forKey: .startTimeIso) + + try? container.encodeIfPresent(endTimeIso, forKey: .endTimeIso) + + try? container.encodeIfPresent(eventType, forKey: .eventType) + + try? container.encodeIfPresent(traceId, forKey: .traceId) + + try? container.encodeIfPresent(count, forKey: .count) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: GetLogsListRes + Used By: Analytics + */ + + class GetLogsListRes: Codable { + public var items: [MkpLogsResp]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [MkpLogsResp]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> GetLogsListRes { + let dict = self.dictionary! + let copy = GetLogsListRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([MkpLogsResp].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: SearchLogReq + Used By: Analytics + */ + + class SearchLogReq: Codable { + public var marketplaceName: String? + + public var startDate: String? + + public var companyId: String? + + public var endDate: String? + + public var identifier: String? + + public var identifierValue: String? + + public enum CodingKeys: String, CodingKey { + case marketplaceName = "marketplace_name" + + case startDate = "start_date" + + case companyId = "company_id" + + case endDate = "end_date" + + case identifier + + case identifierValue = "identifier_value" + } + + public init(companyId: String?, endDate: String?, identifier: String?, identifierValue: String?, marketplaceName: String?, startDate: String?) { + self.marketplaceName = marketplaceName + + self.startDate = startDate + + self.companyId = companyId + + self.endDate = endDate + + self.identifier = identifier + + self.identifierValue = identifierValue + } + + public func duplicate() -> SearchLogReq { + let dict = self.dictionary! + let copy = SearchLogReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + marketplaceName = try container.decode(String.self, forKey: .marketplaceName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + startDate = try container.decode(String.self, forKey: .startDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(String.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + endDate = try container.decode(String.self, forKey: .endDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + identifier = try container.decode(String.self, forKey: .identifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + identifierValue = try container.decode(String.self, forKey: .identifierValue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(marketplaceName, forKey: .marketplaceName) + + try? container.encodeIfPresent(startDate, forKey: .startDate) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(endDate, forKey: .endDate) + + try? container.encodeIfPresent(identifier, forKey: .identifier) + + try? container.encodeIfPresent(identifierValue, forKey: .identifierValue) + } + } + + /* + Model: LogInfo + Used By: Analytics + */ + + class LogInfo: Codable { + public var id: String? + + public var status: String? + + public var eventType: String? + + public var marketplaceName: String? + + public var event: String? + + public var traceId: String? + + public var companyId: Double? + + public var brandId: Double? + + public var storeCode: String? + + public var storeId: Double? + + public var itemId: Double? + + public var articleId: String? + + public var sellerIdentifier: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case status + + case eventType = "event_type" + + case marketplaceName = "marketplace_name" + + case event + + case traceId = "trace_id" + + case companyId = "company_id" + + case brandId = "brand_id" + + case storeCode = "store_code" + + case storeId = "store_id" + + case itemId = "item_id" + + case articleId = "article_id" + + case sellerIdentifier = "seller_identifier" + } + + public init(articleId: String?, brandId: Double?, companyId: Double?, event: String?, eventType: String?, itemId: Double?, marketplaceName: String?, sellerIdentifier: String?, status: String?, storeCode: String?, storeId: Double?, traceId: String?, id: String?) { + self.id = id + + self.status = status + + self.eventType = eventType + + self.marketplaceName = marketplaceName + + self.event = event + + self.traceId = traceId + + self.companyId = companyId + + self.brandId = brandId + + self.storeCode = storeCode + + self.storeId = storeId + + self.itemId = itemId + + self.articleId = articleId + + self.sellerIdentifier = sellerIdentifier + } + + public func duplicate() -> LogInfo { + let dict = self.dictionary! + let copy = LogInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventType = try container.decode(String.self, forKey: .eventType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + marketplaceName = try container.decode(String.self, forKey: .marketplaceName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + event = try container.decode(String.self, forKey: .event) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + traceId = try container.decode(String.self, forKey: .traceId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Double.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandId = try container.decode(Double.self, forKey: .brandId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeCode = try container.decode(String.self, forKey: .storeCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeId = try container.decode(Double.self, forKey: .storeId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemId = try container.decode(Double.self, forKey: .itemId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + articleId = try container.decode(String.self, forKey: .articleId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sellerIdentifier = try container.decode(String.self, forKey: .sellerIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(eventType, forKey: .eventType) + + try? container.encodeIfPresent(marketplaceName, forKey: .marketplaceName) + + try? container.encodeIfPresent(event, forKey: .event) + + try? container.encodeIfPresent(traceId, forKey: .traceId) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(brandId, forKey: .brandId) + + try? container.encodeIfPresent(storeCode, forKey: .storeCode) + + try? container.encodeIfPresent(storeId, forKey: .storeId) + + try? container.encodeIfPresent(itemId, forKey: .itemId) + + try? container.encodeIfPresent(articleId, forKey: .articleId) + + try? container.encodeIfPresent(sellerIdentifier, forKey: .sellerIdentifier) + } + } + + /* + Model: SearchLogRes + Used By: Analytics + */ + + class SearchLogRes: Codable { + public var items: [LogInfo]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [LogInfo]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> SearchLogRes { + let dict = self.dictionary! + let copy = SearchLogRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([LogInfo].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } +} diff --git a/Sources/code/platform/models/BillingPlatformModelClass.swift b/Sources/code/platform/models/BillingPlatformModelClass.swift new file mode 100644 index 0000000000..84a7970cce --- /dev/null +++ b/Sources/code/platform/models/BillingPlatformModelClass.swift @@ -0,0 +1,6548 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: UnauthenticatedUser + Used By: Billing + */ + + class UnauthenticatedUser: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> UnauthenticatedUser { + let dict = self.dictionary! + let copy = UnauthenticatedUser(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: UnauthenticatedApplication + Used By: Billing + */ + + class UnauthenticatedApplication: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> UnauthenticatedApplication { + let dict = self.dictionary! + let copy = UnauthenticatedApplication(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: ResourceNotFound + Used By: Billing + */ + + class ResourceNotFound: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> ResourceNotFound { + let dict = self.dictionary! + let copy = ResourceNotFound(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: InternalServerError + Used By: Billing + */ + + class InternalServerError: Codable { + public var message: String? + + public var code: String? + + public enum CodingKeys: String, CodingKey { + case message + + case code + } + + public init(code: String?, message: String?) { + self.message = message + + self.code = code + } + + public func duplicate() -> InternalServerError { + let dict = self.dictionary! + let copy = InternalServerError(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: CheckValidityResponse + Used By: Billing + */ + + class CheckValidityResponse: Codable { + public var isValid: Bool? + + public var discountAmount: Double? + + public enum CodingKeys: String, CodingKey { + case isValid = "is_valid" + + case discountAmount = "discount_amount" + } + + public init(discountAmount: Double?, isValid: Bool?) { + self.isValid = isValid + + self.discountAmount = discountAmount + } + + public func duplicate() -> CheckValidityResponse { + let dict = self.dictionary! + let copy = CheckValidityResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isValid = try container.decode(Bool.self, forKey: .isValid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discountAmount = try container.decode(Double.self, forKey: .discountAmount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isValid, forKey: .isValid) + + try? container.encodeIfPresent(discountAmount, forKey: .discountAmount) + } + } + + /* + Model: PlanRecurring + Used By: Billing + */ + + class PlanRecurring: Codable { + public var interval: String? + + public var intervalCount: Double? + + public enum CodingKeys: String, CodingKey { + case interval + + case intervalCount = "interval_count" + } + + public init(interval: String?, intervalCount: Double?) { + self.interval = interval + + self.intervalCount = intervalCount + } + + public func duplicate() -> PlanRecurring { + let dict = self.dictionary! + let copy = PlanRecurring(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + interval = try container.decode(String.self, forKey: .interval) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + intervalCount = try container.decode(Double.self, forKey: .intervalCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(interval, forKey: .interval) + + try? container.encodeIfPresent(intervalCount, forKey: .intervalCount) + } + } + + /* + Model: Plan + Used By: Billing + */ + + class Plan: Codable { + public var recurring: PlanRecurring? + + public var isTrialPlan: Bool? + + public var planGroup: String? + + public var tagLines: [String]? + + public var currency: String? + + public var isActive: Bool? + + public var isVisible: Bool? + + public var trialPeriod: Double? + + public var addons: [String]? + + public var tags: [String]? + + public var type: String? + + public var country: String? + + public var id: String? + + public var name: String? + + public var description: String? + + public var amount: Double? + + public var productSuiteId: String? + + public var createdAt: String? + + public var modifiedAt: String? + + public enum CodingKeys: String, CodingKey { + case recurring + + case isTrialPlan = "is_trial_plan" + + case planGroup = "plan_group" + + case tagLines = "tag_lines" + + case currency + + case isActive = "is_active" + + case isVisible = "is_visible" + + case trialPeriod = "trial_period" + + case addons + + case tags + + case type + + case country + + case id = "_id" + + case name + + case description + + case amount + + case productSuiteId = "product_suite_id" + + case createdAt = "created_at" + + case modifiedAt = "modified_at" + } + + public init(addons: [String]?, amount: Double?, country: String?, createdAt: String?, currency: String?, description: String?, isActive: Bool?, isTrialPlan: Bool?, isVisible: Bool?, modifiedAt: String?, name: String?, planGroup: String?, productSuiteId: String?, recurring: PlanRecurring?, tags: [String]?, tagLines: [String]?, trialPeriod: Double?, type: String?, id: String?) { + self.recurring = recurring + + self.isTrialPlan = isTrialPlan + + self.planGroup = planGroup + + self.tagLines = tagLines + + self.currency = currency + + self.isActive = isActive + + self.isVisible = isVisible + + self.trialPeriod = trialPeriod + + self.addons = addons + + self.tags = tags + + self.type = type + + self.country = country + + self.id = id + + self.name = name + + self.description = description + + self.amount = amount + + self.productSuiteId = productSuiteId + + self.createdAt = createdAt + + self.modifiedAt = modifiedAt + } + + public func duplicate() -> Plan { + let dict = self.dictionary! + let copy = Plan(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + recurring = try container.decode(PlanRecurring.self, forKey: .recurring) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isTrialPlan = try container.decode(Bool.self, forKey: .isTrialPlan) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + planGroup = try container.decode(String.self, forKey: .planGroup) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tagLines = try container.decode([String].self, forKey: .tagLines) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isVisible = try container.decode(Bool.self, forKey: .isVisible) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + trialPeriod = try container.decode(Double.self, forKey: .trialPeriod) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addons = try container.decode([String].self, forKey: .addons) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + amount = try container.decode(Double.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productSuiteId = try container.decode(String.self, forKey: .productSuiteId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedAt = try container.decode(String.self, forKey: .modifiedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(recurring, forKey: .recurring) + + try? container.encodeIfPresent(isTrialPlan, forKey: .isTrialPlan) + + try? container.encodeIfPresent(planGroup, forKey: .planGroup) + + try? container.encodeIfPresent(tagLines, forKey: .tagLines) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(isVisible, forKey: .isVisible) + + try? container.encodeIfPresent(trialPeriod, forKey: .trialPeriod) + + try? container.encodeIfPresent(addons, forKey: .addons) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(productSuiteId, forKey: .productSuiteId) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) + } + } + + /* + Model: DetailedPlanComponents + Used By: Billing + */ + + class DetailedPlanComponents: Codable { + public var name: String? + + public var slug: String? + + public var description: String? + + public var group: String? + + public var icon: String? + + public var links: [String: Any]? + + public var enabled: Bool? + + public var displayText: String? + + public enum CodingKeys: String, CodingKey { + case name + + case slug + + case description + + case group + + case icon + + case links + + case enabled + + case displayText = "display_text" + } + + public init(description: String?, displayText: String?, enabled: Bool?, group: String?, icon: String?, links: [String: Any]?, name: String?, slug: String?) { + self.name = name + + self.slug = slug + + self.description = description + + self.group = group + + self.icon = icon + + self.links = links + + self.enabled = enabled + + self.displayText = displayText + } + + public func duplicate() -> DetailedPlanComponents { + let dict = self.dictionary! + let copy = DetailedPlanComponents(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + group = try container.decode(String.self, forKey: .group) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + links = try container.decode([String: Any].self, forKey: .links) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayText = try container.decode(String.self, forKey: .displayText) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(group, forKey: .group) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(links, forKey: .links) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(displayText, forKey: .displayText) + } + } + + /* + Model: DetailedPlan + Used By: Billing + */ + + class DetailedPlan: Codable { + public var recurring: PlanRecurring? + + public var isTrialPlan: Bool? + + public var planGroup: String? + + public var tagLines: [String]? + + public var currency: String? + + public var isActive: Bool? + + public var isVisible: Bool? + + public var trialPeriod: Double? + + public var addons: [String]? + + public var tags: [String]? + + public var type: String? + + public var country: String? + + public var id: String? + + public var name: String? + + public var description: String? + + public var amount: Double? + + public var productSuiteId: String? + + public var createdAt: String? + + public var modifiedAt: String? + + public var components: [DetailedPlanComponents]? + + public enum CodingKeys: String, CodingKey { + case recurring + + case isTrialPlan = "is_trial_plan" + + case planGroup = "plan_group" + + case tagLines = "tag_lines" + + case currency + + case isActive = "is_active" + + case isVisible = "is_visible" + + case trialPeriod = "trial_period" + + case addons + + case tags + + case type + + case country + + case id = "_id" + + case name + + case description + + case amount + + case productSuiteId = "product_suite_id" + + case createdAt = "created_at" + + case modifiedAt = "modified_at" + + case components + } + + public init(addons: [String]?, amount: Double?, components: [DetailedPlanComponents]?, country: String?, createdAt: String?, currency: String?, description: String?, isActive: Bool?, isTrialPlan: Bool?, isVisible: Bool?, modifiedAt: String?, name: String?, planGroup: String?, productSuiteId: String?, recurring: PlanRecurring?, tags: [String]?, tagLines: [String]?, trialPeriod: Double?, type: String?, id: String?) { + self.recurring = recurring + + self.isTrialPlan = isTrialPlan + + self.planGroup = planGroup + + self.tagLines = tagLines + + self.currency = currency + + self.isActive = isActive + + self.isVisible = isVisible + + self.trialPeriod = trialPeriod + + self.addons = addons + + self.tags = tags + + self.type = type + + self.country = country + + self.id = id + + self.name = name + + self.description = description + + self.amount = amount + + self.productSuiteId = productSuiteId + + self.createdAt = createdAt + + self.modifiedAt = modifiedAt + + self.components = components + } + + public func duplicate() -> DetailedPlan { + let dict = self.dictionary! + let copy = DetailedPlan(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + recurring = try container.decode(PlanRecurring.self, forKey: .recurring) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isTrialPlan = try container.decode(Bool.self, forKey: .isTrialPlan) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + planGroup = try container.decode(String.self, forKey: .planGroup) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tagLines = try container.decode([String].self, forKey: .tagLines) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isVisible = try container.decode(Bool.self, forKey: .isVisible) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + trialPeriod = try container.decode(Double.self, forKey: .trialPeriod) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addons = try container.decode([String].self, forKey: .addons) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + amount = try container.decode(Double.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productSuiteId = try container.decode(String.self, forKey: .productSuiteId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedAt = try container.decode(String.self, forKey: .modifiedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + components = try container.decode([DetailedPlanComponents].self, forKey: .components) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(recurring, forKey: .recurring) + + try? container.encodeIfPresent(isTrialPlan, forKey: .isTrialPlan) + + try? container.encodeIfPresent(planGroup, forKey: .planGroup) + + try? container.encodeIfPresent(tagLines, forKey: .tagLines) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(isVisible, forKey: .isVisible) + + try? container.encodeIfPresent(trialPeriod, forKey: .trialPeriod) + + try? container.encodeIfPresent(addons, forKey: .addons) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(productSuiteId, forKey: .productSuiteId) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) + + try? container.encodeIfPresent(components, forKey: .components) + } + } + + /* + Model: SubscriptionTrialPeriod + Used By: Billing + */ + + class SubscriptionTrialPeriod: Codable { + public var startDate: String? + + public var endDate: String? + + public enum CodingKeys: String, CodingKey { + case startDate = "start_date" + + case endDate = "end_date" + } + + public init(endDate: String?, startDate: String?) { + self.startDate = startDate + + self.endDate = endDate + } + + public func duplicate() -> SubscriptionTrialPeriod { + let dict = self.dictionary! + let copy = SubscriptionTrialPeriod(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + startDate = try container.decode(String.self, forKey: .startDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + endDate = try container.decode(String.self, forKey: .endDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(startDate, forKey: .startDate) + + try? container.encodeIfPresent(endDate, forKey: .endDate) + } + } + + /* + Model: EntityChargePrice + Used By: Billing + */ + + class EntityChargePrice: Codable { + public var amount: Double + + public var currencyCode: String + + public enum CodingKeys: String, CodingKey { + case amount + + case currencyCode = "currency_code" + } + + public init(amount: Double, currencyCode: String) { + self.amount = amount + + self.currencyCode = currencyCode + } + + public func duplicate() -> EntityChargePrice { + let dict = self.dictionary! + let copy = EntityChargePrice(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + amount = try container.decode(Double.self, forKey: .amount) + + currencyCode = try container.decode(String.self, forKey: .currencyCode) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + } + } + + /* + Model: EntityChargeRecurring + Used By: Billing + */ + + class EntityChargeRecurring: Codable { + public var interval: String + + public enum CodingKeys: String, CodingKey { + case interval + } + + public init(interval: String) { + self.interval = interval + } + + public func duplicate() -> EntityChargeRecurring { + let dict = self.dictionary! + let copy = EntityChargeRecurring(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + interval = try container.decode(String.self, forKey: .interval) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(interval, forKey: .interval) + } + } + + /* + Model: ChargeLineItem + Used By: Billing + */ + + class ChargeLineItem: Codable { + public var name: String + + public var term: String + + public var pricingType: String + + public var price: EntityChargePrice + + public var recurring: EntityChargeRecurring? + + public var cappedAmount: Double? + + public var trialDays: Int? + + public var isTest: Bool? + + public var metadata: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case name + + case term + + case pricingType = "pricing_type" + + case price + + case recurring + + case cappedAmount = "capped_amount" + + case trialDays = "trial_days" + + case isTest = "is_test" + + case metadata + } + + public init(cappedAmount: Double?, isTest: Bool?, metadata: [String: Any]?, name: String, price: EntityChargePrice, pricingType: String, recurring: EntityChargeRecurring?, term: String, trialDays: Int?) { + self.name = name + + self.term = term + + self.pricingType = pricingType + + self.price = price + + self.recurring = recurring + + self.cappedAmount = cappedAmount + + self.trialDays = trialDays + + self.isTest = isTest + + self.metadata = metadata + } + + public func duplicate() -> ChargeLineItem { + let dict = self.dictionary! + let copy = ChargeLineItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + name = try container.decode(String.self, forKey: .name) + + term = try container.decode(String.self, forKey: .term) + + pricingType = try container.decode(String.self, forKey: .pricingType) + + price = try container.decode(EntityChargePrice.self, forKey: .price) + + do { + recurring = try container.decode(EntityChargeRecurring.self, forKey: .recurring) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cappedAmount = try container.decode(Double.self, forKey: .cappedAmount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + trialDays = try container.decode(Int.self, forKey: .trialDays) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isTest = try container.decode(Bool.self, forKey: .isTest) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + metadata = try container.decode([String: Any].self, forKey: .metadata) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(term, forKey: .term) + + try? container.encodeIfPresent(pricingType, forKey: .pricingType) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(recurring, forKey: .recurring) + + try? container.encodeIfPresent(cappedAmount, forKey: .cappedAmount) + + try? container.encodeIfPresent(trialDays, forKey: .trialDays) + + try? container.encodeIfPresent(isTest, forKey: .isTest) + + try? container.encodeIfPresent(metadata, forKey: .metadata) + } + } + + /* + Model: CreateSubscriptionCharge + Used By: Billing + */ + + class CreateSubscriptionCharge: Codable { + public var name: String + + public var trialDays: Int? + + public var lineItems: [ChargeLineItem] + + public var isTest: Bool? + + public var returnUrl: String + + public enum CodingKeys: String, CodingKey { + case name + + case trialDays = "trial_days" + + case lineItems = "line_items" + + case isTest = "is_test" + + case returnUrl = "return_url" + } + + public init(isTest: Bool?, lineItems: [ChargeLineItem], name: String, returnUrl: String, trialDays: Int?) { + self.name = name + + self.trialDays = trialDays + + self.lineItems = lineItems + + self.isTest = isTest + + self.returnUrl = returnUrl + } + + public func duplicate() -> CreateSubscriptionCharge { + let dict = self.dictionary! + let copy = CreateSubscriptionCharge(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + name = try container.decode(String.self, forKey: .name) + + do { + trialDays = try container.decode(Int.self, forKey: .trialDays) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + lineItems = try container.decode([ChargeLineItem].self, forKey: .lineItems) + + do { + isTest = try container.decode(Bool.self, forKey: .isTest) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + returnUrl = try container.decode(String.self, forKey: .returnUrl) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(trialDays, forKey: .trialDays) + + try? container.encodeIfPresent(lineItems, forKey: .lineItems) + + try? container.encodeIfPresent(isTest, forKey: .isTest) + + try? container.encodeIfPresent(returnUrl, forKey: .returnUrl) + } + } + + /* + Model: CurrentPeriod + Used By: Billing + */ + + class CurrentPeriod: Codable { + public var startDate: String? + + public var endDate: String? + + public enum CodingKeys: String, CodingKey { + case startDate = "start_date" + + case endDate = "end_date" + } + + public init(endDate: String?, startDate: String?) { + self.startDate = startDate + + self.endDate = endDate + } + + public func duplicate() -> CurrentPeriod { + let dict = self.dictionary! + let copy = CurrentPeriod(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + startDate = try container.decode(String.self, forKey: .startDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + endDate = try container.decode(String.self, forKey: .endDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(startDate, forKey: .startDate) + + try? container.encodeIfPresent(endDate, forKey: .endDate) + } + } + + /* + Model: SubscriptionCharge + Used By: Billing + */ + + class SubscriptionCharge: Codable { + public var id: String? + + public var name: String? + + public var term: String? + + public var pricingType: String? + + public var price: EntityChargePrice? + + public var recurring: EntityChargeRecurring? + + public var cappedAmount: Double? + + public var activatedOn: String? + + public var cancelledOn: String? + + public var billingDate: String? + + public var currentPeriod: CurrentPeriod? + + public var status: String? + + public var isTest: Bool? + + public var metadata: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case name + + case term + + case pricingType = "pricing_type" + + case price + + case recurring + + case cappedAmount = "capped_amount" + + case activatedOn = "activated_on" + + case cancelledOn = "cancelled_on" + + case billingDate = "billing_date" + + case currentPeriod = "current_period" + + case status + + case isTest = "is_test" + + case metadata + } + + public init(activatedOn: String?, billingDate: String?, cancelledOn: String?, cappedAmount: Double?, currentPeriod: CurrentPeriod?, isTest: Bool?, metadata: [String: Any]?, name: String?, price: EntityChargePrice?, pricingType: String?, recurring: EntityChargeRecurring?, status: String?, term: String?, id: String?) { + self.id = id + + self.name = name + + self.term = term + + self.pricingType = pricingType + + self.price = price + + self.recurring = recurring + + self.cappedAmount = cappedAmount + + self.activatedOn = activatedOn + + self.cancelledOn = cancelledOn + + self.billingDate = billingDate + + self.currentPeriod = currentPeriod + + self.status = status + + self.isTest = isTest + + self.metadata = metadata + } + + public func duplicate() -> SubscriptionCharge { + let dict = self.dictionary! + let copy = SubscriptionCharge(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + term = try container.decode(String.self, forKey: .term) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pricingType = try container.decode(String.self, forKey: .pricingType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(EntityChargePrice.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + recurring = try container.decode(EntityChargeRecurring.self, forKey: .recurring) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cappedAmount = try container.decode(Double.self, forKey: .cappedAmount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + activatedOn = try container.decode(String.self, forKey: .activatedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cancelledOn = try container.decode(String.self, forKey: .cancelledOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + billingDate = try container.decode(String.self, forKey: .billingDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currentPeriod = try container.decode(CurrentPeriod.self, forKey: .currentPeriod) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isTest = try container.decode(Bool.self, forKey: .isTest) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + metadata = try container.decode([String: Any].self, forKey: .metadata) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(term, forKey: .term) + + try? container.encodeIfPresent(pricingType, forKey: .pricingType) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(recurring, forKey: .recurring) + + try? container.encodeIfPresent(cappedAmount, forKey: .cappedAmount) + + try? container.encodeIfPresent(activatedOn, forKey: .activatedOn) + + try? container.encodeIfPresent(cancelledOn, forKey: .cancelledOn) + + try? container.encodeIfPresent(billingDate, forKey: .billingDate) + + try? container.encodeIfPresent(currentPeriod, forKey: .currentPeriod) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(isTest, forKey: .isTest) + + try? container.encodeIfPresent(metadata, forKey: .metadata) + } + } + + /* + Model: EntitySubscription + Used By: Billing + */ + + class EntitySubscription: Codable { + public var id: String? + + public var name: String? + + public var status: String? + + public var companyId: Int? + + public var activatedOn: String? + + public var cancelledOn: String? + + public var trialDays: Int? + + public var trialPeriod: SubscriptionTrialPeriod? + + public var metadata: [String: Any]? + + public var lineItems: [SubscriptionCharge]? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case name + + case status + + case companyId = "company_id" + + case activatedOn = "activated_on" + + case cancelledOn = "cancelled_on" + + case trialDays = "trial_days" + + case trialPeriod = "trial_period" + + case metadata + + case lineItems = "line_items" + } + + public init(activatedOn: String?, cancelledOn: String?, companyId: Int?, lineItems: [SubscriptionCharge]?, metadata: [String: Any]?, name: String?, status: String?, trialDays: Int?, trialPeriod: SubscriptionTrialPeriod?, id: String?) { + self.id = id + + self.name = name + + self.status = status + + self.companyId = companyId + + self.activatedOn = activatedOn + + self.cancelledOn = cancelledOn + + self.trialDays = trialDays + + self.trialPeriod = trialPeriod + + self.metadata = metadata + + self.lineItems = lineItems + } + + public func duplicate() -> EntitySubscription { + let dict = self.dictionary! + let copy = EntitySubscription(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + activatedOn = try container.decode(String.self, forKey: .activatedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cancelledOn = try container.decode(String.self, forKey: .cancelledOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + trialDays = try container.decode(Int.self, forKey: .trialDays) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + trialPeriod = try container.decode(SubscriptionTrialPeriod.self, forKey: .trialPeriod) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + metadata = try container.decode([String: Any].self, forKey: .metadata) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lineItems = try container.decode([SubscriptionCharge].self, forKey: .lineItems) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(activatedOn, forKey: .activatedOn) + + try? container.encodeIfPresent(cancelledOn, forKey: .cancelledOn) + + try? container.encodeIfPresent(trialDays, forKey: .trialDays) + + try? container.encodeIfPresent(trialPeriod, forKey: .trialPeriod) + + try? container.encodeIfPresent(metadata, forKey: .metadata) + + try? container.encodeIfPresent(lineItems, forKey: .lineItems) + } + } + + /* + Model: CreateSubscriptionResponse + Used By: Billing + */ + + class CreateSubscriptionResponse: Codable { + public var subscription: EntitySubscription? + + public var confirmUrl: String? + + public enum CodingKeys: String, CodingKey { + case subscription + + case confirmUrl = "confirm_url" + } + + public init(confirmUrl: String?, subscription: EntitySubscription?) { + self.subscription = subscription + + self.confirmUrl = confirmUrl + } + + public func duplicate() -> CreateSubscriptionResponse { + let dict = self.dictionary! + let copy = CreateSubscriptionResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + subscription = try container.decode(EntitySubscription.self, forKey: .subscription) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + confirmUrl = try container.decode(String.self, forKey: .confirmUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(subscription, forKey: .subscription) + + try? container.encodeIfPresent(confirmUrl, forKey: .confirmUrl) + } + } + + /* + Model: InvoiceDetailsPeriod + Used By: Billing + */ + + class InvoiceDetailsPeriod: Codable { + public var start: String? + + public var end: String? + + public enum CodingKeys: String, CodingKey { + case start + + case end + } + + public init(end: String?, start: String?) { + self.start = start + + self.end = end + } + + public func duplicate() -> InvoiceDetailsPeriod { + let dict = self.dictionary! + let copy = InvoiceDetailsPeriod(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + start = try container.decode(String.self, forKey: .start) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + end = try container.decode(String.self, forKey: .end) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(start, forKey: .start) + + try? container.encodeIfPresent(end, forKey: .end) + } + } + + /* + Model: InvoiceDetailsClient + Used By: Billing + */ + + class InvoiceDetailsClient: Codable { + public var addressLines: [String]? + + public var name: String? + + public var email: String? + + public var phone: String? + + public enum CodingKeys: String, CodingKey { + case addressLines = "address_lines" + + case name + + case email + + case phone + } + + public init(addressLines: [String]?, email: String?, name: String?, phone: String?) { + self.addressLines = addressLines + + self.name = name + + self.email = email + + self.phone = phone + } + + public func duplicate() -> InvoiceDetailsClient { + let dict = self.dictionary! + let copy = InvoiceDetailsClient(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + addressLines = try container.decode([String].self, forKey: .addressLines) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(addressLines, forKey: .addressLines) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(phone, forKey: .phone) + } + } + + /* + Model: InvoiceDetailsStatusTrail + Used By: Billing + */ + + class InvoiceDetailsStatusTrail: Codable { + public var id: String? + + public var value: String? + + public var timestamp: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case value + + case timestamp + } + + public init(timestamp: String?, value: String?, id: String?) { + self.id = id + + self.value = value + + self.timestamp = timestamp + } + + public func duplicate() -> InvoiceDetailsStatusTrail { + let dict = self.dictionary! + let copy = InvoiceDetailsStatusTrail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + timestamp = try container.decode(String.self, forKey: .timestamp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(timestamp, forKey: .timestamp) + } + } + + /* + Model: InvoiceDetailsPaymentMethodsDataChecks + Used By: Billing + */ + + class InvoiceDetailsPaymentMethodsDataChecks: Codable { + public var cvcCheck: String? + + public var addressLine1Check: String? + + public var addressPostalCodeCheck: String? + + public enum CodingKeys: String, CodingKey { + case cvcCheck = "cvc_check" + + case addressLine1Check = "address_line1_check" + + case addressPostalCodeCheck = "address_postal_code_check" + } + + public init(addressLine1Check: String?, addressPostalCodeCheck: String?, cvcCheck: String?) { + self.cvcCheck = cvcCheck + + self.addressLine1Check = addressLine1Check + + self.addressPostalCodeCheck = addressPostalCodeCheck + } + + public func duplicate() -> InvoiceDetailsPaymentMethodsDataChecks { + let dict = self.dictionary! + let copy = InvoiceDetailsPaymentMethodsDataChecks(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + cvcCheck = try container.decode(String.self, forKey: .cvcCheck) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressLine1Check = try container.decode(String.self, forKey: .addressLine1Check) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressPostalCodeCheck = try container.decode(String.self, forKey: .addressPostalCodeCheck) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(cvcCheck, forKey: .cvcCheck) + + try? container.encodeIfPresent(addressLine1Check, forKey: .addressLine1Check) + + try? container.encodeIfPresent(addressPostalCodeCheck, forKey: .addressPostalCodeCheck) + } + } + + /* + Model: InvoiceDetailsPaymentMethodsDataNetworks + Used By: Billing + */ + + class InvoiceDetailsPaymentMethodsDataNetworks: Codable { + public var available: [String]? + + public var preferred: String? + + public enum CodingKeys: String, CodingKey { + case available + + case preferred + } + + public init(available: [String]?, preferred: String?) { + self.available = available + + self.preferred = preferred + } + + public func duplicate() -> InvoiceDetailsPaymentMethodsDataNetworks { + let dict = self.dictionary! + let copy = InvoiceDetailsPaymentMethodsDataNetworks(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + available = try container.decode([String].self, forKey: .available) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + preferred = try container.decode(String.self, forKey: .preferred) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(available, forKey: .available) + + try? container.encodeIfPresent(preferred, forKey: .preferred) + } + } + + /* + Model: InvoiceDetailsPaymentMethodsDataThreeDSecureUsage + Used By: Billing + */ + + class InvoiceDetailsPaymentMethodsDataThreeDSecureUsage: Codable { + public var supported: Bool? + + public enum CodingKeys: String, CodingKey { + case supported + } + + public init(supported: Bool?) { + self.supported = supported + } + + public func duplicate() -> InvoiceDetailsPaymentMethodsDataThreeDSecureUsage { + let dict = self.dictionary! + let copy = InvoiceDetailsPaymentMethodsDataThreeDSecureUsage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + supported = try container.decode(Bool.self, forKey: .supported) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(supported, forKey: .supported) + } + } + + /* + Model: InvoiceDetailsPaymentMethodsData + Used By: Billing + */ + + class InvoiceDetailsPaymentMethodsData: Codable { + public var brand: String? + + public var last4: String? + + public var checks: InvoiceDetailsPaymentMethodsDataChecks? + + public var wallet: String? + + public var country: String? + + public var funding: String? + + public var expYear: Int? + + public var networks: InvoiceDetailsPaymentMethodsDataNetworks? + + public var expMonth: Int? + + public var fingerprint: String? + + public var generatedFrom: String? + + public var threeDSecureUsage: InvoiceDetailsPaymentMethodsDataThreeDSecureUsage? + + public enum CodingKeys: String, CodingKey { + case brand + + case last4 + + case checks + + case wallet + + case country + + case funding + + case expYear = "exp_year" + + case networks + + case expMonth = "exp_month" + + case fingerprint + + case generatedFrom = "generated_from" + + case threeDSecureUsage = "three_d_secure_usage" + } + + public init(brand: String?, checks: InvoiceDetailsPaymentMethodsDataChecks?, country: String?, expMonth: Int?, expYear: Int?, fingerprint: String?, funding: String?, generatedFrom: String?, last4: String?, networks: InvoiceDetailsPaymentMethodsDataNetworks?, threeDSecureUsage: InvoiceDetailsPaymentMethodsDataThreeDSecureUsage?, wallet: String?) { + self.brand = brand + + self.last4 = last4 + + self.checks = checks + + self.wallet = wallet + + self.country = country + + self.funding = funding + + self.expYear = expYear + + self.networks = networks + + self.expMonth = expMonth + + self.fingerprint = fingerprint + + self.generatedFrom = generatedFrom + + self.threeDSecureUsage = threeDSecureUsage + } + + public func duplicate() -> InvoiceDetailsPaymentMethodsData { + let dict = self.dictionary! + let copy = InvoiceDetailsPaymentMethodsData(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + brand = try container.decode(String.self, forKey: .brand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + last4 = try container.decode(String.self, forKey: .last4) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + checks = try container.decode(InvoiceDetailsPaymentMethodsDataChecks.self, forKey: .checks) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + wallet = try container.decode(String.self, forKey: .wallet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + funding = try container.decode(String.self, forKey: .funding) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expYear = try container.decode(Int.self, forKey: .expYear) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + networks = try container.decode(InvoiceDetailsPaymentMethodsDataNetworks.self, forKey: .networks) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expMonth = try container.decode(Int.self, forKey: .expMonth) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fingerprint = try container.decode(String.self, forKey: .fingerprint) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + generatedFrom = try container.decode(String.self, forKey: .generatedFrom) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + threeDSecureUsage = try container.decode(InvoiceDetailsPaymentMethodsDataThreeDSecureUsage.self, forKey: .threeDSecureUsage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(brand, forKey: .brand) + + try? container.encodeIfPresent(last4, forKey: .last4) + + try? container.encodeIfPresent(checks, forKey: .checks) + + try? container.encodeIfPresent(wallet, forKey: .wallet) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(funding, forKey: .funding) + + try? container.encodeIfPresent(expYear, forKey: .expYear) + + try? container.encodeIfPresent(networks, forKey: .networks) + + try? container.encodeIfPresent(expMonth, forKey: .expMonth) + + try? container.encodeIfPresent(fingerprint, forKey: .fingerprint) + + try? container.encodeIfPresent(generatedFrom, forKey: .generatedFrom) + + try? container.encodeIfPresent(threeDSecureUsage, forKey: .threeDSecureUsage) + } + } + + /* + Model: InvoiceDetailsPaymentMethods + Used By: Billing + */ + + class InvoiceDetailsPaymentMethods: Codable { + public var id: Int? + + public var type: String? + + public var pgPaymentMethodId: String? + + public var data: InvoiceDetailsPaymentMethodsData? + + public var isDefault: Bool? + + public enum CodingKeys: String, CodingKey { + case id + + case type + + case pgPaymentMethodId = "pg_payment_method_id" + + case data + + case isDefault = "is_default" + } + + public init(data: InvoiceDetailsPaymentMethodsData?, id: Int?, isDefault: Bool?, pgPaymentMethodId: String?, type: String?) { + self.id = id + + self.type = type + + self.pgPaymentMethodId = pgPaymentMethodId + + self.data = data + + self.isDefault = isDefault + } + + public func duplicate() -> InvoiceDetailsPaymentMethods { + let dict = self.dictionary! + let copy = InvoiceDetailsPaymentMethods(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pgPaymentMethodId = try container.decode(String.self, forKey: .pgPaymentMethodId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode(InvoiceDetailsPaymentMethodsData.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isDefault = try container.decode(Bool.self, forKey: .isDefault) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(pgPaymentMethodId, forKey: .pgPaymentMethodId) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(isDefault, forKey: .isDefault) + } + } + + /* + Model: InvoicePaymentMethod + Used By: Billing + */ + + class InvoicePaymentMethod: Codable { + public var pgPaymentMethodId: String? + + public enum CodingKeys: String, CodingKey { + case pgPaymentMethodId = "pg_payment_method_id" + } + + public init(pgPaymentMethodId: String?) { + self.pgPaymentMethodId = pgPaymentMethodId + } + + public func duplicate() -> InvoicePaymentMethod { + let dict = self.dictionary! + let copy = InvoicePaymentMethod(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + pgPaymentMethodId = try container.decode(String.self, forKey: .pgPaymentMethodId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pgPaymentMethodId, forKey: .pgPaymentMethodId) + } + } + + /* + Model: InvoiceDetails + Used By: Billing + */ + + class InvoiceDetails: Codable { + public var period: InvoiceDetailsPeriod? + + public var client: InvoiceDetailsClient? + + public var autoAdvance: Bool? + + public var currency: String? + + public var paid: Bool? + + public var attemp: Int? + + public var id: String? + + public var collectionMethod: String? + + public var subscriberId: String? + + public var invoiceUrl: String? + + public var number: String? + + public var pgData: [String: Any]? + + public var receiptNumber: String? + + public var statementDescriptor: String? + + public var currentStatus: String? + + public var statusTrail: [InvoiceDetailsStatusTrail]? + + public var subtotal: Double? + + public var total: Double? + + public var subscription: String? + + public var nextActionTime: String? + + public var createdAt: String? + + public var modifiedAt: String? + + public var hashIdentifier: String? + + public var paymentMethod: InvoicePaymentMethod? + + public enum CodingKeys: String, CodingKey { + case period + + case client + + case autoAdvance = "auto_advance" + + case currency + + case paid + + case attemp + + case id = "_id" + + case collectionMethod = "collection_method" + + case subscriberId = "subscriber_id" + + case invoiceUrl = "invoice_url" + + case number + + case pgData = "pg_data" + + case receiptNumber = "receipt_number" + + case statementDescriptor = "statement_descriptor" + + case currentStatus = "current_status" + + case statusTrail = "status_trail" + + case subtotal + + case total + + case subscription + + case nextActionTime = "next_action_time" + + case createdAt = "created_at" + + case modifiedAt = "modified_at" + + case hashIdentifier = "hash_identifier" + + case paymentMethod = "payment_method" + } + + public init(attemp: Int?, autoAdvance: Bool?, client: InvoiceDetailsClient?, collectionMethod: String?, createdAt: String?, currency: String?, currentStatus: String?, hashIdentifier: String?, invoiceUrl: String?, modifiedAt: String?, nextActionTime: String?, number: String?, paid: Bool?, paymentMethod: InvoicePaymentMethod?, period: InvoiceDetailsPeriod?, pgData: [String: Any]?, receiptNumber: String?, statementDescriptor: String?, statusTrail: [InvoiceDetailsStatusTrail]?, subscriberId: String?, subscription: String?, subtotal: Double?, total: Double?, id: String?) { + self.period = period + + self.client = client + + self.autoAdvance = autoAdvance + + self.currency = currency + + self.paid = paid + + self.attemp = attemp + + self.id = id + + self.collectionMethod = collectionMethod + + self.subscriberId = subscriberId + + self.invoiceUrl = invoiceUrl + + self.number = number + + self.pgData = pgData + + self.receiptNumber = receiptNumber + + self.statementDescriptor = statementDescriptor + + self.currentStatus = currentStatus + + self.statusTrail = statusTrail + + self.subtotal = subtotal + + self.total = total + + self.subscription = subscription + + self.nextActionTime = nextActionTime + + self.createdAt = createdAt + + self.modifiedAt = modifiedAt + + self.hashIdentifier = hashIdentifier + + self.paymentMethod = paymentMethod + } + + public func duplicate() -> InvoiceDetails { + let dict = self.dictionary! + let copy = InvoiceDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + period = try container.decode(InvoiceDetailsPeriod.self, forKey: .period) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + client = try container.decode(InvoiceDetailsClient.self, forKey: .client) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + autoAdvance = try container.decode(Bool.self, forKey: .autoAdvance) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paid = try container.decode(Bool.self, forKey: .paid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attemp = try container.decode(Int.self, forKey: .attemp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + collectionMethod = try container.decode(String.self, forKey: .collectionMethod) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subscriberId = try container.decode(String.self, forKey: .subscriberId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + invoiceUrl = try container.decode(String.self, forKey: .invoiceUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + number = try container.decode(String.self, forKey: .number) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pgData = try container.decode([String: Any].self, forKey: .pgData) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + receiptNumber = try container.decode(String.self, forKey: .receiptNumber) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + statementDescriptor = try container.decode(String.self, forKey: .statementDescriptor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currentStatus = try container.decode(String.self, forKey: .currentStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + statusTrail = try container.decode([InvoiceDetailsStatusTrail].self, forKey: .statusTrail) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subtotal = try container.decode(Double.self, forKey: .subtotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + total = try container.decode(Double.self, forKey: .total) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subscription = try container.decode(String.self, forKey: .subscription) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + nextActionTime = try container.decode(String.self, forKey: .nextActionTime) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedAt = try container.decode(String.self, forKey: .modifiedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hashIdentifier = try container.decode(String.self, forKey: .hashIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentMethod = try container.decode(InvoicePaymentMethod.self, forKey: .paymentMethod) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(period, forKey: .period) + + try? container.encodeIfPresent(client, forKey: .client) + + try? container.encodeIfPresent(autoAdvance, forKey: .autoAdvance) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(paid, forKey: .paid) + + try? container.encodeIfPresent(attemp, forKey: .attemp) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(collectionMethod, forKey: .collectionMethod) + + try? container.encodeIfPresent(subscriberId, forKey: .subscriberId) + + try? container.encodeIfPresent(invoiceUrl, forKey: .invoiceUrl) + + try? container.encodeIfPresent(number, forKey: .number) + + try? container.encodeIfPresent(pgData, forKey: .pgData) + + try? container.encodeIfPresent(receiptNumber, forKey: .receiptNumber) + + try? container.encodeIfPresent(statementDescriptor, forKey: .statementDescriptor) + + try? container.encodeIfPresent(currentStatus, forKey: .currentStatus) + + try? container.encodeIfPresent(statusTrail, forKey: .statusTrail) + + try? container.encodeIfPresent(subtotal, forKey: .subtotal) + + try? container.encodeIfPresent(total, forKey: .total) + + try? container.encodeIfPresent(subscription, forKey: .subscription) + + try? container.encodeIfPresent(nextActionTime, forKey: .nextActionTime) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) + + try? container.encodeIfPresent(hashIdentifier, forKey: .hashIdentifier) + + try? container.encodeIfPresent(paymentMethod, forKey: .paymentMethod) + } + } + + /* + Model: InvoiceItemsPlanRecurring + Used By: Billing + */ + + class InvoiceItemsPlanRecurring: Codable { + public var interval: String? + + public var intervalCount: Int? + + public enum CodingKeys: String, CodingKey { + case interval + + case intervalCount = "interval_count" + } + + public init(interval: String?, intervalCount: Int?) { + self.interval = interval + + self.intervalCount = intervalCount + } + + public func duplicate() -> InvoiceItemsPlanRecurring { + let dict = self.dictionary! + let copy = InvoiceItemsPlanRecurring(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + interval = try container.decode(String.self, forKey: .interval) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + intervalCount = try container.decode(Int.self, forKey: .intervalCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(interval, forKey: .interval) + + try? container.encodeIfPresent(intervalCount, forKey: .intervalCount) + } + } + + /* + Model: InvoiceItemsPlan + Used By: Billing + */ + + class InvoiceItemsPlan: Codable { + public var recurring: InvoiceItemsPlanRecurring? + + public var isTrialPlan: Bool? + + public var planGroup: String? + + public var tagLines: [String]? + + public var currency: String? + + public var isActive: Bool? + + public var isVisible: Bool? + + public var trialPeriod: Int? + + public var addons: [String]? + + public var tags: [String]? + + public var type: String? + + public var country: String? + + public var id: String? + + public var name: String? + + public var description: String? + + public var amount: Int? + + public var productSuiteId: String? + + public var createdAt: String? + + public var modifiedAt: String? + + public enum CodingKeys: String, CodingKey { + case recurring + + case isTrialPlan = "is_trial_plan" + + case planGroup = "plan_group" + + case tagLines = "tag_lines" + + case currency + + case isActive = "is_active" + + case isVisible = "is_visible" + + case trialPeriod = "trial_period" + + case addons + + case tags + + case type + + case country + + case id = "_id" + + case name + + case description + + case amount + + case productSuiteId = "product_suite_id" + + case createdAt = "created_at" + + case modifiedAt = "modified_at" + } + + public init(addons: [String]?, amount: Int?, country: String?, createdAt: String?, currency: String?, description: String?, isActive: Bool?, isTrialPlan: Bool?, isVisible: Bool?, modifiedAt: String?, name: String?, planGroup: String?, productSuiteId: String?, recurring: InvoiceItemsPlanRecurring?, tags: [String]?, tagLines: [String]?, trialPeriod: Int?, type: String?, id: String?) { + self.recurring = recurring + + self.isTrialPlan = isTrialPlan + + self.planGroup = planGroup + + self.tagLines = tagLines + + self.currency = currency + + self.isActive = isActive + + self.isVisible = isVisible + + self.trialPeriod = trialPeriod + + self.addons = addons + + self.tags = tags + + self.type = type + + self.country = country + + self.id = id + + self.name = name + + self.description = description + + self.amount = amount + + self.productSuiteId = productSuiteId + + self.createdAt = createdAt + + self.modifiedAt = modifiedAt + } + + public func duplicate() -> InvoiceItemsPlan { + let dict = self.dictionary! + let copy = InvoiceItemsPlan(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + recurring = try container.decode(InvoiceItemsPlanRecurring.self, forKey: .recurring) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isTrialPlan = try container.decode(Bool.self, forKey: .isTrialPlan) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + planGroup = try container.decode(String.self, forKey: .planGroup) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tagLines = try container.decode([String].self, forKey: .tagLines) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isVisible = try container.decode(Bool.self, forKey: .isVisible) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + trialPeriod = try container.decode(Int.self, forKey: .trialPeriod) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addons = try container.decode([String].self, forKey: .addons) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + amount = try container.decode(Int.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productSuiteId = try container.decode(String.self, forKey: .productSuiteId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedAt = try container.decode(String.self, forKey: .modifiedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(recurring, forKey: .recurring) + + try? container.encodeIfPresent(isTrialPlan, forKey: .isTrialPlan) + + try? container.encodeIfPresent(planGroup, forKey: .planGroup) + + try? container.encodeIfPresent(tagLines, forKey: .tagLines) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(isVisible, forKey: .isVisible) + + try? container.encodeIfPresent(trialPeriod, forKey: .trialPeriod) + + try? container.encodeIfPresent(addons, forKey: .addons) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(productSuiteId, forKey: .productSuiteId) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) + } + } + + /* + Model: InvoiceItemsPeriod + Used By: Billing + */ + + class InvoiceItemsPeriod: Codable { + public var start: String? + + public var end: String? + + public enum CodingKeys: String, CodingKey { + case start + + case end + } + + public init(end: String?, start: String?) { + self.start = start + + self.end = end + } + + public func duplicate() -> InvoiceItemsPeriod { + let dict = self.dictionary! + let copy = InvoiceItemsPeriod(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + start = try container.decode(String.self, forKey: .start) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + end = try container.decode(String.self, forKey: .end) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(start, forKey: .start) + + try? container.encodeIfPresent(end, forKey: .end) + } + } + + /* + Model: InvoiceItems + Used By: Billing + */ + + class InvoiceItems: Codable { + public var id: String? + + public var currency: String? + + public var plan: InvoiceItemsPlan? + + public var name: String? + + public var quantity: Int? + + public var description: String? + + public var period: InvoiceItemsPeriod? + + public var unitAmount: Double? + + public var amount: Double? + + public var type: String? + + public var invoiceId: String? + + public var createdAt: String? + + public var modifiedAt: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case currency + + case plan + + case name + + case quantity + + case description + + case period + + case unitAmount = "unit_amount" + + case amount + + case type + + case invoiceId = "invoice_id" + + case createdAt = "created_at" + + case modifiedAt = "modified_at" + } + + public init(amount: Double?, createdAt: String?, currency: String?, description: String?, invoiceId: String?, modifiedAt: String?, name: String?, period: InvoiceItemsPeriod?, plan: InvoiceItemsPlan?, quantity: Int?, type: String?, unitAmount: Double?, id: String?) { + self.id = id + + self.currency = currency + + self.plan = plan + + self.name = name + + self.quantity = quantity + + self.description = description + + self.period = period + + self.unitAmount = unitAmount + + self.amount = amount + + self.type = type + + self.invoiceId = invoiceId + + self.createdAt = createdAt + + self.modifiedAt = modifiedAt + } + + public func duplicate() -> InvoiceItems { + let dict = self.dictionary! + let copy = InvoiceItems(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + plan = try container.decode(InvoiceItemsPlan.self, forKey: .plan) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + period = try container.decode(InvoiceItemsPeriod.self, forKey: .period) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + unitAmount = try container.decode(Double.self, forKey: .unitAmount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + amount = try container.decode(Double.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + invoiceId = try container.decode(String.self, forKey: .invoiceId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedAt = try container.decode(String.self, forKey: .modifiedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(plan, forKey: .plan) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(period, forKey: .period) + + try? container.encodeIfPresent(unitAmount, forKey: .unitAmount) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(invoiceId, forKey: .invoiceId) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) + } + } + + /* + Model: Invoice + Used By: Billing + */ + + class Invoice: Codable { + public var invoice: InvoiceDetails? + + public var invoiceItems: [InvoiceItems]? + + public enum CodingKeys: String, CodingKey { + case invoice + + case invoiceItems = "invoice_items" + } + + public init(invoice: InvoiceDetails?, invoiceItems: [InvoiceItems]?) { + self.invoice = invoice + + self.invoiceItems = invoiceItems + } + + public func duplicate() -> Invoice { + let dict = self.dictionary! + let copy = Invoice(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + invoice = try container.decode(InvoiceDetails.self, forKey: .invoice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + invoiceItems = try container.decode([InvoiceItems].self, forKey: .invoiceItems) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(invoice, forKey: .invoice) + + try? container.encodeIfPresent(invoiceItems, forKey: .invoiceItems) + } + } + + /* + Model: InvoicesDataClient + Used By: Billing + */ + + class InvoicesDataClient: Codable { + public var name: String? + + public var email: String? + + public var phone: String? + + public var addressLines: [String]? + + public enum CodingKeys: String, CodingKey { + case name + + case email + + case phone + + case addressLines = "address_lines" + } + + public init(addressLines: [String]?, email: String?, name: String?, phone: String?) { + self.name = name + + self.email = email + + self.phone = phone + + self.addressLines = addressLines + } + + public func duplicate() -> InvoicesDataClient { + let dict = self.dictionary! + let copy = InvoicesDataClient(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressLines = try container.decode([String].self, forKey: .addressLines) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(addressLines, forKey: .addressLines) + } + } + + /* + Model: InvoicesDataPeriod + Used By: Billing + */ + + class InvoicesDataPeriod: Codable { + public var start: String? + + public var end: String? + + public enum CodingKeys: String, CodingKey { + case start + + case end + } + + public init(end: String?, start: String?) { + self.start = start + + self.end = end + } + + public func duplicate() -> InvoicesDataPeriod { + let dict = self.dictionary! + let copy = InvoicesDataPeriod(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + start = try container.decode(String.self, forKey: .start) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + end = try container.decode(String.self, forKey: .end) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(start, forKey: .start) + + try? container.encodeIfPresent(end, forKey: .end) + } + } + + /* + Model: InvoicesDataPaymentMethod + Used By: Billing + */ + + class InvoicesDataPaymentMethod: Codable { + public var pgPaymentMethodId: String? + + public enum CodingKeys: String, CodingKey { + case pgPaymentMethodId = "pg_payment_method_id" + } + + public init(pgPaymentMethodId: String?) { + self.pgPaymentMethodId = pgPaymentMethodId + } + + public func duplicate() -> InvoicesDataPaymentMethod { + let dict = self.dictionary! + let copy = InvoicesDataPaymentMethod(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + pgPaymentMethodId = try container.decode(String.self, forKey: .pgPaymentMethodId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pgPaymentMethodId, forKey: .pgPaymentMethodId) + } + } + + /* + Model: InvoicesData + Used By: Billing + */ + + class InvoicesData: Codable { + public var id: String? + + public var client: InvoicesDataClient? + + public var autoAdvance: Bool? + + public var currency: String? + + public var paid: Bool? + + public var attemp: Int? + + public var collectionMethod: String? + + public var subscriberId: String? + + public var invoiceUrl: String? + + public var number: String? + + public var pgData: [String: Any]? + + public var period: InvoicesDataPeriod? + + public var receiptNumber: String? + + public var statementDescriptor: String? + + public var currentStatus: String? + + public var statusTrail: [InvoiceDetailsStatusTrail]? + + public var subtotal: Double? + + public var total: Double? + + public var subscription: String? + + public var nextActionTime: String? + + public var createdAt: String? + + public var modifiedAt: String? + + public var hashIdentifier: String? + + public var paymentMethod: InvoicesDataPaymentMethod? + + public var invoiceItems: [InvoiceItems]? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case client + + case autoAdvance = "auto_advance" + + case currency + + case paid + + case attemp + + case collectionMethod = "collection_method" + + case subscriberId = "subscriber_id" + + case invoiceUrl = "invoice_url" + + case number + + case pgData = "pg_data" + + case period + + case receiptNumber = "receipt_number" + + case statementDescriptor = "statement_descriptor" + + case currentStatus = "current_status" + + case statusTrail = "status_trail" + + case subtotal + + case total + + case subscription + + case nextActionTime = "next_action_time" + + case createdAt = "created_at" + + case modifiedAt = "modified_at" + + case hashIdentifier = "hash_identifier" + + case paymentMethod = "payment_method" + + case invoiceItems = "invoice_items" + } + + public init(attemp: Int?, autoAdvance: Bool?, client: InvoicesDataClient?, collectionMethod: String?, createdAt: String?, currency: String?, currentStatus: String?, hashIdentifier: String?, invoiceItems: [InvoiceItems]?, invoiceUrl: String?, modifiedAt: String?, nextActionTime: String?, number: String?, paid: Bool?, paymentMethod: InvoicesDataPaymentMethod?, period: InvoicesDataPeriod?, pgData: [String: Any]?, receiptNumber: String?, statementDescriptor: String?, statusTrail: [InvoiceDetailsStatusTrail]?, subscriberId: String?, subscription: String?, subtotal: Double?, total: Double?, id: String?) { + self.id = id + + self.client = client + + self.autoAdvance = autoAdvance + + self.currency = currency + + self.paid = paid + + self.attemp = attemp + + self.collectionMethod = collectionMethod + + self.subscriberId = subscriberId + + self.invoiceUrl = invoiceUrl + + self.number = number + + self.pgData = pgData + + self.period = period + + self.receiptNumber = receiptNumber + + self.statementDescriptor = statementDescriptor + + self.currentStatus = currentStatus + + self.statusTrail = statusTrail + + self.subtotal = subtotal + + self.total = total + + self.subscription = subscription + + self.nextActionTime = nextActionTime + + self.createdAt = createdAt + + self.modifiedAt = modifiedAt + + self.hashIdentifier = hashIdentifier + + self.paymentMethod = paymentMethod + + self.invoiceItems = invoiceItems + } + + public func duplicate() -> InvoicesData { + let dict = self.dictionary! + let copy = InvoicesData(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + client = try container.decode(InvoicesDataClient.self, forKey: .client) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + autoAdvance = try container.decode(Bool.self, forKey: .autoAdvance) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paid = try container.decode(Bool.self, forKey: .paid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attemp = try container.decode(Int.self, forKey: .attemp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + collectionMethod = try container.decode(String.self, forKey: .collectionMethod) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subscriberId = try container.decode(String.self, forKey: .subscriberId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + invoiceUrl = try container.decode(String.self, forKey: .invoiceUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + number = try container.decode(String.self, forKey: .number) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pgData = try container.decode([String: Any].self, forKey: .pgData) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + period = try container.decode(InvoicesDataPeriod.self, forKey: .period) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + receiptNumber = try container.decode(String.self, forKey: .receiptNumber) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + statementDescriptor = try container.decode(String.self, forKey: .statementDescriptor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currentStatus = try container.decode(String.self, forKey: .currentStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + statusTrail = try container.decode([InvoiceDetailsStatusTrail].self, forKey: .statusTrail) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subtotal = try container.decode(Double.self, forKey: .subtotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + total = try container.decode(Double.self, forKey: .total) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subscription = try container.decode(String.self, forKey: .subscription) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + nextActionTime = try container.decode(String.self, forKey: .nextActionTime) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedAt = try container.decode(String.self, forKey: .modifiedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hashIdentifier = try container.decode(String.self, forKey: .hashIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentMethod = try container.decode(InvoicesDataPaymentMethod.self, forKey: .paymentMethod) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + invoiceItems = try container.decode([InvoiceItems].self, forKey: .invoiceItems) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(client, forKey: .client) + + try? container.encodeIfPresent(autoAdvance, forKey: .autoAdvance) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(paid, forKey: .paid) + + try? container.encodeIfPresent(attemp, forKey: .attemp) + + try? container.encodeIfPresent(collectionMethod, forKey: .collectionMethod) + + try? container.encodeIfPresent(subscriberId, forKey: .subscriberId) + + try? container.encodeIfPresent(invoiceUrl, forKey: .invoiceUrl) + + try? container.encodeIfPresent(number, forKey: .number) + + try? container.encodeIfPresent(pgData, forKey: .pgData) + + try? container.encodeIfPresent(period, forKey: .period) + + try? container.encodeIfPresent(receiptNumber, forKey: .receiptNumber) + + try? container.encodeIfPresent(statementDescriptor, forKey: .statementDescriptor) + + try? container.encodeIfPresent(currentStatus, forKey: .currentStatus) + + try? container.encodeIfPresent(statusTrail, forKey: .statusTrail) + + try? container.encodeIfPresent(subtotal, forKey: .subtotal) + + try? container.encodeIfPresent(total, forKey: .total) + + try? container.encodeIfPresent(subscription, forKey: .subscription) + + try? container.encodeIfPresent(nextActionTime, forKey: .nextActionTime) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) + + try? container.encodeIfPresent(hashIdentifier, forKey: .hashIdentifier) + + try? container.encodeIfPresent(paymentMethod, forKey: .paymentMethod) + + try? container.encodeIfPresent(invoiceItems, forKey: .invoiceItems) + } + } + + /* + Model: Invoices + Used By: Billing + */ + + class Invoices: Codable { + public var data: [InvoicesData]? + + public var start: Int? + + public var end: Int? + + public var limit: Int? + + public var page: Int? + + public var total: Int? + + public enum CodingKeys: String, CodingKey { + case data + + case start + + case end + + case limit + + case page + + case total + } + + public init(data: [InvoicesData]?, end: Int?, limit: Int?, page: Int?, start: Int?, total: Int?) { + self.data = data + + self.start = start + + self.end = end + + self.limit = limit + + self.page = page + + self.total = total + } + + public func duplicate() -> Invoices { + let dict = self.dictionary! + let copy = Invoices(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode([InvoicesData].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + start = try container.decode(Int.self, forKey: .start) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + end = try container.decode(Int.self, forKey: .end) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + limit = try container.decode(Int.self, forKey: .limit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Int.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + total = try container.decode(Int.self, forKey: .total) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(start, forKey: .start) + + try? container.encodeIfPresent(end, forKey: .end) + + try? container.encodeIfPresent(limit, forKey: .limit) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(total, forKey: .total) + } + } + + /* + Model: Phone + Used By: Billing + */ + + class Phone: Codable { + public var phoneNumber: String? + + public var phoneCountryCode: String? + + public enum CodingKeys: String, CodingKey { + case phoneNumber = "phone_number" + + case phoneCountryCode = "phone_country_code" + } + + public init(phoneCountryCode: String?, phoneNumber: String?) { + self.phoneNumber = phoneNumber + + self.phoneCountryCode = phoneCountryCode + } + + public func duplicate() -> Phone { + let dict = self.dictionary! + let copy = Phone(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + phoneNumber = try container.decode(String.self, forKey: .phoneNumber) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phoneCountryCode = try container.decode(String.self, forKey: .phoneCountryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(phoneNumber, forKey: .phoneNumber) + + try? container.encodeIfPresent(phoneCountryCode, forKey: .phoneCountryCode) + } + } + + /* + Model: SubscriptionBillingAddress + Used By: Billing + */ + + class SubscriptionBillingAddress: Codable { + public var country: String? + + public var state: String? + + public var city: String? + + public var line1: String? + + public var line2: String? + + public var postalCode: String? + + public enum CodingKeys: String, CodingKey { + case country + + case state + + case city + + case line1 + + case line2 + + case postalCode = "postal_code" + } + + public init(city: String?, country: String?, line1: String?, line2: String?, postalCode: String?, state: String?) { + self.country = country + + self.state = state + + self.city = city + + self.line1 = line1 + + self.line2 = line2 + + self.postalCode = postalCode + } + + public func duplicate() -> SubscriptionBillingAddress { + let dict = self.dictionary! + let copy = SubscriptionBillingAddress(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + line1 = try container.decode(String.self, forKey: .line1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + line2 = try container.decode(String.self, forKey: .line2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + postalCode = try container.decode(String.self, forKey: .postalCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(line1, forKey: .line1) + + try? container.encodeIfPresent(line2, forKey: .line2) + + try? container.encodeIfPresent(postalCode, forKey: .postalCode) + } + } + + /* + Model: SubscriptionCustomer + Used By: Billing + */ + + class SubscriptionCustomer: Codable { + public var phone: Phone? + + public var billingAddress: SubscriptionBillingAddress? + + public var id: String? + + public var uniqueId: String? + + public var type: String? + + public var name: String? + + public var email: String? + + public var createdAt: String? + + public var modifiedAt: String? + + public var data: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case phone + + case billingAddress = "billing_address" + + case id = "_id" + + case uniqueId = "unique_id" + + case type + + case name + + case email + + case createdAt = "created_at" + + case modifiedAt = "modified_at" + + case data + } + + public init(billingAddress: SubscriptionBillingAddress?, createdAt: String?, data: [String: Any]?, email: String?, modifiedAt: String?, name: String?, phone: Phone?, type: String?, uniqueId: String?, id: String?) { + self.phone = phone + + self.billingAddress = billingAddress + + self.id = id + + self.uniqueId = uniqueId + + self.type = type + + self.name = name + + self.email = email + + self.createdAt = createdAt + + self.modifiedAt = modifiedAt + + self.data = data + } + + public func duplicate() -> SubscriptionCustomer { + let dict = self.dictionary! + let copy = SubscriptionCustomer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + phone = try container.decode(Phone.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + billingAddress = try container.decode(SubscriptionBillingAddress.self, forKey: .billingAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uniqueId = try container.decode(String.self, forKey: .uniqueId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedAt = try container.decode(String.self, forKey: .modifiedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode([String: Any].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(billingAddress, forKey: .billingAddress) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(uniqueId, forKey: .uniqueId) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: SubscriptionCustomerCreate + Used By: Billing + */ + + class SubscriptionCustomerCreate: Codable { + public var phone: Phone? + + public var billingAddress: SubscriptionBillingAddress? + + public var uniqueId: String? + + public var type: String? + + public var name: String? + + public var email: String? + + public enum CodingKeys: String, CodingKey { + case phone + + case billingAddress = "billing_address" + + case uniqueId = "unique_id" + + case type + + case name + + case email + } + + public init(billingAddress: SubscriptionBillingAddress?, email: String?, name: String?, phone: Phone?, type: String?, uniqueId: String?) { + self.phone = phone + + self.billingAddress = billingAddress + + self.uniqueId = uniqueId + + self.type = type + + self.name = name + + self.email = email + } + + public func duplicate() -> SubscriptionCustomerCreate { + let dict = self.dictionary! + let copy = SubscriptionCustomerCreate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + phone = try container.decode(Phone.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + billingAddress = try container.decode(SubscriptionBillingAddress.self, forKey: .billingAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uniqueId = try container.decode(String.self, forKey: .uniqueId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(billingAddress, forKey: .billingAddress) + + try? container.encodeIfPresent(uniqueId, forKey: .uniqueId) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(email, forKey: .email) + } + } + + /* + Model: SubscriptionCurrentPeriod + Used By: Billing + */ + + class SubscriptionCurrentPeriod: Codable { + public var start: String? + + public var end: String? + + public enum CodingKeys: String, CodingKey { + case start + + case end + } + + public init(end: String?, start: String?) { + self.start = start + + self.end = end + } + + public func duplicate() -> SubscriptionCurrentPeriod { + let dict = self.dictionary! + let copy = SubscriptionCurrentPeriod(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + start = try container.decode(String.self, forKey: .start) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + end = try container.decode(String.self, forKey: .end) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(start, forKey: .start) + + try? container.encodeIfPresent(end, forKey: .end) + } + } + + /* + Model: SubscriptionPauseCollection + Used By: Billing + */ + + class SubscriptionPauseCollection: Codable { + public var behavior: String? + + public var resumeAt: String? + + public enum CodingKeys: String, CodingKey { + case behavior + + case resumeAt = "resume_at" + } + + public init(behavior: String?, resumeAt: String?) { + self.behavior = behavior + + self.resumeAt = resumeAt + } + + public func duplicate() -> SubscriptionPauseCollection { + let dict = self.dictionary! + let copy = SubscriptionPauseCollection(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + behavior = try container.decode(String.self, forKey: .behavior) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + resumeAt = try container.decode(String.self, forKey: .resumeAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(behavior, forKey: .behavior) + + try? container.encodeIfPresent(resumeAt, forKey: .resumeAt) + } + } + + /* + Model: SubscriptionTrial + Used By: Billing + */ + + class SubscriptionTrial: Codable { + public var start: String? + + public var end: String? + + public enum CodingKeys: String, CodingKey { + case start + + case end + } + + public init(end: String?, start: String?) { + self.start = start + + self.end = end + } + + public func duplicate() -> SubscriptionTrial { + let dict = self.dictionary! + let copy = SubscriptionTrial(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + start = try container.decode(String.self, forKey: .start) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + end = try container.decode(String.self, forKey: .end) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(start, forKey: .start) + + try? container.encodeIfPresent(end, forKey: .end) + } + } + + /* + Model: SubscriptionInvoiceSettings + Used By: Billing + */ + + class SubscriptionInvoiceSettings: Codable { + public var generation: Bool? + + public var charging: Bool? + + public enum CodingKeys: String, CodingKey { + case generation + + case charging + } + + public init(charging: Bool?, generation: Bool?) { + self.generation = generation + + self.charging = charging + } + + public func duplicate() -> SubscriptionInvoiceSettings { + let dict = self.dictionary! + let copy = SubscriptionInvoiceSettings(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + generation = try container.decode(Bool.self, forKey: .generation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + charging = try container.decode(Bool.self, forKey: .charging) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(generation, forKey: .generation) + + try? container.encodeIfPresent(charging, forKey: .charging) + } + } + + /* + Model: Subscription + Used By: Billing + */ + + class Subscription: Codable { + public var currentPeriod: SubscriptionCurrentPeriod? + + public var pauseCollection: SubscriptionPauseCollection? + + public var trial: SubscriptionTrial? + + public var invoiceSettings: SubscriptionInvoiceSettings? + + public var isActive: Bool? + + public var cancelAtPeriodEnd: Bool? + + public var id: String? + + public var subscriberId: String? + + public var planId: String? + + public var productSuiteId: String? + + public var planData: Plan? + + public var currentStatus: String? + + public var collectionMethod: String? + + public var createdAt: String? + + public var modifiedAt: String? + + public var latestInvoice: String? + + public enum CodingKeys: String, CodingKey { + case currentPeriod = "current_period" + + case pauseCollection = "pause_collection" + + case trial + + case invoiceSettings = "invoice_settings" + + case isActive = "is_active" + + case cancelAtPeriodEnd = "cancel_at_period_end" + + case id = "_id" + + case subscriberId = "subscriber_id" + + case planId = "plan_id" + + case productSuiteId = "product_suite_id" + + case planData = "plan_data" + + case currentStatus = "current_status" + + case collectionMethod = "collection_method" + + case createdAt = "created_at" + + case modifiedAt = "modified_at" + + case latestInvoice = "latest_invoice" + } + + public init(cancelAtPeriodEnd: Bool?, collectionMethod: String?, createdAt: String?, currentPeriod: SubscriptionCurrentPeriod?, currentStatus: String?, invoiceSettings: SubscriptionInvoiceSettings?, isActive: Bool?, latestInvoice: String?, modifiedAt: String?, pauseCollection: SubscriptionPauseCollection?, planData: Plan?, planId: String?, productSuiteId: String?, subscriberId: String?, trial: SubscriptionTrial?, id: String?) { + self.currentPeriod = currentPeriod + + self.pauseCollection = pauseCollection + + self.trial = trial + + self.invoiceSettings = invoiceSettings + + self.isActive = isActive + + self.cancelAtPeriodEnd = cancelAtPeriodEnd + + self.id = id + + self.subscriberId = subscriberId + + self.planId = planId + + self.productSuiteId = productSuiteId + + self.planData = planData + + self.currentStatus = currentStatus + + self.collectionMethod = collectionMethod + + self.createdAt = createdAt + + self.modifiedAt = modifiedAt + + self.latestInvoice = latestInvoice + } + + public func duplicate() -> Subscription { + let dict = self.dictionary! + let copy = Subscription(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + currentPeriod = try container.decode(SubscriptionCurrentPeriod.self, forKey: .currentPeriod) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pauseCollection = try container.decode(SubscriptionPauseCollection.self, forKey: .pauseCollection) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + trial = try container.decode(SubscriptionTrial.self, forKey: .trial) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + invoiceSettings = try container.decode(SubscriptionInvoiceSettings.self, forKey: .invoiceSettings) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cancelAtPeriodEnd = try container.decode(Bool.self, forKey: .cancelAtPeriodEnd) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subscriberId = try container.decode(String.self, forKey: .subscriberId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + planId = try container.decode(String.self, forKey: .planId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productSuiteId = try container.decode(String.self, forKey: .productSuiteId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + planData = try container.decode(Plan.self, forKey: .planData) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currentStatus = try container.decode(String.self, forKey: .currentStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + collectionMethod = try container.decode(String.self, forKey: .collectionMethod) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedAt = try container.decode(String.self, forKey: .modifiedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + latestInvoice = try container.decode(String.self, forKey: .latestInvoice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(currentPeriod, forKey: .currentPeriod) + + try? container.encodeIfPresent(pauseCollection, forKey: .pauseCollection) + + try? container.encodeIfPresent(trial, forKey: .trial) + + try? container.encodeIfPresent(invoiceSettings, forKey: .invoiceSettings) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(cancelAtPeriodEnd, forKey: .cancelAtPeriodEnd) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(subscriberId, forKey: .subscriberId) + + try? container.encodeIfPresent(planId, forKey: .planId) + + try? container.encodeIfPresent(productSuiteId, forKey: .productSuiteId) + + try? container.encodeIfPresent(planData, forKey: .planData) + + try? container.encodeIfPresent(currentStatus, forKey: .currentStatus) + + try? container.encodeIfPresent(collectionMethod, forKey: .collectionMethod) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) + + try? container.encodeIfPresent(latestInvoice, forKey: .latestInvoice) + } + } + + /* + Model: SubscriptionStatus + Used By: Billing + */ + + class SubscriptionStatus: Codable { + public var isEnabled: Bool? + + public var subscription: Subscription? + + public enum CodingKeys: String, CodingKey { + case isEnabled = "is_enabled" + + case subscription + } + + public init(isEnabled: Bool?, subscription: Subscription?) { + self.isEnabled = isEnabled + + self.subscription = subscription + } + + public func duplicate() -> SubscriptionStatus { + let dict = self.dictionary! + let copy = SubscriptionStatus(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isEnabled = try container.decode(Bool.self, forKey: .isEnabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subscription = try container.decode(Subscription.self, forKey: .subscription) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isEnabled, forKey: .isEnabled) + + try? container.encodeIfPresent(subscription, forKey: .subscription) + } + } + + /* + Model: SubscriptionLimitApplication + Used By: Billing + */ + + class SubscriptionLimitApplication: Codable { + public var enabled: Bool? + + public var hardLimit: Int? + + public var softLimit: Int? + + public enum CodingKeys: String, CodingKey { + case enabled + + case hardLimit = "hard_limit" + + case softLimit = "soft_limit" + } + + public init(enabled: Bool?, hardLimit: Int?, softLimit: Int?) { + self.enabled = enabled + + self.hardLimit = hardLimit + + self.softLimit = softLimit + } + + public func duplicate() -> SubscriptionLimitApplication { + let dict = self.dictionary! + let copy = SubscriptionLimitApplication(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hardLimit = try container.decode(Int.self, forKey: .hardLimit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + softLimit = try container.decode(Int.self, forKey: .softLimit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(hardLimit, forKey: .hardLimit) + + try? container.encodeIfPresent(softLimit, forKey: .softLimit) + } + } + + /* + Model: SubscriptionLimitMarketplace + Used By: Billing + */ + + class SubscriptionLimitMarketplace: Codable { + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case enabled + } + + public init(enabled: Bool?) { + self.enabled = enabled + } + + public func duplicate() -> SubscriptionLimitMarketplace { + let dict = self.dictionary! + let copy = SubscriptionLimitMarketplace(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: SubscriptionLimitOtherPlatform + Used By: Billing + */ + + class SubscriptionLimitOtherPlatform: Codable { + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case enabled + } + + public init(enabled: Bool?) { + self.enabled = enabled + } + + public func duplicate() -> SubscriptionLimitOtherPlatform { + let dict = self.dictionary! + let copy = SubscriptionLimitOtherPlatform(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: SubscriptionLimitTeam + Used By: Billing + */ + + class SubscriptionLimitTeam: Codable { + public var limit: Int? + + public enum CodingKeys: String, CodingKey { + case limit + } + + public init(limit: Int?) { + self.limit = limit + } + + public func duplicate() -> SubscriptionLimitTeam { + let dict = self.dictionary! + let copy = SubscriptionLimitTeam(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + limit = try container.decode(Int.self, forKey: .limit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(limit, forKey: .limit) + } + } + + /* + Model: SubscriptionLimitProducts + Used By: Billing + */ + + class SubscriptionLimitProducts: Codable { + public var bulk: Bool? + + public var limit: Int? + + public enum CodingKeys: String, CodingKey { + case bulk + + case limit + } + + public init(bulk: Bool?, limit: Int?) { + self.bulk = bulk + + self.limit = limit + } + + public func duplicate() -> SubscriptionLimitProducts { + let dict = self.dictionary! + let copy = SubscriptionLimitProducts(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + bulk = try container.decode(Bool.self, forKey: .bulk) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + limit = try container.decode(Int.self, forKey: .limit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(bulk, forKey: .bulk) + + try? container.encodeIfPresent(limit, forKey: .limit) + } + } + + /* + Model: SubscriptionLimitExtensions + Used By: Billing + */ + + class SubscriptionLimitExtensions: Codable { + public var enabled: Bool? + + public var limit: Int? + + public enum CodingKeys: String, CodingKey { + case enabled + + case limit + } + + public init(enabled: Bool?, limit: Int?) { + self.enabled = enabled + + self.limit = limit + } + + public func duplicate() -> SubscriptionLimitExtensions { + let dict = self.dictionary! + let copy = SubscriptionLimitExtensions(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + limit = try container.decode(Int.self, forKey: .limit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(limit, forKey: .limit) + } + } + + /* + Model: SubscriptionLimitIntegrations + Used By: Billing + */ + + class SubscriptionLimitIntegrations: Codable { + public var enabled: Bool? + + public var limit: Int? + + public enum CodingKeys: String, CodingKey { + case enabled + + case limit + } + + public init(enabled: Bool?, limit: Int?) { + self.enabled = enabled + + self.limit = limit + } + + public func duplicate() -> SubscriptionLimitIntegrations { + let dict = self.dictionary! + let copy = SubscriptionLimitIntegrations(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + limit = try container.decode(Int.self, forKey: .limit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(limit, forKey: .limit) + } + } + + /* + Model: SubscriptionLimit + Used By: Billing + */ + + class SubscriptionLimit: Codable { + public var application: SubscriptionLimitApplication? + + public var marketplace: SubscriptionLimitMarketplace? + + public var otherPlatform: SubscriptionLimitOtherPlatform? + + public var team: SubscriptionLimitTeam? + + public var products: SubscriptionLimitProducts? + + public var extensions: SubscriptionLimitExtensions? + + public var integrations: SubscriptionLimitIntegrations? + + public var isTrialPlan: Bool? + + public enum CodingKeys: String, CodingKey { + case application + + case marketplace + + case otherPlatform = "other_platform" + + case team + + case products + + case extensions + + case integrations + + case isTrialPlan = "is_trial_plan" + } + + public init(application: SubscriptionLimitApplication?, extensions: SubscriptionLimitExtensions?, integrations: SubscriptionLimitIntegrations?, isTrialPlan: Bool?, marketplace: SubscriptionLimitMarketplace?, otherPlatform: SubscriptionLimitOtherPlatform?, products: SubscriptionLimitProducts?, team: SubscriptionLimitTeam?) { + self.application = application + + self.marketplace = marketplace + + self.otherPlatform = otherPlatform + + self.team = team + + self.products = products + + self.extensions = extensions + + self.integrations = integrations + + self.isTrialPlan = isTrialPlan + } + + public func duplicate() -> SubscriptionLimit { + let dict = self.dictionary! + let copy = SubscriptionLimit(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(SubscriptionLimitApplication.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + marketplace = try container.decode(SubscriptionLimitMarketplace.self, forKey: .marketplace) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + otherPlatform = try container.decode(SubscriptionLimitOtherPlatform.self, forKey: .otherPlatform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + team = try container.decode(SubscriptionLimitTeam.self, forKey: .team) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + products = try container.decode(SubscriptionLimitProducts.self, forKey: .products) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + extensions = try container.decode(SubscriptionLimitExtensions.self, forKey: .extensions) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + integrations = try container.decode(SubscriptionLimitIntegrations.self, forKey: .integrations) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isTrialPlan = try container.decode(Bool.self, forKey: .isTrialPlan) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(marketplace, forKey: .marketplace) + + try? container.encodeIfPresent(otherPlatform, forKey: .otherPlatform) + + try? container.encodeIfPresent(team, forKey: .team) + + try? container.encodeIfPresent(products, forKey: .products) + + try? container.encodeIfPresent(extensions, forKey: .extensions) + + try? container.encodeIfPresent(integrations, forKey: .integrations) + + try? container.encodeIfPresent(isTrialPlan, forKey: .isTrialPlan) + } + } + + /* + Model: SubscriptionActivateReq + Used By: Billing + */ + + class SubscriptionActivateReq: Codable { + public var uniqueId: String? + + public var type: String? + + public var productSuite: String? + + public var planId: String? + + public var paymentMethod: String? + + public enum CodingKeys: String, CodingKey { + case uniqueId = "unique_id" + + case type + + case productSuite = "product_suite" + + case planId = "plan_id" + + case paymentMethod = "payment_method" + } + + public init(paymentMethod: String?, planId: String?, productSuite: String?, type: String?, uniqueId: String?) { + self.uniqueId = uniqueId + + self.type = type + + self.productSuite = productSuite + + self.planId = planId + + self.paymentMethod = paymentMethod + } + + public func duplicate() -> SubscriptionActivateReq { + let dict = self.dictionary! + let copy = SubscriptionActivateReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uniqueId = try container.decode(String.self, forKey: .uniqueId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productSuite = try container.decode(String.self, forKey: .productSuite) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + planId = try container.decode(String.self, forKey: .planId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentMethod = try container.decode(String.self, forKey: .paymentMethod) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uniqueId, forKey: .uniqueId) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(productSuite, forKey: .productSuite) + + try? container.encodeIfPresent(planId, forKey: .planId) + + try? container.encodeIfPresent(paymentMethod, forKey: .paymentMethod) + } + } + + /* + Model: SubscriptionActivateRes + Used By: Billing + */ + + class SubscriptionActivateRes: Codable { + public var success: Bool? + + public var data: Subscription? + + public enum CodingKeys: String, CodingKey { + case success + + case data + } + + public init(data: Subscription?, success: Bool?) { + self.success = success + + self.data = data + } + + public func duplicate() -> SubscriptionActivateRes { + let dict = self.dictionary! + let copy = SubscriptionActivateRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode(Subscription.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: CancelSubscriptionReq + Used By: Billing + */ + + class CancelSubscriptionReq: Codable { + public var uniqueId: String? + + public var type: String? + + public var productSuite: String? + + public var subscriptionId: String? + + public enum CodingKeys: String, CodingKey { + case uniqueId = "unique_id" + + case type + + case productSuite = "product_suite" + + case subscriptionId = "subscription_id" + } + + public init(productSuite: String?, subscriptionId: String?, type: String?, uniqueId: String?) { + self.uniqueId = uniqueId + + self.type = type + + self.productSuite = productSuite + + self.subscriptionId = subscriptionId + } + + public func duplicate() -> CancelSubscriptionReq { + let dict = self.dictionary! + let copy = CancelSubscriptionReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uniqueId = try container.decode(String.self, forKey: .uniqueId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productSuite = try container.decode(String.self, forKey: .productSuite) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subscriptionId = try container.decode(String.self, forKey: .subscriptionId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uniqueId, forKey: .uniqueId) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(productSuite, forKey: .productSuite) + + try? container.encodeIfPresent(subscriptionId, forKey: .subscriptionId) + } + } + + /* + Model: CancelSubscriptionRes + Used By: Billing + */ + + class CancelSubscriptionRes: Codable { + public var success: Bool? + + public var data: Subscription? + + public enum CodingKeys: String, CodingKey { + case success + + case data + } + + public init(data: Subscription?, success: Bool?) { + self.success = success + + self.data = data + } + + public func duplicate() -> CancelSubscriptionRes { + let dict = self.dictionary! + let copy = CancelSubscriptionRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode(Subscription.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(data, forKey: .data) + } + } +} diff --git a/Sources/code/platform/models/CartPlatformModelClass.swift b/Sources/code/platform/models/CartPlatformModelClass.swift new file mode 100644 index 0000000000..ec34127b5a --- /dev/null +++ b/Sources/code/platform/models/CartPlatformModelClass.swift @@ -0,0 +1,5856 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: CouponSchedule + Used By: Cart + */ + + class CouponSchedule: Codable { + public var nextSchedule: [[String: Any]]? + + public var start: String? + + public var cron: String? + + public var duration: Int? + + public var end: String? + + public enum CodingKeys: String, CodingKey { + case nextSchedule = "next_schedule" + + case start + + case cron + + case duration + + case end + } + + public init(cron: String?, duration: Int?, end: String?, nextSchedule: [[String: Any]]?, start: String?) { + self.nextSchedule = nextSchedule + + self.start = start + + self.cron = cron + + self.duration = duration + + self.end = end + } + + public func duplicate() -> CouponSchedule { + let dict = self.dictionary! + let copy = CouponSchedule(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + nextSchedule = try container.decode([[String: Any]].self, forKey: .nextSchedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + start = try container.decode(String.self, forKey: .start) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cron = try container.decode(String.self, forKey: .cron) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + duration = try container.decode(Int.self, forKey: .duration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + end = try container.decode(String.self, forKey: .end) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(nextSchedule, forKey: .nextSchedule) + + try? container.encodeIfPresent(start, forKey: .start) + + try? container.encode(cron, forKey: .cron) + + try? container.encode(duration, forKey: .duration) + + try? container.encode(end, forKey: .end) + } + } + + /* + Model: Identifier + Used By: Cart + */ + + class Identifier: Codable { + public var brandId: [Int]? + + public var companyId: [Int]? + + public var categoryId: [Int]? + + public var articleId: [String]? + + public var collectionId: [String]? + + public var storeId: [Int]? + + public var itemId: [Int]? + + public var userId: [String]? + + public enum CodingKeys: String, CodingKey { + case brandId = "brand_id" + + case companyId = "company_id" + + case categoryId = "category_id" + + case articleId = "article_id" + + case collectionId = "collection_id" + + case storeId = "store_id" + + case itemId = "item_id" + + case userId = "user_id" + } + + public init(articleId: [String]?, brandId: [Int]?, categoryId: [Int]?, collectionId: [String]?, companyId: [Int]?, itemId: [Int]?, storeId: [Int]?, userId: [String]?) { + self.brandId = brandId + + self.companyId = companyId + + self.categoryId = categoryId + + self.articleId = articleId + + self.collectionId = collectionId + + self.storeId = storeId + + self.itemId = itemId + + self.userId = userId + } + + public func duplicate() -> Identifier { + let dict = self.dictionary! + let copy = Identifier(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + brandId = try container.decode([Int].self, forKey: .brandId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode([Int].self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + categoryId = try container.decode([Int].self, forKey: .categoryId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + articleId = try container.decode([String].self, forKey: .articleId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + collectionId = try container.decode([String].self, forKey: .collectionId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeId = try container.decode([Int].self, forKey: .storeId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemId = try container.decode([Int].self, forKey: .itemId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userId = try container.decode([String].self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(brandId, forKey: .brandId) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(categoryId, forKey: .categoryId) + + try? container.encodeIfPresent(articleId, forKey: .articleId) + + try? container.encodeIfPresent(collectionId, forKey: .collectionId) + + try? container.encodeIfPresent(storeId, forKey: .storeId) + + try? container.encodeIfPresent(itemId, forKey: .itemId) + + try? container.encodeIfPresent(userId, forKey: .userId) + } + } + + /* + Model: Validity + Used By: Cart + */ + + class Validity: Codable { + public var priority: Int? + + public enum CodingKeys: String, CodingKey { + case priority + } + + public init(priority: Int?) { + self.priority = priority + } + + public func duplicate() -> Validity { + let dict = self.dictionary! + let copy = Validity(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + priority = try container.decode(Int.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(priority, forKey: .priority) + } + } + + /* + Model: Validation + Used By: Cart + */ + + class Validation: Codable { + public var appId: [String]? + + public var anonymous: Bool? + + public var userRegisteredAfter: String? + + public enum CodingKeys: String, CodingKey { + case appId = "app_id" + + case anonymous + + case userRegisteredAfter = "user_registered_after" + } + + public init(anonymous: Bool?, appId: [String]?, userRegisteredAfter: String?) { + self.appId = appId + + self.anonymous = anonymous + + self.userRegisteredAfter = userRegisteredAfter + } + + public func duplicate() -> Validation { + let dict = self.dictionary! + let copy = Validation(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + appId = try container.decode([String].self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + anonymous = try container.decode(Bool.self, forKey: .anonymous) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userRegisteredAfter = try container.decode(String.self, forKey: .userRegisteredAfter) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(anonymous, forKey: .anonymous) + + try? container.encode(userRegisteredAfter, forKey: .userRegisteredAfter) + } + } + + /* + Model: RuleDefinition + Used By: Cart + */ + + class RuleDefinition: Codable { + public var applicableOn: String + + public var currencyCode: String? + + public var isExact: Bool? + + public var autoApply: Bool? + + public var valueType: String + + public var calculateOn: String + + public var type: String + + public var scope: [String]? + + public enum CodingKeys: String, CodingKey { + case applicableOn = "applicable_on" + + case currencyCode = "currency_code" + + case isExact = "is_exact" + + case autoApply = "auto_apply" + + case valueType = "value_type" + + case calculateOn = "calculate_on" + + case type + + case scope + } + + public init(applicableOn: String, autoApply: Bool?, calculateOn: String, currencyCode: String?, isExact: Bool?, scope: [String]?, type: String, valueType: String) { + self.applicableOn = applicableOn + + self.currencyCode = currencyCode + + self.isExact = isExact + + self.autoApply = autoApply + + self.valueType = valueType + + self.calculateOn = calculateOn + + self.type = type + + self.scope = scope + } + + public func duplicate() -> RuleDefinition { + let dict = self.dictionary! + let copy = RuleDefinition(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + applicableOn = try container.decode(String.self, forKey: .applicableOn) + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isExact = try container.decode(Bool.self, forKey: .isExact) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + autoApply = try container.decode(Bool.self, forKey: .autoApply) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + valueType = try container.decode(String.self, forKey: .valueType) + + calculateOn = try container.decode(String.self, forKey: .calculateOn) + + type = try container.decode(String.self, forKey: .type) + + do { + scope = try container.decode([String].self, forKey: .scope) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(applicableOn, forKey: .applicableOn) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + + try? container.encodeIfPresent(isExact, forKey: .isExact) + + try? container.encodeIfPresent(autoApply, forKey: .autoApply) + + try? container.encodeIfPresent(valueType, forKey: .valueType) + + try? container.encodeIfPresent(calculateOn, forKey: .calculateOn) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(scope, forKey: .scope) + } + } + + /* + Model: CouponDateMeta + Used By: Cart + */ + + class CouponDateMeta: Codable { + public var modifiedOn: String? + + public var createdOn: String? + + public enum CodingKeys: String, CodingKey { + case modifiedOn = "modified_on" + + case createdOn = "created_on" + } + + public init(createdOn: String?, modifiedOn: String?) { + self.modifiedOn = modifiedOn + + self.createdOn = createdOn + } + + public func duplicate() -> CouponDateMeta { + let dict = self.dictionary! + let copy = CouponDateMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(modifiedOn, forKey: .modifiedOn) + + try? container.encode(createdOn, forKey: .createdOn) + } + } + + /* + Model: DisplayMetaDict + Used By: Cart + */ + + class DisplayMetaDict: Codable { + public var title: String? + + public var subtitle: String? + + public enum CodingKeys: String, CodingKey { + case title + + case subtitle + } + + public init(subtitle: String?, title: String?) { + self.title = title + + self.subtitle = subtitle + } + + public func duplicate() -> DisplayMetaDict { + let dict = self.dictionary! + let copy = DisplayMetaDict(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subtitle = try container.decode(String.self, forKey: .subtitle) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(subtitle, forKey: .subtitle) + } + } + + /* + Model: DisplayMeta + Used By: Cart + */ + + class DisplayMeta: Codable { + public var description: String? + + public var apply: DisplayMetaDict? + + public var auto: DisplayMetaDict? + + public var title: String? + + public var remove: DisplayMetaDict? + + public var subtitle: String? + + public enum CodingKeys: String, CodingKey { + case description + + case apply + + case auto + + case title + + case remove + + case subtitle + } + + public init(apply: DisplayMetaDict?, auto: DisplayMetaDict?, description: String?, remove: DisplayMetaDict?, subtitle: String?, title: String?) { + self.description = description + + self.apply = apply + + self.auto = auto + + self.title = title + + self.remove = remove + + self.subtitle = subtitle + } + + public func duplicate() -> DisplayMeta { + let dict = self.dictionary! + let copy = DisplayMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + apply = try container.decode(DisplayMetaDict.self, forKey: .apply) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + auto = try container.decode(DisplayMetaDict.self, forKey: .auto) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + remove = try container.decode(DisplayMetaDict.self, forKey: .remove) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subtitle = try container.decode(String.self, forKey: .subtitle) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(apply, forKey: .apply) + + try? container.encodeIfPresent(auto, forKey: .auto) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(remove, forKey: .remove) + + try? container.encodeIfPresent(subtitle, forKey: .subtitle) + } + } + + /* + Model: PaymentAllowValue + Used By: Cart + */ + + class PaymentAllowValue: Codable { + public var max: Int? + + public enum CodingKeys: String, CodingKey { + case max + } + + public init(max: Int?) { + self.max = max + } + + public func duplicate() -> PaymentAllowValue { + let dict = self.dictionary! + let copy = PaymentAllowValue(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + max = try container.decode(Int.self, forKey: .max) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(max, forKey: .max) + } + } + + /* + Model: PaymentModes + Used By: Cart + */ + + class PaymentModes: Codable { + public var uses: PaymentAllowValue? + + public var codes: [String]? + + public var types: [String]? + + public var networks: [String]? + + public enum CodingKeys: String, CodingKey { + case uses + + case codes + + case types + + case networks + } + + public init(codes: [String]?, networks: [String]?, types: [String]?, uses: PaymentAllowValue?) { + self.uses = uses + + self.codes = codes + + self.types = types + + self.networks = networks + } + + public func duplicate() -> PaymentModes { + let dict = self.dictionary! + let copy = PaymentModes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uses = try container.decode(PaymentAllowValue.self, forKey: .uses) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + codes = try container.decode([String].self, forKey: .codes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + types = try container.decode([String].self, forKey: .types) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + networks = try container.decode([String].self, forKey: .networks) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uses, forKey: .uses) + + try? container.encodeIfPresent(codes, forKey: .codes) + + try? container.encodeIfPresent(types, forKey: .types) + + try? container.encodeIfPresent(networks, forKey: .networks) + } + } + + /* + Model: PostOrder + Used By: Cart + */ + + class PostOrder: Codable { + public var cancellationAllowed: Bool? + + public var returnAllowed: Bool? + + public enum CodingKeys: String, CodingKey { + case cancellationAllowed = "cancellation_allowed" + + case returnAllowed = "return_allowed" + } + + public init(cancellationAllowed: Bool?, returnAllowed: Bool?) { + self.cancellationAllowed = cancellationAllowed + + self.returnAllowed = returnAllowed + } + + public func duplicate() -> PostOrder { + let dict = self.dictionary! + let copy = PostOrder(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + cancellationAllowed = try container.decode(Bool.self, forKey: .cancellationAllowed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + returnAllowed = try container.decode(Bool.self, forKey: .returnAllowed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(cancellationAllowed, forKey: .cancellationAllowed) + + try? container.encodeIfPresent(returnAllowed, forKey: .returnAllowed) + } + } + + /* + Model: BulkBundleRestriction + Used By: Cart + */ + + class BulkBundleRestriction: Codable { + public var multiStoreAllowed: Bool + + public enum CodingKeys: String, CodingKey { + case multiStoreAllowed = "multi_store_allowed" + } + + public init(multiStoreAllowed: Bool) { + self.multiStoreAllowed = multiStoreAllowed + } + + public func duplicate() -> BulkBundleRestriction { + let dict = self.dictionary! + let copy = BulkBundleRestriction(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + multiStoreAllowed = try container.decode(Bool.self, forKey: .multiStoreAllowed) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(multiStoreAllowed, forKey: .multiStoreAllowed) + } + } + + /* + Model: PriceRange + Used By: Cart + */ + + class PriceRange: Codable { + public var min: Int? + + public var max: Int? + + public enum CodingKeys: String, CodingKey { + case min + + case max + } + + public init(max: Int?, min: Int?) { + self.min = min + + self.max = max + } + + public func duplicate() -> PriceRange { + let dict = self.dictionary! + let copy = PriceRange(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + min = try container.decode(Int.self, forKey: .min) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + max = try container.decode(Int.self, forKey: .max) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(min, forKey: .min) + + try? container.encodeIfPresent(max, forKey: .max) + } + } + + /* + Model: UsesRemaining + Used By: Cart + */ + + class UsesRemaining: Codable { + public var app: Int? + + public var total: Int? + + public var user: Int? + + public enum CodingKeys: String, CodingKey { + case app + + case total + + case user + } + + public init(app: Int?, total: Int?, user: Int?) { + self.app = app + + self.total = total + + self.user = user + } + + public func duplicate() -> UsesRemaining { + let dict = self.dictionary! + let copy = UsesRemaining(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + app = try container.decode(Int.self, forKey: .app) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + total = try container.decode(Int.self, forKey: .total) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + user = try container.decode(Int.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(app, forKey: .app) + + try? container.encodeIfPresent(total, forKey: .total) + + try? container.encodeIfPresent(user, forKey: .user) + } + } + + /* + Model: UsesRestriction + Used By: Cart + */ + + class UsesRestriction: Codable { + public var maximum: UsesRemaining? + + public var remaining: UsesRemaining? + + public enum CodingKeys: String, CodingKey { + case maximum + + case remaining + } + + public init(maximum: UsesRemaining?, remaining: UsesRemaining?) { + self.maximum = maximum + + self.remaining = remaining + } + + public func duplicate() -> UsesRestriction { + let dict = self.dictionary! + let copy = UsesRestriction(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + maximum = try container.decode(UsesRemaining.self, forKey: .maximum) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + remaining = try container.decode(UsesRemaining.self, forKey: .remaining) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(maximum, forKey: .maximum) + + try? container.encodeIfPresent(remaining, forKey: .remaining) + } + } + + /* + Model: Restrictions + Used By: Cart + */ + + class Restrictions: Codable { + public var couponAllowed: Bool? + + public var payments: [String: PaymentModes]? + + public var platforms: [String]? + + public var postOrder: PostOrder? + + public var bulkBundle: BulkBundleRestriction? + + public var priceRange: PriceRange? + + public var uses: UsesRestriction? + + public var orderingStores: [Int]? + + public enum CodingKeys: String, CodingKey { + case couponAllowed = "coupon_allowed" + + case payments + + case platforms + + case postOrder = "post_order" + + case bulkBundle = "bulk_bundle" + + case priceRange = "price_range" + + case uses + + case orderingStores = "ordering_stores" + } + + public init(bulkBundle: BulkBundleRestriction?, couponAllowed: Bool?, orderingStores: [Int]?, payments: [String: PaymentModes]?, platforms: [String]?, postOrder: PostOrder?, priceRange: PriceRange?, uses: UsesRestriction?) { + self.couponAllowed = couponAllowed + + self.payments = payments + + self.platforms = platforms + + self.postOrder = postOrder + + self.bulkBundle = bulkBundle + + self.priceRange = priceRange + + self.uses = uses + + self.orderingStores = orderingStores + } + + public func duplicate() -> Restrictions { + let dict = self.dictionary! + let copy = Restrictions(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + couponAllowed = try container.decode(Bool.self, forKey: .couponAllowed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + payments = try container.decode([String: PaymentModes].self, forKey: .payments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platforms = try container.decode([String].self, forKey: .platforms) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + postOrder = try container.decode(PostOrder.self, forKey: .postOrder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bulkBundle = try container.decode(BulkBundleRestriction.self, forKey: .bulkBundle) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priceRange = try container.decode(PriceRange.self, forKey: .priceRange) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uses = try container.decode(UsesRestriction.self, forKey: .uses) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderingStores = try container.decode([Int].self, forKey: .orderingStores) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(couponAllowed, forKey: .couponAllowed) + + try? container.encodeIfPresent(payments, forKey: .payments) + + try? container.encodeIfPresent(platforms, forKey: .platforms) + + try? container.encodeIfPresent(postOrder, forKey: .postOrder) + + try? container.encodeIfPresent(bulkBundle, forKey: .bulkBundle) + + try? container.encodeIfPresent(priceRange, forKey: .priceRange) + + try? container.encodeIfPresent(uses, forKey: .uses) + + try? container.encodeIfPresent(orderingStores, forKey: .orderingStores) + } + } + + /* + Model: State + Used By: Cart + */ + + class State: Codable { + public var isPublic: Bool? + + public var isDisplay: Bool? + + public var isArchived: Bool? + + public enum CodingKeys: String, CodingKey { + case isPublic = "is_public" + + case isDisplay = "is_display" + + case isArchived = "is_archived" + } + + public init(isArchived: Bool?, isDisplay: Bool?, isPublic: Bool?) { + self.isPublic = isPublic + + self.isDisplay = isDisplay + + self.isArchived = isArchived + } + + public func duplicate() -> State { + let dict = self.dictionary! + let copy = State(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isPublic = try container.decode(Bool.self, forKey: .isPublic) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isDisplay = try container.decode(Bool.self, forKey: .isDisplay) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isArchived = try container.decode(Bool.self, forKey: .isArchived) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isPublic, forKey: .isPublic) + + try? container.encodeIfPresent(isDisplay, forKey: .isDisplay) + + try? container.encodeIfPresent(isArchived, forKey: .isArchived) + } + } + + /* + Model: Ownership + Used By: Cart + */ + + class Ownership: Codable { + public var payableBy: String + + public var payableCategory: String + + public enum CodingKeys: String, CodingKey { + case payableBy = "payable_by" + + case payableCategory = "payable_category" + } + + public init(payableBy: String, payableCategory: String) { + self.payableBy = payableBy + + self.payableCategory = payableCategory + } + + public func duplicate() -> Ownership { + let dict = self.dictionary! + let copy = Ownership(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + payableBy = try container.decode(String.self, forKey: .payableBy) + + payableCategory = try container.decode(String.self, forKey: .payableCategory) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(payableBy, forKey: .payableBy) + + try? container.encodeIfPresent(payableCategory, forKey: .payableCategory) + } + } + + /* + Model: CouponAuthor + Used By: Cart + */ + + class CouponAuthor: Codable { + public var createdBy: String? + + public var modifiedBy: String? + + public enum CodingKeys: String, CodingKey { + case createdBy = "created_by" + + case modifiedBy = "modified_by" + } + + public init(createdBy: String?, modifiedBy: String?) { + self.createdBy = createdBy + + self.modifiedBy = modifiedBy + } + + public func duplicate() -> CouponAuthor { + let dict = self.dictionary! + let copy = CouponAuthor(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + createdBy = try container.decode(String.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode(String.self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(createdBy, forKey: .createdBy) + + try? container.encode(modifiedBy, forKey: .modifiedBy) + } + } + + /* + Model: CouponAction + Used By: Cart + */ + + class CouponAction: Codable { + public var actionDate: String? + + public var txnMode: String? + + public enum CodingKeys: String, CodingKey { + case actionDate = "action_date" + + case txnMode = "txn_mode" + } + + public init(actionDate: String?, txnMode: String?) { + self.actionDate = actionDate + + self.txnMode = txnMode + } + + public func duplicate() -> CouponAction { + let dict = self.dictionary! + let copy = CouponAction(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + actionDate = try container.decode(String.self, forKey: .actionDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + txnMode = try container.decode(String.self, forKey: .txnMode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(actionDate, forKey: .actionDate) + + try? container.encodeIfPresent(txnMode, forKey: .txnMode) + } + } + + /* + Model: Rule + Used By: Cart + */ + + class Rule: Codable { + public var key: Double? + + public var max: Double? + + public var min: Double? + + public var discountQty: Double? + + public var value: Double? + + public enum CodingKeys: String, CodingKey { + case key + + case max + + case min + + case discountQty = "discount_qty" + + case value + } + + public init(discountQty: Double?, key: Double?, max: Double?, min: Double?, value: Double?) { + self.key = key + + self.max = max + + self.min = min + + self.discountQty = discountQty + + self.value = value + } + + public func duplicate() -> Rule { + let dict = self.dictionary! + let copy = Rule(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(Double.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + max = try container.decode(Double.self, forKey: .max) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + min = try container.decode(Double.self, forKey: .min) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discountQty = try container.decode(Double.self, forKey: .discountQty) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(Double.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(max, forKey: .max) + + try? container.encodeIfPresent(min, forKey: .min) + + try? container.encodeIfPresent(discountQty, forKey: .discountQty) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: CouponAdd + Used By: Cart + */ + + class CouponAdd: Codable { + public var schedule: CouponSchedule? + + public var identifiers: Identifier + + public var validity: Validity + + public var tags: [String]? + + public var validation: Validation? + + public var ruleDefinition: RuleDefinition + + public var dateMeta: CouponDateMeta? + + public var displayMeta: DisplayMeta + + public var restrictions: Restrictions? + + public var state: State? + + public var ownership: Ownership + + public var author: CouponAuthor? + + public var action: CouponAction? + + public var typeSlug: String + + public var rule: [Rule] + + public var code: String + + public enum CodingKeys: String, CodingKey { + case schedule = "_schedule" + + case identifiers + + case validity + + case tags + + case validation + + case ruleDefinition = "rule_definition" + + case dateMeta = "date_meta" + + case displayMeta = "display_meta" + + case restrictions + + case state + + case ownership + + case author + + case action + + case typeSlug = "type_slug" + + case rule + + case code + } + + public init(action: CouponAction?, author: CouponAuthor?, code: String, dateMeta: CouponDateMeta?, displayMeta: DisplayMeta, identifiers: Identifier, ownership: Ownership, restrictions: Restrictions?, rule: [Rule], ruleDefinition: RuleDefinition, state: State?, tags: [String]?, typeSlug: String, validation: Validation?, validity: Validity, schedule: CouponSchedule?) { + self.schedule = schedule + + self.identifiers = identifiers + + self.validity = validity + + self.tags = tags + + self.validation = validation + + self.ruleDefinition = ruleDefinition + + self.dateMeta = dateMeta + + self.displayMeta = displayMeta + + self.restrictions = restrictions + + self.state = state + + self.ownership = ownership + + self.author = author + + self.action = action + + self.typeSlug = typeSlug + + self.rule = rule + + self.code = code + } + + public func duplicate() -> CouponAdd { + let dict = self.dictionary! + let copy = CouponAdd(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + schedule = try container.decode(CouponSchedule.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + identifiers = try container.decode(Identifier.self, forKey: .identifiers) + + validity = try container.decode(Validity.self, forKey: .validity) + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + validation = try container.decode(Validation.self, forKey: .validation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + ruleDefinition = try container.decode(RuleDefinition.self, forKey: .ruleDefinition) + + do { + dateMeta = try container.decode(CouponDateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + displayMeta = try container.decode(DisplayMeta.self, forKey: .displayMeta) + + do { + restrictions = try container.decode(Restrictions.self, forKey: .restrictions) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(State.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + ownership = try container.decode(Ownership.self, forKey: .ownership) + + do { + author = try container.decode(CouponAuthor.self, forKey: .author) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(CouponAction.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + typeSlug = try container.decode(String.self, forKey: .typeSlug) + + rule = try container.decode([Rule].self, forKey: .rule) + + code = try container.decode(String.self, forKey: .code) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + + try? container.encodeIfPresent(identifiers, forKey: .identifiers) + + try? container.encodeIfPresent(validity, forKey: .validity) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(validation, forKey: .validation) + + try? container.encodeIfPresent(ruleDefinition, forKey: .ruleDefinition) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(displayMeta, forKey: .displayMeta) + + try? container.encodeIfPresent(restrictions, forKey: .restrictions) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(ownership, forKey: .ownership) + + try? container.encodeIfPresent(author, forKey: .author) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(typeSlug, forKey: .typeSlug) + + try? container.encodeIfPresent(rule, forKey: .rule) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: CouponsResponse + Used By: Cart + */ + + class CouponsResponse: Codable { + public var items: CouponAdd? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: CouponAdd?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> CouponsResponse { + let dict = self.dictionary! + let copy = CouponsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode(CouponAdd.self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: SuccessMessage + Used By: Cart + */ + + class SuccessMessage: Codable { + public var message: String? + + public var success: Bool? + + public enum CodingKeys: String, CodingKey { + case message + + case success + } + + public init(message: String?, success: Bool?) { + self.message = message + + self.success = success + } + + public func duplicate() -> SuccessMessage { + let dict = self.dictionary! + let copy = SuccessMessage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: OperationErrorResponse + Used By: Cart + */ + + class OperationErrorResponse: Codable { + public var message: String? + + public var success: Bool? + + public enum CodingKeys: String, CodingKey { + case message + + case success + } + + public init(message: String?, success: Bool?) { + self.message = message + + self.success = success + } + + public func duplicate() -> OperationErrorResponse { + let dict = self.dictionary! + let copy = OperationErrorResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: CouponUpdate + Used By: Cart + */ + + class CouponUpdate: Codable { + public var schedule: CouponSchedule? + + public var identifiers: Identifier + + public var validity: Validity + + public var tags: [String]? + + public var validation: Validation? + + public var ruleDefinition: RuleDefinition + + public var dateMeta: CouponDateMeta? + + public var displayMeta: DisplayMeta + + public var restrictions: Restrictions? + + public var state: State? + + public var ownership: Ownership + + public var author: CouponAuthor? + + public var action: CouponAction? + + public var typeSlug: String + + public var rule: [Rule] + + public var code: String + + public enum CodingKeys: String, CodingKey { + case schedule = "_schedule" + + case identifiers + + case validity + + case tags + + case validation + + case ruleDefinition = "rule_definition" + + case dateMeta = "date_meta" + + case displayMeta = "display_meta" + + case restrictions + + case state + + case ownership + + case author + + case action + + case typeSlug = "type_slug" + + case rule + + case code + } + + public init(action: CouponAction?, author: CouponAuthor?, code: String, dateMeta: CouponDateMeta?, displayMeta: DisplayMeta, identifiers: Identifier, ownership: Ownership, restrictions: Restrictions?, rule: [Rule], ruleDefinition: RuleDefinition, state: State?, tags: [String]?, typeSlug: String, validation: Validation?, validity: Validity, schedule: CouponSchedule?) { + self.schedule = schedule + + self.identifiers = identifiers + + self.validity = validity + + self.tags = tags + + self.validation = validation + + self.ruleDefinition = ruleDefinition + + self.dateMeta = dateMeta + + self.displayMeta = displayMeta + + self.restrictions = restrictions + + self.state = state + + self.ownership = ownership + + self.author = author + + self.action = action + + self.typeSlug = typeSlug + + self.rule = rule + + self.code = code + } + + public func duplicate() -> CouponUpdate { + let dict = self.dictionary! + let copy = CouponUpdate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + schedule = try container.decode(CouponSchedule.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + identifiers = try container.decode(Identifier.self, forKey: .identifiers) + + validity = try container.decode(Validity.self, forKey: .validity) + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + validation = try container.decode(Validation.self, forKey: .validation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + ruleDefinition = try container.decode(RuleDefinition.self, forKey: .ruleDefinition) + + do { + dateMeta = try container.decode(CouponDateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + displayMeta = try container.decode(DisplayMeta.self, forKey: .displayMeta) + + do { + restrictions = try container.decode(Restrictions.self, forKey: .restrictions) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(State.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + ownership = try container.decode(Ownership.self, forKey: .ownership) + + do { + author = try container.decode(CouponAuthor.self, forKey: .author) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(CouponAction.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + typeSlug = try container.decode(String.self, forKey: .typeSlug) + + rule = try container.decode([Rule].self, forKey: .rule) + + code = try container.decode(String.self, forKey: .code) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + + try? container.encodeIfPresent(identifiers, forKey: .identifiers) + + try? container.encodeIfPresent(validity, forKey: .validity) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(validation, forKey: .validation) + + try? container.encodeIfPresent(ruleDefinition, forKey: .ruleDefinition) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(displayMeta, forKey: .displayMeta) + + try? container.encodeIfPresent(restrictions, forKey: .restrictions) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(ownership, forKey: .ownership) + + try? container.encodeIfPresent(author, forKey: .author) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(typeSlug, forKey: .typeSlug) + + try? container.encodeIfPresent(rule, forKey: .rule) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: CouponPartialUpdate + Used By: Cart + */ + + class CouponPartialUpdate: Codable { + public var schedule: CouponSchedule? + + public var archive: Bool? + + public enum CodingKeys: String, CodingKey { + case schedule + + case archive + } + + public init(archive: Bool?, schedule: CouponSchedule?) { + self.schedule = schedule + + self.archive = archive + } + + public func duplicate() -> CouponPartialUpdate { + let dict = self.dictionary! + let copy = CouponPartialUpdate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + schedule = try container.decode(CouponSchedule.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archive = try container.decode(Bool.self, forKey: .archive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + + try? container.encodeIfPresent(archive, forKey: .archive) + } + } + + /* + Model: CartItem + Used By: Cart + */ + + class CartItem: Codable { + public var quantity: Int? + + public var size: String + + public var productId: String + + public enum CodingKeys: String, CodingKey { + case quantity + + case size + + case productId = "product_id" + } + + public init(productId: String, quantity: Int?, size: String) { + self.quantity = quantity + + self.size = size + + self.productId = productId + } + + public func duplicate() -> CartItem { + let dict = self.dictionary! + let copy = CartItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + size = try container.decode(String.self, forKey: .size) + + productId = try container.decode(String.self, forKey: .productId) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(productId, forKey: .productId) + } + } + + /* + Model: OpenapiCartDetailsRequest + Used By: Cart + */ + + class OpenapiCartDetailsRequest: Codable { + public var cartItems: CartItem? + + public enum CodingKeys: String, CodingKey { + case cartItems = "cart_items" + } + + public init(cartItems: CartItem?) { + self.cartItems = cartItems + } + + public func duplicate() -> OpenapiCartDetailsRequest { + let dict = self.dictionary! + let copy = OpenapiCartDetailsRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + cartItems = try container.decode(CartItem.self, forKey: .cartItems) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(cartItems, forKey: .cartItems) + } + } + + /* + Model: CouponBreakup + Used By: Cart + */ + + class CouponBreakup: Codable { + public var uid: String? + + public var message: String? + + public var type: String? + + public var isApplied: Bool? + + public var value: Double? + + public var code: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case message + + case type + + case isApplied = "is_applied" + + case value + + case code + } + + public init(code: String?, isApplied: Bool?, message: String?, type: String?, uid: String?, value: Double?) { + self.uid = uid + + self.message = message + + self.type = type + + self.isApplied = isApplied + + self.value = value + + self.code = code + } + + public func duplicate() -> CouponBreakup { + let dict = self.dictionary! + let copy = CouponBreakup(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isApplied = try container.decode(Bool.self, forKey: .isApplied) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(Double.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(isApplied, forKey: .isApplied) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: DisplayBreakup + Used By: Cart + */ + + class DisplayBreakup: Codable { + public var key: String? + + public var currencyCode: String? + + public var message: [String]? + + public var currencySymbol: String? + + public var value: Double? + + public var display: String? + + public enum CodingKeys: String, CodingKey { + case key + + case currencyCode = "currency_code" + + case message + + case currencySymbol = "currency_symbol" + + case value + + case display + } + + public init(currencyCode: String?, currencySymbol: String?, display: String?, key: String?, message: [String]?, value: Double?) { + self.key = key + + self.currencyCode = currencyCode + + self.message = message + + self.currencySymbol = currencySymbol + + self.value = value + + self.display = display + } + + public func duplicate() -> DisplayBreakup { + let dict = self.dictionary! + let copy = DisplayBreakup(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode([String].self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencySymbol = try container.decode(String.self, forKey: .currencySymbol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(Double.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(display, forKey: .display) + } + } + + /* + Model: LoyaltyPoints + Used By: Cart + */ + + class LoyaltyPoints: Codable { + public var isApplied: Bool? + + public var total: Double? + + public var description: String? + + public var applicable: Double? + + public enum CodingKeys: String, CodingKey { + case isApplied = "is_applied" + + case total + + case description + + case applicable + } + + public init(applicable: Double?, description: String?, isApplied: Bool?, total: Double?) { + self.isApplied = isApplied + + self.total = total + + self.description = description + + self.applicable = applicable + } + + public func duplicate() -> LoyaltyPoints { + let dict = self.dictionary! + let copy = LoyaltyPoints(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isApplied = try container.decode(Bool.self, forKey: .isApplied) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + total = try container.decode(Double.self, forKey: .total) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + applicable = try container.decode(Double.self, forKey: .applicable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isApplied, forKey: .isApplied) + + try? container.encodeIfPresent(total, forKey: .total) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(applicable, forKey: .applicable) + } + } + + /* + Model: RawBreakup + Used By: Cart + */ + + class RawBreakup: Codable { + public var fyndCash: Double? + + public var subtotal: Double? + + public var total: Double? + + public var codCharge: Double? + + public var vog: Double? + + public var discount: Double? + + public var deliveryCharge: Double? + + public var youSaved: Double? + + public var mrpTotal: Double? + + public var convenienceFee: Double? + + public var coupon: Double? + + public var gstCharges: Double? + + public enum CodingKeys: String, CodingKey { + case fyndCash = "fynd_cash" + + case subtotal + + case total + + case codCharge = "cod_charge" + + case vog + + case discount + + case deliveryCharge = "delivery_charge" + + case youSaved = "you_saved" + + case mrpTotal = "mrp_total" + + case convenienceFee = "convenience_fee" + + case coupon + + case gstCharges = "gst_charges" + } + + public init(codCharge: Double?, convenienceFee: Double?, coupon: Double?, deliveryCharge: Double?, discount: Double?, fyndCash: Double?, gstCharges: Double?, mrpTotal: Double?, subtotal: Double?, total: Double?, vog: Double?, youSaved: Double?) { + self.fyndCash = fyndCash + + self.subtotal = subtotal + + self.total = total + + self.codCharge = codCharge + + self.vog = vog + + self.discount = discount + + self.deliveryCharge = deliveryCharge + + self.youSaved = youSaved + + self.mrpTotal = mrpTotal + + self.convenienceFee = convenienceFee + + self.coupon = coupon + + self.gstCharges = gstCharges + } + + public func duplicate() -> RawBreakup { + let dict = self.dictionary! + let copy = RawBreakup(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + fyndCash = try container.decode(Double.self, forKey: .fyndCash) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subtotal = try container.decode(Double.self, forKey: .subtotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + total = try container.decode(Double.self, forKey: .total) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + codCharge = try container.decode(Double.self, forKey: .codCharge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + vog = try container.decode(Double.self, forKey: .vog) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discount = try container.decode(Double.self, forKey: .discount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryCharge = try container.decode(Double.self, forKey: .deliveryCharge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + youSaved = try container.decode(Double.self, forKey: .youSaved) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mrpTotal = try container.decode(Double.self, forKey: .mrpTotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + convenienceFee = try container.decode(Double.self, forKey: .convenienceFee) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + coupon = try container.decode(Double.self, forKey: .coupon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstCharges = try container.decode(Double.self, forKey: .gstCharges) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(fyndCash, forKey: .fyndCash) + + try? container.encodeIfPresent(subtotal, forKey: .subtotal) + + try? container.encodeIfPresent(total, forKey: .total) + + try? container.encodeIfPresent(codCharge, forKey: .codCharge) + + try? container.encodeIfPresent(vog, forKey: .vog) + + try? container.encodeIfPresent(discount, forKey: .discount) + + try? container.encodeIfPresent(deliveryCharge, forKey: .deliveryCharge) + + try? container.encodeIfPresent(youSaved, forKey: .youSaved) + + try? container.encodeIfPresent(mrpTotal, forKey: .mrpTotal) + + try? container.encodeIfPresent(convenienceFee, forKey: .convenienceFee) + + try? container.encodeIfPresent(coupon, forKey: .coupon) + + try? container.encodeIfPresent(gstCharges, forKey: .gstCharges) + } + } + + /* + Model: CartBreakup + Used By: Cart + */ + + class CartBreakup: Codable { + public var coupon: CouponBreakup? + + public var display: [DisplayBreakup]? + + public var loyaltyPoints: LoyaltyPoints? + + public var raw: RawBreakup? + + public enum CodingKeys: String, CodingKey { + case coupon + + case display + + case loyaltyPoints = "loyalty_points" + + case raw + } + + public init(coupon: CouponBreakup?, display: [DisplayBreakup]?, loyaltyPoints: LoyaltyPoints?, raw: RawBreakup?) { + self.coupon = coupon + + self.display = display + + self.loyaltyPoints = loyaltyPoints + + self.raw = raw + } + + public func duplicate() -> CartBreakup { + let dict = self.dictionary! + let copy = CartBreakup(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + coupon = try container.decode(CouponBreakup.self, forKey: .coupon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode([DisplayBreakup].self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + loyaltyPoints = try container.decode(LoyaltyPoints.self, forKey: .loyaltyPoints) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + raw = try container.decode(RawBreakup.self, forKey: .raw) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(coupon, forKey: .coupon) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(loyaltyPoints, forKey: .loyaltyPoints) + + try? container.encodeIfPresent(raw, forKey: .raw) + } + } + + /* + Model: PromoMeta + Used By: Cart + */ + + class PromoMeta: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> PromoMeta { + let dict = self.dictionary! + let copy = PromoMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: CartProductIdentifer + Used By: Cart + */ + + class CartProductIdentifer: Codable { + public var identifier: String? + + public enum CodingKeys: String, CodingKey { + case identifier + } + + public init(identifier: String?) { + self.identifier = identifier + } + + public func duplicate() -> CartProductIdentifer { + let dict = self.dictionary! + let copy = CartProductIdentifer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + identifier = try container.decode(String.self, forKey: .identifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(identifier, forKey: .identifier) + } + } + + /* + Model: ProductPrice + Used By: Cart + */ + + class ProductPrice: Codable { + public var marked: Double? + + public var currencyCode: String? + + public var selling: Double? + + public var addOn: Double? + + public var effective: Double? + + public var currencySymbol: String? + + public enum CodingKeys: String, CodingKey { + case marked + + case currencyCode = "currency_code" + + case selling + + case addOn = "add_on" + + case effective + + case currencySymbol = "currency_symbol" + } + + public init(addOn: Double?, currencyCode: String?, currencySymbol: String?, effective: Double?, marked: Double?, selling: Double?) { + self.marked = marked + + self.currencyCode = currencyCode + + self.selling = selling + + self.addOn = addOn + + self.effective = effective + + self.currencySymbol = currencySymbol + } + + public func duplicate() -> ProductPrice { + let dict = self.dictionary! + let copy = ProductPrice(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + marked = try container.decode(Double.self, forKey: .marked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + selling = try container.decode(Double.self, forKey: .selling) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addOn = try container.decode(Double.self, forKey: .addOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + effective = try container.decode(Double.self, forKey: .effective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencySymbol = try container.decode(String.self, forKey: .currencySymbol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(marked, forKey: .marked) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + + try? container.encodeIfPresent(selling, forKey: .selling) + + try? container.encodeIfPresent(addOn, forKey: .addOn) + + try? container.encodeIfPresent(effective, forKey: .effective) + + try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) + } + } + + /* + Model: ProductPriceInfo + Used By: Cart + */ + + class ProductPriceInfo: Codable { + public var base: ProductPrice? + + public var converted: ProductPrice? + + public enum CodingKeys: String, CodingKey { + case base + + case converted + } + + public init(base: ProductPrice?, converted: ProductPrice?) { + self.base = base + + self.converted = converted + } + + public func duplicate() -> ProductPriceInfo { + let dict = self.dictionary! + let copy = ProductPriceInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + base = try container.decode(ProductPrice.self, forKey: .base) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + converted = try container.decode(ProductPrice.self, forKey: .converted) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(base, forKey: .base) + + try? container.encodeIfPresent(converted, forKey: .converted) + } + } + + /* + Model: ProductImage + Used By: Cart + */ + + class ProductImage: Codable { + public var aspectRatio: String? + + public var url: String? + + public var secureUrl: String? + + public enum CodingKeys: String, CodingKey { + case aspectRatio = "aspect_ratio" + + case url + + case secureUrl = "secure_url" + } + + public init(aspectRatio: String?, secureUrl: String?, url: String?) { + self.aspectRatio = aspectRatio + + self.url = url + + self.secureUrl = secureUrl + } + + public func duplicate() -> ProductImage { + let dict = self.dictionary! + let copy = ProductImage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + aspectRatio = try container.decode(String.self, forKey: .aspectRatio) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + secureUrl = try container.decode(String.self, forKey: .secureUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) + } + } + + /* + Model: ActionQuery + Used By: Cart + */ + + class ActionQuery: Codable { + public var productSlug: [String]? + + public enum CodingKeys: String, CodingKey { + case productSlug = "product_slug" + } + + public init(productSlug: [String]?) { + self.productSlug = productSlug + } + + public func duplicate() -> ActionQuery { + let dict = self.dictionary! + let copy = ActionQuery(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + productSlug = try container.decode([String].self, forKey: .productSlug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(productSlug, forKey: .productSlug) + } + } + + /* + Model: ProductAction + Used By: Cart + */ + + class ProductAction: Codable { + public var query: ActionQuery? + + public var type: String? + + public var url: String? + + public enum CodingKeys: String, CodingKey { + case query + + case type + + case url + } + + public init(query: ActionQuery?, type: String?, url: String?) { + self.query = query + + self.type = type + + self.url = url + } + + public func duplicate() -> ProductAction { + let dict = self.dictionary! + let copy = ProductAction(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + query = try container.decode(ActionQuery.self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(query, forKey: .query) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(url, forKey: .url) + } + } + + /* + Model: BaseInfo + Used By: Cart + */ + + class BaseInfo: Codable { + public var uid: Int? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case name + } + + public init(name: String?, uid: Int?) { + self.uid = uid + + self.name = name + } + + public func duplicate() -> BaseInfo { + let dict = self.dictionary! + let copy = BaseInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: CategoryInfo + Used By: Cart + */ + + class CategoryInfo: Codable { + public var uid: Int? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case name + } + + public init(name: String?, uid: Int?) { + self.uid = uid + + self.name = name + } + + public func duplicate() -> CategoryInfo { + let dict = self.dictionary! + let copy = CategoryInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: CartProduct + Used By: Cart + */ + + class CartProduct: Codable { + public var images: [ProductImage]? + + public var slug: String? + + public var uid: Int? + + public var type: String? + + public var name: String? + + public var action: ProductAction? + + public var brand: BaseInfo? + + public var categories: [CategoryInfo]? + + public enum CodingKeys: String, CodingKey { + case images + + case slug + + case uid + + case type + + case name + + case action + + case brand + + case categories + } + + public init(action: ProductAction?, brand: BaseInfo?, categories: [CategoryInfo]?, images: [ProductImage]?, name: String?, slug: String?, type: String?, uid: Int?) { + self.images = images + + self.slug = slug + + self.uid = uid + + self.type = type + + self.name = name + + self.action = action + + self.brand = brand + + self.categories = categories + } + + public func duplicate() -> CartProduct { + let dict = self.dictionary! + let copy = CartProduct(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + images = try container.decode([ProductImage].self, forKey: .images) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(ProductAction.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brand = try container.decode(BaseInfo.self, forKey: .brand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + categories = try container.decode([CategoryInfo].self, forKey: .categories) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(images, forKey: .images) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(brand, forKey: .brand) + + try? container.encodeIfPresent(categories, forKey: .categories) + } + } + + /* + Model: ProductAvailability + Used By: Cart + */ + + class ProductAvailability: Codable { + public var deliverable: Bool? + + public var otherStoreQuantity: Int? + + public var sizes: [String]? + + public var outOfStock: Bool? + + public var isValid: Bool? + + public enum CodingKeys: String, CodingKey { + case deliverable + + case otherStoreQuantity = "other_store_quantity" + + case sizes + + case outOfStock = "out_of_stock" + + case isValid = "is_valid" + } + + public init(deliverable: Bool?, isValid: Bool?, otherStoreQuantity: Int?, outOfStock: Bool?, sizes: [String]?) { + self.deliverable = deliverable + + self.otherStoreQuantity = otherStoreQuantity + + self.sizes = sizes + + self.outOfStock = outOfStock + + self.isValid = isValid + } + + public func duplicate() -> ProductAvailability { + let dict = self.dictionary! + let copy = ProductAvailability(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + deliverable = try container.decode(Bool.self, forKey: .deliverable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + otherStoreQuantity = try container.decode(Int.self, forKey: .otherStoreQuantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sizes = try container.decode([String].self, forKey: .sizes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + outOfStock = try container.decode(Bool.self, forKey: .outOfStock) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isValid = try container.decode(Bool.self, forKey: .isValid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(deliverable, forKey: .deliverable) + + try? container.encodeIfPresent(otherStoreQuantity, forKey: .otherStoreQuantity) + + try? container.encodeIfPresent(sizes, forKey: .sizes) + + try? container.encodeIfPresent(outOfStock, forKey: .outOfStock) + + try? container.encodeIfPresent(isValid, forKey: .isValid) + } + } + + /* + Model: BasePrice + Used By: Cart + */ + + class BasePrice: Codable { + public var marked: Double? + + public var currencySymbol: String? + + public var effective: Double? + + public var currencyCode: String? + + public enum CodingKeys: String, CodingKey { + case marked + + case currencySymbol = "currency_symbol" + + case effective + + case currencyCode = "currency_code" + } + + public init(currencyCode: String?, currencySymbol: String?, effective: Double?, marked: Double?) { + self.marked = marked + + self.currencySymbol = currencySymbol + + self.effective = effective + + self.currencyCode = currencyCode + } + + public func duplicate() -> BasePrice { + let dict = self.dictionary! + let copy = BasePrice(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + marked = try container.decode(Double.self, forKey: .marked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencySymbol = try container.decode(String.self, forKey: .currencySymbol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + effective = try container.decode(Double.self, forKey: .effective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(marked, forKey: .marked) + + try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) + + try? container.encodeIfPresent(effective, forKey: .effective) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + } + } + + /* + Model: ArticlePriceInfo + Used By: Cart + */ + + class ArticlePriceInfo: Codable { + public var base: BasePrice? + + public var converted: BasePrice? + + public enum CodingKeys: String, CodingKey { + case base + + case converted + } + + public init(base: BasePrice?, converted: BasePrice?) { + self.base = base + + self.converted = converted + } + + public func duplicate() -> ArticlePriceInfo { + let dict = self.dictionary! + let copy = ArticlePriceInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + base = try container.decode(BasePrice.self, forKey: .base) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + converted = try container.decode(BasePrice.self, forKey: .converted) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(base, forKey: .base) + + try? container.encodeIfPresent(converted, forKey: .converted) + } + } + + /* + Model: ProductArticle + Used By: Cart + */ + + class ProductArticle: Codable { + public var quantity: Int? + + public var size: String? + + public var store: BaseInfo? + + public var seller: BaseInfo? + + public var uid: String? + + public var price: ArticlePriceInfo? + + public var type: String? + + public var extraMeta: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case quantity + + case size + + case store + + case seller + + case uid + + case price + + case type + + case extraMeta = "extra_meta" + } + + public init(extraMeta: [String: Any]?, price: ArticlePriceInfo?, quantity: Int?, seller: BaseInfo?, size: String?, store: BaseInfo?, type: String?, uid: String?) { + self.quantity = quantity + + self.size = size + + self.store = store + + self.seller = seller + + self.uid = uid + + self.price = price + + self.type = type + + self.extraMeta = extraMeta + } + + public func duplicate() -> ProductArticle { + let dict = self.dictionary! + let copy = ProductArticle(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(String.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + store = try container.decode(BaseInfo.self, forKey: .store) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + seller = try container.decode(BaseInfo.self, forKey: .seller) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(ArticlePriceInfo.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + extraMeta = try container.decode([String: Any].self, forKey: .extraMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(store, forKey: .store) + + try? container.encodeIfPresent(seller, forKey: .seller) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(extraMeta, forKey: .extraMeta) + } + } + + /* + Model: CartProductInfo + Used By: Cart + */ + + class CartProductInfo: Codable { + public var key: String? + + public var quantity: Int? + + public var promoMeta: PromoMeta? + + public var isSet: Bool? + + public var discount: String? + + public var identifiers: CartProductIdentifer + + public var couponMessage: String? + + public var message: String? + + public var price: ProductPriceInfo? + + public var bulkOffer: [String: Any]? + + public var product: CartProduct? + + public var availability: ProductAvailability? + + public var article: ProductArticle? + + public var pricePerUnit: ProductPriceInfo? + + public enum CodingKeys: String, CodingKey { + case key + + case quantity + + case promoMeta = "promo_meta" + + case isSet = "is_set" + + case discount + + case identifiers + + case couponMessage = "coupon_message" + + case message + + case price + + case bulkOffer = "bulk_offer" + + case product + + case availability + + case article + + case pricePerUnit = "price_per_unit" + } + + public init(article: ProductArticle?, availability: ProductAvailability?, bulkOffer: [String: Any]?, couponMessage: String?, discount: String?, identifiers: CartProductIdentifer, isSet: Bool?, key: String?, message: String?, price: ProductPriceInfo?, pricePerUnit: ProductPriceInfo?, product: CartProduct?, promoMeta: PromoMeta?, quantity: Int?) { + self.key = key + + self.quantity = quantity + + self.promoMeta = promoMeta + + self.isSet = isSet + + self.discount = discount + + self.identifiers = identifiers + + self.couponMessage = couponMessage + + self.message = message + + self.price = price + + self.bulkOffer = bulkOffer + + self.product = product + + self.availability = availability + + self.article = article + + self.pricePerUnit = pricePerUnit + } + + public func duplicate() -> CartProductInfo { + let dict = self.dictionary! + let copy = CartProductInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + promoMeta = try container.decode(PromoMeta.self, forKey: .promoMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isSet = try container.decode(Bool.self, forKey: .isSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discount = try container.decode(String.self, forKey: .discount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + identifiers = try container.decode(CartProductIdentifer.self, forKey: .identifiers) + + do { + couponMessage = try container.decode(String.self, forKey: .couponMessage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(ProductPriceInfo.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bulkOffer = try container.decode([String: Any].self, forKey: .bulkOffer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + product = try container.decode(CartProduct.self, forKey: .product) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + availability = try container.decode(ProductAvailability.self, forKey: .availability) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + article = try container.decode(ProductArticle.self, forKey: .article) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pricePerUnit = try container.decode(ProductPriceInfo.self, forKey: .pricePerUnit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(promoMeta, forKey: .promoMeta) + + try? container.encodeIfPresent(isSet, forKey: .isSet) + + try? container.encodeIfPresent(discount, forKey: .discount) + + try? container.encodeIfPresent(identifiers, forKey: .identifiers) + + try? container.encodeIfPresent(couponMessage, forKey: .couponMessage) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(bulkOffer, forKey: .bulkOffer) + + try? container.encodeIfPresent(product, forKey: .product) + + try? container.encodeIfPresent(availability, forKey: .availability) + + try? container.encodeIfPresent(article, forKey: .article) + + try? container.encodeIfPresent(pricePerUnit, forKey: .pricePerUnit) + } + } + + /* + Model: OpenapiCartDetailsResponse + Used By: Cart + */ + + class OpenapiCartDetailsResponse: Codable { + public var message: String? + + public var isValid: Bool? + + public var breakupValues: CartBreakup? + + public var items: [CartProductInfo]? + + public enum CodingKeys: String, CodingKey { + case message + + case isValid = "is_valid" + + case breakupValues = "breakup_values" + + case items + } + + public init(breakupValues: CartBreakup?, isValid: Bool?, items: [CartProductInfo]?, message: String?) { + self.message = message + + self.isValid = isValid + + self.breakupValues = breakupValues + + self.items = items + } + + public func duplicate() -> OpenapiCartDetailsResponse { + let dict = self.dictionary! + let copy = OpenapiCartDetailsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isValid = try container.decode(Bool.self, forKey: .isValid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + breakupValues = try container.decode(CartBreakup.self, forKey: .breakupValues) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([CartProductInfo].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(isValid, forKey: .isValid) + + try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: OpenApiErrorResponse + Used By: Cart + */ + + class OpenApiErrorResponse: Codable { + public var message: String? + + public var success: Bool? + + public var errors: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case message + + case success + + case errors + } + + public init(errors: [String: Any]?, message: String?, success: Bool?) { + self.message = message + + self.success = success + + self.errors = errors + } + + public func duplicate() -> OpenApiErrorResponse { + let dict = self.dictionary! + let copy = OpenApiErrorResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + errors = try container.decode([String: Any].self, forKey: .errors) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(errors, forKey: .errors) + } + } + + /* + Model: ShippingAddress + Used By: Cart + */ + + class ShippingAddress: Codable { + public var countryCode: String? + + public var areaCodeSlug: String? + + public var phone: Int? + + public var pincode: Int? + + public var country: String? + + public var city: String? + + public var addressType: String? + + public var landmark: String? + + public var meta: [String: Any]? + + public var address: String? + + public var state: String? + + public var email: String? + + public var name: String? + + public var areaCode: String + + public var area: String? + + public enum CodingKeys: String, CodingKey { + case countryCode = "country_code" + + case areaCodeSlug = "area_code_slug" + + case phone + + case pincode + + case country + + case city + + case addressType = "address_type" + + case landmark + + case meta + + case address + + case state + + case email + + case name + + case areaCode = "area_code" + + case area + } + + public init(address: String?, addressType: String?, area: String?, areaCode: String, areaCodeSlug: String?, city: String?, country: String?, countryCode: String?, email: String?, landmark: String?, meta: [String: Any]?, name: String?, phone: Int?, pincode: Int?, state: String?) { + self.countryCode = countryCode + + self.areaCodeSlug = areaCodeSlug + + self.phone = phone + + self.pincode = pincode + + self.country = country + + self.city = city + + self.addressType = addressType + + self.landmark = landmark + + self.meta = meta + + self.address = address + + self.state = state + + self.email = email + + self.name = name + + self.areaCode = areaCode + + self.area = area + } + + public func duplicate() -> ShippingAddress { + let dict = self.dictionary! + let copy = ShippingAddress(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + areaCodeSlug = try container.decode(String.self, forKey: .areaCodeSlug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(Int.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(Int.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressType = try container.decode(String.self, forKey: .addressType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + landmark = try container.decode(String.self, forKey: .landmark) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address = try container.decode(String.self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + areaCode = try container.decode(String.self, forKey: .areaCode) + + do { + area = try container.decode(String.self, forKey: .area) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(areaCodeSlug, forKey: .areaCodeSlug) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encode(country, forKey: .country) + + try? container.encode(city, forKey: .city) + + try? container.encodeIfPresent(addressType, forKey: .addressType) + + try? container.encodeIfPresent(landmark, forKey: .landmark) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encode(state, forKey: .state) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(areaCode, forKey: .areaCode) + + try? container.encodeIfPresent(area, forKey: .area) + } + } + + /* + Model: OpenApiCartServiceabilityRequest + Used By: Cart + */ + + class OpenApiCartServiceabilityRequest: Codable { + public var shippingAddress: ShippingAddress + + public var cartItems: CartItem? + + public enum CodingKeys: String, CodingKey { + case shippingAddress = "shipping_address" + + case cartItems = "cart_items" + } + + public init(cartItems: CartItem?, shippingAddress: ShippingAddress) { + self.shippingAddress = shippingAddress + + self.cartItems = cartItems + } + + public func duplicate() -> OpenApiCartServiceabilityRequest { + let dict = self.dictionary! + let copy = OpenApiCartServiceabilityRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + shippingAddress = try container.decode(ShippingAddress.self, forKey: .shippingAddress) + + do { + cartItems = try container.decode(CartItem.self, forKey: .cartItems) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(shippingAddress, forKey: .shippingAddress) + + try? container.encodeIfPresent(cartItems, forKey: .cartItems) + } + } + + /* + Model: PromiseTimestamp + Used By: Cart + */ + + class PromiseTimestamp: Codable { + public var min: Double? + + public var max: Double? + + public enum CodingKeys: String, CodingKey { + case min + + case max + } + + public init(max: Double?, min: Double?) { + self.min = min + + self.max = max + } + + public func duplicate() -> PromiseTimestamp { + let dict = self.dictionary! + let copy = PromiseTimestamp(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + min = try container.decode(Double.self, forKey: .min) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + max = try container.decode(Double.self, forKey: .max) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(min, forKey: .min) + + try? container.encodeIfPresent(max, forKey: .max) + } + } + + /* + Model: PromiseFormatted + Used By: Cart + */ + + class PromiseFormatted: Codable { + public var min: String? + + public var max: String? + + public enum CodingKeys: String, CodingKey { + case min + + case max + } + + public init(max: String?, min: String?) { + self.min = min + + self.max = max + } + + public func duplicate() -> PromiseFormatted { + let dict = self.dictionary! + let copy = PromiseFormatted(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + min = try container.decode(String.self, forKey: .min) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + max = try container.decode(String.self, forKey: .max) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(min, forKey: .min) + + try? container.encodeIfPresent(max, forKey: .max) + } + } + + /* + Model: ShipmentPromise + Used By: Cart + */ + + class ShipmentPromise: Codable { + public var timestamp: PromiseTimestamp? + + public var formatted: PromiseFormatted? + + public enum CodingKeys: String, CodingKey { + case timestamp + + case formatted + } + + public init(formatted: PromiseFormatted?, timestamp: PromiseTimestamp?) { + self.timestamp = timestamp + + self.formatted = formatted + } + + public func duplicate() -> ShipmentPromise { + let dict = self.dictionary! + let copy = ShipmentPromise(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + timestamp = try container.decode(PromiseTimestamp.self, forKey: .timestamp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + formatted = try container.decode(PromiseFormatted.self, forKey: .formatted) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(timestamp, forKey: .timestamp) + + try? container.encodeIfPresent(formatted, forKey: .formatted) + } + } + + /* + Model: OpenApiCartServiceabilityResponse + Used By: Cart + */ + + class OpenApiCartServiceabilityResponse: Codable { + public var message: String? + + public var breakupValues: CartBreakup? + + public var items: [CartProductInfo]? + + public var deliveryPromise: ShipmentPromise? + + public var isValid: Bool? + + public enum CodingKeys: String, CodingKey { + case message + + case breakupValues = "breakup_values" + + case items + + case deliveryPromise = "delivery_promise" + + case isValid = "is_valid" + } + + public init(breakupValues: CartBreakup?, deliveryPromise: ShipmentPromise?, isValid: Bool?, items: [CartProductInfo]?, message: String?) { + self.message = message + + self.breakupValues = breakupValues + + self.items = items + + self.deliveryPromise = deliveryPromise + + self.isValid = isValid + } + + public func duplicate() -> OpenApiCartServiceabilityResponse { + let dict = self.dictionary! + let copy = OpenApiCartServiceabilityResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + breakupValues = try container.decode(CartBreakup.self, forKey: .breakupValues) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([CartProductInfo].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryPromise = try container.decode(ShipmentPromise.self, forKey: .deliveryPromise) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isValid = try container.decode(Bool.self, forKey: .isValid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(deliveryPromise, forKey: .deliveryPromise) + + try? container.encodeIfPresent(isValid, forKey: .isValid) + } + } + + /* + Model: OpenApiFiles + Used By: Cart + */ + + class OpenApiFiles: Codable { + public var key: String + + public var values: [String] + + public enum CodingKeys: String, CodingKey { + case key + + case values + } + + public init(key: String, values: [String]) { + self.key = key + + self.values = values + } + + public func duplicate() -> OpenApiFiles { + let dict = self.dictionary! + let copy = OpenApiFiles(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + key = try container.decode(String.self, forKey: .key) + + values = try container.decode([String].self, forKey: .values) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(values, forKey: .values) + } + } + + /* + Model: CartItemMeta + Used By: Cart + */ + + class CartItemMeta: Codable { + public var groupId: String? + + public var primaryItem: Bool? + + public enum CodingKeys: String, CodingKey { + case groupId = "group_id" + + case primaryItem = "primary_item" + } + + public init(groupId: String?, primaryItem: Bool?) { + self.groupId = groupId + + self.primaryItem = primaryItem + } + + public func duplicate() -> CartItemMeta { + let dict = self.dictionary! + let copy = CartItemMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + groupId = try container.decode(String.self, forKey: .groupId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + primaryItem = try container.decode(Bool.self, forKey: .primaryItem) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(groupId, forKey: .groupId) + + try? container.encodeIfPresent(primaryItem, forKey: .primaryItem) + } + } + + /* + Model: OpenApiOrderItem + Used By: Cart + */ + + class OpenApiOrderItem: Codable { + public var quantity: Int? + + public var deliveryCharges: Double + + public var amountPaid: Double + + public var size: String + + public var couponEffectiveDiscount: Double + + public var discount: Double + + public var priceEffective: Double + + public var paymentMethods: [MultiTenderPaymentMethod] + + public var loyaltyDiscount: Double? + + public var files: [OpenApiFiles]? + + public var meta: CartItemMeta? + + public var employeeDiscount: Double? + + public var productId: Int + + public var extraMeta: [String: Any]? + + public var codCharges: Double + + public var priceMarked: Double + + public var cashbackApplied: Double + + public enum CodingKeys: String, CodingKey { + case quantity + + case deliveryCharges = "delivery_charges" + + case amountPaid = "amount_paid" + + case size + + case couponEffectiveDiscount = "coupon_effective_discount" + + case discount + + case priceEffective = "price_effective" + + case paymentMethods = "payment_methods" + + case loyaltyDiscount = "loyalty_discount" + + case files + + case meta + + case employeeDiscount = "employee_discount" + + case productId = "product_id" + + case extraMeta = "extra_meta" + + case codCharges = "cod_charges" + + case priceMarked = "price_marked" + + case cashbackApplied = "cashback_applied" + } + + public init(amountPaid: Double, cashbackApplied: Double, codCharges: Double, couponEffectiveDiscount: Double, deliveryCharges: Double, discount: Double, employeeDiscount: Double?, extraMeta: [String: Any]?, files: [OpenApiFiles]?, loyaltyDiscount: Double?, meta: CartItemMeta?, paymentMethods: [MultiTenderPaymentMethod], priceEffective: Double, priceMarked: Double, productId: Int, quantity: Int?, size: String) { + self.quantity = quantity + + self.deliveryCharges = deliveryCharges + + self.amountPaid = amountPaid + + self.size = size + + self.couponEffectiveDiscount = couponEffectiveDiscount + + self.discount = discount + + self.priceEffective = priceEffective + + self.paymentMethods = paymentMethods + + self.loyaltyDiscount = loyaltyDiscount + + self.files = files + + self.meta = meta + + self.employeeDiscount = employeeDiscount + + self.productId = productId + + self.extraMeta = extraMeta + + self.codCharges = codCharges + + self.priceMarked = priceMarked + + self.cashbackApplied = cashbackApplied + } + + public func duplicate() -> OpenApiOrderItem { + let dict = self.dictionary! + let copy = OpenApiOrderItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + deliveryCharges = try container.decode(Double.self, forKey: .deliveryCharges) + + amountPaid = try container.decode(Double.self, forKey: .amountPaid) + + size = try container.decode(String.self, forKey: .size) + + couponEffectiveDiscount = try container.decode(Double.self, forKey: .couponEffectiveDiscount) + + discount = try container.decode(Double.self, forKey: .discount) + + priceEffective = try container.decode(Double.self, forKey: .priceEffective) + + paymentMethods = try container.decode([MultiTenderPaymentMethod].self, forKey: .paymentMethods) + + do { + loyaltyDiscount = try container.decode(Double.self, forKey: .loyaltyDiscount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + files = try container.decode([OpenApiFiles].self, forKey: .files) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode(CartItemMeta.self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + employeeDiscount = try container.decode(Double.self, forKey: .employeeDiscount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + productId = try container.decode(Int.self, forKey: .productId) + + do { + extraMeta = try container.decode([String: Any].self, forKey: .extraMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + codCharges = try container.decode(Double.self, forKey: .codCharges) + + priceMarked = try container.decode(Double.self, forKey: .priceMarked) + + cashbackApplied = try container.decode(Double.self, forKey: .cashbackApplied) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(deliveryCharges, forKey: .deliveryCharges) + + try? container.encodeIfPresent(amountPaid, forKey: .amountPaid) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(couponEffectiveDiscount, forKey: .couponEffectiveDiscount) + + try? container.encodeIfPresent(discount, forKey: .discount) + + try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) + + try? container.encodeIfPresent(paymentMethods, forKey: .paymentMethods) + + try? container.encodeIfPresent(loyaltyDiscount, forKey: .loyaltyDiscount) + + try? container.encodeIfPresent(files, forKey: .files) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(employeeDiscount, forKey: .employeeDiscount) + + try? container.encodeIfPresent(productId, forKey: .productId) + + try? container.encodeIfPresent(extraMeta, forKey: .extraMeta) + + try? container.encodeIfPresent(codCharges, forKey: .codCharges) + + try? container.encodeIfPresent(priceMarked, forKey: .priceMarked) + + try? container.encodeIfPresent(cashbackApplied, forKey: .cashbackApplied) + } + } + + /* + Model: OpenApiPlatformCheckoutReq + Used By: Cart + */ + + class OpenApiPlatformCheckoutReq: Codable { + public var orderId: String? + + public var paymentMethods: [MultiTenderPaymentMethod] + + public var shippingAddress: ShippingAddress? + + public var loyaltyDiscount: Double? + + public var affiliateOrderId: String? + + public var couponValue: Double + + public var cartItems: [OpenApiOrderItem] + + public var currencyCode: String? + + public var deliveryCharges: Double + + public var couponCode: String + + public var files: [OpenApiFiles]? + + public var billingAddress: ShippingAddress + + public var employeeDiscount: [String: Any]? + + public var coupon: String? + + public var cartValue: Double + + public var codCharges: Double + + public var paymentMode: String? + + public var cashbackApplied: Double + + public enum CodingKeys: String, CodingKey { + case orderId = "order_id" + + case paymentMethods = "payment_methods" + + case shippingAddress = "shipping_address" + + case loyaltyDiscount = "loyalty_discount" + + case affiliateOrderId = "affiliate_order_id" + + case couponValue = "coupon_value" + + case cartItems = "cart_items" + + case currencyCode = "currency_code" + + case deliveryCharges = "delivery_charges" + + case couponCode = "coupon_code" + + case files + + case billingAddress = "billing_address" + + case employeeDiscount = "employee_discount" + + case coupon + + case cartValue = "cart_value" + + case codCharges = "cod_charges" + + case paymentMode = "payment_mode" + + case cashbackApplied = "cashback_applied" + } + + public init(affiliateOrderId: String?, billingAddress: ShippingAddress, cartItems: [OpenApiOrderItem], cartValue: Double, cashbackApplied: Double, codCharges: Double, coupon: String?, couponCode: String, couponValue: Double, currencyCode: String?, deliveryCharges: Double, employeeDiscount: [String: Any]?, files: [OpenApiFiles]?, loyaltyDiscount: Double?, orderId: String?, paymentMethods: [MultiTenderPaymentMethod], paymentMode: String?, shippingAddress: ShippingAddress?) { + self.orderId = orderId + + self.paymentMethods = paymentMethods + + self.shippingAddress = shippingAddress + + self.loyaltyDiscount = loyaltyDiscount + + self.affiliateOrderId = affiliateOrderId + + self.couponValue = couponValue + + self.cartItems = cartItems + + self.currencyCode = currencyCode + + self.deliveryCharges = deliveryCharges + + self.couponCode = couponCode + + self.files = files + + self.billingAddress = billingAddress + + self.employeeDiscount = employeeDiscount + + self.coupon = coupon + + self.cartValue = cartValue + + self.codCharges = codCharges + + self.paymentMode = paymentMode + + self.cashbackApplied = cashbackApplied + } + + public func duplicate() -> OpenApiPlatformCheckoutReq { + let dict = self.dictionary! + let copy = OpenApiPlatformCheckoutReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + orderId = try container.decode(String.self, forKey: .orderId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + paymentMethods = try container.decode([MultiTenderPaymentMethod].self, forKey: .paymentMethods) + + do { + shippingAddress = try container.decode(ShippingAddress.self, forKey: .shippingAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + loyaltyDiscount = try container.decode(Double.self, forKey: .loyaltyDiscount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + affiliateOrderId = try container.decode(String.self, forKey: .affiliateOrderId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + couponValue = try container.decode(Double.self, forKey: .couponValue) + + cartItems = try container.decode([OpenApiOrderItem].self, forKey: .cartItems) + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + deliveryCharges = try container.decode(Double.self, forKey: .deliveryCharges) + + couponCode = try container.decode(String.self, forKey: .couponCode) + + do { + files = try container.decode([OpenApiFiles].self, forKey: .files) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + billingAddress = try container.decode(ShippingAddress.self, forKey: .billingAddress) + + do { + employeeDiscount = try container.decode([String: Any].self, forKey: .employeeDiscount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + coupon = try container.decode(String.self, forKey: .coupon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + cartValue = try container.decode(Double.self, forKey: .cartValue) + + codCharges = try container.decode(Double.self, forKey: .codCharges) + + do { + paymentMode = try container.decode(String.self, forKey: .paymentMode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + cashbackApplied = try container.decode(Double.self, forKey: .cashbackApplied) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + + try? container.encodeIfPresent(paymentMethods, forKey: .paymentMethods) + + try? container.encodeIfPresent(shippingAddress, forKey: .shippingAddress) + + try? container.encodeIfPresent(loyaltyDiscount, forKey: .loyaltyDiscount) + + try? container.encodeIfPresent(affiliateOrderId, forKey: .affiliateOrderId) + + try? container.encodeIfPresent(couponValue, forKey: .couponValue) + + try? container.encodeIfPresent(cartItems, forKey: .cartItems) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + + try? container.encodeIfPresent(deliveryCharges, forKey: .deliveryCharges) + + try? container.encodeIfPresent(couponCode, forKey: .couponCode) + + try? container.encodeIfPresent(files, forKey: .files) + + try? container.encodeIfPresent(billingAddress, forKey: .billingAddress) + + try? container.encodeIfPresent(employeeDiscount, forKey: .employeeDiscount) + + try? container.encodeIfPresent(coupon, forKey: .coupon) + + try? container.encodeIfPresent(cartValue, forKey: .cartValue) + + try? container.encodeIfPresent(codCharges, forKey: .codCharges) + + try? container.encodeIfPresent(paymentMode, forKey: .paymentMode) + + try? container.encodeIfPresent(cashbackApplied, forKey: .cashbackApplied) + } + } + + /* + Model: OpenApiCheckoutResponse + Used By: Cart + */ + + class OpenApiCheckoutResponse: Codable { + public var orderId: String + + public var message: String? + + public var orderRefId: String? + + public var success: Bool? + + public enum CodingKeys: String, CodingKey { + case orderId = "order_id" + + case message + + case orderRefId = "order_ref_id" + + case success + } + + public init(message: String?, orderId: String, orderRefId: String?, success: Bool?) { + self.orderId = orderId + + self.message = message + + self.orderRefId = orderRefId + + self.success = success + } + + public func duplicate() -> OpenApiCheckoutResponse { + let dict = self.dictionary! + let copy = OpenApiCheckoutResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + orderId = try container.decode(String.self, forKey: .orderId) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderRefId = try container.decode(String.self, forKey: .orderRefId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(orderRefId, forKey: .orderRefId) + + try? container.encodeIfPresent(success, forKey: .success) + } + } +} diff --git a/Sources/code/platform/models/CatalogPlatformModelClass.swift b/Sources/code/platform/models/CatalogPlatformModelClass.swift new file mode 100644 index 0000000000..f78e99bf57 --- /dev/null +++ b/Sources/code/platform/models/CatalogPlatformModelClass.swift @@ -0,0 +1,24250 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: GetSearchWordsData + Used By: Catalog + */ + + class GetSearchWordsData: Codable { + public var uid: String? + + public var words: [String]? + + public var appId: String? + + public var result: [String: Any]? + + public var customJson: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case uid + + case words + + case appId = "app_id" + + case result + + case customJson = "_custom_json" + } + + public init(appId: String?, result: [String: Any]?, uid: String?, words: [String]?, customJson: [String: Any]?) { + self.uid = uid + + self.words = words + + self.appId = appId + + self.result = result + + self.customJson = customJson + } + + public func duplicate() -> GetSearchWordsData { + let dict = self.dictionary! + let copy = GetSearchWordsData(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + words = try container.decode([String].self, forKey: .words) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + result = try container.decode([String: Any].self, forKey: .result) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(words, forKey: .words) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(result, forKey: .result) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + } + } + + /* + Model: GetSearchWordsDetailResponse + Used By: Catalog + */ + + class GetSearchWordsDetailResponse: Codable { + public var page: Page? + + public var items: GetSearchWordsData? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: GetSearchWordsData?, page: Page?) { + self.page = page + + self.items = items + } + + public func duplicate() -> GetSearchWordsDetailResponse { + let dict = self.dictionary! + let copy = GetSearchWordsDetailResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode(GetSearchWordsData.self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: ErrorResponse + Used By: Catalog + */ + + class ErrorResponse: Codable { + public var message: String? + + public var code: String? + + public var meta: [String: Any]? + + public var status: Int? + + public enum CodingKeys: String, CodingKey { + case message + + case code + + case meta + + case status + } + + public init(code: String?, message: String?, meta: [String: Any]?, status: Int?) { + self.message = message + + self.code = code + + self.meta = meta + + self.status = status + } + + public func duplicate() -> ErrorResponse { + let dict = self.dictionary! + let copy = ErrorResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Int.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: DeleteResponse + Used By: Catalog + */ + + class DeleteResponse: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> DeleteResponse { + let dict = self.dictionary! + let copy = DeleteResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: SearchKeywordResult + Used By: Catalog + */ + + class SearchKeywordResult: Codable { + public var query: [String: Any] + + public var sortOn: String + + public enum CodingKeys: String, CodingKey { + case query + + case sortOn = "sort_on" + } + + public init(query: [String: Any], sortOn: String) { + self.query = query + + self.sortOn = sortOn + } + + public func duplicate() -> SearchKeywordResult { + let dict = self.dictionary! + let copy = SearchKeywordResult(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + query = try container.decode([String: Any].self, forKey: .query) + + sortOn = try container.decode(String.self, forKey: .sortOn) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(query, forKey: .query) + + try? container.encodeIfPresent(sortOn, forKey: .sortOn) + } + } + + /* + Model: CreateSearchKeyword + Used By: Catalog + */ + + class CreateSearchKeyword: Codable { + public var isActive: Bool? + + public var appId: String? + + public var words: [String]? + + public var result: SearchKeywordResult + + public var customJson: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case isActive = "is_active" + + case appId = "app_id" + + case words + + case result + + case customJson = "_custom_json" + } + + public init(appId: String?, isActive: Bool?, result: SearchKeywordResult, words: [String]?, customJson: [String: Any]?) { + self.isActive = isActive + + self.appId = appId + + self.words = words + + self.result = result + + self.customJson = customJson + } + + public func duplicate() -> CreateSearchKeyword { + let dict = self.dictionary! + let copy = CreateSearchKeyword(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + words = try container.decode([String].self, forKey: .words) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + result = try container.decode(SearchKeywordResult.self, forKey: .result) + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(words, forKey: .words) + + try? container.encodeIfPresent(result, forKey: .result) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + } + } + + /* + Model: GetSearchWordsResponse + Used By: Catalog + */ + + class GetSearchWordsResponse: Codable { + public var page: Page? + + public var items: [GetSearchWordsData]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [GetSearchWordsData]?, page: Page?) { + self.page = page + + self.items = items + } + + public func duplicate() -> GetSearchWordsResponse { + let dict = self.dictionary! + let copy = GetSearchWordsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([GetSearchWordsData].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: GetAutocompleteWordsData + Used By: Catalog + */ + + class GetAutocompleteWordsData: Codable { + public var uid: String? + + public var words: [String]? + + public var appId: String? + + public var results: [[String: Any]]? + + public var customJson: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case uid + + case words + + case appId = "app_id" + + case results + + case customJson = "_custom_json" + } + + public init(appId: String?, results: [[String: Any]]?, uid: String?, words: [String]?, customJson: [String: Any]?) { + self.uid = uid + + self.words = words + + self.appId = appId + + self.results = results + + self.customJson = customJson + } + + public func duplicate() -> GetAutocompleteWordsData { + let dict = self.dictionary! + let copy = GetAutocompleteWordsData(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + words = try container.decode([String].self, forKey: .words) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + results = try container.decode([[String: Any]].self, forKey: .results) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(words, forKey: .words) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(results, forKey: .results) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + } + } + + /* + Model: GetAutocompleteWordsResponse + Used By: Catalog + */ + + class GetAutocompleteWordsResponse: Codable { + public var page: Page? + + public var items: [GetAutocompleteWordsData]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [GetAutocompleteWordsData]?, page: Page?) { + self.page = page + + self.items = items + } + + public func duplicate() -> GetAutocompleteWordsResponse { + let dict = self.dictionary! + let copy = GetAutocompleteWordsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([GetAutocompleteWordsData].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: AutocompletePageAction + Used By: Catalog + */ + + class AutocompletePageAction: Codable { + public var url: String? + + public var query: [String: Any]? + + public var type: String? + + public var params: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case url + + case query + + case type + + case params + } + + public init(params: [String: Any]?, query: [String: Any]?, type: String?, url: String?) { + self.url = url + + self.query = query + + self.type = type + + self.params = params + } + + public func duplicate() -> AutocompletePageAction { + let dict = self.dictionary! + let copy = AutocompletePageAction(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode([String: Any].self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + params = try container.decode([String: Any].self, forKey: .params) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(query, forKey: .query) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(params, forKey: .params) + } + } + + /* + Model: AutocompleteAction + Used By: Catalog + */ + + class AutocompleteAction: Codable { + public var page: AutocompletePageAction? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case page + + case type + } + + public init(page: AutocompletePageAction?, type: String?) { + self.page = page + + self.type = type + } + + public func duplicate() -> AutocompleteAction { + let dict = self.dictionary! + let copy = AutocompleteAction(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(AutocompletePageAction.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: Media + Used By: Catalog + */ + + class Media: Codable { + public var url: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case url + + case type + } + + public init(type: String?, url: String?) { + self.url = url + + self.type = type + } + + public func duplicate() -> Media { + let dict = self.dictionary! + let copy = Media(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: AutocompleteResult + Used By: Catalog + */ + + class AutocompleteResult: Codable { + public var action: AutocompleteAction? + + public var logo: Media? + + public var customJson: [String: Any]? + + public var display: String? + + public enum CodingKeys: String, CodingKey { + case action + + case logo + + case customJson = "_custom_json" + + case display + } + + public init(action: AutocompleteAction?, display: String?, logo: Media?, customJson: [String: Any]?) { + self.action = action + + self.logo = logo + + self.customJson = customJson + + self.display = display + } + + public func duplicate() -> AutocompleteResult { + let dict = self.dictionary! + let copy = AutocompleteResult(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + action = try container.decode(AutocompleteAction.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(Media.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(display, forKey: .display) + } + } + + /* + Model: CreateAutocompleteKeyword + Used By: Catalog + */ + + class CreateAutocompleteKeyword: Codable { + public var isActive: Bool? + + public var appId: String? + + public var words: [String]? + + public var results: [AutocompleteResult]? + + public var customJson: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case isActive = "is_active" + + case appId = "app_id" + + case words + + case results + + case customJson = "_custom_json" + } + + public init(appId: String?, isActive: Bool?, results: [AutocompleteResult]?, words: [String]?, customJson: [String: Any]?) { + self.isActive = isActive + + self.appId = appId + + self.words = words + + self.results = results + + self.customJson = customJson + } + + public func duplicate() -> CreateAutocompleteKeyword { + let dict = self.dictionary! + let copy = CreateAutocompleteKeyword(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + words = try container.decode([String].self, forKey: .words) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + results = try container.decode([AutocompleteResult].self, forKey: .results) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(words, forKey: .words) + + try? container.encodeIfPresent(results, forKey: .results) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + } + } + + /* + Model: CreateAutocompleteWordsResponse + Used By: Catalog + */ + + class CreateAutocompleteWordsResponse: Codable { + public var words: [String]? + + public var appId: String? + + public var customJson: [String: Any]? + + public var results: [[String: Any]]? + + public enum CodingKeys: String, CodingKey { + case words + + case appId = "app_id" + + case customJson = "_custom_json" + + case results + } + + public init(appId: String?, results: [[String: Any]]?, words: [String]?, customJson: [String: Any]?) { + self.words = words + + self.appId = appId + + self.customJson = customJson + + self.results = results + } + + public func duplicate() -> CreateAutocompleteWordsResponse { + let dict = self.dictionary! + let copy = CreateAutocompleteWordsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + words = try container.decode([String].self, forKey: .words) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + results = try container.decode([[String: Any]].self, forKey: .results) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(words, forKey: .words) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(results, forKey: .results) + } + } + + /* + Model: ProductBundleItem + Used By: Catalog + */ + + class ProductBundleItem: Codable { + public var autoSelect: Bool? + + public var autoAddToCart: Bool? + + public var minQuantity: Int + + public var maxQuantity: Int + + public var productUid: Int + + public var allowRemove: Bool? + + public enum CodingKeys: String, CodingKey { + case autoSelect = "auto_select" + + case autoAddToCart = "auto_add_to_cart" + + case minQuantity = "min_quantity" + + case maxQuantity = "max_quantity" + + case productUid = "product_uid" + + case allowRemove = "allow_remove" + } + + public init(allowRemove: Bool?, autoAddToCart: Bool?, autoSelect: Bool?, maxQuantity: Int, minQuantity: Int, productUid: Int) { + self.autoSelect = autoSelect + + self.autoAddToCart = autoAddToCart + + self.minQuantity = minQuantity + + self.maxQuantity = maxQuantity + + self.productUid = productUid + + self.allowRemove = allowRemove + } + + public func duplicate() -> ProductBundleItem { + let dict = self.dictionary! + let copy = ProductBundleItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + autoSelect = try container.decode(Bool.self, forKey: .autoSelect) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + autoAddToCart = try container.decode(Bool.self, forKey: .autoAddToCart) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + minQuantity = try container.decode(Int.self, forKey: .minQuantity) + + maxQuantity = try container.decode(Int.self, forKey: .maxQuantity) + + productUid = try container.decode(Int.self, forKey: .productUid) + + do { + allowRemove = try container.decode(Bool.self, forKey: .allowRemove) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(autoSelect, forKey: .autoSelect) + + try? container.encodeIfPresent(autoAddToCart, forKey: .autoAddToCart) + + try? container.encodeIfPresent(minQuantity, forKey: .minQuantity) + + try? container.encodeIfPresent(maxQuantity, forKey: .maxQuantity) + + try? container.encodeIfPresent(productUid, forKey: .productUid) + + try? container.encodeIfPresent(allowRemove, forKey: .allowRemove) + } + } + + /* + Model: GetProductBundleCreateResponse + Used By: Catalog + */ + + class GetProductBundleCreateResponse: Codable { + public var logo: String? + + public var isActive: Bool + + public var sameStoreAssignment: Bool? + + public var modifiedOn: String? + + public var pageVisibility: [String]? + + public var choice: String + + public var id: String? + + public var createdOn: String? + + public var companyId: Int? + + public var createdBy: [String: Any]? + + public var modifiedBy: [String: Any]? + + public var slug: String + + public var products: [ProductBundleItem] + + public var meta: [String: Any]? + + public var name: String + + public enum CodingKeys: String, CodingKey { + case logo + + case isActive = "is_active" + + case sameStoreAssignment = "same_store_assignment" + + case modifiedOn = "modified_on" + + case pageVisibility = "page_visibility" + + case choice + + case id + + case createdOn = "created_on" + + case companyId = "company_id" + + case createdBy = "created_by" + + case modifiedBy = "modified_by" + + case slug + + case products + + case meta + + case name + } + + public init(choice: String, companyId: Int?, createdBy: [String: Any]?, createdOn: String?, id: String?, isActive: Bool, logo: String?, meta: [String: Any]?, modifiedBy: [String: Any]?, modifiedOn: String?, name: String, pageVisibility: [String]?, products: [ProductBundleItem], sameStoreAssignment: Bool?, slug: String) { + self.logo = logo + + self.isActive = isActive + + self.sameStoreAssignment = sameStoreAssignment + + self.modifiedOn = modifiedOn + + self.pageVisibility = pageVisibility + + self.choice = choice + + self.id = id + + self.createdOn = createdOn + + self.companyId = companyId + + self.createdBy = createdBy + + self.modifiedBy = modifiedBy + + self.slug = slug + + self.products = products + + self.meta = meta + + self.name = name + } + + public func duplicate() -> GetProductBundleCreateResponse { + let dict = self.dictionary! + let copy = GetProductBundleCreateResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + isActive = try container.decode(Bool.self, forKey: .isActive) + + do { + sameStoreAssignment = try container.decode(Bool.self, forKey: .sameStoreAssignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pageVisibility = try container.decode([String].self, forKey: .pageVisibility) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + choice = try container.decode(String.self, forKey: .choice) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode([String: Any].self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode([String: Any].self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + slug = try container.decode(String.self, forKey: .slug) + + products = try container.decode([ProductBundleItem].self, forKey: .products) + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + name = try container.decode(String.self, forKey: .name) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(logo, forKey: .logo) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(sameStoreAssignment, forKey: .sameStoreAssignment) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(pageVisibility, forKey: .pageVisibility) + + try? container.encodeIfPresent(choice, forKey: .choice) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(products, forKey: .products) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: GetProductBundleListingResponse + Used By: Catalog + */ + + class GetProductBundleListingResponse: Codable { + public var page: Page? + + public var items: [GetProductBundleCreateResponse]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [GetProductBundleCreateResponse]?, page: Page?) { + self.page = page + + self.items = items + } + + public func duplicate() -> GetProductBundleListingResponse { + let dict = self.dictionary! + let copy = GetProductBundleListingResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([GetProductBundleCreateResponse].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: ProductBundleRequest + Used By: Catalog + */ + + class ProductBundleRequest: Codable { + public var logo: String? + + public var isActive: Bool + + public var sameStoreAssignment: Bool? + + public var modifiedOn: String? + + public var pageVisibility: [String]? + + public var choice: String + + public var createdOn: String? + + public var createdBy: [String: Any]? + + public var modifiedBy: [String: Any]? + + public var slug: String + + public var products: [ProductBundleItem] + + public var meta: [String: Any]? + + public var name: String + + public enum CodingKeys: String, CodingKey { + case logo + + case isActive = "is_active" + + case sameStoreAssignment = "same_store_assignment" + + case modifiedOn = "modified_on" + + case pageVisibility = "page_visibility" + + case choice + + case createdOn = "created_on" + + case createdBy = "created_by" + + case modifiedBy = "modified_by" + + case slug + + case products + + case meta + + case name + } + + public init(choice: String, createdBy: [String: Any]?, createdOn: String?, isActive: Bool, logo: String?, meta: [String: Any]?, modifiedBy: [String: Any]?, modifiedOn: String?, name: String, pageVisibility: [String]?, products: [ProductBundleItem], sameStoreAssignment: Bool?, slug: String) { + self.logo = logo + + self.isActive = isActive + + self.sameStoreAssignment = sameStoreAssignment + + self.modifiedOn = modifiedOn + + self.pageVisibility = pageVisibility + + self.choice = choice + + self.createdOn = createdOn + + self.createdBy = createdBy + + self.modifiedBy = modifiedBy + + self.slug = slug + + self.products = products + + self.meta = meta + + self.name = name + } + + public func duplicate() -> ProductBundleRequest { + let dict = self.dictionary! + let copy = ProductBundleRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + isActive = try container.decode(Bool.self, forKey: .isActive) + + do { + sameStoreAssignment = try container.decode(Bool.self, forKey: .sameStoreAssignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pageVisibility = try container.decode([String].self, forKey: .pageVisibility) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + choice = try container.decode(String.self, forKey: .choice) + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode([String: Any].self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode([String: Any].self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + slug = try container.decode(String.self, forKey: .slug) + + products = try container.decode([ProductBundleItem].self, forKey: .products) + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + name = try container.decode(String.self, forKey: .name) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(logo, forKey: .logo) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(sameStoreAssignment, forKey: .sameStoreAssignment) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(pageVisibility, forKey: .pageVisibility) + + try? container.encodeIfPresent(choice, forKey: .choice) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(products, forKey: .products) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: Price + Used By: Catalog + */ + + class Price: Codable { + public var maxEffective: Double? + + public var minEffective: Double? + + public var currency: String? + + public var minMarked: Double? + + public var maxMarked: Double? + + public enum CodingKeys: String, CodingKey { + case maxEffective = "max_effective" + + case minEffective = "min_effective" + + case currency + + case minMarked = "min_marked" + + case maxMarked = "max_marked" + } + + public init(currency: String?, maxEffective: Double?, maxMarked: Double?, minEffective: Double?, minMarked: Double?) { + self.maxEffective = maxEffective + + self.minEffective = minEffective + + self.currency = currency + + self.minMarked = minMarked + + self.maxMarked = maxMarked + } + + public func duplicate() -> Price { + let dict = self.dictionary! + let copy = Price(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + maxEffective = try container.decode(Double.self, forKey: .maxEffective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + minEffective = try container.decode(Double.self, forKey: .minEffective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + minMarked = try container.decode(Double.self, forKey: .minMarked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + maxMarked = try container.decode(Double.self, forKey: .maxMarked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(maxEffective, forKey: .maxEffective) + + try? container.encodeIfPresent(minEffective, forKey: .minEffective) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(minMarked, forKey: .minMarked) + + try? container.encodeIfPresent(maxMarked, forKey: .maxMarked) + } + } + + /* + Model: LimitedProductData + Used By: Catalog + */ + + class LimitedProductData: Codable { + public var uid: Int? + + public var images: [String]? + + public var price: [String: Any]? + + public var identifier: [String: Any]? + + public var attributes: [String: Any]? + + public var countryOfOrigin: String? + + public var slug: String? + + public var sizes: [String]? + + public var itemCode: String? + + public var name: String? + + public var quantity: Int? + + public var shortDescription: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case images + + case price + + case identifier + + case attributes + + case countryOfOrigin = "country_of_origin" + + case slug + + case sizes + + case itemCode = "item_code" + + case name + + case quantity + + case shortDescription = "short_description" + } + + public init(attributes: [String: Any]?, countryOfOrigin: String?, identifier: [String: Any]?, images: [String]?, itemCode: String?, name: String?, price: [String: Any]?, quantity: Int?, shortDescription: String?, sizes: [String]?, slug: String?, uid: Int?) { + self.uid = uid + + self.images = images + + self.price = price + + self.identifier = identifier + + self.attributes = attributes + + self.countryOfOrigin = countryOfOrigin + + self.slug = slug + + self.sizes = sizes + + self.itemCode = itemCode + + self.name = name + + self.quantity = quantity + + self.shortDescription = shortDescription + } + + public func duplicate() -> LimitedProductData { + let dict = self.dictionary! + let copy = LimitedProductData(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + images = try container.decode([String].self, forKey: .images) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode([String: Any].self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + identifier = try container.decode([String: Any].self, forKey: .identifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributes = try container.decode([String: Any].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryOfOrigin = try container.decode(String.self, forKey: .countryOfOrigin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sizes = try container.decode([String].self, forKey: .sizes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemCode = try container.decode(String.self, forKey: .itemCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shortDescription = try container.decode(String.self, forKey: .shortDescription) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(images, forKey: .images) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(identifier, forKey: .identifier) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + + try? container.encodeIfPresent(countryOfOrigin, forKey: .countryOfOrigin) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(sizes, forKey: .sizes) + + try? container.encodeIfPresent(itemCode, forKey: .itemCode) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(shortDescription, forKey: .shortDescription) + } + } + + /* + Model: Size + Used By: Catalog + */ + + class Size: Codable { + public var value: String? + + public var isAvailable: Bool? + + public var quantity: Int? + + public var display: String? + + public enum CodingKeys: String, CodingKey { + case value + + case isAvailable = "is_available" + + case quantity + + case display + } + + public init(display: String?, isAvailable: Bool?, quantity: Int?, value: String?) { + self.value = value + + self.isAvailable = isAvailable + + self.quantity = quantity + + self.display = display + } + + public func duplicate() -> Size { + let dict = self.dictionary! + let copy = Size(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isAvailable = try container.decode(Bool.self, forKey: .isAvailable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(isAvailable, forKey: .isAvailable) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(display, forKey: .display) + } + } + + /* + Model: GetProducts + Used By: Catalog + */ + + class GetProducts: Codable { + public var autoSelect: Bool? + + public var autoAddToCart: Bool? + + public var minQuantity: Int? + + public var price: Price? + + public var maxQuantity: Int? + + public var allowRemove: Bool? + + public var productUid: Int? + + public var productDetails: LimitedProductData? + + public var sizes: [Size]? + + public enum CodingKeys: String, CodingKey { + case autoSelect = "auto_select" + + case autoAddToCart = "auto_add_to_cart" + + case minQuantity = "min_quantity" + + case price + + case maxQuantity = "max_quantity" + + case allowRemove = "allow_remove" + + case productUid = "product_uid" + + case productDetails = "product_details" + + case sizes + } + + public init(allowRemove: Bool?, autoAddToCart: Bool?, autoSelect: Bool?, maxQuantity: Int?, minQuantity: Int?, price: Price?, productDetails: LimitedProductData?, productUid: Int?, sizes: [Size]?) { + self.autoSelect = autoSelect + + self.autoAddToCart = autoAddToCart + + self.minQuantity = minQuantity + + self.price = price + + self.maxQuantity = maxQuantity + + self.allowRemove = allowRemove + + self.productUid = productUid + + self.productDetails = productDetails + + self.sizes = sizes + } + + public func duplicate() -> GetProducts { + let dict = self.dictionary! + let copy = GetProducts(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + autoSelect = try container.decode(Bool.self, forKey: .autoSelect) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + autoAddToCart = try container.decode(Bool.self, forKey: .autoAddToCart) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + minQuantity = try container.decode(Int.self, forKey: .minQuantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(Price.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + maxQuantity = try container.decode(Int.self, forKey: .maxQuantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allowRemove = try container.decode(Bool.self, forKey: .allowRemove) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productUid = try container.decode(Int.self, forKey: .productUid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productDetails = try container.decode(LimitedProductData.self, forKey: .productDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sizes = try container.decode([Size].self, forKey: .sizes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(autoSelect, forKey: .autoSelect) + + try? container.encodeIfPresent(autoAddToCart, forKey: .autoAddToCart) + + try? container.encodeIfPresent(minQuantity, forKey: .minQuantity) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(maxQuantity, forKey: .maxQuantity) + + try? container.encodeIfPresent(allowRemove, forKey: .allowRemove) + + try? container.encodeIfPresent(productUid, forKey: .productUid) + + try? container.encodeIfPresent(productDetails, forKey: .productDetails) + + try? container.encodeIfPresent(sizes, forKey: .sizes) + } + } + + /* + Model: GetProductBundleResponse + Used By: Catalog + */ + + class GetProductBundleResponse: Codable { + public var logo: String? + + public var isActive: Bool? + + public var pageVisibility: [String]? + + public var sameStoreAssignment: Bool? + + public var choice: String? + + public var companyId: Int? + + public var slug: String? + + public var products: [GetProducts]? + + public var meta: [String: Any]? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case logo + + case isActive = "is_active" + + case pageVisibility = "page_visibility" + + case sameStoreAssignment = "same_store_assignment" + + case choice + + case companyId = "company_id" + + case slug + + case products + + case meta + + case name + } + + public init(choice: String?, companyId: Int?, isActive: Bool?, logo: String?, meta: [String: Any]?, name: String?, pageVisibility: [String]?, products: [GetProducts]?, sameStoreAssignment: Bool?, slug: String?) { + self.logo = logo + + self.isActive = isActive + + self.pageVisibility = pageVisibility + + self.sameStoreAssignment = sameStoreAssignment + + self.choice = choice + + self.companyId = companyId + + self.slug = slug + + self.products = products + + self.meta = meta + + self.name = name + } + + public func duplicate() -> GetProductBundleResponse { + let dict = self.dictionary! + let copy = GetProductBundleResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pageVisibility = try container.decode([String].self, forKey: .pageVisibility) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sameStoreAssignment = try container.decode(Bool.self, forKey: .sameStoreAssignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + choice = try container.decode(String.self, forKey: .choice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + products = try container.decode([GetProducts].self, forKey: .products) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(pageVisibility, forKey: .pageVisibility) + + try? container.encodeIfPresent(sameStoreAssignment, forKey: .sameStoreAssignment) + + try? container.encodeIfPresent(choice, forKey: .choice) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(products, forKey: .products) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: ProductBundleUpdateRequest + Used By: Catalog + */ + + class ProductBundleUpdateRequest: Codable { + public var logo: String? + + public var isActive: Bool + + public var sameStoreAssignment: Bool? + + public var modifiedOn: String? + + public var pageVisibility: [String]? + + public var choice: String + + public var modifiedBy: [String: Any]? + + public var slug: String + + public var products: [ProductBundleItem] + + public var meta: [String: Any]? + + public var name: String + + public enum CodingKeys: String, CodingKey { + case logo + + case isActive = "is_active" + + case sameStoreAssignment = "same_store_assignment" + + case modifiedOn = "modified_on" + + case pageVisibility = "page_visibility" + + case choice + + case modifiedBy = "modified_by" + + case slug + + case products + + case meta + + case name + } + + public init(choice: String, isActive: Bool, logo: String?, meta: [String: Any]?, modifiedBy: [String: Any]?, modifiedOn: String?, name: String, pageVisibility: [String]?, products: [ProductBundleItem], sameStoreAssignment: Bool?, slug: String) { + self.logo = logo + + self.isActive = isActive + + self.sameStoreAssignment = sameStoreAssignment + + self.modifiedOn = modifiedOn + + self.pageVisibility = pageVisibility + + self.choice = choice + + self.modifiedBy = modifiedBy + + self.slug = slug + + self.products = products + + self.meta = meta + + self.name = name + } + + public func duplicate() -> ProductBundleUpdateRequest { + let dict = self.dictionary! + let copy = ProductBundleUpdateRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + isActive = try container.decode(Bool.self, forKey: .isActive) + + do { + sameStoreAssignment = try container.decode(Bool.self, forKey: .sameStoreAssignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pageVisibility = try container.decode([String].self, forKey: .pageVisibility) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + choice = try container.decode(String.self, forKey: .choice) + + do { + modifiedBy = try container.decode([String: Any].self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + slug = try container.decode(String.self, forKey: .slug) + + products = try container.decode([ProductBundleItem].self, forKey: .products) + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + name = try container.decode(String.self, forKey: .name) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(logo, forKey: .logo) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(sameStoreAssignment, forKey: .sameStoreAssignment) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(pageVisibility, forKey: .pageVisibility) + + try? container.encodeIfPresent(choice, forKey: .choice) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(products, forKey: .products) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: ListSizeGuide + Used By: Catalog + */ + + class ListSizeGuide: Codable { + public var page: [String: Any]? + + public var items: [[String: Any]]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [[String: Any]]?, page: [String: Any]?) { + self.page = page + + self.items = items + } + + public func duplicate() -> ListSizeGuide { + let dict = self.dictionary! + let copy = ListSizeGuide(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode([String: Any].self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([[String: Any]].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: Meta + Used By: Catalog + */ + + class Meta: Codable { + public var values: [[String: Any]]? + + public var unit: String? + + public var headers: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case values + + case unit + + case headers + } + + public init(headers: [String: Any]?, unit: String?, values: [[String: Any]]?) { + self.values = values + + self.unit = unit + + self.headers = headers + } + + public func duplicate() -> Meta { + let dict = self.dictionary! + let copy = Meta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + values = try container.decode([[String: Any]].self, forKey: .values) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + unit = try container.decode(String.self, forKey: .unit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + headers = try container.decode([String: Any].self, forKey: .headers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(values, forKey: .values) + + try? container.encodeIfPresent(unit, forKey: .unit) + + try? container.encodeIfPresent(headers, forKey: .headers) + } + } + + /* + Model: Guide + Used By: Catalog + */ + + class Guide: Codable { + public var meta: Meta? + + public enum CodingKeys: String, CodingKey { + case meta + } + + public init(meta: Meta?) { + self.meta = meta + } + + public func duplicate() -> Guide { + let dict = self.dictionary! + let copy = Guide(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + meta = try container.decode(Meta.self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(meta, forKey: .meta) + } + } + + /* + Model: ValidateSizeGuide + Used By: Catalog + */ + + class ValidateSizeGuide: Codable { + public var tag: String? + + public var description: String? + + public var modifiedOn: String? + + public var brandId: Int? + + public var image: String? + + public var id: String? + + public var createdOn: String? + + public var title: String + + public var active: Bool? + + public var companyId: Int? + + public var createdBy: [String: Any]? + + public var modifiedBy: [String: Any]? + + public var guide: Guide? + + public var name: String + + public var subtitle: String? + + public enum CodingKeys: String, CodingKey { + case tag + + case description + + case modifiedOn = "modified_on" + + case brandId = "brand_id" + + case image + + case id + + case createdOn = "created_on" + + case title + + case active + + case companyId = "company_id" + + case createdBy = "created_by" + + case modifiedBy = "modified_by" + + case guide + + case name + + case subtitle + } + + public init(active: Bool?, brandId: Int?, companyId: Int?, createdBy: [String: Any]?, createdOn: String?, description: String?, guide: Guide?, id: String?, image: String?, modifiedBy: [String: Any]?, modifiedOn: String?, name: String, subtitle: String?, tag: String?, title: String) { + self.tag = tag + + self.description = description + + self.modifiedOn = modifiedOn + + self.brandId = brandId + + self.image = image + + self.id = id + + self.createdOn = createdOn + + self.title = title + + self.active = active + + self.companyId = companyId + + self.createdBy = createdBy + + self.modifiedBy = modifiedBy + + self.guide = guide + + self.name = name + + self.subtitle = subtitle + } + + public func duplicate() -> ValidateSizeGuide { + let dict = self.dictionary! + let copy = ValidateSizeGuide(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + tag = try container.decode(String.self, forKey: .tag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandId = try container.decode(Int.self, forKey: .brandId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + image = try container.decode(String.self, forKey: .image) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + title = try container.decode(String.self, forKey: .title) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode([String: Any].self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode([String: Any].self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + guide = try container.decode(Guide.self, forKey: .guide) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + name = try container.decode(String.self, forKey: .name) + + do { + subtitle = try container.decode(String.self, forKey: .subtitle) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(tag, forKey: .tag) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(brandId, forKey: .brandId) + + try? container.encodeIfPresent(image, forKey: .image) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(guide, forKey: .guide) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(subtitle, forKey: .subtitle) + } + } + + /* + Model: SuccessResponse + Used By: Catalog + */ + + class SuccessResponse: Codable { + public var uid: Int? + + public var success: Bool? + + public enum CodingKeys: String, CodingKey { + case uid + + case success + } + + public init(success: Bool?, uid: Int?) { + self.uid = uid + + self.success = success + } + + public func duplicate() -> SuccessResponse { + let dict = self.dictionary! + let copy = SuccessResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: SizeGuideResponse + Used By: Catalog + */ + + class SizeGuideResponse: Codable { + public var tag: String? + + public var guide: [String: Any]? + + public var modifiedOn: String? + + public var brandId: Int? + + public var id: String? + + public var createdOn: String? + + public var companyId: Int? + + public var active: Bool? + + public var title: String? + + public var modifiedBy: [String: Any]? + + public var createdBy: [String: Any]? + + public var name: String? + + public var subtitle: String? + + public enum CodingKeys: String, CodingKey { + case tag + + case guide + + case modifiedOn = "modified_on" + + case brandId = "brand_id" + + case id + + case createdOn = "created_on" + + case companyId = "company_id" + + case active + + case title + + case modifiedBy = "modified_by" + + case createdBy = "created_by" + + case name + + case subtitle + } + + public init(active: Bool?, brandId: Int?, companyId: Int?, createdBy: [String: Any]?, createdOn: String?, guide: [String: Any]?, id: String?, modifiedBy: [String: Any]?, modifiedOn: String?, name: String?, subtitle: String?, tag: String?, title: String?) { + self.tag = tag + + self.guide = guide + + self.modifiedOn = modifiedOn + + self.brandId = brandId + + self.id = id + + self.createdOn = createdOn + + self.companyId = companyId + + self.active = active + + self.title = title + + self.modifiedBy = modifiedBy + + self.createdBy = createdBy + + self.name = name + + self.subtitle = subtitle + } + + public func duplicate() -> SizeGuideResponse { + let dict = self.dictionary! + let copy = SizeGuideResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + tag = try container.decode(String.self, forKey: .tag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + guide = try container.decode([String: Any].self, forKey: .guide) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandId = try container.decode(Int.self, forKey: .brandId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode([String: Any].self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode([String: Any].self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subtitle = try container.decode(String.self, forKey: .subtitle) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(tag, forKey: .tag) + + try? container.encodeIfPresent(guide, forKey: .guide) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(brandId, forKey: .brandId) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(subtitle, forKey: .subtitle) + } + } + + /* + Model: MetaFields + Used By: Catalog + */ + + class MetaFields: Codable { + public var value: String + + public var key: String + + public enum CodingKeys: String, CodingKey { + case value + + case key + } + + public init(key: String, value: String) { + self.value = value + + self.key = key + } + + public func duplicate() -> MetaFields { + let dict = self.dictionary! + let copy = MetaFields(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + value = try container.decode(String.self, forKey: .value) + + key = try container.decode(String.self, forKey: .key) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(key, forKey: .key) + } + } + + /* + Model: ApplicationItemMeta + Used By: Catalog + */ + + class ApplicationItemMeta: Codable { + public var customMeta: [MetaFields] + + public enum CodingKeys: String, CodingKey { + case customMeta = "_custom_meta" + } + + public init(customMeta: [MetaFields]) { + self.customMeta = customMeta + } + + public func duplicate() -> ApplicationItemMeta { + let dict = self.dictionary! + let copy = ApplicationItemMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + customMeta = try container.decode([MetaFields].self, forKey: .customMeta) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(customMeta, forKey: .customMeta) + } + } + + /* + Model: MetaDataListingSortMetaResponse + Used By: Catalog + */ + + class MetaDataListingSortMetaResponse: Codable { + public var key: String? + + public var display: String? + + public enum CodingKeys: String, CodingKey { + case key + + case display + } + + public init(display: String?, key: String?) { + self.key = key + + self.display = display + } + + public func duplicate() -> MetaDataListingSortMetaResponse { + let dict = self.dictionary! + let copy = MetaDataListingSortMetaResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(display, forKey: .display) + } + } + + /* + Model: MetaDataListingSortResponse + Used By: Catalog + */ + + class MetaDataListingSortResponse: Codable { + public var data: [MetaDataListingSortMetaResponse]? + + public enum CodingKeys: String, CodingKey { + case data + } + + public init(data: [MetaDataListingSortMetaResponse]?) { + self.data = data + } + + public func duplicate() -> MetaDataListingSortResponse { + let dict = self.dictionary! + let copy = MetaDataListingSortResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode([MetaDataListingSortMetaResponse].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: MetaDataListingFilterMetaResponse + Used By: Catalog + */ + + class MetaDataListingFilterMetaResponse: Codable { + public var filterTypes: [String]? + + public var key: String? + + public var units: [[String: Any]]? + + public var display: String? + + public enum CodingKeys: String, CodingKey { + case filterTypes = "filter_types" + + case key + + case units + + case display + } + + public init(display: String?, filterTypes: [String]?, key: String?, units: [[String: Any]]?) { + self.filterTypes = filterTypes + + self.key = key + + self.units = units + + self.display = display + } + + public func duplicate() -> MetaDataListingFilterMetaResponse { + let dict = self.dictionary! + let copy = MetaDataListingFilterMetaResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + filterTypes = try container.decode([String].self, forKey: .filterTypes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + units = try container.decode([[String: Any]].self, forKey: .units) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(filterTypes, forKey: .filterTypes) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(units, forKey: .units) + + try? container.encodeIfPresent(display, forKey: .display) + } + } + + /* + Model: MetaDataListingFilterResponse + Used By: Catalog + */ + + class MetaDataListingFilterResponse: Codable { + public var data: [MetaDataListingFilterMetaResponse]? + + public enum CodingKeys: String, CodingKey { + case data + } + + public init(data: [MetaDataListingFilterMetaResponse]?) { + self.data = data + } + + public func duplicate() -> MetaDataListingFilterResponse { + let dict = self.dictionary! + let copy = MetaDataListingFilterResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode([MetaDataListingFilterMetaResponse].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: MetaDataListingResponse + Used By: Catalog + */ + + class MetaDataListingResponse: Codable { + public var sort: MetaDataListingSortResponse + + public var filter: MetaDataListingFilterResponse + + public enum CodingKeys: String, CodingKey { + case sort + + case filter + } + + public init(filter: MetaDataListingFilterResponse, sort: MetaDataListingSortResponse) { + self.sort = sort + + self.filter = filter + } + + public func duplicate() -> MetaDataListingResponse { + let dict = self.dictionary! + let copy = MetaDataListingResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + sort = try container.decode(MetaDataListingSortResponse.self, forKey: .sort) + + filter = try container.decode(MetaDataListingFilterResponse.self, forKey: .filter) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(sort, forKey: .sort) + + try? container.encodeIfPresent(filter, forKey: .filter) + } + } + + /* + Model: GetCatalogConfigurationDetailsProduct + Used By: Catalog + */ + + class GetCatalogConfigurationDetailsProduct: Codable { + public var detail: [String: Any]? + + public var compare: [String: Any]? + + public var similar: [String: Any]? + + public var variant: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case detail + + case compare + + case similar + + case variant + } + + public init(compare: [String: Any]?, detail: [String: Any]?, similar: [String: Any]?, variant: [String: Any]?) { + self.detail = detail + + self.compare = compare + + self.similar = similar + + self.variant = variant + } + + public func duplicate() -> GetCatalogConfigurationDetailsProduct { + let dict = self.dictionary! + let copy = GetCatalogConfigurationDetailsProduct(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + detail = try container.decode([String: Any].self, forKey: .detail) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + compare = try container.decode([String: Any].self, forKey: .compare) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + similar = try container.decode([String: Any].self, forKey: .similar) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + variant = try container.decode([String: Any].self, forKey: .variant) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(detail, forKey: .detail) + + try? container.encodeIfPresent(compare, forKey: .compare) + + try? container.encodeIfPresent(similar, forKey: .similar) + + try? container.encodeIfPresent(variant, forKey: .variant) + } + } + + /* + Model: GetCatalogConfigurationMetaData + Used By: Catalog + */ + + class GetCatalogConfigurationMetaData: Codable { + public var listing: MetaDataListingResponse? + + public var product: GetCatalogConfigurationDetailsProduct? + + public enum CodingKeys: String, CodingKey { + case listing + + case product + } + + public init(listing: MetaDataListingResponse?, product: GetCatalogConfigurationDetailsProduct?) { + self.listing = listing + + self.product = product + } + + public func duplicate() -> GetCatalogConfigurationMetaData { + let dict = self.dictionary! + let copy = GetCatalogConfigurationMetaData(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + listing = try container.decode(MetaDataListingResponse.self, forKey: .listing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + product = try container.decode(GetCatalogConfigurationDetailsProduct.self, forKey: .product) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(listing, forKey: .listing) + + try? container.encodeIfPresent(product, forKey: .product) + } + } + + /* + Model: ConfigurationListingSortConfig + Used By: Catalog + */ + + class ConfigurationListingSortConfig: Codable { + public var priority: Int + + public var logo: String? + + public var key: String + + public var isActive: Bool + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case priority + + case logo + + case key + + case isActive = "is_active" + + case name + } + + public init(isActive: Bool, key: String, logo: String?, name: String?, priority: Int) { + self.priority = priority + + self.logo = logo + + self.key = key + + self.isActive = isActive + + self.name = name + } + + public func duplicate() -> ConfigurationListingSortConfig { + let dict = self.dictionary! + let copy = ConfigurationListingSortConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + priority = try container.decode(Int.self, forKey: .priority) + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + key = try container.decode(String.self, forKey: .key) + + isActive = try container.decode(Bool.self, forKey: .isActive) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: ConfigurationListingSort + Used By: Catalog + */ + + class ConfigurationListingSort: Codable { + public var config: [ConfigurationListingSortConfig]? + + public var defaultKey: String + + public enum CodingKeys: String, CodingKey { + case config + + case defaultKey = "default_key" + } + + public init(config: [ConfigurationListingSortConfig]?, defaultKey: String) { + self.config = config + + self.defaultKey = defaultKey + } + + public func duplicate() -> ConfigurationListingSort { + let dict = self.dictionary! + let copy = ConfigurationListingSort(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + config = try container.decode([ConfigurationListingSortConfig].self, forKey: .config) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + defaultKey = try container.decode(String.self, forKey: .defaultKey) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(config, forKey: .config) + + try? container.encodeIfPresent(defaultKey, forKey: .defaultKey) + } + } + + /* + Model: ConfigurationBucketPoints + Used By: Catalog + */ + + class ConfigurationBucketPoints: Codable { + public var end: Double? + + public var start: Double? + + public enum CodingKeys: String, CodingKey { + case end + + case start + } + + public init(end: Double?, start: Double?) { + self.end = end + + self.start = start + } + + public func duplicate() -> ConfigurationBucketPoints { + let dict = self.dictionary! + let copy = ConfigurationBucketPoints(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + end = try container.decode(Double.self, forKey: .end) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + start = try container.decode(Double.self, forKey: .start) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(end, forKey: .end) + + try? container.encodeIfPresent(start, forKey: .start) + } + } + + /* + Model: ConfigurationListingFilterValue + Used By: Catalog + */ + + class ConfigurationListingFilterValue: Codable { + public var value: String? + + public var condition: String? + + public var bucketPoints: [ConfigurationBucketPoints]? + + public var map: [String: Any]? + + public var sort: String? + + public enum CodingKeys: String, CodingKey { + case value + + case condition + + case bucketPoints = "bucket_points" + + case map + + case sort + } + + public init(bucketPoints: [ConfigurationBucketPoints]?, condition: String?, map: [String: Any]?, sort: String?, value: String?) { + self.value = value + + self.condition = condition + + self.bucketPoints = bucketPoints + + self.map = map + + self.sort = sort + } + + public func duplicate() -> ConfigurationListingFilterValue { + let dict = self.dictionary! + let copy = ConfigurationListingFilterValue(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + condition = try container.decode(String.self, forKey: .condition) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bucketPoints = try container.decode([ConfigurationBucketPoints].self, forKey: .bucketPoints) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + map = try container.decode([String: Any].self, forKey: .map) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sort = try container.decode(String.self, forKey: .sort) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(condition, forKey: .condition) + + try? container.encodeIfPresent(bucketPoints, forKey: .bucketPoints) + + try? container.encodeIfPresent(map, forKey: .map) + + try? container.encodeIfPresent(sort, forKey: .sort) + } + } + + /* + Model: ConfigurationListingFilterConfig + Used By: Catalog + */ + + class ConfigurationListingFilterConfig: Codable { + public var priority: Int + + public var logo: String? + + public var key: String + + public var isActive: Bool + + public var type: String + + public var valueConfig: ConfigurationListingFilterValue? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case priority + + case logo + + case key + + case isActive = "is_active" + + case type + + case valueConfig = "value_config" + + case name + } + + public init(isActive: Bool, key: String, logo: String?, name: String?, priority: Int, type: String, valueConfig: ConfigurationListingFilterValue?) { + self.priority = priority + + self.logo = logo + + self.key = key + + self.isActive = isActive + + self.type = type + + self.valueConfig = valueConfig + + self.name = name + } + + public func duplicate() -> ConfigurationListingFilterConfig { + let dict = self.dictionary! + let copy = ConfigurationListingFilterConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + priority = try container.decode(Int.self, forKey: .priority) + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + key = try container.decode(String.self, forKey: .key) + + isActive = try container.decode(Bool.self, forKey: .isActive) + + type = try container.decode(String.self, forKey: .type) + + do { + valueConfig = try container.decode(ConfigurationListingFilterValue.self, forKey: .valueConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(valueConfig, forKey: .valueConfig) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: ConfigurationListingFilter + Used By: Catalog + */ + + class ConfigurationListingFilter: Codable { + public var attributeConfig: [ConfigurationListingFilterConfig]? + + public var allowSingle: Bool + + public enum CodingKeys: String, CodingKey { + case attributeConfig = "attribute_config" + + case allowSingle = "allow_single" + } + + public init(allowSingle: Bool, attributeConfig: [ConfigurationListingFilterConfig]?) { + self.attributeConfig = attributeConfig + + self.allowSingle = allowSingle + } + + public func duplicate() -> ConfigurationListingFilter { + let dict = self.dictionary! + let copy = ConfigurationListingFilter(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + attributeConfig = try container.decode([ConfigurationListingFilterConfig].self, forKey: .attributeConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + allowSingle = try container.decode(Bool.self, forKey: .allowSingle) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(attributeConfig, forKey: .attributeConfig) + + try? container.encodeIfPresent(allowSingle, forKey: .allowSingle) + } + } + + /* + Model: ConfigurationListing + Used By: Catalog + */ + + class ConfigurationListing: Codable { + public var sort: ConfigurationListingSort + + public var filter: ConfigurationListingFilter + + public enum CodingKeys: String, CodingKey { + case sort + + case filter + } + + public init(filter: ConfigurationListingFilter, sort: ConfigurationListingSort) { + self.sort = sort + + self.filter = filter + } + + public func duplicate() -> ConfigurationListing { + let dict = self.dictionary! + let copy = ConfigurationListing(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + sort = try container.decode(ConfigurationListingSort.self, forKey: .sort) + + filter = try container.decode(ConfigurationListingFilter.self, forKey: .filter) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(sort, forKey: .sort) + + try? container.encodeIfPresent(filter, forKey: .filter) + } + } + + /* + Model: ProductSize + Used By: Catalog + */ + + class ProductSize: Codable { + public var min: Int + + public var max: Int + + public enum CodingKeys: String, CodingKey { + case min + + case max + } + + public init(max: Int, min: Int) { + self.min = min + + self.max = max + } + + public func duplicate() -> ProductSize { + let dict = self.dictionary! + let copy = ProductSize(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + min = try container.decode(Int.self, forKey: .min) + + max = try container.decode(Int.self, forKey: .max) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(min, forKey: .min) + + try? container.encodeIfPresent(max, forKey: .max) + } + } + + /* + Model: ConfigurationProductVariantConfig + Used By: Catalog + */ + + class ConfigurationProductVariantConfig: Codable { + public var priority: Int + + public var logo: String? + + public var key: String + + public var isActive: Bool + + public var displayType: String + + public var size: ProductSize + + public var name: String + + public enum CodingKeys: String, CodingKey { + case priority + + case logo + + case key + + case isActive = "is_active" + + case displayType = "display_type" + + case size + + case name + } + + public init(displayType: String, isActive: Bool, key: String, logo: String?, name: String, priority: Int, size: ProductSize) { + self.priority = priority + + self.logo = logo + + self.key = key + + self.isActive = isActive + + self.displayType = displayType + + self.size = size + + self.name = name + } + + public func duplicate() -> ConfigurationProductVariantConfig { + let dict = self.dictionary! + let copy = ConfigurationProductVariantConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + priority = try container.decode(Int.self, forKey: .priority) + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + key = try container.decode(String.self, forKey: .key) + + isActive = try container.decode(Bool.self, forKey: .isActive) + + displayType = try container.decode(String.self, forKey: .displayType) + + size = try container.decode(ProductSize.self, forKey: .size) + + name = try container.decode(String.self, forKey: .name) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(displayType, forKey: .displayType) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: ConfigurationProductVariant + Used By: Catalog + */ + + class ConfigurationProductVariant: Codable { + public var config: [ConfigurationProductVariantConfig]? + + public enum CodingKeys: String, CodingKey { + case config + } + + public init(config: [ConfigurationProductVariantConfig]?) { + self.config = config + } + + public func duplicate() -> ConfigurationProductVariant { + let dict = self.dictionary! + let copy = ConfigurationProductVariant(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + config = try container.decode([ConfigurationProductVariantConfig].self, forKey: .config) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(config, forKey: .config) + } + } + + /* + Model: ConfigurationProductConfig + Used By: Catalog + */ + + class ConfigurationProductConfig: Codable { + public var priority: Int + + public var logo: String? + + public var key: String + + public var isActive: Bool + + public var title: String? + + public var size: ProductSize? + + public var subtitle: String? + + public enum CodingKeys: String, CodingKey { + case priority + + case logo + + case key + + case isActive = "is_active" + + case title + + case size + + case subtitle + } + + public init(isActive: Bool, key: String, logo: String?, priority: Int, size: ProductSize?, subtitle: String?, title: String?) { + self.priority = priority + + self.logo = logo + + self.key = key + + self.isActive = isActive + + self.title = title + + self.size = size + + self.subtitle = subtitle + } + + public func duplicate() -> ConfigurationProductConfig { + let dict = self.dictionary! + let copy = ConfigurationProductConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + priority = try container.decode(Int.self, forKey: .priority) + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + key = try container.decode(String.self, forKey: .key) + + isActive = try container.decode(Bool.self, forKey: .isActive) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(ProductSize.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subtitle = try container.decode(String.self, forKey: .subtitle) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(subtitle, forKey: .subtitle) + } + } + + /* + Model: ConfigurationProductSimilar + Used By: Catalog + */ + + class ConfigurationProductSimilar: Codable { + public var config: [ConfigurationProductConfig]? + + public enum CodingKeys: String, CodingKey { + case config + } + + public init(config: [ConfigurationProductConfig]?) { + self.config = config + } + + public func duplicate() -> ConfigurationProductSimilar { + let dict = self.dictionary! + let copy = ConfigurationProductSimilar(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + config = try container.decode([ConfigurationProductConfig].self, forKey: .config) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(config, forKey: .config) + } + } + + /* + Model: ConfigurationProduct + Used By: Catalog + */ + + class ConfigurationProduct: Codable { + public var variant: ConfigurationProductVariant + + public var similar: ConfigurationProductSimilar + + public enum CodingKeys: String, CodingKey { + case variant + + case similar + } + + public init(similar: ConfigurationProductSimilar, variant: ConfigurationProductVariant) { + self.variant = variant + + self.similar = similar + } + + public func duplicate() -> ConfigurationProduct { + let dict = self.dictionary! + let copy = ConfigurationProduct(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + variant = try container.decode(ConfigurationProductVariant.self, forKey: .variant) + + similar = try container.decode(ConfigurationProductSimilar.self, forKey: .similar) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(variant, forKey: .variant) + + try? container.encodeIfPresent(similar, forKey: .similar) + } + } + + /* + Model: AppCatalogConfiguration + Used By: Catalog + */ + + class AppCatalogConfiguration: Codable { + public var configId: String? + + public var id: String? + + public var appId: String + + public var listing: ConfigurationListing? + + public var configType: String + + public var product: ConfigurationProduct? + + public enum CodingKeys: String, CodingKey { + case configId = "config_id" + + case id + + case appId = "app_id" + + case listing + + case configType = "config_type" + + case product + } + + public init(appId: String, configId: String?, configType: String, id: String?, listing: ConfigurationListing?, product: ConfigurationProduct?) { + self.configId = configId + + self.id = id + + self.appId = appId + + self.listing = listing + + self.configType = configType + + self.product = product + } + + public func duplicate() -> AppCatalogConfiguration { + let dict = self.dictionary! + let copy = AppCatalogConfiguration(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + configId = try container.decode(String.self, forKey: .configId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + appId = try container.decode(String.self, forKey: .appId) + + do { + listing = try container.decode(ConfigurationListing.self, forKey: .listing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + configType = try container.decode(String.self, forKey: .configType) + + do { + product = try container.decode(ConfigurationProduct.self, forKey: .product) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(configId, forKey: .configId) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(listing, forKey: .listing) + + try? container.encodeIfPresent(configType, forKey: .configType) + + try? container.encodeIfPresent(product, forKey: .product) + } + } + + /* + Model: GetAppCatalogConfiguration + Used By: Catalog + */ + + class GetAppCatalogConfiguration: Codable { + public var isDefault: Bool? + + public var data: AppCatalogConfiguration? + + public enum CodingKeys: String, CodingKey { + case isDefault = "is_default" + + case data + } + + public init(data: AppCatalogConfiguration?, isDefault: Bool?) { + self.isDefault = isDefault + + self.data = data + } + + public func duplicate() -> GetAppCatalogConfiguration { + let dict = self.dictionary! + let copy = GetAppCatalogConfiguration(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isDefault = try container.decode(Bool.self, forKey: .isDefault) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode(AppCatalogConfiguration.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isDefault, forKey: .isDefault) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: AppConfiguration + Used By: Catalog + */ + + class AppConfiguration: Codable { + public var configId: String? + + public var appId: String + + public var listing: ConfigurationListing? + + public var configType: String + + public var product: ConfigurationProduct? + + public enum CodingKeys: String, CodingKey { + case configId = "config_id" + + case appId = "app_id" + + case listing + + case configType = "config_type" + + case product + } + + public init(appId: String, configId: String?, configType: String, listing: ConfigurationListing?, product: ConfigurationProduct?) { + self.configId = configId + + self.appId = appId + + self.listing = listing + + self.configType = configType + + self.product = product + } + + public func duplicate() -> AppConfiguration { + let dict = self.dictionary! + let copy = AppConfiguration(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + configId = try container.decode(String.self, forKey: .configId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + appId = try container.decode(String.self, forKey: .appId) + + do { + listing = try container.decode(ConfigurationListing.self, forKey: .listing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + configType = try container.decode(String.self, forKey: .configType) + + do { + product = try container.decode(ConfigurationProduct.self, forKey: .product) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(configId, forKey: .configId) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(listing, forKey: .listing) + + try? container.encodeIfPresent(configType, forKey: .configType) + + try? container.encodeIfPresent(product, forKey: .product) + } + } + + /* + Model: GetCatalogConfigurationDetailsSchemaListing + Used By: Catalog + */ + + class GetCatalogConfigurationDetailsSchemaListing: Codable { + public var sort: [String: Any]? + + public var filter: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case sort + + case filter + } + + public init(filter: [String: Any]?, sort: [String: Any]?) { + self.sort = sort + + self.filter = filter + } + + public func duplicate() -> GetCatalogConfigurationDetailsSchemaListing { + let dict = self.dictionary! + let copy = GetCatalogConfigurationDetailsSchemaListing(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + sort = try container.decode([String: Any].self, forKey: .sort) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filter = try container.decode([String: Any].self, forKey: .filter) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(sort, forKey: .sort) + + try? container.encodeIfPresent(filter, forKey: .filter) + } + } + + /* + Model: EntityConfiguration + Used By: Catalog + */ + + class EntityConfiguration: Codable { + public var configId: String? + + public var id: String? + + public var appId: String + + public var listing: GetCatalogConfigurationDetailsSchemaListing? + + public var configType: String + + public var product: GetCatalogConfigurationDetailsProduct? + + public enum CodingKeys: String, CodingKey { + case configId = "config_id" + + case id + + case appId = "app_id" + + case listing + + case configType = "config_type" + + case product + } + + public init(appId: String, configId: String?, configType: String, id: String?, listing: GetCatalogConfigurationDetailsSchemaListing?, product: GetCatalogConfigurationDetailsProduct?) { + self.configId = configId + + self.id = id + + self.appId = appId + + self.listing = listing + + self.configType = configType + + self.product = product + } + + public func duplicate() -> EntityConfiguration { + let dict = self.dictionary! + let copy = EntityConfiguration(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + configId = try container.decode(String.self, forKey: .configId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + appId = try container.decode(String.self, forKey: .appId) + + do { + listing = try container.decode(GetCatalogConfigurationDetailsSchemaListing.self, forKey: .listing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + configType = try container.decode(String.self, forKey: .configType) + + do { + product = try container.decode(GetCatalogConfigurationDetailsProduct.self, forKey: .product) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(configId, forKey: .configId) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(listing, forKey: .listing) + + try? container.encodeIfPresent(configType, forKey: .configType) + + try? container.encodeIfPresent(product, forKey: .product) + } + } + + /* + Model: GetAppCatalogEntityConfiguration + Used By: Catalog + */ + + class GetAppCatalogEntityConfiguration: Codable { + public var isDefault: Bool? + + public var data: EntityConfiguration? + + public enum CodingKeys: String, CodingKey { + case isDefault = "is_default" + + case data + } + + public init(data: EntityConfiguration?, isDefault: Bool?) { + self.isDefault = isDefault + + self.data = data + } + + public func duplicate() -> GetAppCatalogEntityConfiguration { + let dict = self.dictionary! + let copy = GetAppCatalogEntityConfiguration(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isDefault = try container.decode(Bool.self, forKey: .isDefault) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode(EntityConfiguration.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isDefault, forKey: .isDefault) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: ProductFiltersValue + Used By: Catalog + */ + + class ProductFiltersValue: Codable { + public var isSelected: Bool + + public var selectedMin: Int? + + public var value: String + + public var currencyCode: String? + + public var display: String + + public var queryFormat: String? + + public var currencySymbol: String? + + public var displayFormat: String? + + public var selectedMax: Int? + + public var min: Int? + + public var max: Int? + + public var count: Int? + + public enum CodingKeys: String, CodingKey { + case isSelected = "is_selected" + + case selectedMin = "selected_min" + + case value + + case currencyCode = "currency_code" + + case display + + case queryFormat = "query_format" + + case currencySymbol = "currency_symbol" + + case displayFormat = "display_format" + + case selectedMax = "selected_max" + + case min + + case max + + case count + } + + public init(count: Int?, currencyCode: String?, currencySymbol: String?, display: String, displayFormat: String?, isSelected: Bool, max: Int?, min: Int?, queryFormat: String?, selectedMax: Int?, selectedMin: Int?, value: String) { + self.isSelected = isSelected + + self.selectedMin = selectedMin + + self.value = value + + self.currencyCode = currencyCode + + self.display = display + + self.queryFormat = queryFormat + + self.currencySymbol = currencySymbol + + self.displayFormat = displayFormat + + self.selectedMax = selectedMax + + self.min = min + + self.max = max + + self.count = count + } + + public func duplicate() -> ProductFiltersValue { + let dict = self.dictionary! + let copy = ProductFiltersValue(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + isSelected = try container.decode(Bool.self, forKey: .isSelected) + + do { + selectedMin = try container.decode(Int.self, forKey: .selectedMin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + value = try container.decode(String.self, forKey: .value) + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + display = try container.decode(String.self, forKey: .display) + + do { + queryFormat = try container.decode(String.self, forKey: .queryFormat) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencySymbol = try container.decode(String.self, forKey: .currencySymbol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayFormat = try container.decode(String.self, forKey: .displayFormat) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + selectedMax = try container.decode(Int.self, forKey: .selectedMax) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + min = try container.decode(Int.self, forKey: .min) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + max = try container.decode(Int.self, forKey: .max) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isSelected, forKey: .isSelected) + + try? container.encodeIfPresent(selectedMin, forKey: .selectedMin) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(queryFormat, forKey: .queryFormat) + + try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) + + try? container.encodeIfPresent(displayFormat, forKey: .displayFormat) + + try? container.encodeIfPresent(selectedMax, forKey: .selectedMax) + + try? container.encodeIfPresent(min, forKey: .min) + + try? container.encodeIfPresent(max, forKey: .max) + + try? container.encodeIfPresent(count, forKey: .count) + } + } + + /* + Model: ProductFiltersKey + Used By: Catalog + */ + + class ProductFiltersKey: Codable { + public var kind: String? + + public var logo: String? + + public var name: String + + public var display: String + + public enum CodingKeys: String, CodingKey { + case kind + + case logo + + case name + + case display + } + + public init(display: String, kind: String?, logo: String?, name: String) { + self.kind = kind + + self.logo = logo + + self.name = name + + self.display = display + } + + public func duplicate() -> ProductFiltersKey { + let dict = self.dictionary! + let copy = ProductFiltersKey(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + kind = try container.decode(String.self, forKey: .kind) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + name = try container.decode(String.self, forKey: .name) + + display = try container.decode(String.self, forKey: .display) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(kind, forKey: .kind) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(display, forKey: .display) + } + } + + /* + Model: ProductFilters + Used By: Catalog + */ + + class ProductFilters: Codable { + public var values: [ProductFiltersValue] + + public var key: ProductFiltersKey + + public enum CodingKeys: String, CodingKey { + case values + + case key + } + + public init(key: ProductFiltersKey, values: [ProductFiltersValue]) { + self.values = values + + self.key = key + } + + public func duplicate() -> ProductFilters { + let dict = self.dictionary! + let copy = ProductFilters(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + values = try container.decode([ProductFiltersValue].self, forKey: .values) + + key = try container.decode(ProductFiltersKey.self, forKey: .key) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(values, forKey: .values) + + try? container.encodeIfPresent(key, forKey: .key) + } + } + + /* + Model: ProductSortOn + Used By: Catalog + */ + + class ProductSortOn: Codable { + public var value: String? + + public var isSelected: Bool? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case value + + case isSelected = "is_selected" + + case name + } + + public init(isSelected: Bool?, name: String?, value: String?) { + self.value = value + + self.isSelected = isSelected + + self.name = name + } + + public func duplicate() -> ProductSortOn { + let dict = self.dictionary! + let copy = ProductSortOn(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isSelected = try container.decode(Bool.self, forKey: .isSelected) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(isSelected, forKey: .isSelected) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: GetCollectionQueryOptionResponse + Used By: Catalog + */ + + class GetCollectionQueryOptionResponse: Codable { + public var filters: [ProductFilters]? + + public var sortOn: [ProductSortOn]? + + public enum CodingKeys: String, CodingKey { + case filters + + case sortOn = "sort_on" + } + + public init(filters: [ProductFilters]?, sortOn: [ProductSortOn]?) { + self.filters = filters + + self.sortOn = sortOn + } + + public func duplicate() -> GetCollectionQueryOptionResponse { + let dict = self.dictionary! + let copy = GetCollectionQueryOptionResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + filters = try container.decode([ProductFilters].self, forKey: .filters) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sortOn = try container.decode([ProductSortOn].self, forKey: .sortOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(filters, forKey: .filters) + + try? container.encodeIfPresent(sortOn, forKey: .sortOn) + } + } + + /* + Model: CollectionListingFilterType + Used By: Catalog + */ + + class CollectionListingFilterType: Codable { + public var isSelected: Bool? + + public var name: String? + + public var display: String? + + public enum CodingKeys: String, CodingKey { + case isSelected = "is_selected" + + case name + + case display + } + + public init(display: String?, isSelected: Bool?, name: String?) { + self.isSelected = isSelected + + self.name = name + + self.display = display + } + + public func duplicate() -> CollectionListingFilterType { + let dict = self.dictionary! + let copy = CollectionListingFilterType(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isSelected = try container.decode(Bool.self, forKey: .isSelected) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isSelected, forKey: .isSelected) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(display, forKey: .display) + } + } + + /* + Model: CollectionListingFilterTag + Used By: Catalog + */ + + class CollectionListingFilterTag: Codable { + public var isSelected: Bool? + + public var name: String? + + public var display: String? + + public enum CodingKeys: String, CodingKey { + case isSelected = "is_selected" + + case name + + case display + } + + public init(display: String?, isSelected: Bool?, name: String?) { + self.isSelected = isSelected + + self.name = name + + self.display = display + } + + public func duplicate() -> CollectionListingFilterTag { + let dict = self.dictionary! + let copy = CollectionListingFilterTag(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isSelected = try container.decode(Bool.self, forKey: .isSelected) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isSelected, forKey: .isSelected) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(display, forKey: .display) + } + } + + /* + Model: CollectionListingFilter + Used By: Catalog + */ + + class CollectionListingFilter: Codable { + public var type: [CollectionListingFilterType]? + + public var tags: [CollectionListingFilterTag]? + + public enum CodingKeys: String, CodingKey { + case type + + case tags + } + + public init(tags: [CollectionListingFilterTag]?, type: [CollectionListingFilterType]?) { + self.type = type + + self.tags = tags + } + + public func duplicate() -> CollectionListingFilter { + let dict = self.dictionary! + let copy = CollectionListingFilter(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode([CollectionListingFilterType].self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([CollectionListingFilterTag].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: BannerImage + Used By: Catalog + */ + + class BannerImage: Codable { + public var aspectRatio: String? + + public var url: String? + + public enum CodingKeys: String, CodingKey { + case aspectRatio = "aspect_ratio" + + case url + } + + public init(aspectRatio: String?, url: String?) { + self.aspectRatio = aspectRatio + + self.url = url + } + + public func duplicate() -> BannerImage { + let dict = self.dictionary! + let copy = BannerImage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + aspectRatio = try container.decode(String.self, forKey: .aspectRatio) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) + + try? container.encodeIfPresent(url, forKey: .url) + } + } + + /* + Model: ImageUrls + Used By: Catalog + */ + + class ImageUrls: Codable { + public var portrait: BannerImage? + + public var landscape: BannerImage? + + public enum CodingKeys: String, CodingKey { + case portrait + + case landscape + } + + public init(landscape: BannerImage?, portrait: BannerImage?) { + self.portrait = portrait + + self.landscape = landscape + } + + public func duplicate() -> ImageUrls { + let dict = self.dictionary! + let copy = ImageUrls(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + portrait = try container.decode(BannerImage.self, forKey: .portrait) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + landscape = try container.decode(BannerImage.self, forKey: .landscape) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(portrait, forKey: .portrait) + + try? container.encodeIfPresent(landscape, forKey: .landscape) + } + } + + /* + Model: Media1 + Used By: Catalog + */ + + class Media1: Codable { + public var url: String + + public var type: String? + + public var meta: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case url + + case type + + case meta + } + + public init(meta: [String: Any]?, type: String?, url: String) { + self.url = url + + self.type = type + + self.meta = meta + } + + public func duplicate() -> Media1 { + let dict = self.dictionary! + let copy = Media1(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + url = try container.decode(String.self, forKey: .url) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(meta, forKey: .meta) + } + } + + /* + Model: GetCollectionDetailNest + Used By: Catalog + */ + + class GetCollectionDetailNest: Codable { + public var slug: String? + + public var allowFacets: Bool? + + public var visibleFacetsKeys: [String]? + + public var isActive: Bool? + + public var appId: String? + + public var action: Action? + + public var badge: [String: Any]? + + public var meta: [String: Any]? + + public var query: [String: Any]? + + public var banners: ImageUrls? + + public var tag: [String]? + + public var description: String? + + public var logo: Media1? + + public var type: String? + + public var uid: String? + + public var schedule: [String: Any]? + + public var cron: [String: Any]? + + public var name: String? + + public var allowSort: Bool? + + public enum CodingKeys: String, CodingKey { + case slug + + case allowFacets = "allow_facets" + + case visibleFacetsKeys = "visible_facets_keys" + + case isActive = "is_active" + + case appId = "app_id" + + case action + + case badge + + case meta + + case query + + case banners + + case tag + + case description + + case logo + + case type + + case uid + + case schedule = "_schedule" + + case cron + + case name + + case allowSort = "allow_sort" + } + + public init(action: Action?, allowFacets: Bool?, allowSort: Bool?, appId: String?, badge: [String: Any]?, banners: ImageUrls?, cron: [String: Any]?, description: String?, isActive: Bool?, logo: Media1?, meta: [String: Any]?, name: String?, query: [String: Any]?, slug: String?, tag: [String]?, type: String?, uid: String?, visibleFacetsKeys: [String]?, schedule: [String: Any]?) { + self.slug = slug + + self.allowFacets = allowFacets + + self.visibleFacetsKeys = visibleFacetsKeys + + self.isActive = isActive + + self.appId = appId + + self.action = action + + self.badge = badge + + self.meta = meta + + self.query = query + + self.banners = banners + + self.tag = tag + + self.description = description + + self.logo = logo + + self.type = type + + self.uid = uid + + self.schedule = schedule + + self.cron = cron + + self.name = name + + self.allowSort = allowSort + } + + public func duplicate() -> GetCollectionDetailNest { + let dict = self.dictionary! + let copy = GetCollectionDetailNest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allowFacets = try container.decode(Bool.self, forKey: .allowFacets) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + visibleFacetsKeys = try container.decode([String].self, forKey: .visibleFacetsKeys) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(Action.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + badge = try container.decode([String: Any].self, forKey: .badge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode([String: Any].self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banners = try container.decode(ImageUrls.self, forKey: .banners) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tag = try container.decode([String].self, forKey: .tag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(Media1.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode([String: Any].self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cron = try container.decode([String: Any].self, forKey: .cron) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allowSort = try container.decode(Bool.self, forKey: .allowSort) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(allowFacets, forKey: .allowFacets) + + try? container.encodeIfPresent(visibleFacetsKeys, forKey: .visibleFacetsKeys) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(badge, forKey: .badge) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(query, forKey: .query) + + try? container.encodeIfPresent(banners, forKey: .banners) + + try? container.encodeIfPresent(tag, forKey: .tag) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + + try? container.encodeIfPresent(cron, forKey: .cron) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(allowSort, forKey: .allowSort) + } + } + + /* + Model: GetCollectionListingResponse + Used By: Catalog + */ + + class GetCollectionListingResponse: Codable { + public var page: Page? + + public var filters: CollectionListingFilter? + + public var items: [GetCollectionDetailNest]? + + public enum CodingKeys: String, CodingKey { + case page + + case filters + + case items + } + + public init(filters: CollectionListingFilter?, items: [GetCollectionDetailNest]?, page: Page?) { + self.page = page + + self.filters = filters + + self.items = items + } + + public func duplicate() -> GetCollectionListingResponse { + let dict = self.dictionary! + let copy = GetCollectionListingResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filters = try container.decode(CollectionListingFilter.self, forKey: .filters) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([GetCollectionDetailNest].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(filters, forKey: .filters) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: SeoDetail + Used By: Catalog + */ + + class SeoDetail: Codable { + public var description: String? + + public var title: String? + + public enum CodingKeys: String, CodingKey { + case description + + case title + } + + public init(description: String?, title: String?) { + self.description = description + + self.title = title + } + + public func duplicate() -> SeoDetail { + let dict = self.dictionary! + let copy = SeoDetail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(title, forKey: .title) + } + } + + /* + Model: CollectionBadge + Used By: Catalog + */ + + class CollectionBadge: Codable { + public var color: String? + + public var text: String? + + public enum CodingKeys: String, CodingKey { + case color + + case text + } + + public init(color: String?, text: String?) { + self.color = color + + self.text = text + } + + public func duplicate() -> CollectionBadge { + let dict = self.dictionary! + let copy = CollectionBadge(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + color = try container.decode(String.self, forKey: .color) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text = try container.decode(String.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(color, forKey: .color) + + try? container.encodeIfPresent(text, forKey: .text) + } + } + + /* + Model: CollectionImage + Used By: Catalog + */ + + class CollectionImage: Codable { + public var aspectRatio: String + + public var url: String + + public enum CodingKeys: String, CodingKey { + case aspectRatio = "aspect_ratio" + + case url + } + + public init(aspectRatio: String, url: String) { + self.aspectRatio = aspectRatio + + self.url = url + } + + public func duplicate() -> CollectionImage { + let dict = self.dictionary! + let copy = CollectionImage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + aspectRatio = try container.decode(String.self, forKey: .aspectRatio) + + url = try container.decode(String.self, forKey: .url) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) + + try? container.encodeIfPresent(url, forKey: .url) + } + } + + /* + Model: CollectionBanner + Used By: Catalog + */ + + class CollectionBanner: Codable { + public var portrait: CollectionImage + + public var landscape: CollectionImage + + public enum CodingKeys: String, CodingKey { + case portrait + + case landscape + } + + public init(landscape: CollectionImage, portrait: CollectionImage) { + self.portrait = portrait + + self.landscape = landscape + } + + public func duplicate() -> CollectionBanner { + let dict = self.dictionary! + let copy = CollectionBanner(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + portrait = try container.decode(CollectionImage.self, forKey: .portrait) + + landscape = try container.decode(CollectionImage.self, forKey: .landscape) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(portrait, forKey: .portrait) + + try? container.encodeIfPresent(landscape, forKey: .landscape) + } + } + + /* + Model: UserInfo + Used By: Catalog + */ + + class UserInfo: Codable { + public var email: String? + + public var userId: String? + + public var uid: String? + + public var username: String? + + public enum CodingKeys: String, CodingKey { + case email + + case userId = "user_id" + + case uid + + case username + } + + public init(email: String?, uid: String?, username: String?, userId: String?) { + self.email = email + + self.userId = userId + + self.uid = uid + + self.username = username + } + + public func duplicate() -> UserInfo { + let dict = self.dictionary! + let copy = UserInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(userId, forKey: .userId) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(username, forKey: .username) + } + } + + /* + Model: Schedule + Used By: Catalog + */ + + class Schedule: Codable { + public var cron: String? + + public var end: String? + + public var start: String? + + public var duration: Int? + + public enum CodingKeys: String, CodingKey { + case cron + + case end + + case start + + case duration + } + + public init(cron: String?, duration: Int?, end: String?, start: String?) { + self.cron = cron + + self.end = end + + self.start = start + + self.duration = duration + } + + public func duplicate() -> Schedule { + let dict = self.dictionary! + let copy = Schedule(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + cron = try container.decode(String.self, forKey: .cron) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + end = try container.decode(String.self, forKey: .end) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + start = try container.decode(String.self, forKey: .start) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + duration = try container.decode(Int.self, forKey: .duration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(cron, forKey: .cron) + + try? container.encode(end, forKey: .end) + + try? container.encodeIfPresent(start, forKey: .start) + + try? container.encode(duration, forKey: .duration) + } + } + + /* + Model: CreateCollection + Used By: Catalog + */ + + class CreateCollection: Codable { + public var localeLanguage: [String: Any]? + + public var sortOn: String? + + public var slug: String + + public var seo: SeoDetail? + + public var tags: [String]? + + public var allowFacets: Bool? + + public var visibleFacetsKeys: [String]? + + public var isActive: Bool? + + public var appId: String + + public var badge: CollectionBadge? + + public var query: [String: Any]? + + public var meta: [String: Any]? + + public var banners: CollectionBanner + + public var createdBy: UserInfo? + + public var published: Bool? + + public var type: String + + public var logo: CollectionImage + + public var description: String? + + public var isVisible: Bool? + + public var schedule: Schedule? + + public var modifiedBy: UserInfo? + + public var customJson: [String: Any]? + + public var name: String + + public var allowSort: Bool? + + public enum CodingKeys: String, CodingKey { + case localeLanguage = "_locale_language" + + case sortOn = "sort_on" + + case slug + + case seo + + case tags + + case allowFacets = "allow_facets" + + case visibleFacetsKeys = "visible_facets_keys" + + case isActive = "is_active" + + case appId = "app_id" + + case badge + + case query + + case meta + + case banners + + case createdBy = "created_by" + + case published + + case type + + case logo + + case description + + case isVisible = "is_visible" + + case schedule = "_schedule" + + case modifiedBy = "modified_by" + + case customJson = "_custom_json" + + case name + + case allowSort = "allow_sort" + } + + public init(allowFacets: Bool?, allowSort: Bool?, appId: String, badge: CollectionBadge?, banners: CollectionBanner, createdBy: UserInfo?, description: String?, isActive: Bool?, isVisible: Bool?, logo: CollectionImage, meta: [String: Any]?, modifiedBy: UserInfo?, name: String, published: Bool?, query: [String: Any]?, seo: SeoDetail?, slug: String, sortOn: String?, tags: [String]?, type: String, visibleFacetsKeys: [String]?, customJson: [String: Any]?, localeLanguage: [String: Any]?, schedule: Schedule?) { + self.localeLanguage = localeLanguage + + self.sortOn = sortOn + + self.slug = slug + + self.seo = seo + + self.tags = tags + + self.allowFacets = allowFacets + + self.visibleFacetsKeys = visibleFacetsKeys + + self.isActive = isActive + + self.appId = appId + + self.badge = badge + + self.query = query + + self.meta = meta + + self.banners = banners + + self.createdBy = createdBy + + self.published = published + + self.type = type + + self.logo = logo + + self.description = description + + self.isVisible = isVisible + + self.schedule = schedule + + self.modifiedBy = modifiedBy + + self.customJson = customJson + + self.name = name + + self.allowSort = allowSort + } + + public func duplicate() -> CreateCollection { + let dict = self.dictionary! + let copy = CreateCollection(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + localeLanguage = try container.decode([String: Any].self, forKey: .localeLanguage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sortOn = try container.decode(String.self, forKey: .sortOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + slug = try container.decode(String.self, forKey: .slug) + + do { + seo = try container.decode(SeoDetail.self, forKey: .seo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allowFacets = try container.decode(Bool.self, forKey: .allowFacets) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + visibleFacetsKeys = try container.decode([String].self, forKey: .visibleFacetsKeys) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + appId = try container.decode(String.self, forKey: .appId) + + do { + badge = try container.decode(CollectionBadge.self, forKey: .badge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode([String: Any].self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + banners = try container.decode(CollectionBanner.self, forKey: .banners) + + do { + createdBy = try container.decode(UserInfo.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + type = try container.decode(String.self, forKey: .type) + + logo = try container.decode(CollectionImage.self, forKey: .logo) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isVisible = try container.decode(Bool.self, forKey: .isVisible) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode(Schedule.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode(UserInfo.self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + name = try container.decode(String.self, forKey: .name) + + do { + allowSort = try container.decode(Bool.self, forKey: .allowSort) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(localeLanguage, forKey: .localeLanguage) + + try? container.encodeIfPresent(sortOn, forKey: .sortOn) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(seo, forKey: .seo) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(allowFacets, forKey: .allowFacets) + + try? container.encodeIfPresent(visibleFacetsKeys, forKey: .visibleFacetsKeys) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(badge, forKey: .badge) + + try? container.encodeIfPresent(query, forKey: .query) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(banners, forKey: .banners) + + try? container.encode(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(isVisible, forKey: .isVisible) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + + try? container.encode(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(allowSort, forKey: .allowSort) + } + } + + /* + Model: CollectionCreateResponse + Used By: Catalog + */ + + class CollectionCreateResponse: Codable { + public var allowFacets: Bool? + + public var tag: [String]? + + public var visibleFacetsKeys: [String]? + + public var description: String? + + public var logo: BannerImage? + + public var banners: ImageUrls? + + public var isActive: Bool? + + public var type: String? + + public var appId: String? + + public var badge: [String: Any]? + + public var schedule: [String: Any]? + + public var meta: [String: Any]? + + public var slug: String? + + public var cron: [String: Any]? + + public var query: [String: Any]? + + public var name: String? + + public var allowSort: Bool? + + public enum CodingKeys: String, CodingKey { + case allowFacets = "allow_facets" + + case tag + + case visibleFacetsKeys = "visible_facets_keys" + + case description + + case logo + + case banners + + case isActive = "is_active" + + case type + + case appId = "app_id" + + case badge + + case schedule = "_schedule" + + case meta + + case slug + + case cron + + case query + + case name + + case allowSort = "allow_sort" + } + + public init(allowFacets: Bool?, allowSort: Bool?, appId: String?, badge: [String: Any]?, banners: ImageUrls?, cron: [String: Any]?, description: String?, isActive: Bool?, logo: BannerImage?, meta: [String: Any]?, name: String?, query: [String: Any]?, slug: String?, tag: [String]?, type: String?, visibleFacetsKeys: [String]?, schedule: [String: Any]?) { + self.allowFacets = allowFacets + + self.tag = tag + + self.visibleFacetsKeys = visibleFacetsKeys + + self.description = description + + self.logo = logo + + self.banners = banners + + self.isActive = isActive + + self.type = type + + self.appId = appId + + self.badge = badge + + self.schedule = schedule + + self.meta = meta + + self.slug = slug + + self.cron = cron + + self.query = query + + self.name = name + + self.allowSort = allowSort + } + + public func duplicate() -> CollectionCreateResponse { + let dict = self.dictionary! + let copy = CollectionCreateResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + allowFacets = try container.decode(Bool.self, forKey: .allowFacets) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tag = try container.decode([String].self, forKey: .tag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + visibleFacetsKeys = try container.decode([String].self, forKey: .visibleFacetsKeys) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(BannerImage.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banners = try container.decode(ImageUrls.self, forKey: .banners) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + badge = try container.decode([String: Any].self, forKey: .badge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode([String: Any].self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cron = try container.decode([String: Any].self, forKey: .cron) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode([String: Any].self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allowSort = try container.decode(Bool.self, forKey: .allowSort) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(allowFacets, forKey: .allowFacets) + + try? container.encodeIfPresent(tag, forKey: .tag) + + try? container.encodeIfPresent(visibleFacetsKeys, forKey: .visibleFacetsKeys) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(banners, forKey: .banners) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(badge, forKey: .badge) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(cron, forKey: .cron) + + try? container.encodeIfPresent(query, forKey: .query) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(allowSort, forKey: .allowSort) + } + } + + /* + Model: CollectionDetailResponse + Used By: Catalog + */ + + class CollectionDetailResponse: Codable { + public var allowFacets: Bool? + + public var tag: [String]? + + public var visibleFacetsKeys: [String]? + + public var description: String? + + public var logo: Media1? + + public var banners: ImageUrls? + + public var isActive: Bool? + + public var type: String? + + public var appId: String? + + public var badge: [String: Any]? + + public var schedule: [String: Any]? + + public var meta: [String: Any]? + + public var slug: String? + + public var cron: [String: Any]? + + public var query: [String: Any]? + + public var name: String? + + public var allowSort: Bool? + + public enum CodingKeys: String, CodingKey { + case allowFacets = "allow_facets" + + case tag + + case visibleFacetsKeys = "visible_facets_keys" + + case description + + case logo + + case banners + + case isActive = "is_active" + + case type + + case appId = "app_id" + + case badge + + case schedule = "_schedule" + + case meta + + case slug + + case cron + + case query + + case name + + case allowSort = "allow_sort" + } + + public init(allowFacets: Bool?, allowSort: Bool?, appId: String?, badge: [String: Any]?, banners: ImageUrls?, cron: [String: Any]?, description: String?, isActive: Bool?, logo: Media1?, meta: [String: Any]?, name: String?, query: [String: Any]?, slug: String?, tag: [String]?, type: String?, visibleFacetsKeys: [String]?, schedule: [String: Any]?) { + self.allowFacets = allowFacets + + self.tag = tag + + self.visibleFacetsKeys = visibleFacetsKeys + + self.description = description + + self.logo = logo + + self.banners = banners + + self.isActive = isActive + + self.type = type + + self.appId = appId + + self.badge = badge + + self.schedule = schedule + + self.meta = meta + + self.slug = slug + + self.cron = cron + + self.query = query + + self.name = name + + self.allowSort = allowSort + } + + public func duplicate() -> CollectionDetailResponse { + let dict = self.dictionary! + let copy = CollectionDetailResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + allowFacets = try container.decode(Bool.self, forKey: .allowFacets) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tag = try container.decode([String].self, forKey: .tag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + visibleFacetsKeys = try container.decode([String].self, forKey: .visibleFacetsKeys) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(Media1.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banners = try container.decode(ImageUrls.self, forKey: .banners) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + badge = try container.decode([String: Any].self, forKey: .badge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode([String: Any].self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cron = try container.decode([String: Any].self, forKey: .cron) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode([String: Any].self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allowSort = try container.decode(Bool.self, forKey: .allowSort) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(allowFacets, forKey: .allowFacets) + + try? container.encodeIfPresent(tag, forKey: .tag) + + try? container.encodeIfPresent(visibleFacetsKeys, forKey: .visibleFacetsKeys) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(banners, forKey: .banners) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(badge, forKey: .badge) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(cron, forKey: .cron) + + try? container.encodeIfPresent(query, forKey: .query) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(allowSort, forKey: .allowSort) + } + } + + /* + Model: UpdateCollection + Used By: Catalog + */ + + class UpdateCollection: Codable { + public var localeLanguage: [String: Any]? + + public var sortOn: String? + + public var slug: String? + + public var seo: SeoDetail? + + public var tags: [String]? + + public var allowFacets: Bool? + + public var visibleFacetsKeys: [String]? + + public var isActive: Bool? + + public var badge: CollectionBadge? + + public var meta: [String: Any]? + + public var query: [String: Any]? + + public var banners: CollectionBanner? + + public var published: Bool? + + public var logo: CollectionImage? + + public var description: String? + + public var isVisible: Bool? + + public var schedule: Schedule? + + public var modifiedBy: UserInfo? + + public var customJson: [String: Any]? + + public var name: String? + + public var allowSort: Bool? + + public enum CodingKeys: String, CodingKey { + case localeLanguage = "_locale_language" + + case sortOn = "sort_on" + + case slug + + case seo + + case tags + + case allowFacets = "allow_facets" + + case visibleFacetsKeys = "visible_facets_keys" + + case isActive = "is_active" + + case badge + + case meta + + case query + + case banners + + case published + + case logo + + case description + + case isVisible = "is_visible" + + case schedule = "_schedule" + + case modifiedBy = "modified_by" + + case customJson = "_custom_json" + + case name + + case allowSort = "allow_sort" + } + + public init(allowFacets: Bool?, allowSort: Bool?, badge: CollectionBadge?, banners: CollectionBanner?, description: String?, isActive: Bool?, isVisible: Bool?, logo: CollectionImage?, meta: [String: Any]?, modifiedBy: UserInfo?, name: String?, published: Bool?, query: [String: Any]?, seo: SeoDetail?, slug: String?, sortOn: String?, tags: [String]?, visibleFacetsKeys: [String]?, customJson: [String: Any]?, localeLanguage: [String: Any]?, schedule: Schedule?) { + self.localeLanguage = localeLanguage + + self.sortOn = sortOn + + self.slug = slug + + self.seo = seo + + self.tags = tags + + self.allowFacets = allowFacets + + self.visibleFacetsKeys = visibleFacetsKeys + + self.isActive = isActive + + self.badge = badge + + self.meta = meta + + self.query = query + + self.banners = banners + + self.published = published + + self.logo = logo + + self.description = description + + self.isVisible = isVisible + + self.schedule = schedule + + self.modifiedBy = modifiedBy + + self.customJson = customJson + + self.name = name + + self.allowSort = allowSort + } + + public func duplicate() -> UpdateCollection { + let dict = self.dictionary! + let copy = UpdateCollection(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + localeLanguage = try container.decode([String: Any].self, forKey: .localeLanguage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sortOn = try container.decode(String.self, forKey: .sortOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + seo = try container.decode(SeoDetail.self, forKey: .seo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allowFacets = try container.decode(Bool.self, forKey: .allowFacets) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + visibleFacetsKeys = try container.decode([String].self, forKey: .visibleFacetsKeys) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + badge = try container.decode(CollectionBadge.self, forKey: .badge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode([String: Any].self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banners = try container.decode(CollectionBanner.self, forKey: .banners) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(CollectionImage.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isVisible = try container.decode(Bool.self, forKey: .isVisible) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode(Schedule.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode(UserInfo.self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allowSort = try container.decode(Bool.self, forKey: .allowSort) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(localeLanguage, forKey: .localeLanguage) + + try? container.encodeIfPresent(sortOn, forKey: .sortOn) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(seo, forKey: .seo) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(allowFacets, forKey: .allowFacets) + + try? container.encodeIfPresent(visibleFacetsKeys, forKey: .visibleFacetsKeys) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(badge, forKey: .badge) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(query, forKey: .query) + + try? container.encodeIfPresent(banners, forKey: .banners) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(isVisible, forKey: .isVisible) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + + try? container.encode(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(allowSort, forKey: .allowSort) + } + } + + /* + Model: Price1 + Used By: Catalog + */ + + class Price1: Codable { + public var currencySymbol: String? + + public var currencyCode: String? + + public var min: Double? + + public var max: Double? + + public enum CodingKeys: String, CodingKey { + case currencySymbol = "currency_symbol" + + case currencyCode = "currency_code" + + case min + + case max + } + + public init(currencyCode: String?, currencySymbol: String?, max: Double?, min: Double?) { + self.currencySymbol = currencySymbol + + self.currencyCode = currencyCode + + self.min = min + + self.max = max + } + + public func duplicate() -> Price1 { + let dict = self.dictionary! + let copy = Price1(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + currencySymbol = try container.decode(String.self, forKey: .currencySymbol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + min = try container.decode(Double.self, forKey: .min) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + max = try container.decode(Double.self, forKey: .max) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(currencySymbol, forKey: .currencySymbol) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + + try? container.encodeIfPresent(min, forKey: .min) + + try? container.encodeIfPresent(max, forKey: .max) + } + } + + /* + Model: ProductListingPrice + Used By: Catalog + */ + + class ProductListingPrice: Codable { + public var marked: Price1? + + public var effective: Price1? + + public enum CodingKeys: String, CodingKey { + case marked + + case effective + } + + public init(effective: Price1?, marked: Price1?) { + self.marked = marked + + self.effective = effective + } + + public func duplicate() -> ProductListingPrice { + let dict = self.dictionary! + let copy = ProductListingPrice(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + marked = try container.decode(Price1.self, forKey: .marked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + effective = try container.decode(Price1.self, forKey: .effective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(marked, forKey: .marked) + + try? container.encodeIfPresent(effective, forKey: .effective) + } + } + + /* + Model: ProductBrand + Used By: Catalog + */ + + class ProductBrand: Codable { + public var action: Action? + + public var uid: Int? + + public var name: String? + + public var logo: Media1? + + public enum CodingKeys: String, CodingKey { + case action + + case uid + + case name + + case logo + } + + public init(action: Action?, logo: Media1?, name: String?, uid: Int?) { + self.action = action + + self.uid = uid + + self.name = name + + self.logo = logo + } + + public func duplicate() -> ProductBrand { + let dict = self.dictionary! + let copy = ProductBrand(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + action = try container.decode(Action.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(Media1.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(logo, forKey: .logo) + } + } + + /* + Model: ProductDetailAttribute + Used By: Catalog + */ + + class ProductDetailAttribute: Codable { + public var value: String? + + public var type: String? + + public var key: String? + + public enum CodingKeys: String, CodingKey { + case value + + case type + + case key + } + + public init(key: String?, type: String?, value: String?) { + self.value = value + + self.type = type + + self.key = key + } + + public func duplicate() -> ProductDetailAttribute { + let dict = self.dictionary! + let copy = ProductDetailAttribute(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(key, forKey: .key) + } + } + + /* + Model: ProductDetailGroupedAttribute + Used By: Catalog + */ + + class ProductDetailGroupedAttribute: Codable { + public var details: [ProductDetailAttribute]? + + public var title: String? + + public enum CodingKeys: String, CodingKey { + case details + + case title + } + + public init(details: [ProductDetailAttribute]?, title: String?) { + self.details = details + + self.title = title + } + + public func duplicate() -> ProductDetailGroupedAttribute { + let dict = self.dictionary! + let copy = ProductDetailGroupedAttribute(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + details = try container.decode([ProductDetailAttribute].self, forKey: .details) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(details, forKey: .details) + + try? container.encodeIfPresent(title, forKey: .title) + } + } + + /* + Model: ProductListingDetail + Used By: Catalog + */ + + class ProductListingDetail: Codable { + public var productOnlineDate: String? + + public var highlights: [String]? + + public var ratingCount: Int? + + public var slug: String + + public var sellable: Bool? + + public var price: ProductListingPrice? + + public var hasVariant: Bool? + + public var color: String? + + public var itemType: String? + + public var brand: ProductBrand? + + public var teaserTag: [String: Any]? + + public var similars: [String]? + + public var medias: [Media1]? + + public var attributes: [String: Any]? + + public var imageNature: String? + + public var tryouts: [String]? + + public var groupedAttributes: [ProductDetailGroupedAttribute]? + + public var type: String? + + public var uid: Int? + + public var description: String? + + public var discount: String? + + public var promoMeta: [String: Any]? + + public var rating: Double? + + public var itemCode: String? + + public var name: String? + + public var shortDescription: String? + + public enum CodingKeys: String, CodingKey { + case productOnlineDate = "product_online_date" + + case highlights + + case ratingCount = "rating_count" + + case slug + + case sellable + + case price + + case hasVariant = "has_variant" + + case color + + case itemType = "item_type" + + case brand + + case teaserTag = "teaser_tag" + + case similars + + case medias + + case attributes + + case imageNature = "image_nature" + + case tryouts + + case groupedAttributes = "grouped_attributes" + + case type + + case uid + + case description + + case discount + + case promoMeta = "promo_meta" + + case rating + + case itemCode = "item_code" + + case name + + case shortDescription = "short_description" + } + + public init(attributes: [String: Any]?, brand: ProductBrand?, color: String?, description: String?, discount: String?, groupedAttributes: [ProductDetailGroupedAttribute]?, hasVariant: Bool?, highlights: [String]?, imageNature: String?, itemCode: String?, itemType: String?, medias: [Media1]?, name: String?, price: ProductListingPrice?, productOnlineDate: String?, promoMeta: [String: Any]?, rating: Double?, ratingCount: Int?, sellable: Bool?, shortDescription: String?, similars: [String]?, slug: String, teaserTag: [String: Any]?, tryouts: [String]?, type: String?, uid: Int?) { + self.productOnlineDate = productOnlineDate + + self.highlights = highlights + + self.ratingCount = ratingCount + + self.slug = slug + + self.sellable = sellable + + self.price = price + + self.hasVariant = hasVariant + + self.color = color + + self.itemType = itemType + + self.brand = brand + + self.teaserTag = teaserTag + + self.similars = similars + + self.medias = medias + + self.attributes = attributes + + self.imageNature = imageNature + + self.tryouts = tryouts + + self.groupedAttributes = groupedAttributes + + self.type = type + + self.uid = uid + + self.description = description + + self.discount = discount + + self.promoMeta = promoMeta + + self.rating = rating + + self.itemCode = itemCode + + self.name = name + + self.shortDescription = shortDescription + } + + public func duplicate() -> ProductListingDetail { + let dict = self.dictionary! + let copy = ProductListingDetail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + productOnlineDate = try container.decode(String.self, forKey: .productOnlineDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + highlights = try container.decode([String].self, forKey: .highlights) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ratingCount = try container.decode(Int.self, forKey: .ratingCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + slug = try container.decode(String.self, forKey: .slug) + + do { + sellable = try container.decode(Bool.self, forKey: .sellable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(ProductListingPrice.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasVariant = try container.decode(Bool.self, forKey: .hasVariant) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + color = try container.decode(String.self, forKey: .color) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemType = try container.decode(String.self, forKey: .itemType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brand = try container.decode(ProductBrand.self, forKey: .brand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + teaserTag = try container.decode([String: Any].self, forKey: .teaserTag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + similars = try container.decode([String].self, forKey: .similars) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + medias = try container.decode([Media1].self, forKey: .medias) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributes = try container.decode([String: Any].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + imageNature = try container.decode(String.self, forKey: .imageNature) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tryouts = try container.decode([String].self, forKey: .tryouts) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + groupedAttributes = try container.decode([ProductDetailGroupedAttribute].self, forKey: .groupedAttributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discount = try container.decode(String.self, forKey: .discount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + promoMeta = try container.decode([String: Any].self, forKey: .promoMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rating = try container.decode(Double.self, forKey: .rating) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemCode = try container.decode(String.self, forKey: .itemCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shortDescription = try container.decode(String.self, forKey: .shortDescription) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(productOnlineDate, forKey: .productOnlineDate) + + try? container.encodeIfPresent(highlights, forKey: .highlights) + + try? container.encodeIfPresent(ratingCount, forKey: .ratingCount) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(sellable, forKey: .sellable) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(hasVariant, forKey: .hasVariant) + + try? container.encodeIfPresent(color, forKey: .color) + + try? container.encodeIfPresent(itemType, forKey: .itemType) + + try? container.encodeIfPresent(brand, forKey: .brand) + + try? container.encodeIfPresent(teaserTag, forKey: .teaserTag) + + try? container.encodeIfPresent(similars, forKey: .similars) + + try? container.encodeIfPresent(medias, forKey: .medias) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + + try? container.encodeIfPresent(imageNature, forKey: .imageNature) + + try? container.encodeIfPresent(tryouts, forKey: .tryouts) + + try? container.encodeIfPresent(groupedAttributes, forKey: .groupedAttributes) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(discount, forKey: .discount) + + try? container.encodeIfPresent(promoMeta, forKey: .promoMeta) + + try? container.encodeIfPresent(rating, forKey: .rating) + + try? container.encodeIfPresent(itemCode, forKey: .itemCode) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(shortDescription, forKey: .shortDescription) + } + } + + /* + Model: GetCollectionItemsResponse + Used By: Catalog + */ + + class GetCollectionItemsResponse: Codable { + public var page: Page? + + public var filters: [ProductFilters]? + + public var sortOn: [ProductSortOn]? + + public var items: [ProductListingDetail]? + + public enum CodingKeys: String, CodingKey { + case page + + case filters + + case sortOn = "sort_on" + + case items + } + + public init(filters: [ProductFilters]?, items: [ProductListingDetail]?, page: Page?, sortOn: [ProductSortOn]?) { + self.page = page + + self.filters = filters + + self.sortOn = sortOn + + self.items = items + } + + public func duplicate() -> GetCollectionItemsResponse { + let dict = self.dictionary! + let copy = GetCollectionItemsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filters = try container.decode([ProductFilters].self, forKey: .filters) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sortOn = try container.decode([ProductSortOn].self, forKey: .sortOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([ProductListingDetail].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(filters, forKey: .filters) + + try? container.encodeIfPresent(sortOn, forKey: .sortOn) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: CollectionItemRequest + Used By: Catalog + */ + + class CollectionItemRequest: Codable { + public var pageNo: Int + + public var pageSize: Int + + public enum CodingKeys: String, CodingKey { + case pageNo = "page_no" + + case pageSize = "page_size" + } + + public init(pageNo: Int, pageSize: Int) { + self.pageNo = pageNo + + self.pageSize = pageSize + } + + public func duplicate() -> CollectionItemRequest { + let dict = self.dictionary! + let copy = CollectionItemRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + pageNo = try container.decode(Int.self, forKey: .pageNo) + + pageSize = try container.decode(Int.self, forKey: .pageSize) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pageNo, forKey: .pageNo) + + try? container.encodeIfPresent(pageSize, forKey: .pageSize) + } + } + + /* + Model: UpdatedResponse + Used By: Catalog + */ + + class UpdatedResponse: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> UpdatedResponse { + let dict = self.dictionary! + let copy = UpdatedResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: CatalogInsightBrand + Used By: Catalog + */ + + class CatalogInsightBrand: Codable { + public var totalArticles: Int? + + public var availableSizes: Int? + + public var totalSizes: Int? + + public var articleFreshness: Int? + + public var availableArticles: Int? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case totalArticles = "total_articles" + + case availableSizes = "available_sizes" + + case totalSizes = "total_sizes" + + case articleFreshness = "article_freshness" + + case availableArticles = "available_articles" + + case name + } + + public init(articleFreshness: Int?, availableArticles: Int?, availableSizes: Int?, name: String?, totalArticles: Int?, totalSizes: Int?) { + self.totalArticles = totalArticles + + self.availableSizes = availableSizes + + self.totalSizes = totalSizes + + self.articleFreshness = articleFreshness + + self.availableArticles = availableArticles + + self.name = name + } + + public func duplicate() -> CatalogInsightBrand { + let dict = self.dictionary! + let copy = CatalogInsightBrand(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + totalArticles = try container.decode(Int.self, forKey: .totalArticles) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + availableSizes = try container.decode(Int.self, forKey: .availableSizes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalSizes = try container.decode(Int.self, forKey: .totalSizes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + articleFreshness = try container.decode(Int.self, forKey: .articleFreshness) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + availableArticles = try container.decode(Int.self, forKey: .availableArticles) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(totalArticles, forKey: .totalArticles) + + try? container.encodeIfPresent(availableSizes, forKey: .availableSizes) + + try? container.encodeIfPresent(totalSizes, forKey: .totalSizes) + + try? container.encodeIfPresent(articleFreshness, forKey: .articleFreshness) + + try? container.encodeIfPresent(availableArticles, forKey: .availableArticles) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: CatalogInsightItem + Used By: Catalog + */ + + class CatalogInsightItem: Codable { + public var sellableCount: Int? + + public var count: Int? + + public var outOfStockCount: Int? + + public enum CodingKeys: String, CodingKey { + case sellableCount = "sellable_count" + + case count + + case outOfStockCount = "out_of_stock_count" + } + + public init(count: Int?, outOfStockCount: Int?, sellableCount: Int?) { + self.sellableCount = sellableCount + + self.count = count + + self.outOfStockCount = outOfStockCount + } + + public func duplicate() -> CatalogInsightItem { + let dict = self.dictionary! + let copy = CatalogInsightItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + sellableCount = try container.decode(Int.self, forKey: .sellableCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + outOfStockCount = try container.decode(Int.self, forKey: .outOfStockCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(sellableCount, forKey: .sellableCount) + + try? container.encodeIfPresent(count, forKey: .count) + + try? container.encodeIfPresent(outOfStockCount, forKey: .outOfStockCount) + } + } + + /* + Model: CatalogInsightResponse + Used By: Catalog + */ + + class CatalogInsightResponse: Codable { + public var brandDistribution: CatalogInsightBrand? + + public var item: CatalogInsightItem? + + public enum CodingKeys: String, CodingKey { + case brandDistribution = "brand_distribution" + + case item + } + + public init(brandDistribution: CatalogInsightBrand?, item: CatalogInsightItem?) { + self.brandDistribution = brandDistribution + + self.item = item + } + + public func duplicate() -> CatalogInsightResponse { + let dict = self.dictionary! + let copy = CatalogInsightResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + brandDistribution = try container.decode(CatalogInsightBrand.self, forKey: .brandDistribution) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + item = try container.decode(CatalogInsightItem.self, forKey: .item) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(brandDistribution, forKey: .brandDistribution) + + try? container.encodeIfPresent(item, forKey: .item) + } + } + + /* + Model: CrossSellingData + Used By: Catalog + */ + + class CrossSellingData: Codable { + public var articles: Int? + + public var products: Int? + + public enum CodingKeys: String, CodingKey { + case articles + + case products + } + + public init(articles: Int?, products: Int?) { + self.articles = articles + + self.products = products + } + + public func duplicate() -> CrossSellingData { + let dict = self.dictionary! + let copy = CrossSellingData(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + articles = try container.decode(Int.self, forKey: .articles) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + products = try container.decode(Int.self, forKey: .products) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(articles, forKey: .articles) + + try? container.encodeIfPresent(products, forKey: .products) + } + } + + /* + Model: CrossSellingResponse + Used By: Catalog + */ + + class CrossSellingResponse: Codable { + public var brandDistribution: CatalogInsightBrand? + + public var data: CrossSellingData? + + public enum CodingKeys: String, CodingKey { + case brandDistribution = "brand_distribution" + + case data + } + + public init(brandDistribution: CatalogInsightBrand?, data: CrossSellingData?) { + self.brandDistribution = brandDistribution + + self.data = data + } + + public func duplicate() -> CrossSellingResponse { + let dict = self.dictionary! + let copy = CrossSellingResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + brandDistribution = try container.decode(CatalogInsightBrand.self, forKey: .brandDistribution) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode(CrossSellingData.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(brandDistribution, forKey: .brandDistribution) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: OptInPostRequest + Used By: Catalog + */ + + class OptInPostRequest: Codable { + public var storeIds: [Int]? + + public var brandIds: [Int]? + + public var enabled: Bool? + + public var optLevel: String + + public enum CodingKeys: String, CodingKey { + case storeIds = "store_ids" + + case brandIds = "brand_ids" + + case enabled + + case optLevel = "opt_level" + } + + public init(brandIds: [Int]?, enabled: Bool?, optLevel: String, storeIds: [Int]?) { + self.storeIds = storeIds + + self.brandIds = brandIds + + self.enabled = enabled + + self.optLevel = optLevel + } + + public func duplicate() -> OptInPostRequest { + let dict = self.dictionary! + let copy = OptInPostRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + storeIds = try container.decode([Int].self, forKey: .storeIds) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandIds = try container.decode([Int].self, forKey: .brandIds) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + optLevel = try container.decode(String.self, forKey: .optLevel) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(storeIds, forKey: .storeIds) + + try? container.encodeIfPresent(brandIds, forKey: .brandIds) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(optLevel, forKey: .optLevel) + } + } + + /* + Model: CompanyOptIn + Used By: Catalog + */ + + class CompanyOptIn: Codable { + public var storeIds: [Int] + + public var platform: String + + public var modifiedOn: Int + + public var enabled: Bool + + public var optLevel: String + + public var companyId: Int + + public var brandIds: [Int] + + public var createdBy: [String: Any]? + + public var modifiedBy: [String: Any]? + + public var createdOn: Int + + public enum CodingKeys: String, CodingKey { + case storeIds = "store_ids" + + case platform + + case modifiedOn = "modified_on" + + case enabled + + case optLevel = "opt_level" + + case companyId = "company_id" + + case brandIds = "brand_ids" + + case createdBy = "created_by" + + case modifiedBy = "modified_by" + + case createdOn = "created_on" + } + + public init(brandIds: [Int], companyId: Int, createdBy: [String: Any]?, createdOn: Int, enabled: Bool, modifiedBy: [String: Any]?, modifiedOn: Int, optLevel: String, platform: String, storeIds: [Int]) { + self.storeIds = storeIds + + self.platform = platform + + self.modifiedOn = modifiedOn + + self.enabled = enabled + + self.optLevel = optLevel + + self.companyId = companyId + + self.brandIds = brandIds + + self.createdBy = createdBy + + self.modifiedBy = modifiedBy + + self.createdOn = createdOn + } + + public func duplicate() -> CompanyOptIn { + let dict = self.dictionary! + let copy = CompanyOptIn(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + storeIds = try container.decode([Int].self, forKey: .storeIds) + + platform = try container.decode(String.self, forKey: .platform) + + modifiedOn = try container.decode(Int.self, forKey: .modifiedOn) + + enabled = try container.decode(Bool.self, forKey: .enabled) + + optLevel = try container.decode(String.self, forKey: .optLevel) + + companyId = try container.decode(Int.self, forKey: .companyId) + + brandIds = try container.decode([Int].self, forKey: .brandIds) + + do { + createdBy = try container.decode([String: Any].self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode([String: Any].self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + createdOn = try container.decode(Int.self, forKey: .createdOn) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(storeIds, forKey: .storeIds) + + try? container.encodeIfPresent(platform, forKey: .platform) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(optLevel, forKey: .optLevel) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(brandIds, forKey: .brandIds) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + } + } + + /* + Model: GetOptInPlatform + Used By: Catalog + */ + + class GetOptInPlatform: Codable { + public var page: Page + + public var items: [CompanyOptIn] + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [CompanyOptIn], page: Page) { + self.page = page + + self.items = items + } + + public func duplicate() -> GetOptInPlatform { + let dict = self.dictionary! + let copy = GetOptInPlatform(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + page = try container.decode(Page.self, forKey: .page) + + items = try container.decode([CompanyOptIn].self, forKey: .items) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: OptinCompanyDetail + Used By: Catalog + */ + + class OptinCompanyDetail: Codable { + public var businessType: String? + + public var uid: Int? + + public var name: String? + + public var companyType: String? + + public enum CodingKeys: String, CodingKey { + case businessType = "business_type" + + case uid + + case name + + case companyType = "company_type" + } + + public init(businessType: String?, companyType: String?, name: String?, uid: Int?) { + self.businessType = businessType + + self.uid = uid + + self.name = name + + self.companyType = companyType + } + + public func duplicate() -> OptinCompanyDetail { + let dict = self.dictionary! + let copy = OptinCompanyDetail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + businessType = try container.decode(String.self, forKey: .businessType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyType = try container.decode(String.self, forKey: .companyType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(businessType, forKey: .businessType) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(companyType, forKey: .companyType) + } + } + + /* + Model: CompanyBrandDetail + Used By: Catalog + */ + + class CompanyBrandDetail: Codable { + public var totalArticle: Int? + + public var brandName: String? + + public var brandId: Int? + + public var companyId: Int? + + public enum CodingKeys: String, CodingKey { + case totalArticle = "total_article" + + case brandName = "brand_name" + + case brandId = "brand_id" + + case companyId = "company_id" + } + + public init(brandId: Int?, brandName: String?, companyId: Int?, totalArticle: Int?) { + self.totalArticle = totalArticle + + self.brandName = brandName + + self.brandId = brandId + + self.companyId = companyId + } + + public func duplicate() -> CompanyBrandDetail { + let dict = self.dictionary! + let copy = CompanyBrandDetail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + totalArticle = try container.decode(Int.self, forKey: .totalArticle) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandName = try container.decode(String.self, forKey: .brandName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandId = try container.decode(Int.self, forKey: .brandId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(totalArticle, forKey: .totalArticle) + + try? container.encodeIfPresent(brandName, forKey: .brandName) + + try? container.encodeIfPresent(brandId, forKey: .brandId) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + } + } + + /* + Model: OptinCompanyBrandDetailsView + Used By: Catalog + */ + + class OptinCompanyBrandDetailsView: Codable { + public var page: Page? + + public var items: [CompanyBrandDetail]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [CompanyBrandDetail]?, page: Page?) { + self.page = page + + self.items = items + } + + public func duplicate() -> OptinCompanyBrandDetailsView { + let dict = self.dictionary! + let copy = OptinCompanyBrandDetailsView(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([CompanyBrandDetail].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: OptinCompanyMetrics + Used By: Catalog + */ + + class OptinCompanyMetrics: Codable { + public var store: Int? + + public var brand: Int? + + public var company: String? + + public enum CodingKeys: String, CodingKey { + case store + + case brand + + case company + } + + public init(brand: Int?, company: String?, store: Int?) { + self.store = store + + self.brand = brand + + self.company = company + } + + public func duplicate() -> OptinCompanyMetrics { + let dict = self.dictionary! + let copy = OptinCompanyMetrics(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + store = try container.decode(Int.self, forKey: .store) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brand = try container.decode(Int.self, forKey: .brand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + company = try container.decode(String.self, forKey: .company) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(store, forKey: .store) + + try? container.encodeIfPresent(brand, forKey: .brand) + + try? container.encodeIfPresent(company, forKey: .company) + } + } + + /* + Model: StoreDetail + Used By: Catalog + */ + + class StoreDetail: Codable { + public var timing: [String: Any]? + + public var storeType: String? + + public var storeCode: String? + + public var uid: Int? + + public var modifiedOn: String? + + public var documents: [[String: Any]]? + + public var displayName: String? + + public var companyId: Int? + + public var additionalContacts: [[String: Any]]? + + public var createdOn: String? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case timing + + case storeType = "store_type" + + case storeCode = "store_code" + + case uid + + case modifiedOn = "modified_on" + + case documents + + case displayName = "display_name" + + case companyId = "company_id" + + case additionalContacts = "additional_contacts" + + case createdOn = "created_on" + + case name + } + + public init(additionalContacts: [[String: Any]]?, companyId: Int?, createdOn: String?, displayName: String?, documents: [[String: Any]]?, modifiedOn: String?, name: String?, storeCode: String?, storeType: String?, timing: [String: Any]?, uid: Int?) { + self.timing = timing + + self.storeType = storeType + + self.storeCode = storeCode + + self.uid = uid + + self.modifiedOn = modifiedOn + + self.documents = documents + + self.displayName = displayName + + self.companyId = companyId + + self.additionalContacts = additionalContacts + + self.createdOn = createdOn + + self.name = name + } + + public func duplicate() -> StoreDetail { + let dict = self.dictionary! + let copy = StoreDetail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + timing = try container.decode([String: Any].self, forKey: .timing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeType = try container.decode(String.self, forKey: .storeType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeCode = try container.decode(String.self, forKey: .storeCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + documents = try container.decode([[String: Any]].self, forKey: .documents) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + additionalContacts = try container.decode([[String: Any]].self, forKey: .additionalContacts) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(timing, forKey: .timing) + + try? container.encodeIfPresent(storeType, forKey: .storeType) + + try? container.encodeIfPresent(storeCode, forKey: .storeCode) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(documents, forKey: .documents) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(additionalContacts, forKey: .additionalContacts) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: OptinStoreDetails + Used By: Catalog + */ + + class OptinStoreDetails: Codable { + public var page: Page? + + public var items: [StoreDetail]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [StoreDetail]?, page: Page?) { + self.page = page + + self.items = items + } + + public func duplicate() -> OptinStoreDetails { + let dict = self.dictionary! + let copy = OptinStoreDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([StoreDetail].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: AttributeMasterFilter + Used By: Catalog + */ + + class AttributeMasterFilter: Codable { + public var indexing: Bool + + public var priority: Int? + + public var dependsOn: [String]? + + public enum CodingKeys: String, CodingKey { + case indexing + + case priority + + case dependsOn = "depends_on" + } + + public init(dependsOn: [String]?, indexing: Bool, priority: Int?) { + self.indexing = indexing + + self.priority = priority + + self.dependsOn = dependsOn + } + + public func duplicate() -> AttributeMasterFilter { + let dict = self.dictionary! + let copy = AttributeMasterFilter(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + indexing = try container.decode(Bool.self, forKey: .indexing) + + do { + priority = try container.decode(Int.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dependsOn = try container.decode([String].self, forKey: .dependsOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(indexing, forKey: .indexing) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(dependsOn, forKey: .dependsOn) + } + } + + /* + Model: AttributeSchemaRange + Used By: Catalog + */ + + class AttributeSchemaRange: Codable { + public var min: Int? + + public var max: Int? + + public enum CodingKeys: String, CodingKey { + case min + + case max + } + + public init(max: Int?, min: Int?) { + self.min = min + + self.max = max + } + + public func duplicate() -> AttributeSchemaRange { + let dict = self.dictionary! + let copy = AttributeSchemaRange(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + min = try container.decode(Int.self, forKey: .min) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + max = try container.decode(Int.self, forKey: .max) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(min, forKey: .min) + + try? container.encodeIfPresent(max, forKey: .max) + } + } + + /* + Model: AttributeMaster + Used By: Catalog + */ + + class AttributeMaster: Codable { + public var multi: Bool? + + public var type: String + + public var mandatory: Bool? + + public var allowedValues: [String]? + + public var format: String? + + public var range: AttributeSchemaRange? + + public enum CodingKeys: String, CodingKey { + case multi + + case type + + case mandatory + + case allowedValues = "allowed_values" + + case format + + case range + } + + public init(allowedValues: [String]?, format: String?, mandatory: Bool?, multi: Bool?, range: AttributeSchemaRange?, type: String) { + self.multi = multi + + self.type = type + + self.mandatory = mandatory + + self.allowedValues = allowedValues + + self.format = format + + self.range = range + } + + public func duplicate() -> AttributeMaster { + let dict = self.dictionary! + let copy = AttributeMaster(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + multi = try container.decode(Bool.self, forKey: .multi) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + type = try container.decode(String.self, forKey: .type) + + do { + mandatory = try container.decode(Bool.self, forKey: .mandatory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allowedValues = try container.decode([String].self, forKey: .allowedValues) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + format = try container.decode(String.self, forKey: .format) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + range = try container.decode(AttributeSchemaRange.self, forKey: .range) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(multi, forKey: .multi) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(mandatory, forKey: .mandatory) + + try? container.encodeIfPresent(allowedValues, forKey: .allowedValues) + + try? container.encodeIfPresent(format, forKey: .format) + + try? container.encodeIfPresent(range, forKey: .range) + } + } + + /* + Model: AttributeMasterDetails + Used By: Catalog + */ + + class AttributeMasterDetails: Codable { + public var displayType: String + + public enum CodingKeys: String, CodingKey { + case displayType = "display_type" + } + + public init(displayType: String) { + self.displayType = displayType + } + + public func duplicate() -> AttributeMasterDetails { + let dict = self.dictionary! + let copy = AttributeMasterDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + displayType = try container.decode(String.self, forKey: .displayType) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(displayType, forKey: .displayType) + } + } + + /* + Model: AttributeMasterMandatoryDetails + Used By: Catalog + */ + + class AttributeMasterMandatoryDetails: Codable { + public var l3Keys: [String]? + + public enum CodingKeys: String, CodingKey { + case l3Keys = "l3_keys" + } + + public init(l3Keys: [String]?) { + self.l3Keys = l3Keys + } + + public func duplicate() -> AttributeMasterMandatoryDetails { + let dict = self.dictionary! + let copy = AttributeMasterMandatoryDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + l3Keys = try container.decode([String].self, forKey: .l3Keys) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(l3Keys, forKey: .l3Keys) + } + } + + /* + Model: AttributeMasterMeta + Used By: Catalog + */ + + class AttributeMasterMeta: Codable { + public var enriched: Bool? + + public var mandatoryDetails: AttributeMasterMandatoryDetails + + public enum CodingKeys: String, CodingKey { + case enriched + + case mandatoryDetails = "mandatory_details" + } + + public init(enriched: Bool?, mandatoryDetails: AttributeMasterMandatoryDetails) { + self.enriched = enriched + + self.mandatoryDetails = mandatoryDetails + } + + public func duplicate() -> AttributeMasterMeta { + let dict = self.dictionary! + let copy = AttributeMasterMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enriched = try container.decode(Bool.self, forKey: .enriched) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + mandatoryDetails = try container.decode(AttributeMasterMandatoryDetails.self, forKey: .mandatoryDetails) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enriched, forKey: .enriched) + + try? container.encodeIfPresent(mandatoryDetails, forKey: .mandatoryDetails) + } + } + + /* + Model: GenderDetail + Used By: Catalog + */ + + class GenderDetail: Codable { + public var description: String? + + public var logo: String? + + public var id: String? + + public var filters: AttributeMasterFilter? + + public var schema: AttributeMaster? + + public var details: AttributeMasterDetails? + + public var slug: String? + + public var enabledForEndConsumer: Bool? + + public var isNested: Bool? + + public var departments: [String]? + + public var meta: AttributeMasterMeta? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case description + + case logo + + case id + + case filters + + case schema + + case details + + case slug + + case enabledForEndConsumer = "enabled_for_end_consumer" + + case isNested = "is_nested" + + case departments + + case meta + + case name + } + + public init(departments: [String]?, description: String?, details: AttributeMasterDetails?, enabledForEndConsumer: Bool?, filters: AttributeMasterFilter?, id: String?, isNested: Bool?, logo: String?, meta: AttributeMasterMeta?, name: String?, schema: AttributeMaster?, slug: String?) { + self.description = description + + self.logo = logo + + self.id = id + + self.filters = filters + + self.schema = schema + + self.details = details + + self.slug = slug + + self.enabledForEndConsumer = enabledForEndConsumer + + self.isNested = isNested + + self.departments = departments + + self.meta = meta + + self.name = name + } + + public func duplicate() -> GenderDetail { + let dict = self.dictionary! + let copy = GenderDetail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filters = try container.decode(AttributeMasterFilter.self, forKey: .filters) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schema = try container.decode(AttributeMaster.self, forKey: .schema) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + details = try container.decode(AttributeMasterDetails.self, forKey: .details) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabledForEndConsumer = try container.decode(Bool.self, forKey: .enabledForEndConsumer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isNested = try container.decode(Bool.self, forKey: .isNested) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + departments = try container.decode([String].self, forKey: .departments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode(AttributeMasterMeta.self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(filters, forKey: .filters) + + try? container.encodeIfPresent(schema, forKey: .schema) + + try? container.encodeIfPresent(details, forKey: .details) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(enabledForEndConsumer, forKey: .enabledForEndConsumer) + + try? container.encodeIfPresent(isNested, forKey: .isNested) + + try? container.encodeIfPresent(departments, forKey: .departments) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: ProdcutTemplateCategoriesResponse + Used By: Catalog + */ + + class ProdcutTemplateCategoriesResponse: Codable { + public var page: Page? + + public var items: [[String: Any]]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [[String: Any]]?, page: Page?) { + self.page = page + + self.items = items + } + + public func duplicate() -> ProdcutTemplateCategoriesResponse { + let dict = self.dictionary! + let copy = ProdcutTemplateCategoriesResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([[String: Any]].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: PTErrorResponse + Used By: Catalog + */ + + class PTErrorResponse: Codable { + public var errors: [String: Any]? + + public var code: String? + + public var message: String? + + public var status: Int? + + public var meta: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case errors + + case code + + case message + + case status + + case meta + } + + public init(code: String?, errors: [String: Any]?, message: String?, meta: [String: Any]?, status: Int?) { + self.errors = errors + + self.code = code + + self.message = message + + self.status = status + + self.meta = meta + } + + public func duplicate() -> PTErrorResponse { + let dict = self.dictionary! + let copy = PTErrorResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + errors = try container.decode([String: Any].self, forKey: .errors) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Int.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(errors, forKey: .errors) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(meta, forKey: .meta) + } + } + + /* + Model: UserSerializer + Used By: Catalog + */ + + class UserSerializer: Codable { + public var userId: String? + + public var contact: String? + + public var username: String? + + public enum CodingKeys: String, CodingKey { + case userId = "user_id" + + case contact + + case username + } + + public init(contact: String?, username: String?, userId: String?) { + self.userId = userId + + self.contact = contact + + self.username = username + } + + public func duplicate() -> UserSerializer { + let dict = self.dictionary! + let copy = UserSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contact = try container.decode(String.self, forKey: .contact) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(userId, forKey: .userId) + + try? container.encodeIfPresent(contact, forKey: .contact) + + try? container.encodeIfPresent(username, forKey: .username) + } + } + + /* + Model: GetDepartment + Used By: Catalog + */ + + class GetDepartment: Codable { + public var pageNo: Int? + + public var uid: Int? + + public var logo: String? + + public var isActive: Bool? + + public var modifiedOn: String? + + public var priorityOrder: Int? + + public var search: String? + + public var synonyms: [String]? + + public var createdOn: String? + + public var itemType: String? + + public var createdBy: UserSerializer? + + public var modifiedBy: UserSerializer? + + public var slug: String? + + public var pageSize: Int? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case pageNo = "page_no" + + case uid + + case logo + + case isActive = "is_active" + + case modifiedOn = "modified_on" + + case priorityOrder = "priority_order" + + case search + + case synonyms + + case createdOn = "created_on" + + case itemType = "item_type" + + case createdBy = "created_by" + + case modifiedBy = "modified_by" + + case slug + + case pageSize = "page_size" + + case name + } + + public init(createdBy: UserSerializer?, createdOn: String?, isActive: Bool?, itemType: String?, logo: String?, modifiedBy: UserSerializer?, modifiedOn: String?, name: String?, pageNo: Int?, pageSize: Int?, priorityOrder: Int?, search: String?, slug: String?, synonyms: [String]?, uid: Int?) { + self.pageNo = pageNo + + self.uid = uid + + self.logo = logo + + self.isActive = isActive + + self.modifiedOn = modifiedOn + + self.priorityOrder = priorityOrder + + self.search = search + + self.synonyms = synonyms + + self.createdOn = createdOn + + self.itemType = itemType + + self.createdBy = createdBy + + self.modifiedBy = modifiedBy + + self.slug = slug + + self.pageSize = pageSize + + self.name = name + } + + public func duplicate() -> GetDepartment { + let dict = self.dictionary! + let copy = GetDepartment(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + pageNo = try container.decode(Int.self, forKey: .pageNo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priorityOrder = try container.decode(Int.self, forKey: .priorityOrder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + search = try container.decode(String.self, forKey: .search) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + synonyms = try container.decode([String].self, forKey: .synonyms) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemType = try container.decode(String.self, forKey: .itemType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(UserSerializer.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode(UserSerializer.self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pageSize = try container.decode(Int.self, forKey: .pageSize) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pageNo, forKey: .pageNo) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(priorityOrder, forKey: .priorityOrder) + + try? container.encodeIfPresent(search, forKey: .search) + + try? container.encodeIfPresent(synonyms, forKey: .synonyms) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(itemType, forKey: .itemType) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(pageSize, forKey: .pageSize) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: DepartmentsResponse + Used By: Catalog + */ + + class DepartmentsResponse: Codable { + public var page: Page? + + public var items: [GetDepartment]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [GetDepartment]?, page: Page?) { + self.page = page + + self.items = items + } + + public func duplicate() -> DepartmentsResponse { + let dict = self.dictionary! + let copy = DepartmentsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([GetDepartment].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: DepartmentErrorResponse + Used By: Catalog + */ + + class DepartmentErrorResponse: Codable { + public var errors: [String: Any]? + + public var code: String? + + public var message: String? + + public var status: Int? + + public var meta: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case errors + + case code + + case message + + case status + + case meta + } + + public init(code: String?, errors: [String: Any]?, message: String?, meta: [String: Any]?, status: Int?) { + self.errors = errors + + self.code = code + + self.message = message + + self.status = status + + self.meta = meta + } + + public func duplicate() -> DepartmentErrorResponse { + let dict = self.dictionary! + let copy = DepartmentErrorResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + errors = try container.decode([String: Any].self, forKey: .errors) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Int.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(errors, forKey: .errors) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(meta, forKey: .meta) + } + } + + /* + Model: ProductTemplate + Used By: Catalog + */ + + class ProductTemplate: Codable { + public var tag: String? + + public var description: String? + + public var logo: String? + + public var isActive: Bool? + + public var isPhysical: Bool + + public var modifiedOn: String? + + public var categories: [String]? + + public var isArchived: Bool? + + public var createdOn: String? + + public var attributes: [String]? + + public var createdBy: [String: Any]? + + public var isExpirable: Bool + + public var modifiedBy: [String: Any]? + + public var slug: String + + public var departments: [String]? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case tag + + case description + + case logo + + case isActive = "is_active" + + case isPhysical = "is_physical" + + case modifiedOn = "modified_on" + + case categories + + case isArchived = "is_archived" + + case createdOn = "created_on" + + case attributes + + case createdBy = "created_by" + + case isExpirable = "is_expirable" + + case modifiedBy = "modified_by" + + case slug + + case departments + + case name + } + + public init(attributes: [String]?, categories: [String]?, createdBy: [String: Any]?, createdOn: String?, departments: [String]?, description: String?, isActive: Bool?, isArchived: Bool?, isExpirable: Bool, isPhysical: Bool, logo: String?, modifiedBy: [String: Any]?, modifiedOn: String?, name: String?, slug: String, tag: String?) { + self.tag = tag + + self.description = description + + self.logo = logo + + self.isActive = isActive + + self.isPhysical = isPhysical + + self.modifiedOn = modifiedOn + + self.categories = categories + + self.isArchived = isArchived + + self.createdOn = createdOn + + self.attributes = attributes + + self.createdBy = createdBy + + self.isExpirable = isExpirable + + self.modifiedBy = modifiedBy + + self.slug = slug + + self.departments = departments + + self.name = name + } + + public func duplicate() -> ProductTemplate { + let dict = self.dictionary! + let copy = ProductTemplate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + tag = try container.decode(String.self, forKey: .tag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + isPhysical = try container.decode(Bool.self, forKey: .isPhysical) + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + categories = try container.decode([String].self, forKey: .categories) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isArchived = try container.decode(Bool.self, forKey: .isArchived) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributes = try container.decode([String].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode([String: Any].self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + isExpirable = try container.decode(Bool.self, forKey: .isExpirable) + + do { + modifiedBy = try container.decode([String: Any].self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + slug = try container.decode(String.self, forKey: .slug) + + do { + departments = try container.decode([String].self, forKey: .departments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(tag, forKey: .tag) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(isPhysical, forKey: .isPhysical) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encode(categories, forKey: .categories) + + try? container.encodeIfPresent(isArchived, forKey: .isArchived) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encode(attributes, forKey: .attributes) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(isExpirable, forKey: .isExpirable) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encode(departments, forKey: .departments) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: TemplatesResponse + Used By: Catalog + */ + + class TemplatesResponse: Codable { + public var page: Page? + + public var items: ProductTemplate? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: ProductTemplate?, page: Page?) { + self.page = page + + self.items = items + } + + public func duplicate() -> TemplatesResponse { + let dict = self.dictionary! + let copy = TemplatesResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode(ProductTemplate.self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: TemplateDetails + Used By: Catalog + */ + + class TemplateDetails: Codable { + public var tag: String? + + public var description: String? + + public var logo: String? + + public var isActive: Bool? + + public var isPhysical: Bool + + public var id: String? + + public var categories: [String]? + + public var isArchived: Bool? + + public var attributes: [String]? + + public var isExpirable: Bool + + public var slug: String + + public var departments: [String]? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case tag + + case description + + case logo + + case isActive = "is_active" + + case isPhysical = "is_physical" + + case id + + case categories + + case isArchived = "is_archived" + + case attributes + + case isExpirable = "is_expirable" + + case slug + + case departments + + case name + } + + public init(attributes: [String]?, categories: [String]?, departments: [String]?, description: String?, id: String?, isActive: Bool?, isArchived: Bool?, isExpirable: Bool, isPhysical: Bool, logo: String?, name: String?, slug: String, tag: String?) { + self.tag = tag + + self.description = description + + self.logo = logo + + self.isActive = isActive + + self.isPhysical = isPhysical + + self.id = id + + self.categories = categories + + self.isArchived = isArchived + + self.attributes = attributes + + self.isExpirable = isExpirable + + self.slug = slug + + self.departments = departments + + self.name = name + } + + public func duplicate() -> TemplateDetails { + let dict = self.dictionary! + let copy = TemplateDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + tag = try container.decode(String.self, forKey: .tag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + isPhysical = try container.decode(Bool.self, forKey: .isPhysical) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + categories = try container.decode([String].self, forKey: .categories) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isArchived = try container.decode(Bool.self, forKey: .isArchived) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributes = try container.decode([String].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + isExpirable = try container.decode(Bool.self, forKey: .isExpirable) + + slug = try container.decode(String.self, forKey: .slug) + + do { + departments = try container.decode([String].self, forKey: .departments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(tag, forKey: .tag) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(isPhysical, forKey: .isPhysical) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encode(categories, forKey: .categories) + + try? container.encodeIfPresent(isArchived, forKey: .isArchived) + + try? container.encode(attributes, forKey: .attributes) + + try? container.encodeIfPresent(isExpirable, forKey: .isExpirable) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encode(departments, forKey: .departments) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: Properties + Used By: Catalog + */ + + class Properties: Codable { + public var highlights: [String: Any]? + + public var isDependent: [String: Any]? + + public var noOfBoxes: [String: Any]? + + public var slug: [String: Any]? + + public var variants: [String: Any]? + + public var moq: [String: Any]? + + public var tags: [String: Any]? + + public var sizeGuide: [String: Any]? + + public var media: [String: Any]? + + public var isActive: [String: Any]? + + public var itemType: [String: Any]? + + public var returnConfig: [String: Any]? + + public var teaserTag: [String: Any]? + + public var hsnCode: [String: Any]? + + public var sizes: [String: Any]? + + public var categorySlug: [String: Any]? + + public var multiSize: [String: Any]? + + public var customOrder: [String: Any]? + + public var traderType: [String: Any]? + + public var trader: [String: Any]? + + public var brandUid: [String: Any]? + + public var productPublish: [String: Any]? + + public var description: [String: Any]? + + public var productGroupTag: [String: Any]? + + public var currency: [String: Any]? + + public var countryOfOrigin: [String: Any]? + + public var itemCode: [String: Any]? + + public var command: [String: Any]? + + public var name: [String: Any]? + + public var shortDescription: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case highlights + + case isDependent = "is_dependent" + + case noOfBoxes = "no_of_boxes" + + case slug + + case variants + + case moq + + case tags + + case sizeGuide = "size_guide" + + case media + + case isActive = "is_active" + + case itemType = "item_type" + + case returnConfig = "return_config" + + case teaserTag = "teaser_tag" + + case hsnCode = "hsn_code" + + case sizes + + case categorySlug = "category_slug" + + case multiSize = "multi_size" + + case customOrder = "custom_order" + + case traderType = "trader_type" + + case trader + + case brandUid = "brand_uid" + + case productPublish = "product_publish" + + case description + + case productGroupTag = "product_group_tag" + + case currency + + case countryOfOrigin = "country_of_origin" + + case itemCode = "item_code" + + case command + + case name + + case shortDescription = "short_description" + } + + public init(brandUid: [String: Any]?, categorySlug: [String: Any]?, command: [String: Any]?, countryOfOrigin: [String: Any]?, currency: [String: Any]?, customOrder: [String: Any]?, description: [String: Any]?, highlights: [String: Any]?, hsnCode: [String: Any]?, isActive: [String: Any]?, isDependent: [String: Any]?, itemCode: [String: Any]?, itemType: [String: Any]?, media: [String: Any]?, moq: [String: Any]?, multiSize: [String: Any]?, name: [String: Any]?, noOfBoxes: [String: Any]?, productGroupTag: [String: Any]?, productPublish: [String: Any]?, returnConfig: [String: Any]?, shortDescription: [String: Any]?, sizes: [String: Any]?, sizeGuide: [String: Any]?, slug: [String: Any]?, tags: [String: Any]?, teaserTag: [String: Any]?, trader: [String: Any]?, traderType: [String: Any]?, variants: [String: Any]?) { + self.highlights = highlights + + self.isDependent = isDependent + + self.noOfBoxes = noOfBoxes + + self.slug = slug + + self.variants = variants + + self.moq = moq + + self.tags = tags + + self.sizeGuide = sizeGuide + + self.media = media + + self.isActive = isActive + + self.itemType = itemType + + self.returnConfig = returnConfig + + self.teaserTag = teaserTag + + self.hsnCode = hsnCode + + self.sizes = sizes + + self.categorySlug = categorySlug + + self.multiSize = multiSize + + self.customOrder = customOrder + + self.traderType = traderType + + self.trader = trader + + self.brandUid = brandUid + + self.productPublish = productPublish + + self.description = description + + self.productGroupTag = productGroupTag + + self.currency = currency + + self.countryOfOrigin = countryOfOrigin + + self.itemCode = itemCode + + self.command = command + + self.name = name + + self.shortDescription = shortDescription + } + + public func duplicate() -> Properties { + let dict = self.dictionary! + let copy = Properties(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + highlights = try container.decode([String: Any].self, forKey: .highlights) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isDependent = try container.decode([String: Any].self, forKey: .isDependent) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + noOfBoxes = try container.decode([String: Any].self, forKey: .noOfBoxes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode([String: Any].self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + variants = try container.decode([String: Any].self, forKey: .variants) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + moq = try container.decode([String: Any].self, forKey: .moq) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String: Any].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sizeGuide = try container.decode([String: Any].self, forKey: .sizeGuide) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + media = try container.decode([String: Any].self, forKey: .media) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode([String: Any].self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemType = try container.decode([String: Any].self, forKey: .itemType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + returnConfig = try container.decode([String: Any].self, forKey: .returnConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + teaserTag = try container.decode([String: Any].self, forKey: .teaserTag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hsnCode = try container.decode([String: Any].self, forKey: .hsnCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sizes = try container.decode([String: Any].self, forKey: .sizes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + categorySlug = try container.decode([String: Any].self, forKey: .categorySlug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + multiSize = try container.decode([String: Any].self, forKey: .multiSize) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customOrder = try container.decode([String: Any].self, forKey: .customOrder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + traderType = try container.decode([String: Any].self, forKey: .traderType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + trader = try container.decode([String: Any].self, forKey: .trader) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandUid = try container.decode([String: Any].self, forKey: .brandUid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productPublish = try container.decode([String: Any].self, forKey: .productPublish) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode([String: Any].self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productGroupTag = try container.decode([String: Any].self, forKey: .productGroupTag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode([String: Any].self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryOfOrigin = try container.decode([String: Any].self, forKey: .countryOfOrigin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemCode = try container.decode([String: Any].self, forKey: .itemCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + command = try container.decode([String: Any].self, forKey: .command) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode([String: Any].self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shortDescription = try container.decode([String: Any].self, forKey: .shortDescription) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(highlights, forKey: .highlights) + + try? container.encodeIfPresent(isDependent, forKey: .isDependent) + + try? container.encodeIfPresent(noOfBoxes, forKey: .noOfBoxes) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(variants, forKey: .variants) + + try? container.encodeIfPresent(moq, forKey: .moq) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(sizeGuide, forKey: .sizeGuide) + + try? container.encodeIfPresent(media, forKey: .media) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(itemType, forKey: .itemType) + + try? container.encodeIfPresent(returnConfig, forKey: .returnConfig) + + try? container.encodeIfPresent(teaserTag, forKey: .teaserTag) + + try? container.encodeIfPresent(hsnCode, forKey: .hsnCode) + + try? container.encodeIfPresent(sizes, forKey: .sizes) + + try? container.encodeIfPresent(categorySlug, forKey: .categorySlug) + + try? container.encodeIfPresent(multiSize, forKey: .multiSize) + + try? container.encodeIfPresent(customOrder, forKey: .customOrder) + + try? container.encodeIfPresent(traderType, forKey: .traderType) + + try? container.encodeIfPresent(trader, forKey: .trader) + + try? container.encodeIfPresent(brandUid, forKey: .brandUid) + + try? container.encodeIfPresent(productPublish, forKey: .productPublish) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(productGroupTag, forKey: .productGroupTag) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(countryOfOrigin, forKey: .countryOfOrigin) + + try? container.encodeIfPresent(itemCode, forKey: .itemCode) + + try? container.encodeIfPresent(command, forKey: .command) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(shortDescription, forKey: .shortDescription) + } + } + + /* + Model: GlobalValidation + Used By: Catalog + */ + + class GlobalValidation: Codable { + public var type: String? + + public var description: String? + + public var title: String? + + public var definitions: [String: Any]? + + public var properties: Properties? + + public var required: [String]? + + public enum CodingKeys: String, CodingKey { + case type + + case description + + case title + + case definitions + + case properties + + case required + } + + public init(definitions: [String: Any]?, description: String?, properties: Properties?, required: [String]?, title: String?, type: String?) { + self.type = type + + self.description = description + + self.title = title + + self.definitions = definitions + + self.properties = properties + + self.required = required + } + + public func duplicate() -> GlobalValidation { + let dict = self.dictionary! + let copy = GlobalValidation(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + definitions = try container.decode([String: Any].self, forKey: .definitions) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + properties = try container.decode(Properties.self, forKey: .properties) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + required = try container.decode([String].self, forKey: .required) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(definitions, forKey: .definitions) + + try? container.encodeIfPresent(properties, forKey: .properties) + + try? container.encodeIfPresent(required, forKey: .required) + } + } + + /* + Model: TemplateValidationData + Used By: Catalog + */ + + class TemplateValidationData: Codable { + public var globalValidation: GlobalValidation? + + public var templateValidation: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case globalValidation = "global_validation" + + case templateValidation = "template_validation" + } + + public init(globalValidation: GlobalValidation?, templateValidation: [String: Any]?) { + self.globalValidation = globalValidation + + self.templateValidation = templateValidation + } + + public func duplicate() -> TemplateValidationData { + let dict = self.dictionary! + let copy = TemplateValidationData(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + globalValidation = try container.decode(GlobalValidation.self, forKey: .globalValidation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + templateValidation = try container.decode([String: Any].self, forKey: .templateValidation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(globalValidation, forKey: .globalValidation) + + try? container.encodeIfPresent(templateValidation, forKey: .templateValidation) + } + } + + /* + Model: TemplatesValidationResponse + Used By: Catalog + */ + + class TemplatesValidationResponse: Codable { + public var templateDetails: TemplateDetails? + + public var data: TemplateValidationData? + + public enum CodingKeys: String, CodingKey { + case templateDetails = "template_details" + + case data + } + + public init(data: TemplateValidationData?, templateDetails: TemplateDetails?) { + self.templateDetails = templateDetails + + self.data = data + } + + public func duplicate() -> TemplatesValidationResponse { + let dict = self.dictionary! + let copy = TemplatesValidationResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + templateDetails = try container.decode(TemplateDetails.self, forKey: .templateDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode(TemplateValidationData.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(templateDetails, forKey: .templateDetails) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: InventoryValidationResponse + Used By: Catalog + */ + + class InventoryValidationResponse: Codable { + public var message: String? + + public var data: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case message + + case data + } + + public init(data: [String: Any]?, message: String?) { + self.message = message + + self.data = data + } + + public func duplicate() -> InventoryValidationResponse { + let dict = self.dictionary! + let copy = InventoryValidationResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode([String: Any].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: HSNData + Used By: Catalog + */ + + class HSNData: Codable { + public var countryOfOrigin: [String]? + + public var hsnCode: [String]? + + public enum CodingKeys: String, CodingKey { + case countryOfOrigin = "country_of_origin" + + case hsnCode = "hsn_code" + } + + public init(countryOfOrigin: [String]?, hsnCode: [String]?) { + self.countryOfOrigin = countryOfOrigin + + self.hsnCode = hsnCode + } + + public func duplicate() -> HSNData { + let dict = self.dictionary! + let copy = HSNData(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + countryOfOrigin = try container.decode([String].self, forKey: .countryOfOrigin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hsnCode = try container.decode([String].self, forKey: .hsnCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(countryOfOrigin, forKey: .countryOfOrigin) + + try? container.encodeIfPresent(hsnCode, forKey: .hsnCode) + } + } + + /* + Model: HSNCodesResponse + Used By: Catalog + */ + + class HSNCodesResponse: Codable { + public var message: String? + + public var data: HSNData? + + public enum CodingKeys: String, CodingKey { + case message + + case data + } + + public init(data: HSNData?, message: String?) { + self.message = message + + self.data = data + } + + public func duplicate() -> HSNCodesResponse { + let dict = self.dictionary! + let copy = HSNCodesResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode(HSNData.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: ProductDownloadItemsData + Used By: Catalog + */ + + class ProductDownloadItemsData: Codable { + public var brand: [String]? + + public var type: String? + + public var templates: [String]? + + public enum CodingKeys: String, CodingKey { + case brand + + case type + + case templates + } + + public init(brand: [String]?, templates: [String]?, type: String?) { + self.brand = brand + + self.type = type + + self.templates = templates + } + + public func duplicate() -> ProductDownloadItemsData { + let dict = self.dictionary! + let copy = ProductDownloadItemsData(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + brand = try container.decode([String].self, forKey: .brand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + templates = try container.decode([String].self, forKey: .templates) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(brand, forKey: .brand) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(templates, forKey: .templates) + } + } + + /* + Model: VerifiedBy + Used By: Catalog + */ + + class VerifiedBy: Codable { + public var userId: String? + + public var username: String? + + public enum CodingKeys: String, CodingKey { + case userId = "user_id" + + case username + } + + public init(username: String?, userId: String?) { + self.userId = userId + + self.username = username + } + + public func duplicate() -> VerifiedBy { + let dict = self.dictionary! + let copy = VerifiedBy(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(userId, forKey: .userId) + + try? container.encodeIfPresent(username, forKey: .username) + } + } + + /* + Model: ProductDownloadsItems + Used By: Catalog + */ + + class ProductDownloadsItems: Codable { + public var templateTags: [String: Any]? + + public var id: String? + + public var data: ProductDownloadItemsData? + + public var triggerOn: String? + + public var status: String? + + public var sellerId: Double? + + public var createdBy: VerifiedBy? + + public var url: String? + + public var taskId: String? + + public var completedOn: String? + + public enum CodingKeys: String, CodingKey { + case templateTags = "template_tags" + + case id + + case data + + case triggerOn = "trigger_on" + + case status + + case sellerId = "seller_id" + + case createdBy = "created_by" + + case url + + case taskId = "task_id" + + case completedOn = "completed_on" + } + + public init(completedOn: String?, createdBy: VerifiedBy?, data: ProductDownloadItemsData?, id: String?, sellerId: Double?, status: String?, taskId: String?, templateTags: [String: Any]?, triggerOn: String?, url: String?) { + self.templateTags = templateTags + + self.id = id + + self.data = data + + self.triggerOn = triggerOn + + self.status = status + + self.sellerId = sellerId + + self.createdBy = createdBy + + self.url = url + + self.taskId = taskId + + self.completedOn = completedOn + } + + public func duplicate() -> ProductDownloadsItems { + let dict = self.dictionary! + let copy = ProductDownloadsItems(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + templateTags = try container.decode([String: Any].self, forKey: .templateTags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode(ProductDownloadItemsData.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + triggerOn = try container.decode(String.self, forKey: .triggerOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sellerId = try container.decode(Double.self, forKey: .sellerId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(VerifiedBy.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + taskId = try container.decode(String.self, forKey: .taskId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + completedOn = try container.decode(String.self, forKey: .completedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(templateTags, forKey: .templateTags) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(triggerOn, forKey: .triggerOn) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(sellerId, forKey: .sellerId) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(taskId, forKey: .taskId) + + try? container.encodeIfPresent(completedOn, forKey: .completedOn) + } + } + + /* + Model: ProductDownloadsResponse + Used By: Catalog + */ + + class ProductDownloadsResponse: Codable { + public var page: Page? + + public var items: ProductDownloadsItems? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: ProductDownloadsItems?, page: Page?) { + self.page = page + + self.items = items + } + + public func duplicate() -> ProductDownloadsResponse { + let dict = self.dictionary! + let copy = ProductDownloadsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode(ProductDownloadsItems.self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: ProductConfigurationDownloads + Used By: Catalog + */ + + class ProductConfigurationDownloads: Codable { + public var data: [[String: Any]]? + + public var multivalue: Bool? + + public enum CodingKeys: String, CodingKey { + case data + + case multivalue + } + + public init(data: [[String: Any]]?, multivalue: Bool?) { + self.data = data + + self.multivalue = multivalue + } + + public func duplicate() -> ProductConfigurationDownloads { + let dict = self.dictionary! + let copy = ProductConfigurationDownloads(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode([[String: Any]].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + multivalue = try container.decode(Bool.self, forKey: .multivalue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(multivalue, forKey: .multivalue) + } + } + + /* + Model: Media2 + Used By: Catalog + */ + + class Media2: Codable { + public var portrait: String + + public var logo: String + + public var landscape: String + + public enum CodingKeys: String, CodingKey { + case portrait + + case logo + + case landscape + } + + public init(landscape: String, logo: String, portrait: String) { + self.portrait = portrait + + self.logo = logo + + self.landscape = landscape + } + + public func duplicate() -> Media2 { + let dict = self.dictionary! + let copy = Media2(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + portrait = try container.decode(String.self, forKey: .portrait) + + logo = try container.decode(String.self, forKey: .logo) + + landscape = try container.decode(String.self, forKey: .landscape) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(portrait, forKey: .portrait) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(landscape, forKey: .landscape) + } + } + + /* + Model: CategoryMappingValues + Used By: Catalog + */ + + class CategoryMappingValues: Codable { + public var name: String + + public var catalogId: Int? + + public enum CodingKeys: String, CodingKey { + case name + + case catalogId = "catalog_id" + } + + public init(catalogId: Int?, name: String) { + self.name = name + + self.catalogId = catalogId + } + + public func duplicate() -> CategoryMappingValues { + let dict = self.dictionary! + let copy = CategoryMappingValues(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + name = try container.decode(String.self, forKey: .name) + + do { + catalogId = try container.decode(Int.self, forKey: .catalogId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(catalogId, forKey: .catalogId) + } + } + + /* + Model: CategoryMapping + Used By: Catalog + */ + + class CategoryMapping: Codable { + public var ajio: CategoryMappingValues? + + public var google: CategoryMappingValues? + + public var facebook: CategoryMappingValues? + + public enum CodingKeys: String, CodingKey { + case ajio + + case google + + case facebook + } + + public init(ajio: CategoryMappingValues?, facebook: CategoryMappingValues?, google: CategoryMappingValues?) { + self.ajio = ajio + + self.google = google + + self.facebook = facebook + } + + public func duplicate() -> CategoryMapping { + let dict = self.dictionary! + let copy = CategoryMapping(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + ajio = try container.decode(CategoryMappingValues.self, forKey: .ajio) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + google = try container.decode(CategoryMappingValues.self, forKey: .google) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + facebook = try container.decode(CategoryMappingValues.self, forKey: .facebook) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(ajio, forKey: .ajio) + + try? container.encodeIfPresent(google, forKey: .google) + + try? container.encodeIfPresent(facebook, forKey: .facebook) + } + } + + /* + Model: Hierarchy + Used By: Catalog + */ + + class Hierarchy: Codable { + public var l2: Int + + public var department: Int + + public var l1: Int + + public enum CodingKeys: String, CodingKey { + case l2 + + case department + + case l1 + } + + public init(department: Int, l1: Int, l2: Int) { + self.l2 = l2 + + self.department = department + + self.l1 = l1 + } + + public func duplicate() -> Hierarchy { + let dict = self.dictionary! + let copy = Hierarchy(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + l2 = try container.decode(Int.self, forKey: .l2) + + department = try container.decode(Int.self, forKey: .department) + + l1 = try container.decode(Int.self, forKey: .l1) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(l2, forKey: .l2) + + try? container.encodeIfPresent(department, forKey: .department) + + try? container.encodeIfPresent(l1, forKey: .l1) + } + } + + /* + Model: Category + Used By: Catalog + */ + + class Category: Codable { + public var media: Media2? + + public var priority: Int? + + public var uid: Int? + + public var marketplaces: CategoryMapping? + + public var isActive: Bool + + public var modifiedOn: String? + + public var synonyms: [String]? + + public var createdOn: String? + + public var createdBy: [String: Any]? + + public var modifiedBy: [String: Any]? + + public var id: String? + + public var departments: [Int] + + public var slug: String? + + public var tryouts: [String]? + + public var level: Int + + public var name: String + + public var hierarchy: [Hierarchy]? + + public enum CodingKeys: String, CodingKey { + case media + + case priority + + case uid + + case marketplaces + + case isActive = "is_active" + + case modifiedOn = "modified_on" + + case synonyms + + case createdOn = "created_on" + + case createdBy = "created_by" + + case modifiedBy = "modified_by" + + case id = "_id" + + case departments + + case slug + + case tryouts + + case level + + case name + + case hierarchy + } + + public init(createdBy: [String: Any]?, createdOn: String?, departments: [Int], hierarchy: [Hierarchy]?, isActive: Bool, level: Int, marketplaces: CategoryMapping?, media: Media2?, modifiedBy: [String: Any]?, modifiedOn: String?, name: String, priority: Int?, slug: String?, synonyms: [String]?, tryouts: [String]?, uid: Int?, id: String?) { + self.media = media + + self.priority = priority + + self.uid = uid + + self.marketplaces = marketplaces + + self.isActive = isActive + + self.modifiedOn = modifiedOn + + self.synonyms = synonyms + + self.createdOn = createdOn + + self.createdBy = createdBy + + self.modifiedBy = modifiedBy + + self.id = id + + self.departments = departments + + self.slug = slug + + self.tryouts = tryouts + + self.level = level + + self.name = name + + self.hierarchy = hierarchy + } + + public func duplicate() -> Category { + let dict = self.dictionary! + let copy = Category(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + media = try container.decode(Media2.self, forKey: .media) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(Int.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + marketplaces = try container.decode(CategoryMapping.self, forKey: .marketplaces) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + isActive = try container.decode(Bool.self, forKey: .isActive) + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + synonyms = try container.decode([String].self, forKey: .synonyms) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode([String: Any].self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode([String: Any].self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + departments = try container.decode([Int].self, forKey: .departments) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tryouts = try container.decode([String].self, forKey: .tryouts) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + level = try container.decode(Int.self, forKey: .level) + + name = try container.decode(String.self, forKey: .name) + + do { + hierarchy = try container.decode([Hierarchy].self, forKey: .hierarchy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(media, forKey: .media) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(marketplaces, forKey: .marketplaces) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(synonyms, forKey: .synonyms) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(departments, forKey: .departments) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(tryouts, forKey: .tryouts) + + try? container.encodeIfPresent(level, forKey: .level) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(hierarchy, forKey: .hierarchy) + } + } + + /* + Model: CategoryResponse + Used By: Catalog + */ + + class CategoryResponse: Codable { + public var page: Page? + + public var items: [Category]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [Category]?, page: Page?) { + self.page = page + + self.items = items + } + + public func duplicate() -> CategoryResponse { + let dict = self.dictionary! + let copy = CategoryResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([Category].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: CategoryRequestBody + Used By: Catalog + */ + + class CategoryRequestBody: Codable { + public var media: Media2? + + public var priority: Int? + + public var marketplaces: CategoryMapping? + + public var isActive: Bool + + public var synonyms: [String]? + + public var departments: [Int] + + public var slug: String? + + public var tryouts: [String]? + + public var level: Int + + public var name: String + + public var hierarchy: [Hierarchy]? + + public enum CodingKeys: String, CodingKey { + case media + + case priority + + case marketplaces + + case isActive = "is_active" + + case synonyms + + case departments + + case slug + + case tryouts + + case level + + case name + + case hierarchy + } + + public init(departments: [Int], hierarchy: [Hierarchy]?, isActive: Bool, level: Int, marketplaces: CategoryMapping?, media: Media2?, name: String, priority: Int?, slug: String?, synonyms: [String]?, tryouts: [String]?) { + self.media = media + + self.priority = priority + + self.marketplaces = marketplaces + + self.isActive = isActive + + self.synonyms = synonyms + + self.departments = departments + + self.slug = slug + + self.tryouts = tryouts + + self.level = level + + self.name = name + + self.hierarchy = hierarchy + } + + public func duplicate() -> CategoryRequestBody { + let dict = self.dictionary! + let copy = CategoryRequestBody(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + media = try container.decode(Media2.self, forKey: .media) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(Int.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + marketplaces = try container.decode(CategoryMapping.self, forKey: .marketplaces) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + isActive = try container.decode(Bool.self, forKey: .isActive) + + do { + synonyms = try container.decode([String].self, forKey: .synonyms) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + departments = try container.decode([Int].self, forKey: .departments) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tryouts = try container.decode([String].self, forKey: .tryouts) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + level = try container.decode(Int.self, forKey: .level) + + name = try container.decode(String.self, forKey: .name) + + do { + hierarchy = try container.decode([Hierarchy].self, forKey: .hierarchy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(media, forKey: .media) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(marketplaces, forKey: .marketplaces) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(synonyms, forKey: .synonyms) + + try? container.encodeIfPresent(departments, forKey: .departments) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(tryouts, forKey: .tryouts) + + try? container.encodeIfPresent(level, forKey: .level) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(hierarchy, forKey: .hierarchy) + } + } + + /* + Model: CategoryCreateResponse + Used By: Catalog + */ + + class CategoryCreateResponse: Codable { + public var message: String? + + public var uid: Int? + + public enum CodingKeys: String, CodingKey { + case message + + case uid + } + + public init(message: String?, uid: Int?) { + self.message = message + + self.uid = uid + } + + public func duplicate() -> CategoryCreateResponse { + let dict = self.dictionary! + let copy = CategoryCreateResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(uid, forKey: .uid) + } + } + + /* + Model: SingleCategoryResponse + Used By: Catalog + */ + + class SingleCategoryResponse: Codable { + public var data: Category? + + public enum CodingKeys: String, CodingKey { + case data + } + + public init(data: Category?) { + self.data = data + } + + public func duplicate() -> SingleCategoryResponse { + let dict = self.dictionary! + let copy = SingleCategoryResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode(Category.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: CategoryUpdateResponse + Used By: Catalog + */ + + class CategoryUpdateResponse: Codable { + public var message: String? + + public var success: Bool? + + public enum CodingKeys: String, CodingKey { + case message + + case success + } + + public init(message: String?, success: Bool?) { + self.message = message + + self.success = success + } + + public func duplicate() -> CategoryUpdateResponse { + let dict = self.dictionary! + let copy = CategoryUpdateResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: Image + Used By: Catalog + */ + + class Image: Codable { + public var aspectRatioF: Double? + + public var aspectRatio: String? + + public var url: String? + + public var secureUrl: String? + + public enum CodingKeys: String, CodingKey { + case aspectRatioF = "aspect_ratio_f" + + case aspectRatio = "aspect_ratio" + + case url + + case secureUrl = "secure_url" + } + + public init(aspectRatio: String?, aspectRatioF: Double?, secureUrl: String?, url: String?) { + self.aspectRatioF = aspectRatioF + + self.aspectRatio = aspectRatio + + self.url = url + + self.secureUrl = secureUrl + } + + public func duplicate() -> Image { + let dict = self.dictionary! + let copy = Image(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + aspectRatioF = try container.decode(Double.self, forKey: .aspectRatioF) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + aspectRatio = try container.decode(String.self, forKey: .aspectRatio) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + secureUrl = try container.decode(String.self, forKey: .secureUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(aspectRatioF, forKey: .aspectRatioF) + + try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) + } + } + + /* + Model: Logo + Used By: Catalog + */ + + class Logo: Codable { + public var aspectRatioF: Int? + + public var aspectRatio: String? + + public var url: String? + + public var secureUrl: String? + + public enum CodingKeys: String, CodingKey { + case aspectRatioF = "aspect_ratio_f" + + case aspectRatio = "aspect_ratio" + + case url + + case secureUrl = "secure_url" + } + + public init(aspectRatio: String?, aspectRatioF: Int?, secureUrl: String?, url: String?) { + self.aspectRatioF = aspectRatioF + + self.aspectRatio = aspectRatio + + self.url = url + + self.secureUrl = secureUrl + } + + public func duplicate() -> Logo { + let dict = self.dictionary! + let copy = Logo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + aspectRatioF = try container.decode(Int.self, forKey: .aspectRatioF) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + aspectRatio = try container.decode(String.self, forKey: .aspectRatio) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + secureUrl = try container.decode(String.self, forKey: .secureUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(aspectRatioF, forKey: .aspectRatioF) + + try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) + } + } + + /* + Model: Brand + Used By: Catalog + */ + + class Brand: Codable { + public var logo: Logo? + + public var name: String? + + public var uid: Int? + + public enum CodingKeys: String, CodingKey { + case logo + + case name + + case uid + } + + public init(logo: Logo?, name: String?, uid: Int?) { + self.logo = logo + + self.name = name + + self.uid = uid + } + + public func duplicate() -> Brand { + let dict = self.dictionary! + let copy = Brand(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + logo = try container.decode(Logo.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(uid, forKey: .uid) + } + } + + /* + Model: ProductPublished + Used By: Catalog + */ + + class ProductPublished: Codable { + public var isSet: Bool? + + public var productOnlineDate: Int? + + public enum CodingKeys: String, CodingKey { + case isSet = "is_set" + + case productOnlineDate = "product_online_date" + } + + public init(isSet: Bool?, productOnlineDate: Int?) { + self.isSet = isSet + + self.productOnlineDate = productOnlineDate + } + + public func duplicate() -> ProductPublished { + let dict = self.dictionary! + let copy = ProductPublished(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isSet = try container.decode(Bool.self, forKey: .isSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productOnlineDate = try container.decode(Int.self, forKey: .productOnlineDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isSet, forKey: .isSet) + + try? container.encodeIfPresent(productOnlineDate, forKey: .productOnlineDate) + } + } + + /* + Model: Product + Used By: Catalog + */ + + class Product: Codable { + public var highlights: [String]? + + public var isDependent: Bool? + + public var slug: String? + + public var departments: [Int]? + + public var variants: [String: Any]? + + public var moq: [String: Any]? + + public var sizeGuide: String? + + public var media: [Media1]? + + public var primaryColor: String? + + public var isActive: Bool? + + public var isPhysical: Bool? + + public var id: String? + + public var images: [Image]? + + public var color: String? + + public var itemType: String? + + public var brand: Brand? + + public var isSet: Bool? + + public var hsnCode: String? + + public var sizes: [[String: Any]]? + + public var allSizes: [[String: Any]]? + + public var categorySlug: String? + + public var multiSize: Bool? + + public var customOrder: [String: Any]? + + public var categoryUid: Int? + + public var brandUid: Int? + + public var imageNature: String? + + public var productPublish: ProductPublished? + + public var description: String? + + public var uid: Int? + + public var currency: String? + + public var templateTag: String? + + public var l3Mapping: [String]? + + public var countryOfOrigin: String? + + public var itemCode: String? + + public var customJson: [String: Any]? + + public var name: String? + + public var shortDescription: String? + + public enum CodingKeys: String, CodingKey { + case highlights + + case isDependent = "is_dependent" + + case slug + + case departments + + case variants + + case moq + + case sizeGuide = "size_guide" + + case media + + case primaryColor = "primary_color" + + case isActive = "is_active" + + case isPhysical = "is_physical" + + case id + + case images + + case color + + case itemType = "item_type" + + case brand + + case isSet = "is_set" + + case hsnCode = "hsn_code" + + case sizes + + case allSizes = "all_sizes" + + case categorySlug = "category_slug" + + case multiSize = "multi_size" + + case customOrder = "custom_order" + + case categoryUid = "category_uid" + + case brandUid = "brand_uid" + + case imageNature = "image_nature" + + case productPublish = "product_publish" + + case description + + case uid + + case currency + + case templateTag = "template_tag" + + case l3Mapping = "l3_mapping" + + case countryOfOrigin = "country_of_origin" + + case itemCode = "item_code" + + case customJson = "_custom_json" + + case name + + case shortDescription = "short_description" + } + + public init(allSizes: [[String: Any]]?, brand: Brand?, brandUid: Int?, categorySlug: String?, categoryUid: Int?, color: String?, countryOfOrigin: String?, currency: String?, customOrder: [String: Any]?, departments: [Int]?, description: String?, highlights: [String]?, hsnCode: String?, id: String?, images: [Image]?, imageNature: String?, isActive: Bool?, isDependent: Bool?, isPhysical: Bool?, isSet: Bool?, itemCode: String?, itemType: String?, l3Mapping: [String]?, media: [Media1]?, moq: [String: Any]?, multiSize: Bool?, name: String?, primaryColor: String?, productPublish: ProductPublished?, shortDescription: String?, sizes: [[String: Any]]?, sizeGuide: String?, slug: String?, templateTag: String?, uid: Int?, variants: [String: Any]?, customJson: [String: Any]?) { + self.highlights = highlights + + self.isDependent = isDependent + + self.slug = slug + + self.departments = departments + + self.variants = variants + + self.moq = moq + + self.sizeGuide = sizeGuide + + self.media = media + + self.primaryColor = primaryColor + + self.isActive = isActive + + self.isPhysical = isPhysical + + self.id = id + + self.images = images + + self.color = color + + self.itemType = itemType + + self.brand = brand + + self.isSet = isSet + + self.hsnCode = hsnCode + + self.sizes = sizes + + self.allSizes = allSizes + + self.categorySlug = categorySlug + + self.multiSize = multiSize + + self.customOrder = customOrder + + self.categoryUid = categoryUid + + self.brandUid = brandUid + + self.imageNature = imageNature + + self.productPublish = productPublish + + self.description = description + + self.uid = uid + + self.currency = currency + + self.templateTag = templateTag + + self.l3Mapping = l3Mapping + + self.countryOfOrigin = countryOfOrigin + + self.itemCode = itemCode + + self.customJson = customJson + + self.name = name + + self.shortDescription = shortDescription + } + + public func duplicate() -> Product { + let dict = self.dictionary! + let copy = Product(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + highlights = try container.decode([String].self, forKey: .highlights) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isDependent = try container.decode(Bool.self, forKey: .isDependent) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + departments = try container.decode([Int].self, forKey: .departments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + variants = try container.decode([String: Any].self, forKey: .variants) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + moq = try container.decode([String: Any].self, forKey: .moq) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sizeGuide = try container.decode(String.self, forKey: .sizeGuide) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + media = try container.decode([Media1].self, forKey: .media) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + primaryColor = try container.decode(String.self, forKey: .primaryColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isPhysical = try container.decode(Bool.self, forKey: .isPhysical) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + images = try container.decode([Image].self, forKey: .images) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + color = try container.decode(String.self, forKey: .color) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemType = try container.decode(String.self, forKey: .itemType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brand = try container.decode(Brand.self, forKey: .brand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isSet = try container.decode(Bool.self, forKey: .isSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hsnCode = try container.decode(String.self, forKey: .hsnCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sizes = try container.decode([[String: Any]].self, forKey: .sizes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allSizes = try container.decode([[String: Any]].self, forKey: .allSizes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + categorySlug = try container.decode(String.self, forKey: .categorySlug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + multiSize = try container.decode(Bool.self, forKey: .multiSize) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customOrder = try container.decode([String: Any].self, forKey: .customOrder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + categoryUid = try container.decode(Int.self, forKey: .categoryUid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandUid = try container.decode(Int.self, forKey: .brandUid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + imageNature = try container.decode(String.self, forKey: .imageNature) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productPublish = try container.decode(ProductPublished.self, forKey: .productPublish) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + templateTag = try container.decode(String.self, forKey: .templateTag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + l3Mapping = try container.decode([String].self, forKey: .l3Mapping) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryOfOrigin = try container.decode(String.self, forKey: .countryOfOrigin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemCode = try container.decode(String.self, forKey: .itemCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shortDescription = try container.decode(String.self, forKey: .shortDescription) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(highlights, forKey: .highlights) + + try? container.encodeIfPresent(isDependent, forKey: .isDependent) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(departments, forKey: .departments) + + try? container.encodeIfPresent(variants, forKey: .variants) + + try? container.encodeIfPresent(moq, forKey: .moq) + + try? container.encodeIfPresent(sizeGuide, forKey: .sizeGuide) + + try? container.encodeIfPresent(media, forKey: .media) + + try? container.encodeIfPresent(primaryColor, forKey: .primaryColor) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(isPhysical, forKey: .isPhysical) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(images, forKey: .images) + + try? container.encodeIfPresent(color, forKey: .color) + + try? container.encodeIfPresent(itemType, forKey: .itemType) + + try? container.encodeIfPresent(brand, forKey: .brand) + + try? container.encodeIfPresent(isSet, forKey: .isSet) + + try? container.encodeIfPresent(hsnCode, forKey: .hsnCode) + + try? container.encodeIfPresent(sizes, forKey: .sizes) + + try? container.encodeIfPresent(allSizes, forKey: .allSizes) + + try? container.encodeIfPresent(categorySlug, forKey: .categorySlug) + + try? container.encodeIfPresent(multiSize, forKey: .multiSize) + + try? container.encodeIfPresent(customOrder, forKey: .customOrder) + + try? container.encodeIfPresent(categoryUid, forKey: .categoryUid) + + try? container.encodeIfPresent(brandUid, forKey: .brandUid) + + try? container.encodeIfPresent(imageNature, forKey: .imageNature) + + try? container.encodeIfPresent(productPublish, forKey: .productPublish) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(templateTag, forKey: .templateTag) + + try? container.encodeIfPresent(l3Mapping, forKey: .l3Mapping) + + try? container.encodeIfPresent(countryOfOrigin, forKey: .countryOfOrigin) + + try? container.encodeIfPresent(itemCode, forKey: .itemCode) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(shortDescription, forKey: .shortDescription) + } + } + + /* + Model: ProductListingResponse + Used By: Catalog + */ + + class ProductListingResponse: Codable { + public var page: Page? + + public var items: [Product]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [Product]?, page: Page?) { + self.page = page + + self.items = items + } + + public func duplicate() -> ProductListingResponse { + let dict = self.dictionary! + let copy = ProductListingResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([Product].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: OrderQuantity + Used By: Catalog + */ + + class OrderQuantity: Codable { + public var isSet: Bool? + + public var maximum: Int? + + public var minimum: Int? + + public enum CodingKeys: String, CodingKey { + case isSet = "is_set" + + case maximum + + case minimum + } + + public init(isSet: Bool?, maximum: Int?, minimum: Int?) { + self.isSet = isSet + + self.maximum = maximum + + self.minimum = minimum + } + + public func duplicate() -> OrderQuantity { + let dict = self.dictionary! + let copy = OrderQuantity(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isSet = try container.decode(Bool.self, forKey: .isSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + maximum = try container.decode(Int.self, forKey: .maximum) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + minimum = try container.decode(Int.self, forKey: .minimum) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isSet, forKey: .isSet) + + try? container.encodeIfPresent(maximum, forKey: .maximum) + + try? container.encodeIfPresent(minimum, forKey: .minimum) + } + } + + /* + Model: ReturnConfig + Used By: Catalog + */ + + class ReturnConfig: Codable { + public var time: Int + + public var unit: String + + public var returnable: Bool + + public enum CodingKeys: String, CodingKey { + case time + + case unit + + case returnable + } + + public init(returnable: Bool, time: Int, unit: String) { + self.time = time + + self.unit = unit + + self.returnable = returnable + } + + public func duplicate() -> ReturnConfig { + let dict = self.dictionary! + let copy = ReturnConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + time = try container.decode(Int.self, forKey: .time) + + unit = try container.decode(String.self, forKey: .unit) + + returnable = try container.decode(Bool.self, forKey: .returnable) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(time, forKey: .time) + + try? container.encodeIfPresent(unit, forKey: .unit) + + try? container.encodeIfPresent(returnable, forKey: .returnable) + } + } + + /* + Model: TeaserTag + Used By: Catalog + */ + + class TeaserTag: Codable { + public var tag: String? + + public var url: String? + + public enum CodingKeys: String, CodingKey { + case tag + + case url + } + + public init(tag: String?, url: String?) { + self.tag = tag + + self.url = url + } + + public func duplicate() -> TeaserTag { + let dict = self.dictionary! + let copy = TeaserTag(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + tag = try container.decode(String.self, forKey: .tag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(tag, forKey: .tag) + + try? container.encode(url, forKey: .url) + } + } + + /* + Model: CustomOrder + Used By: Catalog + */ + + class CustomOrder: Codable { + public var isCustomOrder: Bool? + + public var manufacturingTimeUnit: String? + + public var manufacturingTime: Int? + + public enum CodingKeys: String, CodingKey { + case isCustomOrder = "is_custom_order" + + case manufacturingTimeUnit = "manufacturing_time_unit" + + case manufacturingTime = "manufacturing_time" + } + + public init(isCustomOrder: Bool?, manufacturingTime: Int?, manufacturingTimeUnit: String?) { + self.isCustomOrder = isCustomOrder + + self.manufacturingTimeUnit = manufacturingTimeUnit + + self.manufacturingTime = manufacturingTime + } + + public func duplicate() -> CustomOrder { + let dict = self.dictionary! + let copy = CustomOrder(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isCustomOrder = try container.decode(Bool.self, forKey: .isCustomOrder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + manufacturingTimeUnit = try container.decode(String.self, forKey: .manufacturingTimeUnit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + manufacturingTime = try container.decode(Int.self, forKey: .manufacturingTime) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isCustomOrder, forKey: .isCustomOrder) + + try? container.encodeIfPresent(manufacturingTimeUnit, forKey: .manufacturingTimeUnit) + + try? container.encodeIfPresent(manufacturingTime, forKey: .manufacturingTime) + } + } + + /* + Model: Trader + Used By: Catalog + */ + + class Trader: Codable { + public var address: [String]? + + public var type: String? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case address + + case type + + case name + } + + public init(address: [String]?, name: String?, type: String?) { + self.address = address + + self.type = type + + self.name = name + } + + public func duplicate() -> Trader { + let dict = self.dictionary! + let copy = Trader(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + address = try container.decode([String].self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: ProductPublish + Used By: Catalog + */ + + class ProductPublish: Codable { + public var isSet: Bool? + + public var productOnlineDate: String? + + public enum CodingKeys: String, CodingKey { + case isSet = "is_set" + + case productOnlineDate = "product_online_date" + } + + public init(isSet: Bool?, productOnlineDate: String?) { + self.isSet = isSet + + self.productOnlineDate = productOnlineDate + } + + public func duplicate() -> ProductPublish { + let dict = self.dictionary! + let copy = ProductPublish(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isSet = try container.decode(Bool.self, forKey: .isSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productOnlineDate = try container.decode(String.self, forKey: .productOnlineDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isSet, forKey: .isSet) + + try? container.encodeIfPresent(productOnlineDate, forKey: .productOnlineDate) + } + } + + /* + Model: ProductCreateUpdate + Used By: Catalog + */ + + class ProductCreateUpdate: Codable { + public var highlights: [String]? + + public var isDependent: Bool? + + public var noOfBoxes: Int? + + public var slug: String + + public var departments: [Int] + + public var variants: [String: Any]? + + public var moq: OrderQuantity? + + public var tags: [String]? + + public var sizeGuide: String? + + public var media: [Media1]? + + public var isActive: Bool? + + public var bulkJobId: String? + + public var requester: String? + + public var isImageLessProduct: Bool? + + public var action: String? + + public var itemType: String + + public var returnConfig: ReturnConfig + + public var isSet: Bool? + + public var teaserTag: TeaserTag? + + public var hsnCode: String + + public var categorySlug: String + + public var multiSize: Bool? + + public var customOrder: CustomOrder? + + public var companyId: Int + + public var trader: [Trader] + + public var brandUid: Int + + public var productPublish: ProductPublish? + + public var description: String? + + public var uid: Int? + + public var productGroupTag: [String]? + + public var currency: String + + public var templateTag: String + + public var countryOfOrigin: String + + public var itemCode: String + + public var changeRequestId: String? + + public var customJson: [String: Any]? + + public var name: String + + public var shortDescription: String? + + public enum CodingKeys: String, CodingKey { + case highlights + + case isDependent = "is_dependent" + + case noOfBoxes = "no_of_boxes" + + case slug + + case departments + + case variants + + case moq + + case tags + + case sizeGuide = "size_guide" + + case media + + case isActive = "is_active" + + case bulkJobId = "bulk_job_id" + + case requester + + case isImageLessProduct = "is_image_less_product" + + case action + + case itemType = "item_type" + + case returnConfig = "return_config" + + case isSet = "is_set" + + case teaserTag = "teaser_tag" + + case hsnCode = "hsn_code" + + case categorySlug = "category_slug" + + case multiSize = "multi_size" + + case customOrder = "custom_order" + + case companyId = "company_id" + + case trader + + case brandUid = "brand_uid" + + case productPublish = "product_publish" + + case description + + case uid + + case productGroupTag = "product_group_tag" + + case currency + + case templateTag = "template_tag" + + case countryOfOrigin = "country_of_origin" + + case itemCode = "item_code" + + case changeRequestId = "change_request_id" + + case customJson = "_custom_json" + + case name + + case shortDescription = "short_description" + } + + public init(action: String?, brandUid: Int, bulkJobId: String?, categorySlug: String, changeRequestId: String?, companyId: Int, countryOfOrigin: String, currency: String, customOrder: CustomOrder?, departments: [Int], description: String?, highlights: [String]?, hsnCode: String, isActive: Bool?, isDependent: Bool?, isImageLessProduct: Bool?, isSet: Bool?, itemCode: String, itemType: String, media: [Media1]?, moq: OrderQuantity?, multiSize: Bool?, name: String, noOfBoxes: Int?, productGroupTag: [String]?, productPublish: ProductPublish?, requester: String?, returnConfig: ReturnConfig, shortDescription: String?, sizeGuide: String?, slug: String, tags: [String]?, teaserTag: TeaserTag?, templateTag: String, trader: [Trader], uid: Int?, variants: [String: Any]?, customJson: [String: Any]?) { + self.highlights = highlights + + self.isDependent = isDependent + + self.noOfBoxes = noOfBoxes + + self.slug = slug + + self.departments = departments + + self.variants = variants + + self.moq = moq + + self.tags = tags + + self.sizeGuide = sizeGuide + + self.media = media + + self.isActive = isActive + + self.bulkJobId = bulkJobId + + self.requester = requester + + self.isImageLessProduct = isImageLessProduct + + self.action = action + + self.itemType = itemType + + self.returnConfig = returnConfig + + self.isSet = isSet + + self.teaserTag = teaserTag + + self.hsnCode = hsnCode + + self.categorySlug = categorySlug + + self.multiSize = multiSize + + self.customOrder = customOrder + + self.companyId = companyId + + self.trader = trader + + self.brandUid = brandUid + + self.productPublish = productPublish + + self.description = description + + self.uid = uid + + self.productGroupTag = productGroupTag + + self.currency = currency + + self.templateTag = templateTag + + self.countryOfOrigin = countryOfOrigin + + self.itemCode = itemCode + + self.changeRequestId = changeRequestId + + self.customJson = customJson + + self.name = name + + self.shortDescription = shortDescription + } + + public func duplicate() -> ProductCreateUpdate { + let dict = self.dictionary! + let copy = ProductCreateUpdate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + highlights = try container.decode([String].self, forKey: .highlights) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isDependent = try container.decode(Bool.self, forKey: .isDependent) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + noOfBoxes = try container.decode(Int.self, forKey: .noOfBoxes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + slug = try container.decode(String.self, forKey: .slug) + + departments = try container.decode([Int].self, forKey: .departments) + + do { + variants = try container.decode([String: Any].self, forKey: .variants) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + moq = try container.decode(OrderQuantity.self, forKey: .moq) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sizeGuide = try container.decode(String.self, forKey: .sizeGuide) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + media = try container.decode([Media1].self, forKey: .media) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bulkJobId = try container.decode(String.self, forKey: .bulkJobId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requester = try container.decode(String.self, forKey: .requester) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isImageLessProduct = try container.decode(Bool.self, forKey: .isImageLessProduct) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(String.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + itemType = try container.decode(String.self, forKey: .itemType) + + returnConfig = try container.decode(ReturnConfig.self, forKey: .returnConfig) + + do { + isSet = try container.decode(Bool.self, forKey: .isSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + teaserTag = try container.decode(TeaserTag.self, forKey: .teaserTag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + hsnCode = try container.decode(String.self, forKey: .hsnCode) + + categorySlug = try container.decode(String.self, forKey: .categorySlug) + + do { + multiSize = try container.decode(Bool.self, forKey: .multiSize) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customOrder = try container.decode(CustomOrder.self, forKey: .customOrder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + companyId = try container.decode(Int.self, forKey: .companyId) + + trader = try container.decode([Trader].self, forKey: .trader) + + brandUid = try container.decode(Int.self, forKey: .brandUid) + + do { + productPublish = try container.decode(ProductPublish.self, forKey: .productPublish) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productGroupTag = try container.decode([String].self, forKey: .productGroupTag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + currency = try container.decode(String.self, forKey: .currency) + + templateTag = try container.decode(String.self, forKey: .templateTag) + + countryOfOrigin = try container.decode(String.self, forKey: .countryOfOrigin) + + itemCode = try container.decode(String.self, forKey: .itemCode) + + do { + changeRequestId = try container.decode(String.self, forKey: .changeRequestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + name = try container.decode(String.self, forKey: .name) + + do { + shortDescription = try container.decode(String.self, forKey: .shortDescription) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(highlights, forKey: .highlights) + + try? container.encodeIfPresent(isDependent, forKey: .isDependent) + + try? container.encodeIfPresent(noOfBoxes, forKey: .noOfBoxes) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(departments, forKey: .departments) + + try? container.encodeIfPresent(variants, forKey: .variants) + + try? container.encodeIfPresent(moq, forKey: .moq) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(sizeGuide, forKey: .sizeGuide) + + try? container.encode(media, forKey: .media) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(bulkJobId, forKey: .bulkJobId) + + try? container.encodeIfPresent(requester, forKey: .requester) + + try? container.encodeIfPresent(isImageLessProduct, forKey: .isImageLessProduct) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(itemType, forKey: .itemType) + + try? container.encodeIfPresent(returnConfig, forKey: .returnConfig) + + try? container.encodeIfPresent(isSet, forKey: .isSet) + + try? container.encodeIfPresent(teaserTag, forKey: .teaserTag) + + try? container.encodeIfPresent(hsnCode, forKey: .hsnCode) + + try? container.encodeIfPresent(categorySlug, forKey: .categorySlug) + + try? container.encodeIfPresent(multiSize, forKey: .multiSize) + + try? container.encodeIfPresent(customOrder, forKey: .customOrder) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(trader, forKey: .trader) + + try? container.encodeIfPresent(brandUid, forKey: .brandUid) + + try? container.encodeIfPresent(productPublish, forKey: .productPublish) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encode(uid, forKey: .uid) + + try? container.encodeIfPresent(productGroupTag, forKey: .productGroupTag) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(templateTag, forKey: .templateTag) + + try? container.encodeIfPresent(countryOfOrigin, forKey: .countryOfOrigin) + + try? container.encodeIfPresent(itemCode, forKey: .itemCode) + + try? container.encode(changeRequestId, forKey: .changeRequestId) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(shortDescription, forKey: .shortDescription) + } + } + + /* + Model: ValidateProduct + Used By: Catalog + */ + + class ValidateProduct: Codable { + public var valid: Bool? + + public enum CodingKeys: String, CodingKey { + case valid + } + + public init(valid: Bool?) { + self.valid = valid + } + + public func duplicate() -> ValidateProduct { + let dict = self.dictionary! + let copy = ValidateProduct(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + valid = try container.decode(Bool.self, forKey: .valid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(valid, forKey: .valid) + } + } + + /* + Model: UserDetail + Used By: Catalog + */ + + class UserDetail: Codable { + public var userId: String? + + public var username: String? + + public var fullName: String? + + public enum CodingKeys: String, CodingKey { + case userId = "user_id" + + case username + + case fullName = "full_name" + } + + public init(fullName: String?, username: String?, userId: String?) { + self.userId = userId + + self.username = username + + self.fullName = fullName + } + + public func duplicate() -> UserDetail { + let dict = self.dictionary! + let copy = UserDetail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fullName = try container.decode(String.self, forKey: .fullName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(userId, forKey: .userId) + + try? container.encodeIfPresent(username, forKey: .username) + + try? container.encodeIfPresent(fullName, forKey: .fullName) + } + } + + /* + Model: ProductBulkRequest + Used By: Catalog + */ + + class ProductBulkRequest: Codable { + public var total: Int? + + public var isActive: Bool? + + public var modifiedOn: String? + + public var templateTag: String? + + public var template: ProductTemplate? + + public var cancelledRecords: [String]? + + public var companyId: Int? + + public var filePath: String? + + public var createdBy: UserDetail? + + public var failedRecords: [String]? + + public var cancelled: Int? + + public var modifiedBy: UserDetail? + + public var createdOn: String? + + public var failed: Int? + + public var succeed: Int? + + public var stage: String? + + public enum CodingKeys: String, CodingKey { + case total + + case isActive = "is_active" + + case modifiedOn = "modified_on" + + case templateTag = "template_tag" + + case template + + case cancelledRecords = "cancelled_records" + + case companyId = "company_id" + + case filePath = "file_path" + + case createdBy = "created_by" + + case failedRecords = "failed_records" + + case cancelled + + case modifiedBy = "modified_by" + + case createdOn = "created_on" + + case failed + + case succeed + + case stage + } + + public init(cancelled: Int?, cancelledRecords: [String]?, companyId: Int?, createdBy: UserDetail?, createdOn: String?, failed: Int?, failedRecords: [String]?, filePath: String?, isActive: Bool?, modifiedBy: UserDetail?, modifiedOn: String?, stage: String?, succeed: Int?, template: ProductTemplate?, templateTag: String?, total: Int?) { + self.total = total + + self.isActive = isActive + + self.modifiedOn = modifiedOn + + self.templateTag = templateTag + + self.template = template + + self.cancelledRecords = cancelledRecords + + self.companyId = companyId + + self.filePath = filePath + + self.createdBy = createdBy + + self.failedRecords = failedRecords + + self.cancelled = cancelled + + self.modifiedBy = modifiedBy + + self.createdOn = createdOn + + self.failed = failed + + self.succeed = succeed + + self.stage = stage + } + + public func duplicate() -> ProductBulkRequest { + let dict = self.dictionary! + let copy = ProductBulkRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + total = try container.decode(Int.self, forKey: .total) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + templateTag = try container.decode(String.self, forKey: .templateTag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + template = try container.decode(ProductTemplate.self, forKey: .template) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cancelledRecords = try container.decode([String].self, forKey: .cancelledRecords) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filePath = try container.decode(String.self, forKey: .filePath) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(UserDetail.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + failedRecords = try container.decode([String].self, forKey: .failedRecords) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cancelled = try container.decode(Int.self, forKey: .cancelled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode(UserDetail.self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + failed = try container.decode(Int.self, forKey: .failed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + succeed = try container.decode(Int.self, forKey: .succeed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stage = try container.decode(String.self, forKey: .stage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(total, forKey: .total) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(templateTag, forKey: .templateTag) + + try? container.encodeIfPresent(template, forKey: .template) + + try? container.encodeIfPresent(cancelledRecords, forKey: .cancelledRecords) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(filePath, forKey: .filePath) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(failedRecords, forKey: .failedRecords) + + try? container.encodeIfPresent(cancelled, forKey: .cancelled) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(failed, forKey: .failed) + + try? container.encodeIfPresent(succeed, forKey: .succeed) + + try? container.encodeIfPresent(stage, forKey: .stage) + } + } + + /* + Model: ProductBulkRequestList + Used By: Catalog + */ + + class ProductBulkRequestList: Codable { + public var page: Page? + + public var items: ProductBulkRequest? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: ProductBulkRequest?, page: Page?) { + self.page = page + + self.items = items + } + + public func duplicate() -> ProductBulkRequestList { + let dict = self.dictionary! + let copy = ProductBulkRequestList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode(ProductBulkRequest.self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: UserInfo1 + Used By: Catalog + */ + + class UserInfo1: Codable { + public var email: String? + + public var userId: String? + + public var uid: String? + + public var username: String? + + public enum CodingKeys: String, CodingKey { + case email + + case userId = "user_id" + + case uid + + case username + } + + public init(email: String?, uid: String?, username: String?, userId: String?) { + self.email = email + + self.userId = userId + + self.uid = uid + + self.username = username + } + + public func duplicate() -> UserInfo1 { + let dict = self.dictionary! + let copy = UserInfo1(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(userId, forKey: .userId) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(username, forKey: .username) + } + } + + /* + Model: BulkJob + Used By: Catalog + */ + + class BulkJob: Codable { + public var total: Int + + public var modifiedOn: String? + + public var isActive: Bool? + + public var templateTag: String? + + public var customTemplateTag: String? + + public var trackingUrl: String? + + public var companyId: Int + + public var cancelledRecords: [[String: Any]]? + + public var filePath: String? + + public var createdBy: UserInfo1? + + public var cancelled: Int? + + public var modifiedBy: UserInfo1? + + public var failedRecords: [[String: Any]]? + + public var createdOn: String + + public var failed: Int? + + public var succeed: Int? + + public var stage: String? + + public enum CodingKeys: String, CodingKey { + case total + + case modifiedOn = "modified_on" + + case isActive = "is_active" + + case templateTag = "template_tag" + + case customTemplateTag = "custom_template_tag" + + case trackingUrl = "tracking_url" + + case companyId = "company_id" + + case cancelledRecords = "cancelled_records" + + case filePath = "file_path" + + case createdBy = "created_by" + + case cancelled + + case modifiedBy = "modified_by" + + case failedRecords = "failed_records" + + case createdOn = "created_on" + + case failed + + case succeed + + case stage + } + + public init(cancelled: Int?, cancelledRecords: [[String: Any]]?, companyId: Int, createdBy: UserInfo1?, createdOn: String, customTemplateTag: String?, failed: Int?, failedRecords: [[String: Any]]?, filePath: String?, isActive: Bool?, modifiedBy: UserInfo1?, modifiedOn: String?, stage: String?, succeed: Int?, templateTag: String?, total: Int, trackingUrl: String?) { + self.total = total + + self.modifiedOn = modifiedOn + + self.isActive = isActive + + self.templateTag = templateTag + + self.customTemplateTag = customTemplateTag + + self.trackingUrl = trackingUrl + + self.companyId = companyId + + self.cancelledRecords = cancelledRecords + + self.filePath = filePath + + self.createdBy = createdBy + + self.cancelled = cancelled + + self.modifiedBy = modifiedBy + + self.failedRecords = failedRecords + + self.createdOn = createdOn + + self.failed = failed + + self.succeed = succeed + + self.stage = stage + } + + public func duplicate() -> BulkJob { + let dict = self.dictionary! + let copy = BulkJob(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + total = try container.decode(Int.self, forKey: .total) + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + templateTag = try container.decode(String.self, forKey: .templateTag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customTemplateTag = try container.decode(String.self, forKey: .customTemplateTag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + trackingUrl = try container.decode(String.self, forKey: .trackingUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + companyId = try container.decode(Int.self, forKey: .companyId) + + do { + cancelledRecords = try container.decode([[String: Any]].self, forKey: .cancelledRecords) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filePath = try container.decode(String.self, forKey: .filePath) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(UserInfo1.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cancelled = try container.decode(Int.self, forKey: .cancelled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode(UserInfo1.self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + failedRecords = try container.decode([[String: Any]].self, forKey: .failedRecords) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + createdOn = try container.decode(String.self, forKey: .createdOn) + + do { + failed = try container.decode(Int.self, forKey: .failed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + succeed = try container.decode(Int.self, forKey: .succeed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stage = try container.decode(String.self, forKey: .stage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(total, forKey: .total) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(templateTag, forKey: .templateTag) + + try? container.encodeIfPresent(customTemplateTag, forKey: .customTemplateTag) + + try? container.encodeIfPresent(trackingUrl, forKey: .trackingUrl) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(cancelledRecords, forKey: .cancelledRecords) + + try? container.encodeIfPresent(filePath, forKey: .filePath) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(cancelled, forKey: .cancelled) + + try? container.encode(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(failedRecords, forKey: .failedRecords) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(failed, forKey: .failed) + + try? container.encodeIfPresent(succeed, forKey: .succeed) + + try? container.encodeIfPresent(stage, forKey: .stage) + } + } + + /* + Model: BulkProductRequest + Used By: Catalog + */ + + class BulkProductRequest: Codable { + public var batchId: String + + public var templateTag: String + + public var data: [[String: Any]] + + public var companyId: Int + + public enum CodingKeys: String, CodingKey { + case batchId = "batch_id" + + case templateTag = "template_tag" + + case data + + case companyId = "company_id" + } + + public init(batchId: String, companyId: Int, data: [[String: Any]], templateTag: String) { + self.batchId = batchId + + self.templateTag = templateTag + + self.data = data + + self.companyId = companyId + } + + public func duplicate() -> BulkProductRequest { + let dict = self.dictionary! + let copy = BulkProductRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + batchId = try container.decode(String.self, forKey: .batchId) + + templateTag = try container.decode(String.self, forKey: .templateTag) + + data = try container.decode([[String: Any]].self, forKey: .data) + + companyId = try container.decode(Int.self, forKey: .companyId) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(batchId, forKey: .batchId) + + try? container.encodeIfPresent(templateTag, forKey: .templateTag) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + } + } + + /* + Model: NestedTags + Used By: Catalog + */ + + class NestedTags: Codable { + public var tags: [String]? + + public enum CodingKeys: String, CodingKey { + case tags + } + + public init(tags: [String]?) { + self.tags = tags + } + + public func duplicate() -> NestedTags { + let dict = self.dictionary! + let copy = NestedTags(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: ProductTagsViewResponse + Used By: Catalog + */ + + class ProductTagsViewResponse: Codable { + public var items: NestedTags? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: NestedTags?) { + self.items = items + } + + public func duplicate() -> ProductTagsViewResponse { + let dict = self.dictionary! + let copy = ProductTagsViewResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode(NestedTags.self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: UserCommon + Used By: Catalog + */ + + class UserCommon: Codable { + public var userId: String? + + public var username: String? + + public var companyId: Int? + + public enum CodingKeys: String, CodingKey { + case userId = "user_id" + + case username + + case companyId = "company_id" + } + + public init(companyId: Int?, username: String?, userId: String?) { + self.userId = userId + + self.username = username + + self.companyId = companyId + } + + public func duplicate() -> UserCommon { + let dict = self.dictionary! + let copy = UserCommon(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(userId, forKey: .userId) + + try? container.encodeIfPresent(username, forKey: .username) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + } + } + + /* + Model: Items + Used By: Catalog + */ + + class Items: Codable { + public var total: Int? + + public var modifiedOn: String? + + public var isActive: Bool? + + public var id: String? + + public var trackingUrl: String? + + public var createdOn: String? + + public var filePath: String? + + public var cancelledRecords: [String]? + + public var companyId: Int? + + public var cancelled: Int? + + public var failedRecords: [String]? + + public var modifiedBy: UserCommon? + + public var createdBy: UserCommon? + + public var retry: Int? + + public var failed: Int? + + public var succeed: Int? + + public var stage: String? + + public enum CodingKeys: String, CodingKey { + case total + + case modifiedOn = "modified_on" + + case isActive = "is_active" + + case id + + case trackingUrl = "tracking_url" + + case createdOn = "created_on" + + case filePath = "file_path" + + case cancelledRecords = "cancelled_records" + + case companyId = "company_id" + + case cancelled + + case failedRecords = "failed_records" + + case modifiedBy = "modified_by" + + case createdBy = "created_by" + + case retry + + case failed + + case succeed + + case stage + } + + public init(cancelled: Int?, cancelledRecords: [String]?, companyId: Int?, createdBy: UserCommon?, createdOn: String?, failed: Int?, failedRecords: [String]?, filePath: String?, id: String?, isActive: Bool?, modifiedBy: UserCommon?, modifiedOn: String?, retry: Int?, stage: String?, succeed: Int?, total: Int?, trackingUrl: String?) { + self.total = total + + self.modifiedOn = modifiedOn + + self.isActive = isActive + + self.id = id + + self.trackingUrl = trackingUrl + + self.createdOn = createdOn + + self.filePath = filePath + + self.cancelledRecords = cancelledRecords + + self.companyId = companyId + + self.cancelled = cancelled + + self.failedRecords = failedRecords + + self.modifiedBy = modifiedBy + + self.createdBy = createdBy + + self.retry = retry + + self.failed = failed + + self.succeed = succeed + + self.stage = stage + } + + public func duplicate() -> Items { + let dict = self.dictionary! + let copy = Items(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + total = try container.decode(Int.self, forKey: .total) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + trackingUrl = try container.decode(String.self, forKey: .trackingUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filePath = try container.decode(String.self, forKey: .filePath) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cancelledRecords = try container.decode([String].self, forKey: .cancelledRecords) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cancelled = try container.decode(Int.self, forKey: .cancelled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + failedRecords = try container.decode([String].self, forKey: .failedRecords) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode(UserCommon.self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(UserCommon.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + retry = try container.decode(Int.self, forKey: .retry) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + failed = try container.decode(Int.self, forKey: .failed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + succeed = try container.decode(Int.self, forKey: .succeed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stage = try container.decode(String.self, forKey: .stage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(total, forKey: .total) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(trackingUrl, forKey: .trackingUrl) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(filePath, forKey: .filePath) + + try? container.encodeIfPresent(cancelledRecords, forKey: .cancelledRecords) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(cancelled, forKey: .cancelled) + + try? container.encodeIfPresent(failedRecords, forKey: .failedRecords) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(retry, forKey: .retry) + + try? container.encodeIfPresent(failed, forKey: .failed) + + try? container.encodeIfPresent(succeed, forKey: .succeed) + + try? container.encodeIfPresent(stage, forKey: .stage) + } + } + + /* + Model: BulkAssetResponse + Used By: Catalog + */ + + class BulkAssetResponse: Codable { + public var page: Page? + + public var items: [Items]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [Items]?, page: Page?) { + self.page = page + + self.items = items + } + + public func duplicate() -> BulkAssetResponse { + let dict = self.dictionary! + let copy = BulkAssetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([Items].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: ProductBulkAssets + Used By: Catalog + */ + + class ProductBulkAssets: Codable { + public var url: String + + public var user: [String: Any] + + public var companyId: Int? + + public enum CodingKeys: String, CodingKey { + case url + + case user + + case companyId = "company_id" + } + + public init(companyId: Int?, url: String, user: [String: Any]) { + self.url = url + + self.user = user + + self.companyId = companyId + } + + public func duplicate() -> ProductBulkAssets { + let dict = self.dictionary! + let copy = ProductBulkAssets(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + url = try container.decode(String.self, forKey: .url) + + user = try container.decode([String: Any].self, forKey: .user) + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + } + } + + /* + Model: ProductSizeDeleteDataResponse + Used By: Catalog + */ + + class ProductSizeDeleteDataResponse: Codable { + public var itemId: Int? + + public var size: String? + + public var companyId: Int? + + public enum CodingKeys: String, CodingKey { + case itemId = "item_id" + + case size + + case companyId = "company_id" + } + + public init(companyId: Int?, itemId: Int?, size: String?) { + self.itemId = itemId + + self.size = size + + self.companyId = companyId + } + + public func duplicate() -> ProductSizeDeleteDataResponse { + let dict = self.dictionary! + let copy = ProductSizeDeleteDataResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + itemId = try container.decode(Int.self, forKey: .itemId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(String.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(itemId, forKey: .itemId) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + } + } + + /* + Model: ProductSizeDeleteResponse + Used By: Catalog + */ + + class ProductSizeDeleteResponse: Codable { + public var success: Bool? + + public var data: ProductSizeDeleteDataResponse? + + public enum CodingKeys: String, CodingKey { + case success + + case data + } + + public init(data: ProductSizeDeleteDataResponse?, success: Bool?) { + self.success = success + + self.data = data + } + + public func duplicate() -> ProductSizeDeleteResponse { + let dict = self.dictionary! + let copy = ProductSizeDeleteResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode(ProductSizeDeleteDataResponse.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: InventoryResponse + Used By: Catalog + */ + + class InventoryResponse: Codable { + public var store: [String: Any]? + + public var identifiers: [String: Any]? + + public var uid: String? + + public var currency: String? + + public var itemId: Int? + + public var priceEffective: Int? + + public var price: Int? + + public var priceTransfer: Int? + + public var sellableQuantity: Int? + + public var inventoryUpdatedOn: String? + + public var size: String? + + public var sellerIdentifier: Int? + + public var quantity: Int? + + public enum CodingKeys: String, CodingKey { + case store + + case identifiers + + case uid + + case currency + + case itemId = "item_id" + + case priceEffective = "price_effective" + + case price + + case priceTransfer = "price_transfer" + + case sellableQuantity = "sellable_quantity" + + case inventoryUpdatedOn = "inventory_updated_on" + + case size + + case sellerIdentifier = "seller_identifier" + + case quantity + } + + public init(currency: String?, identifiers: [String: Any]?, inventoryUpdatedOn: String?, itemId: Int?, price: Int?, priceEffective: Int?, priceTransfer: Int?, quantity: Int?, sellableQuantity: Int?, sellerIdentifier: Int?, size: String?, store: [String: Any]?, uid: String?) { + self.store = store + + self.identifiers = identifiers + + self.uid = uid + + self.currency = currency + + self.itemId = itemId + + self.priceEffective = priceEffective + + self.price = price + + self.priceTransfer = priceTransfer + + self.sellableQuantity = sellableQuantity + + self.inventoryUpdatedOn = inventoryUpdatedOn + + self.size = size + + self.sellerIdentifier = sellerIdentifier + + self.quantity = quantity + } + + public func duplicate() -> InventoryResponse { + let dict = self.dictionary! + let copy = InventoryResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + store = try container.decode([String: Any].self, forKey: .store) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + identifiers = try container.decode([String: Any].self, forKey: .identifiers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemId = try container.decode(Int.self, forKey: .itemId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priceEffective = try container.decode(Int.self, forKey: .priceEffective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(Int.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priceTransfer = try container.decode(Int.self, forKey: .priceTransfer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sellableQuantity = try container.decode(Int.self, forKey: .sellableQuantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + inventoryUpdatedOn = try container.decode(String.self, forKey: .inventoryUpdatedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(String.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sellerIdentifier = try container.decode(Int.self, forKey: .sellerIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(store, forKey: .store) + + try? container.encodeIfPresent(identifiers, forKey: .identifiers) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(itemId, forKey: .itemId) + + try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(priceTransfer, forKey: .priceTransfer) + + try? container.encodeIfPresent(sellableQuantity, forKey: .sellableQuantity) + + try? container.encodeIfPresent(inventoryUpdatedOn, forKey: .inventoryUpdatedOn) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(sellerIdentifier, forKey: .sellerIdentifier) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + } + } + + /* + Model: ItemQuery + Used By: Catalog + */ + + class ItemQuery: Codable { + public var brandUid: Int? + + public var itemCode: String? + + public var uid: Int? + + public enum CodingKeys: String, CodingKey { + case brandUid = "brand_uid" + + case itemCode = "item_code" + + case uid + } + + public init(brandUid: Int?, itemCode: String?, uid: Int?) { + self.brandUid = brandUid + + self.itemCode = itemCode + + self.uid = uid + } + + public func duplicate() -> ItemQuery { + let dict = self.dictionary! + let copy = ItemQuery(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + brandUid = try container.decode(Int.self, forKey: .brandUid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemCode = try container.decode(String.self, forKey: .itemCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(brandUid, forKey: .brandUid) + + try? container.encodeIfPresent(itemCode, forKey: .itemCode) + + try? container.encodeIfPresent(uid, forKey: .uid) + } + } + + /* + Model: SetSize + Used By: Catalog + */ + + class SetSize: Codable { + public var pieces: Int + + public var size: String + + public enum CodingKeys: String, CodingKey { + case pieces + + case size + } + + public init(pieces: Int, size: String) { + self.pieces = pieces + + self.size = size + } + + public func duplicate() -> SetSize { + let dict = self.dictionary! + let copy = SetSize(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + pieces = try container.decode(Int.self, forKey: .pieces) + + size = try container.decode(String.self, forKey: .size) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pieces, forKey: .pieces) + + try? container.encodeIfPresent(size, forKey: .size) + } + } + + /* + Model: SizeDistribution + Used By: Catalog + */ + + class SizeDistribution: Codable { + public var sizes: [SetSize] + + public enum CodingKeys: String, CodingKey { + case sizes + } + + public init(sizes: [SetSize]) { + self.sizes = sizes + } + + public func duplicate() -> SizeDistribution { + let dict = self.dictionary! + let copy = SizeDistribution(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + sizes = try container.decode([SetSize].self, forKey: .sizes) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(sizes, forKey: .sizes) + } + } + + /* + Model: InventorySet + Used By: Catalog + */ + + class InventorySet: Codable { + public var sizeDistribution: SizeDistribution + + public var quantity: Int? + + public enum CodingKeys: String, CodingKey { + case sizeDistribution = "size_distribution" + + case quantity + } + + public init(quantity: Int?, sizeDistribution: SizeDistribution) { + self.sizeDistribution = sizeDistribution + + self.quantity = quantity + } + + public func duplicate() -> InventorySet { + let dict = self.dictionary! + let copy = InventorySet(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + sizeDistribution = try container.decode(SizeDistribution.self, forKey: .sizeDistribution) + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(sizeDistribution, forKey: .sizeDistribution) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + } + } + + /* + Model: GTIN + Used By: Catalog + */ + + class GTIN: Codable { + public var primary: Bool? + + public var gtinValue: String + + public var gtinType: String + + public enum CodingKeys: String, CodingKey { + case primary + + case gtinValue = "gtin_value" + + case gtinType = "gtin_type" + } + + public init(gtinType: String, gtinValue: String, primary: Bool?) { + self.primary = primary + + self.gtinValue = gtinValue + + self.gtinType = gtinType + } + + public func duplicate() -> GTIN { + let dict = self.dictionary! + let copy = GTIN(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + primary = try container.decode(Bool.self, forKey: .primary) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + gtinValue = try container.decode(String.self, forKey: .gtinValue) + + gtinType = try container.decode(String.self, forKey: .gtinType) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(primary, forKey: .primary) + + try? container.encodeIfPresent(gtinValue, forKey: .gtinValue) + + try? container.encodeIfPresent(gtinType, forKey: .gtinType) + } + } + + /* + Model: InvSize + Used By: Catalog + */ + + class InvSize: Codable { + public var set: InventorySet? + + public var size: String + + public var itemDimensionsUnitOfMeasure: String? + + public var identifiers: [GTIN] + + public var storeCode: String + + public var currency: String + + public var itemWidth: Double? + + public var itemLength: Double? + + public var priceEffective: Double + + public var priceTransfer: Double? + + public var price: Double + + public var itemWeight: Double? + + public var itemHeight: Double? + + public var itemWeightUnitOfMeasure: String? + + public var isSet: Bool? + + public var expirationDate: String? + + public var quantity: Int + + public enum CodingKeys: String, CodingKey { + case set + + case size + + case itemDimensionsUnitOfMeasure = "item_dimensions_unit_of_measure" + + case identifiers + + case storeCode = "store_code" + + case currency + + case itemWidth = "item_width" + + case itemLength = "item_length" + + case priceEffective = "price_effective" + + case priceTransfer = "price_transfer" + + case price + + case itemWeight = "item_weight" + + case itemHeight = "item_height" + + case itemWeightUnitOfMeasure = "item_weight_unit_of_measure" + + case isSet = "is_set" + + case expirationDate = "expiration_date" + + case quantity + } + + public init(currency: String, expirationDate: String?, identifiers: [GTIN], isSet: Bool?, itemDimensionsUnitOfMeasure: String?, itemHeight: Double?, itemLength: Double?, itemWeight: Double?, itemWeightUnitOfMeasure: String?, itemWidth: Double?, price: Double, priceEffective: Double, priceTransfer: Double?, quantity: Int, set: InventorySet?, size: String, storeCode: String) { + self.set = set + + self.size = size + + self.itemDimensionsUnitOfMeasure = itemDimensionsUnitOfMeasure + + self.identifiers = identifiers + + self.storeCode = storeCode + + self.currency = currency + + self.itemWidth = itemWidth + + self.itemLength = itemLength + + self.priceEffective = priceEffective + + self.priceTransfer = priceTransfer + + self.price = price + + self.itemWeight = itemWeight + + self.itemHeight = itemHeight + + self.itemWeightUnitOfMeasure = itemWeightUnitOfMeasure + + self.isSet = isSet + + self.expirationDate = expirationDate + + self.quantity = quantity + } + + public func duplicate() -> InvSize { + let dict = self.dictionary! + let copy = InvSize(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + set = try container.decode(InventorySet.self, forKey: .set) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + size = try container.decode(String.self, forKey: .size) + + do { + itemDimensionsUnitOfMeasure = try container.decode(String.self, forKey: .itemDimensionsUnitOfMeasure) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + identifiers = try container.decode([GTIN].self, forKey: .identifiers) + + storeCode = try container.decode(String.self, forKey: .storeCode) + + currency = try container.decode(String.self, forKey: .currency) + + do { + itemWidth = try container.decode(Double.self, forKey: .itemWidth) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemLength = try container.decode(Double.self, forKey: .itemLength) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + priceEffective = try container.decode(Double.self, forKey: .priceEffective) + + do { + priceTransfer = try container.decode(Double.self, forKey: .priceTransfer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + price = try container.decode(Double.self, forKey: .price) + + do { + itemWeight = try container.decode(Double.self, forKey: .itemWeight) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemHeight = try container.decode(Double.self, forKey: .itemHeight) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemWeightUnitOfMeasure = try container.decode(String.self, forKey: .itemWeightUnitOfMeasure) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isSet = try container.decode(Bool.self, forKey: .isSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expirationDate = try container.decode(String.self, forKey: .expirationDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + quantity = try container.decode(Int.self, forKey: .quantity) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(set, forKey: .set) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encode(itemDimensionsUnitOfMeasure, forKey: .itemDimensionsUnitOfMeasure) + + try? container.encodeIfPresent(identifiers, forKey: .identifiers) + + try? container.encodeIfPresent(storeCode, forKey: .storeCode) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encode(itemWidth, forKey: .itemWidth) + + try? container.encode(itemLength, forKey: .itemLength) + + try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) + + try? container.encode(priceTransfer, forKey: .priceTransfer) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encode(itemWeight, forKey: .itemWeight) + + try? container.encode(itemHeight, forKey: .itemHeight) + + try? container.encode(itemWeightUnitOfMeasure, forKey: .itemWeightUnitOfMeasure) + + try? container.encodeIfPresent(isSet, forKey: .isSet) + + try? container.encodeIfPresent(expirationDate, forKey: .expirationDate) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + } + } + + /* + Model: InventoryRequest + Used By: Catalog + */ + + class InventoryRequest: Codable { + public var item: ItemQuery + + public var sizes: [InvSize] + + public var companyId: Int + + public enum CodingKeys: String, CodingKey { + case item + + case sizes + + case companyId = "company_id" + } + + public init(companyId: Int, item: ItemQuery, sizes: [InvSize]) { + self.item = item + + self.sizes = sizes + + self.companyId = companyId + } + + public func duplicate() -> InventoryRequest { + let dict = self.dictionary! + let copy = InventoryRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + item = try container.decode(ItemQuery.self, forKey: .item) + + sizes = try container.decode([InvSize].self, forKey: .sizes) + + companyId = try container.decode(Int.self, forKey: .companyId) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(item, forKey: .item) + + try? container.encodeIfPresent(sizes, forKey: .sizes) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + } + } + + /* + Model: InventoryDeleteData + Used By: Catalog + */ + + class InventoryDeleteData: Codable { + public var itemId: Int? + + public var size: String? + + public var locationId: Int? + + public enum CodingKeys: String, CodingKey { + case itemId = "item_id" + + case size + + case locationId = "location_id" + } + + public init(itemId: Int?, locationId: Int?, size: String?) { + self.itemId = itemId + + self.size = size + + self.locationId = locationId + } + + public func duplicate() -> InventoryDeleteData { + let dict = self.dictionary! + let copy = InventoryDeleteData(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + itemId = try container.decode(Int.self, forKey: .itemId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(String.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + locationId = try container.decode(Int.self, forKey: .locationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(itemId, forKey: .itemId) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(locationId, forKey: .locationId) + } + } + + /* + Model: InventoryDelete + Used By: Catalog + */ + + class InventoryDelete: Codable { + public var success: Bool? + + public var data: InventoryDeleteData? + + public enum CodingKeys: String, CodingKey { + case success + + case data + } + + public init(data: InventoryDeleteData?, success: Bool?) { + self.success = success + + self.data = data + } + + public func duplicate() -> InventoryDelete { + let dict = self.dictionary! + let copy = InventoryDelete(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode(InventoryDeleteData.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: BulkInventoryGetItems + Used By: Catalog + */ + + class BulkInventoryGetItems: Codable { + public var total: Int? + + public var isActive: Bool? + + public var modifiedOn: String? + + public var id: String? + + public var createdOn: String? + + public var companyId: Int? + + public var cancelledRecords: [String]? + + public var filePath: String? + + public var cancelled: Int? + + public var failedRecords: [String]? + + public var modifiedBy: [String: Any]? + + public var createdBy: [String: Any]? + + public var failed: Int? + + public var succeed: Int? + + public var stage: String? + + public enum CodingKeys: String, CodingKey { + case total + + case isActive = "is_active" + + case modifiedOn = "modified_on" + + case id + + case createdOn = "created_on" + + case companyId = "company_id" + + case cancelledRecords = "cancelled_records" + + case filePath = "file_path" + + case cancelled + + case failedRecords = "failed_records" + + case modifiedBy = "modified_by" + + case createdBy = "created_by" + + case failed + + case succeed + + case stage + } + + public init(cancelled: Int?, cancelledRecords: [String]?, companyId: Int?, createdBy: [String: Any]?, createdOn: String?, failed: Int?, failedRecords: [String]?, filePath: String?, id: String?, isActive: Bool?, modifiedBy: [String: Any]?, modifiedOn: String?, stage: String?, succeed: Int?, total: Int?) { + self.total = total + + self.isActive = isActive + + self.modifiedOn = modifiedOn + + self.id = id + + self.createdOn = createdOn + + self.companyId = companyId + + self.cancelledRecords = cancelledRecords + + self.filePath = filePath + + self.cancelled = cancelled + + self.failedRecords = failedRecords + + self.modifiedBy = modifiedBy + + self.createdBy = createdBy + + self.failed = failed + + self.succeed = succeed + + self.stage = stage + } + + public func duplicate() -> BulkInventoryGetItems { + let dict = self.dictionary! + let copy = BulkInventoryGetItems(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + total = try container.decode(Int.self, forKey: .total) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cancelledRecords = try container.decode([String].self, forKey: .cancelledRecords) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filePath = try container.decode(String.self, forKey: .filePath) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cancelled = try container.decode(Int.self, forKey: .cancelled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + failedRecords = try container.decode([String].self, forKey: .failedRecords) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode([String: Any].self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode([String: Any].self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + failed = try container.decode(Int.self, forKey: .failed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + succeed = try container.decode(Int.self, forKey: .succeed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stage = try container.decode(String.self, forKey: .stage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(total, forKey: .total) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(cancelledRecords, forKey: .cancelledRecords) + + try? container.encodeIfPresent(filePath, forKey: .filePath) + + try? container.encodeIfPresent(cancelled, forKey: .cancelled) + + try? container.encodeIfPresent(failedRecords, forKey: .failedRecords) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(failed, forKey: .failed) + + try? container.encodeIfPresent(succeed, forKey: .succeed) + + try? container.encodeIfPresent(stage, forKey: .stage) + } + } + + /* + Model: BulkInventoryGet + Used By: Catalog + */ + + class BulkInventoryGet: Codable { + public var page: Page? + + public var items: [BulkInventoryGetItems]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [BulkInventoryGetItems]?, page: Page?) { + self.page = page + + self.items = items + } + + public func duplicate() -> BulkInventoryGet { + let dict = self.dictionary! + let copy = BulkInventoryGet(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([BulkInventoryGetItems].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: CommonResponse + Used By: Catalog + */ + + class CommonResponse: Codable { + public var success: String? + + public enum CodingKeys: String, CodingKey { + case success + } + + public init(success: String?) { + self.success = success + } + + public func duplicate() -> CommonResponse { + let dict = self.dictionary! + let copy = CommonResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(String.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: Size1 + Used By: Catalog + */ + + class Size1: Codable { + public var set: InventorySet? + + public var size: String? + + public var itemDimensionsUnitOfMeasure: String? + + public var identifiers: [[String: Any]]? + + public var storeCode: String + + public var currency: String + + public var itemWidth: Double? + + public var itemLength: Double? + + public var priceEffective: Double + + public var priceTransfer: Double? + + public var price: Double + + public var itemWeight: Double? + + public var itemHeight: Double? + + public var itemWeightUnitOfMeasure: String? + + public var isSet: Bool? + + public var sellerIdentifier: String + + public var expirationDate: String? + + public var quantity: Int + + public enum CodingKeys: String, CodingKey { + case set + + case size + + case itemDimensionsUnitOfMeasure = "item_dimensions_unit_of_measure" + + case identifiers + + case storeCode = "store_code" + + case currency + + case itemWidth = "item_width" + + case itemLength = "item_length" + + case priceEffective = "price_effective" + + case priceTransfer = "price_transfer" + + case price + + case itemWeight = "item_weight" + + case itemHeight = "item_height" + + case itemWeightUnitOfMeasure = "item_weight_unit_of_measure" + + case isSet = "is_set" + + case sellerIdentifier = "seller_identifier" + + case expirationDate = "expiration_date" + + case quantity + } + + public init(currency: String, expirationDate: String?, identifiers: [[String: Any]]?, isSet: Bool?, itemDimensionsUnitOfMeasure: String?, itemHeight: Double?, itemLength: Double?, itemWeight: Double?, itemWeightUnitOfMeasure: String?, itemWidth: Double?, price: Double, priceEffective: Double, priceTransfer: Double?, quantity: Int, sellerIdentifier: String, set: InventorySet?, size: String?, storeCode: String) { + self.set = set + + self.size = size + + self.itemDimensionsUnitOfMeasure = itemDimensionsUnitOfMeasure + + self.identifiers = identifiers + + self.storeCode = storeCode + + self.currency = currency + + self.itemWidth = itemWidth + + self.itemLength = itemLength + + self.priceEffective = priceEffective + + self.priceTransfer = priceTransfer + + self.price = price + + self.itemWeight = itemWeight + + self.itemHeight = itemHeight + + self.itemWeightUnitOfMeasure = itemWeightUnitOfMeasure + + self.isSet = isSet + + self.sellerIdentifier = sellerIdentifier + + self.expirationDate = expirationDate + + self.quantity = quantity + } + + public func duplicate() -> Size1 { + let dict = self.dictionary! + let copy = Size1(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + set = try container.decode(InventorySet.self, forKey: .set) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(String.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemDimensionsUnitOfMeasure = try container.decode(String.self, forKey: .itemDimensionsUnitOfMeasure) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + identifiers = try container.decode([[String: Any]].self, forKey: .identifiers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + storeCode = try container.decode(String.self, forKey: .storeCode) + + currency = try container.decode(String.self, forKey: .currency) + + do { + itemWidth = try container.decode(Double.self, forKey: .itemWidth) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemLength = try container.decode(Double.self, forKey: .itemLength) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + priceEffective = try container.decode(Double.self, forKey: .priceEffective) + + do { + priceTransfer = try container.decode(Double.self, forKey: .priceTransfer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + price = try container.decode(Double.self, forKey: .price) + + do { + itemWeight = try container.decode(Double.self, forKey: .itemWeight) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemHeight = try container.decode(Double.self, forKey: .itemHeight) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemWeightUnitOfMeasure = try container.decode(String.self, forKey: .itemWeightUnitOfMeasure) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isSet = try container.decode(Bool.self, forKey: .isSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + sellerIdentifier = try container.decode(String.self, forKey: .sellerIdentifier) + + do { + expirationDate = try container.decode(String.self, forKey: .expirationDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + quantity = try container.decode(Int.self, forKey: .quantity) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(set, forKey: .set) + + try? container.encode(size, forKey: .size) + + try? container.encode(itemDimensionsUnitOfMeasure, forKey: .itemDimensionsUnitOfMeasure) + + try? container.encode(identifiers, forKey: .identifiers) + + try? container.encodeIfPresent(storeCode, forKey: .storeCode) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encode(itemWidth, forKey: .itemWidth) + + try? container.encode(itemLength, forKey: .itemLength) + + try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) + + try? container.encode(priceTransfer, forKey: .priceTransfer) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encode(itemWeight, forKey: .itemWeight) + + try? container.encode(itemHeight, forKey: .itemHeight) + + try? container.encode(itemWeightUnitOfMeasure, forKey: .itemWeightUnitOfMeasure) + + try? container.encodeIfPresent(isSet, forKey: .isSet) + + try? container.encodeIfPresent(sellerIdentifier, forKey: .sellerIdentifier) + + try? container.encodeIfPresent(expirationDate, forKey: .expirationDate) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + } + } + + /* + Model: InventoryBulkRequest + Used By: Catalog + */ + + class InventoryBulkRequest: Codable { + public var user: [String: Any]? + + public var batchId: String + + public var sizes: [Size1] + + public var companyId: Int + + public enum CodingKeys: String, CodingKey { + case user + + case batchId = "batch_id" + + case sizes + + case companyId = "company_id" + } + + public init(batchId: String, companyId: Int, sizes: [Size1], user: [String: Any]?) { + self.user = user + + self.batchId = batchId + + self.sizes = sizes + + self.companyId = companyId + } + + public func duplicate() -> InventoryBulkRequest { + let dict = self.dictionary! + let copy = InventoryBulkRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode([String: Any].self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + batchId = try container.decode(String.self, forKey: .batchId) + + sizes = try container.decode([Size1].self, forKey: .sizes) + + companyId = try container.decode(Int.self, forKey: .companyId) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(batchId, forKey: .batchId) + + try? container.encodeIfPresent(sizes, forKey: .sizes) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + } + } + + /* + Model: InventoryExportJob + Used By: Catalog + */ + + class InventoryExportJob: Codable { + public var requestParams: [String: Any]? + + public var taskId: String + + public var triggerOn: String? + + public var status: String? + + public var sellerId: Int + + public var url: String? + + public var completedOn: String? + + public enum CodingKeys: String, CodingKey { + case requestParams = "request_params" + + case taskId = "task_id" + + case triggerOn = "trigger_on" + + case status + + case sellerId = "seller_id" + + case url + + case completedOn = "completed_on" + } + + public init(completedOn: String?, requestParams: [String: Any]?, sellerId: Int, status: String?, taskId: String, triggerOn: String?, url: String?) { + self.requestParams = requestParams + + self.taskId = taskId + + self.triggerOn = triggerOn + + self.status = status + + self.sellerId = sellerId + + self.url = url + + self.completedOn = completedOn + } + + public func duplicate() -> InventoryExportJob { + let dict = self.dictionary! + let copy = InventoryExportJob(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + requestParams = try container.decode([String: Any].self, forKey: .requestParams) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + taskId = try container.decode(String.self, forKey: .taskId) + + do { + triggerOn = try container.decode(String.self, forKey: .triggerOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + sellerId = try container.decode(Int.self, forKey: .sellerId) + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + completedOn = try container.decode(String.self, forKey: .completedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(requestParams, forKey: .requestParams) + + try? container.encodeIfPresent(taskId, forKey: .taskId) + + try? container.encodeIfPresent(triggerOn, forKey: .triggerOn) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(sellerId, forKey: .sellerId) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(completedOn, forKey: .completedOn) + } + } + + /* + Model: InventoryExportRequest + Used By: Catalog + */ + + class InventoryExportRequest: Codable { + public var store: [Int]? + + public var brand: [Int]? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case store + + case brand + + case type + } + + public init(brand: [Int]?, store: [Int]?, type: String?) { + self.store = store + + self.brand = brand + + self.type = type + } + + public func duplicate() -> InventoryExportRequest { + let dict = self.dictionary! + let copy = InventoryExportRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + store = try container.decode([Int].self, forKey: .store) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brand = try container.decode([Int].self, forKey: .brand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(store, forKey: .store) + + try? container.encodeIfPresent(brand, forKey: .brand) + + try? container.encode(type, forKey: .type) + } + } + + /* + Model: FilerList + Used By: Catalog + */ + + class FilerList: Codable { + public var value: String? + + public var display: String? + + public enum CodingKeys: String, CodingKey { + case value + + case display + } + + public init(display: String?, value: String?) { + self.value = value + + self.display = display + } + + public func duplicate() -> FilerList { + let dict = self.dictionary! + let copy = FilerList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(display, forKey: .display) + } + } + + /* + Model: InventoryConfig + Used By: Catalog + */ + + class InventoryConfig: Codable { + public var data: [FilerList]? + + public var multivalues: Bool? + + public enum CodingKeys: String, CodingKey { + case data + + case multivalues + } + + public init(data: [FilerList]?, multivalues: Bool?) { + self.data = data + + self.multivalues = multivalues + } + + public func duplicate() -> InventoryConfig { + let dict = self.dictionary! + let copy = InventoryConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode([FilerList].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + multivalues = try container.decode(Bool.self, forKey: .multivalues) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(multivalues, forKey: .multivalues) + } + } + + /* + Model: PageResponse + Used By: Catalog + */ + + class PageResponse: Codable { + public var itemTotal: Int? + + public var hasNext: Bool? + + public var current: String? + + public var hasPrevious: Bool? + + public var size: Int? + + public enum CodingKeys: String, CodingKey { + case itemTotal = "item_total" + + case hasNext = "has_next" + + case current + + case hasPrevious = "has_previous" + + case size + } + + public init(current: String?, hasNext: Bool?, hasPrevious: Bool?, itemTotal: Int?, size: Int?) { + self.itemTotal = itemTotal + + self.hasNext = hasNext + + self.current = current + + self.hasPrevious = hasPrevious + + self.size = size + } + + public func duplicate() -> PageResponse { + let dict = self.dictionary! + let copy = PageResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + itemTotal = try container.decode(Int.self, forKey: .itemTotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasNext = try container.decode(Bool.self, forKey: .hasNext) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + current = try container.decode(String.self, forKey: .current) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasPrevious = try container.decode(Bool.self, forKey: .hasPrevious) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(Int.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) + + try? container.encodeIfPresent(hasNext, forKey: .hasNext) + + try? container.encodeIfPresent(current, forKey: .current) + + try? container.encodeIfPresent(hasPrevious, forKey: .hasPrevious) + + try? container.encodeIfPresent(size, forKey: .size) + } + } + + /* + Model: HsnCodesObject + Used By: Catalog + */ + + class HsnCodesObject: Codable { + public var tax1: Double? + + public var modifiedOn: String? + + public var taxOnEsp: Bool? + + public var id: String? + + public var threshold1: Double? + + public var companyId: Int? + + public var threshold2: Double? + + public var tax2: Double? + + public var hs2Code: String? + + public var taxOnMrp: Bool? + + public var hsnCode: String? + + public enum CodingKeys: String, CodingKey { + case tax1 + + case modifiedOn = "modified_on" + + case taxOnEsp = "tax_on_esp" + + case id + + case threshold1 + + case companyId = "company_id" + + case threshold2 + + case tax2 + + case hs2Code = "hs2_code" + + case taxOnMrp = "tax_on_mrp" + + case hsnCode = "hsn_code" + } + + public init(companyId: Int?, hs2Code: String?, hsnCode: String?, id: String?, modifiedOn: String?, tax1: Double?, tax2: Double?, taxOnEsp: Bool?, taxOnMrp: Bool?, threshold1: Double?, threshold2: Double?) { + self.tax1 = tax1 + + self.modifiedOn = modifiedOn + + self.taxOnEsp = taxOnEsp + + self.id = id + + self.threshold1 = threshold1 + + self.companyId = companyId + + self.threshold2 = threshold2 + + self.tax2 = tax2 + + self.hs2Code = hs2Code + + self.taxOnMrp = taxOnMrp + + self.hsnCode = hsnCode + } + + public func duplicate() -> HsnCodesObject { + let dict = self.dictionary! + let copy = HsnCodesObject(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + tax1 = try container.decode(Double.self, forKey: .tax1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + taxOnEsp = try container.decode(Bool.self, forKey: .taxOnEsp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + threshold1 = try container.decode(Double.self, forKey: .threshold1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + threshold2 = try container.decode(Double.self, forKey: .threshold2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tax2 = try container.decode(Double.self, forKey: .tax2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hs2Code = try container.decode(String.self, forKey: .hs2Code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + taxOnMrp = try container.decode(Bool.self, forKey: .taxOnMrp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hsnCode = try container.decode(String.self, forKey: .hsnCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(tax1, forKey: .tax1) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(taxOnEsp, forKey: .taxOnEsp) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(threshold1, forKey: .threshold1) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(threshold2, forKey: .threshold2) + + try? container.encodeIfPresent(tax2, forKey: .tax2) + + try? container.encodeIfPresent(hs2Code, forKey: .hs2Code) + + try? container.encodeIfPresent(taxOnMrp, forKey: .taxOnMrp) + + try? container.encodeIfPresent(hsnCode, forKey: .hsnCode) + } + } + + /* + Model: HsnCodesListingResponse + Used By: Catalog + */ + + class HsnCodesListingResponse: Codable { + public var page: PageResponse? + + public var items: [HsnCodesObject]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [HsnCodesObject]?, page: PageResponse?) { + self.page = page + + self.items = items + } + + public func duplicate() -> HsnCodesListingResponse { + let dict = self.dictionary! + let copy = HsnCodesListingResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(PageResponse.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([HsnCodesObject].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: HsnUpsert + Used By: Catalog + */ + + class HsnUpsert: Codable { + public var tax1: Double + + public var uid: Int? + + public var taxOnEsp: Bool? + + public var threshold1: Double + + public var companyId: Int + + public var threshold2: Double? + + public var tax2: Double? + + public var hs2Code: String + + public var taxOnMrp: Bool + + public var hsnCode: String + + public enum CodingKeys: String, CodingKey { + case tax1 + + case uid + + case taxOnEsp = "tax_on_esp" + + case threshold1 + + case companyId = "company_id" + + case threshold2 + + case tax2 + + case hs2Code = "hs2_code" + + case taxOnMrp = "tax_on_mrp" + + case hsnCode = "hsn_code" + } + + public init(companyId: Int, hs2Code: String, hsnCode: String, tax1: Double, tax2: Double?, taxOnEsp: Bool?, taxOnMrp: Bool, threshold1: Double, threshold2: Double?, uid: Int?) { + self.tax1 = tax1 + + self.uid = uid + + self.taxOnEsp = taxOnEsp + + self.threshold1 = threshold1 + + self.companyId = companyId + + self.threshold2 = threshold2 + + self.tax2 = tax2 + + self.hs2Code = hs2Code + + self.taxOnMrp = taxOnMrp + + self.hsnCode = hsnCode + } + + public func duplicate() -> HsnUpsert { + let dict = self.dictionary! + let copy = HsnUpsert(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + tax1 = try container.decode(Double.self, forKey: .tax1) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + taxOnEsp = try container.decode(Bool.self, forKey: .taxOnEsp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + threshold1 = try container.decode(Double.self, forKey: .threshold1) + + companyId = try container.decode(Int.self, forKey: .companyId) + + do { + threshold2 = try container.decode(Double.self, forKey: .threshold2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tax2 = try container.decode(Double.self, forKey: .tax2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + hs2Code = try container.decode(String.self, forKey: .hs2Code) + + taxOnMrp = try container.decode(Bool.self, forKey: .taxOnMrp) + + hsnCode = try container.decode(String.self, forKey: .hsnCode) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(tax1, forKey: .tax1) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(taxOnEsp, forKey: .taxOnEsp) + + try? container.encodeIfPresent(threshold1, forKey: .threshold1) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(threshold2, forKey: .threshold2) + + try? container.encodeIfPresent(tax2, forKey: .tax2) + + try? container.encode(hs2Code, forKey: .hs2Code) + + try? container.encodeIfPresent(taxOnMrp, forKey: .taxOnMrp) + + try? container.encodeIfPresent(hsnCode, forKey: .hsnCode) + } + } + + /* + Model: HsnCode + Used By: Catalog + */ + + class HsnCode: Codable { + public var data: HsnCodesObject? + + public enum CodingKeys: String, CodingKey { + case data + } + + public init(data: HsnCodesObject?) { + self.data = data + } + + public func duplicate() -> HsnCode { + let dict = self.dictionary! + let copy = HsnCode(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode(HsnCodesObject.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: BulkHsnUpsert + Used By: Catalog + */ + + class BulkHsnUpsert: Codable { + public var data: [HsnUpsert] + + public enum CodingKeys: String, CodingKey { + case data + } + + public init(data: [HsnUpsert]) { + self.data = data + } + + public func duplicate() -> BulkHsnUpsert { + let dict = self.dictionary! + let copy = BulkHsnUpsert(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + data = try container.decode([HsnUpsert].self, forKey: .data) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: BulkHsnResponse + Used By: Catalog + */ + + class BulkHsnResponse: Codable { + public var success: Bool? + + public enum CodingKeys: String, CodingKey { + case success + } + + public init(success: Bool?) { + self.success = success + } + + public func duplicate() -> BulkHsnResponse { + let dict = self.dictionary! + let copy = BulkHsnResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: BrandItem + Used By: Catalog + */ + + class BrandItem: Codable { + public var uid: Int? + + public var discount: String? + + public var logo: Media? + + public var banners: ImageUrls? + + public var action: Action? + + public var departments: [String]? + + public var slug: String? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case discount + + case logo + + case banners + + case action + + case departments + + case slug + + case name + } + + public init(action: Action?, banners: ImageUrls?, departments: [String]?, discount: String?, logo: Media?, name: String?, slug: String?, uid: Int?) { + self.uid = uid + + self.discount = discount + + self.logo = logo + + self.banners = banners + + self.action = action + + self.departments = departments + + self.slug = slug + + self.name = name + } + + public func duplicate() -> BrandItem { + let dict = self.dictionary! + let copy = BrandItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discount = try container.decode(String.self, forKey: .discount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(Media.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banners = try container.decode(ImageUrls.self, forKey: .banners) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(Action.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + departments = try container.decode([String].self, forKey: .departments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(discount, forKey: .discount) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(banners, forKey: .banners) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(departments, forKey: .departments) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: BrandListingResponse + Used By: Catalog + */ + + class BrandListingResponse: Codable { + public var page: Page + + public var items: [BrandItem]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [BrandItem]?, page: Page) { + self.page = page + + self.items = items + } + + public func duplicate() -> BrandListingResponse { + let dict = self.dictionary! + let copy = BrandListingResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + page = try container.decode(Page.self, forKey: .page) + + do { + items = try container.decode([BrandItem].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: Department + Used By: Catalog + */ + + class Department: Codable { + public var uid: Int? + + public var logo: Media? + + public var priorityOrder: Int? + + public var slug: String? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case logo + + case priorityOrder = "priority_order" + + case slug + + case name + } + + public init(logo: Media?, name: String?, priorityOrder: Int?, slug: String?, uid: Int?) { + self.uid = uid + + self.logo = logo + + self.priorityOrder = priorityOrder + + self.slug = slug + + self.name = name + } + + public func duplicate() -> Department { + let dict = self.dictionary! + let copy = Department(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(Media.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priorityOrder = try container.decode(Int.self, forKey: .priorityOrder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(priorityOrder, forKey: .priorityOrder) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: DepartmentResponse + Used By: Catalog + */ + + class DepartmentResponse: Codable { + public var items: [Department]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [Department]?) { + self.items = items + } + + public func duplicate() -> DepartmentResponse { + let dict = self.dictionary! + let copy = DepartmentResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Department].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: ThirdLevelChild + Used By: Catalog + */ + + class ThirdLevelChild: Codable { + public var uid: Int? + + public var banners: ImageUrls? + + public var childs: [[String: Any]]? + + public var action: Action? + + public var slug: String? + + public var customJson: [String: Any]? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case banners + + case childs + + case action + + case slug + + case customJson = "_custom_json" + + case name + } + + public init(action: Action?, banners: ImageUrls?, childs: [[String: Any]]?, name: String?, slug: String?, uid: Int?, customJson: [String: Any]?) { + self.uid = uid + + self.banners = banners + + self.childs = childs + + self.action = action + + self.slug = slug + + self.customJson = customJson + + self.name = name + } + + public func duplicate() -> ThirdLevelChild { + let dict = self.dictionary! + let copy = ThirdLevelChild(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banners = try container.decode(ImageUrls.self, forKey: .banners) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + childs = try container.decode([[String: Any]].self, forKey: .childs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(Action.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(banners, forKey: .banners) + + try? container.encodeIfPresent(childs, forKey: .childs) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: SecondLevelChild + Used By: Catalog + */ + + class SecondLevelChild: Codable { + public var uid: Int? + + public var banners: ImageUrls? + + public var childs: [ThirdLevelChild]? + + public var action: Action? + + public var slug: String? + + public var customJson: [String: Any]? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case banners + + case childs + + case action + + case slug + + case customJson = "_custom_json" + + case name + } + + public init(action: Action?, banners: ImageUrls?, childs: [ThirdLevelChild]?, name: String?, slug: String?, uid: Int?, customJson: [String: Any]?) { + self.uid = uid + + self.banners = banners + + self.childs = childs + + self.action = action + + self.slug = slug + + self.customJson = customJson + + self.name = name + } + + public func duplicate() -> SecondLevelChild { + let dict = self.dictionary! + let copy = SecondLevelChild(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banners = try container.decode(ImageUrls.self, forKey: .banners) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + childs = try container.decode([ThirdLevelChild].self, forKey: .childs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(Action.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(banners, forKey: .banners) + + try? container.encodeIfPresent(childs, forKey: .childs) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: Child + Used By: Catalog + */ + + class Child: Codable { + public var uid: Int? + + public var banners: ImageUrls? + + public var childs: [SecondLevelChild]? + + public var action: Action? + + public var slug: String? + + public var customJson: [String: Any]? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case banners + + case childs + + case action + + case slug + + case customJson = "_custom_json" + + case name + } + + public init(action: Action?, banners: ImageUrls?, childs: [SecondLevelChild]?, name: String?, slug: String?, uid: Int?, customJson: [String: Any]?) { + self.uid = uid + + self.banners = banners + + self.childs = childs + + self.action = action + + self.slug = slug + + self.customJson = customJson + + self.name = name + } + + public func duplicate() -> Child { + let dict = self.dictionary! + let copy = Child(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banners = try container.decode(ImageUrls.self, forKey: .banners) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + childs = try container.decode([SecondLevelChild].self, forKey: .childs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(Action.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(banners, forKey: .banners) + + try? container.encodeIfPresent(childs, forKey: .childs) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: CategoryItems + Used By: Catalog + */ + + class CategoryItems: Codable { + public var uid: Int? + + public var banners: ImageUrls? + + public var childs: [Child]? + + public var action: Action? + + public var slug: String? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case banners + + case childs + + case action + + case slug + + case name + } + + public init(action: Action?, banners: ImageUrls?, childs: [Child]?, name: String?, slug: String?, uid: Int?) { + self.uid = uid + + self.banners = banners + + self.childs = childs + + self.action = action + + self.slug = slug + + self.name = name + } + + public func duplicate() -> CategoryItems { + let dict = self.dictionary! + let copy = CategoryItems(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banners = try container.decode(ImageUrls.self, forKey: .banners) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + childs = try container.decode([Child].self, forKey: .childs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(Action.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(banners, forKey: .banners) + + try? container.encodeIfPresent(childs, forKey: .childs) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: DepartmentCategoryTree + Used By: Catalog + */ + + class DepartmentCategoryTree: Codable { + public var department: String? + + public var items: [CategoryItems]? + + public enum CodingKeys: String, CodingKey { + case department + + case items + } + + public init(department: String?, items: [CategoryItems]?) { + self.department = department + + self.items = items + } + + public func duplicate() -> DepartmentCategoryTree { + let dict = self.dictionary! + let copy = DepartmentCategoryTree(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + department = try container.decode(String.self, forKey: .department) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([CategoryItems].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(department, forKey: .department) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: DepartmentIdentifier + Used By: Catalog + */ + + class DepartmentIdentifier: Codable { + public var uid: Int? + + public var slug: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case slug + } + + public init(slug: String?, uid: Int?) { + self.uid = uid + + self.slug = slug + } + + public func duplicate() -> DepartmentIdentifier { + let dict = self.dictionary! + let copy = DepartmentIdentifier(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(slug, forKey: .slug) + } + } + + /* + Model: CategoryListingResponse + Used By: Catalog + */ + + class CategoryListingResponse: Codable { + public var data: [DepartmentCategoryTree]? + + public var departments: [DepartmentIdentifier]? + + public enum CodingKeys: String, CodingKey { + case data + + case departments + } + + public init(data: [DepartmentCategoryTree]?, departments: [DepartmentIdentifier]?) { + self.data = data + + self.departments = departments + } + + public func duplicate() -> CategoryListingResponse { + let dict = self.dictionary! + let copy = CategoryListingResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode([DepartmentCategoryTree].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + departments = try container.decode([DepartmentIdentifier].self, forKey: .departments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(departments, forKey: .departments) + } + } + + /* + Model: ApplicationProductListingResponse + Used By: Catalog + */ + + class ApplicationProductListingResponse: Codable { + public var page: Page + + public var filters: [ProductFilters]? + + public var sortOn: [ProductSortOn]? + + public var items: [ProductListingDetail]? + + public enum CodingKeys: String, CodingKey { + case page + + case filters + + case sortOn = "sort_on" + + case items + } + + public init(filters: [ProductFilters]?, items: [ProductListingDetail]?, page: Page, sortOn: [ProductSortOn]?) { + self.page = page + + self.filters = filters + + self.sortOn = sortOn + + self.items = items + } + + public func duplicate() -> ApplicationProductListingResponse { + let dict = self.dictionary! + let copy = ApplicationProductListingResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + page = try container.decode(Page.self, forKey: .page) + + do { + filters = try container.decode([ProductFilters].self, forKey: .filters) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sortOn = try container.decode([ProductSortOn].self, forKey: .sortOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([ProductListingDetail].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(filters, forKey: .filters) + + try? container.encodeIfPresent(sortOn, forKey: .sortOn) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: ProductDetail + Used By: Catalog + */ + + class ProductDetail: Codable { + public var productOnlineDate: String? + + public var highlights: [String]? + + public var ratingCount: Int? + + public var slug: String + + public var hasVariant: Bool? + + public var color: String? + + public var itemType: String? + + public var brand: ProductBrand? + + public var teaserTag: [String: Any]? + + public var similars: [String]? + + public var medias: [Media1]? + + public var attributes: [String: Any]? + + public var imageNature: String? + + public var tryouts: [String]? + + public var groupedAttributes: [ProductDetailGroupedAttribute]? + + public var type: String? + + public var uid: Int? + + public var description: String? + + public var promoMeta: [String: Any]? + + public var rating: Double? + + public var itemCode: String? + + public var name: String? + + public var shortDescription: String? + + public enum CodingKeys: String, CodingKey { + case productOnlineDate = "product_online_date" + + case highlights + + case ratingCount = "rating_count" + + case slug + + case hasVariant = "has_variant" + + case color + + case itemType = "item_type" + + case brand + + case teaserTag = "teaser_tag" + + case similars + + case medias + + case attributes + + case imageNature = "image_nature" + + case tryouts + + case groupedAttributes = "grouped_attributes" + + case type + + case uid + + case description + + case promoMeta = "promo_meta" + + case rating + + case itemCode = "item_code" + + case name + + case shortDescription = "short_description" + } + + public init(attributes: [String: Any]?, brand: ProductBrand?, color: String?, description: String?, groupedAttributes: [ProductDetailGroupedAttribute]?, hasVariant: Bool?, highlights: [String]?, imageNature: String?, itemCode: String?, itemType: String?, medias: [Media1]?, name: String?, productOnlineDate: String?, promoMeta: [String: Any]?, rating: Double?, ratingCount: Int?, shortDescription: String?, similars: [String]?, slug: String, teaserTag: [String: Any]?, tryouts: [String]?, type: String?, uid: Int?) { + self.productOnlineDate = productOnlineDate + + self.highlights = highlights + + self.ratingCount = ratingCount + + self.slug = slug + + self.hasVariant = hasVariant + + self.color = color + + self.itemType = itemType + + self.brand = brand + + self.teaserTag = teaserTag + + self.similars = similars + + self.medias = medias + + self.attributes = attributes + + self.imageNature = imageNature + + self.tryouts = tryouts + + self.groupedAttributes = groupedAttributes + + self.type = type + + self.uid = uid + + self.description = description + + self.promoMeta = promoMeta + + self.rating = rating + + self.itemCode = itemCode + + self.name = name + + self.shortDescription = shortDescription + } + + public func duplicate() -> ProductDetail { + let dict = self.dictionary! + let copy = ProductDetail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + productOnlineDate = try container.decode(String.self, forKey: .productOnlineDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + highlights = try container.decode([String].self, forKey: .highlights) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ratingCount = try container.decode(Int.self, forKey: .ratingCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + slug = try container.decode(String.self, forKey: .slug) + + do { + hasVariant = try container.decode(Bool.self, forKey: .hasVariant) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + color = try container.decode(String.self, forKey: .color) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemType = try container.decode(String.self, forKey: .itemType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brand = try container.decode(ProductBrand.self, forKey: .brand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + teaserTag = try container.decode([String: Any].self, forKey: .teaserTag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + similars = try container.decode([String].self, forKey: .similars) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + medias = try container.decode([Media1].self, forKey: .medias) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributes = try container.decode([String: Any].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + imageNature = try container.decode(String.self, forKey: .imageNature) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tryouts = try container.decode([String].self, forKey: .tryouts) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + groupedAttributes = try container.decode([ProductDetailGroupedAttribute].self, forKey: .groupedAttributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + promoMeta = try container.decode([String: Any].self, forKey: .promoMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rating = try container.decode(Double.self, forKey: .rating) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemCode = try container.decode(String.self, forKey: .itemCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shortDescription = try container.decode(String.self, forKey: .shortDescription) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(productOnlineDate, forKey: .productOnlineDate) + + try? container.encodeIfPresent(highlights, forKey: .highlights) + + try? container.encodeIfPresent(ratingCount, forKey: .ratingCount) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(hasVariant, forKey: .hasVariant) + + try? container.encodeIfPresent(color, forKey: .color) + + try? container.encodeIfPresent(itemType, forKey: .itemType) + + try? container.encodeIfPresent(brand, forKey: .brand) + + try? container.encodeIfPresent(teaserTag, forKey: .teaserTag) + + try? container.encodeIfPresent(similars, forKey: .similars) + + try? container.encodeIfPresent(medias, forKey: .medias) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + + try? container.encodeIfPresent(imageNature, forKey: .imageNature) + + try? container.encodeIfPresent(tryouts, forKey: .tryouts) + + try? container.encodeIfPresent(groupedAttributes, forKey: .groupedAttributes) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(promoMeta, forKey: .promoMeta) + + try? container.encodeIfPresent(rating, forKey: .rating) + + try? container.encodeIfPresent(itemCode, forKey: .itemCode) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(shortDescription, forKey: .shortDescription) + } + } + + /* + Model: ArticleQuery + Used By: Catalog + */ + + class ArticleQuery: Codable { + public var itemId: Int + + public var size: String + + public var ignoredStores: [Int]? + + public enum CodingKeys: String, CodingKey { + case itemId = "item_id" + + case size + + case ignoredStores = "ignored_stores" + } + + public init(ignoredStores: [Int]?, itemId: Int, size: String) { + self.itemId = itemId + + self.size = size + + self.ignoredStores = ignoredStores + } + + public func duplicate() -> ArticleQuery { + let dict = self.dictionary! + let copy = ArticleQuery(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + itemId = try container.decode(Int.self, forKey: .itemId) + + size = try container.decode(String.self, forKey: .size) + + do { + ignoredStores = try container.decode([Int].self, forKey: .ignoredStores) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(itemId, forKey: .itemId) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(ignoredStores, forKey: .ignoredStores) + } + } + + /* + Model: AssignStoreArticle + Used By: Catalog + */ + + class AssignStoreArticle: Codable { + public var groupId: String? + + public var articleAssignment: ArticleAssignment? + + public var meta: [String: Any]? + + public var query: ArticleQuery? + + public var quantity: Int? + + public enum CodingKeys: String, CodingKey { + case groupId = "group_id" + + case articleAssignment = "article_assignment" + + case meta + + case query + + case quantity + } + + public init(articleAssignment: ArticleAssignment?, groupId: String?, meta: [String: Any]?, quantity: Int?, query: ArticleQuery?) { + self.groupId = groupId + + self.articleAssignment = articleAssignment + + self.meta = meta + + self.query = query + + self.quantity = quantity + } + + public func duplicate() -> AssignStoreArticle { + let dict = self.dictionary! + let copy = AssignStoreArticle(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + groupId = try container.decode(String.self, forKey: .groupId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + articleAssignment = try container.decode(ArticleAssignment.self, forKey: .articleAssignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode(ArticleQuery.self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(groupId, forKey: .groupId) + + try? container.encodeIfPresent(articleAssignment, forKey: .articleAssignment) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(query, forKey: .query) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + } + } + + /* + Model: AssignStore + Used By: Catalog + */ + + class AssignStore: Codable { + public var storeIds: [Int]? + + public var pincode: String + + public var appId: String + + public var companyId: Int? + + public var articles: [AssignStoreArticle] + + public var channelType: String? + + public var channelIdentifier: String? + + public enum CodingKeys: String, CodingKey { + case storeIds = "store_ids" + + case pincode + + case appId = "app_id" + + case companyId = "company_id" + + case articles + + case channelType = "channel_type" + + case channelIdentifier = "channel_identifier" + } + + public init(appId: String, articles: [AssignStoreArticle], channelIdentifier: String?, channelType: String?, companyId: Int?, pincode: String, storeIds: [Int]?) { + self.storeIds = storeIds + + self.pincode = pincode + + self.appId = appId + + self.companyId = companyId + + self.articles = articles + + self.channelType = channelType + + self.channelIdentifier = channelIdentifier + } + + public func duplicate() -> AssignStore { + let dict = self.dictionary! + let copy = AssignStore(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + storeIds = try container.decode([Int].self, forKey: .storeIds) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + pincode = try container.decode(String.self, forKey: .pincode) + + appId = try container.decode(String.self, forKey: .appId) + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + articles = try container.decode([AssignStoreArticle].self, forKey: .articles) + + do { + channelType = try container.decode(String.self, forKey: .channelType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + channelIdentifier = try container.decode(String.self, forKey: .channelIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(storeIds, forKey: .storeIds) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(articles, forKey: .articles) + + try? container.encodeIfPresent(channelType, forKey: .channelType) + + try? container.encodeIfPresent(channelIdentifier, forKey: .channelIdentifier) + } + } + + /* + Model: ArticleAssignment1 + Used By: Catalog + */ + + class ArticleAssignment1: Codable { + public var strategy: String? + + public var level: String? + + public enum CodingKeys: String, CodingKey { + case strategy + + case level + } + + public init(level: String?, strategy: String?) { + self.strategy = strategy + + self.level = level + } + + public func duplicate() -> ArticleAssignment1 { + let dict = self.dictionary! + let copy = ArticleAssignment1(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + strategy = try container.decode(String.self, forKey: .strategy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + level = try container.decode(String.self, forKey: .level) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(strategy, forKey: .strategy) + + try? container.encodeIfPresent(level, forKey: .level) + } + } + + /* + Model: StoreAssignResponse + Used By: Catalog + */ + + class StoreAssignResponse: Codable { + public var priceMarked: Int? + + public var uid: String? + + public var sCity: String? + + public var itemId: Int + + public var priceEffective: Int? + + public var index: Int? + + public var companyId: Int? + + public var groupId: String? + + public var strategyWiseListing: [[String: Any]]? + + public var meta: [String: Any]? + + public var articleAssignment: ArticleAssignment1 + + public var status: Bool + + public var id: String? + + public var storePincode: Int? + + public var size: String + + public var quantity: Int + + public var storeId: Int? + + public enum CodingKeys: String, CodingKey { + case priceMarked = "price_marked" + + case uid + + case sCity = "s_city" + + case itemId = "item_id" + + case priceEffective = "price_effective" + + case index + + case companyId = "company_id" + + case groupId = "group_id" + + case strategyWiseListing = "strategy_wise_listing" + + case meta + + case articleAssignment = "article_assignment" + + case status + + case id = "_id" + + case storePincode = "store_pincode" + + case size + + case quantity + + case storeId = "store_id" + } + + public init(articleAssignment: ArticleAssignment1, companyId: Int?, groupId: String?, index: Int?, itemId: Int, meta: [String: Any]?, priceEffective: Int?, priceMarked: Int?, quantity: Int, size: String, status: Bool, storeId: Int?, storePincode: Int?, strategyWiseListing: [[String: Any]]?, sCity: String?, uid: String?, id: String?) { + self.priceMarked = priceMarked + + self.uid = uid + + self.sCity = sCity + + self.itemId = itemId + + self.priceEffective = priceEffective + + self.index = index + + self.companyId = companyId + + self.groupId = groupId + + self.strategyWiseListing = strategyWiseListing + + self.meta = meta + + self.articleAssignment = articleAssignment + + self.status = status + + self.id = id + + self.storePincode = storePincode + + self.size = size + + self.quantity = quantity + + self.storeId = storeId + } + + public func duplicate() -> StoreAssignResponse { + let dict = self.dictionary! + let copy = StoreAssignResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + priceMarked = try container.decode(Int.self, forKey: .priceMarked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sCity = try container.decode(String.self, forKey: .sCity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + itemId = try container.decode(Int.self, forKey: .itemId) + + do { + priceEffective = try container.decode(Int.self, forKey: .priceEffective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + index = try container.decode(Int.self, forKey: .index) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + groupId = try container.decode(String.self, forKey: .groupId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + strategyWiseListing = try container.decode([[String: Any]].self, forKey: .strategyWiseListing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + articleAssignment = try container.decode(ArticleAssignment1.self, forKey: .articleAssignment) + + status = try container.decode(Bool.self, forKey: .status) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storePincode = try container.decode(Int.self, forKey: .storePincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + size = try container.decode(String.self, forKey: .size) + + quantity = try container.decode(Int.self, forKey: .quantity) + + do { + storeId = try container.decode(Int.self, forKey: .storeId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(priceMarked, forKey: .priceMarked) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(sCity, forKey: .sCity) + + try? container.encodeIfPresent(itemId, forKey: .itemId) + + try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) + + try? container.encodeIfPresent(index, forKey: .index) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(groupId, forKey: .groupId) + + try? container.encodeIfPresent(strategyWiseListing, forKey: .strategyWiseListing) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(articleAssignment, forKey: .articleAssignment) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(storePincode, forKey: .storePincode) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(storeId, forKey: .storeId) + } + } + + /* + Model: Document + Used By: Catalog + */ + + class Document: Codable { + public var type: String + + public var verified: Bool? + + public var value: String + + public var legalName: String? + + public var url: String? + + public enum CodingKeys: String, CodingKey { + case type + + case verified + + case value + + case legalName = "legal_name" + + case url + } + + public init(legalName: String?, type: String, url: String?, value: String, verified: Bool?) { + self.type = type + + self.verified = verified + + self.value = value + + self.legalName = legalName + + self.url = url + } + + public func duplicate() -> Document { + let dict = self.dictionary! + let copy = Document(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + type = try container.decode(String.self, forKey: .type) + + do { + verified = try container.decode(Bool.self, forKey: .verified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + value = try container.decode(String.self, forKey: .value) + + do { + legalName = try container.decode(String.self, forKey: .legalName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(verified, forKey: .verified) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(legalName, forKey: .legalName) + + try? container.encodeIfPresent(url, forKey: .url) + } + } + + /* + Model: UserSerializer1 + Used By: Catalog + */ + + class UserSerializer1: Codable { + public var userId: String? + + public var contact: String? + + public var username: String? + + public enum CodingKeys: String, CodingKey { + case userId = "user_id" + + case contact + + case username + } + + public init(contact: String?, username: String?, userId: String?) { + self.userId = userId + + self.contact = contact + + self.username = username + } + + public func duplicate() -> UserSerializer1 { + let dict = self.dictionary! + let copy = UserSerializer1(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contact = try container.decode(String.self, forKey: .contact) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(userId, forKey: .userId) + + try? container.encodeIfPresent(contact, forKey: .contact) + + try? container.encodeIfPresent(username, forKey: .username) + } + } + + /* + Model: GetAddressSerializer + Used By: Catalog + */ + + class GetAddressSerializer: Codable { + public var state: String? + + public var landmark: String? + + public var pincode: Int? + + public var address1: String? + + public var longitude: Double? + + public var city: String? + + public var address2: String? + + public var addressType: String? + + public var countryCode: String? + + public var latitude: Double? + + public var country: String? + + public enum CodingKeys: String, CodingKey { + case state + + case landmark + + case pincode + + case address1 + + case longitude + + case city + + case address2 + + case addressType = "address_type" + + case countryCode = "country_code" + + case latitude + + case country + } + + public init(address1: String?, address2: String?, addressType: String?, city: String?, country: String?, countryCode: String?, landmark: String?, latitude: Double?, longitude: Double?, pincode: Int?, state: String?) { + self.state = state + + self.landmark = landmark + + self.pincode = pincode + + self.address1 = address1 + + self.longitude = longitude + + self.city = city + + self.address2 = address2 + + self.addressType = addressType + + self.countryCode = countryCode + + self.latitude = latitude + + self.country = country + } + + public func duplicate() -> GetAddressSerializer { + let dict = self.dictionary! + let copy = GetAddressSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + landmark = try container.decode(String.self, forKey: .landmark) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(Int.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address1 = try container.decode(String.self, forKey: .address1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + longitude = try container.decode(Double.self, forKey: .longitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address2 = try container.decode(String.self, forKey: .address2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressType = try container.decode(String.self, forKey: .addressType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + latitude = try container.decode(Double.self, forKey: .latitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(landmark, forKey: .landmark) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(address1, forKey: .address1) + + try? container.encodeIfPresent(longitude, forKey: .longitude) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(address2, forKey: .address2) + + try? container.encodeIfPresent(addressType, forKey: .addressType) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(latitude, forKey: .latitude) + + try? container.encodeIfPresent(country, forKey: .country) + } + } + + /* + Model: GetCompanySerializer + Used By: Catalog + */ + + class GetCompanySerializer: Codable { + public var uid: Int? + + public var modifiedOn: String? + + public var companyType: String? + + public var stage: String? + + public var verifiedOn: String? + + public var createdBy: UserSerializer1? + + public var modifiedBy: UserSerializer1? + + public var businessType: String? + + public var verifiedBy: UserSerializer1? + + public var createdOn: String? + + public var rejectReason: String? + + public var name: String? + + public var addresses: [GetAddressSerializer]? + + public enum CodingKeys: String, CodingKey { + case uid + + case modifiedOn = "modified_on" + + case companyType = "company_type" + + case stage + + case verifiedOn = "verified_on" + + case createdBy = "created_by" + + case modifiedBy = "modified_by" + + case businessType = "business_type" + + case verifiedBy = "verified_by" + + case createdOn = "created_on" + + case rejectReason = "reject_reason" + + case name + + case addresses + } + + public init(addresses: [GetAddressSerializer]?, businessType: String?, companyType: String?, createdBy: UserSerializer1?, createdOn: String?, modifiedBy: UserSerializer1?, modifiedOn: String?, name: String?, rejectReason: String?, stage: String?, uid: Int?, verifiedBy: UserSerializer1?, verifiedOn: String?) { + self.uid = uid + + self.modifiedOn = modifiedOn + + self.companyType = companyType + + self.stage = stage + + self.verifiedOn = verifiedOn + + self.createdBy = createdBy + + self.modifiedBy = modifiedBy + + self.businessType = businessType + + self.verifiedBy = verifiedBy + + self.createdOn = createdOn + + self.rejectReason = rejectReason + + self.name = name + + self.addresses = addresses + } + + public func duplicate() -> GetCompanySerializer { + let dict = self.dictionary! + let copy = GetCompanySerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyType = try container.decode(String.self, forKey: .companyType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stage = try container.decode(String.self, forKey: .stage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifiedOn = try container.decode(String.self, forKey: .verifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(UserSerializer1.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode(UserSerializer1.self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + businessType = try container.decode(String.self, forKey: .businessType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifiedBy = try container.decode(UserSerializer1.self, forKey: .verifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rejectReason = try container.decode(String.self, forKey: .rejectReason) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addresses = try container.decode([GetAddressSerializer].self, forKey: .addresses) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(companyType, forKey: .companyType) + + try? container.encodeIfPresent(stage, forKey: .stage) + + try? container.encodeIfPresent(verifiedOn, forKey: .verifiedOn) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(businessType, forKey: .businessType) + + try? container.encodeIfPresent(verifiedBy, forKey: .verifiedBy) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(rejectReason, forKey: .rejectReason) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(addresses, forKey: .addresses) + } + } + + /* + Model: UserSerializer2 + Used By: Catalog + */ + + class UserSerializer2: Codable { + public var userId: String? + + public var contact: String? + + public var username: String? + + public enum CodingKeys: String, CodingKey { + case userId = "user_id" + + case contact + + case username + } + + public init(contact: String?, username: String?, userId: String?) { + self.userId = userId + + self.contact = contact + + self.username = username + } + + public func duplicate() -> UserSerializer2 { + let dict = self.dictionary! + let copy = UserSerializer2(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contact = try container.decode(String.self, forKey: .contact) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(userId, forKey: .userId) + + try? container.encodeIfPresent(contact, forKey: .contact) + + try? container.encodeIfPresent(username, forKey: .username) + } + } + + /* + Model: ProductReturnConfigSerializer + Used By: Catalog + */ + + class ProductReturnConfigSerializer: Codable { + public var storeUid: Int? + + public var onSameStore: Bool? + + public enum CodingKeys: String, CodingKey { + case storeUid = "store_uid" + + case onSameStore = "on_same_store" + } + + public init(onSameStore: Bool?, storeUid: Int?) { + self.storeUid = storeUid + + self.onSameStore = onSameStore + } + + public func duplicate() -> ProductReturnConfigSerializer { + let dict = self.dictionary! + let copy = ProductReturnConfigSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + storeUid = try container.decode(Int.self, forKey: .storeUid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + onSameStore = try container.decode(Bool.self, forKey: .onSameStore) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(storeUid, forKey: .storeUid) + + try? container.encodeIfPresent(onSameStore, forKey: .onSameStore) + } + } + + /* + Model: SellerPhoneNumber + Used By: Catalog + */ + + class SellerPhoneNumber: Codable { + public var number: String + + public var countryCode: Int + + public enum CodingKeys: String, CodingKey { + case number + + case countryCode = "country_code" + } + + public init(countryCode: Int, number: String) { + self.number = number + + self.countryCode = countryCode + } + + public func duplicate() -> SellerPhoneNumber { + let dict = self.dictionary! + let copy = SellerPhoneNumber(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + number = try container.decode(String.self, forKey: .number) + + countryCode = try container.decode(Int.self, forKey: .countryCode) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(number, forKey: .number) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + } + } + + /* + Model: InvoiceCredSerializer + Used By: Catalog + */ + + class InvoiceCredSerializer: Codable { + public var password: String? + + public var username: String? + + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case password + + case username + + case enabled + } + + public init(enabled: Bool?, password: String?, username: String?) { + self.password = password + + self.username = username + + self.enabled = enabled + } + + public func duplicate() -> InvoiceCredSerializer { + let dict = self.dictionary! + let copy = InvoiceCredSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + password = try container.decode(String.self, forKey: .password) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(password, forKey: .password) + + try? container.encodeIfPresent(username, forKey: .username) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: InvoiceDetailsSerializer + Used By: Catalog + */ + + class InvoiceDetailsSerializer: Codable { + public var eInvoice: InvoiceCredSerializer? + + public var eWaybill: InvoiceCredSerializer? + + public enum CodingKeys: String, CodingKey { + case eInvoice = "e_invoice" + + case eWaybill = "e_waybill" + } + + public init(eInvoice: InvoiceCredSerializer?, eWaybill: InvoiceCredSerializer?) { + self.eInvoice = eInvoice + + self.eWaybill = eWaybill + } + + public func duplicate() -> InvoiceDetailsSerializer { + let dict = self.dictionary! + let copy = InvoiceDetailsSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + eInvoice = try container.decode(InvoiceCredSerializer.self, forKey: .eInvoice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eWaybill = try container.decode(InvoiceCredSerializer.self, forKey: .eWaybill) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(eInvoice, forKey: .eInvoice) + + try? container.encodeIfPresent(eWaybill, forKey: .eWaybill) + } + } + + /* + Model: LocationManagerSerializer + Used By: Catalog + */ + + class LocationManagerSerializer: Codable { + public var email: String? + + public var name: String? + + public var mobileNo: SellerPhoneNumber + + public enum CodingKeys: String, CodingKey { + case email + + case name + + case mobileNo = "mobile_no" + } + + public init(email: String?, mobileNo: SellerPhoneNumber, name: String?) { + self.email = email + + self.name = name + + self.mobileNo = mobileNo + } + + public func duplicate() -> LocationManagerSerializer { + let dict = self.dictionary! + let copy = LocationManagerSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + mobileNo = try container.decode(SellerPhoneNumber.self, forKey: .mobileNo) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(mobileNo, forKey: .mobileNo) + } + } + + /* + Model: LocationTimingSerializer + Used By: Catalog + */ + + class LocationTimingSerializer: Codable { + public var minute: Int? + + public var hour: Int? + + public enum CodingKeys: String, CodingKey { + case minute + + case hour + } + + public init(hour: Int?, minute: Int?) { + self.minute = minute + + self.hour = hour + } + + public func duplicate() -> LocationTimingSerializer { + let dict = self.dictionary! + let copy = LocationTimingSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + minute = try container.decode(Int.self, forKey: .minute) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hour = try container.decode(Int.self, forKey: .hour) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(minute, forKey: .minute) + + try? container.encodeIfPresent(hour, forKey: .hour) + } + } + + /* + Model: LocationDayWiseSerializer + Used By: Catalog + */ + + class LocationDayWiseSerializer: Codable { + public var weekday: String + + public var closing: LocationTimingSerializer? + + public var open: Bool + + public var opening: LocationTimingSerializer? + + public enum CodingKeys: String, CodingKey { + case weekday + + case closing + + case open + + case opening + } + + public init(closing: LocationTimingSerializer?, open: Bool, opening: LocationTimingSerializer?, weekday: String) { + self.weekday = weekday + + self.closing = closing + + self.open = open + + self.opening = opening + } + + public func duplicate() -> LocationDayWiseSerializer { + let dict = self.dictionary! + let copy = LocationDayWiseSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + weekday = try container.decode(String.self, forKey: .weekday) + + do { + closing = try container.decode(LocationTimingSerializer.self, forKey: .closing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + open = try container.decode(Bool.self, forKey: .open) + + do { + opening = try container.decode(LocationTimingSerializer.self, forKey: .opening) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(weekday, forKey: .weekday) + + try? container.encodeIfPresent(closing, forKey: .closing) + + try? container.encodeIfPresent(open, forKey: .open) + + try? container.encodeIfPresent(opening, forKey: .opening) + } + } + + /* + Model: LocationIntegrationType + Used By: Catalog + */ + + class LocationIntegrationType: Codable { + public var order: String? + + public var inventory: String? + + public enum CodingKeys: String, CodingKey { + case order + + case inventory + } + + public init(inventory: String?, order: String?) { + self.order = order + + self.inventory = inventory + } + + public func duplicate() -> LocationIntegrationType { + let dict = self.dictionary! + let copy = LocationIntegrationType(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + order = try container.decode(String.self, forKey: .order) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + inventory = try container.decode(String.self, forKey: .inventory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(order, forKey: .order) + + try? container.encodeIfPresent(inventory, forKey: .inventory) + } + } + + /* + Model: GetLocationSerializer + Used By: Catalog + */ + + class GetLocationSerializer: Codable { + public var documents: [Document]? + + public var company: GetCompanySerializer? + + public var verifiedBy: UserSerializer2? + + public var productReturnConfig: ProductReturnConfigSerializer? + + public var stage: String? + + public var storeType: String? + + public var modifiedOn: String? + + public var contactNumbers: [SellerPhoneNumber]? + + public var verifiedOn: String? + + public var warnings: [String: Any]? + + public var code: String + + public var displayName: String + + public var gstCredentials: InvoiceDetailsSerializer? + + public var manager: LocationManagerSerializer? + + public var createdBy: UserSerializer2? + + public var createdOn: String? + + public var timing: [LocationDayWiseSerializer]? + + public var uid: Int? + + public var integrationType: LocationIntegrationType? + + public var phoneNumber: String + + public var notificationEmails: [String]? + + public var address: GetAddressSerializer + + public var modifiedBy: UserSerializer2? + + public var customJson: [String: Any]? + + public var name: String + + public enum CodingKeys: String, CodingKey { + case documents + + case company + + case verifiedBy = "verified_by" + + case productReturnConfig = "product_return_config" + + case stage + + case storeType = "store_type" + + case modifiedOn = "modified_on" + + case contactNumbers = "contact_numbers" + + case verifiedOn = "verified_on" + + case warnings + + case code + + case displayName = "display_name" + + case gstCredentials = "gst_credentials" + + case manager + + case createdBy = "created_by" + + case createdOn = "created_on" + + case timing + + case uid + + case integrationType = "integration_type" + + case phoneNumber = "phone_number" + + case notificationEmails = "notification_emails" + + case address + + case modifiedBy = "modified_by" + + case customJson = "_custom_json" + + case name + } + + public init(address: GetAddressSerializer, code: String, company: GetCompanySerializer?, contactNumbers: [SellerPhoneNumber]?, createdBy: UserSerializer2?, createdOn: String?, displayName: String, documents: [Document]?, gstCredentials: InvoiceDetailsSerializer?, integrationType: LocationIntegrationType?, manager: LocationManagerSerializer?, modifiedBy: UserSerializer2?, modifiedOn: String?, name: String, notificationEmails: [String]?, phoneNumber: String, productReturnConfig: ProductReturnConfigSerializer?, stage: String?, storeType: String?, timing: [LocationDayWiseSerializer]?, uid: Int?, verifiedBy: UserSerializer2?, verifiedOn: String?, warnings: [String: Any]?, customJson: [String: Any]?) { + self.documents = documents + + self.company = company + + self.verifiedBy = verifiedBy + + self.productReturnConfig = productReturnConfig + + self.stage = stage + + self.storeType = storeType + + self.modifiedOn = modifiedOn + + self.contactNumbers = contactNumbers + + self.verifiedOn = verifiedOn + + self.warnings = warnings + + self.code = code + + self.displayName = displayName + + self.gstCredentials = gstCredentials + + self.manager = manager + + self.createdBy = createdBy + + self.createdOn = createdOn + + self.timing = timing + + self.uid = uid + + self.integrationType = integrationType + + self.phoneNumber = phoneNumber + + self.notificationEmails = notificationEmails + + self.address = address + + self.modifiedBy = modifiedBy + + self.customJson = customJson + + self.name = name + } + + public func duplicate() -> GetLocationSerializer { + let dict = self.dictionary! + let copy = GetLocationSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + documents = try container.decode([Document].self, forKey: .documents) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + company = try container.decode(GetCompanySerializer.self, forKey: .company) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifiedBy = try container.decode(UserSerializer2.self, forKey: .verifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productReturnConfig = try container.decode(ProductReturnConfigSerializer.self, forKey: .productReturnConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stage = try container.decode(String.self, forKey: .stage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeType = try container.decode(String.self, forKey: .storeType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contactNumbers = try container.decode([SellerPhoneNumber].self, forKey: .contactNumbers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifiedOn = try container.decode(String.self, forKey: .verifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + warnings = try container.decode([String: Any].self, forKey: .warnings) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + code = try container.decode(String.self, forKey: .code) + + displayName = try container.decode(String.self, forKey: .displayName) + + do { + gstCredentials = try container.decode(InvoiceDetailsSerializer.self, forKey: .gstCredentials) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + manager = try container.decode(LocationManagerSerializer.self, forKey: .manager) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(UserSerializer2.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + timing = try container.decode([LocationDayWiseSerializer].self, forKey: .timing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + integrationType = try container.decode(LocationIntegrationType.self, forKey: .integrationType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + phoneNumber = try container.decode(String.self, forKey: .phoneNumber) + + do { + notificationEmails = try container.decode([String].self, forKey: .notificationEmails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + address = try container.decode(GetAddressSerializer.self, forKey: .address) + + do { + modifiedBy = try container.decode(UserSerializer2.self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + name = try container.decode(String.self, forKey: .name) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(documents, forKey: .documents) + + try? container.encodeIfPresent(company, forKey: .company) + + try? container.encodeIfPresent(verifiedBy, forKey: .verifiedBy) + + try? container.encodeIfPresent(productReturnConfig, forKey: .productReturnConfig) + + try? container.encodeIfPresent(stage, forKey: .stage) + + try? container.encodeIfPresent(storeType, forKey: .storeType) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(contactNumbers, forKey: .contactNumbers) + + try? container.encodeIfPresent(verifiedOn, forKey: .verifiedOn) + + try? container.encodeIfPresent(warnings, forKey: .warnings) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(gstCredentials, forKey: .gstCredentials) + + try? container.encodeIfPresent(manager, forKey: .manager) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(timing, forKey: .timing) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(integrationType, forKey: .integrationType) + + try? container.encodeIfPresent(phoneNumber, forKey: .phoneNumber) + + try? container.encodeIfPresent(notificationEmails, forKey: .notificationEmails) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: LocationListSerializer + Used By: Catalog + */ + + class LocationListSerializer: Codable { + public var page: Page? + + public var items: [GetLocationSerializer]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [GetLocationSerializer]?, page: Page?) { + self.page = page + + self.items = items + } + + public func duplicate() -> LocationListSerializer { + let dict = self.dictionary! + let copy = LocationListSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([GetLocationSerializer].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } +} diff --git a/Sources/code/platform/models/CommonPlatformModelClass.swift b/Sources/code/platform/models/CommonPlatformModelClass.swift new file mode 100644 index 0000000000..7875f2c0b9 --- /dev/null +++ b/Sources/code/platform/models/CommonPlatformModelClass.swift @@ -0,0 +1,1524 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: ApplicationResponse + Used By: Common + */ + + class ApplicationResponse: Codable { + public var application: Application? + + public enum CodingKeys: String, CodingKey { + case application + } + + public init(application: Application?) { + self.application = application + } + + public func duplicate() -> ApplicationResponse { + let dict = self.dictionary! + let copy = ApplicationResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(Application.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + } + } + + /* + Model: Currency + Used By: Common + */ + + class Currency: Codable { + public var id: String? + + public var isActive: Bool? + + public var name: String? + + public var code: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var decimalDigits: Int? + + public var symbol: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case isActive = "is_active" + + case name + + case code + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case decimalDigits = "decimal_digits" + + case symbol + } + + public init(code: String?, createdAt: String?, decimalDigits: Int?, isActive: Bool?, name: String?, symbol: String?, updatedAt: String?, id: String?) { + self.id = id + + self.isActive = isActive + + self.name = name + + self.code = code + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.decimalDigits = decimalDigits + + self.symbol = symbol + } + + public func duplicate() -> Currency { + let dict = self.dictionary! + let copy = Currency(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + decimalDigits = try container.decode(Int.self, forKey: .decimalDigits) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + symbol = try container.decode(String.self, forKey: .symbol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(decimalDigits, forKey: .decimalDigits) + + try? container.encodeIfPresent(symbol, forKey: .symbol) + } + } + + /* + Model: Domain + Used By: Common + */ + + class Domain: Codable { + public var verified: Bool? + + public var isPrimary: Bool? + + public var isShortlink: Bool? + + public var id: String? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case verified + + case isPrimary = "is_primary" + + case isShortlink = "is_shortlink" + + case id = "_id" + + case name + } + + public init(isPrimary: Bool?, isShortlink: Bool?, name: String?, verified: Bool?, id: String?) { + self.verified = verified + + self.isPrimary = isPrimary + + self.isShortlink = isShortlink + + self.id = id + + self.name = name + } + + public func duplicate() -> Domain { + let dict = self.dictionary! + let copy = Domain(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + verified = try container.decode(Bool.self, forKey: .verified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isPrimary = try container.decode(Bool.self, forKey: .isPrimary) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isShortlink = try container.decode(Bool.self, forKey: .isShortlink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(verified, forKey: .verified) + + try? container.encodeIfPresent(isPrimary, forKey: .isPrimary) + + try? container.encodeIfPresent(isShortlink, forKey: .isShortlink) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: ApplicationWebsite + Used By: Common + */ + + class ApplicationWebsite: Codable { + public var enabled: Bool? + + public var basepath: String? + + public enum CodingKeys: String, CodingKey { + case enabled + + case basepath + } + + public init(basepath: String?, enabled: Bool?) { + self.enabled = enabled + + self.basepath = basepath + } + + public func duplicate() -> ApplicationWebsite { + let dict = self.dictionary! + let copy = ApplicationWebsite(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + basepath = try container.decode(String.self, forKey: .basepath) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(basepath, forKey: .basepath) + } + } + + /* + Model: ApplicationCors + Used By: Common + */ + + class ApplicationCors: Codable { + public var domains: [String]? + + public enum CodingKeys: String, CodingKey { + case domains + } + + public init(domains: [String]?) { + self.domains = domains + } + + public func duplicate() -> ApplicationCors { + let dict = self.dictionary! + let copy = ApplicationCors(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + domains = try container.decode([String].self, forKey: .domains) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(domains, forKey: .domains) + } + } + + /* + Model: ApplicationAuth + Used By: Common + */ + + class ApplicationAuth: Codable { + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case enabled + } + + public init(enabled: Bool?) { + self.enabled = enabled + } + + public func duplicate() -> ApplicationAuth { + let dict = self.dictionary! + let copy = ApplicationAuth(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: ApplicationRedirections + Used By: Common + */ + + class ApplicationRedirections: Codable { + public var redirectFrom: String? + + public var redirectTo: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case redirectFrom = "redirect_from" + + case redirectTo = "redirect_to" + + case type + } + + public init(redirectFrom: String?, redirectTo: String?, type: String?) { + self.redirectFrom = redirectFrom + + self.redirectTo = redirectTo + + self.type = type + } + + public func duplicate() -> ApplicationRedirections { + let dict = self.dictionary! + let copy = ApplicationRedirections(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + redirectFrom = try container.decode(String.self, forKey: .redirectFrom) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + redirectTo = try container.decode(String.self, forKey: .redirectTo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(redirectFrom, forKey: .redirectFrom) + + try? container.encodeIfPresent(redirectTo, forKey: .redirectTo) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: ApplicationMeta + Used By: Common + */ + + class ApplicationMeta: Codable { + public var name: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case name + + case value + } + + public init(name: String?, value: String?) { + self.name = name + + self.value = value + } + + public func duplicate() -> ApplicationMeta { + let dict = self.dictionary! + let copy = ApplicationMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: SecureUrl + Used By: Common + */ + + class SecureUrl: Codable { + public var secureUrl: String? + + public enum CodingKeys: String, CodingKey { + case secureUrl = "secure_url" + } + + public init(secureUrl: String?) { + self.secureUrl = secureUrl + } + + public func duplicate() -> SecureUrl { + let dict = self.dictionary! + let copy = SecureUrl(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + secureUrl = try container.decode(String.self, forKey: .secureUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) + } + } + + /* + Model: Application + Used By: Common + */ + + class Application: Codable { + public var website: ApplicationWebsite? + + public var cors: ApplicationCors? + + public var auth: ApplicationAuth? + + public var description: String? + + public var channelType: String? + + public var cacheTtl: Int? + + public var isInternal: Bool? + + public var isActive: Bool? + + public var id: String? + + public var name: String? + + public var owner: String? + + public var companyId: Int? + + public var token: String? + + public var redirections: [ApplicationRedirections]? + + public var meta: [ApplicationMeta]? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public var banner: SecureUrl? + + public var logo: SecureUrl? + + public var favicon: SecureUrl? + + public var domains: [Domain]? + + public var appType: String? + + public var mobileLogo: SecureUrl? + + public var domain: Domain? + + public enum CodingKeys: String, CodingKey { + case website + + case cors + + case auth + + case description + + case channelType = "channel_type" + + case cacheTtl = "cache_ttl" + + case isInternal = "is_internal" + + case isActive = "is_active" + + case id = "_id" + + case name + + case owner + + case companyId = "company_id" + + case token + + case redirections + + case meta + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + + case banner + + case logo + + case favicon + + case domains + + case appType = "app_type" + + case mobileLogo = "mobile_logo" + + case domain + } + + public init(appType: String?, auth: ApplicationAuth?, banner: SecureUrl?, cacheTtl: Int?, channelType: String?, companyId: Int?, cors: ApplicationCors?, createdAt: String?, description: String?, domain: Domain?, domains: [Domain]?, favicon: SecureUrl?, isActive: Bool?, isInternal: Bool?, logo: SecureUrl?, meta: [ApplicationMeta]?, mobileLogo: SecureUrl?, name: String?, owner: String?, redirections: [ApplicationRedirections]?, token: String?, updatedAt: String?, website: ApplicationWebsite?, id: String?, v: Int?) { + self.website = website + + self.cors = cors + + self.auth = auth + + self.description = description + + self.channelType = channelType + + self.cacheTtl = cacheTtl + + self.isInternal = isInternal + + self.isActive = isActive + + self.id = id + + self.name = name + + self.owner = owner + + self.companyId = companyId + + self.token = token + + self.redirections = redirections + + self.meta = meta + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + + self.banner = banner + + self.logo = logo + + self.favicon = favicon + + self.domains = domains + + self.appType = appType + + self.mobileLogo = mobileLogo + + self.domain = domain + } + + public func duplicate() -> Application { + let dict = self.dictionary! + let copy = Application(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + website = try container.decode(ApplicationWebsite.self, forKey: .website) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cors = try container.decode(ApplicationCors.self, forKey: .cors) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + auth = try container.decode(ApplicationAuth.self, forKey: .auth) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + channelType = try container.decode(String.self, forKey: .channelType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cacheTtl = try container.decode(Int.self, forKey: .cacheTtl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isInternal = try container.decode(Bool.self, forKey: .isInternal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + owner = try container.decode(String.self, forKey: .owner) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + token = try container.decode(String.self, forKey: .token) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + redirections = try container.decode([ApplicationRedirections].self, forKey: .redirections) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([ApplicationMeta].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banner = try container.decode(SecureUrl.self, forKey: .banner) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(SecureUrl.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + favicon = try container.decode(SecureUrl.self, forKey: .favicon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + domains = try container.decode([Domain].self, forKey: .domains) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appType = try container.decode(String.self, forKey: .appType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobileLogo = try container.decode(SecureUrl.self, forKey: .mobileLogo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + domain = try container.decode(Domain.self, forKey: .domain) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(website, forKey: .website) + + try? container.encodeIfPresent(cors, forKey: .cors) + + try? container.encodeIfPresent(auth, forKey: .auth) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(channelType, forKey: .channelType) + + try? container.encodeIfPresent(cacheTtl, forKey: .cacheTtl) + + try? container.encodeIfPresent(isInternal, forKey: .isInternal) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(owner, forKey: .owner) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(token, forKey: .token) + + try? container.encodeIfPresent(redirections, forKey: .redirections) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + + try? container.encodeIfPresent(banner, forKey: .banner) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(favicon, forKey: .favicon) + + try? container.encodeIfPresent(domains, forKey: .domains) + + try? container.encodeIfPresent(appType, forKey: .appType) + + try? container.encodeIfPresent(mobileLogo, forKey: .mobileLogo) + + try? container.encodeIfPresent(domain, forKey: .domain) + } + } + + /* + Model: NotFound + Used By: Common + */ + + class NotFound: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> NotFound { + let dict = self.dictionary! + let copy = NotFound(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: BadRequest + Used By: Common + */ + + class BadRequest: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> BadRequest { + let dict = self.dictionary! + let copy = BadRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: LocationDefaultLanguage + Used By: Common + */ + + class LocationDefaultLanguage: Codable { + public var name: String? + + public var code: String? + + public enum CodingKeys: String, CodingKey { + case name + + case code + } + + public init(code: String?, name: String?) { + self.name = name + + self.code = code + } + + public func duplicate() -> LocationDefaultLanguage { + let dict = self.dictionary! + let copy = LocationDefaultLanguage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: LocationDefaultCurrency + Used By: Common + */ + + class LocationDefaultCurrency: Codable { + public var name: String? + + public var symbol: String? + + public var code: String? + + public enum CodingKeys: String, CodingKey { + case name + + case symbol + + case code + } + + public init(code: String?, name: String?, symbol: String?) { + self.name = name + + self.symbol = symbol + + self.code = code + } + + public func duplicate() -> LocationDefaultCurrency { + let dict = self.dictionary! + let copy = LocationDefaultCurrency(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + symbol = try container.decode(String.self, forKey: .symbol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(symbol, forKey: .symbol) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: LocationCountry + Used By: Common + */ + + class LocationCountry: Codable { + public var capital: String? + + public var currency: String? + + public var iso2: String? + + public var iso3: String? + + public var name: String? + + public var parent: String? + + public var phoneCode: String? + + public var type: String? + + public var uid: Int? + + public var v: Int? + + public var id: String? + + public var defaultCurrency: LocationDefaultCurrency? + + public var defaultLanguage: LocationDefaultLanguage? + + public enum CodingKeys: String, CodingKey { + case capital + + case currency + + case iso2 + + case iso3 + + case name + + case parent + + case phoneCode = "phone_code" + + case type + + case uid + + case v = "__v" + + case id = "_id" + + case defaultCurrency = "default_currency" + + case defaultLanguage = "default_language" + } + + public init(capital: String?, currency: String?, defaultCurrency: LocationDefaultCurrency?, defaultLanguage: LocationDefaultLanguage?, iso2: String?, iso3: String?, name: String?, parent: String?, phoneCode: String?, type: String?, uid: Int?, id: String?, v: Int?) { + self.capital = capital + + self.currency = currency + + self.iso2 = iso2 + + self.iso3 = iso3 + + self.name = name + + self.parent = parent + + self.phoneCode = phoneCode + + self.type = type + + self.uid = uid + + self.v = v + + self.id = id + + self.defaultCurrency = defaultCurrency + + self.defaultLanguage = defaultLanguage + } + + public func duplicate() -> LocationCountry { + let dict = self.dictionary! + let copy = LocationCountry(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + capital = try container.decode(String.self, forKey: .capital) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + iso2 = try container.decode(String.self, forKey: .iso2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + iso3 = try container.decode(String.self, forKey: .iso3) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + parent = try container.decode(String.self, forKey: .parent) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phoneCode = try container.decode(String.self, forKey: .phoneCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + defaultCurrency = try container.decode(LocationDefaultCurrency.self, forKey: .defaultCurrency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + defaultLanguage = try container.decode(LocationDefaultLanguage.self, forKey: .defaultLanguage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(capital, forKey: .capital) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(iso2, forKey: .iso2) + + try? container.encodeIfPresent(iso3, forKey: .iso3) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(parent, forKey: .parent) + + try? container.encodeIfPresent(phoneCode, forKey: .phoneCode) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(v, forKey: .v) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(defaultCurrency, forKey: .defaultCurrency) + + try? container.encodeIfPresent(defaultLanguage, forKey: .defaultLanguage) + } + } + + /* + Model: Locations + Used By: Common + */ + + class Locations: Codable { + public var items: [[String: Any]]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [[String: Any]]?) { + self.items = items + } + + public func duplicate() -> Locations { + let dict = self.dictionary! + let copy = Locations(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([[String: Any]].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } +} diff --git a/Sources/code/platform/models/CommunicationPlatformModelClass.swift b/Sources/code/platform/models/CommunicationPlatformModelClass.swift new file mode 100644 index 0000000000..992b3f3361 --- /dev/null +++ b/Sources/code/platform/models/CommunicationPlatformModelClass.swift @@ -0,0 +1,8511 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: StatsImported + Used By: Communication + */ + + class StatsImported: Codable { + public var count: Int? + + public enum CodingKeys: String, CodingKey { + case count + } + + public init(count: Int?) { + self.count = count + } + + public func duplicate() -> StatsImported { + let dict = self.dictionary! + let copy = StatsImported(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(count, forKey: .count) + } + } + + /* + Model: StatsProcessedEmail + Used By: Communication + */ + + class StatsProcessedEmail: Codable { + public var success: Int? + + public var failed: Int? + + public var suppressed: Int? + + public enum CodingKeys: String, CodingKey { + case success + + case failed + + case suppressed + } + + public init(failed: Int?, success: Int?, suppressed: Int?) { + self.success = success + + self.failed = failed + + self.suppressed = suppressed + } + + public func duplicate() -> StatsProcessedEmail { + let dict = self.dictionary! + let copy = StatsProcessedEmail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Int.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + failed = try container.decode(Int.self, forKey: .failed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + suppressed = try container.decode(Int.self, forKey: .suppressed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(failed, forKey: .failed) + + try? container.encodeIfPresent(suppressed, forKey: .suppressed) + } + } + + /* + Model: StatsProcessedSms + Used By: Communication + */ + + class StatsProcessedSms: Codable { + public var success: Int? + + public var failed: Int? + + public var suppressed: Int? + + public enum CodingKeys: String, CodingKey { + case success + + case failed + + case suppressed + } + + public init(failed: Int?, success: Int?, suppressed: Int?) { + self.success = success + + self.failed = failed + + self.suppressed = suppressed + } + + public func duplicate() -> StatsProcessedSms { + let dict = self.dictionary! + let copy = StatsProcessedSms(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Int.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + failed = try container.decode(Int.self, forKey: .failed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + suppressed = try container.decode(Int.self, forKey: .suppressed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(failed, forKey: .failed) + + try? container.encodeIfPresent(suppressed, forKey: .suppressed) + } + } + + /* + Model: StatsProcessed + Used By: Communication + */ + + class StatsProcessed: Codable { + public var email: StatsProcessedEmail? + + public var sms: StatsProcessedSms? + + public enum CodingKeys: String, CodingKey { + case email + + case sms + } + + public init(email: StatsProcessedEmail?, sms: StatsProcessedSms?) { + self.email = email + + self.sms = sms + } + + public func duplicate() -> StatsProcessed { + let dict = self.dictionary! + let copy = StatsProcessed(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(StatsProcessedEmail.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sms = try container.decode(StatsProcessedSms.self, forKey: .sms) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(sms, forKey: .sms) + } + } + + /* + Model: Stats + Used By: Communication + */ + + class Stats: Codable { + public var id: String? + + public var imported: [String: Any]? + + public var processed: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case imported + + case processed + } + + public init(imported: [String: Any]?, processed: [String: Any]?, id: String?) { + self.id = id + + self.imported = imported + + self.processed = processed + } + + public func duplicate() -> Stats { + let dict = self.dictionary! + let copy = Stats(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + imported = try container.decode([String: Any].self, forKey: .imported) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + processed = try container.decode([String: Any].self, forKey: .processed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(imported, forKey: .imported) + + try? container.encodeIfPresent(processed, forKey: .processed) + } + } + + /* + Model: GetStats + Used By: Communication + */ + + class GetStats: Codable { + public var items: [Stats]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [Stats]?) { + self.items = items + } + + public func duplicate() -> GetStats { + let dict = self.dictionary! + let copy = GetStats(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Stats].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: CampaignReq + Used By: Communication + */ + + class CampaignReq: Codable { + public var description: String? + + public var tags: [String]? + + public var headers: [String]? + + public var isActive: Bool? + + public var name: String? + + public var fileUrl: String? + + public var type: String? + + public var recordsCount: Int? + + public var application: String? + + public enum CodingKeys: String, CodingKey { + case description + + case tags + + case headers + + case isActive = "is_active" + + case name + + case fileUrl = "file_url" + + case type + + case recordsCount = "records_count" + + case application + } + + public init(application: String?, description: String?, fileUrl: String?, headers: [String]?, isActive: Bool?, name: String?, recordsCount: Int?, tags: [String]?, type: String?) { + self.description = description + + self.tags = tags + + self.headers = headers + + self.isActive = isActive + + self.name = name + + self.fileUrl = fileUrl + + self.type = type + + self.recordsCount = recordsCount + + self.application = application + } + + public func duplicate() -> CampaignReq { + let dict = self.dictionary! + let copy = CampaignReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + headers = try container.decode([String].self, forKey: .headers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fileUrl = try container.decode(String.self, forKey: .fileUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + recordsCount = try container.decode(Int.self, forKey: .recordsCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(headers, forKey: .headers) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(fileUrl, forKey: .fileUrl) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(recordsCount, forKey: .recordsCount) + + try? container.encodeIfPresent(application, forKey: .application) + } + } + + /* + Model: RecipientHeaders + Used By: Communication + */ + + class RecipientHeaders: Codable { + public var email: String? + + public enum CodingKeys: String, CodingKey { + case email + } + + public init(email: String?) { + self.email = email + } + + public func duplicate() -> RecipientHeaders { + let dict = self.dictionary! + let copy = RecipientHeaders(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + } + } + + /* + Model: CampaignEmailTemplate + Used By: Communication + */ + + class CampaignEmailTemplate: Codable { + public var key: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case key + + case value + } + + public init(key: String?, value: String?) { + self.key = key + + self.value = value + } + + public func duplicate() -> CampaignEmailTemplate { + let dict = self.dictionary! + let copy = CampaignEmailTemplate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: CampignEmailProvider + Used By: Communication + */ + + class CampignEmailProvider: Codable { + public var id: String? + + public var fromName: String? + + public var fromEmail: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case fromName = "from_name" + + case fromEmail = "from_email" + } + + public init(fromEmail: String?, fromName: String?, id: String?) { + self.id = id + + self.fromName = fromName + + self.fromEmail = fromEmail + } + + public func duplicate() -> CampignEmailProvider { + let dict = self.dictionary! + let copy = CampignEmailProvider(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fromName = try container.decode(String.self, forKey: .fromName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fromEmail = try container.decode(String.self, forKey: .fromEmail) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(fromName, forKey: .fromName) + + try? container.encodeIfPresent(fromEmail, forKey: .fromEmail) + } + } + + /* + Model: CampaignEmail + Used By: Communication + */ + + class CampaignEmail: Codable { + public var template: CampaignEmailTemplate? + + public var provider: CampignEmailProvider? + + public enum CodingKeys: String, CodingKey { + case template + + case provider + } + + public init(provider: CampignEmailProvider?, template: CampaignEmailTemplate?) { + self.template = template + + self.provider = provider + } + + public func duplicate() -> CampaignEmail { + let dict = self.dictionary! + let copy = CampaignEmail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + template = try container.decode(CampaignEmailTemplate.self, forKey: .template) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + provider = try container.decode(CampignEmailProvider.self, forKey: .provider) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(template, forKey: .template) + + try? container.encodeIfPresent(provider, forKey: .provider) + } + } + + /* + Model: Campaign + Used By: Communication + */ + + class Campaign: Codable { + public var recipientHeaders: RecipientHeaders? + + public var email: CampaignEmail? + + public var description: String? + + public var tags: [[String: Any]]? + + public var isActive: Bool? + + public var id: String? + + public var datasource: String? + + public var type: String? + + public var name: String? + + public var application: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var slug: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case recipientHeaders = "recipient_headers" + + case email + + case description + + case tags + + case isActive = "is_active" + + case id = "_id" + + case datasource + + case type + + case name + + case application + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case slug + + case v = "__v" + } + + public init(application: String?, createdAt: String?, datasource: String?, description: String?, email: CampaignEmail?, isActive: Bool?, name: String?, recipientHeaders: RecipientHeaders?, slug: String?, tags: [[String: Any]]?, type: String?, updatedAt: String?, id: String?, v: Int?) { + self.recipientHeaders = recipientHeaders + + self.email = email + + self.description = description + + self.tags = tags + + self.isActive = isActive + + self.id = id + + self.datasource = datasource + + self.type = type + + self.name = name + + self.application = application + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.slug = slug + + self.v = v + } + + public func duplicate() -> Campaign { + let dict = self.dictionary! + let copy = Campaign(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + recipientHeaders = try container.decode(RecipientHeaders.self, forKey: .recipientHeaders) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(CampaignEmail.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([[String: Any]].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + datasource = try container.decode(String.self, forKey: .datasource) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(recipientHeaders, forKey: .recipientHeaders) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(datasource, forKey: .datasource) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: Campaigns + Used By: Communication + */ + + class Campaigns: Codable { + public var items: [Campaign]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [Campaign]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> Campaigns { + let dict = self.dictionary! + let copy = Campaigns(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Campaign].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: BigqueryHeadersReq + Used By: Communication + */ + + class BigqueryHeadersReq: Codable { + public var query: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case query + + case type + } + + public init(query: String?, type: String?) { + self.query = query + + self.type = type + } + + public func duplicate() -> BigqueryHeadersReq { + let dict = self.dictionary! + let copy = BigqueryHeadersReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + query = try container.decode(String.self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(query, forKey: .query) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: BigqueryHeadersResHeaders + Used By: Communication + */ + + class BigqueryHeadersResHeaders: Codable { + public var name: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case name + + case type + } + + public init(name: String?, type: String?) { + self.name = name + + self.type = type + } + + public func duplicate() -> BigqueryHeadersResHeaders { + let dict = self.dictionary! + let copy = BigqueryHeadersResHeaders(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: BigqueryHeadersRes + Used By: Communication + */ + + class BigqueryHeadersRes: Codable { + public var headers: [BigqueryHeadersResHeaders]? + + public enum CodingKeys: String, CodingKey { + case headers + } + + public init(headers: [BigqueryHeadersResHeaders]?) { + self.headers = headers + } + + public func duplicate() -> BigqueryHeadersRes { + let dict = self.dictionary! + let copy = BigqueryHeadersRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + headers = try container.decode([BigqueryHeadersResHeaders].self, forKey: .headers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(headers, forKey: .headers) + } + } + + /* + Model: GetNRecordsCsvReq + Used By: Communication + */ + + class GetNRecordsCsvReq: Codable { + public var url: String? + + public var header: Bool? + + public var count: Int? + + public enum CodingKeys: String, CodingKey { + case url + + case header + + case count + } + + public init(count: Int?, header: Bool?, url: String?) { + self.url = url + + self.header = header + + self.count = count + } + + public func duplicate() -> GetNRecordsCsvReq { + let dict = self.dictionary! + let copy = GetNRecordsCsvReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + header = try container.decode(Bool.self, forKey: .header) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(header, forKey: .header) + + try? container.encodeIfPresent(count, forKey: .count) + } + } + + /* + Model: GetNRecordsCsvResItems + Used By: Communication + */ + + class GetNRecordsCsvResItems: Codable { + public var phoneNumber: String? + + public var email: String? + + public var firstname: String? + + public var lastname: String? + + public var orderid: String? + + public enum CodingKeys: String, CodingKey { + case phoneNumber = "phone_number" + + case email + + case firstname + + case lastname + + case orderid + } + + public init(email: String?, firstname: String?, lastname: String?, orderid: String?, phoneNumber: String?) { + self.phoneNumber = phoneNumber + + self.email = email + + self.firstname = firstname + + self.lastname = lastname + + self.orderid = orderid + } + + public func duplicate() -> GetNRecordsCsvResItems { + let dict = self.dictionary! + let copy = GetNRecordsCsvResItems(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + phoneNumber = try container.decode(String.self, forKey: .phoneNumber) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + firstname = try container.decode(String.self, forKey: .firstname) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastname = try container.decode(String.self, forKey: .lastname) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderid = try container.decode(String.self, forKey: .orderid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(phoneNumber, forKey: .phoneNumber) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(firstname, forKey: .firstname) + + try? container.encodeIfPresent(lastname, forKey: .lastname) + + try? container.encodeIfPresent(orderid, forKey: .orderid) + } + } + + /* + Model: GetNRecordsCsvRes + Used By: Communication + */ + + class GetNRecordsCsvRes: Codable { + public var items: [GetNRecordsCsvResItems]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [GetNRecordsCsvResItems]?) { + self.items = items + } + + public func duplicate() -> GetNRecordsCsvRes { + let dict = self.dictionary! + let copy = GetNRecordsCsvRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([GetNRecordsCsvResItems].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: AudienceReq + Used By: Communication + */ + + class AudienceReq: Codable { + public var description: String? + + public var tags: [String]? + + public var headers: [String]? + + public var isActive: Bool? + + public var name: String? + + public var fileUrl: String? + + public var type: String? + + public var recordsCount: Int? + + public var application: String? + + public enum CodingKeys: String, CodingKey { + case description + + case tags + + case headers + + case isActive = "is_active" + + case name + + case fileUrl = "file_url" + + case type + + case recordsCount = "records_count" + + case application + } + + public init(application: String?, description: String?, fileUrl: String?, headers: [String]?, isActive: Bool?, name: String?, recordsCount: Int?, tags: [String]?, type: String?) { + self.description = description + + self.tags = tags + + self.headers = headers + + self.isActive = isActive + + self.name = name + + self.fileUrl = fileUrl + + self.type = type + + self.recordsCount = recordsCount + + self.application = application + } + + public func duplicate() -> AudienceReq { + let dict = self.dictionary! + let copy = AudienceReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + headers = try container.decode([String].self, forKey: .headers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fileUrl = try container.decode(String.self, forKey: .fileUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + recordsCount = try container.decode(Int.self, forKey: .recordsCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(headers, forKey: .headers) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(fileUrl, forKey: .fileUrl) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(recordsCount, forKey: .recordsCount) + + try? container.encodeIfPresent(application, forKey: .application) + } + } + + /* + Model: Audience + Used By: Communication + */ + + class Audience: Codable { + public var description: String? + + public var tags: [String]? + + public var headers: [String]? + + public var isActive: Bool? + + public var id: String? + + public var name: String? + + public var fileUrl: String? + + public var type: String? + + public var recordsCount: Int? + + public var application: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var slug: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case description + + case tags + + case headers + + case isActive = "is_active" + + case id = "_id" + + case name + + case fileUrl = "file_url" + + case type + + case recordsCount = "records_count" + + case application + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case slug + + case v = "__v" + } + + public init(application: String?, createdAt: String?, description: String?, fileUrl: String?, headers: [String]?, isActive: Bool?, name: String?, recordsCount: Int?, slug: String?, tags: [String]?, type: String?, updatedAt: String?, id: String?, v: Int?) { + self.description = description + + self.tags = tags + + self.headers = headers + + self.isActive = isActive + + self.id = id + + self.name = name + + self.fileUrl = fileUrl + + self.type = type + + self.recordsCount = recordsCount + + self.application = application + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.slug = slug + + self.v = v + } + + public func duplicate() -> Audience { + let dict = self.dictionary! + let copy = Audience(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + headers = try container.decode([String].self, forKey: .headers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fileUrl = try container.decode(String.self, forKey: .fileUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + recordsCount = try container.decode(Int.self, forKey: .recordsCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(headers, forKey: .headers) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(fileUrl, forKey: .fileUrl) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(recordsCount, forKey: .recordsCount) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: Audiences + Used By: Communication + */ + + class Audiences: Codable { + public var items: [Audience]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [Audience]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> Audiences { + let dict = self.dictionary! + let copy = Audiences(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Audience].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: EmailProviderReqFrom + Used By: Communication + */ + + class EmailProviderReqFrom: Codable { + public var name: String? + + public var email: String? + + public var isDefault: Bool? + + public enum CodingKeys: String, CodingKey { + case name + + case email + + case isDefault = "is_default" + } + + public init(email: String?, isDefault: Bool?, name: String?) { + self.name = name + + self.email = email + + self.isDefault = isDefault + } + + public func duplicate() -> EmailProviderReqFrom { + let dict = self.dictionary! + let copy = EmailProviderReqFrom(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isDefault = try container.decode(Bool.self, forKey: .isDefault) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(isDefault, forKey: .isDefault) + } + } + + /* + Model: EmailProviderReq + Used By: Communication + */ + + class EmailProviderReq: Codable { + public var name: String? + + public var description: String? + + public var apiKey: String? + + public var type: String? + + public var provider: String? + + public var fromAddress: [EmailProviderReqFrom]? + + public enum CodingKeys: String, CodingKey { + case name + + case description + + case apiKey = "api_key" + + case type + + case provider + + case fromAddress = "from_address" + } + + public init(apiKey: String?, description: String?, fromAddress: [EmailProviderReqFrom]?, name: String?, provider: String?, type: String?) { + self.name = name + + self.description = description + + self.apiKey = apiKey + + self.type = type + + self.provider = provider + + self.fromAddress = fromAddress + } + + public func duplicate() -> EmailProviderReq { + let dict = self.dictionary! + let copy = EmailProviderReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + apiKey = try container.decode(String.self, forKey: .apiKey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + provider = try container.decode(String.self, forKey: .provider) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fromAddress = try container.decode([EmailProviderReqFrom].self, forKey: .fromAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(apiKey, forKey: .apiKey) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(provider, forKey: .provider) + + try? container.encodeIfPresent(fromAddress, forKey: .fromAddress) + } + } + + /* + Model: EmailProvider + Used By: Communication + */ + + class EmailProvider: Codable { + public var type: String? + + public var provider: String? + + public var fromAddress: [EmailProviderReqFrom]? + + public var id: String? + + public var name: String? + + public var description: String? + + public var apiKey: String? + + public var application: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var slug: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case type + + case provider + + case fromAddress = "from_address" + + case id = "_id" + + case name + + case description + + case apiKey = "api_key" + + case application + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case slug + + case v = "__v" + } + + public init(apiKey: String?, application: String?, createdAt: String?, description: String?, fromAddress: [EmailProviderReqFrom]?, name: String?, provider: String?, slug: String?, type: String?, updatedAt: String?, id: String?, v: Int?) { + self.type = type + + self.provider = provider + + self.fromAddress = fromAddress + + self.id = id + + self.name = name + + self.description = description + + self.apiKey = apiKey + + self.application = application + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.slug = slug + + self.v = v + } + + public func duplicate() -> EmailProvider { + let dict = self.dictionary! + let copy = EmailProvider(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + provider = try container.decode(String.self, forKey: .provider) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fromAddress = try container.decode([EmailProviderReqFrom].self, forKey: .fromAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + apiKey = try container.decode(String.self, forKey: .apiKey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(provider, forKey: .provider) + + try? container.encodeIfPresent(fromAddress, forKey: .fromAddress) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(apiKey, forKey: .apiKey) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: EmailProviders + Used By: Communication + */ + + class EmailProviders: Codable { + public var items: [EmailProvider]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [EmailProvider]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> EmailProviders { + let dict = self.dictionary! + let copy = EmailProviders(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([EmailProvider].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: EmailTemplateDeleteSuccessRes + Used By: Communication + */ + + class EmailTemplateDeleteSuccessRes: Codable { + public var success: Bool? + + public var message: String? + + public enum CodingKeys: String, CodingKey { + case success + + case message + } + + public init(message: String?, success: Bool?) { + self.success = success + + self.message = message + } + + public func duplicate() -> EmailTemplateDeleteSuccessRes { + let dict = self.dictionary! + let copy = EmailTemplateDeleteSuccessRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: EmailTemplateDeleteFailureRes + Used By: Communication + */ + + class EmailTemplateDeleteFailureRes: Codable { + public var success: Bool? + + public var message: String? + + public enum CodingKeys: String, CodingKey { + case success + + case message + } + + public init(message: String?, success: Bool?) { + self.success = success + + self.message = message + } + + public func duplicate() -> EmailTemplateDeleteFailureRes { + let dict = self.dictionary! + let copy = EmailTemplateDeleteFailureRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: EmailTemplateKeys + Used By: Communication + */ + + class EmailTemplateKeys: Codable { + public var to: String? + + public var cc: String? + + public var bcc: String? + + public enum CodingKeys: String, CodingKey { + case to + + case cc + + case bcc + } + + public init(bcc: String?, cc: String?, to: String?) { + self.to = to + + self.cc = cc + + self.bcc = bcc + } + + public func duplicate() -> EmailTemplateKeys { + let dict = self.dictionary! + let copy = EmailTemplateKeys(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + to = try container.decode(String.self, forKey: .to) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cc = try container.decode(String.self, forKey: .cc) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bcc = try container.decode(String.self, forKey: .bcc) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(to, forKey: .to) + + try? container.encodeIfPresent(cc, forKey: .cc) + + try? container.encodeIfPresent(bcc, forKey: .bcc) + } + } + + /* + Model: EmailTemplateHeaders + Used By: Communication + */ + + class EmailTemplateHeaders: Codable { + public var key: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case key + + case value + } + + public init(key: String?, value: String?) { + self.key = key + + self.value = value + } + + public func duplicate() -> EmailTemplateHeaders { + let dict = self.dictionary! + let copy = EmailTemplateHeaders(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: EmailTemplateReq + Used By: Communication + */ + + class EmailTemplateReq: Codable { + public var name: String? + + public var description: String? + + public var keys: EmailTemplateKeys? + + public var staticTo: [String]? + + public var staticCc: [String]? + + public var staticBcc: [String]? + + public var replyTo: String? + + public var headers: [EmailTemplateHeaders]? + + public var subject: TemplateAndType? + + public var html: TemplateAndType? + + public var text: TemplateAndType? + + public var attachments: [[String: Any]]? + + public var priority: String? + + public enum CodingKeys: String, CodingKey { + case name + + case description + + case keys + + case staticTo = "static_to" + + case staticCc = "static_cc" + + case staticBcc = "static_bcc" + + case replyTo = "reply_to" + + case headers + + case subject + + case html + + case text + + case attachments + + case priority + } + + public init(attachments: [[String: Any]]?, description: String?, headers: [EmailTemplateHeaders]?, html: TemplateAndType?, keys: EmailTemplateKeys?, name: String?, priority: String?, replyTo: String?, staticBcc: [String]?, staticCc: [String]?, staticTo: [String]?, subject: TemplateAndType?, text: TemplateAndType?) { + self.name = name + + self.description = description + + self.keys = keys + + self.staticTo = staticTo + + self.staticCc = staticCc + + self.staticBcc = staticBcc + + self.replyTo = replyTo + + self.headers = headers + + self.subject = subject + + self.html = html + + self.text = text + + self.attachments = attachments + + self.priority = priority + } + + public func duplicate() -> EmailTemplateReq { + let dict = self.dictionary! + let copy = EmailTemplateReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + keys = try container.decode(EmailTemplateKeys.self, forKey: .keys) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + staticTo = try container.decode([String].self, forKey: .staticTo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + staticCc = try container.decode([String].self, forKey: .staticCc) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + staticBcc = try container.decode([String].self, forKey: .staticBcc) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + replyTo = try container.decode(String.self, forKey: .replyTo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + headers = try container.decode([EmailTemplateHeaders].self, forKey: .headers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subject = try container.decode(TemplateAndType.self, forKey: .subject) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + html = try container.decode(TemplateAndType.self, forKey: .html) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text = try container.decode(TemplateAndType.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attachments = try container.decode([[String: Any]].self, forKey: .attachments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(String.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(keys, forKey: .keys) + + try? container.encodeIfPresent(staticTo, forKey: .staticTo) + + try? container.encodeIfPresent(staticCc, forKey: .staticCc) + + try? container.encodeIfPresent(staticBcc, forKey: .staticBcc) + + try? container.encodeIfPresent(replyTo, forKey: .replyTo) + + try? container.encodeIfPresent(headers, forKey: .headers) + + try? container.encodeIfPresent(subject, forKey: .subject) + + try? container.encodeIfPresent(html, forKey: .html) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(attachments, forKey: .attachments) + + try? container.encodeIfPresent(priority, forKey: .priority) + } + } + + /* + Model: TemplateAndType + Used By: Communication + */ + + class TemplateAndType: Codable { + public var templateType: String? + + public var template: String? + + public enum CodingKeys: String, CodingKey { + case templateType = "template_type" + + case template + } + + public init(template: String?, templateType: String?) { + self.templateType = templateType + + self.template = template + } + + public func duplicate() -> TemplateAndType { + let dict = self.dictionary! + let copy = TemplateAndType(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + templateType = try container.decode(String.self, forKey: .templateType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + template = try container.decode(String.self, forKey: .template) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(templateType, forKey: .templateType) + + try? container.encodeIfPresent(template, forKey: .template) + } + } + + /* + Model: EmailTemplateRes + Used By: Communication + */ + + class EmailTemplateRes: Codable { + public var isSystem: Bool? + + public var isInternal: Bool? + + public var description: String? + + public var staticTo: [String]? + + public var staticCc: [String]? + + public var staticBcc: [String]? + + public var tags: [[String: Any]]? + + public var priority: String? + + public var published: Bool? + + public var id: String? + + public var name: String? + + public var keys: EmailTemplateKeys? + + public var replyTo: String? + + public var headers: [EmailTemplateHeaders]? + + public var subject: TemplateAndType? + + public var html: TemplateAndType? + + public var text: TemplateAndType? + + public var attachments: [[String: Any]]? + + public var createdAt: String? + + public var updatedAt: String? + + public var slug: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case isSystem = "is_system" + + case isInternal = "is_internal" + + case description + + case staticTo = "static_to" + + case staticCc = "static_cc" + + case staticBcc = "static_bcc" + + case tags + + case priority + + case published + + case id = "_id" + + case name + + case keys + + case replyTo = "reply_to" + + case headers + + case subject + + case html + + case text + + case attachments + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case slug + + case v = "__v" + } + + public init(attachments: [[String: Any]]?, createdAt: String?, description: String?, headers: [EmailTemplateHeaders]?, html: TemplateAndType?, isInternal: Bool?, isSystem: Bool?, keys: EmailTemplateKeys?, name: String?, priority: String?, published: Bool?, replyTo: String?, slug: String?, staticBcc: [String]?, staticCc: [String]?, staticTo: [String]?, subject: TemplateAndType?, tags: [[String: Any]]?, text: TemplateAndType?, updatedAt: String?, id: String?, v: Int?) { + self.isSystem = isSystem + + self.isInternal = isInternal + + self.description = description + + self.staticTo = staticTo + + self.staticCc = staticCc + + self.staticBcc = staticBcc + + self.tags = tags + + self.priority = priority + + self.published = published + + self.id = id + + self.name = name + + self.keys = keys + + self.replyTo = replyTo + + self.headers = headers + + self.subject = subject + + self.html = html + + self.text = text + + self.attachments = attachments + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.slug = slug + + self.v = v + } + + public func duplicate() -> EmailTemplateRes { + let dict = self.dictionary! + let copy = EmailTemplateRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isSystem = try container.decode(Bool.self, forKey: .isSystem) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isInternal = try container.decode(Bool.self, forKey: .isInternal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + staticTo = try container.decode([String].self, forKey: .staticTo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + staticCc = try container.decode([String].self, forKey: .staticCc) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + staticBcc = try container.decode([String].self, forKey: .staticBcc) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([[String: Any]].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(String.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + keys = try container.decode(EmailTemplateKeys.self, forKey: .keys) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + replyTo = try container.decode(String.self, forKey: .replyTo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + headers = try container.decode([EmailTemplateHeaders].self, forKey: .headers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subject = try container.decode(TemplateAndType.self, forKey: .subject) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + html = try container.decode(TemplateAndType.self, forKey: .html) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text = try container.decode(TemplateAndType.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attachments = try container.decode([[String: Any]].self, forKey: .attachments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isSystem, forKey: .isSystem) + + try? container.encodeIfPresent(isInternal, forKey: .isInternal) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(staticTo, forKey: .staticTo) + + try? container.encodeIfPresent(staticCc, forKey: .staticCc) + + try? container.encodeIfPresent(staticBcc, forKey: .staticBcc) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(keys, forKey: .keys) + + try? container.encodeIfPresent(replyTo, forKey: .replyTo) + + try? container.encodeIfPresent(headers, forKey: .headers) + + try? container.encodeIfPresent(subject, forKey: .subject) + + try? container.encodeIfPresent(html, forKey: .html) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(attachments, forKey: .attachments) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: EmailTemplate + Used By: Communication + */ + + class EmailTemplate: Codable { + public var isSystem: Bool? + + public var isInternal: Bool? + + public var description: String? + + public var staticTo: [[String: Any]]? + + public var staticCc: [[String: Any]]? + + public var staticBcc: [[String: Any]]? + + public var tags: [[String: Any]]? + + public var priority: String? + + public var published: Bool? + + public var id: String? + + public var slug: String? + + public var name: String? + + public var fromName: String? + + public var subject: TemplateAndType? + + public var html: TemplateAndType? + + public var text: TemplateAndType? + + public var headers: [[String: Any]]? + + public var attachments: [[String: Any]]? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case isSystem = "is_system" + + case isInternal = "is_internal" + + case description + + case staticTo = "static_to" + + case staticCc = "static_cc" + + case staticBcc = "static_bcc" + + case tags + + case priority + + case published + + case id = "_id" + + case slug + + case name + + case fromName = "from_name" + + case subject + + case html + + case text + + case headers + + case attachments + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + } + + public init(attachments: [[String: Any]]?, createdAt: String?, description: String?, fromName: String?, headers: [[String: Any]]?, html: TemplateAndType?, isInternal: Bool?, isSystem: Bool?, name: String?, priority: String?, published: Bool?, slug: String?, staticBcc: [[String: Any]]?, staticCc: [[String: Any]]?, staticTo: [[String: Any]]?, subject: TemplateAndType?, tags: [[String: Any]]?, text: TemplateAndType?, updatedAt: String?, id: String?, v: Int?) { + self.isSystem = isSystem + + self.isInternal = isInternal + + self.description = description + + self.staticTo = staticTo + + self.staticCc = staticCc + + self.staticBcc = staticBcc + + self.tags = tags + + self.priority = priority + + self.published = published + + self.id = id + + self.slug = slug + + self.name = name + + self.fromName = fromName + + self.subject = subject + + self.html = html + + self.text = text + + self.headers = headers + + self.attachments = attachments + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + } + + public func duplicate() -> EmailTemplate { + let dict = self.dictionary! + let copy = EmailTemplate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isSystem = try container.decode(Bool.self, forKey: .isSystem) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isInternal = try container.decode(Bool.self, forKey: .isInternal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + staticTo = try container.decode([[String: Any]].self, forKey: .staticTo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + staticCc = try container.decode([[String: Any]].self, forKey: .staticCc) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + staticBcc = try container.decode([[String: Any]].self, forKey: .staticBcc) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([[String: Any]].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(String.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fromName = try container.decode(String.self, forKey: .fromName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subject = try container.decode(TemplateAndType.self, forKey: .subject) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + html = try container.decode(TemplateAndType.self, forKey: .html) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text = try container.decode(TemplateAndType.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + headers = try container.decode([[String: Any]].self, forKey: .headers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attachments = try container.decode([[String: Any]].self, forKey: .attachments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isSystem, forKey: .isSystem) + + try? container.encodeIfPresent(isInternal, forKey: .isInternal) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(staticTo, forKey: .staticTo) + + try? container.encodeIfPresent(staticCc, forKey: .staticCc) + + try? container.encodeIfPresent(staticBcc, forKey: .staticBcc) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(fromName, forKey: .fromName) + + try? container.encodeIfPresent(subject, forKey: .subject) + + try? container.encodeIfPresent(html, forKey: .html) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(headers, forKey: .headers) + + try? container.encodeIfPresent(attachments, forKey: .attachments) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: SystemEmailTemplate + Used By: Communication + */ + + class SystemEmailTemplate: Codable { + public var isSystem: Bool? + + public var isInternal: Bool? + + public var description: String? + + public var staticTo: [[String: Any]]? + + public var staticCc: [[String: Any]]? + + public var staticBcc: [[String: Any]]? + + public var tags: [[String: Any]]? + + public var priority: String? + + public var published: Bool? + + public var id: String? + + public var slug: String? + + public var name: String? + + public var fromName: String? + + public var subject: TemplateAndType? + + public var html: TemplateAndType? + + public var text: TemplateAndType? + + public var headers: [[String: Any]]? + + public var attachments: [[String: Any]]? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case isSystem = "is_system" + + case isInternal = "is_internal" + + case description + + case staticTo = "static_to" + + case staticCc = "static_cc" + + case staticBcc = "static_bcc" + + case tags + + case priority + + case published + + case id = "_id" + + case slug + + case name + + case fromName = "from_name" + + case subject + + case html + + case text + + case headers + + case attachments + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + } + + public init(attachments: [[String: Any]]?, createdAt: String?, description: String?, fromName: String?, headers: [[String: Any]]?, html: TemplateAndType?, isInternal: Bool?, isSystem: Bool?, name: String?, priority: String?, published: Bool?, slug: String?, staticBcc: [[String: Any]]?, staticCc: [[String: Any]]?, staticTo: [[String: Any]]?, subject: TemplateAndType?, tags: [[String: Any]]?, text: TemplateAndType?, updatedAt: String?, id: String?, v: Int?) { + self.isSystem = isSystem + + self.isInternal = isInternal + + self.description = description + + self.staticTo = staticTo + + self.staticCc = staticCc + + self.staticBcc = staticBcc + + self.tags = tags + + self.priority = priority + + self.published = published + + self.id = id + + self.slug = slug + + self.name = name + + self.fromName = fromName + + self.subject = subject + + self.html = html + + self.text = text + + self.headers = headers + + self.attachments = attachments + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + } + + public func duplicate() -> SystemEmailTemplate { + let dict = self.dictionary! + let copy = SystemEmailTemplate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isSystem = try container.decode(Bool.self, forKey: .isSystem) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isInternal = try container.decode(Bool.self, forKey: .isInternal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + staticTo = try container.decode([[String: Any]].self, forKey: .staticTo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + staticCc = try container.decode([[String: Any]].self, forKey: .staticCc) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + staticBcc = try container.decode([[String: Any]].self, forKey: .staticBcc) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([[String: Any]].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(String.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fromName = try container.decode(String.self, forKey: .fromName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subject = try container.decode(TemplateAndType.self, forKey: .subject) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + html = try container.decode(TemplateAndType.self, forKey: .html) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text = try container.decode(TemplateAndType.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + headers = try container.decode([[String: Any]].self, forKey: .headers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attachments = try container.decode([[String: Any]].self, forKey: .attachments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isSystem, forKey: .isSystem) + + try? container.encodeIfPresent(isInternal, forKey: .isInternal) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(staticTo, forKey: .staticTo) + + try? container.encodeIfPresent(staticCc, forKey: .staticCc) + + try? container.encodeIfPresent(staticBcc, forKey: .staticBcc) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(fromName, forKey: .fromName) + + try? container.encodeIfPresent(subject, forKey: .subject) + + try? container.encodeIfPresent(html, forKey: .html) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(headers, forKey: .headers) + + try? container.encodeIfPresent(attachments, forKey: .attachments) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: EmailTemplates + Used By: Communication + */ + + class EmailTemplates: Codable { + public var items: [EmailTemplate]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [EmailTemplate]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> EmailTemplates { + let dict = self.dictionary! + let copy = EmailTemplates(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([EmailTemplate].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: SystemEmailTemplates + Used By: Communication + */ + + class SystemEmailTemplates: Codable { + public var items: [SystemEmailTemplate]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [SystemEmailTemplate]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> SystemEmailTemplates { + let dict = self.dictionary! + let copy = SystemEmailTemplates(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([SystemEmailTemplate].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: PayloadEmailTemplateStructure + Used By: Communication + */ + + class PayloadEmailTemplateStructure: Codable { + public var key: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case key + + case value + } + + public init(key: String?, value: String?) { + self.key = key + + self.value = value + } + + public func duplicate() -> PayloadEmailTemplateStructure { + let dict = self.dictionary! + let copy = PayloadEmailTemplateStructure(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: PayloadEmailProviderStructure + Used By: Communication + */ + + class PayloadEmailProviderStructure: Codable { + public var id: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + } + + public init(id: String?) { + self.id = id + } + + public func duplicate() -> PayloadEmailProviderStructure { + let dict = self.dictionary! + let copy = PayloadEmailProviderStructure(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: PayloadEmailStructure + Used By: Communication + */ + + class PayloadEmailStructure: Codable { + public var template: PayloadEmailTemplateStructure? + + public var provider: PayloadEmailProviderStructure? + + public enum CodingKeys: String, CodingKey { + case template + + case provider + } + + public init(provider: PayloadEmailProviderStructure?, template: PayloadEmailTemplateStructure?) { + self.template = template + + self.provider = provider + } + + public func duplicate() -> PayloadEmailStructure { + let dict = self.dictionary! + let copy = PayloadEmailStructure(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + template = try container.decode(PayloadEmailTemplateStructure.self, forKey: .template) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + provider = try container.decode(PayloadEmailProviderStructure.self, forKey: .provider) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(template, forKey: .template) + + try? container.encodeIfPresent(provider, forKey: .provider) + } + } + + /* + Model: PayloadSmsTemplateStructure + Used By: Communication + */ + + class PayloadSmsTemplateStructure: Codable { + public var key: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case key + + case value + } + + public init(key: String?, value: String?) { + self.key = key + + self.value = value + } + + public func duplicate() -> PayloadSmsTemplateStructure { + let dict = self.dictionary! + let copy = PayloadSmsTemplateStructure(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: PayloadSmsProviderStructure + Used By: Communication + */ + + class PayloadSmsProviderStructure: Codable { + public var id: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + } + + public init(id: String?) { + self.id = id + } + + public func duplicate() -> PayloadSmsProviderStructure { + let dict = self.dictionary! + let copy = PayloadSmsProviderStructure(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: PayloadSmsStructure + Used By: Communication + */ + + class PayloadSmsStructure: Codable { + public var template: PayloadSmsTemplateStructure? + + public var provider: PayloadSmsProviderStructure? + + public enum CodingKeys: String, CodingKey { + case template + + case provider + } + + public init(provider: PayloadSmsProviderStructure?, template: PayloadSmsTemplateStructure?) { + self.template = template + + self.provider = provider + } + + public func duplicate() -> PayloadSmsStructure { + let dict = self.dictionary! + let copy = PayloadSmsStructure(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + template = try container.decode(PayloadSmsTemplateStructure.self, forKey: .template) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + provider = try container.decode(PayloadSmsProviderStructure.self, forKey: .provider) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(template, forKey: .template) + + try? container.encodeIfPresent(provider, forKey: .provider) + } + } + + /* + Model: PayloadStructure + Used By: Communication + */ + + class PayloadStructure: Codable { + public var data: [[String: Any]]? + + public var email: PayloadEmailStructure? + + public var sms: PayloadSmsStructure? + + public var application: String? + + public enum CodingKeys: String, CodingKey { + case data + + case email + + case sms + + case application + } + + public init(application: String?, data: [[String: Any]]?, email: PayloadEmailStructure?, sms: PayloadSmsStructure?) { + self.data = data + + self.email = email + + self.sms = sms + + self.application = application + } + + public func duplicate() -> PayloadStructure { + let dict = self.dictionary! + let copy = PayloadStructure(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode([[String: Any]].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(PayloadEmailStructure.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sms = try container.decode(PayloadSmsStructure.self, forKey: .sms) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(sms, forKey: .sms) + + try? container.encodeIfPresent(application, forKey: .application) + } + } + + /* + Model: MetaStructure + Used By: Communication + */ + + class MetaStructure: Codable { + public var jobType: String? + + public var action: String? + + public var trace: String? + + public var timestamp: String? + + public enum CodingKeys: String, CodingKey { + case jobType = "job_type" + + case action + + case trace + + case timestamp + } + + public init(action: String?, jobType: String?, timestamp: String?, trace: String?) { + self.jobType = jobType + + self.action = action + + self.trace = trace + + self.timestamp = timestamp + } + + public func duplicate() -> MetaStructure { + let dict = self.dictionary! + let copy = MetaStructure(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + jobType = try container.decode(String.self, forKey: .jobType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(String.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + trace = try container.decode(String.self, forKey: .trace) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + timestamp = try container.decode(String.self, forKey: .timestamp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(jobType, forKey: .jobType) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(trace, forKey: .trace) + + try? container.encodeIfPresent(timestamp, forKey: .timestamp) + } + } + + /* + Model: EngineRequest + Used By: Communication + */ + + class EngineRequest: Codable { + public var payload: PayloadStructure? + + public var meta: MetaStructure? + + public enum CodingKeys: String, CodingKey { + case payload + + case meta + } + + public init(meta: MetaStructure?, payload: PayloadStructure?) { + self.payload = payload + + self.meta = meta + } + + public func duplicate() -> EngineRequest { + let dict = self.dictionary! + let copy = EngineRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + payload = try container.decode(PayloadStructure.self, forKey: .payload) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode(MetaStructure.self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(payload, forKey: .payload) + + try? container.encodeIfPresent(meta, forKey: .meta) + } + } + + /* + Model: EngineResponse + Used By: Communication + */ + + class EngineResponse: Codable { + public var success: Bool? + + public enum CodingKeys: String, CodingKey { + case success + } + + public init(success: Bool?) { + self.success = success + } + + public func duplicate() -> EngineResponse { + let dict = self.dictionary! + let copy = EngineResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: EventSubscriptionTemplateSms + Used By: Communication + */ + + class EventSubscriptionTemplateSms: Codable { + public var subscribed: Bool? + + public var template: String? + + public enum CodingKeys: String, CodingKey { + case subscribed + + case template + } + + public init(subscribed: Bool?, template: String?) { + self.subscribed = subscribed + + self.template = template + } + + public func duplicate() -> EventSubscriptionTemplateSms { + let dict = self.dictionary! + let copy = EventSubscriptionTemplateSms(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + subscribed = try container.decode(Bool.self, forKey: .subscribed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + template = try container.decode(String.self, forKey: .template) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(subscribed, forKey: .subscribed) + + try? container.encodeIfPresent(template, forKey: .template) + } + } + + /* + Model: EventSubscriptionTemplateEmail + Used By: Communication + */ + + class EventSubscriptionTemplateEmail: Codable { + public var subscribed: Bool? + + public var template: String? + + public enum CodingKeys: String, CodingKey { + case subscribed + + case template + } + + public init(subscribed: Bool?, template: String?) { + self.subscribed = subscribed + + self.template = template + } + + public func duplicate() -> EventSubscriptionTemplateEmail { + let dict = self.dictionary! + let copy = EventSubscriptionTemplateEmail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + subscribed = try container.decode(Bool.self, forKey: .subscribed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + template = try container.decode(String.self, forKey: .template) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(subscribed, forKey: .subscribed) + + try? container.encodeIfPresent(template, forKey: .template) + } + } + + /* + Model: EventSubscriptionTemplate + Used By: Communication + */ + + class EventSubscriptionTemplate: Codable { + public var sms: EventSubscriptionTemplateSms? + + public var email: EventSubscriptionTemplateEmail? + + public enum CodingKeys: String, CodingKey { + case sms + + case email + } + + public init(email: EventSubscriptionTemplateEmail?, sms: EventSubscriptionTemplateSms?) { + self.sms = sms + + self.email = email + } + + public func duplicate() -> EventSubscriptionTemplate { + let dict = self.dictionary! + let copy = EventSubscriptionTemplate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + sms = try container.decode(EventSubscriptionTemplateSms.self, forKey: .sms) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(EventSubscriptionTemplateEmail.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(sms, forKey: .sms) + + try? container.encodeIfPresent(email, forKey: .email) + } + } + + /* + Model: EventSubscription + Used By: Communication + */ + + class EventSubscription: Codable { + public var template: EventSubscriptionTemplate? + + public var isDefault: Bool? + + public var id: String? + + public var application: String? + + public var event: String? + + public var slug: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case template + + case isDefault = "is_default" + + case id = "_id" + + case application + + case event + + case slug + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + } + + public init(application: String?, createdAt: String?, event: String?, isDefault: Bool?, slug: String?, template: EventSubscriptionTemplate?, updatedAt: String?, id: String?, v: Int?) { + self.template = template + + self.isDefault = isDefault + + self.id = id + + self.application = application + + self.event = event + + self.slug = slug + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + } + + public func duplicate() -> EventSubscription { + let dict = self.dictionary! + let copy = EventSubscription(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + template = try container.decode(EventSubscriptionTemplate.self, forKey: .template) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isDefault = try container.decode(Bool.self, forKey: .isDefault) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + event = try container.decode(String.self, forKey: .event) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(template, forKey: .template) + + try? container.encodeIfPresent(isDefault, forKey: .isDefault) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(event, forKey: .event) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: EventSubscriptions + Used By: Communication + */ + + class EventSubscriptions: Codable { + public var items: [EventSubscription]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [EventSubscription]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> EventSubscriptions { + let dict = self.dictionary! + let copy = EventSubscriptions(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([EventSubscription].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: TriggerJobResponse + Used By: Communication + */ + + class TriggerJobResponse: Codable { + public var status: Int? + + public enum CodingKeys: String, CodingKey { + case status + } + + public init(status: Int?) { + self.status = status + } + + public func duplicate() -> TriggerJobResponse { + let dict = self.dictionary! + let copy = TriggerJobResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + status = try container.decode(Int.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: TriggerJobRequest + Used By: Communication + */ + + class TriggerJobRequest: Codable { + public var jobId: String? + + public enum CodingKeys: String, CodingKey { + case jobId = "job_id" + } + + public init(jobId: String?) { + self.jobId = jobId + } + + public func duplicate() -> TriggerJobRequest { + let dict = self.dictionary! + let copy = TriggerJobRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + jobId = try container.decode(String.self, forKey: .jobId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(jobId, forKey: .jobId) + } + } + + /* + Model: Job + Used By: Communication + */ + + class Job: Codable { + public var completed: Bool? + + public var isActive: Bool? + + public var id: String? + + public var campaign: String? + + public var application: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case completed + + case isActive = "is_active" + + case id = "_id" + + case campaign + + case application + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + } + + public init(application: String?, campaign: String?, completed: Bool?, createdAt: String?, isActive: Bool?, updatedAt: String?, id: String?, v: Int?) { + self.completed = completed + + self.isActive = isActive + + self.id = id + + self.campaign = campaign + + self.application = application + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + } + + public func duplicate() -> Job { + let dict = self.dictionary! + let copy = Job(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + completed = try container.decode(Bool.self, forKey: .completed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + campaign = try container.decode(String.self, forKey: .campaign) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(completed, forKey: .completed) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(campaign, forKey: .campaign) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: Jobs + Used By: Communication + */ + + class Jobs: Codable { + public var items: [Job]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [Job]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> Jobs { + let dict = self.dictionary! + let copy = Jobs(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Job].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: JobLog + Used By: Communication + */ + + class JobLog: Codable { + public var imported: [String: Any]? + + public var processed: [String: Any]? + + public var id: String? + + public var job: String? + + public var campaign: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case imported + + case processed + + case id = "_id" + + case job + + case campaign + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + } + + public init(campaign: String?, createdAt: String?, imported: [String: Any]?, job: String?, processed: [String: Any]?, updatedAt: String?, id: String?, v: Int?) { + self.imported = imported + + self.processed = processed + + self.id = id + + self.job = job + + self.campaign = campaign + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + } + + public func duplicate() -> JobLog { + let dict = self.dictionary! + let copy = JobLog(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + imported = try container.decode([String: Any].self, forKey: .imported) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + processed = try container.decode([String: Any].self, forKey: .processed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + job = try container.decode(String.self, forKey: .job) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + campaign = try container.decode(String.self, forKey: .campaign) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(imported, forKey: .imported) + + try? container.encodeIfPresent(processed, forKey: .processed) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(job, forKey: .job) + + try? container.encodeIfPresent(campaign, forKey: .campaign) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: JobLogs + Used By: Communication + */ + + class JobLogs: Codable { + public var items: [JobLog]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [JobLog]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> JobLogs { + let dict = self.dictionary! + let copy = JobLogs(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([JobLog].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: LogEmail + Used By: Communication + */ + + class LogEmail: Codable { + public var template: String? + + public enum CodingKeys: String, CodingKey { + case template + } + + public init(template: String?) { + self.template = template + } + + public func duplicate() -> LogEmail { + let dict = self.dictionary! + let copy = LogEmail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + template = try container.decode(String.self, forKey: .template) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(template, forKey: .template) + } + } + + /* + Model: LogPushnotification + Used By: Communication + */ + + class LogPushnotification: Codable { + public var pushtokens: [String]? + + public enum CodingKeys: String, CodingKey { + case pushtokens + } + + public init(pushtokens: [String]?) { + self.pushtokens = pushtokens + } + + public func duplicate() -> LogPushnotification { + let dict = self.dictionary! + let copy = LogPushnotification(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + pushtokens = try container.decode([String].self, forKey: .pushtokens) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pushtokens, forKey: .pushtokens) + } + } + + /* + Model: LogMeta + Used By: Communication + */ + + class LogMeta: Codable { + public var type: String? + + public var identifier: String? + + public var key: String? + + public var offset: String? + + public var partition: String? + + public var topic: String? + + public enum CodingKeys: String, CodingKey { + case type + + case identifier + + case key + + case offset + + case partition + + case topic + } + + public init(identifier: String?, key: String?, offset: String?, partition: String?, topic: String?, type: String?) { + self.type = type + + self.identifier = identifier + + self.key = key + + self.offset = offset + + self.partition = partition + + self.topic = topic + } + + public func duplicate() -> LogMeta { + let dict = self.dictionary! + let copy = LogMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + identifier = try container.decode(String.self, forKey: .identifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + offset = try container.decode(String.self, forKey: .offset) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + partition = try container.decode(String.self, forKey: .partition) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + topic = try container.decode(String.self, forKey: .topic) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(identifier, forKey: .identifier) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(offset, forKey: .offset) + + try? container.encodeIfPresent(partition, forKey: .partition) + + try? container.encodeIfPresent(topic, forKey: .topic) + } + } + + /* + Model: Log + Used By: Communication + */ + + class Log: Codable { + public var email: LogEmail? + + public var pushnotification: LogPushnotification? + + public var meta: LogMeta? + + public var id: String? + + public var application: String? + + public var service: String? + + public var step: String? + + public var status: String? + + public var data: [String: Any]? + + public var expireAt: String? + + public var createdAt: String? + + public enum CodingKeys: String, CodingKey { + case email + + case pushnotification + + case meta + + case id = "_id" + + case application + + case service + + case step + + case status + + case data + + case expireAt = "expire_at" + + case createdAt = "created_at" + } + + public init(application: String?, createdAt: String?, data: [String: Any]?, email: LogEmail?, expireAt: String?, meta: LogMeta?, pushnotification: LogPushnotification?, service: String?, status: String?, step: String?, id: String?) { + self.email = email + + self.pushnotification = pushnotification + + self.meta = meta + + self.id = id + + self.application = application + + self.service = service + + self.step = step + + self.status = status + + self.data = data + + self.expireAt = expireAt + + self.createdAt = createdAt + } + + public func duplicate() -> Log { + let dict = self.dictionary! + let copy = Log(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(LogEmail.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pushnotification = try container.decode(LogPushnotification.self, forKey: .pushnotification) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode(LogMeta.self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + service = try container.decode(String.self, forKey: .service) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + step = try container.decode(String.self, forKey: .step) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode([String: Any].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expireAt = try container.decode(String.self, forKey: .expireAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(pushnotification, forKey: .pushnotification) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(service, forKey: .service) + + try? container.encodeIfPresent(step, forKey: .step) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(expireAt, forKey: .expireAt) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + } + } + + /* + Model: Logs + Used By: Communication + */ + + class Logs: Codable { + public var items: [Log]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [Log]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> Logs { + let dict = self.dictionary! + let copy = Logs(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Log].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: PushtokenReq + Used By: Communication + */ + + class PushtokenReq: Codable { + public var action: String? + + public var bundleIdentifier: String? + + public var pushToken: String? + + public var uniqueDeviceId: String? + + public enum CodingKeys: String, CodingKey { + case action + + case bundleIdentifier = "bundle_identifier" + + case pushToken = "push_token" + + case uniqueDeviceId = "unique_device_id" + } + + public init(action: String?, bundleIdentifier: String?, pushToken: String?, uniqueDeviceId: String?) { + self.action = action + + self.bundleIdentifier = bundleIdentifier + + self.pushToken = pushToken + + self.uniqueDeviceId = uniqueDeviceId + } + + public func duplicate() -> PushtokenReq { + let dict = self.dictionary! + let copy = PushtokenReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + action = try container.decode(String.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bundleIdentifier = try container.decode(String.self, forKey: .bundleIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pushToken = try container.decode(String.self, forKey: .pushToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uniqueDeviceId = try container.decode(String.self, forKey: .uniqueDeviceId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(bundleIdentifier, forKey: .bundleIdentifier) + + try? container.encodeIfPresent(pushToken, forKey: .pushToken) + + try? container.encodeIfPresent(uniqueDeviceId, forKey: .uniqueDeviceId) + } + } + + /* + Model: PushtokenRes + Used By: Communication + */ + + class PushtokenRes: Codable { + public var id: String? + + public var bundleIdentifier: String? + + public var pushToken: String? + + public var uniqueDeviceId: String? + + public var type: String? + + public var platform: String? + + public var applicationId: String? + + public var userId: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var expiredAt: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case bundleIdentifier = "bundle_identifier" + + case pushToken = "push_token" + + case uniqueDeviceId = "unique_device_id" + + case type + + case platform + + case applicationId = "application_id" + + case userId = "user_id" + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case expiredAt = "expired_at" + } + + public init(applicationId: String?, bundleIdentifier: String?, createdAt: String?, expiredAt: String?, platform: String?, pushToken: String?, type: String?, uniqueDeviceId: String?, updatedAt: String?, userId: String?, id: String?) { + self.id = id + + self.bundleIdentifier = bundleIdentifier + + self.pushToken = pushToken + + self.uniqueDeviceId = uniqueDeviceId + + self.type = type + + self.platform = platform + + self.applicationId = applicationId + + self.userId = userId + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.expiredAt = expiredAt + } + + public func duplicate() -> PushtokenRes { + let dict = self.dictionary! + let copy = PushtokenRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bundleIdentifier = try container.decode(String.self, forKey: .bundleIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pushToken = try container.decode(String.self, forKey: .pushToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uniqueDeviceId = try container.decode(String.self, forKey: .uniqueDeviceId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode(String.self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + applicationId = try container.decode(String.self, forKey: .applicationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expiredAt = try container.decode(String.self, forKey: .expiredAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(bundleIdentifier, forKey: .bundleIdentifier) + + try? container.encodeIfPresent(pushToken, forKey: .pushToken) + + try? container.encodeIfPresent(uniqueDeviceId, forKey: .uniqueDeviceId) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(platform, forKey: .platform) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + + try? container.encodeIfPresent(userId, forKey: .userId) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(expiredAt, forKey: .expiredAt) + } + } + + /* + Model: SmsProviderReq + Used By: Communication + */ + + class SmsProviderReq: Codable { + public var name: String? + + public var description: String? + + public var sender: String? + + public var username: String? + + public var authkey: String? + + public var type: String? + + public var provider: String? + + public enum CodingKeys: String, CodingKey { + case name + + case description + + case sender + + case username + + case authkey + + case type + + case provider + } + + public init(authkey: String?, description: String?, name: String?, provider: String?, sender: String?, type: String?, username: String?) { + self.name = name + + self.description = description + + self.sender = sender + + self.username = username + + self.authkey = authkey + + self.type = type + + self.provider = provider + } + + public func duplicate() -> SmsProviderReq { + let dict = self.dictionary! + let copy = SmsProviderReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sender = try container.decode(String.self, forKey: .sender) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + authkey = try container.decode(String.self, forKey: .authkey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + provider = try container.decode(String.self, forKey: .provider) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(sender, forKey: .sender) + + try? container.encodeIfPresent(username, forKey: .username) + + try? container.encodeIfPresent(authkey, forKey: .authkey) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(provider, forKey: .provider) + } + } + + /* + Model: SmsProvider + Used By: Communication + */ + + class SmsProvider: Codable { + public var rpt: Int? + + public var type: String? + + public var provider: String? + + public var id: String? + + public var name: String? + + public var description: String? + + public var sender: String? + + public var username: String? + + public var authkey: String? + + public var application: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var slug: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case rpt + + case type + + case provider + + case id = "_id" + + case name + + case description + + case sender + + case username + + case authkey + + case application + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case slug + + case v = "__v" + } + + public init(application: String?, authkey: String?, createdAt: String?, description: String?, name: String?, provider: String?, rpt: Int?, sender: String?, slug: String?, type: String?, updatedAt: String?, username: String?, id: String?, v: Int?) { + self.rpt = rpt + + self.type = type + + self.provider = provider + + self.id = id + + self.name = name + + self.description = description + + self.sender = sender + + self.username = username + + self.authkey = authkey + + self.application = application + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.slug = slug + + self.v = v + } + + public func duplicate() -> SmsProvider { + let dict = self.dictionary! + let copy = SmsProvider(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + rpt = try container.decode(Int.self, forKey: .rpt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + provider = try container.decode(String.self, forKey: .provider) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sender = try container.decode(String.self, forKey: .sender) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + authkey = try container.decode(String.self, forKey: .authkey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(rpt, forKey: .rpt) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(provider, forKey: .provider) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(sender, forKey: .sender) + + try? container.encodeIfPresent(username, forKey: .username) + + try? container.encodeIfPresent(authkey, forKey: .authkey) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: SmsProviders + Used By: Communication + */ + + class SmsProviders: Codable { + public var items: [SmsProvider]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [SmsProvider]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> SmsProviders { + let dict = self.dictionary! + let copy = SmsProviders(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([SmsProvider].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: SmsTemplateDeleteSuccessRes + Used By: Communication + */ + + class SmsTemplateDeleteSuccessRes: Codable { + public var success: Bool? + + public var message: String? + + public enum CodingKeys: String, CodingKey { + case success + + case message + } + + public init(message: String?, success: Bool?) { + self.success = success + + self.message = message + } + + public func duplicate() -> SmsTemplateDeleteSuccessRes { + let dict = self.dictionary! + let copy = SmsTemplateDeleteSuccessRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: SmsTemplateDeleteFailureRes + Used By: Communication + */ + + class SmsTemplateDeleteFailureRes: Codable { + public var success: Bool? + + public var message: String? + + public enum CodingKeys: String, CodingKey { + case success + + case message + } + + public init(message: String?, success: Bool?) { + self.success = success + + self.message = message + } + + public func duplicate() -> SmsTemplateDeleteFailureRes { + let dict = self.dictionary! + let copy = SmsTemplateDeleteFailureRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: SmsTemplateMessage + Used By: Communication + */ + + class SmsTemplateMessage: Codable { + public var templateType: String? + + public var template: String? + + public enum CodingKeys: String, CodingKey { + case templateType = "template_type" + + case template + } + + public init(template: String?, templateType: String?) { + self.templateType = templateType + + self.template = template + } + + public func duplicate() -> SmsTemplateMessage { + let dict = self.dictionary! + let copy = SmsTemplateMessage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + templateType = try container.decode(String.self, forKey: .templateType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + template = try container.decode(String.self, forKey: .template) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(templateType, forKey: .templateType) + + try? container.encodeIfPresent(template, forKey: .template) + } + } + + /* + Model: SmsTemplateReq + Used By: Communication + */ + + class SmsTemplateReq: Codable { + public var name: String? + + public var description: String? + + public var message: SmsTemplateMessage? + + public var templateVariables: [String: Any]? + + public var attachments: [[String: Any]]? + + public var priority: String? + + public enum CodingKeys: String, CodingKey { + case name + + case description + + case message + + case templateVariables = "template_variables" + + case attachments + + case priority + } + + public init(attachments: [[String: Any]]?, description: String?, message: SmsTemplateMessage?, name: String?, priority: String?, templateVariables: [String: Any]?) { + self.name = name + + self.description = description + + self.message = message + + self.templateVariables = templateVariables + + self.attachments = attachments + + self.priority = priority + } + + public func duplicate() -> SmsTemplateReq { + let dict = self.dictionary! + let copy = SmsTemplateReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(SmsTemplateMessage.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + templateVariables = try container.decode([String: Any].self, forKey: .templateVariables) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attachments = try container.decode([[String: Any]].self, forKey: .attachments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(String.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(templateVariables, forKey: .templateVariables) + + try? container.encodeIfPresent(attachments, forKey: .attachments) + + try? container.encodeIfPresent(priority, forKey: .priority) + } + } + + /* + Model: SmsTemplateRes + Used By: Communication + */ + + class SmsTemplateRes: Codable { + public var isSystem: Bool? + + public var isInternal: Bool? + + public var description: String? + + public var tags: [[String: Any]]? + + public var priority: String? + + public var published: Bool? + + public var id: String? + + public var name: String? + + public var message: SmsTemplateMessage? + + public var templateVariables: [String: Any]? + + public var createdAt: String? + + public var updatedAt: String? + + public var slug: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case isSystem = "is_system" + + case isInternal = "is_internal" + + case description + + case tags + + case priority + + case published + + case id = "_id" + + case name + + case message + + case templateVariables = "template_variables" + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case slug + + case v = "__v" + } + + public init(createdAt: String?, description: String?, isInternal: Bool?, isSystem: Bool?, message: SmsTemplateMessage?, name: String?, priority: String?, published: Bool?, slug: String?, tags: [[String: Any]]?, templateVariables: [String: Any]?, updatedAt: String?, id: String?, v: Int?) { + self.isSystem = isSystem + + self.isInternal = isInternal + + self.description = description + + self.tags = tags + + self.priority = priority + + self.published = published + + self.id = id + + self.name = name + + self.message = message + + self.templateVariables = templateVariables + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.slug = slug + + self.v = v + } + + public func duplicate() -> SmsTemplateRes { + let dict = self.dictionary! + let copy = SmsTemplateRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isSystem = try container.decode(Bool.self, forKey: .isSystem) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isInternal = try container.decode(Bool.self, forKey: .isInternal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([[String: Any]].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(String.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(SmsTemplateMessage.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + templateVariables = try container.decode([String: Any].self, forKey: .templateVariables) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isSystem, forKey: .isSystem) + + try? container.encodeIfPresent(isInternal, forKey: .isInternal) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(templateVariables, forKey: .templateVariables) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: SmsTemplate + Used By: Communication + */ + + class SmsTemplate: Codable { + public var isSystem: Bool? + + public var isInternal: Bool? + + public var description: String? + + public var priority: String? + + public var tags: [[String: Any]]? + + public var published: Bool? + + public var id: String? + + public var slug: String? + + public var name: String? + + public var message: SmsTemplateMessage? + + public var templateVariables: [String: Any]? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case isSystem = "is_system" + + case isInternal = "is_internal" + + case description + + case priority + + case tags + + case published + + case id = "_id" + + case slug + + case name + + case message + + case templateVariables = "template_variables" + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + } + + public init(createdAt: String?, description: String?, isInternal: Bool?, isSystem: Bool?, message: SmsTemplateMessage?, name: String?, priority: String?, published: Bool?, slug: String?, tags: [[String: Any]]?, templateVariables: [String: Any]?, updatedAt: String?, id: String?, v: Int?) { + self.isSystem = isSystem + + self.isInternal = isInternal + + self.description = description + + self.priority = priority + + self.tags = tags + + self.published = published + + self.id = id + + self.slug = slug + + self.name = name + + self.message = message + + self.templateVariables = templateVariables + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + } + + public func duplicate() -> SmsTemplate { + let dict = self.dictionary! + let copy = SmsTemplate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isSystem = try container.decode(Bool.self, forKey: .isSystem) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isInternal = try container.decode(Bool.self, forKey: .isInternal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(String.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([[String: Any]].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(SmsTemplateMessage.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + templateVariables = try container.decode([String: Any].self, forKey: .templateVariables) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isSystem, forKey: .isSystem) + + try? container.encodeIfPresent(isInternal, forKey: .isInternal) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(templateVariables, forKey: .templateVariables) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: SystemSmsTemplate + Used By: Communication + */ + + class SystemSmsTemplate: Codable { + public var isSystem: Bool? + + public var isInternal: Bool? + + public var description: String? + + public var tags: [[String: Any]]? + + public var priority: String? + + public var published: Bool? + + public var id: String? + + public var slug: String? + + public var name: String? + + public var message: SmsTemplateMessage? + + public var templateVariables: [String: Any]? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case isSystem = "is_system" + + case isInternal = "is_internal" + + case description + + case tags + + case priority + + case published + + case id = "_id" + + case slug + + case name + + case message + + case templateVariables = "template_variables" + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + } + + public init(createdAt: String?, description: String?, isInternal: Bool?, isSystem: Bool?, message: SmsTemplateMessage?, name: String?, priority: String?, published: Bool?, slug: String?, tags: [[String: Any]]?, templateVariables: [String: Any]?, updatedAt: String?, id: String?, v: Int?) { + self.isSystem = isSystem + + self.isInternal = isInternal + + self.description = description + + self.tags = tags + + self.priority = priority + + self.published = published + + self.id = id + + self.slug = slug + + self.name = name + + self.message = message + + self.templateVariables = templateVariables + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + } + + public func duplicate() -> SystemSmsTemplate { + let dict = self.dictionary! + let copy = SystemSmsTemplate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isSystem = try container.decode(Bool.self, forKey: .isSystem) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isInternal = try container.decode(Bool.self, forKey: .isInternal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([[String: Any]].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(String.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(SmsTemplateMessage.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + templateVariables = try container.decode([String: Any].self, forKey: .templateVariables) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isSystem, forKey: .isSystem) + + try? container.encodeIfPresent(isInternal, forKey: .isInternal) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(templateVariables, forKey: .templateVariables) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: SmsTemplates + Used By: Communication + */ + + class SmsTemplates: Codable { + public var items: [SmsTemplate]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [SmsTemplate]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> SmsTemplates { + let dict = self.dictionary! + let copy = SmsTemplates(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([SmsTemplate].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: SystemSmsTemplates + Used By: Communication + */ + + class SystemSmsTemplates: Codable { + public var items: [SystemSmsTemplate]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [SystemSmsTemplate]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> SystemSmsTemplates { + let dict = self.dictionary! + let copy = SystemSmsTemplates(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([SystemSmsTemplate].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: Notification + Used By: Communication + */ + + class Notification: Codable { + public var title: String? + + public var body: String? + + public var subtitle: String? + + public var icon: String? + + public var deeplink: String? + + public var clickAction: String? + + public enum CodingKeys: String, CodingKey { + case title + + case body + + case subtitle + + case icon + + case deeplink + + case clickAction = "click_action" + } + + public init(body: String?, clickAction: String?, deeplink: String?, icon: String?, subtitle: String?, title: String?) { + self.title = title + + self.body = body + + self.subtitle = subtitle + + self.icon = icon + + self.deeplink = deeplink + + self.clickAction = clickAction + } + + public func duplicate() -> Notification { + let dict = self.dictionary! + let copy = Notification(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + body = try container.decode(String.self, forKey: .body) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subtitle = try container.decode(String.self, forKey: .subtitle) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deeplink = try container.decode(String.self, forKey: .deeplink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + clickAction = try container.decode(String.self, forKey: .clickAction) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(body, forKey: .body) + + try? container.encodeIfPresent(subtitle, forKey: .subtitle) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(deeplink, forKey: .deeplink) + + try? container.encodeIfPresent(clickAction, forKey: .clickAction) + } + } + + /* + Model: SystemNotificationUser + Used By: Communication + */ + + class SystemNotificationUser: Codable { + public var type: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case type + + case value + } + + public init(type: String?, value: String?) { + self.type = type + + self.value = value + } + + public func duplicate() -> SystemNotificationUser { + let dict = self.dictionary! + let copy = SystemNotificationUser(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: SystemNotificationSettings + Used By: Communication + */ + + class SystemNotificationSettings: Codable { + public var sound: Bool? + + public var priority: String? + + public var timeToLive: String? + + public enum CodingKeys: String, CodingKey { + case sound + + case priority + + case timeToLive = "time_to_live" + } + + public init(priority: String?, sound: Bool?, timeToLive: String?) { + self.sound = sound + + self.priority = priority + + self.timeToLive = timeToLive + } + + public func duplicate() -> SystemNotificationSettings { + let dict = self.dictionary! + let copy = SystemNotificationSettings(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + sound = try container.decode(Bool.self, forKey: .sound) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(String.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + timeToLive = try container.decode(String.self, forKey: .timeToLive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(sound, forKey: .sound) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(timeToLive, forKey: .timeToLive) + } + } + + /* + Model: SystemNotification + Used By: Communication + */ + + class SystemNotification: Codable { + public var notification: Notification? + + public var user: SystemNotificationUser? + + public var settings: SystemNotificationUser? + + public var id: String? + + public var group: String? + + public var createdAt: String? + + public enum CodingKeys: String, CodingKey { + case notification + + case user + + case settings + + case id = "_id" + + case group + + case createdAt = "created_at" + } + + public init(createdAt: String?, group: String?, notification: Notification?, settings: SystemNotificationUser?, user: SystemNotificationUser?, id: String?) { + self.notification = notification + + self.user = user + + self.settings = settings + + self.id = id + + self.group = group + + self.createdAt = createdAt + } + + public func duplicate() -> SystemNotification { + let dict = self.dictionary! + let copy = SystemNotification(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + notification = try container.decode(Notification.self, forKey: .notification) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + user = try container.decode(SystemNotificationUser.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + settings = try container.decode(SystemNotificationUser.self, forKey: .settings) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + group = try container.decode(String.self, forKey: .group) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(notification, forKey: .notification) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(settings, forKey: .settings) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(group, forKey: .group) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + } + } + + /* + Model: SystemNotificationsPage + Used By: Communication + */ + + class SystemNotificationsPage: Codable { + public var type: String? + + public var current: Int? + + public var size: Int? + + public var itemTotal: Int? + + public var hasNext: Bool? + + public enum CodingKeys: String, CodingKey { + case type + + case current + + case size + + case itemTotal = "item_total" + + case hasNext = "has_next" + } + + public init(current: Int?, hasNext: Bool?, itemTotal: Int?, size: Int?, type: String?) { + self.type = type + + self.current = current + + self.size = size + + self.itemTotal = itemTotal + + self.hasNext = hasNext + } + + public func duplicate() -> SystemNotificationsPage { + let dict = self.dictionary! + let copy = SystemNotificationsPage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + current = try container.decode(Int.self, forKey: .current) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(Int.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemTotal = try container.decode(Int.self, forKey: .itemTotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasNext = try container.decode(Bool.self, forKey: .hasNext) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(current, forKey: .current) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) + + try? container.encodeIfPresent(hasNext, forKey: .hasNext) + } + } + + /* + Model: SystemNotifications + Used By: Communication + */ + + class SystemNotifications: Codable { + public var items: [SystemNotification]? + + public var lastReadAnchor: Int? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case lastReadAnchor = "last_read_anchor" + + case page + } + + public init(items: [SystemNotification]?, lastReadAnchor: Int?, page: Page?) { + self.items = items + + self.lastReadAnchor = lastReadAnchor + + self.page = page + } + + public func duplicate() -> SystemNotifications { + let dict = self.dictionary! + let copy = SystemNotifications(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([SystemNotification].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastReadAnchor = try container.decode(Int.self, forKey: .lastReadAnchor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(lastReadAnchor, forKey: .lastReadAnchor) + + try? container.encodeIfPresent(page, forKey: .page) + } + } +} diff --git a/Sources/code/platform/models/CompanyProfilePlatformModelClass.swift b/Sources/code/platform/models/CompanyProfilePlatformModelClass.swift new file mode 100644 index 0000000000..a1ee3b7695 --- /dev/null +++ b/Sources/code/platform/models/CompanyProfilePlatformModelClass.swift @@ -0,0 +1,2520 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: CreateUpdateAddressSerializer + Used By: CompanyProfile + */ + + class CreateUpdateAddressSerializer: Codable { + public var landmark: String? + + public var city: String + + public var state: String + + public var latitude: Double + + public var addressType: String + + public var pincode: Int + + public var country: String + + public var countryCode: String? + + public var address2: String? + + public var longitude: Double + + public var address1: String + + public enum CodingKeys: String, CodingKey { + case landmark + + case city + + case state + + case latitude + + case addressType = "address_type" + + case pincode + + case country + + case countryCode = "country_code" + + case address2 + + case longitude + + case address1 + } + + public init(address1: String, address2: String?, addressType: String, city: String, country: String, countryCode: String?, landmark: String?, latitude: Double, longitude: Double, pincode: Int, state: String) { + self.landmark = landmark + + self.city = city + + self.state = state + + self.latitude = latitude + + self.addressType = addressType + + self.pincode = pincode + + self.country = country + + self.countryCode = countryCode + + self.address2 = address2 + + self.longitude = longitude + + self.address1 = address1 + } + + public func duplicate() -> CreateUpdateAddressSerializer { + let dict = self.dictionary! + let copy = CreateUpdateAddressSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + landmark = try container.decode(String.self, forKey: .landmark) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + city = try container.decode(String.self, forKey: .city) + + state = try container.decode(String.self, forKey: .state) + + latitude = try container.decode(Double.self, forKey: .latitude) + + addressType = try container.decode(String.self, forKey: .addressType) + + pincode = try container.decode(Int.self, forKey: .pincode) + + country = try container.decode(String.self, forKey: .country) + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address2 = try container.decode(String.self, forKey: .address2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + longitude = try container.decode(Double.self, forKey: .longitude) + + address1 = try container.decode(String.self, forKey: .address1) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(landmark, forKey: .landmark) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(latitude, forKey: .latitude) + + try? container.encodeIfPresent(addressType, forKey: .addressType) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(address2, forKey: .address2) + + try? container.encodeIfPresent(longitude, forKey: .longitude) + + try? container.encodeIfPresent(address1, forKey: .address1) + } + } + + /* + Model: Website + Used By: CompanyProfile + */ + + class Website: Codable { + public var url: String? + + public enum CodingKeys: String, CodingKey { + case url + } + + public init(url: String?) { + self.url = url + } + + public func duplicate() -> Website { + let dict = self.dictionary! + let copy = Website(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(url, forKey: .url) + } + } + + /* + Model: BusinessDetails + Used By: CompanyProfile + */ + + class BusinessDetails: Codable { + public var website: Website? + + public enum CodingKeys: String, CodingKey { + case website + } + + public init(website: Website?) { + self.website = website + } + + public func duplicate() -> BusinessDetails { + let dict = self.dictionary! + let copy = BusinessDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + website = try container.decode(Website.self, forKey: .website) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(website, forKey: .website) + } + } + + /* + Model: ContactDetails + Used By: CompanyProfile + */ + + class ContactDetails: Codable { + public var emails: [String]? + + public var phone: [SellerPhoneNumber]? + + public enum CodingKeys: String, CodingKey { + case emails + + case phone + } + + public init(emails: [String]?, phone: [SellerPhoneNumber]?) { + self.emails = emails + + self.phone = phone + } + + public func duplicate() -> ContactDetails { + let dict = self.dictionary! + let copy = ContactDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + emails = try container.decode([String].self, forKey: .emails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode([SellerPhoneNumber].self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(emails, forKey: .emails) + + try? container.encodeIfPresent(phone, forKey: .phone) + } + } + + /* + Model: UpdateCompany + Used By: CompanyProfile + */ + + class UpdateCompany: Codable { + public var addresses: [CreateUpdateAddressSerializer]? + + public var rejectReason: String? + + public var businessDetails: BusinessDetails? + + public var documents: [Document]? + + public var name: String? + + public var customJson: [String: Any]? + + public var notificationEmails: [String]? + + public var franchiseEnabled: Bool? + + public var businessInfo: String? + + public var companyType: String? + + public var contactDetails: ContactDetails? + + public var warnings: [String: Any]? + + public var businessType: String? + + public enum CodingKeys: String, CodingKey { + case addresses + + case rejectReason = "reject_reason" + + case businessDetails = "business_details" + + case documents + + case name + + case customJson = "_custom_json" + + case notificationEmails = "notification_emails" + + case franchiseEnabled = "franchise_enabled" + + case businessInfo = "business_info" + + case companyType = "company_type" + + case contactDetails = "contact_details" + + case warnings + + case businessType = "business_type" + } + + public init(addresses: [CreateUpdateAddressSerializer]?, businessDetails: BusinessDetails?, businessInfo: String?, businessType: String?, companyType: String?, contactDetails: ContactDetails?, documents: [Document]?, franchiseEnabled: Bool?, name: String?, notificationEmails: [String]?, rejectReason: String?, warnings: [String: Any]?, customJson: [String: Any]?) { + self.addresses = addresses + + self.rejectReason = rejectReason + + self.businessDetails = businessDetails + + self.documents = documents + + self.name = name + + self.customJson = customJson + + self.notificationEmails = notificationEmails + + self.franchiseEnabled = franchiseEnabled + + self.businessInfo = businessInfo + + self.companyType = companyType + + self.contactDetails = contactDetails + + self.warnings = warnings + + self.businessType = businessType + } + + public func duplicate() -> UpdateCompany { + let dict = self.dictionary! + let copy = UpdateCompany(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + addresses = try container.decode([CreateUpdateAddressSerializer].self, forKey: .addresses) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rejectReason = try container.decode(String.self, forKey: .rejectReason) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + businessDetails = try container.decode(BusinessDetails.self, forKey: .businessDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + documents = try container.decode([Document].self, forKey: .documents) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + notificationEmails = try container.decode([String].self, forKey: .notificationEmails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + franchiseEnabled = try container.decode(Bool.self, forKey: .franchiseEnabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + businessInfo = try container.decode(String.self, forKey: .businessInfo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyType = try container.decode(String.self, forKey: .companyType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contactDetails = try container.decode(ContactDetails.self, forKey: .contactDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + warnings = try container.decode([String: Any].self, forKey: .warnings) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + businessType = try container.decode(String.self, forKey: .businessType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(addresses, forKey: .addresses) + + try? container.encodeIfPresent(rejectReason, forKey: .rejectReason) + + try? container.encodeIfPresent(businessDetails, forKey: .businessDetails) + + try? container.encodeIfPresent(documents, forKey: .documents) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(notificationEmails, forKey: .notificationEmails) + + try? container.encodeIfPresent(franchiseEnabled, forKey: .franchiseEnabled) + + try? container.encodeIfPresent(businessInfo, forKey: .businessInfo) + + try? container.encodeIfPresent(companyType, forKey: .companyType) + + try? container.encodeIfPresent(contactDetails, forKey: .contactDetails) + + try? container.encodeIfPresent(warnings, forKey: .warnings) + + try? container.encodeIfPresent(businessType, forKey: .businessType) + } + } + + /* + Model: BusinessCountryInfo + Used By: CompanyProfile + */ + + class BusinessCountryInfo: Codable { + public var countryCode: String? + + public var country: String? + + public enum CodingKeys: String, CodingKey { + case countryCode = "country_code" + + case country + } + + public init(country: String?, countryCode: String?) { + self.countryCode = countryCode + + self.country = country + } + + public func duplicate() -> BusinessCountryInfo { + let dict = self.dictionary! + let copy = BusinessCountryInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(country, forKey: .country) + } + } + + /* + Model: GetCompanyProfileSerializerResponse + Used By: CompanyProfile + */ + + class GetCompanyProfileSerializerResponse: Codable { + public var businessDetails: BusinessDetails? + + public var modifiedBy: UserSerializer? + + public var franchiseEnabled: Bool? + + public var createdBy: UserSerializer? + + public var warnings: [String: Any]? + + public var mode: String? + + public var businessCountryInfo: BusinessCountryInfo? + + public var notificationEmails: [String]? + + public var verifiedOn: String? + + public var businessInfo: String? + + public var verifiedBy: UserSerializer? + + public var modifiedOn: String? + + public var stage: String? + + public var documents: [Document]? + + public var contactDetails: ContactDetails? + + public var businessType: String + + public var addresses: [GetAddressSerializer]? + + public var createdOn: String? + + public var uid: Int + + public var name: String? + + public var companyType: String + + public enum CodingKeys: String, CodingKey { + case businessDetails = "business_details" + + case modifiedBy = "modified_by" + + case franchiseEnabled = "franchise_enabled" + + case createdBy = "created_by" + + case warnings + + case mode + + case businessCountryInfo = "business_country_info" + + case notificationEmails = "notification_emails" + + case verifiedOn = "verified_on" + + case businessInfo = "business_info" + + case verifiedBy = "verified_by" + + case modifiedOn = "modified_on" + + case stage + + case documents + + case contactDetails = "contact_details" + + case businessType = "business_type" + + case addresses + + case createdOn = "created_on" + + case uid + + case name + + case companyType = "company_type" + } + + public init(addresses: [GetAddressSerializer]?, businessCountryInfo: BusinessCountryInfo?, businessDetails: BusinessDetails?, businessInfo: String?, businessType: String, companyType: String, contactDetails: ContactDetails?, createdBy: UserSerializer?, createdOn: String?, documents: [Document]?, franchiseEnabled: Bool?, mode: String?, modifiedBy: UserSerializer?, modifiedOn: String?, name: String?, notificationEmails: [String]?, stage: String?, uid: Int, verifiedBy: UserSerializer?, verifiedOn: String?, warnings: [String: Any]?) { + self.businessDetails = businessDetails + + self.modifiedBy = modifiedBy + + self.franchiseEnabled = franchiseEnabled + + self.createdBy = createdBy + + self.warnings = warnings + + self.mode = mode + + self.businessCountryInfo = businessCountryInfo + + self.notificationEmails = notificationEmails + + self.verifiedOn = verifiedOn + + self.businessInfo = businessInfo + + self.verifiedBy = verifiedBy + + self.modifiedOn = modifiedOn + + self.stage = stage + + self.documents = documents + + self.contactDetails = contactDetails + + self.businessType = businessType + + self.addresses = addresses + + self.createdOn = createdOn + + self.uid = uid + + self.name = name + + self.companyType = companyType + } + + public func duplicate() -> GetCompanyProfileSerializerResponse { + let dict = self.dictionary! + let copy = GetCompanyProfileSerializerResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + businessDetails = try container.decode(BusinessDetails.self, forKey: .businessDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode(UserSerializer.self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + franchiseEnabled = try container.decode(Bool.self, forKey: .franchiseEnabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(UserSerializer.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + warnings = try container.decode([String: Any].self, forKey: .warnings) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mode = try container.decode(String.self, forKey: .mode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + businessCountryInfo = try container.decode(BusinessCountryInfo.self, forKey: .businessCountryInfo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + notificationEmails = try container.decode([String].self, forKey: .notificationEmails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifiedOn = try container.decode(String.self, forKey: .verifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + businessInfo = try container.decode(String.self, forKey: .businessInfo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifiedBy = try container.decode(UserSerializer.self, forKey: .verifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stage = try container.decode(String.self, forKey: .stage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + documents = try container.decode([Document].self, forKey: .documents) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contactDetails = try container.decode(ContactDetails.self, forKey: .contactDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + businessType = try container.decode(String.self, forKey: .businessType) + + do { + addresses = try container.decode([GetAddressSerializer].self, forKey: .addresses) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + uid = try container.decode(Int.self, forKey: .uid) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + companyType = try container.decode(String.self, forKey: .companyType) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(businessDetails, forKey: .businessDetails) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(franchiseEnabled, forKey: .franchiseEnabled) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(warnings, forKey: .warnings) + + try? container.encodeIfPresent(mode, forKey: .mode) + + try? container.encodeIfPresent(businessCountryInfo, forKey: .businessCountryInfo) + + try? container.encodeIfPresent(notificationEmails, forKey: .notificationEmails) + + try? container.encodeIfPresent(verifiedOn, forKey: .verifiedOn) + + try? container.encodeIfPresent(businessInfo, forKey: .businessInfo) + + try? container.encodeIfPresent(verifiedBy, forKey: .verifiedBy) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(stage, forKey: .stage) + + try? container.encodeIfPresent(documents, forKey: .documents) + + try? container.encodeIfPresent(contactDetails, forKey: .contactDetails) + + try? container.encodeIfPresent(businessType, forKey: .businessType) + + try? container.encodeIfPresent(addresses, forKey: .addresses) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(companyType, forKey: .companyType) + } + } + + /* + Model: DocumentsObj + Used By: CompanyProfile + */ + + class DocumentsObj: Codable { + public var verified: Int? + + public var pending: Int? + + public enum CodingKeys: String, CodingKey { + case verified + + case pending + } + + public init(pending: Int?, verified: Int?) { + self.verified = verified + + self.pending = pending + } + + public func duplicate() -> DocumentsObj { + let dict = self.dictionary! + let copy = DocumentsObj(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + verified = try container.decode(Int.self, forKey: .verified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pending = try container.decode(Int.self, forKey: .pending) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(verified, forKey: .verified) + + try? container.encodeIfPresent(pending, forKey: .pending) + } + } + + /* + Model: MetricsSerializer + Used By: CompanyProfile + */ + + class MetricsSerializer: Codable { + public var companyDocuments: DocumentsObj? + + public var product: DocumentsObj? + + public var store: DocumentsObj? + + public var stage: String? + + public var uid: Int? + + public var storeDocuments: DocumentsObj? + + public var brand: DocumentsObj? + + public enum CodingKeys: String, CodingKey { + case companyDocuments = "company_documents" + + case product + + case store + + case stage + + case uid + + case storeDocuments = "store_documents" + + case brand + } + + public init(brand: DocumentsObj?, companyDocuments: DocumentsObj?, product: DocumentsObj?, stage: String?, store: DocumentsObj?, storeDocuments: DocumentsObj?, uid: Int?) { + self.companyDocuments = companyDocuments + + self.product = product + + self.store = store + + self.stage = stage + + self.uid = uid + + self.storeDocuments = storeDocuments + + self.brand = brand + } + + public func duplicate() -> MetricsSerializer { + let dict = self.dictionary! + let copy = MetricsSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + companyDocuments = try container.decode(DocumentsObj.self, forKey: .companyDocuments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + product = try container.decode(DocumentsObj.self, forKey: .product) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + store = try container.decode(DocumentsObj.self, forKey: .store) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stage = try container.decode(String.self, forKey: .stage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeDocuments = try container.decode(DocumentsObj.self, forKey: .storeDocuments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brand = try container.decode(DocumentsObj.self, forKey: .brand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(companyDocuments, forKey: .companyDocuments) + + try? container.encodeIfPresent(product, forKey: .product) + + try? container.encodeIfPresent(store, forKey: .store) + + try? container.encodeIfPresent(stage, forKey: .stage) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(storeDocuments, forKey: .storeDocuments) + + try? container.encodeIfPresent(brand, forKey: .brand) + } + } + + /* + Model: BrandBannerSerializer + Used By: CompanyProfile + */ + + class BrandBannerSerializer: Codable { + public var portrait: String? + + public var landscape: String? + + public enum CodingKeys: String, CodingKey { + case portrait + + case landscape + } + + public init(landscape: String?, portrait: String?) { + self.portrait = portrait + + self.landscape = landscape + } + + public func duplicate() -> BrandBannerSerializer { + let dict = self.dictionary! + let copy = BrandBannerSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + portrait = try container.decode(String.self, forKey: .portrait) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + landscape = try container.decode(String.self, forKey: .landscape) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(portrait, forKey: .portrait) + + try? container.encodeIfPresent(landscape, forKey: .landscape) + } + } + + /* + Model: CreateUpdateBrandRequestSerializer + Used By: CompanyProfile + */ + + class CreateUpdateBrandRequestSerializer: Codable { + public var synonyms: [String]? + + public var banner: BrandBannerSerializer? + + public var brandTier: String? + + public var localeLanguage: [String: Any]? + + public var uid: Int? + + public var name: String + + public var customJson: [String: Any]? + + public var companyId: Int? + + public var logo: String + + public var description: String? + + public enum CodingKeys: String, CodingKey { + case synonyms + + case banner + + case brandTier = "brand_tier" + + case localeLanguage = "_locale_language" + + case uid + + case name + + case customJson = "_custom_json" + + case companyId = "company_id" + + case logo + + case description + } + + public init(banner: BrandBannerSerializer?, brandTier: String?, companyId: Int?, description: String?, logo: String, name: String, synonyms: [String]?, uid: Int?, customJson: [String: Any]?, localeLanguage: [String: Any]?) { + self.synonyms = synonyms + + self.banner = banner + + self.brandTier = brandTier + + self.localeLanguage = localeLanguage + + self.uid = uid + + self.name = name + + self.customJson = customJson + + self.companyId = companyId + + self.logo = logo + + self.description = description + } + + public func duplicate() -> CreateUpdateBrandRequestSerializer { + let dict = self.dictionary! + let copy = CreateUpdateBrandRequestSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + synonyms = try container.decode([String].self, forKey: .synonyms) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banner = try container.decode(BrandBannerSerializer.self, forKey: .banner) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandTier = try container.decode(String.self, forKey: .brandTier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + localeLanguage = try container.decode([String: Any].self, forKey: .localeLanguage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + name = try container.decode(String.self, forKey: .name) + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + logo = try container.decode(String.self, forKey: .logo) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(synonyms, forKey: .synonyms) + + try? container.encodeIfPresent(banner, forKey: .banner) + + try? container.encodeIfPresent(brandTier, forKey: .brandTier) + + try? container.encodeIfPresent(localeLanguage, forKey: .localeLanguage) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(description, forKey: .description) + } + } + + /* + Model: GetBrandResponseSerializer + Used By: CompanyProfile + */ + + class GetBrandResponseSerializer: Codable { + public var synonyms: [String]? + + public var modifiedBy: UserSerializer1? + + public var createdBy: UserSerializer1? + + public var warnings: [String: Any]? + + public var mode: String? + + public var localeLanguage: [String: Any]? + + public var customJson: [String: Any]? + + public var verifiedOn: String? + + public var slugKey: String? + + public var verifiedBy: UserSerializer1? + + public var modifiedOn: String? + + public var stage: String? + + public var logo: String? + + public var description: String? + + public var banner: BrandBannerSerializer? + + public var createdOn: String? + + public var uid: Int? + + public var rejectReason: String? + + public var name: String + + public enum CodingKeys: String, CodingKey { + case synonyms + + case modifiedBy = "modified_by" + + case createdBy = "created_by" + + case warnings + + case mode + + case localeLanguage = "_locale_language" + + case customJson = "_custom_json" + + case verifiedOn = "verified_on" + + case slugKey = "slug_key" + + case verifiedBy = "verified_by" + + case modifiedOn = "modified_on" + + case stage + + case logo + + case description + + case banner + + case createdOn = "created_on" + + case uid + + case rejectReason = "reject_reason" + + case name + } + + public init(banner: BrandBannerSerializer?, createdBy: UserSerializer1?, createdOn: String?, description: String?, logo: String?, mode: String?, modifiedBy: UserSerializer1?, modifiedOn: String?, name: String, rejectReason: String?, slugKey: String?, stage: String?, synonyms: [String]?, uid: Int?, verifiedBy: UserSerializer1?, verifiedOn: String?, warnings: [String: Any]?, customJson: [String: Any]?, localeLanguage: [String: Any]?) { + self.synonyms = synonyms + + self.modifiedBy = modifiedBy + + self.createdBy = createdBy + + self.warnings = warnings + + self.mode = mode + + self.localeLanguage = localeLanguage + + self.customJson = customJson + + self.verifiedOn = verifiedOn + + self.slugKey = slugKey + + self.verifiedBy = verifiedBy + + self.modifiedOn = modifiedOn + + self.stage = stage + + self.logo = logo + + self.description = description + + self.banner = banner + + self.createdOn = createdOn + + self.uid = uid + + self.rejectReason = rejectReason + + self.name = name + } + + public func duplicate() -> GetBrandResponseSerializer { + let dict = self.dictionary! + let copy = GetBrandResponseSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + synonyms = try container.decode([String].self, forKey: .synonyms) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode(UserSerializer1.self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(UserSerializer1.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + warnings = try container.decode([String: Any].self, forKey: .warnings) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mode = try container.decode(String.self, forKey: .mode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + localeLanguage = try container.decode([String: Any].self, forKey: .localeLanguage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifiedOn = try container.decode(String.self, forKey: .verifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slugKey = try container.decode(String.self, forKey: .slugKey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifiedBy = try container.decode(UserSerializer1.self, forKey: .verifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stage = try container.decode(String.self, forKey: .stage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banner = try container.decode(BrandBannerSerializer.self, forKey: .banner) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rejectReason = try container.decode(String.self, forKey: .rejectReason) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + name = try container.decode(String.self, forKey: .name) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(synonyms, forKey: .synonyms) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(warnings, forKey: .warnings) + + try? container.encodeIfPresent(mode, forKey: .mode) + + try? container.encodeIfPresent(localeLanguage, forKey: .localeLanguage) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(verifiedOn, forKey: .verifiedOn) + + try? container.encodeIfPresent(slugKey, forKey: .slugKey) + + try? container.encodeIfPresent(verifiedBy, forKey: .verifiedBy) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(stage, forKey: .stage) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(banner, forKey: .banner) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(rejectReason, forKey: .rejectReason) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: CompanyBrandPostRequestSerializer + Used By: CompanyProfile + */ + + class CompanyBrandPostRequestSerializer: Codable { + public var company: Int + + public var brands: [Int] + + public var uid: Int? + + public enum CodingKeys: String, CodingKey { + case company + + case brands + + case uid + } + + public init(brands: [Int], company: Int, uid: Int?) { + self.company = company + + self.brands = brands + + self.uid = uid + } + + public func duplicate() -> CompanyBrandPostRequestSerializer { + let dict = self.dictionary! + let copy = CompanyBrandPostRequestSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + company = try container.decode(Int.self, forKey: .company) + + brands = try container.decode([Int].self, forKey: .brands) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(company, forKey: .company) + + try? container.encodeIfPresent(brands, forKey: .brands) + + try? container.encodeIfPresent(uid, forKey: .uid) + } + } + + /* + Model: CompanyBrandSerializer + Used By: CompanyProfile + */ + + class CompanyBrandSerializer: Codable { + public var modifiedOn: String? + + public var createdOn: String? + + public var uid: Int? + + public var stage: String? + + public var rejectReason: String? + + public var verifiedOn: String? + + public var modifiedBy: UserSerializer1? + + public var company: GetCompanySerializer? + + public var createdBy: UserSerializer1? + + public var brand: GetBrandResponseSerializer? + + public var warnings: [String: Any]? + + public var verifiedBy: UserSerializer1? + + public enum CodingKeys: String, CodingKey { + case modifiedOn = "modified_on" + + case createdOn = "created_on" + + case uid + + case stage + + case rejectReason = "reject_reason" + + case verifiedOn = "verified_on" + + case modifiedBy = "modified_by" + + case company + + case createdBy = "created_by" + + case brand + + case warnings + + case verifiedBy = "verified_by" + } + + public init(brand: GetBrandResponseSerializer?, company: GetCompanySerializer?, createdBy: UserSerializer1?, createdOn: String?, modifiedBy: UserSerializer1?, modifiedOn: String?, rejectReason: String?, stage: String?, uid: Int?, verifiedBy: UserSerializer1?, verifiedOn: String?, warnings: [String: Any]?) { + self.modifiedOn = modifiedOn + + self.createdOn = createdOn + + self.uid = uid + + self.stage = stage + + self.rejectReason = rejectReason + + self.verifiedOn = verifiedOn + + self.modifiedBy = modifiedBy + + self.company = company + + self.createdBy = createdBy + + self.brand = brand + + self.warnings = warnings + + self.verifiedBy = verifiedBy + } + + public func duplicate() -> CompanyBrandSerializer { + let dict = self.dictionary! + let copy = CompanyBrandSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stage = try container.decode(String.self, forKey: .stage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rejectReason = try container.decode(String.self, forKey: .rejectReason) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifiedOn = try container.decode(String.self, forKey: .verifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode(UserSerializer1.self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + company = try container.decode(GetCompanySerializer.self, forKey: .company) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(UserSerializer1.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brand = try container.decode(GetBrandResponseSerializer.self, forKey: .brand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + warnings = try container.decode([String: Any].self, forKey: .warnings) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifiedBy = try container.decode(UserSerializer1.self, forKey: .verifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(stage, forKey: .stage) + + try? container.encodeIfPresent(rejectReason, forKey: .rejectReason) + + try? container.encodeIfPresent(verifiedOn, forKey: .verifiedOn) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(company, forKey: .company) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(brand, forKey: .brand) + + try? container.encodeIfPresent(warnings, forKey: .warnings) + + try? container.encodeIfPresent(verifiedBy, forKey: .verifiedBy) + } + } + + /* + Model: CompanyBrandListSerializer + Used By: CompanyProfile + */ + + class CompanyBrandListSerializer: Codable { + public var items: [CompanyBrandSerializer]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [CompanyBrandSerializer]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> CompanyBrandListSerializer { + let dict = self.dictionary! + let copy = CompanyBrandListSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([CompanyBrandSerializer].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: GetAddressSerializer1 + Used By: CompanyProfile + */ + + class GetAddressSerializer1: Codable { + public var landmark: String? + + public var city: String? + + public var addressType: String? + + public var state: String? + + public var latitude: Double? + + public var pincode: Int? + + public var country: String? + + public var countryCode: String? + + public var address2: String? + + public var longitude: Double? + + public var address1: String? + + public enum CodingKeys: String, CodingKey { + case landmark + + case city + + case addressType = "address_type" + + case state + + case latitude + + case pincode + + case country + + case countryCode = "country_code" + + case address2 + + case longitude + + case address1 + } + + public init(address1: String?, address2: String?, addressType: String?, city: String?, country: String?, countryCode: String?, landmark: String?, latitude: Double?, longitude: Double?, pincode: Int?, state: String?) { + self.landmark = landmark + + self.city = city + + self.addressType = addressType + + self.state = state + + self.latitude = latitude + + self.pincode = pincode + + self.country = country + + self.countryCode = countryCode + + self.address2 = address2 + + self.longitude = longitude + + self.address1 = address1 + } + + public func duplicate() -> GetAddressSerializer1 { + let dict = self.dictionary! + let copy = GetAddressSerializer1(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + landmark = try container.decode(String.self, forKey: .landmark) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressType = try container.decode(String.self, forKey: .addressType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + latitude = try container.decode(Double.self, forKey: .latitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(Int.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address2 = try container.decode(String.self, forKey: .address2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + longitude = try container.decode(Double.self, forKey: .longitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address1 = try container.decode(String.self, forKey: .address1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(landmark, forKey: .landmark) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(addressType, forKey: .addressType) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(latitude, forKey: .latitude) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(address2, forKey: .address2) + + try? container.encodeIfPresent(longitude, forKey: .longitude) + + try? container.encodeIfPresent(address1, forKey: .address1) + } + } + + /* + Model: LocationSerializer + Used By: CompanyProfile + */ + + class LocationSerializer: Codable { + public var storeType: String? + + public var address: GetAddressSerializer1 + + public var productReturnConfig: ProductReturnConfigSerializer? + + public var manager: LocationManagerSerializer? + + public var uid: Int? + + public var timing: [LocationDayWiseSerializer]? + + public var stage: String? + + public var documents: [Document]? + + public var name: String + + public var customJson: [String: Any]? + + public var displayName: String + + public var notificationEmails: [String]? + + public var gstCredentials: InvoiceDetailsSerializer? + + public var company: Int + + public var warnings: [String: Any]? + + public var contactNumbers: [SellerPhoneNumber]? + + public var code: String + + public enum CodingKeys: String, CodingKey { + case storeType = "store_type" + + case address + + case productReturnConfig = "product_return_config" + + case manager + + case uid + + case timing + + case stage + + case documents + + case name + + case customJson = "_custom_json" + + case displayName = "display_name" + + case notificationEmails = "notification_emails" + + case gstCredentials = "gst_credentials" + + case company + + case warnings + + case contactNumbers = "contact_numbers" + + case code + } + + public init(address: GetAddressSerializer1, code: String, company: Int, contactNumbers: [SellerPhoneNumber]?, displayName: String, documents: [Document]?, gstCredentials: InvoiceDetailsSerializer?, manager: LocationManagerSerializer?, name: String, notificationEmails: [String]?, productReturnConfig: ProductReturnConfigSerializer?, stage: String?, storeType: String?, timing: [LocationDayWiseSerializer]?, uid: Int?, warnings: [String: Any]?, customJson: [String: Any]?) { + self.storeType = storeType + + self.address = address + + self.productReturnConfig = productReturnConfig + + self.manager = manager + + self.uid = uid + + self.timing = timing + + self.stage = stage + + self.documents = documents + + self.name = name + + self.customJson = customJson + + self.displayName = displayName + + self.notificationEmails = notificationEmails + + self.gstCredentials = gstCredentials + + self.company = company + + self.warnings = warnings + + self.contactNumbers = contactNumbers + + self.code = code + } + + public func duplicate() -> LocationSerializer { + let dict = self.dictionary! + let copy = LocationSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + storeType = try container.decode(String.self, forKey: .storeType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + address = try container.decode(GetAddressSerializer1.self, forKey: .address) + + do { + productReturnConfig = try container.decode(ProductReturnConfigSerializer.self, forKey: .productReturnConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + manager = try container.decode(LocationManagerSerializer.self, forKey: .manager) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + timing = try container.decode([LocationDayWiseSerializer].self, forKey: .timing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stage = try container.decode(String.self, forKey: .stage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + documents = try container.decode([Document].self, forKey: .documents) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + name = try container.decode(String.self, forKey: .name) + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + displayName = try container.decode(String.self, forKey: .displayName) + + do { + notificationEmails = try container.decode([String].self, forKey: .notificationEmails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstCredentials = try container.decode(InvoiceDetailsSerializer.self, forKey: .gstCredentials) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + company = try container.decode(Int.self, forKey: .company) + + do { + warnings = try container.decode([String: Any].self, forKey: .warnings) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contactNumbers = try container.decode([SellerPhoneNumber].self, forKey: .contactNumbers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + code = try container.decode(String.self, forKey: .code) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(storeType, forKey: .storeType) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(productReturnConfig, forKey: .productReturnConfig) + + try? container.encodeIfPresent(manager, forKey: .manager) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(timing, forKey: .timing) + + try? container.encodeIfPresent(stage, forKey: .stage) + + try? container.encodeIfPresent(documents, forKey: .documents) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(notificationEmails, forKey: .notificationEmails) + + try? container.encodeIfPresent(gstCredentials, forKey: .gstCredentials) + + try? container.encodeIfPresent(company, forKey: .company) + + try? container.encodeIfPresent(warnings, forKey: .warnings) + + try? container.encodeIfPresent(contactNumbers, forKey: .contactNumbers) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: BulkLocationSerializer + Used By: CompanyProfile + */ + + class BulkLocationSerializer: Codable { + public var data: [LocationSerializer]? + + public enum CodingKeys: String, CodingKey { + case data + } + + public init(data: [LocationSerializer]?) { + self.data = data + } + + public func duplicate() -> BulkLocationSerializer { + let dict = self.dictionary! + let copy = BulkLocationSerializer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode([LocationSerializer].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + } + } +} diff --git a/Sources/code/platform/models/ConfigurationPlatformModelClass.swift b/Sources/code/platform/models/ConfigurationPlatformModelClass.swift new file mode 100644 index 0000000000..b45be9f5cb --- /dev/null +++ b/Sources/code/platform/models/ConfigurationPlatformModelClass.swift @@ -0,0 +1,13999 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: ApplicationInventory + Used By: Configuration + */ + + class ApplicationInventory: Codable { + public var inventory: AppInventoryConfig? + + public var authentication: AuthenticationConfig? + + public var articleAssignment: ArticleAssignmentConfig? + + public var rewardPoints: RewardPointsConfig? + + public var cart: AppCartConfig? + + public var payment: AppPaymentConfig? + + public var order: AppOrderConfig? + + public var logistics: AppLogisticsConfig? + + public var business: String? + + public var commsEnabled: Bool? + + public var platforms: [String]? + + public var id: String? + + public var loyaltyPoints: LoyaltyPointsConfig? + + public var app: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var modifiedBy: String? + + public enum CodingKeys: String, CodingKey { + case inventory + + case authentication + + case articleAssignment = "article_assignment" + + case rewardPoints = "reward_points" + + case cart + + case payment + + case order + + case logistics + + case business + + case commsEnabled = "comms_enabled" + + case platforms + + case id = "_id" + + case loyaltyPoints = "loyalty_points" + + case app + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case modifiedBy = "modified_by" + } + + public init(app: String?, articleAssignment: ArticleAssignmentConfig?, authentication: AuthenticationConfig?, business: String?, cart: AppCartConfig?, commsEnabled: Bool?, createdAt: String?, inventory: AppInventoryConfig?, logistics: AppLogisticsConfig?, loyaltyPoints: LoyaltyPointsConfig?, modifiedBy: String?, order: AppOrderConfig?, payment: AppPaymentConfig?, platforms: [String]?, rewardPoints: RewardPointsConfig?, updatedAt: String?, id: String?) { + self.inventory = inventory + + self.authentication = authentication + + self.articleAssignment = articleAssignment + + self.rewardPoints = rewardPoints + + self.cart = cart + + self.payment = payment + + self.order = order + + self.logistics = logistics + + self.business = business + + self.commsEnabled = commsEnabled + + self.platforms = platforms + + self.id = id + + self.loyaltyPoints = loyaltyPoints + + self.app = app + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.modifiedBy = modifiedBy + } + + public func duplicate() -> ApplicationInventory { + let dict = self.dictionary! + let copy = ApplicationInventory(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + inventory = try container.decode(AppInventoryConfig.self, forKey: .inventory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + authentication = try container.decode(AuthenticationConfig.self, forKey: .authentication) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + articleAssignment = try container.decode(ArticleAssignmentConfig.self, forKey: .articleAssignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rewardPoints = try container.decode(RewardPointsConfig.self, forKey: .rewardPoints) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cart = try container.decode(AppCartConfig.self, forKey: .cart) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + payment = try container.decode(AppPaymentConfig.self, forKey: .payment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + order = try container.decode(AppOrderConfig.self, forKey: .order) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logistics = try container.decode(AppLogisticsConfig.self, forKey: .logistics) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + business = try container.decode(String.self, forKey: .business) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + commsEnabled = try container.decode(Bool.self, forKey: .commsEnabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platforms = try container.decode([String].self, forKey: .platforms) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + loyaltyPoints = try container.decode(LoyaltyPointsConfig.self, forKey: .loyaltyPoints) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + app = try container.decode(String.self, forKey: .app) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode(String.self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(inventory, forKey: .inventory) + + try? container.encodeIfPresent(authentication, forKey: .authentication) + + try? container.encodeIfPresent(articleAssignment, forKey: .articleAssignment) + + try? container.encodeIfPresent(rewardPoints, forKey: .rewardPoints) + + try? container.encodeIfPresent(cart, forKey: .cart) + + try? container.encodeIfPresent(payment, forKey: .payment) + + try? container.encodeIfPresent(order, forKey: .order) + + try? container.encodeIfPresent(logistics, forKey: .logistics) + + try? container.encodeIfPresent(business, forKey: .business) + + try? container.encodeIfPresent(commsEnabled, forKey: .commsEnabled) + + try? container.encodeIfPresent(platforms, forKey: .platforms) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(loyaltyPoints, forKey: .loyaltyPoints) + + try? container.encodeIfPresent(app, forKey: .app) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + } + } + + /* + Model: AppInventoryConfig + Used By: Configuration + */ + + class AppInventoryConfig: Codable { + public var brand: InventoryBrand? + + public var store: InventoryStore? + + public var category: InventoryCategory? + + public var price: InventoryPrice? + + public var discount: InventoryDiscount? + + public var outOfStock: Bool? + + public var onlyVerifiedProducts: Bool? + + public var franchiseEnabled: Bool? + + public var excludeCategory: [[String: Any]]? + + public var image: [String]? + + public var companyStore: [[String: Any]]? + + public enum CodingKeys: String, CodingKey { + case brand + + case store + + case category + + case price + + case discount + + case outOfStock = "out_of_stock" + + case onlyVerifiedProducts = "only_verified_products" + + case franchiseEnabled = "franchise_enabled" + + case excludeCategory = "exclude_category" + + case image + + case companyStore = "company_store" + } + + public init(brand: InventoryBrand?, category: InventoryCategory?, companyStore: [[String: Any]]?, discount: InventoryDiscount?, excludeCategory: [[String: Any]]?, franchiseEnabled: Bool?, image: [String]?, onlyVerifiedProducts: Bool?, outOfStock: Bool?, price: InventoryPrice?, store: InventoryStore?) { + self.brand = brand + + self.store = store + + self.category = category + + self.price = price + + self.discount = discount + + self.outOfStock = outOfStock + + self.onlyVerifiedProducts = onlyVerifiedProducts + + self.franchiseEnabled = franchiseEnabled + + self.excludeCategory = excludeCategory + + self.image = image + + self.companyStore = companyStore + } + + public func duplicate() -> AppInventoryConfig { + let dict = self.dictionary! + let copy = AppInventoryConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + brand = try container.decode(InventoryBrand.self, forKey: .brand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + store = try container.decode(InventoryStore.self, forKey: .store) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + category = try container.decode(InventoryCategory.self, forKey: .category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(InventoryPrice.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discount = try container.decode(InventoryDiscount.self, forKey: .discount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + outOfStock = try container.decode(Bool.self, forKey: .outOfStock) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + onlyVerifiedProducts = try container.decode(Bool.self, forKey: .onlyVerifiedProducts) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + franchiseEnabled = try container.decode(Bool.self, forKey: .franchiseEnabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + excludeCategory = try container.decode([[String: Any]].self, forKey: .excludeCategory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + image = try container.decode([String].self, forKey: .image) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyStore = try container.decode([[String: Any]].self, forKey: .companyStore) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(brand, forKey: .brand) + + try? container.encodeIfPresent(store, forKey: .store) + + try? container.encodeIfPresent(category, forKey: .category) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(discount, forKey: .discount) + + try? container.encodeIfPresent(outOfStock, forKey: .outOfStock) + + try? container.encodeIfPresent(onlyVerifiedProducts, forKey: .onlyVerifiedProducts) + + try? container.encodeIfPresent(franchiseEnabled, forKey: .franchiseEnabled) + + try? container.encodeIfPresent(excludeCategory, forKey: .excludeCategory) + + try? container.encodeIfPresent(image, forKey: .image) + + try? container.encodeIfPresent(companyStore, forKey: .companyStore) + } + } + + /* + Model: InventoryBrand + Used By: Configuration + */ + + class InventoryBrand: Codable { + public var criteria: String? + + public var brands: [[String: Any]]? + + public enum CodingKeys: String, CodingKey { + case criteria + + case brands + } + + public init(brands: [[String: Any]]?, criteria: String?) { + self.criteria = criteria + + self.brands = brands + } + + public func duplicate() -> InventoryBrand { + let dict = self.dictionary! + let copy = InventoryBrand(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + criteria = try container.decode(String.self, forKey: .criteria) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brands = try container.decode([[String: Any]].self, forKey: .brands) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(criteria, forKey: .criteria) + + try? container.encodeIfPresent(brands, forKey: .brands) + } + } + + /* + Model: InventoryStore + Used By: Configuration + */ + + class InventoryStore: Codable { + public var criteria: String? + + public var stores: [[String: Any]]? + + public var rules: AppStoreRules? + + public enum CodingKeys: String, CodingKey { + case criteria + + case stores + + case rules + } + + public init(criteria: String?, rules: AppStoreRules?, stores: [[String: Any]]?) { + self.criteria = criteria + + self.stores = stores + + self.rules = rules + } + + public func duplicate() -> InventoryStore { + let dict = self.dictionary! + let copy = InventoryStore(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + criteria = try container.decode(String.self, forKey: .criteria) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stores = try container.decode([[String: Any]].self, forKey: .stores) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rules = try container.decode(AppStoreRules.self, forKey: .rules) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(criteria, forKey: .criteria) + + try? container.encodeIfPresent(stores, forKey: .stores) + + try? container.encodeIfPresent(rules, forKey: .rules) + } + } + + /* + Model: AppStoreRules + Used By: Configuration + */ + + class AppStoreRules: Codable { + public var companies: [Int]? + + public var brands: [[String: Any]]? + + public enum CodingKeys: String, CodingKey { + case companies + + case brands + } + + public init(brands: [[String: Any]]?, companies: [Int]?) { + self.companies = companies + + self.brands = brands + } + + public func duplicate() -> AppStoreRules { + let dict = self.dictionary! + let copy = AppStoreRules(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + companies = try container.decode([Int].self, forKey: .companies) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brands = try container.decode([[String: Any]].self, forKey: .brands) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(companies, forKey: .companies) + + try? container.encodeIfPresent(brands, forKey: .brands) + } + } + + /* + Model: InventoryCategory + Used By: Configuration + */ + + class InventoryCategory: Codable { + public var criteria: String? + + public var categories: [[String: Any]]? + + public enum CodingKeys: String, CodingKey { + case criteria + + case categories + } + + public init(categories: [[String: Any]]?, criteria: String?) { + self.criteria = criteria + + self.categories = categories + } + + public func duplicate() -> InventoryCategory { + let dict = self.dictionary! + let copy = InventoryCategory(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + criteria = try container.decode(String.self, forKey: .criteria) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + categories = try container.decode([[String: Any]].self, forKey: .categories) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(criteria, forKey: .criteria) + + try? container.encodeIfPresent(categories, forKey: .categories) + } + } + + /* + Model: InventoryPrice + Used By: Configuration + */ + + class InventoryPrice: Codable { + public var min: Double? + + public var max: Double? + + public enum CodingKeys: String, CodingKey { + case min + + case max + } + + public init(max: Double?, min: Double?) { + self.min = min + + self.max = max + } + + public func duplicate() -> InventoryPrice { + let dict = self.dictionary! + let copy = InventoryPrice(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + min = try container.decode(Double.self, forKey: .min) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + max = try container.decode(Double.self, forKey: .max) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(min, forKey: .min) + + try? container.encodeIfPresent(max, forKey: .max) + } + } + + /* + Model: InventoryDiscount + Used By: Configuration + */ + + class InventoryDiscount: Codable { + public var min: Double? + + public var max: Double? + + public enum CodingKeys: String, CodingKey { + case min + + case max + } + + public init(max: Double?, min: Double?) { + self.min = min + + self.max = max + } + + public func duplicate() -> InventoryDiscount { + let dict = self.dictionary! + let copy = InventoryDiscount(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + min = try container.decode(Double.self, forKey: .min) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + max = try container.decode(Double.self, forKey: .max) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(min, forKey: .min) + + try? container.encodeIfPresent(max, forKey: .max) + } + } + + /* + Model: AuthenticationConfig + Used By: Configuration + */ + + class AuthenticationConfig: Codable { + public var required: Bool? + + public var provider: String? + + public enum CodingKeys: String, CodingKey { + case required + + case provider + } + + public init(provider: String?, required: Bool?) { + self.required = required + + self.provider = provider + } + + public func duplicate() -> AuthenticationConfig { + let dict = self.dictionary! + let copy = AuthenticationConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + required = try container.decode(Bool.self, forKey: .required) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + provider = try container.decode(String.self, forKey: .provider) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(required, forKey: .required) + + try? container.encodeIfPresent(provider, forKey: .provider) + } + } + + /* + Model: ArticleAssignmentConfig + Used By: Configuration + */ + + class ArticleAssignmentConfig: Codable { + public var rules: ArticleAssignmentRules? + + public var postOrderReassignment: Bool? + + public enum CodingKeys: String, CodingKey { + case rules + + case postOrderReassignment = "post_order_reassignment" + } + + public init(postOrderReassignment: Bool?, rules: ArticleAssignmentRules?) { + self.rules = rules + + self.postOrderReassignment = postOrderReassignment + } + + public func duplicate() -> ArticleAssignmentConfig { + let dict = self.dictionary! + let copy = ArticleAssignmentConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + rules = try container.decode(ArticleAssignmentRules.self, forKey: .rules) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + postOrderReassignment = try container.decode(Bool.self, forKey: .postOrderReassignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(rules, forKey: .rules) + + try? container.encodeIfPresent(postOrderReassignment, forKey: .postOrderReassignment) + } + } + + /* + Model: ArticleAssignmentRules + Used By: Configuration + */ + + class ArticleAssignmentRules: Codable { + public var storePriority: StorePriority? + + public enum CodingKeys: String, CodingKey { + case storePriority = "store_priority" + } + + public init(storePriority: StorePriority?) { + self.storePriority = storePriority + } + + public func duplicate() -> ArticleAssignmentRules { + let dict = self.dictionary! + let copy = ArticleAssignmentRules(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + storePriority = try container.decode(StorePriority.self, forKey: .storePriority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(storePriority, forKey: .storePriority) + } + } + + /* + Model: StorePriority + Used By: Configuration + */ + + class StorePriority: Codable { + public var enabled: Bool? + + public var storetypeOrder: [[String: Any]]? + + public enum CodingKeys: String, CodingKey { + case enabled + + case storetypeOrder = "storetype_order" + } + + public init(enabled: Bool?, storetypeOrder: [[String: Any]]?) { + self.enabled = enabled + + self.storetypeOrder = storetypeOrder + } + + public func duplicate() -> StorePriority { + let dict = self.dictionary! + let copy = StorePriority(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storetypeOrder = try container.decode([[String: Any]].self, forKey: .storetypeOrder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(storetypeOrder, forKey: .storetypeOrder) + } + } + + /* + Model: AppCartConfig + Used By: Configuration + */ + + class AppCartConfig: Codable { + public var deliveryCharges: DeliveryCharges? + + public var enabled: Bool? + + public var maxCartItems: Int? + + public var minCartValue: Double? + + public var bulkCoupons: Bool? + + public var revenueEngineCoupon: Bool? + + public enum CodingKeys: String, CodingKey { + case deliveryCharges = "delivery_charges" + + case enabled + + case maxCartItems = "max_cart_items" + + case minCartValue = "min_cart_value" + + case bulkCoupons = "bulk_coupons" + + case revenueEngineCoupon = "revenue_engine_coupon" + } + + public init(bulkCoupons: Bool?, deliveryCharges: DeliveryCharges?, enabled: Bool?, maxCartItems: Int?, minCartValue: Double?, revenueEngineCoupon: Bool?) { + self.deliveryCharges = deliveryCharges + + self.enabled = enabled + + self.maxCartItems = maxCartItems + + self.minCartValue = minCartValue + + self.bulkCoupons = bulkCoupons + + self.revenueEngineCoupon = revenueEngineCoupon + } + + public func duplicate() -> AppCartConfig { + let dict = self.dictionary! + let copy = AppCartConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + deliveryCharges = try container.decode(DeliveryCharges.self, forKey: .deliveryCharges) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + maxCartItems = try container.decode(Int.self, forKey: .maxCartItems) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + minCartValue = try container.decode(Double.self, forKey: .minCartValue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bulkCoupons = try container.decode(Bool.self, forKey: .bulkCoupons) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + revenueEngineCoupon = try container.decode(Bool.self, forKey: .revenueEngineCoupon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(deliveryCharges, forKey: .deliveryCharges) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(maxCartItems, forKey: .maxCartItems) + + try? container.encodeIfPresent(minCartValue, forKey: .minCartValue) + + try? container.encodeIfPresent(bulkCoupons, forKey: .bulkCoupons) + + try? container.encodeIfPresent(revenueEngineCoupon, forKey: .revenueEngineCoupon) + } + } + + /* + Model: DeliveryCharges + Used By: Configuration + */ + + class DeliveryCharges: Codable { + public var enabled: Bool? + + public var charges: Charges? + + public enum CodingKeys: String, CodingKey { + case enabled + + case charges + } + + public init(charges: Charges?, enabled: Bool?) { + self.enabled = enabled + + self.charges = charges + } + + public func duplicate() -> DeliveryCharges { + let dict = self.dictionary! + let copy = DeliveryCharges(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + charges = try container.decode(Charges.self, forKey: .charges) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(charges, forKey: .charges) + } + } + + /* + Model: Charges + Used By: Configuration + */ + + class Charges: Codable { + public var threshold: Double? + + public var charges: Double? + + public enum CodingKeys: String, CodingKey { + case threshold + + case charges + } + + public init(charges: Double?, threshold: Double?) { + self.threshold = threshold + + self.charges = charges + } + + public func duplicate() -> Charges { + let dict = self.dictionary! + let copy = Charges(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + threshold = try container.decode(Double.self, forKey: .threshold) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + charges = try container.decode(Double.self, forKey: .charges) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(threshold, forKey: .threshold) + + try? container.encodeIfPresent(charges, forKey: .charges) + } + } + + /* + Model: AppPaymentConfig + Used By: Configuration + */ + + class AppPaymentConfig: Codable { + public var callbackUrl: CallbackUrl? + + public var methods: Methods? + + public var paymentSelectionLock: PaymentSelectionLock? + + public var modeOfPayment: String? + + public var source: String? + + public var enabled: Bool? + + public var codAmountLimit: Double? + + public var codCharges: Double? + + public enum CodingKeys: String, CodingKey { + case callbackUrl = "callback_url" + + case methods + + case paymentSelectionLock = "payment_selection_lock" + + case modeOfPayment = "mode_of_payment" + + case source + + case enabled + + case codAmountLimit = "cod_amount_limit" + + case codCharges = "cod_charges" + } + + public init(callbackUrl: CallbackUrl?, codAmountLimit: Double?, codCharges: Double?, enabled: Bool?, methods: Methods?, modeOfPayment: String?, paymentSelectionLock: PaymentSelectionLock?, source: String?) { + self.callbackUrl = callbackUrl + + self.methods = methods + + self.paymentSelectionLock = paymentSelectionLock + + self.modeOfPayment = modeOfPayment + + self.source = source + + self.enabled = enabled + + self.codAmountLimit = codAmountLimit + + self.codCharges = codCharges + } + + public func duplicate() -> AppPaymentConfig { + let dict = self.dictionary! + let copy = AppPaymentConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + callbackUrl = try container.decode(CallbackUrl.self, forKey: .callbackUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + methods = try container.decode(Methods.self, forKey: .methods) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentSelectionLock = try container.decode(PaymentSelectionLock.self, forKey: .paymentSelectionLock) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modeOfPayment = try container.decode(String.self, forKey: .modeOfPayment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + source = try container.decode(String.self, forKey: .source) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + codAmountLimit = try container.decode(Double.self, forKey: .codAmountLimit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + codCharges = try container.decode(Double.self, forKey: .codCharges) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(callbackUrl, forKey: .callbackUrl) + + try? container.encodeIfPresent(methods, forKey: .methods) + + try? container.encodeIfPresent(paymentSelectionLock, forKey: .paymentSelectionLock) + + try? container.encodeIfPresent(modeOfPayment, forKey: .modeOfPayment) + + try? container.encodeIfPresent(source, forKey: .source) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(codAmountLimit, forKey: .codAmountLimit) + + try? container.encodeIfPresent(codCharges, forKey: .codCharges) + } + } + + /* + Model: CallbackUrl + Used By: Configuration + */ + + class CallbackUrl: Codable { + public var app: String? + + public var web: String? + + public enum CodingKeys: String, CodingKey { + case app + + case web + } + + public init(app: String?, web: String?) { + self.app = app + + self.web = web + } + + public func duplicate() -> CallbackUrl { + let dict = self.dictionary! + let copy = CallbackUrl(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + app = try container.decode(String.self, forKey: .app) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + web = try container.decode(String.self, forKey: .web) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(app, forKey: .app) + + try? container.encodeIfPresent(web, forKey: .web) + } + } + + /* + Model: Methods + Used By: Configuration + */ + + class Methods: Codable { + public var pl: PaymentModeConfig? + + public var card: PaymentModeConfig? + + public var nb: PaymentModeConfig? + + public var wl: PaymentModeConfig? + + public var ps: PaymentModeConfig? + + public var upi: PaymentModeConfig? + + public var qr: PaymentModeConfig? + + public var cod: PaymentModeConfig? + + public var pp: PaymentModeConfig? + + public var jp: PaymentModeConfig? + + public var pac: PaymentModeConfig? + + public var fc: PaymentModeConfig? + + public var jiopp: PaymentModeConfig? + + public var stripepg: PaymentModeConfig? + + public var juspaypg: PaymentModeConfig? + + public var payubizpg: PaymentModeConfig? + + public var payumoneypg: PaymentModeConfig? + + public var rupifipg: PaymentModeConfig? + + public var simpl: PaymentModeConfig? + + public enum CodingKeys: String, CodingKey { + case pl + + case card + + case nb + + case wl + + case ps + + case upi + + case qr + + case cod + + case pp + + case jp + + case pac + + case fc + + case jiopp + + case stripepg + + case juspaypg + + case payubizpg + + case payumoneypg + + case rupifipg + + case simpl + } + + public init(card: PaymentModeConfig?, cod: PaymentModeConfig?, fc: PaymentModeConfig?, jiopp: PaymentModeConfig?, jp: PaymentModeConfig?, juspaypg: PaymentModeConfig?, nb: PaymentModeConfig?, pac: PaymentModeConfig?, payubizpg: PaymentModeConfig?, payumoneypg: PaymentModeConfig?, pl: PaymentModeConfig?, pp: PaymentModeConfig?, ps: PaymentModeConfig?, qr: PaymentModeConfig?, rupifipg: PaymentModeConfig?, simpl: PaymentModeConfig?, stripepg: PaymentModeConfig?, upi: PaymentModeConfig?, wl: PaymentModeConfig?) { + self.pl = pl + + self.card = card + + self.nb = nb + + self.wl = wl + + self.ps = ps + + self.upi = upi + + self.qr = qr + + self.cod = cod + + self.pp = pp + + self.jp = jp + + self.pac = pac + + self.fc = fc + + self.jiopp = jiopp + + self.stripepg = stripepg + + self.juspaypg = juspaypg + + self.payubizpg = payubizpg + + self.payumoneypg = payumoneypg + + self.rupifipg = rupifipg + + self.simpl = simpl + } + + public func duplicate() -> Methods { + let dict = self.dictionary! + let copy = Methods(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + pl = try container.decode(PaymentModeConfig.self, forKey: .pl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + card = try container.decode(PaymentModeConfig.self, forKey: .card) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + nb = try container.decode(PaymentModeConfig.self, forKey: .nb) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + wl = try container.decode(PaymentModeConfig.self, forKey: .wl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ps = try container.decode(PaymentModeConfig.self, forKey: .ps) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + upi = try container.decode(PaymentModeConfig.self, forKey: .upi) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + qr = try container.decode(PaymentModeConfig.self, forKey: .qr) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cod = try container.decode(PaymentModeConfig.self, forKey: .cod) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pp = try container.decode(PaymentModeConfig.self, forKey: .pp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + jp = try container.decode(PaymentModeConfig.self, forKey: .jp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pac = try container.decode(PaymentModeConfig.self, forKey: .pac) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fc = try container.decode(PaymentModeConfig.self, forKey: .fc) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + jiopp = try container.decode(PaymentModeConfig.self, forKey: .jiopp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stripepg = try container.decode(PaymentModeConfig.self, forKey: .stripepg) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + juspaypg = try container.decode(PaymentModeConfig.self, forKey: .juspaypg) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + payubizpg = try container.decode(PaymentModeConfig.self, forKey: .payubizpg) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + payumoneypg = try container.decode(PaymentModeConfig.self, forKey: .payumoneypg) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rupifipg = try container.decode(PaymentModeConfig.self, forKey: .rupifipg) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + simpl = try container.decode(PaymentModeConfig.self, forKey: .simpl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pl, forKey: .pl) + + try? container.encodeIfPresent(card, forKey: .card) + + try? container.encodeIfPresent(nb, forKey: .nb) + + try? container.encodeIfPresent(wl, forKey: .wl) + + try? container.encodeIfPresent(ps, forKey: .ps) + + try? container.encodeIfPresent(upi, forKey: .upi) + + try? container.encodeIfPresent(qr, forKey: .qr) + + try? container.encodeIfPresent(cod, forKey: .cod) + + try? container.encodeIfPresent(pp, forKey: .pp) + + try? container.encodeIfPresent(jp, forKey: .jp) + + try? container.encodeIfPresent(pac, forKey: .pac) + + try? container.encodeIfPresent(fc, forKey: .fc) + + try? container.encodeIfPresent(jiopp, forKey: .jiopp) + + try? container.encodeIfPresent(stripepg, forKey: .stripepg) + + try? container.encodeIfPresent(juspaypg, forKey: .juspaypg) + + try? container.encodeIfPresent(payubizpg, forKey: .payubizpg) + + try? container.encodeIfPresent(payumoneypg, forKey: .payumoneypg) + + try? container.encodeIfPresent(rupifipg, forKey: .rupifipg) + + try? container.encodeIfPresent(simpl, forKey: .simpl) + } + } + + /* + Model: PaymentModeConfig + Used By: Configuration + */ + + class PaymentModeConfig: Codable { + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case enabled + } + + public init(enabled: Bool?) { + self.enabled = enabled + } + + public func duplicate() -> PaymentModeConfig { + let dict = self.dictionary! + let copy = PaymentModeConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: PaymentSelectionLock + Used By: Configuration + */ + + class PaymentSelectionLock: Codable { + public var enabled: Bool? + + public var defaultOptions: String? + + public var paymentIdentifier: String? + + public enum CodingKeys: String, CodingKey { + case enabled + + case defaultOptions = "default_options" + + case paymentIdentifier = "payment_identifier" + } + + public init(defaultOptions: String?, enabled: Bool?, paymentIdentifier: String?) { + self.enabled = enabled + + self.defaultOptions = defaultOptions + + self.paymentIdentifier = paymentIdentifier + } + + public func duplicate() -> PaymentSelectionLock { + let dict = self.dictionary! + let copy = PaymentSelectionLock(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + defaultOptions = try container.decode(String.self, forKey: .defaultOptions) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentIdentifier = try container.decode(String.self, forKey: .paymentIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(defaultOptions, forKey: .defaultOptions) + + try? container.encodeIfPresent(paymentIdentifier, forKey: .paymentIdentifier) + } + } + + /* + Model: AppOrderConfig + Used By: Configuration + */ + + class AppOrderConfig: Codable { + public var enabled: Bool? + + public var forceReassignment: Bool? + + public var message: String? + + public enum CodingKeys: String, CodingKey { + case enabled + + case forceReassignment = "force_reassignment" + + case message + } + + public init(enabled: Bool?, forceReassignment: Bool?, message: String?) { + self.enabled = enabled + + self.forceReassignment = forceReassignment + + self.message = message + } + + public func duplicate() -> AppOrderConfig { + let dict = self.dictionary! + let copy = AppOrderConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + forceReassignment = try container.decode(Bool.self, forKey: .forceReassignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(forceReassignment, forKey: .forceReassignment) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: AppLogisticsConfig + Used By: Configuration + */ + + class AppLogisticsConfig: Codable { + public var logisticsBySeller: Bool? + + public var serviceabilityCheck: Bool? + + public var sameDayDelivery: Bool? + + public var dpAssignment: Bool? + + public enum CodingKeys: String, CodingKey { + case logisticsBySeller = "logistics_by_seller" + + case serviceabilityCheck = "serviceability_check" + + case sameDayDelivery = "same_day_delivery" + + case dpAssignment = "dp_assignment" + } + + public init(dpAssignment: Bool?, logisticsBySeller: Bool?, sameDayDelivery: Bool?, serviceabilityCheck: Bool?) { + self.logisticsBySeller = logisticsBySeller + + self.serviceabilityCheck = serviceabilityCheck + + self.sameDayDelivery = sameDayDelivery + + self.dpAssignment = dpAssignment + } + + public func duplicate() -> AppLogisticsConfig { + let dict = self.dictionary! + let copy = AppLogisticsConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + logisticsBySeller = try container.decode(Bool.self, forKey: .logisticsBySeller) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + serviceabilityCheck = try container.decode(Bool.self, forKey: .serviceabilityCheck) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sameDayDelivery = try container.decode(Bool.self, forKey: .sameDayDelivery) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dpAssignment = try container.decode(Bool.self, forKey: .dpAssignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(logisticsBySeller, forKey: .logisticsBySeller) + + try? container.encodeIfPresent(serviceabilityCheck, forKey: .serviceabilityCheck) + + try? container.encodeIfPresent(sameDayDelivery, forKey: .sameDayDelivery) + + try? container.encodeIfPresent(dpAssignment, forKey: .dpAssignment) + } + } + + /* + Model: LoyaltyPointsConfig + Used By: Configuration + */ + + class LoyaltyPointsConfig: Codable { + public var enabled: Bool? + + public var autoApply: Bool? + + public enum CodingKeys: String, CodingKey { + case enabled + + case autoApply = "auto_apply" + } + + public init(autoApply: Bool?, enabled: Bool?) { + self.enabled = enabled + + self.autoApply = autoApply + } + + public func duplicate() -> LoyaltyPointsConfig { + let dict = self.dictionary! + let copy = LoyaltyPointsConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + autoApply = try container.decode(Bool.self, forKey: .autoApply) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(autoApply, forKey: .autoApply) + } + } + + /* + Model: AppInventoryPartialUpdate + Used By: Configuration + */ + + class AppInventoryPartialUpdate: Codable { + public var rewardPoints: RewardPointsConfig? + + public var cart: AppCartConfig? + + public var payment: AppPaymentConfig? + + public var loyaltyPoints: LoyaltyPointsConfig? + + public var commsEnabled: Bool? + + public enum CodingKeys: String, CodingKey { + case rewardPoints = "reward_points" + + case cart + + case payment + + case loyaltyPoints = "loyalty_points" + + case commsEnabled = "comms_enabled" + } + + public init(cart: AppCartConfig?, commsEnabled: Bool?, loyaltyPoints: LoyaltyPointsConfig?, payment: AppPaymentConfig?, rewardPoints: RewardPointsConfig?) { + self.rewardPoints = rewardPoints + + self.cart = cart + + self.payment = payment + + self.loyaltyPoints = loyaltyPoints + + self.commsEnabled = commsEnabled + } + + public func duplicate() -> AppInventoryPartialUpdate { + let dict = self.dictionary! + let copy = AppInventoryPartialUpdate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + rewardPoints = try container.decode(RewardPointsConfig.self, forKey: .rewardPoints) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cart = try container.decode(AppCartConfig.self, forKey: .cart) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + payment = try container.decode(AppPaymentConfig.self, forKey: .payment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + loyaltyPoints = try container.decode(LoyaltyPointsConfig.self, forKey: .loyaltyPoints) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + commsEnabled = try container.decode(Bool.self, forKey: .commsEnabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(rewardPoints, forKey: .rewardPoints) + + try? container.encodeIfPresent(cart, forKey: .cart) + + try? container.encodeIfPresent(payment, forKey: .payment) + + try? container.encodeIfPresent(loyaltyPoints, forKey: .loyaltyPoints) + + try? container.encodeIfPresent(commsEnabled, forKey: .commsEnabled) + } + } + + /* + Model: BrandCompanyInfo + Used By: Configuration + */ + + class BrandCompanyInfo: Codable { + public var companyName: String? + + public var companyId: Int? + + public enum CodingKeys: String, CodingKey { + case companyName = "company_name" + + case companyId = "company_id" + } + + public init(companyId: Int?, companyName: String?) { + self.companyName = companyName + + self.companyId = companyId + } + + public func duplicate() -> BrandCompanyInfo { + let dict = self.dictionary! + let copy = BrandCompanyInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + companyName = try container.decode(String.self, forKey: .companyName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(companyName, forKey: .companyName) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + } + } + + /* + Model: CompanyByBrandsRequest + Used By: Configuration + */ + + class CompanyByBrandsRequest: Codable { + public var brands: Int + + public var searchText: String? + + public enum CodingKeys: String, CodingKey { + case brands + + case searchText = "search_text" + } + + public init(brands: Int, searchText: String?) { + self.brands = brands + + self.searchText = searchText + } + + public func duplicate() -> CompanyByBrandsRequest { + let dict = self.dictionary! + let copy = CompanyByBrandsRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + brands = try container.decode(Int.self, forKey: .brands) + + do { + searchText = try container.decode(String.self, forKey: .searchText) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(brands, forKey: .brands) + + try? container.encodeIfPresent(searchText, forKey: .searchText) + } + } + + /* + Model: CompanyByBrandsResponse + Used By: Configuration + */ + + class CompanyByBrandsResponse: Codable { + public var items: [BrandCompanyInfo]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [BrandCompanyInfo]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> CompanyByBrandsResponse { + let dict = self.dictionary! + let copy = CompanyByBrandsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([BrandCompanyInfo].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: StoreByBrandsRequest + Used By: Configuration + */ + + class StoreByBrandsRequest: Codable { + public var companyId: Int? + + public var brands: Int + + public var searchText: String? + + public enum CodingKeys: String, CodingKey { + case companyId = "company_id" + + case brands + + case searchText = "search_text" + } + + public init(brands: Int, companyId: Int?, searchText: String?) { + self.companyId = companyId + + self.brands = brands + + self.searchText = searchText + } + + public func duplicate() -> StoreByBrandsRequest { + let dict = self.dictionary! + let copy = StoreByBrandsRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + brands = try container.decode(Int.self, forKey: .brands) + + do { + searchText = try container.decode(String.self, forKey: .searchText) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(brands, forKey: .brands) + + try? container.encodeIfPresent(searchText, forKey: .searchText) + } + } + + /* + Model: StoreByBrandsResponse + Used By: Configuration + */ + + class StoreByBrandsResponse: Codable { + public var items: [BrandStoreInfo]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [BrandStoreInfo]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> StoreByBrandsResponse { + let dict = self.dictionary! + let copy = StoreByBrandsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([BrandStoreInfo].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: BrandStoreInfo + Used By: Configuration + */ + + class BrandStoreInfo: Codable { + public var storeName: String? + + public var storeId: Int? + + public var storeType: String? + + public var storeCode: String? + + public var storeAddress: OptedStoreAddress? + + public var company: OptedCompany? + + public enum CodingKeys: String, CodingKey { + case storeName = "store_name" + + case storeId = "store_id" + + case storeType = "store_type" + + case storeCode = "store_code" + + case storeAddress = "store_address" + + case company + } + + public init(company: OptedCompany?, storeAddress: OptedStoreAddress?, storeCode: String?, storeId: Int?, storeName: String?, storeType: String?) { + self.storeName = storeName + + self.storeId = storeId + + self.storeType = storeType + + self.storeCode = storeCode + + self.storeAddress = storeAddress + + self.company = company + } + + public func duplicate() -> BrandStoreInfo { + let dict = self.dictionary! + let copy = BrandStoreInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + storeName = try container.decode(String.self, forKey: .storeName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeId = try container.decode(Int.self, forKey: .storeId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeType = try container.decode(String.self, forKey: .storeType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeCode = try container.decode(String.self, forKey: .storeCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeAddress = try container.decode(OptedStoreAddress.self, forKey: .storeAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + company = try container.decode(OptedCompany.self, forKey: .company) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(storeName, forKey: .storeName) + + try? container.encodeIfPresent(storeId, forKey: .storeId) + + try? container.encodeIfPresent(storeType, forKey: .storeType) + + try? container.encodeIfPresent(storeCode, forKey: .storeCode) + + try? container.encodeIfPresent(storeAddress, forKey: .storeAddress) + + try? container.encodeIfPresent(company, forKey: .company) + } + } + + /* + Model: CompanyBrandInfo + Used By: Configuration + */ + + class CompanyBrandInfo: Codable { + public var name: String? + + public var value: Int? + + public var brandLogoUrl: String? + + public var brandBannerUrl: String? + + public var brandBannerPortraitUrl: String? + + public enum CodingKeys: String, CodingKey { + case name + + case value + + case brandLogoUrl = "brand_logo_url" + + case brandBannerUrl = "brand_banner_url" + + case brandBannerPortraitUrl = "brand_banner_portrait_url" + } + + public init(brandBannerPortraitUrl: String?, brandBannerUrl: String?, brandLogoUrl: String?, name: String?, value: Int?) { + self.name = name + + self.value = value + + self.brandLogoUrl = brandLogoUrl + + self.brandBannerUrl = brandBannerUrl + + self.brandBannerPortraitUrl = brandBannerPortraitUrl + } + + public func duplicate() -> CompanyBrandInfo { + let dict = self.dictionary! + let copy = CompanyBrandInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(Int.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandLogoUrl = try container.decode(String.self, forKey: .brandLogoUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandBannerUrl = try container.decode(String.self, forKey: .brandBannerUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandBannerPortraitUrl = try container.decode(String.self, forKey: .brandBannerPortraitUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(brandLogoUrl, forKey: .brandLogoUrl) + + try? container.encodeIfPresent(brandBannerUrl, forKey: .brandBannerUrl) + + try? container.encodeIfPresent(brandBannerPortraitUrl, forKey: .brandBannerPortraitUrl) + } + } + + /* + Model: BrandsByCompanyResponse + Used By: Configuration + */ + + class BrandsByCompanyResponse: Codable { + public var brands: CompanyBrandInfo? + + public enum CodingKeys: String, CodingKey { + case brands + } + + public init(brands: CompanyBrandInfo?) { + self.brands = brands + } + + public func duplicate() -> BrandsByCompanyResponse { + let dict = self.dictionary! + let copy = BrandsByCompanyResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + brands = try container.decode(CompanyBrandInfo.self, forKey: .brands) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(brands, forKey: .brands) + } + } + + /* + Model: CreateApplicationRequest + Used By: Configuration + */ + + class CreateApplicationRequest: Codable { + public var app: App? + + public var configuration: AppInventory? + + public var domain: AppDomain? + + public enum CodingKeys: String, CodingKey { + case app + + case configuration + + case domain + } + + public init(app: App?, configuration: AppInventory?, domain: AppDomain?) { + self.app = app + + self.configuration = configuration + + self.domain = domain + } + + public func duplicate() -> CreateApplicationRequest { + let dict = self.dictionary! + let copy = CreateApplicationRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + app = try container.decode(App.self, forKey: .app) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + configuration = try container.decode(AppInventory.self, forKey: .configuration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + domain = try container.decode(AppDomain.self, forKey: .domain) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(app, forKey: .app) + + try? container.encodeIfPresent(configuration, forKey: .configuration) + + try? container.encodeIfPresent(domain, forKey: .domain) + } + } + + /* + Model: CreateAppResponse + Used By: Configuration + */ + + class CreateAppResponse: Codable { + public var app: Application? + + public var configuration: ApplicationInventory? + + public enum CodingKeys: String, CodingKey { + case app + + case configuration + } + + public init(app: Application?, configuration: ApplicationInventory?) { + self.app = app + + self.configuration = configuration + } + + public func duplicate() -> CreateAppResponse { + let dict = self.dictionary! + let copy = CreateAppResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + app = try container.decode(Application.self, forKey: .app) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + configuration = try container.decode(ApplicationInventory.self, forKey: .configuration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(app, forKey: .app) + + try? container.encodeIfPresent(configuration, forKey: .configuration) + } + } + + /* + Model: ApplicationsResponse + Used By: Configuration + */ + + class ApplicationsResponse: Codable { + public var items: [Application]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [Application]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> ApplicationsResponse { + let dict = self.dictionary! + let copy = ApplicationsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Application].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: MobileAppConfiguration + Used By: Configuration + */ + + class MobileAppConfiguration: Codable { + public var isActive: Bool? + + public var id: String? + + public var appName: String? + + public var landingImage: LandingImage? + + public var splashImage: SplashImage? + + public var application: String? + + public var platformType: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public var packageName: String? + + public enum CodingKeys: String, CodingKey { + case isActive = "is_active" + + case id = "_id" + + case appName = "app_name" + + case landingImage = "landing_image" + + case splashImage = "splash_image" + + case application + + case platformType = "platform_type" + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + + case packageName = "package_name" + } + + public init(application: String?, appName: String?, createdAt: String?, isActive: Bool?, landingImage: LandingImage?, packageName: String?, platformType: String?, splashImage: SplashImage?, updatedAt: String?, id: String?, v: Int?) { + self.isActive = isActive + + self.id = id + + self.appName = appName + + self.landingImage = landingImage + + self.splashImage = splashImage + + self.application = application + + self.platformType = platformType + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + + self.packageName = packageName + } + + public func duplicate() -> MobileAppConfiguration { + let dict = self.dictionary! + let copy = MobileAppConfiguration(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appName = try container.decode(String.self, forKey: .appName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + landingImage = try container.decode(LandingImage.self, forKey: .landingImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + splashImage = try container.decode(SplashImage.self, forKey: .splashImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platformType = try container.decode(String.self, forKey: .platformType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + packageName = try container.decode(String.self, forKey: .packageName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(appName, forKey: .appName) + + try? container.encodeIfPresent(landingImage, forKey: .landingImage) + + try? container.encodeIfPresent(splashImage, forKey: .splashImage) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(platformType, forKey: .platformType) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + + try? container.encodeIfPresent(packageName, forKey: .packageName) + } + } + + /* + Model: LandingImage + Used By: Configuration + */ + + class LandingImage: Codable { + public var aspectRatio: String? + + public var secureUrl: String? + + public enum CodingKeys: String, CodingKey { + case aspectRatio = "aspect_ratio" + + case secureUrl = "secure_url" + } + + public init(aspectRatio: String?, secureUrl: String?) { + self.aspectRatio = aspectRatio + + self.secureUrl = secureUrl + } + + public func duplicate() -> LandingImage { + let dict = self.dictionary! + let copy = LandingImage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + aspectRatio = try container.decode(String.self, forKey: .aspectRatio) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + secureUrl = try container.decode(String.self, forKey: .secureUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) + + try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) + } + } + + /* + Model: SplashImage + Used By: Configuration + */ + + class SplashImage: Codable { + public var aspectRatio: String? + + public var secureUrl: String? + + public enum CodingKeys: String, CodingKey { + case aspectRatio = "aspect_ratio" + + case secureUrl = "secure_url" + } + + public init(aspectRatio: String?, secureUrl: String?) { + self.aspectRatio = aspectRatio + + self.secureUrl = secureUrl + } + + public func duplicate() -> SplashImage { + let dict = self.dictionary! + let copy = SplashImage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + aspectRatio = try container.decode(String.self, forKey: .aspectRatio) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + secureUrl = try container.decode(String.self, forKey: .secureUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) + + try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) + } + } + + /* + Model: MobileAppConfigRequest + Used By: Configuration + */ + + class MobileAppConfigRequest: Codable { + public var appName: String? + + public var landingImage: LandingImage? + + public var splashImage: SplashImage? + + public var isActive: Bool? + + public enum CodingKeys: String, CodingKey { + case appName = "app_name" + + case landingImage = "landing_image" + + case splashImage = "splash_image" + + case isActive = "is_active" + } + + public init(appName: String?, isActive: Bool?, landingImage: LandingImage?, splashImage: SplashImage?) { + self.appName = appName + + self.landingImage = landingImage + + self.splashImage = splashImage + + self.isActive = isActive + } + + public func duplicate() -> MobileAppConfigRequest { + let dict = self.dictionary! + let copy = MobileAppConfigRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + appName = try container.decode(String.self, forKey: .appName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + landingImage = try container.decode(LandingImage.self, forKey: .landingImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + splashImage = try container.decode(SplashImage.self, forKey: .splashImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appName, forKey: .appName) + + try? container.encodeIfPresent(landingImage, forKey: .landingImage) + + try? container.encodeIfPresent(splashImage, forKey: .splashImage) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + } + } + + /* + Model: BuildVersionHistory + Used By: Configuration + */ + + class BuildVersionHistory: Codable { + public var versions: BuildVersion? + + public var latestAvailableVersionName: String? + + public enum CodingKeys: String, CodingKey { + case versions + + case latestAvailableVersionName = "latest_available_version_name" + } + + public init(latestAvailableVersionName: String?, versions: BuildVersion?) { + self.versions = versions + + self.latestAvailableVersionName = latestAvailableVersionName + } + + public func duplicate() -> BuildVersionHistory { + let dict = self.dictionary! + let copy = BuildVersionHistory(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + versions = try container.decode(BuildVersion.self, forKey: .versions) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + latestAvailableVersionName = try container.decode(String.self, forKey: .latestAvailableVersionName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(versions, forKey: .versions) + + try? container.encodeIfPresent(latestAvailableVersionName, forKey: .latestAvailableVersionName) + } + } + + /* + Model: BuildVersion + Used By: Configuration + */ + + class BuildVersion: Codable { + public var id: String? + + public var application: String? + + public var platformType: String? + + public var buildStatus: String? + + public var versionName: String? + + public var versionCode: Int? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case application + + case platformType = "platform_type" + + case buildStatus = "build_status" + + case versionName = "version_name" + + case versionCode = "version_code" + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + } + + public init(application: String?, buildStatus: String?, createdAt: String?, platformType: String?, updatedAt: String?, versionCode: Int?, versionName: String?, id: String?, v: Int?) { + self.id = id + + self.application = application + + self.platformType = platformType + + self.buildStatus = buildStatus + + self.versionName = versionName + + self.versionCode = versionCode + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + } + + public func duplicate() -> BuildVersion { + let dict = self.dictionary! + let copy = BuildVersion(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platformType = try container.decode(String.self, forKey: .platformType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + buildStatus = try container.decode(String.self, forKey: .buildStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + versionName = try container.decode(String.self, forKey: .versionName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + versionCode = try container.decode(Int.self, forKey: .versionCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(platformType, forKey: .platformType) + + try? container.encodeIfPresent(buildStatus, forKey: .buildStatus) + + try? container.encodeIfPresent(versionName, forKey: .versionName) + + try? container.encodeIfPresent(versionCode, forKey: .versionCode) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: AppSupportedCurrency + Used By: Configuration + */ + + class AppSupportedCurrency: Codable { + public var id: String? + + public var supportedCurrency: [String]? + + public var application: String? + + public var defaultCurrency: DefaultCurrency? + + public var createdAt: String? + + public var updatedAt: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case supportedCurrency = "supported_currency" + + case application + + case defaultCurrency = "default_currency" + + case createdAt = "created_at" + + case updatedAt = "updated_at" + } + + public init(application: String?, createdAt: String?, defaultCurrency: DefaultCurrency?, supportedCurrency: [String]?, updatedAt: String?, id: String?) { + self.id = id + + self.supportedCurrency = supportedCurrency + + self.application = application + + self.defaultCurrency = defaultCurrency + + self.createdAt = createdAt + + self.updatedAt = updatedAt + } + + public func duplicate() -> AppSupportedCurrency { + let dict = self.dictionary! + let copy = AppSupportedCurrency(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + supportedCurrency = try container.decode([String].self, forKey: .supportedCurrency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + defaultCurrency = try container.decode(DefaultCurrency.self, forKey: .defaultCurrency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(supportedCurrency, forKey: .supportedCurrency) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(defaultCurrency, forKey: .defaultCurrency) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + } + } + + /* + Model: DefaultCurrency + Used By: Configuration + */ + + class DefaultCurrency: Codable { + public var ref: String? + + public var code: String? + + public enum CodingKeys: String, CodingKey { + case ref + + case code + } + + public init(code: String?, ref: String?) { + self.ref = ref + + self.code = code + } + + public func duplicate() -> DefaultCurrency { + let dict = self.dictionary! + let copy = DefaultCurrency(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + ref = try container.decode(String.self, forKey: .ref) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(ref, forKey: .ref) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: CurrencyConfig + Used By: Configuration + */ + + class CurrencyConfig: Codable { + public var id: String? + + public var isActive: Bool? + + public var name: String? + + public var code: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var decimalDigits: Int? + + public var symbol: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case isActive = "is_active" + + case name + + case code + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case decimalDigits = "decimal_digits" + + case symbol + } + + public init(code: String?, createdAt: String?, decimalDigits: Int?, isActive: Bool?, name: String?, symbol: String?, updatedAt: String?, id: String?) { + self.id = id + + self.isActive = isActive + + self.name = name + + self.code = code + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.decimalDigits = decimalDigits + + self.symbol = symbol + } + + public func duplicate() -> CurrencyConfig { + let dict = self.dictionary! + let copy = CurrencyConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + decimalDigits = try container.decode(Int.self, forKey: .decimalDigits) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + symbol = try container.decode(String.self, forKey: .symbol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(decimalDigits, forKey: .decimalDigits) + + try? container.encodeIfPresent(symbol, forKey: .symbol) + } + } + + /* + Model: DomainAdd + Used By: Configuration + */ + + class DomainAdd: Codable { + public var name: String? + + public enum CodingKeys: String, CodingKey { + case name + } + + public init(name: String?) { + self.name = name + } + + public func duplicate() -> DomainAdd { + let dict = self.dictionary! + let copy = DomainAdd(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: DomainAddRequest + Used By: Configuration + */ + + class DomainAddRequest: Codable { + public var domain: DomainAdd? + + public enum CodingKeys: String, CodingKey { + case domain + } + + public init(domain: DomainAdd?) { + self.domain = domain + } + + public func duplicate() -> DomainAddRequest { + let dict = self.dictionary! + let copy = DomainAddRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + domain = try container.decode(DomainAdd.self, forKey: .domain) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(domain, forKey: .domain) + } + } + + /* + Model: DomainsResponse + Used By: Configuration + */ + + class DomainsResponse: Codable { + public var domains: [Domain]? + + public enum CodingKeys: String, CodingKey { + case domains + } + + public init(domains: [Domain]?) { + self.domains = domains + } + + public func duplicate() -> DomainsResponse { + let dict = self.dictionary! + let copy = DomainsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + domains = try container.decode([Domain].self, forKey: .domains) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(domains, forKey: .domains) + } + } + + /* + Model: UpdateDomain + Used By: Configuration + */ + + class UpdateDomain: Codable { + public var id: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + } + + public init(id: String?) { + self.id = id + } + + public func duplicate() -> UpdateDomain { + let dict = self.dictionary! + let copy = UpdateDomain(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: UpdateDomainTypeRequest + Used By: Configuration + */ + + class UpdateDomainTypeRequest: Codable { + public var domain: UpdateDomain? + + public var action: String? + + public enum CodingKeys: String, CodingKey { + case domain + + case action + } + + public init(action: String?, domain: UpdateDomain?) { + self.domain = domain + + self.action = action + } + + public func duplicate() -> UpdateDomainTypeRequest { + let dict = self.dictionary! + let copy = UpdateDomainTypeRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + domain = try container.decode(UpdateDomain.self, forKey: .domain) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(String.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(domain, forKey: .domain) + + try? container.encodeIfPresent(action, forKey: .action) + } + } + + /* + Model: DomainStatusRequest + Used By: Configuration + */ + + class DomainStatusRequest: Codable { + public var domainUrl: String? + + public enum CodingKeys: String, CodingKey { + case domainUrl = "domain_url" + } + + public init(domainUrl: String?) { + self.domainUrl = domainUrl + } + + public func duplicate() -> DomainStatusRequest { + let dict = self.dictionary! + let copy = DomainStatusRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + domainUrl = try container.decode(String.self, forKey: .domainUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(domainUrl, forKey: .domainUrl) + } + } + + /* + Model: DomainStatus + Used By: Configuration + */ + + class DomainStatus: Codable { + public var display: String? + + public var status: Bool? + + public enum CodingKeys: String, CodingKey { + case display + + case status + } + + public init(display: String?, status: Bool?) { + self.display = display + + self.status = status + } + + public func duplicate() -> DomainStatus { + let dict = self.dictionary! + let copy = DomainStatus(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Bool.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: DomainStatusResponse + Used By: Configuration + */ + + class DomainStatusResponse: Codable { + public var connected: Bool? + + public var status: [DomainStatus]? + + public enum CodingKeys: String, CodingKey { + case connected + + case status + } + + public init(connected: Bool?, status: [DomainStatus]?) { + self.connected = connected + + self.status = status + } + + public func duplicate() -> DomainStatusResponse { + let dict = self.dictionary! + let copy = DomainStatusResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + connected = try container.decode(Bool.self, forKey: .connected) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode([DomainStatus].self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(connected, forKey: .connected) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: DomainSuggestionsRequest + Used By: Configuration + */ + + class DomainSuggestionsRequest: Codable { + public var domainUrl: String? + + public var custom: Bool? + + public enum CodingKeys: String, CodingKey { + case domainUrl = "domain_url" + + case custom + } + + public init(custom: Bool?, domainUrl: String?) { + self.domainUrl = domainUrl + + self.custom = custom + } + + public func duplicate() -> DomainSuggestionsRequest { + let dict = self.dictionary! + let copy = DomainSuggestionsRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + domainUrl = try container.decode(String.self, forKey: .domainUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + custom = try container.decode(Bool.self, forKey: .custom) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(domainUrl, forKey: .domainUrl) + + try? container.encodeIfPresent(custom, forKey: .custom) + } + } + + /* + Model: DomainSuggestion + Used By: Configuration + */ + + class DomainSuggestion: Codable { + public var name: String + + public var unsupported: Bool? + + public var isAvailable: Bool + + public var price: Double? + + public var currency: String? + + public enum CodingKeys: String, CodingKey { + case name + + case unsupported + + case isAvailable = "is_available" + + case price + + case currency + } + + public init(currency: String?, isAvailable: Bool, name: String, price: Double?, unsupported: Bool?) { + self.name = name + + self.unsupported = unsupported + + self.isAvailable = isAvailable + + self.price = price + + self.currency = currency + } + + public func duplicate() -> DomainSuggestion { + let dict = self.dictionary! + let copy = DomainSuggestion(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + name = try container.decode(String.self, forKey: .name) + + do { + unsupported = try container.decode(Bool.self, forKey: .unsupported) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + isAvailable = try container.decode(Bool.self, forKey: .isAvailable) + + do { + price = try container.decode(Double.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(unsupported, forKey: .unsupported) + + try? container.encodeIfPresent(isAvailable, forKey: .isAvailable) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(currency, forKey: .currency) + } + } + + /* + Model: DomainSuggestionsResponse + Used By: Configuration + */ + + class DomainSuggestionsResponse: Codable { + public var domains: [DomainSuggestion]? + + public enum CodingKeys: String, CodingKey { + case domains + } + + public init(domains: [DomainSuggestion]?) { + self.domains = domains + } + + public func duplicate() -> DomainSuggestionsResponse { + let dict = self.dictionary! + let copy = DomainSuggestionsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + domains = try container.decode([DomainSuggestion].self, forKey: .domains) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(domains, forKey: .domains) + } + } + + /* + Model: GetIntegrationsOptInsResponse + Used By: Configuration + */ + + class GetIntegrationsOptInsResponse: Codable { + public var items: [IntegrationOptIn]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [IntegrationOptIn]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> GetIntegrationsOptInsResponse { + let dict = self.dictionary! + let copy = GetIntegrationsOptInsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([IntegrationOptIn].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: IntegrationOptIn + Used By: Configuration + */ + + class IntegrationOptIn: Codable { + public var validators: Validators? + + public var description: String? + + public var descriptionHtml: String? + + public var constants: String? + + public var companies: [[String: Any]]? + + public var support: [String]? + + public var id: String? + + public var name: String? + + public var meta: [IntegrationMeta]? + + public var icon: String? + + public var owner: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var token: String? + + public var secret: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case validators + + case description + + case descriptionHtml = "description_html" + + case constants + + case companies + + case support + + case id = "_id" + + case name + + case meta + + case icon + + case owner + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case token + + case secret + + case v = "__v" + } + + public init(companies: [[String: Any]]?, constants: String?, createdAt: String?, description: String?, descriptionHtml: String?, icon: String?, meta: [IntegrationMeta]?, name: String?, owner: String?, secret: String?, support: [String]?, token: String?, updatedAt: String?, validators: Validators?, id: String?, v: Int?) { + self.validators = validators + + self.description = description + + self.descriptionHtml = descriptionHtml + + self.constants = constants + + self.companies = companies + + self.support = support + + self.id = id + + self.name = name + + self.meta = meta + + self.icon = icon + + self.owner = owner + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.token = token + + self.secret = secret + + self.v = v + } + + public func duplicate() -> IntegrationOptIn { + let dict = self.dictionary! + let copy = IntegrationOptIn(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + validators = try container.decode(Validators.self, forKey: .validators) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + descriptionHtml = try container.decode(String.self, forKey: .descriptionHtml) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + constants = try container.decode(String.self, forKey: .constants) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companies = try container.decode([[String: Any]].self, forKey: .companies) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + support = try container.decode([String].self, forKey: .support) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([IntegrationMeta].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + owner = try container.decode(String.self, forKey: .owner) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + token = try container.decode(String.self, forKey: .token) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + secret = try container.decode(String.self, forKey: .secret) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(validators, forKey: .validators) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(descriptionHtml, forKey: .descriptionHtml) + + try? container.encodeIfPresent(constants, forKey: .constants) + + try? container.encodeIfPresent(companies, forKey: .companies) + + try? container.encodeIfPresent(support, forKey: .support) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(owner, forKey: .owner) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(token, forKey: .token) + + try? container.encodeIfPresent(secret, forKey: .secret) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: Validators + Used By: Configuration + */ + + class Validators: Codable { + public var company: CompanyValidator? + + public var store: StoreValidator? + + public var inventory: InventoryValidator? + + public var order: OrderValidator? + + public enum CodingKeys: String, CodingKey { + case company + + case store + + case inventory + + case order + } + + public init(company: CompanyValidator?, inventory: InventoryValidator?, order: OrderValidator?, store: StoreValidator?) { + self.company = company + + self.store = store + + self.inventory = inventory + + self.order = order + } + + public func duplicate() -> Validators { + let dict = self.dictionary! + let copy = Validators(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + company = try container.decode(CompanyValidator.self, forKey: .company) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + store = try container.decode(StoreValidator.self, forKey: .store) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + inventory = try container.decode(InventoryValidator.self, forKey: .inventory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + order = try container.decode(OrderValidator.self, forKey: .order) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(company, forKey: .company) + + try? container.encodeIfPresent(store, forKey: .store) + + try? container.encodeIfPresent(inventory, forKey: .inventory) + + try? container.encodeIfPresent(order, forKey: .order) + } + } + + /* + Model: CompanyValidator + Used By: Configuration + */ + + class CompanyValidator: Codable { + public var jsonSchema: [JsonSchema]? + + public var browserScript: String? + + public enum CodingKeys: String, CodingKey { + case jsonSchema = "json_schema" + + case browserScript = "browser_script" + } + + public init(browserScript: String?, jsonSchema: [JsonSchema]?) { + self.jsonSchema = jsonSchema + + self.browserScript = browserScript + } + + public func duplicate() -> CompanyValidator { + let dict = self.dictionary! + let copy = CompanyValidator(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + jsonSchema = try container.decode([JsonSchema].self, forKey: .jsonSchema) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + browserScript = try container.decode(String.self, forKey: .browserScript) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(jsonSchema, forKey: .jsonSchema) + + try? container.encodeIfPresent(browserScript, forKey: .browserScript) + } + } + + /* + Model: JsonSchema + Used By: Configuration + */ + + class JsonSchema: Codable { + public var display: String? + + public var key: String? + + public var type: String? + + public var tooltip: String? + + public enum CodingKeys: String, CodingKey { + case display + + case key + + case type + + case tooltip + } + + public init(display: String?, key: String?, tooltip: String?, type: String?) { + self.display = display + + self.key = key + + self.type = type + + self.tooltip = tooltip + } + + public func duplicate() -> JsonSchema { + let dict = self.dictionary! + let copy = JsonSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tooltip = try container.decode(String.self, forKey: .tooltip) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(tooltip, forKey: .tooltip) + } + } + + /* + Model: StoreValidator + Used By: Configuration + */ + + class StoreValidator: Codable { + public var jsonSchema: [JsonSchema]? + + public var browserScript: String? + + public enum CodingKeys: String, CodingKey { + case jsonSchema = "json_schema" + + case browserScript = "browser_script" + } + + public init(browserScript: String?, jsonSchema: [JsonSchema]?) { + self.jsonSchema = jsonSchema + + self.browserScript = browserScript + } + + public func duplicate() -> StoreValidator { + let dict = self.dictionary! + let copy = StoreValidator(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + jsonSchema = try container.decode([JsonSchema].self, forKey: .jsonSchema) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + browserScript = try container.decode(String.self, forKey: .browserScript) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(jsonSchema, forKey: .jsonSchema) + + try? container.encodeIfPresent(browserScript, forKey: .browserScript) + } + } + + /* + Model: InventoryValidator + Used By: Configuration + */ + + class InventoryValidator: Codable { + public var jsonSchema: [JsonSchema]? + + public var browserScript: String? + + public enum CodingKeys: String, CodingKey { + case jsonSchema = "json_schema" + + case browserScript = "browser_script" + } + + public init(browserScript: String?, jsonSchema: [JsonSchema]?) { + self.jsonSchema = jsonSchema + + self.browserScript = browserScript + } + + public func duplicate() -> InventoryValidator { + let dict = self.dictionary! + let copy = InventoryValidator(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + jsonSchema = try container.decode([JsonSchema].self, forKey: .jsonSchema) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + browserScript = try container.decode(String.self, forKey: .browserScript) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(jsonSchema, forKey: .jsonSchema) + + try? container.encodeIfPresent(browserScript, forKey: .browserScript) + } + } + + /* + Model: OrderValidator + Used By: Configuration + */ + + class OrderValidator: Codable { + public var jsonSchema: [JsonSchema]? + + public var browserScript: String? + + public enum CodingKeys: String, CodingKey { + case jsonSchema = "json_schema" + + case browserScript = "browser_script" + } + + public init(browserScript: String?, jsonSchema: [JsonSchema]?) { + self.jsonSchema = jsonSchema + + self.browserScript = browserScript + } + + public func duplicate() -> OrderValidator { + let dict = self.dictionary! + let copy = OrderValidator(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + jsonSchema = try container.decode([JsonSchema].self, forKey: .jsonSchema) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + browserScript = try container.decode(String.self, forKey: .browserScript) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(jsonSchema, forKey: .jsonSchema) + + try? container.encodeIfPresent(browserScript, forKey: .browserScript) + } + } + + /* + Model: IntegrationMeta + Used By: Configuration + */ + + class IntegrationMeta: Codable { + public var isPublic: Bool? + + public var id: String? + + public var name: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case isPublic = "is_public" + + case id = "_id" + + case name + + case value + } + + public init(isPublic: Bool?, name: String?, value: String?, id: String?) { + self.isPublic = isPublic + + self.id = id + + self.name = name + + self.value = value + } + + public func duplicate() -> IntegrationMeta { + let dict = self.dictionary! + let copy = IntegrationMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isPublic = try container.decode(Bool.self, forKey: .isPublic) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isPublic, forKey: .isPublic) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: Integration + Used By: Configuration + */ + + class Integration: Codable { + public var validators: Validators? + + public var description: String? + + public var descriptionHtml: String? + + public var constants: [String: Any]? + + public var companies: [[String: Any]]? + + public var support: [String]? + + public var id: String? + + public var name: String? + + public var meta: [IntegrationMeta]? + + public var icon: String? + + public var owner: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var token: String? + + public var secret: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case validators + + case description + + case descriptionHtml = "description_html" + + case constants + + case companies + + case support + + case id = "_id" + + case name + + case meta + + case icon + + case owner + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case token + + case secret + + case v = "__v" + } + + public init(companies: [[String: Any]]?, constants: [String: Any]?, createdAt: String?, description: String?, descriptionHtml: String?, icon: String?, meta: [IntegrationMeta]?, name: String?, owner: String?, secret: String?, support: [String]?, token: String?, updatedAt: String?, validators: Validators?, id: String?, v: Int?) { + self.validators = validators + + self.description = description + + self.descriptionHtml = descriptionHtml + + self.constants = constants + + self.companies = companies + + self.support = support + + self.id = id + + self.name = name + + self.meta = meta + + self.icon = icon + + self.owner = owner + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.token = token + + self.secret = secret + + self.v = v + } + + public func duplicate() -> Integration { + let dict = self.dictionary! + let copy = Integration(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + validators = try container.decode(Validators.self, forKey: .validators) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + descriptionHtml = try container.decode(String.self, forKey: .descriptionHtml) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + constants = try container.decode([String: Any].self, forKey: .constants) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companies = try container.decode([[String: Any]].self, forKey: .companies) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + support = try container.decode([String].self, forKey: .support) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([IntegrationMeta].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + owner = try container.decode(String.self, forKey: .owner) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + token = try container.decode(String.self, forKey: .token) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + secret = try container.decode(String.self, forKey: .secret) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(validators, forKey: .validators) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(descriptionHtml, forKey: .descriptionHtml) + + try? container.encodeIfPresent(constants, forKey: .constants) + + try? container.encodeIfPresent(companies, forKey: .companies) + + try? container.encodeIfPresent(support, forKey: .support) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(owner, forKey: .owner) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(token, forKey: .token) + + try? container.encodeIfPresent(secret, forKey: .secret) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: IntegrationConfigResponse + Used By: Configuration + */ + + class IntegrationConfigResponse: Codable { + public var items: [IntegrationLevel]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [IntegrationLevel]?) { + self.items = items + } + + public func duplicate() -> IntegrationConfigResponse { + let dict = self.dictionary! + let copy = IntegrationConfigResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([IntegrationLevel].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: IntegrationLevel + Used By: Configuration + */ + + class IntegrationLevel: Codable { + public var opted: Bool? + + public var permissions: [[String: Any]]? + + public var lastPatch: [LastPatch]? + + public var id: String? + + public var integration: String? + + public var level: String? + + public var uid: Int? + + public var meta: [IntegrationMeta]? + + public var token: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public var data: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case opted + + case permissions + + case lastPatch = "last_patch" + + case id = "_id" + + case integration + + case level + + case uid + + case meta + + case token + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + + case data + } + + public init(createdAt: String?, data: [String: Any]?, integration: String?, lastPatch: [LastPatch]?, level: String?, meta: [IntegrationMeta]?, opted: Bool?, permissions: [[String: Any]]?, token: String?, uid: Int?, updatedAt: String?, id: String?, v: Int?) { + self.opted = opted + + self.permissions = permissions + + self.lastPatch = lastPatch + + self.id = id + + self.integration = integration + + self.level = level + + self.uid = uid + + self.meta = meta + + self.token = token + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + + self.data = data + } + + public func duplicate() -> IntegrationLevel { + let dict = self.dictionary! + let copy = IntegrationLevel(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + opted = try container.decode(Bool.self, forKey: .opted) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + permissions = try container.decode([[String: Any]].self, forKey: .permissions) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastPatch = try container.decode([LastPatch].self, forKey: .lastPatch) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + integration = try container.decode(String.self, forKey: .integration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + level = try container.decode(String.self, forKey: .level) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([IntegrationMeta].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + token = try container.decode(String.self, forKey: .token) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode([String: Any].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(opted, forKey: .opted) + + try? container.encodeIfPresent(permissions, forKey: .permissions) + + try? container.encodeIfPresent(lastPatch, forKey: .lastPatch) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(integration, forKey: .integration) + + try? container.encodeIfPresent(level, forKey: .level) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(token, forKey: .token) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: UpdateIntegrationLevelRequest + Used By: Configuration + */ + + class UpdateIntegrationLevelRequest: Codable { + public var items: [IntegrationLevel]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [IntegrationLevel]?) { + self.items = items + } + + public func duplicate() -> UpdateIntegrationLevelRequest { + let dict = self.dictionary! + let copy = UpdateIntegrationLevelRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([IntegrationLevel].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: OptedStoreIntegration + Used By: Configuration + */ + + class OptedStoreIntegration: Codable { + public var otherOpted: Bool? + + public var otherIntegration: IntegrationOptIn? + + public var otherEntity: OtherEntity? + + public enum CodingKeys: String, CodingKey { + case otherOpted = "other_opted" + + case otherIntegration = "other_integration" + + case otherEntity = "other_entity" + } + + public init(otherEntity: OtherEntity?, otherIntegration: IntegrationOptIn?, otherOpted: Bool?) { + self.otherOpted = otherOpted + + self.otherIntegration = otherIntegration + + self.otherEntity = otherEntity + } + + public func duplicate() -> OptedStoreIntegration { + let dict = self.dictionary! + let copy = OptedStoreIntegration(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + otherOpted = try container.decode(Bool.self, forKey: .otherOpted) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + otherIntegration = try container.decode(IntegrationOptIn.self, forKey: .otherIntegration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + otherEntity = try container.decode(OtherEntity.self, forKey: .otherEntity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(otherOpted, forKey: .otherOpted) + + try? container.encodeIfPresent(otherIntegration, forKey: .otherIntegration) + + try? container.encodeIfPresent(otherEntity, forKey: .otherEntity) + } + } + + /* + Model: OtherEntity + Used By: Configuration + */ + + class OtherEntity: Codable { + public var opted: Bool? + + public var permissions: [String]? + + public var lastPatch: [LastPatch]? + + public var id: String? + + public var integration: String? + + public var level: String? + + public var uid: Int? + + public var data: OtherEntityData? + + public var meta: [[String: Any]]? + + public var token: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case opted + + case permissions + + case lastPatch = "last_patch" + + case id = "_id" + + case integration + + case level + + case uid + + case data + + case meta + + case token + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + } + + public init(createdAt: String?, data: OtherEntityData?, integration: String?, lastPatch: [LastPatch]?, level: String?, meta: [[String: Any]]?, opted: Bool?, permissions: [String]?, token: String?, uid: Int?, updatedAt: String?, id: String?, v: Int?) { + self.opted = opted + + self.permissions = permissions + + self.lastPatch = lastPatch + + self.id = id + + self.integration = integration + + self.level = level + + self.uid = uid + + self.data = data + + self.meta = meta + + self.token = token + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + } + + public func duplicate() -> OtherEntity { + let dict = self.dictionary! + let copy = OtherEntity(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + opted = try container.decode(Bool.self, forKey: .opted) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + permissions = try container.decode([String].self, forKey: .permissions) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastPatch = try container.decode([LastPatch].self, forKey: .lastPatch) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + integration = try container.decode(String.self, forKey: .integration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + level = try container.decode(String.self, forKey: .level) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode(OtherEntityData.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([[String: Any]].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + token = try container.decode(String.self, forKey: .token) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(opted, forKey: .opted) + + try? container.encodeIfPresent(permissions, forKey: .permissions) + + try? container.encodeIfPresent(lastPatch, forKey: .lastPatch) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(integration, forKey: .integration) + + try? container.encodeIfPresent(level, forKey: .level) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(token, forKey: .token) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: LastPatch + Used By: Configuration + */ + + class LastPatch: Codable { + public var op: String? + + public var path: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case op + + case path + + case value + } + + public init(op: String?, path: String?, value: String?) { + self.op = op + + self.path = path + + self.value = value + } + + public func duplicate() -> LastPatch { + let dict = self.dictionary! + let copy = LastPatch(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + op = try container.decode(String.self, forKey: .op) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + path = try container.decode(String.self, forKey: .path) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(op, forKey: .op) + + try? container.encodeIfPresent(path, forKey: .path) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: OtherEntityData + Used By: Configuration + */ + + class OtherEntityData: Codable { + public var articleIdentifier: String? + + public enum CodingKeys: String, CodingKey { + case articleIdentifier = "article_identifier" + } + + public init(articleIdentifier: String?) { + self.articleIdentifier = articleIdentifier + } + + public func duplicate() -> OtherEntityData { + let dict = self.dictionary! + let copy = OtherEntityData(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + articleIdentifier = try container.decode(String.self, forKey: .articleIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(articleIdentifier, forKey: .articleIdentifier) + } + } + + /* + Model: App + Used By: Configuration + */ + + class App: Codable { + public var companyId: String? + + public var channelType: String? + + public var auth: ApplicationAuth? + + public var name: String? + + public var desc: String? + + public enum CodingKeys: String, CodingKey { + case companyId = "company_id" + + case channelType = "channel_type" + + case auth + + case name + + case desc + } + + public init(auth: ApplicationAuth?, channelType: String?, companyId: String?, desc: String?, name: String?) { + self.companyId = companyId + + self.channelType = channelType + + self.auth = auth + + self.name = name + + self.desc = desc + } + + public func duplicate() -> App { + let dict = self.dictionary! + let copy = App(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + companyId = try container.decode(String.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + channelType = try container.decode(String.self, forKey: .channelType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + auth = try container.decode(ApplicationAuth.self, forKey: .auth) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + desc = try container.decode(String.self, forKey: .desc) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(channelType, forKey: .channelType) + + try? container.encodeIfPresent(auth, forKey: .auth) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(desc, forKey: .desc) + } + } + + /* + Model: AppInventory + Used By: Configuration + */ + + class AppInventory: Codable { + public var brand: InventoryBrandRule? + + public var store: InventoryStoreRule? + + public var image: [String]? + + public var franchiseEnabled: Bool? + + public var outOfStock: Bool? + + public var onlyVerifiedProducts: Bool? + + public var payment: InventoryPaymentConfig? + + public var articleAssignment: InventoryArticleAssignment? + + public enum CodingKeys: String, CodingKey { + case brand + + case store + + case image + + case franchiseEnabled = "franchise_enabled" + + case outOfStock = "out_of_stock" + + case onlyVerifiedProducts = "only_verified_products" + + case payment + + case articleAssignment = "article_assignment" + } + + public init(articleAssignment: InventoryArticleAssignment?, brand: InventoryBrandRule?, franchiseEnabled: Bool?, image: [String]?, onlyVerifiedProducts: Bool?, outOfStock: Bool?, payment: InventoryPaymentConfig?, store: InventoryStoreRule?) { + self.brand = brand + + self.store = store + + self.image = image + + self.franchiseEnabled = franchiseEnabled + + self.outOfStock = outOfStock + + self.onlyVerifiedProducts = onlyVerifiedProducts + + self.payment = payment + + self.articleAssignment = articleAssignment + } + + public func duplicate() -> AppInventory { + let dict = self.dictionary! + let copy = AppInventory(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + brand = try container.decode(InventoryBrandRule.self, forKey: .brand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + store = try container.decode(InventoryStoreRule.self, forKey: .store) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + image = try container.decode([String].self, forKey: .image) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + franchiseEnabled = try container.decode(Bool.self, forKey: .franchiseEnabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + outOfStock = try container.decode(Bool.self, forKey: .outOfStock) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + onlyVerifiedProducts = try container.decode(Bool.self, forKey: .onlyVerifiedProducts) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + payment = try container.decode(InventoryPaymentConfig.self, forKey: .payment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + articleAssignment = try container.decode(InventoryArticleAssignment.self, forKey: .articleAssignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(brand, forKey: .brand) + + try? container.encodeIfPresent(store, forKey: .store) + + try? container.encodeIfPresent(image, forKey: .image) + + try? container.encodeIfPresent(franchiseEnabled, forKey: .franchiseEnabled) + + try? container.encodeIfPresent(outOfStock, forKey: .outOfStock) + + try? container.encodeIfPresent(onlyVerifiedProducts, forKey: .onlyVerifiedProducts) + + try? container.encodeIfPresent(payment, forKey: .payment) + + try? container.encodeIfPresent(articleAssignment, forKey: .articleAssignment) + } + } + + /* + Model: AppDomain + Used By: Configuration + */ + + class AppDomain: Codable { + public var name: String? + + public enum CodingKeys: String, CodingKey { + case name + } + + public init(name: String?) { + self.name = name + } + + public func duplicate() -> AppDomain { + let dict = self.dictionary! + let copy = AppDomain(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: CompaniesResponse + Used By: Configuration + */ + + class CompaniesResponse: Codable { + public var items: AppInventoryCompanies? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: AppInventoryCompanies?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> CompaniesResponse { + let dict = self.dictionary! + let copy = CompaniesResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode(AppInventoryCompanies.self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: AppInventoryCompanies + Used By: Configuration + */ + + class AppInventoryCompanies: Codable { + public var uid: Int? + + public var name: String? + + public var companyType: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case name + + case companyType = "company_type" + } + + public init(companyType: String?, name: String?, uid: Int?) { + self.uid = uid + + self.name = name + + self.companyType = companyType + } + + public func duplicate() -> AppInventoryCompanies { + let dict = self.dictionary! + let copy = AppInventoryCompanies(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyType = try container.decode(String.self, forKey: .companyType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(companyType, forKey: .companyType) + } + } + + /* + Model: StoresResponse + Used By: Configuration + */ + + class StoresResponse: Codable { + public var items: AppInventoryStores? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: AppInventoryStores?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> StoresResponse { + let dict = self.dictionary! + let copy = StoresResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode(AppInventoryStores.self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: AppInventoryStores + Used By: Configuration + */ + + class AppInventoryStores: Codable { + public var id: String? + + public var modifiedOn: String? + + public var uid: Int? + + public var name: String? + + public var displayName: String? + + public var storeType: String? + + public var storeCode: String? + + public var companyId: Int? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case modifiedOn = "modified_on" + + case uid + + case name + + case displayName = "display_name" + + case storeType = "store_type" + + case storeCode = "store_code" + + case companyId = "company_id" + } + + public init(companyId: Int?, displayName: String?, modifiedOn: String?, name: String?, storeCode: String?, storeType: String?, uid: Int?, id: String?) { + self.id = id + + self.modifiedOn = modifiedOn + + self.uid = uid + + self.name = name + + self.displayName = displayName + + self.storeType = storeType + + self.storeCode = storeCode + + self.companyId = companyId + } + + public func duplicate() -> AppInventoryStores { + let dict = self.dictionary! + let copy = AppInventoryStores(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeType = try container.decode(String.self, forKey: .storeType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeCode = try container.decode(String.self, forKey: .storeCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(storeType, forKey: .storeType) + + try? container.encodeIfPresent(storeCode, forKey: .storeCode) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + } + } + + /* + Model: FilterOrderingStoreRequest + Used By: Configuration + */ + + class FilterOrderingStoreRequest: Codable { + public var allStores: Bool? + + public var deployedStores: [Int]? + + public var q: String? + + public enum CodingKeys: String, CodingKey { + case allStores = "all_stores" + + case deployedStores = "deployed_stores" + + case q + } + + public init(allStores: Bool?, deployedStores: [Int]?, q: String?) { + self.allStores = allStores + + self.deployedStores = deployedStores + + self.q = q + } + + public func duplicate() -> FilterOrderingStoreRequest { + let dict = self.dictionary! + let copy = FilterOrderingStoreRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + allStores = try container.decode(Bool.self, forKey: .allStores) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deployedStores = try container.decode([Int].self, forKey: .deployedStores) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + q = try container.decode(String.self, forKey: .q) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(allStores, forKey: .allStores) + + try? container.encodeIfPresent(deployedStores, forKey: .deployedStores) + + try? container.encodeIfPresent(q, forKey: .q) + } + } + + /* + Model: DeploymentMeta + Used By: Configuration + */ + + class DeploymentMeta: Codable { + public var deployedStores: [Int]? + + public var allStores: Bool? + + public var enabled: Bool? + + public var type: String? + + public var id: String? + + public var app: String? + + public enum CodingKeys: String, CodingKey { + case deployedStores = "deployed_stores" + + case allStores = "all_stores" + + case enabled + + case type + + case id = "_id" + + case app + } + + public init(allStores: Bool?, app: String?, deployedStores: [Int]?, enabled: Bool?, type: String?, id: String?) { + self.deployedStores = deployedStores + + self.allStores = allStores + + self.enabled = enabled + + self.type = type + + self.id = id + + self.app = app + } + + public func duplicate() -> DeploymentMeta { + let dict = self.dictionary! + let copy = DeploymentMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + deployedStores = try container.decode([Int].self, forKey: .deployedStores) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allStores = try container.decode(Bool.self, forKey: .allStores) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + app = try container.decode(String.self, forKey: .app) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(deployedStores, forKey: .deployedStores) + + try? container.encodeIfPresent(allStores, forKey: .allStores) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(app, forKey: .app) + } + } + + /* + Model: OrderingStoreConfig + Used By: Configuration + */ + + class OrderingStoreConfig: Codable { + public var deploymentMeta: DeploymentMeta? + + public enum CodingKeys: String, CodingKey { + case deploymentMeta = "deployment_meta" + } + + public init(deploymentMeta: DeploymentMeta?) { + self.deploymentMeta = deploymentMeta + } + + public func duplicate() -> OrderingStoreConfig { + let dict = self.dictionary! + let copy = OrderingStoreConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + deploymentMeta = try container.decode(DeploymentMeta.self, forKey: .deploymentMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(deploymentMeta, forKey: .deploymentMeta) + } + } + + /* + Model: OtherSellerCompany + Used By: Configuration + */ + + class OtherSellerCompany: Codable { + public var uid: Int? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case name + } + + public init(name: String?, uid: Int?) { + self.uid = uid + + self.name = name + } + + public func duplicate() -> OtherSellerCompany { + let dict = self.dictionary! + let copy = OtherSellerCompany(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: OtherSellerApplication + Used By: Configuration + */ + + class OtherSellerApplication: Codable { + public var name: String? + + public var description: String? + + public var id: String? + + public var domain: String? + + public var company: OtherSellerCompany? + + public var optType: String? + + public enum CodingKeys: String, CodingKey { + case name + + case description + + case id = "_id" + + case domain + + case company + + case optType = "opt_type" + } + + public init(company: OtherSellerCompany?, description: String?, domain: String?, name: String?, optType: String?, id: String?) { + self.name = name + + self.description = description + + self.id = id + + self.domain = domain + + self.company = company + + self.optType = optType + } + + public func duplicate() -> OtherSellerApplication { + let dict = self.dictionary! + let copy = OtherSellerApplication(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + domain = try container.decode(String.self, forKey: .domain) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + company = try container.decode(OtherSellerCompany.self, forKey: .company) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + optType = try container.decode(String.self, forKey: .optType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(domain, forKey: .domain) + + try? container.encodeIfPresent(company, forKey: .company) + + try? container.encodeIfPresent(optType, forKey: .optType) + } + } + + /* + Model: OtherSellerApplications + Used By: Configuration + */ + + class OtherSellerApplications: Codable { + public var items: [OtherSellerApplication]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [OtherSellerApplication]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> OtherSellerApplications { + let dict = self.dictionary! + let copy = OtherSellerApplications(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([OtherSellerApplication].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: OptedApplicationResponse + Used By: Configuration + */ + + class OptedApplicationResponse: Codable { + public var name: String? + + public var description: String? + + public var id: String? + + public var domain: String? + + public var company: OptedCompany? + + public var optedInventory: OptedInventory? + + public var optOutInventory: OptOutInventory? + + public enum CodingKeys: String, CodingKey { + case name + + case description + + case id = "_id" + + case domain + + case company + + case optedInventory = "opted_inventory" + + case optOutInventory = "opt_out_inventory" + } + + public init(company: OptedCompany?, description: String?, domain: String?, name: String?, optedInventory: OptedInventory?, optOutInventory: OptOutInventory?, id: String?) { + self.name = name + + self.description = description + + self.id = id + + self.domain = domain + + self.company = company + + self.optedInventory = optedInventory + + self.optOutInventory = optOutInventory + } + + public func duplicate() -> OptedApplicationResponse { + let dict = self.dictionary! + let copy = OptedApplicationResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + domain = try container.decode(String.self, forKey: .domain) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + company = try container.decode(OptedCompany.self, forKey: .company) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + optedInventory = try container.decode(OptedInventory.self, forKey: .optedInventory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + optOutInventory = try container.decode(OptOutInventory.self, forKey: .optOutInventory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(domain, forKey: .domain) + + try? container.encodeIfPresent(company, forKey: .company) + + try? container.encodeIfPresent(optedInventory, forKey: .optedInventory) + + try? container.encodeIfPresent(optOutInventory, forKey: .optOutInventory) + } + } + + /* + Model: OptedCompany + Used By: Configuration + */ + + class OptedCompany: Codable { + public var uid: Int? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case uid + + case name + } + + public init(name: String?, uid: Int?) { + self.uid = uid + + self.name = name + } + + public func duplicate() -> OptedCompany { + let dict = self.dictionary! + let copy = OptedCompany(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: OptedInventory + Used By: Configuration + */ + + class OptedInventory: Codable { + public var optType: OptType? + + public var items: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case optType = "opt_type" + + case items + } + + public init(items: [String: Any]?, optType: OptType?) { + self.optType = optType + + self.items = items + } + + public func duplicate() -> OptedInventory { + let dict = self.dictionary! + let copy = OptedInventory(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + optType = try container.decode(OptType.self, forKey: .optType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([String: Any].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(optType, forKey: .optType) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: OptType + Used By: Configuration + */ + + class OptType: Codable { + public var key: String? + + public var display: String? + + public enum CodingKeys: String, CodingKey { + case key + + case display + } + + public init(display: String?, key: String?) { + self.key = key + + self.display = display + } + + public func duplicate() -> OptType { + let dict = self.dictionary! + let copy = OptType(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(display, forKey: .display) + } + } + + /* + Model: OptedStore + Used By: Configuration + */ + + class OptedStore: Codable { + public var name: String? + + public var storeCode: String? + + public var id: String? + + public var modifiedOn: String? + + public var uid: Int? + + public var address: OptedStoreAddress? + + public var displayName: String? + + public var storeType: String? + + public var companyId: Int? + + public enum CodingKeys: String, CodingKey { + case name + + case storeCode = "store_code" + + case id = "_id" + + case modifiedOn = "modified_on" + + case uid + + case address + + case displayName = "display_name" + + case storeType = "store_type" + + case companyId = "company_id" + } + + public init(address: OptedStoreAddress?, companyId: Int?, displayName: String?, modifiedOn: String?, name: String?, storeCode: String?, storeType: String?, uid: Int?, id: String?) { + self.name = name + + self.storeCode = storeCode + + self.id = id + + self.modifiedOn = modifiedOn + + self.uid = uid + + self.address = address + + self.displayName = displayName + + self.storeType = storeType + + self.companyId = companyId + } + + public func duplicate() -> OptedStore { + let dict = self.dictionary! + let copy = OptedStore(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeCode = try container.decode(String.self, forKey: .storeCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address = try container.decode(OptedStoreAddress.self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeType = try container.decode(String.self, forKey: .storeType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(storeCode, forKey: .storeCode) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(storeType, forKey: .storeType) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + } + } + + /* + Model: OptOutInventory + Used By: Configuration + */ + + class OptOutInventory: Codable { + public var store: [Int] + + public var company: [Int] + + public enum CodingKeys: String, CodingKey { + case store + + case company + } + + public init(company: [Int], store: [Int]) { + self.store = store + + self.company = company + } + + public func duplicate() -> OptOutInventory { + let dict = self.dictionary! + let copy = OptOutInventory(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + store = try container.decode([Int].self, forKey: .store) + + company = try container.decode([Int].self, forKey: .company) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(store, forKey: .store) + + try? container.encodeIfPresent(company, forKey: .company) + } + } + + /* + Model: TokenResponse + Used By: Configuration + */ + + class TokenResponse: Codable { + public var tokens: Tokens? + + public var id: String? + + public var application: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case tokens + + case id = "_id" + + case application + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + } + + public init(application: String?, createdAt: String?, tokens: Tokens?, updatedAt: String?, id: String?, v: Int?) { + self.tokens = tokens + + self.id = id + + self.application = application + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + } + + public func duplicate() -> TokenResponse { + let dict = self.dictionary! + let copy = TokenResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + tokens = try container.decode(Tokens.self, forKey: .tokens) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(tokens, forKey: .tokens) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: Tokens + Used By: Configuration + */ + + class Tokens: Codable { + public var firebase: Firebase? + + public var moengage: Moengage? + + public var segment: Segment? + + public var gtm: Gtm? + + public var freshchat: Freshchat? + + public var safetynet: Safetynet? + + public var fyndRewards: FyndRewards? + + public var googleMap: GoogleMap? + + public enum CodingKeys: String, CodingKey { + case firebase + + case moengage + + case segment + + case gtm + + case freshchat + + case safetynet + + case fyndRewards = "fynd_rewards" + + case googleMap = "google_map" + } + + public init(firebase: Firebase?, freshchat: Freshchat?, fyndRewards: FyndRewards?, googleMap: GoogleMap?, gtm: Gtm?, moengage: Moengage?, safetynet: Safetynet?, segment: Segment?) { + self.firebase = firebase + + self.moengage = moengage + + self.segment = segment + + self.gtm = gtm + + self.freshchat = freshchat + + self.safetynet = safetynet + + self.fyndRewards = fyndRewards + + self.googleMap = googleMap + } + + public func duplicate() -> Tokens { + let dict = self.dictionary! + let copy = Tokens(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + firebase = try container.decode(Firebase.self, forKey: .firebase) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + moengage = try container.decode(Moengage.self, forKey: .moengage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + segment = try container.decode(Segment.self, forKey: .segment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gtm = try container.decode(Gtm.self, forKey: .gtm) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + freshchat = try container.decode(Freshchat.self, forKey: .freshchat) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + safetynet = try container.decode(Safetynet.self, forKey: .safetynet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fyndRewards = try container.decode(FyndRewards.self, forKey: .fyndRewards) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + googleMap = try container.decode(GoogleMap.self, forKey: .googleMap) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(firebase, forKey: .firebase) + + try? container.encodeIfPresent(moengage, forKey: .moengage) + + try? container.encodeIfPresent(segment, forKey: .segment) + + try? container.encodeIfPresent(gtm, forKey: .gtm) + + try? container.encodeIfPresent(freshchat, forKey: .freshchat) + + try? container.encodeIfPresent(safetynet, forKey: .safetynet) + + try? container.encodeIfPresent(fyndRewards, forKey: .fyndRewards) + + try? container.encodeIfPresent(googleMap, forKey: .googleMap) + } + } + + /* + Model: Firebase + Used By: Configuration + */ + + class Firebase: Codable { + public var credentials: Credentials? + + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case credentials + + case enabled + } + + public init(credentials: Credentials?, enabled: Bool?) { + self.credentials = credentials + + self.enabled = enabled + } + + public func duplicate() -> Firebase { + let dict = self.dictionary! + let copy = Firebase(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + credentials = try container.decode(Credentials.self, forKey: .credentials) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(credentials, forKey: .credentials) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: Credentials + Used By: Configuration + */ + + class Credentials: Codable { + public var ios: Ios? + + public var android: Android? + + public var projectId: String? + + public var gcmSenderId: String? + + public var applicationId: String? + + public var apiKey: String? + + public enum CodingKeys: String, CodingKey { + case ios + + case android + + case projectId = "project_id" + + case gcmSenderId = "gcm_sender_id" + + case applicationId = "application_id" + + case apiKey = "api_key" + } + + public init(android: Android?, apiKey: String?, applicationId: String?, gcmSenderId: String?, ios: Ios?, projectId: String?) { + self.ios = ios + + self.android = android + + self.projectId = projectId + + self.gcmSenderId = gcmSenderId + + self.applicationId = applicationId + + self.apiKey = apiKey + } + + public func duplicate() -> Credentials { + let dict = self.dictionary! + let copy = Credentials(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + ios = try container.decode(Ios.self, forKey: .ios) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + android = try container.decode(Android.self, forKey: .android) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + projectId = try container.decode(String.self, forKey: .projectId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gcmSenderId = try container.decode(String.self, forKey: .gcmSenderId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + applicationId = try container.decode(String.self, forKey: .applicationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + apiKey = try container.decode(String.self, forKey: .apiKey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(ios, forKey: .ios) + + try? container.encodeIfPresent(android, forKey: .android) + + try? container.encodeIfPresent(projectId, forKey: .projectId) + + try? container.encodeIfPresent(gcmSenderId, forKey: .gcmSenderId) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + + try? container.encodeIfPresent(apiKey, forKey: .apiKey) + } + } + + /* + Model: Ios + Used By: Configuration + */ + + class Ios: Codable { + public var applicationId: String? + + public var apiKey: String? + + public enum CodingKeys: String, CodingKey { + case applicationId = "application_id" + + case apiKey = "api_key" + } + + public init(apiKey: String?, applicationId: String?) { + self.applicationId = applicationId + + self.apiKey = apiKey + } + + public func duplicate() -> Ios { + let dict = self.dictionary! + let copy = Ios(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + applicationId = try container.decode(String.self, forKey: .applicationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + apiKey = try container.decode(String.self, forKey: .apiKey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + + try? container.encodeIfPresent(apiKey, forKey: .apiKey) + } + } + + /* + Model: Android + Used By: Configuration + */ + + class Android: Codable { + public var applicationId: String? + + public var apiKey: String? + + public enum CodingKeys: String, CodingKey { + case applicationId = "application_id" + + case apiKey = "api_key" + } + + public init(apiKey: String?, applicationId: String?) { + self.applicationId = applicationId + + self.apiKey = apiKey + } + + public func duplicate() -> Android { + let dict = self.dictionary! + let copy = Android(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + applicationId = try container.decode(String.self, forKey: .applicationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + apiKey = try container.decode(String.self, forKey: .apiKey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + + try? container.encodeIfPresent(apiKey, forKey: .apiKey) + } + } + + /* + Model: Moengage + Used By: Configuration + */ + + class Moengage: Codable { + public var credentials: MoengageCredentials? + + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case credentials + + case enabled + } + + public init(credentials: MoengageCredentials?, enabled: Bool?) { + self.credentials = credentials + + self.enabled = enabled + } + + public func duplicate() -> Moengage { + let dict = self.dictionary! + let copy = Moengage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + credentials = try container.decode(MoengageCredentials.self, forKey: .credentials) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(credentials, forKey: .credentials) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: MoengageCredentials + Used By: Configuration + */ + + class MoengageCredentials: Codable { + public var appId: String? + + public enum CodingKeys: String, CodingKey { + case appId = "app_id" + } + + public init(appId: String?) { + self.appId = appId + } + + public func duplicate() -> MoengageCredentials { + let dict = self.dictionary! + let copy = MoengageCredentials(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appId, forKey: .appId) + } + } + + /* + Model: Segment + Used By: Configuration + */ + + class Segment: Codable { + public var credentials: SegmentCredentials? + + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case credentials + + case enabled + } + + public init(credentials: SegmentCredentials?, enabled: Bool?) { + self.credentials = credentials + + self.enabled = enabled + } + + public func duplicate() -> Segment { + let dict = self.dictionary! + let copy = Segment(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + credentials = try container.decode(SegmentCredentials.self, forKey: .credentials) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(credentials, forKey: .credentials) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: SegmentCredentials + Used By: Configuration + */ + + class SegmentCredentials: Codable { + public var writeKey: String? + + public enum CodingKeys: String, CodingKey { + case writeKey = "write_key" + } + + public init(writeKey: String?) { + self.writeKey = writeKey + } + + public func duplicate() -> SegmentCredentials { + let dict = self.dictionary! + let copy = SegmentCredentials(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + writeKey = try container.decode(String.self, forKey: .writeKey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(writeKey, forKey: .writeKey) + } + } + + /* + Model: Gtm + Used By: Configuration + */ + + class Gtm: Codable { + public var credentials: GtmCredentials? + + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case credentials + + case enabled + } + + public init(credentials: GtmCredentials?, enabled: Bool?) { + self.credentials = credentials + + self.enabled = enabled + } + + public func duplicate() -> Gtm { + let dict = self.dictionary! + let copy = Gtm(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + credentials = try container.decode(GtmCredentials.self, forKey: .credentials) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(credentials, forKey: .credentials) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: GtmCredentials + Used By: Configuration + */ + + class GtmCredentials: Codable { + public var apiKey: String? + + public enum CodingKeys: String, CodingKey { + case apiKey = "api_key" + } + + public init(apiKey: String?) { + self.apiKey = apiKey + } + + public func duplicate() -> GtmCredentials { + let dict = self.dictionary! + let copy = GtmCredentials(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + apiKey = try container.decode(String.self, forKey: .apiKey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(apiKey, forKey: .apiKey) + } + } + + /* + Model: Freshchat + Used By: Configuration + */ + + class Freshchat: Codable { + public var credentials: FreshchatCredentials? + + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case credentials + + case enabled + } + + public init(credentials: FreshchatCredentials?, enabled: Bool?) { + self.credentials = credentials + + self.enabled = enabled + } + + public func duplicate() -> Freshchat { + let dict = self.dictionary! + let copy = Freshchat(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + credentials = try container.decode(FreshchatCredentials.self, forKey: .credentials) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(credentials, forKey: .credentials) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: FreshchatCredentials + Used By: Configuration + */ + + class FreshchatCredentials: Codable { + public var appId: String? + + public var appKey: String? + + public var webToken: String? + + public enum CodingKeys: String, CodingKey { + case appId = "app_id" + + case appKey = "app_key" + + case webToken = "web_token" + } + + public init(appId: String?, appKey: String?, webToken: String?) { + self.appId = appId + + self.appKey = appKey + + self.webToken = webToken + } + + public func duplicate() -> FreshchatCredentials { + let dict = self.dictionary! + let copy = FreshchatCredentials(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appKey = try container.decode(String.self, forKey: .appKey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + webToken = try container.decode(String.self, forKey: .webToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(appKey, forKey: .appKey) + + try? container.encodeIfPresent(webToken, forKey: .webToken) + } + } + + /* + Model: Safetynet + Used By: Configuration + */ + + class Safetynet: Codable { + public var credentials: SafetynetCredentials? + + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case credentials + + case enabled + } + + public init(credentials: SafetynetCredentials?, enabled: Bool?) { + self.credentials = credentials + + self.enabled = enabled + } + + public func duplicate() -> Safetynet { + let dict = self.dictionary! + let copy = Safetynet(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + credentials = try container.decode(SafetynetCredentials.self, forKey: .credentials) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(credentials, forKey: .credentials) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: SafetynetCredentials + Used By: Configuration + */ + + class SafetynetCredentials: Codable { + public var apiKey: String? + + public enum CodingKeys: String, CodingKey { + case apiKey = "api_key" + } + + public init(apiKey: String?) { + self.apiKey = apiKey + } + + public func duplicate() -> SafetynetCredentials { + let dict = self.dictionary! + let copy = SafetynetCredentials(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + apiKey = try container.decode(String.self, forKey: .apiKey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(apiKey, forKey: .apiKey) + } + } + + /* + Model: FyndRewards + Used By: Configuration + */ + + class FyndRewards: Codable { + public var credentials: FyndRewardsCredentials? + + public enum CodingKeys: String, CodingKey { + case credentials + } + + public init(credentials: FyndRewardsCredentials?) { + self.credentials = credentials + } + + public func duplicate() -> FyndRewards { + let dict = self.dictionary! + let copy = FyndRewards(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + credentials = try container.decode(FyndRewardsCredentials.self, forKey: .credentials) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(credentials, forKey: .credentials) + } + } + + /* + Model: FyndRewardsCredentials + Used By: Configuration + */ + + class FyndRewardsCredentials: Codable { + public var publicKey: String? + + public enum CodingKeys: String, CodingKey { + case publicKey = "public_key" + } + + public init(publicKey: String?) { + self.publicKey = publicKey + } + + public func duplicate() -> FyndRewardsCredentials { + let dict = self.dictionary! + let copy = FyndRewardsCredentials(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + publicKey = try container.decode(String.self, forKey: .publicKey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(publicKey, forKey: .publicKey) + } + } + + /* + Model: GoogleMap + Used By: Configuration + */ + + class GoogleMap: Codable { + public var credentials: GoogleMapCredentials? + + public enum CodingKeys: String, CodingKey { + case credentials + } + + public init(credentials: GoogleMapCredentials?) { + self.credentials = credentials + } + + public func duplicate() -> GoogleMap { + let dict = self.dictionary! + let copy = GoogleMap(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + credentials = try container.decode(GoogleMapCredentials.self, forKey: .credentials) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(credentials, forKey: .credentials) + } + } + + /* + Model: GoogleMapCredentials + Used By: Configuration + */ + + class GoogleMapCredentials: Codable { + public var apiKey: String? + + public enum CodingKeys: String, CodingKey { + case apiKey = "api_key" + } + + public init(apiKey: String?) { + self.apiKey = apiKey + } + + public func duplicate() -> GoogleMapCredentials { + let dict = self.dictionary! + let copy = GoogleMapCredentials(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + apiKey = try container.decode(String.self, forKey: .apiKey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(apiKey, forKey: .apiKey) + } + } + + /* + Model: RewardPointsConfig + Used By: Configuration + */ + + class RewardPointsConfig: Codable { + public var credit: Credit? + + public var debit: Debit? + + public enum CodingKeys: String, CodingKey { + case credit + + case debit + } + + public init(credit: Credit?, debit: Debit?) { + self.credit = credit + + self.debit = debit + } + + public func duplicate() -> RewardPointsConfig { + let dict = self.dictionary! + let copy = RewardPointsConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + credit = try container.decode(Credit.self, forKey: .credit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + debit = try container.decode(Debit.self, forKey: .debit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(credit, forKey: .credit) + + try? container.encodeIfPresent(debit, forKey: .debit) + } + } + + /* + Model: Credit + Used By: Configuration + */ + + class Credit: Codable { + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case enabled + } + + public init(enabled: Bool?) { + self.enabled = enabled + } + + public func duplicate() -> Credit { + let dict = self.dictionary! + let copy = Credit(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: Debit + Used By: Configuration + */ + + class Debit: Codable { + public var enabled: Bool? + + public var autoApply: Bool? + + public var strategyChannel: String? + + public enum CodingKeys: String, CodingKey { + case enabled + + case autoApply = "auto_apply" + + case strategyChannel = "strategy_channel" + } + + public init(autoApply: Bool?, enabled: Bool?, strategyChannel: String?) { + self.enabled = enabled + + self.autoApply = autoApply + + self.strategyChannel = strategyChannel + } + + public func duplicate() -> Debit { + let dict = self.dictionary! + let copy = Debit(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + autoApply = try container.decode(Bool.self, forKey: .autoApply) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + strategyChannel = try container.decode(String.self, forKey: .strategyChannel) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(autoApply, forKey: .autoApply) + + try? container.encodeIfPresent(strategyChannel, forKey: .strategyChannel) + } + } + + /* + Model: ProductDetailFeature + Used By: Configuration + */ + + class ProductDetailFeature: Codable { + public var similar: [String]? + + public var sellerSelection: Bool? + + public var updateProductMeta: Bool? + + public var requestProduct: Bool? + + public enum CodingKeys: String, CodingKey { + case similar + + case sellerSelection = "seller_selection" + + case updateProductMeta = "update_product_meta" + + case requestProduct = "request_product" + } + + public init(requestProduct: Bool?, sellerSelection: Bool?, similar: [String]?, updateProductMeta: Bool?) { + self.similar = similar + + self.sellerSelection = sellerSelection + + self.updateProductMeta = updateProductMeta + + self.requestProduct = requestProduct + } + + public func duplicate() -> ProductDetailFeature { + let dict = self.dictionary! + let copy = ProductDetailFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + similar = try container.decode([String].self, forKey: .similar) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sellerSelection = try container.decode(Bool.self, forKey: .sellerSelection) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updateProductMeta = try container.decode(Bool.self, forKey: .updateProductMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestProduct = try container.decode(Bool.self, forKey: .requestProduct) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(similar, forKey: .similar) + + try? container.encodeIfPresent(sellerSelection, forKey: .sellerSelection) + + try? container.encodeIfPresent(updateProductMeta, forKey: .updateProductMeta) + + try? container.encodeIfPresent(requestProduct, forKey: .requestProduct) + } + } + + /* + Model: LaunchPage + Used By: Configuration + */ + + class LaunchPage: Codable { + public var pageType: String? + + public var params: [String: Any]? + + public var query: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case pageType = "page_type" + + case params + + case query + } + + public init(pageType: String?, params: [String: Any]?, query: [String: Any]?) { + self.pageType = pageType + + self.params = params + + self.query = query + } + + public func duplicate() -> LaunchPage { + let dict = self.dictionary! + let copy = LaunchPage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + pageType = try container.decode(String.self, forKey: .pageType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + params = try container.decode([String: Any].self, forKey: .params) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode([String: Any].self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pageType, forKey: .pageType) + + try? container.encodeIfPresent(params, forKey: .params) + + try? container.encodeIfPresent(query, forKey: .query) + } + } + + /* + Model: LandingPageFeature + Used By: Configuration + */ + + class LandingPageFeature: Codable { + public var launchPage: LaunchPage? + + public var continueAsGuest: Bool? + + public var loginBtnText: String? + + public var showDomainTextbox: Bool? + + public var showRegisterBtn: Bool? + + public enum CodingKeys: String, CodingKey { + case launchPage = "launch_page" + + case continueAsGuest = "continue_as_guest" + + case loginBtnText = "login_btn_text" + + case showDomainTextbox = "show_domain_textbox" + + case showRegisterBtn = "show_register_btn" + } + + public init(continueAsGuest: Bool?, launchPage: LaunchPage?, loginBtnText: String?, showDomainTextbox: Bool?, showRegisterBtn: Bool?) { + self.launchPage = launchPage + + self.continueAsGuest = continueAsGuest + + self.loginBtnText = loginBtnText + + self.showDomainTextbox = showDomainTextbox + + self.showRegisterBtn = showRegisterBtn + } + + public func duplicate() -> LandingPageFeature { + let dict = self.dictionary! + let copy = LandingPageFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + launchPage = try container.decode(LaunchPage.self, forKey: .launchPage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + continueAsGuest = try container.decode(Bool.self, forKey: .continueAsGuest) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + loginBtnText = try container.decode(String.self, forKey: .loginBtnText) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + showDomainTextbox = try container.decode(Bool.self, forKey: .showDomainTextbox) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + showRegisterBtn = try container.decode(Bool.self, forKey: .showRegisterBtn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(launchPage, forKey: .launchPage) + + try? container.encodeIfPresent(continueAsGuest, forKey: .continueAsGuest) + + try? container.encodeIfPresent(loginBtnText, forKey: .loginBtnText) + + try? container.encodeIfPresent(showDomainTextbox, forKey: .showDomainTextbox) + + try? container.encodeIfPresent(showRegisterBtn, forKey: .showRegisterBtn) + } + } + + /* + Model: RegistrationPageFeature + Used By: Configuration + */ + + class RegistrationPageFeature: Codable { + public var askStoreAddress: Bool? + + public enum CodingKeys: String, CodingKey { + case askStoreAddress = "ask_store_address" + } + + public init(askStoreAddress: Bool?) { + self.askStoreAddress = askStoreAddress + } + + public func duplicate() -> RegistrationPageFeature { + let dict = self.dictionary! + let copy = RegistrationPageFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + askStoreAddress = try container.decode(Bool.self, forKey: .askStoreAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(askStoreAddress, forKey: .askStoreAddress) + } + } + + /* + Model: AppFeature + Used By: Configuration + */ + + class AppFeature: Codable { + public var productDetail: ProductDetailFeature? + + public var landingPage: LandingPageFeature? + + public var registrationPage: RegistrationPageFeature? + + public var homePage: HomePageFeature? + + public var common: CommonFeature? + + public var cart: CartFeature? + + public var qr: QrFeature? + + public var pcr: PcrFeature? + + public var order: OrderFeature? + + public var id: String? + + public var app: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case productDetail = "product_detail" + + case landingPage = "landing_page" + + case registrationPage = "registration_page" + + case homePage = "home_page" + + case common + + case cart + + case qr + + case pcr + + case order + + case id = "_id" + + case app + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + } + + public init(app: String?, cart: CartFeature?, common: CommonFeature?, createdAt: String?, homePage: HomePageFeature?, landingPage: LandingPageFeature?, order: OrderFeature?, pcr: PcrFeature?, productDetail: ProductDetailFeature?, qr: QrFeature?, registrationPage: RegistrationPageFeature?, updatedAt: String?, id: String?, v: Int?) { + self.productDetail = productDetail + + self.landingPage = landingPage + + self.registrationPage = registrationPage + + self.homePage = homePage + + self.common = common + + self.cart = cart + + self.qr = qr + + self.pcr = pcr + + self.order = order + + self.id = id + + self.app = app + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + } + + public func duplicate() -> AppFeature { + let dict = self.dictionary! + let copy = AppFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + productDetail = try container.decode(ProductDetailFeature.self, forKey: .productDetail) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + landingPage = try container.decode(LandingPageFeature.self, forKey: .landingPage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registrationPage = try container.decode(RegistrationPageFeature.self, forKey: .registrationPage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + homePage = try container.decode(HomePageFeature.self, forKey: .homePage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + common = try container.decode(CommonFeature.self, forKey: .common) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cart = try container.decode(CartFeature.self, forKey: .cart) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + qr = try container.decode(QrFeature.self, forKey: .qr) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pcr = try container.decode(PcrFeature.self, forKey: .pcr) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + order = try container.decode(OrderFeature.self, forKey: .order) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + app = try container.decode(String.self, forKey: .app) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(productDetail, forKey: .productDetail) + + try? container.encodeIfPresent(landingPage, forKey: .landingPage) + + try? container.encodeIfPresent(registrationPage, forKey: .registrationPage) + + try? container.encodeIfPresent(homePage, forKey: .homePage) + + try? container.encodeIfPresent(common, forKey: .common) + + try? container.encodeIfPresent(cart, forKey: .cart) + + try? container.encodeIfPresent(qr, forKey: .qr) + + try? container.encodeIfPresent(pcr, forKey: .pcr) + + try? container.encodeIfPresent(order, forKey: .order) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(app, forKey: .app) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: HomePageFeature + Used By: Configuration + */ + + class HomePageFeature: Codable { + public var orderProcessing: Bool? + + public enum CodingKeys: String, CodingKey { + case orderProcessing = "order_processing" + } + + public init(orderProcessing: Bool?) { + self.orderProcessing = orderProcessing + } + + public func duplicate() -> HomePageFeature { + let dict = self.dictionary! + let copy = HomePageFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + orderProcessing = try container.decode(Bool.self, forKey: .orderProcessing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(orderProcessing, forKey: .orderProcessing) + } + } + + /* + Model: CommonFeature + Used By: Configuration + */ + + class CommonFeature: Codable { + public var communicationOptinDialog: CommunicationOptinDialogFeature? + + public var deploymentStoreSelection: DeploymentStoreSelectionFeature? + + public var listingPrice: ListingPriceFeature? + + public var currency: CurrencyFeature? + + public var revenueEngine: RevenueEngineFeature? + + public var feedback: FeedbackFeature? + + public var compareProducts: CompareProductsFeature? + + public var rewardPoints: RewardPointsConfig? + + public enum CodingKeys: String, CodingKey { + case communicationOptinDialog = "communication_optin_dialog" + + case deploymentStoreSelection = "deployment_store_selection" + + case listingPrice = "listing_price" + + case currency + + case revenueEngine = "revenue_engine" + + case feedback + + case compareProducts = "compare_products" + + case rewardPoints = "reward_points" + } + + public init(communicationOptinDialog: CommunicationOptinDialogFeature?, compareProducts: CompareProductsFeature?, currency: CurrencyFeature?, deploymentStoreSelection: DeploymentStoreSelectionFeature?, feedback: FeedbackFeature?, listingPrice: ListingPriceFeature?, revenueEngine: RevenueEngineFeature?, rewardPoints: RewardPointsConfig?) { + self.communicationOptinDialog = communicationOptinDialog + + self.deploymentStoreSelection = deploymentStoreSelection + + self.listingPrice = listingPrice + + self.currency = currency + + self.revenueEngine = revenueEngine + + self.feedback = feedback + + self.compareProducts = compareProducts + + self.rewardPoints = rewardPoints + } + + public func duplicate() -> CommonFeature { + let dict = self.dictionary! + let copy = CommonFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + communicationOptinDialog = try container.decode(CommunicationOptinDialogFeature.self, forKey: .communicationOptinDialog) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deploymentStoreSelection = try container.decode(DeploymentStoreSelectionFeature.self, forKey: .deploymentStoreSelection) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + listingPrice = try container.decode(ListingPriceFeature.self, forKey: .listingPrice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(CurrencyFeature.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + revenueEngine = try container.decode(RevenueEngineFeature.self, forKey: .revenueEngine) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + feedback = try container.decode(FeedbackFeature.self, forKey: .feedback) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + compareProducts = try container.decode(CompareProductsFeature.self, forKey: .compareProducts) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rewardPoints = try container.decode(RewardPointsConfig.self, forKey: .rewardPoints) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(communicationOptinDialog, forKey: .communicationOptinDialog) + + try? container.encodeIfPresent(deploymentStoreSelection, forKey: .deploymentStoreSelection) + + try? container.encodeIfPresent(listingPrice, forKey: .listingPrice) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(revenueEngine, forKey: .revenueEngine) + + try? container.encodeIfPresent(feedback, forKey: .feedback) + + try? container.encodeIfPresent(compareProducts, forKey: .compareProducts) + + try? container.encodeIfPresent(rewardPoints, forKey: .rewardPoints) + } + } + + /* + Model: CommunicationOptinDialogFeature + Used By: Configuration + */ + + class CommunicationOptinDialogFeature: Codable { + public var visibility: Bool? + + public enum CodingKeys: String, CodingKey { + case visibility + } + + public init(visibility: Bool?) { + self.visibility = visibility + } + + public func duplicate() -> CommunicationOptinDialogFeature { + let dict = self.dictionary! + let copy = CommunicationOptinDialogFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + visibility = try container.decode(Bool.self, forKey: .visibility) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(visibility, forKey: .visibility) + } + } + + /* + Model: DeploymentStoreSelectionFeature + Used By: Configuration + */ + + class DeploymentStoreSelectionFeature: Codable { + public var enabled: Bool? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case enabled + + case type + } + + public init(enabled: Bool?, type: String?) { + self.enabled = enabled + + self.type = type + } + + public func duplicate() -> DeploymentStoreSelectionFeature { + let dict = self.dictionary! + let copy = DeploymentStoreSelectionFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: ListingPriceFeature + Used By: Configuration + */ + + class ListingPriceFeature: Codable { + public var value: String? + + public enum CodingKeys: String, CodingKey { + case value + } + + public init(value: String?) { + self.value = value + } + + public func duplicate() -> ListingPriceFeature { + let dict = self.dictionary! + let copy = ListingPriceFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: CurrencyFeature + Used By: Configuration + */ + + class CurrencyFeature: Codable { + public var value: [String]? + + public var type: String? + + public var defaultCurrency: String? + + public enum CodingKeys: String, CodingKey { + case value + + case type + + case defaultCurrency = "default_currency" + } + + public init(defaultCurrency: String?, type: String?, value: [String]?) { + self.value = value + + self.type = type + + self.defaultCurrency = defaultCurrency + } + + public func duplicate() -> CurrencyFeature { + let dict = self.dictionary! + let copy = CurrencyFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + value = try container.decode([String].self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + defaultCurrency = try container.decode(String.self, forKey: .defaultCurrency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(defaultCurrency, forKey: .defaultCurrency) + } + } + + /* + Model: RevenueEngineFeature + Used By: Configuration + */ + + class RevenueEngineFeature: Codable { + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case enabled + } + + public init(enabled: Bool?) { + self.enabled = enabled + } + + public func duplicate() -> RevenueEngineFeature { + let dict = self.dictionary! + let copy = RevenueEngineFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: FeedbackFeature + Used By: Configuration + */ + + class FeedbackFeature: Codable { + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case enabled + } + + public init(enabled: Bool?) { + self.enabled = enabled + } + + public func duplicate() -> FeedbackFeature { + let dict = self.dictionary! + let copy = FeedbackFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: CompareProductsFeature + Used By: Configuration + */ + + class CompareProductsFeature: Codable { + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case enabled + } + + public init(enabled: Bool?) { + self.enabled = enabled + } + + public func duplicate() -> CompareProductsFeature { + let dict = self.dictionary! + let copy = CompareProductsFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: CartFeature + Used By: Configuration + */ + + class CartFeature: Codable { + public var gstInput: Bool? + + public var staffSelection: Bool? + + public var placingForCustomer: Bool? + + public var googleMap: Bool? + + public var revenueEngineCoupon: Bool? + + public enum CodingKeys: String, CodingKey { + case gstInput = "gst_input" + + case staffSelection = "staff_selection" + + case placingForCustomer = "placing_for_customer" + + case googleMap = "google_map" + + case revenueEngineCoupon = "revenue_engine_coupon" + } + + public init(googleMap: Bool?, gstInput: Bool?, placingForCustomer: Bool?, revenueEngineCoupon: Bool?, staffSelection: Bool?) { + self.gstInput = gstInput + + self.staffSelection = staffSelection + + self.placingForCustomer = placingForCustomer + + self.googleMap = googleMap + + self.revenueEngineCoupon = revenueEngineCoupon + } + + public func duplicate() -> CartFeature { + let dict = self.dictionary! + let copy = CartFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + gstInput = try container.decode(Bool.self, forKey: .gstInput) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + staffSelection = try container.decode(Bool.self, forKey: .staffSelection) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + placingForCustomer = try container.decode(Bool.self, forKey: .placingForCustomer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + googleMap = try container.decode(Bool.self, forKey: .googleMap) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + revenueEngineCoupon = try container.decode(Bool.self, forKey: .revenueEngineCoupon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(gstInput, forKey: .gstInput) + + try? container.encodeIfPresent(staffSelection, forKey: .staffSelection) + + try? container.encodeIfPresent(placingForCustomer, forKey: .placingForCustomer) + + try? container.encodeIfPresent(googleMap, forKey: .googleMap) + + try? container.encodeIfPresent(revenueEngineCoupon, forKey: .revenueEngineCoupon) + } + } + + /* + Model: QrFeature + Used By: Configuration + */ + + class QrFeature: Codable { + public var application: Bool? + + public var products: Bool? + + public var collections: Bool? + + public enum CodingKeys: String, CodingKey { + case application + + case products + + case collections + } + + public init(application: Bool?, collections: Bool?, products: Bool?) { + self.application = application + + self.products = products + + self.collections = collections + } + + public func duplicate() -> QrFeature { + let dict = self.dictionary! + let copy = QrFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(Bool.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + products = try container.decode(Bool.self, forKey: .products) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + collections = try container.decode(Bool.self, forKey: .collections) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(products, forKey: .products) + + try? container.encodeIfPresent(collections, forKey: .collections) + } + } + + /* + Model: PcrFeature + Used By: Configuration + */ + + class PcrFeature: Codable { + public var staffSelection: Bool? + + public enum CodingKeys: String, CodingKey { + case staffSelection = "staff_selection" + } + + public init(staffSelection: Bool?) { + self.staffSelection = staffSelection + } + + public func duplicate() -> PcrFeature { + let dict = self.dictionary! + let copy = PcrFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + staffSelection = try container.decode(Bool.self, forKey: .staffSelection) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(staffSelection, forKey: .staffSelection) + } + } + + /* + Model: OrderFeature + Used By: Configuration + */ + + class OrderFeature: Codable { + public var buyAgain: Bool? + + public enum CodingKeys: String, CodingKey { + case buyAgain = "buy_again" + } + + public init(buyAgain: Bool?) { + self.buyAgain = buyAgain + } + + public func duplicate() -> OrderFeature { + let dict = self.dictionary! + let copy = OrderFeature(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + buyAgain = try container.decode(Bool.self, forKey: .buyAgain) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(buyAgain, forKey: .buyAgain) + } + } + + /* + Model: AppFeatureRequest + Used By: Configuration + */ + + class AppFeatureRequest: Codable { + public var feature: AppFeature? + + public enum CodingKeys: String, CodingKey { + case feature + } + + public init(feature: AppFeature?) { + self.feature = feature + } + + public func duplicate() -> AppFeatureRequest { + let dict = self.dictionary! + let copy = AppFeatureRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + feature = try container.decode(AppFeature.self, forKey: .feature) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(feature, forKey: .feature) + } + } + + /* + Model: AppFeatureResponse + Used By: Configuration + */ + + class AppFeatureResponse: Codable { + public var feature: AppFeature? + + public enum CodingKeys: String, CodingKey { + case feature + } + + public init(feature: AppFeature?) { + self.feature = feature + } + + public func duplicate() -> AppFeatureResponse { + let dict = self.dictionary! + let copy = AppFeatureResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + feature = try container.decode(AppFeature.self, forKey: .feature) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(feature, forKey: .feature) + } + } + + /* + Model: UnhandledError + Used By: Configuration + */ + + class UnhandledError: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> UnhandledError { + let dict = self.dictionary! + let copy = UnhandledError(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: InvalidPayloadRequest + Used By: Configuration + */ + + class InvalidPayloadRequest: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> InvalidPayloadRequest { + let dict = self.dictionary! + let copy = InvalidPayloadRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: SuccessMessageResponse + Used By: Configuration + */ + + class SuccessMessageResponse: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> SuccessMessageResponse { + let dict = self.dictionary! + let copy = SuccessMessageResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: InventoryBrandRule + Used By: Configuration + */ + + class InventoryBrandRule: Codable { + public var criteria: String? + + public var brands: [Int]? + + public enum CodingKeys: String, CodingKey { + case criteria + + case brands + } + + public init(brands: [Int]?, criteria: String?) { + self.criteria = criteria + + self.brands = brands + } + + public func duplicate() -> InventoryBrandRule { + let dict = self.dictionary! + let copy = InventoryBrandRule(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + criteria = try container.decode(String.self, forKey: .criteria) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brands = try container.decode([Int].self, forKey: .brands) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(criteria, forKey: .criteria) + + try? container.encodeIfPresent(brands, forKey: .brands) + } + } + + /* + Model: StoreCriteriaRule + Used By: Configuration + */ + + class StoreCriteriaRule: Codable { + public var companies: [Int]? + + public var brands: [Int]? + + public enum CodingKeys: String, CodingKey { + case companies + + case brands + } + + public init(brands: [Int]?, companies: [Int]?) { + self.companies = companies + + self.brands = brands + } + + public func duplicate() -> StoreCriteriaRule { + let dict = self.dictionary! + let copy = StoreCriteriaRule(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + companies = try container.decode([Int].self, forKey: .companies) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brands = try container.decode([Int].self, forKey: .brands) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(companies, forKey: .companies) + + try? container.encodeIfPresent(brands, forKey: .brands) + } + } + + /* + Model: InventoryStoreRule + Used By: Configuration + */ + + class InventoryStoreRule: Codable { + public var criteria: String? + + public var rules: [StoreCriteriaRule]? + + public var stores: [Int]? + + public enum CodingKeys: String, CodingKey { + case criteria + + case rules + + case stores + } + + public init(criteria: String?, rules: [StoreCriteriaRule]?, stores: [Int]?) { + self.criteria = criteria + + self.rules = rules + + self.stores = stores + } + + public func duplicate() -> InventoryStoreRule { + let dict = self.dictionary! + let copy = InventoryStoreRule(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + criteria = try container.decode(String.self, forKey: .criteria) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rules = try container.decode([StoreCriteriaRule].self, forKey: .rules) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stores = try container.decode([Int].self, forKey: .stores) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(criteria, forKey: .criteria) + + try? container.encodeIfPresent(rules, forKey: .rules) + + try? container.encodeIfPresent(stores, forKey: .stores) + } + } + + /* + Model: InventoryPaymentConfig + Used By: Configuration + */ + + class InventoryPaymentConfig: Codable { + public var modeOfPayment: String? + + public var source: String? + + public enum CodingKeys: String, CodingKey { + case modeOfPayment = "mode_of_payment" + + case source + } + + public init(modeOfPayment: String?, source: String?) { + self.modeOfPayment = modeOfPayment + + self.source = source + } + + public func duplicate() -> InventoryPaymentConfig { + let dict = self.dictionary! + let copy = InventoryPaymentConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + modeOfPayment = try container.decode(String.self, forKey: .modeOfPayment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + source = try container.decode(String.self, forKey: .source) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(modeOfPayment, forKey: .modeOfPayment) + + try? container.encodeIfPresent(source, forKey: .source) + } + } + + /* + Model: StorePriorityRule + Used By: Configuration + */ + + class StorePriorityRule: Codable { + public var enabled: Bool? + + public var storetypeOrder: [String]? + + public enum CodingKeys: String, CodingKey { + case enabled + + case storetypeOrder = "storetype_order" + } + + public init(enabled: Bool?, storetypeOrder: [String]?) { + self.enabled = enabled + + self.storetypeOrder = storetypeOrder + } + + public func duplicate() -> StorePriorityRule { + let dict = self.dictionary! + let copy = StorePriorityRule(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storetypeOrder = try container.decode([String].self, forKey: .storetypeOrder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(storetypeOrder, forKey: .storetypeOrder) + } + } + + /* + Model: ArticleAssignmentRule + Used By: Configuration + */ + + class ArticleAssignmentRule: Codable { + public var storePriority: StorePriorityRule? + + public enum CodingKeys: String, CodingKey { + case storePriority = "store_priority" + } + + public init(storePriority: StorePriorityRule?) { + self.storePriority = storePriority + } + + public func duplicate() -> ArticleAssignmentRule { + let dict = self.dictionary! + let copy = ArticleAssignmentRule(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + storePriority = try container.decode(StorePriorityRule.self, forKey: .storePriority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(storePriority, forKey: .storePriority) + } + } + + /* + Model: InventoryArticleAssignment + Used By: Configuration + */ + + class InventoryArticleAssignment: Codable { + public var postOrderReassignment: Bool? + + public var rules: ArticleAssignmentRule? + + public enum CodingKeys: String, CodingKey { + case postOrderReassignment = "post_order_reassignment" + + case rules + } + + public init(postOrderReassignment: Bool?, rules: ArticleAssignmentRule?) { + self.postOrderReassignment = postOrderReassignment + + self.rules = rules + } + + public func duplicate() -> InventoryArticleAssignment { + let dict = self.dictionary! + let copy = InventoryArticleAssignment(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + postOrderReassignment = try container.decode(Bool.self, forKey: .postOrderReassignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rules = try container.decode(ArticleAssignmentRule.self, forKey: .rules) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(postOrderReassignment, forKey: .postOrderReassignment) + + try? container.encodeIfPresent(rules, forKey: .rules) + } + } + + /* + Model: CompanyAboutAddress + Used By: Configuration + */ + + class CompanyAboutAddress: Codable { + public var pincode: Int? + + public var address1: String? + + public var address2: String? + + public var city: String? + + public var state: String? + + public var country: String? + + public var addressType: String? + + public enum CodingKeys: String, CodingKey { + case pincode + + case address1 + + case address2 + + case city + + case state + + case country + + case addressType = "address_type" + } + + public init(address1: String?, address2: String?, addressType: String?, city: String?, country: String?, pincode: Int?, state: String?) { + self.pincode = pincode + + self.address1 = address1 + + self.address2 = address2 + + self.city = city + + self.state = state + + self.country = country + + self.addressType = addressType + } + + public func duplicate() -> CompanyAboutAddress { + let dict = self.dictionary! + let copy = CompanyAboutAddress(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + pincode = try container.decode(Int.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address1 = try container.decode(String.self, forKey: .address1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address2 = try container.decode(String.self, forKey: .address2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressType = try container.decode(String.self, forKey: .addressType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(address1, forKey: .address1) + + try? container.encodeIfPresent(address2, forKey: .address2) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(addressType, forKey: .addressType) + } + } + + /* + Model: UserEmail + Used By: Configuration + */ + + class UserEmail: Codable { + public var active: Bool? + + public var primary: Bool? + + public var verified: Bool? + + public var email: String? + + public enum CodingKeys: String, CodingKey { + case active + + case primary + + case verified + + case email + } + + public init(active: Bool?, email: String?, primary: Bool?, verified: Bool?) { + self.active = active + + self.primary = primary + + self.verified = verified + + self.email = email + } + + public func duplicate() -> UserEmail { + let dict = self.dictionary! + let copy = UserEmail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + primary = try container.decode(Bool.self, forKey: .primary) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verified = try container.decode(Bool.self, forKey: .verified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(primary, forKey: .primary) + + try? container.encodeIfPresent(verified, forKey: .verified) + + try? container.encodeIfPresent(email, forKey: .email) + } + } + + /* + Model: UserPhoneNumber + Used By: Configuration + */ + + class UserPhoneNumber: Codable { + public var active: Bool? + + public var primary: Bool? + + public var verified: Bool? + + public var countryCode: Int? + + public var phone: String? + + public enum CodingKeys: String, CodingKey { + case active + + case primary + + case verified + + case countryCode = "country_code" + + case phone + } + + public init(active: Bool?, countryCode: Int?, phone: String?, primary: Bool?, verified: Bool?) { + self.active = active + + self.primary = primary + + self.verified = verified + + self.countryCode = countryCode + + self.phone = phone + } + + public func duplicate() -> UserPhoneNumber { + let dict = self.dictionary! + let copy = UserPhoneNumber(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + primary = try container.decode(Bool.self, forKey: .primary) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verified = try container.decode(Bool.self, forKey: .verified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(Int.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(primary, forKey: .primary) + + try? container.encodeIfPresent(verified, forKey: .verified) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(phone, forKey: .phone) + } + } + + /* + Model: ApplicationInformation + Used By: Configuration + */ + + class ApplicationInformation: Codable { + public var address: InformationAddress? + + public var support: InformationSupport? + + public var socialLinks: SocialLinks? + + public var links: Links? + + public var copyrightText: String? + + public var id: String? + + public var businessHighlights: BusinessHighlights? + + public var application: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case address + + case support + + case socialLinks = "social_links" + + case links + + case copyrightText = "copyright_text" + + case id = "_id" + + case businessHighlights = "business_highlights" + + case application + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + } + + public init(address: InformationAddress?, application: String?, businessHighlights: BusinessHighlights?, copyrightText: String?, createdAt: String?, links: Links?, socialLinks: SocialLinks?, support: InformationSupport?, updatedAt: String?, id: String?, v: Int?) { + self.address = address + + self.support = support + + self.socialLinks = socialLinks + + self.links = links + + self.copyrightText = copyrightText + + self.id = id + + self.businessHighlights = businessHighlights + + self.application = application + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + } + + public func duplicate() -> ApplicationInformation { + let dict = self.dictionary! + let copy = ApplicationInformation(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + address = try container.decode(InformationAddress.self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + support = try container.decode(InformationSupport.self, forKey: .support) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + socialLinks = try container.decode(SocialLinks.self, forKey: .socialLinks) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + links = try container.decode(Links.self, forKey: .links) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + copyrightText = try container.decode(String.self, forKey: .copyrightText) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + businessHighlights = try container.decode(BusinessHighlights.self, forKey: .businessHighlights) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(support, forKey: .support) + + try? container.encodeIfPresent(socialLinks, forKey: .socialLinks) + + try? container.encodeIfPresent(links, forKey: .links) + + try? container.encodeIfPresent(copyrightText, forKey: .copyrightText) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(businessHighlights, forKey: .businessHighlights) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: InformationAddress + Used By: Configuration + */ + + class InformationAddress: Codable { + public var loc: String? + + public var addressLine: [String]? + + public var phone: InformationPhone? + + public var city: String? + + public var country: String? + + public var pincode: Int? + + public enum CodingKeys: String, CodingKey { + case loc + + case addressLine = "address_line" + + case phone + + case city + + case country + + case pincode + } + + public init(addressLine: [String]?, city: String?, country: String?, loc: String?, phone: InformationPhone?, pincode: Int?) { + self.loc = loc + + self.addressLine = addressLine + + self.phone = phone + + self.city = city + + self.country = country + + self.pincode = pincode + } + + public func duplicate() -> InformationAddress { + let dict = self.dictionary! + let copy = InformationAddress(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + loc = try container.decode(String.self, forKey: .loc) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressLine = try container.decode([String].self, forKey: .addressLine) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(InformationPhone.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(Int.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(loc, forKey: .loc) + + try? container.encodeIfPresent(addressLine, forKey: .addressLine) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + } + } + + /* + Model: InformationPhone + Used By: Configuration + */ + + class InformationPhone: Codable { + public var code: String? + + public var number: String? + + public enum CodingKeys: String, CodingKey { + case code + + case number + } + + public init(code: String?, number: String?) { + self.code = code + + self.number = number + } + + public func duplicate() -> InformationPhone { + let dict = self.dictionary! + let copy = InformationPhone(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + number = try container.decode(String.self, forKey: .number) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(number, forKey: .number) + } + } + + /* + Model: InformationSupport + Used By: Configuration + */ + + class InformationSupport: Codable { + public var phone: [String]? + + public var email: [String]? + + public var timing: String? + + public enum CodingKeys: String, CodingKey { + case phone + + case email + + case timing + } + + public init(email: [String]?, phone: [String]?, timing: String?) { + self.phone = phone + + self.email = email + + self.timing = timing + } + + public func duplicate() -> InformationSupport { + let dict = self.dictionary! + let copy = InformationSupport(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + phone = try container.decode([String].self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode([String].self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + timing = try container.decode(String.self, forKey: .timing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(timing, forKey: .timing) + } + } + + /* + Model: SocialLinks + Used By: Configuration + */ + + class SocialLinks: Codable { + public var facebook: FacebookLink? + + public var instagram: InstagramLink? + + public var twitter: TwitterLink? + + public var pinterest: PinterestLink? + + public var googlePlus: GooglePlusLink? + + public var youtube: YoutubeLink? + + public var linkedIn: LinkedInLink? + + public var vimeo: VimeoLink? + + public var blogLink: BlogLink? + + public enum CodingKeys: String, CodingKey { + case facebook + + case instagram + + case twitter + + case pinterest + + case googlePlus = "google_plus" + + case youtube + + case linkedIn = "linked_in" + + case vimeo + + case blogLink = "blog_link" + } + + public init(blogLink: BlogLink?, facebook: FacebookLink?, googlePlus: GooglePlusLink?, instagram: InstagramLink?, linkedIn: LinkedInLink?, pinterest: PinterestLink?, twitter: TwitterLink?, vimeo: VimeoLink?, youtube: YoutubeLink?) { + self.facebook = facebook + + self.instagram = instagram + + self.twitter = twitter + + self.pinterest = pinterest + + self.googlePlus = googlePlus + + self.youtube = youtube + + self.linkedIn = linkedIn + + self.vimeo = vimeo + + self.blogLink = blogLink + } + + public func duplicate() -> SocialLinks { + let dict = self.dictionary! + let copy = SocialLinks(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + facebook = try container.decode(FacebookLink.self, forKey: .facebook) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + instagram = try container.decode(InstagramLink.self, forKey: .instagram) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + twitter = try container.decode(TwitterLink.self, forKey: .twitter) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pinterest = try container.decode(PinterestLink.self, forKey: .pinterest) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + googlePlus = try container.decode(GooglePlusLink.self, forKey: .googlePlus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + youtube = try container.decode(YoutubeLink.self, forKey: .youtube) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + linkedIn = try container.decode(LinkedInLink.self, forKey: .linkedIn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + vimeo = try container.decode(VimeoLink.self, forKey: .vimeo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + blogLink = try container.decode(BlogLink.self, forKey: .blogLink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(facebook, forKey: .facebook) + + try? container.encodeIfPresent(instagram, forKey: .instagram) + + try? container.encodeIfPresent(twitter, forKey: .twitter) + + try? container.encodeIfPresent(pinterest, forKey: .pinterest) + + try? container.encodeIfPresent(googlePlus, forKey: .googlePlus) + + try? container.encodeIfPresent(youtube, forKey: .youtube) + + try? container.encodeIfPresent(linkedIn, forKey: .linkedIn) + + try? container.encodeIfPresent(vimeo, forKey: .vimeo) + + try? container.encodeIfPresent(blogLink, forKey: .blogLink) + } + } + + /* + Model: FacebookLink + Used By: Configuration + */ + + class FacebookLink: Codable { + public var title: String? + + public var icon: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case icon + + case link + } + + public init(icon: String?, link: String?, title: String?) { + self.title = title + + self.icon = icon + + self.link = link + } + + public func duplicate() -> FacebookLink { + let dict = self.dictionary! + let copy = FacebookLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: InstagramLink + Used By: Configuration + */ + + class InstagramLink: Codable { + public var title: String? + + public var icon: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case icon + + case link + } + + public init(icon: String?, link: String?, title: String?) { + self.title = title + + self.icon = icon + + self.link = link + } + + public func duplicate() -> InstagramLink { + let dict = self.dictionary! + let copy = InstagramLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: TwitterLink + Used By: Configuration + */ + + class TwitterLink: Codable { + public var title: String? + + public var icon: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case icon + + case link + } + + public init(icon: String?, link: String?, title: String?) { + self.title = title + + self.icon = icon + + self.link = link + } + + public func duplicate() -> TwitterLink { + let dict = self.dictionary! + let copy = TwitterLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: PinterestLink + Used By: Configuration + */ + + class PinterestLink: Codable { + public var title: String? + + public var icon: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case icon + + case link + } + + public init(icon: String?, link: String?, title: String?) { + self.title = title + + self.icon = icon + + self.link = link + } + + public func duplicate() -> PinterestLink { + let dict = self.dictionary! + let copy = PinterestLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: GooglePlusLink + Used By: Configuration + */ + + class GooglePlusLink: Codable { + public var title: String? + + public var icon: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case icon + + case link + } + + public init(icon: String?, link: String?, title: String?) { + self.title = title + + self.icon = icon + + self.link = link + } + + public func duplicate() -> GooglePlusLink { + let dict = self.dictionary! + let copy = GooglePlusLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: YoutubeLink + Used By: Configuration + */ + + class YoutubeLink: Codable { + public var title: String? + + public var icon: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case icon + + case link + } + + public init(icon: String?, link: String?, title: String?) { + self.title = title + + self.icon = icon + + self.link = link + } + + public func duplicate() -> YoutubeLink { + let dict = self.dictionary! + let copy = YoutubeLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: LinkedInLink + Used By: Configuration + */ + + class LinkedInLink: Codable { + public var title: String? + + public var icon: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case icon + + case link + } + + public init(icon: String?, link: String?, title: String?) { + self.title = title + + self.icon = icon + + self.link = link + } + + public func duplicate() -> LinkedInLink { + let dict = self.dictionary! + let copy = LinkedInLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: VimeoLink + Used By: Configuration + */ + + class VimeoLink: Codable { + public var title: String? + + public var icon: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case icon + + case link + } + + public init(icon: String?, link: String?, title: String?) { + self.title = title + + self.icon = icon + + self.link = link + } + + public func duplicate() -> VimeoLink { + let dict = self.dictionary! + let copy = VimeoLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: BlogLink + Used By: Configuration + */ + + class BlogLink: Codable { + public var title: String? + + public var icon: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case icon + + case link + } + + public init(icon: String?, link: String?, title: String?) { + self.title = title + + self.icon = icon + + self.link = link + } + + public func duplicate() -> BlogLink { + let dict = self.dictionary! + let copy = BlogLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: Links + Used By: Configuration + */ + + class Links: Codable { + public var title: String? + + public var link: String? + + public enum CodingKeys: String, CodingKey { + case title + + case link + } + + public init(link: String?, title: String?) { + self.title = title + + self.link = link + } + + public func duplicate() -> Links { + let dict = self.dictionary! + let copy = Links(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: BusinessHighlights + Used By: Configuration + */ + + class BusinessHighlights: Codable { + public var id: String? + + public var title: String? + + public var icon: String? + + public var subTitle: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case title + + case icon + + case subTitle = "sub_title" + } + + public init(icon: String?, subTitle: String?, title: String?, id: String?) { + self.id = id + + self.title = title + + self.icon = icon + + self.subTitle = subTitle + } + + public func duplicate() -> BusinessHighlights { + let dict = self.dictionary! + let copy = BusinessHighlights(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(String.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subTitle = try container.decode(String.self, forKey: .subTitle) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(subTitle, forKey: .subTitle) + } + } + + /* + Model: ApplicationDetail + Used By: Configuration + */ + + class ApplicationDetail: Codable { + public var name: String + + public var description: String + + public var logo: SecureUrl + + public var mobileLogo: SecureUrl + + public var favicon: SecureUrl + + public var banner: SecureUrl + + public var domain: Domain? + + public var domains: [Domain]? + + public var id: String? + + public enum CodingKeys: String, CodingKey { + case name + + case description + + case logo + + case mobileLogo = "mobile_logo" + + case favicon + + case banner + + case domain + + case domains + + case id = "_id" + } + + public init(banner: SecureUrl, description: String, domain: Domain?, domains: [Domain]?, favicon: SecureUrl, logo: SecureUrl, mobileLogo: SecureUrl, name: String, id: String?) { + self.name = name + + self.description = description + + self.logo = logo + + self.mobileLogo = mobileLogo + + self.favicon = favicon + + self.banner = banner + + self.domain = domain + + self.domains = domains + + self.id = id + } + + public func duplicate() -> ApplicationDetail { + let dict = self.dictionary! + let copy = ApplicationDetail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + name = try container.decode(String.self, forKey: .name) + + description = try container.decode(String.self, forKey: .description) + + logo = try container.decode(SecureUrl.self, forKey: .logo) + + mobileLogo = try container.decode(SecureUrl.self, forKey: .mobileLogo) + + favicon = try container.decode(SecureUrl.self, forKey: .favicon) + + banner = try container.decode(SecureUrl.self, forKey: .banner) + + do { + domain = try container.decode(Domain.self, forKey: .domain) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + domains = try container.decode([Domain].self, forKey: .domains) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(mobileLogo, forKey: .mobileLogo) + + try? container.encodeIfPresent(favicon, forKey: .favicon) + + try? container.encodeIfPresent(banner, forKey: .banner) + + try? container.encodeIfPresent(domain, forKey: .domain) + + try? container.encodeIfPresent(domains, forKey: .domains) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: CurrenciesResponse + Used By: Configuration + */ + + class CurrenciesResponse: Codable { + public var items: [Currency]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [Currency]?) { + self.items = items + } + + public func duplicate() -> CurrenciesResponse { + let dict = self.dictionary! + let copy = CurrenciesResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Currency].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: AppCurrencyResponse + Used By: Configuration + */ + + class AppCurrencyResponse: Codable { + public var application: String? + + public var defaultCurrency: DefaultCurrency? + + public var supportedCurrency: [Currency]? + + public enum CodingKeys: String, CodingKey { + case application + + case defaultCurrency = "default_currency" + + case supportedCurrency = "supported_currency" + } + + public init(application: String?, defaultCurrency: DefaultCurrency?, supportedCurrency: [Currency]?) { + self.application = application + + self.defaultCurrency = defaultCurrency + + self.supportedCurrency = supportedCurrency + } + + public func duplicate() -> AppCurrencyResponse { + let dict = self.dictionary! + let copy = AppCurrencyResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + defaultCurrency = try container.decode(DefaultCurrency.self, forKey: .defaultCurrency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + supportedCurrency = try container.decode([Currency].self, forKey: .supportedCurrency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(defaultCurrency, forKey: .defaultCurrency) + + try? container.encodeIfPresent(supportedCurrency, forKey: .supportedCurrency) + } + } + + /* + Model: StoreLatLong + Used By: Configuration + */ + + class StoreLatLong: Codable { + public var type: String? + + public var coordinates: [Double]? + + public enum CodingKeys: String, CodingKey { + case type + + case coordinates + } + + public init(coordinates: [Double]?, type: String?) { + self.type = type + + self.coordinates = coordinates + } + + public func duplicate() -> StoreLatLong { + let dict = self.dictionary! + let copy = StoreLatLong(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + coordinates = try container.decode([Double].self, forKey: .coordinates) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(coordinates, forKey: .coordinates) + } + } + + /* + Model: OptedStoreAddress + Used By: Configuration + */ + + class OptedStoreAddress: Codable { + public var state: String? + + public var address1: String? + + public var latLong: StoreLatLong? + + public var address2: String? + + public var pincode: Int? + + public var country: String? + + public var city: String? + + public enum CodingKeys: String, CodingKey { + case state + + case address1 + + case latLong = "lat_long" + + case address2 + + case pincode + + case country + + case city + } + + public init(address1: String?, address2: String?, city: String?, country: String?, latLong: StoreLatLong?, pincode: Int?, state: String?) { + self.state = state + + self.address1 = address1 + + self.latLong = latLong + + self.address2 = address2 + + self.pincode = pincode + + self.country = country + + self.city = city + } + + public func duplicate() -> OptedStoreAddress { + let dict = self.dictionary! + let copy = OptedStoreAddress(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address1 = try container.decode(String.self, forKey: .address1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + latLong = try container.decode(StoreLatLong.self, forKey: .latLong) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address2 = try container.decode(String.self, forKey: .address2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(Int.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(address1, forKey: .address1) + + try? container.encodeIfPresent(latLong, forKey: .latLong) + + try? container.encodeIfPresent(address2, forKey: .address2) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(city, forKey: .city) + } + } + + /* + Model: OrderingStore + Used By: Configuration + */ + + class OrderingStore: Codable { + public var address: OptedStoreAddress? + + public var id: String? + + public var uid: Int? + + public var name: String? + + public var displayName: String? + + public var storeType: String? + + public var storeCode: String? + + public var pincode: Int? + + public var code: String? + + public enum CodingKeys: String, CodingKey { + case address + + case id = "_id" + + case uid + + case name + + case displayName = "display_name" + + case storeType = "store_type" + + case storeCode = "store_code" + + case pincode + + case code + } + + public init(address: OptedStoreAddress?, code: String?, displayName: String?, name: String?, pincode: Int?, storeCode: String?, storeType: String?, uid: Int?, id: String?) { + self.address = address + + self.id = id + + self.uid = uid + + self.name = name + + self.displayName = displayName + + self.storeType = storeType + + self.storeCode = storeCode + + self.pincode = pincode + + self.code = code + } + + public func duplicate() -> OrderingStore { + let dict = self.dictionary! + let copy = OrderingStore(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + address = try container.decode(OptedStoreAddress.self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeType = try container.decode(String.self, forKey: .storeType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeCode = try container.decode(String.self, forKey: .storeCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(Int.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(storeType, forKey: .storeType) + + try? container.encodeIfPresent(storeCode, forKey: .storeCode) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: OrderingStores + Used By: Configuration + */ + + class OrderingStores: Codable { + public var page: Page? + + public var items: [OrderingStore]? + + public var deployedStores: [Int]? + + public var allStores: Bool? + + public var enabled: Bool? + + public var type: String? + + public var id: String? + + public var app: String? + + public var v: Int? + + public enum CodingKeys: String, CodingKey { + case page + + case items + + case deployedStores = "deployed_stores" + + case allStores = "all_stores" + + case enabled + + case type + + case id = "_id" + + case app + + case v = "__v" + } + + public init(allStores: Bool?, app: String?, deployedStores: [Int]?, enabled: Bool?, items: [OrderingStore]?, page: Page?, type: String?, id: String?, v: Int?) { + self.page = page + + self.items = items + + self.deployedStores = deployedStores + + self.allStores = allStores + + self.enabled = enabled + + self.type = type + + self.id = id + + self.app = app + + self.v = v + } + + public func duplicate() -> OrderingStores { + let dict = self.dictionary! + let copy = OrderingStores(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([OrderingStore].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deployedStores = try container.decode([Int].self, forKey: .deployedStores) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allStores = try container.decode(Bool.self, forKey: .allStores) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + app = try container.decode(String.self, forKey: .app) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(deployedStores, forKey: .deployedStores) + + try? container.encodeIfPresent(allStores, forKey: .allStores) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(app, forKey: .app) + + try? container.encodeIfPresent(v, forKey: .v) + } + } + + /* + Model: OrderingStoresResponse + Used By: Configuration + */ + + class OrderingStoresResponse: Codable { + public var page: Page? + + public var items: [OrderingStore]? + + public enum CodingKeys: String, CodingKey { + case page + + case items + } + + public init(items: [OrderingStore]?, page: Page?) { + self.page = page + + self.items = items + } + + public func duplicate() -> OrderingStoresResponse { + let dict = self.dictionary! + let copy = OrderingStoresResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([OrderingStore].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(items, forKey: .items) + } + } +} diff --git a/Sources/code/platform/models/ContentPlatformModelClass.swift b/Sources/code/platform/models/ContentPlatformModelClass.swift new file mode 100644 index 0000000000..51ca1b7bdb --- /dev/null +++ b/Sources/code/platform/models/ContentPlatformModelClass.swift @@ -0,0 +1,8873 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: ApplicationLegal + Used By: Content + */ + + class ApplicationLegal: Codable { + public var application: String? + + public var tnc: String? + + public var policy: String? + + public var shipping: String? + + public var faq: [ApplicationLegalFAQ]? + + public var id: String? + + public var updatedAt: String? + + public var createdAt: String? + + public enum CodingKeys: String, CodingKey { + case application + + case tnc + + case policy + + case shipping + + case faq + + case id = "_id" + + case updatedAt = "updated_at" + + case createdAt = "created_at" + } + + public init(application: String?, createdAt: String?, faq: [ApplicationLegalFAQ]?, policy: String?, shipping: String?, tnc: String?, updatedAt: String?, id: String?) { + self.application = application + + self.tnc = tnc + + self.policy = policy + + self.shipping = shipping + + self.faq = faq + + self.id = id + + self.updatedAt = updatedAt + + self.createdAt = createdAt + } + + public func duplicate() -> ApplicationLegal { + let dict = self.dictionary! + let copy = ApplicationLegal(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tnc = try container.decode(String.self, forKey: .tnc) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + policy = try container.decode(String.self, forKey: .policy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shipping = try container.decode(String.self, forKey: .shipping) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + faq = try container.decode([ApplicationLegalFAQ].self, forKey: .faq) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(tnc, forKey: .tnc) + + try? container.encodeIfPresent(policy, forKey: .policy) + + try? container.encodeIfPresent(shipping, forKey: .shipping) + + try? container.encodeIfPresent(faq, forKey: .faq) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + } + } + + /* + Model: ApplicationLegalFAQ + Used By: Content + */ + + class ApplicationLegalFAQ: Codable { + public var question: String? + + public var answer: String? + + public enum CodingKeys: String, CodingKey { + case question + + case answer + } + + public init(answer: String?, question: String?) { + self.question = question + + self.answer = answer + } + + public func duplicate() -> ApplicationLegalFAQ { + let dict = self.dictionary! + let copy = ApplicationLegalFAQ(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + question = try container.decode(String.self, forKey: .question) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + answer = try container.decode(String.self, forKey: .answer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(question, forKey: .question) + + try? container.encodeIfPresent(answer, forKey: .answer) + } + } + + /* + Model: PathMappingSchema + Used By: Content + */ + + class PathMappingSchema: Codable { + public var application: String? + + public var redirections: [RedirectionSchema]? + + public var id: String? + + public var updatedAt: String? + + public var createdAt: String? + + public enum CodingKeys: String, CodingKey { + case application + + case redirections + + case id = "_id" + + case updatedAt = "updated_at" + + case createdAt = "created_at" + } + + public init(application: String?, createdAt: String?, redirections: [RedirectionSchema]?, updatedAt: String?, id: String?) { + self.application = application + + self.redirections = redirections + + self.id = id + + self.updatedAt = updatedAt + + self.createdAt = createdAt + } + + public func duplicate() -> PathMappingSchema { + let dict = self.dictionary! + let copy = PathMappingSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + redirections = try container.decode([RedirectionSchema].self, forKey: .redirections) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(redirections, forKey: .redirections) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + } + } + + /* + Model: RedirectionSchema + Used By: Content + */ + + class RedirectionSchema: Codable { + public var redirectFrom: String? + + public var redirectTo: String? + + public enum CodingKeys: String, CodingKey { + case redirectFrom = "redirect_from" + + case redirectTo = "redirect_to" + } + + public init(redirectFrom: String?, redirectTo: String?) { + self.redirectFrom = redirectFrom + + self.redirectTo = redirectTo + } + + public func duplicate() -> RedirectionSchema { + let dict = self.dictionary! + let copy = RedirectionSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + redirectFrom = try container.decode(String.self, forKey: .redirectFrom) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + redirectTo = try container.decode(String.self, forKey: .redirectTo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(redirectFrom, forKey: .redirectFrom) + + try? container.encodeIfPresent(redirectTo, forKey: .redirectTo) + } + } + + /* + Model: SeoComponent + Used By: Content + */ + + class SeoComponent: Codable { + public var seo: SeoSchema? + + public enum CodingKeys: String, CodingKey { + case seo + } + + public init(seo: SeoSchema?) { + self.seo = seo + } + + public func duplicate() -> SeoComponent { + let dict = self.dictionary! + let copy = SeoComponent(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + seo = try container.decode(SeoSchema.self, forKey: .seo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(seo, forKey: .seo) + } + } + + /* + Model: SeoSchema + Used By: Content + */ + + class SeoSchema: Codable { + public var app: String? + + public var id: String? + + public var robotsTxt: String? + + public var sitemapEnabled: Bool? + + public var customMetaTags: [CustomMetaTag]? + + public var details: Detail? + + public var createdAt: String? + + public var updatedAt: String? + + public enum CodingKeys: String, CodingKey { + case app + + case id = "_id" + + case robotsTxt = "robots_txt" + + case sitemapEnabled = "sitemap_enabled" + + case customMetaTags = "custom_meta_tags" + + case details + + case createdAt = "created_at" + + case updatedAt = "updated_at" + } + + public init(app: String?, createdAt: String?, customMetaTags: [CustomMetaTag]?, details: Detail?, robotsTxt: String?, sitemapEnabled: Bool?, updatedAt: String?, id: String?) { + self.app = app + + self.id = id + + self.robotsTxt = robotsTxt + + self.sitemapEnabled = sitemapEnabled + + self.customMetaTags = customMetaTags + + self.details = details + + self.createdAt = createdAt + + self.updatedAt = updatedAt + } + + public func duplicate() -> SeoSchema { + let dict = self.dictionary! + let copy = SeoSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + app = try container.decode(String.self, forKey: .app) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + robotsTxt = try container.decode(String.self, forKey: .robotsTxt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sitemapEnabled = try container.decode(Bool.self, forKey: .sitemapEnabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customMetaTags = try container.decode([CustomMetaTag].self, forKey: .customMetaTags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + details = try container.decode(Detail.self, forKey: .details) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(app, forKey: .app) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(robotsTxt, forKey: .robotsTxt) + + try? container.encodeIfPresent(sitemapEnabled, forKey: .sitemapEnabled) + + try? container.encodeIfPresent(customMetaTags, forKey: .customMetaTags) + + try? container.encodeIfPresent(details, forKey: .details) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + } + } + + /* + Model: CustomMetaTag + Used By: Content + */ + + class CustomMetaTag: Codable { + public var name: String? + + public var content: String? + + public var id: String? + + public enum CodingKeys: String, CodingKey { + case name + + case content + + case id = "_id" + } + + public init(content: String?, name: String?, id: String?) { + self.name = name + + self.content = content + + self.id = id + } + + public func duplicate() -> CustomMetaTag { + let dict = self.dictionary! + let copy = CustomMetaTag(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode(String.self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: Detail + Used By: Content + */ + + class Detail: Codable { + public var title: String? + + public var description: String? + + public enum CodingKeys: String, CodingKey { + case title + + case description + } + + public init(description: String?, title: String?) { + self.title = title + + self.description = description + } + + public func duplicate() -> Detail { + let dict = self.dictionary! + let copy = Detail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(description, forKey: .description) + } + } + + /* + Model: AnnouncementPageSchema + Used By: Content + */ + + class AnnouncementPageSchema: Codable { + public var pageSlug: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case pageSlug = "page_slug" + + case type + } + + public init(pageSlug: String?, type: String?) { + self.pageSlug = pageSlug + + self.type = type + } + + public func duplicate() -> AnnouncementPageSchema { + let dict = self.dictionary! + let copy = AnnouncementPageSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + pageSlug = try container.decode(String.self, forKey: .pageSlug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pageSlug, forKey: .pageSlug) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: EditorMeta + Used By: Content + */ + + class EditorMeta: Codable { + public var foregroundColor: String? + + public var backgroundColor: String? + + public var contentType: String? + + public var content: String? + + public enum CodingKeys: String, CodingKey { + case foregroundColor = "foreground_color" + + case backgroundColor = "background_color" + + case contentType = "content_type" + + case content + } + + public init(backgroundColor: String?, content: String?, contentType: String?, foregroundColor: String?) { + self.foregroundColor = foregroundColor + + self.backgroundColor = backgroundColor + + self.contentType = contentType + + self.content = content + } + + public func duplicate() -> EditorMeta { + let dict = self.dictionary! + let copy = EditorMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + foregroundColor = try container.decode(String.self, forKey: .foregroundColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + backgroundColor = try container.decode(String.self, forKey: .backgroundColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contentType = try container.decode(String.self, forKey: .contentType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode(String.self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(foregroundColor, forKey: .foregroundColor) + + try? container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) + + try? container.encodeIfPresent(contentType, forKey: .contentType) + + try? container.encodeIfPresent(content, forKey: .content) + } + } + + /* + Model: AnnouncementAuthorSchema + Used By: Content + */ + + class AnnouncementAuthorSchema: Codable { + public var createdBy: String? + + public var modifiedBy: String? + + public enum CodingKeys: String, CodingKey { + case createdBy = "created_by" + + case modifiedBy = "modified_by" + } + + public init(createdBy: String?, modifiedBy: String?) { + self.createdBy = createdBy + + self.modifiedBy = modifiedBy + } + + public func duplicate() -> AnnouncementAuthorSchema { + let dict = self.dictionary! + let copy = AnnouncementAuthorSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + createdBy = try container.decode(String.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode(String.self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + } + } + + /* + Model: AdminAnnouncementSchema + Used By: Content + */ + + class AdminAnnouncementSchema: Codable { + public var id: String? + + public var platforms: [String]? + + public var title: String? + + public var announcement: String? + + public var pages: [AnnouncementPageSchema]? + + public var editorMeta: EditorMeta? + + public var author: AnnouncementAuthorSchema? + + public var createdAt: String? + + public var app: String? + + public var modifiedAt: String? + + public var schedule: ScheduleSchema? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case platforms + + case title + + case announcement + + case pages + + case editorMeta = "editor_meta" + + case author + + case createdAt = "created_at" + + case app + + case modifiedAt = "modified_at" + + case schedule = "_schedule" + } + + public init(announcement: String?, app: String?, author: AnnouncementAuthorSchema?, createdAt: String?, editorMeta: EditorMeta?, modifiedAt: String?, pages: [AnnouncementPageSchema]?, platforms: [String]?, title: String?, id: String?, schedule: ScheduleSchema?) { + self.id = id + + self.platforms = platforms + + self.title = title + + self.announcement = announcement + + self.pages = pages + + self.editorMeta = editorMeta + + self.author = author + + self.createdAt = createdAt + + self.app = app + + self.modifiedAt = modifiedAt + + self.schedule = schedule + } + + public func duplicate() -> AdminAnnouncementSchema { + let dict = self.dictionary! + let copy = AdminAnnouncementSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platforms = try container.decode([String].self, forKey: .platforms) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + announcement = try container.decode(String.self, forKey: .announcement) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pages = try container.decode([AnnouncementPageSchema].self, forKey: .pages) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + editorMeta = try container.decode(EditorMeta.self, forKey: .editorMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + author = try container.decode(AnnouncementAuthorSchema.self, forKey: .author) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + app = try container.decode(String.self, forKey: .app) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedAt = try container.decode(String.self, forKey: .modifiedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode(ScheduleSchema.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(platforms, forKey: .platforms) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(announcement, forKey: .announcement) + + try? container.encodeIfPresent(pages, forKey: .pages) + + try? container.encodeIfPresent(editorMeta, forKey: .editorMeta) + + try? container.encodeIfPresent(author, forKey: .author) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(app, forKey: .app) + + try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + } + } + + /* + Model: ScheduleSchema + Used By: Content + */ + + class ScheduleSchema: Codable { + public var cron: String? + + public var start: String? + + public var end: String? + + public var duration: Double? + + public var nextSchedule: [NextSchedule]? + + public enum CodingKeys: String, CodingKey { + case cron + + case start + + case end + + case duration + + case nextSchedule = "next_schedule" + } + + public init(cron: String?, duration: Double?, end: String?, nextSchedule: [NextSchedule]?, start: String?) { + self.cron = cron + + self.start = start + + self.end = end + + self.duration = duration + + self.nextSchedule = nextSchedule + } + + public func duplicate() -> ScheduleSchema { + let dict = self.dictionary! + let copy = ScheduleSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + cron = try container.decode(String.self, forKey: .cron) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + start = try container.decode(String.self, forKey: .start) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + end = try container.decode(String.self, forKey: .end) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + duration = try container.decode(Double.self, forKey: .duration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + nextSchedule = try container.decode([NextSchedule].self, forKey: .nextSchedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(cron, forKey: .cron) + + try? container.encodeIfPresent(start, forKey: .start) + + try? container.encodeIfPresent(end, forKey: .end) + + try? container.encodeIfPresent(duration, forKey: .duration) + + try? container.encodeIfPresent(nextSchedule, forKey: .nextSchedule) + } + } + + /* + Model: NextSchedule + Used By: Content + */ + + class NextSchedule: Codable { + public var start: String? + + public var end: String? + + public enum CodingKeys: String, CodingKey { + case start + + case end + } + + public init(end: String?, start: String?) { + self.start = start + + self.end = end + } + + public func duplicate() -> NextSchedule { + let dict = self.dictionary! + let copy = NextSchedule(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + start = try container.decode(String.self, forKey: .start) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + end = try container.decode(String.self, forKey: .end) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(start, forKey: .start) + + try? container.encodeIfPresent(end, forKey: .end) + } + } + + /* + Model: AnnouncementSchema + Used By: Content + */ + + class AnnouncementSchema: Codable { + public var announcement: String? + + public var schedule: ScheduleStartSchema? + + public enum CodingKeys: String, CodingKey { + case announcement + + case schedule + } + + public init(announcement: String?, schedule: ScheduleStartSchema?) { + self.announcement = announcement + + self.schedule = schedule + } + + public func duplicate() -> AnnouncementSchema { + let dict = self.dictionary! + let copy = AnnouncementSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + announcement = try container.decode(String.self, forKey: .announcement) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode(ScheduleStartSchema.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(announcement, forKey: .announcement) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + } + } + + /* + Model: ScheduleStartSchema + Used By: Content + */ + + class ScheduleStartSchema: Codable { + public var start: String? + + public var end: String? + + public enum CodingKeys: String, CodingKey { + case start + + case end + } + + public init(end: String?, start: String?) { + self.start = start + + self.end = end + } + + public func duplicate() -> ScheduleStartSchema { + let dict = self.dictionary! + let copy = ScheduleStartSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + start = try container.decode(String.self, forKey: .start) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + end = try container.decode(String.self, forKey: .end) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(start, forKey: .start) + + try? container.encodeIfPresent(end, forKey: .end) + } + } + + /* + Model: BlogGetResponse + Used By: Content + */ + + class BlogGetResponse: Codable { + public var items: [BlogSchema]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [BlogSchema]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> BlogGetResponse { + let dict = self.dictionary! + let copy = BlogGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([BlogSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: ResourceContent + Used By: Content + */ + + class ResourceContent: Codable { + public var type: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case type + + case value + } + + public init(type: String?, value: String?) { + self.type = type + + self.value = value + } + + public func duplicate() -> ResourceContent { + let dict = self.dictionary! + let copy = ResourceContent(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: Asset + Used By: Content + */ + + class Asset: Codable { + public var aspectRatio: String? + + public var id: String? + + public var secureUrl: String? + + public enum CodingKeys: String, CodingKey { + case aspectRatio = "aspect_ratio" + + case id + + case secureUrl = "secure_url" + } + + public init(aspectRatio: String?, id: String?, secureUrl: String?) { + self.aspectRatio = aspectRatio + + self.id = id + + self.secureUrl = secureUrl + } + + public func duplicate() -> Asset { + let dict = self.dictionary! + let copy = Asset(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + aspectRatio = try container.decode(String.self, forKey: .aspectRatio) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + secureUrl = try container.decode(String.self, forKey: .secureUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) + } + } + + /* + Model: Author + Used By: Content + */ + + class Author: Codable { + public var designation: String? + + public var id: String? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case designation + + case id + + case name + } + + public init(designation: String?, id: String?, name: String?) { + self.designation = designation + + self.id = id + + self.name = name + } + + public func duplicate() -> Author { + let dict = self.dictionary! + let copy = Author(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + designation = try container.decode(String.self, forKey: .designation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(designation, forKey: .designation) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: BlogSchema + Used By: Content + */ + + class BlogSchema: Codable { + public var id: String? + + public var customJson: [String: Any]? + + public var application: String? + + public var archived: Bool? + + public var author: Author? + + public var content: [ResourceContent]? + + public var featureImage: Asset? + + public var published: Bool? + + public var readingTime: String? + + public var slug: String? + + public var tags: [String]? + + public var seo: SEO? + + public var schedule: CronSchedule? + + public var title: String? + + public var dateMeta: DateMeta? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case customJson = "_custom_json" + + case application + + case archived + + case author + + case content + + case featureImage = "feature_image" + + case published + + case readingTime = "reading_time" + + case slug + + case tags + + case seo + + case schedule = "_schedule" + + case title + + case dateMeta = "date_meta" + } + + public init(application: String?, archived: Bool?, author: Author?, content: [ResourceContent]?, dateMeta: DateMeta?, featureImage: Asset?, published: Bool?, readingTime: String?, seo: SEO?, slug: String?, tags: [String]?, title: String?, customJson: [String: Any]?, id: String?, schedule: CronSchedule?) { + self.id = id + + self.customJson = customJson + + self.application = application + + self.archived = archived + + self.author = author + + self.content = content + + self.featureImage = featureImage + + self.published = published + + self.readingTime = readingTime + + self.slug = slug + + self.tags = tags + + self.seo = seo + + self.schedule = schedule + + self.title = title + + self.dateMeta = dateMeta + } + + public func duplicate() -> BlogSchema { + let dict = self.dictionary! + let copy = BlogSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archived = try container.decode(Bool.self, forKey: .archived) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + author = try container.decode(Author.self, forKey: .author) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode([ResourceContent].self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + featureImage = try container.decode(Asset.self, forKey: .featureImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + readingTime = try container.decode(String.self, forKey: .readingTime) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + seo = try container.decode(SEO.self, forKey: .seo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode(CronSchedule.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(archived, forKey: .archived) + + try? container.encodeIfPresent(author, forKey: .author) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(featureImage, forKey: .featureImage) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(readingTime, forKey: .readingTime) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(seo, forKey: .seo) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + } + } + + /* + Model: SEO + Used By: Content + */ + + class SEO: Codable { + public var description: String? + + public var image: SEOImage? + + public var title: String? + + public enum CodingKeys: String, CodingKey { + case description + + case image + + case title + } + + public init(description: String?, image: SEOImage?, title: String?) { + self.description = description + + self.image = image + + self.title = title + } + + public func duplicate() -> SEO { + let dict = self.dictionary! + let copy = SEO(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + image = try container.decode(SEOImage.self, forKey: .image) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(image, forKey: .image) + + try? container.encodeIfPresent(title, forKey: .title) + } + } + + /* + Model: SEOImage + Used By: Content + */ + + class SEOImage: Codable { + public var url: String? + + public enum CodingKeys: String, CodingKey { + case url + } + + public init(url: String?) { + self.url = url + } + + public func duplicate() -> SEOImage { + let dict = self.dictionary! + let copy = SEOImage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(url, forKey: .url) + } + } + + /* + Model: BlogRequest + Used By: Content + */ + + class BlogRequest: Codable { + public var application: String? + + public var customJson: [String: Any]? + + public var author: Author? + + public var content: [ResourceContent]? + + public var featureImage: Asset? + + public var published: Bool? + + public var readingTime: String? + + public var slug: String? + + public var tags: [String]? + + public var title: String? + + public var seo: SEO? + + public var schedule: CronSchedule? + + public enum CodingKeys: String, CodingKey { + case application + + case customJson = "_custom_json" + + case author + + case content + + case featureImage = "feature_image" + + case published + + case readingTime = "reading_time" + + case slug + + case tags + + case title + + case seo + + case schedule = "_schedule" + } + + public init(application: String?, author: Author?, content: [ResourceContent]?, featureImage: Asset?, published: Bool?, readingTime: String?, seo: SEO?, slug: String?, tags: [String]?, title: String?, customJson: [String: Any]?, schedule: CronSchedule?) { + self.application = application + + self.customJson = customJson + + self.author = author + + self.content = content + + self.featureImage = featureImage + + self.published = published + + self.readingTime = readingTime + + self.slug = slug + + self.tags = tags + + self.title = title + + self.seo = seo + + self.schedule = schedule + } + + public func duplicate() -> BlogRequest { + let dict = self.dictionary! + let copy = BlogRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + author = try container.decode(Author.self, forKey: .author) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode([ResourceContent].self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + featureImage = try container.decode(Asset.self, forKey: .featureImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + readingTime = try container.decode(String.self, forKey: .readingTime) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + seo = try container.decode(SEO.self, forKey: .seo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode(CronSchedule.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(author, forKey: .author) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(featureImage, forKey: .featureImage) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(readingTime, forKey: .readingTime) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(seo, forKey: .seo) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + } + } + + /* + Model: GetAnnouncementListSchema + Used By: Content + */ + + class GetAnnouncementListSchema: Codable { + public var items: [AdminAnnouncementSchema]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [AdminAnnouncementSchema]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> GetAnnouncementListSchema { + let dict = self.dictionary! + let copy = GetAnnouncementListSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([AdminAnnouncementSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: CreateAnnouncementSchema + Used By: Content + */ + + class CreateAnnouncementSchema: Codable { + public var message: String? + + public var data: AdminAnnouncementSchema? + + public enum CodingKeys: String, CodingKey { + case message + + case data + } + + public init(data: AdminAnnouncementSchema?, message: String?) { + self.message = message + + self.data = data + } + + public func duplicate() -> CreateAnnouncementSchema { + let dict = self.dictionary! + let copy = CreateAnnouncementSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode(AdminAnnouncementSchema.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: DataLoaderResponseSchema + Used By: Content + */ + + class DataLoaderResponseSchema: Codable { + public var application: String? + + public var company: String? + + public var id: String? + + public var name: String? + + public var service: String? + + public var operationId: String? + + public var type: String? + + public var url: String? + + public var content: String? + + public var source: DataLoaderSourceSchema? + + public enum CodingKeys: String, CodingKey { + case application + + case company + + case id = "_id" + + case name + + case service + + case operationId = "operation_id" + + case type + + case url + + case content + + case source = "__source" + } + + public init(application: String?, company: String?, content: String?, name: String?, operationId: String?, service: String?, type: String?, url: String?, id: String?, source: DataLoaderSourceSchema?) { + self.application = application + + self.company = company + + self.id = id + + self.name = name + + self.service = service + + self.operationId = operationId + + self.type = type + + self.url = url + + self.content = content + + self.source = source + } + + public func duplicate() -> DataLoaderResponseSchema { + let dict = self.dictionary! + let copy = DataLoaderResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + company = try container.decode(String.self, forKey: .company) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + service = try container.decode(String.self, forKey: .service) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + operationId = try container.decode(String.self, forKey: .operationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode(String.self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + source = try container.decode(DataLoaderSourceSchema.self, forKey: .source) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(company, forKey: .company) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(service, forKey: .service) + + try? container.encodeIfPresent(operationId, forKey: .operationId) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(source, forKey: .source) + } + } + + /* + Model: DataLoaderResetResponseSchema + Used By: Content + */ + + class DataLoaderResetResponseSchema: Codable { + public var reset: String? + + public enum CodingKeys: String, CodingKey { + case reset + } + + public init(reset: String?) { + self.reset = reset + } + + public func duplicate() -> DataLoaderResetResponseSchema { + let dict = self.dictionary! + let copy = DataLoaderResetResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + reset = try container.decode(String.self, forKey: .reset) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(reset, forKey: .reset) + } + } + + /* + Model: Navigation + Used By: Content + */ + + class Navigation: Codable { + public var name: String? + + public var slug: String? + + public var orientation: String? + + public var createdBy: CreatedBySchema? + + public var dateMeta: DateMeta? + + public var id: String? + + public var position: String? + + public var application: String? + + public var platform: String? + + public var navigation: NavigationReference? + + public enum CodingKeys: String, CodingKey { + case name + + case slug + + case orientation + + case createdBy = "created_by" + + case dateMeta = "date_meta" + + case id = "_id" + + case position + + case application + + case platform + + case navigation + } + + public init(application: String?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, name: String?, navigation: NavigationReference?, orientation: String?, platform: String?, position: String?, slug: String?, id: String?) { + self.name = name + + self.slug = slug + + self.orientation = orientation + + self.createdBy = createdBy + + self.dateMeta = dateMeta + + self.id = id + + self.position = position + + self.application = application + + self.platform = platform + + self.navigation = navigation + } + + public func duplicate() -> Navigation { + let dict = self.dictionary! + let copy = Navigation(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orientation = try container.decode(String.self, forKey: .orientation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + position = try container.decode(String.self, forKey: .position) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode(String.self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + navigation = try container.decode(NavigationReference.self, forKey: .navigation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(orientation, forKey: .orientation) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(position, forKey: .position) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(platform, forKey: .platform) + + try? container.encodeIfPresent(navigation, forKey: .navigation) + } + } + + /* + Model: LocaleLanguage + Used By: Content + */ + + class LocaleLanguage: Codable { + public var hi: Language? + + public var ar: Language? + + public var enUs: Language? + + public enum CodingKeys: String, CodingKey { + case hi + + case ar + + case enUs = "en_us" + } + + public init(ar: Language?, enUs: Language?, hi: Language?) { + self.hi = hi + + self.ar = ar + + self.enUs = enUs + } + + public func duplicate() -> LocaleLanguage { + let dict = self.dictionary! + let copy = LocaleLanguage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + hi = try container.decode(Language.self, forKey: .hi) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ar = try container.decode(Language.self, forKey: .ar) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enUs = try container.decode(Language.self, forKey: .enUs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(hi, forKey: .hi) + + try? container.encodeIfPresent(ar, forKey: .ar) + + try? container.encodeIfPresent(enUs, forKey: .enUs) + } + } + + /* + Model: Language + Used By: Content + */ + + class Language: Codable { + public var display: String? + + public enum CodingKeys: String, CodingKey { + case display + } + + public init(display: String?) { + self.display = display + } + + public func duplicate() -> Language { + let dict = self.dictionary! + let copy = Language(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(display, forKey: .display) + } + } + + /* + Model: Action + Used By: Content + */ + + class Action: Codable { + public var page: ActionPage? + + public var popup: ActionPage? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case page + + case popup + + case type + } + + public init(page: ActionPage?, popup: ActionPage?, type: String?) { + self.page = page + + self.popup = popup + + self.type = type + } + + public func duplicate() -> Action { + let dict = self.dictionary! + let copy = Action(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + page = try container.decode(ActionPage.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + popup = try container.decode(ActionPage.self, forKey: .popup) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(popup, forKey: .popup) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: ActionPage + Used By: Content + */ + + class ActionPage: Codable { + public var params: [String: [String]]? + + public var query: [String: [String]]? + + public var url: String? + + public var type: PageType + + public enum CodingKeys: String, CodingKey { + case params + + case query + + case url + + case type + } + + public init(params: [String: [String]]?, query: [String: [String]]?, type: PageType, url: String?) { + self.params = params + + self.query = query + + self.url = url + + self.type = type + } + + public func duplicate() -> ActionPage { + let dict = self.dictionary! + let copy = ActionPage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + params = try container.decode([String: [String]].self, forKey: .params) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode([String: [String]].self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + type = try container.decode(PageType.self, forKey: .type) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(params, forKey: .params) + + try? container.encodeIfPresent(query, forKey: .query) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: NavigationReference + Used By: Content + */ + + class NavigationReference: Codable { + public var acl: [String]? + + public var tags: [String]? + + public var localeLanguage: LocaleLanguage? + + public var image: String? + + public var type: String? + + public var action: Action? + + public var active: Bool? + + public var display: String? + + public var sortOrder: Int? + + public var subNavigation: [NavigationReference]? + + public enum CodingKeys: String, CodingKey { + case acl + + case tags + + case localeLanguage = "_locale_language" + + case image + + case type + + case action + + case active + + case display + + case sortOrder = "sort_order" + + case subNavigation = "sub_navigation" + } + + public init(acl: [String]?, action: Action?, active: Bool?, display: String?, image: String?, sortOrder: Int?, subNavigation: [NavigationReference]?, tags: [String]?, type: String?, localeLanguage: LocaleLanguage?) { + self.acl = acl + + self.tags = tags + + self.localeLanguage = localeLanguage + + self.image = image + + self.type = type + + self.action = action + + self.active = active + + self.display = display + + self.sortOrder = sortOrder + + self.subNavigation = subNavigation + } + + public func duplicate() -> NavigationReference { + let dict = self.dictionary! + let copy = NavigationReference(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + acl = try container.decode([String].self, forKey: .acl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + localeLanguage = try container.decode(LocaleLanguage.self, forKey: .localeLanguage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + image = try container.decode(String.self, forKey: .image) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(Action.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sortOrder = try container.decode(Int.self, forKey: .sortOrder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subNavigation = try container.decode([NavigationReference].self, forKey: .subNavigation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(acl, forKey: .acl) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(localeLanguage, forKey: .localeLanguage) + + try? container.encodeIfPresent(image, forKey: .image) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(sortOrder, forKey: .sortOrder) + + try? container.encodeIfPresent(subNavigation, forKey: .subNavigation) + } + } + + /* + Model: LandingPage + Used By: Content + */ + + class LandingPage: Codable { + public var data: LandingPageSchema? + + public var success: Bool? + + public enum CodingKeys: String, CodingKey { + case data + + case success + } + + public init(data: LandingPageSchema?, success: Bool?) { + self.data = data + + self.success = success + } + + public func duplicate() -> LandingPage { + let dict = self.dictionary! + let copy = LandingPage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode(LandingPageSchema.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: ConfigurationSchema + Used By: Content + */ + + class ConfigurationSchema: Codable { + public var sleepTime: Int? + + public var startOnLaunch: Bool? + + public var duration: Int? + + public var slideDirection: String? + + public enum CodingKeys: String, CodingKey { + case sleepTime = "sleep_time" + + case startOnLaunch = "start_on_launch" + + case duration + + case slideDirection = "slide_direction" + } + + public init(duration: Int?, sleepTime: Int?, slideDirection: String?, startOnLaunch: Bool?) { + self.sleepTime = sleepTime + + self.startOnLaunch = startOnLaunch + + self.duration = duration + + self.slideDirection = slideDirection + } + + public func duplicate() -> ConfigurationSchema { + let dict = self.dictionary! + let copy = ConfigurationSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + sleepTime = try container.decode(Int.self, forKey: .sleepTime) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + startOnLaunch = try container.decode(Bool.self, forKey: .startOnLaunch) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + duration = try container.decode(Int.self, forKey: .duration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slideDirection = try container.decode(String.self, forKey: .slideDirection) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(sleepTime, forKey: .sleepTime) + + try? container.encodeIfPresent(startOnLaunch, forKey: .startOnLaunch) + + try? container.encodeIfPresent(duration, forKey: .duration) + + try? container.encodeIfPresent(slideDirection, forKey: .slideDirection) + } + } + + /* + Model: SlideshowMedia + Used By: Content + */ + + class SlideshowMedia: Codable { + public var type: String? + + public var url: String? + + public var bgColor: String? + + public var duration: Int? + + public var autoDecideDuration: Bool? + + public var action: Action? + + public enum CodingKeys: String, CodingKey { + case type + + case url + + case bgColor = "bg_color" + + case duration + + case autoDecideDuration = "auto_decide_duration" + + case action + } + + public init(action: Action?, autoDecideDuration: Bool?, bgColor: String?, duration: Int?, type: String?, url: String?) { + self.type = type + + self.url = url + + self.bgColor = bgColor + + self.duration = duration + + self.autoDecideDuration = autoDecideDuration + + self.action = action + } + + public func duplicate() -> SlideshowMedia { + let dict = self.dictionary! + let copy = SlideshowMedia(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bgColor = try container.decode(String.self, forKey: .bgColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + duration = try container.decode(Int.self, forKey: .duration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + autoDecideDuration = try container.decode(Bool.self, forKey: .autoDecideDuration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(Action.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(bgColor, forKey: .bgColor) + + try? container.encodeIfPresent(duration, forKey: .duration) + + try? container.encodeIfPresent(autoDecideDuration, forKey: .autoDecideDuration) + + try? container.encodeIfPresent(action, forKey: .action) + } + } + + /* + Model: Slideshow + Used By: Content + */ + + class Slideshow: Codable { + public var data: SlideshowSchema? + + public var success: Bool? + + public enum CodingKeys: String, CodingKey { + case data + + case success + } + + public init(data: SlideshowSchema?, success: Bool?) { + self.data = data + + self.success = success + } + + public func duplicate() -> Slideshow { + let dict = self.dictionary! + let copy = Slideshow(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode(SlideshowSchema.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: AnnouncementsResponseSchema + Used By: Content + */ + + class AnnouncementsResponseSchema: Codable { + public var announcements: [String: [AnnouncementSchema]]? + + public var refreshRate: Int? + + public var refreshPages: [String]? + + public enum CodingKeys: String, CodingKey { + case announcements + + case refreshRate = "refresh_rate" + + case refreshPages = "refresh_pages" + } + + public init(announcements: [String: [AnnouncementSchema]]?, refreshPages: [String]?, refreshRate: Int?) { + self.announcements = announcements + + self.refreshRate = refreshRate + + self.refreshPages = refreshPages + } + + public func duplicate() -> AnnouncementsResponseSchema { + let dict = self.dictionary! + let copy = AnnouncementsResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + announcements = try container.decode([String: [AnnouncementSchema]].self, forKey: .announcements) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refreshRate = try container.decode(Int.self, forKey: .refreshRate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refreshPages = try container.decode([String].self, forKey: .refreshPages) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(announcements, forKey: .announcements) + + try? container.encodeIfPresent(refreshRate, forKey: .refreshRate) + + try? container.encodeIfPresent(refreshPages, forKey: .refreshPages) + } + } + + /* + Model: FaqResponseSchema + Used By: Content + */ + + class FaqResponseSchema: Codable { + public var faqs: [FaqSchema]? + + public enum CodingKeys: String, CodingKey { + case faqs + } + + public init(faqs: [FaqSchema]?) { + self.faqs = faqs + } + + public func duplicate() -> FaqResponseSchema { + let dict = self.dictionary! + let copy = FaqResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + faqs = try container.decode([FaqSchema].self, forKey: .faqs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(faqs, forKey: .faqs) + } + } + + /* + Model: UpdateHandpickedSchema + Used By: Content + */ + + class UpdateHandpickedSchema: Codable { + public var tag: HandpickedTagSchema? + + public enum CodingKeys: String, CodingKey { + case tag + } + + public init(tag: HandpickedTagSchema?) { + self.tag = tag + } + + public func duplicate() -> UpdateHandpickedSchema { + let dict = self.dictionary! + let copy = UpdateHandpickedSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + tag = try container.decode(HandpickedTagSchema.self, forKey: .tag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(tag, forKey: .tag) + } + } + + /* + Model: HandpickedTagSchema + Used By: Content + */ + + class HandpickedTagSchema: Codable { + public var position: String? + + public var attributes: [String: Any]? + + public var name: String? + + public var url: String? + + public var type: String? + + public var subType: String? + + public var content: String? + + public enum CodingKeys: String, CodingKey { + case position + + case attributes + + case name + + case url + + case type + + case subType = "sub_type" + + case content + } + + public init(attributes: [String: Any]?, content: String?, name: String?, position: String?, subType: String?, type: String?, url: String?) { + self.position = position + + self.attributes = attributes + + self.name = name + + self.url = url + + self.type = type + + self.subType = subType + + self.content = content + } + + public func duplicate() -> HandpickedTagSchema { + let dict = self.dictionary! + let copy = HandpickedTagSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + position = try container.decode(String.self, forKey: .position) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributes = try container.decode([String: Any].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subType = try container.decode(String.self, forKey: .subType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode(String.self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(position, forKey: .position) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(subType, forKey: .subType) + + try? container.encodeIfPresent(content, forKey: .content) + } + } + + /* + Model: RemoveHandpickedSchema + Used By: Content + */ + + class RemoveHandpickedSchema: Codable { + public var tags: [String]? + + public enum CodingKeys: String, CodingKey { + case tags + } + + public init(tags: [String]?) { + self.tags = tags + } + + public func duplicate() -> RemoveHandpickedSchema { + let dict = self.dictionary! + let copy = RemoveHandpickedSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: CreateTagSchema + Used By: Content + */ + + class CreateTagSchema: Codable { + public var name: String? + + public var subType: String? + + public var id: String? + + public var type: String? + + public var url: String? + + public var position: String? + + public var attributes: [String: Any]? + + public var content: String? + + public enum CodingKeys: String, CodingKey { + case name + + case subType = "sub_type" + + case id = "_id" + + case type + + case url + + case position + + case attributes + + case content + } + + public init(attributes: [String: Any]?, content: String?, name: String?, position: String?, subType: String?, type: String?, url: String?, id: String?) { + self.name = name + + self.subType = subType + + self.id = id + + self.type = type + + self.url = url + + self.position = position + + self.attributes = attributes + + self.content = content + } + + public func duplicate() -> CreateTagSchema { + let dict = self.dictionary! + let copy = CreateTagSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subType = try container.decode(String.self, forKey: .subType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + position = try container.decode(String.self, forKey: .position) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributes = try container.decode([String: Any].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode(String.self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(subType, forKey: .subType) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(position, forKey: .position) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + + try? container.encodeIfPresent(content, forKey: .content) + } + } + + /* + Model: CreateTagRequestSchema + Used By: Content + */ + + class CreateTagRequestSchema: Codable { + public var tags: [CreateTagSchema]? + + public enum CodingKeys: String, CodingKey { + case tags + } + + public init(tags: [CreateTagSchema]?) { + self.tags = tags + } + + public func duplicate() -> CreateTagRequestSchema { + let dict = self.dictionary! + let copy = CreateTagRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + tags = try container.decode([CreateTagSchema].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: DataLoaderSchema + Used By: Content + */ + + class DataLoaderSchema: Codable { + public var name: String? + + public var service: String? + + public var operationId: String? + + public var type: String? + + public var url: String? + + public var content: String? + + public var source: DataLoaderSourceSchema? + + public enum CodingKeys: String, CodingKey { + case name + + case service + + case operationId = "operation_id" + + case type + + case url + + case content + + case source = "__source" + } + + public init(content: String?, name: String?, operationId: String?, service: String?, type: String?, url: String?, source: DataLoaderSourceSchema?) { + self.name = name + + self.service = service + + self.operationId = operationId + + self.type = type + + self.url = url + + self.content = content + + self.source = source + } + + public func duplicate() -> DataLoaderSchema { + let dict = self.dictionary! + let copy = DataLoaderSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + service = try container.decode(String.self, forKey: .service) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + operationId = try container.decode(String.self, forKey: .operationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode(String.self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + source = try container.decode(DataLoaderSourceSchema.self, forKey: .source) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(service, forKey: .service) + + try? container.encodeIfPresent(operationId, forKey: .operationId) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(source, forKey: .source) + } + } + + /* + Model: DataLoaderSourceSchema + Used By: Content + */ + + class DataLoaderSourceSchema: Codable { + public var type: String? + + public var id: String? + + public enum CodingKeys: String, CodingKey { + case type + + case id + } + + public init(id: String?, type: String?) { + self.type = type + + self.id = id + } + + public func duplicate() -> DataLoaderSourceSchema { + let dict = self.dictionary! + let copy = DataLoaderSourceSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: DataLoadersSchema + Used By: Content + */ + + class DataLoadersSchema: Codable { + public var items: [DataLoaderSchema]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [DataLoaderSchema]?) { + self.items = items + } + + public func duplicate() -> DataLoadersSchema { + let dict = self.dictionary! + let copy = DataLoadersSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([DataLoaderSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: TagDeleteSuccessResponse + Used By: Content + */ + + class TagDeleteSuccessResponse: Codable { + public var success: Bool? + + public enum CodingKeys: String, CodingKey { + case success + } + + public init(success: Bool?) { + self.success = success + } + + public func duplicate() -> TagDeleteSuccessResponse { + let dict = self.dictionary! + let copy = TagDeleteSuccessResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: ContentAPIError + Used By: Content + */ + + class ContentAPIError: Codable { + public var message: String? + + public var status: Double? + + public var code: String? + + public var exception: String? + + public var info: String? + + public var requestId: String? + + public var stackTrace: String? + + public var meta: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case message + + case status + + case code + + case exception + + case info + + case requestId = "request_id" + + case stackTrace = "stack_trace" + + case meta + } + + public init(code: String?, exception: String?, info: String?, message: String?, meta: [String: Any]?, requestId: String?, stackTrace: String?, status: Double?) { + self.message = message + + self.status = status + + self.code = code + + self.exception = exception + + self.info = info + + self.requestId = requestId + + self.stackTrace = stackTrace + + self.meta = meta + } + + public func duplicate() -> ContentAPIError { + let dict = self.dictionary! + let copy = ContentAPIError(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Double.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + exception = try container.decode(String.self, forKey: .exception) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + info = try container.decode(String.self, forKey: .info) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stackTrace = try container.decode(String.self, forKey: .stackTrace) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(exception, forKey: .exception) + + try? container.encodeIfPresent(info, forKey: .info) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(stackTrace, forKey: .stackTrace) + + try? container.encodeIfPresent(meta, forKey: .meta) + } + } + + /* + Model: CategorySchema + Used By: Content + */ + + class CategorySchema: Codable { + public var index: Int? + + public var title: String? + + public var description: String? + + public var children: [String]? + + public var id: String? + + public var slug: String? + + public var application: String? + + public var iconUrl: String? + + public var customJson: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case index + + case title + + case description + + case children + + case id = "_id" + + case slug + + case application + + case iconUrl = "icon_url" + + case customJson = "_custom_json" + } + + public init(application: String?, children: [String]?, description: String?, iconUrl: String?, index: Int?, slug: String?, title: String?, customJson: [String: Any]?, id: String?) { + self.index = index + + self.title = title + + self.description = description + + self.children = children + + self.id = id + + self.slug = slug + + self.application = application + + self.iconUrl = iconUrl + + self.customJson = customJson + } + + public func duplicate() -> CategorySchema { + let dict = self.dictionary! + let copy = CategorySchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + index = try container.decode(Int.self, forKey: .index) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + children = try container.decode([String].self, forKey: .children) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + iconUrl = try container.decode(String.self, forKey: .iconUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(index, forKey: .index) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(children, forKey: .children) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(iconUrl, forKey: .iconUrl) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + } + } + + /* + Model: ChildrenSchema + Used By: Content + */ + + class ChildrenSchema: Codable { + public var question: String? + + public var answer: String? + + public var slug: String? + + public var application: String? + + public var id: String? + + public enum CodingKeys: String, CodingKey { + case question + + case answer + + case slug + + case application + + case id = "_id" + } + + public init(answer: String?, application: String?, question: String?, slug: String?, id: String?) { + self.question = question + + self.answer = answer + + self.slug = slug + + self.application = application + + self.id = id + } + + public func duplicate() -> ChildrenSchema { + let dict = self.dictionary! + let copy = ChildrenSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + question = try container.decode(String.self, forKey: .question) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + answer = try container.decode(String.self, forKey: .answer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(question, forKey: .question) + + try? container.encodeIfPresent(answer, forKey: .answer) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: CategoryRequestSchema + Used By: Content + */ + + class CategoryRequestSchema: Codable { + public var slug: String? + + public var title: String? + + public enum CodingKeys: String, CodingKey { + case slug + + case title + } + + public init(slug: String?, title: String?) { + self.slug = slug + + self.title = title + } + + public func duplicate() -> CategoryRequestSchema { + let dict = self.dictionary! + let copy = CategoryRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(title, forKey: .title) + } + } + + /* + Model: FAQCategorySchema + Used By: Content + */ + + class FAQCategorySchema: Codable { + public var index: Int? + + public var title: String? + + public var description: String? + + public var children: [ChildrenSchema]? + + public var id: String? + + public var slug: String? + + public var application: String? + + public var iconUrl: String? + + public var customJson: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case index + + case title + + case description + + case children + + case id = "_id" + + case slug + + case application + + case iconUrl = "icon_url" + + case customJson = "_custom_json" + } + + public init(application: String?, children: [ChildrenSchema]?, description: String?, iconUrl: String?, index: Int?, slug: String?, title: String?, customJson: [String: Any]?, id: String?) { + self.index = index + + self.title = title + + self.description = description + + self.children = children + + self.id = id + + self.slug = slug + + self.application = application + + self.iconUrl = iconUrl + + self.customJson = customJson + } + + public func duplicate() -> FAQCategorySchema { + let dict = self.dictionary! + let copy = FAQCategorySchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + index = try container.decode(Int.self, forKey: .index) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + children = try container.decode([ChildrenSchema].self, forKey: .children) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + iconUrl = try container.decode(String.self, forKey: .iconUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(index, forKey: .index) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(children, forKey: .children) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(iconUrl, forKey: .iconUrl) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + } + } + + /* + Model: FaqSchema + Used By: Content + */ + + class FaqSchema: Codable { + public var slug: String? + + public var application: String? + + public var id: String? + + public var question: String? + + public var answer: String? + + public enum CodingKeys: String, CodingKey { + case slug + + case application + + case id = "_id" + + case question + + case answer + } + + public init(answer: String?, application: String?, question: String?, slug: String?, id: String?) { + self.slug = slug + + self.application = application + + self.id = id + + self.question = question + + self.answer = answer + } + + public func duplicate() -> FaqSchema { + let dict = self.dictionary! + let copy = FaqSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + question = try container.decode(String.self, forKey: .question) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + answer = try container.decode(String.self, forKey: .answer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(question, forKey: .question) + + try? container.encodeIfPresent(answer, forKey: .answer) + } + } + + /* + Model: FAQ + Used By: Content + */ + + class FAQ: Codable { + public var slug: String? + + public var question: String? + + public var answer: String? + + public enum CodingKeys: String, CodingKey { + case slug + + case question + + case answer + } + + public init(answer: String?, question: String?, slug: String?) { + self.slug = slug + + self.question = question + + self.answer = answer + } + + public func duplicate() -> FAQ { + let dict = self.dictionary! + let copy = FAQ(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + question = try container.decode(String.self, forKey: .question) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + answer = try container.decode(String.self, forKey: .answer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(question, forKey: .question) + + try? container.encodeIfPresent(answer, forKey: .answer) + } + } + + /* + Model: CreateFaqResponseSchema + Used By: Content + */ + + class CreateFaqResponseSchema: Codable { + public var faq: FaqSchema? + + public enum CodingKeys: String, CodingKey { + case faq + } + + public init(faq: FaqSchema?) { + self.faq = faq + } + + public func duplicate() -> CreateFaqResponseSchema { + let dict = self.dictionary! + let copy = CreateFaqResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + faq = try container.decode(FaqSchema.self, forKey: .faq) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(faq, forKey: .faq) + } + } + + /* + Model: CreateFaqSchema + Used By: Content + */ + + class CreateFaqSchema: Codable { + public var faq: FAQ? + + public enum CodingKeys: String, CodingKey { + case faq + } + + public init(faq: FAQ?) { + self.faq = faq + } + + public func duplicate() -> CreateFaqSchema { + let dict = self.dictionary! + let copy = CreateFaqSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + faq = try container.decode(FAQ.self, forKey: .faq) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(faq, forKey: .faq) + } + } + + /* + Model: GetFaqSchema + Used By: Content + */ + + class GetFaqSchema: Codable { + public var faqs: [FaqSchema]? + + public enum CodingKeys: String, CodingKey { + case faqs + } + + public init(faqs: [FaqSchema]?) { + self.faqs = faqs + } + + public func duplicate() -> GetFaqSchema { + let dict = self.dictionary! + let copy = GetFaqSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + faqs = try container.decode([FaqSchema].self, forKey: .faqs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(faqs, forKey: .faqs) + } + } + + /* + Model: UpdateFaqCategoryRequestSchema + Used By: Content + */ + + class UpdateFaqCategoryRequestSchema: Codable { + public var category: CategorySchema? + + public enum CodingKeys: String, CodingKey { + case category + } + + public init(category: CategorySchema?) { + self.category = category + } + + public func duplicate() -> UpdateFaqCategoryRequestSchema { + let dict = self.dictionary! + let copy = UpdateFaqCategoryRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + category = try container.decode(CategorySchema.self, forKey: .category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(category, forKey: .category) + } + } + + /* + Model: CreateFaqCategoryRequestSchema + Used By: Content + */ + + class CreateFaqCategoryRequestSchema: Codable { + public var category: CategoryRequestSchema? + + public enum CodingKeys: String, CodingKey { + case category + } + + public init(category: CategoryRequestSchema?) { + self.category = category + } + + public func duplicate() -> CreateFaqCategoryRequestSchema { + let dict = self.dictionary! + let copy = CreateFaqCategoryRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + category = try container.decode(CategoryRequestSchema.self, forKey: .category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(category, forKey: .category) + } + } + + /* + Model: CreateFaqCategorySchema + Used By: Content + */ + + class CreateFaqCategorySchema: Codable { + public var category: CategorySchema? + + public enum CodingKeys: String, CodingKey { + case category + } + + public init(category: CategorySchema?) { + self.category = category + } + + public func duplicate() -> CreateFaqCategorySchema { + let dict = self.dictionary! + let copy = CreateFaqCategorySchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + category = try container.decode(CategorySchema.self, forKey: .category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(category, forKey: .category) + } + } + + /* + Model: GetFaqCategoriesSchema + Used By: Content + */ + + class GetFaqCategoriesSchema: Codable { + public var categories: [CategorySchema]? + + public enum CodingKeys: String, CodingKey { + case categories + } + + public init(categories: [CategorySchema]?) { + self.categories = categories + } + + public func duplicate() -> GetFaqCategoriesSchema { + let dict = self.dictionary! + let copy = GetFaqCategoriesSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + categories = try container.decode([CategorySchema].self, forKey: .categories) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(categories, forKey: .categories) + } + } + + /* + Model: GetFaqCategoryBySlugSchema + Used By: Content + */ + + class GetFaqCategoryBySlugSchema: Codable { + public var category: FAQCategorySchema? + + public enum CodingKeys: String, CodingKey { + case category + } + + public init(category: FAQCategorySchema?) { + self.category = category + } + + public func duplicate() -> GetFaqCategoryBySlugSchema { + let dict = self.dictionary! + let copy = GetFaqCategoryBySlugSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + category = try container.decode(FAQCategorySchema.self, forKey: .category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(category, forKey: .category) + } + } + + /* + Model: LandingPageGetResponse + Used By: Content + */ + + class LandingPageGetResponse: Codable { + public var items: [LandingPageSchema]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [LandingPageSchema]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> LandingPageGetResponse { + let dict = self.dictionary! + let copy = LandingPageGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([LandingPageSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: LandingPageSchema + Used By: Content + */ + + class LandingPageSchema: Codable { + public var slug: String? + + public var action: Action? + + public var platform: [String]? + + public var createdBy: CreatedBySchema? + + public var dateMeta: DateMeta? + + public var id: String? + + public var application: String? + + public var archived: Bool? + + public var customJson: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case slug + + case action + + case platform + + case createdBy = "created_by" + + case dateMeta = "date_meta" + + case id = "_id" + + case application + + case archived + + case customJson = "_custom_json" + } + + public init(action: Action?, application: String?, archived: Bool?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, platform: [String]?, slug: String?, customJson: [String: Any]?, id: String?) { + self.slug = slug + + self.action = action + + self.platform = platform + + self.createdBy = createdBy + + self.dateMeta = dateMeta + + self.id = id + + self.application = application + + self.archived = archived + + self.customJson = customJson + } + + public func duplicate() -> LandingPageSchema { + let dict = self.dictionary! + let copy = LandingPageSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(Action.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode([String].self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archived = try container.decode(Bool.self, forKey: .archived) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(platform, forKey: .platform) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(archived, forKey: .archived) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + } + } + + /* + Model: DefaultNavigationResponse + Used By: Content + */ + + class DefaultNavigationResponse: Codable { + public var items: [NavigationSchema]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [NavigationSchema]?) { + self.items = items + } + + public func duplicate() -> DefaultNavigationResponse { + let dict = self.dictionary! + let copy = DefaultNavigationResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([NavigationSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: NavigationGetResponse + Used By: Content + */ + + class NavigationGetResponse: Codable { + public var items: [NavigationSchema]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [NavigationSchema]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> NavigationGetResponse { + let dict = self.dictionary! + let copy = NavigationGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([NavigationSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: Orientation + Used By: Content + */ + + class Orientation: Codable { + public var portrait: [String]? + + public var landscape: [String]? + + public enum CodingKeys: String, CodingKey { + case portrait + + case landscape + } + + public init(landscape: [String]?, portrait: [String]?) { + self.portrait = portrait + + self.landscape = landscape + } + + public func duplicate() -> Orientation { + let dict = self.dictionary! + let copy = Orientation(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + portrait = try container.decode([String].self, forKey: .portrait) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + landscape = try container.decode([String].self, forKey: .landscape) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(portrait, forKey: .portrait) + + try? container.encodeIfPresent(landscape, forKey: .landscape) + } + } + + /* + Model: NavigationSchema + Used By: Content + */ + + class NavigationSchema: Codable { + public var id: String? + + public var application: String? + + public var archived: Bool? + + public var name: String? + + public var slug: String? + + public var platform: [String]? + + public var createdBy: CreatedBySchema? + + public var dateMeta: DateMeta? + + public var orientation: Orientation? + + public var version: Double? + + public var navigation: [NavigationReference]? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case application + + case archived + + case name + + case slug + + case platform + + case createdBy = "created_by" + + case dateMeta = "date_meta" + + case orientation + + case version + + case navigation + } + + public init(application: String?, archived: Bool?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, name: String?, navigation: [NavigationReference]?, orientation: Orientation?, platform: [String]?, slug: String?, version: Double?, id: String?) { + self.id = id + + self.application = application + + self.archived = archived + + self.name = name + + self.slug = slug + + self.platform = platform + + self.createdBy = createdBy + + self.dateMeta = dateMeta + + self.orientation = orientation + + self.version = version + + self.navigation = navigation + } + + public func duplicate() -> NavigationSchema { + let dict = self.dictionary! + let copy = NavigationSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archived = try container.decode(Bool.self, forKey: .archived) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode([String].self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orientation = try container.decode(Orientation.self, forKey: .orientation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + version = try container.decode(Double.self, forKey: .version) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + navigation = try container.decode([NavigationReference].self, forKey: .navigation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(archived, forKey: .archived) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(platform, forKey: .platform) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(orientation, forKey: .orientation) + + try? container.encodeIfPresent(version, forKey: .version) + + try? container.encodeIfPresent(navigation, forKey: .navigation) + } + } + + /* + Model: NavigationRequest + Used By: Content + */ + + class NavigationRequest: Codable { + public var name: String? + + public var slug: String? + + public var platform: [String]? + + public var orientation: Orientation? + + public var navigation: [NavigationReference]? + + public enum CodingKeys: String, CodingKey { + case name + + case slug + + case platform + + case orientation + + case navigation + } + + public init(name: String?, navigation: [NavigationReference]?, orientation: Orientation?, platform: [String]?, slug: String?) { + self.name = name + + self.slug = slug + + self.platform = platform + + self.orientation = orientation + + self.navigation = navigation + } + + public func duplicate() -> NavigationRequest { + let dict = self.dictionary! + let copy = NavigationRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode([String].self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orientation = try container.decode(Orientation.self, forKey: .orientation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + navigation = try container.decode([NavigationReference].self, forKey: .navigation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(platform, forKey: .platform) + + try? container.encodeIfPresent(orientation, forKey: .orientation) + + try? container.encodeIfPresent(navigation, forKey: .navigation) + } + } + + /* + Model: CustomPageSchema + Used By: Content + */ + + class CustomPageSchema: Codable { + public var id: String? + + public var platform: String? + + public var title: String? + + public var slug: String? + + public var type: String? + + public var orientation: String? + + public var application: String? + + public var description: String? + + public var published: Bool? + + public var tags: [String]? + + public var content: [[String: Any]]? + + public var createdBy: CreatedBySchema? + + public var dateMeta: DateMeta? + + public var schedule: ScheduleSchema? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case platform + + case title + + case slug + + case type + + case orientation + + case application + + case description + + case published + + case tags + + case content + + case createdBy = "created_by" + + case dateMeta = "date_meta" + + case schedule = "_schedule" + } + + public init(application: String?, content: [[String: Any]]?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, description: String?, orientation: String?, platform: String?, published: Bool?, slug: String?, tags: [String]?, title: String?, type: String?, id: String?, schedule: ScheduleSchema?) { + self.id = id + + self.platform = platform + + self.title = title + + self.slug = slug + + self.type = type + + self.orientation = orientation + + self.application = application + + self.description = description + + self.published = published + + self.tags = tags + + self.content = content + + self.createdBy = createdBy + + self.dateMeta = dateMeta + + self.schedule = schedule + } + + public func duplicate() -> CustomPageSchema { + let dict = self.dictionary! + let copy = CustomPageSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode(String.self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orientation = try container.decode(String.self, forKey: .orientation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode([[String: Any]].self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode(ScheduleSchema.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(platform, forKey: .platform) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(orientation, forKey: .orientation) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + } + } + + /* + Model: ContentSchema + Used By: Content + */ + + class ContentSchema: Codable { + public var type: String? + + public var value: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case type + + case value + } + + public init(type: String?, value: [String: Any]?) { + self.type = type + + self.value = value + } + + public func duplicate() -> ContentSchema { + let dict = self.dictionary! + let copy = ContentSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode([String: Any].self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: CustomPage + Used By: Content + */ + + class CustomPage: Codable { + public var data: CustomPageSchema? + + public enum CodingKeys: String, CodingKey { + case data + } + + public init(data: CustomPageSchema?) { + self.data = data + } + + public func duplicate() -> CustomPage { + let dict = self.dictionary! + let copy = CustomPage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode(CustomPageSchema.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: FeatureImage + Used By: Content + */ + + class FeatureImage: Codable { + public var secureUrl: String? + + public enum CodingKeys: String, CodingKey { + case secureUrl = "secure_url" + } + + public init(secureUrl: String?) { + self.secureUrl = secureUrl + } + + public func duplicate() -> FeatureImage { + let dict = self.dictionary! + let copy = FeatureImage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + secureUrl = try container.decode(String.self, forKey: .secureUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) + } + } + + /* + Model: PageGetResponse + Used By: Content + */ + + class PageGetResponse: Codable { + public var items: [PageSchema]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [PageSchema]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> PageGetResponse { + let dict = self.dictionary! + let copy = PageGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([PageSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: PageSpec + Used By: Content + */ + + class PageSpec: Codable { + public var specifications: [PageSpecItem]? + + public enum CodingKeys: String, CodingKey { + case specifications + } + + public init(specifications: [PageSpecItem]?) { + self.specifications = specifications + } + + public func duplicate() -> PageSpec { + let dict = self.dictionary! + let copy = PageSpec(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + specifications = try container.decode([PageSpecItem].self, forKey: .specifications) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(specifications, forKey: .specifications) + } + } + + /* + Model: PageSpecParam + Used By: Content + */ + + class PageSpecParam: Codable { + public var key: String? + + public var required: Bool? + + public enum CodingKeys: String, CodingKey { + case key + + case required + } + + public init(key: String?, required: Bool?) { + self.key = key + + self.required = required + } + + public func duplicate() -> PageSpecParam { + let dict = self.dictionary! + let copy = PageSpecParam(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + required = try container.decode(Bool.self, forKey: .required) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(required, forKey: .required) + } + } + + /* + Model: PageSpecItem + Used By: Content + */ + + class PageSpecItem: Codable { + public var pageType: String? + + public var displayName: String? + + public var params: [PageSpecParam]? + + public var query: [PageSpecParam]? + + public enum CodingKeys: String, CodingKey { + case pageType = "page_type" + + case displayName = "display_name" + + case params + + case query + } + + public init(displayName: String?, pageType: String?, params: [PageSpecParam]?, query: [PageSpecParam]?) { + self.pageType = pageType + + self.displayName = displayName + + self.params = params + + self.query = query + } + + public func duplicate() -> PageSpecItem { + let dict = self.dictionary! + let copy = PageSpecItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + pageType = try container.decode(String.self, forKey: .pageType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + params = try container.decode([PageSpecParam].self, forKey: .params) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode([PageSpecParam].self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pageType, forKey: .pageType) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(params, forKey: .params) + + try? container.encodeIfPresent(query, forKey: .query) + } + } + + /* + Model: PageSchema + Used By: Content + */ + + class PageSchema: Codable { + public var id: String? + + public var application: String? + + public var componentIds: [String]? + + public var content: [[String: Any]]? + + public var contentPath: String? + + public var createdBy: CreatedBySchema? + + public var dateMeta: DateMeta? + + public var description: String? + + public var featureImage: Asset? + + public var pageMeta: [[String: Any]]? + + public var schedule: ScheduleSchema? + + public var customJson: [String: Any]? + + public var orientation: String? + + public var platform: String? + + public var published: Bool? + + public var slug: String? + + public var tags: [String]? + + public var title: String? + + public var type: String? + + public var seo: SEO? + + public var visibility: [String: Any]? + + public var archived: Bool? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case application + + case componentIds = "component_ids" + + case content + + case contentPath = "content_path" + + case createdBy = "created_by" + + case dateMeta = "date_meta" + + case description + + case featureImage = "feature_image" + + case pageMeta = "page_meta" + + case schedule = "_schedule" + + case customJson = "_custom_json" + + case orientation + + case platform + + case published + + case slug + + case tags + + case title + + case type + + case seo + + case visibility + + case archived + } + + public init(application: String?, archived: Bool?, componentIds: [String]?, content: [[String: Any]]?, contentPath: String?, createdBy: CreatedBySchema?, dateMeta: DateMeta?, description: String?, featureImage: Asset?, orientation: String?, pageMeta: [[String: Any]]?, platform: String?, published: Bool?, seo: SEO?, slug: String?, tags: [String]?, title: String?, type: String?, visibility: [String: Any]?, customJson: [String: Any]?, id: String?, schedule: ScheduleSchema?) { + self.id = id + + self.application = application + + self.componentIds = componentIds + + self.content = content + + self.contentPath = contentPath + + self.createdBy = createdBy + + self.dateMeta = dateMeta + + self.description = description + + self.featureImage = featureImage + + self.pageMeta = pageMeta + + self.schedule = schedule + + self.customJson = customJson + + self.orientation = orientation + + self.platform = platform + + self.published = published + + self.slug = slug + + self.tags = tags + + self.title = title + + self.type = type + + self.seo = seo + + self.visibility = visibility + + self.archived = archived + } + + public func duplicate() -> PageSchema { + let dict = self.dictionary! + let copy = PageSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + componentIds = try container.decode([String].self, forKey: .componentIds) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode([[String: Any]].self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contentPath = try container.decode(String.self, forKey: .contentPath) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(CreatedBySchema.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + featureImage = try container.decode(Asset.self, forKey: .featureImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pageMeta = try container.decode([[String: Any]].self, forKey: .pageMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode(ScheduleSchema.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orientation = try container.decode(String.self, forKey: .orientation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode(String.self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + seo = try container.decode(SEO.self, forKey: .seo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + visibility = try container.decode([String: Any].self, forKey: .visibility) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archived = try container.decode(Bool.self, forKey: .archived) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(componentIds, forKey: .componentIds) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(contentPath, forKey: .contentPath) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(featureImage, forKey: .featureImage) + + try? container.encodeIfPresent(pageMeta, forKey: .pageMeta) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(orientation, forKey: .orientation) + + try? container.encodeIfPresent(platform, forKey: .platform) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(seo, forKey: .seo) + + try? container.encodeIfPresent(visibility, forKey: .visibility) + + try? container.encodeIfPresent(archived, forKey: .archived) + } + } + + /* + Model: CreatedBySchema + Used By: Content + */ + + class CreatedBySchema: Codable { + public var id: String? + + public enum CodingKeys: String, CodingKey { + case id + } + + public init(id: String?) { + self.id = id + } + + public func duplicate() -> CreatedBySchema { + let dict = self.dictionary! + let copy = CreatedBySchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: PageContent + Used By: Content + */ + + class PageContent: Codable { + public var type: String? + + public var value: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case type + + case value + } + + public init(type: String?, value: [String: Any]?) { + self.type = type + + self.value = value + } + + public func duplicate() -> PageContent { + let dict = self.dictionary! + let copy = PageContent(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode([String: Any].self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: PageMeta + Used By: Content + */ + + class PageMeta: Codable { + public var key: String? + + public var value: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case key + + case value + } + + public init(key: String?, value: [String: Any]?) { + self.key = key + + self.value = value + } + + public func duplicate() -> PageMeta { + let dict = self.dictionary! + let copy = PageMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode([String: Any].self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: PageRequest + Used By: Content + */ + + class PageRequest: Codable { + public var schedule: CronSchedule? + + public var application: String? + + public var author: Author? + + public var customJson: [String: Any]? + + public var orientation: String? + + public var content: [[String: Any]]? + + public var featureImage: Asset? + + public var published: Bool? + + public var readingTime: String? + + public var slug: String? + + public var tags: [String]? + + public var seo: SEO? + + public var title: String? + + public enum CodingKeys: String, CodingKey { + case schedule = "_schedule" + + case application + + case author + + case customJson = "_custom_json" + + case orientation + + case content + + case featureImage = "feature_image" + + case published + + case readingTime = "reading_time" + + case slug + + case tags + + case seo + + case title + } + + public init(application: String?, author: Author?, content: [[String: Any]]?, featureImage: Asset?, orientation: String?, published: Bool?, readingTime: String?, seo: SEO?, slug: String?, tags: [String]?, title: String?, customJson: [String: Any]?, schedule: CronSchedule?) { + self.schedule = schedule + + self.application = application + + self.author = author + + self.customJson = customJson + + self.orientation = orientation + + self.content = content + + self.featureImage = featureImage + + self.published = published + + self.readingTime = readingTime + + self.slug = slug + + self.tags = tags + + self.seo = seo + + self.title = title + } + + public func duplicate() -> PageRequest { + let dict = self.dictionary! + let copy = PageRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + schedule = try container.decode(CronSchedule.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + author = try container.decode(Author.self, forKey: .author) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orientation = try container.decode(String.self, forKey: .orientation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode([[String: Any]].self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + featureImage = try container.decode(Asset.self, forKey: .featureImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + readingTime = try container.decode(String.self, forKey: .readingTime) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + seo = try container.decode(SEO.self, forKey: .seo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(author, forKey: .author) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(orientation, forKey: .orientation) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(featureImage, forKey: .featureImage) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(readingTime, forKey: .readingTime) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(seo, forKey: .seo) + + try? container.encodeIfPresent(title, forKey: .title) + } + } + + /* + Model: CronSchedule + Used By: Content + */ + + class CronSchedule: Codable { + public var cron: String? + + public var start: String? + + public var end: String? + + public var duration: Double? + + public enum CodingKeys: String, CodingKey { + case cron + + case start + + case end + + case duration + } + + public init(cron: String?, duration: Double?, end: String?, start: String?) { + self.cron = cron + + self.start = start + + self.end = end + + self.duration = duration + } + + public func duplicate() -> CronSchedule { + let dict = self.dictionary! + let copy = CronSchedule(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + cron = try container.decode(String.self, forKey: .cron) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + start = try container.decode(String.self, forKey: .start) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + end = try container.decode(String.self, forKey: .end) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + duration = try container.decode(Double.self, forKey: .duration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(cron, forKey: .cron) + + try? container.encodeIfPresent(start, forKey: .start) + + try? container.encodeIfPresent(end, forKey: .end) + + try? container.encodeIfPresent(duration, forKey: .duration) + } + } + + /* + Model: PagePublishRequest + Used By: Content + */ + + class PagePublishRequest: Codable { + public var publish: Bool? + + public enum CodingKeys: String, CodingKey { + case publish + } + + public init(publish: Bool?) { + self.publish = publish + } + + public func duplicate() -> PagePublishRequest { + let dict = self.dictionary! + let copy = PagePublishRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + publish = try container.decode(Bool.self, forKey: .publish) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(publish, forKey: .publish) + } + } + + /* + Model: PageMetaSchema + Used By: Content + */ + + class PageMetaSchema: Codable { + public var systemPages: [NavigationSchema]? + + public var customPages: [PageSchema]? + + public var applicationId: String? + + public enum CodingKeys: String, CodingKey { + case systemPages = "system_pages" + + case customPages = "custom_pages" + + case applicationId = "application_id" + } + + public init(applicationId: String?, customPages: [PageSchema]?, systemPages: [NavigationSchema]?) { + self.systemPages = systemPages + + self.customPages = customPages + + self.applicationId = applicationId + } + + public func duplicate() -> PageMetaSchema { + let dict = self.dictionary! + let copy = PageMetaSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + systemPages = try container.decode([NavigationSchema].self, forKey: .systemPages) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customPages = try container.decode([PageSchema].self, forKey: .customPages) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + applicationId = try container.decode(String.self, forKey: .applicationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(systemPages, forKey: .systemPages) + + try? container.encodeIfPresent(customPages, forKey: .customPages) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + } + } + + /* + Model: SlideshowGetResponse + Used By: Content + */ + + class SlideshowGetResponse: Codable { + public var items: [SlideshowSchema]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [SlideshowSchema]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> SlideshowGetResponse { + let dict = self.dictionary! + let copy = SlideshowGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([SlideshowSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: SlideshowSchema + Used By: Content + */ + + class SlideshowSchema: Codable { + public var id: String? + + public var slug: String? + + public var dateMeta: DateMeta? + + public var application: String? + + public var platform: String? + + public var configuration: ConfigurationSchema? + + public var media: [SlideshowMedia]? + + public var active: Bool? + + public var archived: Bool? + + public var customJson: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case slug + + case dateMeta = "date_meta" + + case application + + case platform + + case configuration + + case media + + case active + + case archived + + case customJson = "_custom_json" + } + + public init(active: Bool?, application: String?, archived: Bool?, configuration: ConfigurationSchema?, dateMeta: DateMeta?, media: [SlideshowMedia]?, platform: String?, slug: String?, customJson: [String: Any]?, id: String?) { + self.id = id + + self.slug = slug + + self.dateMeta = dateMeta + + self.application = application + + self.platform = platform + + self.configuration = configuration + + self.media = media + + self.active = active + + self.archived = archived + + self.customJson = customJson + } + + public func duplicate() -> SlideshowSchema { + let dict = self.dictionary! + let copy = SlideshowSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode(String.self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + configuration = try container.decode(ConfigurationSchema.self, forKey: .configuration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + media = try container.decode([SlideshowMedia].self, forKey: .media) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archived = try container.decode(Bool.self, forKey: .archived) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(platform, forKey: .platform) + + try? container.encodeIfPresent(configuration, forKey: .configuration) + + try? container.encodeIfPresent(media, forKey: .media) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(archived, forKey: .archived) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + } + } + + /* + Model: SlideshowRequest + Used By: Content + */ + + class SlideshowRequest: Codable { + public var slug: String? + + public var platform: String? + + public var configuration: ConfigurationSchema? + + public var media: SlideshowMedia? + + public var active: Bool? + + public enum CodingKeys: String, CodingKey { + case slug + + case platform + + case configuration + + case media + + case active + } + + public init(active: Bool?, configuration: ConfigurationSchema?, media: SlideshowMedia?, platform: String?, slug: String?) { + self.slug = slug + + self.platform = platform + + self.configuration = configuration + + self.media = media + + self.active = active + } + + public func duplicate() -> SlideshowRequest { + let dict = self.dictionary! + let copy = SlideshowRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode(String.self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + configuration = try container.decode(ConfigurationSchema.self, forKey: .configuration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + media = try container.decode(SlideshowMedia.self, forKey: .media) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(platform, forKey: .platform) + + try? container.encodeIfPresent(configuration, forKey: .configuration) + + try? container.encodeIfPresent(media, forKey: .media) + + try? container.encodeIfPresent(active, forKey: .active) + } + } + + /* + Model: Support + Used By: Content + */ + + class Support: Codable { + public var created: Bool? + + public var id: String? + + public var configType: String? + + public var application: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var contact: ContactSchema? + + public enum CodingKeys: String, CodingKey { + case created + + case id = "_id" + + case configType = "config_type" + + case application + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case contact + } + + public init(application: String?, configType: String?, contact: ContactSchema?, created: Bool?, createdAt: String?, updatedAt: String?, id: String?) { + self.created = created + + self.id = id + + self.configType = configType + + self.application = application + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.contact = contact + } + + public func duplicate() -> Support { + let dict = self.dictionary! + let copy = Support(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + created = try container.decode(Bool.self, forKey: .created) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + configType = try container.decode(String.self, forKey: .configType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contact = try container.decode(ContactSchema.self, forKey: .contact) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(created, forKey: .created) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(configType, forKey: .configType) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(contact, forKey: .contact) + } + } + + /* + Model: PhoneProperties + Used By: Content + */ + + class PhoneProperties: Codable { + public var key: String? + + public var code: String? + + public var number: String? + + public enum CodingKeys: String, CodingKey { + case key + + case code + + case number + } + + public init(code: String?, key: String?, number: String?) { + self.key = key + + self.code = code + + self.number = number + } + + public func duplicate() -> PhoneProperties { + let dict = self.dictionary! + let copy = PhoneProperties(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + number = try container.decode(String.self, forKey: .number) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(number, forKey: .number) + } + } + + /* + Model: PhoneSchema + Used By: Content + */ + + class PhoneSchema: Codable { + public var active: Bool? + + public var phone: [PhoneProperties]? + + public enum CodingKeys: String, CodingKey { + case active + + case phone + } + + public init(active: Bool?, phone: [PhoneProperties]?) { + self.active = active + + self.phone = phone + } + + public func duplicate() -> PhoneSchema { + let dict = self.dictionary! + let copy = PhoneSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode([PhoneProperties].self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(phone, forKey: .phone) + } + } + + /* + Model: EmailProperties + Used By: Content + */ + + class EmailProperties: Codable { + public var key: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case key + + case value + } + + public init(key: String?, value: String?) { + self.key = key + + self.value = value + } + + public func duplicate() -> EmailProperties { + let dict = self.dictionary! + let copy = EmailProperties(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + key = try container.decode(String.self, forKey: .key) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: EmailSchema + Used By: Content + */ + + class EmailSchema: Codable { + public var active: Bool? + + public var email: [EmailProperties]? + + public enum CodingKeys: String, CodingKey { + case active + + case email + } + + public init(active: Bool?, email: [EmailProperties]?) { + self.active = active + + self.email = email + } + + public func duplicate() -> EmailSchema { + let dict = self.dictionary! + let copy = EmailSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode([EmailProperties].self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(email, forKey: .email) + } + } + + /* + Model: ContactSchema + Used By: Content + */ + + class ContactSchema: Codable { + public var phone: PhoneSchema? + + public var email: EmailSchema? + + public enum CodingKeys: String, CodingKey { + case phone + + case email + } + + public init(email: EmailSchema?, phone: PhoneSchema?) { + self.phone = phone + + self.email = email + } + + public func duplicate() -> ContactSchema { + let dict = self.dictionary! + let copy = ContactSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + phone = try container.decode(PhoneSchema.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(EmailSchema.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(email, forKey: .email) + } + } + + /* + Model: TagsSchema + Used By: Content + */ + + class TagsSchema: Codable { + public var application: String? + + public var id: String? + + public var tags: [TagSchema]? + + public enum CodingKeys: String, CodingKey { + case application + + case id = "_id" + + case tags + } + + public init(application: String?, tags: [TagSchema]?, id: String?) { + self.application = application + + self.id = id + + self.tags = tags + } + + public func duplicate() -> TagsSchema { + let dict = self.dictionary! + let copy = TagsSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([TagSchema].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: TagSchema + Used By: Content + */ + + class TagSchema: Codable { + public var name: String? + + public var url: String? + + public var type: String? + + public var subType: String? + + public var id: String? + + public var position: String? + + public var attributes: [String: Any]? + + public var content: String? + + public var source: TagSourceSchema? + + public enum CodingKeys: String, CodingKey { + case name + + case url + + case type + + case subType = "sub_type" + + case id = "_id" + + case position + + case attributes + + case content + + case source = "__source" + } + + public init(attributes: [String: Any]?, content: String?, name: String?, position: String?, subType: String?, type: String?, url: String?, id: String?, source: TagSourceSchema?) { + self.name = name + + self.url = url + + self.type = type + + self.subType = subType + + self.id = id + + self.position = position + + self.attributes = attributes + + self.content = content + + self.source = source + } + + public func duplicate() -> TagSchema { + let dict = self.dictionary! + let copy = TagSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subType = try container.decode(String.self, forKey: .subType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + position = try container.decode(String.self, forKey: .position) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributes = try container.decode([String: Any].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode(String.self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + source = try container.decode(TagSourceSchema.self, forKey: .source) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(subType, forKey: .subType) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(position, forKey: .position) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(source, forKey: .source) + } + } + + /* + Model: TagSourceSchema + Used By: Content + */ + + class TagSourceSchema: Codable { + public var type: String? + + public var id: String? + + public enum CodingKeys: String, CodingKey { + case type + + case id + } + + public init(id: String?, type: String?) { + self.type = type + + self.id = id + } + + public func duplicate() -> TagSourceSchema { + let dict = self.dictionary! + let copy = TagSourceSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(id, forKey: .id) + } + } +} diff --git a/Sources/code/platform/models/DiscountPlatformModelClass.swift b/Sources/code/platform/models/DiscountPlatformModelClass.swift new file mode 100644 index 0000000000..5263c76e4e --- /dev/null +++ b/Sources/code/platform/models/DiscountPlatformModelClass.swift @@ -0,0 +1,805 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: ValidityObject + Used By: Discount + */ + + class ValidityObject: Codable { + public var start: String + + public var end: String + + public enum CodingKeys: String, CodingKey { + case start + + case end + } + + public init(end: String, start: String) { + self.start = start + + self.end = end + } + + public func duplicate() -> ValidityObject { + let dict = self.dictionary! + let copy = ValidityObject(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + start = try container.decode(String.self, forKey: .start) + + end = try container.decode(String.self, forKey: .end) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(start, forKey: .start) + + try? container.encodeIfPresent(end, forKey: .end) + } + } + + /* + Model: CreateUpdateDiscount + Used By: Discount + */ + + class CreateUpdateDiscount: Codable { + public var name: String + + public var companyId: Int + + public var isActive: Bool + + public var appIds: [String] + + public var extensionIds: [String] + + public var jobType: String + + public var discountType: String + + public var discountLevel: String + + public var value: Int? + + public var filePath: String? + + public var brandIds: [Int]? + + public var storeIds: [Int]? + + public var validity: ValidityObject + + public enum CodingKeys: String, CodingKey { + case name + + case companyId = "company_id" + + case isActive = "is_active" + + case appIds = "app_ids" + + case extensionIds = "extension_ids" + + case jobType = "job_type" + + case discountType = "discount_type" + + case discountLevel = "discount_level" + + case value + + case filePath = "file_path" + + case brandIds = "brand_ids" + + case storeIds = "store_ids" + + case validity + } + + public init(appIds: [String], brandIds: [Int]?, companyId: Int, discountLevel: String, discountType: String, extensionIds: [String], filePath: String?, isActive: Bool, jobType: String, name: String, storeIds: [Int]?, validity: ValidityObject, value: Int?) { + self.name = name + + self.companyId = companyId + + self.isActive = isActive + + self.appIds = appIds + + self.extensionIds = extensionIds + + self.jobType = jobType + + self.discountType = discountType + + self.discountLevel = discountLevel + + self.value = value + + self.filePath = filePath + + self.brandIds = brandIds + + self.storeIds = storeIds + + self.validity = validity + } + + public func duplicate() -> CreateUpdateDiscount { + let dict = self.dictionary! + let copy = CreateUpdateDiscount(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + name = try container.decode(String.self, forKey: .name) + + companyId = try container.decode(Int.self, forKey: .companyId) + + isActive = try container.decode(Bool.self, forKey: .isActive) + + appIds = try container.decode([String].self, forKey: .appIds) + + extensionIds = try container.decode([String].self, forKey: .extensionIds) + + jobType = try container.decode(String.self, forKey: .jobType) + + discountType = try container.decode(String.self, forKey: .discountType) + + discountLevel = try container.decode(String.self, forKey: .discountLevel) + + do { + value = try container.decode(Int.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filePath = try container.decode(String.self, forKey: .filePath) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandIds = try container.decode([Int].self, forKey: .brandIds) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeIds = try container.decode([Int].self, forKey: .storeIds) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + validity = try container.decode(ValidityObject.self, forKey: .validity) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(appIds, forKey: .appIds) + + try? container.encodeIfPresent(extensionIds, forKey: .extensionIds) + + try? container.encodeIfPresent(jobType, forKey: .jobType) + + try? container.encodeIfPresent(discountType, forKey: .discountType) + + try? container.encodeIfPresent(discountLevel, forKey: .discountLevel) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(filePath, forKey: .filePath) + + try? container.encodeIfPresent(brandIds, forKey: .brandIds) + + try? container.encodeIfPresent(storeIds, forKey: .storeIds) + + try? container.encodeIfPresent(validity, forKey: .validity) + } + } + + /* + Model: DiscountJob + Used By: Discount + */ + + class DiscountJob: Codable { + public var id: String + + public var name: String + + public var companyId: Int + + public var isActive: Bool + + public var appIds: [String]? + + public var jobType: String? + + public var discountType: String? + + public var discountLevel: String? + + public var value: Int? + + public var filePath: String? + + public var brandIds: [Int]? + + public var storeIds: [Int]? + + public var validity: ValidityObject + + public var createdOn: String + + public var modifiedOn: String + + public var createdBy: UserDetails + + public var modifiedBy: UserDetails + + public var meta: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case name + + case companyId = "company_id" + + case isActive = "is_active" + + case appIds = "app_ids" + + case jobType = "job_type" + + case discountType = "discount_type" + + case discountLevel = "discount_level" + + case value + + case filePath = "file_path" + + case brandIds = "brand_ids" + + case storeIds = "store_ids" + + case validity + + case createdOn = "created_on" + + case modifiedOn = "modified_on" + + case createdBy = "created_by" + + case modifiedBy = "modified_by" + + case meta + } + + public init(appIds: [String]?, brandIds: [Int]?, companyId: Int, createdBy: UserDetails, createdOn: String, discountLevel: String?, discountType: String?, filePath: String?, isActive: Bool, jobType: String?, meta: [String: Any]?, modifiedBy: UserDetails, modifiedOn: String, name: String, storeIds: [Int]?, validity: ValidityObject, value: Int?, id: String) { + self.id = id + + self.name = name + + self.companyId = companyId + + self.isActive = isActive + + self.appIds = appIds + + self.jobType = jobType + + self.discountType = discountType + + self.discountLevel = discountLevel + + self.value = value + + self.filePath = filePath + + self.brandIds = brandIds + + self.storeIds = storeIds + + self.validity = validity + + self.createdOn = createdOn + + self.modifiedOn = modifiedOn + + self.createdBy = createdBy + + self.modifiedBy = modifiedBy + + self.meta = meta + } + + public func duplicate() -> DiscountJob { + let dict = self.dictionary! + let copy = DiscountJob(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + id = try container.decode(String.self, forKey: .id) + + name = try container.decode(String.self, forKey: .name) + + companyId = try container.decode(Int.self, forKey: .companyId) + + isActive = try container.decode(Bool.self, forKey: .isActive) + + do { + appIds = try container.decode([String].self, forKey: .appIds) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + jobType = try container.decode(String.self, forKey: .jobType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discountType = try container.decode(String.self, forKey: .discountType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discountLevel = try container.decode(String.self, forKey: .discountLevel) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(Int.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filePath = try container.decode(String.self, forKey: .filePath) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandIds = try container.decode([Int].self, forKey: .brandIds) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeIds = try container.decode([Int].self, forKey: .storeIds) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + validity = try container.decode(ValidityObject.self, forKey: .validity) + + createdOn = try container.decode(String.self, forKey: .createdOn) + + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + createdBy = try container.decode(UserDetails.self, forKey: .createdBy) + + modifiedBy = try container.decode(UserDetails.self, forKey: .modifiedBy) + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(appIds, forKey: .appIds) + + try? container.encodeIfPresent(jobType, forKey: .jobType) + + try? container.encodeIfPresent(discountType, forKey: .discountType) + + try? container.encodeIfPresent(discountLevel, forKey: .discountLevel) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(filePath, forKey: .filePath) + + try? container.encodeIfPresent(brandIds, forKey: .brandIds) + + try? container.encodeIfPresent(storeIds, forKey: .storeIds) + + try? container.encodeIfPresent(validity, forKey: .validity) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(meta, forKey: .meta) + } + } + + /* + Model: ListOrCalender + Used By: Discount + */ + + class ListOrCalender: Codable { + public var items: [DiscountJob] + + public var page: Page + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [DiscountJob], page: Page) { + self.items = items + + self.page = page + } + + public func duplicate() -> ListOrCalender { + let dict = self.dictionary! + let copy = ListOrCalender(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + items = try container.decode([DiscountJob].self, forKey: .items) + + page = try container.decode(Page.self, forKey: .page) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: FileJobResponse + Used By: Discount + */ + + class FileJobResponse: Codable { + public var stage: String + + public var total: Int + + public var failed: Int + + public var companyId: Int + + public var body: [String: Any]? + + public var type: String + + public var fileType: String + + public enum CodingKeys: String, CodingKey { + case stage + + case total + + case failed + + case companyId = "company_id" + + case body + + case type + + case fileType = "file_type" + } + + public init(body: [String: Any]?, companyId: Int, failed: Int, fileType: String, stage: String, total: Int, type: String) { + self.stage = stage + + self.total = total + + self.failed = failed + + self.companyId = companyId + + self.body = body + + self.type = type + + self.fileType = fileType + } + + public func duplicate() -> FileJobResponse { + let dict = self.dictionary! + let copy = FileJobResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + stage = try container.decode(String.self, forKey: .stage) + + total = try container.decode(Int.self, forKey: .total) + + failed = try container.decode(Int.self, forKey: .failed) + + companyId = try container.decode(Int.self, forKey: .companyId) + + do { + body = try container.decode([String: Any].self, forKey: .body) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + type = try container.decode(String.self, forKey: .type) + + fileType = try container.decode(String.self, forKey: .fileType) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(stage, forKey: .stage) + + try? container.encodeIfPresent(total, forKey: .total) + + try? container.encodeIfPresent(failed, forKey: .failed) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(body, forKey: .body) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(fileType, forKey: .fileType) + } + } + + /* + Model: DownloadFileJob + Used By: Discount + */ + + class DownloadFileJob: Codable { + public var brandIds: [Int]? + + public var storeIds: [Int]? + + public enum CodingKeys: String, CodingKey { + case brandIds = "brand_ids" + + case storeIds = "store_ids" + } + + public init(brandIds: [Int]?, storeIds: [Int]?) { + self.brandIds = brandIds + + self.storeIds = storeIds + } + + public func duplicate() -> DownloadFileJob { + let dict = self.dictionary! + let copy = DownloadFileJob(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + brandIds = try container.decode([Int].self, forKey: .brandIds) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeIds = try container.decode([Int].self, forKey: .storeIds) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(brandIds, forKey: .brandIds) + + try? container.encodeIfPresent(storeIds, forKey: .storeIds) + } + } + + /* + Model: CancelJobResponse + Used By: Discount + */ + + class CancelJobResponse: Codable { + public var success: Bool + + public enum CodingKeys: String, CodingKey { + case success + } + + public init(success: Bool) { + self.success = success + } + + public func duplicate() -> CancelJobResponse { + let dict = self.dictionary! + let copy = CancelJobResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: UserDetails + Used By: Discount + */ + + class UserDetails: Codable { + public var username: String + + public var userId: String + + public enum CodingKeys: String, CodingKey { + case username + + case userId = "user_id" + } + + public init(username: String, userId: String) { + self.username = username + + self.userId = userId + } + + public func duplicate() -> UserDetails { + let dict = self.dictionary! + let copy = UserDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + username = try container.decode(String.self, forKey: .username) + + userId = try container.decode(String.self, forKey: .userId) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(username, forKey: .username) + + try? container.encodeIfPresent(userId, forKey: .userId) + } + } + + /* + Model: BadRequestObject + Used By: Discount + */ + + class BadRequestObject: Codable { + public var message: String + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String) { + self.message = message + } + + public func duplicate() -> BadRequestObject { + let dict = self.dictionary! + let copy = BadRequestObject(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + message = try container.decode(String.self, forKey: .message) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } +} diff --git a/Sources/code/platform/models/FeedbackPlatformModelClass.swift b/Sources/code/platform/models/FeedbackPlatformModelClass.swift new file mode 100644 index 0000000000..92b3b9f71e --- /dev/null +++ b/Sources/code/platform/models/FeedbackPlatformModelClass.swift @@ -0,0 +1,3834 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: Activity + Used By: Feedback + */ + + class Activity: Codable { + public var currentState: [String: Any]? + + public var documentId: String? + + public var previousState: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case currentState = "current_state" + + case documentId = "document_id" + + case previousState = "previous_state" + } + + public init(currentState: [String: Any]?, documentId: String?, previousState: [String: Any]?) { + self.currentState = currentState + + self.documentId = documentId + + self.previousState = previousState + } + + public func duplicate() -> Activity { + let dict = self.dictionary! + let copy = Activity(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + currentState = try container.decode([String: Any].self, forKey: .currentState) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + documentId = try container.decode(String.self, forKey: .documentId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + previousState = try container.decode([String: Any].self, forKey: .previousState) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(currentState, forKey: .currentState) + + try? container.encodeIfPresent(documentId, forKey: .documentId) + + try? container.encodeIfPresent(previousState, forKey: .previousState) + } + } + + /* + Model: ActivityDump + Used By: Feedback + */ + + class ActivityDump: Codable { + public var activity: Activity? + + public var createdBy: CreatedBy? + + public var dateMeta: DateMeta? + + public var id: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case activity + + case createdBy = "created_by" + + case dateMeta = "date_meta" + + case id + + case type + } + + public init(activity: Activity?, createdBy: CreatedBy?, dateMeta: DateMeta?, id: String?, type: String?) { + self.activity = activity + + self.createdBy = createdBy + + self.dateMeta = dateMeta + + self.id = id + + self.type = type + } + + public func duplicate() -> ActivityDump { + let dict = self.dictionary! + let copy = ActivityDump(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + activity = try container.decode(Activity.self, forKey: .activity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(CreatedBy.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(activity, forKey: .activity) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: AddMediaListRequest + Used By: Feedback + */ + + class AddMediaListRequest: Codable { + public var entityId: String? + + public var entityType: String? + + public var mediaList: [AddMediaRequest]? + + public var refId: String? + + public var refType: String? + + public enum CodingKeys: String, CodingKey { + case entityId = "entity_id" + + case entityType = "entity_type" + + case mediaList = "media_list" + + case refId = "ref_id" + + case refType = "ref_type" + } + + public init(entityId: String?, entityType: String?, mediaList: [AddMediaRequest]?, refId: String?, refType: String?) { + self.entityId = entityId + + self.entityType = entityType + + self.mediaList = mediaList + + self.refId = refId + + self.refType = refType + } + + public func duplicate() -> AddMediaListRequest { + let dict = self.dictionary! + let copy = AddMediaListRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + entityId = try container.decode(String.self, forKey: .entityId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entityType = try container.decode(String.self, forKey: .entityType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mediaList = try container.decode([AddMediaRequest].self, forKey: .mediaList) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refId = try container.decode(String.self, forKey: .refId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refType = try container.decode(String.self, forKey: .refType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(entityId, forKey: .entityId) + + try? container.encodeIfPresent(entityType, forKey: .entityType) + + try? container.encodeIfPresent(mediaList, forKey: .mediaList) + + try? container.encodeIfPresent(refId, forKey: .refId) + + try? container.encodeIfPresent(refType, forKey: .refType) + } + } + + /* + Model: AddMediaRequest + Used By: Feedback + */ + + class AddMediaRequest: Codable { + public var cloudId: String? + + public var cloudName: String? + + public var cloudProvider: String? + + public var entityId: String? + + public var entityType: String? + + public var mediaUrl: String? + + public var refId: String? + + public var refType: String? + + public var tags: [String]? + + public var thumbnailUrl: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case cloudId = "cloud_id" + + case cloudName = "cloud_name" + + case cloudProvider = "cloud_provider" + + case entityId = "entity_id" + + case entityType = "entity_type" + + case mediaUrl = "media_url" + + case refId = "ref_id" + + case refType = "ref_type" + + case tags + + case thumbnailUrl = "thumbnail_url" + + case type + } + + public init(cloudId: String?, cloudName: String?, cloudProvider: String?, entityId: String?, entityType: String?, mediaUrl: String?, refId: String?, refType: String?, tags: [String]?, thumbnailUrl: String?, type: String?) { + self.cloudId = cloudId + + self.cloudName = cloudName + + self.cloudProvider = cloudProvider + + self.entityId = entityId + + self.entityType = entityType + + self.mediaUrl = mediaUrl + + self.refId = refId + + self.refType = refType + + self.tags = tags + + self.thumbnailUrl = thumbnailUrl + + self.type = type + } + + public func duplicate() -> AddMediaRequest { + let dict = self.dictionary! + let copy = AddMediaRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + cloudId = try container.decode(String.self, forKey: .cloudId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cloudName = try container.decode(String.self, forKey: .cloudName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cloudProvider = try container.decode(String.self, forKey: .cloudProvider) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entityId = try container.decode(String.self, forKey: .entityId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entityType = try container.decode(String.self, forKey: .entityType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mediaUrl = try container.decode(String.self, forKey: .mediaUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refId = try container.decode(String.self, forKey: .refId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refType = try container.decode(String.self, forKey: .refType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + thumbnailUrl = try container.decode(String.self, forKey: .thumbnailUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(cloudId, forKey: .cloudId) + + try? container.encodeIfPresent(cloudName, forKey: .cloudName) + + try? container.encodeIfPresent(cloudProvider, forKey: .cloudProvider) + + try? container.encodeIfPresent(entityId, forKey: .entityId) + + try? container.encodeIfPresent(entityType, forKey: .entityType) + + try? container.encodeIfPresent(mediaUrl, forKey: .mediaUrl) + + try? container.encodeIfPresent(refId, forKey: .refId) + + try? container.encodeIfPresent(refType, forKey: .refType) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(thumbnailUrl, forKey: .thumbnailUrl) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: ApproveRequest + Used By: Feedback + */ + + class ApproveRequest: Codable { + public var approve: Bool? + + public var entityType: String? + + public var id: String + + public var reason: String? + + public enum CodingKeys: String, CodingKey { + case approve + + case entityType = "entity_type" + + case id + + case reason + } + + public init(approve: Bool?, entityType: String?, id: String, reason: String?) { + self.approve = approve + + self.entityType = entityType + + self.id = id + + self.reason = reason + } + + public func duplicate() -> ApproveRequest { + let dict = self.dictionary! + let copy = ApproveRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + approve = try container.decode(Bool.self, forKey: .approve) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entityType = try container.decode(String.self, forKey: .entityType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + id = try container.decode(String.self, forKey: .id) + + do { + reason = try container.decode(String.self, forKey: .reason) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(approve, forKey: .approve) + + try? container.encodeIfPresent(entityType, forKey: .entityType) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(reason, forKey: .reason) + } + } + + /* + Model: Attribute + Used By: Feedback + */ + + class Attribute: Codable { + public var dateMeta: DateMeta? + + public var description: String? + + public var id: String? + + public var name: String? + + public var slug: String? + + public var tags: [TagMeta]? + + public enum CodingKeys: String, CodingKey { + case dateMeta = "date_meta" + + case description + + case id + + case name + + case slug + + case tags + } + + public init(dateMeta: DateMeta?, description: String?, id: String?, name: String?, slug: String?, tags: [TagMeta]?) { + self.dateMeta = dateMeta + + self.description = description + + self.id = id + + self.name = name + + self.slug = slug + + self.tags = tags + } + + public func duplicate() -> Attribute { + let dict = self.dictionary! + let copy = Attribute(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([TagMeta].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: AttributeObject + Used By: Feedback + */ + + class AttributeObject: Codable { + public var description: String? + + public var name: String + + public var slug: String? + + public var title: String? + + public var type: String + + public var value: Double + + public enum CodingKeys: String, CodingKey { + case description + + case name + + case slug + + case title + + case type + + case value + } + + public init(description: String?, name: String, slug: String?, title: String?, type: String, value: Double) { + self.description = description + + self.name = name + + self.slug = slug + + self.title = title + + self.type = type + + self.value = value + } + + public func duplicate() -> AttributeObject { + let dict = self.dictionary! + let copy = AttributeObject(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + name = try container.decode(String.self, forKey: .name) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + type = try container.decode(String.self, forKey: .type) + + value = try container.decode(Double.self, forKey: .value) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: CreatedBy + Used By: Feedback + */ + + class CreatedBy: Codable { + public var id: String? + + public var name: String? + + public var tags: [TagMeta]? + + public enum CodingKeys: String, CodingKey { + case id + + case name + + case tags + } + + public init(id: String?, name: String?, tags: [TagMeta]?) { + self.id = id + + self.name = name + + self.tags = tags + } + + public func duplicate() -> CreatedBy { + let dict = self.dictionary! + let copy = CreatedBy(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([TagMeta].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: CursorGetResponse + Used By: Feedback + */ + + class CursorGetResponse: Codable { + public var items: [[String: Any]]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [[String: Any]]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> CursorGetResponse { + let dict = self.dictionary! + let copy = CursorGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([[String: Any]].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: DateMeta + Used By: Feedback + */ + + class DateMeta: Codable { + public var createdOn: String? + + public var modifiedOn: String? + + public enum CodingKeys: String, CodingKey { + case createdOn = "created_on" + + case modifiedOn = "modified_on" + } + + public init(createdOn: String?, modifiedOn: String?) { + self.createdOn = createdOn + + self.modifiedOn = modifiedOn + } + + public func duplicate() -> DateMeta { + let dict = self.dictionary! + let copy = DateMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + } + } + + /* + Model: DeviceMeta + Used By: Feedback + */ + + class DeviceMeta: Codable { + public var appVersion: String? + + public var platform: String? + + public enum CodingKeys: String, CodingKey { + case appVersion = "app_version" + + case platform + } + + public init(appVersion: String?, platform: String?) { + self.appVersion = appVersion + + self.platform = platform + } + + public func duplicate() -> DeviceMeta { + let dict = self.dictionary! + let copy = DeviceMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + appVersion = try container.decode(String.self, forKey: .appVersion) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode(String.self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appVersion, forKey: .appVersion) + + try? container.encodeIfPresent(platform, forKey: .platform) + } + } + + /* + Model: Entity + Used By: Feedback + */ + + class Entity: Codable { + public var id: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case id + + case type + } + + public init(id: String?, type: String?) { + self.id = id + + self.type = type + } + + public func duplicate() -> Entity { + let dict = self.dictionary! + let copy = Entity(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: EntityRequest + Used By: Feedback + */ + + class EntityRequest: Codable { + public var entityId: String? + + public var entityType: String? + + public enum CodingKeys: String, CodingKey { + case entityId = "entity_id" + + case entityType = "entity_type" + } + + public init(entityId: String?, entityType: String?) { + self.entityId = entityId + + self.entityType = entityType + } + + public func duplicate() -> EntityRequest { + let dict = self.dictionary! + let copy = EntityRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + entityId = try container.decode(String.self, forKey: .entityId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entityType = try container.decode(String.self, forKey: .entityType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(entityId, forKey: .entityId) + + try? container.encodeIfPresent(entityType, forKey: .entityType) + } + } + + /* + Model: FeedbackAttributes + Used By: Feedback + */ + + class FeedbackAttributes: Codable { + public var items: [Attribute]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [Attribute]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> FeedbackAttributes { + let dict = self.dictionary! + let copy = FeedbackAttributes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Attribute].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: FeedbackError + Used By: Feedback + */ + + class FeedbackError: Codable { + public var code: [String: Any]? + + public var exception: String? + + public var info: String? + + public var message: String? + + public var meta: [String: Any]? + + public var requestId: String? + + public var stackTrace: String? + + public var status: Int? + + public enum CodingKeys: String, CodingKey { + case code + + case exception + + case info + + case message + + case meta + + case requestId = "request_id" + + case stackTrace = "stack_trace" + + case status + } + + public init(code: [String: Any]?, exception: String?, info: String?, message: String?, meta: [String: Any]?, requestId: String?, stackTrace: String?, status: Int?) { + self.code = code + + self.exception = exception + + self.info = info + + self.message = message + + self.meta = meta + + self.requestId = requestId + + self.stackTrace = stackTrace + + self.status = status + } + + public func duplicate() -> FeedbackError { + let dict = self.dictionary! + let copy = FeedbackError(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + code = try container.decode([String: Any].self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + exception = try container.decode(String.self, forKey: .exception) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + info = try container.decode(String.self, forKey: .info) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stackTrace = try container.decode(String.self, forKey: .stackTrace) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Int.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(exception, forKey: .exception) + + try? container.encodeIfPresent(info, forKey: .info) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(stackTrace, forKey: .stackTrace) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: FeedbackState + Used By: Feedback + */ + + class FeedbackState: Codable { + public var active: Bool? + + public var archive: Bool? + + public var media: String? + + public var qna: Bool? + + public var rating: Bool? + + public var review: Bool? + + public enum CodingKeys: String, CodingKey { + case active + + case archive + + case media + + case qna + + case rating + + case review + } + + public init(active: Bool?, archive: Bool?, media: String?, qna: Bool?, rating: Bool?, review: Bool?) { + self.active = active + + self.archive = archive + + self.media = media + + self.qna = qna + + self.rating = rating + + self.review = review + } + + public func duplicate() -> FeedbackState { + let dict = self.dictionary! + let copy = FeedbackState(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archive = try container.decode(Bool.self, forKey: .archive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + media = try container.decode(String.self, forKey: .media) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + qna = try container.decode(Bool.self, forKey: .qna) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rating = try container.decode(Bool.self, forKey: .rating) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + review = try container.decode(Bool.self, forKey: .review) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(archive, forKey: .archive) + + try? container.encodeIfPresent(media, forKey: .media) + + try? container.encodeIfPresent(qna, forKey: .qna) + + try? container.encodeIfPresent(rating, forKey: .rating) + + try? container.encodeIfPresent(review, forKey: .review) + } + } + + /* + Model: GetResponse + Used By: Feedback + */ + + class GetResponse: Codable { + public var data: [String: Any]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case data + + case page + } + + public init(data: [String: Any]?, page: Page?) { + self.data = data + + self.page = page + } + + public func duplicate() -> GetResponse { + let dict = self.dictionary! + let copy = GetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + data = try container.decode([String: Any].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: GetReviewResponse + Used By: Feedback + */ + + class GetReviewResponse: Codable { + public var facets: [ReviewFacet]? + + public var items: [[String: Any]]? + + public var page: Page? + + public var sort: [SortMethod]? + + public enum CodingKeys: String, CodingKey { + case facets + + case items + + case page + + case sort + } + + public init(facets: [ReviewFacet]?, items: [[String: Any]]?, page: Page?, sort: [SortMethod]?) { + self.facets = facets + + self.items = items + + self.page = page + + self.sort = sort + } + + public func duplicate() -> GetReviewResponse { + let dict = self.dictionary! + let copy = GetReviewResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + facets = try container.decode([ReviewFacet].self, forKey: .facets) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([[String: Any]].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sort = try container.decode([SortMethod].self, forKey: .sort) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(facets, forKey: .facets) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(sort, forKey: .sort) + } + } + + /* + Model: InsertResponse + Used By: Feedback + */ + + class InsertResponse: Codable { + public var count: Int? + + public enum CodingKeys: String, CodingKey { + case count + } + + public init(count: Int?) { + self.count = count + } + + public func duplicate() -> InsertResponse { + let dict = self.dictionary! + let copy = InsertResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(count, forKey: .count) + } + } + + /* + Model: MediaMeta + Used By: Feedback + */ + + class MediaMeta: Codable { + public var maxCount: Int? + + public var size: Int? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case maxCount = "max_count" + + case size + + case type + } + + public init(maxCount: Int?, size: Int?, type: String?) { + self.maxCount = maxCount + + self.size = size + + self.type = type + } + + public func duplicate() -> MediaMeta { + let dict = self.dictionary! + let copy = MediaMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + maxCount = try container.decode(Int.self, forKey: .maxCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(Int.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(maxCount, forKey: .maxCount) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: MediaMetaRequest + Used By: Feedback + */ + + class MediaMetaRequest: Codable { + public var maxCount: Int + + public var size: Int + + public enum CodingKeys: String, CodingKey { + case maxCount = "max_count" + + case size + } + + public init(maxCount: Int, size: Int) { + self.maxCount = maxCount + + self.size = size + } + + public func duplicate() -> MediaMetaRequest { + let dict = self.dictionary! + let copy = MediaMetaRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + maxCount = try container.decode(Int.self, forKey: .maxCount) + + size = try container.decode(Int.self, forKey: .size) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(maxCount, forKey: .maxCount) + + try? container.encodeIfPresent(size, forKey: .size) + } + } + + /* + Model: NumberGetResponse + Used By: Feedback + */ + + class NumberGetResponse: Codable { + public var items: [[String: Any]]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [[String: Any]]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> NumberGetResponse { + let dict = self.dictionary! + let copy = NumberGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([[String: Any]].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: PageCursor + Used By: Feedback + */ + + class PageCursor: Codable { + public var current: Int? + + public var hasNext: Bool? + + public var hasPrevious: Bool? + + public var itemTotal: Int? + + public var nextId: String? + + public var size: Int + + public var type: String + + public enum CodingKeys: String, CodingKey { + case current + + case hasNext = "has_next" + + case hasPrevious = "has_previous" + + case itemTotal = "item_total" + + case nextId = "next_id" + + case size + + case type + } + + public init(current: Int?, hasNext: Bool?, hasPrevious: Bool?, itemTotal: Int?, nextId: String?, size: Int, type: String) { + self.current = current + + self.hasNext = hasNext + + self.hasPrevious = hasPrevious + + self.itemTotal = itemTotal + + self.nextId = nextId + + self.size = size + + self.type = type + } + + public func duplicate() -> PageCursor { + let dict = self.dictionary! + let copy = PageCursor(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + current = try container.decode(Int.self, forKey: .current) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasNext = try container.decode(Bool.self, forKey: .hasNext) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasPrevious = try container.decode(Bool.self, forKey: .hasPrevious) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemTotal = try container.decode(Int.self, forKey: .itemTotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + nextId = try container.decode(String.self, forKey: .nextId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + size = try container.decode(Int.self, forKey: .size) + + type = try container.decode(String.self, forKey: .type) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(current, forKey: .current) + + try? container.encodeIfPresent(hasNext, forKey: .hasNext) + + try? container.encodeIfPresent(hasPrevious, forKey: .hasPrevious) + + try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) + + try? container.encodeIfPresent(nextId, forKey: .nextId) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: PageNumber + Used By: Feedback + */ + + class PageNumber: Codable { + public var current: Int? + + public var hasNext: Bool? + + public var itemTotal: Int? + + public var size: Int? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case current + + case hasNext = "has_next" + + case itemTotal = "item_total" + + case size + + case type + } + + public init(current: Int?, hasNext: Bool?, itemTotal: Int?, size: Int?, type: String?) { + self.current = current + + self.hasNext = hasNext + + self.itemTotal = itemTotal + + self.size = size + + self.type = type + } + + public func duplicate() -> PageNumber { + let dict = self.dictionary! + let copy = PageNumber(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + current = try container.decode(Int.self, forKey: .current) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasNext = try container.decode(Bool.self, forKey: .hasNext) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemTotal = try container.decode(Int.self, forKey: .itemTotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(Int.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(current, forKey: .current) + + try? container.encodeIfPresent(hasNext, forKey: .hasNext) + + try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: Rating + Used By: Feedback + */ + + class Rating: Codable { + public var attributes: [Attribute]? + + public var attributesSlugs: [String]? + + public var ui: UI? + + public enum CodingKeys: String, CodingKey { + case attributes + + case attributesSlugs = "attributes_slugs" + + case ui + } + + public init(attributes: [Attribute]?, attributesSlugs: [String]?, ui: UI?) { + self.attributes = attributes + + self.attributesSlugs = attributesSlugs + + self.ui = ui + } + + public func duplicate() -> Rating { + let dict = self.dictionary! + let copy = Rating(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + attributes = try container.decode([Attribute].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributesSlugs = try container.decode([String].self, forKey: .attributesSlugs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ui = try container.decode(UI.self, forKey: .ui) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + + try? container.encodeIfPresent(attributesSlugs, forKey: .attributesSlugs) + + try? container.encodeIfPresent(ui, forKey: .ui) + } + } + + /* + Model: RatingRequest + Used By: Feedback + */ + + class RatingRequest: Codable { + public var attributes: [String] + + public var ui: UI? + + public enum CodingKeys: String, CodingKey { + case attributes + + case ui + } + + public init(attributes: [String], ui: UI?) { + self.attributes = attributes + + self.ui = ui + } + + public func duplicate() -> RatingRequest { + let dict = self.dictionary! + let copy = RatingRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + attributes = try container.decode([String].self, forKey: .attributes) + + do { + ui = try container.decode(UI.self, forKey: .ui) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + + try? container.encodeIfPresent(ui, forKey: .ui) + } + } + + /* + Model: ReportAbuseRequest + Used By: Feedback + */ + + class ReportAbuseRequest: Codable { + public var description: String? + + public var entityId: String + + public var entityType: String + + public enum CodingKeys: String, CodingKey { + case description + + case entityId = "entity_id" + + case entityType = "entity_type" + } + + public init(description: String?, entityId: String, entityType: String) { + self.description = description + + self.entityId = entityId + + self.entityType = entityType + } + + public func duplicate() -> ReportAbuseRequest { + let dict = self.dictionary! + let copy = ReportAbuseRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + entityId = try container.decode(String.self, forKey: .entityId) + + entityType = try container.decode(String.self, forKey: .entityType) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(entityId, forKey: .entityId) + + try? container.encodeIfPresent(entityType, forKey: .entityType) + } + } + + /* + Model: Review + Used By: Feedback + */ + + class Review: Codable { + public var description: String? + + public var header: String? + + public var imageMeta: MediaMeta? + + public var title: String? + + public var videoMeta: MediaMeta? + + public var voteAllowed: Bool? + + public enum CodingKeys: String, CodingKey { + case description + + case header + + case imageMeta = "image_meta" + + case title + + case videoMeta = "video_meta" + + case voteAllowed = "vote_allowed" + } + + public init(description: String?, header: String?, imageMeta: MediaMeta?, title: String?, videoMeta: MediaMeta?, voteAllowed: Bool?) { + self.description = description + + self.header = header + + self.imageMeta = imageMeta + + self.title = title + + self.videoMeta = videoMeta + + self.voteAllowed = voteAllowed + } + + public func duplicate() -> Review { + let dict = self.dictionary! + let copy = Review(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + header = try container.decode(String.self, forKey: .header) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + imageMeta = try container.decode(MediaMeta.self, forKey: .imageMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + videoMeta = try container.decode(MediaMeta.self, forKey: .videoMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + voteAllowed = try container.decode(Bool.self, forKey: .voteAllowed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(header, forKey: .header) + + try? container.encodeIfPresent(imageMeta, forKey: .imageMeta) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(videoMeta, forKey: .videoMeta) + + try? container.encodeIfPresent(voteAllowed, forKey: .voteAllowed) + } + } + + /* + Model: ReviewFacet + Used By: Feedback + */ + + class ReviewFacet: Codable { + public var display: String? + + public var name: String? + + public var selected: Bool? + + public var slug: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case display + + case name + + case selected + + case slug + + case type + } + + public init(display: String?, name: String?, selected: Bool?, slug: String?, type: String?) { + self.display = display + + self.name = name + + self.selected = selected + + self.slug = slug + + self.type = type + } + + public func duplicate() -> ReviewFacet { + let dict = self.dictionary! + let copy = ReviewFacet(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + selected = try container.decode(Bool.self, forKey: .selected) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(selected, forKey: .selected) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: ReviewRequest + Used By: Feedback + */ + + class ReviewRequest: Codable { + public var description: String + + public var header: String + + public var imageMeta: MediaMetaRequest + + public var isVoteAllowed: Bool + + public var title: String + + public var videoMeta: MediaMetaRequest + + public enum CodingKeys: String, CodingKey { + case description + + case header + + case imageMeta = "image_meta" + + case isVoteAllowed = "is_vote_allowed" + + case title + + case videoMeta = "video_meta" + } + + public init(description: String, header: String, imageMeta: MediaMetaRequest, isVoteAllowed: Bool, title: String, videoMeta: MediaMetaRequest) { + self.description = description + + self.header = header + + self.imageMeta = imageMeta + + self.isVoteAllowed = isVoteAllowed + + self.title = title + + self.videoMeta = videoMeta + } + + public func duplicate() -> ReviewRequest { + let dict = self.dictionary! + let copy = ReviewRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + description = try container.decode(String.self, forKey: .description) + + header = try container.decode(String.self, forKey: .header) + + imageMeta = try container.decode(MediaMetaRequest.self, forKey: .imageMeta) + + isVoteAllowed = try container.decode(Bool.self, forKey: .isVoteAllowed) + + title = try container.decode(String.self, forKey: .title) + + videoMeta = try container.decode(MediaMetaRequest.self, forKey: .videoMeta) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(header, forKey: .header) + + try? container.encodeIfPresent(imageMeta, forKey: .imageMeta) + + try? container.encodeIfPresent(isVoteAllowed, forKey: .isVoteAllowed) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(videoMeta, forKey: .videoMeta) + } + } + + /* + Model: SaveAttributeRequest + Used By: Feedback + */ + + class SaveAttributeRequest: Codable { + public var description: String? + + public var name: String + + public var slug: String + + public enum CodingKeys: String, CodingKey { + case description + + case name + + case slug + } + + public init(description: String?, name: String, slug: String) { + self.description = description + + self.name = name + + self.slug = slug + } + + public func duplicate() -> SaveAttributeRequest { + let dict = self.dictionary! + let copy = SaveAttributeRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + name = try container.decode(String.self, forKey: .name) + + slug = try container.decode(String.self, forKey: .slug) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(slug, forKey: .slug) + } + } + + /* + Model: SortMethod + Used By: Feedback + */ + + class SortMethod: Codable { + public var name: String? + + public var selected: Bool? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case name + + case selected + + case type + } + + public init(name: String?, selected: Bool?, type: String?) { + self.name = name + + self.selected = selected + + self.type = type + } + + public func duplicate() -> SortMethod { + let dict = self.dictionary! + let copy = SortMethod(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + selected = try container.decode(Bool.self, forKey: .selected) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(selected, forKey: .selected) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: TagMeta + Used By: Feedback + */ + + class TagMeta: Codable { + public var media: [MediaMeta]? + + public var name: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case media + + case name + + case type + } + + public init(media: [MediaMeta]?, name: String?, type: String?) { + self.media = media + + self.name = name + + self.type = type + } + + public func duplicate() -> TagMeta { + let dict = self.dictionary! + let copy = TagMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + media = try container.decode([MediaMeta].self, forKey: .media) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(media, forKey: .media) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: Template + Used By: Feedback + */ + + class Template: Codable { + public var dateMeta: DateMeta? + + public var entity: Entity? + + public var id: String? + + public var name: String? + + public var rating: Rating? + + public var review: Review? + + public var state: FeedbackState? + + public var tags: [TagMeta]? + + public enum CodingKeys: String, CodingKey { + case dateMeta = "date_meta" + + case entity + + case id + + case name + + case rating + + case review + + case state + + case tags + } + + public init(dateMeta: DateMeta?, entity: Entity?, id: String?, name: String?, rating: Rating?, review: Review?, state: FeedbackState?, tags: [TagMeta]?) { + self.dateMeta = dateMeta + + self.entity = entity + + self.id = id + + self.name = name + + self.rating = rating + + self.review = review + + self.state = state + + self.tags = tags + } + + public func duplicate() -> Template { + let dict = self.dictionary! + let copy = Template(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + dateMeta = try container.decode(DateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entity = try container.decode(Entity.self, forKey: .entity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rating = try container.decode(Rating.self, forKey: .rating) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + review = try container.decode(Review.self, forKey: .review) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(FeedbackState.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([TagMeta].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(entity, forKey: .entity) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(rating, forKey: .rating) + + try? container.encodeIfPresent(review, forKey: .review) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: TemplateGetResponse + Used By: Feedback + */ + + class TemplateGetResponse: Codable { + public var items: [Template]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [Template]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> TemplateGetResponse { + let dict = self.dictionary! + let copy = TemplateGetResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Template].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: TemplateRequest + Used By: Feedback + */ + + class TemplateRequest: Codable { + public var active: Bool + + public var enableMediaType: String? + + public var enableQna: Bool? + + public var enableRating: Bool + + public var enableReview: Bool + + public var entity: EntityRequest + + public var rating: RatingRequest + + public var review: ReviewRequest + + public enum CodingKeys: String, CodingKey { + case active + + case enableMediaType = "enable_media_type" + + case enableQna = "enable_qna" + + case enableRating = "enable_rating" + + case enableReview = "enable_review" + + case entity + + case rating + + case review + } + + public init(active: Bool, enableMediaType: String?, enableQna: Bool?, enableRating: Bool, enableReview: Bool, entity: EntityRequest, rating: RatingRequest, review: ReviewRequest) { + self.active = active + + self.enableMediaType = enableMediaType + + self.enableQna = enableQna + + self.enableRating = enableRating + + self.enableReview = enableReview + + self.entity = entity + + self.rating = rating + + self.review = review + } + + public func duplicate() -> TemplateRequest { + let dict = self.dictionary! + let copy = TemplateRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + active = try container.decode(Bool.self, forKey: .active) + + do { + enableMediaType = try container.decode(String.self, forKey: .enableMediaType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enableQna = try container.decode(Bool.self, forKey: .enableQna) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + enableRating = try container.decode(Bool.self, forKey: .enableRating) + + enableReview = try container.decode(Bool.self, forKey: .enableReview) + + entity = try container.decode(EntityRequest.self, forKey: .entity) + + rating = try container.decode(RatingRequest.self, forKey: .rating) + + review = try container.decode(ReviewRequest.self, forKey: .review) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(enableMediaType, forKey: .enableMediaType) + + try? container.encodeIfPresent(enableQna, forKey: .enableQna) + + try? container.encodeIfPresent(enableRating, forKey: .enableRating) + + try? container.encodeIfPresent(enableReview, forKey: .enableReview) + + try? container.encodeIfPresent(entity, forKey: .entity) + + try? container.encodeIfPresent(rating, forKey: .rating) + + try? container.encodeIfPresent(review, forKey: .review) + } + } + + /* + Model: TemplateRequestList + Used By: Feedback + */ + + class TemplateRequestList: Codable { + public var templateList: [TemplateRequest] + + public enum CodingKeys: String, CodingKey { + case templateList = "template_list" + } + + public init(templateList: [TemplateRequest]) { + self.templateList = templateList + } + + public func duplicate() -> TemplateRequestList { + let dict = self.dictionary! + let copy = TemplateRequestList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + templateList = try container.decode([TemplateRequest].self, forKey: .templateList) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(templateList, forKey: .templateList) + } + } + + /* + Model: UI + Used By: Feedback + */ + + class UI: Codable { + public var feedbackQuestion: [String]? + + public var icon: UIIcon? + + public var text: [String]? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case feedbackQuestion = "feedback_question" + + case icon + + case text + + case type + } + + public init(feedbackQuestion: [String]?, icon: UIIcon?, text: [String]?, type: String?) { + self.feedbackQuestion = feedbackQuestion + + self.icon = icon + + self.text = text + + self.type = type + } + + public func duplicate() -> UI { + let dict = self.dictionary! + let copy = UI(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + feedbackQuestion = try container.decode([String].self, forKey: .feedbackQuestion) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + icon = try container.decode(UIIcon.self, forKey: .icon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text = try container.decode([String].self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(feedbackQuestion, forKey: .feedbackQuestion) + + try? container.encodeIfPresent(icon, forKey: .icon) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: UIIcon + Used By: Feedback + */ + + class UIIcon: Codable { + public var active: String? + + public var inactive: String? + + public var selected: [String]? + + public enum CodingKeys: String, CodingKey { + case active + + case inactive + + case selected + } + + public init(active: String?, inactive: String?, selected: [String]?) { + self.active = active + + self.inactive = inactive + + self.selected = selected + } + + public func duplicate() -> UIIcon { + let dict = self.dictionary! + let copy = UIIcon(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(String.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + inactive = try container.decode(String.self, forKey: .inactive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + selected = try container.decode([String].self, forKey: .selected) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(inactive, forKey: .inactive) + + try? container.encodeIfPresent(selected, forKey: .selected) + } + } + + /* + Model: UpdateAttributeRequest + Used By: Feedback + */ + + class UpdateAttributeRequest: Codable { + public var description: String? + + public var name: String + + public var slug: String? + + public enum CodingKeys: String, CodingKey { + case description + + case name + + case slug + } + + public init(description: String?, name: String, slug: String?) { + self.description = description + + self.name = name + + self.slug = slug + } + + public func duplicate() -> UpdateAttributeRequest { + let dict = self.dictionary! + let copy = UpdateAttributeRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + name = try container.decode(String.self, forKey: .name) + + do { + slug = try container.decode(String.self, forKey: .slug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(slug, forKey: .slug) + } + } + + /* + Model: UpdateResponse + Used By: Feedback + */ + + class UpdateResponse: Codable { + public var count: Int? + + public enum CodingKeys: String, CodingKey { + case count + } + + public init(count: Int?) { + self.count = count + } + + public func duplicate() -> UpdateResponse { + let dict = self.dictionary! + let copy = UpdateResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(count, forKey: .count) + } + } + + /* + Model: UpdateReviewRequest + Used By: Feedback + */ + + class UpdateReviewRequest: Codable { + public var active: Bool? + + public var application: String? + + public var approve: Bool? + + public var archive: Bool? + + public var attributesRating: [AttributeObject]? + + public var description: String? + + public var deviceMeta: DeviceMeta? + + public var entityId: String? + + public var entityType: String? + + public var mediaResource: [MediaMeta]? + + public var rating: Double? + + public var reviewId: String? + + public var templateId: String? + + public var title: String? + + public enum CodingKeys: String, CodingKey { + case active + + case application + + case approve + + case archive + + case attributesRating = "attributes_rating" + + case description + + case deviceMeta = "device_meta" + + case entityId = "entity_id" + + case entityType = "entity_type" + + case mediaResource = "media_resource" + + case rating + + case reviewId = "review_id" + + case templateId = "template_id" + + case title + } + + public init(active: Bool?, application: String?, approve: Bool?, archive: Bool?, attributesRating: [AttributeObject]?, description: String?, deviceMeta: DeviceMeta?, entityId: String?, entityType: String?, mediaResource: [MediaMeta]?, rating: Double?, reviewId: String?, templateId: String?, title: String?) { + self.active = active + + self.application = application + + self.approve = approve + + self.archive = archive + + self.attributesRating = attributesRating + + self.description = description + + self.deviceMeta = deviceMeta + + self.entityId = entityId + + self.entityType = entityType + + self.mediaResource = mediaResource + + self.rating = rating + + self.reviewId = reviewId + + self.templateId = templateId + + self.title = title + } + + public func duplicate() -> UpdateReviewRequest { + let dict = self.dictionary! + let copy = UpdateReviewRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + approve = try container.decode(Bool.self, forKey: .approve) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archive = try container.decode(Bool.self, forKey: .archive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributesRating = try container.decode([AttributeObject].self, forKey: .attributesRating) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deviceMeta = try container.decode(DeviceMeta.self, forKey: .deviceMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entityId = try container.decode(String.self, forKey: .entityId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + entityType = try container.decode(String.self, forKey: .entityType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mediaResource = try container.decode([MediaMeta].self, forKey: .mediaResource) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rating = try container.decode(Double.self, forKey: .rating) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + reviewId = try container.decode(String.self, forKey: .reviewId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + templateId = try container.decode(String.self, forKey: .templateId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(approve, forKey: .approve) + + try? container.encodeIfPresent(archive, forKey: .archive) + + try? container.encodeIfPresent(attributesRating, forKey: .attributesRating) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(deviceMeta, forKey: .deviceMeta) + + try? container.encodeIfPresent(entityId, forKey: .entityId) + + try? container.encodeIfPresent(entityType, forKey: .entityType) + + try? container.encodeIfPresent(mediaResource, forKey: .mediaResource) + + try? container.encodeIfPresent(rating, forKey: .rating) + + try? container.encodeIfPresent(reviewId, forKey: .reviewId) + + try? container.encodeIfPresent(templateId, forKey: .templateId) + + try? container.encodeIfPresent(title, forKey: .title) + } + } + + /* + Model: UpdateTemplateRequest + Used By: Feedback + */ + + class UpdateTemplateRequest: Codable { + public var active: Bool + + public var enableMediaType: String? + + public var enableQna: Bool? + + public var enableRating: Bool + + public var enableReview: Bool + + public var entity: EntityRequest + + public var rating: RatingRequest + + public var review: ReviewRequest + + public enum CodingKeys: String, CodingKey { + case active + + case enableMediaType = "enable_media_type" + + case enableQna = "enable_qna" + + case enableRating = "enable_rating" + + case enableReview = "enable_review" + + case entity + + case rating + + case review + } + + public init(active: Bool, enableMediaType: String?, enableQna: Bool?, enableRating: Bool, enableReview: Bool, entity: EntityRequest, rating: RatingRequest, review: ReviewRequest) { + self.active = active + + self.enableMediaType = enableMediaType + + self.enableQna = enableQna + + self.enableRating = enableRating + + self.enableReview = enableReview + + self.entity = entity + + self.rating = rating + + self.review = review + } + + public func duplicate() -> UpdateTemplateRequest { + let dict = self.dictionary! + let copy = UpdateTemplateRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + active = try container.decode(Bool.self, forKey: .active) + + do { + enableMediaType = try container.decode(String.self, forKey: .enableMediaType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enableQna = try container.decode(Bool.self, forKey: .enableQna) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + enableRating = try container.decode(Bool.self, forKey: .enableRating) + + enableReview = try container.decode(Bool.self, forKey: .enableReview) + + entity = try container.decode(EntityRequest.self, forKey: .entity) + + rating = try container.decode(RatingRequest.self, forKey: .rating) + + review = try container.decode(ReviewRequest.self, forKey: .review) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(enableMediaType, forKey: .enableMediaType) + + try? container.encodeIfPresent(enableQna, forKey: .enableQna) + + try? container.encodeIfPresent(enableRating, forKey: .enableRating) + + try? container.encodeIfPresent(enableReview, forKey: .enableReview) + + try? container.encodeIfPresent(entity, forKey: .entity) + + try? container.encodeIfPresent(rating, forKey: .rating) + + try? container.encodeIfPresent(review, forKey: .review) + } + } + + /* + Model: UpdateTemplateStatusRequest + Used By: Feedback + */ + + class UpdateTemplateStatusRequest: Codable { + public var active: Bool? + + public var archive: Bool? + + public enum CodingKeys: String, CodingKey { + case active + + case archive + } + + public init(active: Bool?, archive: Bool?) { + self.active = active + + self.archive = archive + } + + public func duplicate() -> UpdateTemplateStatusRequest { + let dict = self.dictionary! + let copy = UpdateTemplateStatusRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archive = try container.decode(Bool.self, forKey: .archive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(archive, forKey: .archive) + } + } +} diff --git a/Sources/code/platform/models/FileStoragePlatformModelClass.swift b/Sources/code/platform/models/FileStoragePlatformModelClass.swift new file mode 100644 index 0000000000..ae72c53f97 --- /dev/null +++ b/Sources/code/platform/models/FileStoragePlatformModelClass.swift @@ -0,0 +1,1261 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: FailedResponse + Used By: FileStorage + */ + + class FailedResponse: Codable { + public var message: String + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String) { + self.message = message + } + + public func duplicate() -> FailedResponse { + let dict = self.dictionary! + let copy = FailedResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + message = try container.decode(String.self, forKey: .message) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: CDN + Used By: FileStorage + */ + + class CDN: Codable { + public var url: String + + public enum CodingKeys: String, CodingKey { + case url + } + + public init(url: String) { + self.url = url + } + + public func duplicate() -> CDN { + let dict = self.dictionary! + let copy = CDN(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + url = try container.decode(String.self, forKey: .url) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(url, forKey: .url) + } + } + + /* + Model: Upload + Used By: FileStorage + */ + + class Upload: Codable { + public var expiry: Int + + public var url: String + + public enum CodingKeys: String, CodingKey { + case expiry + + case url + } + + public init(expiry: Int, url: String) { + self.expiry = expiry + + self.url = url + } + + public func duplicate() -> Upload { + let dict = self.dictionary! + let copy = Upload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + expiry = try container.decode(Int.self, forKey: .expiry) + + url = try container.decode(String.self, forKey: .url) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(expiry, forKey: .expiry) + + try? container.encodeIfPresent(url, forKey: .url) + } + } + + /* + Model: StartResponse + Used By: FileStorage + */ + + class StartResponse: Codable { + public var fileName: String + + public var filePath: String + + public var contentType: String + + public var method: String + + public var namespace: String + + public var operation: String + + public var size: Int + + public var upload: Upload + + public var cdn: CDN + + public var tags: [String]? + + public enum CodingKeys: String, CodingKey { + case fileName = "file_name" + + case filePath = "file_path" + + case contentType = "content_type" + + case method + + case namespace + + case operation + + case size + + case upload + + case cdn + + case tags + } + + public init(cdn: CDN, contentType: String, fileName: String, filePath: String, method: String, namespace: String, operation: String, size: Int, tags: [String]?, upload: Upload) { + self.fileName = fileName + + self.filePath = filePath + + self.contentType = contentType + + self.method = method + + self.namespace = namespace + + self.operation = operation + + self.size = size + + self.upload = upload + + self.cdn = cdn + + self.tags = tags + } + + public func duplicate() -> StartResponse { + let dict = self.dictionary! + let copy = StartResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + fileName = try container.decode(String.self, forKey: .fileName) + + filePath = try container.decode(String.self, forKey: .filePath) + + contentType = try container.decode(String.self, forKey: .contentType) + + method = try container.decode(String.self, forKey: .method) + + namespace = try container.decode(String.self, forKey: .namespace) + + operation = try container.decode(String.self, forKey: .operation) + + size = try container.decode(Int.self, forKey: .size) + + upload = try container.decode(Upload.self, forKey: .upload) + + cdn = try container.decode(CDN.self, forKey: .cdn) + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(fileName, forKey: .fileName) + + try? container.encodeIfPresent(filePath, forKey: .filePath) + + try? container.encodeIfPresent(contentType, forKey: .contentType) + + try? container.encodeIfPresent(method, forKey: .method) + + try? container.encodeIfPresent(namespace, forKey: .namespace) + + try? container.encodeIfPresent(operation, forKey: .operation) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(upload, forKey: .upload) + + try? container.encodeIfPresent(cdn, forKey: .cdn) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: StartRequest + Used By: FileStorage + */ + + class StartRequest: Codable { + public var fileName: String + + public var contentType: String + + public var size: Int + + public var tags: [String]? + + public var params: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case fileName = "file_name" + + case contentType = "content_type" + + case size + + case tags + + case params + } + + public init(contentType: String, fileName: String, params: [String: Any]?, size: Int, tags: [String]?) { + self.fileName = fileName + + self.contentType = contentType + + self.size = size + + self.tags = tags + + self.params = params + } + + public func duplicate() -> StartRequest { + let dict = self.dictionary! + let copy = StartRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + fileName = try container.decode(String.self, forKey: .fileName) + + contentType = try container.decode(String.self, forKey: .contentType) + + size = try container.decode(Int.self, forKey: .size) + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + params = try container.decode([String: Any].self, forKey: .params) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(fileName, forKey: .fileName) + + try? container.encodeIfPresent(contentType, forKey: .contentType) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(params, forKey: .params) + } + } + + /* + Model: CompleteResponse + Used By: FileStorage + */ + + class CompleteResponse: Codable { + public var id: String + + public var fileName: String + + public var filePath: String + + public var contentType: String + + public var method: String + + public var namespace: String + + public var operation: String + + public var size: Int + + public var upload: Upload + + public var cdn: CDN + + public var success: String + + public var tags: [String]? + + public var createdOn: String + + public var modifiedOn: String + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case fileName = "file_name" + + case filePath = "file_path" + + case contentType = "content_type" + + case method + + case namespace + + case operation + + case size + + case upload + + case cdn + + case success + + case tags + + case createdOn = "created_on" + + case modifiedOn = "modified_on" + } + + public init(cdn: CDN, contentType: String, createdOn: String, fileName: String, filePath: String, method: String, modifiedOn: String, namespace: String, operation: String, size: Int, success: String, tags: [String]?, upload: Upload, id: String) { + self.id = id + + self.fileName = fileName + + self.filePath = filePath + + self.contentType = contentType + + self.method = method + + self.namespace = namespace + + self.operation = operation + + self.size = size + + self.upload = upload + + self.cdn = cdn + + self.success = success + + self.tags = tags + + self.createdOn = createdOn + + self.modifiedOn = modifiedOn + } + + public func duplicate() -> CompleteResponse { + let dict = self.dictionary! + let copy = CompleteResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + id = try container.decode(String.self, forKey: .id) + + fileName = try container.decode(String.self, forKey: .fileName) + + filePath = try container.decode(String.self, forKey: .filePath) + + contentType = try container.decode(String.self, forKey: .contentType) + + method = try container.decode(String.self, forKey: .method) + + namespace = try container.decode(String.self, forKey: .namespace) + + operation = try container.decode(String.self, forKey: .operation) + + size = try container.decode(Int.self, forKey: .size) + + upload = try container.decode(Upload.self, forKey: .upload) + + cdn = try container.decode(CDN.self, forKey: .cdn) + + success = try container.decode(String.self, forKey: .success) + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + createdOn = try container.decode(String.self, forKey: .createdOn) + + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(fileName, forKey: .fileName) + + try? container.encodeIfPresent(filePath, forKey: .filePath) + + try? container.encodeIfPresent(contentType, forKey: .contentType) + + try? container.encodeIfPresent(method, forKey: .method) + + try? container.encodeIfPresent(namespace, forKey: .namespace) + + try? container.encodeIfPresent(operation, forKey: .operation) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(upload, forKey: .upload) + + try? container.encodeIfPresent(cdn, forKey: .cdn) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + } + } + + /* + Model: Opts + Used By: FileStorage + */ + + class Opts: Codable { + public var attempts: Int? + + public var timestamp: Int? + + public var delay: Int? + + public enum CodingKeys: String, CodingKey { + case attempts + + case timestamp + + case delay + } + + public init(attempts: Int?, delay: Int?, timestamp: Int?) { + self.attempts = attempts + + self.timestamp = timestamp + + self.delay = delay + } + + public func duplicate() -> Opts { + let dict = self.dictionary! + let copy = Opts(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + attempts = try container.decode(Int.self, forKey: .attempts) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + timestamp = try container.decode(Int.self, forKey: .timestamp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + delay = try container.decode(Int.self, forKey: .delay) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(attempts, forKey: .attempts) + + try? container.encodeIfPresent(timestamp, forKey: .timestamp) + + try? container.encodeIfPresent(delay, forKey: .delay) + } + } + + /* + Model: CopyFileTask + Used By: FileStorage + */ + + class CopyFileTask: Codable { + public var id: String + + public var name: String + + public var data: BulkRequest + + public var opts: Opts + + public var progress: Int + + public var delay: Int + + public var timestamp: Int + + public var attemptsMade: Int + + public var stacktrace: [String]? + + public var finishedOn: Int + + public var processedOn: Int + + public enum CodingKeys: String, CodingKey { + case id + + case name + + case data + + case opts + + case progress + + case delay + + case timestamp + + case attemptsMade = "attempts_made" + + case stacktrace + + case finishedOn = "finished_on" + + case processedOn = "processed_on" + } + + public init(attemptsMade: Int, data: BulkRequest, delay: Int, finishedOn: Int, id: String, name: String, opts: Opts, processedOn: Int, progress: Int, stacktrace: [String]?, timestamp: Int) { + self.id = id + + self.name = name + + self.data = data + + self.opts = opts + + self.progress = progress + + self.delay = delay + + self.timestamp = timestamp + + self.attemptsMade = attemptsMade + + self.stacktrace = stacktrace + + self.finishedOn = finishedOn + + self.processedOn = processedOn + } + + public func duplicate() -> CopyFileTask { + let dict = self.dictionary! + let copy = CopyFileTask(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + id = try container.decode(String.self, forKey: .id) + + name = try container.decode(String.self, forKey: .name) + + data = try container.decode(BulkRequest.self, forKey: .data) + + opts = try container.decode(Opts.self, forKey: .opts) + + progress = try container.decode(Int.self, forKey: .progress) + + delay = try container.decode(Int.self, forKey: .delay) + + timestamp = try container.decode(Int.self, forKey: .timestamp) + + attemptsMade = try container.decode(Int.self, forKey: .attemptsMade) + + do { + stacktrace = try container.decode([String].self, forKey: .stacktrace) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + finishedOn = try container.decode(Int.self, forKey: .finishedOn) + + processedOn = try container.decode(Int.self, forKey: .processedOn) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(opts, forKey: .opts) + + try? container.encodeIfPresent(progress, forKey: .progress) + + try? container.encodeIfPresent(delay, forKey: .delay) + + try? container.encodeIfPresent(timestamp, forKey: .timestamp) + + try? container.encodeIfPresent(attemptsMade, forKey: .attemptsMade) + + try? container.encodeIfPresent(stacktrace, forKey: .stacktrace) + + try? container.encodeIfPresent(finishedOn, forKey: .finishedOn) + + try? container.encodeIfPresent(processedOn, forKey: .processedOn) + } + } + + /* + Model: BulkResponse + Used By: FileStorage + */ + + class BulkResponse: Codable { + public var trackingUrl: String + + public var task: CopyFileTask + + public enum CodingKeys: String, CodingKey { + case trackingUrl = "tracking_url" + + case task + } + + public init(task: CopyFileTask, trackingUrl: String) { + self.trackingUrl = trackingUrl + + self.task = task + } + + public func duplicate() -> BulkResponse { + let dict = self.dictionary! + let copy = BulkResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + trackingUrl = try container.decode(String.self, forKey: .trackingUrl) + + task = try container.decode(CopyFileTask.self, forKey: .task) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(trackingUrl, forKey: .trackingUrl) + + try? container.encodeIfPresent(task, forKey: .task) + } + } + + /* + Model: ReqConfiguration + Used By: FileStorage + */ + + class ReqConfiguration: Codable { + public var concurrency: Int? + + public enum CodingKeys: String, CodingKey { + case concurrency + } + + public init(concurrency: Int?) { + self.concurrency = concurrency + } + + public func duplicate() -> ReqConfiguration { + let dict = self.dictionary! + let copy = ReqConfiguration(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + concurrency = try container.decode(Int.self, forKey: .concurrency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(concurrency, forKey: .concurrency) + } + } + + /* + Model: Destination + Used By: FileStorage + */ + + class Destination: Codable { + public var namespace: String + + public var rewrite: String + + public var basepath: String? + + public enum CodingKeys: String, CodingKey { + case namespace + + case rewrite + + case basepath + } + + public init(basepath: String?, namespace: String, rewrite: String) { + self.namespace = namespace + + self.rewrite = rewrite + + self.basepath = basepath + } + + public func duplicate() -> Destination { + let dict = self.dictionary! + let copy = Destination(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + namespace = try container.decode(String.self, forKey: .namespace) + + rewrite = try container.decode(String.self, forKey: .rewrite) + + do { + basepath = try container.decode(String.self, forKey: .basepath) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(namespace, forKey: .namespace) + + try? container.encodeIfPresent(rewrite, forKey: .rewrite) + + try? container.encodeIfPresent(basepath, forKey: .basepath) + } + } + + /* + Model: BulkRequest + Used By: FileStorage + */ + + class BulkRequest: Codable { + public var urls: [String] + + public var destination: Destination + + public var configuration: ReqConfiguration? + + public enum CodingKeys: String, CodingKey { + case urls + + case destination + + case configuration + } + + public init(configuration: ReqConfiguration?, destination: Destination, urls: [String]) { + self.urls = urls + + self.destination = destination + + self.configuration = configuration + } + + public func duplicate() -> BulkRequest { + let dict = self.dictionary! + let copy = BulkRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + urls = try container.decode([String].self, forKey: .urls) + + destination = try container.decode(Destination.self, forKey: .destination) + + do { + configuration = try container.decode(ReqConfiguration.self, forKey: .configuration) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(urls, forKey: .urls) + + try? container.encodeIfPresent(destination, forKey: .destination) + + try? container.encodeIfPresent(configuration, forKey: .configuration) + } + } + + /* + Model: Urls + Used By: FileStorage + */ + + class Urls: Codable { + public var url: String + + public var signedUrl: String + + public var expiry: Int + + public enum CodingKeys: String, CodingKey { + case url + + case signedUrl = "signed_url" + + case expiry + } + + public init(expiry: Int, signedUrl: String, url: String) { + self.url = url + + self.signedUrl = signedUrl + + self.expiry = expiry + } + + public func duplicate() -> Urls { + let dict = self.dictionary! + let copy = Urls(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + url = try container.decode(String.self, forKey: .url) + + signedUrl = try container.decode(String.self, forKey: .signedUrl) + + expiry = try container.decode(Int.self, forKey: .expiry) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(signedUrl, forKey: .signedUrl) + + try? container.encodeIfPresent(expiry, forKey: .expiry) + } + } + + /* + Model: SignUrlResponse + Used By: FileStorage + */ + + class SignUrlResponse: Codable { + public var urls: [Urls] + + public enum CodingKeys: String, CodingKey { + case urls + } + + public init(urls: [Urls]) { + self.urls = urls + } + + public func duplicate() -> SignUrlResponse { + let dict = self.dictionary! + let copy = SignUrlResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + urls = try container.decode([Urls].self, forKey: .urls) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(urls, forKey: .urls) + } + } + + /* + Model: SignUrlRequest + Used By: FileStorage + */ + + class SignUrlRequest: Codable { + public var expiry: Int + + public var urls: [String] + + public enum CodingKeys: String, CodingKey { + case expiry + + case urls + } + + public init(expiry: Int, urls: [String]) { + self.expiry = expiry + + self.urls = urls + } + + public func duplicate() -> SignUrlRequest { + let dict = self.dictionary! + let copy = SignUrlRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + expiry = try container.decode(Int.self, forKey: .expiry) + + urls = try container.decode([String].self, forKey: .urls) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(expiry, forKey: .expiry) + + try? container.encodeIfPresent(urls, forKey: .urls) + } + } + + /* + Model: DbRecord + Used By: FileStorage + */ + + class DbRecord: Codable { + public var success: Bool + + public var tags: [String] + + public var id: String + + public var fileName: String + + public var operation: String? + + public var namespace: String + + public var contentType: String + + public var filePath: String + + public var upload: Upload + + public var cdn: CDN + + public var createdOn: String + + public var modifiedOn: String + + public enum CodingKeys: String, CodingKey { + case success + + case tags + + case id = "_id" + + case fileName = "file_name" + + case operation + + case namespace + + case contentType = "content_type" + + case filePath = "file_path" + + case upload + + case cdn + + case createdOn = "created_on" + + case modifiedOn = "modified_on" + } + + public init(cdn: CDN, contentType: String, createdOn: String, fileName: String, filePath: String, modifiedOn: String, namespace: String, operation: String?, success: Bool, tags: [String], upload: Upload, id: String) { + self.success = success + + self.tags = tags + + self.id = id + + self.fileName = fileName + + self.operation = operation + + self.namespace = namespace + + self.contentType = contentType + + self.filePath = filePath + + self.upload = upload + + self.cdn = cdn + + self.createdOn = createdOn + + self.modifiedOn = modifiedOn + } + + public func duplicate() -> DbRecord { + let dict = self.dictionary! + let copy = DbRecord(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + tags = try container.decode([String].self, forKey: .tags) + + id = try container.decode(String.self, forKey: .id) + + fileName = try container.decode(String.self, forKey: .fileName) + + do { + operation = try container.decode(String.self, forKey: .operation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + namespace = try container.decode(String.self, forKey: .namespace) + + contentType = try container.decode(String.self, forKey: .contentType) + + filePath = try container.decode(String.self, forKey: .filePath) + + upload = try container.decode(Upload.self, forKey: .upload) + + cdn = try container.decode(CDN.self, forKey: .cdn) + + createdOn = try container.decode(String.self, forKey: .createdOn) + + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(fileName, forKey: .fileName) + + try? container.encodeIfPresent(operation, forKey: .operation) + + try? container.encodeIfPresent(namespace, forKey: .namespace) + + try? container.encodeIfPresent(contentType, forKey: .contentType) + + try? container.encodeIfPresent(filePath, forKey: .filePath) + + try? container.encodeIfPresent(upload, forKey: .upload) + + try? container.encodeIfPresent(cdn, forKey: .cdn) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + } + } + + /* + Model: BrowseResponse + Used By: FileStorage + */ + + class BrowseResponse: Codable { + public var items: [DbRecord] + + public var page: Page + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [DbRecord], page: Page) { + self.items = items + + self.page = page + } + + public func duplicate() -> BrowseResponse { + let dict = self.dictionary! + let copy = BrowseResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + items = try container.decode([DbRecord].self, forKey: .items) + + page = try container.decode(Page.self, forKey: .page) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } +} diff --git a/Sources/code/platform/models/InventoryPlatformModelClass.swift b/Sources/code/platform/models/InventoryPlatformModelClass.swift new file mode 100644 index 0000000000..b84d3279c9 --- /dev/null +++ b/Sources/code/platform/models/InventoryPlatformModelClass.swift @@ -0,0 +1,7508 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: DataTresholdDTO + Used By: Inventory + */ + + class DataTresholdDTO: Codable { + public var minPrice: Double? + + public var safeStock: Int? + + public var periodThreshold: Int? + + public var periodThresholdType: String? + + public var periodTypeList: [GenericDTO]? + + public enum CodingKeys: String, CodingKey { + case minPrice = "min_price" + + case safeStock = "safe_stock" + + case periodThreshold = "period_threshold" + + case periodThresholdType = "period_threshold_type" + + case periodTypeList = "period_type_list" + } + + public init(minPrice: Double?, periodThreshold: Int?, periodThresholdType: String?, periodTypeList: [GenericDTO]?, safeStock: Int?) { + self.minPrice = minPrice + + self.safeStock = safeStock + + self.periodThreshold = periodThreshold + + self.periodThresholdType = periodThresholdType + + self.periodTypeList = periodTypeList + } + + public func duplicate() -> DataTresholdDTO { + let dict = self.dictionary! + let copy = DataTresholdDTO(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + minPrice = try container.decode(Double.self, forKey: .minPrice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + safeStock = try container.decode(Int.self, forKey: .safeStock) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + periodThreshold = try container.decode(Int.self, forKey: .periodThreshold) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + periodThresholdType = try container.decode(String.self, forKey: .periodThresholdType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + periodTypeList = try container.decode([GenericDTO].self, forKey: .periodTypeList) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(minPrice, forKey: .minPrice) + + try? container.encodeIfPresent(safeStock, forKey: .safeStock) + + try? container.encodeIfPresent(periodThreshold, forKey: .periodThreshold) + + try? container.encodeIfPresent(periodThresholdType, forKey: .periodThresholdType) + + try? container.encodeIfPresent(periodTypeList, forKey: .periodTypeList) + } + } + + /* + Model: GenericDTO + Used By: Inventory + */ + + class GenericDTO: Codable { + public var text: String? + + public var value: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case text + + case value + } + + public init(text: String?, value: [String: Any]?) { + self.text = text + + self.value = value + } + + public func duplicate() -> GenericDTO { + let dict = self.dictionary! + let copy = GenericDTO(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + text = try container.decode(String.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode([String: Any].self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: JobConfigDTO + Used By: Inventory + */ + + class JobConfigDTO: Codable { + public var integration: String + + public var integrationData: [String: Any]? + + public var companyName: String? + + public var companyId: Int + + public var taskDetails: TaskDTO? + + public var thresholdDetails: DataTresholdDTO? + + public var jobCode: String? + + public var alias: String? + + public enum CodingKeys: String, CodingKey { + case integration + + case integrationData = "integration_data" + + case companyName = "company_name" + + case companyId = "company_id" + + case taskDetails = "task_details" + + case thresholdDetails = "threshold_details" + + case jobCode = "job_code" + + case alias + } + + public init(alias: String?, companyId: Int, companyName: String?, integration: String, integrationData: [String: Any]?, jobCode: String?, taskDetails: TaskDTO?, thresholdDetails: DataTresholdDTO?) { + self.integration = integration + + self.integrationData = integrationData + + self.companyName = companyName + + self.companyId = companyId + + self.taskDetails = taskDetails + + self.thresholdDetails = thresholdDetails + + self.jobCode = jobCode + + self.alias = alias + } + + public func duplicate() -> JobConfigDTO { + let dict = self.dictionary! + let copy = JobConfigDTO(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + integration = try container.decode(String.self, forKey: .integration) + + do { + integrationData = try container.decode([String: Any].self, forKey: .integrationData) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyName = try container.decode(String.self, forKey: .companyName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + companyId = try container.decode(Int.self, forKey: .companyId) + + do { + taskDetails = try container.decode(TaskDTO.self, forKey: .taskDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + thresholdDetails = try container.decode(DataTresholdDTO.self, forKey: .thresholdDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + jobCode = try container.decode(String.self, forKey: .jobCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + alias = try container.decode(String.self, forKey: .alias) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(integration, forKey: .integration) + + try? container.encodeIfPresent(integrationData, forKey: .integrationData) + + try? container.encodeIfPresent(companyName, forKey: .companyName) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(taskDetails, forKey: .taskDetails) + + try? container.encodeIfPresent(thresholdDetails, forKey: .thresholdDetails) + + try? container.encodeIfPresent(jobCode, forKey: .jobCode) + + try? container.encodeIfPresent(alias, forKey: .alias) + } + } + + /* + Model: TaskDTO + Used By: Inventory + */ + + class TaskDTO: Codable { + public var type: Int? + + public var groupList: [GenericDTO]? + + public enum CodingKeys: String, CodingKey { + case type + + case groupList = "group_list" + } + + public init(groupList: [GenericDTO]?, type: Int?) { + self.type = type + + self.groupList = groupList + } + + public func duplicate() -> TaskDTO { + let dict = self.dictionary! + let copy = TaskDTO(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(Int.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + groupList = try container.decode([GenericDTO].self, forKey: .groupList) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(groupList, forKey: .groupList) + } + } + + /* + Model: ResponseEnvelopeString + Used By: Inventory + */ + + class ResponseEnvelopeString: Codable { + public var timestamp: String? + + public var status: Int? + + public var error: String? + + public var exception: String? + + public var message: String? + + public var totalTimeTakenInMillis: Int? + + public var httpStatus: String? + + public var items: String? + + public var payload: String? + + public var traceId: String? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case timestamp + + case status + + case error + + case exception + + case message + + case totalTimeTakenInMillis = "total_time_taken_in_millis" + + case httpStatus = "http_status" + + case items + + case payload + + case traceId = "trace_id" + + case page + } + + public init(error: String?, exception: String?, httpStatus: String?, items: String?, message: String?, page: Page?, payload: String?, status: Int?, timestamp: String?, totalTimeTakenInMillis: Int?, traceId: String?) { + self.timestamp = timestamp + + self.status = status + + self.error = error + + self.exception = exception + + self.message = message + + self.totalTimeTakenInMillis = totalTimeTakenInMillis + + self.httpStatus = httpStatus + + self.items = items + + self.payload = payload + + self.traceId = traceId + + self.page = page + } + + public func duplicate() -> ResponseEnvelopeString { + let dict = self.dictionary! + let copy = ResponseEnvelopeString(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + timestamp = try container.decode(String.self, forKey: .timestamp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Int.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + error = try container.decode(String.self, forKey: .error) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + exception = try container.decode(String.self, forKey: .exception) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalTimeTakenInMillis = try container.decode(Int.self, forKey: .totalTimeTakenInMillis) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + httpStatus = try container.decode(String.self, forKey: .httpStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode(String.self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + payload = try container.decode(String.self, forKey: .payload) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + traceId = try container.decode(String.self, forKey: .traceId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(timestamp, forKey: .timestamp) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(error, forKey: .error) + + try? container.encodeIfPresent(exception, forKey: .exception) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(totalTimeTakenInMillis, forKey: .totalTimeTakenInMillis) + + try? container.encodeIfPresent(httpStatus, forKey: .httpStatus) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(payload, forKey: .payload) + + try? container.encodeIfPresent(traceId, forKey: .traceId) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: AWSS3config + Used By: Inventory + */ + + class AWSS3config: Codable { + public var bucket: String? + + public var region: String? + + public var dir: String? + + public var accessKey: String? + + public var secretKey: String? + + public var localFilePath: String? + + public var archivePath: String? + + public var archive: Bool? + + public var delete: Bool? + + public var unzip: Bool? + + public var zipFormat: String? + + public var fileRegex: String? + + public var archiveConfig: ArchiveConfig? + + public enum CodingKeys: String, CodingKey { + case bucket + + case region + + case dir + + case accessKey = "access_key" + + case secretKey = "secret_key" + + case localFilePath = "local_file_path" + + case archivePath = "archive_path" + + case archive + + case delete + + case unzip + + case zipFormat = "zip_format" + + case fileRegex = "file_regex" + + case archiveConfig = "archive_config" + } + + public init(accessKey: String?, archive: Bool?, archiveConfig: ArchiveConfig?, archivePath: String?, bucket: String?, delete: Bool?, dir: String?, fileRegex: String?, localFilePath: String?, region: String?, secretKey: String?, unzip: Bool?, zipFormat: String?) { + self.bucket = bucket + + self.region = region + + self.dir = dir + + self.accessKey = accessKey + + self.secretKey = secretKey + + self.localFilePath = localFilePath + + self.archivePath = archivePath + + self.archive = archive + + self.delete = delete + + self.unzip = unzip + + self.zipFormat = zipFormat + + self.fileRegex = fileRegex + + self.archiveConfig = archiveConfig + } + + public func duplicate() -> AWSS3config { + let dict = self.dictionary! + let copy = AWSS3config(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + bucket = try container.decode(String.self, forKey: .bucket) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + region = try container.decode(String.self, forKey: .region) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dir = try container.decode(String.self, forKey: .dir) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + accessKey = try container.decode(String.self, forKey: .accessKey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + secretKey = try container.decode(String.self, forKey: .secretKey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + localFilePath = try container.decode(String.self, forKey: .localFilePath) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archivePath = try container.decode(String.self, forKey: .archivePath) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archive = try container.decode(Bool.self, forKey: .archive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + delete = try container.decode(Bool.self, forKey: .delete) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + unzip = try container.decode(Bool.self, forKey: .unzip) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + zipFormat = try container.decode(String.self, forKey: .zipFormat) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fileRegex = try container.decode(String.self, forKey: .fileRegex) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archiveConfig = try container.decode(ArchiveConfig.self, forKey: .archiveConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(bucket, forKey: .bucket) + + try? container.encodeIfPresent(region, forKey: .region) + + try? container.encodeIfPresent(dir, forKey: .dir) + + try? container.encodeIfPresent(accessKey, forKey: .accessKey) + + try? container.encodeIfPresent(secretKey, forKey: .secretKey) + + try? container.encodeIfPresent(localFilePath, forKey: .localFilePath) + + try? container.encodeIfPresent(archivePath, forKey: .archivePath) + + try? container.encodeIfPresent(archive, forKey: .archive) + + try? container.encodeIfPresent(delete, forKey: .delete) + + try? container.encodeIfPresent(unzip, forKey: .unzip) + + try? container.encodeIfPresent(zipFormat, forKey: .zipFormat) + + try? container.encodeIfPresent(fileRegex, forKey: .fileRegex) + + try? container.encodeIfPresent(archiveConfig, forKey: .archiveConfig) + } + } + + /* + Model: ArchiveConfig + Used By: Inventory + */ + + class ArchiveConfig: Codable { + public var delete: Bool? + + public var archive: Bool? + + public var archiveDir: String? + + public enum CodingKeys: String, CodingKey { + case delete + + case archive + + case archiveDir = "archive_dir" + } + + public init(archive: Bool?, archiveDir: String?, delete: Bool?) { + self.delete = delete + + self.archive = archive + + self.archiveDir = archiveDir + } + + public func duplicate() -> ArchiveConfig { + let dict = self.dictionary! + let copy = ArchiveConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + delete = try container.decode(Bool.self, forKey: .delete) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archive = try container.decode(Bool.self, forKey: .archive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archiveDir = try container.decode(String.self, forKey: .archiveDir) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(delete, forKey: .delete) + + try? container.encodeIfPresent(archive, forKey: .archive) + + try? container.encodeIfPresent(archiveDir, forKey: .archiveDir) + } + } + + /* + Model: Audit + Used By: Inventory + */ + + class Audit: Codable { + public var createdBy: String? + + public var modifiedBy: String? + + public var createdOn: String? + + public var modifiedOn: String? + + public enum CodingKeys: String, CodingKey { + case createdBy = "created_by" + + case modifiedBy = "modified_by" + + case createdOn = "created_on" + + case modifiedOn = "modified_on" + } + + public init(createdBy: String?, createdOn: String?, modifiedBy: String?, modifiedOn: String?) { + self.createdBy = createdBy + + self.modifiedBy = modifiedBy + + self.createdOn = createdOn + + self.modifiedOn = modifiedOn + } + + public func duplicate() -> Audit { + let dict = self.dictionary! + let copy = Audit(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + createdBy = try container.decode(String.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode(String.self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + } + } + + /* + Model: CatalogMasterConfig + Used By: Inventory + */ + + class CatalogMasterConfig: Codable { + public var sourceSlug: String? + + public enum CodingKeys: String, CodingKey { + case sourceSlug = "source_slug" + } + + public init(sourceSlug: String?) { + self.sourceSlug = sourceSlug + } + + public func duplicate() -> CatalogMasterConfig { + let dict = self.dictionary! + let copy = CatalogMasterConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + sourceSlug = try container.decode(String.self, forKey: .sourceSlug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(sourceSlug, forKey: .sourceSlug) + } + } + + /* + Model: CompanyConfig + Used By: Inventory + */ + + class CompanyConfig: Codable { + public var companyId: Int? + + public var excludeSteps: [Int]? + + public var hiddenClosetKeys: [String]? + + public var openTags: [String: Any]? + + public var taxIdentifiers: [String]? + + public var deleteQuantityThreshold: Int? + + public enum CodingKeys: String, CodingKey { + case companyId = "company_id" + + case excludeSteps = "exclude_steps" + + case hiddenClosetKeys = "hidden_closet_keys" + + case openTags = "open_tags" + + case taxIdentifiers = "tax_identifiers" + + case deleteQuantityThreshold = "delete_quantity_threshold" + } + + public init(companyId: Int?, deleteQuantityThreshold: Int?, excludeSteps: [Int]?, hiddenClosetKeys: [String]?, openTags: [String: Any]?, taxIdentifiers: [String]?) { + self.companyId = companyId + + self.excludeSteps = excludeSteps + + self.hiddenClosetKeys = hiddenClosetKeys + + self.openTags = openTags + + self.taxIdentifiers = taxIdentifiers + + self.deleteQuantityThreshold = deleteQuantityThreshold + } + + public func duplicate() -> CompanyConfig { + let dict = self.dictionary! + let copy = CompanyConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + excludeSteps = try container.decode([Int].self, forKey: .excludeSteps) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hiddenClosetKeys = try container.decode([String].self, forKey: .hiddenClosetKeys) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + openTags = try container.decode([String: Any].self, forKey: .openTags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + taxIdentifiers = try container.decode([String].self, forKey: .taxIdentifiers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deleteQuantityThreshold = try container.decode(Int.self, forKey: .deleteQuantityThreshold) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(excludeSteps, forKey: .excludeSteps) + + try? container.encodeIfPresent(hiddenClosetKeys, forKey: .hiddenClosetKeys) + + try? container.encodeIfPresent(openTags, forKey: .openTags) + + try? container.encodeIfPresent(taxIdentifiers, forKey: .taxIdentifiers) + + try? container.encodeIfPresent(deleteQuantityThreshold, forKey: .deleteQuantityThreshold) + } + } + + /* + Model: DBConfig + Used By: Inventory + */ + + class DBConfig: Codable { + public var vendor: String? + + public var host: String? + + public var port: Int? + + public var username: String? + + public var password: String? + + public var dbname: String? + + public var query: String? + + public var procedure: Bool? + + public var driverClass: String? + + public var jdbcUrl: String? + + public var optionalProperties: [String: String]? + + public enum CodingKeys: String, CodingKey { + case vendor + + case host + + case port + + case username + + case password + + case dbname + + case query + + case procedure + + case driverClass = "driver_class" + + case jdbcUrl = "jdbc_url" + + case optionalProperties = "optional_properties" + } + + public init(dbname: String?, driverClass: String?, host: String?, jdbcUrl: String?, optionalProperties: [String: String]?, password: String?, port: Int?, procedure: Bool?, query: String?, username: String?, vendor: String?) { + self.vendor = vendor + + self.host = host + + self.port = port + + self.username = username + + self.password = password + + self.dbname = dbname + + self.query = query + + self.procedure = procedure + + self.driverClass = driverClass + + self.jdbcUrl = jdbcUrl + + self.optionalProperties = optionalProperties + } + + public func duplicate() -> DBConfig { + let dict = self.dictionary! + let copy = DBConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + vendor = try container.decode(String.self, forKey: .vendor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + host = try container.decode(String.self, forKey: .host) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + port = try container.decode(Int.self, forKey: .port) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + password = try container.decode(String.self, forKey: .password) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dbname = try container.decode(String.self, forKey: .dbname) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode(String.self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + procedure = try container.decode(Bool.self, forKey: .procedure) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + driverClass = try container.decode(String.self, forKey: .driverClass) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + jdbcUrl = try container.decode(String.self, forKey: .jdbcUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + optionalProperties = try container.decode([String: String].self, forKey: .optionalProperties) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(vendor, forKey: .vendor) + + try? container.encodeIfPresent(host, forKey: .host) + + try? container.encodeIfPresent(port, forKey: .port) + + try? container.encodeIfPresent(username, forKey: .username) + + try? container.encodeIfPresent(password, forKey: .password) + + try? container.encodeIfPresent(dbname, forKey: .dbname) + + try? container.encodeIfPresent(query, forKey: .query) + + try? container.encodeIfPresent(procedure, forKey: .procedure) + + try? container.encodeIfPresent(driverClass, forKey: .driverClass) + + try? container.encodeIfPresent(jdbcUrl, forKey: .jdbcUrl) + + try? container.encodeIfPresent(optionalProperties, forKey: .optionalProperties) + } + } + + /* + Model: DBConnectionProfile + Used By: Inventory + */ + + class DBConnectionProfile: Codable { + public var inventory: String? + + public enum CodingKeys: String, CodingKey { + case inventory + } + + public init(inventory: String?) { + self.inventory = inventory + } + + public func duplicate() -> DBConnectionProfile { + let dict = self.dictionary! + let copy = DBConnectionProfile(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + inventory = try container.decode(String.self, forKey: .inventory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(inventory, forKey: .inventory) + } + } + + /* + Model: DBParamConfig + Used By: Inventory + */ + + class DBParamConfig: Codable { + public var params: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case params + } + + public init(params: [String: Any]?) { + self.params = params + } + + public func duplicate() -> DBParamConfig { + let dict = self.dictionary! + let copy = DBParamConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + params = try container.decode([String: Any].self, forKey: .params) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(params, forKey: .params) + } + } + + /* + Model: DefaultHeadersDTO + Used By: Inventory + */ + + class DefaultHeadersDTO: Codable { + public var store: PropBeanDTO? + + public var intfArticleId: PropBeanDTO? + + public var priceEffective: PropBeanDTO? + + public var quantity: PropBeanDTO? + + public enum CodingKeys: String, CodingKey { + case store + + case intfArticleId = "intf_article_id" + + case priceEffective = "price_effective" + + case quantity + } + + public init(intfArticleId: PropBeanDTO?, priceEffective: PropBeanDTO?, quantity: PropBeanDTO?, store: PropBeanDTO?) { + self.store = store + + self.intfArticleId = intfArticleId + + self.priceEffective = priceEffective + + self.quantity = quantity + } + + public func duplicate() -> DefaultHeadersDTO { + let dict = self.dictionary! + let copy = DefaultHeadersDTO(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + store = try container.decode(PropBeanDTO.self, forKey: .store) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + intfArticleId = try container.decode(PropBeanDTO.self, forKey: .intfArticleId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priceEffective = try container.decode(PropBeanDTO.self, forKey: .priceEffective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quantity = try container.decode(PropBeanDTO.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(store, forKey: .store) + + try? container.encodeIfPresent(intfArticleId, forKey: .intfArticleId) + + try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + } + } + + /* + Model: DocMappingConfig + Used By: Inventory + */ + + class DocMappingConfig: Codable { + public var properties: [String: Any]? + + public var junkDataThresholdCount: Int? + + public var propBeanConfigs: [PropBeanConfig]? + + public var unwindField: String? + + public var defaultHeaders: DefaultHeadersDTO? + + public enum CodingKeys: String, CodingKey { + case properties + + case junkDataThresholdCount = "junk_data_threshold_count" + + case propBeanConfigs = "prop_bean_configs" + + case unwindField = "unwind_field" + + case defaultHeaders = "default_headers" + } + + public init(defaultHeaders: DefaultHeadersDTO?, junkDataThresholdCount: Int?, properties: [String: Any]?, propBeanConfigs: [PropBeanConfig]?, unwindField: String?) { + self.properties = properties + + self.junkDataThresholdCount = junkDataThresholdCount + + self.propBeanConfigs = propBeanConfigs + + self.unwindField = unwindField + + self.defaultHeaders = defaultHeaders + } + + public func duplicate() -> DocMappingConfig { + let dict = self.dictionary! + let copy = DocMappingConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + properties = try container.decode([String: Any].self, forKey: .properties) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + junkDataThresholdCount = try container.decode(Int.self, forKey: .junkDataThresholdCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + propBeanConfigs = try container.decode([PropBeanConfig].self, forKey: .propBeanConfigs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + unwindField = try container.decode(String.self, forKey: .unwindField) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + defaultHeaders = try container.decode(DefaultHeadersDTO.self, forKey: .defaultHeaders) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(properties, forKey: .properties) + + try? container.encodeIfPresent(junkDataThresholdCount, forKey: .junkDataThresholdCount) + + try? container.encodeIfPresent(propBeanConfigs, forKey: .propBeanConfigs) + + try? container.encodeIfPresent(unwindField, forKey: .unwindField) + + try? container.encodeIfPresent(defaultHeaders, forKey: .defaultHeaders) + } + } + + /* + Model: EmailConfig + Used By: Inventory + */ + + class EmailConfig: Codable { + public var recepient: String? + + public var host: String? + + public var username: String? + + public var password: String? + + public var unzip: Bool? + + public var readFromContent: Bool? + + public var filterBasedOnRecepients: Bool? + + public var pcol: String? + + public var subjectLineRegex: String? + + public var senderAddress: String? + + public var localDir: String? + + public var folderNameHierarchies: [String]? + + public var attachmentRegex: String? + + public var bodyContentRegex: String? + + public var passwordProtected: Bool? + + public var zipFormat: String? + + public var attachmentMandate: Bool? + + public var filterFilesAfterExtraction: Bool? + + public var archiveConfig: ArchiveConfig? + + public var readAllUnreadMails: Bool? + + public var contentType: String? + + public var downloadableLink: Bool? + + public var properties: [String: String]? + + public enum CodingKeys: String, CodingKey { + case recepient + + case host + + case username + + case password + + case unzip + + case readFromContent = "read_from_content" + + case filterBasedOnRecepients = "filter_based_on_recepients" + + case pcol + + case subjectLineRegex = "subject_line_regex" + + case senderAddress = "sender_address" + + case localDir = "local_dir" + + case folderNameHierarchies = "folder_name_hierarchies" + + case attachmentRegex = "attachment_regex" + + case bodyContentRegex = "body_content_regex" + + case passwordProtected = "password_protected" + + case zipFormat = "zip_format" + + case attachmentMandate = "attachment_mandate" + + case filterFilesAfterExtraction = "filter_files_after_extraction" + + case archiveConfig = "archive_config" + + case readAllUnreadMails = "read_all_unread_mails" + + case contentType = "content_type" + + case downloadableLink = "downloadable_link" + + case properties + } + + public init(archiveConfig: ArchiveConfig?, attachmentMandate: Bool?, attachmentRegex: String?, bodyContentRegex: String?, contentType: String?, downloadableLink: Bool?, filterBasedOnRecepients: Bool?, filterFilesAfterExtraction: Bool?, folderNameHierarchies: [String]?, host: String?, localDir: String?, password: String?, passwordProtected: Bool?, pcol: String?, properties: [String: String]?, readAllUnreadMails: Bool?, readFromContent: Bool?, recepient: String?, senderAddress: String?, subjectLineRegex: String?, unzip: Bool?, username: String?, zipFormat: String?) { + self.recepient = recepient + + self.host = host + + self.username = username + + self.password = password + + self.unzip = unzip + + self.readFromContent = readFromContent + + self.filterBasedOnRecepients = filterBasedOnRecepients + + self.pcol = pcol + + self.subjectLineRegex = subjectLineRegex + + self.senderAddress = senderAddress + + self.localDir = localDir + + self.folderNameHierarchies = folderNameHierarchies + + self.attachmentRegex = attachmentRegex + + self.bodyContentRegex = bodyContentRegex + + self.passwordProtected = passwordProtected + + self.zipFormat = zipFormat + + self.attachmentMandate = attachmentMandate + + self.filterFilesAfterExtraction = filterFilesAfterExtraction + + self.archiveConfig = archiveConfig + + self.readAllUnreadMails = readAllUnreadMails + + self.contentType = contentType + + self.downloadableLink = downloadableLink + + self.properties = properties + } + + public func duplicate() -> EmailConfig { + let dict = self.dictionary! + let copy = EmailConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + recepient = try container.decode(String.self, forKey: .recepient) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + host = try container.decode(String.self, forKey: .host) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + password = try container.decode(String.self, forKey: .password) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + unzip = try container.decode(Bool.self, forKey: .unzip) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + readFromContent = try container.decode(Bool.self, forKey: .readFromContent) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filterBasedOnRecepients = try container.decode(Bool.self, forKey: .filterBasedOnRecepients) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pcol = try container.decode(String.self, forKey: .pcol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subjectLineRegex = try container.decode(String.self, forKey: .subjectLineRegex) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + senderAddress = try container.decode(String.self, forKey: .senderAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + localDir = try container.decode(String.self, forKey: .localDir) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + folderNameHierarchies = try container.decode([String].self, forKey: .folderNameHierarchies) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attachmentRegex = try container.decode(String.self, forKey: .attachmentRegex) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bodyContentRegex = try container.decode(String.self, forKey: .bodyContentRegex) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + passwordProtected = try container.decode(Bool.self, forKey: .passwordProtected) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + zipFormat = try container.decode(String.self, forKey: .zipFormat) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attachmentMandate = try container.decode(Bool.self, forKey: .attachmentMandate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filterFilesAfterExtraction = try container.decode(Bool.self, forKey: .filterFilesAfterExtraction) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archiveConfig = try container.decode(ArchiveConfig.self, forKey: .archiveConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + readAllUnreadMails = try container.decode(Bool.self, forKey: .readAllUnreadMails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contentType = try container.decode(String.self, forKey: .contentType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + downloadableLink = try container.decode(Bool.self, forKey: .downloadableLink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + properties = try container.decode([String: String].self, forKey: .properties) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(recepient, forKey: .recepient) + + try? container.encodeIfPresent(host, forKey: .host) + + try? container.encodeIfPresent(username, forKey: .username) + + try? container.encodeIfPresent(password, forKey: .password) + + try? container.encodeIfPresent(unzip, forKey: .unzip) + + try? container.encodeIfPresent(readFromContent, forKey: .readFromContent) + + try? container.encodeIfPresent(filterBasedOnRecepients, forKey: .filterBasedOnRecepients) + + try? container.encodeIfPresent(pcol, forKey: .pcol) + + try? container.encodeIfPresent(subjectLineRegex, forKey: .subjectLineRegex) + + try? container.encodeIfPresent(senderAddress, forKey: .senderAddress) + + try? container.encodeIfPresent(localDir, forKey: .localDir) + + try? container.encodeIfPresent(folderNameHierarchies, forKey: .folderNameHierarchies) + + try? container.encodeIfPresent(attachmentRegex, forKey: .attachmentRegex) + + try? container.encodeIfPresent(bodyContentRegex, forKey: .bodyContentRegex) + + try? container.encodeIfPresent(passwordProtected, forKey: .passwordProtected) + + try? container.encodeIfPresent(zipFormat, forKey: .zipFormat) + + try? container.encodeIfPresent(attachmentMandate, forKey: .attachmentMandate) + + try? container.encodeIfPresent(filterFilesAfterExtraction, forKey: .filterFilesAfterExtraction) + + try? container.encodeIfPresent(archiveConfig, forKey: .archiveConfig) + + try? container.encodeIfPresent(readAllUnreadMails, forKey: .readAllUnreadMails) + + try? container.encodeIfPresent(contentType, forKey: .contentType) + + try? container.encodeIfPresent(downloadableLink, forKey: .downloadableLink) + + try? container.encodeIfPresent(properties, forKey: .properties) + } + } + + /* + Model: FTPConfig + Used By: Inventory + */ + + class FTPConfig: Codable { + public var host: String? + + public var port: Int? + + public var username: String? + + public var password: String? + + public var unzip: Bool? + + public var retries: Int? + + public var interval: Int? + + public var localDir: String? + + public var remoteDir: String? + + public var zipFileRegex: String? + + public var archiveConfig: ArchiveConfig? + + public var fileRegex: String? + + public var zipFormat: String? + + public var readAllFiles: Bool? + + public enum CodingKeys: String, CodingKey { + case host + + case port + + case username + + case password + + case unzip + + case retries + + case interval + + case localDir = "local_dir" + + case remoteDir = "remote_dir" + + case zipFileRegex = "zip_file_regex" + + case archiveConfig = "archive_config" + + case fileRegex = "file_regex" + + case zipFormat = "zip_format" + + case readAllFiles = "read_all_files" + } + + public init(archiveConfig: ArchiveConfig?, fileRegex: String?, host: String?, interval: Int?, localDir: String?, password: String?, port: Int?, readAllFiles: Bool?, remoteDir: String?, retries: Int?, unzip: Bool?, username: String?, zipFileRegex: String?, zipFormat: String?) { + self.host = host + + self.port = port + + self.username = username + + self.password = password + + self.unzip = unzip + + self.retries = retries + + self.interval = interval + + self.localDir = localDir + + self.remoteDir = remoteDir + + self.zipFileRegex = zipFileRegex + + self.archiveConfig = archiveConfig + + self.fileRegex = fileRegex + + self.zipFormat = zipFormat + + self.readAllFiles = readAllFiles + } + + public func duplicate() -> FTPConfig { + let dict = self.dictionary! + let copy = FTPConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + host = try container.decode(String.self, forKey: .host) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + port = try container.decode(Int.self, forKey: .port) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + password = try container.decode(String.self, forKey: .password) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + unzip = try container.decode(Bool.self, forKey: .unzip) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + retries = try container.decode(Int.self, forKey: .retries) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + interval = try container.decode(Int.self, forKey: .interval) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + localDir = try container.decode(String.self, forKey: .localDir) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + remoteDir = try container.decode(String.self, forKey: .remoteDir) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + zipFileRegex = try container.decode(String.self, forKey: .zipFileRegex) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archiveConfig = try container.decode(ArchiveConfig.self, forKey: .archiveConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fileRegex = try container.decode(String.self, forKey: .fileRegex) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + zipFormat = try container.decode(String.self, forKey: .zipFormat) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + readAllFiles = try container.decode(Bool.self, forKey: .readAllFiles) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(host, forKey: .host) + + try? container.encodeIfPresent(port, forKey: .port) + + try? container.encodeIfPresent(username, forKey: .username) + + try? container.encodeIfPresent(password, forKey: .password) + + try? container.encodeIfPresent(unzip, forKey: .unzip) + + try? container.encodeIfPresent(retries, forKey: .retries) + + try? container.encodeIfPresent(interval, forKey: .interval) + + try? container.encodeIfPresent(localDir, forKey: .localDir) + + try? container.encodeIfPresent(remoteDir, forKey: .remoteDir) + + try? container.encodeIfPresent(zipFileRegex, forKey: .zipFileRegex) + + try? container.encodeIfPresent(archiveConfig, forKey: .archiveConfig) + + try? container.encodeIfPresent(fileRegex, forKey: .fileRegex) + + try? container.encodeIfPresent(zipFormat, forKey: .zipFormat) + + try? container.encodeIfPresent(readAllFiles, forKey: .readAllFiles) + } + } + + /* + Model: FileConfig + Used By: Inventory + */ + + class FileConfig: Codable { + public var delimiter: String? + + public var charset: String? + + public var properties: [String: Any]? + + public var fileHasHeader: Bool? + + public var headerIndex: Int? + + public var headerArray: [String]? + + public var dataStartIndex: Int? + + public var propBeanConfigs: [PropBeanConfig]? + + public var junkDataThresholdCount: Int? + + public var fileType: String? + + public var lineValidityCheck: Bool? + + public var sheetNames: [String]? + + public var readAllSheets: Bool? + + public var quoteChar: String? + + public var escapeChar: String? + + public var defaultHeaders: DefaultHeadersDTO? + + public enum CodingKeys: String, CodingKey { + case delimiter + + case charset + + case properties + + case fileHasHeader = "file_has_header" + + case headerIndex = "header_index" + + case headerArray = "header_array" + + case dataStartIndex = "data_start_index" + + case propBeanConfigs = "prop_bean_configs" + + case junkDataThresholdCount = "junk_data_threshold_count" + + case fileType = "file_type" + + case lineValidityCheck = "line_validity_check" + + case sheetNames = "sheet_names" + + case readAllSheets = "read_all_sheets" + + case quoteChar = "quote_char" + + case escapeChar = "escape_char" + + case defaultHeaders = "default_headers" + } + + public init(charset: String?, dataStartIndex: Int?, defaultHeaders: DefaultHeadersDTO?, delimiter: String?, escapeChar: String?, fileHasHeader: Bool?, fileType: String?, headerArray: [String]?, headerIndex: Int?, junkDataThresholdCount: Int?, lineValidityCheck: Bool?, properties: [String: Any]?, propBeanConfigs: [PropBeanConfig]?, quoteChar: String?, readAllSheets: Bool?, sheetNames: [String]?) { + self.delimiter = delimiter + + self.charset = charset + + self.properties = properties + + self.fileHasHeader = fileHasHeader + + self.headerIndex = headerIndex + + self.headerArray = headerArray + + self.dataStartIndex = dataStartIndex + + self.propBeanConfigs = propBeanConfigs + + self.junkDataThresholdCount = junkDataThresholdCount + + self.fileType = fileType + + self.lineValidityCheck = lineValidityCheck + + self.sheetNames = sheetNames + + self.readAllSheets = readAllSheets + + self.quoteChar = quoteChar + + self.escapeChar = escapeChar + + self.defaultHeaders = defaultHeaders + } + + public func duplicate() -> FileConfig { + let dict = self.dictionary! + let copy = FileConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + delimiter = try container.decode(String.self, forKey: .delimiter) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + charset = try container.decode(String.self, forKey: .charset) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + properties = try container.decode([String: Any].self, forKey: .properties) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fileHasHeader = try container.decode(Bool.self, forKey: .fileHasHeader) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + headerIndex = try container.decode(Int.self, forKey: .headerIndex) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + headerArray = try container.decode([String].self, forKey: .headerArray) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dataStartIndex = try container.decode(Int.self, forKey: .dataStartIndex) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + propBeanConfigs = try container.decode([PropBeanConfig].self, forKey: .propBeanConfigs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + junkDataThresholdCount = try container.decode(Int.self, forKey: .junkDataThresholdCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fileType = try container.decode(String.self, forKey: .fileType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lineValidityCheck = try container.decode(Bool.self, forKey: .lineValidityCheck) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sheetNames = try container.decode([String].self, forKey: .sheetNames) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + readAllSheets = try container.decode(Bool.self, forKey: .readAllSheets) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quoteChar = try container.decode(String.self, forKey: .quoteChar) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + escapeChar = try container.decode(String.self, forKey: .escapeChar) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + defaultHeaders = try container.decode(DefaultHeadersDTO.self, forKey: .defaultHeaders) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(delimiter, forKey: .delimiter) + + try? container.encodeIfPresent(charset, forKey: .charset) + + try? container.encodeIfPresent(properties, forKey: .properties) + + try? container.encodeIfPresent(fileHasHeader, forKey: .fileHasHeader) + + try? container.encodeIfPresent(headerIndex, forKey: .headerIndex) + + try? container.encodeIfPresent(headerArray, forKey: .headerArray) + + try? container.encodeIfPresent(dataStartIndex, forKey: .dataStartIndex) + + try? container.encodeIfPresent(propBeanConfigs, forKey: .propBeanConfigs) + + try? container.encodeIfPresent(junkDataThresholdCount, forKey: .junkDataThresholdCount) + + try? container.encodeIfPresent(fileType, forKey: .fileType) + + try? container.encodeIfPresent(lineValidityCheck, forKey: .lineValidityCheck) + + try? container.encodeIfPresent(sheetNames, forKey: .sheetNames) + + try? container.encodeIfPresent(readAllSheets, forKey: .readAllSheets) + + try? container.encodeIfPresent(quoteChar, forKey: .quoteChar) + + try? container.encodeIfPresent(escapeChar, forKey: .escapeChar) + + try? container.encodeIfPresent(defaultHeaders, forKey: .defaultHeaders) + } + } + + /* + Model: GoogleSpreadSheetConfig + Used By: Inventory + */ + + class GoogleSpreadSheetConfig: Codable { + public var range: String? + + public var sheetId: String? + + public var clientSecretLocation: String? + + public var credStorageDirectory: String? + + public var localDir: String? + + public var archiveConfig: ArchiveConfig? + + public enum CodingKeys: String, CodingKey { + case range + + case sheetId = "sheet_id" + + case clientSecretLocation = "client_secret_location" + + case credStorageDirectory = "cred_storage_directory" + + case localDir = "local_dir" + + case archiveConfig = "archive_config" + } + + public init(archiveConfig: ArchiveConfig?, clientSecretLocation: String?, credStorageDirectory: String?, localDir: String?, range: String?, sheetId: String?) { + self.range = range + + self.sheetId = sheetId + + self.clientSecretLocation = clientSecretLocation + + self.credStorageDirectory = credStorageDirectory + + self.localDir = localDir + + self.archiveConfig = archiveConfig + } + + public func duplicate() -> GoogleSpreadSheetConfig { + let dict = self.dictionary! + let copy = GoogleSpreadSheetConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + range = try container.decode(String.self, forKey: .range) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sheetId = try container.decode(String.self, forKey: .sheetId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + clientSecretLocation = try container.decode(String.self, forKey: .clientSecretLocation) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + credStorageDirectory = try container.decode(String.self, forKey: .credStorageDirectory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + localDir = try container.decode(String.self, forKey: .localDir) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archiveConfig = try container.decode(ArchiveConfig.self, forKey: .archiveConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(range, forKey: .range) + + try? container.encodeIfPresent(sheetId, forKey: .sheetId) + + try? container.encodeIfPresent(clientSecretLocation, forKey: .clientSecretLocation) + + try? container.encodeIfPresent(credStorageDirectory, forKey: .credStorageDirectory) + + try? container.encodeIfPresent(localDir, forKey: .localDir) + + try? container.encodeIfPresent(archiveConfig, forKey: .archiveConfig) + } + } + + /* + Model: HttpConfig + Used By: Inventory + */ + + class HttpConfig: Codable { + public var hosturl: String? + + public var username: String? + + public var password: String? + + public var requestParams: [String: String]? + + public var httpMethod: String? + + public var requestPayload: String? + + public var localPath: String? + + public var archiveConfig: ArchiveConfig? + + public enum CodingKeys: String, CodingKey { + case hosturl + + case username + + case password + + case requestParams = "request_params" + + case httpMethod = "http_method" + + case requestPayload = "request_payload" + + case localPath = "local_path" + + case archiveConfig = "archive_config" + } + + public init(archiveConfig: ArchiveConfig?, hosturl: String?, httpMethod: String?, localPath: String?, password: String?, requestParams: [String: String]?, requestPayload: String?, username: String?) { + self.hosturl = hosturl + + self.username = username + + self.password = password + + self.requestParams = requestParams + + self.httpMethod = httpMethod + + self.requestPayload = requestPayload + + self.localPath = localPath + + self.archiveConfig = archiveConfig + } + + public func duplicate() -> HttpConfig { + let dict = self.dictionary! + let copy = HttpConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + hosturl = try container.decode(String.self, forKey: .hosturl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + password = try container.decode(String.self, forKey: .password) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestParams = try container.decode([String: String].self, forKey: .requestParams) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + httpMethod = try container.decode(String.self, forKey: .httpMethod) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestPayload = try container.decode(String.self, forKey: .requestPayload) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + localPath = try container.decode(String.self, forKey: .localPath) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archiveConfig = try container.decode(ArchiveConfig.self, forKey: .archiveConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(hosturl, forKey: .hosturl) + + try? container.encodeIfPresent(username, forKey: .username) + + try? container.encodeIfPresent(password, forKey: .password) + + try? container.encodeIfPresent(requestParams, forKey: .requestParams) + + try? container.encodeIfPresent(httpMethod, forKey: .httpMethod) + + try? container.encodeIfPresent(requestPayload, forKey: .requestPayload) + + try? container.encodeIfPresent(localPath, forKey: .localPath) + + try? container.encodeIfPresent(archiveConfig, forKey: .archiveConfig) + } + } + + /* + Model: JobConfig + Used By: Inventory + */ + + class JobConfig: Codable { + public var id: Int? + + public var jobCode: String? + + public var taskType: String? + + public var syncDelay: Int? + + public var cronExpression: String? + + public var storeFilter: StoreFilter? + + public var processConfig: ProcessConfig? + + public var storeConfig: [StoreConfig]? + + public var properties: [String: String]? + + public var immediateFirstRun: Bool? + + public var disable: Bool? + + public var dependentJobCodes: [String]? + + public var companyConfig: [CompanyConfig]? + + public var companyIds: [Int]? + + public var taxIdentifiers: [String]? + + public var priority: String? + + public var periodThreshold: Int? + + public var periodThresholdType: String? + + public var dbConnectionProfile: DBConnectionProfile? + + public var params: [String: Any]? + + public var openTags: [String: Any]? + + public var deleteQuantityThreshold: Int? + + public var catalogMasterConfig: CatalogMasterConfig? + + public var aggregatorTypes: [String]? + + public var integrationType: String? + + public var minPrice: Double? + + public var audit: Audit? + + public var version: Int? + + public var alias: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case jobCode = "job_code" + + case taskType = "task_type" + + case syncDelay = "sync_delay" + + case cronExpression = "cron_expression" + + case storeFilter = "store_filter" + + case processConfig = "process_config" + + case storeConfig = "store_config" + + case properties + + case immediateFirstRun = "immediate_first_run" + + case disable + + case dependentJobCodes = "dependent_job_codes" + + case companyConfig = "company_config" + + case companyIds = "company_ids" + + case taxIdentifiers = "tax_identifiers" + + case priority + + case periodThreshold = "period_threshold" + + case periodThresholdType = "period_threshold_type" + + case dbConnectionProfile = "db_connection_profile" + + case params + + case openTags = "open_tags" + + case deleteQuantityThreshold = "delete_quantity_threshold" + + case catalogMasterConfig = "catalog_master_config" + + case aggregatorTypes = "aggregator_types" + + case integrationType = "integration_type" + + case minPrice = "min_price" + + case audit + + case version + + case alias + } + + public init(aggregatorTypes: [String]?, alias: String?, audit: Audit?, catalogMasterConfig: CatalogMasterConfig?, companyConfig: [CompanyConfig]?, companyIds: [Int]?, cronExpression: String?, dbConnectionProfile: DBConnectionProfile?, deleteQuantityThreshold: Int?, dependentJobCodes: [String]?, disable: Bool?, immediateFirstRun: Bool?, integrationType: String?, jobCode: String?, minPrice: Double?, openTags: [String: Any]?, params: [String: Any]?, periodThreshold: Int?, periodThresholdType: String?, priority: String?, processConfig: ProcessConfig?, properties: [String: String]?, storeConfig: [StoreConfig]?, storeFilter: StoreFilter?, syncDelay: Int?, taskType: String?, taxIdentifiers: [String]?, version: Int?, id: Int?) { + self.id = id + + self.jobCode = jobCode + + self.taskType = taskType + + self.syncDelay = syncDelay + + self.cronExpression = cronExpression + + self.storeFilter = storeFilter + + self.processConfig = processConfig + + self.storeConfig = storeConfig + + self.properties = properties + + self.immediateFirstRun = immediateFirstRun + + self.disable = disable + + self.dependentJobCodes = dependentJobCodes + + self.companyConfig = companyConfig + + self.companyIds = companyIds + + self.taxIdentifiers = taxIdentifiers + + self.priority = priority + + self.periodThreshold = periodThreshold + + self.periodThresholdType = periodThresholdType + + self.dbConnectionProfile = dbConnectionProfile + + self.params = params + + self.openTags = openTags + + self.deleteQuantityThreshold = deleteQuantityThreshold + + self.catalogMasterConfig = catalogMasterConfig + + self.aggregatorTypes = aggregatorTypes + + self.integrationType = integrationType + + self.minPrice = minPrice + + self.audit = audit + + self.version = version + + self.alias = alias + } + + public func duplicate() -> JobConfig { + let dict = self.dictionary! + let copy = JobConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + jobCode = try container.decode(String.self, forKey: .jobCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + taskType = try container.decode(String.self, forKey: .taskType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + syncDelay = try container.decode(Int.self, forKey: .syncDelay) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cronExpression = try container.decode(String.self, forKey: .cronExpression) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeFilter = try container.decode(StoreFilter.self, forKey: .storeFilter) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + processConfig = try container.decode(ProcessConfig.self, forKey: .processConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeConfig = try container.decode([StoreConfig].self, forKey: .storeConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + properties = try container.decode([String: String].self, forKey: .properties) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + immediateFirstRun = try container.decode(Bool.self, forKey: .immediateFirstRun) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + disable = try container.decode(Bool.self, forKey: .disable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dependentJobCodes = try container.decode([String].self, forKey: .dependentJobCodes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyConfig = try container.decode([CompanyConfig].self, forKey: .companyConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyIds = try container.decode([Int].self, forKey: .companyIds) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + taxIdentifiers = try container.decode([String].self, forKey: .taxIdentifiers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(String.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + periodThreshold = try container.decode(Int.self, forKey: .periodThreshold) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + periodThresholdType = try container.decode(String.self, forKey: .periodThresholdType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dbConnectionProfile = try container.decode(DBConnectionProfile.self, forKey: .dbConnectionProfile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + params = try container.decode([String: Any].self, forKey: .params) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + openTags = try container.decode([String: Any].self, forKey: .openTags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deleteQuantityThreshold = try container.decode(Int.self, forKey: .deleteQuantityThreshold) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + catalogMasterConfig = try container.decode(CatalogMasterConfig.self, forKey: .catalogMasterConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + aggregatorTypes = try container.decode([String].self, forKey: .aggregatorTypes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + integrationType = try container.decode(String.self, forKey: .integrationType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + minPrice = try container.decode(Double.self, forKey: .minPrice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + audit = try container.decode(Audit.self, forKey: .audit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + version = try container.decode(Int.self, forKey: .version) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + alias = try container.decode(String.self, forKey: .alias) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(jobCode, forKey: .jobCode) + + try? container.encodeIfPresent(taskType, forKey: .taskType) + + try? container.encodeIfPresent(syncDelay, forKey: .syncDelay) + + try? container.encodeIfPresent(cronExpression, forKey: .cronExpression) + + try? container.encodeIfPresent(storeFilter, forKey: .storeFilter) + + try? container.encodeIfPresent(processConfig, forKey: .processConfig) + + try? container.encodeIfPresent(storeConfig, forKey: .storeConfig) + + try? container.encodeIfPresent(properties, forKey: .properties) + + try? container.encodeIfPresent(immediateFirstRun, forKey: .immediateFirstRun) + + try? container.encodeIfPresent(disable, forKey: .disable) + + try? container.encodeIfPresent(dependentJobCodes, forKey: .dependentJobCodes) + + try? container.encodeIfPresent(companyConfig, forKey: .companyConfig) + + try? container.encodeIfPresent(companyIds, forKey: .companyIds) + + try? container.encodeIfPresent(taxIdentifiers, forKey: .taxIdentifiers) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(periodThreshold, forKey: .periodThreshold) + + try? container.encodeIfPresent(periodThresholdType, forKey: .periodThresholdType) + + try? container.encodeIfPresent(dbConnectionProfile, forKey: .dbConnectionProfile) + + try? container.encodeIfPresent(params, forKey: .params) + + try? container.encodeIfPresent(openTags, forKey: .openTags) + + try? container.encodeIfPresent(deleteQuantityThreshold, forKey: .deleteQuantityThreshold) + + try? container.encodeIfPresent(catalogMasterConfig, forKey: .catalogMasterConfig) + + try? container.encodeIfPresent(aggregatorTypes, forKey: .aggregatorTypes) + + try? container.encodeIfPresent(integrationType, forKey: .integrationType) + + try? container.encodeIfPresent(minPrice, forKey: .minPrice) + + try? container.encodeIfPresent(audit, forKey: .audit) + + try? container.encodeIfPresent(version, forKey: .version) + + try? container.encodeIfPresent(alias, forKey: .alias) + } + } + + /* + Model: JobConfigRawDTO + Used By: Inventory + */ + + class JobConfigRawDTO: Codable { + public var integration: String + + public var companyName: String + + public var companyId: Int + + public var data: JobConfig? + + public enum CodingKeys: String, CodingKey { + case integration + + case companyName = "company_name" + + case companyId = "company_id" + + case data + } + + public init(companyId: Int, companyName: String, data: JobConfig?, integration: String) { + self.integration = integration + + self.companyName = companyName + + self.companyId = companyId + + self.data = data + } + + public func duplicate() -> JobConfigRawDTO { + let dict = self.dictionary! + let copy = JobConfigRawDTO(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + integration = try container.decode(String.self, forKey: .integration) + + companyName = try container.decode(String.self, forKey: .companyName) + + companyId = try container.decode(Int.self, forKey: .companyId) + + do { + data = try container.decode(JobConfig.self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(integration, forKey: .integration) + + try? container.encodeIfPresent(companyName, forKey: .companyName) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: JsonDocConfig + Used By: Inventory + */ + + class JsonDocConfig: Codable { + public var propBeanConfigs: [PropBeanConfig]? + + public enum CodingKeys: String, CodingKey { + case propBeanConfigs = "prop_bean_configs" + } + + public init(propBeanConfigs: [PropBeanConfig]?) { + self.propBeanConfigs = propBeanConfigs + } + + public func duplicate() -> JsonDocConfig { + let dict = self.dictionary! + let copy = JsonDocConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + propBeanConfigs = try container.decode([PropBeanConfig].self, forKey: .propBeanConfigs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(propBeanConfigs, forKey: .propBeanConfigs) + } + } + + /* + Model: LocalFileConfig + Used By: Inventory + */ + + class LocalFileConfig: Codable { + public var retries: Int? + + public var interval: Int? + + public var localDir: String? + + public var workingDir: String? + + public var unzip: Bool? + + public var zipFileRegex: String? + + public var fileRegex: String? + + public var zipFormat: String? + + public var archiveConfig: ArchiveConfig? + + public var readAllFiles: Bool? + + public enum CodingKeys: String, CodingKey { + case retries + + case interval + + case localDir = "local_dir" + + case workingDir = "working_dir" + + case unzip + + case zipFileRegex = "zip_file_regex" + + case fileRegex = "file_regex" + + case zipFormat = "zip_format" + + case archiveConfig = "archive_config" + + case readAllFiles = "read_all_files" + } + + public init(archiveConfig: ArchiveConfig?, fileRegex: String?, interval: Int?, localDir: String?, readAllFiles: Bool?, retries: Int?, unzip: Bool?, workingDir: String?, zipFileRegex: String?, zipFormat: String?) { + self.retries = retries + + self.interval = interval + + self.localDir = localDir + + self.workingDir = workingDir + + self.unzip = unzip + + self.zipFileRegex = zipFileRegex + + self.fileRegex = fileRegex + + self.zipFormat = zipFormat + + self.archiveConfig = archiveConfig + + self.readAllFiles = readAllFiles + } + + public func duplicate() -> LocalFileConfig { + let dict = self.dictionary! + let copy = LocalFileConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + retries = try container.decode(Int.self, forKey: .retries) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + interval = try container.decode(Int.self, forKey: .interval) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + localDir = try container.decode(String.self, forKey: .localDir) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + workingDir = try container.decode(String.self, forKey: .workingDir) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + unzip = try container.decode(Bool.self, forKey: .unzip) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + zipFileRegex = try container.decode(String.self, forKey: .zipFileRegex) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fileRegex = try container.decode(String.self, forKey: .fileRegex) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + zipFormat = try container.decode(String.self, forKey: .zipFormat) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archiveConfig = try container.decode(ArchiveConfig.self, forKey: .archiveConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + readAllFiles = try container.decode(Bool.self, forKey: .readAllFiles) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(retries, forKey: .retries) + + try? container.encodeIfPresent(interval, forKey: .interval) + + try? container.encodeIfPresent(localDir, forKey: .localDir) + + try? container.encodeIfPresent(workingDir, forKey: .workingDir) + + try? container.encodeIfPresent(unzip, forKey: .unzip) + + try? container.encodeIfPresent(zipFileRegex, forKey: .zipFileRegex) + + try? container.encodeIfPresent(fileRegex, forKey: .fileRegex) + + try? container.encodeIfPresent(zipFormat, forKey: .zipFormat) + + try? container.encodeIfPresent(archiveConfig, forKey: .archiveConfig) + + try? container.encodeIfPresent(readAllFiles, forKey: .readAllFiles) + } + } + + /* + Model: MongoDocConfig + Used By: Inventory + */ + + class MongoDocConfig: Codable { + public var collectionName: String? + + public var findQuery: [String: Any]? + + public var projectionQuery: [String: Any]? + + public var propBeanConfigs: [PropBeanConfig]? + + public var aggregatePipeline: [[String: Any]]? + + public var skipSave: Bool? + + public enum CodingKeys: String, CodingKey { + case collectionName = "collection_name" + + case findQuery = "find_query" + + case projectionQuery = "projection_query" + + case propBeanConfigs = "prop_bean_configs" + + case aggregatePipeline = "aggregate_pipeline" + + case skipSave = "skip_save" + } + + public init(aggregatePipeline: [[String: Any]]?, collectionName: String?, findQuery: [String: Any]?, projectionQuery: [String: Any]?, propBeanConfigs: [PropBeanConfig]?, skipSave: Bool?) { + self.collectionName = collectionName + + self.findQuery = findQuery + + self.projectionQuery = projectionQuery + + self.propBeanConfigs = propBeanConfigs + + self.aggregatePipeline = aggregatePipeline + + self.skipSave = skipSave + } + + public func duplicate() -> MongoDocConfig { + let dict = self.dictionary! + let copy = MongoDocConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + collectionName = try container.decode(String.self, forKey: .collectionName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + findQuery = try container.decode([String: Any].self, forKey: .findQuery) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + projectionQuery = try container.decode([String: Any].self, forKey: .projectionQuery) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + propBeanConfigs = try container.decode([PropBeanConfig].self, forKey: .propBeanConfigs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + aggregatePipeline = try container.decode([[String: Any]].self, forKey: .aggregatePipeline) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + skipSave = try container.decode(Bool.self, forKey: .skipSave) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(collectionName, forKey: .collectionName) + + try? container.encodeIfPresent(findQuery, forKey: .findQuery) + + try? container.encodeIfPresent(projectionQuery, forKey: .projectionQuery) + + try? container.encodeIfPresent(propBeanConfigs, forKey: .propBeanConfigs) + + try? container.encodeIfPresent(aggregatePipeline, forKey: .aggregatePipeline) + + try? container.encodeIfPresent(skipSave, forKey: .skipSave) + } + } + + /* + Model: OAuthConfig + Used By: Inventory + */ + + class OAuthConfig: Codable { + public var limit: Int? + + public var pages: Int? + + public var interval: Int? + + public var consumerKey: String? + + public var consumerSecret: String? + + public var token: String? + + public var tokenSecret: String? + + public var restUrl: String? + + public var restBaseUrl: String? + + public var functionName: String? + + public enum CodingKeys: String, CodingKey { + case limit + + case pages + + case interval + + case consumerKey = "consumer_key" + + case consumerSecret = "consumer_secret" + + case token + + case tokenSecret = "token_secret" + + case restUrl = "rest_url" + + case restBaseUrl = "rest_base_url" + + case functionName = "function_name" + } + + public init(consumerKey: String?, consumerSecret: String?, functionName: String?, interval: Int?, limit: Int?, pages: Int?, restBaseUrl: String?, restUrl: String?, token: String?, tokenSecret: String?) { + self.limit = limit + + self.pages = pages + + self.interval = interval + + self.consumerKey = consumerKey + + self.consumerSecret = consumerSecret + + self.token = token + + self.tokenSecret = tokenSecret + + self.restUrl = restUrl + + self.restBaseUrl = restBaseUrl + + self.functionName = functionName + } + + public func duplicate() -> OAuthConfig { + let dict = self.dictionary! + let copy = OAuthConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + limit = try container.decode(Int.self, forKey: .limit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pages = try container.decode(Int.self, forKey: .pages) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + interval = try container.decode(Int.self, forKey: .interval) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + consumerKey = try container.decode(String.self, forKey: .consumerKey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + consumerSecret = try container.decode(String.self, forKey: .consumerSecret) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + token = try container.decode(String.self, forKey: .token) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tokenSecret = try container.decode(String.self, forKey: .tokenSecret) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + restUrl = try container.decode(String.self, forKey: .restUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + restBaseUrl = try container.decode(String.self, forKey: .restBaseUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + functionName = try container.decode(String.self, forKey: .functionName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(limit, forKey: .limit) + + try? container.encodeIfPresent(pages, forKey: .pages) + + try? container.encodeIfPresent(interval, forKey: .interval) + + try? container.encodeIfPresent(consumerKey, forKey: .consumerKey) + + try? container.encodeIfPresent(consumerSecret, forKey: .consumerSecret) + + try? container.encodeIfPresent(token, forKey: .token) + + try? container.encodeIfPresent(tokenSecret, forKey: .tokenSecret) + + try? container.encodeIfPresent(restUrl, forKey: .restUrl) + + try? container.encodeIfPresent(restBaseUrl, forKey: .restBaseUrl) + + try? container.encodeIfPresent(functionName, forKey: .functionName) + } + } + + /* + Model: ProcessConfig + Used By: Inventory + */ + + class ProcessConfig: Codable { + public var dbConfig: DBConfig? + + public var dbParamConfig: DBParamConfig? + + public var sftpConfig: SFTPConfig? + + public var awsS3Config: AWSS3config? + + public var mongoDocConfig: MongoDocConfig? + + public var ftpConfig: FTPConfig? + + public var emailConfig: EmailConfig? + + public var fileConfig: FileConfig? + + public var jsonDocConfig: JsonDocConfig? + + public var docMappingConfig: DocMappingConfig? + + public var taskStepConfig: TaskStepConfig? + + public var httpConfig: HttpConfig? + + public var localFileConfig: LocalFileConfig? + + public var oauthConfig: OAuthConfig? + + public var googleSpreadsheetConfig: GoogleSpreadSheetConfig? + + public enum CodingKeys: String, CodingKey { + case dbConfig = "db_config" + + case dbParamConfig = "db_param_config" + + case sftpConfig = "sftp_config" + + case awsS3Config = "aws_s3_config" + + case mongoDocConfig = "mongo_doc_config" + + case ftpConfig = "ftp_config" + + case emailConfig = "email_config" + + case fileConfig = "file_config" + + case jsonDocConfig = "json_doc_config" + + case docMappingConfig = "doc_mapping_config" + + case taskStepConfig = "task_step_config" + + case httpConfig = "http_config" + + case localFileConfig = "local_file_config" + + case oauthConfig = "oauth_config" + + case googleSpreadsheetConfig = "google_spreadsheet_config" + } + + public init(awsS3Config: AWSS3config?, dbConfig: DBConfig?, dbParamConfig: DBParamConfig?, docMappingConfig: DocMappingConfig?, emailConfig: EmailConfig?, fileConfig: FileConfig?, ftpConfig: FTPConfig?, googleSpreadsheetConfig: GoogleSpreadSheetConfig?, httpConfig: HttpConfig?, jsonDocConfig: JsonDocConfig?, localFileConfig: LocalFileConfig?, mongoDocConfig: MongoDocConfig?, oauthConfig: OAuthConfig?, sftpConfig: SFTPConfig?, taskStepConfig: TaskStepConfig?) { + self.dbConfig = dbConfig + + self.dbParamConfig = dbParamConfig + + self.sftpConfig = sftpConfig + + self.awsS3Config = awsS3Config + + self.mongoDocConfig = mongoDocConfig + + self.ftpConfig = ftpConfig + + self.emailConfig = emailConfig + + self.fileConfig = fileConfig + + self.jsonDocConfig = jsonDocConfig + + self.docMappingConfig = docMappingConfig + + self.taskStepConfig = taskStepConfig + + self.httpConfig = httpConfig + + self.localFileConfig = localFileConfig + + self.oauthConfig = oauthConfig + + self.googleSpreadsheetConfig = googleSpreadsheetConfig + } + + public func duplicate() -> ProcessConfig { + let dict = self.dictionary! + let copy = ProcessConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + dbConfig = try container.decode(DBConfig.self, forKey: .dbConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dbParamConfig = try container.decode(DBParamConfig.self, forKey: .dbParamConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sftpConfig = try container.decode(SFTPConfig.self, forKey: .sftpConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + awsS3Config = try container.decode(AWSS3config.self, forKey: .awsS3Config) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mongoDocConfig = try container.decode(MongoDocConfig.self, forKey: .mongoDocConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ftpConfig = try container.decode(FTPConfig.self, forKey: .ftpConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + emailConfig = try container.decode(EmailConfig.self, forKey: .emailConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fileConfig = try container.decode(FileConfig.self, forKey: .fileConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + jsonDocConfig = try container.decode(JsonDocConfig.self, forKey: .jsonDocConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + docMappingConfig = try container.decode(DocMappingConfig.self, forKey: .docMappingConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + taskStepConfig = try container.decode(TaskStepConfig.self, forKey: .taskStepConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + httpConfig = try container.decode(HttpConfig.self, forKey: .httpConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + localFileConfig = try container.decode(LocalFileConfig.self, forKey: .localFileConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + oauthConfig = try container.decode(OAuthConfig.self, forKey: .oauthConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + googleSpreadsheetConfig = try container.decode(GoogleSpreadSheetConfig.self, forKey: .googleSpreadsheetConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(dbConfig, forKey: .dbConfig) + + try? container.encodeIfPresent(dbParamConfig, forKey: .dbParamConfig) + + try? container.encodeIfPresent(sftpConfig, forKey: .sftpConfig) + + try? container.encodeIfPresent(awsS3Config, forKey: .awsS3Config) + + try? container.encodeIfPresent(mongoDocConfig, forKey: .mongoDocConfig) + + try? container.encodeIfPresent(ftpConfig, forKey: .ftpConfig) + + try? container.encodeIfPresent(emailConfig, forKey: .emailConfig) + + try? container.encodeIfPresent(fileConfig, forKey: .fileConfig) + + try? container.encodeIfPresent(jsonDocConfig, forKey: .jsonDocConfig) + + try? container.encodeIfPresent(docMappingConfig, forKey: .docMappingConfig) + + try? container.encodeIfPresent(taskStepConfig, forKey: .taskStepConfig) + + try? container.encodeIfPresent(httpConfig, forKey: .httpConfig) + + try? container.encodeIfPresent(localFileConfig, forKey: .localFileConfig) + + try? container.encodeIfPresent(oauthConfig, forKey: .oauthConfig) + + try? container.encodeIfPresent(googleSpreadsheetConfig, forKey: .googleSpreadsheetConfig) + } + } + + /* + Model: PropBeanConfig + Used By: Inventory + */ + + class PropBeanConfig: Codable { + public var required: Bool? + + public var mapping: [String: PropBeanConfig]? + + public var optional: Bool? + + public var send: Send? + + public var validations: [[String: Any]]? + + public var values: [String]? + + public var include: Bool? + + public var sourceField: String? + + public var sourceFields: [String]? + + public var destinationField: String? + + public var dataType: String? + + public var defaultValue: [String: Any]? + + public var constValue: [String: Any]? + + public var concatStr: String? + + public var functionName: String? + + public var transformerName: String? + + public var allParamFunctionName: String? + + public var subSeparator: String? + + public var indexField: String? + + public var ignoreIfNotExists: Bool? + + public var identifierType: String? + + public var projectionQuery: [String: Any]? + + public var enrichFromMaster: Bool? + + public enum CodingKeys: String, CodingKey { + case required + + case mapping + + case optional + + case send + + case validations + + case values + + case include + + case sourceField = "source_field" + + case sourceFields = "source_fields" + + case destinationField = "destination_field" + + case dataType = "data_type" + + case defaultValue = "default_value" + + case constValue = "const_value" + + case concatStr = "concat_str" + + case functionName = "function_name" + + case transformerName = "transformer_name" + + case allParamFunctionName = "all_param_function_name" + + case subSeparator = "sub_separator" + + case indexField = "index_field" + + case ignoreIfNotExists = "ignore_if_not_exists" + + case identifierType = "identifier_type" + + case projectionQuery = "projection_query" + + case enrichFromMaster = "enrich_from_master" + } + + public init(allParamFunctionName: String?, concatStr: String?, constValue: [String: Any]?, dataType: String?, defaultValue: [String: Any]?, destinationField: String?, enrichFromMaster: Bool?, functionName: String?, identifierType: String?, ignoreIfNotExists: Bool?, include: Bool?, indexField: String?, mapping: [String: PropBeanConfig]?, optional: Bool?, projectionQuery: [String: Any]?, required: Bool?, send: Send?, sourceField: String?, sourceFields: [String]?, subSeparator: String?, transformerName: String?, validations: [[String: Any]]?, values: [String]?) { + self.required = required + + self.mapping = mapping + + self.optional = optional + + self.send = send + + self.validations = validations + + self.values = values + + self.include = include + + self.sourceField = sourceField + + self.sourceFields = sourceFields + + self.destinationField = destinationField + + self.dataType = dataType + + self.defaultValue = defaultValue + + self.constValue = constValue + + self.concatStr = concatStr + + self.functionName = functionName + + self.transformerName = transformerName + + self.allParamFunctionName = allParamFunctionName + + self.subSeparator = subSeparator + + self.indexField = indexField + + self.ignoreIfNotExists = ignoreIfNotExists + + self.identifierType = identifierType + + self.projectionQuery = projectionQuery + + self.enrichFromMaster = enrichFromMaster + } + + public func duplicate() -> PropBeanConfig { + let dict = self.dictionary! + let copy = PropBeanConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + required = try container.decode(Bool.self, forKey: .required) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mapping = try container.decode([String: PropBeanConfig].self, forKey: .mapping) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + optional = try container.decode(Bool.self, forKey: .optional) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + send = try container.decode(Send.self, forKey: .send) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + validations = try container.decode([[String: Any]].self, forKey: .validations) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + values = try container.decode([String].self, forKey: .values) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + include = try container.decode(Bool.self, forKey: .include) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sourceField = try container.decode(String.self, forKey: .sourceField) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sourceFields = try container.decode([String].self, forKey: .sourceFields) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + destinationField = try container.decode(String.self, forKey: .destinationField) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dataType = try container.decode(String.self, forKey: .dataType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + defaultValue = try container.decode([String: Any].self, forKey: .defaultValue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + constValue = try container.decode([String: Any].self, forKey: .constValue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + concatStr = try container.decode(String.self, forKey: .concatStr) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + functionName = try container.decode(String.self, forKey: .functionName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + transformerName = try container.decode(String.self, forKey: .transformerName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allParamFunctionName = try container.decode(String.self, forKey: .allParamFunctionName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subSeparator = try container.decode(String.self, forKey: .subSeparator) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + indexField = try container.decode(String.self, forKey: .indexField) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ignoreIfNotExists = try container.decode(Bool.self, forKey: .ignoreIfNotExists) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + identifierType = try container.decode(String.self, forKey: .identifierType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + projectionQuery = try container.decode([String: Any].self, forKey: .projectionQuery) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enrichFromMaster = try container.decode(Bool.self, forKey: .enrichFromMaster) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(required, forKey: .required) + + try? container.encodeIfPresent(mapping, forKey: .mapping) + + try? container.encodeIfPresent(optional, forKey: .optional) + + try? container.encodeIfPresent(send, forKey: .send) + + try? container.encodeIfPresent(validations, forKey: .validations) + + try? container.encodeIfPresent(values, forKey: .values) + + try? container.encodeIfPresent(include, forKey: .include) + + try? container.encodeIfPresent(sourceField, forKey: .sourceField) + + try? container.encodeIfPresent(sourceFields, forKey: .sourceFields) + + try? container.encodeIfPresent(destinationField, forKey: .destinationField) + + try? container.encodeIfPresent(dataType, forKey: .dataType) + + try? container.encodeIfPresent(defaultValue, forKey: .defaultValue) + + try? container.encodeIfPresent(constValue, forKey: .constValue) + + try? container.encodeIfPresent(concatStr, forKey: .concatStr) + + try? container.encodeIfPresent(functionName, forKey: .functionName) + + try? container.encodeIfPresent(transformerName, forKey: .transformerName) + + try? container.encodeIfPresent(allParamFunctionName, forKey: .allParamFunctionName) + + try? container.encodeIfPresent(subSeparator, forKey: .subSeparator) + + try? container.encodeIfPresent(indexField, forKey: .indexField) + + try? container.encodeIfPresent(ignoreIfNotExists, forKey: .ignoreIfNotExists) + + try? container.encodeIfPresent(identifierType, forKey: .identifierType) + + try? container.encodeIfPresent(projectionQuery, forKey: .projectionQuery) + + try? container.encodeIfPresent(enrichFromMaster, forKey: .enrichFromMaster) + } + } + + /* + Model: PropBeanDTO + Used By: Inventory + */ + + class PropBeanDTO: Codable { + public var required: Bool? + + public var optional: Bool? + + public var include: Bool? + + public var sourceField: String? + + public var sourceFields: [String]? + + public var destinationField: String? + + public var dataType: String? + + public var defaultValue: [String: Any]? + + public var constValue: [String: Any]? + + public var concatStr: String? + + public var functionName: String? + + public var transformerName: String? + + public var allParamFunctionName: String? + + public var subSeparator: String? + + public var indexField: String? + + public var ignoreIfNotExists: Bool? + + public var identifierType: String? + + public var projectionQuery: [String: Any]? + + public var enrichFromMaster: Bool? + + public enum CodingKeys: String, CodingKey { + case required + + case optional + + case include + + case sourceField = "source_field" + + case sourceFields = "source_fields" + + case destinationField = "destination_field" + + case dataType = "data_type" + + case defaultValue = "default_value" + + case constValue = "const_value" + + case concatStr = "concat_str" + + case functionName = "function_name" + + case transformerName = "transformer_name" + + case allParamFunctionName = "all_param_function_name" + + case subSeparator = "sub_separator" + + case indexField = "index_field" + + case ignoreIfNotExists = "ignore_if_not_exists" + + case identifierType = "identifier_type" + + case projectionQuery = "projection_query" + + case enrichFromMaster = "enrich_from_master" + } + + public init(allParamFunctionName: String?, concatStr: String?, constValue: [String: Any]?, dataType: String?, defaultValue: [String: Any]?, destinationField: String?, enrichFromMaster: Bool?, functionName: String?, identifierType: String?, ignoreIfNotExists: Bool?, include: Bool?, indexField: String?, optional: Bool?, projectionQuery: [String: Any]?, required: Bool?, sourceField: String?, sourceFields: [String]?, subSeparator: String?, transformerName: String?) { + self.required = required + + self.optional = optional + + self.include = include + + self.sourceField = sourceField + + self.sourceFields = sourceFields + + self.destinationField = destinationField + + self.dataType = dataType + + self.defaultValue = defaultValue + + self.constValue = constValue + + self.concatStr = concatStr + + self.functionName = functionName + + self.transformerName = transformerName + + self.allParamFunctionName = allParamFunctionName + + self.subSeparator = subSeparator + + self.indexField = indexField + + self.ignoreIfNotExists = ignoreIfNotExists + + self.identifierType = identifierType + + self.projectionQuery = projectionQuery + + self.enrichFromMaster = enrichFromMaster + } + + public func duplicate() -> PropBeanDTO { + let dict = self.dictionary! + let copy = PropBeanDTO(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + required = try container.decode(Bool.self, forKey: .required) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + optional = try container.decode(Bool.self, forKey: .optional) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + include = try container.decode(Bool.self, forKey: .include) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sourceField = try container.decode(String.self, forKey: .sourceField) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sourceFields = try container.decode([String].self, forKey: .sourceFields) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + destinationField = try container.decode(String.self, forKey: .destinationField) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dataType = try container.decode(String.self, forKey: .dataType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + defaultValue = try container.decode([String: Any].self, forKey: .defaultValue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + constValue = try container.decode([String: Any].self, forKey: .constValue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + concatStr = try container.decode(String.self, forKey: .concatStr) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + functionName = try container.decode(String.self, forKey: .functionName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + transformerName = try container.decode(String.self, forKey: .transformerName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allParamFunctionName = try container.decode(String.self, forKey: .allParamFunctionName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subSeparator = try container.decode(String.self, forKey: .subSeparator) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + indexField = try container.decode(String.self, forKey: .indexField) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ignoreIfNotExists = try container.decode(Bool.self, forKey: .ignoreIfNotExists) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + identifierType = try container.decode(String.self, forKey: .identifierType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + projectionQuery = try container.decode([String: Any].self, forKey: .projectionQuery) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enrichFromMaster = try container.decode(Bool.self, forKey: .enrichFromMaster) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(required, forKey: .required) + + try? container.encodeIfPresent(optional, forKey: .optional) + + try? container.encodeIfPresent(include, forKey: .include) + + try? container.encodeIfPresent(sourceField, forKey: .sourceField) + + try? container.encodeIfPresent(sourceFields, forKey: .sourceFields) + + try? container.encodeIfPresent(destinationField, forKey: .destinationField) + + try? container.encodeIfPresent(dataType, forKey: .dataType) + + try? container.encodeIfPresent(defaultValue, forKey: .defaultValue) + + try? container.encodeIfPresent(constValue, forKey: .constValue) + + try? container.encodeIfPresent(concatStr, forKey: .concatStr) + + try? container.encodeIfPresent(functionName, forKey: .functionName) + + try? container.encodeIfPresent(transformerName, forKey: .transformerName) + + try? container.encodeIfPresent(allParamFunctionName, forKey: .allParamFunctionName) + + try? container.encodeIfPresent(subSeparator, forKey: .subSeparator) + + try? container.encodeIfPresent(indexField, forKey: .indexField) + + try? container.encodeIfPresent(ignoreIfNotExists, forKey: .ignoreIfNotExists) + + try? container.encodeIfPresent(identifierType, forKey: .identifierType) + + try? container.encodeIfPresent(projectionQuery, forKey: .projectionQuery) + + try? container.encodeIfPresent(enrichFromMaster, forKey: .enrichFromMaster) + } + } + + /* + Model: ResponseEnvelopeListJobConfigRawDTO + Used By: Inventory + */ + + class ResponseEnvelopeListJobConfigRawDTO: Codable { + public var timestamp: String? + + public var status: Int? + + public var error: String? + + public var exception: String? + + public var message: String? + + public var totalTimeTakenInMillis: Int? + + public var httpStatus: String? + + public var items: [JobConfigRawDTO]? + + public var payload: [JobConfigRawDTO]? + + public var traceId: String? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case timestamp + + case status + + case error + + case exception + + case message + + case totalTimeTakenInMillis = "total_time_taken_in_millis" + + case httpStatus = "http_status" + + case items + + case payload + + case traceId = "trace_id" + + case page + } + + public init(error: String?, exception: String?, httpStatus: String?, items: [JobConfigRawDTO]?, message: String?, page: Page?, payload: [JobConfigRawDTO]?, status: Int?, timestamp: String?, totalTimeTakenInMillis: Int?, traceId: String?) { + self.timestamp = timestamp + + self.status = status + + self.error = error + + self.exception = exception + + self.message = message + + self.totalTimeTakenInMillis = totalTimeTakenInMillis + + self.httpStatus = httpStatus + + self.items = items + + self.payload = payload + + self.traceId = traceId + + self.page = page + } + + public func duplicate() -> ResponseEnvelopeListJobConfigRawDTO { + let dict = self.dictionary! + let copy = ResponseEnvelopeListJobConfigRawDTO(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + timestamp = try container.decode(String.self, forKey: .timestamp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Int.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + error = try container.decode(String.self, forKey: .error) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + exception = try container.decode(String.self, forKey: .exception) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalTimeTakenInMillis = try container.decode(Int.self, forKey: .totalTimeTakenInMillis) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + httpStatus = try container.decode(String.self, forKey: .httpStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([JobConfigRawDTO].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + payload = try container.decode([JobConfigRawDTO].self, forKey: .payload) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + traceId = try container.decode(String.self, forKey: .traceId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(timestamp, forKey: .timestamp) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(error, forKey: .error) + + try? container.encodeIfPresent(exception, forKey: .exception) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(totalTimeTakenInMillis, forKey: .totalTimeTakenInMillis) + + try? container.encodeIfPresent(httpStatus, forKey: .httpStatus) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(payload, forKey: .payload) + + try? container.encodeIfPresent(traceId, forKey: .traceId) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: SFTPConfig + Used By: Inventory + */ + + class SFTPConfig: Codable { + public var host: String? + + public var port: Int? + + public var username: String? + + public var password: String? + + public var unzip: Bool? + + public var retries: Int? + + public var interval: Int? + + public var privateKeyPath: String? + + public var strictHostKeyChecking: Bool? + + public var localDir: String? + + public var remoteDir: String? + + public var passwordProtected: Bool? + + public var zipFileRegex: String? + + public var fileRegex: String? + + public var zipFormat: String? + + public var archiveConfig: ArchiveConfig? + + public var readAllFiles: Bool? + + public enum CodingKeys: String, CodingKey { + case host + + case port + + case username + + case password + + case unzip + + case retries + + case interval + + case privateKeyPath = "private_key_path" + + case strictHostKeyChecking = "strict_host_key_checking" + + case localDir = "local_dir" + + case remoteDir = "remote_dir" + + case passwordProtected = "password_protected" + + case zipFileRegex = "zip_file_regex" + + case fileRegex = "file_regex" + + case zipFormat = "zip_format" + + case archiveConfig = "archive_config" + + case readAllFiles = "read_all_files" + } + + public init(archiveConfig: ArchiveConfig?, fileRegex: String?, host: String?, interval: Int?, localDir: String?, password: String?, passwordProtected: Bool?, port: Int?, privateKeyPath: String?, readAllFiles: Bool?, remoteDir: String?, retries: Int?, strictHostKeyChecking: Bool?, unzip: Bool?, username: String?, zipFileRegex: String?, zipFormat: String?) { + self.host = host + + self.port = port + + self.username = username + + self.password = password + + self.unzip = unzip + + self.retries = retries + + self.interval = interval + + self.privateKeyPath = privateKeyPath + + self.strictHostKeyChecking = strictHostKeyChecking + + self.localDir = localDir + + self.remoteDir = remoteDir + + self.passwordProtected = passwordProtected + + self.zipFileRegex = zipFileRegex + + self.fileRegex = fileRegex + + self.zipFormat = zipFormat + + self.archiveConfig = archiveConfig + + self.readAllFiles = readAllFiles + } + + public func duplicate() -> SFTPConfig { + let dict = self.dictionary! + let copy = SFTPConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + host = try container.decode(String.self, forKey: .host) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + port = try container.decode(Int.self, forKey: .port) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + password = try container.decode(String.self, forKey: .password) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + unzip = try container.decode(Bool.self, forKey: .unzip) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + retries = try container.decode(Int.self, forKey: .retries) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + interval = try container.decode(Int.self, forKey: .interval) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + privateKeyPath = try container.decode(String.self, forKey: .privateKeyPath) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + strictHostKeyChecking = try container.decode(Bool.self, forKey: .strictHostKeyChecking) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + localDir = try container.decode(String.self, forKey: .localDir) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + remoteDir = try container.decode(String.self, forKey: .remoteDir) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + passwordProtected = try container.decode(Bool.self, forKey: .passwordProtected) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + zipFileRegex = try container.decode(String.self, forKey: .zipFileRegex) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fileRegex = try container.decode(String.self, forKey: .fileRegex) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + zipFormat = try container.decode(String.self, forKey: .zipFormat) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archiveConfig = try container.decode(ArchiveConfig.self, forKey: .archiveConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + readAllFiles = try container.decode(Bool.self, forKey: .readAllFiles) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(host, forKey: .host) + + try? container.encodeIfPresent(port, forKey: .port) + + try? container.encodeIfPresent(username, forKey: .username) + + try? container.encodeIfPresent(password, forKey: .password) + + try? container.encodeIfPresent(unzip, forKey: .unzip) + + try? container.encodeIfPresent(retries, forKey: .retries) + + try? container.encodeIfPresent(interval, forKey: .interval) + + try? container.encodeIfPresent(privateKeyPath, forKey: .privateKeyPath) + + try? container.encodeIfPresent(strictHostKeyChecking, forKey: .strictHostKeyChecking) + + try? container.encodeIfPresent(localDir, forKey: .localDir) + + try? container.encodeIfPresent(remoteDir, forKey: .remoteDir) + + try? container.encodeIfPresent(passwordProtected, forKey: .passwordProtected) + + try? container.encodeIfPresent(zipFileRegex, forKey: .zipFileRegex) + + try? container.encodeIfPresent(fileRegex, forKey: .fileRegex) + + try? container.encodeIfPresent(zipFormat, forKey: .zipFormat) + + try? container.encodeIfPresent(archiveConfig, forKey: .archiveConfig) + + try? container.encodeIfPresent(readAllFiles, forKey: .readAllFiles) + } + } + + /* + Model: Send + Used By: Inventory + */ + + class Send: Codable { + public var raw: Bool? + + public var processed: Bool? + + public enum CodingKeys: String, CodingKey { + case raw + + case processed + } + + public init(processed: Bool?, raw: Bool?) { + self.raw = raw + + self.processed = processed + } + + public func duplicate() -> Send { + let dict = self.dictionary! + let copy = Send(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + raw = try container.decode(Bool.self, forKey: .raw) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + processed = try container.decode(Bool.self, forKey: .processed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(raw, forKey: .raw) + + try? container.encodeIfPresent(processed, forKey: .processed) + } + } + + /* + Model: StoreConfig + Used By: Inventory + */ + + class StoreConfig: Codable { + public var jobCode: String? + + public var storeid: String? + + public var storeAlias: String? + + public var storeFileRegex: String? + + public var storeFileName: String? + + public var processConfig: ProcessConfig? + + public var properties: [String: String]? + + public enum CodingKeys: String, CodingKey { + case jobCode = "job_code" + + case storeid + + case storeAlias = "store_alias" + + case storeFileRegex = "store_file_regex" + + case storeFileName = "store_file_name" + + case processConfig = "process_config" + + case properties + } + + public init(jobCode: String?, processConfig: ProcessConfig?, properties: [String: String]?, storeid: String?, storeAlias: String?, storeFileName: String?, storeFileRegex: String?) { + self.jobCode = jobCode + + self.storeid = storeid + + self.storeAlias = storeAlias + + self.storeFileRegex = storeFileRegex + + self.storeFileName = storeFileName + + self.processConfig = processConfig + + self.properties = properties + } + + public func duplicate() -> StoreConfig { + let dict = self.dictionary! + let copy = StoreConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + jobCode = try container.decode(String.self, forKey: .jobCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeid = try container.decode(String.self, forKey: .storeid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeAlias = try container.decode(String.self, forKey: .storeAlias) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeFileRegex = try container.decode(String.self, forKey: .storeFileRegex) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeFileName = try container.decode(String.self, forKey: .storeFileName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + processConfig = try container.decode(ProcessConfig.self, forKey: .processConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + properties = try container.decode([String: String].self, forKey: .properties) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(jobCode, forKey: .jobCode) + + try? container.encodeIfPresent(storeid, forKey: .storeid) + + try? container.encodeIfPresent(storeAlias, forKey: .storeAlias) + + try? container.encodeIfPresent(storeFileRegex, forKey: .storeFileRegex) + + try? container.encodeIfPresent(storeFileName, forKey: .storeFileName) + + try? container.encodeIfPresent(processConfig, forKey: .processConfig) + + try? container.encodeIfPresent(properties, forKey: .properties) + } + } + + /* + Model: StoreFilter + Used By: Inventory + */ + + class StoreFilter: Codable { + public var includeTags: [String]? + + public var excludeTags: [String]? + + public var query: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case includeTags = "include_tags" + + case excludeTags = "exclude_tags" + + case query + } + + public init(excludeTags: [String]?, includeTags: [String]?, query: [String: Any]?) { + self.includeTags = includeTags + + self.excludeTags = excludeTags + + self.query = query + } + + public func duplicate() -> StoreFilter { + let dict = self.dictionary! + let copy = StoreFilter(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + includeTags = try container.decode([String].self, forKey: .includeTags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + excludeTags = try container.decode([String].self, forKey: .excludeTags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode([String: Any].self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(includeTags, forKey: .includeTags) + + try? container.encodeIfPresent(excludeTags, forKey: .excludeTags) + + try? container.encodeIfPresent(query, forKey: .query) + } + } + + /* + Model: TaskConfig + Used By: Inventory + */ + + class TaskConfig: Codable { + public var name: String? + + public var taskConfigId: Int? + + public var taskParams: [TaskParam]? + + public enum CodingKeys: String, CodingKey { + case name + + case taskConfigId = "task_config_id" + + case taskParams = "task_params" + } + + public init(name: String?, taskConfigId: Int?, taskParams: [TaskParam]?) { + self.name = name + + self.taskConfigId = taskConfigId + + self.taskParams = taskParams + } + + public func duplicate() -> TaskConfig { + let dict = self.dictionary! + let copy = TaskConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + taskConfigId = try container.decode(Int.self, forKey: .taskConfigId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + taskParams = try container.decode([TaskParam].self, forKey: .taskParams) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(taskConfigId, forKey: .taskConfigId) + + try? container.encodeIfPresent(taskParams, forKey: .taskParams) + } + } + + /* + Model: TaskParam + Used By: Inventory + */ + + class TaskParam: Codable { + public var name: String? + + public var value: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case name + + case value + } + + public init(name: String?, value: [String: Any]?) { + self.name = name + + self.value = value + } + + public func duplicate() -> TaskParam { + let dict = self.dictionary! + let copy = TaskParam(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode([String: Any].self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: TaskStepConfig + Used By: Inventory + */ + + class TaskStepConfig: Codable { + public var taskConfigs: [TaskConfig]? + + public var taskConfigIds: [Int]? + + public var taskConfigGroupIds: [Int]? + + public enum CodingKeys: String, CodingKey { + case taskConfigs = "task_configs" + + case taskConfigIds = "task_config_ids" + + case taskConfigGroupIds = "task_config_group_ids" + } + + public init(taskConfigs: [TaskConfig]?, taskConfigGroupIds: [Int]?, taskConfigIds: [Int]?) { + self.taskConfigs = taskConfigs + + self.taskConfigIds = taskConfigIds + + self.taskConfigGroupIds = taskConfigGroupIds + } + + public func duplicate() -> TaskStepConfig { + let dict = self.dictionary! + let copy = TaskStepConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + taskConfigs = try container.decode([TaskConfig].self, forKey: .taskConfigs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + taskConfigIds = try container.decode([Int].self, forKey: .taskConfigIds) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + taskConfigGroupIds = try container.decode([Int].self, forKey: .taskConfigGroupIds) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(taskConfigs, forKey: .taskConfigs) + + try? container.encodeIfPresent(taskConfigIds, forKey: .taskConfigIds) + + try? container.encodeIfPresent(taskConfigGroupIds, forKey: .taskConfigGroupIds) + } + } + + /* + Model: JobStepsDTO + Used By: Inventory + */ + + class JobStepsDTO: Codable { + public var stepName: String? + + public var type: String? + + public var stepExecutionTime: Int? + + public var startCount: Int? + + public var endCount: Int? + + public var deletedCount: Int? + + public var processedStartTime: String? + + public var processedAt: String? + + public enum CodingKeys: String, CodingKey { + case stepName = "step_name" + + case type + + case stepExecutionTime = "step_execution_time" + + case startCount = "start_count" + + case endCount = "end_count" + + case deletedCount = "deleted_count" + + case processedStartTime = "processed_start_time" + + case processedAt = "processed_at" + } + + public init(deletedCount: Int?, endCount: Int?, processedAt: String?, processedStartTime: String?, startCount: Int?, stepExecutionTime: Int?, stepName: String?, type: String?) { + self.stepName = stepName + + self.type = type + + self.stepExecutionTime = stepExecutionTime + + self.startCount = startCount + + self.endCount = endCount + + self.deletedCount = deletedCount + + self.processedStartTime = processedStartTime + + self.processedAt = processedAt + } + + public func duplicate() -> JobStepsDTO { + let dict = self.dictionary! + let copy = JobStepsDTO(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + stepName = try container.decode(String.self, forKey: .stepName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stepExecutionTime = try container.decode(Int.self, forKey: .stepExecutionTime) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + startCount = try container.decode(Int.self, forKey: .startCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + endCount = try container.decode(Int.self, forKey: .endCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deletedCount = try container.decode(Int.self, forKey: .deletedCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + processedStartTime = try container.decode(String.self, forKey: .processedStartTime) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + processedAt = try container.decode(String.self, forKey: .processedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(stepName, forKey: .stepName) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(stepExecutionTime, forKey: .stepExecutionTime) + + try? container.encodeIfPresent(startCount, forKey: .startCount) + + try? container.encodeIfPresent(endCount, forKey: .endCount) + + try? container.encodeIfPresent(deletedCount, forKey: .deletedCount) + + try? container.encodeIfPresent(processedStartTime, forKey: .processedStartTime) + + try? container.encodeIfPresent(processedAt, forKey: .processedAt) + } + } + + /* + Model: ResponseEnvelopeListJobStepsDTO + Used By: Inventory + */ + + class ResponseEnvelopeListJobStepsDTO: Codable { + public var timestamp: String? + + public var status: Int? + + public var error: String? + + public var exception: String? + + public var message: String? + + public var totalTimeTakenInMillis: Int? + + public var httpStatus: String? + + public var items: [JobStepsDTO]? + + public var payload: [JobStepsDTO]? + + public var traceId: String? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case timestamp + + case status + + case error + + case exception + + case message + + case totalTimeTakenInMillis = "total_time_taken_in_millis" + + case httpStatus = "http_status" + + case items + + case payload + + case traceId = "trace_id" + + case page + } + + public init(error: String?, exception: String?, httpStatus: String?, items: [JobStepsDTO]?, message: String?, page: Page?, payload: [JobStepsDTO]?, status: Int?, timestamp: String?, totalTimeTakenInMillis: Int?, traceId: String?) { + self.timestamp = timestamp + + self.status = status + + self.error = error + + self.exception = exception + + self.message = message + + self.totalTimeTakenInMillis = totalTimeTakenInMillis + + self.httpStatus = httpStatus + + self.items = items + + self.payload = payload + + self.traceId = traceId + + self.page = page + } + + public func duplicate() -> ResponseEnvelopeListJobStepsDTO { + let dict = self.dictionary! + let copy = ResponseEnvelopeListJobStepsDTO(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + timestamp = try container.decode(String.self, forKey: .timestamp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Int.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + error = try container.decode(String.self, forKey: .error) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + exception = try container.decode(String.self, forKey: .exception) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalTimeTakenInMillis = try container.decode(Int.self, forKey: .totalTimeTakenInMillis) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + httpStatus = try container.decode(String.self, forKey: .httpStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([JobStepsDTO].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + payload = try container.decode([JobStepsDTO].self, forKey: .payload) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + traceId = try container.decode(String.self, forKey: .traceId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(timestamp, forKey: .timestamp) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(error, forKey: .error) + + try? container.encodeIfPresent(exception, forKey: .exception) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(totalTimeTakenInMillis, forKey: .totalTimeTakenInMillis) + + try? container.encodeIfPresent(httpStatus, forKey: .httpStatus) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(payload, forKey: .payload) + + try? container.encodeIfPresent(traceId, forKey: .traceId) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: ResponseEnvelopeListJobConfigDTO + Used By: Inventory + */ + + class ResponseEnvelopeListJobConfigDTO: Codable { + public var timestamp: String? + + public var status: Int? + + public var error: String? + + public var exception: String? + + public var message: String? + + public var totalTimeTakenInMillis: Int? + + public var httpStatus: String? + + public var items: [JobConfigDTO]? + + public var payload: [JobConfigDTO]? + + public var traceId: String? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case timestamp + + case status + + case error + + case exception + + case message + + case totalTimeTakenInMillis = "total_time_taken_in_millis" + + case httpStatus = "http_status" + + case items + + case payload + + case traceId = "trace_id" + + case page + } + + public init(error: String?, exception: String?, httpStatus: String?, items: [JobConfigDTO]?, message: String?, page: Page?, payload: [JobConfigDTO]?, status: Int?, timestamp: String?, totalTimeTakenInMillis: Int?, traceId: String?) { + self.timestamp = timestamp + + self.status = status + + self.error = error + + self.exception = exception + + self.message = message + + self.totalTimeTakenInMillis = totalTimeTakenInMillis + + self.httpStatus = httpStatus + + self.items = items + + self.payload = payload + + self.traceId = traceId + + self.page = page + } + + public func duplicate() -> ResponseEnvelopeListJobConfigDTO { + let dict = self.dictionary! + let copy = ResponseEnvelopeListJobConfigDTO(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + timestamp = try container.decode(String.self, forKey: .timestamp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Int.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + error = try container.decode(String.self, forKey: .error) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + exception = try container.decode(String.self, forKey: .exception) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalTimeTakenInMillis = try container.decode(Int.self, forKey: .totalTimeTakenInMillis) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + httpStatus = try container.decode(String.self, forKey: .httpStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([JobConfigDTO].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + payload = try container.decode([JobConfigDTO].self, forKey: .payload) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + traceId = try container.decode(String.self, forKey: .traceId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(timestamp, forKey: .timestamp) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(error, forKey: .error) + + try? container.encodeIfPresent(exception, forKey: .exception) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(totalTimeTakenInMillis, forKey: .totalTimeTakenInMillis) + + try? container.encodeIfPresent(httpStatus, forKey: .httpStatus) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(payload, forKey: .payload) + + try? container.encodeIfPresent(traceId, forKey: .traceId) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: ResponseEnvelopeJobConfigDTO + Used By: Inventory + */ + + class ResponseEnvelopeJobConfigDTO: Codable { + public var timestamp: String? + + public var status: Int? + + public var error: String? + + public var exception: String? + + public var message: String? + + public var totalTimeTakenInMillis: Int? + + public var httpStatus: String? + + public var items: JobConfigDTO? + + public var payload: JobConfigDTO? + + public var traceId: String? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case timestamp + + case status + + case error + + case exception + + case message + + case totalTimeTakenInMillis = "total_time_taken_in_millis" + + case httpStatus = "http_status" + + case items + + case payload + + case traceId = "trace_id" + + case page + } + + public init(error: String?, exception: String?, httpStatus: String?, items: JobConfigDTO?, message: String?, page: Page?, payload: JobConfigDTO?, status: Int?, timestamp: String?, totalTimeTakenInMillis: Int?, traceId: String?) { + self.timestamp = timestamp + + self.status = status + + self.error = error + + self.exception = exception + + self.message = message + + self.totalTimeTakenInMillis = totalTimeTakenInMillis + + self.httpStatus = httpStatus + + self.items = items + + self.payload = payload + + self.traceId = traceId + + self.page = page + } + + public func duplicate() -> ResponseEnvelopeJobConfigDTO { + let dict = self.dictionary! + let copy = ResponseEnvelopeJobConfigDTO(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + timestamp = try container.decode(String.self, forKey: .timestamp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Int.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + error = try container.decode(String.self, forKey: .error) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + exception = try container.decode(String.self, forKey: .exception) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalTimeTakenInMillis = try container.decode(Int.self, forKey: .totalTimeTakenInMillis) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + httpStatus = try container.decode(String.self, forKey: .httpStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode(JobConfigDTO.self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + payload = try container.decode(JobConfigDTO.self, forKey: .payload) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + traceId = try container.decode(String.self, forKey: .traceId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(timestamp, forKey: .timestamp) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(error, forKey: .error) + + try? container.encodeIfPresent(exception, forKey: .exception) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(totalTimeTakenInMillis, forKey: .totalTimeTakenInMillis) + + try? container.encodeIfPresent(httpStatus, forKey: .httpStatus) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(payload, forKey: .payload) + + try? container.encodeIfPresent(traceId, forKey: .traceId) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: JobHistoryDto + Used By: Inventory + */ + + class JobHistoryDto: Codable { + public var totalAddedCount: Int? + + public var totalUpdatedCount: Int? + + public var totalSuppressedCount: Int? + + public var totalInitialCount: Int? + + public var jobId: Int? + + public var status: String? + + public var jobCode: String? + + public var processedOn: String? + + public var filename: [String]? + + public var errorType: String? + + public var message: String? + + public enum CodingKeys: String, CodingKey { + case totalAddedCount = "total_added_count" + + case totalUpdatedCount = "total_updated_count" + + case totalSuppressedCount = "total_suppressed_count" + + case totalInitialCount = "total_initial_count" + + case jobId = "job_id" + + case status + + case jobCode = "job_code" + + case processedOn = "processed_on" + + case filename + + case errorType = "error_type" + + case message + } + + public init(errorType: String?, filename: [String]?, jobCode: String?, jobId: Int?, message: String?, processedOn: String?, status: String?, totalAddedCount: Int?, totalInitialCount: Int?, totalSuppressedCount: Int?, totalUpdatedCount: Int?) { + self.totalAddedCount = totalAddedCount + + self.totalUpdatedCount = totalUpdatedCount + + self.totalSuppressedCount = totalSuppressedCount + + self.totalInitialCount = totalInitialCount + + self.jobId = jobId + + self.status = status + + self.jobCode = jobCode + + self.processedOn = processedOn + + self.filename = filename + + self.errorType = errorType + + self.message = message + } + + public func duplicate() -> JobHistoryDto { + let dict = self.dictionary! + let copy = JobHistoryDto(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + totalAddedCount = try container.decode(Int.self, forKey: .totalAddedCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalUpdatedCount = try container.decode(Int.self, forKey: .totalUpdatedCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalSuppressedCount = try container.decode(Int.self, forKey: .totalSuppressedCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalInitialCount = try container.decode(Int.self, forKey: .totalInitialCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + jobId = try container.decode(Int.self, forKey: .jobId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + jobCode = try container.decode(String.self, forKey: .jobCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + processedOn = try container.decode(String.self, forKey: .processedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filename = try container.decode([String].self, forKey: .filename) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + errorType = try container.decode(String.self, forKey: .errorType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(totalAddedCount, forKey: .totalAddedCount) + + try? container.encodeIfPresent(totalUpdatedCount, forKey: .totalUpdatedCount) + + try? container.encodeIfPresent(totalSuppressedCount, forKey: .totalSuppressedCount) + + try? container.encodeIfPresent(totalInitialCount, forKey: .totalInitialCount) + + try? container.encodeIfPresent(jobId, forKey: .jobId) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(jobCode, forKey: .jobCode) + + try? container.encodeIfPresent(processedOn, forKey: .processedOn) + + try? container.encodeIfPresent(filename, forKey: .filename) + + try? container.encodeIfPresent(errorType, forKey: .errorType) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: JobMetricsDto + Used By: Inventory + */ + + class JobMetricsDto: Codable { + public var jobCode: String? + + public var isRunMoreThanUsual: String? + + public var jobHistory: [JobHistoryDto]? + + public var totalSuccessCount: Int? + + public var totalFailureCount: Int? + + public var totalWarningCount: Int? + + public var totalSuppressedCount: Int? + + public var totalJobRuns: Int? + + public enum CodingKeys: String, CodingKey { + case jobCode = "job_code" + + case isRunMoreThanUsual = "is_run_more_than_usual" + + case jobHistory = "job_history" + + case totalSuccessCount = "total_success_count" + + case totalFailureCount = "total_failure_count" + + case totalWarningCount = "total_warning_count" + + case totalSuppressedCount = "total_suppressed_count" + + case totalJobRuns = "total_job_runs" + } + + public init(isRunMoreThanUsual: String?, jobCode: String?, jobHistory: [JobHistoryDto]?, totalFailureCount: Int?, totalJobRuns: Int?, totalSuccessCount: Int?, totalSuppressedCount: Int?, totalWarningCount: Int?) { + self.jobCode = jobCode + + self.isRunMoreThanUsual = isRunMoreThanUsual + + self.jobHistory = jobHistory + + self.totalSuccessCount = totalSuccessCount + + self.totalFailureCount = totalFailureCount + + self.totalWarningCount = totalWarningCount + + self.totalSuppressedCount = totalSuppressedCount + + self.totalJobRuns = totalJobRuns + } + + public func duplicate() -> JobMetricsDto { + let dict = self.dictionary! + let copy = JobMetricsDto(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + jobCode = try container.decode(String.self, forKey: .jobCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isRunMoreThanUsual = try container.decode(String.self, forKey: .isRunMoreThanUsual) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + jobHistory = try container.decode([JobHistoryDto].self, forKey: .jobHistory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalSuccessCount = try container.decode(Int.self, forKey: .totalSuccessCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalFailureCount = try container.decode(Int.self, forKey: .totalFailureCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalWarningCount = try container.decode(Int.self, forKey: .totalWarningCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalSuppressedCount = try container.decode(Int.self, forKey: .totalSuppressedCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalJobRuns = try container.decode(Int.self, forKey: .totalJobRuns) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(jobCode, forKey: .jobCode) + + try? container.encodeIfPresent(isRunMoreThanUsual, forKey: .isRunMoreThanUsual) + + try? container.encodeIfPresent(jobHistory, forKey: .jobHistory) + + try? container.encodeIfPresent(totalSuccessCount, forKey: .totalSuccessCount) + + try? container.encodeIfPresent(totalFailureCount, forKey: .totalFailureCount) + + try? container.encodeIfPresent(totalWarningCount, forKey: .totalWarningCount) + + try? container.encodeIfPresent(totalSuppressedCount, forKey: .totalSuppressedCount) + + try? container.encodeIfPresent(totalJobRuns, forKey: .totalJobRuns) + } + } + + /* + Model: ResponseEnvelopeJobMetricsDto + Used By: Inventory + */ + + class ResponseEnvelopeJobMetricsDto: Codable { + public var timestamp: String? + + public var status: Int? + + public var error: String? + + public var exception: String? + + public var message: String? + + public var totalTimeTakenInMillis: Int? + + public var httpStatus: String? + + public var items: JobMetricsDto? + + public var payload: JobMetricsDto? + + public var traceId: String? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case timestamp + + case status + + case error + + case exception + + case message + + case totalTimeTakenInMillis = "total_time_taken_in_millis" + + case httpStatus = "http_status" + + case items + + case payload + + case traceId = "trace_id" + + case page + } + + public init(error: String?, exception: String?, httpStatus: String?, items: JobMetricsDto?, message: String?, page: Page?, payload: JobMetricsDto?, status: Int?, timestamp: String?, totalTimeTakenInMillis: Int?, traceId: String?) { + self.timestamp = timestamp + + self.status = status + + self.error = error + + self.exception = exception + + self.message = message + + self.totalTimeTakenInMillis = totalTimeTakenInMillis + + self.httpStatus = httpStatus + + self.items = items + + self.payload = payload + + self.traceId = traceId + + self.page = page + } + + public func duplicate() -> ResponseEnvelopeJobMetricsDto { + let dict = self.dictionary! + let copy = ResponseEnvelopeJobMetricsDto(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + timestamp = try container.decode(String.self, forKey: .timestamp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Int.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + error = try container.decode(String.self, forKey: .error) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + exception = try container.decode(String.self, forKey: .exception) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalTimeTakenInMillis = try container.decode(Int.self, forKey: .totalTimeTakenInMillis) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + httpStatus = try container.decode(String.self, forKey: .httpStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode(JobMetricsDto.self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + payload = try container.decode(JobMetricsDto.self, forKey: .payload) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + traceId = try container.decode(String.self, forKey: .traceId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(timestamp, forKey: .timestamp) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(error, forKey: .error) + + try? container.encodeIfPresent(exception, forKey: .exception) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(totalTimeTakenInMillis, forKey: .totalTimeTakenInMillis) + + try? container.encodeIfPresent(httpStatus, forKey: .httpStatus) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(payload, forKey: .payload) + + try? container.encodeIfPresent(traceId, forKey: .traceId) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: JobConfigListDTO + Used By: Inventory + */ + + class JobConfigListDTO: Codable { + public var code: String? + + public var alias: String? + + public var modifiedBy: String? + + public var createdBy: String? + + public var modifiedOn: String? + + public var createdOn: String? + + public var active: Bool? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case code + + case alias + + case modifiedBy = "modified_by" + + case createdBy = "created_by" + + case modifiedOn = "modified_on" + + case createdOn = "created_on" + + case active + + case type + } + + public init(active: Bool?, alias: String?, code: String?, createdBy: String?, createdOn: String?, modifiedBy: String?, modifiedOn: String?, type: String?) { + self.code = code + + self.alias = alias + + self.modifiedBy = modifiedBy + + self.createdBy = createdBy + + self.modifiedOn = modifiedOn + + self.createdOn = createdOn + + self.active = active + + self.type = type + } + + public func duplicate() -> JobConfigListDTO { + let dict = self.dictionary! + let copy = JobConfigListDTO(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + alias = try container.decode(String.self, forKey: .alias) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedBy = try container.decode(String.self, forKey: .modifiedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(String.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(alias, forKey: .alias) + + try? container.encodeIfPresent(modifiedBy, forKey: .modifiedBy) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: ResponseEnvelopeListJobConfigListDTO + Used By: Inventory + */ + + class ResponseEnvelopeListJobConfigListDTO: Codable { + public var timestamp: String? + + public var status: Int? + + public var error: String? + + public var exception: String? + + public var message: String? + + public var totalTimeTakenInMillis: Int? + + public var httpStatus: String? + + public var items: [JobConfigListDTO]? + + public var payload: [JobConfigListDTO]? + + public var traceId: String? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case timestamp + + case status + + case error + + case exception + + case message + + case totalTimeTakenInMillis = "total_time_taken_in_millis" + + case httpStatus = "http_status" + + case items + + case payload + + case traceId = "trace_id" + + case page + } + + public init(error: String?, exception: String?, httpStatus: String?, items: [JobConfigListDTO]?, message: String?, page: Page?, payload: [JobConfigListDTO]?, status: Int?, timestamp: String?, totalTimeTakenInMillis: Int?, traceId: String?) { + self.timestamp = timestamp + + self.status = status + + self.error = error + + self.exception = exception + + self.message = message + + self.totalTimeTakenInMillis = totalTimeTakenInMillis + + self.httpStatus = httpStatus + + self.items = items + + self.payload = payload + + self.traceId = traceId + + self.page = page + } + + public func duplicate() -> ResponseEnvelopeListJobConfigListDTO { + let dict = self.dictionary! + let copy = ResponseEnvelopeListJobConfigListDTO(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + timestamp = try container.decode(String.self, forKey: .timestamp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Int.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + error = try container.decode(String.self, forKey: .error) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + exception = try container.decode(String.self, forKey: .exception) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalTimeTakenInMillis = try container.decode(Int.self, forKey: .totalTimeTakenInMillis) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + httpStatus = try container.decode(String.self, forKey: .httpStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + items = try container.decode([JobConfigListDTO].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + payload = try container.decode([JobConfigListDTO].self, forKey: .payload) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + traceId = try container.decode(String.self, forKey: .traceId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(timestamp, forKey: .timestamp) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(error, forKey: .error) + + try? container.encodeIfPresent(exception, forKey: .exception) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(totalTimeTakenInMillis, forKey: .totalTimeTakenInMillis) + + try? container.encodeIfPresent(httpStatus, forKey: .httpStatus) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(payload, forKey: .payload) + + try? container.encodeIfPresent(traceId, forKey: .traceId) + + try? container.encodeIfPresent(page, forKey: .page) + } + } +} diff --git a/Sources/code/platform/models/LeadPlatformModelClass.swift b/Sources/code/platform/models/LeadPlatformModelClass.swift new file mode 100644 index 0000000000..53dae31594 --- /dev/null +++ b/Sources/code/platform/models/LeadPlatformModelClass.swift @@ -0,0 +1,3189 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: TicketList + Used By: Lead + */ + + class TicketList: Codable { + public var items: [Ticket]? + + public var filters: Filter? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case filters + + case page + } + + public init(filters: Filter?, items: [Ticket]?, page: Page?) { + self.items = items + + self.filters = filters + + self.page = page + } + + public func duplicate() -> TicketList { + let dict = self.dictionary! + let copy = TicketList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Ticket].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filters = try container.decode(Filter.self, forKey: .filters) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(filters, forKey: .filters) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: Page + Used By: Lead + */ + + class Page: Codable { + public var itemTotal: Int? + + public var nextId: String? + + public var hasPrevious: Bool? + + public var hasNext: Bool? + + public var current: Int? + + public var type: String + + public var size: Int? + + public enum CodingKeys: String, CodingKey { + case itemTotal = "item_total" + + case nextId = "next_id" + + case hasPrevious = "has_previous" + + case hasNext = "has_next" + + case current + + case type + + case size + } + + public init(current: Int?, hasNext: Bool?, hasPrevious: Bool?, itemTotal: Int?, nextId: String?, size: Int?, type: String) { + self.itemTotal = itemTotal + + self.nextId = nextId + + self.hasPrevious = hasPrevious + + self.hasNext = hasNext + + self.current = current + + self.type = type + + self.size = size + } + + public func duplicate() -> Page { + let dict = self.dictionary! + let copy = Page(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + itemTotal = try container.decode(Int.self, forKey: .itemTotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + nextId = try container.decode(String.self, forKey: .nextId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasPrevious = try container.decode(Bool.self, forKey: .hasPrevious) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasNext = try container.decode(Bool.self, forKey: .hasNext) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + current = try container.decode(Int.self, forKey: .current) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + type = try container.decode(String.self, forKey: .type) + + do { + size = try container.decode(Int.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) + + try? container.encodeIfPresent(nextId, forKey: .nextId) + + try? container.encodeIfPresent(hasPrevious, forKey: .hasPrevious) + + try? container.encodeIfPresent(hasNext, forKey: .hasNext) + + try? container.encodeIfPresent(current, forKey: .current) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(size, forKey: .size) + } + } + + /* + Model: TicketHistoryList + Used By: Lead + */ + + class TicketHistoryList: Codable { + public var items: [TicketHistory]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [TicketHistory]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> TicketHistoryList { + let dict = self.dictionary! + let copy = TicketHistoryList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([TicketHistory].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: CustomFormList + Used By: Lead + */ + + class CustomFormList: Codable { + public var items: [CustomForm]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [CustomForm]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> CustomFormList { + let dict = self.dictionary! + let copy = CustomFormList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([CustomForm].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: CreateCustomFormPayload + Used By: Lead + */ + + class CreateCustomFormPayload: Codable { + public var slug: String + + public var title: String + + public var inputs: [[String: Any]] + + public var description: String? + + public var headerImage: String? + + public var priority: PriorityEnum + + public var shouldNotify: Bool? + + public var successMessage: String? + + public var pollForAssignment: PollForAssignment? + + public enum CodingKeys: String, CodingKey { + case slug + + case title + + case inputs + + case description + + case headerImage = "header_image" + + case priority + + case shouldNotify = "should_notify" + + case successMessage = "success_message" + + case pollForAssignment = "poll_for_assignment" + } + + public init(description: String?, headerImage: String?, inputs: [[String: Any]], pollForAssignment: PollForAssignment?, priority: PriorityEnum, shouldNotify: Bool?, slug: String, successMessage: String?, title: String) { + self.slug = slug + + self.title = title + + self.inputs = inputs + + self.description = description + + self.headerImage = headerImage + + self.priority = priority + + self.shouldNotify = shouldNotify + + self.successMessage = successMessage + + self.pollForAssignment = pollForAssignment + } + + public func duplicate() -> CreateCustomFormPayload { + let dict = self.dictionary! + let copy = CreateCustomFormPayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + slug = try container.decode(String.self, forKey: .slug) + + title = try container.decode(String.self, forKey: .title) + + inputs = try container.decode([[String: Any]].self, forKey: .inputs) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + headerImage = try container.decode(String.self, forKey: .headerImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + priority = try container.decode(PriorityEnum.self, forKey: .priority) + + do { + shouldNotify = try container.decode(Bool.self, forKey: .shouldNotify) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + successMessage = try container.decode(String.self, forKey: .successMessage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pollForAssignment = try container.decode(PollForAssignment.self, forKey: .pollForAssignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(inputs, forKey: .inputs) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(headerImage, forKey: .headerImage) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(shouldNotify, forKey: .shouldNotify) + + try? container.encodeIfPresent(successMessage, forKey: .successMessage) + + try? container.encodeIfPresent(pollForAssignment, forKey: .pollForAssignment) + } + } + + /* + Model: EditCustomFormPayload + Used By: Lead + */ + + class EditCustomFormPayload: Codable { + public var title: String + + public var inputs: [[String: Any]] + + public var description: String? + + public var priority: PriorityEnum + + public var headerImage: String? + + public var shouldNotify: Bool? + + public var loginRequired: Bool? + + public var successMessage: String? + + public var pollForAssignment: PollForAssignment? + + public enum CodingKeys: String, CodingKey { + case title + + case inputs + + case description + + case priority + + case headerImage = "header_image" + + case shouldNotify = "should_notify" + + case loginRequired = "login_required" + + case successMessage = "success_message" + + case pollForAssignment = "poll_for_assignment" + } + + public init(description: String?, headerImage: String?, inputs: [[String: Any]], loginRequired: Bool?, pollForAssignment: PollForAssignment?, priority: PriorityEnum, shouldNotify: Bool?, successMessage: String?, title: String) { + self.title = title + + self.inputs = inputs + + self.description = description + + self.priority = priority + + self.headerImage = headerImage + + self.shouldNotify = shouldNotify + + self.loginRequired = loginRequired + + self.successMessage = successMessage + + self.pollForAssignment = pollForAssignment + } + + public func duplicate() -> EditCustomFormPayload { + let dict = self.dictionary! + let copy = EditCustomFormPayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + title = try container.decode(String.self, forKey: .title) + + inputs = try container.decode([[String: Any]].self, forKey: .inputs) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + priority = try container.decode(PriorityEnum.self, forKey: .priority) + + do { + headerImage = try container.decode(String.self, forKey: .headerImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shouldNotify = try container.decode(Bool.self, forKey: .shouldNotify) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + loginRequired = try container.decode(Bool.self, forKey: .loginRequired) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + successMessage = try container.decode(String.self, forKey: .successMessage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pollForAssignment = try container.decode(PollForAssignment.self, forKey: .pollForAssignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(inputs, forKey: .inputs) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(headerImage, forKey: .headerImage) + + try? container.encodeIfPresent(shouldNotify, forKey: .shouldNotify) + + try? container.encodeIfPresent(loginRequired, forKey: .loginRequired) + + try? container.encodeIfPresent(successMessage, forKey: .successMessage) + + try? container.encodeIfPresent(pollForAssignment, forKey: .pollForAssignment) + } + } + + /* + Model: EditTicketPayload + Used By: Lead + */ + + class EditTicketPayload: Codable { + public var content: TicketContent? + + public var category: String? + + public var subCategory: String? + + public var source: String? + + public var status: String? + + public var priority: PriorityEnum? + + public var assignedTo: AgentChangePayload? + + public var tags: [String]? + + public enum CodingKeys: String, CodingKey { + case content + + case category + + case subCategory = "sub_category" + + case source + + case status + + case priority + + case assignedTo = "assigned_to" + + case tags + } + + public init(assignedTo: AgentChangePayload?, category: String?, content: TicketContent?, priority: PriorityEnum?, source: String?, status: String?, subCategory: String?, tags: [String]?) { + self.content = content + + self.category = category + + self.subCategory = subCategory + + self.source = source + + self.status = status + + self.priority = priority + + self.assignedTo = assignedTo + + self.tags = tags + } + + public func duplicate() -> EditTicketPayload { + let dict = self.dictionary! + let copy = EditTicketPayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + content = try container.decode(TicketContent.self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + category = try container.decode(String.self, forKey: .category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subCategory = try container.decode(String.self, forKey: .subCategory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + source = try container.decode(String.self, forKey: .source) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(PriorityEnum.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + assignedTo = try container.decode(AgentChangePayload.self, forKey: .assignedTo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(category, forKey: .category) + + try? container.encodeIfPresent(subCategory, forKey: .subCategory) + + try? container.encodeIfPresent(source, forKey: .source) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(assignedTo, forKey: .assignedTo) + + try? container.encodeIfPresent(tags, forKey: .tags) + } + } + + /* + Model: AgentChangePayload + Used By: Lead + */ + + class AgentChangePayload: Codable { + public var agentId: String + + public enum CodingKeys: String, CodingKey { + case agentId = "agent_id" + } + + public init(agentId: String) { + self.agentId = agentId + } + + public func duplicate() -> AgentChangePayload { + let dict = self.dictionary! + let copy = AgentChangePayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + agentId = try container.decode(String.self, forKey: .agentId) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(agentId, forKey: .agentId) + } + } + + /* + Model: CreateVideoRoomResponse + Used By: Lead + */ + + class CreateVideoRoomResponse: Codable { + public var uniqueName: String + + public enum CodingKeys: String, CodingKey { + case uniqueName = "unique_name" + } + + public init(uniqueName: String) { + self.uniqueName = uniqueName + } + + public func duplicate() -> CreateVideoRoomResponse { + let dict = self.dictionary! + let copy = CreateVideoRoomResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + uniqueName = try container.decode(String.self, forKey: .uniqueName) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uniqueName, forKey: .uniqueName) + } + } + + /* + Model: CloseVideoRoomResponse + Used By: Lead + */ + + class CloseVideoRoomResponse: Codable { + public var success: Bool + + public enum CodingKeys: String, CodingKey { + case success + } + + public init(success: Bool) { + self.success = success + } + + public func duplicate() -> CloseVideoRoomResponse { + let dict = self.dictionary! + let copy = CloseVideoRoomResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: CreateVideoRoomPayload + Used By: Lead + */ + + class CreateVideoRoomPayload: Codable { + public var uniqueName: String + + public var notify: [NotifyUser]? + + public enum CodingKeys: String, CodingKey { + case uniqueName = "unique_name" + + case notify + } + + public init(notify: [NotifyUser]?, uniqueName: String) { + self.uniqueName = uniqueName + + self.notify = notify + } + + public func duplicate() -> CreateVideoRoomPayload { + let dict = self.dictionary! + let copy = CreateVideoRoomPayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + uniqueName = try container.decode(String.self, forKey: .uniqueName) + + do { + notify = try container.decode([NotifyUser].self, forKey: .notify) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uniqueName, forKey: .uniqueName) + + try? container.encodeIfPresent(notify, forKey: .notify) + } + } + + /* + Model: NotifyUser + Used By: Lead + */ + + class NotifyUser: Codable { + public var countryCode: String + + public var phoneNumber: String + + public enum CodingKeys: String, CodingKey { + case countryCode = "country_code" + + case phoneNumber = "phone_number" + } + + public init(countryCode: String, phoneNumber: String) { + self.countryCode = countryCode + + self.phoneNumber = phoneNumber + } + + public func duplicate() -> NotifyUser { + let dict = self.dictionary! + let copy = NotifyUser(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + countryCode = try container.decode(String.self, forKey: .countryCode) + + phoneNumber = try container.decode(String.self, forKey: .phoneNumber) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(phoneNumber, forKey: .phoneNumber) + } + } + + /* + Model: Filter + Used By: Lead + */ + + class Filter: Codable { + public var priorities: [Priority] + + public var categories: [TicketCategory]? + + public var statuses: [Status] + + public var assignees: [[String: Any]] + + public enum CodingKeys: String, CodingKey { + case priorities + + case categories + + case statuses + + case assignees + } + + public init(assignees: [[String: Any]], categories: [TicketCategory]?, priorities: [Priority], statuses: [Status]) { + self.priorities = priorities + + self.categories = categories + + self.statuses = statuses + + self.assignees = assignees + } + + public func duplicate() -> Filter { + let dict = self.dictionary! + let copy = Filter(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + priorities = try container.decode([Priority].self, forKey: .priorities) + + do { + categories = try container.decode([TicketCategory].self, forKey: .categories) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + statuses = try container.decode([Status].self, forKey: .statuses) + + assignees = try container.decode([[String: Any]].self, forKey: .assignees) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(priorities, forKey: .priorities) + + try? container.encodeIfPresent(categories, forKey: .categories) + + try? container.encodeIfPresent(statuses, forKey: .statuses) + + try? container.encodeIfPresent(assignees, forKey: .assignees) + } + } + + /* + Model: TicketHistoryPayload + Used By: Lead + */ + + class TicketHistoryPayload: Codable { + public var value: [String: Any] + + public var type: HistoryTypeEnum + + public enum CodingKeys: String, CodingKey { + case value + + case type + } + + public init(type: HistoryTypeEnum, value: [String: Any]) { + self.value = value + + self.type = type + } + + public func duplicate() -> TicketHistoryPayload { + let dict = self.dictionary! + let copy = TicketHistoryPayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + value = try container.decode([String: Any].self, forKey: .value) + + type = try container.decode(HistoryTypeEnum.self, forKey: .type) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: CustomFormSubmissionPayload + Used By: Lead + */ + + class CustomFormSubmissionPayload: Codable { + public var response: [[String: Any]] + + public var attachments: [TicketAsset]? + + public enum CodingKeys: String, CodingKey { + case response + + case attachments + } + + public init(attachments: [TicketAsset]?, response: [[String: Any]]) { + self.response = response + + self.attachments = attachments + } + + public func duplicate() -> CustomFormSubmissionPayload { + let dict = self.dictionary! + let copy = CustomFormSubmissionPayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + response = try container.decode([[String: Any]].self, forKey: .response) + + do { + attachments = try container.decode([TicketAsset].self, forKey: .attachments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(response, forKey: .response) + + try? container.encodeIfPresent(attachments, forKey: .attachments) + } + } + + /* + Model: GetTokenForVideoRoomResponse + Used By: Lead + */ + + class GetTokenForVideoRoomResponse: Codable { + public var accessToken: String + + public enum CodingKeys: String, CodingKey { + case accessToken = "access_token" + } + + public init(accessToken: String) { + self.accessToken = accessToken + } + + public func duplicate() -> GetTokenForVideoRoomResponse { + let dict = self.dictionary! + let copy = GetTokenForVideoRoomResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + accessToken = try container.decode(String.self, forKey: .accessToken) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(accessToken, forKey: .accessToken) + } + } + + /* + Model: GetParticipantsInsideVideoRoomResponse + Used By: Lead + */ + + class GetParticipantsInsideVideoRoomResponse: Codable { + public var participants: [Participant] + + public enum CodingKeys: String, CodingKey { + case participants + } + + public init(participants: [Participant]) { + self.participants = participants + } + + public func duplicate() -> GetParticipantsInsideVideoRoomResponse { + let dict = self.dictionary! + let copy = GetParticipantsInsideVideoRoomResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + participants = try container.decode([Participant].self, forKey: .participants) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(participants, forKey: .participants) + } + } + + /* + Model: Participant + Used By: Lead + */ + + class Participant: Codable { + public var user: UserSchema? + + public var identity: String? + + public var status: String? + + public enum CodingKeys: String, CodingKey { + case user + + case identity + + case status + } + + public init(identity: String?, status: String?, user: UserSchema?) { + self.user = user + + self.identity = identity + + self.status = status + } + + public func duplicate() -> Participant { + let dict = self.dictionary! + let copy = Participant(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode(UserSchema.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + identity = try container.decode(String.self, forKey: .identity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(identity, forKey: .identity) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: PhoneNumber + Used By: Lead + */ + + class PhoneNumber: Codable { + public var active: Bool? + + public var primary: Bool? + + public var verified: Bool? + + public var phone: String? + + public var countryCode: Int? + + public enum CodingKeys: String, CodingKey { + case active + + case primary + + case verified + + case phone + + case countryCode = "country_code" + } + + public init(active: Bool?, countryCode: Int?, phone: String?, primary: Bool?, verified: Bool?) { + self.active = active + + self.primary = primary + + self.verified = verified + + self.phone = phone + + self.countryCode = countryCode + } + + public func duplicate() -> PhoneNumber { + let dict = self.dictionary! + let copy = PhoneNumber(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + primary = try container.decode(Bool.self, forKey: .primary) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verified = try container.decode(Bool.self, forKey: .verified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(Int.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(primary, forKey: .primary) + + try? container.encodeIfPresent(verified, forKey: .verified) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + } + } + + /* + Model: Email + Used By: Lead + */ + + class Email: Codable { + public var primary: Bool? + + public var verified: Bool? + + public var email: String? + + public var active: Bool? + + public enum CodingKeys: String, CodingKey { + case primary + + case verified + + case email + + case active + } + + public init(active: Bool?, email: String?, primary: Bool?, verified: Bool?) { + self.primary = primary + + self.verified = verified + + self.email = email + + self.active = active + } + + public func duplicate() -> Email { + let dict = self.dictionary! + let copy = Email(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + primary = try container.decode(Bool.self, forKey: .primary) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verified = try container.decode(Bool.self, forKey: .verified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(primary, forKey: .primary) + + try? container.encodeIfPresent(verified, forKey: .verified) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(active, forKey: .active) + } + } + + /* + Model: Debug + Used By: Lead + */ + + class Debug: Codable { + public var source: String? + + public var platform: String? + + public enum CodingKeys: String, CodingKey { + case source + + case platform + } + + public init(platform: String?, source: String?) { + self.source = source + + self.platform = platform + } + + public func duplicate() -> Debug { + let dict = self.dictionary! + let copy = Debug(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + source = try container.decode(String.self, forKey: .source) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + platform = try container.decode(String.self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(source, forKey: .source) + + try? container.encodeIfPresent(platform, forKey: .platform) + } + } + + /* + Model: SubmitCustomFormResponse + Used By: Lead + */ + + class SubmitCustomFormResponse: Codable { + public var ticket: Ticket + + public enum CodingKeys: String, CodingKey { + case ticket + } + + public init(ticket: Ticket) { + self.ticket = ticket + } + + public func duplicate() -> SubmitCustomFormResponse { + let dict = self.dictionary! + let copy = SubmitCustomFormResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + ticket = try container.decode(Ticket.self, forKey: .ticket) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(ticket, forKey: .ticket) + } + } + + /* + Model: TicketContext + Used By: Lead + */ + + class TicketContext: Codable { + public var applicationId: String? + + public var companyId: String + + public enum CodingKeys: String, CodingKey { + case applicationId = "application_id" + + case companyId = "company_id" + } + + public init(applicationId: String?, companyId: String) { + self.applicationId = applicationId + + self.companyId = companyId + } + + public func duplicate() -> TicketContext { + let dict = self.dictionary! + let copy = TicketContext(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + applicationId = try container.decode(String.self, forKey: .applicationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + companyId = try container.decode(String.self, forKey: .companyId) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + } + } + + /* + Model: CreatedOn + Used By: Lead + */ + + class CreatedOn: Codable { + public var userAgent: String + + public enum CodingKeys: String, CodingKey { + case userAgent = "user_agent" + } + + public init(userAgent: String) { + self.userAgent = userAgent + } + + public func duplicate() -> CreatedOn { + let dict = self.dictionary! + let copy = CreatedOn(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + userAgent = try container.decode(String.self, forKey: .userAgent) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(userAgent, forKey: .userAgent) + } + } + + /* + Model: TicketAsset + Used By: Lead + */ + + class TicketAsset: Codable { + public var display: String? + + public var value: String + + public var type: TicketAssetTypeEnum + + public enum CodingKeys: String, CodingKey { + case display + + case value + + case type + } + + public init(display: String?, type: TicketAssetTypeEnum, value: String) { + self.display = display + + self.value = value + + self.type = type + } + + public func duplicate() -> TicketAsset { + let dict = self.dictionary! + let copy = TicketAsset(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + value = try container.decode(String.self, forKey: .value) + + type = try container.decode(TicketAssetTypeEnum.self, forKey: .type) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: TicketContent + Used By: Lead + */ + + class TicketContent: Codable { + public var title: String + + public var description: String? + + public var attachments: [TicketAsset]? + + public enum CodingKeys: String, CodingKey { + case title + + case description + + case attachments + } + + public init(attachments: [TicketAsset]?, description: String?, title: String) { + self.title = title + + self.description = description + + self.attachments = attachments + } + + public func duplicate() -> TicketContent { + let dict = self.dictionary! + let copy = TicketContent(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + title = try container.decode(String.self, forKey: .title) + + do { + description = try container.decode(String.self, forKey: .description) + + if let strong_description = description, + let descriptionData = Data(base64Encoded: strong_description) + { + description = String(data: descriptionData, encoding: .utf8) ?? description + } + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attachments = try container.decode([TicketAsset].self, forKey: .attachments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(description?.asBase64, forKey: .description) + + try? container.encodeIfPresent(attachments, forKey: .attachments) + } + } + + /* + Model: AddTicketPayload + Used By: Lead + */ + + class AddTicketPayload: Codable { + public var createdBy: [String: Any]? + + public var status: String? + + public var priority: PriorityEnum? + + public var category: String + + public var content: TicketContent + + public enum CodingKeys: String, CodingKey { + case createdBy = "created_by" + + case status + + case priority + + case category + + case content + } + + public init(category: String, content: TicketContent, createdBy: [String: Any]?, priority: PriorityEnum?, status: String?) { + self.createdBy = createdBy + + self.status = status + + self.priority = priority + + self.category = category + + self.content = content + } + + public func duplicate() -> AddTicketPayload { + let dict = self.dictionary! + let copy = AddTicketPayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + createdBy = try container.decode([String: Any].self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(PriorityEnum.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + category = try container.decode(String.self, forKey: .category) + + content = try container.decode(TicketContent.self, forKey: .content) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(category, forKey: .category) + + try? container.encodeIfPresent(content, forKey: .content) + } + } + + /* + Model: Priority + Used By: Lead + */ + + class Priority: Codable { + public var key: PriorityEnum + + public var display: String + + public var color: String + + public enum CodingKeys: String, CodingKey { + case key + + case display + + case color + } + + public init(color: String, display: String, key: PriorityEnum) { + self.key = key + + self.display = display + + self.color = color + } + + public func duplicate() -> Priority { + let dict = self.dictionary! + let copy = Priority(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + key = try container.decode(PriorityEnum.self, forKey: .key) + + display = try container.decode(String.self, forKey: .display) + + color = try container.decode(String.self, forKey: .color) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(color, forKey: .color) + } + } + + /* + Model: Status + Used By: Lead + */ + + class Status: Codable { + public var key: String + + public var display: String + + public var color: String + + public enum CodingKeys: String, CodingKey { + case key + + case display + + case color + } + + public init(color: String, display: String, key: String) { + self.key = key + + self.display = display + + self.color = color + } + + public func duplicate() -> Status { + let dict = self.dictionary! + let copy = Status(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + key = try container.decode(String.self, forKey: .key) + + display = try container.decode(String.self, forKey: .display) + + color = try container.decode(String.self, forKey: .color) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(color, forKey: .color) + } + } + + /* + Model: TicketCategory + Used By: Lead + */ + + class TicketCategory: Codable { + public var key: String + + public var display: String + + public var form: CustomForm? + + public var subCategories: [TicketSubCategory]? + + public var feedbackForm: TicketFeedbackForm? + + public enum CodingKeys: String, CodingKey { + case key + + case display + + case form + + case subCategories = "sub_categories" + + case feedbackForm = "feedback_form" + } + + public init(display: String, feedbackForm: TicketFeedbackForm?, form: CustomForm?, key: String, subCategories: [TicketSubCategory]?) { + self.key = key + + self.display = display + + self.form = form + + self.subCategories = subCategories + + self.feedbackForm = feedbackForm + } + + public func duplicate() -> TicketCategory { + let dict = self.dictionary! + let copy = TicketCategory(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + key = try container.decode(String.self, forKey: .key) + + display = try container.decode(String.self, forKey: .display) + + do { + form = try container.decode(CustomForm.self, forKey: .form) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subCategories = try container.decode([TicketSubCategory].self, forKey: .subCategories) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + feedbackForm = try container.decode(TicketFeedbackForm.self, forKey: .feedbackForm) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(form, forKey: .form) + + try? container.encodeIfPresent(subCategories, forKey: .subCategories) + + try? container.encodeIfPresent(feedbackForm, forKey: .feedbackForm) + } + } + + /* + Model: TicketSubCategory + Used By: Lead + */ + + class TicketSubCategory: Codable { + public var key: String + + public var display: String + + public enum CodingKeys: String, CodingKey { + case key + + case display + } + + public init(display: String, key: String) { + self.key = key + + self.display = display + } + + public func duplicate() -> TicketSubCategory { + let dict = self.dictionary! + let copy = TicketSubCategory(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + key = try container.decode(String.self, forKey: .key) + + display = try container.decode(String.self, forKey: .display) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(display, forKey: .display) + } + } + + /* + Model: TicketFeedbackForm + Used By: Lead + */ + + class TicketFeedbackForm: Codable { + public var title: String + + public var display: [[String: Any]]? + + public enum CodingKeys: String, CodingKey { + case title + + case display + } + + public init(display: [[String: Any]]?, title: String) { + self.title = title + + self.display = display + } + + public func duplicate() -> TicketFeedbackForm { + let dict = self.dictionary! + let copy = TicketFeedbackForm(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + title = try container.decode(String.self, forKey: .title) + + do { + display = try container.decode([[String: Any]].self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(display, forKey: .display) + } + } + + /* + Model: TicketFeedbackList + Used By: Lead + */ + + class TicketFeedbackList: Codable { + public var items: [TicketFeedback]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [TicketFeedback]?) { + self.items = items + } + + public func duplicate() -> TicketFeedbackList { + let dict = self.dictionary! + let copy = TicketFeedbackList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([TicketFeedback].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: TicketFeedbackPayload + Used By: Lead + */ + + class TicketFeedbackPayload: Codable { + public var formResponse: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case formResponse = "form_response" + } + + public init(formResponse: [String: Any]?) { + self.formResponse = formResponse + } + + public func duplicate() -> TicketFeedbackPayload { + let dict = self.dictionary! + let copy = TicketFeedbackPayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + formResponse = try container.decode([String: Any].self, forKey: .formResponse) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(formResponse, forKey: .formResponse) + } + } + + /* + Model: SubmitButton + Used By: Lead + */ + + class SubmitButton: Codable { + public var title: String + + public var titleColor: String + + public var backgroundColor: String + + public enum CodingKeys: String, CodingKey { + case title + + case titleColor = "title_color" + + case backgroundColor = "background_color" + } + + public init(backgroundColor: String, title: String, titleColor: String) { + self.title = title + + self.titleColor = titleColor + + self.backgroundColor = backgroundColor + } + + public func duplicate() -> SubmitButton { + let dict = self.dictionary! + let copy = SubmitButton(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + title = try container.decode(String.self, forKey: .title) + + titleColor = try container.decode(String.self, forKey: .titleColor) + + backgroundColor = try container.decode(String.self, forKey: .backgroundColor) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(titleColor, forKey: .titleColor) + + try? container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) + } + } + + /* + Model: PollForAssignment + Used By: Lead + */ + + class PollForAssignment: Codable { + public var duration: Double + + public var message: String + + public var successMessage: String + + public var failureMessage: String + + public enum CodingKeys: String, CodingKey { + case duration + + case message + + case successMessage = "success_message" + + case failureMessage = "failure_message" + } + + public init(duration: Double, failureMessage: String, message: String, successMessage: String) { + self.duration = duration + + self.message = message + + self.successMessage = successMessage + + self.failureMessage = failureMessage + } + + public func duplicate() -> PollForAssignment { + let dict = self.dictionary! + let copy = PollForAssignment(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + duration = try container.decode(Double.self, forKey: .duration) + + message = try container.decode(String.self, forKey: .message) + + successMessage = try container.decode(String.self, forKey: .successMessage) + + failureMessage = try container.decode(String.self, forKey: .failureMessage) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(duration, forKey: .duration) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(successMessage, forKey: .successMessage) + + try? container.encodeIfPresent(failureMessage, forKey: .failureMessage) + } + } + + /* + Model: CustomForm + Used By: Lead + */ + + class CustomForm: Codable { + public var applicationId: String + + public var slug: String + + public var headerImage: String? + + public var title: String + + public var description: String? + + public var priority: Priority + + public var loginRequired: Bool + + public var shouldNotify: Bool + + public var successMessage: String? + + public var submitButton: SubmitButton? + + public var inputs: [[String: Any]] + + public var createdOn: CreatedOn? + + public var createdBy: [String: Any]? + + public var pollForAssignment: PollForAssignment? + + public var id: String + + public enum CodingKeys: String, CodingKey { + case applicationId = "application_id" + + case slug + + case headerImage = "header_image" + + case title + + case description + + case priority + + case loginRequired = "login_required" + + case shouldNotify = "should_notify" + + case successMessage = "success_message" + + case submitButton = "submit_button" + + case inputs + + case createdOn = "created_on" + + case createdBy = "created_by" + + case pollForAssignment = "poll_for_assignment" + + case id = "_id" + } + + public init(applicationId: String, createdBy: [String: Any]?, createdOn: CreatedOn?, description: String?, headerImage: String?, inputs: [[String: Any]], loginRequired: Bool, pollForAssignment: PollForAssignment?, priority: Priority, shouldNotify: Bool, slug: String, submitButton: SubmitButton?, successMessage: String?, title: String, id: String) { + self.applicationId = applicationId + + self.slug = slug + + self.headerImage = headerImage + + self.title = title + + self.description = description + + self.priority = priority + + self.loginRequired = loginRequired + + self.shouldNotify = shouldNotify + + self.successMessage = successMessage + + self.submitButton = submitButton + + self.inputs = inputs + + self.createdOn = createdOn + + self.createdBy = createdBy + + self.pollForAssignment = pollForAssignment + + self.id = id + } + + public func duplicate() -> CustomForm { + let dict = self.dictionary! + let copy = CustomForm(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + applicationId = try container.decode(String.self, forKey: .applicationId) + + slug = try container.decode(String.self, forKey: .slug) + + do { + headerImage = try container.decode(String.self, forKey: .headerImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + title = try container.decode(String.self, forKey: .title) + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + priority = try container.decode(Priority.self, forKey: .priority) + + loginRequired = try container.decode(Bool.self, forKey: .loginRequired) + + shouldNotify = try container.decode(Bool.self, forKey: .shouldNotify) + + do { + successMessage = try container.decode(String.self, forKey: .successMessage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + submitButton = try container.decode(SubmitButton.self, forKey: .submitButton) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + inputs = try container.decode([[String: Any]].self, forKey: .inputs) + + do { + createdOn = try container.decode(CreatedOn.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode([String: Any].self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pollForAssignment = try container.decode(PollForAssignment.self, forKey: .pollForAssignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + id = try container.decode(String.self, forKey: .id) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + + try? container.encodeIfPresent(slug, forKey: .slug) + + try? container.encodeIfPresent(headerImage, forKey: .headerImage) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(loginRequired, forKey: .loginRequired) + + try? container.encodeIfPresent(shouldNotify, forKey: .shouldNotify) + + try? container.encodeIfPresent(successMessage, forKey: .successMessage) + + try? container.encodeIfPresent(submitButton, forKey: .submitButton) + + try? container.encodeIfPresent(inputs, forKey: .inputs) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(pollForAssignment, forKey: .pollForAssignment) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: FeedbackResponseItem + Used By: Lead + */ + + class FeedbackResponseItem: Codable { + public var display: String + + public var key: String + + public var value: String + + public enum CodingKeys: String, CodingKey { + case display + + case key + + case value + } + + public init(display: String, key: String, value: String) { + self.display = display + + self.key = key + + self.value = value + } + + public func duplicate() -> FeedbackResponseItem { + let dict = self.dictionary! + let copy = FeedbackResponseItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + display = try container.decode(String.self, forKey: .display) + + key = try container.decode(String.self, forKey: .key) + + value = try container.decode(String.self, forKey: .value) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(key, forKey: .key) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: TicketFeedback + Used By: Lead + */ + + class TicketFeedback: Codable { + public var id: String + + public var ticketId: String + + public var companyId: String + + public var response: [FeedbackResponseItem] + + public var category: String? + + public var user: [String: Any]? + + public var updatedAt: String? + + public var createdAt: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case ticketId = "ticket_id" + + case companyId = "company_id" + + case response + + case category + + case user + + case updatedAt = "updated_at" + + case createdAt = "created_at" + } + + public init(category: String?, companyId: String, createdAt: String?, response: [FeedbackResponseItem], ticketId: String, updatedAt: String?, user: [String: Any]?, id: String) { + self.id = id + + self.ticketId = ticketId + + self.companyId = companyId + + self.response = response + + self.category = category + + self.user = user + + self.updatedAt = updatedAt + + self.createdAt = createdAt + } + + public func duplicate() -> TicketFeedback { + let dict = self.dictionary! + let copy = TicketFeedback(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + id = try container.decode(String.self, forKey: .id) + + ticketId = try container.decode(String.self, forKey: .ticketId) + + companyId = try container.decode(String.self, forKey: .companyId) + + response = try container.decode([FeedbackResponseItem].self, forKey: .response) + + do { + category = try container.decode(String.self, forKey: .category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + user = try container.decode([String: Any].self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(ticketId, forKey: .ticketId) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(response, forKey: .response) + + try? container.encodeIfPresent(category, forKey: .category) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + } + } + + /* + Model: TicketHistory + Used By: Lead + */ + + class TicketHistory: Codable { + public var type: String + + public var value: [String: Any] + + public var ticketId: String + + public var createdOn: CreatedOn? + + public var createdBy: [String: Any]? + + public var id: String + + public var updatedAt: String? + + public var createdAt: String? + + public enum CodingKeys: String, CodingKey { + case type + + case value + + case ticketId = "ticket_id" + + case createdOn = "created_on" + + case createdBy = "created_by" + + case id = "_id" + + case updatedAt = "updated_at" + + case createdAt = "created_at" + } + + public init(createdAt: String?, createdBy: [String: Any]?, createdOn: CreatedOn?, ticketId: String, type: String, updatedAt: String?, value: [String: Any], id: String) { + self.type = type + + self.value = value + + self.ticketId = ticketId + + self.createdOn = createdOn + + self.createdBy = createdBy + + self.id = id + + self.updatedAt = updatedAt + + self.createdAt = createdAt + } + + public func duplicate() -> TicketHistory { + let dict = self.dictionary! + let copy = TicketHistory(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + type = try container.decode(String.self, forKey: .type) + + value = try container.decode([String: Any].self, forKey: .value) + + ticketId = try container.decode(String.self, forKey: .ticketId) + + do { + createdOn = try container.decode(CreatedOn.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode([String: Any].self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + id = try container.decode(String.self, forKey: .id) + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(ticketId, forKey: .ticketId) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + } + } + + /* + Model: Ticket + Used By: Lead + */ + + class Ticket: Codable { + public var context: TicketContext? + + public var createdOn: CreatedOn? + + public var responseId: String? + + public var content: TicketContent? + + public var ticketId: String + + public var category: TicketCategory + + public var subCategory: TicketSubCategory? + + public var source: TicketSourceEnum + + public var status: Status + + public var priority: Priority + + public var createdBy: [String: Any]? + + public var assignedTo: [String: Any]? + + public var tags: [String]? + + public var customJson: [String: Any]? + + public var isFeedbackPending: Bool? + + public var id: String + + public var updatedAt: String? + + public var createdAt: String? + + public enum CodingKeys: String, CodingKey { + case context + + case createdOn = "created_on" + + case responseId = "response_id" + + case content + + case ticketId = "ticket_id" + + case category + + case subCategory = "sub_category" + + case source + + case status + + case priority + + case createdBy = "created_by" + + case assignedTo = "assigned_to" + + case tags + + case customJson = "_custom_json" + + case isFeedbackPending = "is_feedback_pending" + + case id = "_id" + + case updatedAt = "updated_at" + + case createdAt = "created_at" + } + + public init(assignedTo: [String: Any]?, category: TicketCategory, content: TicketContent?, context: TicketContext?, createdAt: String?, createdBy: [String: Any]?, createdOn: CreatedOn?, isFeedbackPending: Bool?, priority: Priority, responseId: String?, source: TicketSourceEnum, status: Status, subCategory: TicketSubCategory?, tags: [String]?, ticketId: String, updatedAt: String?, customJson: [String: Any]?, id: String) { + self.context = context + + self.createdOn = createdOn + + self.responseId = responseId + + self.content = content + + self.ticketId = ticketId + + self.category = category + + self.subCategory = subCategory + + self.source = source + + self.status = status + + self.priority = priority + + self.createdBy = createdBy + + self.assignedTo = assignedTo + + self.tags = tags + + self.customJson = customJson + + self.isFeedbackPending = isFeedbackPending + + self.id = id + + self.updatedAt = updatedAt + + self.createdAt = createdAt + } + + public func duplicate() -> Ticket { + let dict = self.dictionary! + let copy = Ticket(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + context = try container.decode(TicketContext.self, forKey: .context) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(CreatedOn.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + responseId = try container.decode(String.self, forKey: .responseId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + content = try container.decode(TicketContent.self, forKey: .content) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + ticketId = try container.decode(String.self, forKey: .ticketId) + + category = try container.decode(TicketCategory.self, forKey: .category) + + do { + subCategory = try container.decode(TicketSubCategory.self, forKey: .subCategory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + source = try container.decode(TicketSourceEnum.self, forKey: .source) + + status = try container.decode(Status.self, forKey: .status) + + priority = try container.decode(Priority.self, forKey: .priority) + + do { + createdBy = try container.decode([String: Any].self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + assignedTo = try container.decode([String: Any].self, forKey: .assignedTo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customJson = try container.decode([String: Any].self, forKey: .customJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isFeedbackPending = try container.decode(Bool.self, forKey: .isFeedbackPending) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + id = try container.decode(String.self, forKey: .id) + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(context, forKey: .context) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(responseId, forKey: .responseId) + + try? container.encodeIfPresent(content, forKey: .content) + + try? container.encodeIfPresent(ticketId, forKey: .ticketId) + + try? container.encodeIfPresent(category, forKey: .category) + + try? container.encodeIfPresent(subCategory, forKey: .subCategory) + + try? container.encodeIfPresent(source, forKey: .source) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(assignedTo, forKey: .assignedTo) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(customJson, forKey: .customJson) + + try? container.encodeIfPresent(isFeedbackPending, forKey: .isFeedbackPending) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + } + } +} diff --git a/Sources/code/platform/models/OrderPlatformModelClass.swift b/Sources/code/platform/models/OrderPlatformModelClass.swift new file mode 100644 index 0000000000..9d9235856d --- /dev/null +++ b/Sources/code/platform/models/OrderPlatformModelClass.swift @@ -0,0 +1,17718 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: GetActivityStatus + Used By: Order + */ + + class GetActivityStatus: Codable { + public var activityHistory: ActivityHistory + + public enum CodingKeys: String, CodingKey { + case activityHistory = "activity_history" + } + + public init(activityHistory: ActivityHistory) { + self.activityHistory = activityHistory + } + + public func duplicate() -> GetActivityStatus { + let dict = self.dictionary! + let copy = GetActivityStatus(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + activityHistory = try container.decode(ActivityHistory.self, forKey: .activityHistory) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(activityHistory, forKey: .activityHistory) + } + } + + /* + Model: ActivityHistory + Used By: Order + */ + + class ActivityHistory: Codable { + public var createdat: String? + + public var message: String? + + public var type: String? + + public var user: String? + + public enum CodingKeys: String, CodingKey { + case createdat + + case message + + case type + + case user + } + + public init(createdat: String?, message: String?, type: String?, user: String?) { + self.createdat = createdat + + self.message = message + + self.type = type + + self.user = user + } + + public func duplicate() -> ActivityHistory { + let dict = self.dictionary! + let copy = ActivityHistory(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + createdat = try container.decode(String.self, forKey: .createdat) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + user = try container.decode(String.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(createdat, forKey: .createdat) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(user, forKey: .user) + } + } + + /* + Model: CanBreakRequestBody + Used By: Order + */ + + class CanBreakRequestBody: Codable { + public var shipmentIds: [String] + + public enum CodingKeys: String, CodingKey { + case shipmentIds = "shipment_ids" + } + + public init(shipmentIds: [String]) { + self.shipmentIds = shipmentIds + } + + public func duplicate() -> CanBreakRequestBody { + let dict = self.dictionary! + let copy = CanBreakRequestBody(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + shipmentIds = try container.decode([String].self, forKey: .shipmentIds) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(shipmentIds, forKey: .shipmentIds) + } + } + + /* + Model: CanBreakResponse + Used By: Order + */ + + class CanBreakResponse: Codable { + public var status: Bool + + public var validActions: [String: Any] + + public enum CodingKeys: String, CodingKey { + case status + + case validActions = "valid_actions" + } + + public init(status: Bool, validActions: [String: Any]) { + self.status = status + + self.validActions = validActions + } + + public func duplicate() -> CanBreakResponse { + let dict = self.dictionary! + let copy = CanBreakResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + status = try container.decode(Bool.self, forKey: .status) + + validActions = try container.decode([String: Any].self, forKey: .validActions) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(validActions, forKey: .validActions) + } + } + + /* + Model: FailedOrders + Used By: Order + */ + + class FailedOrders: Codable { + public var orders: FailOrder + + public enum CodingKeys: String, CodingKey { + case orders + } + + public init(orders: FailOrder) { + self.orders = orders + } + + public func duplicate() -> FailedOrders { + let dict = self.dictionary! + let copy = FailedOrders(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + orders = try container.decode(FailOrder.self, forKey: .orders) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(orders, forKey: .orders) + } + } + + /* + Model: FailOrder + Used By: Order + */ + + class FailOrder: Codable { + public var updatedAt: String? + + public var id: String? + + public var reason: String? + + public var marketplaceOrder: MarketplaceOrder? + + public var marketplaceOrderId: String? + + public var createdAt: String? + + public var appId: String? + + public var marketplace: String? + + public var companyId: Int? + + public enum CodingKeys: String, CodingKey { + case updatedAt = "updated_at" + + case id = "_id" + + case reason + + case marketplaceOrder = "marketplace_order" + + case marketplaceOrderId = "marketplace_order_id" + + case createdAt = "created_at" + + case appId = "app_id" + + case marketplace + + case companyId = "company_id" + } + + public init(appId: String?, companyId: Int?, createdAt: String?, marketplace: String?, marketplaceOrder: MarketplaceOrder?, marketplaceOrderId: String?, reason: String?, updatedAt: String?, id: String?) { + self.updatedAt = updatedAt + + self.id = id + + self.reason = reason + + self.marketplaceOrder = marketplaceOrder + + self.marketplaceOrderId = marketplaceOrderId + + self.createdAt = createdAt + + self.appId = appId + + self.marketplace = marketplace + + self.companyId = companyId + } + + public func duplicate() -> FailOrder { + let dict = self.dictionary! + let copy = FailOrder(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + reason = try container.decode(String.self, forKey: .reason) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + marketplaceOrder = try container.decode(MarketplaceOrder.self, forKey: .marketplaceOrder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + marketplaceOrderId = try container.decode(String.self, forKey: .marketplaceOrderId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + marketplace = try container.decode(String.self, forKey: .marketplace) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(reason, forKey: .reason) + + try? container.encodeIfPresent(marketplaceOrder, forKey: .marketplaceOrder) + + try? container.encodeIfPresent(marketplaceOrderId, forKey: .marketplaceOrderId) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(marketplace, forKey: .marketplace) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + } + } + + /* + Model: MarketplaceOrder + Used By: Order + */ + + class MarketplaceOrder: Codable { + public var orderStatusUrl: String? + + public var adminGraphqlApiId: String? + + public var email: String? + + public var test: Bool? + + public var note: String? + + public var totalPrice: String? + + public var appId: Int? + + public var totalDiscountsSet: TotalDiscountsSet? + + public var totalPriceSet: TotalPriceSet? + + public var totalTaxSet: TotalTaxSet? + + public var gateway: String? + + public var name: String? + + public var subtotalPriceSet: SubtotalPriceSet? + + public var number: Int? + + public var buyerAcceptsMarketing: Bool? + + public var contactEmail: String? + + public var token: String? + + public var sourceName: String? + + public var paymentGatewayNames: [[String: Any]]? + + public var presentmentCurrency: String? + + public var subtotalPrice: String? + + public var processedAt: String? + + public var orderNumber: Int? + + public var totalTipReceived: String? + + public var id: Int? + + public var confirmed: Bool? + + public var currency: String? + + public var totalLineItemsPrice: String? + + public var lineItems: LineItems? + + public var createdAt: String? + + public var updatedAt: String? + + public var totalWeight: Int? + + public var billingAddress: BillingAddress? + + public var totalShippingPriceSet: TotalShippingPriceSet? + + public var customer: Customer? + + public var totalDiscounts: String? + + public var totalLineItemsPriceSet: TotalLineItemsPriceSet? + + public var tags: String? + + public var totalPriceUsd: String? + + public var userId: Int? + + public var totalTax: String? + + public var processingMethod: String? + + public var shippingAddress: OrderShippingAddress? + + public var taxesIncluded: Bool? + + public var financialStatus: String? + + public enum CodingKeys: String, CodingKey { + case orderStatusUrl = "order_status_url" + + case adminGraphqlApiId = "admin_graphql_api_id" + + case email + + case test + + case note + + case totalPrice = "total_price" + + case appId = "app_id" + + case totalDiscountsSet = "total_discounts_set" + + case totalPriceSet = "total_price_set" + + case totalTaxSet = "total_tax_set" + + case gateway + + case name + + case subtotalPriceSet = "subtotal_price_set" + + case number + + case buyerAcceptsMarketing = "buyer_accepts_marketing" + + case contactEmail = "contact_email" + + case token + + case sourceName = "source_name" + + case paymentGatewayNames = "payment_gateway_names" + + case presentmentCurrency = "presentment_currency" + + case subtotalPrice = "subtotal_price" + + case processedAt = "processed_at" + + case orderNumber = "order_number" + + case totalTipReceived = "total_tip_received" + + case id + + case confirmed + + case currency + + case totalLineItemsPrice = "total_line_items_price" + + case lineItems = "line_items" + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case totalWeight = "total_weight" + + case billingAddress = "billing_address" + + case totalShippingPriceSet = "total_shipping_price_set" + + case customer + + case totalDiscounts = "total_discounts" + + case totalLineItemsPriceSet = "total_line_items_price_set" + + case tags + + case totalPriceUsd = "total_price_usd" + + case userId = "user_id" + + case totalTax = "total_tax" + + case processingMethod = "processing_method" + + case shippingAddress = "shipping_address" + + case taxesIncluded = "taxes_included" + + case financialStatus = "financial_status" + } + + public init(adminGraphqlApiId: String?, appId: Int?, billingAddress: BillingAddress?, buyerAcceptsMarketing: Bool?, confirmed: Bool?, contactEmail: String?, createdAt: String?, currency: String?, customer: Customer?, email: String?, financialStatus: String?, gateway: String?, id: Int?, lineItems: LineItems?, name: String?, note: String?, number: Int?, orderNumber: Int?, orderStatusUrl: String?, paymentGatewayNames: [[String: Any]]?, presentmentCurrency: String?, processedAt: String?, processingMethod: String?, shippingAddress: OrderShippingAddress?, sourceName: String?, subtotalPrice: String?, subtotalPriceSet: SubtotalPriceSet?, tags: String?, taxesIncluded: Bool?, test: Bool?, token: String?, totalDiscounts: String?, totalDiscountsSet: TotalDiscountsSet?, totalLineItemsPrice: String?, totalLineItemsPriceSet: TotalLineItemsPriceSet?, totalPrice: String?, totalPriceSet: TotalPriceSet?, totalPriceUsd: String?, totalShippingPriceSet: TotalShippingPriceSet?, totalTax: String?, totalTaxSet: TotalTaxSet?, totalTipReceived: String?, totalWeight: Int?, updatedAt: String?, userId: Int?) { + self.orderStatusUrl = orderStatusUrl + + self.adminGraphqlApiId = adminGraphqlApiId + + self.email = email + + self.test = test + + self.note = note + + self.totalPrice = totalPrice + + self.appId = appId + + self.totalDiscountsSet = totalDiscountsSet + + self.totalPriceSet = totalPriceSet + + self.totalTaxSet = totalTaxSet + + self.gateway = gateway + + self.name = name + + self.subtotalPriceSet = subtotalPriceSet + + self.number = number + + self.buyerAcceptsMarketing = buyerAcceptsMarketing + + self.contactEmail = contactEmail + + self.token = token + + self.sourceName = sourceName + + self.paymentGatewayNames = paymentGatewayNames + + self.presentmentCurrency = presentmentCurrency + + self.subtotalPrice = subtotalPrice + + self.processedAt = processedAt + + self.orderNumber = orderNumber + + self.totalTipReceived = totalTipReceived + + self.id = id + + self.confirmed = confirmed + + self.currency = currency + + self.totalLineItemsPrice = totalLineItemsPrice + + self.lineItems = lineItems + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.totalWeight = totalWeight + + self.billingAddress = billingAddress + + self.totalShippingPriceSet = totalShippingPriceSet + + self.customer = customer + + self.totalDiscounts = totalDiscounts + + self.totalLineItemsPriceSet = totalLineItemsPriceSet + + self.tags = tags + + self.totalPriceUsd = totalPriceUsd + + self.userId = userId + + self.totalTax = totalTax + + self.processingMethod = processingMethod + + self.shippingAddress = shippingAddress + + self.taxesIncluded = taxesIncluded + + self.financialStatus = financialStatus + } + + public func duplicate() -> MarketplaceOrder { + let dict = self.dictionary! + let copy = MarketplaceOrder(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + orderStatusUrl = try container.decode(String.self, forKey: .orderStatusUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + adminGraphqlApiId = try container.decode(String.self, forKey: .adminGraphqlApiId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + test = try container.decode(Bool.self, forKey: .test) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + note = try container.decode(String.self, forKey: .note) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalPrice = try container.decode(String.self, forKey: .totalPrice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appId = try container.decode(Int.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalDiscountsSet = try container.decode(TotalDiscountsSet.self, forKey: .totalDiscountsSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalPriceSet = try container.decode(TotalPriceSet.self, forKey: .totalPriceSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalTaxSet = try container.decode(TotalTaxSet.self, forKey: .totalTaxSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gateway = try container.decode(String.self, forKey: .gateway) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subtotalPriceSet = try container.decode(SubtotalPriceSet.self, forKey: .subtotalPriceSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + number = try container.decode(Int.self, forKey: .number) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + buyerAcceptsMarketing = try container.decode(Bool.self, forKey: .buyerAcceptsMarketing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contactEmail = try container.decode(String.self, forKey: .contactEmail) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + token = try container.decode(String.self, forKey: .token) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sourceName = try container.decode(String.self, forKey: .sourceName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentGatewayNames = try container.decode([[String: Any]].self, forKey: .paymentGatewayNames) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + presentmentCurrency = try container.decode(String.self, forKey: .presentmentCurrency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subtotalPrice = try container.decode(String.self, forKey: .subtotalPrice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + processedAt = try container.decode(String.self, forKey: .processedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderNumber = try container.decode(Int.self, forKey: .orderNumber) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalTipReceived = try container.decode(String.self, forKey: .totalTipReceived) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + confirmed = try container.decode(Bool.self, forKey: .confirmed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalLineItemsPrice = try container.decode(String.self, forKey: .totalLineItemsPrice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lineItems = try container.decode(LineItems.self, forKey: .lineItems) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalWeight = try container.decode(Int.self, forKey: .totalWeight) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + billingAddress = try container.decode(BillingAddress.self, forKey: .billingAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalShippingPriceSet = try container.decode(TotalShippingPriceSet.self, forKey: .totalShippingPriceSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customer = try container.decode(Customer.self, forKey: .customer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalDiscounts = try container.decode(String.self, forKey: .totalDiscounts) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalLineItemsPriceSet = try container.decode(TotalLineItemsPriceSet.self, forKey: .totalLineItemsPriceSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode(String.self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalPriceUsd = try container.decode(String.self, forKey: .totalPriceUsd) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userId = try container.decode(Int.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalTax = try container.decode(String.self, forKey: .totalTax) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + processingMethod = try container.decode(String.self, forKey: .processingMethod) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shippingAddress = try container.decode(OrderShippingAddress.self, forKey: .shippingAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + taxesIncluded = try container.decode(Bool.self, forKey: .taxesIncluded) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + financialStatus = try container.decode(String.self, forKey: .financialStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(orderStatusUrl, forKey: .orderStatusUrl) + + try? container.encodeIfPresent(adminGraphqlApiId, forKey: .adminGraphqlApiId) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(test, forKey: .test) + + try? container.encodeIfPresent(note, forKey: .note) + + try? container.encodeIfPresent(totalPrice, forKey: .totalPrice) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(totalDiscountsSet, forKey: .totalDiscountsSet) + + try? container.encodeIfPresent(totalPriceSet, forKey: .totalPriceSet) + + try? container.encodeIfPresent(totalTaxSet, forKey: .totalTaxSet) + + try? container.encodeIfPresent(gateway, forKey: .gateway) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(subtotalPriceSet, forKey: .subtotalPriceSet) + + try? container.encodeIfPresent(number, forKey: .number) + + try? container.encodeIfPresent(buyerAcceptsMarketing, forKey: .buyerAcceptsMarketing) + + try? container.encodeIfPresent(contactEmail, forKey: .contactEmail) + + try? container.encodeIfPresent(token, forKey: .token) + + try? container.encodeIfPresent(sourceName, forKey: .sourceName) + + try? container.encodeIfPresent(paymentGatewayNames, forKey: .paymentGatewayNames) + + try? container.encodeIfPresent(presentmentCurrency, forKey: .presentmentCurrency) + + try? container.encodeIfPresent(subtotalPrice, forKey: .subtotalPrice) + + try? container.encodeIfPresent(processedAt, forKey: .processedAt) + + try? container.encodeIfPresent(orderNumber, forKey: .orderNumber) + + try? container.encodeIfPresent(totalTipReceived, forKey: .totalTipReceived) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(confirmed, forKey: .confirmed) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(totalLineItemsPrice, forKey: .totalLineItemsPrice) + + try? container.encodeIfPresent(lineItems, forKey: .lineItems) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(totalWeight, forKey: .totalWeight) + + try? container.encodeIfPresent(billingAddress, forKey: .billingAddress) + + try? container.encodeIfPresent(totalShippingPriceSet, forKey: .totalShippingPriceSet) + + try? container.encodeIfPresent(customer, forKey: .customer) + + try? container.encodeIfPresent(totalDiscounts, forKey: .totalDiscounts) + + try? container.encodeIfPresent(totalLineItemsPriceSet, forKey: .totalLineItemsPriceSet) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(totalPriceUsd, forKey: .totalPriceUsd) + + try? container.encodeIfPresent(userId, forKey: .userId) + + try? container.encodeIfPresent(totalTax, forKey: .totalTax) + + try? container.encodeIfPresent(processingMethod, forKey: .processingMethod) + + try? container.encodeIfPresent(shippingAddress, forKey: .shippingAddress) + + try? container.encodeIfPresent(taxesIncluded, forKey: .taxesIncluded) + + try? container.encodeIfPresent(financialStatus, forKey: .financialStatus) + } + } + + /* + Model: TotalDiscountsSet + Used By: Order + */ + + class TotalDiscountsSet: Codable { + public var presentmentMoney: PresentmentMoney? + + public var shopMoney: ShopMoney? + + public enum CodingKeys: String, CodingKey { + case presentmentMoney = "presentment_money" + + case shopMoney = "shop_money" + } + + public init(presentmentMoney: PresentmentMoney?, shopMoney: ShopMoney?) { + self.presentmentMoney = presentmentMoney + + self.shopMoney = shopMoney + } + + public func duplicate() -> TotalDiscountsSet { + let dict = self.dictionary! + let copy = TotalDiscountsSet(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + presentmentMoney = try container.decode(PresentmentMoney.self, forKey: .presentmentMoney) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shopMoney = try container.decode(ShopMoney.self, forKey: .shopMoney) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(presentmentMoney, forKey: .presentmentMoney) + + try? container.encodeIfPresent(shopMoney, forKey: .shopMoney) + } + } + + /* + Model: PresentmentMoney + Used By: Order + */ + + class PresentmentMoney: Codable { + public var amount: String? + + public var currencyCode: String? + + public enum CodingKeys: String, CodingKey { + case amount + + case currencyCode = "currency_code" + } + + public init(amount: String?, currencyCode: String?) { + self.amount = amount + + self.currencyCode = currencyCode + } + + public func duplicate() -> PresentmentMoney { + let dict = self.dictionary! + let copy = PresentmentMoney(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + amount = try container.decode(String.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + } + } + + /* + Model: ShopMoney + Used By: Order + */ + + class ShopMoney: Codable { + public var amount: String? + + public var currencyCode: String? + + public enum CodingKeys: String, CodingKey { + case amount + + case currencyCode = "currency_code" + } + + public init(amount: String?, currencyCode: String?) { + self.amount = amount + + self.currencyCode = currencyCode + } + + public func duplicate() -> ShopMoney { + let dict = self.dictionary! + let copy = ShopMoney(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + amount = try container.decode(String.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + } + } + + /* + Model: TotalPriceSet + Used By: Order + */ + + class TotalPriceSet: Codable { + public var shopMoney: TotalPriceSetShopMoney? + + public var presentmentMoney: TotalPriceSetPresentmentMoney? + + public enum CodingKeys: String, CodingKey { + case shopMoney = "shop_money" + + case presentmentMoney = "presentment_money" + } + + public init(presentmentMoney: TotalPriceSetPresentmentMoney?, shopMoney: TotalPriceSetShopMoney?) { + self.shopMoney = shopMoney + + self.presentmentMoney = presentmentMoney + } + + public func duplicate() -> TotalPriceSet { + let dict = self.dictionary! + let copy = TotalPriceSet(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + shopMoney = try container.decode(TotalPriceSetShopMoney.self, forKey: .shopMoney) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + presentmentMoney = try container.decode(TotalPriceSetPresentmentMoney.self, forKey: .presentmentMoney) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(shopMoney, forKey: .shopMoney) + + try? container.encodeIfPresent(presentmentMoney, forKey: .presentmentMoney) + } + } + + /* + Model: TotalPriceSetShopMoney + Used By: Order + */ + + class TotalPriceSetShopMoney: Codable { + public var amount: String? + + public var currencyCode: String? + + public enum CodingKeys: String, CodingKey { + case amount + + case currencyCode = "currency_code" + } + + public init(amount: String?, currencyCode: String?) { + self.amount = amount + + self.currencyCode = currencyCode + } + + public func duplicate() -> TotalPriceSetShopMoney { + let dict = self.dictionary! + let copy = TotalPriceSetShopMoney(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + amount = try container.decode(String.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + } + } + + /* + Model: TotalPriceSetPresentmentMoney + Used By: Order + */ + + class TotalPriceSetPresentmentMoney: Codable { + public var amount: String? + + public var currencyCode: String? + + public enum CodingKeys: String, CodingKey { + case amount + + case currencyCode = "currency_code" + } + + public init(amount: String?, currencyCode: String?) { + self.amount = amount + + self.currencyCode = currencyCode + } + + public func duplicate() -> TotalPriceSetPresentmentMoney { + let dict = self.dictionary! + let copy = TotalPriceSetPresentmentMoney(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + amount = try container.decode(String.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + } + } + + /* + Model: TotalTaxSet + Used By: Order + */ + + class TotalTaxSet: Codable { + public var shopMoney: TotalTaxSetShopMoney? + + public var presentmentMoney: TotalTaxSetPresentmentMoney? + + public enum CodingKeys: String, CodingKey { + case shopMoney = "shop_money" + + case presentmentMoney = "presentment_money" + } + + public init(presentmentMoney: TotalTaxSetPresentmentMoney?, shopMoney: TotalTaxSetShopMoney?) { + self.shopMoney = shopMoney + + self.presentmentMoney = presentmentMoney + } + + public func duplicate() -> TotalTaxSet { + let dict = self.dictionary! + let copy = TotalTaxSet(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + shopMoney = try container.decode(TotalTaxSetShopMoney.self, forKey: .shopMoney) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + presentmentMoney = try container.decode(TotalTaxSetPresentmentMoney.self, forKey: .presentmentMoney) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(shopMoney, forKey: .shopMoney) + + try? container.encodeIfPresent(presentmentMoney, forKey: .presentmentMoney) + } + } + + /* + Model: TotalTaxSetShopMoney + Used By: Order + */ + + class TotalTaxSetShopMoney: Codable { + public var amount: String? + + public var currencyCode: String? + + public enum CodingKeys: String, CodingKey { + case amount + + case currencyCode = "currency_code" + } + + public init(amount: String?, currencyCode: String?) { + self.amount = amount + + self.currencyCode = currencyCode + } + + public func duplicate() -> TotalTaxSetShopMoney { + let dict = self.dictionary! + let copy = TotalTaxSetShopMoney(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + amount = try container.decode(String.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + } + } + + /* + Model: TotalTaxSetPresentmentMoney + Used By: Order + */ + + class TotalTaxSetPresentmentMoney: Codable { + public var amount: String? + + public var currencyCode: String? + + public enum CodingKeys: String, CodingKey { + case amount + + case currencyCode = "currency_code" + } + + public init(amount: String?, currencyCode: String?) { + self.amount = amount + + self.currencyCode = currencyCode + } + + public func duplicate() -> TotalTaxSetPresentmentMoney { + let dict = self.dictionary! + let copy = TotalTaxSetPresentmentMoney(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + amount = try container.decode(String.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + } + } + + /* + Model: SubtotalPriceSet + Used By: Order + */ + + class SubtotalPriceSet: Codable { + public var shopMoney: SubtotalPriceSetShopMoney? + + public var presentmentMoney: SubtotalPriceSetPresentmentMoney? + + public enum CodingKeys: String, CodingKey { + case shopMoney = "shop_money" + + case presentmentMoney = "presentment_money" + } + + public init(presentmentMoney: SubtotalPriceSetPresentmentMoney?, shopMoney: SubtotalPriceSetShopMoney?) { + self.shopMoney = shopMoney + + self.presentmentMoney = presentmentMoney + } + + public func duplicate() -> SubtotalPriceSet { + let dict = self.dictionary! + let copy = SubtotalPriceSet(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + shopMoney = try container.decode(SubtotalPriceSetShopMoney.self, forKey: .shopMoney) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + presentmentMoney = try container.decode(SubtotalPriceSetPresentmentMoney.self, forKey: .presentmentMoney) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(shopMoney, forKey: .shopMoney) + + try? container.encodeIfPresent(presentmentMoney, forKey: .presentmentMoney) + } + } + + /* + Model: SubtotalPriceSetShopMoney + Used By: Order + */ + + class SubtotalPriceSetShopMoney: Codable { + public var amount: String? + + public var currencyCode: String? + + public enum CodingKeys: String, CodingKey { + case amount + + case currencyCode = "currency_code" + } + + public init(amount: String?, currencyCode: String?) { + self.amount = amount + + self.currencyCode = currencyCode + } + + public func duplicate() -> SubtotalPriceSetShopMoney { + let dict = self.dictionary! + let copy = SubtotalPriceSetShopMoney(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + amount = try container.decode(String.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + } + } + + /* + Model: SubtotalPriceSetPresentmentMoney + Used By: Order + */ + + class SubtotalPriceSetPresentmentMoney: Codable { + public var amount: String? + + public var currencyCode: String? + + public enum CodingKeys: String, CodingKey { + case amount + + case currencyCode = "currency_code" + } + + public init(amount: String?, currencyCode: String?) { + self.amount = amount + + self.currencyCode = currencyCode + } + + public func duplicate() -> SubtotalPriceSetPresentmentMoney { + let dict = self.dictionary! + let copy = SubtotalPriceSetPresentmentMoney(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + amount = try container.decode(String.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + } + } + + /* + Model: LineItems + Used By: Order + */ + + class LineItems: Codable { + public var sku: String? + + public var fulfillableQuantity: Int? + + public var grams: Int? + + public var totalDiscount: String? + + public var article: LineItemsArticle? + + public var title: String? + + public var variantInventoryManagement: String? + + public var id: Int? + + public var variantId: Int? + + public var variantTitle: String? + + public var productExists: Bool? + + public var price: String? + + public var adminGraphqlApiId: String? + + public var quantity: Int? + + public var vendor: String? + + public var fulfillmentService: String? + + public var taxable: Bool? + + public var name: String? + + public var productId: Int? + + public var priceSet: PriceSet? + + public var taxLines: TaxLines? + + public var requiresShipping: Bool? + + public var giftCard: Bool? + + public var totalDiscountSet: TotalDiscountSet? + + public enum CodingKeys: String, CodingKey { + case sku + + case fulfillableQuantity = "fulfillable_quantity" + + case grams + + case totalDiscount = "total_discount" + + case article + + case title + + case variantInventoryManagement = "variant_inventory_management" + + case id + + case variantId = "variant_id" + + case variantTitle = "variant_title" + + case productExists = "product_exists" + + case price + + case adminGraphqlApiId = "admin_graphql_api_id" + + case quantity + + case vendor + + case fulfillmentService = "fulfillment_service" + + case taxable + + case name + + case productId = "product_id" + + case priceSet = "price_set" + + case taxLines = "tax_lines" + + case requiresShipping = "requires_shipping" + + case giftCard = "gift_card" + + case totalDiscountSet = "total_discount_set" + } + + public init(adminGraphqlApiId: String?, article: LineItemsArticle?, fulfillableQuantity: Int?, fulfillmentService: String?, giftCard: Bool?, grams: Int?, id: Int?, name: String?, price: String?, priceSet: PriceSet?, productExists: Bool?, productId: Int?, quantity: Int?, requiresShipping: Bool?, sku: String?, taxable: Bool?, taxLines: TaxLines?, title: String?, totalDiscount: String?, totalDiscountSet: TotalDiscountSet?, variantId: Int?, variantInventoryManagement: String?, variantTitle: String?, vendor: String?) { + self.sku = sku + + self.fulfillableQuantity = fulfillableQuantity + + self.grams = grams + + self.totalDiscount = totalDiscount + + self.article = article + + self.title = title + + self.variantInventoryManagement = variantInventoryManagement + + self.id = id + + self.variantId = variantId + + self.variantTitle = variantTitle + + self.productExists = productExists + + self.price = price + + self.adminGraphqlApiId = adminGraphqlApiId + + self.quantity = quantity + + self.vendor = vendor + + self.fulfillmentService = fulfillmentService + + self.taxable = taxable + + self.name = name + + self.productId = productId + + self.priceSet = priceSet + + self.taxLines = taxLines + + self.requiresShipping = requiresShipping + + self.giftCard = giftCard + + self.totalDiscountSet = totalDiscountSet + } + + public func duplicate() -> LineItems { + let dict = self.dictionary! + let copy = LineItems(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + sku = try container.decode(String.self, forKey: .sku) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fulfillableQuantity = try container.decode(Int.self, forKey: .fulfillableQuantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + grams = try container.decode(Int.self, forKey: .grams) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalDiscount = try container.decode(String.self, forKey: .totalDiscount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + article = try container.decode(LineItemsArticle.self, forKey: .article) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + variantInventoryManagement = try container.decode(String.self, forKey: .variantInventoryManagement) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + variantId = try container.decode(Int.self, forKey: .variantId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + variantTitle = try container.decode(String.self, forKey: .variantTitle) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productExists = try container.decode(Bool.self, forKey: .productExists) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(String.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + adminGraphqlApiId = try container.decode(String.self, forKey: .adminGraphqlApiId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + vendor = try container.decode(String.self, forKey: .vendor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fulfillmentService = try container.decode(String.self, forKey: .fulfillmentService) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + taxable = try container.decode(Bool.self, forKey: .taxable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productId = try container.decode(Int.self, forKey: .productId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priceSet = try container.decode(PriceSet.self, forKey: .priceSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + taxLines = try container.decode(TaxLines.self, forKey: .taxLines) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requiresShipping = try container.decode(Bool.self, forKey: .requiresShipping) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + giftCard = try container.decode(Bool.self, forKey: .giftCard) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalDiscountSet = try container.decode(TotalDiscountSet.self, forKey: .totalDiscountSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(sku, forKey: .sku) + + try? container.encodeIfPresent(fulfillableQuantity, forKey: .fulfillableQuantity) + + try? container.encodeIfPresent(grams, forKey: .grams) + + try? container.encodeIfPresent(totalDiscount, forKey: .totalDiscount) + + try? container.encodeIfPresent(article, forKey: .article) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(variantInventoryManagement, forKey: .variantInventoryManagement) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(variantId, forKey: .variantId) + + try? container.encodeIfPresent(variantTitle, forKey: .variantTitle) + + try? container.encodeIfPresent(productExists, forKey: .productExists) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(adminGraphqlApiId, forKey: .adminGraphqlApiId) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(vendor, forKey: .vendor) + + try? container.encodeIfPresent(fulfillmentService, forKey: .fulfillmentService) + + try? container.encodeIfPresent(taxable, forKey: .taxable) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(productId, forKey: .productId) + + try? container.encodeIfPresent(priceSet, forKey: .priceSet) + + try? container.encodeIfPresent(taxLines, forKey: .taxLines) + + try? container.encodeIfPresent(requiresShipping, forKey: .requiresShipping) + + try? container.encodeIfPresent(giftCard, forKey: .giftCard) + + try? container.encodeIfPresent(totalDiscountSet, forKey: .totalDiscountSet) + } + } + + /* + Model: LineItemsArticle + Used By: Order + */ + + class LineItemsArticle: Codable { + public var quantities: Quantities? + + public var oldArticleUid: String? + + public var totalQuantity: Int? + + public var manufacturer: Manufacturer? + + public var price: ArticlePrice? + + public var trackInventory: Bool? + + public var company: Company? + + public var isActive: Bool? + + public var dateMeta: FailOrderDateMeta? + + public var fragile: Bool? + + public var marketplaceIdentifiers: MarketplaceIdentifiers? + + public var size: String? + + public var isSet: Bool? + + public var dimension: Dimension? + + public var weight: Weight? + + public var store: Store? + + public var meta: ArticleMeta? + + public var uid: String? + + public var brand: ArticleBrand? + + public var itemId: Int? + + public var fyndArticleCode: String? + + public var id: String? + + public var identifier: LineItemsArticleIdentifier? + + public var sellerIdentifier: String? + + public var fyndItemCode: String? + + public var countryOfOrigin: String? + + public enum CodingKeys: String, CodingKey { + case quantities + + case oldArticleUid = "old_article_uid" + + case totalQuantity = "total_quantity" + + case manufacturer + + case price + + case trackInventory = "track_inventory" + + case company + + case isActive = "is_active" + + case dateMeta = "date_meta" + + case fragile + + case marketplaceIdentifiers = "marketplace_identifiers" + + case size + + case isSet = "is_set" + + case dimension + + case weight + + case store + + case meta + + case uid + + case brand + + case itemId = "item_id" + + case fyndArticleCode = "fynd_article_code" + + case id = "_id" + + case identifier + + case sellerIdentifier = "seller_identifier" + + case fyndItemCode = "fynd_item_code" + + case countryOfOrigin = "country_of_origin" + } + + public init(brand: ArticleBrand?, company: Company?, countryOfOrigin: String?, dateMeta: FailOrderDateMeta?, dimension: Dimension?, fragile: Bool?, fyndArticleCode: String?, fyndItemCode: String?, identifier: LineItemsArticleIdentifier?, isActive: Bool?, isSet: Bool?, itemId: Int?, manufacturer: Manufacturer?, marketplaceIdentifiers: MarketplaceIdentifiers?, meta: ArticleMeta?, oldArticleUid: String?, price: ArticlePrice?, quantities: Quantities?, sellerIdentifier: String?, size: String?, store: Store?, totalQuantity: Int?, trackInventory: Bool?, uid: String?, weight: Weight?, id: String?) { + self.quantities = quantities + + self.oldArticleUid = oldArticleUid + + self.totalQuantity = totalQuantity + + self.manufacturer = manufacturer + + self.price = price + + self.trackInventory = trackInventory + + self.company = company + + self.isActive = isActive + + self.dateMeta = dateMeta + + self.fragile = fragile + + self.marketplaceIdentifiers = marketplaceIdentifiers + + self.size = size + + self.isSet = isSet + + self.dimension = dimension + + self.weight = weight + + self.store = store + + self.meta = meta + + self.uid = uid + + self.brand = brand + + self.itemId = itemId + + self.fyndArticleCode = fyndArticleCode + + self.id = id + + self.identifier = identifier + + self.sellerIdentifier = sellerIdentifier + + self.fyndItemCode = fyndItemCode + + self.countryOfOrigin = countryOfOrigin + } + + public func duplicate() -> LineItemsArticle { + let dict = self.dictionary! + let copy = LineItemsArticle(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + quantities = try container.decode(Quantities.self, forKey: .quantities) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + oldArticleUid = try container.decode(String.self, forKey: .oldArticleUid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalQuantity = try container.decode(Int.self, forKey: .totalQuantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + manufacturer = try container.decode(Manufacturer.self, forKey: .manufacturer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(ArticlePrice.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + trackInventory = try container.decode(Bool.self, forKey: .trackInventory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + company = try container.decode(Company.self, forKey: .company) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dateMeta = try container.decode(FailOrderDateMeta.self, forKey: .dateMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fragile = try container.decode(Bool.self, forKey: .fragile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + marketplaceIdentifiers = try container.decode(MarketplaceIdentifiers.self, forKey: .marketplaceIdentifiers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(String.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isSet = try container.decode(Bool.self, forKey: .isSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dimension = try container.decode(Dimension.self, forKey: .dimension) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + weight = try container.decode(Weight.self, forKey: .weight) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + store = try container.decode(Store.self, forKey: .store) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode(ArticleMeta.self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brand = try container.decode(ArticleBrand.self, forKey: .brand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemId = try container.decode(Int.self, forKey: .itemId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fyndArticleCode = try container.decode(String.self, forKey: .fyndArticleCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + identifier = try container.decode(LineItemsArticleIdentifier.self, forKey: .identifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sellerIdentifier = try container.decode(String.self, forKey: .sellerIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fyndItemCode = try container.decode(String.self, forKey: .fyndItemCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryOfOrigin = try container.decode(String.self, forKey: .countryOfOrigin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(quantities, forKey: .quantities) + + try? container.encodeIfPresent(oldArticleUid, forKey: .oldArticleUid) + + try? container.encodeIfPresent(totalQuantity, forKey: .totalQuantity) + + try? container.encodeIfPresent(manufacturer, forKey: .manufacturer) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(trackInventory, forKey: .trackInventory) + + try? container.encodeIfPresent(company, forKey: .company) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(dateMeta, forKey: .dateMeta) + + try? container.encodeIfPresent(fragile, forKey: .fragile) + + try? container.encodeIfPresent(marketplaceIdentifiers, forKey: .marketplaceIdentifiers) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(isSet, forKey: .isSet) + + try? container.encodeIfPresent(dimension, forKey: .dimension) + + try? container.encodeIfPresent(weight, forKey: .weight) + + try? container.encodeIfPresent(store, forKey: .store) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(brand, forKey: .brand) + + try? container.encodeIfPresent(itemId, forKey: .itemId) + + try? container.encodeIfPresent(fyndArticleCode, forKey: .fyndArticleCode) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(identifier, forKey: .identifier) + + try? container.encodeIfPresent(sellerIdentifier, forKey: .sellerIdentifier) + + try? container.encodeIfPresent(fyndItemCode, forKey: .fyndItemCode) + + try? container.encodeIfPresent(countryOfOrigin, forKey: .countryOfOrigin) + } + } + + /* + Model: Quantities + Used By: Order + */ + + class Quantities: Codable { + public var notAvailable: NotAvailable? + + public var sellable: Sellable? + + public var orderCommitted: OrderCommitted? + + public var damaged: Damaged? + + public enum CodingKeys: String, CodingKey { + case notAvailable = "not_available" + + case sellable + + case orderCommitted = "order_committed" + + case damaged + } + + public init(damaged: Damaged?, notAvailable: NotAvailable?, orderCommitted: OrderCommitted?, sellable: Sellable?) { + self.notAvailable = notAvailable + + self.sellable = sellable + + self.orderCommitted = orderCommitted + + self.damaged = damaged + } + + public func duplicate() -> Quantities { + let dict = self.dictionary! + let copy = Quantities(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + notAvailable = try container.decode(NotAvailable.self, forKey: .notAvailable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sellable = try container.decode(Sellable.self, forKey: .sellable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderCommitted = try container.decode(OrderCommitted.self, forKey: .orderCommitted) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + damaged = try container.decode(Damaged.self, forKey: .damaged) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(notAvailable, forKey: .notAvailable) + + try? container.encodeIfPresent(sellable, forKey: .sellable) + + try? container.encodeIfPresent(orderCommitted, forKey: .orderCommitted) + + try? container.encodeIfPresent(damaged, forKey: .damaged) + } + } + + /* + Model: NotAvailable + Used By: Order + */ + + class NotAvailable: Codable { + public var count: Int? + + public var updatedAt: String? + + public enum CodingKeys: String, CodingKey { + case count + + case updatedAt = "updated_at" + } + + public init(count: Int?, updatedAt: String?) { + self.count = count + + self.updatedAt = updatedAt + } + + public func duplicate() -> NotAvailable { + let dict = self.dictionary! + let copy = NotAvailable(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(count, forKey: .count) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + } + } + + /* + Model: Sellable + Used By: Order + */ + + class Sellable: Codable { + public var count: Int? + + public var updatedAt: String? + + public enum CodingKeys: String, CodingKey { + case count + + case updatedAt = "updated_at" + } + + public init(count: Int?, updatedAt: String?) { + self.count = count + + self.updatedAt = updatedAt + } + + public func duplicate() -> Sellable { + let dict = self.dictionary! + let copy = Sellable(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(count, forKey: .count) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + } + } + + /* + Model: OrderCommitted + Used By: Order + */ + + class OrderCommitted: Codable { + public var count: Int? + + public var updatedAt: String? + + public enum CodingKeys: String, CodingKey { + case count + + case updatedAt = "updated_at" + } + + public init(count: Int?, updatedAt: String?) { + self.count = count + + self.updatedAt = updatedAt + } + + public func duplicate() -> OrderCommitted { + let dict = self.dictionary! + let copy = OrderCommitted(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(count, forKey: .count) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + } + } + + /* + Model: Damaged + Used By: Order + */ + + class Damaged: Codable { + public var updatedAt: String? + + public var count: Int? + + public enum CodingKeys: String, CodingKey { + case updatedAt = "updated_at" + + case count + } + + public init(count: Int?, updatedAt: String?) { + self.updatedAt = updatedAt + + self.count = count + } + + public func duplicate() -> Damaged { + let dict = self.dictionary! + let copy = Damaged(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(count, forKey: .count) + } + } + + /* + Model: Manufacturer + Used By: Order + */ + + class Manufacturer: Codable { + public var isDefault: Bool? + + public var address: String? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case isDefault = "is_default" + + case address + + case name + } + + public init(address: String?, isDefault: Bool?, name: String?) { + self.isDefault = isDefault + + self.address = address + + self.name = name + } + + public func duplicate() -> Manufacturer { + let dict = self.dictionary! + let copy = Manufacturer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isDefault = try container.decode(Bool.self, forKey: .isDefault) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address = try container.decode(String.self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isDefault, forKey: .isDefault) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: ArticlePrice + Used By: Order + */ + + class ArticlePrice: Codable { + public var marked: Int? + + public var currency: String? + + public var effective: Int? + + public var transfer: Int? + + public enum CodingKeys: String, CodingKey { + case marked + + case currency + + case effective + + case transfer + } + + public init(currency: String?, effective: Int?, marked: Int?, transfer: Int?) { + self.marked = marked + + self.currency = currency + + self.effective = effective + + self.transfer = transfer + } + + public func duplicate() -> ArticlePrice { + let dict = self.dictionary! + let copy = ArticlePrice(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + marked = try container.decode(Int.self, forKey: .marked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + effective = try container.decode(Int.self, forKey: .effective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + transfer = try container.decode(Int.self, forKey: .transfer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(marked, forKey: .marked) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(effective, forKey: .effective) + + try? container.encodeIfPresent(transfer, forKey: .transfer) + } + } + + /* + Model: Company + Used By: Order + */ + + class Company: Codable { + public var id: Int? + + public var companyType: String? + + public var businessType: String? + + public var companyName: String? + + public var createdOn: String? + + public var panNo: String? + + public var returnAllowed: Bool? + + public var meta: String? + + public var exchangeAllowed: Bool? + + public var agreementStartDate: String? + + public var exchangeWithinDays: Int? + + public var paymentProcesingCharge: Int? + + public var fyndAFitAvailable: Bool? + + public var modifiedOn: String? + + public var returnWithinDays: Int? + + public enum CodingKeys: String, CodingKey { + case id + + case companyType = "company_type" + + case businessType = "business_type" + + case companyName = "company_name" + + case createdOn = "created_on" + + case panNo = "pan_no" + + case returnAllowed = "return_allowed" + + case meta + + case exchangeAllowed = "exchange_allowed" + + case agreementStartDate = "agreement_start_date" + + case exchangeWithinDays = "exchange_within_days" + + case paymentProcesingCharge = "payment_procesing_charge" + + case fyndAFitAvailable = "fynd_a_fit_available" + + case modifiedOn = "modified_on" + + case returnWithinDays = "return_within_days" + } + + public init(agreementStartDate: String?, businessType: String?, companyName: String?, companyType: String?, createdOn: String?, exchangeAllowed: Bool?, exchangeWithinDays: Int?, fyndAFitAvailable: Bool?, id: Int?, meta: String?, modifiedOn: String?, panNo: String?, paymentProcesingCharge: Int?, returnAllowed: Bool?, returnWithinDays: Int?) { + self.id = id + + self.companyType = companyType + + self.businessType = businessType + + self.companyName = companyName + + self.createdOn = createdOn + + self.panNo = panNo + + self.returnAllowed = returnAllowed + + self.meta = meta + + self.exchangeAllowed = exchangeAllowed + + self.agreementStartDate = agreementStartDate + + self.exchangeWithinDays = exchangeWithinDays + + self.paymentProcesingCharge = paymentProcesingCharge + + self.fyndAFitAvailable = fyndAFitAvailable + + self.modifiedOn = modifiedOn + + self.returnWithinDays = returnWithinDays + } + + public func duplicate() -> Company { + let dict = self.dictionary! + let copy = Company(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyType = try container.decode(String.self, forKey: .companyType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + businessType = try container.decode(String.self, forKey: .businessType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyName = try container.decode(String.self, forKey: .companyName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + panNo = try container.decode(String.self, forKey: .panNo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + returnAllowed = try container.decode(Bool.self, forKey: .returnAllowed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode(String.self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + exchangeAllowed = try container.decode(Bool.self, forKey: .exchangeAllowed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + agreementStartDate = try container.decode(String.self, forKey: .agreementStartDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + exchangeWithinDays = try container.decode(Int.self, forKey: .exchangeWithinDays) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentProcesingCharge = try container.decode(Int.self, forKey: .paymentProcesingCharge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fyndAFitAvailable = try container.decode(Bool.self, forKey: .fyndAFitAvailable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + returnWithinDays = try container.decode(Int.self, forKey: .returnWithinDays) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(companyType, forKey: .companyType) + + try? container.encodeIfPresent(businessType, forKey: .businessType) + + try? container.encodeIfPresent(companyName, forKey: .companyName) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(panNo, forKey: .panNo) + + try? container.encodeIfPresent(returnAllowed, forKey: .returnAllowed) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(exchangeAllowed, forKey: .exchangeAllowed) + + try? container.encodeIfPresent(agreementStartDate, forKey: .agreementStartDate) + + try? container.encodeIfPresent(exchangeWithinDays, forKey: .exchangeWithinDays) + + try? container.encodeIfPresent(paymentProcesingCharge, forKey: .paymentProcesingCharge) + + try? container.encodeIfPresent(fyndAFitAvailable, forKey: .fyndAFitAvailable) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(returnWithinDays, forKey: .returnWithinDays) + } + } + + /* + Model: FailOrderDateMeta + Used By: Order + */ + + class FailOrderDateMeta: Codable { + public var addedOnStore: String? + + public var inventoryUpdatedOn: String? + + public var createdOn: String? + + public var modifiedOn: String? + + public enum CodingKeys: String, CodingKey { + case addedOnStore = "added_on_store" + + case inventoryUpdatedOn = "inventory_updated_on" + + case createdOn = "created_on" + + case modifiedOn = "modified_on" + } + + public init(addedOnStore: String?, createdOn: String?, inventoryUpdatedOn: String?, modifiedOn: String?) { + self.addedOnStore = addedOnStore + + self.inventoryUpdatedOn = inventoryUpdatedOn + + self.createdOn = createdOn + + self.modifiedOn = modifiedOn + } + + public func duplicate() -> FailOrderDateMeta { + let dict = self.dictionary! + let copy = FailOrderDateMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + addedOnStore = try container.decode(String.self, forKey: .addedOnStore) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + inventoryUpdatedOn = try container.decode(String.self, forKey: .inventoryUpdatedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(addedOnStore, forKey: .addedOnStore) + + try? container.encodeIfPresent(inventoryUpdatedOn, forKey: .inventoryUpdatedOn) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + } + } + + /* + Model: MarketplaceIdentifiers + Used By: Order + */ + + class MarketplaceIdentifiers: Codable { + public var tatacliqLuxury: TatacliqLuxury? + + public enum CodingKeys: String, CodingKey { + case tatacliqLuxury = "tatacliq_luxury" + } + + public init(tatacliqLuxury: TatacliqLuxury?) { + self.tatacliqLuxury = tatacliqLuxury + } + + public func duplicate() -> MarketplaceIdentifiers { + let dict = self.dictionary! + let copy = MarketplaceIdentifiers(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + tatacliqLuxury = try container.decode(TatacliqLuxury.self, forKey: .tatacliqLuxury) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(tatacliqLuxury, forKey: .tatacliqLuxury) + } + } + + /* + Model: TatacliqLuxury + Used By: Order + */ + + class TatacliqLuxury: Codable { + public var sku: String? + + public enum CodingKeys: String, CodingKey { + case sku + } + + public init(sku: String?) { + self.sku = sku + } + + public func duplicate() -> TatacliqLuxury { + let dict = self.dictionary! + let copy = TatacliqLuxury(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + sku = try container.decode(String.self, forKey: .sku) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(sku, forKey: .sku) + } + } + + /* + Model: Dimension + Used By: Order + */ + + class Dimension: Codable { + public var height: Int? + + public var width: Int? + + public var unit: String? + + public var length: Int? + + public var isDefault: Bool? + + public enum CodingKeys: String, CodingKey { + case height + + case width + + case unit + + case length + + case isDefault = "is_default" + } + + public init(height: Int?, isDefault: Bool?, length: Int?, unit: String?, width: Int?) { + self.height = height + + self.width = width + + self.unit = unit + + self.length = length + + self.isDefault = isDefault + } + + public func duplicate() -> Dimension { + let dict = self.dictionary! + let copy = Dimension(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + height = try container.decode(Int.self, forKey: .height) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + width = try container.decode(Int.self, forKey: .width) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + unit = try container.decode(String.self, forKey: .unit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + length = try container.decode(Int.self, forKey: .length) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isDefault = try container.decode(Bool.self, forKey: .isDefault) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(height, forKey: .height) + + try? container.encodeIfPresent(width, forKey: .width) + + try? container.encodeIfPresent(unit, forKey: .unit) + + try? container.encodeIfPresent(length, forKey: .length) + + try? container.encodeIfPresent(isDefault, forKey: .isDefault) + } + } + + /* + Model: Weight + Used By: Order + */ + + class Weight: Codable { + public var isDefault: Bool? + + public var unit: String? + + public var shipping: Int? + + public enum CodingKeys: String, CodingKey { + case isDefault = "is_default" + + case unit + + case shipping + } + + public init(isDefault: Bool?, shipping: Int?, unit: String?) { + self.isDefault = isDefault + + self.unit = unit + + self.shipping = shipping + } + + public func duplicate() -> Weight { + let dict = self.dictionary! + let copy = Weight(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isDefault = try container.decode(Bool.self, forKey: .isDefault) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + unit = try container.decode(String.self, forKey: .unit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shipping = try container.decode(Int.self, forKey: .shipping) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isDefault, forKey: .isDefault) + + try? container.encodeIfPresent(unit, forKey: .unit) + + try? container.encodeIfPresent(shipping, forKey: .shipping) + } + } + + /* + Model: Store + Used By: Order + */ + + class Store: Codable { + public var id: Int? + + public enum CodingKeys: String, CodingKey { + case id + } + + public init(id: Int?) { + self.id = id + } + + public func duplicate() -> Store { + let dict = self.dictionary! + let copy = Store(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: ArticleMeta + Used By: Order + */ + + class ArticleMeta: Codable { + public var service: String? + + public enum CodingKeys: String, CodingKey { + case service + } + + public init(service: String?) { + self.service = service + } + + public func duplicate() -> ArticleMeta { + let dict = self.dictionary! + let copy = ArticleMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + service = try container.decode(String.self, forKey: .service) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(service, forKey: .service) + } + } + + /* + Model: ArticleBrand + Used By: Order + */ + + class ArticleBrand: Codable { + public var name: String? + + public var id: Int? + + public enum CodingKeys: String, CodingKey { + case name + + case id + } + + public init(id: Int?, name: String?) { + self.name = name + + self.id = id + } + + public func duplicate() -> ArticleBrand { + let dict = self.dictionary! + let copy = ArticleBrand(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: LineItemsArticleIdentifier + Used By: Order + */ + + class LineItemsArticleIdentifier: Codable { + public var skuCode: String? + + public enum CodingKeys: String, CodingKey { + case skuCode = "sku_code" + } + + public init(skuCode: String?) { + self.skuCode = skuCode + } + + public func duplicate() -> LineItemsArticleIdentifier { + let dict = self.dictionary! + let copy = LineItemsArticleIdentifier(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + skuCode = try container.decode(String.self, forKey: .skuCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(skuCode, forKey: .skuCode) + } + } + + /* + Model: PriceSet + Used By: Order + */ + + class PriceSet: Codable { + public var shopMoney: PriceSetShopMoney? + + public var presentmentMoney: PriceSetPresentmentMoney? + + public enum CodingKeys: String, CodingKey { + case shopMoney = "shop_money" + + case presentmentMoney = "presentment_money" + } + + public init(presentmentMoney: PriceSetPresentmentMoney?, shopMoney: PriceSetShopMoney?) { + self.shopMoney = shopMoney + + self.presentmentMoney = presentmentMoney + } + + public func duplicate() -> PriceSet { + let dict = self.dictionary! + let copy = PriceSet(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + shopMoney = try container.decode(PriceSetShopMoney.self, forKey: .shopMoney) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + presentmentMoney = try container.decode(PriceSetPresentmentMoney.self, forKey: .presentmentMoney) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(shopMoney, forKey: .shopMoney) + + try? container.encodeIfPresent(presentmentMoney, forKey: .presentmentMoney) + } + } + + /* + Model: PriceSetShopMoney + Used By: Order + */ + + class PriceSetShopMoney: Codable { + public var amount: String? + + public var currencyCode: String? + + public enum CodingKeys: String, CodingKey { + case amount + + case currencyCode = "currency_code" + } + + public init(amount: String?, currencyCode: String?) { + self.amount = amount + + self.currencyCode = currencyCode + } + + public func duplicate() -> PriceSetShopMoney { + let dict = self.dictionary! + let copy = PriceSetShopMoney(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + amount = try container.decode(String.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + } + } + + /* + Model: PriceSetPresentmentMoney + Used By: Order + */ + + class PriceSetPresentmentMoney: Codable { + public var amount: String? + + public var currencyCode: String? + + public enum CodingKeys: String, CodingKey { + case amount + + case currencyCode = "currency_code" + } + + public init(amount: String?, currencyCode: String?) { + self.amount = amount + + self.currencyCode = currencyCode + } + + public func duplicate() -> PriceSetPresentmentMoney { + let dict = self.dictionary! + let copy = PriceSetPresentmentMoney(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + amount = try container.decode(String.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + } + } + + /* + Model: TaxLines + Used By: Order + */ + + class TaxLines: Codable { + public var title: String? + + public var price: String? + + public var rate: Int? + + public var priceSet: TaxLinesPriceSet? + + public enum CodingKeys: String, CodingKey { + case title + + case price + + case rate + + case priceSet = "price_set" + } + + public init(price: String?, priceSet: TaxLinesPriceSet?, rate: Int?, title: String?) { + self.title = title + + self.price = price + + self.rate = rate + + self.priceSet = priceSet + } + + public func duplicate() -> TaxLines { + let dict = self.dictionary! + let copy = TaxLines(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(String.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rate = try container.decode(Int.self, forKey: .rate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priceSet = try container.decode(TaxLinesPriceSet.self, forKey: .priceSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(rate, forKey: .rate) + + try? container.encodeIfPresent(priceSet, forKey: .priceSet) + } + } + + /* + Model: TaxLinesPriceSet + Used By: Order + */ + + class TaxLinesPriceSet: Codable { + public var shopMoney: TaxLinesPriceSetShopMoney? + + public var presentmentMoney: TaxLinesPriceSetPresentmentMoney? + + public enum CodingKeys: String, CodingKey { + case shopMoney = "shop_money" + + case presentmentMoney = "presentment_money" + } + + public init(presentmentMoney: TaxLinesPriceSetPresentmentMoney?, shopMoney: TaxLinesPriceSetShopMoney?) { + self.shopMoney = shopMoney + + self.presentmentMoney = presentmentMoney + } + + public func duplicate() -> TaxLinesPriceSet { + let dict = self.dictionary! + let copy = TaxLinesPriceSet(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + shopMoney = try container.decode(TaxLinesPriceSetShopMoney.self, forKey: .shopMoney) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + presentmentMoney = try container.decode(TaxLinesPriceSetPresentmentMoney.self, forKey: .presentmentMoney) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(shopMoney, forKey: .shopMoney) + + try? container.encodeIfPresent(presentmentMoney, forKey: .presentmentMoney) + } + } + + /* + Model: TaxLinesPriceSetShopMoney + Used By: Order + */ + + class TaxLinesPriceSetShopMoney: Codable { + public var amount: String? + + public var currencyCode: String? + + public enum CodingKeys: String, CodingKey { + case amount + + case currencyCode = "currency_code" + } + + public init(amount: String?, currencyCode: String?) { + self.amount = amount + + self.currencyCode = currencyCode + } + + public func duplicate() -> TaxLinesPriceSetShopMoney { + let dict = self.dictionary! + let copy = TaxLinesPriceSetShopMoney(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + amount = try container.decode(String.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + } + } + + /* + Model: TaxLinesPriceSetPresentmentMoney + Used By: Order + */ + + class TaxLinesPriceSetPresentmentMoney: Codable { + public var currencyCode: String? + + public var amount: String? + + public enum CodingKeys: String, CodingKey { + case currencyCode = "currency_code" + + case amount + } + + public init(amount: String?, currencyCode: String?) { + self.currencyCode = currencyCode + + self.amount = amount + } + + public func duplicate() -> TaxLinesPriceSetPresentmentMoney { + let dict = self.dictionary! + let copy = TaxLinesPriceSetPresentmentMoney(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + amount = try container.decode(String.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + + try? container.encodeIfPresent(amount, forKey: .amount) + } + } + + /* + Model: TotalDiscountSet + Used By: Order + */ + + class TotalDiscountSet: Codable { + public var presentmentMoney: TotalDiscountSetPresentmentMoney? + + public var shopMoney: TotalDiscountSetShopMoney? + + public enum CodingKeys: String, CodingKey { + case presentmentMoney = "presentment_money" + + case shopMoney = "shop_money" + } + + public init(presentmentMoney: TotalDiscountSetPresentmentMoney?, shopMoney: TotalDiscountSetShopMoney?) { + self.presentmentMoney = presentmentMoney + + self.shopMoney = shopMoney + } + + public func duplicate() -> TotalDiscountSet { + let dict = self.dictionary! + let copy = TotalDiscountSet(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + presentmentMoney = try container.decode(TotalDiscountSetPresentmentMoney.self, forKey: .presentmentMoney) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shopMoney = try container.decode(TotalDiscountSetShopMoney.self, forKey: .shopMoney) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(presentmentMoney, forKey: .presentmentMoney) + + try? container.encodeIfPresent(shopMoney, forKey: .shopMoney) + } + } + + /* + Model: TotalDiscountSetPresentmentMoney + Used By: Order + */ + + class TotalDiscountSetPresentmentMoney: Codable { + public var amount: String? + + public var currencyCode: String? + + public enum CodingKeys: String, CodingKey { + case amount + + case currencyCode = "currency_code" + } + + public init(amount: String?, currencyCode: String?) { + self.amount = amount + + self.currencyCode = currencyCode + } + + public func duplicate() -> TotalDiscountSetPresentmentMoney { + let dict = self.dictionary! + let copy = TotalDiscountSetPresentmentMoney(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + amount = try container.decode(String.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + } + } + + /* + Model: TotalDiscountSetShopMoney + Used By: Order + */ + + class TotalDiscountSetShopMoney: Codable { + public var amount: String? + + public var currencyCode: String? + + public enum CodingKeys: String, CodingKey { + case amount + + case currencyCode = "currency_code" + } + + public init(amount: String?, currencyCode: String?) { + self.amount = amount + + self.currencyCode = currencyCode + } + + public func duplicate() -> TotalDiscountSetShopMoney { + let dict = self.dictionary! + let copy = TotalDiscountSetShopMoney(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + amount = try container.decode(String.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + } + } + + /* + Model: BillingAddress + Used By: Order + */ + + class BillingAddress: Codable { + public var address1: String? + + public var city: String? + + public var zip: String? + + public var lastName: String? + + public var address2: String? + + public var latitude: Double? + + public var longitude: Double? + + public var provinceCode: String? + + public var phone: String? + + public var company: String? + + public var name: String? + + public var country: String? + + public var countryCode: String? + + public var firstName: String? + + public var province: String? + + public enum CodingKeys: String, CodingKey { + case address1 + + case city + + case zip + + case lastName = "last_name" + + case address2 + + case latitude + + case longitude + + case provinceCode = "province_code" + + case phone + + case company + + case name + + case country + + case countryCode = "country_code" + + case firstName = "first_name" + + case province + } + + public init(address1: String?, address2: String?, city: String?, company: String?, country: String?, countryCode: String?, firstName: String?, lastName: String?, latitude: Double?, longitude: Double?, name: String?, phone: String?, province: String?, provinceCode: String?, zip: String?) { + self.address1 = address1 + + self.city = city + + self.zip = zip + + self.lastName = lastName + + self.address2 = address2 + + self.latitude = latitude + + self.longitude = longitude + + self.provinceCode = provinceCode + + self.phone = phone + + self.company = company + + self.name = name + + self.country = country + + self.countryCode = countryCode + + self.firstName = firstName + + self.province = province + } + + public func duplicate() -> BillingAddress { + let dict = self.dictionary! + let copy = BillingAddress(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + address1 = try container.decode(String.self, forKey: .address1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + zip = try container.decode(String.self, forKey: .zip) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address2 = try container.decode(String.self, forKey: .address2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + latitude = try container.decode(Double.self, forKey: .latitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + longitude = try container.decode(Double.self, forKey: .longitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + provinceCode = try container.decode(String.self, forKey: .provinceCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + company = try container.decode(String.self, forKey: .company) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + province = try container.decode(String.self, forKey: .province) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(address1, forKey: .address1) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(zip, forKey: .zip) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(address2, forKey: .address2) + + try? container.encodeIfPresent(latitude, forKey: .latitude) + + try? container.encodeIfPresent(longitude, forKey: .longitude) + + try? container.encodeIfPresent(provinceCode, forKey: .provinceCode) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(company, forKey: .company) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(province, forKey: .province) + } + } + + /* + Model: TotalShippingPriceSet + Used By: Order + */ + + class TotalShippingPriceSet: Codable { + public var shopMoney: TotalShippingPriceSetShopMoney? + + public var presentmentMoney: TotalShippingPriceSetPresentmentMoney? + + public enum CodingKeys: String, CodingKey { + case shopMoney = "shop_money" + + case presentmentMoney = "presentment_money" + } + + public init(presentmentMoney: TotalShippingPriceSetPresentmentMoney?, shopMoney: TotalShippingPriceSetShopMoney?) { + self.shopMoney = shopMoney + + self.presentmentMoney = presentmentMoney + } + + public func duplicate() -> TotalShippingPriceSet { + let dict = self.dictionary! + let copy = TotalShippingPriceSet(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + shopMoney = try container.decode(TotalShippingPriceSetShopMoney.self, forKey: .shopMoney) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + presentmentMoney = try container.decode(TotalShippingPriceSetPresentmentMoney.self, forKey: .presentmentMoney) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(shopMoney, forKey: .shopMoney) + + try? container.encodeIfPresent(presentmentMoney, forKey: .presentmentMoney) + } + } + + /* + Model: TotalShippingPriceSetShopMoney + Used By: Order + */ + + class TotalShippingPriceSetShopMoney: Codable { + public var amount: String? + + public var currencyCode: String? + + public enum CodingKeys: String, CodingKey { + case amount + + case currencyCode = "currency_code" + } + + public init(amount: String?, currencyCode: String?) { + self.amount = amount + + self.currencyCode = currencyCode + } + + public func duplicate() -> TotalShippingPriceSetShopMoney { + let dict = self.dictionary! + let copy = TotalShippingPriceSetShopMoney(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + amount = try container.decode(String.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + } + } + + /* + Model: TotalShippingPriceSetPresentmentMoney + Used By: Order + */ + + class TotalShippingPriceSetPresentmentMoney: Codable { + public var amount: String? + + public var currencyCode: String? + + public enum CodingKeys: String, CodingKey { + case amount + + case currencyCode = "currency_code" + } + + public init(amount: String?, currencyCode: String?) { + self.amount = amount + + self.currencyCode = currencyCode + } + + public func duplicate() -> TotalShippingPriceSetPresentmentMoney { + let dict = self.dictionary! + let copy = TotalShippingPriceSetPresentmentMoney(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + amount = try container.decode(String.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + } + } + + /* + Model: Customer + Used By: Order + */ + + class Customer: Codable { + public var createdAt: String? + + public var id: Int? + + public var lastName: String? + + public var state: String? + + public var lastOrderId: Int? + + public var note: String? + + public var verifiedEmail: Bool? + + public var phone: String? + + public var acceptsMarketing: Bool? + + public var firstName: String? + + public var tags: String? + + public var lastOrderName: String? + + public var ordersCount: Int? + + public var totalSpent: String? + + public var taxExempt: Bool? + + public var currency: String? + + public var acceptsMarketingUpdatedAt: String? + + public var email: String? + + public var updatedAt: String? + + public var adminGraphqlApiId: String? + + public var defaultAddress: DefaultAddress? + + public enum CodingKeys: String, CodingKey { + case createdAt = "created_at" + + case id + + case lastName = "last_name" + + case state + + case lastOrderId = "last_order_id" + + case note + + case verifiedEmail = "verified_email" + + case phone + + case acceptsMarketing = "accepts_marketing" + + case firstName = "first_name" + + case tags + + case lastOrderName = "last_order_name" + + case ordersCount = "orders_count" + + case totalSpent = "total_spent" + + case taxExempt = "tax_exempt" + + case currency + + case acceptsMarketingUpdatedAt = "accepts_marketing_updated_at" + + case email + + case updatedAt = "updated_at" + + case adminGraphqlApiId = "admin_graphql_api_id" + + case defaultAddress = "default_address" + } + + public init(acceptsMarketing: Bool?, acceptsMarketingUpdatedAt: String?, adminGraphqlApiId: String?, createdAt: String?, currency: String?, defaultAddress: DefaultAddress?, email: String?, firstName: String?, id: Int?, lastName: String?, lastOrderId: Int?, lastOrderName: String?, note: String?, ordersCount: Int?, phone: String?, state: String?, tags: String?, taxExempt: Bool?, totalSpent: String?, updatedAt: String?, verifiedEmail: Bool?) { + self.createdAt = createdAt + + self.id = id + + self.lastName = lastName + + self.state = state + + self.lastOrderId = lastOrderId + + self.note = note + + self.verifiedEmail = verifiedEmail + + self.phone = phone + + self.acceptsMarketing = acceptsMarketing + + self.firstName = firstName + + self.tags = tags + + self.lastOrderName = lastOrderName + + self.ordersCount = ordersCount + + self.totalSpent = totalSpent + + self.taxExempt = taxExempt + + self.currency = currency + + self.acceptsMarketingUpdatedAt = acceptsMarketingUpdatedAt + + self.email = email + + self.updatedAt = updatedAt + + self.adminGraphqlApiId = adminGraphqlApiId + + self.defaultAddress = defaultAddress + } + + public func duplicate() -> Customer { + let dict = self.dictionary! + let copy = Customer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastOrderId = try container.decode(Int.self, forKey: .lastOrderId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + note = try container.decode(String.self, forKey: .note) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifiedEmail = try container.decode(Bool.self, forKey: .verifiedEmail) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + acceptsMarketing = try container.decode(Bool.self, forKey: .acceptsMarketing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode(String.self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastOrderName = try container.decode(String.self, forKey: .lastOrderName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ordersCount = try container.decode(Int.self, forKey: .ordersCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalSpent = try container.decode(String.self, forKey: .totalSpent) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + taxExempt = try container.decode(Bool.self, forKey: .taxExempt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + acceptsMarketingUpdatedAt = try container.decode(String.self, forKey: .acceptsMarketingUpdatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + adminGraphqlApiId = try container.decode(String.self, forKey: .adminGraphqlApiId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + defaultAddress = try container.decode(DefaultAddress.self, forKey: .defaultAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(lastOrderId, forKey: .lastOrderId) + + try? container.encodeIfPresent(note, forKey: .note) + + try? container.encodeIfPresent(verifiedEmail, forKey: .verifiedEmail) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(acceptsMarketing, forKey: .acceptsMarketing) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(lastOrderName, forKey: .lastOrderName) + + try? container.encodeIfPresent(ordersCount, forKey: .ordersCount) + + try? container.encodeIfPresent(totalSpent, forKey: .totalSpent) + + try? container.encodeIfPresent(taxExempt, forKey: .taxExempt) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(acceptsMarketingUpdatedAt, forKey: .acceptsMarketingUpdatedAt) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(adminGraphqlApiId, forKey: .adminGraphqlApiId) + + try? container.encodeIfPresent(defaultAddress, forKey: .defaultAddress) + } + } + + /* + Model: DefaultAddress + Used By: Order + */ + + class DefaultAddress: Codable { + public var lastName: String? + + public var name: String? + + public var provinceCode: String? + + public var countryCode: String? + + public var isDefault: Bool? + + public var id: Int? + + public var customerId: Int? + + public var firstName: String? + + public var address1: String? + + public var phone: String? + + public var countryName: String? + + public var company: String? + + public var address2: String? + + public var city: String? + + public var province: String? + + public var country: String? + + public var zip: String? + + public enum CodingKeys: String, CodingKey { + case lastName = "last_name" + + case name + + case provinceCode = "province_code" + + case countryCode = "country_code" + + case isDefault = "is_default" + + case id + + case customerId = "customer_id" + + case firstName = "first_name" + + case address1 + + case phone + + case countryName = "country_name" + + case company + + case address2 + + case city + + case province + + case country + + case zip + } + + public init(address1: String?, address2: String?, city: String?, company: String?, country: String?, countryCode: String?, countryName: String?, customerId: Int?, firstName: String?, id: Int?, isDefault: Bool?, lastName: String?, name: String?, phone: String?, province: String?, provinceCode: String?, zip: String?) { + self.lastName = lastName + + self.name = name + + self.provinceCode = provinceCode + + self.countryCode = countryCode + + self.isDefault = isDefault + + self.id = id + + self.customerId = customerId + + self.firstName = firstName + + self.address1 = address1 + + self.phone = phone + + self.countryName = countryName + + self.company = company + + self.address2 = address2 + + self.city = city + + self.province = province + + self.country = country + + self.zip = zip + } + + public func duplicate() -> DefaultAddress { + let dict = self.dictionary! + let copy = DefaultAddress(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + provinceCode = try container.decode(String.self, forKey: .provinceCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isDefault = try container.decode(Bool.self, forKey: .isDefault) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customerId = try container.decode(Int.self, forKey: .customerId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address1 = try container.decode(String.self, forKey: .address1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryName = try container.decode(String.self, forKey: .countryName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + company = try container.decode(String.self, forKey: .company) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address2 = try container.decode(String.self, forKey: .address2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + province = try container.decode(String.self, forKey: .province) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + zip = try container.decode(String.self, forKey: .zip) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(provinceCode, forKey: .provinceCode) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(isDefault, forKey: .isDefault) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(customerId, forKey: .customerId) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(address1, forKey: .address1) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(countryName, forKey: .countryName) + + try? container.encodeIfPresent(company, forKey: .company) + + try? container.encodeIfPresent(address2, forKey: .address2) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(province, forKey: .province) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(zip, forKey: .zip) + } + } + + /* + Model: TotalLineItemsPriceSet + Used By: Order + */ + + class TotalLineItemsPriceSet: Codable { + public var shopMoney: TotalLineItemsPriceSetShopMoney? + + public var presentmentMoney: TotalLineItemsPriceSetPresentmentMoney? + + public enum CodingKeys: String, CodingKey { + case shopMoney = "shop_money" + + case presentmentMoney = "presentment_money" + } + + public init(presentmentMoney: TotalLineItemsPriceSetPresentmentMoney?, shopMoney: TotalLineItemsPriceSetShopMoney?) { + self.shopMoney = shopMoney + + self.presentmentMoney = presentmentMoney + } + + public func duplicate() -> TotalLineItemsPriceSet { + let dict = self.dictionary! + let copy = TotalLineItemsPriceSet(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + shopMoney = try container.decode(TotalLineItemsPriceSetShopMoney.self, forKey: .shopMoney) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + presentmentMoney = try container.decode(TotalLineItemsPriceSetPresentmentMoney.self, forKey: .presentmentMoney) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(shopMoney, forKey: .shopMoney) + + try? container.encodeIfPresent(presentmentMoney, forKey: .presentmentMoney) + } + } + + /* + Model: TotalLineItemsPriceSetShopMoney + Used By: Order + */ + + class TotalLineItemsPriceSetShopMoney: Codable { + public var amount: String? + + public var currencyCode: String? + + public enum CodingKeys: String, CodingKey { + case amount + + case currencyCode = "currency_code" + } + + public init(amount: String?, currencyCode: String?) { + self.amount = amount + + self.currencyCode = currencyCode + } + + public func duplicate() -> TotalLineItemsPriceSetShopMoney { + let dict = self.dictionary! + let copy = TotalLineItemsPriceSetShopMoney(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + amount = try container.decode(String.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + } + } + + /* + Model: TotalLineItemsPriceSetPresentmentMoney + Used By: Order + */ + + class TotalLineItemsPriceSetPresentmentMoney: Codable { + public var amount: String? + + public var currencyCode: String? + + public enum CodingKeys: String, CodingKey { + case amount + + case currencyCode = "currency_code" + } + + public init(amount: String?, currencyCode: String?) { + self.amount = amount + + self.currencyCode = currencyCode + } + + public func duplicate() -> TotalLineItemsPriceSetPresentmentMoney { + let dict = self.dictionary! + let copy = TotalLineItemsPriceSetPresentmentMoney(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + amount = try container.decode(String.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currencyCode = try container.decode(String.self, forKey: .currencyCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(currencyCode, forKey: .currencyCode) + } + } + + /* + Model: OrderShippingAddress + Used By: Order + */ + + class OrderShippingAddress: Codable { + public var address1: String? + + public var zip: String? + + public var address2: String? + + public var countryCode: String? + + public var country: String? + + public var lastName: String? + + public var provinceCode: String? + + public var firstName: String? + + public var phone: String? + + public var province: String? + + public var latitude: Double? + + public var longitude: Double? + + public var city: String? + + public var company: String? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case address1 + + case zip + + case address2 + + case countryCode = "country_code" + + case country + + case lastName = "last_name" + + case provinceCode = "province_code" + + case firstName = "first_name" + + case phone + + case province + + case latitude + + case longitude + + case city + + case company + + case name + } + + public init(address1: String?, address2: String?, city: String?, company: String?, country: String?, countryCode: String?, firstName: String?, lastName: String?, latitude: Double?, longitude: Double?, name: String?, phone: String?, province: String?, provinceCode: String?, zip: String?) { + self.address1 = address1 + + self.zip = zip + + self.address2 = address2 + + self.countryCode = countryCode + + self.country = country + + self.lastName = lastName + + self.provinceCode = provinceCode + + self.firstName = firstName + + self.phone = phone + + self.province = province + + self.latitude = latitude + + self.longitude = longitude + + self.city = city + + self.company = company + + self.name = name + } + + public func duplicate() -> OrderShippingAddress { + let dict = self.dictionary! + let copy = OrderShippingAddress(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + address1 = try container.decode(String.self, forKey: .address1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + zip = try container.decode(String.self, forKey: .zip) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address2 = try container.decode(String.self, forKey: .address2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + provinceCode = try container.decode(String.self, forKey: .provinceCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + province = try container.decode(String.self, forKey: .province) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + latitude = try container.decode(Double.self, forKey: .latitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + longitude = try container.decode(Double.self, forKey: .longitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + company = try container.decode(String.self, forKey: .company) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(address1, forKey: .address1) + + try? container.encodeIfPresent(zip, forKey: .zip) + + try? container.encodeIfPresent(address2, forKey: .address2) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(provinceCode, forKey: .provinceCode) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(province, forKey: .province) + + try? container.encodeIfPresent(latitude, forKey: .latitude) + + try? container.encodeIfPresent(longitude, forKey: .longitude) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(company, forKey: .company) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: OrderListing + Used By: Order + */ + + class OrderListing: Codable { + public var items: [OrderItems] + + public var filters: Filters + + public var nextOrderStatus: [String: Any] + + public var page: PlatformOrderPage + + public var appliedFilters: AppliedFilters + + public enum CodingKeys: String, CodingKey { + case items + + case filters + + case nextOrderStatus = "next_order_status" + + case page + + case appliedFilters = "applied_filters" + } + + public init(appliedFilters: AppliedFilters, filters: Filters, items: [OrderItems], nextOrderStatus: [String: Any], page: PlatformOrderPage) { + self.items = items + + self.filters = filters + + self.nextOrderStatus = nextOrderStatus + + self.page = page + + self.appliedFilters = appliedFilters + } + + public func duplicate() -> OrderListing { + let dict = self.dictionary! + let copy = OrderListing(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + items = try container.decode([OrderItems].self, forKey: .items) + + filters = try container.decode(Filters.self, forKey: .filters) + + nextOrderStatus = try container.decode([String: Any].self, forKey: .nextOrderStatus) + + page = try container.decode(PlatformOrderPage.self, forKey: .page) + + appliedFilters = try container.decode(AppliedFilters.self, forKey: .appliedFilters) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(filters, forKey: .filters) + + try? container.encodeIfPresent(nextOrderStatus, forKey: .nextOrderStatus) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(appliedFilters, forKey: .appliedFilters) + } + } + + /* + Model: OrderItems + Used By: Order + */ + + class OrderItems: Codable { + public var user: PlatformOrderUserInfo? + + public var deliveryAddress: PlatformDeliveryAddress? + + public var channel: Channel? + + public var id: String? + + public var application: PlatformApplication? + + public var shipments: PlatformShipment? + + public var createdAt: String? + + public var totalShipmentsInOrder: Int? + + public enum CodingKeys: String, CodingKey { + case user + + case deliveryAddress = "delivery_address" + + case channel + + case id + + case application + + case shipments + + case createdAt = "created_at" + + case totalShipmentsInOrder = "total_shipments_in_order" + } + + public init(application: PlatformApplication?, channel: Channel?, createdAt: String?, deliveryAddress: PlatformDeliveryAddress?, id: String?, shipments: PlatformShipment?, totalShipmentsInOrder: Int?, user: PlatformOrderUserInfo?) { + self.user = user + + self.deliveryAddress = deliveryAddress + + self.channel = channel + + self.id = id + + self.application = application + + self.shipments = shipments + + self.createdAt = createdAt + + self.totalShipmentsInOrder = totalShipmentsInOrder + } + + public func duplicate() -> OrderItems { + let dict = self.dictionary! + let copy = OrderItems(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode(PlatformOrderUserInfo.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryAddress = try container.decode(PlatformDeliveryAddress.self, forKey: .deliveryAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + channel = try container.decode(Channel.self, forKey: .channel) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(PlatformApplication.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shipments = try container.decode(PlatformShipment.self, forKey: .shipments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalShipmentsInOrder = try container.decode(Int.self, forKey: .totalShipmentsInOrder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(deliveryAddress, forKey: .deliveryAddress) + + try? container.encodeIfPresent(channel, forKey: .channel) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(shipments, forKey: .shipments) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(totalShipmentsInOrder, forKey: .totalShipmentsInOrder) + } + } + + /* + Model: PlatformOrderUserInfo + Used By: Order + */ + + class PlatformOrderUserInfo: Codable { + public var mobile: String? + + public var firstName: String? + + public var gender: String? + + public var email: String? + + public var lastName: String? + + public var isAnonymousUser: Bool? + + public var uid: Int? + + public var avisUserId: String? + + public enum CodingKeys: String, CodingKey { + case mobile + + case firstName = "first_name" + + case gender + + case email + + case lastName = "last_name" + + case isAnonymousUser = "is_anonymous_user" + + case uid + + case avisUserId = "avis_user_id" + } + + public init(avisUserId: String?, email: String?, firstName: String?, gender: String?, isAnonymousUser: Bool?, lastName: String?, mobile: String?, uid: Int?) { + self.mobile = mobile + + self.firstName = firstName + + self.gender = gender + + self.email = email + + self.lastName = lastName + + self.isAnonymousUser = isAnonymousUser + + self.uid = uid + + self.avisUserId = avisUserId + } + + public func duplicate() -> PlatformOrderUserInfo { + let dict = self.dictionary! + let copy = PlatformOrderUserInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + mobile = try container.decode(String.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gender = try container.decode(String.self, forKey: .gender) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isAnonymousUser = try container.decode(Bool.self, forKey: .isAnonymousUser) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + avisUserId = try container.decode(String.self, forKey: .avisUserId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(gender, forKey: .gender) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(isAnonymousUser, forKey: .isAnonymousUser) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(avisUserId, forKey: .avisUserId) + } + } + + /* + Model: PlatformDeliveryAddress + Used By: Order + */ + + class PlatformDeliveryAddress: Codable { + public var area: String? + + public var state: String? + + public var country: String? + + public var version: String? + + public var address1: String? + + public var updatedAt: String? + + public var city: String? + + public var landmark: String? + + public var createdAt: String? + + public var name: String? + + public var address: String? + + public var phone: String? + + public var latitude: Double? + + public var longitude: Double? + + public var addressType: String? + + public var email: String? + + public var pincode: String? + + public var address2: String? + + public var contactPerson: String? + + public var addressCategory: String? + + public enum CodingKeys: String, CodingKey { + case area + + case state + + case country + + case version + + case address1 + + case updatedAt = "updated_at" + + case city + + case landmark + + case createdAt = "created_at" + + case name + + case address + + case phone + + case latitude + + case longitude + + case addressType = "address_type" + + case email + + case pincode + + case address2 + + case contactPerson = "contact_person" + + case addressCategory = "address_category" + } + + public init(address: String?, address1: String?, address2: String?, addressCategory: String?, addressType: String?, area: String?, city: String?, contactPerson: String?, country: String?, createdAt: String?, email: String?, landmark: String?, latitude: Double?, longitude: Double?, name: String?, phone: String?, pincode: String?, state: String?, updatedAt: String?, version: String?) { + self.area = area + + self.state = state + + self.country = country + + self.version = version + + self.address1 = address1 + + self.updatedAt = updatedAt + + self.city = city + + self.landmark = landmark + + self.createdAt = createdAt + + self.name = name + + self.address = address + + self.phone = phone + + self.latitude = latitude + + self.longitude = longitude + + self.addressType = addressType + + self.email = email + + self.pincode = pincode + + self.address2 = address2 + + self.contactPerson = contactPerson + + self.addressCategory = addressCategory + } + + public func duplicate() -> PlatformDeliveryAddress { + let dict = self.dictionary! + let copy = PlatformDeliveryAddress(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + area = try container.decode(String.self, forKey: .area) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + version = try container.decode(String.self, forKey: .version) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address1 = try container.decode(String.self, forKey: .address1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + landmark = try container.decode(String.self, forKey: .landmark) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address = try container.decode(String.self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + latitude = try container.decode(Double.self, forKey: .latitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + longitude = try container.decode(Double.self, forKey: .longitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressType = try container.decode(String.self, forKey: .addressType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(String.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address2 = try container.decode(String.self, forKey: .address2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contactPerson = try container.decode(String.self, forKey: .contactPerson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressCategory = try container.decode(String.self, forKey: .addressCategory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(area, forKey: .area) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(version, forKey: .version) + + try? container.encodeIfPresent(address1, forKey: .address1) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(landmark, forKey: .landmark) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(latitude, forKey: .latitude) + + try? container.encodeIfPresent(longitude, forKey: .longitude) + + try? container.encodeIfPresent(addressType, forKey: .addressType) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(address2, forKey: .address2) + + try? container.encodeIfPresent(contactPerson, forKey: .contactPerson) + + try? container.encodeIfPresent(addressCategory, forKey: .addressCategory) + } + } + + /* + Model: Channel + Used By: Order + */ + + class Channel: Codable { + public var name: String? + + public var logo: String? + + public enum CodingKeys: String, CodingKey { + case name + + case logo + } + + public init(logo: String?, name: String?) { + self.name = name + + self.logo = logo + } + + public func duplicate() -> Channel { + let dict = self.dictionary! + let copy = Channel(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(logo, forKey: .logo) + } + } + + /* + Model: PlatformApplication + Used By: Order + */ + + class PlatformApplication: Codable { + public var id: String? + + public enum CodingKeys: String, CodingKey { + case id + } + + public init(id: String?) { + self.id = id + } + + public func duplicate() -> PlatformApplication { + let dict = self.dictionary! + let copy = PlatformApplication(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: PlatformShipment + Used By: Order + */ + + class PlatformShipment: Codable { + public var status: PlatformShipmentStatus? + + public var bags: Bags? + + public var prices: ShipmentPrices? + + public var id: String? + + public var gst: ShipmentGst? + + public var priority: Double? + + public var priorityText: String? + + public var lockStatus: Bool? + + public var orderingChannel: String? + + public var totalShipmentBags: Int? + + public enum CodingKeys: String, CodingKey { + case status + + case bags + + case prices + + case id + + case gst + + case priority + + case priorityText = "priority_text" + + case lockStatus = "lock_status" + + case orderingChannel = "ordering_channel" + + case totalShipmentBags = "total_shipment_bags" + } + + public init(bags: Bags?, gst: ShipmentGst?, id: String?, lockStatus: Bool?, orderingChannel: String?, prices: ShipmentPrices?, priority: Double?, priorityText: String?, status: PlatformShipmentStatus?, totalShipmentBags: Int?) { + self.status = status + + self.bags = bags + + self.prices = prices + + self.id = id + + self.gst = gst + + self.priority = priority + + self.priorityText = priorityText + + self.lockStatus = lockStatus + + self.orderingChannel = orderingChannel + + self.totalShipmentBags = totalShipmentBags + } + + public func duplicate() -> PlatformShipment { + let dict = self.dictionary! + let copy = PlatformShipment(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + status = try container.decode(PlatformShipmentStatus.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bags = try container.decode(Bags.self, forKey: .bags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + prices = try container.decode(ShipmentPrices.self, forKey: .prices) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gst = try container.decode(ShipmentGst.self, forKey: .gst) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(Double.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priorityText = try container.decode(String.self, forKey: .priorityText) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lockStatus = try container.decode(Bool.self, forKey: .lockStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderingChannel = try container.decode(String.self, forKey: .orderingChannel) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalShipmentBags = try container.decode(Int.self, forKey: .totalShipmentBags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(bags, forKey: .bags) + + try? container.encodeIfPresent(prices, forKey: .prices) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(gst, forKey: .gst) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(priorityText, forKey: .priorityText) + + try? container.encodeIfPresent(lockStatus, forKey: .lockStatus) + + try? container.encodeIfPresent(orderingChannel, forKey: .orderingChannel) + + try? container.encodeIfPresent(totalShipmentBags, forKey: .totalShipmentBags) + } + } + + /* + Model: PlatformShipmentStatus + Used By: Order + */ + + class PlatformShipmentStatus: Codable { + public var id: Int? + + public var bagList: [Int]? + + public var createdAt: String? + + public var status: String? + + public var name: String? + + public var progress: Int? + + public var shipmentId: String? + + public var currentShipmentStatus: String? + + public var colorCode: String? + + public enum CodingKeys: String, CodingKey { + case id + + case bagList = "bag_list" + + case createdAt = "created_at" + + case status + + case name + + case progress + + case shipmentId = "shipment_id" + + case currentShipmentStatus = "current_shipment_status" + + case colorCode = "color_code" + } + + public init(bagList: [Int]?, colorCode: String?, createdAt: String?, currentShipmentStatus: String?, id: Int?, name: String?, progress: Int?, shipmentId: String?, status: String?) { + self.id = id + + self.bagList = bagList + + self.createdAt = createdAt + + self.status = status + + self.name = name + + self.progress = progress + + self.shipmentId = shipmentId + + self.currentShipmentStatus = currentShipmentStatus + + self.colorCode = colorCode + } + + public func duplicate() -> PlatformShipmentStatus { + let dict = self.dictionary! + let copy = PlatformShipmentStatus(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bagList = try container.decode([Int].self, forKey: .bagList) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + progress = try container.decode(Int.self, forKey: .progress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shipmentId = try container.decode(String.self, forKey: .shipmentId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currentShipmentStatus = try container.decode(String.self, forKey: .currentShipmentStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + colorCode = try container.decode(String.self, forKey: .colorCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(bagList, forKey: .bagList) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(progress, forKey: .progress) + + try? container.encodeIfPresent(shipmentId, forKey: .shipmentId) + + try? container.encodeIfPresent(currentShipmentStatus, forKey: .currentShipmentStatus) + + try? container.encodeIfPresent(colorCode, forKey: .colorCode) + } + } + + /* + Model: Bags + Used By: Order + */ + + class Bags: Codable { + public var item: BagItem? + + public var id: Int? + + public enum CodingKeys: String, CodingKey { + case item + + case id + } + + public init(id: Int?, item: BagItem?) { + self.item = item + + self.id = id + } + + public func duplicate() -> Bags { + let dict = self.dictionary! + let copy = Bags(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + item = try container.decode(BagItem.self, forKey: .item) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(item, forKey: .item) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: BagItem + Used By: Order + */ + + class BagItem: Codable { + public var id: Int? + + public var size: String? + + public var slugKey: String? + + public var canReturn: Bool? + + public var brandId: Int? + + public var l2Category: [String]? + + public var name: String? + + public var code: String? + + public var canCancel: Bool? + + public var attributes: BagItemAttributes? + + public var l3CategoryName: String? + + public var l3Category: Int? + + public var l1Category: [String]? + + public var image: [String]? + + public var brand: String? + + public var lastUpdatedAt: String? + + public enum CodingKeys: String, CodingKey { + case id + + case size + + case slugKey = "slug_key" + + case canReturn = "can_return" + + case brandId = "brand_id" + + case l2Category = "l2_category" + + case name + + case code + + case canCancel = "can_cancel" + + case attributes + + case l3CategoryName = "l3_category_name" + + case l3Category = "l3_category" + + case l1Category = "l1_category" + + case image + + case brand + + case lastUpdatedAt = "last_updated_at" + } + + public init(attributes: BagItemAttributes?, brand: String?, brandId: Int?, canCancel: Bool?, canReturn: Bool?, code: String?, id: Int?, image: [String]?, l1Category: [String]?, l2Category: [String]?, l3Category: Int?, l3CategoryName: String?, lastUpdatedAt: String?, name: String?, size: String?, slugKey: String?) { + self.id = id + + self.size = size + + self.slugKey = slugKey + + self.canReturn = canReturn + + self.brandId = brandId + + self.l2Category = l2Category + + self.name = name + + self.code = code + + self.canCancel = canCancel + + self.attributes = attributes + + self.l3CategoryName = l3CategoryName + + self.l3Category = l3Category + + self.l1Category = l1Category + + self.image = image + + self.brand = brand + + self.lastUpdatedAt = lastUpdatedAt + } + + public func duplicate() -> BagItem { + let dict = self.dictionary! + let copy = BagItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(String.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + slugKey = try container.decode(String.self, forKey: .slugKey) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + canReturn = try container.decode(Bool.self, forKey: .canReturn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandId = try container.decode(Int.self, forKey: .brandId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + l2Category = try container.decode([String].self, forKey: .l2Category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + canCancel = try container.decode(Bool.self, forKey: .canCancel) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attributes = try container.decode(BagItemAttributes.self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + l3CategoryName = try container.decode(String.self, forKey: .l3CategoryName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + l3Category = try container.decode(Int.self, forKey: .l3Category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + l1Category = try container.decode([String].self, forKey: .l1Category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + image = try container.decode([String].self, forKey: .image) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brand = try container.decode(String.self, forKey: .brand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastUpdatedAt = try container.decode(String.self, forKey: .lastUpdatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(slugKey, forKey: .slugKey) + + try? container.encodeIfPresent(canReturn, forKey: .canReturn) + + try? container.encodeIfPresent(brandId, forKey: .brandId) + + try? container.encodeIfPresent(l2Category, forKey: .l2Category) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(canCancel, forKey: .canCancel) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + + try? container.encodeIfPresent(l3CategoryName, forKey: .l3CategoryName) + + try? container.encodeIfPresent(l3Category, forKey: .l3Category) + + try? container.encodeIfPresent(l1Category, forKey: .l1Category) + + try? container.encodeIfPresent(image, forKey: .image) + + try? container.encodeIfPresent(brand, forKey: .brand) + + try? container.encodeIfPresent(lastUpdatedAt, forKey: .lastUpdatedAt) + } + } + + /* + Model: BagItemAttributes + Used By: Order + */ + + class BagItemAttributes: Codable { + public var itemCode: String? + + public var brandName: String? + + public var countryOfOrigin: String? + + public enum CodingKeys: String, CodingKey { + case itemCode = "item_code" + + case brandName = "brand_name" + + case countryOfOrigin = "country_of_origin" + } + + public init(brandName: String?, countryOfOrigin: String?, itemCode: String?) { + self.itemCode = itemCode + + self.brandName = brandName + + self.countryOfOrigin = countryOfOrigin + } + + public func duplicate() -> BagItemAttributes { + let dict = self.dictionary! + let copy = BagItemAttributes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + itemCode = try container.decode(String.self, forKey: .itemCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandName = try container.decode(String.self, forKey: .brandName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryOfOrigin = try container.decode(String.self, forKey: .countryOfOrigin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(itemCode, forKey: .itemCode) + + try? container.encodeIfPresent(brandName, forKey: .brandName) + + try? container.encodeIfPresent(countryOfOrigin, forKey: .countryOfOrigin) + } + } + + /* + Model: ShipmentPrices + Used By: Order + */ + + class ShipmentPrices: Codable { + public var refundAmount: Double? + + public var cashbackApplied: Double? + + public var transferPrice: Double? + + public var couponValue: Double? + + public var amountPaid: Double? + + public var deliveryCharge: Double? + + public var couponEffectiveDiscount: Double? + + public var codCharges: Double? + + public var refundCredit: Double? + + public var addedToFyndCash: Bool? + + public var gstTaxPercentage: Double? + + public var priceMarked: Double? + + public var priceEffective: Double? + + public var discount: Double? + + public var promotionEffectiveDiscount: Double? + + public var amountPaidRoundoff: Double? + + public var fyndCredits: Double? + + public var brandCalculatedAmount: Double? + + public var cashback: Double? + + public var valueOfGood: Double? + + public enum CodingKeys: String, CodingKey { + case refundAmount = "refund_amount" + + case cashbackApplied = "cashback_applied" + + case transferPrice = "transfer_price" + + case couponValue = "coupon_value" + + case amountPaid = "amount_paid" + + case deliveryCharge = "delivery_charge" + + case couponEffectiveDiscount = "coupon_effective_discount" + + case codCharges = "cod_charges" + + case refundCredit = "refund_credit" + + case addedToFyndCash = "added_to_fynd_cash" + + case gstTaxPercentage = "gst_tax_percentage" + + case priceMarked = "price_marked" + + case priceEffective = "price_effective" + + case discount + + case promotionEffectiveDiscount = "promotion_effective_discount" + + case amountPaidRoundoff = "amount_paid_roundoff" + + case fyndCredits = "fynd_credits" + + case brandCalculatedAmount = "brand_calculated_amount" + + case cashback + + case valueOfGood = "value_of_good" + } + + public init(addedToFyndCash: Bool?, amountPaid: Double?, amountPaidRoundoff: Double?, brandCalculatedAmount: Double?, cashback: Double?, cashbackApplied: Double?, codCharges: Double?, couponEffectiveDiscount: Double?, couponValue: Double?, deliveryCharge: Double?, discount: Double?, fyndCredits: Double?, gstTaxPercentage: Double?, priceEffective: Double?, priceMarked: Double?, promotionEffectiveDiscount: Double?, refundAmount: Double?, refundCredit: Double?, transferPrice: Double?, valueOfGood: Double?) { + self.refundAmount = refundAmount + + self.cashbackApplied = cashbackApplied + + self.transferPrice = transferPrice + + self.couponValue = couponValue + + self.amountPaid = amountPaid + + self.deliveryCharge = deliveryCharge + + self.couponEffectiveDiscount = couponEffectiveDiscount + + self.codCharges = codCharges + + self.refundCredit = refundCredit + + self.addedToFyndCash = addedToFyndCash + + self.gstTaxPercentage = gstTaxPercentage + + self.priceMarked = priceMarked + + self.priceEffective = priceEffective + + self.discount = discount + + self.promotionEffectiveDiscount = promotionEffectiveDiscount + + self.amountPaidRoundoff = amountPaidRoundoff + + self.fyndCredits = fyndCredits + + self.brandCalculatedAmount = brandCalculatedAmount + + self.cashback = cashback + + self.valueOfGood = valueOfGood + } + + public func duplicate() -> ShipmentPrices { + let dict = self.dictionary! + let copy = ShipmentPrices(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + refundAmount = try container.decode(Double.self, forKey: .refundAmount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cashbackApplied = try container.decode(Double.self, forKey: .cashbackApplied) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + transferPrice = try container.decode(Double.self, forKey: .transferPrice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + couponValue = try container.decode(Double.self, forKey: .couponValue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + amountPaid = try container.decode(Double.self, forKey: .amountPaid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryCharge = try container.decode(Double.self, forKey: .deliveryCharge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + couponEffectiveDiscount = try container.decode(Double.self, forKey: .couponEffectiveDiscount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + codCharges = try container.decode(Double.self, forKey: .codCharges) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refundCredit = try container.decode(Double.self, forKey: .refundCredit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addedToFyndCash = try container.decode(Bool.self, forKey: .addedToFyndCash) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstTaxPercentage = try container.decode(Double.self, forKey: .gstTaxPercentage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priceMarked = try container.decode(Double.self, forKey: .priceMarked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priceEffective = try container.decode(Double.self, forKey: .priceEffective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discount = try container.decode(Double.self, forKey: .discount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + promotionEffectiveDiscount = try container.decode(Double.self, forKey: .promotionEffectiveDiscount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + amountPaidRoundoff = try container.decode(Double.self, forKey: .amountPaidRoundoff) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fyndCredits = try container.decode(Double.self, forKey: .fyndCredits) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandCalculatedAmount = try container.decode(Double.self, forKey: .brandCalculatedAmount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cashback = try container.decode(Double.self, forKey: .cashback) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + valueOfGood = try container.decode(Double.self, forKey: .valueOfGood) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(refundAmount, forKey: .refundAmount) + + try? container.encodeIfPresent(cashbackApplied, forKey: .cashbackApplied) + + try? container.encodeIfPresent(transferPrice, forKey: .transferPrice) + + try? container.encodeIfPresent(couponValue, forKey: .couponValue) + + try? container.encodeIfPresent(amountPaid, forKey: .amountPaid) + + try? container.encodeIfPresent(deliveryCharge, forKey: .deliveryCharge) + + try? container.encodeIfPresent(couponEffectiveDiscount, forKey: .couponEffectiveDiscount) + + try? container.encodeIfPresent(codCharges, forKey: .codCharges) + + try? container.encodeIfPresent(refundCredit, forKey: .refundCredit) + + try? container.encodeIfPresent(addedToFyndCash, forKey: .addedToFyndCash) + + try? container.encodeIfPresent(gstTaxPercentage, forKey: .gstTaxPercentage) + + try? container.encodeIfPresent(priceMarked, forKey: .priceMarked) + + try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) + + try? container.encodeIfPresent(discount, forKey: .discount) + + try? container.encodeIfPresent(promotionEffectiveDiscount, forKey: .promotionEffectiveDiscount) + + try? container.encodeIfPresent(amountPaidRoundoff, forKey: .amountPaidRoundoff) + + try? container.encodeIfPresent(fyndCredits, forKey: .fyndCredits) + + try? container.encodeIfPresent(brandCalculatedAmount, forKey: .brandCalculatedAmount) + + try? container.encodeIfPresent(cashback, forKey: .cashback) + + try? container.encodeIfPresent(valueOfGood, forKey: .valueOfGood) + } + } + + /* + Model: Payments + Used By: Order + */ + + class Payments: Codable { + public var isActive: Bool? + + public var displayName: String? + + public var logo: String? + + public var source: String? + + public var sourceNickname: String? + + public var displayPriority: Int? + + public var id: Int? + + public var mode: String? + + public var paymentIdentifier: String? + + public enum CodingKeys: String, CodingKey { + case isActive = "is_active" + + case displayName = "display_name" + + case logo + + case source + + case sourceNickname = "source_nickname" + + case displayPriority = "display_priority" + + case id + + case mode + + case paymentIdentifier = "payment_identifier" + } + + public init(displayName: String?, displayPriority: Int?, id: Int?, isActive: Bool?, logo: String?, mode: String?, paymentIdentifier: String?, source: String?, sourceNickname: String?) { + self.isActive = isActive + + self.displayName = displayName + + self.logo = logo + + self.source = source + + self.sourceNickname = sourceNickname + + self.displayPriority = displayPriority + + self.id = id + + self.mode = mode + + self.paymentIdentifier = paymentIdentifier + } + + public func duplicate() -> Payments { + let dict = self.dictionary! + let copy = Payments(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + source = try container.decode(String.self, forKey: .source) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sourceNickname = try container.decode(String.self, forKey: .sourceNickname) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayPriority = try container.decode(Int.self, forKey: .displayPriority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mode = try container.decode(String.self, forKey: .mode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentIdentifier = try container.decode(String.self, forKey: .paymentIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(source, forKey: .source) + + try? container.encodeIfPresent(sourceNickname, forKey: .sourceNickname) + + try? container.encodeIfPresent(displayPriority, forKey: .displayPriority) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(mode, forKey: .mode) + + try? container.encodeIfPresent(paymentIdentifier, forKey: .paymentIdentifier) + } + } + + /* + Model: Filters + Used By: Order + */ + + class Filters: Codable { + public var stage: Stage? + + public var stages: Stages? + + public enum CodingKeys: String, CodingKey { + case stage + + case stages + } + + public init(stage: Stage?, stages: Stages?) { + self.stage = stage + + self.stages = stages + } + + public func duplicate() -> Filters { + let dict = self.dictionary! + let copy = Filters(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + stage = try container.decode(Stage.self, forKey: .stage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stages = try container.decode(Stages.self, forKey: .stages) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(stage, forKey: .stage) + + try? container.encodeIfPresent(stages, forKey: .stages) + } + } + + /* + Model: Stage + Used By: Order + */ + + class Stage: Codable { + public var text: String? + + public var value: String? + + public var isDefault: Bool? + + public var filters: StagesFilters? + + public enum CodingKeys: String, CodingKey { + case text + + case value + + case isDefault = "is_default" + + case filters + } + + public init(filters: StagesFilters?, isDefault: Bool?, text: String?, value: String?) { + self.text = text + + self.value = value + + self.isDefault = isDefault + + self.filters = filters + } + + public func duplicate() -> Stage { + let dict = self.dictionary! + let copy = Stage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + text = try container.decode(String.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isDefault = try container.decode(Bool.self, forKey: .isDefault) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filters = try container.decode(StagesFilters.self, forKey: .filters) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(isDefault, forKey: .isDefault) + + try? container.encodeIfPresent(filters, forKey: .filters) + } + } + + /* + Model: StagesFilters + Used By: Order + */ + + class StagesFilters: Codable { + public var text: String? + + public var value: String? + + public var type: String? + + public var options: Options? + + public enum CodingKeys: String, CodingKey { + case text + + case value + + case type + + case options + } + + public init(options: Options?, text: String?, type: String?, value: String?) { + self.text = text + + self.value = value + + self.type = type + + self.options = options + } + + public func duplicate() -> StagesFilters { + let dict = self.dictionary! + let copy = StagesFilters(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + text = try container.decode(String.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + options = try container.decode(Options.self, forKey: .options) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(options, forKey: .options) + } + } + + /* + Model: Options + Used By: Order + */ + + class Options: Codable { + public var text: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case text + + case value + } + + public init(text: String?, value: String?) { + self.text = text + + self.value = value + } + + public func duplicate() -> Options { + let dict = self.dictionary! + let copy = Options(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + text = try container.decode(String.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: PlatformOrderPage + Used By: Order + */ + + class PlatformOrderPage: Codable { + public var next: String? + + public var previous: String? + + public var type: String? + + public var size: Int? + + public var current: Int? + + public var hasNext: Bool? + + public var total: Int? + + public var itemTotal: ItemTotal? + + public enum CodingKeys: String, CodingKey { + case next + + case previous + + case type + + case size + + case current + + case hasNext = "has_next" + + case total + + case itemTotal = "item_total" + } + + public init(current: Int?, hasNext: Bool?, itemTotal: ItemTotal?, next: String?, previous: String?, size: Int?, total: Int?, type: String?) { + self.next = next + + self.previous = previous + + self.type = type + + self.size = size + + self.current = current + + self.hasNext = hasNext + + self.total = total + + self.itemTotal = itemTotal + } + + public func duplicate() -> PlatformOrderPage { + let dict = self.dictionary! + let copy = PlatformOrderPage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + next = try container.decode(String.self, forKey: .next) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + previous = try container.decode(String.self, forKey: .previous) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(Int.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + current = try container.decode(Int.self, forKey: .current) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasNext = try container.decode(Bool.self, forKey: .hasNext) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + total = try container.decode(Int.self, forKey: .total) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemTotal = try container.decode(ItemTotal.self, forKey: .itemTotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(next, forKey: .next) + + try? container.encodeIfPresent(previous, forKey: .previous) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(current, forKey: .current) + + try? container.encodeIfPresent(hasNext, forKey: .hasNext) + + try? container.encodeIfPresent(total, forKey: .total) + + try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) + } + } + + /* + Model: AppliedFilters + Used By: Order + */ + + class AppliedFilters: Codable { + public var stage: String? + + public var stores: [String]? + + public var deploymentStores: [String]? + + public var dp: [Int]? + + public var fromDate: String? + + public var toDate: String? + + public enum CodingKeys: String, CodingKey { + case stage + + case stores + + case deploymentStores = "deployment_stores" + + case dp + + case fromDate = "from_date" + + case toDate = "to_date" + } + + public init(deploymentStores: [String]?, dp: [Int]?, fromDate: String?, stage: String?, stores: [String]?, toDate: String?) { + self.stage = stage + + self.stores = stores + + self.deploymentStores = deploymentStores + + self.dp = dp + + self.fromDate = fromDate + + self.toDate = toDate + } + + public func duplicate() -> AppliedFilters { + let dict = self.dictionary! + let copy = AppliedFilters(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + stage = try container.decode(String.self, forKey: .stage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stores = try container.decode([String].self, forKey: .stores) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deploymentStores = try container.decode([String].self, forKey: .deploymentStores) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dp = try container.decode([Int].self, forKey: .dp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fromDate = try container.decode(String.self, forKey: .fromDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + toDate = try container.decode(String.self, forKey: .toDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(stage, forKey: .stage) + + try? container.encodeIfPresent(stores, forKey: .stores) + + try? container.encodeIfPresent(deploymentStores, forKey: .deploymentStores) + + try? container.encodeIfPresent(dp, forKey: .dp) + + try? container.encodeIfPresent(fromDate, forKey: .fromDate) + + try? container.encodeIfPresent(toDate, forKey: .toDate) + } + } + + /* + Model: OrderDetails + Used By: Order + */ + + class OrderDetails: Codable { + public var items: [OrderPicklistListing] + + public var page: PlatformOrderPage + + public var filters: Filters + + public var nextOrderStatus: [String: Any] + + public var appliedFilters: AppliedFilters + + public enum CodingKeys: String, CodingKey { + case items + + case page + + case filters + + case nextOrderStatus = "next_order_status" + + case appliedFilters = "applied_filters" + } + + public init(appliedFilters: AppliedFilters, filters: Filters, items: [OrderPicklistListing], nextOrderStatus: [String: Any], page: PlatformOrderPage) { + self.items = items + + self.page = page + + self.filters = filters + + self.nextOrderStatus = nextOrderStatus + + self.appliedFilters = appliedFilters + } + + public func duplicate() -> OrderDetails { + let dict = self.dictionary! + let copy = OrderDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + items = try container.decode([OrderPicklistListing].self, forKey: .items) + + page = try container.decode(PlatformOrderPage.self, forKey: .page) + + filters = try container.decode(Filters.self, forKey: .filters) + + nextOrderStatus = try container.decode([String: Any].self, forKey: .nextOrderStatus) + + appliedFilters = try container.decode(AppliedFilters.self, forKey: .appliedFilters) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(filters, forKey: .filters) + + try? container.encodeIfPresent(nextOrderStatus, forKey: .nextOrderStatus) + + try? container.encodeIfPresent(appliedFilters, forKey: .appliedFilters) + } + } + + /* + Model: OrderDetailsItem + Used By: Order + */ + + class OrderDetailsItem: Codable { + public var user: PlatformOrderUserInfo? + + public var deliveryAddress: PlatformDeliveryAddress? + + public var channel: Channel? + + public var fyndstoreEmp: [String: Any]? + + public var orderingStore: [String: Any]? + + public var breakupValues: PlatformBreakupValues? + + public var id: String? + + public var application: PlatformApplication? + + public var shipments: PlatformShipmentDetails? + + public var createdAt: String? + + public var totalShipmentsInOrder: Int? + + public var payments: ItemsPayments? + + public var paymentMethods: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case user + + case deliveryAddress = "delivery_address" + + case channel + + case fyndstoreEmp = "fyndstore_emp" + + case orderingStore = "ordering_store" + + case breakupValues = "breakup_values" + + case id + + case application + + case shipments + + case createdAt = "created_at" + + case totalShipmentsInOrder = "total_shipments_in_order" + + case payments + + case paymentMethods = "payment_methods" + } + + public init(application: PlatformApplication?, breakupValues: PlatformBreakupValues?, channel: Channel?, createdAt: String?, deliveryAddress: PlatformDeliveryAddress?, fyndstoreEmp: [String: Any]?, id: String?, orderingStore: [String: Any]?, payments: ItemsPayments?, paymentMethods: [String: Any]?, shipments: PlatformShipmentDetails?, totalShipmentsInOrder: Int?, user: PlatformOrderUserInfo?) { + self.user = user + + self.deliveryAddress = deliveryAddress + + self.channel = channel + + self.fyndstoreEmp = fyndstoreEmp + + self.orderingStore = orderingStore + + self.breakupValues = breakupValues + + self.id = id + + self.application = application + + self.shipments = shipments + + self.createdAt = createdAt + + self.totalShipmentsInOrder = totalShipmentsInOrder + + self.payments = payments + + self.paymentMethods = paymentMethods + } + + public func duplicate() -> OrderDetailsItem { + let dict = self.dictionary! + let copy = OrderDetailsItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode(PlatformOrderUserInfo.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryAddress = try container.decode(PlatformDeliveryAddress.self, forKey: .deliveryAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + channel = try container.decode(Channel.self, forKey: .channel) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fyndstoreEmp = try container.decode([String: Any].self, forKey: .fyndstoreEmp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderingStore = try container.decode([String: Any].self, forKey: .orderingStore) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + breakupValues = try container.decode(PlatformBreakupValues.self, forKey: .breakupValues) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(PlatformApplication.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shipments = try container.decode(PlatformShipmentDetails.self, forKey: .shipments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalShipmentsInOrder = try container.decode(Int.self, forKey: .totalShipmentsInOrder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + payments = try container.decode(ItemsPayments.self, forKey: .payments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentMethods = try container.decode([String: Any].self, forKey: .paymentMethods) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(deliveryAddress, forKey: .deliveryAddress) + + try? container.encodeIfPresent(channel, forKey: .channel) + + try? container.encodeIfPresent(fyndstoreEmp, forKey: .fyndstoreEmp) + + try? container.encodeIfPresent(orderingStore, forKey: .orderingStore) + + try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(shipments, forKey: .shipments) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(totalShipmentsInOrder, forKey: .totalShipmentsInOrder) + + try? container.encodeIfPresent(payments, forKey: .payments) + + try? container.encodeIfPresent(paymentMethods, forKey: .paymentMethods) + } + } + + /* + Model: PlatformBreakupValues + Used By: Order + */ + + class PlatformBreakupValues: Codable { + public var display: String? + + public var value: Double? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case display + + case value + + case name + } + + public init(display: String?, name: String?, value: Double?) { + self.display = display + + self.value = value + + self.name = name + } + + public func duplicate() -> PlatformBreakupValues { + let dict = self.dictionary! + let copy = PlatformBreakupValues(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(Double.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: ArticleAssignment + Used By: Order + */ + + class ArticleAssignment: Codable { + public var strategy: String? + + public var level: String? + + public enum CodingKeys: String, CodingKey { + case strategy + + case level + } + + public init(level: String?, strategy: String?) { + self.strategy = strategy + + self.level = level + } + + public func duplicate() -> ArticleAssignment { + let dict = self.dictionary! + let copy = ArticleAssignment(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + strategy = try container.decode(String.self, forKey: .strategy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + level = try container.decode(String.self, forKey: .level) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(strategy, forKey: .strategy) + + try? container.encodeIfPresent(level, forKey: .level) + } + } + + /* + Model: PlatformShipmentDetails + Used By: Order + */ + + class PlatformShipmentDetails: Codable { + public var status: PlatformShipmentDetailsStatus? + + public var bags: BagsDetails? + + public var prices: ShipmentPrices? + + public var breakupValues: ShipmentBreakupValues? + + public var id: String? + + public var dpDetails: DpDetails? + + public var paymentMethods: [String: Any]? + + public var invoice: ShipmentInvoice? + + public var fulfillingStore: PlatformFulfillingStore? + + public var payments: Payments? + + public var gst: ShipmentGst? + + public var company: Company? + + public var brand: PlatformShipmentDetailsBrand? + + public var coupon: [String: Any]? + + public var orderSource: String? + + public var isNotFyndSource: Bool? + + public var canBreak: [String: Any]? + + public var comment: String? + + public var promise: Promise? + + public var trackingDetails: ShipmentTrackingDetails? + + public var isFyndCoupon: Bool? + + public var orderType: String? + + public var totalShipmentBags: Int? + + public var pod: [String: Any]? + + public var lockStatus: Bool? + + public var priority: Double? + + public var priorityText: String? + + public var orderingChannel: String? + + public var creditNoteId: String? + + public var autoTriggerDpAssignment: Bool? + + public var packagingType: String? + + public var dates: ShipmentDates? + + public enum CodingKeys: String, CodingKey { + case status + + case bags + + case prices + + case breakupValues = "breakup_values" + + case id + + case dpDetails = "dp_details" + + case paymentMethods = "payment_methods" + + case invoice + + case fulfillingStore = "fulfilling_store" + + case payments + + case gst + + case company + + case brand + + case coupon + + case orderSource = "order_source" + + case isNotFyndSource = "is_not_fynd_source" + + case canBreak = "can_break" + + case comment + + case promise + + case trackingDetails = "tracking_details" + + case isFyndCoupon = "is_fynd_coupon" + + case orderType = "order_type" + + case totalShipmentBags = "total_shipment_bags" + + case pod + + case lockStatus = "lock_status" + + case priority + + case priorityText = "priority_text" + + case orderingChannel = "ordering_channel" + + case creditNoteId = "credit_note_id" + + case autoTriggerDpAssignment = "auto_trigger_dp_assignment" + + case packagingType = "packaging_type" + + case dates + } + + public init(autoTriggerDpAssignment: Bool?, bags: BagsDetails?, brand: PlatformShipmentDetailsBrand?, breakupValues: ShipmentBreakupValues?, canBreak: [String: Any]?, comment: String?, company: Company?, coupon: [String: Any]?, creditNoteId: String?, dates: ShipmentDates?, dpDetails: DpDetails?, fulfillingStore: PlatformFulfillingStore?, gst: ShipmentGst?, id: String?, invoice: ShipmentInvoice?, isFyndCoupon: Bool?, isNotFyndSource: Bool?, lockStatus: Bool?, orderingChannel: String?, orderSource: String?, orderType: String?, packagingType: String?, payments: Payments?, paymentMethods: [String: Any]?, pod: [String: Any]?, prices: ShipmentPrices?, priority: Double?, priorityText: String?, promise: Promise?, status: PlatformShipmentDetailsStatus?, totalShipmentBags: Int?, trackingDetails: ShipmentTrackingDetails?) { + self.status = status + + self.bags = bags + + self.prices = prices + + self.breakupValues = breakupValues + + self.id = id + + self.dpDetails = dpDetails + + self.paymentMethods = paymentMethods + + self.invoice = invoice + + self.fulfillingStore = fulfillingStore + + self.payments = payments + + self.gst = gst + + self.company = company + + self.brand = brand + + self.coupon = coupon + + self.orderSource = orderSource + + self.isNotFyndSource = isNotFyndSource + + self.canBreak = canBreak + + self.comment = comment + + self.promise = promise + + self.trackingDetails = trackingDetails + + self.isFyndCoupon = isFyndCoupon + + self.orderType = orderType + + self.totalShipmentBags = totalShipmentBags + + self.pod = pod + + self.lockStatus = lockStatus + + self.priority = priority + + self.priorityText = priorityText + + self.orderingChannel = orderingChannel + + self.creditNoteId = creditNoteId + + self.autoTriggerDpAssignment = autoTriggerDpAssignment + + self.packagingType = packagingType + + self.dates = dates + } + + public func duplicate() -> PlatformShipmentDetails { + let dict = self.dictionary! + let copy = PlatformShipmentDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + status = try container.decode(PlatformShipmentDetailsStatus.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bags = try container.decode(BagsDetails.self, forKey: .bags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + prices = try container.decode(ShipmentPrices.self, forKey: .prices) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + breakupValues = try container.decode(ShipmentBreakupValues.self, forKey: .breakupValues) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dpDetails = try container.decode(DpDetails.self, forKey: .dpDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentMethods = try container.decode([String: Any].self, forKey: .paymentMethods) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + invoice = try container.decode(ShipmentInvoice.self, forKey: .invoice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fulfillingStore = try container.decode(PlatformFulfillingStore.self, forKey: .fulfillingStore) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + payments = try container.decode(Payments.self, forKey: .payments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gst = try container.decode(ShipmentGst.self, forKey: .gst) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + company = try container.decode(Company.self, forKey: .company) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brand = try container.decode(PlatformShipmentDetailsBrand.self, forKey: .brand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + coupon = try container.decode([String: Any].self, forKey: .coupon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderSource = try container.decode(String.self, forKey: .orderSource) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isNotFyndSource = try container.decode(Bool.self, forKey: .isNotFyndSource) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + canBreak = try container.decode([String: Any].self, forKey: .canBreak) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + comment = try container.decode(String.self, forKey: .comment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + promise = try container.decode(Promise.self, forKey: .promise) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + trackingDetails = try container.decode(ShipmentTrackingDetails.self, forKey: .trackingDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isFyndCoupon = try container.decode(Bool.self, forKey: .isFyndCoupon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderType = try container.decode(String.self, forKey: .orderType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalShipmentBags = try container.decode(Int.self, forKey: .totalShipmentBags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pod = try container.decode([String: Any].self, forKey: .pod) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lockStatus = try container.decode(Bool.self, forKey: .lockStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priority = try container.decode(Double.self, forKey: .priority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priorityText = try container.decode(String.self, forKey: .priorityText) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderingChannel = try container.decode(String.self, forKey: .orderingChannel) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + creditNoteId = try container.decode(String.self, forKey: .creditNoteId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + autoTriggerDpAssignment = try container.decode(Bool.self, forKey: .autoTriggerDpAssignment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + packagingType = try container.decode(String.self, forKey: .packagingType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dates = try container.decode(ShipmentDates.self, forKey: .dates) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(bags, forKey: .bags) + + try? container.encodeIfPresent(prices, forKey: .prices) + + try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(dpDetails, forKey: .dpDetails) + + try? container.encodeIfPresent(paymentMethods, forKey: .paymentMethods) + + try? container.encodeIfPresent(invoice, forKey: .invoice) + + try? container.encodeIfPresent(fulfillingStore, forKey: .fulfillingStore) + + try? container.encodeIfPresent(payments, forKey: .payments) + + try? container.encodeIfPresent(gst, forKey: .gst) + + try? container.encodeIfPresent(company, forKey: .company) + + try? container.encodeIfPresent(brand, forKey: .brand) + + try? container.encodeIfPresent(coupon, forKey: .coupon) + + try? container.encodeIfPresent(orderSource, forKey: .orderSource) + + try? container.encodeIfPresent(isNotFyndSource, forKey: .isNotFyndSource) + + try? container.encodeIfPresent(canBreak, forKey: .canBreak) + + try? container.encodeIfPresent(comment, forKey: .comment) + + try? container.encodeIfPresent(promise, forKey: .promise) + + try? container.encodeIfPresent(trackingDetails, forKey: .trackingDetails) + + try? container.encodeIfPresent(isFyndCoupon, forKey: .isFyndCoupon) + + try? container.encodeIfPresent(orderType, forKey: .orderType) + + try? container.encodeIfPresent(totalShipmentBags, forKey: .totalShipmentBags) + + try? container.encodeIfPresent(pod, forKey: .pod) + + try? container.encodeIfPresent(lockStatus, forKey: .lockStatus) + + try? container.encodeIfPresent(priority, forKey: .priority) + + try? container.encodeIfPresent(priorityText, forKey: .priorityText) + + try? container.encodeIfPresent(orderingChannel, forKey: .orderingChannel) + + try? container.encodeIfPresent(creditNoteId, forKey: .creditNoteId) + + try? container.encodeIfPresent(autoTriggerDpAssignment, forKey: .autoTriggerDpAssignment) + + try? container.encodeIfPresent(packagingType, forKey: .packagingType) + + try? container.encodeIfPresent(dates, forKey: .dates) + } + } + + /* + Model: PlatformShipmentDetailsStatus + Used By: Order + */ + + class PlatformShipmentDetailsStatus: Codable { + public var id: Int? + + public var bagList: [Int]? + + public var createdAt: String? + + public var status: String? + + public var name: String? + + public var progress: Int? + + public var shipmentId: String? + + public var currentShipmentStatus: String? + + public var colorCode: String? + + public enum CodingKeys: String, CodingKey { + case id + + case bagList = "bag_list" + + case createdAt = "created_at" + + case status + + case name + + case progress + + case shipmentId = "shipment_id" + + case currentShipmentStatus = "current_shipment_status" + + case colorCode = "color_code" + } + + public init(bagList: [Int]?, colorCode: String?, createdAt: String?, currentShipmentStatus: String?, id: Int?, name: String?, progress: Int?, shipmentId: String?, status: String?) { + self.id = id + + self.bagList = bagList + + self.createdAt = createdAt + + self.status = status + + self.name = name + + self.progress = progress + + self.shipmentId = shipmentId + + self.currentShipmentStatus = currentShipmentStatus + + self.colorCode = colorCode + } + + public func duplicate() -> PlatformShipmentDetailsStatus { + let dict = self.dictionary! + let copy = PlatformShipmentDetailsStatus(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bagList = try container.decode([Int].self, forKey: .bagList) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + progress = try container.decode(Int.self, forKey: .progress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shipmentId = try container.decode(String.self, forKey: .shipmentId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currentShipmentStatus = try container.decode(String.self, forKey: .currentShipmentStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + colorCode = try container.decode(String.self, forKey: .colorCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(bagList, forKey: .bagList) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(progress, forKey: .progress) + + try? container.encodeIfPresent(shipmentId, forKey: .shipmentId) + + try? container.encodeIfPresent(currentShipmentStatus, forKey: .currentShipmentStatus) + + try? container.encodeIfPresent(colorCode, forKey: .colorCode) + } + } + + /* + Model: BagsDetails + Used By: Order + */ + + class BagsDetails: Codable { + public var financialBreakup: [BagFinancialBreakup]? + + public var status: BagCurrStatus? + + public var item: BagItem? + + public var article: BagArticle? + + public var id: Int? + + public var prices: BagPrices? + + public var gstDetails: GstDetails? + + public var breakupValues: BagBreakupValues? + + public var updateTime: Int? + + public var currentStatus: BagCurrentStatus? + + public var bagStatus: BagStatus? + + public var canCancel: Bool? + + public var canReturn: Bool? + + public var paymentMethods: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case financialBreakup = "financial_breakup" + + case status + + case item + + case article + + case id + + case prices + + case gstDetails = "gst_details" + + case breakupValues = "breakup_values" + + case updateTime = "update_time" + + case currentStatus = "current_status" + + case bagStatus = "bag_status" + + case canCancel = "can_cancel" + + case canReturn = "can_return" + + case paymentMethods = "payment_methods" + } + + public init(article: BagArticle?, bagStatus: BagStatus?, breakupValues: BagBreakupValues?, canCancel: Bool?, canReturn: Bool?, currentStatus: BagCurrentStatus?, financialBreakup: [BagFinancialBreakup]?, gstDetails: GstDetails?, id: Int?, item: BagItem?, paymentMethods: [String: Any]?, prices: BagPrices?, status: BagCurrStatus?, updateTime: Int?) { + self.financialBreakup = financialBreakup + + self.status = status + + self.item = item + + self.article = article + + self.id = id + + self.prices = prices + + self.gstDetails = gstDetails + + self.breakupValues = breakupValues + + self.updateTime = updateTime + + self.currentStatus = currentStatus + + self.bagStatus = bagStatus + + self.canCancel = canCancel + + self.canReturn = canReturn + + self.paymentMethods = paymentMethods + } + + public func duplicate() -> BagsDetails { + let dict = self.dictionary! + let copy = BagsDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + financialBreakup = try container.decode([BagFinancialBreakup].self, forKey: .financialBreakup) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(BagCurrStatus.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + item = try container.decode(BagItem.self, forKey: .item) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + article = try container.decode(BagArticle.self, forKey: .article) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + prices = try container.decode(BagPrices.self, forKey: .prices) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstDetails = try container.decode(GstDetails.self, forKey: .gstDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + breakupValues = try container.decode(BagBreakupValues.self, forKey: .breakupValues) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updateTime = try container.decode(Int.self, forKey: .updateTime) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currentStatus = try container.decode(BagCurrentStatus.self, forKey: .currentStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bagStatus = try container.decode(BagStatus.self, forKey: .bagStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + canCancel = try container.decode(Bool.self, forKey: .canCancel) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + canReturn = try container.decode(Bool.self, forKey: .canReturn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentMethods = try container.decode([String: Any].self, forKey: .paymentMethods) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(financialBreakup, forKey: .financialBreakup) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(item, forKey: .item) + + try? container.encodeIfPresent(article, forKey: .article) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(prices, forKey: .prices) + + try? container.encodeIfPresent(gstDetails, forKey: .gstDetails) + + try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) + + try? container.encodeIfPresent(updateTime, forKey: .updateTime) + + try? container.encodeIfPresent(currentStatus, forKey: .currentStatus) + + try? container.encodeIfPresent(bagStatus, forKey: .bagStatus) + + try? container.encodeIfPresent(canCancel, forKey: .canCancel) + + try? container.encodeIfPresent(canReturn, forKey: .canReturn) + + try? container.encodeIfPresent(paymentMethods, forKey: .paymentMethods) + } + } + + /* + Model: BagFinancialBreakup + Used By: Order + */ + + class BagFinancialBreakup: Codable { + public var valueOfGood: Double? + + public var hsnCode: String? + + public var priceEffective: Double? + + public var codCharges: Double? + + public var gstFee: String? + + public var fyndCredits: Double? + + public var refundAmount: Double? + + public var cashbackApplied: Double? + + public var transferPrice: Double? + + public var amountPaidRoundoff: Double? + + public var couponValue: Double? + + public var amountPaid: Double? + + public var gstTaxPercentage: Double? + + public var size: String? + + public var totalUnits: Int? + + public var discount: Double? + + public var couponEffectiveDiscount: Double? + + public var cashback: Double? + + public var promotionEffectiveDiscount: Double? + + public var gstTag: String? + + public var deliveryCharge: Double? + + public var refundCredit: Double? + + public var priceMarked: Double? + + public var identifiers: Identifiers? + + public var itemName: String? + + public var addedToFyndCash: Bool? + + public var brandCalculatedAmount: Double? + + public enum CodingKeys: String, CodingKey { + case valueOfGood = "value_of_good" + + case hsnCode = "hsn_code" + + case priceEffective = "price_effective" + + case codCharges = "cod_charges" + + case gstFee = "gst_fee" + + case fyndCredits = "fynd_credits" + + case refundAmount = "refund_amount" + + case cashbackApplied = "cashback_applied" + + case transferPrice = "transfer_price" + + case amountPaidRoundoff = "amount_paid_roundoff" + + case couponValue = "coupon_value" + + case amountPaid = "amount_paid" + + case gstTaxPercentage = "gst_tax_percentage" + + case size + + case totalUnits = "total_units" + + case discount + + case couponEffectiveDiscount = "coupon_effective_discount" + + case cashback + + case promotionEffectiveDiscount = "promotion_effective_discount" + + case gstTag = "gst_tag" + + case deliveryCharge = "delivery_charge" + + case refundCredit = "refund_credit" + + case priceMarked = "price_marked" + + case identifiers + + case itemName = "item_name" + + case addedToFyndCash = "added_to_fynd_cash" + + case brandCalculatedAmount = "brand_calculated_amount" + } + + public init(addedToFyndCash: Bool?, amountPaid: Double?, amountPaidRoundoff: Double?, brandCalculatedAmount: Double?, cashback: Double?, cashbackApplied: Double?, codCharges: Double?, couponEffectiveDiscount: Double?, couponValue: Double?, deliveryCharge: Double?, discount: Double?, fyndCredits: Double?, gstFee: String?, gstTag: String?, gstTaxPercentage: Double?, hsnCode: String?, identifiers: Identifiers?, itemName: String?, priceEffective: Double?, priceMarked: Double?, promotionEffectiveDiscount: Double?, refundAmount: Double?, refundCredit: Double?, size: String?, totalUnits: Int?, transferPrice: Double?, valueOfGood: Double?) { + self.valueOfGood = valueOfGood + + self.hsnCode = hsnCode + + self.priceEffective = priceEffective + + self.codCharges = codCharges + + self.gstFee = gstFee + + self.fyndCredits = fyndCredits + + self.refundAmount = refundAmount + + self.cashbackApplied = cashbackApplied + + self.transferPrice = transferPrice + + self.amountPaidRoundoff = amountPaidRoundoff + + self.couponValue = couponValue + + self.amountPaid = amountPaid + + self.gstTaxPercentage = gstTaxPercentage + + self.size = size + + self.totalUnits = totalUnits + + self.discount = discount + + self.couponEffectiveDiscount = couponEffectiveDiscount + + self.cashback = cashback + + self.promotionEffectiveDiscount = promotionEffectiveDiscount + + self.gstTag = gstTag + + self.deliveryCharge = deliveryCharge + + self.refundCredit = refundCredit + + self.priceMarked = priceMarked + + self.identifiers = identifiers + + self.itemName = itemName + + self.addedToFyndCash = addedToFyndCash + + self.brandCalculatedAmount = brandCalculatedAmount + } + + public func duplicate() -> BagFinancialBreakup { + let dict = self.dictionary! + let copy = BagFinancialBreakup(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + valueOfGood = try container.decode(Double.self, forKey: .valueOfGood) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hsnCode = try container.decode(String.self, forKey: .hsnCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priceEffective = try container.decode(Double.self, forKey: .priceEffective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + codCharges = try container.decode(Double.self, forKey: .codCharges) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstFee = try container.decode(String.self, forKey: .gstFee) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fyndCredits = try container.decode(Double.self, forKey: .fyndCredits) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refundAmount = try container.decode(Double.self, forKey: .refundAmount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cashbackApplied = try container.decode(Double.self, forKey: .cashbackApplied) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + transferPrice = try container.decode(Double.self, forKey: .transferPrice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + amountPaidRoundoff = try container.decode(Double.self, forKey: .amountPaidRoundoff) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + couponValue = try container.decode(Double.self, forKey: .couponValue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + amountPaid = try container.decode(Double.self, forKey: .amountPaid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstTaxPercentage = try container.decode(Double.self, forKey: .gstTaxPercentage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(String.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalUnits = try container.decode(Int.self, forKey: .totalUnits) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discount = try container.decode(Double.self, forKey: .discount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + couponEffectiveDiscount = try container.decode(Double.self, forKey: .couponEffectiveDiscount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cashback = try container.decode(Double.self, forKey: .cashback) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + promotionEffectiveDiscount = try container.decode(Double.self, forKey: .promotionEffectiveDiscount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstTag = try container.decode(String.self, forKey: .gstTag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryCharge = try container.decode(Double.self, forKey: .deliveryCharge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refundCredit = try container.decode(Double.self, forKey: .refundCredit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priceMarked = try container.decode(Double.self, forKey: .priceMarked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + identifiers = try container.decode(Identifiers.self, forKey: .identifiers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemName = try container.decode(String.self, forKey: .itemName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addedToFyndCash = try container.decode(Bool.self, forKey: .addedToFyndCash) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandCalculatedAmount = try container.decode(Double.self, forKey: .brandCalculatedAmount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(valueOfGood, forKey: .valueOfGood) + + try? container.encodeIfPresent(hsnCode, forKey: .hsnCode) + + try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) + + try? container.encodeIfPresent(codCharges, forKey: .codCharges) + + try? container.encodeIfPresent(gstFee, forKey: .gstFee) + + try? container.encodeIfPresent(fyndCredits, forKey: .fyndCredits) + + try? container.encodeIfPresent(refundAmount, forKey: .refundAmount) + + try? container.encodeIfPresent(cashbackApplied, forKey: .cashbackApplied) + + try? container.encodeIfPresent(transferPrice, forKey: .transferPrice) + + try? container.encodeIfPresent(amountPaidRoundoff, forKey: .amountPaidRoundoff) + + try? container.encodeIfPresent(couponValue, forKey: .couponValue) + + try? container.encodeIfPresent(amountPaid, forKey: .amountPaid) + + try? container.encodeIfPresent(gstTaxPercentage, forKey: .gstTaxPercentage) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(totalUnits, forKey: .totalUnits) + + try? container.encodeIfPresent(discount, forKey: .discount) + + try? container.encodeIfPresent(couponEffectiveDiscount, forKey: .couponEffectiveDiscount) + + try? container.encodeIfPresent(cashback, forKey: .cashback) + + try? container.encodeIfPresent(promotionEffectiveDiscount, forKey: .promotionEffectiveDiscount) + + try? container.encodeIfPresent(gstTag, forKey: .gstTag) + + try? container.encodeIfPresent(deliveryCharge, forKey: .deliveryCharge) + + try? container.encodeIfPresent(refundCredit, forKey: .refundCredit) + + try? container.encodeIfPresent(priceMarked, forKey: .priceMarked) + + try? container.encodeIfPresent(identifiers, forKey: .identifiers) + + try? container.encodeIfPresent(itemName, forKey: .itemName) + + try? container.encodeIfPresent(addedToFyndCash, forKey: .addedToFyndCash) + + try? container.encodeIfPresent(brandCalculatedAmount, forKey: .brandCalculatedAmount) + } + } + + /* + Model: Identifiers + Used By: Order + */ + + class Identifiers: Codable { + public var ean: String? + + public enum CodingKeys: String, CodingKey { + case ean + } + + public init(ean: String?) { + self.ean = ean + } + + public func duplicate() -> Identifiers { + let dict = self.dictionary! + let copy = Identifiers(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + ean = try container.decode(String.self, forKey: .ean) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(ean, forKey: .ean) + } + } + + /* + Model: BagCurrStatus + Used By: Order + */ + + class BagCurrStatus: Codable { + public var enableTracking: Bool? + + public var isCustomerReturnAllowed: Bool? + + public var isActive: Bool? + + public var isReturnable: Bool? + + public var canBeCancelled: Bool? + + public enum CodingKeys: String, CodingKey { + case enableTracking = "enable_tracking" + + case isCustomerReturnAllowed = "is_customer_return_allowed" + + case isActive = "is_active" + + case isReturnable = "is_returnable" + + case canBeCancelled = "can_be_cancelled" + } + + public init(canBeCancelled: Bool?, enableTracking: Bool?, isActive: Bool?, isCustomerReturnAllowed: Bool?, isReturnable: Bool?) { + self.enableTracking = enableTracking + + self.isCustomerReturnAllowed = isCustomerReturnAllowed + + self.isActive = isActive + + self.isReturnable = isReturnable + + self.canBeCancelled = canBeCancelled + } + + public func duplicate() -> BagCurrStatus { + let dict = self.dictionary! + let copy = BagCurrStatus(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enableTracking = try container.decode(Bool.self, forKey: .enableTracking) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isCustomerReturnAllowed = try container.decode(Bool.self, forKey: .isCustomerReturnAllowed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isReturnable = try container.decode(Bool.self, forKey: .isReturnable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + canBeCancelled = try container.decode(Bool.self, forKey: .canBeCancelled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enableTracking, forKey: .enableTracking) + + try? container.encodeIfPresent(isCustomerReturnAllowed, forKey: .isCustomerReturnAllowed) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(isReturnable, forKey: .isReturnable) + + try? container.encodeIfPresent(canBeCancelled, forKey: .canBeCancelled) + } + } + + /* + Model: BagArticle + Used By: Order + */ + + class BagArticle: Codable { + public var identifiers: ArticleIdentifiers? + + public var espModified: Bool? + + public var isSet: Bool? + + public var size: String? + + public var code: String? + + public var set: Set? + + public var sellerIdentifier: String? + + public var returnConfig: BagArticleReturnConfig? + + public var id: String? + + public var uid: String? + + public var childDetails: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case identifiers + + case espModified = "esp_modified" + + case isSet = "is_set" + + case size + + case code + + case set + + case sellerIdentifier = "seller_identifier" + + case returnConfig = "return_config" + + case id = "_id" + + case uid + + case childDetails = "child_details" + } + + public init(childDetails: [String: Any]?, code: String?, espModified: Bool?, identifiers: ArticleIdentifiers?, isSet: Bool?, returnConfig: BagArticleReturnConfig?, sellerIdentifier: String?, set: Set?, size: String?, uid: String?, id: String?) { + self.identifiers = identifiers + + self.espModified = espModified + + self.isSet = isSet + + self.size = size + + self.code = code + + self.set = set + + self.sellerIdentifier = sellerIdentifier + + self.returnConfig = returnConfig + + self.id = id + + self.uid = uid + + self.childDetails = childDetails + } + + public func duplicate() -> BagArticle { + let dict = self.dictionary! + let copy = BagArticle(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + identifiers = try container.decode(ArticleIdentifiers.self, forKey: .identifiers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + espModified = try container.decode(Bool.self, forKey: .espModified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isSet = try container.decode(Bool.self, forKey: .isSet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(String.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + set = try container.decode(Set.self, forKey: .set) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sellerIdentifier = try container.decode(String.self, forKey: .sellerIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + returnConfig = try container.decode(BagArticleReturnConfig.self, forKey: .returnConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + childDetails = try container.decode([String: Any].self, forKey: .childDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(identifiers, forKey: .identifiers) + + try? container.encodeIfPresent(espModified, forKey: .espModified) + + try? container.encodeIfPresent(isSet, forKey: .isSet) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(set, forKey: .set) + + try? container.encodeIfPresent(sellerIdentifier, forKey: .sellerIdentifier) + + try? container.encodeIfPresent(returnConfig, forKey: .returnConfig) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(childDetails, forKey: .childDetails) + } + } + + /* + Model: ArticleIdentifiers + Used By: Order + */ + + class ArticleIdentifiers: Codable { + public var ean: String? + + public enum CodingKeys: String, CodingKey { + case ean + } + + public init(ean: String?) { + self.ean = ean + } + + public func duplicate() -> ArticleIdentifiers { + let dict = self.dictionary! + let copy = ArticleIdentifiers(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + ean = try container.decode(String.self, forKey: .ean) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(ean, forKey: .ean) + } + } + + /* + Model: Set + Used By: Order + */ + + class Set: Codable { + public var quantity: Int? + + public var sizeDistribution: SetSizeDistribution? + + public enum CodingKeys: String, CodingKey { + case quantity + + case sizeDistribution = "size_distribution" + } + + public init(quantity: Int?, sizeDistribution: SetSizeDistribution?) { + self.quantity = quantity + + self.sizeDistribution = sizeDistribution + } + + public func duplicate() -> Set { + let dict = self.dictionary! + let copy = Set(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + quantity = try container.decode(Int.self, forKey: .quantity) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sizeDistribution = try container.decode(SetSizeDistribution.self, forKey: .sizeDistribution) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(quantity, forKey: .quantity) + + try? container.encodeIfPresent(sizeDistribution, forKey: .sizeDistribution) + } + } + + /* + Model: SetSizeDistribution + Used By: Order + */ + + class SetSizeDistribution: Codable { + public var sizes: Sizes? + + public enum CodingKeys: String, CodingKey { + case sizes + } + + public init(sizes: Sizes?) { + self.sizes = sizes + } + + public func duplicate() -> SetSizeDistribution { + let dict = self.dictionary! + let copy = SetSizeDistribution(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + sizes = try container.decode(Sizes.self, forKey: .sizes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(sizes, forKey: .sizes) + } + } + + /* + Model: Sizes + Used By: Order + */ + + class Sizes: Codable { + public var size: String? + + public var pieces: Int? + + public enum CodingKeys: String, CodingKey { + case size + + case pieces + } + + public init(pieces: Int?, size: String?) { + self.size = size + + self.pieces = pieces + } + + public func duplicate() -> Sizes { + let dict = self.dictionary! + let copy = Sizes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + size = try container.decode(String.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pieces = try container.decode(Int.self, forKey: .pieces) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(pieces, forKey: .pieces) + } + } + + /* + Model: BagArticleReturnConfig + Used By: Order + */ + + class BagArticleReturnConfig: Codable { + public var time: Int? + + public var unit: String? + + public var returnable: Bool? + + public enum CodingKeys: String, CodingKey { + case time + + case unit + + case returnable + } + + public init(returnable: Bool?, time: Int?, unit: String?) { + self.time = time + + self.unit = unit + + self.returnable = returnable + } + + public func duplicate() -> BagArticleReturnConfig { + let dict = self.dictionary! + let copy = BagArticleReturnConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + time = try container.decode(Int.self, forKey: .time) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + unit = try container.decode(String.self, forKey: .unit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + returnable = try container.decode(Bool.self, forKey: .returnable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(time, forKey: .time) + + try? container.encodeIfPresent(unit, forKey: .unit) + + try? container.encodeIfPresent(returnable, forKey: .returnable) + } + } + + /* + Model: GstDetails + Used By: Order + */ + + class GstDetails: Codable { + public var brandCalculatedAmount: Double? + + public var gstFee: String? + + public var gstTag: String? + + public var hsnCode: String? + + public var valueOfGood: Double? + + public var gstTaxPercentage: Double? + + public var isDefaultHsnCode: Bool? + + public enum CodingKeys: String, CodingKey { + case brandCalculatedAmount = "brand_calculated_amount" + + case gstFee = "gst_fee" + + case gstTag = "gst_tag" + + case hsnCode = "hsn_code" + + case valueOfGood = "value_of_good" + + case gstTaxPercentage = "gst_tax_percentage" + + case isDefaultHsnCode = "is_default_hsn_code" + } + + public init(brandCalculatedAmount: Double?, gstFee: String?, gstTag: String?, gstTaxPercentage: Double?, hsnCode: String?, isDefaultHsnCode: Bool?, valueOfGood: Double?) { + self.brandCalculatedAmount = brandCalculatedAmount + + self.gstFee = gstFee + + self.gstTag = gstTag + + self.hsnCode = hsnCode + + self.valueOfGood = valueOfGood + + self.gstTaxPercentage = gstTaxPercentage + + self.isDefaultHsnCode = isDefaultHsnCode + } + + public func duplicate() -> GstDetails { + let dict = self.dictionary! + let copy = GstDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + brandCalculatedAmount = try container.decode(Double.self, forKey: .brandCalculatedAmount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstFee = try container.decode(String.self, forKey: .gstFee) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstTag = try container.decode(String.self, forKey: .gstTag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hsnCode = try container.decode(String.self, forKey: .hsnCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + valueOfGood = try container.decode(Double.self, forKey: .valueOfGood) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstTaxPercentage = try container.decode(Double.self, forKey: .gstTaxPercentage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isDefaultHsnCode = try container.decode(Bool.self, forKey: .isDefaultHsnCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(brandCalculatedAmount, forKey: .brandCalculatedAmount) + + try? container.encodeIfPresent(gstFee, forKey: .gstFee) + + try? container.encodeIfPresent(gstTag, forKey: .gstTag) + + try? container.encodeIfPresent(hsnCode, forKey: .hsnCode) + + try? container.encodeIfPresent(valueOfGood, forKey: .valueOfGood) + + try? container.encodeIfPresent(gstTaxPercentage, forKey: .gstTaxPercentage) + + try? container.encodeIfPresent(isDefaultHsnCode, forKey: .isDefaultHsnCode) + } + } + + /* + Model: BagBreakupValues + Used By: Order + */ + + class BagBreakupValues: Codable { + public var name: String? + + public var display: String? + + public var value: Double? + + public enum CodingKeys: String, CodingKey { + case name + + case display + + case value + } + + public init(display: String?, name: String?, value: Double?) { + self.name = name + + self.display = display + + self.value = value + } + + public func duplicate() -> BagBreakupValues { + let dict = self.dictionary! + let copy = BagBreakupValues(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(Double.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: BagCurrentStatus + Used By: Order + */ + + class BagCurrentStatus: Codable { + public var updatedAt: String? + + public var bagStateMapper: BagStateMapper? + + public var status: String? + + public var stateType: String? + + public enum CodingKeys: String, CodingKey { + case updatedAt = "updated_at" + + case bagStateMapper = "bag_state_mapper" + + case status + + case stateType = "state_type" + } + + public init(bagStateMapper: BagStateMapper?, stateType: String?, status: String?, updatedAt: String?) { + self.updatedAt = updatedAt + + self.bagStateMapper = bagStateMapper + + self.status = status + + self.stateType = stateType + } + + public func duplicate() -> BagCurrentStatus { + let dict = self.dictionary! + let copy = BagCurrentStatus(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bagStateMapper = try container.decode(BagStateMapper.self, forKey: .bagStateMapper) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stateType = try container.decode(String.self, forKey: .stateType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(bagStateMapper, forKey: .bagStateMapper) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(stateType, forKey: .stateType) + } + } + + /* + Model: BagStateMapper + Used By: Order + */ + + class BagStateMapper: Codable { + public var appStateName: String? + + public var isActive: Bool? + + public var displayName: String? + + public var name: String? + + public var appDisplayName: String? + + public enum CodingKeys: String, CodingKey { + case appStateName = "app_state_name" + + case isActive = "is_active" + + case displayName = "display_name" + + case name + + case appDisplayName = "app_display_name" + } + + public init(appDisplayName: String?, appStateName: String?, displayName: String?, isActive: Bool?, name: String?) { + self.appStateName = appStateName + + self.isActive = isActive + + self.displayName = displayName + + self.name = name + + self.appDisplayName = appDisplayName + } + + public func duplicate() -> BagStateMapper { + let dict = self.dictionary! + let copy = BagStateMapper(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + appStateName = try container.decode(String.self, forKey: .appStateName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appDisplayName = try container.decode(String.self, forKey: .appDisplayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appStateName, forKey: .appStateName) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(appDisplayName, forKey: .appDisplayName) + } + } + + /* + Model: BagStatus + Used By: Order + */ + + class BagStatus: Codable { + public var status: String? + + public var stateType: String? + + public var updatedAt: String? + + public var bagStateMapper: BagStatusBagStateMapper? + + public enum CodingKeys: String, CodingKey { + case status + + case stateType = "state_type" + + case updatedAt = "updated_at" + + case bagStateMapper = "bag_state_mapper" + } + + public init(bagStateMapper: BagStatusBagStateMapper?, stateType: String?, status: String?, updatedAt: String?) { + self.status = status + + self.stateType = stateType + + self.updatedAt = updatedAt + + self.bagStateMapper = bagStateMapper + } + + public func duplicate() -> BagStatus { + let dict = self.dictionary! + let copy = BagStatus(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stateType = try container.decode(String.self, forKey: .stateType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bagStateMapper = try container.decode(BagStatusBagStateMapper.self, forKey: .bagStateMapper) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(stateType, forKey: .stateType) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(bagStateMapper, forKey: .bagStateMapper) + } + } + + /* + Model: BagStatusBagStateMapper + Used By: Order + */ + + class BagStatusBagStateMapper: Codable { + public var isActive: Bool? + + public var displayName: String? + + public var name: String? + + public var appDisplayName: String? + + public var appStateName: String? + + public enum CodingKeys: String, CodingKey { + case isActive = "is_active" + + case displayName = "display_name" + + case name + + case appDisplayName = "app_display_name" + + case appStateName = "app_state_name" + } + + public init(appDisplayName: String?, appStateName: String?, displayName: String?, isActive: Bool?, name: String?) { + self.isActive = isActive + + self.displayName = displayName + + self.name = name + + self.appDisplayName = appDisplayName + + self.appStateName = appStateName + } + + public func duplicate() -> BagStatusBagStateMapper { + let dict = self.dictionary! + let copy = BagStatusBagStateMapper(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appDisplayName = try container.decode(String.self, forKey: .appDisplayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appStateName = try container.decode(String.self, forKey: .appStateName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(appDisplayName, forKey: .appDisplayName) + + try? container.encodeIfPresent(appStateName, forKey: .appStateName) + } + } + + /* + Model: BagPrices + Used By: Order + */ + + class BagPrices: Codable { + public var cashback: Double? + + public var refundCredit: Double? + + public var couponValue: Double? + + public var deliveryCharge: Double? + + public var fyndCredits: Double? + + public var priceMarked: Double? + + public var cashbackApplied: Double? + + public var valueOfGood: Double? + + public var amountPaidRoundoff: Double? + + public var amountPaid: Double? + + public var codCharges: Double? + + public var priceEffective: Double? + + public var refundAmount: Double? + + public var discount: Double? + + public enum CodingKeys: String, CodingKey { + case cashback + + case refundCredit = "refund_credit" + + case couponValue = "coupon_value" + + case deliveryCharge = "delivery_charge" + + case fyndCredits = "fynd_credits" + + case priceMarked = "price_marked" + + case cashbackApplied = "cashback_applied" + + case valueOfGood = "value_of_good" + + case amountPaidRoundoff = "amount_paid_roundoff" + + case amountPaid = "amount_paid" + + case codCharges = "cod_charges" + + case priceEffective = "price_effective" + + case refundAmount = "refund_amount" + + case discount + } + + public init(amountPaid: Double?, amountPaidRoundoff: Double?, cashback: Double?, cashbackApplied: Double?, codCharges: Double?, couponValue: Double?, deliveryCharge: Double?, discount: Double?, fyndCredits: Double?, priceEffective: Double?, priceMarked: Double?, refundAmount: Double?, refundCredit: Double?, valueOfGood: Double?) { + self.cashback = cashback + + self.refundCredit = refundCredit + + self.couponValue = couponValue + + self.deliveryCharge = deliveryCharge + + self.fyndCredits = fyndCredits + + self.priceMarked = priceMarked + + self.cashbackApplied = cashbackApplied + + self.valueOfGood = valueOfGood + + self.amountPaidRoundoff = amountPaidRoundoff + + self.amountPaid = amountPaid + + self.codCharges = codCharges + + self.priceEffective = priceEffective + + self.refundAmount = refundAmount + + self.discount = discount + } + + public func duplicate() -> BagPrices { + let dict = self.dictionary! + let copy = BagPrices(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + cashback = try container.decode(Double.self, forKey: .cashback) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refundCredit = try container.decode(Double.self, forKey: .refundCredit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + couponValue = try container.decode(Double.self, forKey: .couponValue) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryCharge = try container.decode(Double.self, forKey: .deliveryCharge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fyndCredits = try container.decode(Double.self, forKey: .fyndCredits) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priceMarked = try container.decode(Double.self, forKey: .priceMarked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cashbackApplied = try container.decode(Double.self, forKey: .cashbackApplied) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + valueOfGood = try container.decode(Double.self, forKey: .valueOfGood) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + amountPaidRoundoff = try container.decode(Double.self, forKey: .amountPaidRoundoff) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + amountPaid = try container.decode(Double.self, forKey: .amountPaid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + codCharges = try container.decode(Double.self, forKey: .codCharges) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priceEffective = try container.decode(Double.self, forKey: .priceEffective) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refundAmount = try container.decode(Double.self, forKey: .refundAmount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + discount = try container.decode(Double.self, forKey: .discount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(cashback, forKey: .cashback) + + try? container.encodeIfPresent(refundCredit, forKey: .refundCredit) + + try? container.encodeIfPresent(couponValue, forKey: .couponValue) + + try? container.encodeIfPresent(deliveryCharge, forKey: .deliveryCharge) + + try? container.encodeIfPresent(fyndCredits, forKey: .fyndCredits) + + try? container.encodeIfPresent(priceMarked, forKey: .priceMarked) + + try? container.encodeIfPresent(cashbackApplied, forKey: .cashbackApplied) + + try? container.encodeIfPresent(valueOfGood, forKey: .valueOfGood) + + try? container.encodeIfPresent(amountPaidRoundoff, forKey: .amountPaidRoundoff) + + try? container.encodeIfPresent(amountPaid, forKey: .amountPaid) + + try? container.encodeIfPresent(codCharges, forKey: .codCharges) + + try? container.encodeIfPresent(priceEffective, forKey: .priceEffective) + + try? container.encodeIfPresent(refundAmount, forKey: .refundAmount) + + try? container.encodeIfPresent(discount, forKey: .discount) + } + } + + /* + Model: ShipmentBreakupValues + Used By: Order + */ + + class ShipmentBreakupValues: Codable { + public var name: String? + + public var display: String? + + public var value: Double? + + public enum CodingKeys: String, CodingKey { + case name + + case display + + case value + } + + public init(display: String?, name: String?, value: Double?) { + self.name = name + + self.display = display + + self.value = value + } + + public func duplicate() -> ShipmentBreakupValues { + let dict = self.dictionary! + let copy = ShipmentBreakupValues(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(Double.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: DpDetails + Used By: Order + */ + + class DpDetails: Codable { + public var gstTag: String? + + public enum CodingKeys: String, CodingKey { + case gstTag = "gst_tag" + } + + public init(gstTag: String?) { + self.gstTag = gstTag + } + + public func duplicate() -> DpDetails { + let dict = self.dictionary! + let copy = DpDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + gstTag = try container.decode(String.self, forKey: .gstTag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(gstTag, forKey: .gstTag) + } + } + + /* + Model: ShipmentInvoice + Used By: Order + */ + + class ShipmentInvoice: Codable { + public var paymentType: String? + + public var updatedDate: String? + + public var invoiceUrl: String? + + public var labelUrl: String? + + public var paymentMode: String? + + public var amountToCollect: Double? + + public var rtoAddress: RtoAddress? + + public enum CodingKeys: String, CodingKey { + case paymentType = "payment_type" + + case updatedDate = "updated_date" + + case invoiceUrl = "invoice_url" + + case labelUrl = "label_url" + + case paymentMode = "payment_mode" + + case amountToCollect = "amount_to_collect" + + case rtoAddress = "rto_address" + } + + public init(amountToCollect: Double?, invoiceUrl: String?, labelUrl: String?, paymentMode: String?, paymentType: String?, rtoAddress: RtoAddress?, updatedDate: String?) { + self.paymentType = paymentType + + self.updatedDate = updatedDate + + self.invoiceUrl = invoiceUrl + + self.labelUrl = labelUrl + + self.paymentMode = paymentMode + + self.amountToCollect = amountToCollect + + self.rtoAddress = rtoAddress + } + + public func duplicate() -> ShipmentInvoice { + let dict = self.dictionary! + let copy = ShipmentInvoice(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + paymentType = try container.decode(String.self, forKey: .paymentType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedDate = try container.decode(String.self, forKey: .updatedDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + invoiceUrl = try container.decode(String.self, forKey: .invoiceUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + labelUrl = try container.decode(String.self, forKey: .labelUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentMode = try container.decode(String.self, forKey: .paymentMode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + amountToCollect = try container.decode(Double.self, forKey: .amountToCollect) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rtoAddress = try container.decode(RtoAddress.self, forKey: .rtoAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(paymentType, forKey: .paymentType) + + try? container.encodeIfPresent(updatedDate, forKey: .updatedDate) + + try? container.encodeIfPresent(invoiceUrl, forKey: .invoiceUrl) + + try? container.encodeIfPresent(labelUrl, forKey: .labelUrl) + + try? container.encodeIfPresent(paymentMode, forKey: .paymentMode) + + try? container.encodeIfPresent(amountToCollect, forKey: .amountToCollect) + + try? container.encodeIfPresent(rtoAddress, forKey: .rtoAddress) + } + } + + /* + Model: RtoAddress + Used By: Order + */ + + class RtoAddress: Codable { + public var name: String? + + public var id: Int? + + public var phone: String? + + public var locationType: String? + + public var storeAddressJson: StoreAddressJson? + + public var code: String? + + public var address1: String? + + public var city: String? + + public var country: String? + + public var pincode: String? + + public var companyId: Int? + + public var contactPerson: String? + + public var state: String? + + public var storeEmail: String? + + public var address2: String? + + public enum CodingKeys: String, CodingKey { + case name + + case id + + case phone + + case locationType = "location_type" + + case storeAddressJson = "store_address_json" + + case code + + case address1 + + case city + + case country + + case pincode + + case companyId = "company_id" + + case contactPerson = "contact_person" + + case state + + case storeEmail = "store_email" + + case address2 + } + + public init(address1: String?, address2: String?, city: String?, code: String?, companyId: Int?, contactPerson: String?, country: String?, id: Int?, locationType: String?, name: String?, phone: String?, pincode: String?, state: String?, storeAddressJson: StoreAddressJson?, storeEmail: String?) { + self.name = name + + self.id = id + + self.phone = phone + + self.locationType = locationType + + self.storeAddressJson = storeAddressJson + + self.code = code + + self.address1 = address1 + + self.city = city + + self.country = country + + self.pincode = pincode + + self.companyId = companyId + + self.contactPerson = contactPerson + + self.state = state + + self.storeEmail = storeEmail + + self.address2 = address2 + } + + public func duplicate() -> RtoAddress { + let dict = self.dictionary! + let copy = RtoAddress(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + locationType = try container.decode(String.self, forKey: .locationType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeAddressJson = try container.decode(StoreAddressJson.self, forKey: .storeAddressJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address1 = try container.decode(String.self, forKey: .address1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(String.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contactPerson = try container.decode(String.self, forKey: .contactPerson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeEmail = try container.decode(String.self, forKey: .storeEmail) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address2 = try container.decode(String.self, forKey: .address2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(locationType, forKey: .locationType) + + try? container.encodeIfPresent(storeAddressJson, forKey: .storeAddressJson) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(address1, forKey: .address1) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(contactPerson, forKey: .contactPerson) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(storeEmail, forKey: .storeEmail) + + try? container.encodeIfPresent(address2, forKey: .address2) + } + } + + /* + Model: StoreAddressJson + Used By: Order + */ + + class StoreAddressJson: Codable { + public var country: String? + + public var updatedAt: String? + + public var area: String? + + public var state: String? + + public var addressType: String? + + public var city: String? + + public var pincode: String? + + public var address1: String? + + public var address2: String? + + public var latitude: Double? + + public var longitude: Double? + + public var email: String? + + public var phone: String? + + public var createdAt: String? + + public var contactPerson: String? + + public var addressCategory: String? + + public var version: String? + + public var landmark: String? + + public enum CodingKeys: String, CodingKey { + case country + + case updatedAt = "updated_at" + + case area + + case state + + case addressType = "address_type" + + case city + + case pincode + + case address1 + + case address2 + + case latitude + + case longitude + + case email + + case phone + + case createdAt = "created_at" + + case contactPerson = "contact_person" + + case addressCategory = "address_category" + + case version + + case landmark + } + + public init(address1: String?, address2: String?, addressCategory: String?, addressType: String?, area: String?, city: String?, contactPerson: String?, country: String?, createdAt: String?, email: String?, landmark: String?, latitude: Double?, longitude: Double?, phone: String?, pincode: String?, state: String?, updatedAt: String?, version: String?) { + self.country = country + + self.updatedAt = updatedAt + + self.area = area + + self.state = state + + self.addressType = addressType + + self.city = city + + self.pincode = pincode + + self.address1 = address1 + + self.address2 = address2 + + self.latitude = latitude + + self.longitude = longitude + + self.email = email + + self.phone = phone + + self.createdAt = createdAt + + self.contactPerson = contactPerson + + self.addressCategory = addressCategory + + self.version = version + + self.landmark = landmark + } + + public func duplicate() -> StoreAddressJson { + let dict = self.dictionary! + let copy = StoreAddressJson(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + area = try container.decode(String.self, forKey: .area) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressType = try container.decode(String.self, forKey: .addressType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(String.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address1 = try container.decode(String.self, forKey: .address1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address2 = try container.decode(String.self, forKey: .address2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + latitude = try container.decode(Double.self, forKey: .latitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + longitude = try container.decode(Double.self, forKey: .longitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contactPerson = try container.decode(String.self, forKey: .contactPerson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressCategory = try container.decode(String.self, forKey: .addressCategory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + version = try container.decode(String.self, forKey: .version) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + landmark = try container.decode(String.self, forKey: .landmark) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(area, forKey: .area) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(addressType, forKey: .addressType) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(address1, forKey: .address1) + + try? container.encodeIfPresent(address2, forKey: .address2) + + try? container.encodeIfPresent(latitude, forKey: .latitude) + + try? container.encodeIfPresent(longitude, forKey: .longitude) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(contactPerson, forKey: .contactPerson) + + try? container.encodeIfPresent(addressCategory, forKey: .addressCategory) + + try? container.encodeIfPresent(version, forKey: .version) + + try? container.encodeIfPresent(landmark, forKey: .landmark) + } + } + + /* + Model: PlatformFulfillingStore + Used By: Order + */ + + class PlatformFulfillingStore: Codable { + public var packagingMaterialCount: Int? + + public var locationType: String? + + public var code: String? + + public var city: String? + + public var meta: FulfillingStoreMeta? + + public var name: String? + + public var isActive: Bool? + + public var address1: String? + + public var storeEmail: String? + + public var isArchived: Bool? + + public var state: String? + + public var address2: String? + + public var contactPerson: String? + + public var phone: String? + + public var isEnabledForRecon: Bool? + + public var fulfillmentChannel: String? + + public var createdAt: String? + + public var id: Int? + + public var pincode: String? + + public var brandStoreTags: [String]? + + public var companyId: Int? + + public var storeAddressJson: FulfillingStoreStoreAddressJson? + + public var updatedAt: String? + + public var loginUsername: String? + + public var country: String? + + public enum CodingKeys: String, CodingKey { + case packagingMaterialCount = "packaging_material_count" + + case locationType = "location_type" + + case code + + case city + + case meta + + case name + + case isActive = "is_active" + + case address1 + + case storeEmail = "store_email" + + case isArchived = "is_archived" + + case state + + case address2 + + case contactPerson = "contact_person" + + case phone + + case isEnabledForRecon = "is_enabled_for_recon" + + case fulfillmentChannel = "fulfillment_channel" + + case createdAt = "created_at" + + case id + + case pincode + + case brandStoreTags = "brand_store_tags" + + case companyId = "company_id" + + case storeAddressJson = "store_address_json" + + case updatedAt = "updated_at" + + case loginUsername = "login_username" + + case country + } + + public init(address1: String?, address2: String?, brandStoreTags: [String]?, city: String?, code: String?, companyId: Int?, contactPerson: String?, country: String?, createdAt: String?, fulfillmentChannel: String?, id: Int?, isActive: Bool?, isArchived: Bool?, isEnabledForRecon: Bool?, locationType: String?, loginUsername: String?, meta: FulfillingStoreMeta?, name: String?, packagingMaterialCount: Int?, phone: String?, pincode: String?, state: String?, storeAddressJson: FulfillingStoreStoreAddressJson?, storeEmail: String?, updatedAt: String?) { + self.packagingMaterialCount = packagingMaterialCount + + self.locationType = locationType + + self.code = code + + self.city = city + + self.meta = meta + + self.name = name + + self.isActive = isActive + + self.address1 = address1 + + self.storeEmail = storeEmail + + self.isArchived = isArchived + + self.state = state + + self.address2 = address2 + + self.contactPerson = contactPerson + + self.phone = phone + + self.isEnabledForRecon = isEnabledForRecon + + self.fulfillmentChannel = fulfillmentChannel + + self.createdAt = createdAt + + self.id = id + + self.pincode = pincode + + self.brandStoreTags = brandStoreTags + + self.companyId = companyId + + self.storeAddressJson = storeAddressJson + + self.updatedAt = updatedAt + + self.loginUsername = loginUsername + + self.country = country + } + + public func duplicate() -> PlatformFulfillingStore { + let dict = self.dictionary! + let copy = PlatformFulfillingStore(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + packagingMaterialCount = try container.decode(Int.self, forKey: .packagingMaterialCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + locationType = try container.decode(String.self, forKey: .locationType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode(FulfillingStoreMeta.self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address1 = try container.decode(String.self, forKey: .address1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeEmail = try container.decode(String.self, forKey: .storeEmail) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isArchived = try container.decode(Bool.self, forKey: .isArchived) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address2 = try container.decode(String.self, forKey: .address2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contactPerson = try container.decode(String.self, forKey: .contactPerson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isEnabledForRecon = try container.decode(Bool.self, forKey: .isEnabledForRecon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fulfillmentChannel = try container.decode(String.self, forKey: .fulfillmentChannel) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(String.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandStoreTags = try container.decode([String].self, forKey: .brandStoreTags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + storeAddressJson = try container.decode(FulfillingStoreStoreAddressJson.self, forKey: .storeAddressJson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + loginUsername = try container.decode(String.self, forKey: .loginUsername) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(packagingMaterialCount, forKey: .packagingMaterialCount) + + try? container.encodeIfPresent(locationType, forKey: .locationType) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(address1, forKey: .address1) + + try? container.encodeIfPresent(storeEmail, forKey: .storeEmail) + + try? container.encodeIfPresent(isArchived, forKey: .isArchived) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(address2, forKey: .address2) + + try? container.encodeIfPresent(contactPerson, forKey: .contactPerson) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(isEnabledForRecon, forKey: .isEnabledForRecon) + + try? container.encodeIfPresent(fulfillmentChannel, forKey: .fulfillmentChannel) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(brandStoreTags, forKey: .brandStoreTags) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(storeAddressJson, forKey: .storeAddressJson) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(loginUsername, forKey: .loginUsername) + + try? container.encodeIfPresent(country, forKey: .country) + } + } + + /* + Model: FulfillingStoreMeta + Used By: Order + */ + + class FulfillingStoreMeta: Codable { + public var additionalContactDetails: AdditionalContactDetails? + + public var documents: Documents? + + public var gstNumber: String? + + public var displayName: String? + + public var productReturnConfig: ProductReturnConfig? + + public var allowDpAssignmentFromFynd: Bool? + + public var stage: String? + + public var timing: Timing? + + public enum CodingKeys: String, CodingKey { + case additionalContactDetails = "additional_contact_details" + + case documents + + case gstNumber = "gst_number" + + case displayName = "display_name" + + case productReturnConfig = "product_return_config" + + case allowDpAssignmentFromFynd = "allow_dp_assignment_from_fynd" + + case stage + + case timing + } + + public init(additionalContactDetails: AdditionalContactDetails?, allowDpAssignmentFromFynd: Bool?, displayName: String?, documents: Documents?, gstNumber: String?, productReturnConfig: ProductReturnConfig?, stage: String?, timing: Timing?) { + self.additionalContactDetails = additionalContactDetails + + self.documents = documents + + self.gstNumber = gstNumber + + self.displayName = displayName + + self.productReturnConfig = productReturnConfig + + self.allowDpAssignmentFromFynd = allowDpAssignmentFromFynd + + self.stage = stage + + self.timing = timing + } + + public func duplicate() -> FulfillingStoreMeta { + let dict = self.dictionary! + let copy = FulfillingStoreMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + additionalContactDetails = try container.decode(AdditionalContactDetails.self, forKey: .additionalContactDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + documents = try container.decode(Documents.self, forKey: .documents) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstNumber = try container.decode(String.self, forKey: .gstNumber) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productReturnConfig = try container.decode(ProductReturnConfig.self, forKey: .productReturnConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + allowDpAssignmentFromFynd = try container.decode(Bool.self, forKey: .allowDpAssignmentFromFynd) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stage = try container.decode(String.self, forKey: .stage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + timing = try container.decode(Timing.self, forKey: .timing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(additionalContactDetails, forKey: .additionalContactDetails) + + try? container.encodeIfPresent(documents, forKey: .documents) + + try? container.encodeIfPresent(gstNumber, forKey: .gstNumber) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(productReturnConfig, forKey: .productReturnConfig) + + try? container.encodeIfPresent(allowDpAssignmentFromFynd, forKey: .allowDpAssignmentFromFynd) + + try? container.encodeIfPresent(stage, forKey: .stage) + + try? container.encodeIfPresent(timing, forKey: .timing) + } + } + + /* + Model: AdditionalContactDetails + Used By: Order + */ + + class AdditionalContactDetails: Codable { + public var number: [String]? + + public enum CodingKeys: String, CodingKey { + case number + } + + public init(number: [String]?) { + self.number = number + } + + public func duplicate() -> AdditionalContactDetails { + let dict = self.dictionary! + let copy = AdditionalContactDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + number = try container.decode([String].self, forKey: .number) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(number, forKey: .number) + } + } + + /* + Model: Documents + Used By: Order + */ + + class Documents: Codable { + public var gst: Gst? + + public enum CodingKeys: String, CodingKey { + case gst + } + + public init(gst: Gst?) { + self.gst = gst + } + + public func duplicate() -> Documents { + let dict = self.dictionary! + let copy = Documents(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + gst = try container.decode(Gst.self, forKey: .gst) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(gst, forKey: .gst) + } + } + + /* + Model: Gst + Used By: Order + */ + + class Gst: Codable { + public var legalName: String? + + public var type: String? + + public var value: String? + + public var verified: Bool? + + public enum CodingKeys: String, CodingKey { + case legalName = "legal_name" + + case type + + case value + + case verified + } + + public init(legalName: String?, type: String?, value: String?, verified: Bool?) { + self.legalName = legalName + + self.type = type + + self.value = value + + self.verified = verified + } + + public func duplicate() -> Gst { + let dict = self.dictionary! + let copy = Gst(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + legalName = try container.decode(String.self, forKey: .legalName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verified = try container.decode(Bool.self, forKey: .verified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(legalName, forKey: .legalName) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(verified, forKey: .verified) + } + } + + /* + Model: ProductReturnConfig + Used By: Order + */ + + class ProductReturnConfig: Codable { + public var onSameStore: Bool? + + public enum CodingKeys: String, CodingKey { + case onSameStore = "on_same_store" + } + + public init(onSameStore: Bool?) { + self.onSameStore = onSameStore + } + + public func duplicate() -> ProductReturnConfig { + let dict = self.dictionary! + let copy = ProductReturnConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + onSameStore = try container.decode(Bool.self, forKey: .onSameStore) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(onSameStore, forKey: .onSameStore) + } + } + + /* + Model: Timing + Used By: Order + */ + + class Timing: Codable { + public var opening: Opening? + + public var weekday: String? + + public var open: Bool? + + public var closing: Closing? + + public enum CodingKeys: String, CodingKey { + case opening + + case weekday + + case open + + case closing + } + + public init(closing: Closing?, open: Bool?, opening: Opening?, weekday: String?) { + self.opening = opening + + self.weekday = weekday + + self.open = open + + self.closing = closing + } + + public func duplicate() -> Timing { + let dict = self.dictionary! + let copy = Timing(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + opening = try container.decode(Opening.self, forKey: .opening) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + weekday = try container.decode(String.self, forKey: .weekday) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + open = try container.decode(Bool.self, forKey: .open) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + closing = try container.decode(Closing.self, forKey: .closing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(opening, forKey: .opening) + + try? container.encodeIfPresent(weekday, forKey: .weekday) + + try? container.encodeIfPresent(open, forKey: .open) + + try? container.encodeIfPresent(closing, forKey: .closing) + } + } + + /* + Model: Opening + Used By: Order + */ + + class Opening: Codable { + public var minute: Int? + + public var hour: Int? + + public enum CodingKeys: String, CodingKey { + case minute + + case hour + } + + public init(hour: Int?, minute: Int?) { + self.minute = minute + + self.hour = hour + } + + public func duplicate() -> Opening { + let dict = self.dictionary! + let copy = Opening(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + minute = try container.decode(Int.self, forKey: .minute) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hour = try container.decode(Int.self, forKey: .hour) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(minute, forKey: .minute) + + try? container.encodeIfPresent(hour, forKey: .hour) + } + } + + /* + Model: Closing + Used By: Order + */ + + class Closing: Codable { + public var hour: Int? + + public var minute: Int? + + public enum CodingKeys: String, CodingKey { + case hour + + case minute + } + + public init(hour: Int?, minute: Int?) { + self.hour = hour + + self.minute = minute + } + + public func duplicate() -> Closing { + let dict = self.dictionary! + let copy = Closing(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + hour = try container.decode(Int.self, forKey: .hour) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + minute = try container.decode(Int.self, forKey: .minute) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(hour, forKey: .hour) + + try? container.encodeIfPresent(minute, forKey: .minute) + } + } + + /* + Model: FulfillingStoreStoreAddressJson + Used By: Order + */ + + class FulfillingStoreStoreAddressJson: Codable { + public var address2: String? + + public var area: String? + + public var email: String? + + public var phone: String? + + public var state: String? + + public var contactPerson: String? + + public var country: String? + + public var pincode: String? + + public var version: String? + + public var createdAt: String? + + public var addressType: String? + + public var city: String? + + public var address1: String? + + public var landmark: String? + + public var latitude: Double? + + public var longitude: Double? + + public var updatedAt: String? + + public var addressCategory: String? + + public enum CodingKeys: String, CodingKey { + case address2 + + case area + + case email + + case phone + + case state + + case contactPerson = "contact_person" + + case country + + case pincode + + case version + + case createdAt = "created_at" + + case addressType = "address_type" + + case city + + case address1 + + case landmark + + case latitude + + case longitude + + case updatedAt = "updated_at" + + case addressCategory = "address_category" + } + + public init(address1: String?, address2: String?, addressCategory: String?, addressType: String?, area: String?, city: String?, contactPerson: String?, country: String?, createdAt: String?, email: String?, landmark: String?, latitude: Double?, longitude: Double?, phone: String?, pincode: String?, state: String?, updatedAt: String?, version: String?) { + self.address2 = address2 + + self.area = area + + self.email = email + + self.phone = phone + + self.state = state + + self.contactPerson = contactPerson + + self.country = country + + self.pincode = pincode + + self.version = version + + self.createdAt = createdAt + + self.addressType = addressType + + self.city = city + + self.address1 = address1 + + self.landmark = landmark + + self.latitude = latitude + + self.longitude = longitude + + self.updatedAt = updatedAt + + self.addressCategory = addressCategory + } + + public func duplicate() -> FulfillingStoreStoreAddressJson { + let dict = self.dictionary! + let copy = FulfillingStoreStoreAddressJson(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + address2 = try container.decode(String.self, forKey: .address2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + area = try container.decode(String.self, forKey: .area) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + contactPerson = try container.decode(String.self, forKey: .contactPerson) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(String.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + version = try container.decode(String.self, forKey: .version) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressType = try container.decode(String.self, forKey: .addressType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address1 = try container.decode(String.self, forKey: .address1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + landmark = try container.decode(String.self, forKey: .landmark) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + latitude = try container.decode(Double.self, forKey: .latitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + longitude = try container.decode(Double.self, forKey: .longitude) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressCategory = try container.decode(String.self, forKey: .addressCategory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(address2, forKey: .address2) + + try? container.encodeIfPresent(area, forKey: .area) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(contactPerson, forKey: .contactPerson) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(version, forKey: .version) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(addressType, forKey: .addressType) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(address1, forKey: .address1) + + try? container.encodeIfPresent(landmark, forKey: .landmark) + + try? container.encodeIfPresent(latitude, forKey: .latitude) + + try? container.encodeIfPresent(longitude, forKey: .longitude) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(addressCategory, forKey: .addressCategory) + } + } + + /* + Model: ShipmentGst + Used By: Order + */ + + class ShipmentGst: Codable { + public var brandCalculatedAmount: Double? + + public var valueOfGood: Double? + + public var gstFee: Double? + + public enum CodingKeys: String, CodingKey { + case brandCalculatedAmount = "brand_calculated_amount" + + case valueOfGood = "value_of_good" + + case gstFee = "gst_fee" + } + + public init(brandCalculatedAmount: Double?, gstFee: Double?, valueOfGood: Double?) { + self.brandCalculatedAmount = brandCalculatedAmount + + self.valueOfGood = valueOfGood + + self.gstFee = gstFee + } + + public func duplicate() -> ShipmentGst { + let dict = self.dictionary! + let copy = ShipmentGst(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + brandCalculatedAmount = try container.decode(Double.self, forKey: .brandCalculatedAmount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + valueOfGood = try container.decode(Double.self, forKey: .valueOfGood) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gstFee = try container.decode(Double.self, forKey: .gstFee) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(brandCalculatedAmount, forKey: .brandCalculatedAmount) + + try? container.encodeIfPresent(valueOfGood, forKey: .valueOfGood) + + try? container.encodeIfPresent(gstFee, forKey: .gstFee) + } + } + + /* + Model: PlatformShipmentDetailsBrand + Used By: Order + */ + + class PlatformShipmentDetailsBrand: Codable { + public var creditNoteAllowed: Bool? + + public var brandName: String? + + public var modifiedOn: String? + + public var id: Int? + + public var isVirtualInvoice: Bool? + + public var createdOn: String? + + public var logo: String? + + public enum CodingKeys: String, CodingKey { + case creditNoteAllowed = "credit_note_allowed" + + case brandName = "brand_name" + + case modifiedOn = "modified_on" + + case id + + case isVirtualInvoice = "is_virtual_invoice" + + case createdOn = "created_on" + + case logo + } + + public init(brandName: String?, createdOn: String?, creditNoteAllowed: Bool?, id: Int?, isVirtualInvoice: Bool?, logo: String?, modifiedOn: String?) { + self.creditNoteAllowed = creditNoteAllowed + + self.brandName = brandName + + self.modifiedOn = modifiedOn + + self.id = id + + self.isVirtualInvoice = isVirtualInvoice + + self.createdOn = createdOn + + self.logo = logo + } + + public func duplicate() -> PlatformShipmentDetailsBrand { + let dict = self.dictionary! + let copy = PlatformShipmentDetailsBrand(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + creditNoteAllowed = try container.decode(Bool.self, forKey: .creditNoteAllowed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandName = try container.decode(String.self, forKey: .brandName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isVirtualInvoice = try container.decode(Bool.self, forKey: .isVirtualInvoice) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(creditNoteAllowed, forKey: .creditNoteAllowed) + + try? container.encodeIfPresent(brandName, forKey: .brandName) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(isVirtualInvoice, forKey: .isVirtualInvoice) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(logo, forKey: .logo) + } + } + + /* + Model: Promise + Used By: Order + */ + + class Promise: Codable { + public var timestamp: Timestamp? + + public enum CodingKeys: String, CodingKey { + case timestamp + } + + public init(timestamp: Timestamp?) { + self.timestamp = timestamp + } + + public func duplicate() -> Promise { + let dict = self.dictionary! + let copy = Promise(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + timestamp = try container.decode(Timestamp.self, forKey: .timestamp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(timestamp, forKey: .timestamp) + } + } + + /* + Model: Timestamp + Used By: Order + */ + + class Timestamp: Codable { + public var min: String? + + public var max: String? + + public enum CodingKeys: String, CodingKey { + case min + + case max + } + + public init(max: String?, min: String?) { + self.min = min + + self.max = max + } + + public func duplicate() -> Timestamp { + let dict = self.dictionary! + let copy = Timestamp(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + min = try container.decode(String.self, forKey: .min) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + max = try container.decode(String.self, forKey: .max) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(min, forKey: .min) + + try? container.encodeIfPresent(max, forKey: .max) + } + } + + /* + Model: ShipmentTrackingDetails + Used By: Order + */ + + class ShipmentTrackingDetails: Codable { + public var status: String? + + public var time: String? + + public var isPassed: Bool? + + public var isCurrent: Bool? + + public enum CodingKeys: String, CodingKey { + case status + + case time + + case isPassed = "is_passed" + + case isCurrent = "is_current" + } + + public init(isCurrent: Bool?, isPassed: Bool?, status: String?, time: String?) { + self.status = status + + self.time = time + + self.isPassed = isPassed + + self.isCurrent = isCurrent + } + + public func duplicate() -> ShipmentTrackingDetails { + let dict = self.dictionary! + let copy = ShipmentTrackingDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + time = try container.decode(String.self, forKey: .time) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isPassed = try container.decode(Bool.self, forKey: .isPassed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isCurrent = try container.decode(Bool.self, forKey: .isCurrent) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(time, forKey: .time) + + try? container.encodeIfPresent(isPassed, forKey: .isPassed) + + try? container.encodeIfPresent(isCurrent, forKey: .isCurrent) + } + } + + /* + Model: ItemsPayments + Used By: Order + */ + + class ItemsPayments: Codable { + public var displayPriority: Int? + + public var id: Int? + + public var isActive: Bool? + + public var displayName: String? + + public var logo: String? + + public var paymentIdentifier: String? + + public var sourceNickname: String? + + public var mode: String? + + public var source: String? + + public enum CodingKeys: String, CodingKey { + case displayPriority = "display_priority" + + case id + + case isActive = "is_active" + + case displayName = "display_name" + + case logo + + case paymentIdentifier = "payment_identifier" + + case sourceNickname = "source_nickname" + + case mode + + case source + } + + public init(displayName: String?, displayPriority: Int?, id: Int?, isActive: Bool?, logo: String?, mode: String?, paymentIdentifier: String?, source: String?, sourceNickname: String?) { + self.displayPriority = displayPriority + + self.id = id + + self.isActive = isActive + + self.displayName = displayName + + self.logo = logo + + self.paymentIdentifier = paymentIdentifier + + self.sourceNickname = sourceNickname + + self.mode = mode + + self.source = source + } + + public func duplicate() -> ItemsPayments { + let dict = self.dictionary! + let copy = ItemsPayments(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + displayPriority = try container.decode(Int.self, forKey: .displayPriority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(String.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentIdentifier = try container.decode(String.self, forKey: .paymentIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sourceNickname = try container.decode(String.self, forKey: .sourceNickname) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mode = try container.decode(String.self, forKey: .mode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + source = try container.decode(String.self, forKey: .source) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(displayPriority, forKey: .displayPriority) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(paymentIdentifier, forKey: .paymentIdentifier) + + try? container.encodeIfPresent(sourceNickname, forKey: .sourceNickname) + + try? container.encodeIfPresent(mode, forKey: .mode) + + try? container.encodeIfPresent(source, forKey: .source) + } + } + + /* + Model: PlatformOrderDetailsPage + Used By: Order + */ + + class PlatformOrderDetailsPage: Codable { + public var next: String? + + public var previous: String? + + public enum CodingKeys: String, CodingKey { + case next + + case previous + } + + public init(next: String?, previous: String?) { + self.next = next + + self.previous = previous + } + + public func duplicate() -> PlatformOrderDetailsPage { + let dict = self.dictionary! + let copy = PlatformOrderDetailsPage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + next = try container.decode(String.self, forKey: .next) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + previous = try container.decode(String.self, forKey: .previous) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(next, forKey: .next) + + try? container.encodeIfPresent(previous, forKey: .previous) + } + } + + /* + Model: ShipmentDates + Used By: Order + */ + + class ShipmentDates: Codable { + public var dueDate: String? + + public enum CodingKeys: String, CodingKey { + case dueDate = "due_date" + } + + public init(dueDate: String?) { + self.dueDate = dueDate + } + + public func duplicate() -> ShipmentDates { + let dict = self.dictionary! + let copy = ShipmentDates(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + dueDate = try container.decode(String.self, forKey: .dueDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(dueDate, forKey: .dueDate) + } + } + + /* + Model: OrderLanesCount + Used By: Order + */ + + class OrderLanesCount: Codable { + public var stages: [StageItem] + + public enum CodingKeys: String, CodingKey { + case stages + } + + public init(stages: [StageItem]) { + self.stages = stages + } + + public func duplicate() -> OrderLanesCount { + let dict = self.dictionary! + let copy = OrderLanesCount(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + stages = try container.decode([StageItem].self, forKey: .stages) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(stages, forKey: .stages) + } + } + + /* + Model: StageItem + Used By: Order + */ + + class StageItem: Codable { + public var count: Int? + + public var text: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case count + + case text + + case value + } + + public init(count: Int?, text: String?, value: String?) { + self.count = count + + self.text = text + + self.value = value + } + + public func duplicate() -> StageItem { + let dict = self.dictionary! + let copy = StageItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text = try container.decode(String.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(count, forKey: .count) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: UpdateOrderReprocessResponse + Used By: Order + */ + + class UpdateOrderReprocessResponse: Codable { + public var status: String + + public enum CodingKeys: String, CodingKey { + case status + } + + public init(status: String) { + self.status = status + } + + public func duplicate() -> UpdateOrderReprocessResponse { + let dict = self.dictionary! + let copy = UpdateOrderReprocessResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + status = try container.decode(String.self, forKey: .status) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: PlatformOrderTrack + Used By: Order + */ + + class PlatformOrderTrack: Codable { + public var success: Bool + + public var requestId: String + + public var message: String + + public var mobile: String + + public var countryCode: String + + public var resendTimer: Int + + public var resendToken: String? + + public enum CodingKeys: String, CodingKey { + case success + + case requestId = "request_id" + + case message + + case mobile + + case countryCode = "country_code" + + case resendTimer = "resend_timer" + + case resendToken = "resend_token" + } + + public init(countryCode: String, message: String, mobile: String, requestId: String, resendTimer: Int, resendToken: String?, success: Bool) { + self.success = success + + self.requestId = requestId + + self.message = message + + self.mobile = mobile + + self.countryCode = countryCode + + self.resendTimer = resendTimer + + self.resendToken = resendToken + } + + public func duplicate() -> PlatformOrderTrack { + let dict = self.dictionary! + let copy = PlatformOrderTrack(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + requestId = try container.decode(String.self, forKey: .requestId) + + message = try container.decode(String.self, forKey: .message) + + mobile = try container.decode(String.self, forKey: .mobile) + + countryCode = try container.decode(String.self, forKey: .countryCode) + + resendTimer = try container.decode(Int.self, forKey: .resendTimer) + + do { + resendToken = try container.decode(String.self, forKey: .resendToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(resendTimer, forKey: .resendTimer) + + try? container.encodeIfPresent(resendToken, forKey: .resendToken) + } + } + + /* + Model: OrderPicklistListing + Used By: Order + */ + + class OrderPicklistListing: Codable { + public var user: PlatformOrderUserInfo? + + public var deliveryAddress: PlatformDeliveryAddress? + + public var channel: Channel? + + public var fyndstoreEmp: [String: Any]? + + public var orderingStore: [String: Any]? + + public var breakupValues: PlatformBreakupValues? + + public var id: String? + + public var application: PlatformApplication? + + public var shipments: PlatformShipmentDetails? + + public var createdAt: String? + + public var totalShipmentsInOrder: Int? + + public var payments: ItemsPayments? + + public var paymentMethods: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case user + + case deliveryAddress = "delivery_address" + + case channel + + case fyndstoreEmp = "fyndstore_emp" + + case orderingStore = "ordering_store" + + case breakupValues = "breakup_values" + + case id + + case application + + case shipments + + case createdAt = "created_at" + + case totalShipmentsInOrder = "total_shipments_in_order" + + case payments + + case paymentMethods = "payment_methods" + } + + public init(application: PlatformApplication?, breakupValues: PlatformBreakupValues?, channel: Channel?, createdAt: String?, deliveryAddress: PlatformDeliveryAddress?, fyndstoreEmp: [String: Any]?, id: String?, orderingStore: [String: Any]?, payments: ItemsPayments?, paymentMethods: [String: Any]?, shipments: PlatformShipmentDetails?, totalShipmentsInOrder: Int?, user: PlatformOrderUserInfo?) { + self.user = user + + self.deliveryAddress = deliveryAddress + + self.channel = channel + + self.fyndstoreEmp = fyndstoreEmp + + self.orderingStore = orderingStore + + self.breakupValues = breakupValues + + self.id = id + + self.application = application + + self.shipments = shipments + + self.createdAt = createdAt + + self.totalShipmentsInOrder = totalShipmentsInOrder + + self.payments = payments + + self.paymentMethods = paymentMethods + } + + public func duplicate() -> OrderPicklistListing { + let dict = self.dictionary! + let copy = OrderPicklistListing(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode(PlatformOrderUserInfo.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryAddress = try container.decode(PlatformDeliveryAddress.self, forKey: .deliveryAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + channel = try container.decode(Channel.self, forKey: .channel) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fyndstoreEmp = try container.decode([String: Any].self, forKey: .fyndstoreEmp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderingStore = try container.decode([String: Any].self, forKey: .orderingStore) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + breakupValues = try container.decode(PlatformBreakupValues.self, forKey: .breakupValues) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(PlatformApplication.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shipments = try container.decode(PlatformShipmentDetails.self, forKey: .shipments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + totalShipmentsInOrder = try container.decode(Int.self, forKey: .totalShipmentsInOrder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + payments = try container.decode(ItemsPayments.self, forKey: .payments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentMethods = try container.decode([String: Any].self, forKey: .paymentMethods) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(deliveryAddress, forKey: .deliveryAddress) + + try? container.encodeIfPresent(channel, forKey: .channel) + + try? container.encodeIfPresent(fyndstoreEmp, forKey: .fyndstoreEmp) + + try? container.encodeIfPresent(orderingStore, forKey: .orderingStore) + + try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(shipments, forKey: .shipments) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(totalShipmentsInOrder, forKey: .totalShipmentsInOrder) + + try? container.encodeIfPresent(payments, forKey: .payments) + + try? container.encodeIfPresent(paymentMethods, forKey: .paymentMethods) + } + } + + /* + Model: Stages + Used By: Order + */ + + class Stages: Codable { + public var text: String? + + public var value: String? + + public var isDefault: Bool? + + public var filters: StagesFilters? + + public enum CodingKeys: String, CodingKey { + case text + + case value + + case isDefault = "is_default" + + case filters + } + + public init(filters: StagesFilters?, isDefault: Bool?, text: String?, value: String?) { + self.text = text + + self.value = value + + self.isDefault = isDefault + + self.filters = filters + } + + public func duplicate() -> Stages { + let dict = self.dictionary! + let copy = Stages(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + text = try container.decode(String.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isDefault = try container.decode(Bool.self, forKey: .isDefault) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + filters = try container.decode(StagesFilters.self, forKey: .filters) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(isDefault, forKey: .isDefault) + + try? container.encodeIfPresent(filters, forKey: .filters) + } + } + + /* + Model: ItemTotal + Used By: Order + */ + + class ItemTotal: Codable { + public var new: Int? + + public var processing: Int? + + public var returns: Int? + + public var all: Int? + + public enum CodingKeys: String, CodingKey { + case new + + case processing + + case returns + + case all + } + + public init(all: Int?, new: Int?, processing: Int?, returns: Int?) { + self.new = new + + self.processing = processing + + self.returns = returns + + self.all = all + } + + public func duplicate() -> ItemTotal { + let dict = self.dictionary! + let copy = ItemTotal(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + new = try container.decode(Int.self, forKey: .new) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + processing = try container.decode(Int.self, forKey: .processing) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + returns = try container.decode(Int.self, forKey: .returns) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + all = try container.decode(Int.self, forKey: .all) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(new, forKey: .new) + + try? container.encodeIfPresent(processing, forKey: .processing) + + try? container.encodeIfPresent(returns, forKey: .returns) + + try? container.encodeIfPresent(all, forKey: .all) + } + } + + /* + Model: GetPingResponse + Used By: Order + */ + + class GetPingResponse: Codable { + public var ping: String + + public enum CodingKeys: String, CodingKey { + case ping + } + + public init(ping: String) { + self.ping = ping + } + + public func duplicate() -> GetPingResponse { + let dict = self.dictionary! + let copy = GetPingResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + ping = try container.decode(String.self, forKey: .ping) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(ping, forKey: .ping) + } + } + + /* + Model: GetShipmentAddressResponse + Used By: Order + */ + + class GetShipmentAddressResponse: Codable { + public var message: String + + public var data: DataShipmentAddress + + public var success: Bool + + public enum CodingKeys: String, CodingKey { + case message + + case data + + case success + } + + public init(data: DataShipmentAddress, message: String, success: Bool) { + self.message = message + + self.data = data + + self.success = success + } + + public func duplicate() -> GetShipmentAddressResponse { + let dict = self.dictionary! + let copy = GetShipmentAddressResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + message = try container.decode(String.self, forKey: .message) + + data = try container.decode(DataShipmentAddress.self, forKey: .data) + + success = try container.decode(Bool.self, forKey: .success) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: DataShipmentAddress + Used By: Order + */ + + class DataShipmentAddress: Codable { + public var city: String? + + public var country: String? + + public var pincode: String? + + public var phone: String? + + public var area: String? + + public var address: String? + + public var landmark: String? + + public var state: String? + + public var addressType: String? + + public var addressCategory: String? + + public var email: String? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case city + + case country + + case pincode + + case phone + + case area + + case address + + case landmark + + case state + + case addressType = "address_type" + + case addressCategory = "address_category" + + case email + + case name + } + + public init(address: String?, addressCategory: String?, addressType: String?, area: String?, city: String?, country: String?, email: String?, landmark: String?, name: String?, phone: String?, pincode: String?, state: String?) { + self.city = city + + self.country = country + + self.pincode = pincode + + self.phone = phone + + self.area = area + + self.address = address + + self.landmark = landmark + + self.state = state + + self.addressType = addressType + + self.addressCategory = addressCategory + + self.email = email + + self.name = name + } + + public func duplicate() -> DataShipmentAddress { + let dict = self.dictionary! + let copy = DataShipmentAddress(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(String.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + area = try container.decode(String.self, forKey: .area) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address = try container.decode(String.self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + landmark = try container.decode(String.self, forKey: .landmark) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressType = try container.decode(String.self, forKey: .addressType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + addressCategory = try container.decode(String.self, forKey: .addressCategory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(area, forKey: .area) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(landmark, forKey: .landmark) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(addressType, forKey: .addressType) + + try? container.encodeIfPresent(addressCategory, forKey: .addressCategory) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: UpdateShipmentAddressRequest + Used By: Order + */ + + class UpdateShipmentAddressRequest: Codable { + public var email: String + + public var address: String + + public var pincode: String + + public var state: String + + public var addressType: String + + public var country: String + + public var name: String + + public var phone: String + + public var area: String + + public var landmark: String + + public var city: String + + public enum CodingKeys: String, CodingKey { + case email + + case address + + case pincode + + case state + + case addressType = "address_type" + + case country + + case name + + case phone + + case area + + case landmark + + case city + } + + public init(address: String, addressType: String, area: String, city: String, country: String, email: String, landmark: String, name: String, phone: String, pincode: String, state: String) { + self.email = email + + self.address = address + + self.pincode = pincode + + self.state = state + + self.addressType = addressType + + self.country = country + + self.name = name + + self.phone = phone + + self.area = area + + self.landmark = landmark + + self.city = city + } + + public func duplicate() -> UpdateShipmentAddressRequest { + let dict = self.dictionary! + let copy = UpdateShipmentAddressRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + email = try container.decode(String.self, forKey: .email) + + address = try container.decode(String.self, forKey: .address) + + pincode = try container.decode(String.self, forKey: .pincode) + + state = try container.decode(String.self, forKey: .state) + + addressType = try container.decode(String.self, forKey: .addressType) + + country = try container.decode(String.self, forKey: .country) + + name = try container.decode(String.self, forKey: .name) + + phone = try container.decode(String.self, forKey: .phone) + + area = try container.decode(String.self, forKey: .area) + + landmark = try container.decode(String.self, forKey: .landmark) + + city = try container.decode(String.self, forKey: .city) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(state, forKey: .state) + + try? container.encodeIfPresent(addressType, forKey: .addressType) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(area, forKey: .area) + + try? container.encodeIfPresent(landmark, forKey: .landmark) + + try? container.encodeIfPresent(city, forKey: .city) + } + } + + /* + Model: UpdateShipmentAddressResponse + Used By: Order + */ + + class UpdateShipmentAddressResponse: Codable { + public var success: Bool + + public var message: String + + public enum CodingKeys: String, CodingKey { + case success + + case message + } + + public init(message: String, success: Bool) { + self.success = success + + self.message = message + } + + public func duplicate() -> UpdateShipmentAddressResponse { + let dict = self.dictionary! + let copy = UpdateShipmentAddressResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + message = try container.decode(String.self, forKey: .message) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: ShipmentTrackResponse + Used By: Order + */ + + class ShipmentTrackResponse: Codable { + public var bagList: [ShipmentTrackResponseBagListItem] + + public var message: String + + public var orderValue: Int + + public enum CodingKeys: String, CodingKey { + case bagList = "bag_list" + + case message + + case orderValue = "order_value" + } + + public init(bagList: [ShipmentTrackResponseBagListItem], message: String, orderValue: Int) { + self.bagList = bagList + + self.message = message + + self.orderValue = orderValue + } + + public func duplicate() -> ShipmentTrackResponse { + let dict = self.dictionary! + let copy = ShipmentTrackResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + bagList = try container.decode([ShipmentTrackResponseBagListItem].self, forKey: .bagList) + + message = try container.decode(String.self, forKey: .message) + + orderValue = try container.decode(Int.self, forKey: .orderValue) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(bagList, forKey: .bagList) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(orderValue, forKey: .orderValue) + } + } + + /* + Model: ShipmentTrackResponseBagListItem + Used By: Order + */ + + class ShipmentTrackResponseBagListItem: Codable { + public var enableTracking: Bool? + + public var price: String? + + public var timeSlot: String? + + public var productName: String? + + public var canReturn: Bool? + + public var orderDate: String? + + public var isTryAtHome: Bool? + + public var breakupValues: [ShipmentTrackResponseBagListItemBreakValues]? + + public var statuses: [ShipmentTrackResponseBagListItemStatuses]? + + public var isActive: Bool? + + public var bagId: String? + + public var orderId: String? + + public var size: String? + + public var paymentModeSource: String? + + public var dpDetails: ShipmentTrackResponseBagListItemDpDetails? + + public var productId: Int? + + public var productImage: ShipmentTrackResponseBagListItemsProductImage? + + public var brandName: String? + + public var priceMarked: String? + + public var status: String? + + public var canCancel: Bool? + + public var paymentMode: String? + + public var fyndCashMsg: String? + + public var deliveryAddress: String? + + public enum CodingKeys: String, CodingKey { + case enableTracking = "enable_tracking" + + case price + + case timeSlot = "time_slot" + + case productName = "product_name" + + case canReturn = "can_return" + + case orderDate = "order_date" + + case isTryAtHome = "is_try_at_home" + + case breakupValues = "breakup_values" + + case statuses + + case isActive = "is_active" + + case bagId = "bag_id" + + case orderId = "order_id" + + case size + + case paymentModeSource = "payment_mode_source" + + case dpDetails = "dp_details" + + case productId = "product_id" + + case productImage = "product_image" + + case brandName = "brand_name" + + case priceMarked = "price_marked" + + case status + + case canCancel = "can_cancel" + + case paymentMode = "payment_mode" + + case fyndCashMsg = "fynd_cash_msg" + + case deliveryAddress = "delivery_address" + } + + public init(bagId: String?, brandName: String?, breakupValues: [ShipmentTrackResponseBagListItemBreakValues]?, canCancel: Bool?, canReturn: Bool?, deliveryAddress: String?, dpDetails: ShipmentTrackResponseBagListItemDpDetails?, enableTracking: Bool?, fyndCashMsg: String?, isActive: Bool?, isTryAtHome: Bool?, orderDate: String?, orderId: String?, paymentMode: String?, paymentModeSource: String?, price: String?, priceMarked: String?, productId: Int?, productImage: ShipmentTrackResponseBagListItemsProductImage?, productName: String?, size: String?, status: String?, statuses: [ShipmentTrackResponseBagListItemStatuses]?, timeSlot: String?) { + self.enableTracking = enableTracking + + self.price = price + + self.timeSlot = timeSlot + + self.productName = productName + + self.canReturn = canReturn + + self.orderDate = orderDate + + self.isTryAtHome = isTryAtHome + + self.breakupValues = breakupValues + + self.statuses = statuses + + self.isActive = isActive + + self.bagId = bagId + + self.orderId = orderId + + self.size = size + + self.paymentModeSource = paymentModeSource + + self.dpDetails = dpDetails + + self.productId = productId + + self.productImage = productImage + + self.brandName = brandName + + self.priceMarked = priceMarked + + self.status = status + + self.canCancel = canCancel + + self.paymentMode = paymentMode + + self.fyndCashMsg = fyndCashMsg + + self.deliveryAddress = deliveryAddress + } + + public func duplicate() -> ShipmentTrackResponseBagListItem { + let dict = self.dictionary! + let copy = ShipmentTrackResponseBagListItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enableTracking = try container.decode(Bool.self, forKey: .enableTracking) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + price = try container.decode(String.self, forKey: .price) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + timeSlot = try container.decode(String.self, forKey: .timeSlot) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productName = try container.decode(String.self, forKey: .productName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + canReturn = try container.decode(Bool.self, forKey: .canReturn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderDate = try container.decode(String.self, forKey: .orderDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isTryAtHome = try container.decode(Bool.self, forKey: .isTryAtHome) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + breakupValues = try container.decode([ShipmentTrackResponseBagListItemBreakValues].self, forKey: .breakupValues) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + statuses = try container.decode([ShipmentTrackResponseBagListItemStatuses].self, forKey: .statuses) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bagId = try container.decode(String.self, forKey: .bagId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderId = try container.decode(String.self, forKey: .orderId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + size = try container.decode(String.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentModeSource = try container.decode(String.self, forKey: .paymentModeSource) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dpDetails = try container.decode(ShipmentTrackResponseBagListItemDpDetails.self, forKey: .dpDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productId = try container.decode(Int.self, forKey: .productId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + productImage = try container.decode(ShipmentTrackResponseBagListItemsProductImage.self, forKey: .productImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + brandName = try container.decode(String.self, forKey: .brandName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + priceMarked = try container.decode(String.self, forKey: .priceMarked) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + canCancel = try container.decode(Bool.self, forKey: .canCancel) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentMode = try container.decode(String.self, forKey: .paymentMode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fyndCashMsg = try container.decode(String.self, forKey: .fyndCashMsg) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + deliveryAddress = try container.decode(String.self, forKey: .deliveryAddress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enableTracking, forKey: .enableTracking) + + try? container.encodeIfPresent(price, forKey: .price) + + try? container.encodeIfPresent(timeSlot, forKey: .timeSlot) + + try? container.encodeIfPresent(productName, forKey: .productName) + + try? container.encodeIfPresent(canReturn, forKey: .canReturn) + + try? container.encodeIfPresent(orderDate, forKey: .orderDate) + + try? container.encodeIfPresent(isTryAtHome, forKey: .isTryAtHome) + + try? container.encodeIfPresent(breakupValues, forKey: .breakupValues) + + try? container.encodeIfPresent(statuses, forKey: .statuses) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(bagId, forKey: .bagId) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(paymentModeSource, forKey: .paymentModeSource) + + try? container.encodeIfPresent(dpDetails, forKey: .dpDetails) + + try? container.encodeIfPresent(productId, forKey: .productId) + + try? container.encodeIfPresent(productImage, forKey: .productImage) + + try? container.encodeIfPresent(brandName, forKey: .brandName) + + try? container.encodeIfPresent(priceMarked, forKey: .priceMarked) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(canCancel, forKey: .canCancel) + + try? container.encodeIfPresent(paymentMode, forKey: .paymentMode) + + try? container.encodeIfPresent(fyndCashMsg, forKey: .fyndCashMsg) + + try? container.encodeIfPresent(deliveryAddress, forKey: .deliveryAddress) + } + } + + /* + Model: ShipmentTrackResponseBagListItemBreakValues + Used By: Order + */ + + class ShipmentTrackResponseBagListItemBreakValues: Codable { + public var name: String? + + public var display: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case name + + case display + + case value + } + + public init(display: String?, name: String?, value: String?) { + self.name = name + + self.display = display + + self.value = value + } + + public func duplicate() -> ShipmentTrackResponseBagListItemBreakValues { + let dict = self.dictionary! + let copy = ShipmentTrackResponseBagListItemBreakValues(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: ShipmentTrackResponseBagListItemStatuses + Used By: Order + */ + + class ShipmentTrackResponseBagListItemStatuses: Codable { + public var npsRating: Int? + + public var npsString: String? + + public var progressStatus: [ShipmentTrackResponseBagListItemStatusesProgress]? + + public var flowType: String? + + public var statusProgress: Int? + + public var isNpsDone: Bool? + + public var headerMessage: String? + + public var isDelayed: String? + + public var trackingList: [ShipmentTrackResponseBagListItemStatusesTrack]? + + public enum CodingKeys: String, CodingKey { + case npsRating = "nps_rating" + + case npsString = "nps_string" + + case progressStatus = "progress_status" + + case flowType = "flow_type" + + case statusProgress = "status_progress" + + case isNpsDone = "is_nps_done" + + case headerMessage = "header_message" + + case isDelayed = "is_delayed" + + case trackingList = "tracking_list" + } + + public init(flowType: String?, headerMessage: String?, isDelayed: String?, isNpsDone: Bool?, npsRating: Int?, npsString: String?, progressStatus: [ShipmentTrackResponseBagListItemStatusesProgress]?, statusProgress: Int?, trackingList: [ShipmentTrackResponseBagListItemStatusesTrack]?) { + self.npsRating = npsRating + + self.npsString = npsString + + self.progressStatus = progressStatus + + self.flowType = flowType + + self.statusProgress = statusProgress + + self.isNpsDone = isNpsDone + + self.headerMessage = headerMessage + + self.isDelayed = isDelayed + + self.trackingList = trackingList + } + + public func duplicate() -> ShipmentTrackResponseBagListItemStatuses { + let dict = self.dictionary! + let copy = ShipmentTrackResponseBagListItemStatuses(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + npsRating = try container.decode(Int.self, forKey: .npsRating) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + npsString = try container.decode(String.self, forKey: .npsString) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + progressStatus = try container.decode([ShipmentTrackResponseBagListItemStatusesProgress].self, forKey: .progressStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + flowType = try container.decode(String.self, forKey: .flowType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + statusProgress = try container.decode(Int.self, forKey: .statusProgress) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isNpsDone = try container.decode(Bool.self, forKey: .isNpsDone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + headerMessage = try container.decode(String.self, forKey: .headerMessage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isDelayed = try container.decode(String.self, forKey: .isDelayed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + trackingList = try container.decode([ShipmentTrackResponseBagListItemStatusesTrack].self, forKey: .trackingList) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(npsRating, forKey: .npsRating) + + try? container.encodeIfPresent(npsString, forKey: .npsString) + + try? container.encodeIfPresent(progressStatus, forKey: .progressStatus) + + try? container.encodeIfPresent(flowType, forKey: .flowType) + + try? container.encodeIfPresent(statusProgress, forKey: .statusProgress) + + try? container.encodeIfPresent(isNpsDone, forKey: .isNpsDone) + + try? container.encodeIfPresent(headerMessage, forKey: .headerMessage) + + try? container.encodeIfPresent(isDelayed, forKey: .isDelayed) + + try? container.encodeIfPresent(trackingList, forKey: .trackingList) + } + } + + /* + Model: ShipmentTrackResponseBagListItemStatusesProgress + Used By: Order + */ + + class ShipmentTrackResponseBagListItemStatusesProgress: Codable { + public var title: String? + + public var type: String? + + public var state: Bool? + + public enum CodingKeys: String, CodingKey { + case title + + case type + + case state + } + + public init(state: Bool?, title: String?, type: String?) { + self.title = title + + self.type = type + + self.state = state + } + + public func duplicate() -> ShipmentTrackResponseBagListItemStatusesProgress { + let dict = self.dictionary! + let copy = ShipmentTrackResponseBagListItemStatusesProgress(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(Bool.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(state, forKey: .state) + } + } + + /* + Model: ShipmentTrackResponseBagListItemStatusesTrack + Used By: Order + */ + + class ShipmentTrackResponseBagListItemStatusesTrack: Codable { + public var status: String? + + public var time: String? + + public var isPassed: Bool? + + public var isCurrent: Bool? + + public enum CodingKeys: String, CodingKey { + case status + + case time + + case isPassed = "is_passed" + + case isCurrent = "is_current" + } + + public init(isCurrent: Bool?, isPassed: Bool?, status: String?, time: String?) { + self.status = status + + self.time = time + + self.isPassed = isPassed + + self.isCurrent = isCurrent + } + + public func duplicate() -> ShipmentTrackResponseBagListItemStatusesTrack { + let dict = self.dictionary! + let copy = ShipmentTrackResponseBagListItemStatusesTrack(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + time = try container.decode(String.self, forKey: .time) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isPassed = try container.decode(Bool.self, forKey: .isPassed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isCurrent = try container.decode(Bool.self, forKey: .isCurrent) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(time, forKey: .time) + + try? container.encodeIfPresent(isPassed, forKey: .isPassed) + + try? container.encodeIfPresent(isCurrent, forKey: .isCurrent) + } + } + + /* + Model: ShipmentTrackResponseBagListItemDpDetails + Used By: Order + */ + + class ShipmentTrackResponseBagListItemDpDetails: Codable { + public var trackingNo: String? + + public var courier: String? + + public enum CodingKeys: String, CodingKey { + case trackingNo = "tracking_no" + + case courier + } + + public init(courier: String?, trackingNo: String?) { + self.trackingNo = trackingNo + + self.courier = courier + } + + public func duplicate() -> ShipmentTrackResponseBagListItemDpDetails { + let dict = self.dictionary! + let copy = ShipmentTrackResponseBagListItemDpDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + trackingNo = try container.decode(String.self, forKey: .trackingNo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + courier = try container.decode(String.self, forKey: .courier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(trackingNo, forKey: .trackingNo) + + try? container.encodeIfPresent(courier, forKey: .courier) + } + } + + /* + Model: ShipmentTrackResponseBagListItemsProductImage + Used By: Order + */ + + class ShipmentTrackResponseBagListItemsProductImage: Codable { + public var aspectRatio: String? + + public var url: String? + + public enum CodingKeys: String, CodingKey { + case aspectRatio = "aspect_ratio" + + case url + } + + public init(aspectRatio: String?, url: String?) { + self.aspectRatio = aspectRatio + + self.url = url + } + + public func duplicate() -> ShipmentTrackResponseBagListItemsProductImage { + let dict = self.dictionary! + let copy = ShipmentTrackResponseBagListItemsProductImage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + aspectRatio = try container.decode(String.self, forKey: .aspectRatio) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(aspectRatio, forKey: .aspectRatio) + + try? container.encodeIfPresent(url, forKey: .url) + } + } + + /* + Model: UpdateShipmentStatusResponse + Used By: Order + */ + + class UpdateShipmentStatusResponse: Codable { + public var shipments: [String: Any] + + public var errorShipments: [[String: Any]]? + + public enum CodingKeys: String, CodingKey { + case shipments + + case errorShipments = "error_shipments" + } + + public init(errorShipments: [[String: Any]]?, shipments: [String: Any]) { + self.shipments = shipments + + self.errorShipments = errorShipments + } + + public func duplicate() -> UpdateShipmentStatusResponse { + let dict = self.dictionary! + let copy = UpdateShipmentStatusResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + shipments = try container.decode([String: Any].self, forKey: .shipments) + + do { + errorShipments = try container.decode([[String: Any]].self, forKey: .errorShipments) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(shipments, forKey: .shipments) + + try? container.encodeIfPresent(errorShipments, forKey: .errorShipments) + } + } + + /* + Model: UpdateShipmentStatusBody + Used By: Order + */ + + class UpdateShipmentStatusBody: Codable { + public var shipments: [String: Any] + + public var forceTransition: Bool + + public var task: Bool + + public enum CodingKeys: String, CodingKey { + case shipments + + case forceTransition = "force_transition" + + case task + } + + public init(forceTransition: Bool, shipments: [String: Any], task: Bool) { + self.shipments = shipments + + self.forceTransition = forceTransition + + self.task = task + } + + public func duplicate() -> UpdateShipmentStatusBody { + let dict = self.dictionary! + let copy = UpdateShipmentStatusBody(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + shipments = try container.decode([String: Any].self, forKey: .shipments) + + forceTransition = try container.decode(Bool.self, forKey: .forceTransition) + + task = try container.decode(Bool.self, forKey: .task) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(shipments, forKey: .shipments) + + try? container.encodeIfPresent(forceTransition, forKey: .forceTransition) + + try? container.encodeIfPresent(task, forKey: .task) + } + } + + /* + Model: ShipmentReasonsResponse + Used By: Order + */ + + class ShipmentReasonsResponse: Codable { + public var success: Bool + + public var message: String + + public var reasons: [ShipmentResponseReasons] + + public enum CodingKeys: String, CodingKey { + case success + + case message + + case reasons + } + + public init(message: String, reasons: [ShipmentResponseReasons], success: Bool) { + self.success = success + + self.message = message + + self.reasons = reasons + } + + public func duplicate() -> ShipmentReasonsResponse { + let dict = self.dictionary! + let copy = ShipmentReasonsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + message = try container.decode(String.self, forKey: .message) + + reasons = try container.decode([ShipmentResponseReasons].self, forKey: .reasons) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(reasons, forKey: .reasons) + } + } + + /* + Model: ShipmentResponseReasons + Used By: Order + */ + + class ShipmentResponseReasons: Codable { + public var reasonId: Double? + + public var reason: String? + + public enum CodingKeys: String, CodingKey { + case reasonId = "reason_id" + + case reason + } + + public init(reason: String?, reasonId: Double?) { + self.reasonId = reasonId + + self.reason = reason + } + + public func duplicate() -> ShipmentResponseReasons { + let dict = self.dictionary! + let copy = ShipmentResponseReasons(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + reasonId = try container.decode(Double.self, forKey: .reasonId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + reason = try container.decode(String.self, forKey: .reason) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(reasonId, forKey: .reasonId) + + try? container.encodeIfPresent(reason, forKey: .reason) + } + } + + /* + Model: PlatformShipmentTrack + Used By: Order + */ + + class PlatformShipmentTrack: Codable { + public var results: Results + + public enum CodingKeys: String, CodingKey { + case results + } + + public init(results: Results) { + self.results = results + } + + public func duplicate() -> PlatformShipmentTrack { + let dict = self.dictionary! + let copy = PlatformShipmentTrack(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + results = try container.decode(Results.self, forKey: .results) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(results, forKey: .results) + } + } + + /* + Model: Results + Used By: Order + */ + + class Results: Codable { + public var awb: String? + + public var updatedAt: String? + + public var lastLocationRecievedAt: String? + + public var reason: String? + + public var shipmentType: String? + + public var status: String? + + public var updatedTime: String? + + public var accountName: String? + + public enum CodingKeys: String, CodingKey { + case awb + + case updatedAt = "updated_at" + + case lastLocationRecievedAt = "last_location_recieved_at" + + case reason + + case shipmentType = "shipment_type" + + case status + + case updatedTime = "updated_time" + + case accountName = "account_name" + } + + public init(accountName: String?, awb: String?, lastLocationRecievedAt: String?, reason: String?, shipmentType: String?, status: String?, updatedAt: String?, updatedTime: String?) { + self.awb = awb + + self.updatedAt = updatedAt + + self.lastLocationRecievedAt = lastLocationRecievedAt + + self.reason = reason + + self.shipmentType = shipmentType + + self.status = status + + self.updatedTime = updatedTime + + self.accountName = accountName + } + + public func duplicate() -> Results { + let dict = self.dictionary! + let copy = Results(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + awb = try container.decode(String.self, forKey: .awb) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastLocationRecievedAt = try container.decode(String.self, forKey: .lastLocationRecievedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + reason = try container.decode(String.self, forKey: .reason) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + shipmentType = try container.decode(String.self, forKey: .shipmentType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedTime = try container.decode(String.self, forKey: .updatedTime) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + accountName = try container.decode(String.self, forKey: .accountName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(awb, forKey: .awb) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(lastLocationRecievedAt, forKey: .lastLocationRecievedAt) + + try? container.encodeIfPresent(reason, forKey: .reason) + + try? container.encodeIfPresent(shipmentType, forKey: .shipmentType) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(updatedTime, forKey: .updatedTime) + + try? container.encodeIfPresent(accountName, forKey: .accountName) + } + } + + /* + Model: ShipmentUpdateRequest + Used By: Order + */ + + class ShipmentUpdateRequest: Codable { + public var bags: [String] + + public var reason: [String: Any] + + public var comments: String + + public var action: String + + public enum CodingKeys: String, CodingKey { + case bags + + case reason + + case comments + + case action + } + + public init(action: String, bags: [String], comments: String, reason: [String: Any]) { + self.bags = bags + + self.reason = reason + + self.comments = comments + + self.action = action + } + + public func duplicate() -> ShipmentUpdateRequest { + let dict = self.dictionary! + let copy = ShipmentUpdateRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + bags = try container.decode([String].self, forKey: .bags) + + reason = try container.decode([String: Any].self, forKey: .reason) + + comments = try container.decode(String.self, forKey: .comments) + + action = try container.decode(String.self, forKey: .action) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(bags, forKey: .bags) + + try? container.encodeIfPresent(reason, forKey: .reason) + + try? container.encodeIfPresent(comments, forKey: .comments) + + try? container.encodeIfPresent(action, forKey: .action) + } + } + + /* + Model: ShipmentUpdateResponse + Used By: Order + */ + + class ShipmentUpdateResponse: Codable { + public var success: Bool + + public var message: String + + public enum CodingKeys: String, CodingKey { + case success + + case message + } + + public init(message: String, success: Bool) { + self.success = success + + self.message = message + } + + public func duplicate() -> ShipmentUpdateResponse { + let dict = self.dictionary! + let copy = ShipmentUpdateResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + message = try container.decode(String.self, forKey: .message) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: UpdateProcessShipmenstRequestBody + Used By: Order + */ + + class UpdateProcessShipmenstRequestBody: Codable { + public var shipmentIds: [String] + + public var expectedStatus: String + + public enum CodingKeys: String, CodingKey { + case shipmentIds = "shipment_ids" + + case expectedStatus = "expected_status" + } + + public init(expectedStatus: String, shipmentIds: [String]) { + self.shipmentIds = shipmentIds + + self.expectedStatus = expectedStatus + } + + public func duplicate() -> UpdateProcessShipmenstRequestBody { + let dict = self.dictionary! + let copy = UpdateProcessShipmenstRequestBody(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + shipmentIds = try container.decode([String].self, forKey: .shipmentIds) + + expectedStatus = try container.decode(String.self, forKey: .expectedStatus) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(shipmentIds, forKey: .shipmentIds) + + try? container.encodeIfPresent(expectedStatus, forKey: .expectedStatus) + } + } + + /* + Model: UpdateProcessShipmenstRequestResponse + Used By: Order + */ + + class UpdateProcessShipmenstRequestResponse: Codable { + public var success: Bool + + public var message: String + + public enum CodingKeys: String, CodingKey { + case success + + case message + } + + public init(message: String, success: Bool) { + self.success = success + + self.message = message + } + + public func duplicate() -> UpdateProcessShipmenstRequestResponse { + let dict = self.dictionary! + let copy = UpdateProcessShipmenstRequestResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + message = try container.decode(String.self, forKey: .message) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: GetVoiceCallbackResponse + Used By: Order + */ + + class GetVoiceCallbackResponse: Codable { + public var message: String + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String) { + self.message = message + } + + public func duplicate() -> GetVoiceCallbackResponse { + let dict = self.dictionary! + let copy = GetVoiceCallbackResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + message = try container.decode(String.self, forKey: .message) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: GetClickToCallResponse + Used By: Order + */ + + class GetClickToCallResponse: Codable { + public var message: String + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String) { + self.message = message + } + + public func duplicate() -> GetClickToCallResponse { + let dict = self.dictionary! + let copy = GetClickToCallResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + message = try container.decode(String.self, forKey: .message) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: ApefaceApiError + Used By: Order + */ + + class ApefaceApiError: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> ApefaceApiError { + let dict = self.dictionary! + let copy = ApefaceApiError(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } +} diff --git a/Sources/code/platform/models/PartnerPlatformModelClass.swift b/Sources/code/platform/models/PartnerPlatformModelClass.swift new file mode 100644 index 0000000000..0b3e115fff --- /dev/null +++ b/Sources/code/platform/models/PartnerPlatformModelClass.swift @@ -0,0 +1,376 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: AddProxyReq + Used By: Partner + */ + + class AddProxyReq: Codable { + public var attachedPath: String? + + public var proxyUrl: String? + + public enum CodingKeys: String, CodingKey { + case attachedPath = "attached_path" + + case proxyUrl = "proxy_url" + } + + public init(attachedPath: String?, proxyUrl: String?) { + self.attachedPath = attachedPath + + self.proxyUrl = proxyUrl + } + + public func duplicate() -> AddProxyReq { + let dict = self.dictionary! + let copy = AddProxyReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + attachedPath = try container.decode(String.self, forKey: .attachedPath) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + proxyUrl = try container.decode(String.self, forKey: .proxyUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(attachedPath, forKey: .attachedPath) + + try? container.encodeIfPresent(proxyUrl, forKey: .proxyUrl) + } + } + + /* + Model: AddProxyResponse + Used By: Partner + */ + + class AddProxyResponse: Codable { + public var id: String? + + public var attachedPath: String? + + public var proxyUrl: String? + + public var companyId: String? + + public var applicationId: String? + + public var extensionId: String? + + public var createdAt: String? + + public var modifiedAt: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case attachedPath = "attached_path" + + case proxyUrl = "proxy_url" + + case companyId = "company_id" + + case applicationId = "application_id" + + case extensionId = "extension_id" + + case createdAt = "created_at" + + case modifiedAt = "modified_at" + } + + public init(applicationId: String?, attachedPath: String?, companyId: String?, createdAt: String?, extensionId: String?, modifiedAt: String?, proxyUrl: String?, id: String?) { + self.id = id + + self.attachedPath = attachedPath + + self.proxyUrl = proxyUrl + + self.companyId = companyId + + self.applicationId = applicationId + + self.extensionId = extensionId + + self.createdAt = createdAt + + self.modifiedAt = modifiedAt + } + + public func duplicate() -> AddProxyResponse { + let dict = self.dictionary! + let copy = AddProxyResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attachedPath = try container.decode(String.self, forKey: .attachedPath) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + proxyUrl = try container.decode(String.self, forKey: .proxyUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(String.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + applicationId = try container.decode(String.self, forKey: .applicationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + extensionId = try container.decode(String.self, forKey: .extensionId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + modifiedAt = try container.decode(String.self, forKey: .modifiedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(attachedPath, forKey: .attachedPath) + + try? container.encodeIfPresent(proxyUrl, forKey: .proxyUrl) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + + try? container.encodeIfPresent(extensionId, forKey: .extensionId) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(modifiedAt, forKey: .modifiedAt) + } + } + + /* + Model: APIError + Used By: Partner + */ + + class APIError: Codable { + public var code: String? + + public var message: String? + + public var info: String? + + public var requestId: String? + + public var meta: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case code + + case message + + case info + + case requestId = "request_id" + + case meta + } + + public init(code: String?, info: String?, message: String?, meta: [String: Any]?, requestId: String?) { + self.code = code + + self.message = message + + self.info = info + + self.requestId = requestId + + self.meta = meta + } + + public func duplicate() -> APIError { + let dict = self.dictionary! + let copy = APIError(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + info = try container.decode(String.self, forKey: .info) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(info, forKey: .info) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(meta, forKey: .meta) + } + } + + /* + Model: RemoveProxyResponse + Used By: Partner + */ + + class RemoveProxyResponse: Codable { + public var message: String? + + public var data: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case message + + case data + } + + public init(data: [String: Any]?, message: String?) { + self.message = message + + self.data = data + } + + public func duplicate() -> RemoveProxyResponse { + let dict = self.dictionary! + let copy = RemoveProxyResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + data = try container.decode([String: Any].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(data, forKey: .data) + } + } +} diff --git a/Sources/code/platform/models/PaymentPlatformModelClass.swift b/Sources/code/platform/models/PaymentPlatformModelClass.swift new file mode 100644 index 0000000000..eb538ee08d --- /dev/null +++ b/Sources/code/platform/models/PaymentPlatformModelClass.swift @@ -0,0 +1,3181 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: PaymentGatewayConfigResponse + Used By: Payment + */ + + class PaymentGatewayConfigResponse: Codable { + public var appId: String + + public var created: Bool + + public var success: Bool + + public var aggregators: [[String: Any]]? + + public var excludedFields: [String] + + public var displayFields: [String] + + public enum CodingKeys: String, CodingKey { + case appId = "app_id" + + case created + + case success + + case aggregators + + case excludedFields = "excluded_fields" + + case displayFields = "display_fields" + } + + public init(aggregators: [[String: Any]]?, appId: String, created: Bool, displayFields: [String], excludedFields: [String], success: Bool) { + self.appId = appId + + self.created = created + + self.success = success + + self.aggregators = aggregators + + self.excludedFields = excludedFields + + self.displayFields = displayFields + } + + public func duplicate() -> PaymentGatewayConfigResponse { + let dict = self.dictionary! + let copy = PaymentGatewayConfigResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + appId = try container.decode(String.self, forKey: .appId) + + created = try container.decode(Bool.self, forKey: .created) + + success = try container.decode(Bool.self, forKey: .success) + + do { + aggregators = try container.decode([[String: Any]].self, forKey: .aggregators) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + excludedFields = try container.decode([String].self, forKey: .excludedFields) + + displayFields = try container.decode([String].self, forKey: .displayFields) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appId, forKey: .appId) + + try? container.encodeIfPresent(created, forKey: .created) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(aggregators, forKey: .aggregators) + + try? container.encodeIfPresent(excludedFields, forKey: .excludedFields) + + try? container.encodeIfPresent(displayFields, forKey: .displayFields) + } + } + + /* + Model: ErrorCodeDescription + Used By: Payment + */ + + class ErrorCodeDescription: Codable { + public var success: Bool + + public var description: String + + public var code: String + + public enum CodingKeys: String, CodingKey { + case success + + case description + + case code + } + + public init(code: String, description: String, success: Bool) { + self.success = success + + self.description = description + + self.code = code + } + + public func duplicate() -> ErrorCodeDescription { + let dict = self.dictionary! + let copy = ErrorCodeDescription(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + description = try container.decode(String.self, forKey: .description) + + code = try container.decode(String.self, forKey: .code) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: PaymentGatewayConfig + Used By: Payment + */ + + class PaymentGatewayConfig: Codable { + public var merchantSalt: String + + public var isActive: Bool? + + public var secret: String + + public var configType: String + + public var key: String + + public enum CodingKeys: String, CodingKey { + case merchantSalt = "merchant_salt" + + case isActive = "is_active" + + case secret + + case configType = "config_type" + + case key + } + + public init(configType: String, isActive: Bool?, key: String, merchantSalt: String, secret: String) { + self.merchantSalt = merchantSalt + + self.isActive = isActive + + self.secret = secret + + self.configType = configType + + self.key = key + } + + public func duplicate() -> PaymentGatewayConfig { + let dict = self.dictionary! + let copy = PaymentGatewayConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + merchantSalt = try container.decode(String.self, forKey: .merchantSalt) + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + secret = try container.decode(String.self, forKey: .secret) + + configType = try container.decode(String.self, forKey: .configType) + + key = try container.decode(String.self, forKey: .key) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(merchantSalt, forKey: .merchantSalt) + + try? container.encode(isActive, forKey: .isActive) + + try? container.encodeIfPresent(secret, forKey: .secret) + + try? container.encodeIfPresent(configType, forKey: .configType) + + try? container.encodeIfPresent(key, forKey: .key) + } + } + + /* + Model: PaymentGatewayConfigRequest + Used By: Payment + */ + + class PaymentGatewayConfigRequest: Codable { + public var isActive: Bool? + + public var aggregatorName: PaymentGatewayConfig? + + public var appId: String + + public enum CodingKeys: String, CodingKey { + case isActive = "is_active" + + case aggregatorName = "aggregator_name" + + case appId = "app_id" + } + + public init(aggregatorName: PaymentGatewayConfig?, appId: String, isActive: Bool?) { + self.isActive = isActive + + self.aggregatorName = aggregatorName + + self.appId = appId + } + + public func duplicate() -> PaymentGatewayConfigRequest { + let dict = self.dictionary! + let copy = PaymentGatewayConfigRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + aggregatorName = try container.decode(PaymentGatewayConfig.self, forKey: .aggregatorName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + appId = try container.decode(String.self, forKey: .appId) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(isActive, forKey: .isActive) + + try? container.encodeIfPresent(aggregatorName, forKey: .aggregatorName) + + try? container.encodeIfPresent(appId, forKey: .appId) + } + } + + /* + Model: PaymentGatewayToBeReviewed + Used By: Payment + */ + + class PaymentGatewayToBeReviewed: Codable { + public var success: Bool + + public var aggregator: [String] + + public enum CodingKeys: String, CodingKey { + case success + + case aggregator + } + + public init(aggregator: [String], success: Bool) { + self.success = success + + self.aggregator = aggregator + } + + public func duplicate() -> PaymentGatewayToBeReviewed { + let dict = self.dictionary! + let copy = PaymentGatewayToBeReviewed(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + aggregator = try container.decode([String].self, forKey: .aggregator) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(aggregator, forKey: .aggregator) + } + } + + /* + Model: ErrorCodeAndDescription + Used By: Payment + */ + + class ErrorCodeAndDescription: Codable { + public var description: String + + public var code: String + + public enum CodingKeys: String, CodingKey { + case description + + case code + } + + public init(code: String, description: String) { + self.description = description + + self.code = code + } + + public func duplicate() -> ErrorCodeAndDescription { + let dict = self.dictionary! + let copy = ErrorCodeAndDescription(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + description = try container.decode(String.self, forKey: .description) + + code = try container.decode(String.self, forKey: .code) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: HttpErrorCodeAndResponse + Used By: Payment + */ + + class HttpErrorCodeAndResponse: Codable { + public var success: Bool + + public var error: ErrorCodeAndDescription + + public enum CodingKeys: String, CodingKey { + case success + + case error + } + + public init(error: ErrorCodeAndDescription, success: Bool) { + self.success = success + + self.error = error + } + + public func duplicate() -> HttpErrorCodeAndResponse { + let dict = self.dictionary! + let copy = HttpErrorCodeAndResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + error = try container.decode(ErrorCodeAndDescription.self, forKey: .error) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(error, forKey: .error) + } + } + + /* + Model: PaymentModeLogo + Used By: Payment + */ + + class PaymentModeLogo: Codable { + public var large: String + + public var small: String + + public enum CodingKeys: String, CodingKey { + case large + + case small + } + + public init(large: String, small: String) { + self.large = large + + self.small = small + } + + public func duplicate() -> PaymentModeLogo { + let dict = self.dictionary! + let copy = PaymentModeLogo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + large = try container.decode(String.self, forKey: .large) + + small = try container.decode(String.self, forKey: .small) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(large, forKey: .large) + + try? container.encodeIfPresent(small, forKey: .small) + } + } + + /* + Model: IntentApp + Used By: Payment + */ + + class IntentApp: Codable { + public var logos: PaymentModeLogo? + + public var packageName: String? + + public var displayName: String? + + public var code: String? + + public enum CodingKeys: String, CodingKey { + case logos + + case packageName = "package_name" + + case displayName = "display_name" + + case code + } + + public init(code: String?, displayName: String?, logos: PaymentModeLogo?, packageName: String?) { + self.logos = logos + + self.packageName = packageName + + self.displayName = displayName + + self.code = code + } + + public func duplicate() -> IntentApp { + let dict = self.dictionary! + let copy = IntentApp(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + logos = try container.decode(PaymentModeLogo.self, forKey: .logos) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + packageName = try container.decode(String.self, forKey: .packageName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(logos, forKey: .logos) + + try? container.encode(packageName, forKey: .packageName) + + try? container.encode(displayName, forKey: .displayName) + + try? container.encode(code, forKey: .code) + } + } + + /* + Model: IntentAppErrorList + Used By: Payment + */ + + class IntentAppErrorList: Codable { + public var code: String? + + public var packageName: String? + + public enum CodingKeys: String, CodingKey { + case code + + case packageName = "package_name" + } + + public init(code: String?, packageName: String?) { + self.code = code + + self.packageName = packageName + } + + public func duplicate() -> IntentAppErrorList { + let dict = self.dictionary! + let copy = IntentAppErrorList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + packageName = try container.decode(String.self, forKey: .packageName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(code, forKey: .code) + + try? container.encode(packageName, forKey: .packageName) + } + } + + /* + Model: PaymentModeList + Used By: Payment + */ + + class PaymentModeList: Codable { + public var nickname: String? + + public var intentAppErrorList: [String]? + + public var logoUrl: PaymentModeLogo? + + public var cardId: String? + + public var fyndVpa: String? + + public var intentFlow: Bool? + + public var cardToken: String? + + public var cardIssuer: String? + + public var expMonth: Int? + + public var intentApp: [IntentApp]? + + public var cardFingerprint: String? + + public var cardReference: String? + + public var aggregatorName: String + + public var merchantCode: String? + + public var intentAppErrorDictList: [IntentAppErrorList]? + + public var displayName: String? + + public var retryCount: Int? + + public var expired: Bool? + + public var code: String? + + public var name: String? + + public var cardNumber: String? + + public var cardBrand: String? + + public var cardBrandImage: String? + + public var timeout: Int? + + public var cardType: String? + + public var displayPriority: Int? + + public var cardName: String? + + public var cardIsin: String? + + public var expYear: Int? + + public enum CodingKeys: String, CodingKey { + case nickname + + case intentAppErrorList = "intent_app_error_list" + + case logoUrl = "logo_url" + + case cardId = "card_id" + + case fyndVpa = "fynd_vpa" + + case intentFlow = "intent_flow" + + case cardToken = "card_token" + + case cardIssuer = "card_issuer" + + case expMonth = "exp_month" + + case intentApp = "intent_app" + + case cardFingerprint = "card_fingerprint" + + case cardReference = "card_reference" + + case aggregatorName = "aggregator_name" + + case merchantCode = "merchant_code" + + case intentAppErrorDictList = "intent_app_error_dict_list" + + case displayName = "display_name" + + case retryCount = "retry_count" + + case expired + + case code + + case name + + case cardNumber = "card_number" + + case cardBrand = "card_brand" + + case cardBrandImage = "card_brand_image" + + case timeout + + case cardType = "card_type" + + case displayPriority = "display_priority" + + case cardName = "card_name" + + case cardIsin = "card_isin" + + case expYear = "exp_year" + } + + public init(aggregatorName: String, cardBrand: String?, cardBrandImage: String?, cardFingerprint: String?, cardId: String?, cardIsin: String?, cardIssuer: String?, cardName: String?, cardNumber: String?, cardReference: String?, cardToken: String?, cardType: String?, code: String?, displayName: String?, displayPriority: Int?, expired: Bool?, expMonth: Int?, expYear: Int?, fyndVpa: String?, intentApp: [IntentApp]?, intentAppErrorDictList: [IntentAppErrorList]?, intentAppErrorList: [String]?, intentFlow: Bool?, logoUrl: PaymentModeLogo?, merchantCode: String?, name: String?, nickname: String?, retryCount: Int?, timeout: Int?) { + self.nickname = nickname + + self.intentAppErrorList = intentAppErrorList + + self.logoUrl = logoUrl + + self.cardId = cardId + + self.fyndVpa = fyndVpa + + self.intentFlow = intentFlow + + self.cardToken = cardToken + + self.cardIssuer = cardIssuer + + self.expMonth = expMonth + + self.intentApp = intentApp + + self.cardFingerprint = cardFingerprint + + self.cardReference = cardReference + + self.aggregatorName = aggregatorName + + self.merchantCode = merchantCode + + self.intentAppErrorDictList = intentAppErrorDictList + + self.displayName = displayName + + self.retryCount = retryCount + + self.expired = expired + + self.code = code + + self.name = name + + self.cardNumber = cardNumber + + self.cardBrand = cardBrand + + self.cardBrandImage = cardBrandImage + + self.timeout = timeout + + self.cardType = cardType + + self.displayPriority = displayPriority + + self.cardName = cardName + + self.cardIsin = cardIsin + + self.expYear = expYear + } + + public func duplicate() -> PaymentModeList { + let dict = self.dictionary! + let copy = PaymentModeList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + nickname = try container.decode(String.self, forKey: .nickname) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + intentAppErrorList = try container.decode([String].self, forKey: .intentAppErrorList) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logoUrl = try container.decode(PaymentModeLogo.self, forKey: .logoUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardId = try container.decode(String.self, forKey: .cardId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fyndVpa = try container.decode(String.self, forKey: .fyndVpa) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + intentFlow = try container.decode(Bool.self, forKey: .intentFlow) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardToken = try container.decode(String.self, forKey: .cardToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardIssuer = try container.decode(String.self, forKey: .cardIssuer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expMonth = try container.decode(Int.self, forKey: .expMonth) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + intentApp = try container.decode([IntentApp].self, forKey: .intentApp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardFingerprint = try container.decode(String.self, forKey: .cardFingerprint) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardReference = try container.decode(String.self, forKey: .cardReference) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + aggregatorName = try container.decode(String.self, forKey: .aggregatorName) + + do { + merchantCode = try container.decode(String.self, forKey: .merchantCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + intentAppErrorDictList = try container.decode([IntentAppErrorList].self, forKey: .intentAppErrorDictList) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + retryCount = try container.decode(Int.self, forKey: .retryCount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expired = try container.decode(Bool.self, forKey: .expired) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardNumber = try container.decode(String.self, forKey: .cardNumber) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardBrand = try container.decode(String.self, forKey: .cardBrand) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardBrandImage = try container.decode(String.self, forKey: .cardBrandImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + timeout = try container.decode(Int.self, forKey: .timeout) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardType = try container.decode(String.self, forKey: .cardType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayPriority = try container.decode(Int.self, forKey: .displayPriority) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardName = try container.decode(String.self, forKey: .cardName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cardIsin = try container.decode(String.self, forKey: .cardIsin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expYear = try container.decode(Int.self, forKey: .expYear) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(nickname, forKey: .nickname) + + try? container.encode(intentAppErrorList, forKey: .intentAppErrorList) + + try? container.encode(logoUrl, forKey: .logoUrl) + + try? container.encode(cardId, forKey: .cardId) + + try? container.encode(fyndVpa, forKey: .fyndVpa) + + try? container.encode(intentFlow, forKey: .intentFlow) + + try? container.encode(cardToken, forKey: .cardToken) + + try? container.encode(cardIssuer, forKey: .cardIssuer) + + try? container.encode(expMonth, forKey: .expMonth) + + try? container.encode(intentApp, forKey: .intentApp) + + try? container.encode(cardFingerprint, forKey: .cardFingerprint) + + try? container.encode(cardReference, forKey: .cardReference) + + try? container.encodeIfPresent(aggregatorName, forKey: .aggregatorName) + + try? container.encode(merchantCode, forKey: .merchantCode) + + try? container.encode(intentAppErrorDictList, forKey: .intentAppErrorDictList) + + try? container.encode(displayName, forKey: .displayName) + + try? container.encode(retryCount, forKey: .retryCount) + + try? container.encode(expired, forKey: .expired) + + try? container.encode(code, forKey: .code) + + try? container.encode(name, forKey: .name) + + try? container.encode(cardNumber, forKey: .cardNumber) + + try? container.encode(cardBrand, forKey: .cardBrand) + + try? container.encode(cardBrandImage, forKey: .cardBrandImage) + + try? container.encode(timeout, forKey: .timeout) + + try? container.encode(cardType, forKey: .cardType) + + try? container.encode(displayPriority, forKey: .displayPriority) + + try? container.encode(cardName, forKey: .cardName) + + try? container.encode(cardIsin, forKey: .cardIsin) + + try? container.encode(expYear, forKey: .expYear) + } + } + + /* + Model: RootPaymentMode + Used By: Payment + */ + + class RootPaymentMode: Codable { + public var displayPriority: Int + + public var addCardEnabled: Bool? + + public var aggregatorName: String? + + public var list: [PaymentModeList]? + + public var name: String + + public var anonymousEnable: Bool? + + public var displayName: String + + public enum CodingKeys: String, CodingKey { + case displayPriority = "display_priority" + + case addCardEnabled = "add_card_enabled" + + case aggregatorName = "aggregator_name" + + case list + + case name + + case anonymousEnable = "anonymous_enable" + + case displayName = "display_name" + } + + public init(addCardEnabled: Bool?, aggregatorName: String?, anonymousEnable: Bool?, displayName: String, displayPriority: Int, list: [PaymentModeList]?, name: String) { + self.displayPriority = displayPriority + + self.addCardEnabled = addCardEnabled + + self.aggregatorName = aggregatorName + + self.list = list + + self.name = name + + self.anonymousEnable = anonymousEnable + + self.displayName = displayName + } + + public func duplicate() -> RootPaymentMode { + let dict = self.dictionary! + let copy = RootPaymentMode(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + displayPriority = try container.decode(Int.self, forKey: .displayPriority) + + do { + addCardEnabled = try container.decode(Bool.self, forKey: .addCardEnabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + aggregatorName = try container.decode(String.self, forKey: .aggregatorName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + list = try container.decode([PaymentModeList].self, forKey: .list) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + name = try container.decode(String.self, forKey: .name) + + do { + anonymousEnable = try container.decode(Bool.self, forKey: .anonymousEnable) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + displayName = try container.decode(String.self, forKey: .displayName) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(displayPriority, forKey: .displayPriority) + + try? container.encode(addCardEnabled, forKey: .addCardEnabled) + + try? container.encode(aggregatorName, forKey: .aggregatorName) + + try? container.encodeIfPresent(list, forKey: .list) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encode(anonymousEnable, forKey: .anonymousEnable) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + } + } + + /* + Model: PaymentOptions + Used By: Payment + */ + + class PaymentOptions: Codable { + public var paymentOption: [RootPaymentMode] + + public enum CodingKeys: String, CodingKey { + case paymentOption = "payment_option" + } + + public init(paymentOption: [RootPaymentMode]) { + self.paymentOption = paymentOption + } + + public func duplicate() -> PaymentOptions { + let dict = self.dictionary! + let copy = PaymentOptions(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + paymentOption = try container.decode([RootPaymentMode].self, forKey: .paymentOption) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(paymentOption, forKey: .paymentOption) + } + } + + /* + Model: PaymentOptionsResponse + Used By: Payment + */ + + class PaymentOptionsResponse: Codable { + public var success: Bool + + public var paymentOptions: PaymentOptions + + public enum CodingKeys: String, CodingKey { + case success + + case paymentOptions = "payment_options" + } + + public init(paymentOptions: PaymentOptions, success: Bool) { + self.success = success + + self.paymentOptions = paymentOptions + } + + public func duplicate() -> PaymentOptionsResponse { + let dict = self.dictionary! + let copy = PaymentOptionsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + paymentOptions = try container.decode(PaymentOptions.self, forKey: .paymentOptions) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(paymentOptions, forKey: .paymentOptions) + } + } + + /* + Model: PayoutsResponse + Used By: Payment + */ + + class PayoutsResponse: Codable { + public var customers: [String: Any] + + public var isActive: Bool + + public var transferType: String + + public var uniqueTransferNo: [String: Any] + + public var payoutsAggregators: [[String: Any]] + + public var isDefault: Bool + + public var moreAttributes: [String: Any] + + public enum CodingKeys: String, CodingKey { + case customers + + case isActive = "is_active" + + case transferType = "transfer_type" + + case uniqueTransferNo = "unique_transfer_no" + + case payoutsAggregators = "payouts_aggregators" + + case isDefault = "is_default" + + case moreAttributes = "more_attributes" + } + + public init(customers: [String: Any], isActive: Bool, isDefault: Bool, moreAttributes: [String: Any], payoutsAggregators: [[String: Any]], transferType: String, uniqueTransferNo: [String: Any]) { + self.customers = customers + + self.isActive = isActive + + self.transferType = transferType + + self.uniqueTransferNo = uniqueTransferNo + + self.payoutsAggregators = payoutsAggregators + + self.isDefault = isDefault + + self.moreAttributes = moreAttributes + } + + public func duplicate() -> PayoutsResponse { + let dict = self.dictionary! + let copy = PayoutsResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + customers = try container.decode([String: Any].self, forKey: .customers) + + isActive = try container.decode(Bool.self, forKey: .isActive) + + transferType = try container.decode(String.self, forKey: .transferType) + + uniqueTransferNo = try container.decode([String: Any].self, forKey: .uniqueTransferNo) + + payoutsAggregators = try container.decode([[String: Any]].self, forKey: .payoutsAggregators) + + isDefault = try container.decode(Bool.self, forKey: .isDefault) + + moreAttributes = try container.decode([String: Any].self, forKey: .moreAttributes) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(customers, forKey: .customers) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(transferType, forKey: .transferType) + + try? container.encodeIfPresent(uniqueTransferNo, forKey: .uniqueTransferNo) + + try? container.encodeIfPresent(payoutsAggregators, forKey: .payoutsAggregators) + + try? container.encodeIfPresent(isDefault, forKey: .isDefault) + + try? container.encodeIfPresent(moreAttributes, forKey: .moreAttributes) + } + } + + /* + Model: PayoutBankDetails + Used By: Payment + */ + + class PayoutBankDetails: Codable { + public var city: String? + + public var ifscCode: String + + public var country: String? + + public var pincode: Int? + + public var accountNo: String? + + public var bankName: String? + + public var accountType: String + + public var accountHolder: String? + + public var branchName: String? + + public var state: String? + + public enum CodingKeys: String, CodingKey { + case city + + case ifscCode = "ifsc_code" + + case country + + case pincode + + case accountNo = "account_no" + + case bankName = "bank_name" + + case accountType = "account_type" + + case accountHolder = "account_holder" + + case branchName = "branch_name" + + case state + } + + public init(accountHolder: String?, accountNo: String?, accountType: String, bankName: String?, branchName: String?, city: String?, country: String?, ifscCode: String, pincode: Int?, state: String?) { + self.city = city + + self.ifscCode = ifscCode + + self.country = country + + self.pincode = pincode + + self.accountNo = accountNo + + self.bankName = bankName + + self.accountType = accountType + + self.accountHolder = accountHolder + + self.branchName = branchName + + self.state = state + } + + public func duplicate() -> PayoutBankDetails { + let dict = self.dictionary! + let copy = PayoutBankDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + city = try container.decode(String.self, forKey: .city) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + ifscCode = try container.decode(String.self, forKey: .ifscCode) + + do { + country = try container.decode(String.self, forKey: .country) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + pincode = try container.decode(Int.self, forKey: .pincode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + accountNo = try container.decode(String.self, forKey: .accountNo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bankName = try container.decode(String.self, forKey: .bankName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + accountType = try container.decode(String.self, forKey: .accountType) + + do { + accountHolder = try container.decode(String.self, forKey: .accountHolder) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + branchName = try container.decode(String.self, forKey: .branchName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + state = try container.decode(String.self, forKey: .state) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(city, forKey: .city) + + try? container.encodeIfPresent(ifscCode, forKey: .ifscCode) + + try? container.encodeIfPresent(country, forKey: .country) + + try? container.encodeIfPresent(pincode, forKey: .pincode) + + try? container.encodeIfPresent(accountNo, forKey: .accountNo) + + try? container.encodeIfPresent(bankName, forKey: .bankName) + + try? container.encodeIfPresent(accountType, forKey: .accountType) + + try? container.encodeIfPresent(accountHolder, forKey: .accountHolder) + + try? container.encodeIfPresent(branchName, forKey: .branchName) + + try? container.encodeIfPresent(state, forKey: .state) + } + } + + /* + Model: PayoutRequest + Used By: Payment + */ + + class PayoutRequest: Codable { + public var users: [String: Any] + + public var bankDetails: PayoutBankDetails + + public var isActive: Bool + + public var transferType: String + + public var uniqueExternalId: String + + public var aggregator: String + + public enum CodingKeys: String, CodingKey { + case users + + case bankDetails = "bank_details" + + case isActive = "is_active" + + case transferType = "transfer_type" + + case uniqueExternalId = "unique_external_id" + + case aggregator + } + + public init(aggregator: String, bankDetails: PayoutBankDetails, isActive: Bool, transferType: String, uniqueExternalId: String, users: [String: Any]) { + self.users = users + + self.bankDetails = bankDetails + + self.isActive = isActive + + self.transferType = transferType + + self.uniqueExternalId = uniqueExternalId + + self.aggregator = aggregator + } + + public func duplicate() -> PayoutRequest { + let dict = self.dictionary! + let copy = PayoutRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + users = try container.decode([String: Any].self, forKey: .users) + + bankDetails = try container.decode(PayoutBankDetails.self, forKey: .bankDetails) + + isActive = try container.decode(Bool.self, forKey: .isActive) + + transferType = try container.decode(String.self, forKey: .transferType) + + uniqueExternalId = try container.decode(String.self, forKey: .uniqueExternalId) + + aggregator = try container.decode(String.self, forKey: .aggregator) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(users, forKey: .users) + + try? container.encodeIfPresent(bankDetails, forKey: .bankDetails) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(transferType, forKey: .transferType) + + try? container.encodeIfPresent(uniqueExternalId, forKey: .uniqueExternalId) + + try? container.encodeIfPresent(aggregator, forKey: .aggregator) + } + } + + /* + Model: PayoutResponse + Used By: Payment + */ + + class PayoutResponse: Codable { + public var users: [String: Any] + + public var created: Bool + + public var bankDetails: [String: Any] + + public var success: Bool + + public var isActive: Bool + + public var uniqueTransferNo: String + + public var transferType: String + + public var aggregator: String + + public var paymentStatus: String + + public var payouts: [String: Any] + + public enum CodingKeys: String, CodingKey { + case users + + case created + + case bankDetails = "bank_details" + + case success + + case isActive = "is_active" + + case uniqueTransferNo = "unique_transfer_no" + + case transferType = "transfer_type" + + case aggregator + + case paymentStatus = "payment_status" + + case payouts + } + + public init(aggregator: String, bankDetails: [String: Any], created: Bool, isActive: Bool, paymentStatus: String, payouts: [String: Any], success: Bool, transferType: String, uniqueTransferNo: String, users: [String: Any]) { + self.users = users + + self.created = created + + self.bankDetails = bankDetails + + self.success = success + + self.isActive = isActive + + self.uniqueTransferNo = uniqueTransferNo + + self.transferType = transferType + + self.aggregator = aggregator + + self.paymentStatus = paymentStatus + + self.payouts = payouts + } + + public func duplicate() -> PayoutResponse { + let dict = self.dictionary! + let copy = PayoutResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + users = try container.decode([String: Any].self, forKey: .users) + + created = try container.decode(Bool.self, forKey: .created) + + bankDetails = try container.decode([String: Any].self, forKey: .bankDetails) + + success = try container.decode(Bool.self, forKey: .success) + + isActive = try container.decode(Bool.self, forKey: .isActive) + + uniqueTransferNo = try container.decode(String.self, forKey: .uniqueTransferNo) + + transferType = try container.decode(String.self, forKey: .transferType) + + aggregator = try container.decode(String.self, forKey: .aggregator) + + paymentStatus = try container.decode(String.self, forKey: .paymentStatus) + + payouts = try container.decode([String: Any].self, forKey: .payouts) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(users, forKey: .users) + + try? container.encodeIfPresent(created, forKey: .created) + + try? container.encodeIfPresent(bankDetails, forKey: .bankDetails) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(uniqueTransferNo, forKey: .uniqueTransferNo) + + try? container.encodeIfPresent(transferType, forKey: .transferType) + + try? container.encodeIfPresent(aggregator, forKey: .aggregator) + + try? container.encodeIfPresent(paymentStatus, forKey: .paymentStatus) + + try? container.encodeIfPresent(payouts, forKey: .payouts) + } + } + + /* + Model: UpdatePayoutResponse + Used By: Payment + */ + + class UpdatePayoutResponse: Codable { + public var success: Bool + + public var isActive: Bool + + public var isDefault: Bool + + public enum CodingKeys: String, CodingKey { + case success + + case isActive = "is_active" + + case isDefault = "is_default" + } + + public init(isActive: Bool, isDefault: Bool, success: Bool) { + self.success = success + + self.isActive = isActive + + self.isDefault = isDefault + } + + public func duplicate() -> UpdatePayoutResponse { + let dict = self.dictionary! + let copy = UpdatePayoutResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + isActive = try container.decode(Bool.self, forKey: .isActive) + + isDefault = try container.decode(Bool.self, forKey: .isDefault) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(isDefault, forKey: .isDefault) + } + } + + /* + Model: UpdatePayoutRequest + Used By: Payment + */ + + class UpdatePayoutRequest: Codable { + public var uniqueExternalId: String + + public var isActive: Bool + + public var isDefault: Bool + + public enum CodingKeys: String, CodingKey { + case uniqueExternalId = "unique_external_id" + + case isActive = "is_active" + + case isDefault = "is_default" + } + + public init(isActive: Bool, isDefault: Bool, uniqueExternalId: String) { + self.uniqueExternalId = uniqueExternalId + + self.isActive = isActive + + self.isDefault = isDefault + } + + public func duplicate() -> UpdatePayoutRequest { + let dict = self.dictionary! + let copy = UpdatePayoutRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + uniqueExternalId = try container.decode(String.self, forKey: .uniqueExternalId) + + isActive = try container.decode(Bool.self, forKey: .isActive) + + isDefault = try container.decode(Bool.self, forKey: .isDefault) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uniqueExternalId, forKey: .uniqueExternalId) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(isDefault, forKey: .isDefault) + } + } + + /* + Model: DeletePayoutResponse + Used By: Payment + */ + + class DeletePayoutResponse: Codable { + public var success: Bool + + public enum CodingKeys: String, CodingKey { + case success + } + + public init(success: Bool) { + self.success = success + } + + public func duplicate() -> DeletePayoutResponse { + let dict = self.dictionary! + let copy = DeletePayoutResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: SubscriptionPaymentMethodResponse + Used By: Payment + */ + + class SubscriptionPaymentMethodResponse: Codable { + public var success: Bool + + public var data: [[String: Any]] + + public enum CodingKeys: String, CodingKey { + case success + + case data + } + + public init(data: [[String: Any]], success: Bool) { + self.success = success + + self.data = data + } + + public func duplicate() -> SubscriptionPaymentMethodResponse { + let dict = self.dictionary! + let copy = SubscriptionPaymentMethodResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + data = try container.decode([[String: Any]].self, forKey: .data) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: DeleteSubscriptionPaymentMethodResponse + Used By: Payment + */ + + class DeleteSubscriptionPaymentMethodResponse: Codable { + public var success: Bool + + public enum CodingKeys: String, CodingKey { + case success + } + + public init(success: Bool) { + self.success = success + } + + public func duplicate() -> DeleteSubscriptionPaymentMethodResponse { + let dict = self.dictionary! + let copy = DeleteSubscriptionPaymentMethodResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: SubscriptionConfigResponse + Used By: Payment + */ + + class SubscriptionConfigResponse: Codable { + public var success: Bool + + public var config: [String: Any] + + public var aggregator: String + + public enum CodingKeys: String, CodingKey { + case success + + case config + + case aggregator + } + + public init(aggregator: String, config: [String: Any], success: Bool) { + self.success = success + + self.config = config + + self.aggregator = aggregator + } + + public func duplicate() -> SubscriptionConfigResponse { + let dict = self.dictionary! + let copy = SubscriptionConfigResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + config = try container.decode([String: Any].self, forKey: .config) + + aggregator = try container.decode(String.self, forKey: .aggregator) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(config, forKey: .config) + + try? container.encodeIfPresent(aggregator, forKey: .aggregator) + } + } + + /* + Model: SaveSubscriptionSetupIntentRequest + Used By: Payment + */ + + class SaveSubscriptionSetupIntentRequest: Codable { + public var uniqueExternalId: String + + public enum CodingKeys: String, CodingKey { + case uniqueExternalId = "unique_external_id" + } + + public init(uniqueExternalId: String) { + self.uniqueExternalId = uniqueExternalId + } + + public func duplicate() -> SaveSubscriptionSetupIntentRequest { + let dict = self.dictionary! + let copy = SaveSubscriptionSetupIntentRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + uniqueExternalId = try container.decode(String.self, forKey: .uniqueExternalId) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(uniqueExternalId, forKey: .uniqueExternalId) + } + } + + /* + Model: SaveSubscriptionSetupIntentResponse + Used By: Payment + */ + + class SaveSubscriptionSetupIntentResponse: Codable { + public var success: Bool + + public var data: [String: Any] + + public enum CodingKeys: String, CodingKey { + case success + + case data + } + + public init(data: [String: Any], success: Bool) { + self.success = success + + self.data = data + } + + public func duplicate() -> SaveSubscriptionSetupIntentResponse { + let dict = self.dictionary! + let copy = SaveSubscriptionSetupIntentResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + data = try container.decode([String: Any].self, forKey: .data) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(data, forKey: .data) + } + } + + /* + Model: BeneficiaryModeDetails + Used By: Payment + */ + + class BeneficiaryModeDetails: Codable { + public var comment: String? + + public var address: String? + + public var ifscCode: String + + public var vpa: String? + + public var accountNo: String + + public var bankName: String + + public var wallet: String? + + public var mobile: String + + public var accountHolder: String + + public var email: String + + public var branchName: String + + public enum CodingKeys: String, CodingKey { + case comment + + case address + + case ifscCode = "ifsc_code" + + case vpa + + case accountNo = "account_no" + + case bankName = "bank_name" + + case wallet + + case mobile + + case accountHolder = "account_holder" + + case email + + case branchName = "branch_name" + } + + public init(accountHolder: String, accountNo: String, address: String?, bankName: String, branchName: String, comment: String?, email: String, ifscCode: String, mobile: String, vpa: String?, wallet: String?) { + self.comment = comment + + self.address = address + + self.ifscCode = ifscCode + + self.vpa = vpa + + self.accountNo = accountNo + + self.bankName = bankName + + self.wallet = wallet + + self.mobile = mobile + + self.accountHolder = accountHolder + + self.email = email + + self.branchName = branchName + } + + public func duplicate() -> BeneficiaryModeDetails { + let dict = self.dictionary! + let copy = BeneficiaryModeDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + comment = try container.decode(String.self, forKey: .comment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + address = try container.decode(String.self, forKey: .address) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + ifscCode = try container.decode(String.self, forKey: .ifscCode) + + do { + vpa = try container.decode(String.self, forKey: .vpa) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + accountNo = try container.decode(String.self, forKey: .accountNo) + + bankName = try container.decode(String.self, forKey: .bankName) + + do { + wallet = try container.decode(String.self, forKey: .wallet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + mobile = try container.decode(String.self, forKey: .mobile) + + accountHolder = try container.decode(String.self, forKey: .accountHolder) + + email = try container.decode(String.self, forKey: .email) + + branchName = try container.decode(String.self, forKey: .branchName) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(comment, forKey: .comment) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(ifscCode, forKey: .ifscCode) + + try? container.encode(vpa, forKey: .vpa) + + try? container.encodeIfPresent(accountNo, forKey: .accountNo) + + try? container.encodeIfPresent(bankName, forKey: .bankName) + + try? container.encode(wallet, forKey: .wallet) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + try? container.encodeIfPresent(accountHolder, forKey: .accountHolder) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(branchName, forKey: .branchName) + } + } + + /* + Model: AddBeneficiaryDetailsRequest + Used By: Payment + */ + + class AddBeneficiaryDetailsRequest: Codable { + public var shipmentId: String + + public var details: BeneficiaryModeDetails + + public var requestId: String? + + public var orderId: String + + public var transferMode: String + + public var delights: Bool + + public var otp: String? + + public enum CodingKeys: String, CodingKey { + case shipmentId = "shipment_id" + + case details + + case requestId = "request_id" + + case orderId = "order_id" + + case transferMode = "transfer_mode" + + case delights + + case otp + } + + public init(delights: Bool, details: BeneficiaryModeDetails, orderId: String, otp: String?, requestId: String?, shipmentId: String, transferMode: String) { + self.shipmentId = shipmentId + + self.details = details + + self.requestId = requestId + + self.orderId = orderId + + self.transferMode = transferMode + + self.delights = delights + + self.otp = otp + } + + public func duplicate() -> AddBeneficiaryDetailsRequest { + let dict = self.dictionary! + let copy = AddBeneficiaryDetailsRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + shipmentId = try container.decode(String.self, forKey: .shipmentId) + + details = try container.decode(BeneficiaryModeDetails.self, forKey: .details) + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + orderId = try container.decode(String.self, forKey: .orderId) + + transferMode = try container.decode(String.self, forKey: .transferMode) + + delights = try container.decode(Bool.self, forKey: .delights) + + do { + otp = try container.decode(String.self, forKey: .otp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(shipmentId, forKey: .shipmentId) + + try? container.encodeIfPresent(details, forKey: .details) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + + try? container.encodeIfPresent(transferMode, forKey: .transferMode) + + try? container.encodeIfPresent(delights, forKey: .delights) + + try? container.encodeIfPresent(otp, forKey: .otp) + } + } + + /* + Model: RefundAccountResponse + Used By: Payment + */ + + class RefundAccountResponse: Codable { + public var success: Bool + + public var data: [String: Any]? + + public var message: String + + public var isVerifiedFlag: Bool? + + public enum CodingKeys: String, CodingKey { + case success + + case data + + case message + + case isVerifiedFlag = "is_verified_flag" + } + + public init(data: [String: Any]?, isVerifiedFlag: Bool?, message: String, success: Bool) { + self.success = success + + self.data = data + + self.message = message + + self.isVerifiedFlag = isVerifiedFlag + } + + public func duplicate() -> RefundAccountResponse { + let dict = self.dictionary! + let copy = RefundAccountResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + do { + data = try container.decode([String: Any].self, forKey: .data) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + message = try container.decode(String.self, forKey: .message) + + do { + isVerifiedFlag = try container.decode(Bool.self, forKey: .isVerifiedFlag) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(data, forKey: .data) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(isVerifiedFlag, forKey: .isVerifiedFlag) + } + } + + /* + Model: NotFoundResourceError + Used By: Payment + */ + + class NotFoundResourceError: Codable { + public var success: Bool + + public var description: String + + public var code: String + + public enum CodingKeys: String, CodingKey { + case success + + case description + + case code + } + + public init(code: String, description: String, success: Bool) { + self.success = success + + self.description = description + + self.code = code + } + + public func duplicate() -> NotFoundResourceError { + let dict = self.dictionary! + let copy = NotFoundResourceError(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + description = try container.decode(String.self, forKey: .description) + + code = try container.decode(String.self, forKey: .code) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: IfscCodeResponse + Used By: Payment + */ + + class IfscCodeResponse: Codable { + public var success: Bool? + + public var bankName: String + + public var branchName: String + + public enum CodingKeys: String, CodingKey { + case success + + case bankName = "bank_name" + + case branchName = "branch_name" + } + + public init(bankName: String, branchName: String, success: Bool?) { + self.success = success + + self.bankName = bankName + + self.branchName = branchName + } + + public func duplicate() -> IfscCodeResponse { + let dict = self.dictionary! + let copy = IfscCodeResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + bankName = try container.decode(String.self, forKey: .bankName) + + branchName = try container.decode(String.self, forKey: .branchName) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(bankName, forKey: .bankName) + + try? container.encodeIfPresent(branchName, forKey: .branchName) + } + } + + /* + Model: OrderBeneficiaryDetails + Used By: Payment + */ + + class OrderBeneficiaryDetails: Codable { + public var modifiedOn: String + + public var isActive: Bool + + public var accountNo: String + + public var id: Int + + public var email: String + + public var delightsUserName: String? + + public var title: String + + public var accountHolder: String + + public var displayName: String + + public var branchName: Bool? + + public var comment: Bool? + + public var address: String + + public var ifscCode: String + + public var bankName: String + + public var beneficiaryId: String + + public var subtitle: String + + public var createdOn: String + + public var transferMode: String + + public var mobile: Bool? + + public enum CodingKeys: String, CodingKey { + case modifiedOn = "modified_on" + + case isActive = "is_active" + + case accountNo = "account_no" + + case id + + case email + + case delightsUserName = "delights_user_name" + + case title + + case accountHolder = "account_holder" + + case displayName = "display_name" + + case branchName = "branch_name" + + case comment + + case address + + case ifscCode = "ifsc_code" + + case bankName = "bank_name" + + case beneficiaryId = "beneficiary_id" + + case subtitle + + case createdOn = "created_on" + + case transferMode = "transfer_mode" + + case mobile + } + + public init(accountHolder: String, accountNo: String, address: String, bankName: String, beneficiaryId: String, branchName: Bool?, comment: Bool?, createdOn: String, delightsUserName: String?, displayName: String, email: String, id: Int, ifscCode: String, isActive: Bool, mobile: Bool?, modifiedOn: String, subtitle: String, title: String, transferMode: String) { + self.modifiedOn = modifiedOn + + self.isActive = isActive + + self.accountNo = accountNo + + self.id = id + + self.email = email + + self.delightsUserName = delightsUserName + + self.title = title + + self.accountHolder = accountHolder + + self.displayName = displayName + + self.branchName = branchName + + self.comment = comment + + self.address = address + + self.ifscCode = ifscCode + + self.bankName = bankName + + self.beneficiaryId = beneficiaryId + + self.subtitle = subtitle + + self.createdOn = createdOn + + self.transferMode = transferMode + + self.mobile = mobile + } + + public func duplicate() -> OrderBeneficiaryDetails { + let dict = self.dictionary! + let copy = OrderBeneficiaryDetails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + modifiedOn = try container.decode(String.self, forKey: .modifiedOn) + + isActive = try container.decode(Bool.self, forKey: .isActive) + + accountNo = try container.decode(String.self, forKey: .accountNo) + + id = try container.decode(Int.self, forKey: .id) + + email = try container.decode(String.self, forKey: .email) + + do { + delightsUserName = try container.decode(String.self, forKey: .delightsUserName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + title = try container.decode(String.self, forKey: .title) + + accountHolder = try container.decode(String.self, forKey: .accountHolder) + + displayName = try container.decode(String.self, forKey: .displayName) + + do { + branchName = try container.decode(Bool.self, forKey: .branchName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + comment = try container.decode(Bool.self, forKey: .comment) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + address = try container.decode(String.self, forKey: .address) + + ifscCode = try container.decode(String.self, forKey: .ifscCode) + + bankName = try container.decode(String.self, forKey: .bankName) + + beneficiaryId = try container.decode(String.self, forKey: .beneficiaryId) + + subtitle = try container.decode(String.self, forKey: .subtitle) + + createdOn = try container.decode(String.self, forKey: .createdOn) + + transferMode = try container.decode(String.self, forKey: .transferMode) + + do { + mobile = try container.decode(Bool.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(modifiedOn, forKey: .modifiedOn) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(accountNo, forKey: .accountNo) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encode(delightsUserName, forKey: .delightsUserName) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(accountHolder, forKey: .accountHolder) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(branchName, forKey: .branchName) + + try? container.encodeIfPresent(comment, forKey: .comment) + + try? container.encodeIfPresent(address, forKey: .address) + + try? container.encodeIfPresent(ifscCode, forKey: .ifscCode) + + try? container.encodeIfPresent(bankName, forKey: .bankName) + + try? container.encodeIfPresent(beneficiaryId, forKey: .beneficiaryId) + + try? container.encodeIfPresent(subtitle, forKey: .subtitle) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(transferMode, forKey: .transferMode) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + } + } + + /* + Model: OrderBeneficiaryResponse + Used By: Payment + */ + + class OrderBeneficiaryResponse: Codable { + public var beneficiaries: [OrderBeneficiaryDetails]? + + public var showBeneficiaryDetails: Bool? + + public enum CodingKeys: String, CodingKey { + case beneficiaries + + case showBeneficiaryDetails = "show_beneficiary_details" + } + + public init(beneficiaries: [OrderBeneficiaryDetails]?, showBeneficiaryDetails: Bool?) { + self.beneficiaries = beneficiaries + + self.showBeneficiaryDetails = showBeneficiaryDetails + } + + public func duplicate() -> OrderBeneficiaryResponse { + let dict = self.dictionary! + let copy = OrderBeneficiaryResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + beneficiaries = try container.decode([OrderBeneficiaryDetails].self, forKey: .beneficiaries) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + showBeneficiaryDetails = try container.decode(Bool.self, forKey: .showBeneficiaryDetails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encode(beneficiaries, forKey: .beneficiaries) + + try? container.encodeIfPresent(showBeneficiaryDetails, forKey: .showBeneficiaryDetails) + } + } + + /* + Model: MultiTenderPaymentMeta + Used By: Payment + */ + + class MultiTenderPaymentMeta: Codable { + public var paymentId: String? + + public var extraMeta: [String: Any]? + + public var paymentGateway: String? + + public var currentStatus: String? + + public var orderId: String? + + public enum CodingKeys: String, CodingKey { + case paymentId = "payment_id" + + case extraMeta = "extra_meta" + + case paymentGateway = "payment_gateway" + + case currentStatus = "current_status" + + case orderId = "order_id" + } + + public init(currentStatus: String?, extraMeta: [String: Any]?, orderId: String?, paymentGateway: String?, paymentId: String?) { + self.paymentId = paymentId + + self.extraMeta = extraMeta + + self.paymentGateway = paymentGateway + + self.currentStatus = currentStatus + + self.orderId = orderId + } + + public func duplicate() -> MultiTenderPaymentMeta { + let dict = self.dictionary! + let copy = MultiTenderPaymentMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + paymentId = try container.decode(String.self, forKey: .paymentId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + extraMeta = try container.decode([String: Any].self, forKey: .extraMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + paymentGateway = try container.decode(String.self, forKey: .paymentGateway) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currentStatus = try container.decode(String.self, forKey: .currentStatus) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + orderId = try container.decode(String.self, forKey: .orderId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(paymentId, forKey: .paymentId) + + try? container.encode(extraMeta, forKey: .extraMeta) + + try? container.encodeIfPresent(paymentGateway, forKey: .paymentGateway) + + try? container.encodeIfPresent(currentStatus, forKey: .currentStatus) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + } + } + + /* + Model: MultiTenderPaymentMethod + Used By: Payment + */ + + class MultiTenderPaymentMethod: Codable { + public var mode: String + + public var amount: Double + + public var name: String? + + public var meta: MultiTenderPaymentMeta? + + public enum CodingKeys: String, CodingKey { + case mode + + case amount + + case name + + case meta + } + + public init(amount: Double, meta: MultiTenderPaymentMeta?, mode: String, name: String?) { + self.mode = mode + + self.amount = amount + + self.name = name + + self.meta = meta + } + + public func duplicate() -> MultiTenderPaymentMethod { + let dict = self.dictionary! + let copy = MultiTenderPaymentMethod(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + mode = try container.decode(String.self, forKey: .mode) + + amount = try container.decode(Double.self, forKey: .amount) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode(MultiTenderPaymentMeta.self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(mode, forKey: .mode) + + try? container.encodeIfPresent(amount, forKey: .amount) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(meta, forKey: .meta) + } + } + + /* + Model: PaymentConfirmationRequest + Used By: Payment + */ + + class PaymentConfirmationRequest: Codable { + public var orderId: String + + public var paymentMethods: [MultiTenderPaymentMethod] + + public enum CodingKeys: String, CodingKey { + case orderId = "order_id" + + case paymentMethods = "payment_methods" + } + + public init(orderId: String, paymentMethods: [MultiTenderPaymentMethod]) { + self.orderId = orderId + + self.paymentMethods = paymentMethods + } + + public func duplicate() -> PaymentConfirmationRequest { + let dict = self.dictionary! + let copy = PaymentConfirmationRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + orderId = try container.decode(String.self, forKey: .orderId) + + paymentMethods = try container.decode([MultiTenderPaymentMethod].self, forKey: .paymentMethods) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + + try? container.encodeIfPresent(paymentMethods, forKey: .paymentMethods) + } + } + + /* + Model: PaymentConfirmationResponse + Used By: Payment + */ + + class PaymentConfirmationResponse: Codable { + public var success: Bool + + public var orderId: String + + public var message: String + + public enum CodingKeys: String, CodingKey { + case success + + case orderId = "order_id" + + case message + } + + public init(message: String, orderId: String, success: Bool) { + self.success = success + + self.orderId = orderId + + self.message = message + } + + public func duplicate() -> PaymentConfirmationResponse { + let dict = self.dictionary! + let copy = PaymentConfirmationResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + success = try container.decode(Bool.self, forKey: .success) + + orderId = try container.decode(String.self, forKey: .orderId) + + message = try container.decode(String.self, forKey: .message) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(orderId, forKey: .orderId) + + try? container.encodeIfPresent(message, forKey: .message) + } + } +} diff --git a/Sources/code/platform/models/RewardsPlatformModelClass.swift b/Sources/code/platform/models/RewardsPlatformModelClass.swift new file mode 100644 index 0000000000..f617543d02 --- /dev/null +++ b/Sources/code/platform/models/RewardsPlatformModelClass.swift @@ -0,0 +1,1666 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: AppUser + Used By: Rewards + */ + + class AppUser: Codable { + public var id: String? + + public var active: Bool? + + public var applicationId: String? + + public var blockReason: String? + + public var updatedAt: String? + + public var updatedBy: String? + + public var userId: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case active + + case applicationId = "application_id" + + case blockReason = "block_reason" + + case updatedAt = "updated_at" + + case updatedBy = "updated_by" + + case userId = "user_id" + } + + public init(active: Bool?, applicationId: String?, blockReason: String?, updatedAt: String?, updatedBy: String?, userId: String?, id: String?) { + self.id = id + + self.active = active + + self.applicationId = applicationId + + self.blockReason = blockReason + + self.updatedAt = updatedAt + + self.updatedBy = updatedBy + + self.userId = userId + } + + public func duplicate() -> AppUser { + let dict = self.dictionary! + let copy = AppUser(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + applicationId = try container.decode(String.self, forKey: .applicationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + blockReason = try container.decode(String.self, forKey: .blockReason) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedBy = try container.decode(String.self, forKey: .updatedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + + try? container.encodeIfPresent(blockReason, forKey: .blockReason) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(updatedBy, forKey: .updatedBy) + + try? container.encodeIfPresent(userId, forKey: .userId) + } + } + + /* + Model: E + Used By: Rewards + */ + + class E: Codable { + public var code: [String: Any]? + + public var exception: String? + + public var info: String? + + public var message: String? + + public var requestId: String? + + public var stackTrace: String? + + public var status: Int? + + public enum CodingKeys: String, CodingKey { + case code + + case exception + + case info + + case message + + case requestId = "request_id" + + case stackTrace = "stack_trace" + + case status + } + + public init(code: [String: Any]?, exception: String?, info: String?, message: String?, requestId: String?, stackTrace: String?, status: Int?) { + self.code = code + + self.exception = exception + + self.info = info + + self.message = message + + self.requestId = requestId + + self.stackTrace = stackTrace + + self.status = status + } + + public func duplicate() -> E { + let dict = self.dictionary! + let copy = E(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + code = try container.decode([String: Any].self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + exception = try container.decode(String.self, forKey: .exception) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + info = try container.decode(String.self, forKey: .info) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + stackTrace = try container.decode(String.self, forKey: .stackTrace) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Int.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(exception, forKey: .exception) + + try? container.encodeIfPresent(info, forKey: .info) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(stackTrace, forKey: .stackTrace) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: Giveaway + Used By: Rewards + */ + + class Giveaway: Codable { + public var id: String? + + public var schedule: Schedule? + + public var active: Bool? + + public var applicationId: String? + + public var audience: RewardsAudience? + + public var bannerImage: Asset? + + public var createdAt: String? + + public var description: String? + + public var name: String? + + public var rule: RewardsRule? + + public var title: String? + + public var updatedAt: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case schedule = "_schedule" + + case active + + case applicationId = "application_id" + + case audience + + case bannerImage = "banner_image" + + case createdAt = "created_at" + + case description + + case name + + case rule + + case title + + case updatedAt = "updated_at" + } + + public init(active: Bool?, applicationId: String?, audience: RewardsAudience?, bannerImage: Asset?, createdAt: String?, description: String?, name: String?, rule: RewardsRule?, title: String?, updatedAt: String?, id: String?, schedule: Schedule?) { + self.id = id + + self.schedule = schedule + + self.active = active + + self.applicationId = applicationId + + self.audience = audience + + self.bannerImage = bannerImage + + self.createdAt = createdAt + + self.description = description + + self.name = name + + self.rule = rule + + self.title = title + + self.updatedAt = updatedAt + } + + public func duplicate() -> Giveaway { + let dict = self.dictionary! + let copy = Giveaway(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + schedule = try container.decode(Schedule.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + applicationId = try container.decode(String.self, forKey: .applicationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + audience = try container.decode(RewardsAudience.self, forKey: .audience) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bannerImage = try container.decode(Asset.self, forKey: .bannerImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rule = try container.decode(RewardsRule.self, forKey: .rule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + + try? container.encodeIfPresent(audience, forKey: .audience) + + try? container.encodeIfPresent(bannerImage, forKey: .bannerImage) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(rule, forKey: .rule) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + } + } + + /* + Model: GiveawayResponse + Used By: Rewards + */ + + class GiveawayResponse: Codable { + public var items: [Giveaway]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [Giveaway]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> GiveawayResponse { + let dict = self.dictionary! + let copy = GiveawayResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([Giveaway].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: HistoryPretty + Used By: Rewards + */ + + class HistoryPretty: Codable { + public var id: String? + + public var applicationId: String? + + public var claimed: Bool? + + public var createdAt: String? + + public var expiresOn: String? + + public var points: Double? + + public var remainingPoints: Double? + + public var text1: String? + + public var text2: String? + + public var text3: String? + + public var txnName: String? + + public var updatedAt: String? + + public var userId: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case applicationId = "application_id" + + case claimed + + case createdAt = "created_at" + + case expiresOn = "expires_on" + + case points + + case remainingPoints = "remaining_points" + + case text1 = "text_1" + + case text2 = "text_2" + + case text3 = "text_3" + + case txnName = "txn_name" + + case updatedAt = "updated_at" + + case userId = "user_id" + } + + public init(applicationId: String?, claimed: Bool?, createdAt: String?, expiresOn: String?, points: Double?, remainingPoints: Double?, text1: String?, text2: String?, text3: String?, txnName: String?, updatedAt: String?, userId: String?, id: String?) { + self.id = id + + self.applicationId = applicationId + + self.claimed = claimed + + self.createdAt = createdAt + + self.expiresOn = expiresOn + + self.points = points + + self.remainingPoints = remainingPoints + + self.text1 = text1 + + self.text2 = text2 + + self.text3 = text3 + + self.txnName = txnName + + self.updatedAt = updatedAt + + self.userId = userId + } + + public func duplicate() -> HistoryPretty { + let dict = self.dictionary! + let copy = HistoryPretty(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + applicationId = try container.decode(String.self, forKey: .applicationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + claimed = try container.decode(Bool.self, forKey: .claimed) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expiresOn = try container.decode(String.self, forKey: .expiresOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + points = try container.decode(Double.self, forKey: .points) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + remainingPoints = try container.decode(Double.self, forKey: .remainingPoints) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text1 = try container.decode(String.self, forKey: .text1) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text2 = try container.decode(String.self, forKey: .text2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text3 = try container.decode(String.self, forKey: .text3) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + txnName = try container.decode(String.self, forKey: .txnName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + + try? container.encodeIfPresent(claimed, forKey: .claimed) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(expiresOn, forKey: .expiresOn) + + try? container.encodeIfPresent(points, forKey: .points) + + try? container.encodeIfPresent(remainingPoints, forKey: .remainingPoints) + + try? container.encodeIfPresent(text1, forKey: .text1) + + try? container.encodeIfPresent(text2, forKey: .text2) + + try? container.encodeIfPresent(text3, forKey: .text3) + + try? container.encodeIfPresent(txnName, forKey: .txnName) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(userId, forKey: .userId) + } + } + + /* + Model: HistoryRes + Used By: Rewards + */ + + class HistoryRes: Codable { + public var items: [HistoryPretty]? + + public var page: Page? + + public var points: Double? + + public enum CodingKeys: String, CodingKey { + case items + + case page + + case points + } + + public init(items: [HistoryPretty]?, page: Page?, points: Double?) { + self.items = items + + self.page = page + + self.points = points + } + + public func duplicate() -> HistoryRes { + let dict = self.dictionary! + let copy = HistoryRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([HistoryPretty].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + points = try container.decode(Double.self, forKey: .points) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(points, forKey: .points) + } + } + + /* + Model: Offer + Used By: Rewards + */ + + class Offer: Codable { + public var schedule: Schedule? + + public var active: Bool? + + public var applicationId: String? + + public var bannerImage: Asset? + + public var createdAt: String? + + public var name: String? + + public var rule: [String: Any]? + + public var share: ShareMessages? + + public var subText: String? + + public var text: String? + + public var type: String? + + public var updatedAt: String? + + public var updatedBy: String? + + public var url: String? + + public enum CodingKeys: String, CodingKey { + case schedule = "_schedule" + + case active + + case applicationId = "application_id" + + case bannerImage = "banner_image" + + case createdAt = "created_at" + + case name + + case rule + + case share + + case subText = "sub_text" + + case text + + case type + + case updatedAt = "updated_at" + + case updatedBy = "updated_by" + + case url + } + + public init(active: Bool?, applicationId: String?, bannerImage: Asset?, createdAt: String?, name: String?, rule: [String: Any]?, share: ShareMessages?, subText: String?, text: String?, type: String?, updatedAt: String?, updatedBy: String?, url: String?, schedule: Schedule?) { + self.schedule = schedule + + self.active = active + + self.applicationId = applicationId + + self.bannerImage = bannerImage + + self.createdAt = createdAt + + self.name = name + + self.rule = rule + + self.share = share + + self.subText = subText + + self.text = text + + self.type = type + + self.updatedAt = updatedAt + + self.updatedBy = updatedBy + + self.url = url + } + + public func duplicate() -> Offer { + let dict = self.dictionary! + let copy = Offer(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + schedule = try container.decode(Schedule.self, forKey: .schedule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + applicationId = try container.decode(String.self, forKey: .applicationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bannerImage = try container.decode(Asset.self, forKey: .bannerImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + rule = try container.decode([String: Any].self, forKey: .rule) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + share = try container.decode(ShareMessages.self, forKey: .share) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subText = try container.decode(String.self, forKey: .subText) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text = try container.decode(String.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedBy = try container.decode(String.self, forKey: .updatedBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(String.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(schedule, forKey: .schedule) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + + try? container.encodeIfPresent(bannerImage, forKey: .bannerImage) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(rule, forKey: .rule) + + try? container.encodeIfPresent(share, forKey: .share) + + try? container.encodeIfPresent(subText, forKey: .subText) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(updatedBy, forKey: .updatedBy) + + try? container.encodeIfPresent(url, forKey: .url) + } + } + + /* + Model: Points + Used By: Rewards + */ + + class Points: Codable { + public var available: Double? + + public enum CodingKeys: String, CodingKey { + case available + } + + public init(available: Double?) { + self.available = available + } + + public func duplicate() -> Points { + let dict = self.dictionary! + let copy = Points(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + available = try container.decode(Double.self, forKey: .available) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(available, forKey: .available) + } + } + + /* + Model: Referral + Used By: Rewards + */ + + class Referral: Codable { + public var code: String? + + public enum CodingKeys: String, CodingKey { + case code + } + + public init(code: String?) { + self.code = code + } + + public func duplicate() -> Referral { + let dict = self.dictionary! + let copy = Referral(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: RewardUser + Used By: Rewards + */ + + class RewardUser: Codable { + public var id: String? + + public var active: Bool? + + public var createdAt: String? + + public var referral: Referral? + + public var uid: Int? + + public var updatedAt: String? + + public var userBlockReason: String? + + public var userId: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case active + + case createdAt = "created_at" + + case referral + + case uid + + case updatedAt = "updated_at" + + case userBlockReason = "user_block_reason" + + case userId = "user_id" + } + + public init(active: Bool?, createdAt: String?, referral: Referral?, uid: Int?, updatedAt: String?, userBlockReason: String?, userId: String?, id: String?) { + self.id = id + + self.active = active + + self.createdAt = createdAt + + self.referral = referral + + self.uid = uid + + self.updatedAt = updatedAt + + self.userBlockReason = userBlockReason + + self.userId = userId + } + + public func duplicate() -> RewardUser { + let dict = self.dictionary! + let copy = RewardUser(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + referral = try container.decode(Referral.self, forKey: .referral) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userBlockReason = try container.decode(String.self, forKey: .userBlockReason) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(referral, forKey: .referral) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(userBlockReason, forKey: .userBlockReason) + + try? container.encodeIfPresent(userId, forKey: .userId) + } + } + + /* + Model: RewardsAudience + Used By: Rewards + */ + + class RewardsAudience: Codable { + public var headerUserId: String? + + public var id: String? + + public enum CodingKeys: String, CodingKey { + case headerUserId = "header_user_id" + + case id + } + + public init(headerUserId: String?, id: String?) { + self.headerUserId = headerUserId + + self.id = id + } + + public func duplicate() -> RewardsAudience { + let dict = self.dictionary! + let copy = RewardsAudience(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + headerUserId = try container.decode(String.self, forKey: .headerUserId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(headerUserId, forKey: .headerUserId) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: RewardsRule + Used By: Rewards + */ + + class RewardsRule: Codable { + public var amount: Double? + + public enum CodingKeys: String, CodingKey { + case amount + } + + public init(amount: Double?) { + self.amount = amount + } + + public func duplicate() -> RewardsRule { + let dict = self.dictionary! + let copy = RewardsRule(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + amount = try container.decode(Double.self, forKey: .amount) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(amount, forKey: .amount) + } + } + + /* + Model: ShareMessages + Used By: Rewards + */ + + class ShareMessages: Codable { + public var email: String? + + public var facebook: String? + + public var fallback: String? + + public var message: String? + + public var messenger: String? + + public var sms: String? + + public var text: String? + + public var twitter: String? + + public var whatsapp: String? + + public enum CodingKeys: String, CodingKey { + case email + + case facebook + + case fallback + + case message + + case messenger + + case sms + + case text + + case twitter + + case whatsapp + } + + public init(email: String?, facebook: String?, fallback: String?, message: String?, messenger: String?, sms: String?, text: String?, twitter: String?, whatsapp: String?) { + self.email = email + + self.facebook = facebook + + self.fallback = fallback + + self.message = message + + self.messenger = messenger + + self.sms = sms + + self.text = text + + self.twitter = twitter + + self.whatsapp = whatsapp + } + + public func duplicate() -> ShareMessages { + let dict = self.dictionary! + let copy = ShareMessages(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + facebook = try container.decode(String.self, forKey: .facebook) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fallback = try container.decode(String.self, forKey: .fallback) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + messenger = try container.decode(String.self, forKey: .messenger) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sms = try container.decode(String.self, forKey: .sms) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text = try container.decode(String.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + twitter = try container.decode(String.self, forKey: .twitter) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + whatsapp = try container.decode(String.self, forKey: .whatsapp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(facebook, forKey: .facebook) + + try? container.encodeIfPresent(fallback, forKey: .fallback) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(messenger, forKey: .messenger) + + try? container.encodeIfPresent(sms, forKey: .sms) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(twitter, forKey: .twitter) + + try? container.encodeIfPresent(whatsapp, forKey: .whatsapp) + } + } + + /* + Model: UserRes + Used By: Rewards + */ + + class UserRes: Codable { + public var points: Points? + + public var user: RewardUser? + + public enum CodingKeys: String, CodingKey { + case points + + case user + } + + public init(points: Points?, user: RewardUser?) { + self.points = points + + self.user = user + } + + public func duplicate() -> UserRes { + let dict = self.dictionary! + let copy = UserRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + points = try container.decode(Points.self, forKey: .points) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + user = try container.decode(RewardUser.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(points, forKey: .points) + + try? container.encodeIfPresent(user, forKey: .user) + } + } +} diff --git a/Sources/code/platform/models/SharePlatformModelClass.swift b/Sources/code/platform/models/SharePlatformModelClass.swift new file mode 100644 index 0000000000..e3a293212b --- /dev/null +++ b/Sources/code/platform/models/SharePlatformModelClass.swift @@ -0,0 +1,1099 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: RedirectDevice + Used By: Share + */ + + class RedirectDevice: Codable { + public var link: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case link + + case type + } + + public init(link: String?, type: String?) { + self.link = link + + self.type = type + } + + public func duplicate() -> RedirectDevice { + let dict = self.dictionary! + let copy = RedirectDevice(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(link, forKey: .link) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: WebRedirect + Used By: Share + */ + + class WebRedirect: Codable { + public var link: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case link + + case type + } + + public init(link: String?, type: String?) { + self.link = link + + self.type = type + } + + public func duplicate() -> WebRedirect { + let dict = self.dictionary! + let copy = WebRedirect(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(link, forKey: .link) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: Redirects + Used By: Share + */ + + class Redirects: Codable { + public var ios: RedirectDevice? + + public var android: RedirectDevice? + + public var web: WebRedirect? + + public var forceWeb: Bool? + + public enum CodingKeys: String, CodingKey { + case ios + + case android + + case web + + case forceWeb = "force_web" + } + + public init(android: RedirectDevice?, forceWeb: Bool?, ios: RedirectDevice?, web: WebRedirect?) { + self.ios = ios + + self.android = android + + self.web = web + + self.forceWeb = forceWeb + } + + public func duplicate() -> Redirects { + let dict = self.dictionary! + let copy = Redirects(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + ios = try container.decode(RedirectDevice.self, forKey: .ios) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + android = try container.decode(RedirectDevice.self, forKey: .android) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + web = try container.decode(WebRedirect.self, forKey: .web) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + forceWeb = try container.decode(Bool.self, forKey: .forceWeb) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(ios, forKey: .ios) + + try? container.encodeIfPresent(android, forKey: .android) + + try? container.encodeIfPresent(web, forKey: .web) + + try? container.encodeIfPresent(forceWeb, forKey: .forceWeb) + } + } + + /* + Model: CampaignShortLink + Used By: Share + */ + + class CampaignShortLink: Codable { + public var source: String? + + public var medium: String? + + public enum CodingKeys: String, CodingKey { + case source + + case medium + } + + public init(medium: String?, source: String?) { + self.source = source + + self.medium = medium + } + + public func duplicate() -> CampaignShortLink { + let dict = self.dictionary! + let copy = CampaignShortLink(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + source = try container.decode(String.self, forKey: .source) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + medium = try container.decode(String.self, forKey: .medium) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(source, forKey: .source) + + try? container.encodeIfPresent(medium, forKey: .medium) + } + } + + /* + Model: Attribution + Used By: Share + */ + + class Attribution: Codable { + public var campaignCookieExpiry: String? + + public enum CodingKeys: String, CodingKey { + case campaignCookieExpiry = "campaign_cookie_expiry" + } + + public init(campaignCookieExpiry: String?) { + self.campaignCookieExpiry = campaignCookieExpiry + } + + public func duplicate() -> Attribution { + let dict = self.dictionary! + let copy = Attribution(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + campaignCookieExpiry = try container.decode(String.self, forKey: .campaignCookieExpiry) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(campaignCookieExpiry, forKey: .campaignCookieExpiry) + } + } + + /* + Model: SocialMediaTags + Used By: Share + */ + + class SocialMediaTags: Codable { + public var title: String? + + public var description: String? + + public var image: String? + + public enum CodingKeys: String, CodingKey { + case title + + case description + + case image + } + + public init(description: String?, image: String?, title: String?) { + self.title = title + + self.description = description + + self.image = image + } + + public func duplicate() -> SocialMediaTags { + let dict = self.dictionary! + let copy = SocialMediaTags(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + image = try container.decode(String.self, forKey: .image) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(image, forKey: .image) + } + } + + /* + Model: ShortLinkReq + Used By: Share + */ + + class ShortLinkReq: Codable { + public var title: String + + public var url: String + + public var hash: String? + + public var active: Bool? + + public var expireAt: String? + + public var enableTracking: Bool? + + public var personalized: Bool? + + public var campaign: CampaignShortLink? + + public var redirects: Redirects? + + public var attribution: Attribution? + + public var socialMediaTags: SocialMediaTags? + + public var count: Int? + + public enum CodingKeys: String, CodingKey { + case title + + case url + + case hash + + case active + + case expireAt = "expire_at" + + case enableTracking = "enable_tracking" + + case personalized + + case campaign + + case redirects + + case attribution + + case socialMediaTags = "social_media_tags" + + case count + } + + public init(active: Bool?, attribution: Attribution?, campaign: CampaignShortLink?, count: Int?, enableTracking: Bool?, expireAt: String?, hash: String?, personalized: Bool?, redirects: Redirects?, socialMediaTags: SocialMediaTags?, title: String, url: String) { + self.title = title + + self.url = url + + self.hash = hash + + self.active = active + + self.expireAt = expireAt + + self.enableTracking = enableTracking + + self.personalized = personalized + + self.campaign = campaign + + self.redirects = redirects + + self.attribution = attribution + + self.socialMediaTags = socialMediaTags + + self.count = count + } + + public func duplicate() -> ShortLinkReq { + let dict = self.dictionary! + let copy = ShortLinkReq(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + title = try container.decode(String.self, forKey: .title) + + url = try container.decode(String.self, forKey: .url) + + do { + hash = try container.decode(String.self, forKey: .hash) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expireAt = try container.decode(String.self, forKey: .expireAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enableTracking = try container.decode(Bool.self, forKey: .enableTracking) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + personalized = try container.decode(Bool.self, forKey: .personalized) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + campaign = try container.decode(CampaignShortLink.self, forKey: .campaign) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + redirects = try container.decode(Redirects.self, forKey: .redirects) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attribution = try container.decode(Attribution.self, forKey: .attribution) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + socialMediaTags = try container.decode(SocialMediaTags.self, forKey: .socialMediaTags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(hash, forKey: .hash) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(expireAt, forKey: .expireAt) + + try? container.encodeIfPresent(enableTracking, forKey: .enableTracking) + + try? container.encodeIfPresent(personalized, forKey: .personalized) + + try? container.encodeIfPresent(campaign, forKey: .campaign) + + try? container.encodeIfPresent(redirects, forKey: .redirects) + + try? container.encodeIfPresent(attribution, forKey: .attribution) + + try? container.encodeIfPresent(socialMediaTags, forKey: .socialMediaTags) + + try? container.encodeIfPresent(count, forKey: .count) + } + } + + /* + Model: UrlInfo + Used By: Share + */ + + class UrlInfo: Codable { + public var original: String? + + public var short: String? + + public var hash: String? + + public enum CodingKeys: String, CodingKey { + case original + + case short + + case hash + } + + public init(hash: String?, original: String?, short: String?) { + self.original = original + + self.short = short + + self.hash = hash + } + + public func duplicate() -> UrlInfo { + let dict = self.dictionary! + let copy = UrlInfo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + original = try container.decode(String.self, forKey: .original) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + short = try container.decode(String.self, forKey: .short) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hash = try container.decode(String.self, forKey: .hash) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(original, forKey: .original) + + try? container.encodeIfPresent(short, forKey: .short) + + try? container.encodeIfPresent(hash, forKey: .hash) + } + } + + /* + Model: ShortLinkRes + Used By: Share + */ + + class ShortLinkRes: Codable { + public var title: String? + + public var url: UrlInfo? + + public var createdBy: String? + + public var appRedirect: Bool? + + public var fallback: String? + + public var active: Bool? + + public var id: String? + + public var enableTracking: Bool? + + public var expireAt: String? + + public var application: String? + + public var userId: String? + + public var createdAt: String? + + public var meta: [String: Any]? + + public var updatedAt: String? + + public var personalized: Bool? + + public var campaign: CampaignShortLink? + + public var redirects: Redirects? + + public var attribution: Attribution? + + public var socialMediaTags: SocialMediaTags? + + public var count: Int? + + public enum CodingKeys: String, CodingKey { + case title + + case url + + case createdBy = "created_by" + + case appRedirect = "app_redirect" + + case fallback + + case active + + case id = "_id" + + case enableTracking = "enable_tracking" + + case expireAt = "expire_at" + + case application + + case userId = "user_id" + + case createdAt = "created_at" + + case meta + + case updatedAt = "updated_at" + + case personalized + + case campaign + + case redirects + + case attribution + + case socialMediaTags = "social_media_tags" + + case count + } + + public init(active: Bool?, application: String?, appRedirect: Bool?, attribution: Attribution?, campaign: CampaignShortLink?, count: Int?, createdAt: String?, createdBy: String?, enableTracking: Bool?, expireAt: String?, fallback: String?, meta: [String: Any]?, personalized: Bool?, redirects: Redirects?, socialMediaTags: SocialMediaTags?, title: String?, updatedAt: String?, url: UrlInfo?, userId: String?, id: String?) { + self.title = title + + self.url = url + + self.createdBy = createdBy + + self.appRedirect = appRedirect + + self.fallback = fallback + + self.active = active + + self.id = id + + self.enableTracking = enableTracking + + self.expireAt = expireAt + + self.application = application + + self.userId = userId + + self.createdAt = createdAt + + self.meta = meta + + self.updatedAt = updatedAt + + self.personalized = personalized + + self.campaign = campaign + + self.redirects = redirects + + self.attribution = attribution + + self.socialMediaTags = socialMediaTags + + self.count = count + } + + public func duplicate() -> ShortLinkRes { + let dict = self.dictionary! + let copy = ShortLinkRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + url = try container.decode(UrlInfo.self, forKey: .url) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdBy = try container.decode(String.self, forKey: .createdBy) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appRedirect = try container.decode(Bool.self, forKey: .appRedirect) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fallback = try container.decode(String.self, forKey: .fallback) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + enableTracking = try container.decode(Bool.self, forKey: .enableTracking) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expireAt = try container.decode(String.self, forKey: .expireAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + personalized = try container.decode(Bool.self, forKey: .personalized) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + campaign = try container.decode(CampaignShortLink.self, forKey: .campaign) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + redirects = try container.decode(Redirects.self, forKey: .redirects) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attribution = try container.decode(Attribution.self, forKey: .attribution) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + socialMediaTags = try container.decode(SocialMediaTags.self, forKey: .socialMediaTags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + count = try container.decode(Int.self, forKey: .count) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(url, forKey: .url) + + try? container.encodeIfPresent(createdBy, forKey: .createdBy) + + try? container.encodeIfPresent(appRedirect, forKey: .appRedirect) + + try? container.encodeIfPresent(fallback, forKey: .fallback) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(enableTracking, forKey: .enableTracking) + + try? container.encodeIfPresent(expireAt, forKey: .expireAt) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(userId, forKey: .userId) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(personalized, forKey: .personalized) + + try? container.encodeIfPresent(campaign, forKey: .campaign) + + try? container.encodeIfPresent(redirects, forKey: .redirects) + + try? container.encodeIfPresent(attribution, forKey: .attribution) + + try? container.encodeIfPresent(socialMediaTags, forKey: .socialMediaTags) + + try? container.encodeIfPresent(count, forKey: .count) + } + } + + /* + Model: ShortLinkList + Used By: Share + */ + + class ShortLinkList: Codable { + public var items: [ShortLinkRes]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [ShortLinkRes]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> ShortLinkList { + let dict = self.dictionary! + let copy = ShortLinkList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([ShortLinkRes].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: ErrorRes + Used By: Share + */ + + class ErrorRes: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> ErrorRes { + let dict = self.dictionary! + let copy = ErrorRes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } +} diff --git a/Sources/code/platform/models/ThemePlatformModelClass.swift b/Sources/code/platform/models/ThemePlatformModelClass.swift new file mode 100644 index 0000000000..bf00d469ff --- /dev/null +++ b/Sources/code/platform/models/ThemePlatformModelClass.swift @@ -0,0 +1,3506 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: AvailablePageSchema + Used By: Theme + */ + + class AvailablePageSchema: Codable { + public var value: String? + + public var text: String? + + public var path: String? + + public var type: String? + + public var sections: [AvailablePageSchemaSections]? + + public var sectionsMeta: [AvailablePageSectionMetaAttributes]? + + public var theme: String? + + public var seo: AvailablePageSeo? + + public var props: [[String: Any]]? + + public var id: String? + + public enum CodingKeys: String, CodingKey { + case value + + case text + + case path + + case type + + case sections + + case sectionsMeta = "sections_meta" + + case theme + + case seo + + case props + + case id = "_id" + } + + public init(path: String?, props: [[String: Any]]?, sections: [AvailablePageSchemaSections]?, sectionsMeta: [AvailablePageSectionMetaAttributes]?, seo: AvailablePageSeo?, text: String?, theme: String?, type: String?, value: String?, id: String?) { + self.value = value + + self.text = text + + self.path = path + + self.type = type + + self.sections = sections + + self.sectionsMeta = sectionsMeta + + self.theme = theme + + self.seo = seo + + self.props = props + + self.id = id + } + + public func duplicate() -> AvailablePageSchema { + let dict = self.dictionary! + let copy = AvailablePageSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + text = try container.decode(String.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + path = try container.decode(String.self, forKey: .path) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sections = try container.decode([AvailablePageSchemaSections].self, forKey: .sections) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sectionsMeta = try container.decode([AvailablePageSectionMetaAttributes].self, forKey: .sectionsMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + theme = try container.decode(String.self, forKey: .theme) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + seo = try container.decode(AvailablePageSeo.self, forKey: .seo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + props = try container.decode([[String: Any]].self, forKey: .props) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(value, forKey: .value) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(path, forKey: .path) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(sections, forKey: .sections) + + try? container.encodeIfPresent(sectionsMeta, forKey: .sectionsMeta) + + try? container.encodeIfPresent(theme, forKey: .theme) + + try? container.encodeIfPresent(seo, forKey: .seo) + + try? container.encodeIfPresent(props, forKey: .props) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: AvailablePageSectionMetaAttributes + Used By: Theme + */ + + class AvailablePageSectionMetaAttributes: Codable { + public var attributes: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case attributes + } + + public init(attributes: [String: Any]?) { + self.attributes = attributes + } + + public func duplicate() -> AvailablePageSectionMetaAttributes { + let dict = self.dictionary! + let copy = AvailablePageSectionMetaAttributes(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + attributes = try container.decode([String: Any].self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + } + } + + /* + Model: AvailablePageSeo + Used By: Theme + */ + + class AvailablePageSeo: Codable { + public var title: String? + + public var description: String? + + public var id: String? + + public enum CodingKeys: String, CodingKey { + case title + + case description + + case id = "_id" + } + + public init(description: String?, title: String?, id: String?) { + self.title = title + + self.description = description + + self.id = id + } + + public func duplicate() -> AvailablePageSeo { + let dict = self.dictionary! + let copy = AvailablePageSeo(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + title = try container.decode(String.self, forKey: .title) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(title, forKey: .title) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(id, forKey: .id) + } + } + + /* + Model: AvailablePageSchemaSections + Used By: Theme + */ + + class AvailablePageSchemaSections: Codable { + public var name: String? + + public var label: String? + + public var props: [String: Any]? + + public var blocks: [[String: Any]]? + + public var preset: [String: Any]? + + public var predicate: AvailablePagePredicate? + + public enum CodingKeys: String, CodingKey { + case name + + case label + + case props + + case blocks + + case preset + + case predicate + } + + public init(blocks: [[String: Any]]?, label: String?, name: String?, predicate: AvailablePagePredicate?, preset: [String: Any]?, props: [String: Any]?) { + self.name = name + + self.label = label + + self.props = props + + self.blocks = blocks + + self.preset = preset + + self.predicate = predicate + } + + public func duplicate() -> AvailablePageSchemaSections { + let dict = self.dictionary! + let copy = AvailablePageSchemaSections(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + label = try container.decode(String.self, forKey: .label) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + props = try container.decode([String: Any].self, forKey: .props) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + blocks = try container.decode([[String: Any]].self, forKey: .blocks) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + preset = try container.decode([String: Any].self, forKey: .preset) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + predicate = try container.decode(AvailablePagePredicate.self, forKey: .predicate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(label, forKey: .label) + + try? container.encodeIfPresent(props, forKey: .props) + + try? container.encodeIfPresent(blocks, forKey: .blocks) + + try? container.encodeIfPresent(preset, forKey: .preset) + + try? container.encodeIfPresent(predicate, forKey: .predicate) + } + } + + /* + Model: AvailablePageScreenPredicate + Used By: Theme + */ + + class AvailablePageScreenPredicate: Codable { + public var mobile: Bool? + + public var desktop: Bool? + + public var tablet: Bool? + + public enum CodingKeys: String, CodingKey { + case mobile + + case desktop + + case tablet + } + + public init(desktop: Bool?, mobile: Bool?, tablet: Bool?) { + self.mobile = mobile + + self.desktop = desktop + + self.tablet = tablet + } + + public func duplicate() -> AvailablePageScreenPredicate { + let dict = self.dictionary! + let copy = AvailablePageScreenPredicate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + mobile = try container.decode(Bool.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + desktop = try container.decode(Bool.self, forKey: .desktop) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tablet = try container.decode(Bool.self, forKey: .tablet) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + try? container.encodeIfPresent(desktop, forKey: .desktop) + + try? container.encodeIfPresent(tablet, forKey: .tablet) + } + } + + /* + Model: AvailablePageUserPredicate + Used By: Theme + */ + + class AvailablePageUserPredicate: Codable { + public var authenticated: Bool? + + public var anonymous: Bool? + + public enum CodingKeys: String, CodingKey { + case authenticated + + case anonymous + } + + public init(anonymous: Bool?, authenticated: Bool?) { + self.authenticated = authenticated + + self.anonymous = anonymous + } + + public func duplicate() -> AvailablePageUserPredicate { + let dict = self.dictionary! + let copy = AvailablePageUserPredicate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + authenticated = try container.decode(Bool.self, forKey: .authenticated) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + anonymous = try container.decode(Bool.self, forKey: .anonymous) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(authenticated, forKey: .authenticated) + + try? container.encodeIfPresent(anonymous, forKey: .anonymous) + } + } + + /* + Model: AvailablePageRoutePredicate + Used By: Theme + */ + + class AvailablePageRoutePredicate: Codable { + public var selected: String? + + public var exactUrl: String? + + public var query: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case selected + + case exactUrl = "exact_url" + + case query + } + + public init(exactUrl: String?, query: [String: Any]?, selected: String?) { + self.selected = selected + + self.exactUrl = exactUrl + + self.query = query + } + + public func duplicate() -> AvailablePageRoutePredicate { + let dict = self.dictionary! + let copy = AvailablePageRoutePredicate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + selected = try container.decode(String.self, forKey: .selected) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + exactUrl = try container.decode(String.self, forKey: .exactUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + query = try container.decode([String: Any].self, forKey: .query) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(selected, forKey: .selected) + + try? container.encodeIfPresent(exactUrl, forKey: .exactUrl) + + try? container.encodeIfPresent(query, forKey: .query) + } + } + + /* + Model: AvailablePagePredicate + Used By: Theme + */ + + class AvailablePagePredicate: Codable { + public var screen: AvailablePageScreenPredicate? + + public var user: AvailablePageUserPredicate? + + public var route: AvailablePageRoutePredicate? + + public enum CodingKeys: String, CodingKey { + case screen + + case user + + case route + } + + public init(route: AvailablePageRoutePredicate?, screen: AvailablePageScreenPredicate?, user: AvailablePageUserPredicate?) { + self.screen = screen + + self.user = user + + self.route = route + } + + public func duplicate() -> AvailablePagePredicate { + let dict = self.dictionary! + let copy = AvailablePagePredicate(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + screen = try container.decode(AvailablePageScreenPredicate.self, forKey: .screen) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + user = try container.decode(AvailablePageUserPredicate.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + route = try container.decode(AvailablePageRoutePredicate.self, forKey: .route) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(screen, forKey: .screen) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(route, forKey: .route) + } + } + + /* + Model: AllAvailablePageSchema + Used By: Theme + */ + + class AllAvailablePageSchema: Codable { + public var pages: [AvailablePageSchema]? + + public enum CodingKeys: String, CodingKey { + case pages + } + + public init(pages: [AvailablePageSchema]?) { + self.pages = pages + } + + public func duplicate() -> AllAvailablePageSchema { + let dict = self.dictionary! + let copy = AllAvailablePageSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + pages = try container.decode([AvailablePageSchema].self, forKey: .pages) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pages, forKey: .pages) + } + } + + /* + Model: PaginationSchema + Used By: Theme + */ + + class PaginationSchema: Codable { + public var size: Int? + + public var itemTotal: Int? + + public var hasNext: Bool? + + public var type: String? + + public var current: Int? + + public enum CodingKeys: String, CodingKey { + case size + + case itemTotal = "item_total" + + case hasNext = "has_next" + + case type + + case current + } + + public init(current: Int?, hasNext: Bool?, itemTotal: Int?, size: Int?, type: String?) { + self.size = size + + self.itemTotal = itemTotal + + self.hasNext = hasNext + + self.type = type + + self.current = current + } + + public func duplicate() -> PaginationSchema { + let dict = self.dictionary! + let copy = PaginationSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + size = try container.decode(Int.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemTotal = try container.decode(Int.self, forKey: .itemTotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasNext = try container.decode(Bool.self, forKey: .hasNext) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + current = try container.decode(Int.self, forKey: .current) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) + + try? container.encodeIfPresent(hasNext, forKey: .hasNext) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(current, forKey: .current) + } + } + + /* + Model: ThemesListingResponseSchema + Used By: Theme + */ + + class ThemesListingResponseSchema: Codable { + public var items: [ThemesSchema]? + + public var page: PaginationSchema? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [ThemesSchema]?, page: PaginationSchema?) { + self.items = items + + self.page = page + } + + public func duplicate() -> ThemesListingResponseSchema { + let dict = self.dictionary! + let copy = ThemesListingResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([ThemesSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(PaginationSchema.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: AddThemeRequestSchema + Used By: Theme + */ + + class AddThemeRequestSchema: Codable { + public var themeId: String? + + public enum CodingKeys: String, CodingKey { + case themeId = "theme_id" + } + + public init(themeId: String?) { + self.themeId = themeId + } + + public func duplicate() -> AddThemeRequestSchema { + let dict = self.dictionary! + let copy = AddThemeRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + themeId = try container.decode(String.self, forKey: .themeId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(themeId, forKey: .themeId) + } + } + + /* + Model: UpgradableThemeSchema + Used By: Theme + */ + + class UpgradableThemeSchema: Codable { + public var parentTheme: String? + + public var appliedTheme: String? + + public var upgrade: Bool? + + public enum CodingKeys: String, CodingKey { + case parentTheme = "parent_theme" + + case appliedTheme = "applied_theme" + + case upgrade + } + + public init(appliedTheme: String?, parentTheme: String?, upgrade: Bool?) { + self.parentTheme = parentTheme + + self.appliedTheme = appliedTheme + + self.upgrade = upgrade + } + + public func duplicate() -> UpgradableThemeSchema { + let dict = self.dictionary! + let copy = UpgradableThemeSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + parentTheme = try container.decode(String.self, forKey: .parentTheme) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appliedTheme = try container.decode(String.self, forKey: .appliedTheme) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + upgrade = try container.decode(Bool.self, forKey: .upgrade) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(parentTheme, forKey: .parentTheme) + + try? container.encodeIfPresent(appliedTheme, forKey: .appliedTheme) + + try? container.encodeIfPresent(upgrade, forKey: .upgrade) + } + } + + /* + Model: FontsSchema + Used By: Theme + */ + + class FontsSchema: Codable { + public var items: FontsSchemaItems? + + public var kind: String? + + public enum CodingKeys: String, CodingKey { + case items + + case kind + } + + public init(items: FontsSchemaItems?, kind: String?) { + self.items = items + + self.kind = kind + } + + public func duplicate() -> FontsSchema { + let dict = self.dictionary! + let copy = FontsSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode(FontsSchemaItems.self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + kind = try container.decode(String.self, forKey: .kind) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(kind, forKey: .kind) + } + } + + /* + Model: BlitzkriegApiErrorSchema + Used By: Theme + */ + + class BlitzkriegApiErrorSchema: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> BlitzkriegApiErrorSchema { + let dict = self.dictionary! + let copy = BlitzkriegApiErrorSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: BlitzkriegNotFoundSchema + Used By: Theme + */ + + class BlitzkriegNotFoundSchema: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> BlitzkriegNotFoundSchema { + let dict = self.dictionary! + let copy = BlitzkriegNotFoundSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: BlitzkriegInternalServerErrorSchema + Used By: Theme + */ + + class BlitzkriegInternalServerErrorSchema: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> BlitzkriegInternalServerErrorSchema { + let dict = self.dictionary! + let copy = BlitzkriegInternalServerErrorSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: FontsSchemaItems + Used By: Theme + */ + + class FontsSchemaItems: Codable { + public var family: String? + + public var variants: [String]? + + public var subsets: [String]? + + public var version: String? + + public var lastModified: String? + + public var files: FontsSchemaItemsFiles? + + public var category: String? + + public var kind: String? + + public enum CodingKeys: String, CodingKey { + case family + + case variants + + case subsets + + case version + + case lastModified = "last_modified" + + case files + + case category + + case kind + } + + public init(category: String?, family: String?, files: FontsSchemaItemsFiles?, kind: String?, lastModified: String?, subsets: [String]?, variants: [String]?, version: String?) { + self.family = family + + self.variants = variants + + self.subsets = subsets + + self.version = version + + self.lastModified = lastModified + + self.files = files + + self.category = category + + self.kind = kind + } + + public func duplicate() -> FontsSchemaItems { + let dict = self.dictionary! + let copy = FontsSchemaItems(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + family = try container.decode(String.self, forKey: .family) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + variants = try container.decode([String].self, forKey: .variants) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subsets = try container.decode([String].self, forKey: .subsets) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + version = try container.decode(String.self, forKey: .version) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastModified = try container.decode(String.self, forKey: .lastModified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + files = try container.decode(FontsSchemaItemsFiles.self, forKey: .files) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + category = try container.decode(String.self, forKey: .category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + kind = try container.decode(String.self, forKey: .kind) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(family, forKey: .family) + + try? container.encodeIfPresent(variants, forKey: .variants) + + try? container.encodeIfPresent(subsets, forKey: .subsets) + + try? container.encodeIfPresent(version, forKey: .version) + + try? container.encodeIfPresent(lastModified, forKey: .lastModified) + + try? container.encodeIfPresent(files, forKey: .files) + + try? container.encodeIfPresent(category, forKey: .category) + + try? container.encodeIfPresent(kind, forKey: .kind) + } + } + + /* + Model: FontsSchemaItemsFiles + Used By: Theme + */ + + class FontsSchemaItemsFiles: Codable { + public var regular: String? + + public var italic: String? + + public var bold: String? + + public enum CodingKeys: String, CodingKey { + case regular + + case italic + + case bold + } + + public init(bold: String?, italic: String?, regular: String?) { + self.regular = regular + + self.italic = italic + + self.bold = bold + } + + public func duplicate() -> FontsSchemaItemsFiles { + let dict = self.dictionary! + let copy = FontsSchemaItemsFiles(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + regular = try container.decode(String.self, forKey: .regular) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + italic = try container.decode(String.self, forKey: .italic) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bold = try container.decode(String.self, forKey: .bold) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(regular, forKey: .regular) + + try? container.encodeIfPresent(italic, forKey: .italic) + + try? container.encodeIfPresent(bold, forKey: .bold) + } + } + + /* + Model: ThemesSchema + Used By: Theme + */ + + class ThemesSchema: Codable { + public var application: String? + + public var applied: Bool? + + public var customized: Bool? + + public var published: Bool? + + public var archived: Bool? + + public var createdAt: String? + + public var updatedAt: String? + + public var version: String? + + public var parentThemeVersion: String? + + public var parentTheme: String? + + public var information: Information? + + public var tags: [String]? + + public var src: Src? + + public var assets: AssetsSchema? + + public var availableSections: [availableSectionSchema]? + + public var constants: [String: Any]? + + public var styles: [String: Any]? + + public var config: Config? + + public var settings: [String: Any]? + + public var font: Font? + + public var id: String? + + public var v: Int? + + public var colors: Colors? + + public enum CodingKeys: String, CodingKey { + case application + + case applied + + case customized + + case published + + case archived + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case version + + case parentThemeVersion = "parent_theme_version" + + case parentTheme = "parent_theme" + + case information + + case tags + + case src + + case assets + + case availableSections = "available_sections" + + case constants + + case styles + + case config + + case settings + + case font + + case id = "_id" + + case v = "__v" + + case colors + } + + public init(application: String?, applied: Bool?, archived: Bool?, assets: AssetsSchema?, availableSections: [availableSectionSchema]?, colors: Colors?, config: Config?, constants: [String: Any]?, createdAt: String?, customized: Bool?, font: Font?, information: Information?, parentTheme: String?, parentThemeVersion: String?, published: Bool?, settings: [String: Any]?, src: Src?, styles: [String: Any]?, tags: [String]?, updatedAt: String?, version: String?, id: String?, v: Int?) { + self.application = application + + self.applied = applied + + self.customized = customized + + self.published = published + + self.archived = archived + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.version = version + + self.parentThemeVersion = parentThemeVersion + + self.parentTheme = parentTheme + + self.information = information + + self.tags = tags + + self.src = src + + self.assets = assets + + self.availableSections = availableSections + + self.constants = constants + + self.styles = styles + + self.config = config + + self.settings = settings + + self.font = font + + self.id = id + + self.v = v + + self.colors = colors + } + + public func duplicate() -> ThemesSchema { + let dict = self.dictionary! + let copy = ThemesSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(String.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + applied = try container.decode(Bool.self, forKey: .applied) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customized = try container.decode(Bool.self, forKey: .customized) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + published = try container.decode(Bool.self, forKey: .published) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + archived = try container.decode(Bool.self, forKey: .archived) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + version = try container.decode(String.self, forKey: .version) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + parentThemeVersion = try container.decode(String.self, forKey: .parentThemeVersion) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + parentTheme = try container.decode(String.self, forKey: .parentTheme) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + information = try container.decode(Information.self, forKey: .information) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + tags = try container.decode([String].self, forKey: .tags) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + src = try container.decode(Src.self, forKey: .src) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + assets = try container.decode(AssetsSchema.self, forKey: .assets) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + availableSections = try container.decode([availableSectionSchema].self, forKey: .availableSections) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + constants = try container.decode([String: Any].self, forKey: .constants) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + styles = try container.decode([String: Any].self, forKey: .styles) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + config = try container.decode(Config.self, forKey: .config) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + settings = try container.decode([String: Any].self, forKey: .settings) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + font = try container.decode(Font.self, forKey: .font) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + colors = try container.decode(Colors.self, forKey: .colors) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + + try? container.encodeIfPresent(applied, forKey: .applied) + + try? container.encodeIfPresent(customized, forKey: .customized) + + try? container.encodeIfPresent(published, forKey: .published) + + try? container.encodeIfPresent(archived, forKey: .archived) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(version, forKey: .version) + + try? container.encodeIfPresent(parentThemeVersion, forKey: .parentThemeVersion) + + try? container.encodeIfPresent(parentTheme, forKey: .parentTheme) + + try? container.encodeIfPresent(information, forKey: .information) + + try? container.encodeIfPresent(tags, forKey: .tags) + + try? container.encodeIfPresent(src, forKey: .src) + + try? container.encodeIfPresent(assets, forKey: .assets) + + try? container.encodeIfPresent(availableSections, forKey: .availableSections) + + try? container.encodeIfPresent(constants, forKey: .constants) + + try? container.encodeIfPresent(styles, forKey: .styles) + + try? container.encodeIfPresent(config, forKey: .config) + + try? container.encodeIfPresent(settings, forKey: .settings) + + try? container.encodeIfPresent(font, forKey: .font) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(v, forKey: .v) + + try? container.encodeIfPresent(colors, forKey: .colors) + } + } + + /* + Model: availableSectionSchema + Used By: Theme + */ + + class availableSectionSchema: Codable { + public var blocks: [Blocks]? + + public var name: String? + + public var label: String? + + public var props: [BlocksProps]? + + public enum CodingKeys: String, CodingKey { + case blocks + + case name + + case label + + case props + } + + public init(blocks: [Blocks]?, label: String?, name: String?, props: [BlocksProps]?) { + self.blocks = blocks + + self.name = name + + self.label = label + + self.props = props + } + + public func duplicate() -> availableSectionSchema { + let dict = self.dictionary! + let copy = availableSectionSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + blocks = try container.decode([Blocks].self, forKey: .blocks) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + label = try container.decode(String.self, forKey: .label) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + props = try container.decode([BlocksProps].self, forKey: .props) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(blocks, forKey: .blocks) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(label, forKey: .label) + + try? container.encodeIfPresent(props, forKey: .props) + } + } + + /* + Model: Information + Used By: Theme + */ + + class Information: Codable { + public var images: Images? + + public var features: [String]? + + public var name: String? + + public var description: String? + + public enum CodingKeys: String, CodingKey { + case images + + case features + + case name + + case description + } + + public init(description: String?, features: [String]?, images: Images?, name: String?) { + self.images = images + + self.features = features + + self.name = name + + self.description = description + } + + public func duplicate() -> Information { + let dict = self.dictionary! + let copy = Information(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + images = try container.decode(Images.self, forKey: .images) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + features = try container.decode([String].self, forKey: .features) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(images, forKey: .images) + + try? container.encodeIfPresent(features, forKey: .features) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(description, forKey: .description) + } + } + + /* + Model: Images + Used By: Theme + */ + + class Images: Codable { + public var desktop: [String]? + + public var android: [String]? + + public var ios: [String]? + + public var thumbnail: [String]? + + public enum CodingKeys: String, CodingKey { + case desktop + + case android + + case ios + + case thumbnail + } + + public init(android: [String]?, desktop: [String]?, ios: [String]?, thumbnail: [String]?) { + self.desktop = desktop + + self.android = android + + self.ios = ios + + self.thumbnail = thumbnail + } + + public func duplicate() -> Images { + let dict = self.dictionary! + let copy = Images(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + desktop = try container.decode([String].self, forKey: .desktop) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + android = try container.decode([String].self, forKey: .android) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + ios = try container.decode([String].self, forKey: .ios) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + thumbnail = try container.decode([String].self, forKey: .thumbnail) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(desktop, forKey: .desktop) + + try? container.encodeIfPresent(android, forKey: .android) + + try? container.encodeIfPresent(ios, forKey: .ios) + + try? container.encodeIfPresent(thumbnail, forKey: .thumbnail) + } + } + + /* + Model: Src + Used By: Theme + */ + + class Src: Codable { + public var link: String? + + public enum CodingKeys: String, CodingKey { + case link + } + + public init(link: String?) { + self.link = link + } + + public func duplicate() -> Src { + let dict = self.dictionary! + let copy = Src(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: AssetsSchema + Used By: Theme + */ + + class AssetsSchema: Codable { + public var umdJs: UmdJs? + + public var commonJs: CommonJs? + + public var css: Css? + + public enum CodingKeys: String, CodingKey { + case umdJs = "umd_js" + + case commonJs = "common_js" + + case css + } + + public init(commonJs: CommonJs?, css: Css?, umdJs: UmdJs?) { + self.umdJs = umdJs + + self.commonJs = commonJs + + self.css = css + } + + public func duplicate() -> AssetsSchema { + let dict = self.dictionary! + let copy = AssetsSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + umdJs = try container.decode(UmdJs.self, forKey: .umdJs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + commonJs = try container.decode(CommonJs.self, forKey: .commonJs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + css = try container.decode(Css.self, forKey: .css) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(umdJs, forKey: .umdJs) + + try? container.encodeIfPresent(commonJs, forKey: .commonJs) + + try? container.encodeIfPresent(css, forKey: .css) + } + } + + /* + Model: UmdJs + Used By: Theme + */ + + class UmdJs: Codable { + public var link: String? + + public enum CodingKeys: String, CodingKey { + case link + } + + public init(link: String?) { + self.link = link + } + + public func duplicate() -> UmdJs { + let dict = self.dictionary! + let copy = UmdJs(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: CommonJs + Used By: Theme + */ + + class CommonJs: Codable { + public var link: String? + + public enum CodingKeys: String, CodingKey { + case link + } + + public init(link: String?) { + self.link = link + } + + public func duplicate() -> CommonJs { + let dict = self.dictionary! + let copy = CommonJs(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: Css + Used By: Theme + */ + + class Css: Codable { + public var link: String? + + public enum CodingKeys: String, CodingKey { + case link + } + + public init(link: String?) { + self.link = link + } + + public func duplicate() -> Css { + let dict = self.dictionary! + let copy = Css(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + link = try container.decode(String.self, forKey: .link) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(link, forKey: .link) + } + } + + /* + Model: Sections + Used By: Theme + */ + + class Sections: Codable { + public var attributes: String? + + public enum CodingKeys: String, CodingKey { + case attributes + } + + public init(attributes: String?) { + self.attributes = attributes + } + + public func duplicate() -> Sections { + let dict = self.dictionary! + let copy = Sections(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + attributes = try container.decode(String.self, forKey: .attributes) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(attributes, forKey: .attributes) + } + } + + /* + Model: Config + Used By: Theme + */ + + class Config: Codable { + public var preset: Preset? + + public var globalSchema: GlobalSchema? + + public var current: String? + + public var list: [ListSchemaItem]? + + public enum CodingKeys: String, CodingKey { + case preset + + case globalSchema = "global_schema" + + case current + + case list + } + + public init(current: String?, globalSchema: GlobalSchema?, list: [ListSchemaItem]?, preset: Preset?) { + self.preset = preset + + self.globalSchema = globalSchema + + self.current = current + + self.list = list + } + + public func duplicate() -> Config { + let dict = self.dictionary! + let copy = Config(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + preset = try container.decode(Preset.self, forKey: .preset) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + globalSchema = try container.decode(GlobalSchema.self, forKey: .globalSchema) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + current = try container.decode(String.self, forKey: .current) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + list = try container.decode([ListSchemaItem].self, forKey: .list) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(preset, forKey: .preset) + + try? container.encodeIfPresent(globalSchema, forKey: .globalSchema) + + try? container.encodeIfPresent(current, forKey: .current) + + try? container.encodeIfPresent(list, forKey: .list) + } + } + + /* + Model: Preset + Used By: Theme + */ + + class Preset: Codable { + public var pages: [AvailablePageSchema]? + + public enum CodingKeys: String, CodingKey { + case pages + } + + public init(pages: [AvailablePageSchema]?) { + self.pages = pages + } + + public func duplicate() -> Preset { + let dict = self.dictionary! + let copy = Preset(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + pages = try container.decode([AvailablePageSchema].self, forKey: .pages) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(pages, forKey: .pages) + } + } + + /* + Model: GlobalSchema + Used By: Theme + */ + + class GlobalSchema: Codable { + public var props: [GlobalSchemaProps]? + + public enum CodingKeys: String, CodingKey { + case props + } + + public init(props: [GlobalSchemaProps]?) { + self.props = props + } + + public func duplicate() -> GlobalSchema { + let dict = self.dictionary! + let copy = GlobalSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + props = try container.decode([GlobalSchemaProps].self, forKey: .props) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(props, forKey: .props) + } + } + + /* + Model: ListSchemaItem + Used By: Theme + */ + + class ListSchemaItem: Codable { + public var globalConfig: [String: Any]? + + public var page: [ConfigPage]? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case globalConfig = "global_config" + + case page + + case name + } + + public init(globalConfig: [String: Any]?, name: String?, page: [ConfigPage]?) { + self.globalConfig = globalConfig + + self.page = page + + self.name = name + } + + public func duplicate() -> ListSchemaItem { + let dict = self.dictionary! + let copy = ListSchemaItem(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + globalConfig = try container.decode([String: Any].self, forKey: .globalConfig) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode([ConfigPage].self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(globalConfig, forKey: .globalConfig) + + try? container.encodeIfPresent(page, forKey: .page) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: Colors + Used By: Theme + */ + + class Colors: Codable { + public var bgColor: String? + + public var primaryColor: String? + + public var secondaryColor: String? + + public var accentColor: String? + + public var linkColor: String? + + public var buttonSecondaryColor: String? + + public enum CodingKeys: String, CodingKey { + case bgColor = "bg_color" + + case primaryColor = "primary_color" + + case secondaryColor = "secondary_color" + + case accentColor = "accent_color" + + case linkColor = "link_color" + + case buttonSecondaryColor = "button_secondary_color" + } + + public init(accentColor: String?, bgColor: String?, buttonSecondaryColor: String?, linkColor: String?, primaryColor: String?, secondaryColor: String?) { + self.bgColor = bgColor + + self.primaryColor = primaryColor + + self.secondaryColor = secondaryColor + + self.accentColor = accentColor + + self.linkColor = linkColor + + self.buttonSecondaryColor = buttonSecondaryColor + } + + public func duplicate() -> Colors { + let dict = self.dictionary! + let copy = Colors(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + bgColor = try container.decode(String.self, forKey: .bgColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + primaryColor = try container.decode(String.self, forKey: .primaryColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + secondaryColor = try container.decode(String.self, forKey: .secondaryColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + accentColor = try container.decode(String.self, forKey: .accentColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + linkColor = try container.decode(String.self, forKey: .linkColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + buttonSecondaryColor = try container.decode(String.self, forKey: .buttonSecondaryColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(bgColor, forKey: .bgColor) + + try? container.encodeIfPresent(primaryColor, forKey: .primaryColor) + + try? container.encodeIfPresent(secondaryColor, forKey: .secondaryColor) + + try? container.encodeIfPresent(accentColor, forKey: .accentColor) + + try? container.encodeIfPresent(linkColor, forKey: .linkColor) + + try? container.encodeIfPresent(buttonSecondaryColor, forKey: .buttonSecondaryColor) + } + } + + /* + Model: Custom + Used By: Theme + */ + + class Custom: Codable { + public var props: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case props + } + + public init(props: [String: Any]?) { + self.props = props + } + + public func duplicate() -> Custom { + let dict = self.dictionary! + let copy = Custom(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + props = try container.decode([String: Any].self, forKey: .props) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(props, forKey: .props) + } + } + + /* + Model: ConfigPage + Used By: Theme + */ + + class ConfigPage: Codable { + public var settings: [String: Any]? + + public var page: String? + + public enum CodingKeys: String, CodingKey { + case settings + + case page + } + + public init(page: String?, settings: [String: Any]?) { + self.settings = settings + + self.page = page + } + + public func duplicate() -> ConfigPage { + let dict = self.dictionary! + let copy = ConfigPage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + settings = try container.decode([String: Any].self, forKey: .settings) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(String.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(settings, forKey: .settings) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: Font + Used By: Theme + */ + + class Font: Codable { + public var family: String? + + public var variants: Variants? + + public enum CodingKeys: String, CodingKey { + case family + + case variants + } + + public init(family: String?, variants: Variants?) { + self.family = family + + self.variants = variants + } + + public func duplicate() -> Font { + let dict = self.dictionary! + let copy = Font(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + family = try container.decode(String.self, forKey: .family) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + variants = try container.decode(Variants.self, forKey: .variants) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(family, forKey: .family) + + try? container.encodeIfPresent(variants, forKey: .variants) + } + } + + /* + Model: Variants + Used By: Theme + */ + + class Variants: Codable { + public var medium: Medium? + + public var semiBold: SemiBold? + + public var bold: Bold? + + public var light: Light? + + public var regular: Regular? + + public enum CodingKeys: String, CodingKey { + case medium + + case semiBold = "semi_bold" + + case bold + + case light + + case regular + } + + public init(bold: Bold?, light: Light?, medium: Medium?, regular: Regular?, semiBold: SemiBold?) { + self.medium = medium + + self.semiBold = semiBold + + self.bold = bold + + self.light = light + + self.regular = regular + } + + public func duplicate() -> Variants { + let dict = self.dictionary! + let copy = Variants(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + medium = try container.decode(Medium.self, forKey: .medium) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + semiBold = try container.decode(SemiBold.self, forKey: .semiBold) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + bold = try container.decode(Bold.self, forKey: .bold) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + light = try container.decode(Light.self, forKey: .light) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + regular = try container.decode(Regular.self, forKey: .regular) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(medium, forKey: .medium) + + try? container.encodeIfPresent(semiBold, forKey: .semiBold) + + try? container.encodeIfPresent(bold, forKey: .bold) + + try? container.encodeIfPresent(light, forKey: .light) + + try? container.encodeIfPresent(regular, forKey: .regular) + } + } + + /* + Model: Medium + Used By: Theme + */ + + class Medium: Codable { + public var name: String? + + public var file: String? + + public enum CodingKeys: String, CodingKey { + case name + + case file + } + + public init(file: String?, name: String?) { + self.name = name + + self.file = file + } + + public func duplicate() -> Medium { + let dict = self.dictionary! + let copy = Medium(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + file = try container.decode(String.self, forKey: .file) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(file, forKey: .file) + } + } + + /* + Model: SemiBold + Used By: Theme + */ + + class SemiBold: Codable { + public var name: String? + + public var file: String? + + public enum CodingKeys: String, CodingKey { + case name + + case file + } + + public init(file: String?, name: String?) { + self.name = name + + self.file = file + } + + public func duplicate() -> SemiBold { + let dict = self.dictionary! + let copy = SemiBold(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + file = try container.decode(String.self, forKey: .file) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(file, forKey: .file) + } + } + + /* + Model: Bold + Used By: Theme + */ + + class Bold: Codable { + public var name: String? + + public var file: String? + + public enum CodingKeys: String, CodingKey { + case name + + case file + } + + public init(file: String?, name: String?) { + self.name = name + + self.file = file + } + + public func duplicate() -> Bold { + let dict = self.dictionary! + let copy = Bold(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + file = try container.decode(String.self, forKey: .file) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(file, forKey: .file) + } + } + + /* + Model: Light + Used By: Theme + */ + + class Light: Codable { + public var name: String? + + public var file: String? + + public enum CodingKeys: String, CodingKey { + case name + + case file + } + + public init(file: String?, name: String?) { + self.name = name + + self.file = file + } + + public func duplicate() -> Light { + let dict = self.dictionary! + let copy = Light(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + file = try container.decode(String.self, forKey: .file) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(file, forKey: .file) + } + } + + /* + Model: Regular + Used By: Theme + */ + + class Regular: Codable { + public var name: String? + + public var file: String? + + public enum CodingKeys: String, CodingKey { + case name + + case file + } + + public init(file: String?, name: String?) { + self.name = name + + self.file = file + } + + public func duplicate() -> Regular { + let dict = self.dictionary! + let copy = Regular(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + file = try container.decode(String.self, forKey: .file) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(file, forKey: .file) + } + } + + /* + Model: Blocks + Used By: Theme + */ + + class Blocks: Codable { + public var type: String? + + public var name: String? + + public var props: [BlocksProps]? + + public enum CodingKeys: String, CodingKey { + case type + + case name + + case props + } + + public init(name: String?, props: [BlocksProps]?, type: String?) { + self.type = type + + self.name = name + + self.props = props + } + + public func duplicate() -> Blocks { + let dict = self.dictionary! + let copy = Blocks(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + props = try container.decode([BlocksProps].self, forKey: .props) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(props, forKey: .props) + } + } + + /* + Model: GlobalSchemaProps + Used By: Theme + */ + + class GlobalSchemaProps: Codable { + public var id: String? + + public var label: String? + + public var type: String? + + public var category: String? + + public enum CodingKeys: String, CodingKey { + case id + + case label + + case type + + case category + } + + public init(category: String?, id: String?, label: String?, type: String?) { + self.id = id + + self.label = label + + self.type = type + + self.category = category + } + + public func duplicate() -> GlobalSchemaProps { + let dict = self.dictionary! + let copy = GlobalSchemaProps(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + label = try container.decode(String.self, forKey: .label) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + category = try container.decode(String.self, forKey: .category) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(label, forKey: .label) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(category, forKey: .category) + } + } + + /* + Model: BlocksProps + Used By: Theme + */ + + class BlocksProps: Codable { + public var id: String? + + public var label: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case id + + case label + + case type + } + + public init(id: String?, label: String?, type: String?) { + self.id = id + + self.label = label + + self.type = type + } + + public func duplicate() -> BlocksProps { + let dict = self.dictionary! + let copy = BlocksProps(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + label = try container.decode(String.self, forKey: .label) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(label, forKey: .label) + + try? container.encodeIfPresent(type, forKey: .type) + } + } +} diff --git a/Sources/code/platform/models/UserPlatformModelClass.swift b/Sources/code/platform/models/UserPlatformModelClass.swift new file mode 100644 index 0000000000..b82993d961 --- /dev/null +++ b/Sources/code/platform/models/UserPlatformModelClass.swift @@ -0,0 +1,6011 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: EditEmailRequestSchema + Used By: User + */ + + class EditEmailRequestSchema: Codable { + public var email: String? + + public enum CodingKeys: String, CodingKey { + case email + } + + public init(email: String?) { + self.email = email + } + + public func duplicate() -> EditEmailRequestSchema { + let dict = self.dictionary! + let copy = EditEmailRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + } + } + + /* + Model: SendVerificationLinkMobileRequestSchema + Used By: User + */ + + class SendVerificationLinkMobileRequestSchema: Codable { + public var verified: Bool? + + public var active: Bool? + + public var countryCode: String? + + public var phone: String? + + public var primary: Bool? + + public enum CodingKeys: String, CodingKey { + case verified + + case active + + case countryCode = "country_code" + + case phone + + case primary + } + + public init(active: Bool?, countryCode: String?, phone: String?, primary: Bool?, verified: Bool?) { + self.verified = verified + + self.active = active + + self.countryCode = countryCode + + self.phone = phone + + self.primary = primary + } + + public func duplicate() -> SendVerificationLinkMobileRequestSchema { + let dict = self.dictionary! + let copy = SendVerificationLinkMobileRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + verified = try container.decode(Bool.self, forKey: .verified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + primary = try container.decode(Bool.self, forKey: .primary) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(verified, forKey: .verified) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(primary, forKey: .primary) + } + } + + /* + Model: EditMobileRequestSchema + Used By: User + */ + + class EditMobileRequestSchema: Codable { + public var countryCode: String? + + public var phone: String? + + public enum CodingKeys: String, CodingKey { + case countryCode = "country_code" + + case phone + } + + public init(countryCode: String?, phone: String?) { + self.countryCode = countryCode + + self.phone = phone + } + + public func duplicate() -> EditMobileRequestSchema { + let dict = self.dictionary! + let copy = EditMobileRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(phone, forKey: .phone) + } + } + + /* + Model: EditProfileRequestSchema + Used By: User + */ + + class EditProfileRequestSchema: Codable { + public var firstName: String? + + public var lastName: String? + + public var mobile: EditProfileMobileSchema? + + public var countryCode: String? + + public var email: String? + + public var gender: String? + + public var dob: String? + + public var profilePicUrl: String? + + public var androidHash: String? + + public var sender: String? + + public var registerToken: String? + + public enum CodingKeys: String, CodingKey { + case firstName = "first_name" + + case lastName = "last_name" + + case mobile + + case countryCode = "country_code" + + case email + + case gender + + case dob + + case profilePicUrl = "profile_pic_url" + + case androidHash = "android_hash" + + case sender + + case registerToken = "register_token" + } + + public init(androidHash: String?, countryCode: String?, dob: String?, email: String?, firstName: String?, gender: String?, lastName: String?, mobile: EditProfileMobileSchema?, profilePicUrl: String?, registerToken: String?, sender: String?) { + self.firstName = firstName + + self.lastName = lastName + + self.mobile = mobile + + self.countryCode = countryCode + + self.email = email + + self.gender = gender + + self.dob = dob + + self.profilePicUrl = profilePicUrl + + self.androidHash = androidHash + + self.sender = sender + + self.registerToken = registerToken + } + + public func duplicate() -> EditProfileRequestSchema { + let dict = self.dictionary! + let copy = EditProfileRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobile = try container.decode(EditProfileMobileSchema.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gender = try container.decode(String.self, forKey: .gender) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dob = try container.decode(String.self, forKey: .dob) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + profilePicUrl = try container.decode(String.self, forKey: .profilePicUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + androidHash = try container.decode(String.self, forKey: .androidHash) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + sender = try container.decode(String.self, forKey: .sender) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(gender, forKey: .gender) + + try? container.encodeIfPresent(dob, forKey: .dob) + + try? container.encodeIfPresent(profilePicUrl, forKey: .profilePicUrl) + + try? container.encodeIfPresent(androidHash, forKey: .androidHash) + + try? container.encodeIfPresent(sender, forKey: .sender) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + } + } + + /* + Model: EditProfileMobileSchema + Used By: User + */ + + class EditProfileMobileSchema: Codable { + public var phone: String? + + public var countryCode: String? + + public enum CodingKeys: String, CodingKey { + case phone + + case countryCode = "country_code" + } + + public init(countryCode: String?, phone: String?) { + self.phone = phone + + self.countryCode = countryCode + } + + public func duplicate() -> EditProfileMobileSchema { + let dict = self.dictionary! + let copy = EditProfileMobileSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + phone = try container.decode(String.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + } + } + + /* + Model: SendEmailOtpRequestSchema + Used By: User + */ + + class SendEmailOtpRequestSchema: Codable { + public var email: String? + + public var action: String? + + public var token: String? + + public var registerToken: String? + + public enum CodingKeys: String, CodingKey { + case email + + case action + + case token + + case registerToken = "register_token" + } + + public init(action: String?, email: String?, registerToken: String?, token: String?) { + self.email = email + + self.action = action + + self.token = token + + self.registerToken = registerToken + } + + public func duplicate() -> SendEmailOtpRequestSchema { + let dict = self.dictionary! + let copy = SendEmailOtpRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(String.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + token = try container.decode(String.self, forKey: .token) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(token, forKey: .token) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + } + } + + /* + Model: VerifyEmailOtpRequestSchema + Used By: User + */ + + class VerifyEmailOtpRequestSchema: Codable { + public var email: String? + + public var action: String? + + public var registerToken: String? + + public var otp: String? + + public enum CodingKeys: String, CodingKey { + case email + + case action + + case registerToken = "register_token" + + case otp + } + + public init(action: String?, email: String?, otp: String?, registerToken: String?) { + self.email = email + + self.action = action + + self.registerToken = registerToken + + self.otp = otp + } + + public func duplicate() -> VerifyEmailOtpRequestSchema { + let dict = self.dictionary! + let copy = VerifyEmailOtpRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(String.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + otp = try container.decode(String.self, forKey: .otp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + + try? container.encodeIfPresent(otp, forKey: .otp) + } + } + + /* + Model: VerifyOtpRequestSchema + Used By: User + */ + + class VerifyOtpRequestSchema: Codable { + public var requestId: String? + + public var registerToken: String? + + public var otp: String? + + public enum CodingKeys: String, CodingKey { + case requestId = "request_id" + + case registerToken = "register_token" + + case otp + } + + public init(otp: String?, registerToken: String?, requestId: String?) { + self.requestId = requestId + + self.registerToken = registerToken + + self.otp = otp + } + + public func duplicate() -> VerifyOtpRequestSchema { + let dict = self.dictionary! + let copy = VerifyOtpRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + otp = try container.decode(String.self, forKey: .otp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + + try? container.encodeIfPresent(otp, forKey: .otp) + } + } + + /* + Model: SendMobileOtpRequestSchema + Used By: User + */ + + class SendMobileOtpRequestSchema: Codable { + public var mobile: String? + + public var countryCode: String? + + public var action: String? + + public var token: String? + + public var androidHash: String? + + public var force: String? + + public var captchaCode: String? + + public enum CodingKeys: String, CodingKey { + case mobile + + case countryCode = "country_code" + + case action + + case token + + case androidHash = "android_hash" + + case force + + case captchaCode = "captcha_code" + } + + public init(action: String?, androidHash: String?, captchaCode: String?, countryCode: String?, force: String?, mobile: String?, token: String?) { + self.mobile = mobile + + self.countryCode = countryCode + + self.action = action + + self.token = token + + self.androidHash = androidHash + + self.force = force + + self.captchaCode = captchaCode + } + + public func duplicate() -> SendMobileOtpRequestSchema { + let dict = self.dictionary! + let copy = SendMobileOtpRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + mobile = try container.decode(String.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + action = try container.decode(String.self, forKey: .action) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + token = try container.decode(String.self, forKey: .token) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + androidHash = try container.decode(String.self, forKey: .androidHash) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + force = try container.decode(String.self, forKey: .force) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + captchaCode = try container.decode(String.self, forKey: .captchaCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(action, forKey: .action) + + try? container.encodeIfPresent(token, forKey: .token) + + try? container.encodeIfPresent(androidHash, forKey: .androidHash) + + try? container.encodeIfPresent(force, forKey: .force) + + try? container.encodeIfPresent(captchaCode, forKey: .captchaCode) + } + } + + /* + Model: UpdatePasswordRequestSchema + Used By: User + */ + + class UpdatePasswordRequestSchema: Codable { + public var oldPassword: String? + + public var newPassword: String? + + public enum CodingKeys: String, CodingKey { + case oldPassword = "old_password" + + case newPassword = "new_password" + } + + public init(newPassword: String?, oldPassword: String?) { + self.oldPassword = oldPassword + + self.newPassword = newPassword + } + + public func duplicate() -> UpdatePasswordRequestSchema { + let dict = self.dictionary! + let copy = UpdatePasswordRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + oldPassword = try container.decode(String.self, forKey: .oldPassword) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + newPassword = try container.decode(String.self, forKey: .newPassword) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(oldPassword, forKey: .oldPassword) + + try? container.encodeIfPresent(newPassword, forKey: .newPassword) + } + } + + /* + Model: FormRegisterRequestSchema + Used By: User + */ + + class FormRegisterRequestSchema: Codable { + public var firstName: String? + + public var lastName: String? + + public var gender: String? + + public var email: String? + + public var password: String? + + public var phone: FormRegisterRequestSchemaPhone? + + public var registerToken: String? + + public enum CodingKeys: String, CodingKey { + case firstName = "first_name" + + case lastName = "last_name" + + case gender + + case email + + case password + + case phone + + case registerToken = "register_token" + } + + public init(email: String?, firstName: String?, gender: String?, lastName: String?, password: String?, phone: FormRegisterRequestSchemaPhone?, registerToken: String?) { + self.firstName = firstName + + self.lastName = lastName + + self.gender = gender + + self.email = email + + self.password = password + + self.phone = phone + + self.registerToken = registerToken + } + + public func duplicate() -> FormRegisterRequestSchema { + let dict = self.dictionary! + let copy = FormRegisterRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gender = try container.decode(String.self, forKey: .gender) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + password = try container.decode(String.self, forKey: .password) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phone = try container.decode(FormRegisterRequestSchemaPhone.self, forKey: .phone) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(gender, forKey: .gender) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(password, forKey: .password) + + try? container.encodeIfPresent(phone, forKey: .phone) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + } + } + + /* + Model: TokenRequestBodySchema + Used By: User + */ + + class TokenRequestBodySchema: Codable { + public var token: String? + + public enum CodingKeys: String, CodingKey { + case token + } + + public init(token: String?) { + self.token = token + } + + public func duplicate() -> TokenRequestBodySchema { + let dict = self.dictionary! + let copy = TokenRequestBodySchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + token = try container.decode(String.self, forKey: .token) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(token, forKey: .token) + } + } + + /* + Model: ForgotPasswordRequestSchema + Used By: User + */ + + class ForgotPasswordRequestSchema: Codable { + public var code: String? + + public var password: String? + + public enum CodingKeys: String, CodingKey { + case code + + case password + } + + public init(code: String?, password: String?) { + self.code = code + + self.password = password + } + + public func duplicate() -> ForgotPasswordRequestSchema { + let dict = self.dictionary! + let copy = ForgotPasswordRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + password = try container.decode(String.self, forKey: .password) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(password, forKey: .password) + } + } + + /* + Model: CodeRequestBodySchema + Used By: User + */ + + class CodeRequestBodySchema: Codable { + public var code: String? + + public enum CodingKeys: String, CodingKey { + case code + } + + public init(code: String?) { + self.code = code + } + + public func duplicate() -> CodeRequestBodySchema { + let dict = self.dictionary! + let copy = CodeRequestBodySchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: SendResetPasswordEmailRequestSchema + Used By: User + */ + + class SendResetPasswordEmailRequestSchema: Codable { + public var email: String? + + public var captchaCode: String? + + public enum CodingKeys: String, CodingKey { + case email + + case captchaCode = "captcha_code" + } + + public init(captchaCode: String?, email: String?) { + self.email = email + + self.captchaCode = captchaCode + } + + public func duplicate() -> SendResetPasswordEmailRequestSchema { + let dict = self.dictionary! + let copy = SendResetPasswordEmailRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + captchaCode = try container.decode(String.self, forKey: .captchaCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(captchaCode, forKey: .captchaCode) + } + } + + /* + Model: PasswordLoginRequestSchema + Used By: User + */ + + class PasswordLoginRequestSchema: Codable { + public var captchaCode: String? + + public var password: String? + + public var username: String? + + public enum CodingKeys: String, CodingKey { + case captchaCode = "captcha_code" + + case password + + case username + } + + public init(captchaCode: String?, password: String?, username: String?) { + self.captchaCode = captchaCode + + self.password = password + + self.username = username + } + + public func duplicate() -> PasswordLoginRequestSchema { + let dict = self.dictionary! + let copy = PasswordLoginRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + captchaCode = try container.decode(String.self, forKey: .captchaCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + password = try container.decode(String.self, forKey: .password) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(captchaCode, forKey: .captchaCode) + + try? container.encodeIfPresent(password, forKey: .password) + + try? container.encodeIfPresent(username, forKey: .username) + } + } + + /* + Model: SendOtpRequestSchema + Used By: User + */ + + class SendOtpRequestSchema: Codable { + public var countryCode: String? + + public var captchaCode: String? + + public var mobile: String? + + public enum CodingKeys: String, CodingKey { + case countryCode = "country_code" + + case captchaCode = "captcha_code" + + case mobile + } + + public init(captchaCode: String?, countryCode: String?, mobile: String?) { + self.countryCode = countryCode + + self.captchaCode = captchaCode + + self.mobile = mobile + } + + public func duplicate() -> SendOtpRequestSchema { + let dict = self.dictionary! + let copy = SendOtpRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + captchaCode = try container.decode(String.self, forKey: .captchaCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobile = try container.decode(String.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(captchaCode, forKey: .captchaCode) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + } + } + + /* + Model: OAuthRequestSchema + Used By: User + */ + + class OAuthRequestSchema: Codable { + public var isSignedIn: Bool? + + public var oauth2: OAuthRequestSchemaOauth2? + + public var profile: OAuthRequestSchemaProfile? + + public enum CodingKeys: String, CodingKey { + case isSignedIn = "is_signed_in" + + case oauth2 + + case profile + } + + public init(isSignedIn: Bool?, oauth2: OAuthRequestSchemaOauth2?, profile: OAuthRequestSchemaProfile?) { + self.isSignedIn = isSignedIn + + self.oauth2 = oauth2 + + self.profile = profile + } + + public func duplicate() -> OAuthRequestSchema { + let dict = self.dictionary! + let copy = OAuthRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isSignedIn = try container.decode(Bool.self, forKey: .isSignedIn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + oauth2 = try container.decode(OAuthRequestSchemaOauth2.self, forKey: .oauth2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + profile = try container.decode(OAuthRequestSchemaProfile.self, forKey: .profile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isSignedIn, forKey: .isSignedIn) + + try? container.encodeIfPresent(oauth2, forKey: .oauth2) + + try? container.encodeIfPresent(profile, forKey: .profile) + } + } + + /* + Model: OAuthRequestAppleSchema + Used By: User + */ + + class OAuthRequestAppleSchema: Codable { + public var userIdentifier: String? + + public var oauth: OAuthRequestAppleSchemaOauth? + + public var profile: OAuthRequestAppleSchemaProfile? + + public enum CodingKeys: String, CodingKey { + case userIdentifier = "user_identifier" + + case oauth + + case profile + } + + public init(oauth: OAuthRequestAppleSchemaOauth?, profile: OAuthRequestAppleSchemaProfile?, userIdentifier: String?) { + self.userIdentifier = userIdentifier + + self.oauth = oauth + + self.profile = profile + } + + public func duplicate() -> OAuthRequestAppleSchema { + let dict = self.dictionary! + let copy = OAuthRequestAppleSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + userIdentifier = try container.decode(String.self, forKey: .userIdentifier) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + oauth = try container.decode(OAuthRequestAppleSchemaOauth.self, forKey: .oauth) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + profile = try container.decode(OAuthRequestAppleSchemaProfile.self, forKey: .profile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(userIdentifier, forKey: .userIdentifier) + + try? container.encodeIfPresent(oauth, forKey: .oauth) + + try? container.encodeIfPresent(profile, forKey: .profile) + } + } + + /* + Model: UserObjectSchema + Used By: User + */ + + class UserObjectSchema: Codable { + public var user: UserSchema? + + public enum CodingKeys: String, CodingKey { + case user + } + + public init(user: UserSchema?) { + self.user = user + } + + public func duplicate() -> UserObjectSchema { + let dict = self.dictionary! + let copy = UserObjectSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode(UserSchema.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + } + } + + /* + Model: AuthSuccess + Used By: User + */ + + class AuthSuccess: Codable { + public var registerToken: String? + + public var userExists: Bool? + + public var user: UserSchema? + + public enum CodingKeys: String, CodingKey { + case registerToken = "register_token" + + case userExists = "user_exists" + + case user + } + + public init(registerToken: String?, user: UserSchema?, userExists: Bool?) { + self.registerToken = registerToken + + self.userExists = userExists + + self.user = user + } + + public func duplicate() -> AuthSuccess { + let dict = self.dictionary! + let copy = AuthSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userExists = try container.decode(Bool.self, forKey: .userExists) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + user = try container.decode(UserSchema.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + + try? container.encodeIfPresent(userExists, forKey: .userExists) + + try? container.encodeIfPresent(user, forKey: .user) + } + } + + /* + Model: SendOtpResponse + Used By: User + */ + + class SendOtpResponse: Codable { + public var resendTimer: Int? + + public var resendToken: String? + + public var success: Bool? + + public var requestId: String? + + public var message: String? + + public var mobile: String? + + public var countryCode: String? + + public var email: String? + + public var resendEmailToken: String? + + public var registerToken: String? + + public var verifyEmailOtp: Bool? + + public var verifyMobileOtp: Bool? + + public var userExists: Bool? + + public enum CodingKeys: String, CodingKey { + case resendTimer = "resend_timer" + + case resendToken = "resend_token" + + case success + + case requestId = "request_id" + + case message + + case mobile + + case countryCode = "country_code" + + case email + + case resendEmailToken = "resend_email_token" + + case registerToken = "register_token" + + case verifyEmailOtp = "verify_email_otp" + + case verifyMobileOtp = "verify_mobile_otp" + + case userExists = "user_exists" + } + + public init(countryCode: String?, email: String?, message: String?, mobile: String?, registerToken: String?, requestId: String?, resendEmailToken: String?, resendTimer: Int?, resendToken: String?, success: Bool?, userExists: Bool?, verifyEmailOtp: Bool?, verifyMobileOtp: Bool?) { + self.resendTimer = resendTimer + + self.resendToken = resendToken + + self.success = success + + self.requestId = requestId + + self.message = message + + self.mobile = mobile + + self.countryCode = countryCode + + self.email = email + + self.resendEmailToken = resendEmailToken + + self.registerToken = registerToken + + self.verifyEmailOtp = verifyEmailOtp + + self.verifyMobileOtp = verifyMobileOtp + + self.userExists = userExists + } + + public func duplicate() -> SendOtpResponse { + let dict = self.dictionary! + let copy = SendOtpResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + resendTimer = try container.decode(Int.self, forKey: .resendTimer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + resendToken = try container.decode(String.self, forKey: .resendToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobile = try container.decode(String.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + resendEmailToken = try container.decode(String.self, forKey: .resendEmailToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyEmailOtp = try container.decode(Bool.self, forKey: .verifyEmailOtp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyMobileOtp = try container.decode(Bool.self, forKey: .verifyMobileOtp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userExists = try container.decode(Bool.self, forKey: .userExists) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(resendTimer, forKey: .resendTimer) + + try? container.encodeIfPresent(resendToken, forKey: .resendToken) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(resendEmailToken, forKey: .resendEmailToken) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + + try? container.encodeIfPresent(verifyEmailOtp, forKey: .verifyEmailOtp) + + try? container.encodeIfPresent(verifyMobileOtp, forKey: .verifyMobileOtp) + + try? container.encodeIfPresent(userExists, forKey: .userExists) + } + } + + /* + Model: ProfileEditSuccess + Used By: User + */ + + class ProfileEditSuccess: Codable { + public var user: UserSchema? + + public var resendEmailToken: String? + + public var registerToken: String? + + public var userExists: Bool? + + public var verifyEmailLink: Bool? + + public var verifyEmailOtp: Bool? + + public var verifyMobileOtp: Bool? + + public var email: String? + + public var requestId: String? + + public enum CodingKeys: String, CodingKey { + case user + + case resendEmailToken = "resend_email_token" + + case registerToken = "register_token" + + case userExists = "user_exists" + + case verifyEmailLink = "verify_email_link" + + case verifyEmailOtp = "verify_email_otp" + + case verifyMobileOtp = "verify_mobile_otp" + + case email + + case requestId = "request_id" + } + + public init(email: String?, registerToken: String?, requestId: String?, resendEmailToken: String?, user: UserSchema?, userExists: Bool?, verifyEmailLink: Bool?, verifyEmailOtp: Bool?, verifyMobileOtp: Bool?) { + self.user = user + + self.resendEmailToken = resendEmailToken + + self.registerToken = registerToken + + self.userExists = userExists + + self.verifyEmailLink = verifyEmailLink + + self.verifyEmailOtp = verifyEmailOtp + + self.verifyMobileOtp = verifyMobileOtp + + self.email = email + + self.requestId = requestId + } + + public func duplicate() -> ProfileEditSuccess { + let dict = self.dictionary! + let copy = ProfileEditSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode(UserSchema.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + resendEmailToken = try container.decode(String.self, forKey: .resendEmailToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userExists = try container.decode(Bool.self, forKey: .userExists) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyEmailLink = try container.decode(Bool.self, forKey: .verifyEmailLink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyEmailOtp = try container.decode(Bool.self, forKey: .verifyEmailOtp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyMobileOtp = try container.decode(Bool.self, forKey: .verifyMobileOtp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(resendEmailToken, forKey: .resendEmailToken) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + + try? container.encodeIfPresent(userExists, forKey: .userExists) + + try? container.encodeIfPresent(verifyEmailLink, forKey: .verifyEmailLink) + + try? container.encodeIfPresent(verifyEmailOtp, forKey: .verifyEmailOtp) + + try? container.encodeIfPresent(verifyMobileOtp, forKey: .verifyMobileOtp) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + } + } + + /* + Model: LoginSuccess + Used By: User + */ + + class LoginSuccess: Codable { + public var user: UserSchema? + + public var requestId: String? + + public var registerToken: String? + + public enum CodingKeys: String, CodingKey { + case user + + case requestId = "request_id" + + case registerToken = "register_token" + } + + public init(registerToken: String?, requestId: String?, user: UserSchema?) { + self.user = user + + self.requestId = requestId + + self.registerToken = registerToken + } + + public func duplicate() -> LoginSuccess { + let dict = self.dictionary! + let copy = LoginSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode(UserSchema.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + } + } + + /* + Model: VerifyOtpSuccess + Used By: User + */ + + class VerifyOtpSuccess: Codable { + public var user: UserSchema? + + public var userExists: Bool? + + public var registerToken: String? + + public enum CodingKeys: String, CodingKey { + case user + + case userExists = "user_exists" + + case registerToken = "register_token" + } + + public init(registerToken: String?, user: UserSchema?, userExists: Bool?) { + self.user = user + + self.userExists = userExists + + self.registerToken = registerToken + } + + public func duplicate() -> VerifyOtpSuccess { + let dict = self.dictionary! + let copy = VerifyOtpSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode(UserSchema.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userExists = try container.decode(Bool.self, forKey: .userExists) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(userExists, forKey: .userExists) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + } + } + + /* + Model: ResetPasswordSuccess + Used By: User + */ + + class ResetPasswordSuccess: Codable { + public var status: String? + + public enum CodingKeys: String, CodingKey { + case status + } + + public init(status: String?) { + self.status = status + } + + public func duplicate() -> ResetPasswordSuccess { + let dict = self.dictionary! + let copy = ResetPasswordSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + status = try container.decode(String.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: RegisterFormSuccess + Used By: User + */ + + class RegisterFormSuccess: Codable { + public var email: String? + + public var resendTimer: Int? + + public var resendToken: String? + + public var resendEmailToken: String? + + public var registerToken: String? + + public var success: Bool? + + public var requestId: String? + + public var message: String? + + public var mobile: String? + + public var countryCode: String? + + public var verifyEmailOtp: Bool? + + public var verifyMobileOtp: Bool? + + public var userExists: Bool? + + public enum CodingKeys: String, CodingKey { + case email + + case resendTimer = "resend_timer" + + case resendToken = "resend_token" + + case resendEmailToken = "resend_email_token" + + case registerToken = "register_token" + + case success + + case requestId = "request_id" + + case message + + case mobile + + case countryCode = "country_code" + + case verifyEmailOtp = "verify_email_otp" + + case verifyMobileOtp = "verify_mobile_otp" + + case userExists = "user_exists" + } + + public init(countryCode: String?, email: String?, message: String?, mobile: String?, registerToken: String?, requestId: String?, resendEmailToken: String?, resendTimer: Int?, resendToken: String?, success: Bool?, userExists: Bool?, verifyEmailOtp: Bool?, verifyMobileOtp: Bool?) { + self.email = email + + self.resendTimer = resendTimer + + self.resendToken = resendToken + + self.resendEmailToken = resendEmailToken + + self.registerToken = registerToken + + self.success = success + + self.requestId = requestId + + self.message = message + + self.mobile = mobile + + self.countryCode = countryCode + + self.verifyEmailOtp = verifyEmailOtp + + self.verifyMobileOtp = verifyMobileOtp + + self.userExists = userExists + } + + public func duplicate() -> RegisterFormSuccess { + let dict = self.dictionary! + let copy = RegisterFormSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + resendTimer = try container.decode(Int.self, forKey: .resendTimer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + resendToken = try container.decode(String.self, forKey: .resendToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + resendEmailToken = try container.decode(String.self, forKey: .resendEmailToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobile = try container.decode(String.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyEmailOtp = try container.decode(Bool.self, forKey: .verifyEmailOtp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyMobileOtp = try container.decode(Bool.self, forKey: .verifyMobileOtp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userExists = try container.decode(Bool.self, forKey: .userExists) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(resendTimer, forKey: .resendTimer) + + try? container.encodeIfPresent(resendToken, forKey: .resendToken) + + try? container.encodeIfPresent(resendEmailToken, forKey: .resendEmailToken) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(verifyEmailOtp, forKey: .verifyEmailOtp) + + try? container.encodeIfPresent(verifyMobileOtp, forKey: .verifyMobileOtp) + + try? container.encodeIfPresent(userExists, forKey: .userExists) + } + } + + /* + Model: VerifyEmailSuccess + Used By: User + */ + + class VerifyEmailSuccess: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> VerifyEmailSuccess { + let dict = self.dictionary! + let copy = VerifyEmailSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: HasPasswordSuccess + Used By: User + */ + + class HasPasswordSuccess: Codable { + public var result: Bool? + + public enum CodingKeys: String, CodingKey { + case result + } + + public init(result: Bool?) { + self.result = result + } + + public func duplicate() -> HasPasswordSuccess { + let dict = self.dictionary! + let copy = HasPasswordSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + result = try container.decode(Bool.self, forKey: .result) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(result, forKey: .result) + } + } + + /* + Model: LogoutSuccess + Used By: User + */ + + class LogoutSuccess: Codable { + public var logout: Bool? + + public enum CodingKeys: String, CodingKey { + case logout + } + + public init(logout: Bool?) { + self.logout = logout + } + + public func duplicate() -> LogoutSuccess { + let dict = self.dictionary! + let copy = LogoutSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + logout = try container.decode(Bool.self, forKey: .logout) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(logout, forKey: .logout) + } + } + + /* + Model: OtpSuccess + Used By: User + */ + + class OtpSuccess: Codable { + public var resendTimer: Int? + + public var resendToken: String? + + public var registerToken: String? + + public var success: Bool? + + public var requestId: String? + + public var message: String? + + public var mobile: String? + + public var countryCode: String? + + public enum CodingKeys: String, CodingKey { + case resendTimer = "resend_timer" + + case resendToken = "resend_token" + + case registerToken = "register_token" + + case success + + case requestId = "request_id" + + case message + + case mobile + + case countryCode = "country_code" + } + + public init(countryCode: String?, message: String?, mobile: String?, registerToken: String?, requestId: String?, resendTimer: Int?, resendToken: String?, success: Bool?) { + self.resendTimer = resendTimer + + self.resendToken = resendToken + + self.registerToken = registerToken + + self.success = success + + self.requestId = requestId + + self.message = message + + self.mobile = mobile + + self.countryCode = countryCode + } + + public func duplicate() -> OtpSuccess { + let dict = self.dictionary! + let copy = OtpSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + resendTimer = try container.decode(Int.self, forKey: .resendTimer) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + resendToken = try container.decode(String.self, forKey: .resendToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requestId = try container.decode(String.self, forKey: .requestId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobile = try container.decode(String.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(resendTimer, forKey: .resendTimer) + + try? container.encodeIfPresent(resendToken, forKey: .resendToken) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + + try? container.encodeIfPresent(success, forKey: .success) + + try? container.encodeIfPresent(requestId, forKey: .requestId) + + try? container.encodeIfPresent(message, forKey: .message) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + } + } + + /* + Model: EmailOtpSuccess + Used By: User + */ + + class EmailOtpSuccess: Codable { + public var success: Bool? + + public enum CodingKeys: String, CodingKey { + case success + } + + public init(success: Bool?) { + self.success = success + } + + public func duplicate() -> EmailOtpSuccess { + let dict = self.dictionary! + let copy = EmailOtpSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + success = try container.decode(Bool.self, forKey: .success) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(success, forKey: .success) + } + } + + /* + Model: SessionListSuccess + Used By: User + */ + + class SessionListSuccess: Codable { + public var sessions: [String]? + + public enum CodingKeys: String, CodingKey { + case sessions + } + + public init(sessions: [String]?) { + self.sessions = sessions + } + + public func duplicate() -> SessionListSuccess { + let dict = self.dictionary! + let copy = SessionListSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + sessions = try container.decode([String].self, forKey: .sessions) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(sessions, forKey: .sessions) + } + } + + /* + Model: VerifyMobileOTPSuccess + Used By: User + */ + + class VerifyMobileOTPSuccess: Codable { + public var user: UserSchema? + + public var verifyMobileLink: Bool? + + public enum CodingKeys: String, CodingKey { + case user + + case verifyMobileLink = "verify_mobile_link" + } + + public init(user: UserSchema?, verifyMobileLink: Bool?) { + self.user = user + + self.verifyMobileLink = verifyMobileLink + } + + public func duplicate() -> VerifyMobileOTPSuccess { + let dict = self.dictionary! + let copy = VerifyMobileOTPSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode(UserSchema.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyMobileLink = try container.decode(Bool.self, forKey: .verifyMobileLink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(verifyMobileLink, forKey: .verifyMobileLink) + } + } + + /* + Model: VerifyEmailOTPSuccess + Used By: User + */ + + class VerifyEmailOTPSuccess: Codable { + public var user: UserSchema? + + public var verifyEmailLink: Bool? + + public enum CodingKeys: String, CodingKey { + case user + + case verifyEmailLink = "verify_email_link" + } + + public init(user: UserSchema?, verifyEmailLink: Bool?) { + self.user = user + + self.verifyEmailLink = verifyEmailLink + } + + public func duplicate() -> VerifyEmailOTPSuccess { + let dict = self.dictionary! + let copy = VerifyEmailOTPSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode(UserSchema.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyEmailLink = try container.decode(Bool.self, forKey: .verifyEmailLink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(verifyEmailLink, forKey: .verifyEmailLink) + } + } + + /* + Model: SendMobileVerifyLinkSuccess + Used By: User + */ + + class SendMobileVerifyLinkSuccess: Codable { + public var verifyMobileLink: Bool? + + public enum CodingKeys: String, CodingKey { + case verifyMobileLink = "verify_mobile_link" + } + + public init(verifyMobileLink: Bool?) { + self.verifyMobileLink = verifyMobileLink + } + + public func duplicate() -> SendMobileVerifyLinkSuccess { + let dict = self.dictionary! + let copy = SendMobileVerifyLinkSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + verifyMobileLink = try container.decode(Bool.self, forKey: .verifyMobileLink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(verifyMobileLink, forKey: .verifyMobileLink) + } + } + + /* + Model: SendEmailVerifyLinkSuccess + Used By: User + */ + + class SendEmailVerifyLinkSuccess: Codable { + public var verifyEmailLink: Bool? + + public enum CodingKeys: String, CodingKey { + case verifyEmailLink = "verify_email_link" + } + + public init(verifyEmailLink: Bool?) { + self.verifyEmailLink = verifyEmailLink + } + + public func duplicate() -> SendEmailVerifyLinkSuccess { + let dict = self.dictionary! + let copy = SendEmailVerifyLinkSuccess(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + verifyEmailLink = try container.decode(Bool.self, forKey: .verifyEmailLink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(verifyEmailLink, forKey: .verifyEmailLink) + } + } + + /* + Model: UserSearchResponseSchema + Used By: User + */ + + class UserSearchResponseSchema: Codable { + public var users: [UserSchema]? + + public enum CodingKeys: String, CodingKey { + case users + } + + public init(users: [UserSchema]?) { + self.users = users + } + + public func duplicate() -> UserSearchResponseSchema { + let dict = self.dictionary! + let copy = UserSearchResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + users = try container.decode([UserSchema].self, forKey: .users) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(users, forKey: .users) + } + } + + /* + Model: CustomerListResponseSchema + Used By: User + */ + + class CustomerListResponseSchema: Codable { + public var items: [UserSchema]? + + public var page: PaginationSchema? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [UserSchema]?, page: PaginationSchema?) { + self.items = items + + self.page = page + } + + public func duplicate() -> CustomerListResponseSchema { + let dict = self.dictionary! + let copy = CustomerListResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([UserSchema].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(PaginationSchema.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: UnauthorizedSchema + Used By: User + */ + + class UnauthorizedSchema: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> UnauthorizedSchema { + let dict = self.dictionary! + let copy = UnauthorizedSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: UnauthenticatedSchema + Used By: User + */ + + class UnauthenticatedSchema: Codable { + public var authenticated: Bool? + + public enum CodingKeys: String, CodingKey { + case authenticated + } + + public init(authenticated: Bool?) { + self.authenticated = authenticated + } + + public func duplicate() -> UnauthenticatedSchema { + let dict = self.dictionary! + let copy = UnauthenticatedSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + authenticated = try container.decode(Bool.self, forKey: .authenticated) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(authenticated, forKey: .authenticated) + } + } + + /* + Model: NotFoundSchema + Used By: User + */ + + class NotFoundSchema: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> NotFoundSchema { + let dict = self.dictionary! + let copy = NotFoundSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: AuthenticationInternalServerErrorSchema + Used By: User + */ + + class AuthenticationInternalServerErrorSchema: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> AuthenticationInternalServerErrorSchema { + let dict = self.dictionary! + let copy = AuthenticationInternalServerErrorSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: AuthenticationApiErrorSchema + Used By: User + */ + + class AuthenticationApiErrorSchema: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> AuthenticationApiErrorSchema { + let dict = self.dictionary! + let copy = AuthenticationApiErrorSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: ProfileEditSuccessSchema + Used By: User + */ + + class ProfileEditSuccessSchema: Codable { + public var email: String? + + public var verifyEmailOtp: Bool? + + public var verifyEmailLink: Bool? + + public var verifyMobileOtp: Bool? + + public var user: String? + + public var registerToken: String? + + public var userExists: Bool? + + public enum CodingKeys: String, CodingKey { + case email + + case verifyEmailOtp = "verify_email_otp" + + case verifyEmailLink = "verify_email_link" + + case verifyMobileOtp = "verify_mobile_otp" + + case user + + case registerToken = "register_token" + + case userExists = "user_exists" + } + + public init(email: String?, registerToken: String?, user: String?, userExists: Bool?, verifyEmailLink: Bool?, verifyEmailOtp: Bool?, verifyMobileOtp: Bool?) { + self.email = email + + self.verifyEmailOtp = verifyEmailOtp + + self.verifyEmailLink = verifyEmailLink + + self.verifyMobileOtp = verifyMobileOtp + + self.user = user + + self.registerToken = registerToken + + self.userExists = userExists + } + + public func duplicate() -> ProfileEditSuccessSchema { + let dict = self.dictionary! + let copy = ProfileEditSuccessSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyEmailOtp = try container.decode(Bool.self, forKey: .verifyEmailOtp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyEmailLink = try container.decode(Bool.self, forKey: .verifyEmailLink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verifyMobileOtp = try container.decode(Bool.self, forKey: .verifyMobileOtp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + user = try container.decode(String.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerToken = try container.decode(String.self, forKey: .registerToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userExists = try container.decode(Bool.self, forKey: .userExists) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(verifyEmailOtp, forKey: .verifyEmailOtp) + + try? container.encodeIfPresent(verifyEmailLink, forKey: .verifyEmailLink) + + try? container.encodeIfPresent(verifyMobileOtp, forKey: .verifyMobileOtp) + + try? container.encodeIfPresent(user, forKey: .user) + + try? container.encodeIfPresent(registerToken, forKey: .registerToken) + + try? container.encodeIfPresent(userExists, forKey: .userExists) + } + } + + /* + Model: FormRegisterRequestSchemaPhone + Used By: User + */ + + class FormRegisterRequestSchemaPhone: Codable { + public var countryCode: String? + + public var mobile: String? + + public enum CodingKeys: String, CodingKey { + case countryCode = "country_code" + + case mobile + } + + public init(countryCode: String?, mobile: String?) { + self.countryCode = countryCode + + self.mobile = mobile + } + + public func duplicate() -> FormRegisterRequestSchemaPhone { + let dict = self.dictionary! + let copy = FormRegisterRequestSchemaPhone(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + countryCode = try container.decode(String.self, forKey: .countryCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobile = try container.decode(String.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(countryCode, forKey: .countryCode) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + } + } + + /* + Model: OAuthRequestSchemaOauth2 + Used By: User + */ + + class OAuthRequestSchemaOauth2: Codable { + public var accessToken: String? + + public var expiry: Int? + + public var refreshToken: String? + + public enum CodingKeys: String, CodingKey { + case accessToken = "access_token" + + case expiry + + case refreshToken = "refresh_token" + } + + public init(accessToken: String?, expiry: Int?, refreshToken: String?) { + self.accessToken = accessToken + + self.expiry = expiry + + self.refreshToken = refreshToken + } + + public func duplicate() -> OAuthRequestSchemaOauth2 { + let dict = self.dictionary! + let copy = OAuthRequestSchemaOauth2(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + accessToken = try container.decode(String.self, forKey: .accessToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + expiry = try container.decode(Int.self, forKey: .expiry) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + refreshToken = try container.decode(String.self, forKey: .refreshToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(accessToken, forKey: .accessToken) + + try? container.encodeIfPresent(expiry, forKey: .expiry) + + try? container.encodeIfPresent(refreshToken, forKey: .refreshToken) + } + } + + /* + Model: OAuthRequestSchemaProfile + Used By: User + */ + + class OAuthRequestSchemaProfile: Codable { + public var lastName: String? + + public var image: String? + + public var id: String? + + public var email: String? + + public var fullName: String? + + public var firstName: String? + + public enum CodingKeys: String, CodingKey { + case lastName = "last_name" + + case image + + case id + + case email + + case fullName = "full_name" + + case firstName = "first_name" + } + + public init(email: String?, firstName: String?, fullName: String?, id: String?, image: String?, lastName: String?) { + self.lastName = lastName + + self.image = image + + self.id = id + + self.email = email + + self.fullName = fullName + + self.firstName = firstName + } + + public func duplicate() -> OAuthRequestSchemaProfile { + let dict = self.dictionary! + let copy = OAuthRequestSchemaProfile(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + image = try container.decode(String.self, forKey: .image) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fullName = try container.decode(String.self, forKey: .fullName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(image, forKey: .image) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(fullName, forKey: .fullName) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + } + } + + /* + Model: OAuthRequestAppleSchemaOauth + Used By: User + */ + + class OAuthRequestAppleSchemaOauth: Codable { + public var identityToken: String? + + public enum CodingKeys: String, CodingKey { + case identityToken = "identity_token" + } + + public init(identityToken: String?) { + self.identityToken = identityToken + } + + public func duplicate() -> OAuthRequestAppleSchemaOauth { + let dict = self.dictionary! + let copy = OAuthRequestAppleSchemaOauth(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + identityToken = try container.decode(String.self, forKey: .identityToken) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(identityToken, forKey: .identityToken) + } + } + + /* + Model: OAuthRequestAppleSchemaProfile + Used By: User + */ + + class OAuthRequestAppleSchemaProfile: Codable { + public var lastName: String? + + public var fullName: String? + + public var firstName: String? + + public enum CodingKeys: String, CodingKey { + case lastName = "last_name" + + case fullName = "full_name" + + case firstName = "first_name" + } + + public init(firstName: String?, fullName: String?, lastName: String?) { + self.lastName = lastName + + self.fullName = fullName + + self.firstName = firstName + } + + public func duplicate() -> OAuthRequestAppleSchemaProfile { + let dict = self.dictionary! + let copy = OAuthRequestAppleSchemaProfile(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + fullName = try container.decode(String.self, forKey: .fullName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(fullName, forKey: .fullName) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + } + } + + /* + Model: AuthSuccessUser + Used By: User + */ + + class AuthSuccessUser: Codable { + public var firstName: String? + + public var lastName: String? + + public var debug: AuthSuccessUserDebug? + + public var active: Bool? + + public var emails: AuthSuccessUserEmails? + + public enum CodingKeys: String, CodingKey { + case firstName = "first_name" + + case lastName = "last_name" + + case debug + + case active + + case emails + } + + public init(active: Bool?, debug: AuthSuccessUserDebug?, emails: AuthSuccessUserEmails?, firstName: String?, lastName: String?) { + self.firstName = firstName + + self.lastName = lastName + + self.debug = debug + + self.active = active + + self.emails = emails + } + + public func duplicate() -> AuthSuccessUser { + let dict = self.dictionary! + let copy = AuthSuccessUser(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + debug = try container.decode(AuthSuccessUserDebug.self, forKey: .debug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + emails = try container.decode(AuthSuccessUserEmails.self, forKey: .emails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(debug, forKey: .debug) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(emails, forKey: .emails) + } + } + + /* + Model: AuthSuccessUserDebug + Used By: User + */ + + class AuthSuccessUserDebug: Codable { + public var platform: String? + + public enum CodingKeys: String, CodingKey { + case platform + } + + public init(platform: String?) { + self.platform = platform + } + + public func duplicate() -> AuthSuccessUserDebug { + let dict = self.dictionary! + let copy = AuthSuccessUserDebug(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + platform = try container.decode(String.self, forKey: .platform) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(platform, forKey: .platform) + } + } + + /* + Model: AuthSuccessUserEmails + Used By: User + */ + + class AuthSuccessUserEmails: Codable { + public var email: String? + + public var verified: Bool? + + public var primary: Bool? + + public var active: Bool? + + public enum CodingKeys: String, CodingKey { + case email + + case verified + + case primary + + case active + } + + public init(active: Bool?, email: String?, primary: Bool?, verified: Bool?) { + self.email = email + + self.verified = verified + + self.primary = primary + + self.active = active + } + + public func duplicate() -> AuthSuccessUserEmails { + let dict = self.dictionary! + let copy = AuthSuccessUserEmails(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + verified = try container.decode(Bool.self, forKey: .verified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + primary = try container.decode(Bool.self, forKey: .primary) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(verified, forKey: .verified) + + try? container.encodeIfPresent(primary, forKey: .primary) + + try? container.encodeIfPresent(active, forKey: .active) + } + } + + /* + Model: CreateUserRequestSchema + Used By: User + */ + + class CreateUserRequestSchema: Codable { + public var phoneNumber: String + + public var email: String? + + public var firstName: String? + + public var lastName: String? + + public var gender: String? + + public var username: String + + public var meta: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case phoneNumber = "phone_number" + + case email + + case firstName = "first_name" + + case lastName = "last_name" + + case gender + + case username + + case meta + } + + public init(email: String?, firstName: String?, gender: String?, lastName: String?, meta: [String: Any]?, phoneNumber: String, username: String) { + self.phoneNumber = phoneNumber + + self.email = email + + self.firstName = firstName + + self.lastName = lastName + + self.gender = gender + + self.username = username + + self.meta = meta + } + + public func duplicate() -> CreateUserRequestSchema { + let dict = self.dictionary! + let copy = CreateUserRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + phoneNumber = try container.decode(String.self, forKey: .phoneNumber) + + do { + email = try container.decode(String.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gender = try container.decode(String.self, forKey: .gender) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + username = try container.decode(String.self, forKey: .username) + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(phoneNumber, forKey: .phoneNumber) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(gender, forKey: .gender) + + try? container.encodeIfPresent(username, forKey: .username) + + try? container.encodeIfPresent(meta, forKey: .meta) + } + } + + /* + Model: CreateUserResponseSchema + Used By: User + */ + + class CreateUserResponseSchema: Codable { + public var user: UserSchema? + + public enum CodingKeys: String, CodingKey { + case user + } + + public init(user: UserSchema?) { + self.user = user + } + + public func duplicate() -> CreateUserResponseSchema { + let dict = self.dictionary! + let copy = CreateUserResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + user = try container.decode(UserSchema.self, forKey: .user) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(user, forKey: .user) + } + } + + /* + Model: CreateUserSessionRequestSchema + Used By: User + */ + + class CreateUserSessionRequestSchema: Codable { + public var domain: String? + + public var maxAge: Double? + + public var userId: String? + + public enum CodingKeys: String, CodingKey { + case domain + + case maxAge = "max_age" + + case userId = "user_id" + } + + public init(domain: String?, maxAge: Double?, userId: String?) { + self.domain = domain + + self.maxAge = maxAge + + self.userId = userId + } + + public func duplicate() -> CreateUserSessionRequestSchema { + let dict = self.dictionary! + let copy = CreateUserSessionRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + domain = try container.decode(String.self, forKey: .domain) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + maxAge = try container.decode(Double.self, forKey: .maxAge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + userId = try container.decode(String.self, forKey: .userId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(domain, forKey: .domain) + + try? container.encodeIfPresent(maxAge, forKey: .maxAge) + + try? container.encodeIfPresent(userId, forKey: .userId) + } + } + + /* + Model: CreateUserSessionResponseSchema + Used By: User + */ + + class CreateUserSessionResponseSchema: Codable { + public var domain: String? + + public var maxAge: Double? + + public var secure: Bool? + + public var httpOnly: Bool? + + public var cookie: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case domain + + case maxAge = "max_age" + + case secure + + case httpOnly = "http_only" + + case cookie + } + + public init(cookie: [String: Any]?, domain: String?, httpOnly: Bool?, maxAge: Double?, secure: Bool?) { + self.domain = domain + + self.maxAge = maxAge + + self.secure = secure + + self.httpOnly = httpOnly + + self.cookie = cookie + } + + public func duplicate() -> CreateUserSessionResponseSchema { + let dict = self.dictionary! + let copy = CreateUserSessionResponseSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + domain = try container.decode(String.self, forKey: .domain) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + maxAge = try container.decode(Double.self, forKey: .maxAge) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + secure = try container.decode(Bool.self, forKey: .secure) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + httpOnly = try container.decode(Bool.self, forKey: .httpOnly) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cookie = try container.decode([String: Any].self, forKey: .cookie) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(domain, forKey: .domain) + + try? container.encodeIfPresent(maxAge, forKey: .maxAge) + + try? container.encodeIfPresent(secure, forKey: .secure) + + try? container.encodeIfPresent(httpOnly, forKey: .httpOnly) + + try? container.encodeIfPresent(cookie, forKey: .cookie) + } + } + + /* + Model: PlatformSchema + Used By: User + */ + + class PlatformSchema: Codable { + public var display: String? + + public var lookAndFeel: LookAndFeel? + + public var updatedAt: String? + + public var active: Bool? + + public var forgotPassword: Bool? + + public var login: Login? + + public var skipCaptcha: Bool? + + public var name: String? + + public var meta: MetaSchema? + + public var id: String? + + public var social: Social? + + public var requiredFields: RequiredFields? + + public var registerRequiredFields: RegisterRequiredFields? + + public var skipLogin: Bool? + + public var flashCard: FlashCard? + + public var subtext: String? + + public var socialTokens: SocialTokens? + + public var createdAt: String? + + public var register: Bool? + + public var mobileImage: String? + + public var desktopImage: String? + + public enum CodingKeys: String, CodingKey { + case display + + case lookAndFeel = "look_and_feel" + + case updatedAt = "updated_at" + + case active + + case forgotPassword = "forgot_password" + + case login + + case skipCaptcha = "skip_captcha" + + case name + + case meta + + case id = "_id" + + case social + + case requiredFields = "required_fields" + + case registerRequiredFields = "register_required_fields" + + case skipLogin = "skip_login" + + case flashCard = "flash_card" + + case subtext + + case socialTokens = "social_tokens" + + case createdAt = "created_at" + + case register + + case mobileImage = "mobile_image" + + case desktopImage = "desktop_image" + } + + public init(active: Bool?, createdAt: String?, desktopImage: String?, display: String?, flashCard: FlashCard?, forgotPassword: Bool?, login: Login?, lookAndFeel: LookAndFeel?, meta: MetaSchema?, mobileImage: String?, name: String?, register: Bool?, registerRequiredFields: RegisterRequiredFields?, requiredFields: RequiredFields?, skipCaptcha: Bool?, skipLogin: Bool?, social: Social?, socialTokens: SocialTokens?, subtext: String?, updatedAt: String?, id: String?) { + self.display = display + + self.lookAndFeel = lookAndFeel + + self.updatedAt = updatedAt + + self.active = active + + self.forgotPassword = forgotPassword + + self.login = login + + self.skipCaptcha = skipCaptcha + + self.name = name + + self.meta = meta + + self.id = id + + self.social = social + + self.requiredFields = requiredFields + + self.registerRequiredFields = registerRequiredFields + + self.skipLogin = skipLogin + + self.flashCard = flashCard + + self.subtext = subtext + + self.socialTokens = socialTokens + + self.createdAt = createdAt + + self.register = register + + self.mobileImage = mobileImage + + self.desktopImage = desktopImage + } + + public func duplicate() -> PlatformSchema { + let dict = self.dictionary! + let copy = PlatformSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + display = try container.decode(String.self, forKey: .display) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lookAndFeel = try container.decode(LookAndFeel.self, forKey: .lookAndFeel) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + forgotPassword = try container.decode(Bool.self, forKey: .forgotPassword) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + login = try container.decode(Login.self, forKey: .login) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + skipCaptcha = try container.decode(Bool.self, forKey: .skipCaptcha) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode(MetaSchema.self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + social = try container.decode(Social.self, forKey: .social) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + requiredFields = try container.decode(RequiredFields.self, forKey: .requiredFields) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + registerRequiredFields = try container.decode(RegisterRequiredFields.self, forKey: .registerRequiredFields) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + skipLogin = try container.decode(Bool.self, forKey: .skipLogin) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + flashCard = try container.decode(FlashCard.self, forKey: .flashCard) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subtext = try container.decode(String.self, forKey: .subtext) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + socialTokens = try container.decode(SocialTokens.self, forKey: .socialTokens) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + register = try container.decode(Bool.self, forKey: .register) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobileImage = try container.decode(String.self, forKey: .mobileImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + desktopImage = try container.decode(String.self, forKey: .desktopImage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(display, forKey: .display) + + try? container.encodeIfPresent(lookAndFeel, forKey: .lookAndFeel) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(forgotPassword, forKey: .forgotPassword) + + try? container.encodeIfPresent(login, forKey: .login) + + try? container.encodeIfPresent(skipCaptcha, forKey: .skipCaptcha) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(social, forKey: .social) + + try? container.encodeIfPresent(requiredFields, forKey: .requiredFields) + + try? container.encodeIfPresent(registerRequiredFields, forKey: .registerRequiredFields) + + try? container.encodeIfPresent(skipLogin, forKey: .skipLogin) + + try? container.encodeIfPresent(flashCard, forKey: .flashCard) + + try? container.encodeIfPresent(subtext, forKey: .subtext) + + try? container.encodeIfPresent(socialTokens, forKey: .socialTokens) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(register, forKey: .register) + + try? container.encodeIfPresent(mobileImage, forKey: .mobileImage) + + try? container.encodeIfPresent(desktopImage, forKey: .desktopImage) + } + } + + /* + Model: LookAndFeel + Used By: User + */ + + class LookAndFeel: Codable { + public var cardPosition: String? + + public var backgroundColor: String? + + public enum CodingKeys: String, CodingKey { + case cardPosition = "card_position" + + case backgroundColor = "background_color" + } + + public init(backgroundColor: String?, cardPosition: String?) { + self.cardPosition = cardPosition + + self.backgroundColor = backgroundColor + } + + public func duplicate() -> LookAndFeel { + let dict = self.dictionary! + let copy = LookAndFeel(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + cardPosition = try container.decode(String.self, forKey: .cardPosition) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + backgroundColor = try container.decode(String.self, forKey: .backgroundColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(cardPosition, forKey: .cardPosition) + + try? container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) + } + } + + /* + Model: Login + Used By: User + */ + + class Login: Codable { + public var password: Bool? + + public var otp: Bool? + + public enum CodingKeys: String, CodingKey { + case password + + case otp + } + + public init(otp: Bool?, password: Bool?) { + self.password = password + + self.otp = otp + } + + public func duplicate() -> Login { + let dict = self.dictionary! + let copy = Login(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + password = try container.decode(Bool.self, forKey: .password) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + otp = try container.decode(Bool.self, forKey: .otp) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(password, forKey: .password) + + try? container.encodeIfPresent(otp, forKey: .otp) + } + } + + /* + Model: MetaSchema + Used By: User + */ + + class MetaSchema: Codable { + public var fyndDefault: Bool? + + public enum CodingKeys: String, CodingKey { + case fyndDefault = "fynd_default" + } + + public init(fyndDefault: Bool?) { + self.fyndDefault = fyndDefault + } + + public func duplicate() -> MetaSchema { + let dict = self.dictionary! + let copy = MetaSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + fyndDefault = try container.decode(Bool.self, forKey: .fyndDefault) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(fyndDefault, forKey: .fyndDefault) + } + } + + /* + Model: Social + Used By: User + */ + + class Social: Codable { + public var accountKit: Bool? + + public var facebook: Bool? + + public var google: Bool? + + public var apple: Bool? + + public enum CodingKeys: String, CodingKey { + case accountKit = "account_kit" + + case facebook + + case google + + case apple + } + + public init(accountKit: Bool?, apple: Bool?, facebook: Bool?, google: Bool?) { + self.accountKit = accountKit + + self.facebook = facebook + + self.google = google + + self.apple = apple + } + + public func duplicate() -> Social { + let dict = self.dictionary! + let copy = Social(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + accountKit = try container.decode(Bool.self, forKey: .accountKit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + facebook = try container.decode(Bool.self, forKey: .facebook) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + google = try container.decode(Bool.self, forKey: .google) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + apple = try container.decode(Bool.self, forKey: .apple) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(accountKit, forKey: .accountKit) + + try? container.encodeIfPresent(facebook, forKey: .facebook) + + try? container.encodeIfPresent(google, forKey: .google) + + try? container.encodeIfPresent(apple, forKey: .apple) + } + } + + /* + Model: RequiredFields + Used By: User + */ + + class RequiredFields: Codable { + public var email: PlatformEmail? + + public var mobile: PlatformMobile? + + public enum CodingKeys: String, CodingKey { + case email + + case mobile + } + + public init(email: PlatformEmail?, mobile: PlatformMobile?) { + self.email = email + + self.mobile = mobile + } + + public func duplicate() -> RequiredFields { + let dict = self.dictionary! + let copy = RequiredFields(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(PlatformEmail.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobile = try container.decode(PlatformMobile.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + } + } + + /* + Model: PlatformEmail + Used By: User + */ + + class PlatformEmail: Codable { + public var isRequired: Bool? + + public var level: String? + + public enum CodingKeys: String, CodingKey { + case isRequired = "is_required" + + case level + } + + public init(isRequired: Bool?, level: String?) { + self.isRequired = isRequired + + self.level = level + } + + public func duplicate() -> PlatformEmail { + let dict = self.dictionary! + let copy = PlatformEmail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isRequired = try container.decode(Bool.self, forKey: .isRequired) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + level = try container.decode(String.self, forKey: .level) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isRequired, forKey: .isRequired) + + try? container.encodeIfPresent(level, forKey: .level) + } + } + + /* + Model: PlatformMobile + Used By: User + */ + + class PlatformMobile: Codable { + public var isRequired: Bool? + + public var level: String? + + public enum CodingKeys: String, CodingKey { + case isRequired = "is_required" + + case level + } + + public init(isRequired: Bool?, level: String?) { + self.isRequired = isRequired + + self.level = level + } + + public func duplicate() -> PlatformMobile { + let dict = self.dictionary! + let copy = PlatformMobile(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isRequired = try container.decode(Bool.self, forKey: .isRequired) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + level = try container.decode(String.self, forKey: .level) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isRequired, forKey: .isRequired) + + try? container.encodeIfPresent(level, forKey: .level) + } + } + + /* + Model: RegisterRequiredFields + Used By: User + */ + + class RegisterRequiredFields: Codable { + public var email: RegisterRequiredFieldsEmail? + + public var mobile: RegisterRequiredFieldsMobile? + + public enum CodingKeys: String, CodingKey { + case email + + case mobile + } + + public init(email: RegisterRequiredFieldsEmail?, mobile: RegisterRequiredFieldsMobile?) { + self.email = email + + self.mobile = mobile + } + + public func duplicate() -> RegisterRequiredFields { + let dict = self.dictionary! + let copy = RegisterRequiredFields(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + email = try container.decode(RegisterRequiredFieldsEmail.self, forKey: .email) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobile = try container.decode(RegisterRequiredFieldsMobile.self, forKey: .mobile) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(email, forKey: .email) + + try? container.encodeIfPresent(mobile, forKey: .mobile) + } + } + + /* + Model: RegisterRequiredFieldsEmail + Used By: User + */ + + class RegisterRequiredFieldsEmail: Codable { + public var isRequired: Bool? + + public var level: String? + + public enum CodingKeys: String, CodingKey { + case isRequired = "is_required" + + case level + } + + public init(isRequired: Bool?, level: String?) { + self.isRequired = isRequired + + self.level = level + } + + public func duplicate() -> RegisterRequiredFieldsEmail { + let dict = self.dictionary! + let copy = RegisterRequiredFieldsEmail(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isRequired = try container.decode(Bool.self, forKey: .isRequired) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + level = try container.decode(String.self, forKey: .level) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isRequired, forKey: .isRequired) + + try? container.encodeIfPresent(level, forKey: .level) + } + } + + /* + Model: RegisterRequiredFieldsMobile + Used By: User + */ + + class RegisterRequiredFieldsMobile: Codable { + public var isRequired: Bool? + + public var level: String? + + public enum CodingKeys: String, CodingKey { + case isRequired = "is_required" + + case level + } + + public init(isRequired: Bool?, level: String?) { + self.isRequired = isRequired + + self.level = level + } + + public func duplicate() -> RegisterRequiredFieldsMobile { + let dict = self.dictionary! + let copy = RegisterRequiredFieldsMobile(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + isRequired = try container.decode(Bool.self, forKey: .isRequired) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + level = try container.decode(String.self, forKey: .level) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(isRequired, forKey: .isRequired) + + try? container.encodeIfPresent(level, forKey: .level) + } + } + + /* + Model: FlashCard + Used By: User + */ + + class FlashCard: Codable { + public var text: String? + + public var textColor: String? + + public var backgroundColor: String? + + public enum CodingKeys: String, CodingKey { + case text + + case textColor = "text_color" + + case backgroundColor = "background_color" + } + + public init(backgroundColor: String?, text: String?, textColor: String?) { + self.text = text + + self.textColor = textColor + + self.backgroundColor = backgroundColor + } + + public func duplicate() -> FlashCard { + let dict = self.dictionary! + let copy = FlashCard(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + text = try container.decode(String.self, forKey: .text) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + textColor = try container.decode(String.self, forKey: .textColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + backgroundColor = try container.decode(String.self, forKey: .backgroundColor) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(text, forKey: .text) + + try? container.encodeIfPresent(textColor, forKey: .textColor) + + try? container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) + } + } + + /* + Model: SocialTokens + Used By: User + */ + + class SocialTokens: Codable { + public var facebook: Facebook? + + public var accountKit: Accountkit? + + public var google: Google? + + public enum CodingKeys: String, CodingKey { + case facebook + + case accountKit = "account_kit" + + case google + } + + public init(accountKit: Accountkit?, facebook: Facebook?, google: Google?) { + self.facebook = facebook + + self.accountKit = accountKit + + self.google = google + } + + public func duplicate() -> SocialTokens { + let dict = self.dictionary! + let copy = SocialTokens(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + facebook = try container.decode(Facebook.self, forKey: .facebook) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + accountKit = try container.decode(Accountkit.self, forKey: .accountKit) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + google = try container.decode(Google.self, forKey: .google) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(facebook, forKey: .facebook) + + try? container.encodeIfPresent(accountKit, forKey: .accountKit) + + try? container.encodeIfPresent(google, forKey: .google) + } + } + + /* + Model: Facebook + Used By: User + */ + + class Facebook: Codable { + public var appId: String? + + public enum CodingKeys: String, CodingKey { + case appId = "app_id" + } + + public init(appId: String?) { + self.appId = appId + } + + public func duplicate() -> Facebook { + let dict = self.dictionary! + let copy = Facebook(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appId, forKey: .appId) + } + } + + /* + Model: Accountkit + Used By: User + */ + + class Accountkit: Codable { + public var appId: String? + + public enum CodingKeys: String, CodingKey { + case appId = "app_id" + } + + public init(appId: String?) { + self.appId = appId + } + + public func duplicate() -> Accountkit { + let dict = self.dictionary! + let copy = Accountkit(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appId, forKey: .appId) + } + } + + /* + Model: Google + Used By: User + */ + + class Google: Codable { + public var appId: String? + + public enum CodingKeys: String, CodingKey { + case appId = "app_id" + } + + public init(appId: String?) { + self.appId = appId + } + + public func duplicate() -> Google { + let dict = self.dictionary! + let copy = Google(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + appId = try container.decode(String.self, forKey: .appId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(appId, forKey: .appId) + } + } + + /* + Model: UpdateUserRequestSchema + Used By: User + */ + + class UpdateUserRequestSchema: Codable { + public var firstName: String? + + public var lastName: String? + + public var gender: String? + + public var meta: [String: Any]? + + public enum CodingKeys: String, CodingKey { + case firstName = "first_name" + + case lastName = "last_name" + + case gender + + case meta + } + + public init(firstName: String?, gender: String?, lastName: String?, meta: [String: Any]?) { + self.firstName = firstName + + self.lastName = lastName + + self.gender = gender + + self.meta = meta + } + + public func duplicate() -> UpdateUserRequestSchema { + let dict = self.dictionary! + let copy = UpdateUserRequestSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gender = try container.decode(String.self, forKey: .gender) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(gender, forKey: .gender) + + try? container.encodeIfPresent(meta, forKey: .meta) + } + } + + /* + Model: UserSchema + Used By: User + */ + + class UserSchema: Codable { + public var firstName: String? + + public var meta: [String: Any]? + + public var lastName: String? + + public var phoneNumbers: [PhoneNumber]? + + public var emails: [Email]? + + public var gender: String? + + public var dob: String? + + public var active: Bool? + + public var profilePicUrl: String? + + public var username: String? + + public var accountType: String? + + public var uid: String? + + public var debug: Debug? + + public var hasOldPasswordHash: Bool? + + public var id: String? + + public var createdAt: String? + + public var updatedAt: String? + + public enum CodingKeys: String, CodingKey { + case firstName = "first_name" + + case meta + + case lastName = "last_name" + + case phoneNumbers = "phone_numbers" + + case emails + + case gender + + case dob + + case active + + case profilePicUrl = "profile_pic_url" + + case username + + case accountType = "account_type" + + case uid + + case debug + + case hasOldPasswordHash = "has_old_password_hash" + + case id = "_id" + + case createdAt = "created_at" + + case updatedAt = "updated_at" + } + + public init(accountType: String?, active: Bool?, createdAt: String?, debug: Debug?, dob: String?, emails: [Email]?, firstName: String?, gender: String?, hasOldPasswordHash: Bool?, lastName: String?, meta: [String: Any]?, phoneNumbers: [PhoneNumber]?, profilePicUrl: String?, uid: String?, updatedAt: String?, username: String?, id: String?) { + self.firstName = firstName + + self.meta = meta + + self.lastName = lastName + + self.phoneNumbers = phoneNumbers + + self.emails = emails + + self.gender = gender + + self.dob = dob + + self.active = active + + self.profilePicUrl = profilePicUrl + + self.username = username + + self.accountType = accountType + + self.uid = uid + + self.debug = debug + + self.hasOldPasswordHash = hasOldPasswordHash + + self.id = id + + self.createdAt = createdAt + + self.updatedAt = updatedAt + } + + public func duplicate() -> UserSchema { + let dict = self.dictionary! + let copy = UserSchema(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + firstName = try container.decode(String.self, forKey: .firstName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([String: Any].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + lastName = try container.decode(String.self, forKey: .lastName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phoneNumbers = try container.decode([PhoneNumber].self, forKey: .phoneNumbers) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + emails = try container.decode([Email].self, forKey: .emails) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + gender = try container.decode(String.self, forKey: .gender) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + dob = try container.decode(String.self, forKey: .dob) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + active = try container.decode(Bool.self, forKey: .active) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + profilePicUrl = try container.decode(String.self, forKey: .profilePicUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + username = try container.decode(String.self, forKey: .username) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + accountType = try container.decode(String.self, forKey: .accountType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(String.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + debug = try container.decode(Debug.self, forKey: .debug) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasOldPasswordHash = try container.decode(Bool.self, forKey: .hasOldPasswordHash) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(firstName, forKey: .firstName) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(lastName, forKey: .lastName) + + try? container.encodeIfPresent(phoneNumbers, forKey: .phoneNumbers) + + try? container.encodeIfPresent(emails, forKey: .emails) + + try? container.encodeIfPresent(gender, forKey: .gender) + + try? container.encodeIfPresent(dob, forKey: .dob) + + try? container.encodeIfPresent(active, forKey: .active) + + try? container.encodeIfPresent(profilePicUrl, forKey: .profilePicUrl) + + try? container.encodeIfPresent(username, forKey: .username) + + try? container.encodeIfPresent(accountType, forKey: .accountType) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(debug, forKey: .debug) + + try? container.encodeIfPresent(hasOldPasswordHash, forKey: .hasOldPasswordHash) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + } + } +} diff --git a/Sources/code/platform/models/WebhookPlatformModelClass.swift b/Sources/code/platform/models/WebhookPlatformModelClass.swift new file mode 100644 index 0000000000..a73810ae2b --- /dev/null +++ b/Sources/code/platform/models/WebhookPlatformModelClass.swift @@ -0,0 +1,1296 @@ +import Foundation + +import Foundation +public extension PlatformClient { + /* + Model: EventConfig + Used By: Webhook + */ + + class EventConfig: Codable { + public var id: Int? + + public var eventName: String? + + public var eventType: String? + + public var eventCategory: String? + + public var version: String? + + public var displayName: String? + + public var description: String? + + public var createdOn: String? + + public enum CodingKeys: String, CodingKey { + case id + + case eventName = "event_name" + + case eventType = "event_type" + + case eventCategory = "event_category" + + case version + + case displayName = "display_name" + + case description + + case createdOn = "created_on" + } + + public init(createdOn: String?, description: String?, displayName: String?, eventCategory: String?, eventName: String?, eventType: String?, id: Int?, version: String?) { + self.id = id + + self.eventName = eventName + + self.eventType = eventType + + self.eventCategory = eventCategory + + self.version = version + + self.displayName = displayName + + self.description = description + + self.createdOn = createdOn + } + + public func duplicate() -> EventConfig { + let dict = self.dictionary! + let copy = EventConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventName = try container.decode(String.self, forKey: .eventName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventType = try container.decode(String.self, forKey: .eventType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventCategory = try container.decode(String.self, forKey: .eventCategory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + version = try container.decode(String.self, forKey: .version) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(eventName, forKey: .eventName) + + try? container.encodeIfPresent(eventType, forKey: .eventType) + + try? container.encodeIfPresent(eventCategory, forKey: .eventCategory) + + try? container.encodeIfPresent(version, forKey: .version) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + } + } + + /* + Model: EventConfigList + Used By: Webhook + */ + + class EventConfigList: Codable { + public var items: [EventConfig]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [EventConfig]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> EventConfigList { + let dict = self.dictionary! + let copy = EventConfigList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([EventConfig].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: EventConfigResponse + Used By: Webhook + */ + + class EventConfigResponse: Codable { + public var eventConfigs: [EventConfig]? + + public enum CodingKeys: String, CodingKey { + case eventConfigs = "event_configs" + } + + public init(eventConfigs: [EventConfig]?) { + self.eventConfigs = eventConfigs + } + + public func duplicate() -> EventConfigResponse { + let dict = self.dictionary! + let copy = EventConfigResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + eventConfigs = try container.decode([EventConfig].self, forKey: .eventConfigs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(eventConfigs, forKey: .eventConfigs) + } + } + + /* + Model: SubscriberConfigList + Used By: Webhook + */ + + class SubscriberConfigList: Codable { + public var items: [SubscriberResponse]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [SubscriberResponse]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> SubscriberConfigList { + let dict = self.dictionary! + let copy = SubscriberConfigList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([SubscriberResponse].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: EventProcessedStatus + Used By: Webhook + */ + + class EventProcessedStatus: Codable { + public var id: Int? + + public var subscriberId: String? + + public var attempt: Int? + + public var responseCode: String? + + public var responseMessage: String? + + public var createdOn: String? + + public var processedOn: String? + + public var status: Bool? + + public enum CodingKeys: String, CodingKey { + case id + + case subscriberId = "subscriber_id" + + case attempt + + case responseCode = "response_code" + + case responseMessage = "response_message" + + case createdOn = "created_on" + + case processedOn = "processed_on" + + case status + } + + public init(attempt: Int?, createdOn: String?, id: Int?, processedOn: String?, responseCode: String?, responseMessage: String?, status: Bool?, subscriberId: String?) { + self.id = id + + self.subscriberId = subscriberId + + self.attempt = attempt + + self.responseCode = responseCode + + self.responseMessage = responseMessage + + self.createdOn = createdOn + + self.processedOn = processedOn + + self.status = status + } + + public func duplicate() -> EventProcessedStatus { + let dict = self.dictionary! + let copy = EventProcessedStatus(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subscriberId = try container.decode(String.self, forKey: .subscriberId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attempt = try container.decode(Int.self, forKey: .attempt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + responseCode = try container.decode(String.self, forKey: .responseCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + responseMessage = try container.decode(String.self, forKey: .responseMessage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + processedOn = try container.decode(String.self, forKey: .processedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Bool.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(subscriberId, forKey: .subscriberId) + + try? container.encodeIfPresent(attempt, forKey: .attempt) + + try? container.encodeIfPresent(responseCode, forKey: .responseCode) + + try? container.encodeIfPresent(responseMessage, forKey: .responseMessage) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(processedOn, forKey: .processedOn) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: EventPayload + Used By: Webhook + */ + + class EventPayload: Codable { + public var id: Int? + + public var eventTraceId: String? + + public var messageId: String? + + public var eventName: String? + + public var eventType: String? + + public var version: String? + + public var status: Bool? + + public enum CodingKeys: String, CodingKey { + case id + + case eventTraceId = "event_trace_id" + + case messageId = "message_id" + + case eventName = "event_name" + + case eventType = "event_type" + + case version + + case status + } + + public init(eventName: String?, eventTraceId: String?, eventType: String?, id: Int?, messageId: String?, status: Bool?, version: String?) { + self.id = id + + self.eventTraceId = eventTraceId + + self.messageId = messageId + + self.eventName = eventName + + self.eventType = eventType + + self.version = version + + self.status = status + } + + public func duplicate() -> EventPayload { + let dict = self.dictionary! + let copy = EventPayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventTraceId = try container.decode(String.self, forKey: .eventTraceId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + messageId = try container.decode(String.self, forKey: .messageId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventName = try container.decode(String.self, forKey: .eventName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventType = try container.decode(String.self, forKey: .eventType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + version = try container.decode(String.self, forKey: .version) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Bool.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(eventTraceId, forKey: .eventTraceId) + + try? container.encodeIfPresent(messageId, forKey: .messageId) + + try? container.encodeIfPresent(eventName, forKey: .eventName) + + try? container.encodeIfPresent(eventType, forKey: .eventType) + + try? container.encodeIfPresent(version, forKey: .version) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: SubscriberConfig + Used By: Webhook + */ + + class SubscriberConfig: Codable { + public var id: Int? + + public var name: String? + + public var webhookUrl: String? + + public var association: Association? + + public var customHeaders: [String: Any]? + + public var status: SubscriberStatus? + + public var emailId: String? + + public var authMeta: AuthMeta? + + public var eventId: [Int]? + + public enum CodingKeys: String, CodingKey { + case id + + case name + + case webhookUrl = "webhook_url" + + case association + + case customHeaders = "custom_headers" + + case status + + case emailId = "email_id" + + case authMeta = "auth_meta" + + case eventId = "event_id" + } + + public init(association: Association?, authMeta: AuthMeta?, customHeaders: [String: Any]?, emailId: String?, eventId: [Int]?, id: Int?, name: String?, status: SubscriberStatus?, webhookUrl: String?) { + self.id = id + + self.name = name + + self.webhookUrl = webhookUrl + + self.association = association + + self.customHeaders = customHeaders + + self.status = status + + self.emailId = emailId + + self.authMeta = authMeta + + self.eventId = eventId + } + + public func duplicate() -> SubscriberConfig { + let dict = self.dictionary! + let copy = SubscriberConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + webhookUrl = try container.decode(String.self, forKey: .webhookUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + association = try container.decode(Association.self, forKey: .association) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customHeaders = try container.decode([String: Any].self, forKey: .customHeaders) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(SubscriberStatus.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + emailId = try container.decode(String.self, forKey: .emailId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + authMeta = try container.decode(AuthMeta.self, forKey: .authMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventId = try container.decode([Int].self, forKey: .eventId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(webhookUrl, forKey: .webhookUrl) + + try? container.encodeIfPresent(association, forKey: .association) + + try? container.encodeIfPresent(customHeaders, forKey: .customHeaders) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(emailId, forKey: .emailId) + + try? container.encodeIfPresent(authMeta, forKey: .authMeta) + + try? container.encodeIfPresent(eventId, forKey: .eventId) + } + } + + /* + Model: SubscriberResponse + Used By: Webhook + */ + + class SubscriberResponse: Codable { + public var id: Int? + + public var name: String? + + public var webhookUrl: String? + + public var association: Association? + + public var customHeaders: [String: Any]? + + public var emailId: String? + + public var status: SubscriberStatus? + + public var authMeta: AuthMeta? + + public var createdOn: String? + + public var updatedOn: String? + + public var eventConfigs: [EventConfig]? + + public enum CodingKeys: String, CodingKey { + case id + + case name + + case webhookUrl = "webhook_url" + + case association + + case customHeaders = "custom_headers" + + case emailId = "email_id" + + case status + + case authMeta = "auth_meta" + + case createdOn = "created_on" + + case updatedOn = "updated_on" + + case eventConfigs = "event_configs" + } + + public init(association: Association?, authMeta: AuthMeta?, createdOn: String?, customHeaders: [String: Any]?, emailId: String?, eventConfigs: [EventConfig]?, id: Int?, name: String?, status: SubscriberStatus?, updatedOn: String?, webhookUrl: String?) { + self.id = id + + self.name = name + + self.webhookUrl = webhookUrl + + self.association = association + + self.customHeaders = customHeaders + + self.emailId = emailId + + self.status = status + + self.authMeta = authMeta + + self.createdOn = createdOn + + self.updatedOn = updatedOn + + self.eventConfigs = eventConfigs + } + + public func duplicate() -> SubscriberResponse { + let dict = self.dictionary! + let copy = SubscriberResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + webhookUrl = try container.decode(String.self, forKey: .webhookUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + association = try container.decode(Association.self, forKey: .association) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customHeaders = try container.decode([String: Any].self, forKey: .customHeaders) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + emailId = try container.decode(String.self, forKey: .emailId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(SubscriberStatus.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + authMeta = try container.decode(AuthMeta.self, forKey: .authMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedOn = try container.decode(String.self, forKey: .updatedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventConfigs = try container.decode([EventConfig].self, forKey: .eventConfigs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(webhookUrl, forKey: .webhookUrl) + + try? container.encodeIfPresent(association, forKey: .association) + + try? container.encodeIfPresent(customHeaders, forKey: .customHeaders) + + try? container.encodeIfPresent(emailId, forKey: .emailId) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(authMeta, forKey: .authMeta) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(updatedOn, forKey: .updatedOn) + + try? container.encodeIfPresent(eventConfigs, forKey: .eventConfigs) + } + } + + /* + Model: SubscriberEvent + Used By: Webhook + */ + + class SubscriberEvent: Codable { + public var id: Int? + + public var subscriberId: Int? + + public var eventId: Int? + + public var createdDate: String? + + public enum CodingKeys: String, CodingKey { + case id + + case subscriberId = "subscriber_id" + + case eventId = "event_id" + + case createdDate = "created_date" + } + + public init(createdDate: String?, eventId: Int?, id: Int?, subscriberId: Int?) { + self.id = id + + self.subscriberId = subscriberId + + self.eventId = eventId + + self.createdDate = createdDate + } + + public func duplicate() -> SubscriberEvent { + let dict = self.dictionary! + let copy = SubscriberEvent(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subscriberId = try container.decode(Int.self, forKey: .subscriberId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventId = try container.decode(Int.self, forKey: .eventId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdDate = try container.decode(String.self, forKey: .createdDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(subscriberId, forKey: .subscriberId) + + try? container.encodeIfPresent(eventId, forKey: .eventId) + + try? container.encodeIfPresent(createdDate, forKey: .createdDate) + } + } + + /* + Model: AuthMeta + Used By: Webhook + */ + + class AuthMeta: Codable { + public var type: String? + + public var secret: String? + + public enum CodingKeys: String, CodingKey { + case type + + case secret + } + + public init(secret: String?, type: String?) { + self.type = type + + self.secret = secret + } + + public func duplicate() -> AuthMeta { + let dict = self.dictionary! + let copy = AuthMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + secret = try container.decode(String.self, forKey: .secret) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(secret, forKey: .secret) + } + } + + /* + Model: Association + Used By: Webhook + */ + + class Association: Codable { + public var companyId: Int? + + public var applicationId: [String]? + + public var extensionId: String? + + public var criteria: String? + + public enum CodingKeys: String, CodingKey { + case companyId = "company_id" + + case applicationId = "application_id" + + case extensionId = "extension_id" + + case criteria + } + + public init(applicationId: [String]?, companyId: Int?, criteria: String?, extensionId: String?) { + self.companyId = companyId + + self.applicationId = applicationId + + self.extensionId = extensionId + + self.criteria = criteria + } + + public func duplicate() -> Association { + let dict = self.dictionary! + let copy = Association(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + applicationId = try container.decode([String].self, forKey: .applicationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + extensionId = try container.decode(String.self, forKey: .extensionId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + criteria = try container.decode(String.self, forKey: .criteria) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + + try? container.encodeIfPresent(extensionId, forKey: .extensionId) + + try? container.encodeIfPresent(criteria, forKey: .criteria) + } + } + + /* + Model: EventConfigBase + Used By: Webhook + */ + + class EventConfigBase: Codable { + public var eventName: String? + + public var eventType: String? + + public var eventCategory: String? + + public var version: String? + + public enum CodingKeys: String, CodingKey { + case eventName = "event_name" + + case eventType = "event_type" + + case eventCategory = "event_category" + + case version + } + + public init(eventCategory: String?, eventName: String?, eventType: String?, version: String?) { + self.eventName = eventName + + self.eventType = eventType + + self.eventCategory = eventCategory + + self.version = version + } + + public func duplicate() -> EventConfigBase { + let dict = self.dictionary! + let copy = EventConfigBase(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + eventName = try container.decode(String.self, forKey: .eventName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventType = try container.decode(String.self, forKey: .eventType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventCategory = try container.decode(String.self, forKey: .eventCategory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + version = try container.decode(String.self, forKey: .version) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(eventName, forKey: .eventName) + + try? container.encodeIfPresent(eventType, forKey: .eventType) + + try? container.encodeIfPresent(eventCategory, forKey: .eventCategory) + + try? container.encodeIfPresent(version, forKey: .version) + } + } +} diff --git a/Sources/code/public/PublicAPIClient.swift b/Sources/code/public/PublicAPIClient.swift new file mode 100644 index 0000000000..ab90eceb65 --- /dev/null +++ b/Sources/code/public/PublicAPIClient.swift @@ -0,0 +1,34 @@ +import Foundation +class PublicAPIClient { + static func execute(config: PublicConfig, + method: String, + url: String, + query: [String: Any]?, + extraHeaders: [(key: String, value: String)] = [], + body: [String: Any]?, + responseType: String = "application/json", + onResponse: @escaping OnResponse) + { + var headers = [ + (key: "x-fp-sdk-version", value: "0.1.15") + ] + headers.append(contentsOf: extraHeaders) + headers.append(contentsOf: config.extraHeaders) + if let userAgent = config.userAgent { + headers.append((key: "User-Agent", value: userAgent)) + } + if let language = config.language { + headers.append((key: "Accept-Language", value: language)) + } + if let currency = config.currency { + headers.append((key: "x-currency-code", value: currency)) + } + AlmofireHelper.request(config.domain.appendAsPath(url), + query: query, + parameters: body, + type: method, + headers: headers, + responseType: responseType, + onResponse: onResponse) + } +} diff --git a/Sources/code/public/PublicClient.swift b/Sources/code/public/PublicClient.swift new file mode 100644 index 0000000000..87af3aa0b7 --- /dev/null +++ b/Sources/code/public/PublicClient.swift @@ -0,0 +1,207 @@ + +import Foundation + +public class PublicClient { + public let configuration: Configuration + + public let webhook: Webhook + + public init(config: PublicConfig) { + configuration = Configuration(config: config) + + webhook = Webhook(config: config) + } + + public class Configuration { + var config: PublicConfig + + init(config: PublicConfig) { + self.config = config + } + + /** + * + * Summary: Search Application + * Description: Provide application name or domain url + **/ + public func searchApplication( + authorization: String?, + query: String?, + + onResponse: @escaping (_ response: ApplicationResponse?, _ error: FDKError?) -> Void + ) { + var xQuery: [String: Any] = [:] + + if let value = query { + xQuery["query"] = value + } + + var xHeaders: [(key: String, value: String)] = [] + + if let value = authorization { + xHeaders.append((key: "authorization", value: value)) + } + + PublicAPIClient.execute( + config: config, + method: "get", + url: "/service/common/configuration/v1.0/application/search-application", + query: xQuery, + extraHeaders: xHeaders, + body: nil, + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(ApplicationResponse.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Get countries, states, cities + * Description: + **/ + public func getLocations( + locationType: String?, + id: String?, + + onResponse: @escaping (_ response: Locations?, _ error: FDKError?) -> Void + ) { + var xQuery: [String: Any] = [:] + + if let value = locationType { + xQuery["location_type"] = value + } + + if let value = id { + xQuery["id"] = value + } + + PublicAPIClient.execute( + config: config, + method: "get", + url: "/service/common/configuration/v1.0/location", + query: xQuery, + extraHeaders: [], + body: nil, + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(Locations.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + } + + public class Webhook { + var config: PublicConfig + + init(config: PublicConfig) { + self.config = config + } + + /** + * + * Summary: Get All Webhook Events + * Description: Get All Webhook Events + **/ + public func fetchAllWebhookEvents( + onResponse: @escaping (_ response: EventConfigResponse?, _ error: FDKError?) -> Void + ) { + PublicAPIClient.execute( + config: config, + method: "get", + url: "/service/common/webhook/v1.0/events", + query: nil, + extraHeaders: [], + body: nil, + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(EventConfigResponse.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + + /** + * + * Summary: Send webhook event name, type, version, category in request body to get complete details of event from server + * Description: Get Webhook Event Details for provided events + **/ + public func queryWebhookEventDetails( + body: [EventConfigBase], + onResponse: @escaping (_ response: EventConfigResponse?, _ error: FDKError?) -> Void + ) { + PublicAPIClient.execute( + config: config, + method: "post", + url: "/service/common/webhook/v1.0/events/query-event-details", + query: nil, + extraHeaders: [], + body: body.dictionary, + responseType: "application/json", + onResponse: { responseData, error, responseCode in + if let _ = error, let data = responseData { + var err = Utility.decode(FDKError.self, from: data) + if err?.status == nil { + err?.status = responseCode + } + onResponse(nil, err) + } else if let data = responseData { + let response = Utility.decode(EventConfigResponse.self, from: data) + + onResponse(response, nil) + } else { + let userInfo: [String: Any] = [NSLocalizedDescriptionKey: NSLocalizedString("Unidentified", value: "Please try after sometime", comment: ""), + NSLocalizedFailureReasonErrorKey: NSLocalizedString("Unidentified", value: "Something went wrong", comment: "")] + let err = FDKError(message: "Something went wrong", status: 502, code: "Unidentified", exception: nil, info: "Please try after sometime", requestID: nil, stackTrace: nil, meta: userInfo) + onResponse(nil, err) + } + } + ) + } + } +} diff --git a/Sources/code/public/PublicConfig.swift b/Sources/code/public/PublicConfig.swift new file mode 100644 index 0000000000..5f5ee4632f --- /dev/null +++ b/Sources/code/public/PublicConfig.swift @@ -0,0 +1,16 @@ +import Foundation +public class PublicConfig { + var domain: String + var userAgent: String? + var currency: String? + var language: String? + var extraHeaders: [(key: String, value: String)] = [] + + public init?(domain: String = "https://api.fynd.com", userAgent: String? = nil, language: String? = "en-IN", currency: String? = "INR", extraHeaders: [(key: String, value: String)] = []) { + self.domain = domain + self.userAgent = userAgent + self.language = language + self.currency = currency + self.extraHeaders = extraHeaders + } +} diff --git a/Sources/code/public/PublicEnums.swift b/Sources/code/public/PublicEnums.swift new file mode 100644 index 0000000000..c8e3c8c6ad --- /dev/null +++ b/Sources/code/public/PublicEnums.swift @@ -0,0 +1,15 @@ + +import Foundation +public extension PublicClient { + /* + Enum: SubscriberStatus + Used By: Webhook + */ + enum SubscriberStatus: String, Codable { + case active + + case inactive + + case blocked + } +} diff --git a/Sources/code/public/PublicModels.swift b/Sources/code/public/PublicModels.swift new file mode 100644 index 0000000000..01d8cef4ac --- /dev/null +++ b/Sources/code/public/PublicModels.swift @@ -0,0 +1,2916 @@ +import Foundation +public extension PublicClient { + /* + Model: ApplicationResponse + Used By: Configuration + */ + class ApplicationResponse: Codable { + public var application: Application? + + public enum CodingKeys: String, CodingKey { + case application + } + + public init(application: Application?) { + self.application = application + } + + public func duplicate() -> ApplicationResponse { + let dict = self.dictionary! + let copy = ApplicationResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + application = try container.decode(Application.self, forKey: .application) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(application, forKey: .application) + } + } + + /* + Model: Currency + Used By: Configuration + */ + class Currency: Codable { + public var id: String? + + public var isActive: Bool? + + public var name: String? + + public var code: String? + + public var createdAt: String? + + public var updatedAt: String? + + public var decimalDigits: Int? + + public var symbol: String? + + public enum CodingKeys: String, CodingKey { + case id = "_id" + + case isActive = "is_active" + + case name + + case code + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case decimalDigits = "decimal_digits" + + case symbol + } + + public init(code: String?, createdAt: String?, decimalDigits: Int?, isActive: Bool?, name: String?, symbol: String?, updatedAt: String?, id: String?) { + self.id = id + + self.isActive = isActive + + self.name = name + + self.code = code + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.decimalDigits = decimalDigits + + self.symbol = symbol + } + + public func duplicate() -> Currency { + let dict = self.dictionary! + let copy = Currency(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + decimalDigits = try container.decode(Int.self, forKey: .decimalDigits) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + symbol = try container.decode(String.self, forKey: .symbol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(code, forKey: .code) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(decimalDigits, forKey: .decimalDigits) + + try? container.encodeIfPresent(symbol, forKey: .symbol) + } + } + + /* + Model: Domain + Used By: Configuration + */ + class Domain: Codable { + public var verified: Bool? + + public var isPrimary: Bool? + + public var isShortlink: Bool? + + public var id: String? + + public var name: String? + + public enum CodingKeys: String, CodingKey { + case verified + + case isPrimary = "is_primary" + + case isShortlink = "is_shortlink" + + case id = "_id" + + case name + } + + public init(isPrimary: Bool?, isShortlink: Bool?, name: String?, verified: Bool?, id: String?) { + self.verified = verified + + self.isPrimary = isPrimary + + self.isShortlink = isShortlink + + self.id = id + + self.name = name + } + + public func duplicate() -> Domain { + let dict = self.dictionary! + let copy = Domain(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + verified = try container.decode(Bool.self, forKey: .verified) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isPrimary = try container.decode(Bool.self, forKey: .isPrimary) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isShortlink = try container.decode(Bool.self, forKey: .isShortlink) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(verified, forKey: .verified) + + try? container.encodeIfPresent(isPrimary, forKey: .isPrimary) + + try? container.encodeIfPresent(isShortlink, forKey: .isShortlink) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + } + } + + /* + Model: ApplicationWebsite + Used By: Configuration + */ + class ApplicationWebsite: Codable { + public var enabled: Bool? + + public var basepath: String? + + public enum CodingKeys: String, CodingKey { + case enabled + + case basepath + } + + public init(basepath: String?, enabled: Bool?) { + self.enabled = enabled + + self.basepath = basepath + } + + public func duplicate() -> ApplicationWebsite { + let dict = self.dictionary! + let copy = ApplicationWebsite(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + basepath = try container.decode(String.self, forKey: .basepath) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + + try? container.encodeIfPresent(basepath, forKey: .basepath) + } + } + + /* + Model: ApplicationCors + Used By: Configuration + */ + class ApplicationCors: Codable { + public var domains: [String]? + + public enum CodingKeys: String, CodingKey { + case domains + } + + public init(domains: [String]?) { + self.domains = domains + } + + public func duplicate() -> ApplicationCors { + let dict = self.dictionary! + let copy = ApplicationCors(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + domains = try container.decode([String].self, forKey: .domains) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(domains, forKey: .domains) + } + } + + /* + Model: ApplicationAuth + Used By: Configuration + */ + class ApplicationAuth: Codable { + public var enabled: Bool? + + public enum CodingKeys: String, CodingKey { + case enabled + } + + public init(enabled: Bool?) { + self.enabled = enabled + } + + public func duplicate() -> ApplicationAuth { + let dict = self.dictionary! + let copy = ApplicationAuth(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + enabled = try container.decode(Bool.self, forKey: .enabled) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(enabled, forKey: .enabled) + } + } + + /* + Model: ApplicationRedirections + Used By: Configuration + */ + class ApplicationRedirections: Codable { + public var redirectFrom: String? + + public var redirectTo: String? + + public var type: String? + + public enum CodingKeys: String, CodingKey { + case redirectFrom = "redirect_from" + + case redirectTo = "redirect_to" + + case type + } + + public init(redirectFrom: String?, redirectTo: String?, type: String?) { + self.redirectFrom = redirectFrom + + self.redirectTo = redirectTo + + self.type = type + } + + public func duplicate() -> ApplicationRedirections { + let dict = self.dictionary! + let copy = ApplicationRedirections(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + redirectFrom = try container.decode(String.self, forKey: .redirectFrom) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + redirectTo = try container.decode(String.self, forKey: .redirectTo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(redirectFrom, forKey: .redirectFrom) + + try? container.encodeIfPresent(redirectTo, forKey: .redirectTo) + + try? container.encodeIfPresent(type, forKey: .type) + } + } + + /* + Model: ApplicationMeta + Used By: Configuration + */ + class ApplicationMeta: Codable { + public var name: String? + + public var value: String? + + public enum CodingKeys: String, CodingKey { + case name + + case value + } + + public init(name: String?, value: String?) { + self.name = name + + self.value = value + } + + public func duplicate() -> ApplicationMeta { + let dict = self.dictionary! + let copy = ApplicationMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + value = try container.decode(String.self, forKey: .value) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(value, forKey: .value) + } + } + + /* + Model: SecureUrl + Used By: Configuration + */ + class SecureUrl: Codable { + public var secureUrl: String? + + public enum CodingKeys: String, CodingKey { + case secureUrl = "secure_url" + } + + public init(secureUrl: String?) { + self.secureUrl = secureUrl + } + + public func duplicate() -> SecureUrl { + let dict = self.dictionary! + let copy = SecureUrl(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + secureUrl = try container.decode(String.self, forKey: .secureUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(secureUrl, forKey: .secureUrl) + } + } + + /* + Model: Application + Used By: Configuration + */ + class Application: Codable { + public var website: ApplicationWebsite? + + public var cors: ApplicationCors? + + public var auth: ApplicationAuth? + + public var description: String? + + public var channelType: String? + + public var cacheTtl: Int? + + public var isInternal: Bool? + + public var isActive: Bool? + + public var id: String? + + public var name: String? + + public var owner: String? + + public var companyId: Int? + + public var token: String? + + public var redirections: [ApplicationRedirections]? + + public var meta: [ApplicationMeta]? + + public var createdAt: String? + + public var updatedAt: String? + + public var v: Int? + + public var banner: SecureUrl? + + public var logo: SecureUrl? + + public var favicon: SecureUrl? + + public var domains: [Domain]? + + public var appType: String? + + public var mobileLogo: SecureUrl? + + public var domain: Domain? + + public enum CodingKeys: String, CodingKey { + case website + + case cors + + case auth + + case description + + case channelType = "channel_type" + + case cacheTtl = "cache_ttl" + + case isInternal = "is_internal" + + case isActive = "is_active" + + case id = "_id" + + case name + + case owner + + case companyId = "company_id" + + case token + + case redirections + + case meta + + case createdAt = "created_at" + + case updatedAt = "updated_at" + + case v = "__v" + + case banner + + case logo + + case favicon + + case domains + + case appType = "app_type" + + case mobileLogo = "mobile_logo" + + case domain + } + + public init(appType: String?, auth: ApplicationAuth?, banner: SecureUrl?, cacheTtl: Int?, channelType: String?, companyId: Int?, cors: ApplicationCors?, createdAt: String?, description: String?, domain: Domain?, domains: [Domain]?, favicon: SecureUrl?, isActive: Bool?, isInternal: Bool?, logo: SecureUrl?, meta: [ApplicationMeta]?, mobileLogo: SecureUrl?, name: String?, owner: String?, redirections: [ApplicationRedirections]?, token: String?, updatedAt: String?, website: ApplicationWebsite?, id: String?, v: Int?) { + self.website = website + + self.cors = cors + + self.auth = auth + + self.description = description + + self.channelType = channelType + + self.cacheTtl = cacheTtl + + self.isInternal = isInternal + + self.isActive = isActive + + self.id = id + + self.name = name + + self.owner = owner + + self.companyId = companyId + + self.token = token + + self.redirections = redirections + + self.meta = meta + + self.createdAt = createdAt + + self.updatedAt = updatedAt + + self.v = v + + self.banner = banner + + self.logo = logo + + self.favicon = favicon + + self.domains = domains + + self.appType = appType + + self.mobileLogo = mobileLogo + + self.domain = domain + } + + public func duplicate() -> Application { + let dict = self.dictionary! + let copy = Application(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + website = try container.decode(ApplicationWebsite.self, forKey: .website) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cors = try container.decode(ApplicationCors.self, forKey: .cors) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + auth = try container.decode(ApplicationAuth.self, forKey: .auth) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + channelType = try container.decode(String.self, forKey: .channelType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + cacheTtl = try container.decode(Int.self, forKey: .cacheTtl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isInternal = try container.decode(Bool.self, forKey: .isInternal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + isActive = try container.decode(Bool.self, forKey: .isActive) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + owner = try container.decode(String.self, forKey: .owner) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + token = try container.decode(String.self, forKey: .token) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + redirections = try container.decode([ApplicationRedirections].self, forKey: .redirections) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + meta = try container.decode([ApplicationMeta].self, forKey: .meta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdAt = try container.decode(String.self, forKey: .createdAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedAt = try container.decode(String.self, forKey: .updatedAt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + banner = try container.decode(SecureUrl.self, forKey: .banner) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + logo = try container.decode(SecureUrl.self, forKey: .logo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + favicon = try container.decode(SecureUrl.self, forKey: .favicon) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + domains = try container.decode([Domain].self, forKey: .domains) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + appType = try container.decode(String.self, forKey: .appType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + mobileLogo = try container.decode(SecureUrl.self, forKey: .mobileLogo) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + domain = try container.decode(Domain.self, forKey: .domain) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(website, forKey: .website) + + try? container.encodeIfPresent(cors, forKey: .cors) + + try? container.encodeIfPresent(auth, forKey: .auth) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(channelType, forKey: .channelType) + + try? container.encodeIfPresent(cacheTtl, forKey: .cacheTtl) + + try? container.encodeIfPresent(isInternal, forKey: .isInternal) + + try? container.encodeIfPresent(isActive, forKey: .isActive) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(owner, forKey: .owner) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(token, forKey: .token) + + try? container.encodeIfPresent(redirections, forKey: .redirections) + + try? container.encodeIfPresent(meta, forKey: .meta) + + try? container.encodeIfPresent(createdAt, forKey: .createdAt) + + try? container.encodeIfPresent(updatedAt, forKey: .updatedAt) + + try? container.encodeIfPresent(v, forKey: .v) + + try? container.encodeIfPresent(banner, forKey: .banner) + + try? container.encodeIfPresent(logo, forKey: .logo) + + try? container.encodeIfPresent(favicon, forKey: .favicon) + + try? container.encodeIfPresent(domains, forKey: .domains) + + try? container.encodeIfPresent(appType, forKey: .appType) + + try? container.encodeIfPresent(mobileLogo, forKey: .mobileLogo) + + try? container.encodeIfPresent(domain, forKey: .domain) + } + } + + /* + Model: NotFound + Used By: Configuration + */ + class NotFound: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> NotFound { + let dict = self.dictionary! + let copy = NotFound(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: BadRequest + Used By: Configuration + */ + class BadRequest: Codable { + public var message: String? + + public enum CodingKeys: String, CodingKey { + case message + } + + public init(message: String?) { + self.message = message + } + + public func duplicate() -> BadRequest { + let dict = self.dictionary! + let copy = BadRequest(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + message = try container.decode(String.self, forKey: .message) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(message, forKey: .message) + } + } + + /* + Model: Page + Used By: Configuration + */ + class Page: Codable { + public var type: String + + public var size: Int? + + public var current: Int? + + public var hasNext: Bool? + + public var itemTotal: Int? + + public var nextId: String? + + public var hasPrevious: Bool? + + public enum CodingKeys: String, CodingKey { + case type + + case size + + case current + + case hasNext = "has_next" + + case itemTotal = "item_total" + + case nextId = "next_id" + + case hasPrevious = "has_previous" + } + + public init(current: Int?, hasNext: Bool?, hasPrevious: Bool?, itemTotal: Int?, nextId: String?, size: Int?, type: String) { + self.type = type + + self.size = size + + self.current = current + + self.hasNext = hasNext + + self.itemTotal = itemTotal + + self.nextId = nextId + + self.hasPrevious = hasPrevious + } + + public func duplicate() -> Page { + let dict = self.dictionary! + let copy = Page(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + type = try container.decode(String.self, forKey: .type) + + do { + size = try container.decode(Int.self, forKey: .size) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + current = try container.decode(Int.self, forKey: .current) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasNext = try container.decode(Bool.self, forKey: .hasNext) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + itemTotal = try container.decode(Int.self, forKey: .itemTotal) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + nextId = try container.decode(String.self, forKey: .nextId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + hasPrevious = try container.decode(Bool.self, forKey: .hasPrevious) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(size, forKey: .size) + + try? container.encodeIfPresent(current, forKey: .current) + + try? container.encodeIfPresent(hasNext, forKey: .hasNext) + + try? container.encodeIfPresent(itemTotal, forKey: .itemTotal) + + try? container.encodeIfPresent(nextId, forKey: .nextId) + + try? container.encodeIfPresent(hasPrevious, forKey: .hasPrevious) + } + } + + /* + Model: LocationDefaultLanguage + Used By: Configuration + */ + class LocationDefaultLanguage: Codable { + public var name: String? + + public var code: String? + + public enum CodingKeys: String, CodingKey { + case name + + case code + } + + public init(code: String?, name: String?) { + self.name = name + + self.code = code + } + + public func duplicate() -> LocationDefaultLanguage { + let dict = self.dictionary! + let copy = LocationDefaultLanguage(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: LocationDefaultCurrency + Used By: Configuration + */ + class LocationDefaultCurrency: Codable { + public var name: String? + + public var symbol: String? + + public var code: String? + + public enum CodingKeys: String, CodingKey { + case name + + case symbol + + case code + } + + public init(code: String?, name: String?, symbol: String?) { + self.name = name + + self.symbol = symbol + + self.code = code + } + + public func duplicate() -> LocationDefaultCurrency { + let dict = self.dictionary! + let copy = LocationDefaultCurrency(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + symbol = try container.decode(String.self, forKey: .symbol) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + code = try container.decode(String.self, forKey: .code) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(symbol, forKey: .symbol) + + try? container.encodeIfPresent(code, forKey: .code) + } + } + + /* + Model: LocationCountry + Used By: Configuration + */ + class LocationCountry: Codable { + public var capital: String? + + public var currency: String? + + public var iso2: String? + + public var iso3: String? + + public var name: String? + + public var parent: String? + + public var phoneCode: String? + + public var type: String? + + public var uid: Int? + + public var v: Int? + + public var id: String? + + public var defaultCurrency: LocationDefaultCurrency? + + public var defaultLanguage: LocationDefaultLanguage? + + public enum CodingKeys: String, CodingKey { + case capital + + case currency + + case iso2 + + case iso3 + + case name + + case parent + + case phoneCode = "phone_code" + + case type + + case uid + + case v = "__v" + + case id = "_id" + + case defaultCurrency = "default_currency" + + case defaultLanguage = "default_language" + } + + public init(capital: String?, currency: String?, defaultCurrency: LocationDefaultCurrency?, defaultLanguage: LocationDefaultLanguage?, iso2: String?, iso3: String?, name: String?, parent: String?, phoneCode: String?, type: String?, uid: Int?, id: String?, v: Int?) { + self.capital = capital + + self.currency = currency + + self.iso2 = iso2 + + self.iso3 = iso3 + + self.name = name + + self.parent = parent + + self.phoneCode = phoneCode + + self.type = type + + self.uid = uid + + self.v = v + + self.id = id + + self.defaultCurrency = defaultCurrency + + self.defaultLanguage = defaultLanguage + } + + public func duplicate() -> LocationCountry { + let dict = self.dictionary! + let copy = LocationCountry(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + capital = try container.decode(String.self, forKey: .capital) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + currency = try container.decode(String.self, forKey: .currency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + iso2 = try container.decode(String.self, forKey: .iso2) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + iso3 = try container.decode(String.self, forKey: .iso3) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + parent = try container.decode(String.self, forKey: .parent) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + phoneCode = try container.decode(String.self, forKey: .phoneCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + uid = try container.decode(Int.self, forKey: .uid) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + v = try container.decode(Int.self, forKey: .v) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + id = try container.decode(String.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + defaultCurrency = try container.decode(LocationDefaultCurrency.self, forKey: .defaultCurrency) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + defaultLanguage = try container.decode(LocationDefaultLanguage.self, forKey: .defaultLanguage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(capital, forKey: .capital) + + try? container.encodeIfPresent(currency, forKey: .currency) + + try? container.encodeIfPresent(iso2, forKey: .iso2) + + try? container.encodeIfPresent(iso3, forKey: .iso3) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(parent, forKey: .parent) + + try? container.encodeIfPresent(phoneCode, forKey: .phoneCode) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(uid, forKey: .uid) + + try? container.encodeIfPresent(v, forKey: .v) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(defaultCurrency, forKey: .defaultCurrency) + + try? container.encodeIfPresent(defaultLanguage, forKey: .defaultLanguage) + } + } + + /* + Model: Locations + Used By: Configuration + */ + class Locations: Codable { + public var items: [[String: Any]]? + + public enum CodingKeys: String, CodingKey { + case items + } + + public init(items: [[String: Any]]?) { + self.items = items + } + + public func duplicate() -> Locations { + let dict = self.dictionary! + let copy = Locations(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([[String: Any]].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + } + } + + /* + Model: EventConfig + Used By: Webhook + */ + class EventConfig: Codable { + public var id: Int? + + public var eventName: String? + + public var eventType: String? + + public var eventCategory: String? + + public var version: String? + + public var displayName: String? + + public var description: String? + + public var createdOn: String? + + public enum CodingKeys: String, CodingKey { + case id + + case eventName = "event_name" + + case eventType = "event_type" + + case eventCategory = "event_category" + + case version + + case displayName = "display_name" + + case description + + case createdOn = "created_on" + } + + public init(createdOn: String?, description: String?, displayName: String?, eventCategory: String?, eventName: String?, eventType: String?, id: Int?, version: String?) { + self.id = id + + self.eventName = eventName + + self.eventType = eventType + + self.eventCategory = eventCategory + + self.version = version + + self.displayName = displayName + + self.description = description + + self.createdOn = createdOn + } + + public func duplicate() -> EventConfig { + let dict = self.dictionary! + let copy = EventConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventName = try container.decode(String.self, forKey: .eventName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventType = try container.decode(String.self, forKey: .eventType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventCategory = try container.decode(String.self, forKey: .eventCategory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + version = try container.decode(String.self, forKey: .version) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + displayName = try container.decode(String.self, forKey: .displayName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + description = try container.decode(String.self, forKey: .description) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(eventName, forKey: .eventName) + + try? container.encodeIfPresent(eventType, forKey: .eventType) + + try? container.encodeIfPresent(eventCategory, forKey: .eventCategory) + + try? container.encodeIfPresent(version, forKey: .version) + + try? container.encodeIfPresent(displayName, forKey: .displayName) + + try? container.encodeIfPresent(description, forKey: .description) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + } + } + + /* + Model: EventConfigList + Used By: Webhook + */ + class EventConfigList: Codable { + public var items: [EventConfig]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [EventConfig]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> EventConfigList { + let dict = self.dictionary! + let copy = EventConfigList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([EventConfig].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: EventConfigResponse + Used By: Webhook + */ + class EventConfigResponse: Codable { + public var eventConfigs: [EventConfig]? + + public enum CodingKeys: String, CodingKey { + case eventConfigs = "event_configs" + } + + public init(eventConfigs: [EventConfig]?) { + self.eventConfigs = eventConfigs + } + + public func duplicate() -> EventConfigResponse { + let dict = self.dictionary! + let copy = EventConfigResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + eventConfigs = try container.decode([EventConfig].self, forKey: .eventConfigs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(eventConfigs, forKey: .eventConfigs) + } + } + + /* + Model: SubscriberConfigList + Used By: Webhook + */ + class SubscriberConfigList: Codable { + public var items: [SubscriberResponse]? + + public var page: Page? + + public enum CodingKeys: String, CodingKey { + case items + + case page + } + + public init(items: [SubscriberResponse]?, page: Page?) { + self.items = items + + self.page = page + } + + public func duplicate() -> SubscriberConfigList { + let dict = self.dictionary! + let copy = SubscriberConfigList(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + items = try container.decode([SubscriberResponse].self, forKey: .items) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + page = try container.decode(Page.self, forKey: .page) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(items, forKey: .items) + + try? container.encodeIfPresent(page, forKey: .page) + } + } + + /* + Model: EventProcessedStatus + Used By: Webhook + */ + class EventProcessedStatus: Codable { + public var id: Int? + + public var subscriberId: String? + + public var attempt: Int? + + public var responseCode: String? + + public var responseMessage: String? + + public var createdOn: String? + + public var processedOn: String? + + public var status: Bool? + + public enum CodingKeys: String, CodingKey { + case id + + case subscriberId = "subscriber_id" + + case attempt + + case responseCode = "response_code" + + case responseMessage = "response_message" + + case createdOn = "created_on" + + case processedOn = "processed_on" + + case status + } + + public init(attempt: Int?, createdOn: String?, id: Int?, processedOn: String?, responseCode: String?, responseMessage: String?, status: Bool?, subscriberId: String?) { + self.id = id + + self.subscriberId = subscriberId + + self.attempt = attempt + + self.responseCode = responseCode + + self.responseMessage = responseMessage + + self.createdOn = createdOn + + self.processedOn = processedOn + + self.status = status + } + + public func duplicate() -> EventProcessedStatus { + let dict = self.dictionary! + let copy = EventProcessedStatus(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subscriberId = try container.decode(String.self, forKey: .subscriberId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + attempt = try container.decode(Int.self, forKey: .attempt) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + responseCode = try container.decode(String.self, forKey: .responseCode) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + responseMessage = try container.decode(String.self, forKey: .responseMessage) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + processedOn = try container.decode(String.self, forKey: .processedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Bool.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(subscriberId, forKey: .subscriberId) + + try? container.encodeIfPresent(attempt, forKey: .attempt) + + try? container.encodeIfPresent(responseCode, forKey: .responseCode) + + try? container.encodeIfPresent(responseMessage, forKey: .responseMessage) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(processedOn, forKey: .processedOn) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: EventPayload + Used By: Webhook + */ + class EventPayload: Codable { + public var id: Int? + + public var eventTraceId: String? + + public var messageId: String? + + public var eventName: String? + + public var eventType: String? + + public var version: String? + + public var status: Bool? + + public enum CodingKeys: String, CodingKey { + case id + + case eventTraceId = "event_trace_id" + + case messageId = "message_id" + + case eventName = "event_name" + + case eventType = "event_type" + + case version + + case status + } + + public init(eventName: String?, eventTraceId: String?, eventType: String?, id: Int?, messageId: String?, status: Bool?, version: String?) { + self.id = id + + self.eventTraceId = eventTraceId + + self.messageId = messageId + + self.eventName = eventName + + self.eventType = eventType + + self.version = version + + self.status = status + } + + public func duplicate() -> EventPayload { + let dict = self.dictionary! + let copy = EventPayload(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventTraceId = try container.decode(String.self, forKey: .eventTraceId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + messageId = try container.decode(String.self, forKey: .messageId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventName = try container.decode(String.self, forKey: .eventName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventType = try container.decode(String.self, forKey: .eventType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + version = try container.decode(String.self, forKey: .version) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(Bool.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(eventTraceId, forKey: .eventTraceId) + + try? container.encodeIfPresent(messageId, forKey: .messageId) + + try? container.encodeIfPresent(eventName, forKey: .eventName) + + try? container.encodeIfPresent(eventType, forKey: .eventType) + + try? container.encodeIfPresent(version, forKey: .version) + + try? container.encodeIfPresent(status, forKey: .status) + } + } + + /* + Model: SubscriberConfig + Used By: Webhook + */ + class SubscriberConfig: Codable { + public var id: Int? + + public var name: String? + + public var webhookUrl: String? + + public var association: Association? + + public var customHeaders: [String: Any]? + + public var status: SubscriberStatus? + + public var emailId: String? + + public var authMeta: AuthMeta? + + public var eventId: [Int]? + + public enum CodingKeys: String, CodingKey { + case id + + case name + + case webhookUrl = "webhook_url" + + case association + + case customHeaders = "custom_headers" + + case status + + case emailId = "email_id" + + case authMeta = "auth_meta" + + case eventId = "event_id" + } + + public init(association: Association?, authMeta: AuthMeta?, customHeaders: [String: Any]?, emailId: String?, eventId: [Int]?, id: Int?, name: String?, status: SubscriberStatus?, webhookUrl: String?) { + self.id = id + + self.name = name + + self.webhookUrl = webhookUrl + + self.association = association + + self.customHeaders = customHeaders + + self.status = status + + self.emailId = emailId + + self.authMeta = authMeta + + self.eventId = eventId + } + + public func duplicate() -> SubscriberConfig { + let dict = self.dictionary! + let copy = SubscriberConfig(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + webhookUrl = try container.decode(String.self, forKey: .webhookUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + association = try container.decode(Association.self, forKey: .association) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customHeaders = try container.decode([String: Any].self, forKey: .customHeaders) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(SubscriberStatus.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + emailId = try container.decode(String.self, forKey: .emailId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + authMeta = try container.decode(AuthMeta.self, forKey: .authMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventId = try container.decode([Int].self, forKey: .eventId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(webhookUrl, forKey: .webhookUrl) + + try? container.encodeIfPresent(association, forKey: .association) + + try? container.encodeIfPresent(customHeaders, forKey: .customHeaders) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(emailId, forKey: .emailId) + + try? container.encodeIfPresent(authMeta, forKey: .authMeta) + + try? container.encodeIfPresent(eventId, forKey: .eventId) + } + } + + /* + Model: SubscriberResponse + Used By: Webhook + */ + class SubscriberResponse: Codable { + public var id: Int? + + public var name: String? + + public var webhookUrl: String? + + public var association: Association? + + public var customHeaders: [String: Any]? + + public var emailId: String? + + public var status: SubscriberStatus? + + public var authMeta: AuthMeta? + + public var createdOn: String? + + public var updatedOn: String? + + public var eventConfigs: [EventConfig]? + + public enum CodingKeys: String, CodingKey { + case id + + case name + + case webhookUrl = "webhook_url" + + case association + + case customHeaders = "custom_headers" + + case emailId = "email_id" + + case status + + case authMeta = "auth_meta" + + case createdOn = "created_on" + + case updatedOn = "updated_on" + + case eventConfigs = "event_configs" + } + + public init(association: Association?, authMeta: AuthMeta?, createdOn: String?, customHeaders: [String: Any]?, emailId: String?, eventConfigs: [EventConfig]?, id: Int?, name: String?, status: SubscriberStatus?, updatedOn: String?, webhookUrl: String?) { + self.id = id + + self.name = name + + self.webhookUrl = webhookUrl + + self.association = association + + self.customHeaders = customHeaders + + self.emailId = emailId + + self.status = status + + self.authMeta = authMeta + + self.createdOn = createdOn + + self.updatedOn = updatedOn + + self.eventConfigs = eventConfigs + } + + public func duplicate() -> SubscriberResponse { + let dict = self.dictionary! + let copy = SubscriberResponse(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + name = try container.decode(String.self, forKey: .name) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + webhookUrl = try container.decode(String.self, forKey: .webhookUrl) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + association = try container.decode(Association.self, forKey: .association) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + customHeaders = try container.decode([String: Any].self, forKey: .customHeaders) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + emailId = try container.decode(String.self, forKey: .emailId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + status = try container.decode(SubscriberStatus.self, forKey: .status) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + authMeta = try container.decode(AuthMeta.self, forKey: .authMeta) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdOn = try container.decode(String.self, forKey: .createdOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + updatedOn = try container.decode(String.self, forKey: .updatedOn) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventConfigs = try container.decode([EventConfig].self, forKey: .eventConfigs) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(name, forKey: .name) + + try? container.encodeIfPresent(webhookUrl, forKey: .webhookUrl) + + try? container.encodeIfPresent(association, forKey: .association) + + try? container.encodeIfPresent(customHeaders, forKey: .customHeaders) + + try? container.encodeIfPresent(emailId, forKey: .emailId) + + try? container.encodeIfPresent(status, forKey: .status) + + try? container.encodeIfPresent(authMeta, forKey: .authMeta) + + try? container.encodeIfPresent(createdOn, forKey: .createdOn) + + try? container.encodeIfPresent(updatedOn, forKey: .updatedOn) + + try? container.encodeIfPresent(eventConfigs, forKey: .eventConfigs) + } + } + + /* + Model: SubscriberEvent + Used By: Webhook + */ + class SubscriberEvent: Codable { + public var id: Int? + + public var subscriberId: Int? + + public var eventId: Int? + + public var createdDate: String? + + public enum CodingKeys: String, CodingKey { + case id + + case subscriberId = "subscriber_id" + + case eventId = "event_id" + + case createdDate = "created_date" + } + + public init(createdDate: String?, eventId: Int?, id: Int?, subscriberId: Int?) { + self.id = id + + self.subscriberId = subscriberId + + self.eventId = eventId + + self.createdDate = createdDate + } + + public func duplicate() -> SubscriberEvent { + let dict = self.dictionary! + let copy = SubscriberEvent(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + id = try container.decode(Int.self, forKey: .id) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + subscriberId = try container.decode(Int.self, forKey: .subscriberId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventId = try container.decode(Int.self, forKey: .eventId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + createdDate = try container.decode(String.self, forKey: .createdDate) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(id, forKey: .id) + + try? container.encodeIfPresent(subscriberId, forKey: .subscriberId) + + try? container.encodeIfPresent(eventId, forKey: .eventId) + + try? container.encodeIfPresent(createdDate, forKey: .createdDate) + } + } + + /* + Model: AuthMeta + Used By: Webhook + */ + class AuthMeta: Codable { + public var type: String? + + public var secret: String? + + public enum CodingKeys: String, CodingKey { + case type + + case secret + } + + public init(secret: String?, type: String?) { + self.type = type + + self.secret = secret + } + + public func duplicate() -> AuthMeta { + let dict = self.dictionary! + let copy = AuthMeta(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + type = try container.decode(String.self, forKey: .type) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + secret = try container.decode(String.self, forKey: .secret) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(type, forKey: .type) + + try? container.encodeIfPresent(secret, forKey: .secret) + } + } + + /* + Model: Association + Used By: Webhook + */ + class Association: Codable { + public var companyId: Int? + + public var applicationId: [String]? + + public var extensionId: String? + + public var criteria: String? + + public enum CodingKeys: String, CodingKey { + case companyId = "company_id" + + case applicationId = "application_id" + + case extensionId = "extension_id" + + case criteria + } + + public init(applicationId: [String]?, companyId: Int?, criteria: String?, extensionId: String?) { + self.companyId = companyId + + self.applicationId = applicationId + + self.extensionId = extensionId + + self.criteria = criteria + } + + public func duplicate() -> Association { + let dict = self.dictionary! + let copy = Association(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + companyId = try container.decode(Int.self, forKey: .companyId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + applicationId = try container.decode([String].self, forKey: .applicationId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + extensionId = try container.decode(String.self, forKey: .extensionId) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + criteria = try container.decode(String.self, forKey: .criteria) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(companyId, forKey: .companyId) + + try? container.encodeIfPresent(applicationId, forKey: .applicationId) + + try? container.encodeIfPresent(extensionId, forKey: .extensionId) + + try? container.encodeIfPresent(criteria, forKey: .criteria) + } + } + + /* + Model: EventConfigBase + Used By: Webhook + */ + class EventConfigBase: Codable { + public var eventName: String? + + public var eventType: String? + + public var eventCategory: String? + + public var version: String? + + public enum CodingKeys: String, CodingKey { + case eventName = "event_name" + + case eventType = "event_type" + + case eventCategory = "event_category" + + case version + } + + public init(eventCategory: String?, eventName: String?, eventType: String?, version: String?) { + self.eventName = eventName + + self.eventType = eventType + + self.eventCategory = eventCategory + + self.version = version + } + + public func duplicate() -> EventConfigBase { + let dict = self.dictionary! + let copy = EventConfigBase(dictionary: dict)! + return copy + } + + required public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + do { + eventName = try container.decode(String.self, forKey: .eventName) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventType = try container.decode(String.self, forKey: .eventType) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + eventCategory = try container.decode(String.self, forKey: .eventCategory) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + + do { + version = try container.decode(String.self, forKey: .version) + + } catch DecodingError.typeMismatch(let type, let context) { + print("Type '\(type)' mismatch:", context.debugDescription) + print("codingPath:", context.codingPath) + } catch {} + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + + try? container.encodeIfPresent(eventName, forKey: .eventName) + + try? container.encodeIfPresent(eventType, forKey: .eventType) + + try? container.encodeIfPresent(eventCategory, forKey: .eventCategory) + + try? container.encodeIfPresent(version, forKey: .version) + } + } +} diff --git a/Tests/Lead.swift b/Tests/Lead.swift index bb24d935a2..5b53b85423 100644 --- a/Tests/Lead.swift +++ b/Tests/Lead.swift @@ -1,5 +1,5 @@ -import XCTest @testable import FDKClient +import XCTest final class LeadTestCase: XCTestCase { func testPDP() { @@ -7,12 +7,13 @@ final class LeadTestCase: XCTestCase { guard let config = ApplicationConfig( applicationId: "000000000000000000000001", - applicationToken: "9502d710-5a22-11e9-a001-57d85417c280") else { - return + applicationToken: "9502d710-5a22-11e9-a001-57d85417c280" + ) else { + return } let applicationClient = ApplicationClient(config: config) - applicationClient.catalog.getProductDetailBySlug(slug: "w-off-white-printed-regular-kurta-5") { (product, error) in + applicationClient.catalog.getProductDetailBySlug(slug: "w-off-white-printed-regular-kurta-5") { product, error in if let product = product { XCTAssertEqual(product.slug, "w-off-white-printed-regular-kurta-5") print("Product Slug: " + product.slug) @@ -20,7 +21,7 @@ final class LeadTestCase: XCTestCase { XCTAssertTrue(false) print("Error: " + error.message) } - + expectation.fulfill() } wait(for: [expectation], timeout: 10.0) diff --git a/documentation/APPLICATION.md b/documentation/APPLICATION.md deleted file mode 100644 index 41ec783af3..0000000000 --- a/documentation/APPLICATION.md +++ /dev/null @@ -1,40052 +0,0 @@ - - - - -# FDK Application Front API Documentaion - - -* [Catalog](#Catalog) - Catalog API's allows you to access list of products, prices, seller details, similar features, variants and many more useful features. -* [Cart](#Cart) - Cart APIs -* [Common](#Common) - Application configuration apis -* [Lead](#Lead) - Handles communication between Staff and Users -* [Theme](#Theme) - Responsible for themes -* [User](#User) - Authentication Service -* [Content](#Content) - Content System -* [Communication](#Communication) - Manages email, sms, push notifications sent to users -* [Share](#Share) - Short link and QR Code -* [FileStorage](#FileStorage) - File Storage -* [Configuration](#Configuration) - Application configuration apis -* [Payment](#Payment) - Collect payment through many payment gateway i.e Stripe, Razorpay, Juspay etc.into Fynd or Self account -* [Order](#Order) - Handles Platform websites OMS -* [Rewards](#Rewards) - Earn and redeem reward points -* [Feedback](#Feedback) - User Reviews and Rating System -* [PosCart](#PosCart) - Cart APIs -* [Logistic](#Logistic) - Handles Platform websites OMS - ----- - -### Classes and Methods - - -* ## [Catalog](#Catalog) - * Methods - * [getProductDetailBySlug](#getproductdetailbyslug) - * [getProductSizesBySlug](#getproductsizesbyslug) - * [getProductPriceBySlug](#getproductpricebyslug) - * [getProductSellersBySlug](#getproductsellersbyslug) - * [getProductComparisonBySlugs](#getproductcomparisonbyslugs) - * [getSimilarComparisonProductBySlug](#getsimilarcomparisonproductbyslug) - * [getComparedFrequentlyProductBySlug](#getcomparedfrequentlyproductbyslug) - * [getProductSimilarByIdentifier](#getproductsimilarbyidentifier) - * [getProductVariantsBySlug](#getproductvariantsbyslug) - * [getProductStockByIds](#getproductstockbyids) - * [getProductStockForTimeByIds](#getproductstockfortimebyids) - * [getProducts](#getproducts) - * [getBrands](#getbrands) - * [getBrandDetailBySlug](#getbranddetailbyslug) - * [getCategories](#getcategories) - * [getCategoryDetailBySlug](#getcategorydetailbyslug) - * [getHomeProducts](#gethomeproducts) - * [getDepartments](#getdepartments) - * [getSearchResults](#getsearchresults) - * [getCollections](#getcollections) - * [getCollectionItemsBySlug](#getcollectionitemsbyslug) - * [getCollectionDetailBySlug](#getcollectiondetailbyslug) - * [getFollowedListing](#getfollowedlisting) - * [followById](#followbyid) - * [unfollowById](#unfollowbyid) - * [getFollowerCountById](#getfollowercountbyid) - * [getFollowIds](#getfollowids) - * [getStores](#getstores) - - -* ## [Cart](#Cart) - * Methods - * [getCart](#getcart) - * [getCartLastModified](#getcartlastmodified) - * [addItems](#additems) - * [updateCart](#updatecart) - * [getItemCount](#getitemcount) - * [getCoupons](#getcoupons) - * [applyCoupon](#applycoupon) - * [removeCoupon](#removecoupon) - * [getBulkDiscountOffers](#getbulkdiscountoffers) - * [applyRewardPoints](#applyrewardpoints) - * [getAddresses](#getaddresses) - * [addAddress](#addaddress) - * [getAddressById](#getaddressbyid) - * [updateAddress](#updateaddress) - * [removeAddress](#removeaddress) - * [selectAddress](#selectaddress) - * [selectPaymentMode](#selectpaymentmode) - * [validateCouponForPayment](#validatecouponforpayment) - * [getShipments](#getshipments) - * [checkoutCart](#checkoutcart) - * [updateCartMeta](#updatecartmeta) - * [getCartShareLink](#getcartsharelink) - * [getCartSharedItems](#getcartshareditems) - * [updateCartWithSharedItems](#updatecartwithshareditems) - - -* ## [Common](#Common) - * Methods - * [getLocations](#getlocations) - - -* ## [Lead](#Lead) - * Methods - * [getTicket](#getticket) - * [createHistory](#createhistory) - * [createTicket](#createticket) - * [getCustomForm](#getcustomform) - * [submitCustomForm](#submitcustomform) - * [getParticipantsInsideVideoRoom](#getparticipantsinsidevideoroom) - * [getTokenForVideoRoom](#gettokenforvideoroom) - - -* ## [Theme](#Theme) - * Methods - * [getAllPages](#getallpages) - * [getPage](#getpage) - * [getAppliedTheme](#getappliedtheme) - * [getThemeForPreview](#getthemeforpreview) - - -* ## [User](#User) - * Methods - * [loginWithFacebook](#loginwithfacebook) - * [loginWithGoogle](#loginwithgoogle) - * [loginWithGoogleAndroid](#loginwithgoogleandroid) - * [loginWithGoogleIOS](#loginwithgoogleios) - * [loginWithOTP](#loginwithotp) - * [loginWithEmailAndPassword](#loginwithemailandpassword) - * [sendResetPasswordEmail](#sendresetpasswordemail) - * [forgotPassword](#forgotpassword) - * [sendResetToken](#sendresettoken) - * [loginWithToken](#loginwithtoken) - * [registerWithForm](#registerwithform) - * [verifyEmail](#verifyemail) - * [verifyMobile](#verifymobile) - * [hasPassword](#haspassword) - * [updatePassword](#updatepassword) - * [logout](#logout) - * [sendOTPOnMobile](#sendotponmobile) - * [verifyMobileOTP](#verifymobileotp) - * [sendOTPOnEmail](#sendotponemail) - * [verifyEmailOTP](#verifyemailotp) - * [getLoggedInUser](#getloggedinuser) - * [getListOfActiveSessions](#getlistofactivesessions) - * [getPlatformConfig](#getplatformconfig) - * [updateProfile](#updateprofile) - * [addMobileNumber](#addmobilenumber) - * [deleteMobileNumber](#deletemobilenumber) - * [setMobileNumberAsPrimary](#setmobilenumberasprimary) - * [sendVerificationLinkToMobile](#sendverificationlinktomobile) - * [addEmail](#addemail) - * [deleteEmail](#deleteemail) - * [setEmailAsPrimary](#setemailasprimary) - * [sendVerificationLinkToEmail](#sendverificationlinktoemail) - - -* ## [Content](#Content) - * Methods - * [getAnnouncements](#getannouncements) - * [getBlog](#getblog) - * [getBlogs](#getblogs) - * [getFaqs](#getfaqs) - * [getFaqCategories](#getfaqcategories) - * [getFaqBySlug](#getfaqbyslug) - * [getFaqCategoryBySlug](#getfaqcategorybyslug) - * [getFaqsByCategorySlug](#getfaqsbycategoryslug) - * [getLandingPage](#getlandingpage) - * [getLegalInformation](#getlegalinformation) - * [getNavigations](#getnavigations) - * [getPage](#getpage) - * [getPages](#getpages) - * [getSEOConfiguration](#getseoconfiguration) - * [getSlideshows](#getslideshows) - * [getSlideshow](#getslideshow) - * [getSupportInformation](#getsupportinformation) - * [getTags](#gettags) - - -* ## [Communication](#Communication) - * Methods - * [getCommunicationConsent](#getcommunicationconsent) - * [upsertCommunicationConsent](#upsertcommunicationconsent) - * [upsertAppPushtoken](#upsertapppushtoken) - - -* ## [Share](#Share) - * Methods - * [getApplicationQRCode](#getapplicationqrcode) - * [getProductQRCodeBySlug](#getproductqrcodebyslug) - * [getCollectionQRCodeBySlug](#getcollectionqrcodebyslug) - * [getUrlQRCode](#geturlqrcode) - * [createShortLink](#createshortlink) - * [getShortLinkByHash](#getshortlinkbyhash) - * [getOriginalShortLinkByHash](#getoriginalshortlinkbyhash) - - -* ## [FileStorage](#FileStorage) - * Methods - * [startUpload](#startupload) - * [completeUpload](#completeupload) - - -* ## [Configuration](#Configuration) - * Methods - * [getApplication](#getapplication) - * [getOwnerInfo](#getownerinfo) - * [getBasicDetails](#getbasicdetails) - * [getIntegrationTokens](#getintegrationtokens) - * [getOrderingStores](#getorderingstores) - * [getStoreDetailById](#getstoredetailbyid) - * [getFeatures](#getfeatures) - * [getContactInfo](#getcontactinfo) - * [getCurrencies](#getcurrencies) - * [getCurrencyById](#getcurrencybyid) - * [getAppCurrencies](#getappcurrencies) - * [getLanguages](#getlanguages) - * [getOrderingStoreCookie](#getorderingstorecookie) - * [removeOrderingStoreCookie](#removeorderingstorecookie) - * [getAppStaffs](#getappstaffs) - - -* ## [Payment](#Payment) - * Methods - * [getAggregatorsConfig](#getaggregatorsconfig) - * [attachCardToCustomer](#attachcardtocustomer) - * [getActiveCardAggregator](#getactivecardaggregator) - * [getActiveUserCards](#getactiveusercards) - * [deleteUserCard](#deleteusercard) - * [verifyCustomerForPayment](#verifycustomerforpayment) - * [verifyAndChargePayment](#verifyandchargepayment) - * [initialisePayment](#initialisepayment) - * [checkAndUpdatePaymentStatus](#checkandupdatepaymentstatus) - * [getPaymentModeRoutes](#getpaymentmoderoutes) - * [getPosPaymentModeRoutes](#getpospaymentmoderoutes) - * [getRupifiBannerDetails](#getrupifibannerdetails) - * [getActiveRefundTransferModes](#getactiverefundtransfermodes) - * [enableOrDisableRefundTransferMode](#enableordisablerefundtransfermode) - * [getUserBeneficiariesDetail](#getuserbeneficiariesdetail) - * [verifyIfscCode](#verifyifsccode) - * [getOrderBeneficiariesDetail](#getorderbeneficiariesdetail) - * [verifyOtpAndAddBeneficiaryForBank](#verifyotpandaddbeneficiaryforbank) - * [addBeneficiaryDetails](#addbeneficiarydetails) - * [addRefundBankAccountUsingOTP](#addrefundbankaccountusingotp) - * [verifyOtpAndAddBeneficiaryForWallet](#verifyotpandaddbeneficiaryforwallet) - * [updateDefaultBeneficiary](#updatedefaultbeneficiary) - - -* ## [Order](#Order) - * Methods - * [getOrders](#getorders) - * [getOrderById](#getorderbyid) - * [getShipmentById](#getshipmentbyid) - * [getShipmentReasons](#getshipmentreasons) - * [updateShipmentStatus](#updateshipmentstatus) - * [trackShipment](#trackshipment) - * [getPosOrderById](#getposorderbyid) - * [getCustomerDetailsByShipmentId](#getcustomerdetailsbyshipmentid) - * [sendOtpToShipmentCustomer](#sendotptoshipmentcustomer) - * [verifyOtpShipmentCustomer](#verifyotpshipmentcustomer) - - -* ## [Rewards](#Rewards) - * Methods - * [getPointsOnProduct](#getpointsonproduct) - * [getOfferByName](#getofferbyname) - * [getOrderDiscount](#getorderdiscount) - * [getUserPoints](#getuserpoints) - * [getUserPointsHistory](#getuserpointshistory) - * [getUserReferralDetails](#getuserreferraldetails) - * [redeemReferralCode](#redeemreferralcode) - - -* ## [Feedback](#Feedback) - * Methods - * [createAbuseReport](#createabusereport) - * [updateAbuseReport](#updateabusereport) - * [getAbuseReports](#getabusereports) - * [getAttributes](#getattributes) - * [createAttribute](#createattribute) - * [getAttribute](#getattribute) - * [updateAttribute](#updateattribute) - * [createComment](#createcomment) - * [updateComment](#updatecomment) - * [getComments](#getcomments) - * [checkEligibility](#checkeligibility) - * [deleteMedia](#deletemedia) - * [createMedia](#createmedia) - * [updateMedia](#updatemedia) - * [getMedias](#getmedias) - * [getReviewSummaries](#getreviewsummaries) - * [createReview](#createreview) - * [updateReview](#updatereview) - * [getReviews](#getreviews) - * [getTemplates](#gettemplates) - * [createQuestion](#createquestion) - * [updateQuestion](#updatequestion) - * [getQuestionAndAnswers](#getquestionandanswers) - * [getVotes](#getvotes) - * [createVote](#createvote) - * [updateVote](#updatevote) - - -* ## [PosCart](#PosCart) - * Methods - * [getCart](#getcart) - * [getCartLastModified](#getcartlastmodified) - * [addItems](#additems) - * [updateCart](#updatecart) - * [getItemCount](#getitemcount) - * [getCoupons](#getcoupons) - * [applyCoupon](#applycoupon) - * [removeCoupon](#removecoupon) - * [getBulkDiscountOffers](#getbulkdiscountoffers) - * [applyRewardPoints](#applyrewardpoints) - * [getAddresses](#getaddresses) - * [addAddress](#addaddress) - * [getAddressById](#getaddressbyid) - * [updateAddress](#updateaddress) - * [removeAddress](#removeaddress) - * [selectAddress](#selectaddress) - * [selectPaymentMode](#selectpaymentmode) - * [validateCouponForPayment](#validatecouponforpayment) - * [getShipments](#getshipments) - * [updateShipments](#updateshipments) - * [checkoutCart](#checkoutcart) - * [updateCartMeta](#updatecartmeta) - * [getAvailableDeliveryModes](#getavailabledeliverymodes) - * [getStoreAddressByUid](#getstoreaddressbyuid) - * [getCartShareLink](#getcartsharelink) - * [getCartSharedItems](#getcartshareditems) - * [updateCartWithSharedItems](#updatecartwithshareditems) - - -* ## [Logistic](#Logistic) - * Methods - * [getTatProduct](#gettatproduct) - * [getPincodeCity](#getpincodecity) - - - ---- - - - -## Catalog - - -#### getProductDetailBySlug -Get a product - - - -```swift -catalog.getProductDetailBySlug(slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | - - - -Use this API to retrieve a product by its slug value. - -*Returned Response:* - - - - -[ProductDetail](#ProductDetail) - -Success. Returns a Product object. Check the example shown below or refer `ProductDetail` for more details. - - - - -
-  Example: - -```json -{ - "type": "product", - "grouped_attributes": [ - { - "title": "Alexander Sawyer", - "details": [ - { - "key": "Kimberly Davidson", - "type": "text", - "value": "DarkGrey" - }, - { - "key": "Kimberly Mcdaniel", - "type": "text", - "value": "Men,Women" - }, - { - "key": "Monica Hampton", - "type": "text", - "value": "Neoprene" - }, - { - "key": "John Mendoza", - "type": "text", - "value": "100 g" - } - ] - } - ], - "medias": [ - { - "type": "image", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1309_LGLAPTOPSLEEVE5/1_1564735832806.jpg" - } - ], - "brand": { - "name": "Barry, Jennings and Larson", - "uid": 1, - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "uid": 1, - "slug": "benchmark-collaborative-paradigms", - "attributes": { - "color_hex": "808080", - "weight": 100, - "product_type": "LaptopBags", - "gender": [ - "Men", - "Women" - ], - "material": "Neoprene", - "style_note": "Shape up your overall appeal with this stunning laptop bag. The amazing storage and great design will let you carry your laptop in style!", - "item_code": "LGLAPTOPSLEEVE5", - "occasion": "Casual", - "primary_color": "Grey", - "primary_material": "Others", - "variant": "LGLAPTOPSLEEVE5", - "color": "DarkGrey", - "product_details": "This is a Unisex Product.", - "primary_color_hex": "808080", - "brand": "Barry, Jennings and Larson" - }, - "name": "benchmark collaborative paradigms", - "has_variant": true, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "tryouts": [], - "rating": 2.7, - "rating_count": 2, - "image_nature": "standard", - "tags": [ - "Digital" - ], - "teaser_tag": {}, - "no_of_boxes": 1, - "custom_order": {}, - "color": "808080", - "similars": [ - "brand" - ], - "_custom_json": {} -} -``` -
- - - - - - - - - ---- - - -#### getProductSizesBySlug -Get the sizes of a product - - - -```swift -catalog.getProductSizesBySlug(slug: slug, storeId: storeId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | -| storeId | Int? | no | The ID of the store that is selling the product, e.g. 1,2,3. | - - - -A product can have multiple sizes. Use this API to fetch all the available sizes of a product. - -*Returned Response:* - - - - -[ProductSizes](#ProductSizes) - -Success. Returns a ProductSize object. Check the example shown below or refer `ProductSizes` for more details. - - - - -
-  Example: - -```json -{ - "sellable": true, - "sizes": [ - { - "display": "13", - "value": "13", - "quantity": 10, - "is_available": true - } - ], - "discount": "", - "stores": { - "count": 1 - }, - "size_chart": {}, - "price": { - "marked": { - "min": 66.5, - "max": 66.5, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 66.5, - "max": 66.5, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "tags": [ - "Digital" - ] -} -``` -
- - - - - - - - - ---- - - -#### getProductPriceBySlug -Get the price of a product size at a PIN Code - - - -```swift -catalog.getProductPriceBySlug(slug: slug, size: size, pincode: pincode, storeId: storeId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | -| size | String | yes | A string indicating the size of the product, e.g. S, M, XL. You can get slug value from the endpoint /service/application/catalog/v1.0/products/sizes | -| pincode | String | yes | The PIN Code of the area near which the selling locations should be searched, e.g. 400059 | -| storeId | Int? | no | The ID of the store that is selling the product, e.g. 1,2,3. | - - - -Prices may vary for different sizes of a product. Use this API to retrieve the price of a product size at all the selling locations near to a PIN Code. - -*Returned Response:* - - - - -[ProductSizePriceResponse](#ProductSizePriceResponse) - -Success. Returns a ProductSizePrice object. Check the example shown below or refer `ProductSizePriceResponse` for more details. - - - - -
-  Example: - -```json -{ - "price_per_piece": { - "effective": 66.5, - "marked": 66.5, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "price": { - "effective": 399, - "marked": 399, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "quantity": 5, - "pincode": 400603, - "article_id": "1", - "long_lat": [ - 72.9159784, - 19.0990231 - ], - "item_type": "set", - "discount": "", - "article_assignment": { - "level": "multi-companies", - "strategy": "optimal" - }, - "seller": { - "uid": 1, - "name": "Natalie Norman" - }, - "store": { - "uid": 1, - "name": "Wayne Lamb", - "count": 2 - }, - "strategy_wise_listing": [ - { - "distance": 11, - "quantity": 5, - "tat": 2592000, - "pincode": 400603 - }, - { - "distance": 11, - "quantity": 5, - "tat": 2592000, - "pincode": 400603 - } - ], - "set": { - "size_distribution": { - "sizes": [ - { - "size": "5", - "pieces": 1 - }, - { - "size": "7", - "pieces": 1 - }, - { - "size": "8", - "pieces": 2 - }, - { - "size": "9", - "pieces": 1 - }, - { - "size": "10", - "pieces": 1 - } - ] - }, - "quantity": 6 - } -} -``` -
- - - - - - - - - ---- - - -#### getProductSellersBySlug -Get the sellers of a product size at a PIN Code - - - -```swift -catalog.getProductSellersBySlug(slug: slug, size: size, pincode: pincode, strategy: strategy, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | -| size | String | yes | A string indicating the size of the product, e.g. S, M, XL. You can get slug value from the endpoint /service/application/catalog/v1.0/products/sizes | -| pincode | String | yes | The 6-digit PIN Code of the area near which the selling locations should be searched, e.g. 400059 | -| strategy | String? | no | Sort stores on the basis of strategy. eg, fast-delivery, low-price, optimal. | -| pageNo | Int? | no | The page number to navigate through the given set of results. | -| pageSize | Int? | no | The number of items to retrieve in each page. | - - - -A product of a particular size may be sold by multiple sellers. Use this API to fetch the sellers having the stock of a particular size at a given PIN Code. - -*Returned Response:* - - - - -[ProductSizeSellersResponse](#ProductSizeSellersResponse) - -Success. Returns a ProductSizeSeller object. Check the example shown below or refer `ProductSizeSellersResponse` for more details. - - - - -
-  Example: - -```json -{ - "items": [ - { - "price_per_piece": { - "effective": 66.5, - "marked": 66.5, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "price": { - "effective": 399, - "marked": 399, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "quantity": 5, - "pincode": 400603, - "article_id": "1", - "discount": "", - "article_assignment": { - "level": "single-company", - "strategy": "optimal" - }, - "seller": { - "uid": 1, - "name": "Natalie Norman" - }, - "store": { - "uid": 1, - "name": "Wayne Lamb" - } - }, - { - "price_per_piece": { - "effective": 66.5, - "marked": 66.5, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "price": { - "effective": 399, - "marked": 399, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "quantity": 5, - "pincode": 400603, - "article_id": "2", - "discount": "", - "article_assignment": { - "level": "single-company", - "strategy": "optimal" - }, - "seller": { - "uid": 1, - "name": "Natalie Norman" - }, - "store": { - "uid": 1, - "name": "Wayne Lamb" - } - } - ], - "page": { - "current": 1, - "total": 1, - "has_previous": false, - "has_next": false, - "item_total": 2, - "type": "number" - }, - "sort_on": [ - { - "default": true, - "is_selected": true, - "name": "Best price & fast delivery", - "value": "optimal" - }, - { - "default": false, - "is_selected": false, - "name": "Best Price", - "value": "low-price" - }, - { - "default": false, - "is_selected": false, - "name": "Fastest Delivery", - "value": "fast-delivery" - } - ] -} -``` -
- - - - - - - - - ---- - - -#### getProductComparisonBySlugs -Compare products - - - -```swift -catalog.getProductComparisonBySlugs(slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | [String] | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/. | - - - -Use this API to compare the features of products belonging to the same category. Note that at least one slug is mandatory in the request query. - -*Returned Response:* - - - - -[ProductsComparisonResponse](#ProductsComparisonResponse) - -Success. Returns an array of objects containing the attributes for comparision. Check the example shown below or refer `ProductsComparisonResponse` for more details. - - - - -
-  Example: - -```json -{ - "attributes_metadata": [ - { - "title": "Alexander Sawyer", - "details": [ - { - "key": "color", - "display": "Kimberly Davidson", - "description": "" - }, - { - "key": "gender", - "display": "Kimberly Mcdaniel", - "description": "" - }, - { - "key": "material", - "display": "Monica Hampton", - "description": "" - }, - { - "key": "weight", - "display": "John Mendoza", - "description": "" - } - ] - } - ], - "items": [ - { - "type": "product", - "name": "benchmark collaborative paradigms", - "item_type": "set", - "slug": "benchmark-collaborative-paradigms", - "id": 1, - "brand": { - "type": "brand", - "name": "Barry, Jennings and Larson", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "benchmark-collaborative-paradigms" - } - }, - "type": "page" - }, - "attributes": { - "color_hex": "808080", - "weight": 100, - "product_type": "LaptopBags", - "gender": [ - "Men", - "Women" - ], - "material": "Neoprene", - "style_note": "Shape up your overall appeal with this stunning laptop bag. The amazing storage and great design will let you carry your laptop in style!", - "item_code": "LGLAPTOPSLEEVE5", - "occasion": "Casual", - "primary_color": "Grey", - "primary_material": "Others", - "variant": "LGLAPTOPSLEEVE5", - "color": "DarkGrey", - "product_details": "This is a Unisex Product.", - "primary_color_hex": "808080" - }, - "medias": [ - { - "type": "image", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1309_LGLAPTOPSLEEVE5/1_1564735832806.jpg" - } - ], - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "rating": 2.7, - "rating_count": 2 - }, - { - "type": "product", - "name": "deploy viral systems", - "item_type": "set", - "slug": "deploy-viral-systems", - "id": 2, - "brand": { - "type": "brand", - "name": "Barry, Jennings and Larson", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "deploy-viral-systems" - } - }, - "type": "page" - }, - "attributes": { - "color_hex": "808080", - "weight": 100, - "product_type": "LaptopBags", - "gender": [ - "Men", - "Women" - ], - "material": "Neoprene", - "style_note": "Shape up your overall appeal with this stunning laptop bag. The amazing storage and great design will let you carry your laptop in style!", - "item_code": "LGLAPTOPSLEEVE5", - "occasion": "Casual", - "primary_color": "Grey", - "primary_material": "Others", - "variant": "LGLAPTOPSLEEVE5", - "color": "DarkGrey", - "product_details": "This is a Unisex Product.", - "primary_color_hex": "808080" - }, - "medias": [ - { - "type": "image", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1309_LGLAPTOPSLEEVE5/1_1564735832806.jpg" - } - ], - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "rating": 2.7, - "rating_count": 2 - } - ] -} -``` -
- - - - - - - - - ---- - - -#### getSimilarComparisonProductBySlug -Get comparison between similar products - - - -```swift -catalog.getSimilarComparisonProductBySlug(slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | - - - -Use this API to compare a given product automatically with similar products. Only one slug is needed. - -*Returned Response:* - - - - -[ProductCompareResponse](#ProductCompareResponse) - -Success. Returns an array of objects containing the attributes for comparision. Check the example shown below or refer `ProductCompareResponse` for more details. - - - - -
-  Example: - -```json - -``` -
- - - - - - - - - ---- - - -#### getComparedFrequentlyProductBySlug -Get comparison between frequently compared products with the given product - - - -```swift -catalog.getComparedFrequentlyProductBySlug(slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | - - - -Use this API to compare a given product automatically with products that are frequently compared with it. Only one slug is needed. - -*Returned Response:* - - - - -[ProductFrequentlyComparedSimilarResponse](#ProductFrequentlyComparedSimilarResponse) - -Success. Returns an array of objects containing the attributes for comparision. Check the example shown below or refer `ProductFrequentlyComparedSimilarResponse` for more details. - - - - -
-  Example: - -```json -{ - "similars": { - "title": "Most Compared", - "subtitle": "We bet you would love these!", - "attributes_metadata": [ - { - "title": "Alexander Sawyer", - "details": [ - { - "key": "color", - "display": "Kimberly Davidson", - "description": "" - }, - { - "key": "gender", - "display": "Kimberly Mcdaniel", - "description": "" - }, - { - "key": "material", - "display": "Monica Hampton", - "description": "" - }, - { - "key": "weight", - "display": "John Mendoza", - "description": "" - } - ] - } - ], - "items": [ - { - "type": "product", - "name": "benchmark collaborative paradigms", - "item_type": "set", - "slug": "benchmark-collaborative-paradigms", - "id": 1, - "brand": { - "type": "brand", - "name": "Barry, Jennings and Larson", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "benchmark-collaborative-paradigms" - } - }, - "type": "page" - }, - "attributes": { - "color_hex": "808080", - "weight": 100, - "product_type": "LaptopBags", - "gender": [ - "Men", - "Women" - ], - "material": "Neoprene", - "style_note": "Shape up your overall appeal with this stunning laptop bag. The amazing storage and great design will let you carry your laptop in style!", - "item_code": "LGLAPTOPSLEEVE5", - "occasion": "Casual", - "primary_color": "Grey", - "primary_material": "Others", - "variant": "LGLAPTOPSLEEVE5", - "color": "DarkGrey", - "product_details": "This is a Unisex Product.", - "primary_color_hex": "808080" - }, - "medias": [ - { - "type": "image", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1309_LGLAPTOPSLEEVE5/1_1564735832806.jpg" - } - ], - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "rating": 2.7, - "rating_count": 2 - }, - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "deploy viral systems", - "slug": "deploy-viral-systems", - "uid": 2, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "deploy-viral-systems" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "rating": 2.7 - } - ] - } -} -``` -
- - - - - - - - - ---- - - -#### getProductSimilarByIdentifier -Get similar products - - - -```swift -catalog.getProductSimilarByIdentifier(slug: slug, similarType: similarType) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | -| similarType | String | yes | Similarity criteria such as basic, visual, price, seller, category and spec. Visual - Products having similar patterns, Price - Products in similar price range, Seller - Products sold by the same seller, Category - Products belonging to the same category, e.g. sports shoes, Spec - Products having similar specifications, e.g. phones with same memory. | - - - -Use this API to retrieve products similar to the one specified by its slug. You can search not only similar looking products, but also those that are sold by same seller, or those that belong to the same category, price, specifications, etc. - -*Returned Response:* - - - - -[SimilarProductByTypeResponse](#SimilarProductByTypeResponse) - -Success. Returns a group of similar products based on type. Check the example shown below or refer `SimilarProductByTypeResponse` for more details. - - - - -
-  Example: - -```json -{ - "similars": { - "title": "Brand", - "subtitle": "", - "type": "brand", - "items": [ - { - "type": "product", - "attributes": { - "primary_color_hex": null, - "features": "
  • Dura-pump Technology
  • i-Pure Technology
  • Powerful Air Throw
  • Cool Flow Dispenser
  • Engg. Plastic: Blower
  • Blower/Fan Diameter (mm): 180
  • Ice Chamber
  • Cool Flow Dispenser
  • Cooling Media: Honeycomb
  • Air Throw Distance (mt): 9/30
  • ", - "model": "DiET 35T", - "air-cooler-type": "Portable", - "primary_color": "" - }, - "categories": [ - { - "id": 2717, - "uid": 2717, - "name": "Air Coolers", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "category": [ - "air-coolers" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "Symphony Diet 35t Portable Air Cooler", - "slug": "symphony-diet-35t-portable-air-cooler", - "uid": 7502019, - "item_type": "standard", - "item_code": "491297014", - "brand": { - "type": "brand", - "name": "Symphony", - "logo": { - "type": "image", - "url": "https://hdn-1.jiox0.de/jiox0/brands/pictures/square-logo/original/69sKmY_CX-Logo.jpeg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "symphony" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "params": { - "slug": [ - "symphony-diet-35t-portable-air-cooler" - ] - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.jiox0.de/jiox0/products/pictures/item/free/original/63/491297014/0/5aKOS19APd-symphony-diet-35t-air-coolers-491297014-i-1-1200wx1200h.jpeg" - }, - { - "type": "image", - "url": "https://hdn-1.jiox0.de/jiox0/products/pictures/item/free/original/63/491297014/1/NY6IJ7xfug-symphony-diet-35t-air-coolers-491297014-i-2-1200wx1200h.jpeg" - } - ], - "discount": "", - "price": { - "marked": { - "min": 9299, - "max": 9299, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 9299, - "max": 9299, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "_custom_json": {}, - "highlights": [ - "Powerful Air Throw ", - "Large 35 Litre Tank Capacity ", - "Automatic Louvers ", - "Multi Directional Wheels ", - "High Efficiency Honey Comb Pad" - ], - "description": "Exclusively suited for your cozy bedroom, Symphony DiET 35T Portable Air Cooler, assures you your comfort while it makes summers fun. Powered by a 35 litre tank, a high efficiency honeycomb pad and ice chamber, it is indeed your coolest buddy in summers. Automatic louvers, multi-directional wheels and three speed remote controlled setting options make it an ideal buy.", - "country_of_origin": "India" - } - ] - } -} -``` -
    - - - - - - - - - ---- - - -#### getProductVariantsBySlug -Get variant of a particular product - - - -```swift -catalog.getProductVariantsBySlug(slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | - - - -A product can have a different type of variants such as colour, shade, memory. Use this API to fetch all the available variants of a product using its slug. - -*Returned Response:* - - - - -[ProductVariantsResponse](#ProductVariantsResponse) - -Success. Returns all variants of a product. Check the example shown below or refer `ProductVariantsResponse` for more details. For `display_type:image`, `color` key will be present otherwise `value` key will be shown. - - - - -
    -  Example: - -```json -{ - "variants": [ - { - "header": "Addtn. Color", - "key": "color", - "display_type": "image", - "logo": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/360x0/56_MKT02AI060CORAL/1_1567590349681.jpg", - "items": [ - { - "action": { - "page": { - "type": "product", - "query": { - "slug": "benchmark-collaborative-paradigms" - } - }, - "type": "page" - }, - "uid": 1, - "slug": "benchmark-collaborative-paradigms", - "medias": [ - { - "type": "image", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1309_LGLAPTOPSLEEVE5/1_1564735832806.jpg" - } - ], - "name": "benchmark collaborative paradigms", - "is_available": true, - "color_name": "DarkGrey", - "color": "808080" - } - ] - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getProductStockByIds -Get the stock of a product - - - -```swift -catalog.getProductStockByIds(itemId: itemId, alu: alu, skuCode: skuCode, ean: ean, upc: upc) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| itemId | String? | no | The Item ID of the product (Max. 50 allowed) | -| alu | String? | no | ALU of the product (limited upto 50 ALU identifier in a single request) | -| skuCode | String? | no | Stock-keeping Unit of the product (limited upto 50 SKU Code in a single request) | -| ean | String? | no | European Article Number of the product (limited upto 50 EAN identifier in a single request) | -| upc | String? | no | Universal Product Code of the product (limited upto 50 UPC identifier in a single request) | - - - -Retrieve the available stock of the products. Use this API to retrieve stock of multiple products (up to 50) at a time. - -*Returned Response:* - - - - -[ProductStockStatusResponse](#ProductStockStatusResponse) - -Success. Returns the status of the product stock.Check the example shown below or refer `ProductStockStatusResponse` for more details. - - - - -
    -  Example: - -```json -{ - "items": [ - { - "uid": "1", - "item_id": 1, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "2", - "item_id": 1, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "3", - "item_id": 2, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "4", - "item_id": 2, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "5", - "item_id": 3, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "6", - "item_id": 3, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "7", - "item_id": 4, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "8", - "item_id": 4, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "9", - "item_id": 5, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "10", - "item_id": 5, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "11", - "item_id": 6, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "12", - "item_id": 6, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "13", - "item_id": 7, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "14", - "item_id": 7, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "15", - "item_id": 8, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "16", - "item_id": 8, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "17", - "item_id": 9, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "18", - "item_id": 9, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "19", - "item_id": 10, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "20", - "item_id": 10, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "21", - "item_id": 11, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "22", - "item_id": 11, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "23", - "item_id": 12, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "24", - "item_id": 12, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "25", - "item_id": 13, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "26", - "item_id": 13, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "27", - "item_id": 14, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "28", - "item_id": 14, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "29", - "item_id": 15, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - }, - { - "uid": "30", - "item_id": 15, - "identifier": { - "sku_code": "P10101101154425S" - }, - "price": { - "effective": 399, - "marked": 399, - "currency": "INR" - }, - "size": "13", - "company": { - "id": 1, - "name": "Natalie Norman" - }, - "store": { - "id": 1, - "name": "Wayne Lamb", - "code": "Wayne-Lamb" - }, - "quantity": 5 - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getProductStockForTimeByIds -Get the stock of a product - - - -```swift -catalog.getProductStockForTimeByIds(timestamp: timestamp, pageSize: pageSize, pageId: pageId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| timestamp | String | yes | Timestamp in UTC format (2020-07-23T10:27:50Z) | -| pageSize | Int? | no | The number of items to retrieve in each page. | -| pageId | String? | no | Page ID to retrieve next set of results. | - - - -Retrieve the available stock of the products. Use this API to get the stock status of products whose inventory is updated at the specified time - -*Returned Response:* - - - - -[ProductStockPolling](#ProductStockPolling) - -Success. Returns the status of the product stock.Check the example shown below or refer `ProductStockPolling` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getProducts -Get all the products - - - -```swift -catalog.getProducts(q: q, f: f, filters: filters, sortOn: sortOn, pageId: pageId, pageSize: pageSize, pageNo: pageNo, pageType: pageType) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| q | String? | no | The search query for entering partial or full name of product, brand, category, or collection. | -| f | String? | no | The search filter parameters. Filter parameters will be passed in f parameter as shown in the example below. Double Pipe (||) denotes the OR condition, whereas Triple-colon (:::) indicates a new filter paramater applied as an AND condition. | -| filters | Bool? | no | This is a boolean value, True for fetching all filter parameters and False for disabling the filter parameters. | -| sortOn | String? | no | The order in which the list of products should be sorted, e.g. popularity, price, latest and discount, in either ascending or descending order. See the supported values below. | -| pageId | String? | no | Page ID to retrieve next set of results. | -| pageSize | Int? | no | The number of items to retrieve in each page. | -| pageNo | Int? | no | The page number to navigate through the given set of results. | -| pageType | String? | no | Available pagination types are cursor or number. | - - - -Use this API to list all the products. You may choose a sort order or make arbitrary search queries by entering the product name, brand, category or collection. - -*Returned Response:* - - - - -[ProductListingResponse](#ProductListingResponse) - -Success. Returns a paginated list of products..Check the example shown below or refer `ProductListingResponse` for more details. - - - - -
    -  Example: - -```json -{ - "filters": [ - { - "key": { - "display": "Department", - "name": "department", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Department.svg" - }, - "values": [ - { - "display": "Debra Villarreal", - "count": 15, - "is_selected": false, - "value": "Debra-Villarreal", - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "display": "Tracey Miller", - "count": 15, - "is_selected": false, - "value": "Tracey-Miller", - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - } - ] - }, - { - "key": { - "display": "Category", - "name": "category", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Category.svg" - }, - "values": [ - { - "display": "Amy Kim DDS", - "count": 15, - "is_selected": false, - "value": "3", - "logo": "http://cdn4.gofynd.com/media/banner/category/original/12063_a5bb91bd5cb44c3c9db98c2a0e6b3d99.jpg" - } - ] - }, - { - "key": { - "display": "Gender", - "name": "gender", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Gender.svg" - }, - "values": [ - { - "display": "Men", - "count": 15, - "is_selected": false, - "value": "men" - }, - { - "display": "Women", - "count": 15, - "is_selected": false, - "value": "women" - } - ] - }, - { - "key": { - "display": "Size", - "name": "sizes", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Sizes.svg" - }, - "values": [ - { - "display": "13", - "count": 15, - "is_selected": false, - "value": "13" - } - ] - }, - { - "key": { - "display": "Brand", - "name": "brand", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Brand%20ID.svg" - }, - "values": [ - { - "display": "Barry, Jennings and Larson", - "count": 15, - "is_selected": false, - "value": "1", - "logo": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - } - ] - }, - { - "key": { - "display": "Rating", - "name": "rating", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Rating.svg" - }, - "values": [ - { - "count": 15, - "display": "2 - 3", - "value": "[2 TO 3}", - "is_selected": false - } - ] - }, - { - "key": { - "display": "Image", - "name": "image_nature", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/image%20Nature.svg" - }, - "values": [ - { - "display": "GoodQuality", - "count": 15, - "is_selected": false, - "value": "standard" - } - ] - }, - { - "key": { - "display": "Monica Hampton", - "name": "material", - "kind": "multivalued", - "logo": "" - }, - "values": [ - { - "display": "Neoprene", - "count": 15, - "is_selected": false, - "value": "Neoprene" - } - ] - }, - { - "key": { - "display": "John Mendoza", - "name": "weight", - "kind": "multivalued", - "logo": "" - }, - "values": [ - { - "display": "100", - "count": 15, - "is_selected": false, - "value": "100" - } - ] - }, - { - "key": { - "display": "Kimberly Mcdaniel", - "name": "gender", - "kind": "multivalued", - "logo": "" - }, - "values": [ - { - "display": "['Men', 'Women']", - "count": 15, - "is_selected": false, - "value": "['Men', 'Women']" - } - ] - }, - { - "key": { - "display": "Kimberly Davidson", - "name": "color", - "kind": "multivalued", - "logo": "" - }, - "values": [ - { - "display": "Grey", - "count": 15, - "is_selected": false, - "value": "808080" - } - ] - }, - { - "key": { - "display": "Available", - "name": "is_available", - "kind": "singlevalued" - }, - "values": [ - { - "display": "Available", - "count": 3, - "is_selected": false, - "value": "true" - } - ] - } - ], - "items": [ - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "benchmark collaborative paradigms", - "slug": "benchmark-collaborative-paradigms", - "uid": 1, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "benchmark-collaborative-paradigms" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "item_code": "ITEM_CODE_1", - "rating": 2.7 - }, - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "architect granular e-business", - "slug": "architect-granular-e-business", - "uid": 10, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "architect-granular-e-business" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "item_code": "ITEM_CODE_2", - "rating": 2.7 - }, - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "facilitate enterprise supply-chains", - "slug": "facilitate-enterprise-supply-chains", - "uid": 11, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "facilitate-enterprise-supply-chains" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "item_code": "ITEM_CODE_3", - "rating": 2.7 - }, - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "optimize web-enabled e-tailers", - "slug": "optimize-web-enabled-e-tailers", - "uid": 12, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "optimize-web-enabled-e-tailers" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "item_code": "ITEM_CODE_4", - "rating": 2.7 - } - ], - "sort_on": [ - { - "display": "Latest Products.", - "name": "Latest Products.", - "logo": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/360x0/56_MKT02AI060CORAL/1_1567590349681.jpg", - "value": "latest", - "is_selected": true - } - ], - "page": { - "current": 1, - "total": 2, - "has_previous": false, - "has_next": true, - "item_total": 15, - "type": "number" - } -} -``` -
    - - - - - - - - - ---- - - -#### getBrands -Get all the brands - - - -```swift -catalog.getBrands(department: department, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| department | String? | no | The name of the department. Use this parameter to filter products by a particular department. See the list of available departments below. Also, you can get available departments from the endpoint /service/application/catalog/v1.0/departments/ | -| pageNo | Int? | no | The page number to navigate through the given set of results. | -| pageSize | Int? | no | The number of items to retrieve in each page. | - - - -A brand is the name under which a product is sold. Use this API to list all the brands. You can also filter the brands by department. - -*Returned Response:* - - - - -[BrandListingResponse](#BrandListingResponse) - -Success. Returns a paginated list of brands. Check the example shown below or refer `BrandListingResponse` for more details. - - - - -
    -  Example: - -```json -{ - "items": [ - { - "uid": 1, - "name": "Barry, Jennings and Larson", - "slug": "Hess-Inc", - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "banners": { - "portrait": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/12537_9cdfc6835e814b0986ee1643d38cf6cd.png" - } - }, - "en_name": "Barry, Jennings and Larson" - } - ], - "page": { - "current": 1, - "total": 1, - "has_previous": false, - "has_next": false, - "item_total": 1, - "type": "number" - } -} -``` -
    - - - - - - - - - ---- - - -#### getBrandDetailBySlug -Get metadata of a brand - - - -```swift -catalog.getBrandDetailBySlug(slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a brand. You can get slug value from the endpoint /service/application/catalog/v1.0/brands/. | - - - -Fetch metadata of a brand such as name, information, logo, banner, etc. - -*Returned Response:* - - - - -[BrandDetailResponse](#BrandDetailResponse) - -Success. Returns a metadata object. Check the example shown below or refer `BrandDetailResponse` for more details. - - - - -
    -  Example: - -```json -{ - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "banners": { - "portrait": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/12537_9cdfc6835e814b0986ee1643d38cf6cd.png" - }, - "landscape": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner/brand/original/12536_e1a5cdcefc7540e68cedd8c2b0673179.png" - } - }, - "uid": 1, - "name": "Hess Inc" -} -``` -
    - - - - - - - - - ---- - - -#### getCategories -List all the categories - - - -```swift -catalog.getCategories(department: department) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| department | String? | no | The name of the department. Use this parameter to filter products by a particular department. See the list of available departments below. Also, you can get available departments from the endpoint /service/application/catalog/v1.0/departments/ | - - - -Use this API to list all the categories. You can also filter the categories by department. - -*Returned Response:* - - - - -[CategoryListingResponse](#CategoryListingResponse) - -Success. Returns a list of categories. Check the example shown below or refer `CategoryListingResponse` for more details. - - - - -
    -  Example: - -```json -{ - "departments": [ - { - "slug": "Cody-Doyle", - "uid": 1 - } - ], - "data": [ - { - "department": "Cody-Doyle", - "items": [ - { - "name": "Janet Parker", - "image": { - "aspect_ratio": "13:20", - "aspect_ratio_f": 0.65, - "url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/banner_portrait/category/resize-w:130,h:200/12064_e69e1d8b5e934d3488f0dc8663d8a158.jpg" - }, - "uid": 1, - "slug": "Janet-Parker", - "_custom_json": {}, - "action": { - "type": "category", - "url": "https://api.addsale.com/platform/content/v1/products/?l1_category=Janet-Parker&department=Jaime-Chambers", - "query": { - "l1_category": [ - "Janet-Parker" - ], - "department": [ - "Jaime-Chambers" - ] - } - }, - "childs": [ - { - "name": "Hannah Lawson", - "image": { - "aspect_ratio": "13:20", - "aspect_ratio_f": 0.65, - "url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/banner_portrait/category/resize-w:130,h:200/12064_e69e1d8b5e934d3488f0dc8663d8a158.jpg" - }, - "uid": 2, - "slug": "Hannah-Lawson", - "_custom_json": {}, - "action": { - "type": "category", - "url": "https://api.addsale.com/platform/content/v1/products/?l2_category=Hannah-Lawson&department=Jaime-Chambers", - "query": { - "l2_category": [ - "Hannah-Lawson" - ], - "department": [ - "Jaime-Chambers" - ] - } - }, - "childs": [ - { - "name": "Logan Black", - "image": { - "aspect_ratio": "13:20", - "aspect_ratio_f": 0.65, - "url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/banner_portrait/category/resize-w:130,h:200/12064_e69e1d8b5e934d3488f0dc8663d8a158.jpg" - }, - "uid": 3, - "slug": "Logan-Black", - "_custom_json": {}, - "action": { - "type": "category", - "url": "https://api.addsale.com/platform/content/v1/products/?category=Logan-Black&department=Jaime-Chambers", - "query": { - "category": [ - "Logan-Black" - ], - "department": [ - "Jaime-Chambers" - ] - } - }, - "childs": [] - } - ] - } - ] - } - ] - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getCategoryDetailBySlug -Get metadata of a category - - - -```swift -catalog.getCategoryDetailBySlug(slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a brand. You can get slug value from the endpoint /service/application/catalog/v1.0/brands/. | - - - -Fetch metadata of a category such as name, information, logo, banner, etc. - -*Returned Response:* - - - - -[CategoryMetaResponse](#CategoryMetaResponse) - -Success. Returns metadata of a category. Check the example shown below or refer `CategoryMetaResponse` for more details. - - - - -
    -  Example: - -```json -{ - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/banner/category/original/12063_a5bb91bd5cb44c3c9db98c2a0e6b3d99.jpg" - }, - "uid": 1, - "name": "Kyle Cabrera", - "banners": { - "portrait": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/banner_portrait/category/original/12064_e69e1d8b5e934d3488f0dc8663d8a158.jpg" - }, - "landscape": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/banner/category/original/12063_a5bb91bd5cb44c3c9db98c2a0e6b3d99.jpg" - } - }, - "_custom_json": {} -} -``` -
    - - - - - - - - - ---- - - -#### getHomeProducts -List the products - - - -```swift -catalog.getHomeProducts(sortOn: sortOn, pageId: pageId, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| sortOn | String? | no | The order in which the list of products should be sorted, e.g. popularity, price, latest and discount, in either ascending or descending order. | -| pageId | String? | no | Page ID to retrieve next set of results. | -| pageSize | Int? | no | The number of items to retrieve in each page. | - - - -List all the products associated with a brand, collection or category in a random order. - -*Returned Response:* - - - - -[HomeListingResponse](#HomeListingResponse) - -Success. Returns a paginated list of products. Check the example shown below or refer `HomeListingResponse` for more details. - - - - -
    -  Example: - -```json -{ - "items": [ - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "whiteboard holistic functionalities", - "slug": "whiteboard-holistic-functionalities", - "uid": 7, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "whiteboard-holistic-functionalities" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "rating": 2.7 - }, - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "envisioneer user-centric technologies", - "slug": "envisioneer-user-centric-technologies", - "uid": 6, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "envisioneer-user-centric-technologies" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "rating": 2.7 - }, - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "deploy viral systems", - "slug": "deploy-viral-systems", - "uid": 2, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "deploy-viral-systems" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "rating": 2.7 - }, - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "syndicate compelling e-commerce", - "slug": "syndicate-compelling-e-commerce", - "uid": 8, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "syndicate-compelling-e-commerce" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "rating": 2.7 - }, - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "leverage granular e-commerce", - "slug": "leverage-granular-e-commerce", - "uid": 3, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "leverage-granular-e-commerce" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "rating": 2.7 - }, - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "deliver bleeding-edge systems", - "slug": "deliver-bleeding-edge-systems", - "uid": 13, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "deliver-bleeding-edge-systems" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "rating": 2.7 - }, - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "optimize web-enabled e-tailers", - "slug": "optimize-web-enabled-e-tailers", - "uid": 12, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "optimize-web-enabled-e-tailers" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "rating": 2.7 - }, - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "architect granular e-business", - "slug": "architect-granular-e-business", - "uid": 10, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "architect-granular-e-business" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "rating": 2.7 - }, - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "drive scalable applications", - "slug": "drive-scalable-applications", - "uid": 5, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "drive-scalable-applications" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "rating": 2.7 - }, - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "cultivate web-enabled e-tailers", - "slug": "cultivate-web-enabled-e-tailers", - "uid": 4, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "cultivate-web-enabled-e-tailers" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "rating": 2.7 - }, - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "facilitate enterprise supply-chains", - "slug": "facilitate-enterprise-supply-chains", - "uid": 11, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "facilitate-enterprise-supply-chains" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "rating": 2.7 - }, - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "benchmark collaborative paradigms", - "slug": "benchmark-collaborative-paradigms", - "uid": 1, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "benchmark-collaborative-paradigms" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "rating": 2.7 - } - ], - "page": { - "next_id": "AoJftsmkNiEx", - "has_previous": false, - "has_next": true, - "item_total": 15, - "type": "number" - }, - "sort_on": "random_36547cfbb4c54a1a992c17aa5 asc" -} -``` -
    - - - - - - - - - ---- - - -#### getDepartments -List all the departments - - - -```swift -catalog.getDepartments() { (response, error) in - // Use response -} -``` - - - - -Departments are a way to categorise similar products. A product can lie in multiple departments. For example, a skirt can below to the 'Women's Fashion' Department while a handbag can lie in 'Women's Accessories' Department. Use this API to list all the departments. If successful, returns the list of departments specified in `DepartmentResponse` - -*Returned Response:* - - - - -[DepartmentResponse](#DepartmentResponse) - -List of Departments. See example below or refer `DepartmentResponse` for details. - - - - -
    -  Example: - -```json -{ - "items": [ - { - "uid": 1, - "name": "Zachary Harris", - "slug": "Zachary-Harris", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "uid": 2, - "name": "Aaron Reilly", - "slug": "Aaron-Reilly", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "uid": 3, - "name": "Bobby Sandoval", - "slug": "Bobby-Sandoval", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "uid": 4, - "name": "Seth Hughes", - "slug": "Seth-Hughes", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "uid": 5, - "name": "Michelle Moore", - "slug": "Michelle-Moore", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "uid": 6, - "name": "Annette Baldwin", - "slug": "Annette-Baldwin", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "uid": 7, - "name": "Chris Mata", - "slug": "Chris-Mata", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "uid": 8, - "name": "Nicole Jacobs", - "slug": "Nicole-Jacobs", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "uid": 9, - "name": "Pamela Smith", - "slug": "Pamela-Smith", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "uid": 10, - "name": "Nicole Simon", - "slug": "Nicole-Simon", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getSearchResults -Get relevant suggestions for a search query - - - -```swift -catalog.getSearchResults(q: q) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| q | String | yes | The search query for entering partial or full name of a product, brand or category. For example, if the given search query `q` is _ski_, the relevant search suggestions could be _skirt_, _ski shoes_, __skin cream_ etc. | - - - -Retrieves a list of suggestions for a given search query. Each suggestion is a valid search term that's generated on the basis of query. This is particularly useful to enhance the user experience while using the search tool. - -*Returned Response:* - - - - -[AutoCompleteResponse](#AutoCompleteResponse) - -Success. Returns a list autocomplete suggestions for the search query `q`. Check the example shown below or refer `AutoCompleteResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getCollections -List all the collections - - - -```swift -catalog.getCollections(pageNo: pageNo, pageSize: pageSize, tag: tag) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| pageNo | Int? | no | The page number to navigate through the given set of results. | -| pageSize | Int? | no | The number of items to retrieve in each page. | -| tag | [String]? | no | List of tags to filter collections | - - - -Collections are a great way to organize your products and can improve the ability for customers to find items quickly and efficiently. - -*Returned Response:* - - - - -[GetCollectionListingResponse](#GetCollectionListingResponse) - -Success. Returns a list of collections. Check the example shown below or refer `GetCollectionListingResponse` for more details. - - - - -
    -  Example: - -```json -{ - "page": { - "type": "number", - "current": 1, - "total": 1, - "has_previous": false, - "has_next": false, - "item_total": 2 - }, - "items": [ - { - "uid": "601a4f39448327cfa83e7db2", - "type": "query", - "query": { - "category": [ - "Anna-Navarro" - ] - }, - "name": "collection with Anna-Navarro", - "banners": { - "portrait": { - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1571729908/production/applications/app_000000000000000000000001/media/collection/portrait/pewrpnjrhcrca1dmtvx5.png", - "aspect_ratio": "13:20" - }, - "landscape": { - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1571729858/production/applications/app_000000000000000000000001/media/collection/landscape/tkclmj847hdvfbudeqbr.png", - "aspect_ratio": "27:20" - } - }, - "logo": { - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1571729838/production/applications/app_000000000000000000000001/media/collection/logo/xierjsrcwhd2fphzyjod.png", - "aspect_ratio": "1:1" - }, - "published": true, - "description": "Crimsoune Club | Upto 70% Off", - "is_active": true, - "tags": [ - "men", - "women" - ], - "slug": "crimsoune-club-upto-70-off-754fa043", - "action": { - "type": "collection", - "url": "https://api.addsale.com/platform/content/v1/collections/crimsoune-club-upto-70-off-754fa043/items/" - }, - "allow_facets": true, - "allow_sort": true, - "visible_facets_keys": [], - "meta": {}, - "badge": {}, - "sort_on": "popular", - "_custom_json": {}, - "_locale_language": {}, - "_schedule": {} - }, - { - "uid": "601a4f39448327cfa83e7db0", - "type": "items", - "query": {}, - "name": "collection with items", - "banners": { - "portrait": { - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1571729908/production/applications/app_000000000000000000000001/media/collection/portrait/pewrpnjrhcrca1dmtvx5.png", - "aspect_ratio": "13:20" - }, - "landscape": { - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1571729858/production/applications/app_000000000000000000000001/media/collection/landscape/tkclmj847hdvfbudeqbr.png", - "aspect_ratio": "27:20" - } - }, - "logo": { - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1571729838/production/applications/app_000000000000000000000001/media/collection/logo/xierjsrcwhd2fphzyjod.png", - "aspect_ratio": "1:1" - }, - "published": true, - "description": "Crimsoune Club | Upto 70% Off", - "is_active": true, - "tags": [ - "men", - "women" - ], - "slug": "crimsoune-club-upto-70-off-754fa043", - "action": { - "type": "collection", - "url": "https://api.addsale.com/platform/content/v1/collections/crimsoune-club-upto-70-off-754fa043/items/" - }, - "allow_facets": true, - "allow_sort": true, - "visible_facets_keys": [], - "meta": {}, - "badge": {}, - "sort_on": "popular", - "_custom_json": {}, - "_locale_language": {}, - "_schedule": {} - } - ], - "filters": { - "tags": [ - { - "name": "men", - "is_selected": false, - "display": "men" - }, - { - "name": "women", - "is_selected": false, - "display": "women" - } - ], - "type": [ - { - "name": "items", - "is_selected": false, - "display": "items" - }, - { - "name": "query", - "is_selected": false, - "display": "query" - } - ] - } -} -``` -
    - - - - - - - - - ---- - - -#### getCollectionItemsBySlug -Get the items in a collection - - - -```swift -catalog.getCollectionItemsBySlug(slug: slug, f: f, filters: filters, sortOn: sortOn, pageId: pageId, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a collection. You can get slug value from the endpoint /service/application/catalog/v1.0/collections/. | -| f | String? | no | The search filter parameters. Filter parameters will be passed in f parameter as shown in the example below. Double Pipe (||) denotes the OR condition, whereas Triple-colon (:::) indicates a new filter paramater applied as an AND condition. | -| filters | Bool? | no | This is a boolean value, True for fetching all filter parameters and False for disabling the filter parameters. | -| sortOn | String? | no | The order in which the list of products should be sorted, e.g. popularity, price, latest and discount, in either ascending or descending order. See the supported values below. | -| pageId | String? | no | Page ID to retrieve next set of results. | -| pageSize | Int? | no | The number of items to retrieve in each page. | - - - -Get items in a collection specified by its `slug`. - -*Returned Response:* - - - - -[ProductListingResponse](#ProductListingResponse) - -Success. Returns a list items in a given collection. Check the example shown below or refer `ProductListingResponse` for more details. - - - - -
    -  Example: - -```json -{ - "filters": [ - { - "key": { - "display": "Department", - "name": "department", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Department.svg" - }, - "values": [ - { - "display": "Debra Villarreal", - "count": 1, - "is_selected": false, - "value": "Debra-Villarreal", - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "display": "Tracey Miller", - "count": 1, - "is_selected": false, - "value": "Tracey-Miller", - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - } - ] - }, - { - "key": { - "display": "Category", - "name": "category", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Category.svg" - }, - "values": [ - { - "display": "Amy Kim DDS", - "count": 1, - "is_selected": false, - "value": "3", - "logo": "http://cdn4.gofynd.com/media/banner/category/original/12063_a5bb91bd5cb44c3c9db98c2a0e6b3d99.jpg" - } - ] - }, - { - "key": { - "display": "Gender", - "name": "gender", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Gender.svg" - }, - "values": [ - { - "display": "Men", - "count": 1, - "is_selected": false, - "value": "men" - }, - { - "display": "Women", - "count": 1, - "is_selected": false, - "value": "women" - } - ] - }, - { - "key": { - "display": "Size", - "name": "sizes", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Sizes.svg" - }, - "values": [ - { - "display": "13", - "count": 1, - "is_selected": false, - "value": "13" - } - ] - }, - { - "key": { - "display": "Brand", - "name": "brand", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Brand%20ID.svg" - }, - "values": [ - { - "display": "Barry, Jennings and Larson", - "count": 1, - "is_selected": false, - "value": "1", - "logo": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - } - ] - }, - { - "key": { - "display": "Rating", - "name": "rating", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Rating.svg" - }, - "values": [ - { - "count": 1, - "display": "2 - 3", - "value": "[2 TO 3}", - "is_selected": false - } - ] - }, - { - "key": { - "display": "Image", - "name": "image_nature", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/image%20Nature.svg" - }, - "values": [ - { - "display": "GoodQuality", - "count": 1, - "is_selected": false, - "value": "standard" - } - ] - }, - { - "key": { - "display": "Monica Hampton", - "name": "material", - "kind": "multivalued", - "logo": "" - }, - "values": [ - { - "display": "Neoprene", - "count": 1, - "is_selected": false, - "value": "Neoprene" - } - ] - }, - { - "key": { - "display": "John Mendoza", - "name": "weight", - "kind": "multivalued", - "logo": "" - }, - "values": [ - { - "display": "100", - "count": 1, - "is_selected": false, - "value": "100" - } - ] - }, - { - "key": { - "display": "Kimberly Mcdaniel", - "name": "gender", - "kind": "multivalued", - "logo": "" - }, - "values": [ - { - "display": "['Men', 'Women']", - "count": 1, - "is_selected": false, - "value": "['Men', 'Women']" - } - ] - }, - { - "key": { - "display": "Kimberly Davidson", - "name": "color", - "kind": "multivalued", - "logo": "" - }, - "values": [ - { - "display": "Grey", - "count": 1, - "is_selected": false, - "value": "808080" - } - ] - }, - { - "key": { - "display": "Available", - "name": "is_available", - "kind": "singlevalued" - }, - "values": [ - { - "display": "Available", - "count": 3, - "is_selected": false, - "value": "true" - } - ] - } - ], - "items": [ - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "benchmark collaborative paradigms", - "slug": "benchmark-collaborative-paradigms", - "uid": 1, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "benchmark-collaborative-paradigms" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "rating": 2.7 - } - ], - "sort_on": [ - { - "display": "Latest Products.", - "name": "Latest Products.", - "logo": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/360x0/56_MKT02AI060CORAL/1_1567590349681.jpg", - "value": "latest", - "is_selected": false - } - ], - "page": { - "type": "number", - "current": 1, - "total": 1, - "has_previous": false, - "has_next": false, - "item_total": 1 - } -} -``` -
    - - - - - - - - - ---- - - -#### getCollectionDetailBySlug -Get a particular collection - - - -```swift -catalog.getCollectionDetailBySlug(slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a collection. You can get slug value from the endpoint /service/application/catalog/v1.0/collections/. | - - - -Get the details of a collection by its `slug`. - -*Returned Response:* - - - - -[CollectionDetailResponse](#CollectionDetailResponse) - -Success. Returns a Collection object. Check the example shown below or refer `CollectionDetailResponse` for more details. - - - - -
    -  Example: - -```json -{ - "uid": "601a4f39448327cfa83e7db0", - "type": "items", - "query": {}, - "name": "collection with items", - "banners": { - "portrait": { - "type": "image", - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1571729908/production/applications/app_000000000000000000000001/media/collection/portrait/pewrpnjrhcrca1dmtvx5.png" - }, - "landscape": { - "type": "image", - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1571729858/production/applications/app_000000000000000000000001/media/collection/landscape/tkclmj847hdvfbudeqbr.png" - } - }, - "logo": { - "type": "image", - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1571729838/production/applications/app_000000000000000000000001/media/collection/logo/xierjsrcwhd2fphzyjod.png" - }, - "published": true, - "description": "Crimsoune Club | Upto 70% Off", - "is_active": true, - "tags": [ - "men", - "women" - ], - "slug": "crimsoune-club-upto-70-off-754fa043", - "action": { - "page": { - "type": "collection", - "query": { - "collection": [ - "crimsoune-club-upto-70-off-754fa043" - ] - } - }, - "type": "page" - }, - "allow_facets": true, - "allow_sort": true, - "visible_facets_keys": [], - "meta": {}, - "badge": {}, - "sort_on": "popular", - "_custom_json": {}, - "_locale_language": {}, - "_schedule": {} -} -``` -
    - - - - - - - - - ---- - - -#### getFollowedListing -Get a list of followed Products, Brands, Collections - - - -```swift -catalog.getFollowedListing(collectionType: collectionType, pageId: pageId, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| collectionType | String | yes | Type of collection followed, i.e. products, brands, or collections. | -| pageId | String? | no | Page ID to retrieve next set of results. | -| pageSize | Int? | no | Page ID to retrieve next set of results. | - - - -Users can follow a product they like. This API retrieves the products the user have followed. - -*Returned Response:* - - - - -[GetFollowListingResponse](#GetFollowListingResponse) - -Success. Returns a Followed resource object. Check the example shown below or refer `GetFollowListingResponse` for more details. - - - - -
    -  Example: - -```json -{ - "items": [ - { - "type": "product", - "name": "revolutionize end-to-end technologies", - "item_type": "set", - "slug": "revolutionize-end-to-end-technologies", - "uid": 1, - "brand": { - "type": "brand", - "name": "Chen PLC", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Chen-PLC" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "sellable": false, - "action": { - "page": { - "type": "product", - "query": { - "slug": "revolutionize-end-to-end-technologies" - } - }, - "type": "page" - }, - "attributes": { - "color_hex": "808080", - "weight": 100, - "product_type": "LaptopBags", - "gender": [ - "Men", - "Women" - ], - "material": "Neoprene", - "style_note": "Shape up your overall appeal with this stunning laptop bag. The amazing storage and great design will let you carry your laptop in style!", - "item_code": "LGLAPTOPSLEEVE5", - "occasion": "Casual", - "primary_color": "Grey", - "primary_material": "Others", - "variant": "LGLAPTOPSLEEVE5", - "color": "DarkGrey", - "product_details": "This is a Unisex Product.", - "primary_color_hex": "808080" - }, - "medias": [ - { - "type": "image", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1309_LGLAPTOPSLEEVE5/1_1564735832806.jpg" - } - ], - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Paul Palmer", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Paul-Palmer" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "rating": 2.7, - "rating_count": 2 - }, - { - "type": "product", - "name": "grow B2B experiences", - "item_type": "set", - "slug": "grow-B2B-experiences", - "uid": 15, - "brand": { - "type": "brand", - "name": "Chen PLC", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Chen-PLC" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "sellable": false, - "action": { - "page": { - "type": "product", - "query": { - "slug": "grow-B2B-experiences" - } - }, - "type": "page" - }, - "attributes": { - "color_hex": "808080", - "weight": 100, - "product_type": "LaptopBags", - "gender": [ - "Men", - "Women" - ], - "material": "Neoprene", - "style_note": "Shape up your overall appeal with this stunning laptop bag. The amazing storage and great design will let you carry your laptop in style!", - "item_code": "LGLAPTOPSLEEVE5", - "occasion": "Casual", - "primary_color": "Grey", - "primary_material": "Others", - "variant": "LGLAPTOPSLEEVE5", - "color": "DarkGrey", - "product_details": "This is a Unisex Product.", - "primary_color_hex": "808080" - }, - "medias": [ - { - "type": "image", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1309_LGLAPTOPSLEEVE5/1_1564735832806.jpg" - } - ], - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Paul Palmer", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Paul-Palmer" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "rating": 2.7, - "rating_count": 2 - }, - { - "type": "product", - "name": "target robust systems", - "item_type": "set", - "slug": "target-robust-systems", - "uid": 14, - "brand": { - "type": "brand", - "name": "Chen PLC", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Chen-PLC" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "sellable": false, - "action": { - "page": { - "type": "product", - "query": { - "slug": "target-robust-systems" - } - }, - "type": "page" - }, - "attributes": { - "color_hex": "808080", - "weight": 100, - "product_type": "LaptopBags", - "gender": [ - "Men", - "Women" - ], - "material": "Neoprene", - "style_note": "Shape up your overall appeal with this stunning laptop bag. The amazing storage and great design will let you carry your laptop in style!", - "item_code": "LGLAPTOPSLEEVE5", - "occasion": "Casual", - "primary_color": "Grey", - "primary_material": "Others", - "variant": "LGLAPTOPSLEEVE5", - "color": "DarkGrey", - "product_details": "This is a Unisex Product.", - "primary_color_hex": "808080" - }, - "medias": [ - { - "type": "image", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1309_LGLAPTOPSLEEVE5/1_1564735832806.jpg" - } - ], - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Paul Palmer", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Paul-Palmer" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "rating": 2.7, - "rating_count": 2 - } - ], - "page": { - "next_id": "6066fc7b3b17fd7038c46317", - "has_previous": false, - "has_next": true, - "item_total": 15, - "type": "number" - } -} -``` -
    - - - - - - - - - ---- - - -#### followById -Follow an entity (product/brand/collection) - - - -```swift -catalog.followById(collectionType: collectionType, collectionId: collectionId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| collectionType | String | yes | Type of collection followed, i.e. products, brands, or collections. | -| collectionId | String | yes | The ID of the collection type. | - - - -Follow a particular entity such as product, brand, collection specified by its ID. - -*Returned Response:* - - - - -[FollowPostResponse](#FollowPostResponse) - -Success. Returns a response object. Check the example shown below or refer `FollowPostResponse` for more details. - - - - -
    -  Example: - -```json -{ - "message": "Brands Added To Wishlist", - "id": "1" -} -``` -
    - - - - - - - - - ---- - - -#### unfollowById -Unfollow an entity (product/brand/collection) - - - -```swift -catalog.unfollowById(collectionType: collectionType, collectionId: collectionId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| collectionType | String | yes | Type of collection followed, i.e. products, brands, or collections. | -| collectionId | String | yes | The ID of the collection type. | - - - -You can undo a followed product, brand or collection by its ID. This action is referred as _unfollow_. - -*Returned Response:* - - - - -[FollowPostResponse](#FollowPostResponse) - -Success. Returns a response object. Check the example shown below or refer `FollowPostResponse` for more details. - - - - -
    -  Example: - -```json -{ - "message": "Products Removed From Wishlist", - "id": "1" -} -``` -
    - - - - - - - - - ---- - - -#### getFollowerCountById -Get Follow Count - - - -```swift -catalog.getFollowerCountById(collectionType: collectionType, collectionId: collectionId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| collectionType | String | yes | Type of collection, i.e. products, brands, or collections. | -| collectionId | String | yes | The ID of the collection type. | - - - -Get the total count of followers for a given collection type and collection ID. - -*Returned Response:* - - - - -[FollowerCountResponse](#FollowerCountResponse) - -Success. Returns the number of followers for a given collection type. Check the example shown below or refer `FollowerCountResponse` for more details. - - - - -
    -  Example: - -```json -{ - "count": 0 -} -``` -
    - - - - - - - - - ---- - - -#### getFollowIds -Get the IDs of followed products, brands and collections. - - - -```swift -catalog.getFollowIds(collectionType: collectionType) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| collectionType | String? | no | Type of collection, i.e. products, brands, collections. | - - - -You can get the IDs of all the followed Products, Brands and Collections. Pass collection_type as query parameter to fetch specific Ids - -*Returned Response:* - - - - -[FollowIdsResponse](#FollowIdsResponse) - -Success. Returns the IDs of all the Products, Brands and Collections which were followed. Check the example shown below or refer `FollowIdsResponse` for more details. - - - - -
    -  Example: - -```json -{ - "data": { - "products": [ - 1, - 15, - 14, - 13, - 12, - 11, - 10, - 9, - 8, - 7, - 6, - 5, - 4, - 3, - 2 - ], - "brands": [ - 1 - ], - "collections": [] - } -} -``` -
    - - - - - - - - - ---- - - -#### getStores -Get store meta information. - - - -```swift -catalog.getStores(pageNo: pageNo, pageSize: pageSize, q: q, city: city, range: range, latitude: latitude, longitude: longitude) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| pageNo | Int? | no | The page number to navigate through the given set of results. | -| pageSize | Int? | no | Number of items to retrieve in each page. | -| q | String? | no | Search a store by its name or store_code. | -| city | String? | no | Search stores by the city in which they are situated. | -| range | Int? | no | Use this to retrieve stores within a particular range in meters, e.g. 10000, to indicate a 10km range | -| latitude | Double? | no | Latitude of the location from where one wants to retreive the nearest stores, e.g. 72.8691788 | -| longitude | Double? | no | Longitude of the location from where one wants to retreive the nearest stores, e.g. 19.1174114 | - - - -Use this API to get a list of stores in a specific application. - -*Returned Response:* - - - - -[StoreListingResponse](#StoreListingResponse) - -Success. Returns a list of selling locations. Check the example shown below or refer `StoreListingResponse` for more details. - - - - -
    -  Example: - -```json -{ - "page": { - "type": "number", - "current": 1, - "total": 1, - "has_previous": false, - "has_next": false, - "item_total": 1 - }, - "data": [ - { - "pincode": 400059, - "city": "MUMBAI", - "state": "MAHARASHTRA", - "country": "INDIA", - "address": "SHOPSENSE RETAIL TECHNOLOGIES PRIVATE LIMITED 1ST FLOOR WEWORK VIJAY DIAMOND, CROSS RD B, AJIT NAGAR,", - "store_email": "ASHISHCHANDORKAR@FYND.COM", - "lat_long": { - "type": "Point", - "coordinates": [ - 72.8691788, - 19.1174114 - ] - }, - "name": "RRL01", - "store_code": "WH_8513", - "uid": 1 - } - ] -} -``` -
    - - - - - - - - - ---- - - - - -## Cart - - -#### getCart -Fetch all items added to the cart - - - -```swift -cart.getCart(id: id, i: i, b: b, assignCardId: assignCardId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | | -| i | Bool? | no | | -| b | Bool? | no | | -| assignCardId | Int? | no | | - - - -Use this API to get details of all the items added to a cart. - -*Returned Response:* - - - - -[CartDetailResponse](#CartDetailResponse) - -Success. Returns a Cart object. Check the example shown below or refer `CartDetailResponse` for more details. - - - - -
    -  Example: - -```json -{ - "items": [ - { - "bulk_offer": {}, - "discount": "67% OFF", - "article": { - "type": "article", - "uid": "604_902_SSTC60401_636BLUE_1", - "size": "1", - "seller": { - "uid": 604, - "name": "SHRI SHANTINATH TRADING COMPANY" - }, - "store": { - "uid": 4579, - "name": "Gandhi Nagar" - }, - "quantity": 108, - "price": { - "base": { - "marked": 2999, - "effective": 999, - "currency_code": "INR" - }, - "converted": { - "marked": 2999, - "effective": 999, - "currency_code": "INR" - } - } - }, - "coupon_message": "", - "key": "707569_1", - "availability": { - "sizes": [ - "1", - "8", - "7", - "2", - "9", - "5", - "3", - "6" - ], - "other_store_quantity": 107, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 707569, - "name": "Blue and Gold Printed Ethnic Set", - "slug": "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a", - "brand": { - "uid": 902, - "name": "" - }, - "categories": [ - { - "uid": 525, - "name": "" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/v1/products/aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a/", - "query": { - "product_slug": [ - "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a" - ] - } - } - }, - "price": { - "base": { - "add_on": 999, - "marked": 2999, - "effective": 999, - "selling": 999, - "currency_code": "INR" - }, - "converted": { - "add_on": 999, - "marked": 2999, - "effective": 999, - "selling": 999, - "currency_code": "INR" - } - }, - "message": "", - "quantity": 1 - } - ], - "cart_id": 54, - "uid": "54", - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": -2000, - "fynd_cash": 0, - "gst_charges": 47.57, - "mrp_total": 2999, - "subtotal": 999, - "total": 999, - "vog": 951.43, - "you_saved": 0 - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 2999, - "currency_code": "INR" - }, - { - "display": "Discount", - "key": "discount", - "value": -2000, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 999, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 999, - "currency_code": "INR" - } - ], - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - } - }, - "delivery_charge_info": "", - "coupon_text": "View all offers", - "gstin": null, - "checkout_mode": "self", - "restrict_checkout": false, - "is_valid": true, - "last_modified": "Tue, 03 Sep 2019 05:35:59 GMT" -} -``` -
    - - - - - - - - - ---- - - -#### getCartLastModified -Fetch last-modified timestamp - - - -```swift -cart.getCartLastModified(id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | | - - - -Use this API to fetch Last-Modified timestamp in header metadata. - -*Returned Response:* - - - - - - - - ---- - - -#### addItems -Add items to cart - - - -```swift -cart.addItems(i: i, b: b, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| i | Bool? | no | | -| b | Bool? | no | | -| body | [AddCartRequest](#AddCartRequest) | no | Request body | - - -Use this API to add items to the cart. - -*Returned Response:* - - - - -[AddCartDetailResponse](#AddCartDetailResponse) - -Success. Returns a cart object as shown below. Refer `AddCartDetailResponse` for more details. - - - - -
    -  Examples: - - -
    -  Product has been added to your cart - -```json -{ - "value": { - "message": "Product has been added to your cart", - "success": true, - "cart": { - "breakup_values": { - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 17486, - "currency_code": "INR" - }, - { - "display": "Discount", - "key": "discount", - "value": -3540, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 13946, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 13946, - "currency_code": "INR" - } - ], - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": -3540, - "fynd_cash": 0, - "gst_charges": 1529.96, - "mrp_total": 17486, - "subtotal": 13946, - "total": 13946, - "vog": 12416.04, - "you_saved": 0 - }, - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - } - }, - "items": [ - { - "key": "751083_10", - "article": { - "type": "article", - "uid": "612_9_SE61201_19100302_10", - "size": "10", - "seller": { - "uid": 612, - "name": "SSR ENTERPRISE" - }, - "store": { - "uid": 4431, - "name": "Motilal Nagar 1, Goregaon" - }, - "quantity": 4, - "price": { - "base": { - "marked": 3999, - "effective": 2399, - "currency_code": "INR" - }, - "converted": { - "marked": 3999, - "effective": 2399, - "currency_code": "INR" - } - } - }, - "price": { - "base": { - "add_on": 4798, - "marked": 7998, - "effective": 4798, - "selling": 4798, - "currency_code": "INR" - }, - "converted": { - "add_on": 4798, - "marked": 7998, - "effective": 4798, - "selling": 4798, - "currency_code": "INR" - } - }, - "availability": { - "sizes": [ - "10" - ], - "other_store_quantity": 2, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 751083, - "name": "Carson 2", - "slug": "puma-carson-2-751083-6ad98d", - "brand": { - "uid": 9, - "name": "Puma" - }, - "categories": [ - { - "uid": 165, - "name": "Outdoor Sports Shoes" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/9_19100302/1_1542807042296.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/9_19100302/1_1542807042296.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/puma-carson-2-751083-6ad98d/", - "query": { - "product_slug": [ - "puma-carson-2-751083-6ad98d" - ] - } - } - }, - "coupon_message": "", - "quantity": 2, - "message": "", - "bulk_offer": {}, - "discount": "41% OFF" - }, - { - "key": "246228_S", - "article": { - "type": "article", - "uid": "46_235_TM62_M11029ONDSXNS_S", - "size": "S", - "seller": { - "uid": 46, - "name": "RELIANCE BRANDS LIMITED" - }, - "store": { - "uid": 4550, - "name": "VR Mall" - }, - "quantity": 1, - "price": { - "base": { - "marked": 4490, - "effective": 4490, - "currency_code": "INR" - }, - "converted": { - "marked": 4490, - "effective": 4490, - "currency_code": "INR" - } - } - }, - "price": { - "base": { - "add_on": 4490, - "marked": 4490, - "effective": 4490, - "selling": 4490, - "currency_code": "INR" - }, - "converted": { - "add_on": 4490, - "marked": 4490, - "effective": 4490, - "selling": 4490, - "currency_code": "INR" - } - }, - "availability": { - "sizes": [ - "L", - "M", - "S", - "XL", - "XXL" - ], - "other_store_quantity": 0, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 246228, - "name": "Blue Solid T-Shirt", - "slug": "superdry-blue-solid-t-shirt-2", - "brand": { - "uid": 235, - "name": "Superdry" - }, - "categories": [ - { - "uid": 192, - "name": "T-Shirts" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/235_M11029ONDSXNS/1.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/235_M11029ONDSXNS/1.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/superdry-blue-solid-t-shirt-2/", - "query": { - "product_slug": [ - "superdry-blue-solid-t-shirt-2" - ] - } - } - }, - "coupon_message": "", - "quantity": 1, - "message": "", - "bulk_offer": {}, - "discount": "" - }, - { - "key": "443175_S", - "article": { - "type": "article", - "uid": "162_207_1271_LJ03LBLUDN88_S", - "size": "S", - "seller": { - "uid": 162, - "name": "GO FASHION INDIA PRIVATE LIMITED" - }, - "store": { - "uid": 5784, - "name": "Vega City mall" - }, - "quantity": 3, - "price": { - "base": { - "marked": 1599, - "effective": 1599, - "currency_code": "INR" - }, - "converted": { - "marked": 1599, - "effective": 1599, - "currency_code": "INR" - } - } - }, - "price": { - "base": { - "add_on": 1599, - "marked": 1599, - "effective": 1599, - "selling": 1599, - "currency_code": "INR" - }, - "converted": { - "add_on": 1599, - "marked": 1599, - "effective": 1599, - "selling": 1599, - "currency_code": "INR" - } - }, - "availability": { - "sizes": [ - "XL", - "M", - "L", - "S" - ], - "other_store_quantity": 8, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 443175, - "name": "Light Blue Denim Jeggings", - "slug": "go-colors-light-blue-denim-jeggings-443175-3c688c", - "brand": { - "uid": 207, - "name": "Go Colors" - }, - "categories": [ - { - "uid": 267, - "name": "Jeggings" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/207_LJ03LBLUDN88/1_1512382513548.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/207_LJ03LBLUDN88/1_1512382513548.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/go-colors-light-blue-denim-jeggings-443175-3c688c/", - "query": { - "product_slug": [ - "go-colors-light-blue-denim-jeggings-443175-3c688c" - ] - } - } - }, - "coupon_message": "", - "quantity": 1, - "message": "", - "bulk_offer": {}, - "discount": "" - }, - { - "key": "778937_OS", - "article": { - "type": "article", - "uid": "686_963_IC68601_PWUPC01977_OS", - "size": "OS", - "seller": { - "uid": 686, - "name": "INDUS CORPORATION" - }, - "store": { - "uid": 5059, - "name": "Vidyaranyapura Main Road" - }, - "quantity": 3, - "price": { - "base": { - "marked": 3399, - "effective": 3059, - "currency_code": "INR" - }, - "converted": { - "marked": 3399, - "effective": 3059, - "currency_code": "INR" - } - } - }, - "price": { - "base": { - "add_on": 3059, - "marked": 3399, - "effective": 3059, - "selling": 3059, - "currency_code": "INR" - }, - "converted": { - "add_on": 3059, - "marked": 3399, - "effective": 3059, - "selling": 3059, - "currency_code": "INR" - } - }, - "availability": { - "sizes": [ - "OS" - ], - "other_store_quantity": 2, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 778937, - "name": "Colourful Carnival Bouncer", - "slug": "fisher-price-colourful-carnival-bouncer-778937-fafa1f", - "brand": { - "uid": 963, - "name": "Fisher-Price" - }, - "categories": [ - { - "uid": 576, - "name": "Cradles" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/963_PWUPC01977/1_1545308400588.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/963_PWUPC01977/1_1545308400588.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/fisher-price-colourful-carnival-bouncer-778937-fafa1f/", - "query": { - "product_slug": [ - "fisher-price-colourful-carnival-bouncer-778937-fafa1f" - ] - } - } - }, - "coupon_message": "", - "quantity": 1, - "message": "", - "bulk_offer": {}, - "discount": "11% OFF" - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "cart_id": 7927, - "uid": "7927", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Tue, 03 Sep 2019 06:00:43 GMT", - "restrict_checkout": false, - "is_valid": true - }, - "result": {} - } -} -``` -
    - -
    -  Sorry, item is out of stock - -```json -{ - "value": { - "message": "Sorry, item is out of stock", - "success": false, - "cart": { - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": -202000, - "fynd_cash": 0, - "gst_charges": 4804.71, - "mrp_total": 302899, - "subtotal": 100899, - "total": 100899, - "vog": 96094.29, - "you_saved": 0 - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 302899, - "currency_code": "INR" - }, - { - "display": "Discount", - "key": "discount", - "value": -202000, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 100899, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 100899, - "currency_code": "INR" - } - ], - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - } - }, - "items": [ - { - "bulk_offer": {}, - "discount": "67% OFF", - "article": { - "type": "article", - "uid": "604_902_SSTC60401_636BLUE_1", - "size": "1", - "seller": { - "uid": 604, - "name": "SHRI SHANTINATH TRADING COMPANY" - }, - "store": { - "uid": 4579, - "name": "Gandhi Nagar" - }, - "quantity": 108, - "price": { - "base": { - "marked": 2999, - "effective": 999, - "currency_code": "INR" - }, - "converted": { - "marked": 2999, - "effective": 999, - "currency_code": "INR" - } - } - }, - "coupon_message": "", - "key": "707569_1", - "availability": { - "sizes": [ - "1", - "8", - "7", - "2", - "9", - "5", - "3", - "6" - ], - "other_store_quantity": 7, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 707569, - "name": "Blue and Gold Printed Ethnic Set", - "slug": "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a", - "brand": { - "uid": 902, - "name": "" - }, - "categories": [ - { - "uid": 525, - "name": "" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/v1/products/aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a/", - "query": { - "product_slug": [ - "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a" - ] - } - } - }, - "price": { - "base": { - "add_on": 100899, - "marked": 302899, - "effective": 100899, - "selling": 100899, - "currency_code": "INR" - }, - "converted": { - "add_on": 100899, - "marked": 302899, - "effective": 100899, - "selling": 100899, - "currency_code": "INR" - } - }, - "message": "", - "quantity": 101 - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "cart_id": 54, - "uid": "54", - "gstin": null, - "checkout_mode": "self", - "restrict_checkout": false, - "is_valid": false, - "last_modified": "Tue, 03 Sep 2019 09:55:40 GMT" - }, - "result": {} - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateCart -Update items in the cart - - - -```swift -cart.updateCart(id: id, i: i, b: b, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | | -| i | Bool? | no | | -| b | Bool? | no | | -| body | [UpdateCartRequest](#UpdateCartRequest) | no | Request body | - - -Use this API to update items added to the cart with the help of a request object containing attributes like item_quantity and item_size. These attributes will be fetched from the following APIs

    • operation Operation for current api call. update_item for update items. remove_item for removing items.
    • item_id "/platform/content/v1/products/"
    • item_size "/platform/content/v1/products/{slug}/sizes/"
    • quantity item quantity (must be greater than or equal to 1)
    • article_id "/content​/v1​/products​/{identifier}​/sizes​/price​/"
    • item_index item position in the cart (must be greater than or equal to 0)
    - -*Returned Response:* - - - - -[UpdateCartDetailResponse](#UpdateCartDetailResponse) - -Success. Updates and returns a cart object as shown below. Refer `UpdateCartDetailResponse` for more details. - - - - -
    -  Examples: - - -
    -  Nothing updated - -```json -{ - "value": { - "cart": { - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": -202000, - "fynd_cash": 0, - "gst_charges": 4804.71, - "mrp_total": 302899, - "subtotal": 100899, - "total": 100899, - "vog": 96094.29, - "you_saved": 0 - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 302899, - "currency_code": "INR" - }, - { - "display": "Discount", - "key": "discount", - "value": -202000, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 100899, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 100899, - "currency_code": "INR" - } - ], - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - } - }, - "items": [ - { - "bulk_offer": {}, - "discount": "67% OFF", - "article": { - "type": "article", - "uid": "604_902_SSTC60401_636BLUE_1", - "size": "1", - "seller": { - "uid": 604, - "name": "SHRI SHANTINATH TRADING COMPANY" - }, - "store": { - "uid": 4579, - "name": "Gandhi Nagar" - }, - "quantity": 108, - "price": { - "base": { - "marked": 2999, - "effective": 999, - "currency_code": "INR" - }, - "converted": { - "marked": 2999, - "effective": 999, - "currency_code": "INR" - } - } - }, - "coupon_message": "", - "key": "707569_1", - "availability": { - "sizes": [ - "1", - "8", - "7", - "2", - "9", - "5", - "3", - "6" - ], - "other_store_quantity": 7, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 707569, - "name": "Blue and Gold Printed Ethnic Set", - "slug": "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a", - "brand": { - "uid": 902, - "name": "" - }, - "categories": [ - { - "uid": 525, - "name": "" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/v1/products/aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a/", - "query": { - "product_slug": [ - "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a" - ] - } - } - }, - "price": { - "base": { - "add_on": 100899, - "marked": 302899, - "effective": 100899, - "selling": 100899, - "currency_code": "INR" - }, - "converted": { - "add_on": 100899, - "marked": 302899, - "effective": 100899, - "selling": 100899, - "currency_code": "INR" - } - }, - "message": "", - "quantity": 101 - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "cart_id": 54, - "uid": "54", - "gstin": null, - "checkout_mode": "self", - "restrict_checkout": false, - "is_valid": true, - "last_modified": "Tue, 03 Sep 2019 10:19:20 GMT" - }, - "result": { - "707569_90": { - "success": true, - "message": "Nothing updated" - } - }, - "message": "Nothing updated", - "success": true - } -} -``` -
    - -
    -  Item updated in the cart - -```json -{ - "value": { - "cart": { - "breakup_values": { - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - }, - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - }, - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 838.83, - "mrp_total": 5499, - "subtotal": 5499, - "total": 5499, - "vog": 4660.17, - "you_saved": 0 - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 5499, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 5499, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 5499, - "currency_code": "INR" - } - ] - }, - "items": [ - { - "key": "437414_7", - "message": "", - "bulk_offer": {}, - "price": { - "base": { - "add_on": 5499, - "marked": 5499, - "effective": 5499, - "selling": 5499, - "currency_code": "INR" - }, - "converted": { - "add_on": 5499, - "marked": 5499, - "effective": 5499, - "selling": 5499, - "currency_code": "INR" - } - }, - "quantity": 1, - "discount": "", - "product": { - "type": "product", - "uid": 437414, - "name": "Suede Classic", - "slug": "puma-suede-classic-437414-6e6bbf", - "brand": { - "uid": 9, - "name": "Puma" - }, - "categories": [ - { - "uid": 165, - "name": "Outdoor Sports Shoes" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/9_35656851/1_1511171811830.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/9_35656851/1_1511171811830.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/puma-suede-classic-437414-6e6bbf/", - "query": { - "product_slug": [ - "puma-suede-classic-437414-6e6bbf" - ] - } - } - }, - "article": { - "type": "article", - "uid": "507_9_96099_35656851_7", - "size": "7", - "seller": { - "uid": 507, - "name": "PUMA SPORTS INDIA PVT LTD" - }, - "store": { - "uid": 3632, - "name": "Colaba Causway" - }, - "quantity": 5, - "price": { - "base": { - "marked": 5499, - "effective": 5499, - "currency_code": "INR" - }, - "converted": { - "marked": 5499, - "effective": 5499, - "currency_code": "INR" - } - } - }, - "coupon_message": "", - "availability": { - "sizes": [ - "10", - "11", - "6", - "9", - "7", - "8" - ], - "other_store_quantity": 22, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - } - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "cart_id": 12426, - "uid": "12426", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Thu, 22 Aug 2019 04:51:42 GMT", - "restrict_checkout": false, - "is_valid": true - }, - "result": { - "437414_7": { - "success": true, - "message": "Item updated in the bag" - } - }, - "message": "Item updated in the bag", - "success": true - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getItemCount -Count items in the cart - - - -```swift -cart.getItemCount(id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | The unique identifier of the cart. | - - - -Use this API to get the total number of items present in cart. - -*Returned Response:* - - - - -[CartItemCountResponse](#CartItemCountResponse) - -Success. Returns the total count of items in a user's cart. - - - - -
    -  Example: - -```json -{ - "user_cart_items_count": 0 -} -``` -
    - - - - - - - - - ---- - - -#### getCoupons -Fetch Coupon - - - -```swift -cart.getCoupons(id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | | - - - -Use this API to get a list of available coupons along with their details. - -*Returned Response:* - - - - -[GetCouponResponse](#GetCouponResponse) - -Success. Returns a coupon object which has a list of all the eligible coupons. Refer `GetCouponResponse` for more details. - - - - -
    -  Example: - -```json -{ - "available_coupon_list": [ - { - "coupon_value": 500, - "minimum_cart_value": 0, - "coupon_code": "RAJA500", - "title": "RAJA500 | Fynd coupon", - "sub_title": "NA", - "message": "TEST500", - "max_discount_value": 500, - "uid": 17921, - "is_applicable": true, - "is_applied": false, - "expires_on": "28 Aug, 19" - }, - { - "coupon_value": 2250, - "minimum_cart_value": 0, - "coupon_code": "PRISMC22250111", - "title": "celio 2 time coupn to kalim hsp", - "sub_title": "celio 2 time coupn to kalim hsp", - "message": "celio 2 time coupn to kalim hsp", - "max_discount_value": 2250, - "uid": 17743, - "is_applicable": true, - "is_applied": false, - "expires_on": "24 Jan, 20" - } - ], - "page": { - "current": 1, - "total": 0, - "has_previous": false, - "has_next": false, - "total_item_count": 0 - } -} -``` -
    - - - - - - - - - ---- - - -#### applyCoupon -Apply Coupon - - - -```swift -cart.applyCoupon(i: i, b: b, p: p, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| i | Bool? | no | | -| b | Bool? | no | | -| p | Bool? | no | | -| id | String? | no | | -| body | [ApplyCouponRequest](#ApplyCouponRequest) | no | Request body | - - -Use this API to apply coupons on items in the cart. - -*Returned Response:* - - - - -[CartDetailResponse](#CartDetailResponse) - -Success. Returns coupons applied to the cart along with item details and price breakup. Refer `CartDetailResponse` for more details. - - - - -
    -  Example: - -```json -{ - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": -2250, - "delivery_charge": 0, - "discount": -7240.2163, - "fynd_cash": 0, - "gst_charges": 2139.08, - "mrp_total": 26983, - "subtotal": 19742.7837, - "total": 17492.7837, - "vog": 15353.7, - "you_saved": 0 - }, - "coupon": { - "type": "cash", - "code": "PRISMC22250111", - "uid": 17743, - "value": 2250, - "is_applied": true, - "message": "coupn applied" - }, - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 26983, - "currency_code": "INR" - }, - { - "display": "Discount", - "key": "discount", - "value": -7240, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 19743, - "currency_code": "INR" - }, - { - "display": "Coupon", - "key": "coupon", - "value": -2250, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 17493, - "currency_code": "INR" - } - ] - }, - "items": [ - { - "availability": { - "sizes": [ - "10" - ], - "other_store_quantity": 0, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 751083, - "name": "Carson 2", - "slug": "puma-carson-2-751083-6ad98d", - "brand": { - "uid": 9, - "name": "Puma" - }, - "categories": [ - { - "uid": 165, - "name": "Outdoor Sports Shoes" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/9_19100302/1_1542807042296.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/9_19100302/1_1542807042296.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/puma-carson-2-751083-6ad98d/", - "query": { - "product_slug": [ - "puma-carson-2-751083-6ad98d" - ] - } - } - }, - "quantity": 4, - "discount": "41% OFF", - "price": { - "base": { - "add_on": 9596, - "marked": 15996, - "effective": 9596, - "selling": 9596, - "currency_code": "INR" - }, - "converted": { - "add_on": 9596, - "marked": 15996, - "effective": 9596, - "selling": 9596, - "currency_code": "INR" - } - }, - "message": "", - "bulk_offer": {}, - "key": "751083_10", - "coupon_message": "", - "article": { - "type": "article", - "uid": "612_9_SE61201_19100302_10", - "size": "10", - "seller": { - "uid": 612, - "name": "SSR ENTERPRISE" - }, - "store": { - "uid": 4431, - "name": "Motilal Nagar 1, Goregaon" - }, - "quantity": 4, - "price": { - "base": { - "marked": 3999, - "effective": 2399, - "currency_code": "INR" - }, - "converted": { - "marked": 3999, - "effective": 2399, - "currency_code": "INR" - } - } - } - }, - { - "availability": { - "sizes": [ - "L", - "M", - "S", - "XL", - "XXL" - ], - "other_store_quantity": 0, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 246228, - "name": "Blue Solid T-Shirt", - "slug": "superdry-blue-solid-t-shirt-2", - "brand": { - "uid": 235, - "name": "Superdry" - }, - "categories": [ - { - "uid": 192, - "name": "T-Shirts" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/235_M11029ONDSXNS/1.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/235_M11029ONDSXNS/1.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/superdry-blue-solid-t-shirt-2/", - "query": { - "product_slug": [ - "superdry-blue-solid-t-shirt-2" - ] - } - } - }, - "quantity": 1, - "discount": "", - "price": { - "base": { - "add_on": 4490, - "marked": 4490, - "effective": 4490, - "selling": 4490, - "currency_code": "INR" - }, - "converted": { - "add_on": 4490, - "marked": 4490, - "effective": 4490, - "selling": 4490, - "currency_code": "INR" - } - }, - "message": "", - "bulk_offer": {}, - "key": "246228_S", - "coupon_message": "", - "article": { - "type": "article", - "uid": "46_235_TM62_M11029ONDSXNS_S", - "size": "S", - "seller": { - "uid": 46, - "name": "RELIANCE BRANDS LIMITED" - }, - "store": { - "uid": 4550, - "name": "VR Mall" - }, - "quantity": 1, - "price": { - "base": { - "marked": 4490, - "effective": 4490, - "currency_code": "INR" - }, - "converted": { - "marked": 4490, - "effective": 4490, - "currency_code": "INR" - } - } - } - }, - { - "availability": { - "sizes": [ - "XL", - "M", - "L", - "S" - ], - "other_store_quantity": 8, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 443175, - "name": "Light Blue Denim Jeggings", - "slug": "go-colors-light-blue-denim-jeggings-443175-3c688c", - "brand": { - "uid": 207, - "name": "Go Colors" - }, - "categories": [ - { - "uid": 267, - "name": "Jeggings" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/207_LJ03LBLUDN88/1_1512382513548.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/207_LJ03LBLUDN88/1_1512382513548.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/go-colors-light-blue-denim-jeggings-443175-3c688c/", - "query": { - "product_slug": [ - "go-colors-light-blue-denim-jeggings-443175-3c688c" - ] - } - } - }, - "quantity": 1, - "discount": "", - "price": { - "base": { - "add_on": 1599, - "marked": 1599, - "effective": 1599, - "selling": 1599, - "currency_code": "INR" - }, - "converted": { - "add_on": 1599, - "marked": 1599, - "effective": 1599, - "selling": 1599, - "currency_code": "INR" - } - }, - "message": "", - "bulk_offer": {}, - "key": "443175_S", - "coupon_message": "", - "article": { - "type": "article", - "uid": "162_207_1271_LJ03LBLUDN88_S", - "size": "S", - "seller": { - "uid": 162, - "name": "GO FASHION INDIA PRIVATE LIMITED" - }, - "store": { - "uid": 5784, - "name": "Vega City mall" - }, - "quantity": 3, - "price": { - "base": { - "marked": 1599, - "effective": 1599, - "currency_code": "INR" - }, - "converted": { - "marked": 1599, - "effective": 1599, - "currency_code": "INR" - } - } - } - }, - { - "availability": { - "sizes": [ - "OS" - ], - "other_store_quantity": 12, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 842716, - "name": "Blue Backpack", - "slug": "istorm-blue-backpack-842716-951b5a", - "brand": { - "uid": 1177, - "name": "iStorm" - }, - "categories": [ - { - "uid": 198, - "name": "Backpacks" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1177_IS483/1_1551353288247.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1177_IS483/1_1551353288247.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/istorm-blue-backpack-842716-951b5a/", - "query": { - "product_slug": [ - "istorm-blue-backpack-842716-951b5a" - ] - } - } - }, - "quantity": 1, - "discount": "34% OFF", - "price": { - "base": { - "add_on": 998.7837, - "marked": 1499, - "effective": 998.7837, - "selling": 998.7837, - "currency_code": "INR" - }, - "converted": { - "add_on": 998.7837, - "marked": 1499, - "effective": 998.7837, - "selling": 998.7837, - "currency_code": "INR" - } - }, - "message": "", - "bulk_offer": {}, - "key": "842716_OS", - "coupon_message": "", - "article": { - "type": "article", - "uid": "638_1177_CRSL63802_IS483_OS", - "size": "OS", - "seller": { - "uid": 638, - "name": "COUNFREEDISE RETAIL SERVICES LTD" - }, - "store": { - "uid": 4630, - "name": "Bhiwandi" - }, - "quantity": 4, - "price": { - "base": { - "marked": 1499, - "effective": 998.7837, - "currency_code": "INR" - }, - "converted": { - "marked": 1499, - "effective": 998.7837, - "currency_code": "INR" - } - } - } - }, - { - "availability": { - "sizes": [ - "OS" - ], - "other_store_quantity": 2, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 778937, - "name": "Colourful Carnival Bouncer", - "slug": "fisher-price-colourful-carnival-bouncer-778937-fafa1f", - "brand": { - "uid": 963, - "name": "Fisher-Price" - }, - "categories": [ - { - "uid": 576, - "name": "Cradles" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/963_PWUPC01977/1_1545308400588.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/963_PWUPC01977/1_1545308400588.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/fisher-price-colourful-carnival-bouncer-778937-fafa1f/", - "query": { - "product_slug": [ - "fisher-price-colourful-carnival-bouncer-778937-fafa1f" - ] - } - } - }, - "quantity": 1, - "discount": "11% OFF", - "price": { - "base": { - "add_on": 3059, - "marked": 3399, - "effective": 3059, - "selling": 3059, - "currency_code": "INR" - }, - "converted": { - "add_on": 3059, - "marked": 3399, - "effective": 3059, - "selling": 3059, - "currency_code": "INR" - } - }, - "message": "", - "bulk_offer": {}, - "key": "778937_OS", - "coupon_message": "", - "article": { - "type": "article", - "uid": "686_963_IC68601_PWUPC01977_OS", - "size": "OS", - "seller": { - "uid": 686, - "name": "INDUS CORPORATION" - }, - "store": { - "uid": 5059, - "name": "Vidyaranyapura Main Road" - }, - "quantity": 3, - "price": { - "base": { - "marked": 3399, - "effective": 3059, - "currency_code": "INR" - }, - "converted": { - "marked": 3399, - "effective": 3059, - "currency_code": "INR" - } - } - } - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "cart_id": 7927, - "uid": "7927", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Wed, 04 Sep 2019 04:52:21 GMT", - "restrict_checkout": false, - "is_valid": true -} -``` -
    - - - - - - - - - ---- - - -#### removeCoupon -Remove Coupon Applied - - - -```swift -cart.removeCoupon(id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | The unique identifier of the cart | - - - -Remove Coupon applied on the cart by passing uid in request body. - -*Returned Response:* - - - - -[CartDetailResponse](#CartDetailResponse) - -Success. Returns coupons removed from the cart along with item details and price breakup. Refer `CartDetailResponse` for more details. - - - - -
    -  Example: - -```json -{ - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 342.75, - "mrp_total": 3199, - "subtotal": 3199, - "total": 3199, - "vog": 2856.25, - "you_saved": 0 - }, - "coupon": { - "type": "cash", - "code": "prismc22250111", - "uid": 17743, - "value": 0, - "is_applied": false, - "message": "Coupon successfully removed" - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 3199, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 3199, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 3199, - "currency_code": "INR" - } - ], - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - } - }, - "items": [ - { - "message": "", - "availability": { - "sizes": [ - "M", - "S", - "L", - "XXL", - "XL" - ], - "other_store_quantity": 10, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "bulk_offer": {}, - "key": "857596_S", - "quantity": 1, - "price": { - "base": { - "add_on": 3199, - "marked": 3199, - "effective": 3199, - "selling": 3199, - "currency_code": "INR" - }, - "converted": { - "add_on": 3199, - "marked": 3199, - "effective": 3199, - "selling": 3199, - "currency_code": "INR" - } - }, - "discount": "", - "coupon_message": "", - "product": { - "type": "product", - "uid": 857596, - "name": "Pink Solid Hoodie", - "slug": "883-police-pink-solid-hoodie-857596-111bdc", - "brand": { - "uid": 610, - "name": "883 Police" - }, - "categories": [ - { - "uid": 144, - "name": "Hoodies" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/883-police-pink-solid-hoodie-857596-111bdc/", - "query": { - "product_slug": [ - "883-police-pink-solid-hoodie-857596-111bdc" - ] - } - } - }, - "article": { - "type": "article", - "uid": "381_610_IGPL01_LETTER19APINK_S", - "size": "S", - "seller": { - "uid": 381, - "name": "INTERSOURCE GARMENTS PVT LTD" - }, - "store": { - "uid": 3009, - "name": "Kormangala" - }, - "quantity": 11, - "price": { - "base": { - "marked": 3199, - "effective": 3199, - "currency_code": "INR" - }, - "converted": { - "marked": 3199, - "effective": 3199, - "currency_code": "INR" - } - } - } - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "cart_id": 7477, - "uid": "7477", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Thu, 22 Aug 2019 10:55:05 GMT", - "restrict_checkout": false, - "is_valid": true -} -``` -
    - - - - - - - - - ---- - - -#### getBulkDiscountOffers -Get discount offers based on quantity - - - -```swift -cart.getBulkDiscountOffers(itemId: itemId, articleId: articleId, uid: uid, slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| itemId | Int? | no | The Item ID of the product | -| articleId | String? | no | Article Mongo ID | -| uid | Int? | no | UID of the product | -| slug | String? | no | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | - - - -Use this API to get a list of applicable offers along with current, next and best offer for given product. Either one of uid, item_id, slug should be present. - -*Returned Response:* - - - - -[BulkPriceResponse](#BulkPriceResponse) - -Success. Returns a data object containing the seller details and available offers (if exists) on bulk products. Refer `BulkPriceResponse` for more details. - - - - -
    -  Examples: - - -
    -  Offers found - -```json -{ - "value": { - "data": [ - { - "seller": { - "uid": 248, - "name": "MANYAVAR CREATIONS PRIVATE LIMITED" - }, - "offers": [ - { - "quantity": 1, - "auto_applied": true, - "margin": 10, - "type": "bundle", - "price": { - "marked": 3999, - "effective": 3999, - "bulk_effective": 3599.1, - "currency_code": "INR" - }, - "total": 3599.1 - }, - { - "quantity": 3, - "auto_applied": true, - "margin": 20, - "type": "bundle", - "price": { - "marked": 3999, - "effective": 3999, - "bulk_effective": 3199.2, - "currency_code": "INR" - }, - "total": 9597.6 - }, - { - "quantity": 9, - "auto_applied": true, - "margin": 30, - "type": "bundle", - "price": { - "marked": 3999, - "effective": 3999, - "bulk_effective": 3443.4444444444, - "currency_code": "INR" - }, - "total": 30991, - "best": true - } - ] - } - ] - } -} -``` -
    - -
    -  Offers not found - -```json -{ - "value": { - "data": [] - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### applyRewardPoints -Apply reward points at cart - - - -```swift -cart.applyRewardPoints(id: id, i: i, b: b, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | | -| i | Bool? | no | | -| b | Bool? | no | | -| body | [RewardPointRequest](#RewardPointRequest) | no | Request body | - - -Use this API to redeem a fixed no. of reward points by applying it to the cart. - -*Returned Response:* - - - - -[CartDetailResponse](#CartDetailResponse) - -Success. Returns a Cart object. Check the example shown below or refer `CartDetailResponse` for more details. - - - - -
    -  Example: - -```json -{ - "items": [ - { - "bulk_offer": {}, - "discount": "67% OFF", - "article": { - "type": "article", - "uid": "604_902_SSTC60401_636BLUE_1", - "size": "1", - "seller": { - "uid": 604, - "name": "SHRI SHANTINATH TRADING COMPANY" - }, - "store": { - "uid": 4579, - "name": "Gandhi Nagar" - }, - "quantity": 108, - "price": { - "base": { - "marked": 2999, - "effective": 999, - "currency_code": "INR" - }, - "converted": { - "marked": 2999, - "effective": 999, - "currency_code": "INR" - } - } - }, - "coupon_message": "", - "key": "707569_1", - "availability": { - "sizes": [ - "1", - "8", - "7", - "2", - "9", - "5", - "3", - "6" - ], - "other_store_quantity": 107, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 707569, - "name": "Blue and Gold Printed Ethnic Set", - "slug": "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a", - "brand": { - "uid": 902, - "name": "" - }, - "categories": [ - { - "uid": 525, - "name": "" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/v1/products/aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a/", - "query": { - "product_slug": [ - "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a" - ] - } - } - }, - "price": { - "base": { - "add_on": 999, - "marked": 2999, - "effective": 999, - "selling": 999, - "currency_code": "INR" - }, - "converted": { - "add_on": 999, - "marked": 2999, - "effective": 999, - "selling": 999, - "currency_code": "INR" - } - }, - "message": "", - "quantity": 1 - } - ], - "cart_id": 54, - "uid": "54", - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": -2000, - "fynd_cash": 0, - "gst_charges": 47.57, - "mrp_total": 2999, - "subtotal": 999, - "total": 999, - "vog": 951.43, - "you_saved": 0 - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 2999, - "currency_code": "INR" - }, - { - "display": "Discount", - "key": "discount", - "value": -2000, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 999, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 999, - "currency_code": "INR" - } - ], - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - } - }, - "delivery_charge_info": "", - "coupon_text": "View all offers", - "gstin": null, - "checkout_mode": "self", - "restrict_checkout": false, - "is_valid": true, - "last_modified": "Tue, 03 Sep 2019 05:35:59 GMT" -} -``` -
    - - - - - - - - - ---- - - -#### getAddresses -Fetch address - - - -```swift -cart.getAddresses(cartId: cartId, mobileNo: mobileNo, checkoutMode: checkoutMode, tags: tags, isDefault: isDefault) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| cartId | String? | no | | -| mobileNo | String? | no | | -| checkoutMode | String? | no | | -| tags | String? | no | | -| isDefault | Bool? | no | | - - - -Use this API to get all the addresses associated with an account. If successful, returns a Address resource in the response body specified in GetAddressesResponse.attibutes listed below are optional
    • uid
    • address_id
    • mobile_no
    • checkout_mode
    • tags
    • default
    - -*Returned Response:* - - - - -[GetAddressesResponse](#GetAddressesResponse) - -Success. Returns an Address object containing a list of address saved in the account. Refer `GetAddressesResponse` for more details. - - - - -
    -  Example: - -```json -{ - "address": [ - { - "landmark": "", - "area_code": { - "slug": "pincode", - "id": 400093 - }, - "id": "8b526f521bb14a2593a8b9e3ce8c76b3", - "state": "Maharashtra", - "meta": {}, - "user_id": "8b526f521bb14a2593a8b9e3ce8c76b3", - "country_code": "IND", - "phone": 9915347757, - "geo_location": {}, - "country": "India", - "is_default_address": true, - "is_active": true, - "city": "Mumbai", - "pincode": 400093, - "checkout_mode": "self", - "address_type": "home", - "tags": [], - "area": "Sector 127", - "name": "abc", - "email": "ankur@gofynd1.com", - "address": "Megatron2", - "store_name": "store123" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### addAddress -Add address to an account - - - -```swift -cart.addAddress(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [Address](#Address) | no | Request body | - - -Use this API to add an address to an account. - -*Returned Response:* - - - - -[SaveAddressResponse](#SaveAddressResponse) - -Success. Returns the address ID, a flag whether the address is set as default, and a success message. Refer `SaveAddressResponse` for more details. - - - - -
    -  Example: - -```json -{ - "id": "mongo_object_id", - "is_default_address": true, - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getAddressById -Fetch a single address by its ID - - - -```swift -cart.getAddressById(id: id, cartId: cartId, mobileNo: mobileNo, checkoutMode: checkoutMode, tags: tags, isDefault: isDefault) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String | yes | | -| cartId | String? | no | | -| mobileNo | String? | no | | -| checkoutMode | String? | no | | -| tags | String? | no | | -| isDefault | Bool? | no | | - - - -Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional
    • mobile_no
    • checkout_mode
    • tags
    • default
    - -*Returned Response:* - - - - -[Address](#Address) - -Success. Returns an Address object containing a list of address saved in the account. Refer `Address` for more details. - - - - -
    -  Example: - -```json -{ - "landmark": "", - "area_code": { - "slug": "pincode", - "id": 400093 - }, - "state": "Maharashtra", - "meta": {}, - "user_id": "8b526f521bb14a2593a8b9e3ce8c76b3", - "country_code": "IND", - "phone": 9915347757, - "geo_location": {}, - "country": "India", - "is_default_address": true, - "is_active": true, - "city": "Mumbai", - "pincode": 400093, - "checkout_mode": "self", - "address_type": "home", - "uid": 1145, - "tags": [], - "area": "Sector 127", - "name": "abc", - "address_id": 1145, - "email": "ankur@gofynd1.com", - "address": "Megatron2", - "store_name": "store123" -} -``` -
    - - - - - - - - - ---- - - -#### updateAddress -Update address added to an account - - - -```swift -cart.updateAddress(id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String | yes | ID allotted to the selected address | -| body | [Address](#Address) | no | Request body | - - -Use this API to update an existing address in the account. Request object should contain attributes mentioned in Address can be updated. These attributes are:

    • is_default_address
    • landmark
    • area
    • pincode
    • email
    • address_type
    • name
    • address_id
    • address
    - -*Returned Response:* - - - - -[UpdateAddressResponse](#UpdateAddressResponse) - -Success. Returns the address ID and a message indicating a successful address updation. - - - - -
    -  Example: - -```json -{ - "is_updated": true, - "id": "", - "is_default_address": true, - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### removeAddress -Remove address associated with an account - - - -```swift -cart.removeAddress(id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String | yes | ID allotted to the selected address | - - - -Use this API to delete an address by its ID. This will returns an object that will indicate whether the address was deleted successfully or not. - -*Returned Response:* - - - - -[DeleteAddressResponse](#DeleteAddressResponse) - -Returns a Status object indicating the success or failure of address deletion. - - - - -
    -  Example: - -```json -{ - "id": "", - "is_deleted": true -} -``` -
    - - - - - - - - - ---- - - -#### selectAddress -Select an address from available addresses - - - -```swift -cart.selectAddress(cartId: cartId, i: i, b: b, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| cartId | String? | no | | -| i | Bool? | no | | -| b | Bool? | no | | -| body | [SelectCartAddressRequest](#SelectCartAddressRequest) | no | Request body | - - -

    Select Address from all addresses associated with the account in order to ship the cart items to that address, otherwise default address will be selected implicitly. See `SelectCartAddressRequest` in schema of request body for the list of attributes needed to select Address from account. On successful request, this API returns a Cart object. Below address attributes are required.

    • address_id
    • billing_address_id
    • uid
    - -*Returned Response:* - - - - -[CartDetailResponse](#CartDetailResponse) - -Success. Returns a Cart object as shown below. Refer `CartDetailResponse` for more details. . - - - - -
    -  Example: - -```json -{ - "is_valid": true, - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": -2250, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 315.86, - "mrp_total": 5198, - "subtotal": 5198, - "total": 2948, - "vog": 2632.15, - "you_saved": 0 - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 5198, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 5198, - "currency_code": "INR" - }, - { - "display": "Coupon", - "key": "coupon", - "value": -2250, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 2948, - "currency_code": "INR" - } - ], - "coupon": { - "type": "cash", - "code": "PRISMC22250111", - "uid": 17743, - "value": 2250, - "is_applied": true, - "message": "coupn applied" - }, - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - } - }, - "items": [ - { - "message": "", - "quantity": 1, - "availability": { - "sizes": [ - "M", - "S", - "L", - "XXL", - "XL" - ], - "other_store_quantity": 10, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "coupon_message": "PRISMC22250111 coupon applied", - "price": { - "base": { - "add_on": 3199, - "marked": 3199, - "effective": 3199, - "selling": 3199, - "currency_code": "INR" - }, - "converted": { - "add_on": 3199, - "marked": 3199, - "effective": 3199, - "selling": 3199, - "currency_code": "INR" - } - }, - "bulk_offer": {}, - "article": { - "type": "article", - "uid": "381_610_IGPL01_LETTER19APINK_S", - "size": "S", - "seller": { - "uid": 381, - "name": "INTERSOURCE GARMENTS PVT LTD" - }, - "store": { - "uid": 3009, - "name": "Kormangala" - }, - "quantity": 11, - "price": { - "base": { - "marked": 3199, - "effective": 3199, - "currency_code": "INR" - }, - "converted": { - "marked": 3199, - "effective": 3199, - "currency_code": "INR" - } - } - }, - "product": { - "type": "product", - "uid": 857596, - "name": "Pink Solid Hoodie", - "slug": "883-police-pink-solid-hoodie-857596-111bdc", - "brand": { - "uid": 610, - "name": "883 Police" - }, - "categories": [ - { - "uid": 144, - "name": "Hoodies" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/883-police-pink-solid-hoodie-857596-111bdc/", - "query": { - "product_slug": [ - "883-police-pink-solid-hoodie-857596-111bdc" - ] - } - } - }, - "key": "857596_S", - "discount": "" - }, - { - "message": "", - "quantity": 1, - "availability": { - "sizes": [ - "L", - "XL", - "XXL" - ], - "other_store_quantity": 1, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "coupon_message": "PRISMC22250111 coupon applied", - "price": { - "base": { - "add_on": 1999, - "marked": 1999, - "effective": 1999, - "selling": 1999, - "currency_code": "INR" - }, - "converted": { - "add_on": 1999, - "marked": 1999, - "effective": 1999, - "selling": 1999, - "currency_code": "INR" - } - }, - "bulk_offer": {}, - "article": { - "type": "article", - "uid": "381_610_IGPL01_SPIRAL19ANAVY_L", - "size": "L", - "seller": { - "uid": 381, - "name": "INTERSOURCE GARMENTS PVT LTD" - }, - "store": { - "uid": 3009, - "name": "Kormangala" - }, - "quantity": 2, - "price": { - "base": { - "marked": 1999, - "effective": 1999, - "currency_code": "INR" - }, - "converted": { - "marked": 1999, - "effective": 1999, - "currency_code": "INR" - } - } - }, - "product": { - "type": "product", - "uid": 820312, - "name": "Navy Blue Melange Shorts", - "slug": "883-police-navy-blue-melange-shorts-820312-4943a8", - "brand": { - "uid": 610, - "name": "883 Police" - }, - "categories": [ - { - "uid": 193, - "name": "Shorts" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/883-police-navy-blue-melange-shorts-820312-4943a8/", - "query": { - "product_slug": [ - "883-police-navy-blue-melange-shorts-820312-4943a8" - ] - } - } - }, - "key": "820312_L", - "discount": "" - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "uid": "7477", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Fri, 23 Aug 2019 08:03:12 GMT", - "restrict_checkout": false -} -``` -
    - - - - - - - - - ---- - - -#### selectPaymentMode -Update cart payment - - - -```swift -cart.selectPaymentMode(id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | | -| body | [UpdateCartPaymentRequest](#UpdateCartPaymentRequest) | no | Request body | - - -Use this API to update cart payment. - -*Returned Response:* - - - - -[CartDetailResponse](#CartDetailResponse) - -Success. Returns a Cart object as shown below. Refer `CartDetailResponse` for more details. - - - - -
    -  Example: - -```json -{ - "success": true, - "error_message": "Note: Your order delivery will be delayed by 7-10 Days", - "user_type": "Store User", - "cod_charges": 0, - "order_id": null, - "cod_available": true, - "cod_message": "No additional COD charges applicable", - "delivery_charges": 0, - "delivery_charge_order_value": 0, - "store_code": "", - "store_emps": [], - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": -2250, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 315.86, - "mrp_total": 5198, - "subtotal": 5198, - "total": 2948, - "vog": 2632.15, - "you_saved": 0 - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 5198, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 5198, - "currency_code": "INR" - }, - { - "display": "Coupon", - "key": "coupon", - "value": -2250, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 2948, - "currency_code": "INR" - } - ], - "coupon": { - "type": "cash", - "code": "PRISMC22250111", - "uid": 17743, - "value": 2250, - "is_applied": true, - "message": "coupn applied" - }, - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - } - }, - "items": [ - { - "message": "", - "quantity": 1, - "availability": { - "sizes": [ - "M", - "S", - "L", - "XXL", - "XL" - ], - "other_store_quantity": 10, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "coupon_message": "PRISMC22250111 coupon applied", - "price": { - "base": { - "add_on": 3199, - "marked": 3199, - "effective": 3199, - "selling": 3199, - "currency_code": "INR" - }, - "converted": { - "add_on": 3199, - "marked": 3199, - "effective": 3199, - "selling": 3199, - "currency_code": "INR" - } - }, - "bulk_offer": {}, - "article": { - "type": "article", - "uid": "381_610_IGPL01_LETTER19APINK_S", - "size": "S", - "seller": { - "uid": 381, - "name": "INTERSOURCE GARMENTS PVT LTD" - }, - "store": { - "uid": 3009, - "name": "Kormangala" - }, - "quantity": 11, - "price": { - "base": { - "marked": 3199, - "effective": 3199, - "currency_code": "INR" - }, - "converted": { - "marked": 3199, - "effective": 3199, - "currency_code": "INR" - } - } - }, - "product": { - "type": "product", - "uid": 857596, - "name": "Pink Solid Hoodie", - "slug": "883-police-pink-solid-hoodie-857596-111bdc", - "brand": { - "uid": 610, - "name": "883 Police" - }, - "categories": [ - { - "uid": 144, - "name": "Hoodies" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/883-police-pink-solid-hoodie-857596-111bdc/", - "query": { - "product_slug": [ - "883-police-pink-solid-hoodie-857596-111bdc" - ] - } - } - }, - "key": "857596_S", - "discount": "" - }, - { - "message": "", - "quantity": 1, - "availability": { - "sizes": [ - "L", - "XL", - "XXL" - ], - "other_store_quantity": 1, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "coupon_message": "PRISMC22250111 coupon applied", - "price": { - "base": { - "add_on": 1999, - "marked": 1999, - "effective": 1999, - "selling": 1999, - "currency_code": "INR" - }, - "converted": { - "add_on": 1999, - "marked": 1999, - "effective": 1999, - "selling": 1999, - "currency_code": "INR" - } - }, - "bulk_offer": {}, - "article": { - "type": "article", - "uid": "381_610_IGPL01_SPIRAL19ANAVY_L", - "size": "L", - "seller": { - "uid": 381, - "name": "INTERSOURCE GARMENTS PVT LTD" - }, - "store": { - "uid": 3009, - "name": "Kormangala" - }, - "quantity": 2, - "price": { - "base": { - "marked": 1999, - "effective": 1999, - "currency_code": "INR" - }, - "converted": { - "marked": 1999, - "effective": 1999, - "currency_code": "INR" - } - } - }, - "product": { - "type": "product", - "uid": 820312, - "name": "Navy Blue Melange Shorts", - "slug": "883-police-navy-blue-melange-shorts-820312-4943a8", - "brand": { - "uid": 610, - "name": "883 Police" - }, - "categories": [ - { - "uid": 193, - "name": "Shorts" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/883-police-navy-blue-melange-shorts-820312-4943a8/", - "query": { - "product_slug": [ - "883-police-navy-blue-melange-shorts-820312-4943a8" - ] - } - } - }, - "key": "820312_L", - "discount": "" - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "cart_id": 7477, - "uid": "7477", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Fri, 23 Aug 2019 08:03:04 GMT", - "restrict_checkout": false, - "is_valid": true -} -``` -
    - - - - - - - - - ---- - - -#### validateCouponForPayment -Verify the coupon eligibility against the payment mode - - - -```swift -cart.validateCouponForPayment(id: id, addressId: addressId, paymentMode: paymentMode, paymentIdentifier: paymentIdentifier, aggregatorName: aggregatorName, merchantCode: merchantCode) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | | -| addressId | String? | no | | -| paymentMode | String? | no | | -| paymentIdentifier | String? | no | | -| aggregatorName | String? | no | | -| merchantCode | String? | no | | - - - -Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc. - -*Returned Response:* - - - - -[PaymentCouponValidate](#PaymentCouponValidate) - -Success. Returns a success message and the coupon validity. Refer `PaymentCouponValidate` for more details. - - - - -
    -  Example: - -```json -{ - "success": true, - "message": "", - "coupon_validity": { - "valid": true, - "discount": 499.5, - "code": "testpayment", - "display_message_en": "", - "title": "Coupon value will change." - } -} -``` -
    - - - - - - - - - ---- - - -#### getShipments -Get delivery date and options before checkout - - - -```swift -cart.getShipments(p: p, id: id, addressId: addressId, areaCode: areaCode) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| p | Bool? | no | This is a boolean value. Select `true` for getting a payment option in response. | -| id | String? | no | The unique identifier of the cart | -| addressId | String? | no | ID allotted to the selected address | -| areaCode | String? | no | The PIN Code of the destination address, e.g. 400059 | - - - -Use this API to get shipment details, expected delivery date, items and price breakup of the shipment. - -*Returned Response:* - - - - -[CartShipmentsResponse](#CartShipmentsResponse) - -Success. Returns delivery promise along with shipment details and price breakup. Refer `CartShipmentsResponse` for more details. - - - - -
    -  Examples: - - -
    -  Shipment Generated - -```json -{ - "value": { - "items": [], - "cart_id": 7501, - "uid": "7501", - "success": true, - "error_message": "Note: Your order delivery will be delayed by 7-10 Days", - "payment_options": { - "payment_option": [ - { - "name": "COD", - "display_name": "Cash on Delivery", - "display_priority": 1, - "payment_mode_id": 11, - "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png" - }, - "list": [] - }, - { - "name": "CARD", - "display_priority": 2, - "payment_mode_id": 2, - "display_name": "Card", - "list": [] - }, - { - "name": "NB", - "display_priority": 3, - "payment_mode_id": 3, - "display_name": "Net Banking", - "list": [ - { - "aggregator_name": "Razorpay", - "bank_name": "ICICI Bank", - "bank_code": "ICIC", - "url": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png" - }, - "merchant_code": "NB_ICICI", - "display_priority": 1 - } - ] - }, - { - "name": "WL", - "display_priority": 4, - "payment_mode_id": 4, - "display_name": "Wallet", - "list": [ - { - "wallet_name": "Paytm", - "wallet_code": "paytm", - "wallet_id": 4, - "merchant_code": "PAYTM", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_small.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_large.png" - }, - "aggregator_name": "Juspay", - "display_priority": 1 - } - ] - }, - { - "name": "UPI", - "display_priority": 9, - "payment_mode_id": 6, - "display_name": "UPI", - "list": [ - { - "aggregator_name": "UPI_Razorpay", - "name": "UPI", - "display_name": "BHIM UPI", - "code": "UPI", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_100x78.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_150x100.png" - }, - "merchant_code": "UPI", - "timeout": 240, - "retry_count": 0, - "fynd_vpa": "shopsense.rzp@hdfcbank", - "intent_flow": true, - "intent_app_error_list": [ - "com.csam.icici.bank.imobile", - "in.org.npci.upiapp", - "com.whatsapp" - ] - } - ] - }, - { - "name": "PL", - "display_priority": 11, - "payment_mode_id": 1, - "display_name": "Pay Later", - "list": [ - { - "aggregator_name": "Simpl", - "name": "Simpl", - "code": "simpl", - "merchant_code": "SIMPL", - "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png" - } - } - ] - } - ], - "payment_flows": { - "Simpl": { - "data": { - "gateway": { - "route": "simpl", - "entity": "sdk", - "is_customer_validation_required": true, - "cust_validation_url": "https://api.addsale.com/gringotts/api/v1/validate-customer/", - "sdk": { - "config": { - "redirect": false, - "callback_url": null, - "action_url": "https://api.addsale.com/avis/api/v1/payments/charge-gringotts-transaction/" - }, - "data": { - "user_phone": "8452996729", - "user_email": "paymentsdummy@gofynd.com" - } - }, - "return_url": null - } - }, - "api_link": "", - "payment_flow": "sdk" - }, - "Juspay": { - "data": {}, - "api_link": "https://sandbox.juspay.in/txns", - "payment_flow": "api" - }, - "Razorpay": { - "data": {}, - "api_link": "", - "payment_flow": "sdk" - }, - "UPI_Razorpay": { - "data": {}, - "api_link": "https://api.addsale.com/gringotts/api/v1/external/payment-initialisation/", - "payment_flow": "api" - }, - "Fynd": { - "data": {}, - "api_link": "", - "payment_flow": "api" - } - }, - "default": {} - }, - "user_type": "Store User", - "cod_charges": 0, - "order_id": null, - "cod_available": true, - "cod_message": "No additional COD charges applicable", - "delivery_charges": 0, - "delivery_charge_order_value": 0, - "delivery_slots": [ - { - "date": "Sat, 24 Aug", - "delivery_slot": [ - { - "delivery_slot_timing": "By 9:00 PM", - "default": true, - "delivery_slot_id": 1 - } - ] - } - ], - "store_code": "", - "store_emps": [], - "breakup_values": { - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - }, - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 214.18, - "mrp_total": 1999, - "subtotal": 1999, - "total": 1999, - "vog": 1784.82, - "you_saved": 0 - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 1999, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 1999, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 1999, - "currency_code": "INR" - } - ] - }, - "shipments": [ - { - "fulfillment_id": 3009, - "shipment_type": "single_shipment", - "fulfillment_type": "store", - "dp_id": "29", - "dp_options": { - "4": { - "f_priority": 4, - "r_priority": 5, - "is_cod": true, - "is_prepaid": true, - "is_reverse": true - }, - "7": { - "f_priority": 3, - "r_priority": 4, - "is_cod": true, - "is_prepaid": true, - "is_reverse": true - }, - "29": { - "f_priority": 1, - "r_priority": 2, - "is_cod": true, - "is_prepaid": true, - "is_reverse": true - } - }, - "promise": { - "timestamp": { - "min": 1566678108, - "max": 1567023708 - }, - "formatted": { - "min": "Aug 24", - "max": "Aug 28" - } - }, - "box_type": "Small Courier bag", - "shipments": 1, - "items": [ - { - "quantity": 1, - "product": { - "type": "product", - "uid": 820312, - "name": "Navy Blue Melange Shorts", - "slug": "883-police-navy-blue-melange-shorts-820312-4943a8", - "brand": { - "uid": 610, - "name": "883 Police" - }, - "categories": [ - { - "uid": 193, - "name": "Shorts" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/883-police-navy-blue-melange-shorts-820312-4943a8/", - "query": { - "product_slug": [ - "883-police-navy-blue-melange-shorts-820312-4943a8" - ] - } - } - }, - "discount": "", - "bulk_offer": {}, - "key": "820312_L", - "price": { - "base": { - "add_on": 1999, - "marked": 1999, - "effective": 1999, - "selling": 1999, - "currency_code": "INR" - }, - "converted": { - "add_on": 1999, - "marked": 1999, - "effective": 1999, - "selling": 1999, - "currency_code": "INR" - } - }, - "article": { - "type": "article", - "uid": "381_610_IGPL01_SPIRAL19ANAVY_L", - "size": "L", - "seller": { - "uid": 381, - "name": "INTERSOURCE GARMENTS PVT LTD" - }, - "store": { - "uid": 3009, - "name": "Kormangala" - }, - "quantity": 2, - "price": { - "base": { - "marked": 1999, - "effective": 1999, - "currency_code": "INR" - }, - "converted": { - "marked": 1999, - "effective": 1999, - "currency_code": "INR" - } - } - }, - "availability": { - "sizes": [ - "L", - "XL", - "XXL" - ], - "other_store_quantity": 1, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "coupon_message": "", - "message": "" - } - ] - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Thu, 22 Aug 2019 20:21:48 GMT", - "restrict_checkout": false, - "is_valid": true - } -} -``` -
    - -
    -  Shipment Generation Failed - -```json -{ - "value": { - "items": [], - "cart_id": 7501, - "uid": "7501", - "success": true, - "error_message": "Note: Your order delivery will be delayed by 7-10 Days", - "payment_options": { - "payment_option": [ - { - "name": "COD", - "display_name": "Cash on Delivery", - "display_priority": 1, - "payment_mode_id": 11, - "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png" - }, - "list": [] - }, - { - "name": "CARD", - "display_priority": 2, - "payment_mode_id": 2, - "display_name": "Card", - "list": [] - }, - { - "name": "NB", - "display_priority": 3, - "payment_mode_id": 3, - "display_name": "Net Banking", - "list": [ - { - "aggregator_name": "Razorpay", - "bank_name": "ICICI Bank", - "bank_code": "ICIC", - "url": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png" - }, - "merchant_code": "NB_ICICI", - "display_priority": 1 - } - ] - }, - { - "name": "WL", - "display_priority": 4, - "payment_mode_id": 4, - "display_name": "Wallet", - "list": [ - { - "wallet_name": "Paytm", - "wallet_code": "paytm", - "wallet_id": 4, - "merchant_code": "PAYTM", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_small.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_large.png" - }, - "aggregator_name": "Juspay", - "display_priority": 1 - } - ] - }, - { - "name": "UPI", - "display_priority": 9, - "payment_mode_id": 6, - "display_name": "UPI", - "list": [ - { - "aggregator_name": "UPI_Razorpay", - "name": "UPI", - "display_name": "BHIM UPI", - "code": "UPI", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_100x78.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_150x100.png" - }, - "merchant_code": "UPI", - "timeout": 240, - "retry_count": 0, - "fynd_vpa": "shopsense.rzp@hdfcbank", - "intent_flow": true, - "intent_app_error_list": [ - "com.csam.icici.bank.imobile", - "in.org.npci.upiapp", - "com.whatsapp" - ] - } - ] - }, - { - "name": "PL", - "display_priority": 11, - "payment_mode_id": 1, - "display_name": "Pay Later", - "list": [ - { - "aggregator_name": "Simpl", - "name": "Simpl", - "code": "simpl", - "merchant_code": "SIMPL", - "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png" - } - } - ] - } - ], - "payment_flows": { - "Simpl": { - "data": { - "gateway": { - "route": "simpl", - "entity": "sdk", - "is_customer_validation_required": true, - "cust_validation_url": "https://api.addsale.com/gringotts/api/v1/validate-customer/", - "sdk": { - "config": { - "redirect": false, - "callback_url": null, - "action_url": "https://api.addsale.com/avis/api/v1/payments/charge-gringotts-transaction/" - }, - "data": { - "user_phone": "8452996729", - "user_email": "paymentsdummy@gofynd.com" - } - }, - "return_url": null - } - }, - "api_link": "", - "payment_flow": "sdk" - }, - "Juspay": { - "data": {}, - "api_link": "https://sandbox.juspay.in/txns", - "payment_flow": "api" - }, - "Razorpay": { - "data": {}, - "api_link": "", - "payment_flow": "sdk" - }, - "UPI_Razorpay": { - "data": {}, - "api_link": "https://api.addsale.com/gringotts/api/v1/external/payment-initialisation/", - "payment_flow": "api" - }, - "Fynd": { - "data": {}, - "api_link": "", - "payment_flow": "api" - } - }, - "default": {} - }, - "user_type": "Store User", - "cod_charges": 0, - "order_id": null, - "cod_available": true, - "cod_message": "No additional COD charges applicable", - "delivery_charges": 0, - "delivery_charge_order_value": 0, - "delivery_slots": [ - { - "date": "Sat, 24 Aug", - "delivery_slot": [ - { - "delivery_slot_timing": "By 9:00 PM", - "default": true, - "delivery_slot_id": 1 - } - ] - } - ], - "store_code": "", - "store_emps": [], - "breakup_values": { - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - }, - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 214.18, - "mrp_total": 1999, - "subtotal": 1999, - "total": 1999, - "vog": 1784.82, - "you_saved": 0 - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 1999, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 1999, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 1999, - "currency_code": "INR" - } - ] - }, - "shipments": [], - "message": "Shipments could not be generated. Please Try again after some time.", - "delivery_charge_info": "", - "coupon_text": "View all offers", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Thu, 22 Aug 2019 20:21:48 GMT", - "restrict_checkout": false, - "is_valid": false - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### checkoutCart -Checkout all items in the cart - - - -```swift -cart.checkoutCart(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [CartCheckoutDetailRequest](#CartCheckoutDetailRequest) | no | Request body | - - -Use this API to checkout all items in the cart for payment and order generation. For COD, order will be directly generated, whereas for other checkout modes, user will be redirected to a payment gateway. - -*Returned Response:* - - - - -[CartCheckoutResponse](#CartCheckoutResponse) - -Success. Returns the status of cart checkout. Refer `CartCheckoutResponseSchema` for more details. - - - - -
    -  Examples: - - -
    -  Address id not found - -```json -{ - "value": { - "success": false, - "message": "No address found with address id {address_id}" - } -} -``` -
    - -
    -  Missing address_id - -```json -{ - "value": { - "address_id": [ - "Missing data for required field." - ] - } -} -``` -
    - -
    -  Successful checkout cod payment - -```json -{ - "value": { - "success": true, - "cart": { - "success": true, - "error_message": "Note: Your order delivery will be delayed by 7-10 Days", - "payment_options": { - "payment_option": [ - { - "name": "COD", - "display_name": "Cash on Delivery", - "display_priority": 1, - "payment_mode_id": 11, - "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png" - }, - "list": [] - }, - { - "name": "CARD", - "display_priority": 2, - "payment_mode_id": 2, - "display_name": "Card", - "list": [] - }, - { - "name": "NB", - "display_priority": 3, - "payment_mode_id": 3, - "display_name": "Net Banking", - "list": [ - { - "aggregator_name": "Razorpay", - "bank_name": "ICICI Bank", - "bank_code": "ICIC", - "url": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png" - }, - "merchant_code": "NB_ICICI", - "display_priority": 1 - } - ] - }, - { - "name": "WL", - "display_priority": 4, - "payment_mode_id": 4, - "display_name": "Wallet", - "list": [ - { - "wallet_name": "Paytm", - "wallet_code": "paytm", - "wallet_id": 4, - "merchant_code": "PAYTM", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_small.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_large.png" - }, - "aggregator_name": "Juspay", - "display_priority": 1 - } - ] - }, - { - "name": "UPI", - "display_priority": 9, - "payment_mode_id": 6, - "display_name": "UPI", - "list": [ - { - "aggregator_name": "UPI_Razorpay", - "name": "UPI", - "display_name": "BHIM UPI", - "code": "UPI", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_100x78.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_150x100.png" - }, - "merchant_code": "UPI", - "timeout": 240, - "retry_count": 0, - "fynd_vpa": "shopsense.rzp@hdfcbank", - "intent_flow": true, - "intent_app_error_list": [ - "com.csam.icici.bank.imobile", - "in.org.npci.upiapp", - "com.whatsapp" - ] - } - ] - }, - { - "name": "PL", - "display_priority": 11, - "payment_mode_id": 1, - "display_name": "Pay Later", - "list": [ - { - "aggregator_name": "Simpl", - "name": "Simpl", - "code": "simpl", - "merchant_code": "SIMPL", - "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png" - } - } - ] - } - ], - "payment_flows": { - "Simpl": { - "data": { - "gateway": { - "route": "simpl", - "entity": "sdk", - "is_customer_validation_required": true, - "cust_validation_url": "https://api.addsale.com/gringotts/api/v1/validate-customer/", - "sdk": { - "config": { - "redirect": false, - "callback_url": null, - "action_url": "https://api.addsale.com/avis/api/v1/payments/charge-gringotts-transaction/" - }, - "data": { - "user_phone": "8452996729", - "user_email": "paymentsdummy@gofynd.com" - } - }, - "return_url": null - } - }, - "api_link": "", - "payment_flow": "sdk" - }, - "Juspay": { - "data": {}, - "api_link": "https://sandbox.juspay.in/txns", - "payment_flow": "api" - }, - "Razorpay": { - "data": {}, - "api_link": "", - "payment_flow": "sdk" - }, - "UPI_Razorpay": { - "data": {}, - "api_link": "https://api.addsale.com/gringotts/api/v1/external/payment-initialisation/", - "payment_flow": "api" - }, - "Fynd": { - "data": {}, - "api_link": "", - "payment_flow": "api" - } - }, - "default": {} - }, - "user_type": "Store User", - "cod_charges": 0, - "order_id": "FY5D5E215CF287584CE6", - "cod_available": true, - "cod_message": "No additional COD charges applicable", - "delivery_charges": 0, - "delivery_charge_order_value": 0, - "delivery_slots": [ - { - "date": "Sat, 24 Aug", - "delivery_slot": [ - { - "delivery_slot_timing": "By 9:00 PM", - "default": true, - "delivery_slot_id": 1 - } - ] - } - ], - "store_code": "", - "store_emps": [], - "breakup_values": { - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - }, - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - }, - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 214.18, - "mrp_total": 1999, - "subtotal": 1999, - "total": 1999, - "vog": 1784.82, - "you_saved": 0 - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 1999, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 1999, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 1999, - "currency_code": "INR" - } - ] - }, - "items": [ - { - "key": "820312_L", - "message": "", - "bulk_offer": {}, - "price": { - "base": { - "add_on": 1999, - "marked": 1999, - "effective": 1999, - "selling": 1999, - "currency_code": "INR" - }, - "converted": { - "add_on": 1999, - "marked": 1999, - "effective": 1999, - "selling": 1999, - "currency_code": "INR" - } - }, - "quantity": 1, - "discount": "", - "product": { - "type": "product", - "uid": 820312, - "name": "Navy Blue Melange Shorts", - "slug": "883-police-navy-blue-melange-shorts-820312-4943a8", - "brand": { - "uid": 610, - "name": "883 Police" - }, - "categories": [ - { - "uid": 193, - "name": "Shorts" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/883-police-navy-blue-melange-shorts-820312-4943a8/", - "query": { - "product_slug": [ - "883-police-navy-blue-melange-shorts-820312-4943a8" - ] - } - } - }, - "article": { - "type": "article", - "uid": "381_610_IGPL01_SPIRAL19ANAVY_L", - "size": "L", - "seller": { - "uid": 381, - "name": "INTERSOURCE GARMENTS PVT LTD" - }, - "store": { - "uid": 3009, - "name": "Kormangala" - }, - "quantity": 2, - "price": { - "base": { - "marked": 1999, - "effective": 1999, - "currency_code": "INR" - }, - "converted": { - "marked": 1999, - "effective": 1999, - "currency_code": "INR" - } - } - }, - "coupon_message": "", - "availability": { - "sizes": [ - "L", - "XL", - "XXL" - ], - "other_store_quantity": 1, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - } - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "cart_id": 7483, - "uid": "7483", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Thu, 22 Aug 2019 04:58:44 GMT", - "restrict_checkout": false, - "is_valid": true - }, - "callback_url": "https://api.addsale.com/gringotts/api/v1/external/payment-callback/", - "app_intercept_url": "http://uniket-testing.addsale.link/cart/order-status", - "message": "", - "data": { - "order_id": "FY5D5E215CF287584CE6" - }, - "order_id": "FY5D5E215CF287584CE6" - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateCartMeta -Update the cart meta - - - -```swift -cart.updateCartMeta(id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | The unique identifier of the cart | -| body | [CartMetaRequest](#CartMetaRequest) | no | Request body | - - -Use this API to update cart meta like checkout_mode and gstin. - -*Returned Response:* - - - - -[CartMetaResponse](#CartMetaResponse) - -Returns a message indicating the success of cart meta updation as shown below. - - - - -
    -  Example: - -```json -{ - "message": "cart meta updated" -} -``` -
    - - - - - - - - - ---- - - -#### getCartShareLink -Generate token for sharing the cart - - - -```swift -cart.getCartShareLink(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [GetShareCartLinkRequest](#GetShareCartLinkRequest) | no | Request body | - - -Use this API to generate a shared cart snapshot and return a shortlink token. The link can be shared with other users for getting the same items in their cart. - -*Returned Response:* - - - - -[GetShareCartLinkResponse](#GetShareCartLinkResponse) - -Returns a URL to share and a token as shown below. - - - - -
    -  Examples: - - -
    -  Token Generated - -```json -{ - "value": { - "token": "ZweG1XyX", - "share_url": "https://uniket-testing.addsale.link/shared-cart/ZweG1XyX" - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getCartSharedItems -Get details of a shared cart - - - -```swift -cart.getCartSharedItems(token: token) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| token | String | yes | Token of the shared short link | - - - -Use this API to get the shared cart details as per the token generated using the share-cart API. - -*Returned Response:* - - - - -[SharedCartResponse](#SharedCartResponse) - -Success. Returns a Cart object as per the valid token. Refer `SharedCartResponse` for more details. - - - - -
    -  Example: - -```json -{ - "cart": { - "shared_cart_details": { - "token": "BQ9jySQ9", - "user": { - "user_id": "23109086", - "is_anonymous": false - }, - "meta": { - "selected_staff": "", - "ordering_store": null - }, - "selected_staff": "", - "ordering_store": null, - "source": {}, - "created_on": "2019-12-18T14:00:07.165000" - }, - "items": [ - { - "key": "791651_6", - "discount": "", - "bulk_offer": {}, - "coupon_message": "", - "article": { - "type": "article", - "uid": "304_1054_9036_R1005753_6", - "size": "6", - "seller": { - "uid": 304, - "name": "LEAYAN GLOBAL PVT. LTD." - }, - "store": { - "uid": 5322, - "name": "Vaisali Nagar" - }, - "quantity": 1, - "price": { - "base": { - "marked": 2095, - "effective": 2095, - "currency_code": "INR" - }, - "converted": { - "marked": 2095, - "effective": 2095, - "currency_code": "INR" - } - } - }, - "product": { - "type": "product", - "uid": 791651, - "name": "Black Running Shoes", - "slug": "furo-black-running-shoes-791651-f8bcc3", - "brand": { - "uid": 1054, - "name": "Furo" - }, - "categories": [ - { - "uid": 160, - "name": "Running Shoes" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/furo-black-running-shoes-791651-f8bcc3/", - "query": { - "product_slug": [ - "furo-black-running-shoes-791651-f8bcc3" - ] - } - } - }, - "message": "", - "quantity": 1, - "availability": { - "sizes": [ - "7", - "8", - "9", - "10", - "6" - ], - "other_store_quantity": 12, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "price": { - "base": { - "add_on": 2095, - "marked": 2095, - "effective": 2095, - "selling": 2095, - "currency_code": "INR" - }, - "converted": { - "add_on": 2095, - "marked": 2095, - "effective": 2095, - "selling": 2095, - "currency_code": "INR" - } - } - }, - { - "key": "791651_7", - "discount": "", - "bulk_offer": {}, - "coupon_message": "", - "article": { - "type": "article", - "uid": "304_1054_9036_R1005753_7", - "size": "7", - "seller": { - "uid": 304, - "name": "LEAYAN GLOBAL PVT. LTD." - }, - "store": { - "uid": 5322, - "name": "Vaisali Nagar" - }, - "quantity": 2, - "price": { - "base": { - "marked": 2095, - "effective": 2095, - "currency_code": "INR" - }, - "converted": { - "marked": 2095, - "effective": 2095, - "currency_code": "INR" - } - } - }, - "product": { - "type": "product", - "uid": 791651, - "name": "Black Running Shoes", - "slug": "furo-black-running-shoes-791651-f8bcc3", - "brand": { - "uid": 1054, - "name": "Furo" - }, - "categories": [ - { - "uid": 160, - "name": "Running Shoes" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/furo-black-running-shoes-791651-f8bcc3/", - "query": { - "product_slug": [ - "furo-black-running-shoes-791651-f8bcc3" - ] - } - } - }, - "message": "", - "quantity": 2, - "availability": { - "sizes": [ - "7", - "8", - "9", - "10", - "6" - ], - "other_store_quantity": 7, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "price": { - "base": { - "add_on": 4190, - "marked": 4190, - "effective": 4190, - "selling": 4190, - "currency_code": "INR" - }, - "converted": { - "add_on": 4190, - "marked": 4190, - "effective": 4190, - "selling": 4190, - "currency_code": "INR" - } - } - } - ], - "cart_id": 13055, - "uid": "13055", - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 958.73, - "mrp_total": 6285, - "subtotal": 6285, - "total": 6285, - "vog": 5326.27, - "you_saved": 0 - }, - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid coupon" - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 6285, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 6285, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 6285, - "currency_code": "INR" - } - ] - }, - "delivery_charge_info": "", - "coupon_text": "View all offers", - "gstin": null, - "comment": "", - "checkout_mode": "self", - "payment_selection_lock": { - "enabled": false, - "default_options": "COD", - "payment_identifier": null - }, - "restrict_checkout": false, - "is_valid": true, - "last_modified": "Mon, 16 Dec 2019 07:02:18 GMT" - }, - "error": "" -} -``` -
    - - - - - - - - - ---- - - -#### updateCartWithSharedItems -Merge or replace existing cart - - - -```swift -cart.updateCartWithSharedItems(token: token, action: action) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| token | String | yes | Token of the shared short link | -| action | String | yes | Operation to perform on the existing cart merge or replace. | - - - -Use this API to merge the shared cart with existing cart, or replace the existing cart with the shared cart. The `action` parameter is used to indicate the operation Merge or Replace. - -*Returned Response:* - - - - -[SharedCartResponse](#SharedCartResponse) - -Success. Returns a merged or replaced cart as per the valid token. Refer `SharedCartResponse` for more details. - - - - -
    -  Examples: - - -
    -  Cart Merged/Replaced - -```json -{ - "value": { - "cart": { - "shared_cart_details": { - "token": "BQ9jySQ9", - "user": { - "user_id": "23109086", - "is_anonymous": false - }, - "meta": { - "selected_staff": "", - "ordering_store": null - }, - "selected_staff": "", - "ordering_store": null, - "source": {}, - "created_on": "2019-12-18T14:00:07.165000" - }, - "items": [ - { - "key": "791651_6", - "discount": "", - "bulk_offer": {}, - "coupon_message": "", - "article": { - "type": "article", - "uid": "304_1054_9036_R1005753_6", - "size": "6", - "seller": { - "uid": 304, - "name": "LEAYAN GLOBAL PVT. LTD." - }, - "store": { - "uid": 5322, - "name": "Vaisali Nagar" - }, - "quantity": 1, - "price": { - "base": { - "marked": 2095, - "effective": 2095, - "currency_code": "INR" - }, - "converted": { - "marked": 2095, - "effective": 2095, - "currency_code": "INR" - } - } - }, - "product": { - "type": "product", - "uid": 791651, - "name": "Black Running Shoes", - "slug": "furo-black-running-shoes-791651-f8bcc3", - "brand": { - "uid": 1054, - "name": "Furo" - }, - "categories": [ - { - "uid": 160, - "name": "Running Shoes" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/furo-black-running-shoes-791651-f8bcc3/", - "query": { - "product_slug": [ - "furo-black-running-shoes-791651-f8bcc3" - ] - } - } - }, - "message": "", - "quantity": 1, - "availability": { - "sizes": [ - "7", - "8", - "9", - "10", - "6" - ], - "other_store_quantity": 12, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "price": { - "base": { - "add_on": 2095, - "marked": 2095, - "effective": 2095, - "selling": 2095, - "currency_code": "INR" - }, - "converted": { - "add_on": 2095, - "marked": 2095, - "effective": 2095, - "selling": 2095, - "currency_code": "INR" - } - } - }, - { - "key": "791651_7", - "discount": "", - "bulk_offer": {}, - "coupon_message": "", - "article": { - "type": "article", - "uid": "304_1054_9036_R1005753_7", - "size": "7", - "seller": { - "uid": 304, - "name": "LEAYAN GLOBAL PVT. LTD." - }, - "store": { - "uid": 5322, - "name": "Vaisali Nagar" - }, - "quantity": 2, - "price": { - "base": { - "marked": 2095, - "effective": 2095, - "currency_code": "INR" - }, - "converted": { - "marked": 2095, - "effective": 2095, - "currency_code": "INR" - } - } - }, - "product": { - "type": "product", - "uid": 791651, - "name": "Black Running Shoes", - "slug": "furo-black-running-shoes-791651-f8bcc3", - "brand": { - "uid": 1054, - "name": "Furo" - }, - "categories": [ - { - "uid": 160, - "name": "Running Shoes" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/furo-black-running-shoes-791651-f8bcc3/", - "query": { - "product_slug": [ - "furo-black-running-shoes-791651-f8bcc3" - ] - } - } - }, - "message": "", - "quantity": 2, - "availability": { - "sizes": [ - "7", - "8", - "9", - "10", - "6" - ], - "other_store_quantity": 7, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "price": { - "base": { - "add_on": 4190, - "marked": 4190, - "effective": 4190, - "selling": 4190, - "currency_code": "INR" - }, - "converted": { - "add_on": 4190, - "marked": 4190, - "effective": 4190, - "selling": 4190, - "currency_code": "INR" - } - } - } - ], - "cart_id": 13055, - "uid": "13055", - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 958.73, - "mrp_total": 6285, - "subtotal": 6285, - "total": 6285, - "vog": 5326.27, - "you_saved": 0 - }, - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid coupon" - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 6285, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 6285, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 6285, - "currency_code": "INR" - } - ] - }, - "delivery_charge_info": "", - "coupon_text": "View all offers", - "gstin": null, - "comment": "", - "checkout_mode": "self", - "payment_selection_lock": { - "enabled": false, - "default_options": "COD", - "payment_identifier": null - }, - "restrict_checkout": false, - "is_valid": true, - "last_modified": "Mon, 16 Dec 2019 07:02:18 GMT" - } - } -} -``` -
    - -
    - - - - - - - - - ---- - - - - -## Common - - -#### getLocations -Get countries, states, cities - - - -```swift -common.getLocations(locationType: locationType, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| locationType | String? | no | Provide location type to query on. Possible values : country, state, city | -| id | String? | no | Field is optional when location_type is country. If querying for state, provide id of country. If querying for city, provide id of state. | - - - - - -*Returned Response:* - - - - -[Locations](#Locations) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - - - -## Lead - - -#### getTicket -Get Ticket with the specific id - - - -```swift -lead.getTicket(id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String | yes | ID of ticket to be retrieved | - - - -Get Ticket with the specific id, this is used to view the ticket details - -*Returned Response:* - - - - -[Ticket](#Ticket) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "context": { - "application_id": "000000000000000000000003", - "company_id": "884" - }, - "content": { - "title": "SOme title Response", - "description": "Single lineeee: asdf
    Email: asdf@asdf.com
    dfsdf: asdf
    ", - "attachments": [] - }, - "status": { - "display": "In Progress", - "color": "#ffa951", - "key": "in_progress" - }, - "priority": { - "display": "Medium", - "color": "#f37736", - "key": "medium" - }, - "assigned_to": { - "agent_id": "5d1363adf599d850df93175e", - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", - "hasOldPasswordHash": false, - "_id": "5d1363adf599d850df93175e", - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - } - ], - "username": "nikhilmshchs_gmail_com_38425_20500281", - "createdAt": "2019-01-01T17:22:38.528Z", - "updatedAt": "2021-01-22T10:02:42.258Z", - "uid": "20500281", - "__v": 56 - }, - "tags": [ - "some-title" - ], - "_id": "6012f38557751ee8fc162cf7", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.96" - }, - "os": { - "name": "macOS", - "version": "10.15.7", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "source": "sales_channel", - "created_by": { - "id": "5d1363adf599d850df93175e", - "user": { - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", - "hasOldPasswordHash": false, - "_id": "5d1363adf599d850df93175e", - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - } - ], - "username": "nikhilmshchs_gmail_com_38425_20500281", - "createdAt": "2019-01-01T17:22:38.528Z", - "updatedAt": "2021-01-22T10:02:42.258Z", - "uid": "20500281", - "__v": 56 - } - }, - "response_id": "6012f38457751e0fb8162cf6", - "category": { - "form": { - "login_required": false, - "should_notify": false, - "inputs": [ - { - "required": false, - "type": "text", - "enum": [], - "display": "Single lineeee", - "key": "single-lineeee", - "showRegexInput": false - }, - { - "required": false, - "type": "email", - "enum": [], - "display": "Email", - "regex": "\\S+@\\S+\\.\\S+", - "key": "email", - "showRegexInput": true - }, - { - "required": false, - "type": "text", - "enum": [], - "display": "dfsdf", - "key": "dfsdf", - "showRegexInput": false - } - ], - "available_assignees": [ - "5b9b98150df588546aaea6d2", - "5c45d78395d7504f76c2cb37" - ], - "_id": "5fd72db3dc250f8decfc61b2", - "title": "SOme title", - "description": "SOme big description", - "slug": "some-title", - "application_id": "000000000000000000000003", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "87.0.4280.88" - }, - "os": { - "name": "macOS", - "version": "10.15.6", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5d1363adf599d850df93175e", - "createdAt": "2020-12-14T09:17:39.953Z", - "updatedAt": "2021-01-28T18:48:07.717Z", - "__v": 0 - }, - "key": "some-title", - "display": "SOme title" - }, - "ticket_id": "43", - "createdAt": "2021-01-28T17:25:25.013Z", - "updatedAt": "2021-01-28T17:25:33.396Z", - "__v": 0, - "video_room_id": "6012f38557751ee8fc162cf7" - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createHistory -Create history for specific Ticket - - - -```swift -lead.createHistory(id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String | yes | Ticket ID for which history is created | -| body | [TicketHistoryPayload](#TicketHistoryPayload) | no | Request body | - - -Create history for specific Ticket, this history is seen on ticket detail page, this can be comment, log or rating. - -*Returned Response:* - - - - -[TicketHistory](#TicketHistory) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "_id": "601a9d52c26687d086c499ef", - "ticket_id": "41", - "type": "comment", - "value": { - "text": "d", - "media": [] - }, - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.96" - }, - "os": { - "name": "macOS", - "version": "10.15.7", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5d1363adf599d850df93175e", - "createdAt": "2021-02-03T12:55:46.808Z", - "updatedAt": "2021-02-03T12:55:46.808Z", - "__v": 0 - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createTicket -Create Ticket - - - -```swift -lead.createTicket(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [AddTicketPayload](#AddTicketPayload) | no | Request body | - - -This is used to Create Ticket. - -*Returned Response:* - - - - -[Ticket](#Ticket) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "context": { - "application_id": "000000000000000000000003", - "company_id": "884" - }, - "content": { - "title": "SOme title Response", - "description": "Single lineeee: asdf
    Email: asdf@asdf.com
    dfsdf: asdf
    ", - "attachments": [] - }, - "status": { - "display": "In Progress", - "color": "#ffa951", - "key": "in_progress" - }, - "priority": { - "display": "Medium", - "color": "#f37736", - "key": "medium" - }, - "assigned_to": { - "agent_id": "5d1363adf599d850df93175e", - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", - "hasOldPasswordHash": false, - "_id": "5d1363adf599d850df93175e", - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - } - ], - "username": "nikhilmshchs_gmail_com_38425_20500281", - "createdAt": "2019-01-01T17:22:38.528Z", - "updatedAt": "2021-01-22T10:02:42.258Z", - "uid": "20500281", - "__v": 56 - }, - "tags": [ - "some-title" - ], - "_id": "6012f38557751ee8fc162cf7", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.96" - }, - "os": { - "name": "macOS", - "version": "10.15.7", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "source": "sales_channel", - "created_by": { - "id": "5d1363adf599d850df93175e", - "user": { - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", - "hasOldPasswordHash": false, - "_id": "5d1363adf599d850df93175e", - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - } - ], - "username": "nikhilmshchs_gmail_com_38425_20500281", - "createdAt": "2019-01-01T17:22:38.528Z", - "updatedAt": "2021-01-22T10:02:42.258Z", - "uid": "20500281", - "__v": 56 - } - }, - "response_id": "6012f38457751e0fb8162cf6", - "category": { - "form": { - "login_required": false, - "should_notify": false, - "inputs": [ - { - "required": false, - "type": "text", - "enum": [], - "display": "Single lineeee", - "key": "single-lineeee", - "showRegexInput": false - }, - { - "required": false, - "type": "email", - "enum": [], - "display": "Email", - "regex": "\\S+@\\S+\\.\\S+", - "key": "email", - "showRegexInput": true - }, - { - "required": false, - "type": "text", - "enum": [], - "display": "dfsdf", - "key": "dfsdf", - "showRegexInput": false - } - ], - "available_assignees": [ - "5b9b98150df588546aaea6d2", - "5c45d78395d7504f76c2cb37" - ], - "_id": "5fd72db3dc250f8decfc61b2", - "title": "SOme title", - "description": "SOme big description", - "slug": "some-title", - "application_id": "000000000000000000000003", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "87.0.4280.88" - }, - "os": { - "name": "macOS", - "version": "10.15.6", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5d1363adf599d850df93175e", - "createdAt": "2020-12-14T09:17:39.953Z", - "updatedAt": "2021-01-28T18:48:07.717Z", - "__v": 0 - }, - "key": "some-title", - "display": "SOme title" - }, - "ticket_id": "43", - "createdAt": "2021-01-28T17:25:25.013Z", - "updatedAt": "2021-01-28T17:25:33.396Z", - "__v": 0, - "video_room_id": "6012f38557751ee8fc162cf7" - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getCustomForm -Get specific Custom Form using it's slug - - - -```swift -lead.getCustomForm(slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | Slug of form whose response is getting submitted | - - - -Get specific Custom Form using it's slug, this is used to view the form. - -*Returned Response:* - - - - -[CustomForm](#CustomForm) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "login_required": false, - "should_notify": false, - "inputs": [ - { - "required": false, - "type": "text", - "display": "Name", - "placeholder": "Please enter your name", - "key": "name" - } - ], - "available_assignees": [], - "_id": "5fd258a9088f957f34c288fc", - "title": "trail form", - "description": "Trail form description", - "slug": "trail-form", - "application_id": "000000000000000000000003", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "87.0.4280.88" - }, - "os": { - "name": "macOS", - "version": "10.15.6", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5d1363adf599d850df93175e", - "createdAt": "2020-12-10T17:19:37.515Z", - "updatedAt": "2020-12-10T17:19:43.214Z", - "__v": 0 - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### submitCustomForm -Submit Response for a specific Custom Form using it's slug - - - -```swift -lead.submitCustomForm(slug: slug, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | Slug of form whose response is getting submitted | -| body | [CustomFormSubmissionPayload](#CustomFormSubmissionPayload) | no | Request body | - - -Submit Response for a specific Custom Form using it's slug, this response is then used to create a ticket on behalf of the user. - -*Returned Response:* - - - - -[SubmitCustomFormResponse](#SubmitCustomFormResponse) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "ticket": { - "context": { - "application_id": "000000000000000000000003", - "company_id": "884" - }, - "content": { - "title": "SOme title Response", - "description": "Single lineeee: asdf
    Email: asdf@asdf.com
    dfsdf: asdf
    ", - "attachments": [] - }, - "status": { - "display": "In Progress", - "color": "#ffa951", - "key": "in_progress" - }, - "priority": { - "display": "Medium", - "color": "#f37736", - "key": "medium" - }, - "assigned_to": { - "agent_id": "5d1363adf599d850df93175e", - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", - "hasOldPasswordHash": false, - "_id": "5d1363adf599d850df93175e", - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - } - ], - "username": "nikhilmshchs_gmail_com_38425_20500281", - "createdAt": "2019-01-01T17:22:38.528Z", - "updatedAt": "2021-01-22T10:02:42.258Z", - "uid": "20500281", - "__v": 56 - }, - "tags": [ - "some-title" - ], - "_id": "6012f38557751ee8fc162cf7", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.96" - }, - "os": { - "name": "macOS", - "version": "10.15.7", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "source": "sales_channel", - "created_by": { - "id": "5d1363adf599d850df93175e", - "user": { - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", - "hasOldPasswordHash": false, - "_id": "5d1363adf599d850df93175e", - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - } - ], - "username": "nikhilmshchs_gmail_com_38425_20500281", - "createdAt": "2019-01-01T17:22:38.528Z", - "updatedAt": "2021-01-22T10:02:42.258Z", - "uid": "20500281", - "__v": 56 - } - }, - "response_id": "6012f38457751e0fb8162cf6", - "category": { - "form": { - "login_required": false, - "should_notify": false, - "inputs": [ - { - "required": false, - "type": "text", - "enum": [], - "display": "Single lineeee", - "key": "single-lineeee", - "showRegexInput": false - }, - { - "required": false, - "type": "email", - "enum": [], - "display": "Email", - "regex": "\\S+@\\S+\\.\\S+", - "key": "email", - "showRegexInput": true - }, - { - "required": false, - "type": "text", - "enum": [], - "display": "dfsdf", - "key": "dfsdf", - "showRegexInput": false - } - ], - "available_assignees": [ - "5b9b98150df588546aaea6d2", - "5c45d78395d7504f76c2cb37" - ], - "_id": "5fd72db3dc250f8decfc61b2", - "title": "SOme title", - "description": "SOme big description", - "slug": "some-title", - "application_id": "000000000000000000000003", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "87.0.4280.88" - }, - "os": { - "name": "macOS", - "version": "10.15.6", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5d1363adf599d850df93175e", - "createdAt": "2020-12-14T09:17:39.953Z", - "updatedAt": "2021-01-28T18:48:07.717Z", - "__v": 0 - }, - "key": "some-title", - "display": "SOme title" - }, - "ticket_id": "43", - "createdAt": "2021-01-28T17:25:25.013Z", - "updatedAt": "2021-01-28T17:25:33.396Z", - "__v": 0, - "video_room_id": "6012f38557751ee8fc162cf7" - } - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getParticipantsInsideVideoRoom -Get participants of a specific Video Room using it's unique name - - - -```swift -lead.getParticipantsInsideVideoRoom(uniqueName: uniqueName) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| uniqueName | String | yes | Unique name of Video Room | - - - -Get participants of a specific Video Room using it's unique name, this can be used to check if people are already there in the room and also to show their names. - -*Returned Response:* - - - - -[GetParticipantsInsideVideoRoomResponse](#GetParticipantsInsideVideoRoomResponse) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "participants": [] - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getTokenForVideoRoom -Get Token to join a specific Video Room using it's unqiue name - - - -```swift -lead.getTokenForVideoRoom(uniqueName: uniqueName) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| uniqueName | String | yes | Unique name of Video Room | - - - -Get Token to join a specific Video Room using it's unqiue name, this Token is your ticket to Room and also creates your identity there. - -*Returned Response:* - - - - -[GetTokenForVideoRoomResponse](#GetTokenForVideoRoomResponse) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "access_token": "your_token_to_the_room" - } -} -``` -
    - -
    - - - - - - - - - ---- - - - - -## Theme - - -#### getAllPages -Get all pages of a theme - - - -```swift -theme.getAllPages(themeId: themeId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| themeId | String | yes | ID of the theme to be retrieved | - - - -Use this API to retrieve all the available pages of a theme by its ID. - -*Returned Response:* - - - - -[AllAvailablePageSchema](#AllAvailablePageSchema) - -Success. Returns an array all the pages of the theme. Refer `AllAvailablePageSchema` for more details. - - - - -
    -  Examples: - - -
    -  All pages - -```json -{ - "$ref": "#/components/examples/AllAvailablePagesExample" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getPage -Get page of a theme - - - -```swift -theme.getPage(themeId: themeId, pageValue: pageValue) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| themeId | String | yes | ID of the theme to be retrieved | -| pageValue | String | yes | Value of the page to be retrieved | - - - -Use this API to retrieve a page of a theme. - -*Returned Response:* - - - - -[AvailablePageSchema](#AvailablePageSchema) - -Success. Returns an object of the pages. Refer `AvailablePageSchema` for more details. - - - - -
    -  Examples: - - -
    -  Home page - -```json -{ - "$ref": "#/components/examples/AvailablePageExample" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getAppliedTheme -Get the theme currently applied to an application - - - -```swift -theme.getAppliedTheme() { (response, error) in - // Use response -} -``` - - - - -An application has multiple themes, but only one theme can be applied at a time. Use this API to retrieve the theme currently applied to the application. - -*Returned Response:* - - - - -[ThemesSchema](#ThemesSchema) - -Success. Returns a JSON object of the theme. Check the example shown below or refer `ThemesSchema` for more details. - - - - -
    -  Examples: - - -
    -  Applied Theme - -```json -{ - "$ref": "#/components/examples/Themes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getThemeForPreview -Get a theme for a preview - - - -```swift -theme.getThemeForPreview(themeId: themeId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| themeId | String | yes | ID of the theme to be retrieved | - - - -A theme can be previewed before applying it. Use this API to retrieve the preview of a theme by its ID. - -*Returned Response:* - - - - -[ThemesSchema](#ThemesSchema) - -Success. Returns a JSON object of the theme. Check the example shown below or refer `ThemesSchema` for more details. - - - - -
    -  Examples: - - -
    -  Preview Theme - -```json -{ - "$ref": "#/components/examples/Themes" -} -``` -
    - -
    - - - - - - - - - ---- - - - - -## User - - -#### loginWithFacebook -Login or Register using Facebook - - - -```swift -user.loginWithFacebook(platform: platform, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| platform | String? | no | ID of the application | -| body | [OAuthRequestSchema](#OAuthRequestSchema) | no | Request body | - - -Use this API to login or register using Facebook credentials. - -*Returned Response:* - - - - -[AuthSuccess](#AuthSuccess) - -Success. Returns a JSON object with the user details. Check the example shown below or refer `AuthSuccess` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/AuthSuccess" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### loginWithGoogle -Login or Register using Google - - - -```swift -user.loginWithGoogle(platform: platform, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| platform | String? | no | ID of the application | -| body | [OAuthRequestSchema](#OAuthRequestSchema) | no | Request body | - - -Use this API to login or register using Google Account credentials. - -*Returned Response:* - - - - -[AuthSuccess](#AuthSuccess) - -Success. Returns a JSON object with the user details. Check the example shown below or refer `AuthSuccess` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/AuthSuccess" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### loginWithGoogleAndroid -Login or Register using Google on Android - - - -```swift -user.loginWithGoogleAndroid(platform: platform, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| platform | String? | no | ID of the application | -| body | [OAuthRequestSchema](#OAuthRequestSchema) | no | Request body | - - -Use this API to login or register in Android app using Google Account credentials. - -*Returned Response:* - - - - -[AuthSuccess](#AuthSuccess) - -Success. Returns a JSON object with the user details. Check the example shown below or refer `AuthSuccess` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/AuthSuccess" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### loginWithGoogleIOS -Login or Register using Google on iOS - - - -```swift -user.loginWithGoogleIOS(platform: platform, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| platform | String? | no | ID of the application | -| body | [OAuthRequestSchema](#OAuthRequestSchema) | no | Request body | - - -Use this API to login or register in iOS app using Google Account credentials. - -*Returned Response:* - - - - -[AuthSuccess](#AuthSuccess) - -Success. Returns a JSON object with the user details. Check the example shown below or refer `AuthSuccess` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/AuthSuccess" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### loginWithOTP -Login or Register with OTP - - - -```swift -user.loginWithOTP(platform: platform, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| platform | String? | no | ID of the application | -| body | [SendOtpRequestSchema](#SendOtpRequestSchema) | no | Request body | - - -Use this API to login or register with a One-time Password (OTP) sent via Email or SMS. - -*Returned Response:* - - - - -[SendOtpResponse](#SendOtpResponse) - -Success. Check the example shown below or refer `SendOtpResponse` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/SendOtpResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### loginWithEmailAndPassword -Login or Register with password - - - -```swift -user.loginWithEmailAndPassword(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [PasswordLoginRequestSchema](#PasswordLoginRequestSchema) | no | Request body | - - -Use this API to login or register using an email address and password. - -*Returned Response:* - - - - -[LoginSuccess](#LoginSuccess) - -Success. Check the example shown below or refer `LoginSuccess` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/UserExampleObject" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### sendResetPasswordEmail -Reset Password - - - -```swift -user.sendResetPasswordEmail(platform: platform, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| platform | String? | no | ID of the application | -| body | [SendResetPasswordEmailRequestSchema](#SendResetPasswordEmailRequestSchema) | no | Request body | - - -Use this API to reset a password using the link sent on email. - -*Returned Response:* - - - - -[ResetPasswordSuccess](#ResetPasswordSuccess) - -Success. Check the example shown below or refer `ResetPasswordSuccess` for more details. - - - - -
    -  Example: - -```json -{ - "status": "sent" -} -``` -
    - - - - - - - - - ---- - - -#### forgotPassword -Forgot Password - - - -```swift -user.forgotPassword(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [ForgotPasswordRequestSchema](#ForgotPasswordRequestSchema) | no | Request body | - - -Use this API to reset a password using the code sent on email or SMS. - -*Returned Response:* - - - - -[LoginSuccess](#LoginSuccess) - -Success. Check the example shown below or refer `LoginSuccess` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/UserExampleObject" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### sendResetToken -Reset Password using token - - - -```swift -user.sendResetToken(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [CodeRequestBodySchema](#CodeRequestBodySchema) | no | Request body | - - -Use this API to send code to reset password. - -*Returned Response:* - - - - -[ResetPasswordSuccess](#ResetPasswordSuccess) - -Success. Check the example shown below or refer `ResetPasswordSuccess` for more details. - - - - -
    -  Example: - -```json -{ - "status": "success" -} -``` -
    - - - - - - - - - ---- - - -#### loginWithToken -Login or Register with token - - - -```swift -user.loginWithToken(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [TokenRequestBodySchema](#TokenRequestBodySchema) | no | Request body | - - -Use this API to login or register using a token for authentication. - -*Returned Response:* - - - - -[LoginSuccess](#LoginSuccess) - -Success. Check the example shown below or refer `LoginSuccess` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/UserExampleObject" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### registerWithForm -Registration using a form - - - -```swift -user.registerWithForm(platform: platform, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| platform | String? | no | ID of the application | -| body | [FormRegisterRequestSchema](#FormRegisterRequestSchema) | no | Request body | - - -Use this API to perform user registration by sending form data in the request body. - -*Returned Response:* - - - - -[RegisterFormSuccess](#RegisterFormSuccess) - -Success. Check the example shown below or refer `RegisterFormSuccess` for more details. - - - - -
    -  Example: - -```json -{ - "success": true, - "request_id": "ebc059191393681cdfb805b5424bddad", - "message": "OTP sent", - "mobile": "7400448798", - "country_code": "91", - "resend_timer": 30, - "resend_token": "5197ff90-66e2-11eb-9399-0312fbf2c2a6", - "verify_mobile_otp": true, - "register_token": "276e718a-d406-4a4b-83f7-cb6cb72b99ff", - "userExists": false -} -``` -
    - - - - - - - - - ---- - - -#### verifyEmail -Verify email - - - -```swift -user.verifyEmail(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [CodeRequestBodySchema](#CodeRequestBodySchema) | no | Request body | - - -Use this API to send a verification code to verify an email. - -*Returned Response:* - - - - -[VerifyEmailSuccess](#VerifyEmailSuccess) - -Success. Check the example shown below or refer `VerifyEmailSuccess` for more details. - - - - -
    -  Example: - -```json -{ - "message": "verified" -} -``` -
    - - - - - - - - - ---- - - -#### verifyMobile -Verify mobile - - - -```swift -user.verifyMobile(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [CodeRequestBodySchema](#CodeRequestBodySchema) | no | Request body | - - -Use this API to send a verification code to verify a mobile number. - -*Returned Response:* - - - - -[VerifyEmailSuccess](#VerifyEmailSuccess) - -Success. Check the example shown below or refer `VerifyEmailSuccess` for more details. - - - - -
    -  Example: - -```json -{ - "message": "verified" -} -``` -
    - - - - - - - - - ---- - - -#### hasPassword -Check password - - - -```swift -user.hasPassword() { (response, error) in - // Use response -} -``` - - - - -Use this API to check if user has created a password for login. - -*Returned Response:* - - - - -[HasPasswordSuccess](#HasPasswordSuccess) - -Success. Returns a boolean value. Check the example shown below or refer `HasPasswordSuccess` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updatePassword -Update user password - - - -```swift -user.updatePassword(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [UpdatePasswordRequestSchema](#UpdatePasswordRequestSchema) | no | Request body | - - -Use this API to update the password. - -*Returned Response:* - - - - -[VerifyEmailSuccess](#VerifyEmailSuccess) - -Success. Returns a success message. Refer `VerifyEmailSuccess` for more details. - - - - -
    -  Example: - -```json -{ - "message": "success" -} -``` -
    - - - - - - - - - ---- - - -#### logout -Logs out currently logged in user - - - -```swift -user.logout() { (response, error) in - // Use response -} -``` - - - - -Use this API to check to logout a user from the app. - -*Returned Response:* - - - - -[LogoutSuccess](#LogoutSuccess) - -Success. Returns a success message as shown below. Refer `LogoutSuccess` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### sendOTPOnMobile -Send OTP on mobile - - - -```swift -user.sendOTPOnMobile(platform: platform, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| platform | String? | no | ID of the application | -| body | [SendMobileOtpRequestSchema](#SendMobileOtpRequestSchema) | no | Request body | - - -Use this API to send an OTP to a mobile number. - -*Returned Response:* - - - - -[OtpSuccess](#OtpSuccess) - -Success. Returns a JSON object as shown below. Refer `OtpSuccess` for more details. - - - - -
    -  Example: - -```json -{ - "success": true, - "request_id": "01503005aeab87cbed93d40f46cc2749", - "message": "OTP sent", - "mobile": "8652523958", - "country_code": "91", - "resend_timer": 30, - "resend_token": "18fc3d60-66e5-11eb-9399-0312fbf2c2a6" -} -``` -
    - - - - - - - - - ---- - - -#### verifyMobileOTP -Verify OTP on mobile - - - -```swift -user.verifyMobileOTP(platform: platform, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| platform | String? | no | ID of the application | -| body | [VerifyOtpRequestSchema](#VerifyOtpRequestSchema) | no | Request body | - - -Use this API to verify the OTP received on a mobile number. - -*Returned Response:* - - - - -[VerifyOtpSuccess](#VerifyOtpSuccess) - -Success. Returns a JSON object as shown below. Refer `VerifyOtpSuccess` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/VerifyMobileOTP" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### sendOTPOnEmail -Send OTP on email - - - -```swift -user.sendOTPOnEmail(platform: platform, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| platform | String? | no | ID of the application | -| body | [SendEmailOtpRequestSchema](#SendEmailOtpRequestSchema) | no | Request body | - - -Use this API to send an OTP to an email ID. - -*Returned Response:* - - - - -[EmailOtpSuccess](#EmailOtpSuccess) - -Success. Returns a JSON object as shown below. Refer `EmailOtpSuccess` for more details. - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### verifyEmailOTP -Verify OTP on email - - - -```swift -user.verifyEmailOTP(platform: platform, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| platform | String? | no | ID of the application | -| body | [VerifyEmailOtpRequestSchema](#VerifyEmailOtpRequestSchema) | no | Request body | - - -Use this API to verify the OTP received on an email ID. - -*Returned Response:* - - - - -[VerifyOtpSuccess](#VerifyOtpSuccess) - -Success. Returns a JSON object as shown below. Refer `VerifyOtpSuccess` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/VerifyMobileOTP" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getLoggedInUser -Get logged in user - - - -```swift -user.getLoggedInUser() { (response, error) in - // Use response -} -``` - - - - -Use this API to get the details of a logged in user. - -*Returned Response:* - - - - -[UserObjectSchema](#UserObjectSchema) - -Success. Returns a JSON object with user details. Refer `UserObjectSchema` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/UserExampleObject" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getListOfActiveSessions -Get list of sessions - - - -```swift -user.getListOfActiveSessions() { (response, error) in - // Use response -} -``` - - - - -Use this API to retrieve all active sessions of a user. - -*Returned Response:* - - - - -[SessionListSuccess](#SessionListSuccess) - -Success. Returns a JSON object containing an array of sessions. Refer `SessionListSuccess` for more details. - - - - -
    -  Example: - -```json -{ - "sessions": [ - "session_1", - "session_2" - ] -} -``` -
    - - - - - - - - - ---- - - -#### getPlatformConfig -Get platform configurations - - - -```swift -user.getPlatformConfig(name: name) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| name | String? | no | Name of the application, e.g. Fynd | - - - -Use this API to get all the platform configurations such as mobile image, desktop image, social logins, and all other text. - -*Returned Response:* - - - - -[PlatformSchema](#PlatformSchema) - -Success. Returns a JSON object containing the all the platform configurations. Refer `PlatformSchema` for more details. - - - - -
    -  Example: - -```json -{ - "active": true, - "mobile_image": null, - "desktop_image": null, - "social": { - "facebook": true, - "google": true, - "account_kit": true - }, - "flash_card": { - "text": "", - "text_color": "#FFFFFF", - "background_color": "#EF5350" - }, - "register": true, - "forgot_password": true, - "login": { - "password": true, - "otp": true - }, - "skip_captcha": false, - "display": "Fynd", - "subtext": "Login to Fynd", - "name": "Fynd", - "meta": {}, - "required_fields": { - "email": { - "is_required": false, - "level": "hard" - }, - "mobile": { - "is_required": true, - "level": "hard" - } - }, - "register_required_fields": { - "email": { - "is_required": false, - "level": "hard" - }, - "mobile": { - "is_required": true, - "level": "hard" - } - }, - "skip_login": false, - "look_and_feel": { - "background_color": "#F5F5F5", - "card_position": "center" - }, - "social_tokens": { - "google": { - "appId": "token_123" - }, - "facebook": { - "appId": "2033146826724884" - }, - "account_kit": { - "appId": "548529975557631" - } - }, - "_id": "5e04a5e5220bc15839ad9bc0", - "created_at": "2019-12-26T12:21:57.878Z", - "updated_at": "2020-08-13T14:31:09.878Z", - "__v": 0 -} -``` -
    - - - - - - - - - ---- - - -#### updateProfile -Edit Profile Details - - - -```swift -user.updateProfile(platform: platform, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| platform | String? | no | ID of the application | -| body | [EditProfileRequestSchema](#EditProfileRequestSchema) | no | Request body | - - -Use this API to update details in the user profile. Details can be first name, last name, gender, email, phone number, or profile picture. - -*Returned Response:* - - - - -[ProfileEditSuccess](#ProfileEditSuccess) - -Success. Check the example shown below or refer `LoginSuccess` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/UserExampleObject" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### addMobileNumber -Add mobile number to profile - - - -```swift -user.addMobileNumber(platform: platform, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| platform | String? | no | ID of the application | -| body | [EditMobileRequestSchema](#EditMobileRequestSchema) | no | Request body | - - -Use this API to add a new mobile number to a profile. - -*Returned Response:* - - - - -[VerifyMobileOTPSuccess](#VerifyMobileOTPSuccess) - -Success. Check the example shown below or refer `VerifyMobileOTPSuccess` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/VerifyMobileOTP" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### deleteMobileNumber -Delete mobile number from profile - - - -```swift -user.deleteMobileNumber(platform: platform, active: active, primary: primary, verified: verified, countryCode: countryCode, phone: phone) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| platform | String? | no | ID of the application | -| active | Bool | yes | This is a boolean value to check if mobile number is active 1.True - Number is active 2. False - Number is inactive | -| primary | Bool | yes | This is a boolean value to check if mobile number is primary number (main number) 1. True - Number is primary 2. False - Number is not primary | -| verified | Bool | yes | This is a boolean value to check if mobile number is verified 1. True - Number is verified 2.False - Number is not verified yet | -| countryCode | String | yes | Country code of the phone number, e.g. 91 | -| phone | String | yes | Phone number | - - - -Use this API to delete a mobile number from a profile. - -*Returned Response:* - - - - -[LoginSuccess](#LoginSuccess) - -Success. Check the example shown below or refer `LoginSuccess` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/UserExampleObject" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### setMobileNumberAsPrimary -Set mobile as primary - - - -```swift -user.setMobileNumberAsPrimary(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [SendVerificationLinkMobileRequestSchema](#SendVerificationLinkMobileRequestSchema) | no | Request body | - - -Use this API to set a mobile number as primary. Primary number is a verified number used for all future communications. - -*Returned Response:* - - - - -[LoginSuccess](#LoginSuccess) - -Success. Check the example shown below or refer `LoginSuccess` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/UserExampleObject" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### sendVerificationLinkToMobile -Send verification link to mobile - - - -```swift -user.sendVerificationLinkToMobile(platform: platform, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| platform | String? | no | ID of the application | -| body | [SendVerificationLinkMobileRequestSchema](#SendVerificationLinkMobileRequestSchema) | no | Request body | - - -Use this API to send a verification link to a mobile number - -*Returned Response:* - - - - -[SendMobileVerifyLinkSuccess](#SendMobileVerifyLinkSuccess) - -Success. Check the example shown below or refer `SendMobileVerifyLinkSuccess` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/VerifyMobileOTP" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### addEmail -Add email to profile - - - -```swift -user.addEmail(platform: platform, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| platform | String? | no | ID of the application | -| body | [EditEmailRequestSchema](#EditEmailRequestSchema) | no | Request body | - - -Use this API to add a new email address to a profile - -*Returned Response:* - - - - -[VerifyEmailOTPSuccess](#VerifyEmailOTPSuccess) - -Success. Returns a JSON object with user details. Refer `VerifyEmailOTPSuccess` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/VerifyEmailOTP" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### deleteEmail -Delete email from profile - - - -```swift -user.deleteEmail(platform: platform, active: active, primary: primary, verified: verified, email: email) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| platform | String? | no | ID of the application | -| active | Bool | yes | This is a boolean value to check if email ID is active 1. True - Email ID is active 2.False - Email ID is inactive | -| primary | Bool | yes | This is a boolean value to check if email ID is primary (main email ID) 1. True - Email ID is primary 2.False - Email ID is not primary | -| verified | Bool | yes | This is a boolean value to check if email ID is verified 1. True - Email ID is verified 2.False - Email ID is not verified yet | -| email | String | yes | The email ID to delete | - - - -Use this API to delete an email address from a profile - -*Returned Response:* - - - - -[LoginSuccess](#LoginSuccess) - -Success. Returns a JSON object with user details. Refer `LoginSuccess` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/UserExampleObject" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### setEmailAsPrimary -Set email as primary - - - -```swift -user.setEmailAsPrimary(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [EditEmailRequestSchema](#EditEmailRequestSchema) | no | Request body | - - -Use this API to set an email address as primary. Primary email ID is a email address used for all future communications. - -*Returned Response:* - - - - -[LoginSuccess](#LoginSuccess) - -Success. Returns a JSON object with user details. Refer `LoginSuccess` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/UserExampleObject" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### sendVerificationLinkToEmail -Send verification link to email - - - -```swift -user.sendVerificationLinkToEmail(platform: platform, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| platform | String? | no | ID of the application | -| body | [EditEmailRequestSchema](#EditEmailRequestSchema) | no | Request body | - - -Use this API to send verification link to an email address. - -*Returned Response:* - - - - -[SendEmailVerifyLinkSuccess](#SendEmailVerifyLinkSuccess) - -Request body must contain an email ID. Refer `EditEmailRequestSchema` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - - - -## Content - - -#### getAnnouncements -Get live announcements - - - -```swift -content.getAnnouncements() { (response, error) in - // Use response -} -``` - - - - -Announcements are useful to highlight a message or information on top of a webpage. Use this API to retrieve live announcements. Get announcements on individual pages or for all pages. - -*Returned Response:* - - - - -[AnnouncementsResponseSchema](#AnnouncementsResponseSchema) - -Success. Returns a JSON object with the details of the announcement shown on an individual page. `$all` is a special slug to indicate that an announcement is being shown on all the pages. Check the example shown below or refer `AnnouncementsResponseSchema` for more details. - - - - -
    -  Examples: - - -
    -  Announcements enabled - -```json -{ - "$ref": "#/components/examples/AnnouncementEnabledExample" -} -``` -
    - -
    -  No Announcement enabled - -```json -{ - "value": { - "announcements": {}, - "refresh_rate": 900, - "refresh_pages": [] - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getBlog -Get a blog - - - -```swift -content.getBlog(slug: slug, rootId: rootId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a blog. You can get slug value from the endpoint /service/application/content/v1.0/blogs/. | -| rootId | String? | no | ID given to the HTML element | - - - -Use this API to get the details of a blog using its slug. Details include the title, reading time, publish status, feature image, tags, author, etc. - -*Returned Response:* - - - - -[BlogSchema](#BlogSchema) - -Success. Returns a JSON object with blog details. Check the example shown below or refer `BlogSchema` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/BlogResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getBlogs -Get a list of blogs - - - -```swift -content.getBlogs(pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | -| pageSize | Int? | no | The number of items to retrieve in each page. | - - - -Use this API to get all the blogs. - -*Returned Response:* - - - - -[BlogGetResponse](#BlogGetResponse) - -Success. Check the example shown below or refer `BlogGetResponse` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/BlogGetResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getFaqs -Get a list of FAQs - - - -```swift -content.getFaqs() { (response, error) in - // Use response -} -``` - - - - -Use this API to get a list of frequently asked questions. Users will benefit from it when facing any issue with the website. - -*Returned Response:* - - - - -[FaqResponseSchema](#FaqResponseSchema) - -Success. Returns a JSON object with question and answers. Check the example shown below or refer `FaqResponseSchema` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/AppFaqs" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getFaqCategories -Get a list of FAQ categories - - - -```swift -content.getFaqCategories() { (response, error) in - // Use response -} -``` - - - - -FAQs can be divided into categories. Use this API to get a list of FAQ categories. - -*Returned Response:* - - - - -[GetFaqCategoriesSchema](#GetFaqCategoriesSchema) - -Success. Returns a JSON object with categories of FAQ. Check the example shown below or refer `GetFaqCategoriesSchema` for more details. - - - - -
    -  Example: - -```json -{ - "categories": [ - { - "index": 0, - "children": [ - "6026426ae507768b168dee4b" - ], - "title": "Test", - "_id": "60263f80c83c1f89f2863a8a", - "slug": "test", - "application": "000000000000000000000001" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getFaqBySlug -Get an FAQ - - - -```swift -content.getFaqBySlug(slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of an FAQ. You can get slug value from the endpoint /service/application/content/v1.0/faq. | - - - -Use this API to get a particular FAQ by its slug. - -*Returned Response:* - - - - -[FaqSchema](#FaqSchema) - -Success. Returns a question and answer by its slug. Check the example shown below or refer `FaqSchema` for more details. - - - - -
    -  Example: - -```json -{ - "_id": "5eb2db750a8ebf497e315028", - "question": "how to refer my friend", - "answer": "1. Click on refer and earn image in fynd app\n2. Click on share the code\n3. Use any method for sharing\n4. Once the user activates the app with your code, both of you will get the refereal credits.", - "slug": "how to refer", - "application": "000000000000000000000001" -} -``` -
    - - - - - - - - - ---- - - -#### getFaqCategoryBySlug -Get the FAQ category - - - -```swift -content.getFaqCategoryBySlug(slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of an FAQ category. You can get slug value from the endpoint /service/application/content/v1.0/faq/categories. | - - - -FAQs can be divided into categories. Use this API to get the category to which an FAQ belongs. - -*Returned Response:* - - - - -[GetFaqCategoryBySlugSchema](#GetFaqCategoryBySlugSchema) - -Success. Returns a FAQ category with its slug. Check the example shown below or refer `GetFaqCategoryBySlugSchema` for more details. - - - - -
    -  Example: - -```json -{ - "category": { - "index": 0, - "children": [ - { - "_id": "6026426ae507768b168dee4b", - "question": "question 1", - "answer": "answer 1", - "slug": "question-1", - "application": "000000000000000000000001" - } - ], - "_id": "60263f80c83c1f89f2863a8a", - "slug": "test", - "title": "Test", - "application": "000000000000000000000001" - } -} -``` -
    - - - - - - - - - ---- - - -#### getFaqsByCategorySlug -Get FAQs using the slug of FAQ category - - - -```swift -content.getFaqsByCategorySlug(slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of an FAQ category. You can get slug value from the endpoint /service/application/content/v1.0/faq/categories. | - - - -FAQs can be divided into categories. Use this API to get all the FAQs belonging to a category by using the category slug. - -*Returned Response:* - - - - -[GetFaqSchema](#GetFaqSchema) - -Success. Returns a categorized list of question and answers using its slug. Check the example shown below or refer `GetFaqSchema` for more details. - - - - -
    -  Example: - -```json -{ - "faqs": [ - { - "_id": "60265b64e507768b168dee4d", - "question": "question 1", - "answer": "answer 1", - "slug": "question-1", - "application": "000000000000000000000001" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getLandingPage -Get the landing page - - - -```swift -content.getLandingPage() { (response, error) in - // Use response -} -``` - - - - -Landing page is the first page that a prospect lands upon while visiting a website. Use this API to fetch the details of a landing page. - -*Returned Response:* - - - - -[LandingPageSchema](#LandingPageSchema) - -Success. Returns the landing page details. Check the example shown below or refer `LandingPageSchema` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/LandingPageResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getLegalInformation -Get legal information - - - -```swift -content.getLegalInformation() { (response, error) in - // Use response -} -``` - - - - -Use this API to get the legal information of an application, which includes Privacy Policy, Terms and Conditions, Shipping Policy and FAQs regarding the usage of the application. - -*Returned Response:* - - - - -[ApplicationLegal](#ApplicationLegal) - -Success. Returns the T&C, Shipping Policy, Privacy Policy and Return Policy. Check the example shown below or refer `ApplicationLegal` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/Legal" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getNavigations -Get the navigation - - - -```swift -content.getNavigations(pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | -| pageSize | Int? | no | The number of items to retrieve in each page. | - - - -Use this API to fetch the navigations details which includes the items of the navigation pane. It also shows the links and sub-navigations. - -*Returned Response:* - - - - -[NavigationGetResponse](#NavigationGetResponse) - -Success. Returns a JSON object with navigation details. Check the example shown below or refer `NavigationGetResponse` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/NavigationGetResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getPage -Get a page - - - -```swift -content.getPage(slug: slug, rootId: rootId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a page. You can get slug value from the endpoint /service/application/content/v1.0/pages/. | -| rootId | String? | no | ID given to the HTML element | - - - -Use this API to get the details of a page using its slug. Details include the title, seo, publish status, feature image, tags, meta, etc. - -*Returned Response:* - - - - -[PageSchema](#PageSchema) - -Success. Returns a JSON object with page details. Check the example shown below or refer `CustomPageSchema` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/PageResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getPages -Get all pages - - - -```swift -content.getPages(pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | -| pageSize | Int? | no | The number of items to retrieve in each page. | - - - -Use this API to get a list of pages. - -*Returned Response:* - - - - -[PageGetResponse](#PageGetResponse) - -Success. Returns a list of pages along with their details. Check the example shown below or refer `PageGetResponse` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/PageGetResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getSEOConfiguration -Get the SEO of an application - - - -```swift -content.getSEOConfiguration() { (response, error) in - // Use response -} -``` - - - - -Use this API to get the SEO details of an application, which includes a robot.txt, meta-tags and sitemap. - -*Returned Response:* - - - - -[SeoComponent](#SeoComponent) - -Success. Returns a JSON object SEO details such as robots.txt, meta-tags, and sitemap. Check the example shown below or refer `SeoComponent` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/Seo" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getSlideshows -Get the slideshows - - - -```swift -content.getSlideshows(pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | -| pageSize | Int? | no | The number of items to retrieve in each page. | - - - -Use this API to get a list of slideshows along with their details. - -*Returned Response:* - - - - -[SlideshowGetResponse](#SlideshowGetResponse) - -Success. Check the example shown below or refer `SlideshowGetResponse` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SlideshowGetResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getSlideshow -Get a slideshow - - - -```swift -content.getSlideshow(slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a slideshow. You can get slug value from the endpoint /service/application/content/v1.0/slideshow/. | - - - -A slideshow is a group of images, videos or a combination of both that are shown on the website in the form of slides. Use this API to fetch a slideshow using its `slug`. - -*Returned Response:* - - - - -[SlideshowSchema](#SlideshowSchema) - -Success. Returns the details of how a slideshow is configured. Check the example shown below or refer `SlideshowSchema` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SlideshowResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getSupportInformation -Get the support information - - - -```swift -content.getSupportInformation() { (response, error) in - // Use response -} -``` - - - - -Use this API to get contact details for customer support including emails and phone numbers. - -*Returned Response:* - - - - -[Support](#Support) - -Success. Returns all support information including email and phone number. Check the example shown below or refer `Support` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/Support" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getTags -Get the tags associated with an application - - - -```swift -content.getTags() { (response, error) in - // Use response -} -``` - - - - -Use this API to get all the CSS and JS injected in the application in the form of tags. - -*Returned Response:* - - - - -[TagsSchema](#TagsSchema) - -Success. Returns a JSON object containing all the tags injected in the application. Check the example shown below or refer `TagsSchema` for more details. - - - - -
    -  Example: - -```json -{ - "application": "000000000000000000000001", - "_id": "5f7c37b2dd0144bb3a353c5f", - "tags": [ - { - "name": "Tapfiliate JS", - "sub_type": "external", - "_id": "5f7c37b2dd0144f1f8353c60", - "type": "js", - "url": "https://script.tapfiliate.com/tapfiliate.js", - "position": "body-bottom", - "attributes": { - "async": true - } - } - ] -} -``` -
    - - - - - - - - - ---- - - - - -## Communication - - -#### getCommunicationConsent -Get communication consent - - - -```swift -communication.getCommunicationConsent() { (response, error) in - // Use response -} -``` - - - - -Use this API to retrieve the consent provided by the user for receiving communication messages over Email/SMS/WhatsApp. - -*Returned Response:* - - - - -[CommunicationConsent](#CommunicationConsent) - -Success. Returns all available communication opt-ins along with the consent details. Check the example shown below or refer `CommunicationConsent` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/CommunicationConsent" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### upsertCommunicationConsent -Upsert communication consent - - - -```swift -communication.upsertCommunicationConsent(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [CommunicationConsentReq](#CommunicationConsentReq) | yes | Request body | - - -Use this API to update and insert the consent provided by the user for receiving communication messages over Email/SMS/WhatsApp. - -*Returned Response:* - - - - -[CommunicationConsentRes](#CommunicationConsentRes) - -Success. Updates the channels for which user has consented. Check the example shown below or refer `CommunicationConsentRes` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/CommunicationConsentRes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### upsertAppPushtoken -Upsert push token of a user - - - -```swift -communication.upsertAppPushtoken(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [PushtokenReq](#PushtokenReq) | yes | Request body | - - -Use this API to update and insert the push token of the user. - -*Returned Response:* - - - - -[PushtokenRes](#PushtokenRes) - -Success. Check the example shown below or refer `PushtokenRes` for more details. - - - - -
    -  Examples: - - -
    -  create - -```json -{ - "$ref": "#/components/examples/PushtokenResponseCreate" -} -``` -
    - -
    -  update - -```json -{ - "$ref": "#/components/examples/PushtokenResponseUpdate" -} -``` -
    - -
    -  reset - -```json -{ - "$ref": "#/components/examples/PushtokenResponseReset" -} -``` -
    - -
    - - - - - - - - - ---- - - - - -## Share - - -#### getApplicationQRCode -Create QR Code of an app - - - -```swift -share.getApplicationQRCode() { (response, error) in - // Use response -} -``` - - - - -Use this API to create a QR code of an app for sharing it with users who want to use the app. - -*Returned Response:* - - - - -[QRCodeResp](#QRCodeResp) - -Success. Check the example shown below or refer `QRCodeResp` for more details. - - - - -
    -  Example: - -```json -{ - "link": "https://fynd.com", - "svg": "" -} -``` -
    - - - - - - - - - ---- - - -#### getProductQRCodeBySlug -Create QR Code of a product - - - -```swift -share.getProductQRCodeBySlug(slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint. | - - - -Use this API to create a QR code of a product for sharing it with users who want to view/purchase the product. - -*Returned Response:* - - - - -[QRCodeResp](#QRCodeResp) - -Success. Check the example shown below or refer `QRCodeResp` for more details. - - - - -
    -  Example: - -```json -{ - "link": "https://fynd.com/products/shirt-small-blue", - "svg": "" -} -``` -
    - - - - - - - - - ---- - - -#### getCollectionQRCodeBySlug -Create QR Code of a collection - - - -```swift -share.getCollectionQRCodeBySlug(slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a collection. You can get slug value from the endpoint. | - - - -Use this API to create a QR code of a collection of products for sharing it with users who want to view/purchase the collection. - -*Returned Response:* - - - - -[QRCodeResp](#QRCodeResp) - -Success. Check the example shown below or refer `QRCodeResp` for more details. - - - - -
    -  Example: - -```json -{ - "link": "https://fynd.com/collection/flat-50-off", - "svg": "" -} -``` -
    - - - - - - - - - ---- - - -#### getUrlQRCode -Create QR Code of a URL - - - -```swift -share.getUrlQRCode(url: url) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| url | String | yes | A link or a web address | - - - -Use this API to create a QR code of a URL for sharing it with users who want to visit the link. - -*Returned Response:* - - - - -[QRCodeResp](#QRCodeResp) - -Success. Check the example shown below or refer `QRCodeResp` for more details. - - - - -
    -  Example: - -```json -{ - "link": "https://fynd.com", - "svg": "" -} -``` -
    - - - - - - - - - ---- - - -#### createShortLink -Create a short link - - - -```swift -share.createShortLink(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [ShortLinkReq](#ShortLinkReq) | no | Request body | - - -Use this API to create a short link that is easy to write/share/read as compared to long URLs. - -*Returned Response:* - - - - -[ShortLinkRes](#ShortLinkRes) - -Success. Check the example shown below or refer `ShortLinkRes` for more details. - - - - -
    -  Example: - -```json -{ - "url": { - "original": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh", - "short": "https://0icof6vvsf.hostx0.de/l/3qKlnsq-x", - "hash": "3qKlnsq-x" - }, - "redirects": { - "ios": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "android": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "web": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "force_web": false - }, - "created_by": "team", - "personalized": false, - "app_redirect": false, - "fallback": "web", - "enable_tracking": false, - "active": true, - "count": 0, - "_id": "601a54054c0349592e76c8f3", - "title": "new ", - "meta": { - "type": "brand" - }, - "expire_at": null, - "application": "5eda528b97457fe43a733ace", - "user_id": "5e4d01e2c39837ab66144f6d", - "created_at": "2021-02-03T07:43:01.342Z", - "updated_at": "2021-02-03T07:43:01.342Z" -} -``` -
    - - - - - - - - - ---- - - -#### getShortLinkByHash -Get short link by hash - - - -```swift -share.getShortLinkByHash(hash: hash) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| hash | String | yes | A string value used for converting long URL to short URL and vice-versa. | - - - -Use this API to get a short link by using a hash value. - -*Returned Response:* - - - - -[ShortLinkRes](#ShortLinkRes) - -Success. Check the example shown below or refer `ShortLinkRes` for more details. - - - - -
    -  Example: - -```json -{ - "url": { - "original": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh", - "short": "https://0icof6vvsf.hostx0.de/l/3qKlnsq-x", - "hash": "3qKlnsq-x" - }, - "redirects": { - "ios": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "android": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "web": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "force_web": false - }, - "created_by": "team", - "personalized": false, - "app_redirect": false, - "fallback": "web", - "enable_tracking": false, - "active": true, - "count": 0, - "_id": "601a54054c0349592e76c8f3", - "title": "new ", - "meta": { - "type": "brand" - }, - "expire_at": null, - "application": "5eda528b97457fe43a733ace", - "user_id": "5e4d01e2c39837ab66144f6d", - "created_at": "2021-02-03T07:43:01.342Z", - "updated_at": "2021-02-03T07:43:01.342Z" -} -``` -
    - - - - - - - - - ---- - - -#### getOriginalShortLinkByHash -Get original link by hash - - - -```swift -share.getOriginalShortLinkByHash(hash: hash) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| hash | String | yes | A string value used for converting long URL to short URL and vice-versa. | - - - -Use this API to retrieve the original link from a short-link by using a hash value. - -*Returned Response:* - - - - -[ShortLinkRes](#ShortLinkRes) - -Success. Check the example shown below or refer `ShortLinkRes` for more details. - - - - -
    -  Example: - -```json -{ - "url": { - "original": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh", - "short": "https://0icof6vvsf.hostx0.de/l/3qKlnsq-x", - "hash": "3qKlnsq-x" - }, - "redirects": { - "ios": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "android": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "web": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "force_web": false - }, - "created_by": "team", - "personalized": false, - "app_redirect": false, - "fallback": "web", - "enable_tracking": false, - "active": true, - "count": 0, - "_id": "601a54054c0349592e76c8f3", - "title": "new ", - "meta": { - "type": "brand" - }, - "expire_at": null, - "application": "5eda528b97457fe43a733ace", - "user_id": "5e4d01e2c39837ab66144f6d", - "created_at": "2021-02-03T07:43:01.342Z", - "updated_at": "2021-02-03T07:43:01.342Z" -} -``` -
    - - - - - - - - - ---- - - - - -## FileStorage - - -#### startUpload -Initiates an upload and returns a storage link that is valid for 30 minutes. You can use the storage link to make subsequent upload request with file buffer or blob. - - - -```swift -filestorage.startUpload(namespace: namespace, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| namespace | String | yes | Name of the bucket created for storing objects. | -| body | [StartRequest](#StartRequest) | no | Request body | - - -Use this API to perform the first step of uploading (i.e. **Start**) an arbitrarily sized buffer or blob. - -The three major steps are: -* Start -* Upload -* Complete - -### Start -Initiates the assets upload using `startUpload`. -It returns a storage link in response. - -### Upload -Use the storage link to upload a file (Buffer or Blob) to the File Storage. -Make a `PUT` request on storage link received from `startUpload` API with the file (Buffer or Blob) in the request body. - -### Complete -After successfully upload, call the `completeUpload` API to finish the upload process. -This operation will return the URL of the uploaded file. - - -*Returned Response:* - - - - -[StartResponse](#StartResponse) - -Success. Next, call the `completeUpload` API and pass the response payload of this API to finish the upload process. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### completeUpload -Completes the upload process. After successfully uploading a file, call this API to finish the upload process. - - - -```swift -filestorage.completeUpload(namespace: namespace, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| namespace | String | yes | Name of the bucket created for storing objects. | -| body | [StartResponse](#StartResponse) | no | Request body | - - -Use this API to perform the third step of uploading (i.e. **Complete**) an arbitrarily sized buffer or blob. - -The three major steps are: -* Start -* Upload -* Complete - -### Start -Initiates the assets upload using `startUpload`. -It returns a storage link in response. - -### Upload -Use the storage link to upload a file (Buffer or Blob) to the File Storage. -Make a `PUT` request on storage link received from `startUpload` API with the file (Buffer or Blob) in the request body. - -### Complete -After successfully upload, call the `completeUpload` API to finish the upload process. -This operation will return the URL of the uploaded file. - - -*Returned Response:* - - - - -[CompleteResponse](#CompleteResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - - - -## Configuration - - -#### getApplication -Get current application details - - - -```swift -configuration.getApplication() { (response, error) in - // Use response -} -``` - - - - -Use this API to get the current application details which includes configurations that indicate the status of the website, domain, ID, tokens, images, etc. - -*Returned Response:* - - - - -[Application](#Application) - -Success. Check the example shown below or refer `Application` for more details. - - - - -
    -  Example: - -```json -{ - "website": { - "enabled": true, - "basepath": "/" - }, - "cors": { - "domains": [] - }, - "auth": { - "enabled": false - }, - "description": "Uniket B2B - India's Fastest Growing Retail Store - Aapki Badhti Dukaan", - "channel_type": "uniket", - "cache_ttl": -1, - "internal": false, - "is_active": true, - "_id": "000000000000000000000004", - "name": "Uniket B2B", - "owner": "5e71a60dc671daffd81992ea", - "company_id": 1, - "token": "iTNjY_yAI", - "redirections": [], - "meta": [], - "created_at": "2019-12-26T13:22:23.619Z", - "modified_at": "2020-12-02T05:49:41.610Z", - "__v": 29, - "banner": { - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/landscape-banner/original/uSwlNpygq-Uniket-B2B.png" - }, - "logo": { - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/free-logo/original/oEf3SQjda-Uniket-B2B.png" - }, - "favicon": { - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/favicon/original/y3h6SSlY5-Uniket-B2B.png" - }, - "domains": [ - { - "verified": true, - "is_primary": true, - "is_default": true, - "is_shortlink": true, - "_id": "5eb1177748312a3bd55d0f1e", - "name": "uniket.hostx0.de" - }, - { - "verified": true, - "is_primary": false, - "is_default": false, - "is_shortlink": false, - "_id": "5f0858c5f86e00cd42dccc8d", - "name": "jd.hostx0.de" - } - ], - "app_type": "live", - "mobile_logo": { - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/free-logo/original/oEf3SQjda-Uniket-B2B.png" - }, - "domain": { - "verified": true, - "is_primary": true, - "is_default": true, - "is_shortlink": true, - "_id": "5eb1177748312a3bd55d0f1e", - "name": "uniket.hostx0.de" - }, - "id": "000000000000000000000004" -} -``` -
    - - - - - - - - - ---- - - -#### getOwnerInfo -Get application, owner and seller information - - - -```swift -configuration.getOwnerInfo() { (response, error) in - // Use response -} -``` - - - - -Use this API to get the current application details which includes channel name, description, banner, logo, favicon, domain details, etc. This API also retrieves the seller and owner information such as address, email address, and phone number. - -*Returned Response:* - - - - -[ApplicationAboutResponse](#ApplicationAboutResponse) - -Success. Check the example shown below or refer `ApplicationAboutResponse` for more details. - - - - -
    -  Example: - -```json -{ - "application_info": { - "domains": [ - { - "verified": true, - "name": "uniket-testing.addsale.link", - "custom": false, - "is_primary": true, - "is_default": true - } - ], - "website": { - "enabled": true, - "basepath": "/" - }, - "cors": { - "domains": [] - }, - "description": "R-City Mall,Ghatkoper East,Mumbai", - "is_active": true, - "_id": "5cd3db5e9d692cfe5302a7ba", - "name": "Shivam Clothing Store", - "meta": [ - { - "name": "tes", - "value": "test" - } - ], - "token": "xOfcP-aYE", - "secret": "", - "created_at": "2019-05-09T07:48:46.218Z", - "banner": { - "secure_url": "https://res.cloudinary.com/jkvora/image/upload/v1561551809/fqt2djkddoe2yjjlln2h.png" - }, - "logo": { - "secure_url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1577513094/addsale/applications/app_5cd3db5e9d692cfe5302a7ba/media/store/logo/ayrkk2uzfknst2ohluzc.png" - }, - "id": "5cd3db5e9d692cfe5302a7ba", - "company_info": { - "_id": "5da4274a723af4000188a66c", - "uid": 873, - "created_on": "2019-10-14T07:44:10.391Z", - "is_active": true, - "name": "SAPPER LIFESTYLE PRIVATE LIMITED", - "addresses": [ - { - "pincode": 110042, - "address1": "412, SISODIA MOHALLA BADALI VILLAGE", - "city": "NEW DELHI", - "state": "DELHI", - "country": "INDIA", - "address_type": "registered" - }, - { - "pincode": 110042, - "address1": "412, SISODIA MOHALLA BADALI VILLAGE", - "city": "NEW DELHI", - "state": "DELHI", - "country": "INDIA", - "address_type": "office" - } - ], - "notification_emails": [ - "ecom.sapperlifestyle@f2fretail.com" - ] - }, - "owner_info": { - "_id": "5c77921fa1bf7d8695ed57fd", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "jalakvora@gofynd.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "jalakvora@fynd.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "jalakvora@uniket.store" - } - ], - "phone_numbers": [ - { - "active": true, - "primary": true, - "verified": true, - "country_code": 91, - "phone": "9408282323" - } - ], - "first_name": "Jalak", - "last_name": "Vora", - "profile_pic": "" - } - } -} -``` -
    - - - - - - - - - ---- - - -#### getBasicDetails -Get basic application details - - - -```swift -configuration.getBasicDetails() { (response, error) in - // Use response -} -``` - - - - -Use this API to retrieve only the basic details of the application which includes channel name, description, banner, logo, favicon, domain details, etc. - -*Returned Response:* - - - - -[ApplicationDetail](#ApplicationDetail) - -Success. Check the example shown below or refer `ApplicationDetail` for more details. - - - - -
    -  Example: - -```json -{ - "name": "Uniket B2B", - "description": "Uniket B2B - India's Fastest Growing Retail Store - Aapki Badhti Dukaan", - "logo": { - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/free-logo/original/oEf3SQjda-Uniket-B2B.png" - }, - "mobile_logo": { - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/free-logo/original/oEf3SQjda-Uniket-B2B.png" - }, - "favicon": { - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/favicon/original/y3h6SSlY5-Uniket-B2B.png" - }, - "banner": { - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/landscape-banner/original/uSwlNpygq-Uniket-B2B.png" - }, - "domain": { - "verified": true, - "is_primary": true, - "is_default": true, - "is_shortlink": false, - "_id": "5eb1177748312a3bd55d0f1e", - "name": "uniket.hostx0.de" - }, - "domains": [ - { - "verified": true, - "is_primary": true, - "is_default": true, - "is_shortlink": false, - "_id": "5eb1177748312a3bd55d0f1e", - "name": "uniket.hostx0.de" - }, - { - "verified": true, - "is_primary": false, - "is_default": false, - "is_shortlink": true, - "_id": "5f0858c5f86e00cd42dccc8d", - "name": "jd.hostx0.de" - } - ], - "company_id": 1, - "_id": "000000000000000000000004" -} -``` -
    - - - - - - - - - ---- - - -#### getIntegrationTokens -Get integration tokens - - - -```swift -configuration.getIntegrationTokens() { (response, error) in - // Use response -} -``` - - - - -Use this API to retrieve the tokens used while integrating Firebase, MoEngage, Segment, GTM, Freshchat, Safetynet, Google Map and Facebook. **Note** - Token values are encrypted with AES encryption using a secret key. Kindly reach out to the developers for obtaining the secret key. - -*Returned Response:* - - - - -[AppTokenResponse](#AppTokenResponse) - -Success. Check the example shown below or refer `AppTokenResponse` for more details. - - - - -
    -  Example: - -```json -{ - "tokens": { - "firebase": { - "credentials": { - "project_id": "", - "gcm_sender_id": "", - "application_id": "", - "api_key": "" - }, - "enabled": false - }, - "moengage": { - "credentials": { - "app_id": "" - }, - "enabled": false - }, - "segment": { - "credentials": { - "write_key": "U2FsdGVkX18E920z+xtaD+GnGWoK/5SNxu61phXf6/o=" - }, - "enabled": false - }, - "gtm": { - "credentials": { - "api_key": "" - }, - "enabled": false - }, - "freshchat": { - "credentials": { - "app_id": "U2FsdGVkX19+Egjfy8alIB4S+n2IQEXz2X4yxzimxbGzq9M5+iFsvGjrBAyQrDZ/iIXgWQyWOFRHmf9xhFGajQ==", - "app_key": "U2FsdGVkX18OydYSvUBRKJDsLD1KCcwK6+jJVGma4Ck2PVwOv6BW5vyiM2sZ4kEpHbRV38KBPZPqlx3EfZd6mw==" - }, - "enabled": true - }, - "safetynet": { - "credentials": { - "api_key": "U2FsdGVkX1/Ex0BXvB16B81dwWIfVK8LPwexMMbVC3/nB9Y5n4stcnOMUCDalDs8Z92MecOQKydWg+E17QfZ4Q==" - }, - "enabled": true - }, - "fynd_rewards": { - "credentials": { - "public_key": "U2FsdGVkX1/C7x0hybxKPpWSMYBEKukQCVjnm7wfW3lrTJPmcr06xvLzVatPQJTKXeXvay0rdvcXuHlp8n/VAX7v9Usobmp1znadnPWt07GOvq5aPK9zDlg05tb+TX8Wx0q2rVonRK0Q6ZyMcn6Oy+Z812TpRAlcU1AmSrDtl/PMjuH1rSRTxKJLD0HzXk9zPl2M6GOKmgzjpHD4ZmtRSfJmm/h+qbZZ4AuD9upTbJzDm/pcp4S4cYu9rSV31JpOtAkrCxZFzCT8seWKa2eU8VdleRltwF5DO1x8Pny/hKNmhrUqxdkevY6lm4aEQjThA/EeBv1UPq52EFDteXLsZ6yBXyNAxcFNuPupour+K8hi0nfgbd/fsFqu5NUBOwz0hsqQh9OsTGt7SdiIyMSQgCttphaqhBbJ926UlG9d/O1W1u+i9rn7pECcH1eyUYlsNbYqghciz9pTrfRdqA8AIa2j7H/3Lxq37arxZCIDlTgl+Kk/8QUTsTefk+seGZsyiDyIkxW+FcmHBZLr3y85ST23szWSnyweV2hQHtPWnCE=" - } - }, - "auth": { - "google": { - "app_id": "U2FsdGVkX19ZkUS8HAnz17Sbcixaj0N4xDcaxztzAPdkxsc2i56kuEL+hVDv5z47HjiY4jOFN0zd5HbO9vf5/adwr6L8QQVEmz1BEEGEze13a5PgONGZlfQkxeuQLBT9" - }, - "facebook": { - "app_id": "U2FsdGVkX1/kPjoWmEvESc276Ect4VZmAFVTkQKKjsxgk6LXWjj73vPrBsnJyPpR" - }, - "accountkit": { - "app_id": "" - } - }, - "google_map": { - "credentials": { - "api_key": "U2FsdGVkX1+5tBH/3lREPiDwVukCS/Q2ftu/CYD9RdLYK8hGO/XJfrs2zpoGDKCJBhgTDRESItRKR7Lt/w+zeQ==" - } - } - }, - "_id": "5e285cb1df7e5b1421d5f840", - "application": "000000000000000000000004", - "created_at": "2020-01-22T14:31:13.192Z", - "modified_at": "2020-05-01T04:14:42.117Z", - "__v": 0 -} -``` -
    - - - - - - - - - ---- - - -#### getOrderingStores -Get deployment stores - - - -```swift -configuration.getOrderingStores(pageNo: pageNo, pageSize: pageSize, q: q) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | -| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | -| q | String? | no | Store code or name of the ordering store. | - - - -Use this API to retrieve the details of all the deployment stores (the selling locations where the application will be utilized for placing orders). - -*Returned Response:* - - - - -[OrderingStores](#OrderingStores) - -Success. Check the example shown below or refer `OrderingStores` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getStoreDetailById -Get ordering store details - - - -```swift -configuration.getStoreDetailById(storeId: storeId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| storeId | Int | yes | Store uid | - - - -Use this API to retrieve the details of given stores uid (the selling locations where the application will be utilized for placing orders). - -*Returned Response:* - - - - -[OrderingStore](#OrderingStore) - -Success. Check the example shown below or refer `OrderingStore` for more details. - - - - -
    -  Example: - -```json -{ - "uid": 1060, - "name": "THE MANDHANA PARK KAMLANAGAR DELHI", - "pincode": 110007, - "store_code": "MRVLB22", - "code": "MRVLB22", - "display_name": "Kamla Nagar", - "store_type": "mall" -} -``` -
    - - - - - - - - - ---- - - -#### getFeatures -Get features of application - - - -```swift -configuration.getFeatures() { (response, error) in - // Use response -} -``` - - - - -Use this API to retrieve the configuration of features such as product detail, landing page, options in the login/registration screen, communication opt-in, cart options and many more. - -*Returned Response:* - - - - -[AppFeatureResponse](#AppFeatureResponse) - -Success. Check the example shown below or refer `AppFeatureResponse` for more details. - - - - -
    -  Example: - -```json -{ - "feature": { - "product_detail": { - "similar": [ - "basic", - "visual", - "brand", - "category", - "seller", - "price", - "specs" - ], - "seller_selection": true, - "update_product_meta": true, - "request_product": true - }, - "landing_page": { - "launch_page": { - "page_type": "home", - "params": null, - "query": null - }, - "continue_as_guest": true, - "login_btn_text": "Click here to sign-in", - "show_domain_textbox": true, - "show_register_btn": true - }, - "registration_page": { - "ask_store_address": false - }, - "home_page": { - "order_processing": true - }, - "common": { - "communication_optin_dialog": { - "visibility": true - }, - "deployment_store_selection": { - "enabled": true, - "type": "hard" - }, - "listing_price": { - "value": "min", - "sort": "min" - }, - "currency": { - "value": [ - "INR" - ], - "type": "explicit", - "default_currency": "INR" - }, - "revenue_engine": { - "enabled": false - }, - "feedback": { - "enabled": true - }, - "compare_products": { - "enabled": true - }, - "reward_points": { - "credit": { - "enabled": true - }, - "debit": { - "enabled": true, - "auto_apply": false, - "strategy_channel": "REWARDS" - } - } - }, - "cart": { - "gst_input": true, - "staff_selection": true, - "placing_for_customer": true, - "google_map": true, - "revenue_engine_coupon": false - }, - "qr": { - "application": true, - "products": true, - "collections": true - }, - "pcr": { - "staff_selection": true - }, - "order": { - "buy_again": true - }, - "_id": "5e57643c986e4119c973df7d", - "app": "000000000000000000000004", - "created_at": "2020-02-27T06:39:56.088Z", - "modified_at": "2021-02-02T11:04:14.289Z", - "__v": 1 - } -} -``` -
    - - - - - - - - - ---- - - -#### getContactInfo -Get application information - - - -```swift -configuration.getContactInfo() { (response, error) in - // Use response -} -``` - - - - -Use this API to retrieve information about the social links, address and contact information of the company/seller/brand operating the application. - -*Returned Response:* - - - - -[ApplicationInformation](#ApplicationInformation) - -Success. Check the example shown below or refer `ApplicationAboutResponse` for more details. - - - - -
    -  Example: - -```json -{ - "value": { - "address": { - "loc": null, - "address_line": [ - "Warehouse 5, Near Industrial Complex", - "2nd Lane, Andheri" - ], - "phone": [ - { - "code": "+91", - "number": "9988776654" - } - ], - "city": "Mumbai , Maharashtra , India", - "country": "India", - "pincode": 400059 - }, - "support": { - "phone": [], - "email": [], - "timing": "9 AM to 9 PM" - }, - "social_links": { - "facebook": { - "title": "Facebook", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/hQAbAKdvHK-facebookfooteraopcjq.svg", - "link": "" - }, - "instagram": { - "title": "Instagram", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/UZYsGWOqXp-instagramfooterl3utrr.svg", - "link": "" - }, - "twitter": { - "title": "Twitter", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/oT2hW-BJjq-twitterfooternajsyr.svg", - "link": "" - }, - "pinterest": { - "title": "Pinterest", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/v0erlcMk8p-pinterestfooternzmq4b.svg", - "link": "" - }, - "google_plus": { - "title": "Google+", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/lw3Y5S58h4-googleplusysukr1.png", - "link": "" - }, - "youtube": { - "title": "Youtube", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/EYV03PDST_-youtubefootermqhcr7.svg", - "link": "" - }, - "linked_in": { - "title": "LinkedIn", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/qa7gx_bW9O-linkedinfooterrcr0yq.svg", - "link": "" - }, - "vimeo": { - "title": "Vimeo", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/Ttc80b3U78-vimeofooternho4br.svg", - "link": "" - }, - "blog_link": { - "title": "Blog", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/LKpxTk1I3s-mediumfooterdtvrva.svg", - "link": "" - } - }, - "links": [ - { - "title": "Shipping", - "link": "www.uniket.store/shipping-details" - }, - { - "title": "Returns", - "link": "www.uniket.store/policy/return-policy" - }, - { - "title": "Privacy", - "link": "www.uniket.store/policy/privacy-policy" - }, - { - "title": "Terms", - "link": "www.uniket.store/policy/terms-conditions" - } - ], - "copyright_text": "#MadeInIndia © 2020 Shopsense Retail Technologies", - "_id": "5e6627bd0732616083e83750", - "business_highlights": [ - { - "_id": "5fc901611dfba6c2e87d1ca9", - "title": "100% Genuine Products", - "icon": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/business-highlights/pictures/square-logo/original/bVlx43F2a-H6pvZ9tzp-business-logo-icon.png", - "sub_title": "Directly from brands" - }, - { - "_id": "5fc901611dfba64ce57d1caa", - "title": "Credit Facility Available", - "icon": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/business-highlights/pictures/square-logo/original/VMnltS1m3-QuUnEjOsA-business-logo-icon.png", - "sub_title": "Free 30 Days Credit" - }, - { - "_id": "5fc901611dfba64b2e7d1cab", - "title": "Assured Returns", - "icon": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/business-highlights/pictures/square-logo/original/cTHzgHJXK-sROtLMalN-business-logo-icon.png", - "sub_title": "For all damaged/wrong items" - } - ], - "application": "000000000000000000000004", - "created_at": "2020-03-09T11:25:49.921Z", - "modified_at": "2020-12-03T15:16:49.087Z", - "__v": 99 - } -} -``` -
    - - - - - - - - - ---- - - -#### getCurrencies -Get all currencies list - - - -```swift -configuration.getCurrencies() { (response, error) in - // Use response -} -``` - - - - -Use this API to get a list of currencies available. Moreover, get the name, code, symbol, and the decimal digits of the currencies. - -*Returned Response:* - - - - -[CurrenciesResponse](#CurrenciesResponse) - -Success. Check the example shown below or refer `CurrenciesResponse` for more details. - - - - -
    -  Example: - -```json -{ - "items": [ - { - "_id": "5ec75d11f7bfb54d798f3516", - "is_active": true, - "name": "United States Dollar", - "code": "USD", - "created_at": "2020-05-22T05:03:13.354Z", - "modified_at": "2020-06-05T09:12:04.248Z", - "decimal_digits": 2, - "symbol": "$" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getCurrencyById -Get currency by its ID - - - -```swift -configuration.getCurrencyById(id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String | yes | Object ID assigned to the currency | - - - -Use this API to retrieve a currency using its ID. - -*Returned Response:* - - - - -[Currency](#Currency) - -Success. Check the example shown below or refer `Currency` for more details. - - - - -
    -  Example: - -```json -{ - "_id": "5ec75d11f7bfb501d88f3559", - "is_active": true, - "name": "Gold Ounce", - "code": "XAU", - "created_at": "2020-05-22T05:03:13.429Z", - "modified_at": "2020-06-05T09:12:04.248Z", - "decimal_digits": null, - "symbol": null -} -``` -
    - - - - - - - - - ---- - - -#### getAppCurrencies -Get currencies enabled in the application - - - -```swift -configuration.getAppCurrencies() { (response, error) in - // Use response -} -``` - - - - -Use this API to get a list of currencies allowed in the current application. Moreover, get the name, code, symbol, and the decimal digits of the currencies. - -*Returned Response:* - - - - -[AppCurrencyResponse](#AppCurrencyResponse) - -Success. Check the example shown below or refer `AppCurrencyResponse` for more details. - - - - -
    -  Example: - -```json -{ - "application": "000000000000000000000001", - "default_currency": { - "ref": "5ecf6122d953d4242c044907", - "code": "INR" - }, - "supported_currency": [ - { - "_id": "5ecf6122d953d4242c044907", - "is_active": true, - "name": "Indian Rupee", - "code": "INR", - "decimal_digits": 2, - "symbol": "₹", - "created_at": "2020-05-28T06:58:42.532Z", - "modified_at": "2021-04-05T16:44:14.358Z" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getLanguages -Get list of languages - - - -```swift -configuration.getLanguages() { (response, error) in - // Use response -} -``` - - - - -Use this API to get a list of languages supported in the application. - -*Returned Response:* - - - - -[LanguageResponse](#LanguageResponse) - -Success. Check the example shown below or refer `LanguageResponse` for more details. - - - - -
    -  Example: - -```json -{ - "items": [ - { - "name": "हिन्दी", - "code": "hi-IN" - }, - { - "name": "English", - "code": "en-IN" - }, - { - "name": "عربى", - "code": "ar-AE" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getOrderingStoreCookie -Get an Ordering Store signed cookie on selection of ordering store. - - - -```swift -configuration.getOrderingStoreCookie(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [OrderingStoreSelectRequest](#OrderingStoreSelectRequest) | no | Request body | - - -Use this API to get an Ordering Store signed cookie upon selecting an ordering store. This will be used by the cart service to verify a coupon against the selected ordering store in cart. - -*Returned Response:* - - - - -[SuccessMessageResponse](#SuccessMessageResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### removeOrderingStoreCookie -Unset the Ordering Store signed cookie. - - - -```swift -configuration.removeOrderingStoreCookie() { (response, error) in - // Use response -} -``` - - - - -Use this API to unset the Ordering Store cookie upon changing the sales channel, by its domain URL, in the Universal Fynd Store app. - -*Returned Response:* - - - - -[SuccessMessageResponse](#SuccessMessageResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getAppStaffs -Get a list of staff. - - - -```swift -configuration.getAppStaffs(orderIncent: orderIncent, orderingStore: orderingStore, user: user) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| orderIncent | Bool? | no | This is a boolean value. Select `true` to retrieve the staff members eligible for getting incentives on orders. | -| orderingStore | Int? | no | ID of the ordering store. Helps in retrieving staff members working at a particular ordering store. | -| user | String? | no | Mongo ID of the staff. Helps in retrieving the details of a particular staff member. | - - - -Use this API to get a list of staff including the names, employee code, incentive status, assigned ordering stores, and title of each staff added to the application. - -*Returned Response:* - - - - -[AppStaffResponse](#AppStaffResponse) - -Success. Check the example shown below or refer `AppStaffResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - - - -## Payment - - -#### getAggregatorsConfig -Get payment gateway keys - - - -```swift -payment.getAggregatorsConfig(xApiToken: xApiToken, refresh: refresh) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| xApiToken | String? | no | Used for basic authentication. | -| refresh | Bool? | no | This is a boolean value. Select `true` to remove temporary cache files on payment gateway and replace with the latest one. | - - - -Use this API to retrieve the payment gateway key, secrets, merchant, SDK/API details to complete a payment at front-end. - -*Returned Response:* - - - - -[AggregatorsConfigDetailResponse](#AggregatorsConfigDetailResponse) - -Success. Returns the keys of all payment gateways. Check the example shown below or refer `AggregatorsConfigDetailResponse` for more details. - - - - -
    -  Example: - -```json -{ - "simpl": { - "key": "bf9d0ff65ffe6e54223a871e733bbd1c", - "secret": "XXXX-XXXX-XXXX-XXXX", - "config_type": "fynd", - "sdk": true - }, - "juspay": { - "key": "XXXX-XXXX-XXXX-XXXX", - "secret": "XXXX-XXXX-XXXX-XXXX", - "config_type": "fynd", - "merchant_key": "XXXX-XXXX-XXXX-XXXX", - "sdk": false, - "api": "https://api.juspay.in" - }, - "mswipe": { - "key": "XXXX-XXXX-XXXX-XXXX", - "secret": "XXXX-XXXX-XXXX-XXXX", - "config_type": "fynd", - "merchant_id": "XXXX-XXXX-XXXX-XXXX", - "user_id": "XXXX-XXXX-XXXX-XXXX", - "pin": "XXXX-XXXX-XXXX-XXXX", - "sdk": true, - "verify_api": "https://www.mswipetech.com/verificationapi/api/VerificationApi/MswipeCardSaleVerificationApi" - }, - "razorpay": { - "key": "XXXX-XXXX-XXXX-XXXX", - "secret": "XXXX-XXXX-XXXX-XXXX", - "config_type": "fynd", - "webhook_secret": "XXXX-XXXX-XXXX-XXXX", - "sdk": true, - "api": "https://api.razorpay.com/v1/", - "vpa": "XXXX-XXXX-XXXX-XXXX" - }, - "success": true, - "env": "live" -} -``` -
    - - - - - - - - - ---- - - -#### attachCardToCustomer -Attach a saved card to customer. - - - -```swift -payment.attachCardToCustomer(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [AttachCardRequest](#AttachCardRequest) | no | Request body | - - -Use this API to attach a customer's saved card at the payment gateway, such as Stripe, Juspay. - -*Returned Response:* - - - - -[AttachCardsResponse](#AttachCardsResponse) - -Success. Check the example shown below or refer `AttachCardsResponse` for more details. - - - - -
    -  Example: - -```json -{ - "success": true, - "message": "", - "data": { - "id": "pm_1IGQlvHY5NCLOJpYNTBP6WpY", - "brand": "visa", - "checks": { - "address_line1_check": null, - "address_postal_code_check": null, - "cvc_check": "pass" - }, - "country": "US", - "exp_month": 11, - "exp_year": 2025, - "fingerprint": "poKWfSweJ0I5CvEA", - "funding": "credit", - "generated_from": null, - "last4": "1111", - "networks": { - "available": [ - "visa" - ], - "preferred": null - }, - "three_d_secure_usage": { - "supported": true - }, - "wallet": null - } -} -``` -
    - - - - - - - - - ---- - - -#### getActiveCardAggregator -Fetch active payment gateway for card payments - - - -```swift -payment.getActiveCardAggregator(refresh: refresh) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| refresh | Bool? | no | | - - - -Use this API to retrieve an active payment aggregator along with the Customer ID. This is applicable for cards payments only. - -*Returned Response:* - - - - -[ActiveCardPaymentGatewayResponse](#ActiveCardPaymentGatewayResponse) - -Success. Returns an active payment gateway. Check the example shown below or refer `ActiveCardPaymentGatewayResponse` for more details. - - - - -
    -  Example: - -```json -{ - "success": true, - "message": "", - "cards": { - "aggregator": "Stripe", - "api": "https://www.example.com/cards/", - "customer_id": "lorem_12345" - } -} -``` -
    - - - - - - - - - ---- - - -#### getActiveUserCards -Fetch the list of cards saved by the user - - - -```swift -payment.getActiveUserCards(forceRefresh: forceRefresh) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| forceRefresh | Bool? | no | | - - - -Use this API to retrieve a list of cards stored by user from an active payment gateway. - -*Returned Response:* - - - - -[ListCardsResponse](#ListCardsResponse) - -Success. Returns a list of cards saved by the user. Check the example shown below or refer `ListCardsResponse` for more details. - - - - -
    -  Example: - -```json -{ - "success": true, - "message": "Success", - "data": [ - { - "aggregator_name": "Razorpay", - "card_id": "token_lorem_ipsum_001", - "card_token": "card_token_lorem_ipsum_001", - "card_reference": "ref_lorem_ipsum_001", - "card_number": "XXXX-XXXX-XXXX-1111", - "card_isin": "001", - "exp_year": 2025, - "exp_month": 5, - "card_type": "credit", - "card_issuer": "ICIC", - "card_brand": "VISA", - "nickname": "Visa", - "card_name": "Lorem Ipsum", - "expired": false, - "card_fingerprint": null, - "card_brand_image": "https://hdn-1.fynd.com/payment/visa.png" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### deleteUserCard -Delete a card - - - -```swift -payment.deleteUserCard(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [DeletehCardRequest](#DeletehCardRequest) | no | Request body | - - -Use this API to delete a card added by a user on the payment gateway and clear the cache. - -*Returned Response:* - - - - -[DeleteCardsResponse](#DeleteCardsResponse) - -Success. Returns a success message if card is deleted. - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### verifyCustomerForPayment -Validate customer for payment - - - -```swift -payment.verifyCustomerForPayment(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [ValidateCustomerRequest](#ValidateCustomerRequest) | no | Request body | - - -Use this API to check if the customer is eligible to use credit-line facilities such as Simpl Pay Later and Rupifi. - -*Returned Response:* - - - - -[ValidateCustomerResponse](#ValidateCustomerResponse) - -Success. Check the example shown below or refer `ValidateCustomerResponse` for more details. - - - - -
    -  Example: - -```json -{ - "success": true, - "message": "data fetched", - "data": { - "api_version": 2, - "data": { - "approved": true, - "button_text": "Buy Now, Pay Later", - "first_transaction": false - }, - "aggregator": "Simpl" - } -} -``` -
    - - - - - - - - - ---- - - -#### verifyAndChargePayment -Verify and charge payment - - - -```swift -payment.verifyAndChargePayment(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [ChargeCustomerRequest](#ChargeCustomerRequest) | no | Request body | - - -Use this API to verify and check the status of a payment transaction (server-to-server) made through aggregators like Simpl and Mswipe. - -*Returned Response:* - - - - -[ChargeCustomerResponse](#ChargeCustomerResponse) - -Success. Check the example shown below or refer `ChargeCustomerResponse` for more details. - - - - -
    -  Example: - -```json -{ - "success": true, - "message": "Payment Successful", - "status": "complete", - "order_id": "FY000000001000000101", - "aggregator": "Simpl", - "cart_id": "0000000", - "delivery_address_id": "0000000" -} -``` -
    - - - - - - - - - ---- - - -#### initialisePayment -Initialize a payment (server-to-server) for UPI and BharatQR - - - -```swift -payment.initialisePayment(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [PaymentInitializationRequest](#PaymentInitializationRequest) | no | Request body | - - -PUse this API to inititate payment using UPI, BharatQR, wherein the UPI requests are send to the app and QR code is displayed on the screen. - -*Returned Response:* - - - - -[PaymentInitializationResponse](#PaymentInitializationResponse) - -Success. Check the example shown below or refer `PaymentInitializationResponse` for more details. - - - - -
    -  Example: - -```json -{ - "success": true, - "aggregator": "UPI_Razorpay", - "method": "upi", - "status": "success", - "merchant_order_id": "FY000120000101", - "aggregator_order_id": "lorem_GX8W00p2ipsum", - "polling_url": "https://api.fynd.com/service/application/payment/v0.1/payments/confirm/polling/?app_id=000000000000000000000001", - "timeout": 240, - "virtual_id": null, - "razorpay_payment_id": "pay_dummy_001", - "customer_id": "cust_dummy_001" -} -``` -
    - - - - - - - - - ---- - - -#### checkAndUpdatePaymentStatus -Performs continuous polling to check status of payment on the server - - - -```swift -payment.checkAndUpdatePaymentStatus(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [PaymentStatusUpdateRequest](#PaymentStatusUpdateRequest) | no | Request body | - - -Use this API to perform continuous polling at intervals to check the status of payment until timeout. - -*Returned Response:* - - - - -[PaymentStatusUpdateResponse](#PaymentStatusUpdateResponse) - -Success. Returns the status of payment. Check the example shown below or refer `PaymentStatusUpdateResponse` for more details. - - - - -
    -  Example: - -```json -{ - "aggregator_name": "UPI_Razorpay", - "status": "success", - "retry": false -} -``` -
    - - - - - - - - - ---- - - -#### getPaymentModeRoutes -Get applicable payment options - - - -```swift -payment.getPaymentModeRoutes(amount: amount, cartId: cartId, pincode: pincode, checkoutMode: checkoutMode, refresh: refresh, cardReference: cardReference, userDetails: userDetails) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| amount | Int | yes | Payable amount. | -| cartId | String | yes | Identifier of the cart. | -| pincode | String | yes | The PIN Code of the destination address, e.g. 400059 | -| checkoutMode | String | yes | Option to checkout for self or for others. | -| refresh | Bool? | no | This is a boolean value. Select `true` to remove temporary cache files on payment gateway and replace with the latest one. | -| cardReference | String? | no | Card reference id of user's debit or credit card. | -| userDetails | String? | no | URIencoded JSON containing details of an anonymous user. | - - - -Use this API to get all valid payment options for doing a payment. - -*Returned Response:* - - - - -[PaymentModeRouteResponse](#PaymentModeRouteResponse) - -Success. Returns all available options for payment. Check the example shown below or refer `PaymentModeRouteResponse` for more details. - - - - -
    -  Example: - -```json -{ - "success": true, - "payment_options": { - "payment_option": [ - { - "name": "CARD", - "display_priority": 2, - "payment_mode_id": 2, - "display_name": "Card", - "list": [], - "anonymous_enable": true, - "aggregator_name": "Razorpay", - "add_card_enabled": false - }, - { - "name": "NB", - "display_priority": 3, - "payment_mode_id": 3, - "display_name": "Net Banking", - "list": [ - { - "aggregator_name": "Razorpay", - "name": "ICICI Bank", - "code": "ICIC", - "bank_name": "ICICI Bank", - "bank_code": "ICIC", - "url": "https://hdn-1.fynd.com/payment/NB_ICICI.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_ICICI.png", - "large": "https://hdn-1.fynd.com/payment/NB_ICICI.png" - }, - "merchant_code": "NB_ICICI", - "display_priority": 1, - "display_name": "ICICI Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "HDFC Bank", - "code": "HDFC", - "bank_name": "HDFC Bank", - "bank_code": "HDFC", - "url": "https://hdn-1.fynd.com/payment/NB_HDFC.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_HDFC.png", - "large": "https://hdn-1.fynd.com/payment/NB_HDFC.png" - }, - "merchant_code": "NB_HDFC", - "display_priority": 2, - "display_name": "HDFC Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Axis Bank", - "code": "UTIB", - "bank_name": "Axis Bank", - "bank_code": "UTIB", - "url": "https://hdn-1.fynd.com/payment/NB_AXIS.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_AXIS.png", - "large": "https://hdn-1.fynd.com/payment/NB_AXIS.png" - }, - "merchant_code": "NB_AXIS", - "display_priority": 3, - "display_name": "Axis Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "State Bank of India", - "code": "SBIN", - "bank_name": "State Bank of India", - "bank_code": "SBIN", - "url": "https://hdn-1.fynd.com/payment/NB_SBI.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_SBI.png", - "large": "https://hdn-1.fynd.com/payment/NB_SBI.png" - }, - "merchant_code": "NB_SBI", - "display_priority": 4, - "display_name": "State Bank of India" - }, - { - "aggregator_name": "Razorpay", - "name": "Kotak Mahindra Bank", - "code": "KKBK", - "bank_name": "Kotak Mahindra Bank", - "bank_code": "KKBK", - "url": "https://hdn-1.fynd.com/payment/NB_KOTAK.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_KOTAK.png", - "large": "https://hdn-1.fynd.com/payment/NB_KOTAK.png" - }, - "merchant_code": "NB_KOTAK", - "display_priority": 5, - "display_name": "Kotak Mahindra Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Indusind Bank", - "code": "INDB", - "bank_name": "Indusind Bank", - "bank_code": "INDB", - "url": "https://hdn-1.fynd.com/payment/NB_INDUS.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_INDUS.png", - "large": "https://hdn-1.fynd.com/payment/NB_INDUS.png" - }, - "merchant_code": "INDB", - "display_priority": 6, - "display_name": "Indusind Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "City Union Bank", - "code": "CIUB", - "bank_name": "City Union Bank", - "bank_code": "CIUB", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_CUB", - "display_priority": 9, - "display_name": "City Union Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Catholic Syrian Bank", - "code": "CSBK", - "bank_name": "Catholic Syrian Bank", - "bank_code": "CSBK", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "CSBK", - "display_priority": 11, - "display_name": "Catholic Syrian Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "State Bank of Hyderabad", - "code": "SBHY", - "bank_name": "State Bank of Hyderabad", - "bank_code": "SBHY", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_SBH", - "display_priority": 12, - "display_name": "State Bank of Hyderabad" - }, - { - "aggregator_name": "Razorpay", - "name": "Allahabad Bank", - "code": "ALLA", - "bank_name": "Allahabad Bank", - "bank_code": "ALLA", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "ALLA", - "display_priority": 15, - "display_name": "Allahabad Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Syndicate Bank", - "code": "SYNB", - "bank_name": "Syndicate Bank", - "bank_code": "SYNB", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "SYNB", - "display_priority": 17, - "display_name": "Syndicate Bank" - } - ] - }, - { - "name": "WL", - "display_priority": 4, - "payment_mode_id": 4, - "display_name": "Wallet", - "list": [ - { - "wallet_name": "Paytm", - "wallet_code": "paytm", - "name": "Paytm", - "display_name": "Paytm", - "code": "paytm", - "wallet_id": 4, - "merchant_code": "PAYTM", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/paytm_logo_small.png", - "large": "https://hdn-1.fynd.com/payment/paytm_logo_large.png" - }, - "aggregator_name": "Juspay", - "display_priority": 1 - }, - { - "wallet_name": "Amazon Pay", - "wallet_code": "amazonpay", - "name": "Amazon Pay", - "display_name": "Amazon Pay", - "code": "amazonpay", - "wallet_id": 10, - "merchant_code": "AMAZONPAY", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/amazon-pay.png", - "large": "https://hdn-1.fynd.com/payment/amazon-pay.png" - }, - "aggregator_name": "Razorpay", - "display_priority": 9 - } - ] - }, - { - "name": "UPI", - "display_priority": 9, - "payment_mode_id": 7, - "display_name": "UPI", - "list": [ - { - "aggregator_name": "Razorpay", - "name": "UPI", - "display_name": "BHIM UPI", - "code": "UPI", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/upi_100x78.png", - "large": "https://hdn-1.fynd.com/payment/upi_150x100.png" - }, - "merchant_code": "UPI", - "timeout": 310, - "retry_count": 0, - "fynd_vpa": "shopsense.rzp@hdfcbank", - "intent_flow": true, - "intent_app_error_list": [ - "com.csam.icici.bank.imobile", - "in.org.npci.upiapp", - "com.whatsapp" - ] - } - ] - }, - { - "name": "JUSPAYPG", - "display_priority": 18, - "payment_mode_id": 24, - "display_name": "Pay Using Juspay", - "list": [] - }, - { - "name": "PL", - "display_priority": 21, - "display_name": "Pay Later", - "list": [ - { - "aggregator_name": "Simpl", - "name": "Simpl", - "display_name": "Simpl", - "code": "simpl", - "merchant_code": "SIMPL", - "logo": "https://hdn-1.fynd.com/payment/simpl_logo.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/simpl_logo.png", - "large": "https://hdn-1.fynd.com/payment/simpl_logo.png" - } - } - ] - } - ], - "payment_flows": { - "simpl": { - "data": { - "gateway": { - "route": "simpl", - "entity": "sdk", - "is_customer_validation_required": true, - "cust_validation_url": "https://api.fyndx0.de/gringotts/api/v1/validate-customer/?app_id=000000000000000000000001", - "sdk": { - "config": { - "redirect": false, - "callback_url": null, - "action_url": "https://api.fyndx0.de/platform/payment/v2/external/payments/confirm/charge/?app_id=000000000000000000000001" - }, - "data": { - "user_phone": "9999632145", - "user_email": "app@fynd.com" - } - }, - "return_url": null - } - }, - "api_link": "", - "payment_flow": "sdk" - }, - "mswipe": { - "data": { - "gateway": { - "sdk": { - "config": { - "redirect": false, - "action_url": "url", - "webhook_url": "url", - "timeout": 60 - } - } - } - }, - "api_link": "", - "payment_flow": "sdk" - }, - "juspay": { - "data": {}, - "api_link": "https://sandbox.juspay.in/txns", - "payment_flow": "api" - }, - "razorpay": { - "data": {}, - "api_link": "", - "payment_flow": "sdk" - }, - "bqr_razorpay": { - "data": {}, - "api_link": "https://api.fyndx0.de/platform/payment/v2/external/payments/request/?app_id=000000000000000000000001", - "payment_flow": "api" - }, - "fynd": { - "data": {}, - "api_link": "", - "payment_flow": "api" - }, - "jio": { - "data": {}, - "api_link": "", - "payment_flow": "api" - }, - "stripe": { - "data": {}, - "api_link": "", - "payment_flow": "sdk" - }, - "ccavenue": { - "data": {}, - "api_link": "", - "payment_flow": "sdk" - }, - "payumoney": { - "data": {}, - "api_link": "", - "payment_flow": "sdk" - }, - "rupifi": { - "data": {}, - "api_link": "", - "return_url": "", - "payment_flow": "api", - "cust_validation_url": "https://api.jiox0.de/gringotts/api/v1/validate-customer/" - } - } - } -} -``` -
    - - - - - - - - - ---- - - -#### getPosPaymentModeRoutes -Get applicable payment options for Point-of-Sale (POS) - - - -```swift -payment.getPosPaymentModeRoutes(amount: amount, cartId: cartId, pincode: pincode, checkoutMode: checkoutMode, refresh: refresh, cardReference: cardReference, orderType: orderType, userDetails: userDetails) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| amount | Int | yes | Payable amount. | -| cartId | String | yes | Identifier of the cart. | -| pincode | String | yes | The PIN Code of the destination address, e.g. 400059 | -| checkoutMode | String | yes | Option to checkout for self or for others. | -| refresh | Bool? | no | This is a boolean value. Select `true` to remove temporary cache files on payment gateway and replace with the latest one. | -| cardReference | String? | no | Card reference id of user's debit or credit card. | -| orderType | String | yes | The order type of shipment * HomeDelivery - If the customer wants the order home-delivered * PickAtStore - If the customer wants the handover of an order at the store itself. | -| userDetails | String? | no | URIencoded JSON containing details of an anonymous user. | - - - -Use this API to get all valid payment options for doing a payment in POS. - -*Returned Response:* - - - - -[PaymentModeRouteResponse](#PaymentModeRouteResponse) - -Success. Returns all available options for payment. Check the example shown below or refer `PaymentModeRouteResponse` for more details. - - - - -
    -  Example: - -```json -{ - "success": true, - "payment_options": { - "payment_option": [ - { - "name": "CAS", - "display_priority": 21, - "payment_mode_id": 39, - "display_name": "Cash at Store", - "list": [ - { - "aggregator_name": "Fynd", - "name": "CAS", - "display_name": "CASH", - "code": "CAS", - "logo_url": { - "large": "https://hdn-1.fynd.com/payment/cod.png", - "small": "https://hdn-1.fynd.com/payment/cod.png" - }, - "merchant_code": "CAS" - } - ] - }, - { - "name": "CSAS", - "display_priority": 21, - "payment_mode_id": 40, - "display_name": "Card Swiped at Store", - "list": [ - { - "aggregator_name": "Fynd", - "name": "CSAS", - "display_name": "Card Swipe", - "code": "CSAS", - "logo_url": { - "large": "https://hdn-1.fynd.com/payment/cod.png", - "small": "https://hdn-1.fynd.com/payment/cod.png" - }, - "merchant_code": "CSAS" - } - ] - }, - { - "name": "UPI", - "display_priority": 9, - "payment_mode_id": 7, - "display_name": "UPI", - "list": [ - { - "aggregator_name": "Razorpay", - "name": "UPI", - "display_name": "BHIM UPI", - "code": "UPI", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/upi_100x78.png", - "large": "https://hdn-1.fynd.com/payment/upi_150x100.png" - }, - "merchant_code": "UPI", - "timeout": 240, - "retry_count": 0, - "fynd_vpa": "shopsense.rzp@hdfcbank", - "intent_flow": true, - "intent_app_error_list": [ - "com.csam.icici.bank.imobile", - "in.org.npci.upiapp", - "com.whatsapp" - ] - } - ] - } - ], - "payment_flows": { - "simpl": { - "data": { - "gateway": { - "route": "simpl", - "entity": "sdk", - "is_customer_validation_required": true, - "cust_validation_url": "https://api.fyndx0.de/gringotts/api/v1/validate-customer/?app_id=000000000000000000000001", - "sdk": { - "config": { - "redirect": false, - "callback_url": null, - "action_url": "https://api.fyndx0.de/platform/payment/v2/external/payments/confirm/charge/?app_id=000000000000000000000001" - }, - "data": { - "user_phone": "9999632145", - "user_email": "app@fynd.com" - } - }, - "return_url": null - } - }, - "api_link": "", - "payment_flow": "sdk" - }, - "juspay": { - "data": {}, - "api_link": "https://sandbox.juspay.in/txns", - "payment_flow": "api" - }, - "razorpay": { - "data": {}, - "api_link": "", - "payment_flow": "sdk" - }, - "upi_razorpay": { - "data": {}, - "api_link": "https://api.fyndx0.de/platform/payment/v2/external/payments/request/?app_id=000000000000000000000001", - "payment_flow": "api" - }, - "bqr_razorpay": { - "data": {}, - "api_link": "https://api.fyndx0.de/platform/payment/v2/external/payments/request/?app_id=000000000000000000000001", - "payment_flow": "api" - }, - "cashfree": { - "data": {}, - "api_link": "", - "payment_flow": "api" - }, - "fynd": { - "data": {}, - "api_link": "", - "payment_flow": "api" - }, - "jio": { - "data": {}, - "api_link": "", - "payment_flow": "api" - }, - "stripe": { - "data": {}, - "api_link": "", - "payment_flow": "sdk" - }, - "ccavenue": { - "data": {}, - "api_link": "", - "payment_flow": "sdk" - }, - "payumoney": { - "data": {}, - "api_link": "", - "payment_flow": "sdk" - }, - "rupifi": { - "data": {}, - "api_link": "", - "return_url": "", - "payment_flow": "api", - "cust_validation_url": "https://api.jiox0.de/gringotts/api/v1/validate-customer/" - } - } - } -} -``` -
    - - - - - - - - - ---- - - -#### getRupifiBannerDetails -Get CreditLine Offer - - - -```swift -payment.getRupifiBannerDetails() { (response, error) in - // Use response -} -``` - - - - -Get CreditLine Offer if user is tentatively approved by rupifi - -*Returned Response:* - - - - -[RupifiBannerResponse](#RupifiBannerResponse) - -Success. Return CreditLine Offer detail. Check the example shown below or refer `RupifiBannerResponseSchema` for more details. - - - - -
    -  Example: - -```json -{ - "success": true, - "data": { - "kyc_url": "http://rupifi.kyc1.com/", - "status": "APPROVED" - } -} -``` -
    - - - - - - - - - ---- - - -#### getActiveRefundTransferModes -Lists the mode of refund - - - -```swift -payment.getActiveRefundTransferModes() { (response, error) in - // Use response -} -``` - - - - -Use this API to retrieve eligible refund modes (such as Netbanking) and add the beneficiary details. - -*Returned Response:* - - - - -[TransferModeResponse](#TransferModeResponse) - -Success. Shows the available refund mode to choose, e.g. Netbanking. Check the example shown below or refer `TransferModeResponse` for more details. - - - - -
    -  Example: - -```json -{ - "data": [ - { - "display_name": "BANK", - "items": [ - { - "id": 6, - "name": "bank", - "display_name": "BANK", - "logo_small": "https://hdn-1.fynd.com/payment/netbanking.png", - "logo_large": "https://hdn-1.fynd.com/payment/netbanking.png" - } - ] - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### enableOrDisableRefundTransferMode -Enable/Disable a mode for transferring a refund - - - -```swift -payment.enableOrDisableRefundTransferMode(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [UpdateRefundTransferModeRequest](#UpdateRefundTransferModeRequest) | no | Request body | - - -Activate or Deactivate Transfer Mode to collect Beneficiary Details for Refund - -*Returned Response:* - - - - -[UpdateRefundTransferModeResponse](#UpdateRefundTransferModeResponse) - -Success. Shows whether the refund mode was successfully enabled or disabled. - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getUserBeneficiariesDetail -Lists the beneficiary of a refund - - - -```swift -payment.getUserBeneficiariesDetail(orderId: orderId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| orderId | String | yes | A unique number used for identifying and tracking your orders. | - - - -Use this API to get the details of all active beneficiary added by a user for refund. - -*Returned Response:* - - - - -[OrderBeneficiaryResponse](#OrderBeneficiaryResponse) - -Success. Returns the details of the beneficiary getting a refund. Check the example shown below or refer `OrderBeneficiaryResponse` for more details. - - - - -
    -  Example: - -```json -{ - "beneficiaries": [ - { - "id": 221, - "beneficiary_id": "0f7e44a922df352c05c5f73cb40ba115", - "bank_name": "State Bank of India", - "branch_name": "State Bank of India", - "account_holder": "SHASHI TEST", - "account_no": "1234567891", - "ifsc_code": "SBIN0005611", - "mobile": "9112042174", - "email": "payment@gofynd.com", - "address": "204A", - "comment": "", - "is_active": null, - "created_on": "2020-06-29 12:38:39", - "modified_on": "2020-06-29 12:38:39", - "display_name": "BANK", - "transfer_mode": "bank", - "title": "Bank Account", - "subtitle": "1234567891", - "delights_user_name": null - } - ], - "show_beneficiary_details": false -} -``` -
    - - - - - - - - - ---- - - -#### verifyIfscCode -Verify IFSC Code - - - -```swift -payment.verifyIfscCode(ifscCode: ifscCode) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| ifscCode | String? | no | A 11-digit alphanumeric code that uniquely identifies a bank branch. | - - - -Use this API to check whether the 11-digit IFSC code is valid and to fetch the bank details for refund. - -*Returned Response:* - - - - -[IfscCodeResponse](#IfscCodeResponse) - -Success. Shows whether the IFSC code is valid, and returns the bank details. Check the example shown below or refer `IfscCodeResponse` for more details. - - - - -
    -  Example: - -```json -{ - "branch_name": "MANPUR", - "bank_name": "GAYA", - "BRANCH": "MANPUR", - "CENTRE": "GAYA", - "DISTRICT": "GAYA", - "STATE": "BIHAR", - "ADDRESS": "POBUNIYADGANJBIHAR", - "CONTACT": "00", - "MICR": "816002103", - "UPI": true, - "RTGS": true, - "CITY": "GAYA", - "NEFT": true, - "IMPS": true, - "SWIFT": "", - "BANK": "State Bank of India", - "BANKCODE": "SBIN", - "IFSC": "SBIN0005611", - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getOrderBeneficiariesDetail -Lists the beneficiary of a refund - - - -```swift -payment.getOrderBeneficiariesDetail(orderId: orderId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| orderId | String | yes | A unique number used for identifying and tracking your orders. | - - - -Use this API to get the details of all active beneficiary added by a user for refund. - -*Returned Response:* - - - - -[OrderBeneficiaryResponse](#OrderBeneficiaryResponse) - -Success. Returns the details of the beneficiary getting a refund. Check the example shown below or refer `OrderBeneficiaryResponse` for more details. - - - - -
    -  Example: - -```json -{ - "beneficiaries": [ - { - "id": 3695, - "beneficiary_id": "4c86dd56e634a4c6a8fb51d195bc7b83", - "bank_name": "State Bank of India", - "branch_name": "BHOGAT", - "account_holder": "PRAKASH TEST", - "account_no": "3566342455454", - "ifsc_code": "SBIN0014982", - "mobile": "7819064010", - "email": "prakashtest@gmail.com", - "address": "49A, Dabhi seri, jodhpur, kalyanpur", - "comment": "COD Refund", - "is_active": null, - "created_on": "2021-01-22 11:31:02", - "modified_on": "2021-01-22 11:31:02", - "display_name": "BANK", - "transfer_mode": "bank", - "title": "Bank Account", - "subtitle": "35663423659", - "delights_user_name": "shreeniwas_24x7_gmail_com_45978_16624463" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### verifyOtpAndAddBeneficiaryForBank -Verify the beneficiary details using OTP - - - -```swift -payment.verifyOtpAndAddBeneficiaryForBank(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [AddBeneficiaryViaOtpVerificationRequest](#AddBeneficiaryViaOtpVerificationRequest) | no | Request body | - - -Use this API to perform an OTP validation before saving the beneficiary details added for a refund. - -*Returned Response:* - - - - -[AddBeneficiaryViaOtpVerificationResponse](#AddBeneficiaryViaOtpVerificationResponse) - -Success. Check the example shown below or refer `AddBeneficiaryViaOtpVerificationRequest` for more details. - - - - -
    -  Example: - -```json -{ - "success": true, - "message": "Account successfully created", - "data": {} -} -``` -
    - - - - - - - - - ---- - - -#### addBeneficiaryDetails -Save bank details for cancelled/returned order - - - -```swift -payment.addBeneficiaryDetails(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [AddBeneficiaryDetailsRequest](#AddBeneficiaryDetailsRequest) | no | Request body | - - -Use this API to save the bank details for a returned or cancelled order to refund the amount. - -*Returned Response:* - - - - -[RefundAccountResponse](#RefundAccountResponse) - -Success. Shows whether the beneficiary details were saved to a returned/cancelled order or not. - - - - -
    -  Example: - -```json -{ - "success": true, - "message": "Account successfully created", - "data": {} -} -``` -
    - - - - - - - - - ---- - - -#### addRefundBankAccountUsingOTP -Save bank details for cancelled/returned order - - - -```swift -payment.addRefundBankAccountUsingOTP(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [AddBeneficiaryDetailsOTPRequest](#AddBeneficiaryDetailsOTPRequest) | no | Request body | - - -Use this API to save bank details for returned/cancelled order to refund amount in his account. - -*Returned Response:* - - - - -[RefundAccountResponse](#RefundAccountResponse) - -Success. Shows whether the beneficiary details were saved to a returned/cancelled order or not. - - - - -
    -  Example: - -```json -{ - "success": true, - "message": "Account successfully created", - "data": {} -} -``` -
    - - - - - - - - - ---- - - -#### verifyOtpAndAddBeneficiaryForWallet -Send OTP on adding a wallet beneficiary - - - -```swift -payment.verifyOtpAndAddBeneficiaryForWallet(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [WalletOtpRequest](#WalletOtpRequest) | no | Request body | - - -Use this API to send an OTP while adding a wallet beneficiary by mobile no. verification. - -*Returned Response:* - - - - -[WalletOtpResponse](#WalletOtpResponse) - -Success. Sends the OTP to the given mobile number. Check the example shown below or refer `WalletOtpResponse` for more details. - - - - -
    -  Example: - -```json -{ - "success": true, - "is_verified_flag": false, - "request_id": "c3ca6c13d490c885a125d106b45697b7" -} -``` -
    - - - - - - - - - ---- - - -#### updateDefaultBeneficiary -Set a default beneficiary for a refund - - - -```swift -payment.updateDefaultBeneficiary(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [SetDefaultBeneficiaryRequest](#SetDefaultBeneficiaryRequest) | no | Request body | - - -Use this API to set a default beneficiary for getting a refund. - -*Returned Response:* - - - - -[SetDefaultBeneficiaryResponse](#SetDefaultBeneficiaryResponse) - -Success. Check the example shown below or refer `SetDefaultBeneficiaryResponse` for more details. - - - - -
    -  Example: - -```json -{ - "success": true, - "is_beneficiary_set": true -} -``` -
    - - - - - - - - - ---- - - - - -## Order - - -#### getOrders -Get all orders - - - -```swift -order.getOrders(pageNo: pageNo, pageSize: pageSize, fromDate: fromDate, toDate: toDate, status: status) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | -| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | -| fromDate | String? | no | The date from which the orders should be retrieved. | -| toDate | String? | no | The date till which the orders should be retrieved. | -| status | Int? | no | A filter to retrieve orders by their current status such as _placed_, _delivered_, etc. | - - - -Use this API to retrieve all the orders. - -*Returned Response:* - - - - -[OrderList](#OrderList) - -Success. Returns all the orders. Check the example shown below or refer `OrderList` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getOrderById -Get details of an order - - - -```swift -order.getOrderById(orderId: orderId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| orderId | String | yes | A unique number used for identifying and tracking your orders. | - - - -Use this API to retrieve order details such as tracking details, shipment, store information using Fynd Order ID. - -*Returned Response:* - - - - -[OrderById](#OrderById) - -Success. Check the example shown below or refer `OrderById` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getShipmentById -Get details of a shipment - - - -```swift -order.getShipmentById(shipmentId: shipmentId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | - - - -Use this API to retrieve shipment details such as price breakup, tracking details, store information, etc. using Shipment ID. - -*Returned Response:* - - - - -[ShipmentById](#ShipmentById) - -Success. Check the example shown below or refer `ShipmentById` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getShipmentReasons -Get reasons behind full or partial cancellation of a shipment - - - -```swift -order.getShipmentReasons(shipmentId: shipmentId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | - - - -Use this API to retrieve the issues that led to the cancellation of bags within a shipment. - -*Returned Response:* - - - - -[ShipmentReasons](#ShipmentReasons) - -Success. Check the example shown below or refer `ShipmentReasons` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updateShipmentStatus -Update the shipment status - - - -```swift -order.updateShipmentStatus(shipmentId: shipmentId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | -| body | [ShipmentStatusUpdateBody](#ShipmentStatusUpdateBody) | yes | Request body | - - -Use this API to update the status of a shipment using its shipment ID. - -*Returned Response:* - - - - -[ShipmentStatusUpdate](#ShipmentStatusUpdate) - -Success. Check the example shown below or refer `ShipmentStatusUpdateBody` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### trackShipment -Track shipment - - - -```swift -order.trackShipment(shipmentId: shipmentId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | - - - -Use this API to track a shipment using its shipment ID. - -*Returned Response:* - - - - -[ShipmentTrack](#ShipmentTrack) - -Success. Check the example shown below or refer `ShipmentTrack` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getPosOrderById -Get POS Order - - - -```swift -order.getPosOrderById(orderId: orderId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| orderId | String | yes | A unique number used for identifying and tracking your orders. | - - - -Use this API to retrieve a POS order and all its details such as tracking details, shipment, store information using Fynd Order ID. - -*Returned Response:* - - - - -[PosOrderById](#PosOrderById) - -Success. Check the example shown below or refer `PosOrderById` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getCustomerDetailsByShipmentId -Get Customer Details by Shipment Id - - - -```swift -order.getCustomerDetailsByShipmentId(orderId: orderId, shipmentId: shipmentId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| orderId | String | yes | A unique number used for identifying and tracking your orders. | -| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | - - - -Use this API to retrieve customer details such as mobileno using Shipment ID. - -*Returned Response:* - - - - -[CustomerDetailsByShipmentId](#CustomerDetailsByShipmentId) - -Success. Check the example shown below or refer `CustomerDetailsByShipmentId` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### sendOtpToShipmentCustomer -Send and Resend Otp code to Order-Shipment customer - - - -```swift -order.sendOtpToShipmentCustomer(orderId: orderId, shipmentId: shipmentId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| orderId | String | yes | A unique number used for identifying and tracking your orders. | -| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | - - - -Use this API to send OTP to the customer of the mapped Shipment. - -*Returned Response:* - - - - -[sendOTPApplicationResponse](#sendOTPApplicationResponse) - -Success to acknowledge the service was notified - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### verifyOtpShipmentCustomer -Verify Otp code - - - -```swift -order.verifyOtpShipmentCustomer(orderId: orderId, shipmentId: shipmentId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| orderId | String | yes | A unique number used for identifying and tracking your orders. | -| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | -| body | [ReqBodyVerifyOTPShipment](#ReqBodyVerifyOTPShipment) | yes | Request body | - - -Use this API to verify OTP and create a session token with custom payload. - -*Returned Response:* - - - - -[ResponseVerifyOTPShipment](#ResponseVerifyOTPShipment) - -Success, the code is valid and returns a session token - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - - - -## Rewards - - -#### getPointsOnProduct -Get the eligibility of reward points on a product - - - -```swift -rewards.getPointsOnProduct(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [CatalogueOrderRequest](#CatalogueOrderRequest) | yes | Request body | - - -Use this API to evaluate the amount of reward points that could be earned on any catalogue product. - -*Returned Response:* - - - - -[CatalogueOrderResponse](#CatalogueOrderResponse) - -Success. Check example below or refer `CatalogueOrderRequest` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getOfferByName -Get offer by name - - - -```swift -rewards.getOfferByName(name: name) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| name | String | yes | The name given to the offer. | - - - -Use this API to get the offer details and configuration by entering the name of the offer. - -*Returned Response:* - - - - -[Offer](#Offer) - -Success. Check example below or refer `Offer` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getOrderDiscount -Calculates the discount on order-amount - - - -```swift -rewards.getOrderDiscount(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [OrderDiscountRequest](#OrderDiscountRequest) | yes | Request body | - - -Use this API to calculate the discount on order-amount based on all the amount range configured in order_discount. - -*Returned Response:* - - - - -[OrderDiscountResponse](#OrderDiscountResponse) - -Success. Check example below or refer `OrderDiscountResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getUserPoints -Get reward points available with a user - - - -```swift -rewards.getUserPoints() { (response, error) in - // Use response -} -``` - - - - -Use this API to retrieve total available points of a user for current application - -*Returned Response:* - - - - -[PointsResponse](#PointsResponse) - -Success. Check example below or refer `PointsResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getUserPointsHistory -Get all transactions of reward points - - - -```swift -rewards.getUserPointsHistory(pageId: pageId, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| pageId | String? | no | PageID is the ID of the requested page. For first request it should be kept empty. | -| pageSize | Int? | no | The number of items to retrieve in each page. | - - - -Use this API to get a list of points transactions. The list of points history is paginated. - -*Returned Response:* - - - - -[PointsHistoryResponse](#PointsHistoryResponse) - -Success. Check example below or refer `PointsHistoryResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getUserReferralDetails -Get referral details of a user - - - -```swift -rewards.getUserReferralDetails() { (response, error) in - // Use response -} -``` - - - - -Use this API to retrieve the referral details a user has configured in the application. - -*Returned Response:* - - - - -[ReferralDetailsResponse](#ReferralDetailsResponse) - -Success. Check example below or refer `ReferralDetailsResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### redeemReferralCode -Redeems a referral code and credits reward points to users - - - -```swift -rewards.redeemReferralCode(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [RedeemReferralCodeRequest](#RedeemReferralCodeRequest) | yes | Request body | - - -Use this API to enter a referral code following which, the configured points would be credited to a user's reward points account. - -*Returned Response:* - - - - -[RedeemReferralCodeResponse](#RedeemReferralCodeResponse) - -Success. Check example below or refer `RedeemReferralCodeResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - - - -## Feedback - - -#### createAbuseReport -Post a new abuse request - - - -```swift -feedback.createAbuseReport(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [ReportAbuseRequest](#ReportAbuseRequest) | yes | Request body | - - -Use this API to report a specific entity (question/review/comment) for abuse. - -*Returned Response:* - - - - -[InsertResponse](#InsertResponse) - -Success. Returns an abuse ID. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updateAbuseReport -Update abuse details - - - -```swift -feedback.updateAbuseReport(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [UpdateAbuseStatusRequest](#UpdateAbuseStatusRequest) | yes | Request body | - - -Use this API to update the abuse details, i.e. status and description. - -*Returned Response:* - - - - -[UpdateResponse](#UpdateResponse) - -Success. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getAbuseReports -Get a list of abuse data - - - -```swift -feedback.getAbuseReports(entityId: entityId, entityType: entityType, id: id, pageId: pageId, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| entityId | String | yes | ID of the eligible entity as specified in the entity type (question ID/review ID/comment ID). | -| entityType | String | yes | Type of entity, e.g. question, review or comment. | -| id | String? | no | abuse id | -| pageId | String? | no | Pagination page ID to retrieve next set of results. | -| pageSize | Int? | no | The number of items to retrieve in each page. | - - - -Use this API to retrieve a list of abuse data from entity type and entity ID. - -*Returned Response:* - - - - -[ReportAbuseGetResponse](#ReportAbuseGetResponse) - -Success. Check the example shown below or refer `ReportAbuseGetResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getAttributes -Get a list of attribute data - - - -```swift -feedback.getAttributes(pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | -| pageSize | Int? | no | The number of items to retrieve in each page. | - - - -Use this API to retrieve a list of all attribute data, e.g. quality, material, product fitting, packaging, etc. - -*Returned Response:* - - - - -[AttributeResponse](#AttributeResponse) - -Success. Check the example shown below or refer `AttributeResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### createAttribute -Add a new attribute request - - - -```swift -feedback.createAttribute(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [SaveAttributeRequest](#SaveAttributeRequest) | yes | Request body | - - -Use this API to add a new attribute (e.g. product quality/material/value for money) with its name, slug and description. - -*Returned Response:* - - - - -[InsertResponse](#InsertResponse) - -Success. Returns an attribute ID. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getAttribute -Get data of a single attribute - - - -```swift -feedback.getAttribute(slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of an attribute. You can get slug value from the endpoint 'service/application/feedback/v1.0/attributes'. | - - - -Use this API to retrieve a single attribute data from a given slug. - -*Returned Response:* - - - - -[Attribute](#Attribute) - -Success. Check the example shown below or refer `Attribute` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updateAttribute -Update details of an attribute - - - -```swift -feedback.updateAttribute(slug: slug, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| slug | String | yes | A short, human-readable, URL-friendly identifier of an attribute. You can get slug value from the endpoint 'service/application/feedback/v1.0/attributes'. | -| body | [UpdateAttributeRequest](#UpdateAttributeRequest) | yes | Request body | - - -Use this API update the attribute's name and description. - -*Returned Response:* - - - - -[UpdateResponse](#UpdateResponse) - -Success. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### createComment -Post a new comment - - - -```swift -feedback.createComment(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [CommentRequest](#CommentRequest) | yes | Request body | - - -Use this API to add a new comment for a specific entity. - -*Returned Response:* - - - - -[InsertResponse](#InsertResponse) - -Success. Returns a comment ID. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updateComment -Update the status of a comment - - - -```swift -feedback.updateComment(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [UpdateCommentRequest](#UpdateCommentRequest) | yes | Request body | - - -Use this API to update the comment status (active or approve) along with new comment if any. - -*Returned Response:* - - - - -[UpdateResponse](#UpdateResponse) - -Success. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getComments -Get a list of comments - - - -```swift -feedback.getComments(entityType: entityType, id: id, entityId: entityId, userId: userId, pageId: pageId, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| entityType | String | yes | Type of entity, e.g. question, review or comment. | -| id | String? | no | Comment ID | -| entityId | String? | no | ID of the eligible entity as specified in the entity type (question ID/review ID/comment ID). | -| userId | String? | no | User ID - a flag/filter to get comments for a user. | -| pageId | String? | no | Pagination page ID to retrieve next set of results. | -| pageSize | Int? | no | The number of items to retrieve in each page. | - - - -Use this API to retrieve a list of comments for a specific entity type, e.g. products. - -*Returned Response:* - - - - -[CommentGetResponse](#CommentGetResponse) - -Success. Check the example shown below or refer `CommentGetResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### checkEligibility -Checks eligibility to rate and review, and shows the cloud media configuration - - - -```swift -feedback.checkEligibility(entityType: entityType, entityId: entityId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| entityType | String | yes | Type of entity, e.g. question, rate, review, answer, or comment. | -| entityId | String | yes | ID of the eligible entity as specified in the entity type. | - - - -Use this API to check whether an entity is eligible to be rated and reviewed. Moreover, it shows the cloud media configuration too. - -*Returned Response:* - - - - -[CheckEligibilityResponse](#CheckEligibilityResponse) - -Success. Returns a Product object. Check the example shown below or refer `CheckEligibilityResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### deleteMedia -Delete Media - - - -```swift -feedback.deleteMedia(ids: ids) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| ids | [String] | yes | List of media ID | - - - -Use this API to delete media for an entity ID. - -*Returned Response:* - - - - -[UpdateResponse](#UpdateResponse) - -Success. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### createMedia -Add Media - - - -```swift -feedback.createMedia(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [AddMediaListRequest](#AddMediaListRequest) | yes | Request body | - - -Use this API to add media to an entity, e.g. review. - -*Returned Response:* - - - - -[InsertResponse](#InsertResponse) - -Success. Returns media IDs. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updateMedia -Update Media - - - -```swift -feedback.updateMedia(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [UpdateMediaListRequest](#UpdateMediaListRequest) | yes | Request body | - - -Use this API to update media (archive/approve) for an entity. - -*Returned Response:* - - - - -[UpdateResponse](#UpdateResponse) - -Success. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getMedias -Get Media - - - -```swift -feedback.getMedias(entityType: entityType, entityId: entityId, id: id, type: type, pageId: pageId, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| entityType | String | yes | Type of entity, e.g. question or product. | -| entityId | String | yes | ID of the eligible entity as specified in the entity type(question ID/product ID). | -| id | String? | no | ID of the media. | -| type | String? | no | Media type. | -| pageId | String? | no | Pagination page ID to retrieve next set of results. | -| pageSize | Int? | no | The number of items to retrieve in each page. | - - - -Use this API to retrieve all media from an entity. - -*Returned Response:* - - - - -[MediaGetResponse](#MediaGetResponse) - -Success. Check the example shown below or refer `MediaGetResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getReviewSummaries -Get a review summary - - - -```swift -feedback.getReviewSummaries(entityType: entityType, entityId: entityId, id: id, pageId: pageId, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| entityType | String | yes | Type of entity, e.g. product, delivery, seller, order placed, order delivered, application, or template. | -| entityId | String | yes | ID of the eligible entity as specified in the entity type. | -| id | String? | no | Review summary identifier. | -| pageId | String? | no | Pagination page ID to retrieve next set of results. | -| pageSize | Int? | no | The number of items to retrieve in each page. | - - - -Review summary gives ratings and attribute metrics of a review per entity. Use this API to retrieve the following response data: review count, rating average. 'review metrics'/'attribute rating metrics' which contains name, type, average and count. - -*Returned Response:* - - - - -[ReviewMetricGetResponse](#ReviewMetricGetResponse) - -Success. Check the example shown below or refer `ReviewMetricGetResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### createReview -Add customer reviews - - - -```swift -feedback.createReview(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [UpdateReviewRequest](#UpdateReviewRequest) | yes | Request body | - - -Use this API to add customer reviews for a specific entity along with the following data: attributes rating, entity rating, title, description, media resources and template ID. - -*Returned Response:* - - - - -[UpdateResponse](#UpdateResponse) - -Success. Returns a review ID. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updateReview -Update customer reviews - - - -```swift -feedback.updateReview(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [UpdateReviewRequest](#UpdateReviewRequest) | yes | Request body | - - -Use this API to update customer reviews for a specific entity along with following data: attributes rating, entity rating, title, description, media resources and template ID. - -*Returned Response:* - - - - -[UpdateResponse](#UpdateResponse) - -Success. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getReviews -Get list of customer reviews - - - -```swift -feedback.getReviews(entityType: entityType, entityId: entityId, id: id, userId: userId, media: media, rating: rating, attributeRating: attributeRating, facets: facets, sort: sort, active: active, approve: approve, pageId: pageId, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| entityType | String | yes | Type of entity, e.g. product, delivery, seller, l3, order placed, order delivered, application, or template. | -| entityId | String | yes | ID of the eligible entity as specified in the entity type. | -| id | String? | no | ID of the review. | -| userId | String? | no | ID of the user. | -| media | String? | no | media type, e.g. image | video | video_file | video_link | -| rating | [Double]? | no | rating filter, e.g. 1-5 | -| attributeRating | [String]? | no | Filter for attribute rating. | -| facets | Bool? | no | This is a boolean value for enabling metadata (facets). Selecting *true* will enable facets. | -| sort | String? | no | Sort by: default | top | recent | -| active | Bool? | no | Get the active reviews. | -| approve | Bool? | no | Get the approved reviews. | -| pageId | String? | no | Pagination page ID to retrieve next set of results. | -| pageSize | Int? | no | The number of items to retrieve in each page. | - - - -Use this API to retrieve a list of customer reviews based on entity and filters provided. - -*Returned Response:* - - - - -[ReviewGetResponse](#ReviewGetResponse) - -Success. Check the example shown below or refer `ReviewGetResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getTemplates -Get the feedback templates for a product or l3 - - - -```swift -feedback.getTemplates(templateId: templateId, entityId: entityId, entityType: entityType) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| templateId | String? | no | ID of the feedback template. | -| entityId | String? | no | ID of the eligible entity as specified in the entity type. | -| entityType | String? | no | Type of entity, e.g. product, delivery, seller, l3, order placed, order delivered, or application. | - - - -Use this API to retrieve the details of the following feedback template. order, delivered, application, seller, order, placed, product - -*Returned Response:* - - - - -[TemplateGetResponse](#TemplateGetResponse) - -Success. Check the example shown below or refer `TemplateGetResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### createQuestion -Create a new question - - - -```swift -feedback.createQuestion(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [CreateQNARequest](#CreateQNARequest) | yes | Request body | - - -Use this API to create a new question with following data- tags, text, type, choices for MCQ type questions, maximum length of answer. - -*Returned Response:* - - - - -[InsertResponse](#InsertResponse) - -Success. Returns a qna ID. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updateQuestion -Update a question - - - -```swift -feedback.updateQuestion(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [UpdateQNARequest](#UpdateQNARequest) | yes | Request body | - - -Use this API to update the status of a question, its tags and its choices. - -*Returned Response:* - - - - -[UpdateResponse](#UpdateResponse) - -Success. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getQuestionAndAnswers -Get a list of QnA - - - -```swift -feedback.getQuestionAndAnswers(entityType: entityType, entityId: entityId, id: id, userId: userId, showAnswer: showAnswer, pageId: pageId, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| entityType | String | yes | Type of entity, e.g. product, l3, etc. | -| entityId | String | yes | ID of the eligible entity as specified in the entity type. | -| id | String? | no | QNA ID | -| userId | String? | no | User ID | -| showAnswer | Bool? | no | This is a boolean value. Select *true* to display answers given. | -| pageId | String? | no | Pagination page ID to retrieve next set of results. | -| pageSize | Int? | no | The number of items to retrieve in each page. | - - - -Use this API to retrieve a list of questions and answers for a given entity. - -*Returned Response:* - - - - -[QNAGetResponse](#QNAGetResponse) - -Success. Check the example shown below or refer `QNAGetResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getVotes -Get a list of votes - - - -```swift -feedback.getVotes(id: id, refType: refType, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | vote ID | -| refType | String? | no | Entity type, e.g. review | comment. | -| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | -| pageSize | Int? | no | The number of items to retrieve in each page. | - - - -Use this API to retrieve a list of votes of a current logged in user. Votes can be filtered using `ref_type`, i.e. review | comment. - -*Returned Response:* - - - - -[VoteResponse](#VoteResponse) - -Success. Check the example shown below or refer `VoteResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### createVote -Create a new vote - - - -```swift -feedback.createVote(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [VoteRequest](#VoteRequest) | yes | Request body | - - -Use this API to create a new vote, where the action could be an upvote or a downvote. This is useful when you want to give a vote (say upvote) to a review (ref_type) of a product (entity_type). - -*Returned Response:* - - - - -[InsertResponse](#InsertResponse) - -Success. Returns a vote ID. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updateVote -Update a vote - - - -```swift -feedback.updateVote(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [UpdateVoteRequest](#UpdateVoteRequest) | yes | Request body | - - -Use this API to update a vote with a new action, i.e. either an upvote or a downvote. - -*Returned Response:* - - - - -[UpdateResponse](#UpdateResponse) - -Success. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - - - -## PosCart - - -#### getCart -Fetch all items added to the cart - - - -```swift -poscart.getCart(id: id, i: i, b: b, assignCardId: assignCardId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | | -| i | Bool? | no | | -| b | Bool? | no | | -| assignCardId | Int? | no | | - - - -Use this API to get details of all the items added to a cart. - -*Returned Response:* - - - - -[CartDetailResponse](#CartDetailResponse) - -Success. Returns a Cart object. Check the example shown below or refer `CartDetailResponse` for more details. - - - - -
    -  Example: - -```json -{ - "items": [ - { - "bulk_offer": {}, - "discount": "67% OFF", - "article": { - "type": "article", - "uid": "604_902_SSTC60401_636BLUE_1", - "size": "1", - "seller": { - "uid": 604, - "name": "SHRI SHANTINATH TRADING COMPANY" - }, - "store": { - "uid": 4579, - "name": "Gandhi Nagar" - }, - "quantity": 108, - "price": { - "base": { - "marked": 2999, - "effective": 999, - "currency_code": "INR" - }, - "converted": { - "marked": 2999, - "effective": 999, - "currency_code": "INR" - } - } - }, - "coupon_message": "", - "key": "707569_1", - "availability": { - "sizes": [ - "1", - "8", - "7", - "2", - "9", - "5", - "3", - "6" - ], - "other_store_quantity": 107, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 707569, - "name": "Blue and Gold Printed Ethnic Set", - "slug": "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a", - "brand": { - "uid": 902, - "name": "" - }, - "categories": [ - { - "uid": 525, - "name": "" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/v1/products/aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a/", - "query": { - "product_slug": [ - "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a" - ] - } - } - }, - "price": { - "base": { - "add_on": 999, - "marked": 2999, - "effective": 999, - "selling": 999, - "currency_code": "INR" - }, - "converted": { - "add_on": 999, - "marked": 2999, - "effective": 999, - "selling": 999, - "currency_code": "INR" - } - }, - "message": "", - "quantity": 1 - } - ], - "cart_id": 54, - "uid": "54", - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": -2000, - "fynd_cash": 0, - "gst_charges": 47.57, - "mrp_total": 2999, - "subtotal": 999, - "total": 999, - "vog": 951.43, - "you_saved": 0 - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 2999, - "currency_code": "INR" - }, - { - "display": "Discount", - "key": "discount", - "value": -2000, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 999, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 999, - "currency_code": "INR" - } - ], - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - } - }, - "delivery_charge_info": "", - "coupon_text": "View all offers", - "gstin": null, - "checkout_mode": "self", - "restrict_checkout": false, - "is_valid": true, - "last_modified": "Tue, 03 Sep 2019 05:35:59 GMT" -} -``` -
    - - - - - - - - - ---- - - -#### getCartLastModified -Fetch last-modified timestamp - - - -```swift -poscart.getCartLastModified(id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | | - - - -Use this API to fetch Last-Modified timestamp in header metadata. - -*Returned Response:* - - - - - - - - ---- - - -#### addItems -Add items to cart - - - -```swift -poscart.addItems(i: i, b: b, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| i | Bool? | no | | -| b | Bool? | no | | -| body | [AddCartRequest](#AddCartRequest) | no | Request body | - - -Use this API to add items to the cart. - -*Returned Response:* - - - - -[AddCartDetailResponse](#AddCartDetailResponse) - -Success. Returns a cart object as shown below. Refer `AddCartDetailResponse` for more details. - - - - -
    -  Examples: - - -
    -  Product has been added to your cart - -```json -{ - "value": { - "message": "Product has been added to your cart", - "success": true, - "cart": { - "breakup_values": { - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 17486, - "currency_code": "INR" - }, - { - "display": "Discount", - "key": "discount", - "value": -3540, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 13946, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 13946, - "currency_code": "INR" - } - ], - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": -3540, - "fynd_cash": 0, - "gst_charges": 1529.96, - "mrp_total": 17486, - "subtotal": 13946, - "total": 13946, - "vog": 12416.04, - "you_saved": 0 - }, - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - } - }, - "items": [ - { - "key": "751083_10", - "article": { - "type": "article", - "uid": "612_9_SE61201_19100302_10", - "size": "10", - "seller": { - "uid": 612, - "name": "SSR ENTERPRISE" - }, - "store": { - "uid": 4431, - "name": "Motilal Nagar 1, Goregaon" - }, - "quantity": 4, - "price": { - "base": { - "marked": 3999, - "effective": 2399, - "currency_code": "INR" - }, - "converted": { - "marked": 3999, - "effective": 2399, - "currency_code": "INR" - } - } - }, - "price": { - "base": { - "add_on": 4798, - "marked": 7998, - "effective": 4798, - "selling": 4798, - "currency_code": "INR" - }, - "converted": { - "add_on": 4798, - "marked": 7998, - "effective": 4798, - "selling": 4798, - "currency_code": "INR" - } - }, - "availability": { - "sizes": [ - "10" - ], - "other_store_quantity": 2, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 751083, - "name": "Carson 2", - "slug": "puma-carson-2-751083-6ad98d", - "brand": { - "uid": 9, - "name": "Puma" - }, - "categories": [ - { - "uid": 165, - "name": "Outdoor Sports Shoes" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/9_19100302/1_1542807042296.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/9_19100302/1_1542807042296.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/puma-carson-2-751083-6ad98d/", - "query": { - "product_slug": [ - "puma-carson-2-751083-6ad98d" - ] - } - } - }, - "coupon_message": "", - "quantity": 2, - "message": "", - "bulk_offer": {}, - "discount": "41% OFF" - }, - { - "key": "246228_S", - "article": { - "type": "article", - "uid": "46_235_TM62_M11029ONDSXNS_S", - "size": "S", - "seller": { - "uid": 46, - "name": "RELIANCE BRANDS LIMITED" - }, - "store": { - "uid": 4550, - "name": "VR Mall" - }, - "quantity": 1, - "price": { - "base": { - "marked": 4490, - "effective": 4490, - "currency_code": "INR" - }, - "converted": { - "marked": 4490, - "effective": 4490, - "currency_code": "INR" - } - } - }, - "price": { - "base": { - "add_on": 4490, - "marked": 4490, - "effective": 4490, - "selling": 4490, - "currency_code": "INR" - }, - "converted": { - "add_on": 4490, - "marked": 4490, - "effective": 4490, - "selling": 4490, - "currency_code": "INR" - } - }, - "availability": { - "sizes": [ - "L", - "M", - "S", - "XL", - "XXL" - ], - "other_store_quantity": 0, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 246228, - "name": "Blue Solid T-Shirt", - "slug": "superdry-blue-solid-t-shirt-2", - "brand": { - "uid": 235, - "name": "Superdry" - }, - "categories": [ - { - "uid": 192, - "name": "T-Shirts" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/235_M11029ONDSXNS/1.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/235_M11029ONDSXNS/1.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/superdry-blue-solid-t-shirt-2/", - "query": { - "product_slug": [ - "superdry-blue-solid-t-shirt-2" - ] - } - } - }, - "coupon_message": "", - "quantity": 1, - "message": "", - "bulk_offer": {}, - "discount": "" - }, - { - "key": "443175_S", - "article": { - "type": "article", - "uid": "162_207_1271_LJ03LBLUDN88_S", - "size": "S", - "seller": { - "uid": 162, - "name": "GO FASHION INDIA PRIVATE LIMITED" - }, - "store": { - "uid": 5784, - "name": "Vega City mall" - }, - "quantity": 3, - "price": { - "base": { - "marked": 1599, - "effective": 1599, - "currency_code": "INR" - }, - "converted": { - "marked": 1599, - "effective": 1599, - "currency_code": "INR" - } - } - }, - "price": { - "base": { - "add_on": 1599, - "marked": 1599, - "effective": 1599, - "selling": 1599, - "currency_code": "INR" - }, - "converted": { - "add_on": 1599, - "marked": 1599, - "effective": 1599, - "selling": 1599, - "currency_code": "INR" - } - }, - "availability": { - "sizes": [ - "XL", - "M", - "L", - "S" - ], - "other_store_quantity": 8, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 443175, - "name": "Light Blue Denim Jeggings", - "slug": "go-colors-light-blue-denim-jeggings-443175-3c688c", - "brand": { - "uid": 207, - "name": "Go Colors" - }, - "categories": [ - { - "uid": 267, - "name": "Jeggings" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/207_LJ03LBLUDN88/1_1512382513548.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/207_LJ03LBLUDN88/1_1512382513548.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/go-colors-light-blue-denim-jeggings-443175-3c688c/", - "query": { - "product_slug": [ - "go-colors-light-blue-denim-jeggings-443175-3c688c" - ] - } - } - }, - "coupon_message": "", - "quantity": 1, - "message": "", - "bulk_offer": {}, - "discount": "" - }, - { - "key": "778937_OS", - "article": { - "type": "article", - "uid": "686_963_IC68601_PWUPC01977_OS", - "size": "OS", - "seller": { - "uid": 686, - "name": "INDUS CORPORATION" - }, - "store": { - "uid": 5059, - "name": "Vidyaranyapura Main Road" - }, - "quantity": 3, - "price": { - "base": { - "marked": 3399, - "effective": 3059, - "currency_code": "INR" - }, - "converted": { - "marked": 3399, - "effective": 3059, - "currency_code": "INR" - } - } - }, - "price": { - "base": { - "add_on": 3059, - "marked": 3399, - "effective": 3059, - "selling": 3059, - "currency_code": "INR" - }, - "converted": { - "add_on": 3059, - "marked": 3399, - "effective": 3059, - "selling": 3059, - "currency_code": "INR" - } - }, - "availability": { - "sizes": [ - "OS" - ], - "other_store_quantity": 2, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 778937, - "name": "Colourful Carnival Bouncer", - "slug": "fisher-price-colourful-carnival-bouncer-778937-fafa1f", - "brand": { - "uid": 963, - "name": "Fisher-Price" - }, - "categories": [ - { - "uid": 576, - "name": "Cradles" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/963_PWUPC01977/1_1545308400588.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/963_PWUPC01977/1_1545308400588.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/fisher-price-colourful-carnival-bouncer-778937-fafa1f/", - "query": { - "product_slug": [ - "fisher-price-colourful-carnival-bouncer-778937-fafa1f" - ] - } - } - }, - "coupon_message": "", - "quantity": 1, - "message": "", - "bulk_offer": {}, - "discount": "11% OFF" - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "cart_id": 7927, - "uid": "7927", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Tue, 03 Sep 2019 06:00:43 GMT", - "restrict_checkout": false, - "is_valid": true - }, - "result": {} - } -} -``` -
    - -
    -  Sorry, item is out of stock - -```json -{ - "value": { - "message": "Sorry, item is out of stock", - "success": false, - "cart": { - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": -202000, - "fynd_cash": 0, - "gst_charges": 4804.71, - "mrp_total": 302899, - "subtotal": 100899, - "total": 100899, - "vog": 96094.29, - "you_saved": 0 - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 302899, - "currency_code": "INR" - }, - { - "display": "Discount", - "key": "discount", - "value": -202000, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 100899, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 100899, - "currency_code": "INR" - } - ], - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - } - }, - "items": [ - { - "bulk_offer": {}, - "discount": "67% OFF", - "article": { - "type": "article", - "uid": "604_902_SSTC60401_636BLUE_1", - "size": "1", - "seller": { - "uid": 604, - "name": "SHRI SHANTINATH TRADING COMPANY" - }, - "store": { - "uid": 4579, - "name": "Gandhi Nagar" - }, - "quantity": 108, - "price": { - "base": { - "marked": 2999, - "effective": 999, - "currency_code": "INR" - }, - "converted": { - "marked": 2999, - "effective": 999, - "currency_code": "INR" - } - } - }, - "coupon_message": "", - "key": "707569_1", - "availability": { - "sizes": [ - "1", - "8", - "7", - "2", - "9", - "5", - "3", - "6" - ], - "other_store_quantity": 7, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 707569, - "name": "Blue and Gold Printed Ethnic Set", - "slug": "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a", - "brand": { - "uid": 902, - "name": "" - }, - "categories": [ - { - "uid": 525, - "name": "" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/v1/products/aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a/", - "query": { - "product_slug": [ - "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a" - ] - } - } - }, - "price": { - "base": { - "add_on": 100899, - "marked": 302899, - "effective": 100899, - "selling": 100899, - "currency_code": "INR" - }, - "converted": { - "add_on": 100899, - "marked": 302899, - "effective": 100899, - "selling": 100899, - "currency_code": "INR" - } - }, - "message": "", - "quantity": 101 - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "cart_id": 54, - "uid": "54", - "gstin": null, - "checkout_mode": "self", - "restrict_checkout": false, - "is_valid": false, - "last_modified": "Tue, 03 Sep 2019 09:55:40 GMT" - }, - "result": {} - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateCart -Update items in the cart - - - -```swift -poscart.updateCart(id: id, i: i, b: b, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | | -| i | Bool? | no | | -| b | Bool? | no | | -| body | [UpdateCartRequest](#UpdateCartRequest) | no | Request body | - - -Use this API to update items added to the cart with the help of a request object containing attributes like item_quantity and item_size. These attributes will be fetched from the following APIs

    • operation Operation for current api call. update_item for update items. remove_item for removing items.
    • item_id "/platform/content/v1/products/"
    • item_size "/platform/content/v1/products/{slug}/sizes/"
    • quantity item quantity (must be greater than or equal to 1)
    • article_id "/content​/v1​/products​/{identifier}​/sizes​/price​/"
    • item_index item position in the cart (must be greater than or equal to 0)
    - -*Returned Response:* - - - - -[UpdateCartDetailResponse](#UpdateCartDetailResponse) - -Success. Updates and returns a cart object as shown below. Refer `UpdateCartDetailResponse` for more details. - - - - -
    -  Examples: - - -
    -  Nothing updated - -```json -{ - "value": { - "cart": { - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": -202000, - "fynd_cash": 0, - "gst_charges": 4804.71, - "mrp_total": 302899, - "subtotal": 100899, - "total": 100899, - "vog": 96094.29, - "you_saved": 0 - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 302899, - "currency_code": "INR" - }, - { - "display": "Discount", - "key": "discount", - "value": -202000, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 100899, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 100899, - "currency_code": "INR" - } - ], - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - } - }, - "items": [ - { - "bulk_offer": {}, - "discount": "67% OFF", - "article": { - "type": "article", - "uid": "604_902_SSTC60401_636BLUE_1", - "size": "1", - "seller": { - "uid": 604, - "name": "SHRI SHANTINATH TRADING COMPANY" - }, - "store": { - "uid": 4579, - "name": "Gandhi Nagar" - }, - "quantity": 108, - "price": { - "base": { - "marked": 2999, - "effective": 999, - "currency_code": "INR" - }, - "converted": { - "marked": 2999, - "effective": 999, - "currency_code": "INR" - } - } - }, - "coupon_message": "", - "key": "707569_1", - "availability": { - "sizes": [ - "1", - "8", - "7", - "2", - "9", - "5", - "3", - "6" - ], - "other_store_quantity": 7, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 707569, - "name": "Blue and Gold Printed Ethnic Set", - "slug": "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a", - "brand": { - "uid": 902, - "name": "" - }, - "categories": [ - { - "uid": 525, - "name": "" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/v1/products/aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a/", - "query": { - "product_slug": [ - "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a" - ] - } - } - }, - "price": { - "base": { - "add_on": 100899, - "marked": 302899, - "effective": 100899, - "selling": 100899, - "currency_code": "INR" - }, - "converted": { - "add_on": 100899, - "marked": 302899, - "effective": 100899, - "selling": 100899, - "currency_code": "INR" - } - }, - "message": "", - "quantity": 101 - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "cart_id": 54, - "uid": "54", - "gstin": null, - "checkout_mode": "self", - "restrict_checkout": false, - "is_valid": true, - "last_modified": "Tue, 03 Sep 2019 10:19:20 GMT" - }, - "result": { - "707569_90": { - "success": true, - "message": "Nothing updated" - } - }, - "message": "Nothing updated", - "success": true - } -} -``` -
    - -
    -  Item updated in the cart - -```json -{ - "value": { - "cart": { - "breakup_values": { - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - }, - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - }, - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 838.83, - "mrp_total": 5499, - "subtotal": 5499, - "total": 5499, - "vog": 4660.17, - "you_saved": 0 - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 5499, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 5499, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 5499, - "currency_code": "INR" - } - ] - }, - "items": [ - { - "key": "437414_7", - "message": "", - "bulk_offer": {}, - "price": { - "base": { - "add_on": 5499, - "marked": 5499, - "effective": 5499, - "selling": 5499, - "currency_code": "INR" - }, - "converted": { - "add_on": 5499, - "marked": 5499, - "effective": 5499, - "selling": 5499, - "currency_code": "INR" - } - }, - "quantity": 1, - "discount": "", - "product": { - "type": "product", - "uid": 437414, - "name": "Suede Classic", - "slug": "puma-suede-classic-437414-6e6bbf", - "brand": { - "uid": 9, - "name": "Puma" - }, - "categories": [ - { - "uid": 165, - "name": "Outdoor Sports Shoes" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/9_35656851/1_1511171811830.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/9_35656851/1_1511171811830.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/puma-suede-classic-437414-6e6bbf/", - "query": { - "product_slug": [ - "puma-suede-classic-437414-6e6bbf" - ] - } - } - }, - "article": { - "type": "article", - "uid": "507_9_96099_35656851_7", - "size": "7", - "seller": { - "uid": 507, - "name": "PUMA SPORTS INDIA PVT LTD" - }, - "store": { - "uid": 3632, - "name": "Colaba Causway" - }, - "quantity": 5, - "price": { - "base": { - "marked": 5499, - "effective": 5499, - "currency_code": "INR" - }, - "converted": { - "marked": 5499, - "effective": 5499, - "currency_code": "INR" - } - } - }, - "coupon_message": "", - "availability": { - "sizes": [ - "10", - "11", - "6", - "9", - "7", - "8" - ], - "other_store_quantity": 22, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - } - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "cart_id": 12426, - "uid": "12426", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Thu, 22 Aug 2019 04:51:42 GMT", - "restrict_checkout": false, - "is_valid": true - }, - "result": { - "437414_7": { - "success": true, - "message": "Item updated in the bag" - } - }, - "message": "Item updated in the bag", - "success": true - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getItemCount -Count items in the cart - - - -```swift -poscart.getItemCount(id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | The unique identifier of the cart. | - - - -Use this API to get the total number of items present in cart. - -*Returned Response:* - - - - -[CartItemCountResponse](#CartItemCountResponse) - -Success. Returns the total count of items in a user's cart. - - - - -
    -  Example: - -```json -{ - "user_cart_items_count": 0 -} -``` -
    - - - - - - - - - ---- - - -#### getCoupons -Fetch Coupon - - - -```swift -poscart.getCoupons(id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | | - - - -Use this API to get a list of available coupons along with their details. - -*Returned Response:* - - - - -[GetCouponResponse](#GetCouponResponse) - -Success. Returns a coupon object which has a list of all the eligible coupons. Refer `GetCouponResponse` for more details. - - - - -
    -  Example: - -```json -{ - "available_coupon_list": [ - { - "coupon_value": 500, - "minimum_cart_value": 0, - "coupon_code": "RAJA500", - "title": "RAJA500 | Fynd coupon", - "sub_title": "NA", - "message": "TEST500", - "max_discount_value": 500, - "uid": 17921, - "is_applicable": true, - "is_applied": false, - "expires_on": "28 Aug, 19" - }, - { - "coupon_value": 2250, - "minimum_cart_value": 0, - "coupon_code": "PRISMC22250111", - "title": "celio 2 time coupn to kalim hsp", - "sub_title": "celio 2 time coupn to kalim hsp", - "message": "celio 2 time coupn to kalim hsp", - "max_discount_value": 2250, - "uid": 17743, - "is_applicable": true, - "is_applied": false, - "expires_on": "24 Jan, 20" - } - ], - "page": { - "current": 1, - "total": 0, - "has_previous": false, - "has_next": false, - "total_item_count": 0 - } -} -``` -
    - - - - - - - - - ---- - - -#### applyCoupon -Apply Coupon - - - -```swift -poscart.applyCoupon(i: i, b: b, p: p, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| i | Bool? | no | | -| b | Bool? | no | | -| p | Bool? | no | | -| id | String? | no | | -| body | [ApplyCouponRequest](#ApplyCouponRequest) | no | Request body | - - -Use this API to apply coupons on items in the cart. - -*Returned Response:* - - - - -[CartDetailResponse](#CartDetailResponse) - -Success. Returns coupons applied to the cart along with item details and price breakup. Refer `CartDetailResponse` for more details. - - - - -
    -  Example: - -```json -{ - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": -2250, - "delivery_charge": 0, - "discount": -7240.2163, - "fynd_cash": 0, - "gst_charges": 2139.08, - "mrp_total": 26983, - "subtotal": 19742.7837, - "total": 17492.7837, - "vog": 15353.7, - "you_saved": 0 - }, - "coupon": { - "type": "cash", - "code": "PRISMC22250111", - "uid": 17743, - "value": 2250, - "is_applied": true, - "message": "coupn applied" - }, - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 26983, - "currency_code": "INR" - }, - { - "display": "Discount", - "key": "discount", - "value": -7240, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 19743, - "currency_code": "INR" - }, - { - "display": "Coupon", - "key": "coupon", - "value": -2250, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 17493, - "currency_code": "INR" - } - ] - }, - "items": [ - { - "availability": { - "sizes": [ - "10" - ], - "other_store_quantity": 0, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 751083, - "name": "Carson 2", - "slug": "puma-carson-2-751083-6ad98d", - "brand": { - "uid": 9, - "name": "Puma" - }, - "categories": [ - { - "uid": 165, - "name": "Outdoor Sports Shoes" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/9_19100302/1_1542807042296.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/9_19100302/1_1542807042296.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/puma-carson-2-751083-6ad98d/", - "query": { - "product_slug": [ - "puma-carson-2-751083-6ad98d" - ] - } - } - }, - "quantity": 4, - "discount": "41% OFF", - "price": { - "base": { - "add_on": 9596, - "marked": 15996, - "effective": 9596, - "selling": 9596, - "currency_code": "INR" - }, - "converted": { - "add_on": 9596, - "marked": 15996, - "effective": 9596, - "selling": 9596, - "currency_code": "INR" - } - }, - "message": "", - "bulk_offer": {}, - "key": "751083_10", - "coupon_message": "", - "article": { - "type": "article", - "uid": "612_9_SE61201_19100302_10", - "size": "10", - "seller": { - "uid": 612, - "name": "SSR ENTERPRISE" - }, - "store": { - "uid": 4431, - "name": "Motilal Nagar 1, Goregaon" - }, - "quantity": 4, - "price": { - "base": { - "marked": 3999, - "effective": 2399, - "currency_code": "INR" - }, - "converted": { - "marked": 3999, - "effective": 2399, - "currency_code": "INR" - } - } - } - }, - { - "availability": { - "sizes": [ - "L", - "M", - "S", - "XL", - "XXL" - ], - "other_store_quantity": 0, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 246228, - "name": "Blue Solid T-Shirt", - "slug": "superdry-blue-solid-t-shirt-2", - "brand": { - "uid": 235, - "name": "Superdry" - }, - "categories": [ - { - "uid": 192, - "name": "T-Shirts" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/235_M11029ONDSXNS/1.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/235_M11029ONDSXNS/1.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/superdry-blue-solid-t-shirt-2/", - "query": { - "product_slug": [ - "superdry-blue-solid-t-shirt-2" - ] - } - } - }, - "quantity": 1, - "discount": "", - "price": { - "base": { - "add_on": 4490, - "marked": 4490, - "effective": 4490, - "selling": 4490, - "currency_code": "INR" - }, - "converted": { - "add_on": 4490, - "marked": 4490, - "effective": 4490, - "selling": 4490, - "currency_code": "INR" - } - }, - "message": "", - "bulk_offer": {}, - "key": "246228_S", - "coupon_message": "", - "article": { - "type": "article", - "uid": "46_235_TM62_M11029ONDSXNS_S", - "size": "S", - "seller": { - "uid": 46, - "name": "RELIANCE BRANDS LIMITED" - }, - "store": { - "uid": 4550, - "name": "VR Mall" - }, - "quantity": 1, - "price": { - "base": { - "marked": 4490, - "effective": 4490, - "currency_code": "INR" - }, - "converted": { - "marked": 4490, - "effective": 4490, - "currency_code": "INR" - } - } - } - }, - { - "availability": { - "sizes": [ - "XL", - "M", - "L", - "S" - ], - "other_store_quantity": 8, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 443175, - "name": "Light Blue Denim Jeggings", - "slug": "go-colors-light-blue-denim-jeggings-443175-3c688c", - "brand": { - "uid": 207, - "name": "Go Colors" - }, - "categories": [ - { - "uid": 267, - "name": "Jeggings" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/207_LJ03LBLUDN88/1_1512382513548.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/207_LJ03LBLUDN88/1_1512382513548.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/go-colors-light-blue-denim-jeggings-443175-3c688c/", - "query": { - "product_slug": [ - "go-colors-light-blue-denim-jeggings-443175-3c688c" - ] - } - } - }, - "quantity": 1, - "discount": "", - "price": { - "base": { - "add_on": 1599, - "marked": 1599, - "effective": 1599, - "selling": 1599, - "currency_code": "INR" - }, - "converted": { - "add_on": 1599, - "marked": 1599, - "effective": 1599, - "selling": 1599, - "currency_code": "INR" - } - }, - "message": "", - "bulk_offer": {}, - "key": "443175_S", - "coupon_message": "", - "article": { - "type": "article", - "uid": "162_207_1271_LJ03LBLUDN88_S", - "size": "S", - "seller": { - "uid": 162, - "name": "GO FASHION INDIA PRIVATE LIMITED" - }, - "store": { - "uid": 5784, - "name": "Vega City mall" - }, - "quantity": 3, - "price": { - "base": { - "marked": 1599, - "effective": 1599, - "currency_code": "INR" - }, - "converted": { - "marked": 1599, - "effective": 1599, - "currency_code": "INR" - } - } - } - }, - { - "availability": { - "sizes": [ - "OS" - ], - "other_store_quantity": 12, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 842716, - "name": "Blue Backpack", - "slug": "istorm-blue-backpack-842716-951b5a", - "brand": { - "uid": 1177, - "name": "iStorm" - }, - "categories": [ - { - "uid": 198, - "name": "Backpacks" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1177_IS483/1_1551353288247.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1177_IS483/1_1551353288247.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/istorm-blue-backpack-842716-951b5a/", - "query": { - "product_slug": [ - "istorm-blue-backpack-842716-951b5a" - ] - } - } - }, - "quantity": 1, - "discount": "34% OFF", - "price": { - "base": { - "add_on": 998.7837, - "marked": 1499, - "effective": 998.7837, - "selling": 998.7837, - "currency_code": "INR" - }, - "converted": { - "add_on": 998.7837, - "marked": 1499, - "effective": 998.7837, - "selling": 998.7837, - "currency_code": "INR" - } - }, - "message": "", - "bulk_offer": {}, - "key": "842716_OS", - "coupon_message": "", - "article": { - "type": "article", - "uid": "638_1177_CRSL63802_IS483_OS", - "size": "OS", - "seller": { - "uid": 638, - "name": "COUNFREEDISE RETAIL SERVICES LTD" - }, - "store": { - "uid": 4630, - "name": "Bhiwandi" - }, - "quantity": 4, - "price": { - "base": { - "marked": 1499, - "effective": 998.7837, - "currency_code": "INR" - }, - "converted": { - "marked": 1499, - "effective": 998.7837, - "currency_code": "INR" - } - } - } - }, - { - "availability": { - "sizes": [ - "OS" - ], - "other_store_quantity": 2, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 778937, - "name": "Colourful Carnival Bouncer", - "slug": "fisher-price-colourful-carnival-bouncer-778937-fafa1f", - "brand": { - "uid": 963, - "name": "Fisher-Price" - }, - "categories": [ - { - "uid": 576, - "name": "Cradles" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/963_PWUPC01977/1_1545308400588.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/963_PWUPC01977/1_1545308400588.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/fisher-price-colourful-carnival-bouncer-778937-fafa1f/", - "query": { - "product_slug": [ - "fisher-price-colourful-carnival-bouncer-778937-fafa1f" - ] - } - } - }, - "quantity": 1, - "discount": "11% OFF", - "price": { - "base": { - "add_on": 3059, - "marked": 3399, - "effective": 3059, - "selling": 3059, - "currency_code": "INR" - }, - "converted": { - "add_on": 3059, - "marked": 3399, - "effective": 3059, - "selling": 3059, - "currency_code": "INR" - } - }, - "message": "", - "bulk_offer": {}, - "key": "778937_OS", - "coupon_message": "", - "article": { - "type": "article", - "uid": "686_963_IC68601_PWUPC01977_OS", - "size": "OS", - "seller": { - "uid": 686, - "name": "INDUS CORPORATION" - }, - "store": { - "uid": 5059, - "name": "Vidyaranyapura Main Road" - }, - "quantity": 3, - "price": { - "base": { - "marked": 3399, - "effective": 3059, - "currency_code": "INR" - }, - "converted": { - "marked": 3399, - "effective": 3059, - "currency_code": "INR" - } - } - } - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "cart_id": 7927, - "uid": "7927", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Wed, 04 Sep 2019 04:52:21 GMT", - "restrict_checkout": false, - "is_valid": true -} -``` -
    - - - - - - - - - ---- - - -#### removeCoupon -Remove Coupon Applied - - - -```swift -poscart.removeCoupon(id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | The unique identifier of the cart | - - - -Remove Coupon applied on the cart by passing uid in request body. - -*Returned Response:* - - - - -[CartDetailResponse](#CartDetailResponse) - -Success. Returns coupons removed from the cart along with item details and price breakup. Refer `CartDetailResponse` for more details. - - - - -
    -  Example: - -```json -{ - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 342.75, - "mrp_total": 3199, - "subtotal": 3199, - "total": 3199, - "vog": 2856.25, - "you_saved": 0 - }, - "coupon": { - "type": "cash", - "code": "prismc22250111", - "uid": 17743, - "value": 0, - "is_applied": false, - "message": "Coupon successfully removed" - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 3199, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 3199, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 3199, - "currency_code": "INR" - } - ], - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - } - }, - "items": [ - { - "message": "", - "availability": { - "sizes": [ - "M", - "S", - "L", - "XXL", - "XL" - ], - "other_store_quantity": 10, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "bulk_offer": {}, - "key": "857596_S", - "quantity": 1, - "price": { - "base": { - "add_on": 3199, - "marked": 3199, - "effective": 3199, - "selling": 3199, - "currency_code": "INR" - }, - "converted": { - "add_on": 3199, - "marked": 3199, - "effective": 3199, - "selling": 3199, - "currency_code": "INR" - } - }, - "discount": "", - "coupon_message": "", - "product": { - "type": "product", - "uid": 857596, - "name": "Pink Solid Hoodie", - "slug": "883-police-pink-solid-hoodie-857596-111bdc", - "brand": { - "uid": 610, - "name": "883 Police" - }, - "categories": [ - { - "uid": 144, - "name": "Hoodies" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/883-police-pink-solid-hoodie-857596-111bdc/", - "query": { - "product_slug": [ - "883-police-pink-solid-hoodie-857596-111bdc" - ] - } - } - }, - "article": { - "type": "article", - "uid": "381_610_IGPL01_LETTER19APINK_S", - "size": "S", - "seller": { - "uid": 381, - "name": "INTERSOURCE GARMENTS PVT LTD" - }, - "store": { - "uid": 3009, - "name": "Kormangala" - }, - "quantity": 11, - "price": { - "base": { - "marked": 3199, - "effective": 3199, - "currency_code": "INR" - }, - "converted": { - "marked": 3199, - "effective": 3199, - "currency_code": "INR" - } - } - } - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "cart_id": 7477, - "uid": "7477", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Thu, 22 Aug 2019 10:55:05 GMT", - "restrict_checkout": false, - "is_valid": true -} -``` -
    - - - - - - - - - ---- - - -#### getBulkDiscountOffers -Get discount offers based on quantity - - - -```swift -poscart.getBulkDiscountOffers(itemId: itemId, articleId: articleId, uid: uid, slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| itemId | Int? | no | The Item ID of the product | -| articleId | String? | no | Article Mongo ID | -| uid | Int? | no | UID of the product | -| slug | String? | no | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | - - - -Use this API to get a list of applicable offers along with current, next and best offer for given product. Either one of uid, item_id, slug should be present. - -*Returned Response:* - - - - -[BulkPriceResponse](#BulkPriceResponse) - -Success. Returns a data object containing the seller details and available offers (if exists) on bulk products. Refer `BulkPriceResponse` for more details. - - - - -
    -  Examples: - - -
    -  Offers found - -```json -{ - "value": { - "data": [ - { - "seller": { - "uid": 248, - "name": "MANYAVAR CREATIONS PRIVATE LIMITED" - }, - "offers": [ - { - "quantity": 1, - "auto_applied": true, - "margin": 10, - "type": "bundle", - "price": { - "marked": 3999, - "effective": 3999, - "bulk_effective": 3599.1, - "currency_code": "INR" - }, - "total": 3599.1 - }, - { - "quantity": 3, - "auto_applied": true, - "margin": 20, - "type": "bundle", - "price": { - "marked": 3999, - "effective": 3999, - "bulk_effective": 3199.2, - "currency_code": "INR" - }, - "total": 9597.6 - }, - { - "quantity": 9, - "auto_applied": true, - "margin": 30, - "type": "bundle", - "price": { - "marked": 3999, - "effective": 3999, - "bulk_effective": 3443.4444444444, - "currency_code": "INR" - }, - "total": 30991, - "best": true - } - ] - } - ] - } -} -``` -
    - -
    -  Offers not found - -```json -{ - "value": { - "data": [] - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### applyRewardPoints -Apply reward points at cart - - - -```swift -poscart.applyRewardPoints(id: id, i: i, b: b, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | | -| i | Bool? | no | | -| b | Bool? | no | | -| body | [RewardPointRequest](#RewardPointRequest) | no | Request body | - - -Use this API to redeem a fixed no. of reward points by applying it to the cart. - -*Returned Response:* - - - - -[CartDetailResponse](#CartDetailResponse) - -Success. Returns a Cart object. Check the example shown below or refer `CartDetailResponse` for more details. - - - - -
    -  Example: - -```json -{ - "items": [ - { - "bulk_offer": {}, - "discount": "67% OFF", - "article": { - "type": "article", - "uid": "604_902_SSTC60401_636BLUE_1", - "size": "1", - "seller": { - "uid": 604, - "name": "SHRI SHANTINATH TRADING COMPANY" - }, - "store": { - "uid": 4579, - "name": "Gandhi Nagar" - }, - "quantity": 108, - "price": { - "base": { - "marked": 2999, - "effective": 999, - "currency_code": "INR" - }, - "converted": { - "marked": 2999, - "effective": 999, - "currency_code": "INR" - } - } - }, - "coupon_message": "", - "key": "707569_1", - "availability": { - "sizes": [ - "1", - "8", - "7", - "2", - "9", - "5", - "3", - "6" - ], - "other_store_quantity": 107, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "product": { - "type": "product", - "uid": 707569, - "name": "Blue and Gold Printed Ethnic Set", - "slug": "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a", - "brand": { - "uid": 902, - "name": "" - }, - "categories": [ - { - "uid": 525, - "name": "" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/v1/products/aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a/", - "query": { - "product_slug": [ - "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a" - ] - } - } - }, - "price": { - "base": { - "add_on": 999, - "marked": 2999, - "effective": 999, - "selling": 999, - "currency_code": "INR" - }, - "converted": { - "add_on": 999, - "marked": 2999, - "effective": 999, - "selling": 999, - "currency_code": "INR" - } - }, - "message": "", - "quantity": 1 - } - ], - "cart_id": 54, - "uid": "54", - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": -2000, - "fynd_cash": 0, - "gst_charges": 47.57, - "mrp_total": 2999, - "subtotal": 999, - "total": 999, - "vog": 951.43, - "you_saved": 0 - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 2999, - "currency_code": "INR" - }, - { - "display": "Discount", - "key": "discount", - "value": -2000, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 999, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 999, - "currency_code": "INR" - } - ], - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - } - }, - "delivery_charge_info": "", - "coupon_text": "View all offers", - "gstin": null, - "checkout_mode": "self", - "restrict_checkout": false, - "is_valid": true, - "last_modified": "Tue, 03 Sep 2019 05:35:59 GMT" -} -``` -
    - - - - - - - - - ---- - - -#### getAddresses -Fetch address - - - -```swift -poscart.getAddresses(cartId: cartId, mobileNo: mobileNo, checkoutMode: checkoutMode, tags: tags, isDefault: isDefault) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| cartId | String? | no | | -| mobileNo | String? | no | | -| checkoutMode | String? | no | | -| tags | String? | no | | -| isDefault | Bool? | no | | - - - -Use this API to get all the addresses associated with an account. If successful, returns a Address resource in the response body specified in GetAddressesResponse.attibutes listed below are optional
    • uid
    • address_id
    • mobile_no
    • checkout_mode
    • tags
    • default
    - -*Returned Response:* - - - - -[GetAddressesResponse](#GetAddressesResponse) - -Success. Returns an Address object containing a list of address saved in the account. Refer `GetAddressesResponse` for more details. - - - - -
    -  Example: - -```json -{ - "address": [ - { - "landmark": "", - "area_code": { - "slug": "pincode", - "id": 400093 - }, - "id": "8b526f521bb14a2593a8b9e3ce8c76b3", - "state": "Maharashtra", - "meta": {}, - "user_id": "8b526f521bb14a2593a8b9e3ce8c76b3", - "country_code": "IND", - "phone": 9915347757, - "geo_location": {}, - "country": "India", - "is_default_address": true, - "is_active": true, - "city": "Mumbai", - "pincode": 400093, - "checkout_mode": "self", - "address_type": "home", - "tags": [], - "area": "Sector 127", - "name": "abc", - "email": "ankur@gofynd1.com", - "address": "Megatron2", - "store_name": "store123" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### addAddress -Add address to an account - - - -```swift -poscart.addAddress(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [Address](#Address) | no | Request body | - - -Use this API to add an address to an account. - -*Returned Response:* - - - - -[SaveAddressResponse](#SaveAddressResponse) - -Success. Returns the address ID, a flag whether the address is set as default, and a success message. Refer `SaveAddressResponse` for more details. - - - - -
    -  Example: - -```json -{ - "id": "mongo_object_id", - "is_default_address": true, - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getAddressById -Fetch a single address by its ID - - - -```swift -poscart.getAddressById(id: id, cartId: cartId, mobileNo: mobileNo, checkoutMode: checkoutMode, tags: tags, isDefault: isDefault) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String | yes | | -| cartId | String? | no | | -| mobileNo | String? | no | | -| checkoutMode | String? | no | | -| tags | String? | no | | -| isDefault | Bool? | no | | - - - -Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional
    • mobile_no
    • checkout_mode
    • tags
    • default
    - -*Returned Response:* - - - - -[Address](#Address) - -Success. Returns an Address object containing a list of address saved in the account. Refer `Address` for more details. - - - - -
    -  Example: - -```json -{ - "landmark": "", - "area_code": { - "slug": "pincode", - "id": 400093 - }, - "state": "Maharashtra", - "meta": {}, - "user_id": "8b526f521bb14a2593a8b9e3ce8c76b3", - "country_code": "IND", - "phone": 9915347757, - "geo_location": {}, - "country": "India", - "is_default_address": true, - "is_active": true, - "city": "Mumbai", - "pincode": 400093, - "checkout_mode": "self", - "address_type": "home", - "uid": 1145, - "tags": [], - "area": "Sector 127", - "name": "abc", - "address_id": 1145, - "email": "ankur@gofynd1.com", - "address": "Megatron2", - "store_name": "store123" -} -``` -
    - - - - - - - - - ---- - - -#### updateAddress -Update address added to an account - - - -```swift -poscart.updateAddress(id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String | yes | ID allotted to the selected address | -| body | [Address](#Address) | no | Request body | - - -Use this API to update an existing address in the account. Request object should contain attributes mentioned in Address can be updated. These attributes are:

    • is_default_address
    • landmark
    • area
    • pincode
    • email
    • address_type
    • name
    • address_id
    • address
    - -*Returned Response:* - - - - -[UpdateAddressResponse](#UpdateAddressResponse) - -Success. Returns the address ID and a message indicating a successful address updation. - - - - -
    -  Example: - -```json -{ - "is_updated": true, - "id": "", - "is_default_address": true, - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### removeAddress -Remove address associated with an account - - - -```swift -poscart.removeAddress(id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String | yes | ID allotted to the selected address | - - - -Use this API to delete an address by its ID. This will returns an object that will indicate whether the address was deleted successfully or not. - -*Returned Response:* - - - - -[DeleteAddressResponse](#DeleteAddressResponse) - -Returns a Status object indicating the success or failure of address deletion. - - - - -
    -  Example: - -```json -{ - "id": "", - "is_deleted": true -} -``` -
    - - - - - - - - - ---- - - -#### selectAddress -Select an address from available addresses - - - -```swift -poscart.selectAddress(cartId: cartId, i: i, b: b, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| cartId | String? | no | | -| i | Bool? | no | | -| b | Bool? | no | | -| body | [SelectCartAddressRequest](#SelectCartAddressRequest) | no | Request body | - - -

    Select Address from all addresses associated with the account in order to ship the cart items to that address, otherwise default address will be selected implicitly. See `SelectCartAddressRequest` in schema of request body for the list of attributes needed to select Address from account. On successful request, this API returns a Cart object. Below address attributes are required.

    • address_id
    • billing_address_id
    • uid
    - -*Returned Response:* - - - - -[CartDetailResponse](#CartDetailResponse) - -Success. Returns a Cart object as shown below. Refer `CartDetailResponse` for more details. . - - - - -
    -  Example: - -```json -{ - "is_valid": true, - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": -2250, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 315.86, - "mrp_total": 5198, - "subtotal": 5198, - "total": 2948, - "vog": 2632.15, - "you_saved": 0 - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 5198, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 5198, - "currency_code": "INR" - }, - { - "display": "Coupon", - "key": "coupon", - "value": -2250, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 2948, - "currency_code": "INR" - } - ], - "coupon": { - "type": "cash", - "code": "PRISMC22250111", - "uid": 17743, - "value": 2250, - "is_applied": true, - "message": "coupn applied" - }, - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - } - }, - "items": [ - { - "message": "", - "quantity": 1, - "availability": { - "sizes": [ - "M", - "S", - "L", - "XXL", - "XL" - ], - "other_store_quantity": 10, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "coupon_message": "PRISMC22250111 coupon applied", - "price": { - "base": { - "add_on": 3199, - "marked": 3199, - "effective": 3199, - "selling": 3199, - "currency_code": "INR" - }, - "converted": { - "add_on": 3199, - "marked": 3199, - "effective": 3199, - "selling": 3199, - "currency_code": "INR" - } - }, - "bulk_offer": {}, - "article": { - "type": "article", - "uid": "381_610_IGPL01_LETTER19APINK_S", - "size": "S", - "seller": { - "uid": 381, - "name": "INTERSOURCE GARMENTS PVT LTD" - }, - "store": { - "uid": 3009, - "name": "Kormangala" - }, - "quantity": 11, - "price": { - "base": { - "marked": 3199, - "effective": 3199, - "currency_code": "INR" - }, - "converted": { - "marked": 3199, - "effective": 3199, - "currency_code": "INR" - } - } - }, - "product": { - "type": "product", - "uid": 857596, - "name": "Pink Solid Hoodie", - "slug": "883-police-pink-solid-hoodie-857596-111bdc", - "brand": { - "uid": 610, - "name": "883 Police" - }, - "categories": [ - { - "uid": 144, - "name": "Hoodies" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/883-police-pink-solid-hoodie-857596-111bdc/", - "query": { - "product_slug": [ - "883-police-pink-solid-hoodie-857596-111bdc" - ] - } - } - }, - "key": "857596_S", - "discount": "" - }, - { - "message": "", - "quantity": 1, - "availability": { - "sizes": [ - "L", - "XL", - "XXL" - ], - "other_store_quantity": 1, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "coupon_message": "PRISMC22250111 coupon applied", - "price": { - "base": { - "add_on": 1999, - "marked": 1999, - "effective": 1999, - "selling": 1999, - "currency_code": "INR" - }, - "converted": { - "add_on": 1999, - "marked": 1999, - "effective": 1999, - "selling": 1999, - "currency_code": "INR" - } - }, - "bulk_offer": {}, - "article": { - "type": "article", - "uid": "381_610_IGPL01_SPIRAL19ANAVY_L", - "size": "L", - "seller": { - "uid": 381, - "name": "INTERSOURCE GARMENTS PVT LTD" - }, - "store": { - "uid": 3009, - "name": "Kormangala" - }, - "quantity": 2, - "price": { - "base": { - "marked": 1999, - "effective": 1999, - "currency_code": "INR" - }, - "converted": { - "marked": 1999, - "effective": 1999, - "currency_code": "INR" - } - } - }, - "product": { - "type": "product", - "uid": 820312, - "name": "Navy Blue Melange Shorts", - "slug": "883-police-navy-blue-melange-shorts-820312-4943a8", - "brand": { - "uid": 610, - "name": "883 Police" - }, - "categories": [ - { - "uid": 193, - "name": "Shorts" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/883-police-navy-blue-melange-shorts-820312-4943a8/", - "query": { - "product_slug": [ - "883-police-navy-blue-melange-shorts-820312-4943a8" - ] - } - } - }, - "key": "820312_L", - "discount": "" - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "uid": "7477", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Fri, 23 Aug 2019 08:03:12 GMT", - "restrict_checkout": false -} -``` -
    - - - - - - - - - ---- - - -#### selectPaymentMode -Update cart payment - - - -```swift -poscart.selectPaymentMode(id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | | -| body | [UpdateCartPaymentRequest](#UpdateCartPaymentRequest) | no | Request body | - - -Use this API to update cart payment. - -*Returned Response:* - - - - -[CartDetailResponse](#CartDetailResponse) - -Success. Returns a Cart object as shown below. Refer `CartDetailResponse` for more details. - - - - -
    -  Example: - -```json -{ - "success": true, - "error_message": "Note: Your order delivery will be delayed by 7-10 Days", - "user_type": "Store User", - "cod_charges": 0, - "order_id": null, - "cod_available": true, - "cod_message": "No additional COD charges applicable", - "delivery_charges": 0, - "delivery_charge_order_value": 0, - "store_code": "", - "store_emps": [], - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": -2250, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 315.86, - "mrp_total": 5198, - "subtotal": 5198, - "total": 2948, - "vog": 2632.15, - "you_saved": 0 - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 5198, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 5198, - "currency_code": "INR" - }, - { - "display": "Coupon", - "key": "coupon", - "value": -2250, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 2948, - "currency_code": "INR" - } - ], - "coupon": { - "type": "cash", - "code": "PRISMC22250111", - "uid": 17743, - "value": 2250, - "is_applied": true, - "message": "coupn applied" - }, - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - } - }, - "items": [ - { - "message": "", - "quantity": 1, - "availability": { - "sizes": [ - "M", - "S", - "L", - "XXL", - "XL" - ], - "other_store_quantity": 10, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "coupon_message": "PRISMC22250111 coupon applied", - "price": { - "base": { - "add_on": 3199, - "marked": 3199, - "effective": 3199, - "selling": 3199, - "currency_code": "INR" - }, - "converted": { - "add_on": 3199, - "marked": 3199, - "effective": 3199, - "selling": 3199, - "currency_code": "INR" - } - }, - "bulk_offer": {}, - "article": { - "type": "article", - "uid": "381_610_IGPL01_LETTER19APINK_S", - "size": "S", - "seller": { - "uid": 381, - "name": "INTERSOURCE GARMENTS PVT LTD" - }, - "store": { - "uid": 3009, - "name": "Kormangala" - }, - "quantity": 11, - "price": { - "base": { - "marked": 3199, - "effective": 3199, - "currency_code": "INR" - }, - "converted": { - "marked": 3199, - "effective": 3199, - "currency_code": "INR" - } - } - }, - "product": { - "type": "product", - "uid": 857596, - "name": "Pink Solid Hoodie", - "slug": "883-police-pink-solid-hoodie-857596-111bdc", - "brand": { - "uid": 610, - "name": "883 Police" - }, - "categories": [ - { - "uid": 144, - "name": "Hoodies" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/883-police-pink-solid-hoodie-857596-111bdc/", - "query": { - "product_slug": [ - "883-police-pink-solid-hoodie-857596-111bdc" - ] - } - } - }, - "key": "857596_S", - "discount": "" - }, - { - "message": "", - "quantity": 1, - "availability": { - "sizes": [ - "L", - "XL", - "XXL" - ], - "other_store_quantity": 1, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "coupon_message": "PRISMC22250111 coupon applied", - "price": { - "base": { - "add_on": 1999, - "marked": 1999, - "effective": 1999, - "selling": 1999, - "currency_code": "INR" - }, - "converted": { - "add_on": 1999, - "marked": 1999, - "effective": 1999, - "selling": 1999, - "currency_code": "INR" - } - }, - "bulk_offer": {}, - "article": { - "type": "article", - "uid": "381_610_IGPL01_SPIRAL19ANAVY_L", - "size": "L", - "seller": { - "uid": 381, - "name": "INTERSOURCE GARMENTS PVT LTD" - }, - "store": { - "uid": 3009, - "name": "Kormangala" - }, - "quantity": 2, - "price": { - "base": { - "marked": 1999, - "effective": 1999, - "currency_code": "INR" - }, - "converted": { - "marked": 1999, - "effective": 1999, - "currency_code": "INR" - } - } - }, - "product": { - "type": "product", - "uid": 820312, - "name": "Navy Blue Melange Shorts", - "slug": "883-police-navy-blue-melange-shorts-820312-4943a8", - "brand": { - "uid": 610, - "name": "883 Police" - }, - "categories": [ - { - "uid": 193, - "name": "Shorts" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/883-police-navy-blue-melange-shorts-820312-4943a8/", - "query": { - "product_slug": [ - "883-police-navy-blue-melange-shorts-820312-4943a8" - ] - } - } - }, - "key": "820312_L", - "discount": "" - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "cart_id": 7477, - "uid": "7477", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Fri, 23 Aug 2019 08:03:04 GMT", - "restrict_checkout": false, - "is_valid": true -} -``` -
    - - - - - - - - - ---- - - -#### validateCouponForPayment -Verify the coupon eligibility against the payment mode - - - -```swift -poscart.validateCouponForPayment(id: id, addressId: addressId, paymentMode: paymentMode, paymentIdentifier: paymentIdentifier, aggregatorName: aggregatorName, merchantCode: merchantCode) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | | -| addressId | String? | no | | -| paymentMode | String? | no | | -| paymentIdentifier | String? | no | | -| aggregatorName | String? | no | | -| merchantCode | String? | no | | - - - -Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc. - -*Returned Response:* - - - - -[PaymentCouponValidate](#PaymentCouponValidate) - -Success. Returns a success message and the coupon validity. Refer `PaymentCouponValidate` for more details. - - - - -
    -  Example: - -```json -{ - "success": true, - "message": "", - "coupon_validity": { - "valid": true, - "discount": 499.5, - "code": "testpayment", - "display_message_en": "", - "title": "Coupon value will change." - } -} -``` -
    - - - - - - - - - ---- - - -#### getShipments -Get delivery date and options before checkout - - - -```swift -poscart.getShipments(pickAtStoreUid: pickAtStoreUid, orderingStoreId: orderingStoreId, p: p, id: id, addressId: addressId, areaCode: areaCode, orderType: orderType) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| pickAtStoreUid | Int? | no | | -| orderingStoreId | Int? | no | | -| p | Bool? | no | This is a boolean value. Select `true` for getting a payment option in response. | -| id | String? | no | The unique identifier of the cart | -| addressId | String? | no | ID allotted to the selected address | -| areaCode | String? | no | The PIN Code of the destination address, e.g. 400059 | -| orderType | String? | no | The order type of shipment HomeDelivery - If the customer wants the order home-delivered PickAtStore - If the customer wants the handover of an order at the store itself. | - - - -Use this API to get shipment details, expected delivery date, items and price breakup of the shipment. - -*Returned Response:* - - - - -[CartShipmentsResponse](#CartShipmentsResponse) - -Success. Returns delivery promise along with shipment details and price breakup. Refer `CartShipmentsResponse` for more details. - - - - -
    -  Examples: - - -
    -  Shipment Generated - -```json -{ - "value": { - "items": [], - "cart_id": 7501, - "uid": "7501", - "success": true, - "error_message": "Note: Your order delivery will be delayed by 7-10 Days", - "payment_options": { - "payment_option": [ - { - "name": "COD", - "display_name": "Cash on Delivery", - "display_priority": 1, - "payment_mode_id": 11, - "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png" - }, - "list": [] - }, - { - "name": "CARD", - "display_priority": 2, - "payment_mode_id": 2, - "display_name": "Card", - "list": [] - }, - { - "name": "NB", - "display_priority": 3, - "payment_mode_id": 3, - "display_name": "Net Banking", - "list": [ - { - "aggregator_name": "Razorpay", - "bank_name": "ICICI Bank", - "bank_code": "ICIC", - "url": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png" - }, - "merchant_code": "NB_ICICI", - "display_priority": 1 - } - ] - }, - { - "name": "WL", - "display_priority": 4, - "payment_mode_id": 4, - "display_name": "Wallet", - "list": [ - { - "wallet_name": "Paytm", - "wallet_code": "paytm", - "wallet_id": 4, - "merchant_code": "PAYTM", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_small.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_large.png" - }, - "aggregator_name": "Juspay", - "display_priority": 1 - } - ] - }, - { - "name": "UPI", - "display_priority": 9, - "payment_mode_id": 6, - "display_name": "UPI", - "list": [ - { - "aggregator_name": "UPI_Razorpay", - "name": "UPI", - "display_name": "BHIM UPI", - "code": "UPI", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_100x78.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_150x100.png" - }, - "merchant_code": "UPI", - "timeout": 240, - "retry_count": 0, - "fynd_vpa": "shopsense.rzp@hdfcbank", - "intent_flow": true, - "intent_app_error_list": [ - "com.csam.icici.bank.imobile", - "in.org.npci.upiapp", - "com.whatsapp" - ] - } - ] - }, - { - "name": "PL", - "display_priority": 11, - "payment_mode_id": 1, - "display_name": "Pay Later", - "list": [ - { - "aggregator_name": "Simpl", - "name": "Simpl", - "code": "simpl", - "merchant_code": "SIMPL", - "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png" - } - } - ] - } - ], - "payment_flows": { - "Simpl": { - "data": { - "gateway": { - "route": "simpl", - "entity": "sdk", - "is_customer_validation_required": true, - "cust_validation_url": "https://api.addsale.com/gringotts/api/v1/validate-customer/", - "sdk": { - "config": { - "redirect": false, - "callback_url": null, - "action_url": "https://api.addsale.com/avis/api/v1/payments/charge-gringotts-transaction/" - }, - "data": { - "user_phone": "8452996729", - "user_email": "paymentsdummy@gofynd.com" - } - }, - "return_url": null - } - }, - "api_link": "", - "payment_flow": "sdk" - }, - "Juspay": { - "data": {}, - "api_link": "https://sandbox.juspay.in/txns", - "payment_flow": "api" - }, - "Razorpay": { - "data": {}, - "api_link": "", - "payment_flow": "sdk" - }, - "UPI_Razorpay": { - "data": {}, - "api_link": "https://api.addsale.com/gringotts/api/v1/external/payment-initialisation/", - "payment_flow": "api" - }, - "Fynd": { - "data": {}, - "api_link": "", - "payment_flow": "api" - } - }, - "default": {} - }, - "user_type": "Store User", - "cod_charges": 0, - "order_id": null, - "cod_available": true, - "cod_message": "No additional COD charges applicable", - "delivery_charges": 0, - "delivery_charge_order_value": 0, - "delivery_slots": [ - { - "date": "Sat, 24 Aug", - "delivery_slot": [ - { - "delivery_slot_timing": "By 9:00 PM", - "default": true, - "delivery_slot_id": 1 - } - ] - } - ], - "store_code": "", - "store_emps": [], - "breakup_values": { - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - }, - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 214.18, - "mrp_total": 1999, - "subtotal": 1999, - "total": 1999, - "vog": 1784.82, - "you_saved": 0 - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 1999, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 1999, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 1999, - "currency_code": "INR" - } - ] - }, - "shipments": [ - { - "fulfillment_id": 3009, - "shipment_type": "single_shipment", - "fulfillment_type": "store", - "dp_id": "29", - "dp_options": { - "4": { - "f_priority": 4, - "r_priority": 5, - "is_cod": true, - "is_prepaid": true, - "is_reverse": true - }, - "7": { - "f_priority": 3, - "r_priority": 4, - "is_cod": true, - "is_prepaid": true, - "is_reverse": true - }, - "29": { - "f_priority": 1, - "r_priority": 2, - "is_cod": true, - "is_prepaid": true, - "is_reverse": true - } - }, - "promise": { - "timestamp": { - "min": 1566678108, - "max": 1567023708 - }, - "formatted": { - "min": "Aug 24", - "max": "Aug 28" - } - }, - "box_type": "Small Courier bag", - "shipments": 1, - "items": [ - { - "quantity": 1, - "product": { - "type": "product", - "uid": 820312, - "name": "Navy Blue Melange Shorts", - "slug": "883-police-navy-blue-melange-shorts-820312-4943a8", - "brand": { - "uid": 610, - "name": "883 Police" - }, - "categories": [ - { - "uid": 193, - "name": "Shorts" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/883-police-navy-blue-melange-shorts-820312-4943a8/", - "query": { - "product_slug": [ - "883-police-navy-blue-melange-shorts-820312-4943a8" - ] - } - } - }, - "discount": "", - "bulk_offer": {}, - "key": "820312_L", - "price": { - "base": { - "add_on": 1999, - "marked": 1999, - "effective": 1999, - "selling": 1999, - "currency_code": "INR" - }, - "converted": { - "add_on": 1999, - "marked": 1999, - "effective": 1999, - "selling": 1999, - "currency_code": "INR" - } - }, - "article": { - "type": "article", - "uid": "381_610_IGPL01_SPIRAL19ANAVY_L", - "size": "L", - "seller": { - "uid": 381, - "name": "INTERSOURCE GARMENTS PVT LTD" - }, - "store": { - "uid": 3009, - "name": "Kormangala" - }, - "quantity": 2, - "price": { - "base": { - "marked": 1999, - "effective": 1999, - "currency_code": "INR" - }, - "converted": { - "marked": 1999, - "effective": 1999, - "currency_code": "INR" - } - } - }, - "availability": { - "sizes": [ - "L", - "XL", - "XXL" - ], - "other_store_quantity": 1, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "coupon_message": "", - "message": "" - } - ] - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Thu, 22 Aug 2019 20:21:48 GMT", - "restrict_checkout": false, - "is_valid": true - } -} -``` -
    - -
    -  Shipment Generation Failed - -```json -{ - "value": { - "items": [], - "cart_id": 7501, - "uid": "7501", - "success": true, - "error_message": "Note: Your order delivery will be delayed by 7-10 Days", - "payment_options": { - "payment_option": [ - { - "name": "COD", - "display_name": "Cash on Delivery", - "display_priority": 1, - "payment_mode_id": 11, - "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png" - }, - "list": [] - }, - { - "name": "CARD", - "display_priority": 2, - "payment_mode_id": 2, - "display_name": "Card", - "list": [] - }, - { - "name": "NB", - "display_priority": 3, - "payment_mode_id": 3, - "display_name": "Net Banking", - "list": [ - { - "aggregator_name": "Razorpay", - "bank_name": "ICICI Bank", - "bank_code": "ICIC", - "url": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png" - }, - "merchant_code": "NB_ICICI", - "display_priority": 1 - } - ] - }, - { - "name": "WL", - "display_priority": 4, - "payment_mode_id": 4, - "display_name": "Wallet", - "list": [ - { - "wallet_name": "Paytm", - "wallet_code": "paytm", - "wallet_id": 4, - "merchant_code": "PAYTM", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_small.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_large.png" - }, - "aggregator_name": "Juspay", - "display_priority": 1 - } - ] - }, - { - "name": "UPI", - "display_priority": 9, - "payment_mode_id": 6, - "display_name": "UPI", - "list": [ - { - "aggregator_name": "UPI_Razorpay", - "name": "UPI", - "display_name": "BHIM UPI", - "code": "UPI", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_100x78.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_150x100.png" - }, - "merchant_code": "UPI", - "timeout": 240, - "retry_count": 0, - "fynd_vpa": "shopsense.rzp@hdfcbank", - "intent_flow": true, - "intent_app_error_list": [ - "com.csam.icici.bank.imobile", - "in.org.npci.upiapp", - "com.whatsapp" - ] - } - ] - }, - { - "name": "PL", - "display_priority": 11, - "payment_mode_id": 1, - "display_name": "Pay Later", - "list": [ - { - "aggregator_name": "Simpl", - "name": "Simpl", - "code": "simpl", - "merchant_code": "SIMPL", - "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png" - } - } - ] - } - ], - "payment_flows": { - "Simpl": { - "data": { - "gateway": { - "route": "simpl", - "entity": "sdk", - "is_customer_validation_required": true, - "cust_validation_url": "https://api.addsale.com/gringotts/api/v1/validate-customer/", - "sdk": { - "config": { - "redirect": false, - "callback_url": null, - "action_url": "https://api.addsale.com/avis/api/v1/payments/charge-gringotts-transaction/" - }, - "data": { - "user_phone": "8452996729", - "user_email": "paymentsdummy@gofynd.com" - } - }, - "return_url": null - } - }, - "api_link": "", - "payment_flow": "sdk" - }, - "Juspay": { - "data": {}, - "api_link": "https://sandbox.juspay.in/txns", - "payment_flow": "api" - }, - "Razorpay": { - "data": {}, - "api_link": "", - "payment_flow": "sdk" - }, - "UPI_Razorpay": { - "data": {}, - "api_link": "https://api.addsale.com/gringotts/api/v1/external/payment-initialisation/", - "payment_flow": "api" - }, - "Fynd": { - "data": {}, - "api_link": "", - "payment_flow": "api" - } - }, - "default": {} - }, - "user_type": "Store User", - "cod_charges": 0, - "order_id": null, - "cod_available": true, - "cod_message": "No additional COD charges applicable", - "delivery_charges": 0, - "delivery_charge_order_value": 0, - "delivery_slots": [ - { - "date": "Sat, 24 Aug", - "delivery_slot": [ - { - "delivery_slot_timing": "By 9:00 PM", - "default": true, - "delivery_slot_id": 1 - } - ] - } - ], - "store_code": "", - "store_emps": [], - "breakup_values": { - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - }, - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 214.18, - "mrp_total": 1999, - "subtotal": 1999, - "total": 1999, - "vog": 1784.82, - "you_saved": 0 - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 1999, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 1999, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 1999, - "currency_code": "INR" - } - ] - }, - "shipments": [], - "message": "Shipments could not be generated. Please Try again after some time.", - "delivery_charge_info": "", - "coupon_text": "View all offers", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Thu, 22 Aug 2019 20:21:48 GMT", - "restrict_checkout": false, - "is_valid": false - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateShipments -Update shipment delivery type and quantity before checkout - - - -```swift -poscart.updateShipments(i: i, p: p, id: id, addressId: addressId, orderType: orderType, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| i | Bool? | no | This is a boolean value. Select `true` to retrieve all the items added in the cart. | -| p | Bool? | no | This is a boolean value. Select `true` for getting a payment option in response. | -| id | String? | no | The unique identifier of the cart | -| addressId | String? | no | ID allotted to an address | -| orderType | String? | no | The order type of shipment HomeDelivery - If the customer wants the order home-delivered PickAtStore - If the customer wants the handover of an order at the store itself. | -| body | [UpdateCartShipmentRequest](#UpdateCartShipmentRequest) | no | Request body | - - -Use this API to update the delivery type and quantity as per customer's preference for either store pick-up or home-delivery. - -*Returned Response:* - - - - -[CartShipmentsResponse](#CartShipmentsResponse) - -Success. Returns delivery promise along with shipment details and price breakup. Refer `CartShipmentsResponse` for more details. - - - - -
    -  Examples: - - -
    -  Shipment Generated - -```json -{ - "value": { - "items": [], - "cart_id": 7501, - "uid": "7501", - "success": true, - "error_message": "Note: Your order delivery will be delayed by 7-10 Days", - "payment_options": { - "payment_option": [ - { - "name": "COD", - "display_name": "Cash on Delivery", - "display_priority": 1, - "payment_mode_id": 11, - "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png" - }, - "list": [] - }, - { - "name": "CARD", - "display_priority": 2, - "payment_mode_id": 2, - "display_name": "Card", - "list": [] - }, - { - "name": "NB", - "display_priority": 3, - "payment_mode_id": 3, - "display_name": "Net Banking", - "list": [ - { - "aggregator_name": "Razorpay", - "bank_name": "ICICI Bank", - "bank_code": "ICIC", - "url": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png" - }, - "merchant_code": "NB_ICICI", - "display_priority": 1 - } - ] - }, - { - "name": "WL", - "display_priority": 4, - "payment_mode_id": 4, - "display_name": "Wallet", - "list": [ - { - "wallet_name": "Paytm", - "wallet_code": "paytm", - "wallet_id": 4, - "merchant_code": "PAYTM", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_small.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_large.png" - }, - "aggregator_name": "Juspay", - "display_priority": 1 - } - ] - }, - { - "name": "UPI", - "display_priority": 9, - "payment_mode_id": 6, - "display_name": "UPI", - "list": [ - { - "aggregator_name": "UPI_Razorpay", - "name": "UPI", - "display_name": "BHIM UPI", - "code": "UPI", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_100x78.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_150x100.png" - }, - "merchant_code": "UPI", - "timeout": 240, - "retry_count": 0, - "fynd_vpa": "shopsense.rzp@hdfcbank", - "intent_flow": true, - "intent_app_error_list": [ - "com.csam.icici.bank.imobile", - "in.org.npci.upiapp", - "com.whatsapp" - ] - } - ] - }, - { - "name": "PL", - "display_priority": 11, - "payment_mode_id": 1, - "display_name": "Pay Later", - "list": [ - { - "aggregator_name": "Simpl", - "name": "Simpl", - "code": "simpl", - "merchant_code": "SIMPL", - "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png" - } - } - ] - } - ], - "payment_flows": { - "Simpl": { - "data": { - "gateway": { - "route": "simpl", - "entity": "sdk", - "is_customer_validation_required": true, - "cust_validation_url": "https://api.addsale.com/gringotts/api/v1/validate-customer/", - "sdk": { - "config": { - "redirect": false, - "callback_url": null, - "action_url": "https://api.addsale.com/avis/api/v1/payments/charge-gringotts-transaction/" - }, - "data": { - "user_phone": "8452996729", - "user_email": "paymentsdummy@gofynd.com" - } - }, - "return_url": null - } - }, - "api_link": "", - "payment_flow": "sdk" - }, - "Juspay": { - "data": {}, - "api_link": "https://sandbox.juspay.in/txns", - "payment_flow": "api" - }, - "Razorpay": { - "data": {}, - "api_link": "", - "payment_flow": "sdk" - }, - "UPI_Razorpay": { - "data": {}, - "api_link": "https://api.addsale.com/gringotts/api/v1/external/payment-initialisation/", - "payment_flow": "api" - }, - "Fynd": { - "data": {}, - "api_link": "", - "payment_flow": "api" - } - }, - "default": {} - }, - "user_type": "Store User", - "cod_charges": 0, - "order_id": null, - "cod_available": true, - "cod_message": "No additional COD charges applicable", - "delivery_charges": 0, - "delivery_charge_order_value": 0, - "delivery_slots": [ - { - "date": "Sat, 24 Aug", - "delivery_slot": [ - { - "delivery_slot_timing": "By 9:00 PM", - "default": true, - "delivery_slot_id": 1 - } - ] - } - ], - "store_code": "", - "store_emps": [], - "breakup_values": { - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - }, - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 214.18, - "mrp_total": 1999, - "subtotal": 1999, - "total": 1999, - "vog": 1784.82, - "you_saved": 0 - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 1999, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 1999, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 1999, - "currency_code": "INR" - } - ] - }, - "shipments": [ - { - "fulfillment_id": 3009, - "shipment_type": "single_shipment", - "fulfillment_type": "store", - "dp_id": "29", - "order_type": "PickAtStore", - "dp_options": { - "4": { - "f_priority": 4, - "r_priority": 5, - "is_cod": true, - "is_prepaid": true, - "is_reverse": true - }, - "7": { - "f_priority": 3, - "r_priority": 4, - "is_cod": true, - "is_prepaid": true, - "is_reverse": true - }, - "29": { - "f_priority": 1, - "r_priority": 2, - "is_cod": true, - "is_prepaid": true, - "is_reverse": true - } - }, - "promise": { - "timestamp": { - "min": 1566678108, - "max": 1567023708 - }, - "formatted": { - "min": "Aug 24", - "max": "Aug 28" - } - }, - "box_type": "Small Courier bag", - "shipments": 1, - "items": [ - { - "quantity": 1, - "product": { - "type": "product", - "uid": 820312, - "name": "Navy Blue Melange Shorts", - "slug": "883-police-navy-blue-melange-shorts-820312-4943a8", - "brand": { - "uid": 610, - "name": "883 Police" - }, - "categories": [ - { - "uid": 193, - "name": "Shorts" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/883-police-navy-blue-melange-shorts-820312-4943a8/", - "query": { - "product_slug": [ - "883-police-navy-blue-melange-shorts-820312-4943a8" - ] - } - } - }, - "discount": "", - "bulk_offer": {}, - "key": "820312_L", - "price": { - "base": { - "add_on": 1999, - "marked": 1999, - "effective": 1999, - "selling": 1999, - "currency_code": "INR" - }, - "converted": { - "add_on": 1999, - "marked": 1999, - "effective": 1999, - "selling": 1999, - "currency_code": "INR" - } - }, - "article": { - "type": "article", - "uid": "381_610_IGPL01_SPIRAL19ANAVY_L", - "size": "L", - "seller": { - "uid": 381, - "name": "INTERSOURCE GARMENTS PVT LTD" - }, - "store": { - "uid": 3009, - "name": "Kormangala" - }, - "quantity": 2, - "price": { - "base": { - "marked": 1999, - "effective": 1999, - "currency_code": "INR" - }, - "converted": { - "marked": 1999, - "effective": 1999, - "currency_code": "INR" - } - } - }, - "availability": { - "sizes": [ - "L", - "XL", - "XXL" - ], - "other_store_quantity": 1, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "coupon_message": "", - "message": "" - } - ] - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Thu, 22 Aug 2019 20:21:48 GMT", - "restrict_checkout": false, - "is_valid": true - } -} -``` -
    - -
    -  Shipment Generation Failed - -```json -{ - "value": { - "items": [], - "cart_id": 7501, - "uid": "7501", - "success": true, - "error_message": "Note: Your order delivery will be delayed by 7-10 Days", - "payment_options": { - "payment_option": [ - { - "name": "COD", - "display_name": "Cash on Delivery", - "display_priority": 1, - "payment_mode_id": 11, - "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png" - }, - "list": [] - }, - { - "name": "CARD", - "display_priority": 2, - "payment_mode_id": 2, - "display_name": "Card", - "list": [] - }, - { - "name": "NB", - "display_priority": 3, - "payment_mode_id": 3, - "display_name": "Net Banking", - "list": [ - { - "aggregator_name": "Razorpay", - "bank_name": "ICICI Bank", - "bank_code": "ICIC", - "url": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png" - }, - "merchant_code": "NB_ICICI", - "display_priority": 1 - } - ] - }, - { - "name": "WL", - "display_priority": 4, - "payment_mode_id": 4, - "display_name": "Wallet", - "list": [ - { - "wallet_name": "Paytm", - "wallet_code": "paytm", - "wallet_id": 4, - "merchant_code": "PAYTM", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_small.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_large.png" - }, - "aggregator_name": "Juspay", - "display_priority": 1 - } - ] - }, - { - "name": "UPI", - "display_priority": 9, - "payment_mode_id": 6, - "display_name": "UPI", - "list": [ - { - "aggregator_name": "UPI_Razorpay", - "name": "UPI", - "display_name": "BHIM UPI", - "code": "UPI", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_100x78.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_150x100.png" - }, - "merchant_code": "UPI", - "timeout": 240, - "retry_count": 0, - "fynd_vpa": "shopsense.rzp@hdfcbank", - "intent_flow": true, - "intent_app_error_list": [ - "com.csam.icici.bank.imobile", - "in.org.npci.upiapp", - "com.whatsapp" - ] - } - ] - }, - { - "name": "PL", - "display_priority": 11, - "payment_mode_id": 1, - "display_name": "Pay Later", - "list": [ - { - "aggregator_name": "Simpl", - "name": "Simpl", - "code": "simpl", - "merchant_code": "SIMPL", - "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png" - } - } - ] - } - ], - "payment_flows": { - "Simpl": { - "data": { - "gateway": { - "route": "simpl", - "entity": "sdk", - "is_customer_validation_required": true, - "cust_validation_url": "https://api.addsale.com/gringotts/api/v1/validate-customer/", - "sdk": { - "config": { - "redirect": false, - "callback_url": null, - "action_url": "https://api.addsale.com/avis/api/v1/payments/charge-gringotts-transaction/" - }, - "data": { - "user_phone": "8452996729", - "user_email": "paymentsdummy@gofynd.com" - } - }, - "return_url": null - } - }, - "api_link": "", - "payment_flow": "sdk" - }, - "Juspay": { - "data": {}, - "api_link": "https://sandbox.juspay.in/txns", - "payment_flow": "api" - }, - "Razorpay": { - "data": {}, - "api_link": "", - "payment_flow": "sdk" - }, - "UPI_Razorpay": { - "data": {}, - "api_link": "https://api.addsale.com/gringotts/api/v1/external/payment-initialisation/", - "payment_flow": "api" - }, - "Fynd": { - "data": {}, - "api_link": "", - "payment_flow": "api" - } - }, - "default": {} - }, - "user_type": "Store User", - "cod_charges": 0, - "order_id": null, - "cod_available": true, - "cod_message": "No additional COD charges applicable", - "delivery_charges": 0, - "delivery_charge_order_value": 0, - "delivery_slots": [ - { - "date": "Sat, 24 Aug", - "delivery_slot": [ - { - "delivery_slot_timing": "By 9:00 PM", - "default": true, - "delivery_slot_id": 1 - } - ] - } - ], - "store_code": "", - "store_emps": [], - "breakup_values": { - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - }, - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 214.18, - "mrp_total": 1999, - "subtotal": 1999, - "total": 1999, - "vog": 1784.82, - "you_saved": 0 - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 1999, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 1999, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 1999, - "currency_code": "INR" - } - ] - }, - "shipments": [], - "message": "Shipments could not be generated. Please Try again after some time.", - "delivery_charge_info": "", - "coupon_text": "View all offers", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Thu, 22 Aug 2019 20:21:48 GMT", - "restrict_checkout": false, - "is_valid": false - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### checkoutCart -Checkout all items in the cart - - - -```swift -poscart.checkoutCart(id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | | -| body | [CartPosCheckoutDetailRequest](#CartPosCheckoutDetailRequest) | no | Request body | - - -Use this API to checkout all items in the cart for payment and order generation. For COD, order will be generated directly, whereas for other checkout modes, user will be redirected to a payment gateway. - -*Returned Response:* - - - - -[CartCheckoutResponse](#CartCheckoutResponse) - -Success. Returns the status of cart checkout. Refer `CartCheckoutResponse` for more details. - - - - -
    -  Examples: - - -
    -  Address id not found - -```json -{ - "value": { - "success": false, - "message": "No address found with address id {address_id}" - } -} -``` -
    - -
    -  Missing address_id - -```json -{ - "value": { - "address_id": [ - "Missing data for required field." - ] - } -} -``` -
    - -
    -  Successful checkout cod payment - -```json -{ - "value": { - "success": true, - "cart": { - "success": true, - "error_message": "Note: Your order delivery will be delayed by 7-10 Days", - "payment_options": { - "payment_option": [ - { - "name": "COD", - "display_name": "Cash on Delivery", - "display_priority": 1, - "payment_mode_id": 11, - "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png" - }, - "list": [] - }, - { - "name": "CARD", - "display_priority": 2, - "payment_mode_id": 2, - "display_name": "Card", - "list": [] - }, - { - "name": "NB", - "display_priority": 3, - "payment_mode_id": 3, - "display_name": "Net Banking", - "list": [ - { - "aggregator_name": "Razorpay", - "bank_name": "ICICI Bank", - "bank_code": "ICIC", - "url": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png" - }, - "merchant_code": "NB_ICICI", - "display_priority": 1 - } - ] - }, - { - "name": "WL", - "display_priority": 4, - "payment_mode_id": 4, - "display_name": "Wallet", - "list": [ - { - "wallet_name": "Paytm", - "wallet_code": "paytm", - "wallet_id": 4, - "merchant_code": "PAYTM", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_small.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_large.png" - }, - "aggregator_name": "Juspay", - "display_priority": 1 - } - ] - }, - { - "name": "UPI", - "display_priority": 9, - "payment_mode_id": 6, - "display_name": "UPI", - "list": [ - { - "aggregator_name": "UPI_Razorpay", - "name": "UPI", - "display_name": "BHIM UPI", - "code": "UPI", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_100x78.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_150x100.png" - }, - "merchant_code": "UPI", - "timeout": 240, - "retry_count": 0, - "fynd_vpa": "shopsense.rzp@hdfcbank", - "intent_flow": true, - "intent_app_error_list": [ - "com.csam.icici.bank.imobile", - "in.org.npci.upiapp", - "com.whatsapp" - ] - } - ] - }, - { - "name": "PL", - "display_priority": 11, - "payment_mode_id": 1, - "display_name": "Pay Later", - "list": [ - { - "aggregator_name": "Simpl", - "name": "Simpl", - "code": "simpl", - "merchant_code": "SIMPL", - "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", - "logo_url": { - "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", - "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png" - } - } - ] - } - ], - "payment_flows": { - "Simpl": { - "data": { - "gateway": { - "route": "simpl", - "entity": "sdk", - "is_customer_validation_required": true, - "cust_validation_url": "https://api.addsale.com/gringotts/api/v1/validate-customer/", - "sdk": { - "config": { - "redirect": false, - "callback_url": null, - "action_url": "https://api.addsale.com/avis/api/v1/payments/charge-gringotts-transaction/" - }, - "data": { - "user_phone": "8452996729", - "user_email": "paymentsdummy@gofynd.com" - } - }, - "return_url": null - } - }, - "api_link": "", - "payment_flow": "sdk" - }, - "Juspay": { - "data": {}, - "api_link": "https://sandbox.juspay.in/txns", - "payment_flow": "api" - }, - "Razorpay": { - "data": {}, - "api_link": "", - "payment_flow": "sdk" - }, - "UPI_Razorpay": { - "data": {}, - "api_link": "https://api.addsale.com/gringotts/api/v1/external/payment-initialisation/", - "payment_flow": "api" - }, - "Fynd": { - "data": {}, - "api_link": "", - "payment_flow": "api" - } - }, - "default": {} - }, - "user_type": "Store User", - "cod_charges": 0, - "order_id": "FY5D5E215CF287584CE6", - "cod_available": true, - "cod_message": "No additional COD charges applicable", - "delivery_charges": 0, - "delivery_charge_order_value": 0, - "delivery_slots": [ - { - "date": "Sat, 24 Aug", - "delivery_slot": [ - { - "delivery_slot_timing": "By 9:00 PM", - "default": true, - "delivery_slot_id": 1 - } - ] - } - ], - "store_code": "", - "store_emps": [], - "breakup_values": { - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid Coupon" - }, - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - }, - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 214.18, - "mrp_total": 1999, - "subtotal": 1999, - "total": 1999, - "vog": 1784.82, - "you_saved": 0 - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 1999, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 1999, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 1999, - "currency_code": "INR" - } - ] - }, - "items": [ - { - "key": "820312_L", - "message": "", - "bulk_offer": {}, - "price": { - "base": { - "add_on": 1999, - "marked": 1999, - "effective": 1999, - "selling": 1999, - "currency_code": "INR" - }, - "converted": { - "add_on": 1999, - "marked": 1999, - "effective": 1999, - "selling": 1999, - "currency_code": "INR" - } - }, - "quantity": 1, - "discount": "", - "product": { - "type": "product", - "uid": 820312, - "name": "Navy Blue Melange Shorts", - "slug": "883-police-navy-blue-melange-shorts-820312-4943a8", - "brand": { - "uid": 610, - "name": "883 Police" - }, - "categories": [ - { - "uid": 193, - "name": "Shorts" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/883-police-navy-blue-melange-shorts-820312-4943a8/", - "query": { - "product_slug": [ - "883-police-navy-blue-melange-shorts-820312-4943a8" - ] - } - } - }, - "article": { - "type": "article", - "uid": "381_610_IGPL01_SPIRAL19ANAVY_L", - "size": "L", - "seller": { - "uid": 381, - "name": "INTERSOURCE GARMENTS PVT LTD" - }, - "store": { - "uid": 3009, - "name": "Kormangala" - }, - "quantity": 2, - "price": { - "base": { - "marked": 1999, - "effective": 1999, - "currency_code": "INR" - }, - "converted": { - "marked": 1999, - "effective": 1999, - "currency_code": "INR" - } - } - }, - "coupon_message": "", - "availability": { - "sizes": [ - "L", - "XL", - "XXL" - ], - "other_store_quantity": 1, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - } - } - ], - "delivery_charge_info": "", - "coupon_text": "View all offers", - "cart_id": 7483, - "uid": "7483", - "gstin": null, - "checkout_mode": "self", - "last_modified": "Thu, 22 Aug 2019 04:58:44 GMT", - "restrict_checkout": false, - "is_valid": true - }, - "callback_url": "https://api.addsale.com/gringotts/api/v1/external/payment-callback/", - "app_intercept_url": "http://uniket-testing.addsale.link/cart/order-status", - "message": "", - "data": { - "order_id": "FY5D5E215CF287584CE6" - }, - "order_id": "FY5D5E215CF287584CE6" - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateCartMeta -Update the cart meta - - - -```swift -poscart.updateCartMeta(id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| id | String? | no | The unique identifier of the cart | -| body | [CartMetaRequest](#CartMetaRequest) | no | Request body | - - -Use this API to update cart meta like checkout_mode and gstin. - -*Returned Response:* - - - - -[CartMetaResponse](#CartMetaResponse) - -Returns a message indicating the success of cart meta updation as shown below. - - - - -
    -  Example: - -```json -{ - "message": "cart meta updated" -} -``` -
    - - - - - - - - - ---- - - -#### getAvailableDeliveryModes -Get available delivery modes for cart - - - -```swift -poscart.getAvailableDeliveryModes(areaCode: areaCode, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| areaCode | String | yes | | -| id | String? | no | | - - - -Use this API to get the delivery modes (home-delivery/store-pickup) along with a list of pickup stores available for a given cart at a given PIN Code. User can then view the address of a pickup store with the help of store-address API. - -*Returned Response:* - - - - -[CartDeliveryModesResponse](#CartDeliveryModesResponse) - -Success. Returns the available delivery mode available for a given PIN Code, along with the UID of all the eligible pickup stores. - - - - -
    -  Example: - -```json -{ - "available_modes": [ - "HomeDelivery", - "PickAtStore" - ], - "pickup_stores": [ - 1 - ] -} -``` -
    - - - - - - - - - ---- - - -#### getStoreAddressByUid -Get list of stores for give uids - - - -```swift -poscart.getStoreAddressByUid(storeUid: storeUid) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| storeUid | Int | yes | | - - - -Use this API to get the store details by entering the unique identifier of the pickup stores shown in the response of available-delivery-mode API. - -*Returned Response:* - - - - -[StoreDetailsResponse](#StoreDetailsResponse) - -Success. Returns available store information with its address as shown below. - - - - -
    -  Example: - -```json -{ - "items": [ - { - "name": "Tennille Urse", - "phone": "9819716565", - "email": "rehman@cashkart.com", - "address_type": "store", - "address": "NO", - "area": "", - "pincode": 400072, - "area_code": 400072, - "area_code_slug": "pincode", - "landmark": "", - "country": "INDIA", - "city": "MUMBAI", - "state": "MAHA", - "store_code": "6462b3cd-9d64-4da9-a764-b0e6a52cf5e8", - "uid": 20, - "geo_location": { - "longitude": 1, - "latitude": 1 - } - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getCartShareLink -Generate token for sharing the cart - - - -```swift -poscart.getCartShareLink(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [GetShareCartLinkRequest](#GetShareCartLinkRequest) | no | Request body | - - -Use this API to generate a shared cart snapshot and return a shortlink token. The link can be shared with other users for getting the same items in their cart. - -*Returned Response:* - - - - -[GetShareCartLinkResponse](#GetShareCartLinkResponse) - -Returns a URL to share and a token as shown below. - - - - -
    -  Examples: - - -
    -  Token Generated - -```json -{ - "value": { - "token": "ZweG1XyX", - "share_url": "https://uniket-testing.addsale.link/shared-cart/ZweG1XyX" - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getCartSharedItems -Get details of a shared cart - - - -```swift -poscart.getCartSharedItems(token: token) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| token | String | yes | Token of the shared short link | - - - -Use this API to get the shared cart details as per the token generated using the share-cart API. - -*Returned Response:* - - - - -[SharedCartResponse](#SharedCartResponse) - -Success. Returns a Cart object as per the valid token. Refer `SharedCartResponse` for more details. - - - - -
    -  Example: - -```json -{ - "cart": { - "shared_cart_details": { - "token": "BQ9jySQ9", - "user": { - "user_id": "23109086", - "is_anonymous": false - }, - "meta": { - "selected_staff": "", - "ordering_store": null - }, - "selected_staff": "", - "ordering_store": null, - "source": {}, - "created_on": "2019-12-18T14:00:07.165000" - }, - "items": [ - { - "key": "791651_6", - "discount": "", - "bulk_offer": {}, - "coupon_message": "", - "article": { - "type": "article", - "uid": "304_1054_9036_R1005753_6", - "size": "6", - "seller": { - "uid": 304, - "name": "LEAYAN GLOBAL PVT. LTD." - }, - "store": { - "uid": 5322, - "name": "Vaisali Nagar" - }, - "quantity": 1, - "price": { - "base": { - "marked": 2095, - "effective": 2095, - "currency_code": "INR" - }, - "converted": { - "marked": 2095, - "effective": 2095, - "currency_code": "INR" - } - } - }, - "product": { - "type": "product", - "uid": 791651, - "name": "Black Running Shoes", - "slug": "furo-black-running-shoes-791651-f8bcc3", - "brand": { - "uid": 1054, - "name": "Furo" - }, - "categories": [ - { - "uid": 160, - "name": "Running Shoes" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/furo-black-running-shoes-791651-f8bcc3/", - "query": { - "product_slug": [ - "furo-black-running-shoes-791651-f8bcc3" - ] - } - } - }, - "message": "", - "quantity": 1, - "availability": { - "sizes": [ - "7", - "8", - "9", - "10", - "6" - ], - "other_store_quantity": 12, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "price": { - "base": { - "add_on": 2095, - "marked": 2095, - "effective": 2095, - "selling": 2095, - "currency_code": "INR" - }, - "converted": { - "add_on": 2095, - "marked": 2095, - "effective": 2095, - "selling": 2095, - "currency_code": "INR" - } - } - }, - { - "key": "791651_7", - "discount": "", - "bulk_offer": {}, - "coupon_message": "", - "article": { - "type": "article", - "uid": "304_1054_9036_R1005753_7", - "size": "7", - "seller": { - "uid": 304, - "name": "LEAYAN GLOBAL PVT. LTD." - }, - "store": { - "uid": 5322, - "name": "Vaisali Nagar" - }, - "quantity": 2, - "price": { - "base": { - "marked": 2095, - "effective": 2095, - "currency_code": "INR" - }, - "converted": { - "marked": 2095, - "effective": 2095, - "currency_code": "INR" - } - } - }, - "product": { - "type": "product", - "uid": 791651, - "name": "Black Running Shoes", - "slug": "furo-black-running-shoes-791651-f8bcc3", - "brand": { - "uid": 1054, - "name": "Furo" - }, - "categories": [ - { - "uid": 160, - "name": "Running Shoes" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/furo-black-running-shoes-791651-f8bcc3/", - "query": { - "product_slug": [ - "furo-black-running-shoes-791651-f8bcc3" - ] - } - } - }, - "message": "", - "quantity": 2, - "availability": { - "sizes": [ - "7", - "8", - "9", - "10", - "6" - ], - "other_store_quantity": 7, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "price": { - "base": { - "add_on": 4190, - "marked": 4190, - "effective": 4190, - "selling": 4190, - "currency_code": "INR" - }, - "converted": { - "add_on": 4190, - "marked": 4190, - "effective": 4190, - "selling": 4190, - "currency_code": "INR" - } - } - } - ], - "cart_id": 13055, - "uid": "13055", - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 958.73, - "mrp_total": 6285, - "subtotal": 6285, - "total": 6285, - "vog": 5326.27, - "you_saved": 0 - }, - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid coupon" - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 6285, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 6285, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 6285, - "currency_code": "INR" - } - ] - }, - "delivery_charge_info": "", - "coupon_text": "View all offers", - "gstin": null, - "comment": "", - "checkout_mode": "self", - "payment_selection_lock": { - "enabled": false, - "default_options": "COD", - "payment_identifier": null - }, - "restrict_checkout": false, - "is_valid": true, - "last_modified": "Mon, 16 Dec 2019 07:02:18 GMT" - }, - "error": "" -} -``` -
    - - - - - - - - - ---- - - -#### updateCartWithSharedItems -Merge or replace existing cart - - - -```swift -poscart.updateCartWithSharedItems(token: token, action: action) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| token | String | yes | Token of the shared short link | -| action | String | yes | Operation to perform on the existing cart merge or replace. | - - - -Use this API to merge the shared cart with existing cart, or replace the existing cart with the shared cart. The `action` parameter is used to indicate the operation Merge or Replace. - -*Returned Response:* - - - - -[SharedCartResponse](#SharedCartResponse) - -Success. Returns a merged or replaced cart as per the valid token. Refer `SharedCartResponse` for more details. - - - - -
    -  Examples: - - -
    -  Cart Merged/Replaced - -```json -{ - "value": { - "cart": { - "shared_cart_details": { - "token": "BQ9jySQ9", - "user": { - "user_id": "23109086", - "is_anonymous": false - }, - "meta": { - "selected_staff": "", - "ordering_store": null - }, - "selected_staff": "", - "ordering_store": null, - "source": {}, - "created_on": "2019-12-18T14:00:07.165000" - }, - "items": [ - { - "key": "791651_6", - "discount": "", - "bulk_offer": {}, - "coupon_message": "", - "article": { - "type": "article", - "uid": "304_1054_9036_R1005753_6", - "size": "6", - "seller": { - "uid": 304, - "name": "LEAYAN GLOBAL PVT. LTD." - }, - "store": { - "uid": 5322, - "name": "Vaisali Nagar" - }, - "quantity": 1, - "price": { - "base": { - "marked": 2095, - "effective": 2095, - "currency_code": "INR" - }, - "converted": { - "marked": 2095, - "effective": 2095, - "currency_code": "INR" - } - } - }, - "product": { - "type": "product", - "uid": 791651, - "name": "Black Running Shoes", - "slug": "furo-black-running-shoes-791651-f8bcc3", - "brand": { - "uid": 1054, - "name": "Furo" - }, - "categories": [ - { - "uid": 160, - "name": "Running Shoes" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/furo-black-running-shoes-791651-f8bcc3/", - "query": { - "product_slug": [ - "furo-black-running-shoes-791651-f8bcc3" - ] - } - } - }, - "message": "", - "quantity": 1, - "availability": { - "sizes": [ - "7", - "8", - "9", - "10", - "6" - ], - "other_store_quantity": 12, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "price": { - "base": { - "add_on": 2095, - "marked": 2095, - "effective": 2095, - "selling": 2095, - "currency_code": "INR" - }, - "converted": { - "add_on": 2095, - "marked": 2095, - "effective": 2095, - "selling": 2095, - "currency_code": "INR" - } - } - }, - { - "key": "791651_7", - "discount": "", - "bulk_offer": {}, - "coupon_message": "", - "article": { - "type": "article", - "uid": "304_1054_9036_R1005753_7", - "size": "7", - "seller": { - "uid": 304, - "name": "LEAYAN GLOBAL PVT. LTD." - }, - "store": { - "uid": 5322, - "name": "Vaisali Nagar" - }, - "quantity": 2, - "price": { - "base": { - "marked": 2095, - "effective": 2095, - "currency_code": "INR" - }, - "converted": { - "marked": 2095, - "effective": 2095, - "currency_code": "INR" - } - } - }, - "product": { - "type": "product", - "uid": 791651, - "name": "Black Running Shoes", - "slug": "furo-black-running-shoes-791651-f8bcc3", - "brand": { - "uid": 1054, - "name": "Furo" - }, - "categories": [ - { - "uid": 160, - "name": "Running Shoes" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/furo-black-running-shoes-791651-f8bcc3/", - "query": { - "product_slug": [ - "furo-black-running-shoes-791651-f8bcc3" - ] - } - } - }, - "message": "", - "quantity": 2, - "availability": { - "sizes": [ - "7", - "8", - "9", - "10", - "6" - ], - "other_store_quantity": 7, - "out_of_stock": false, - "deliverable": true, - "is_valid": true - }, - "price": { - "base": { - "add_on": 4190, - "marked": 4190, - "effective": 4190, - "selling": 4190, - "currency_code": "INR" - }, - "converted": { - "add_on": 4190, - "marked": 4190, - "effective": 4190, - "selling": 4190, - "currency_code": "INR" - } - } - } - ], - "cart_id": 13055, - "uid": "13055", - "breakup_values": { - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": 0, - "fynd_cash": 0, - "gst_charges": 958.73, - "mrp_total": 6285, - "subtotal": 6285, - "total": 6285, - "vog": 5326.27, - "you_saved": 0 - }, - "loyalty_points": { - "total": 0, - "applicable": 0, - "is_applied": false, - "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." - }, - "coupon": { - "type": "cash", - "code": "", - "uid": null, - "value": 0, - "is_applied": false, - "message": "Sorry! Invalid coupon" - }, - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 6285, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 6285, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 6285, - "currency_code": "INR" - } - ] - }, - "delivery_charge_info": "", - "coupon_text": "View all offers", - "gstin": null, - "comment": "", - "checkout_mode": "self", - "payment_selection_lock": { - "enabled": false, - "default_options": "COD", - "payment_identifier": null - }, - "restrict_checkout": false, - "is_valid": true, - "last_modified": "Mon, 16 Dec 2019 07:02:18 GMT" - } - } -} -``` -
    - -
    - - - - - - - - - ---- - - - - -## Logistic - - -#### getTatProduct -Get TAT of a product - - - -```swift -logistic.getTatProduct(body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| body | [GetTatProductReqBody](#GetTatProductReqBody) | yes | Request body | - - -Use this API to know the delivery turnaround time (TAT) by entering the product details along with the PIN Code of the location. - -*Returned Response:* - - - - -[GetTatProductResponse](#GetTatProductResponse) - -Success. Check the example shown below or refer `GetTatProductResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getPincodeCity -Get city from PIN Code - - - -```swift -logistic.getPincodeCity(pincode: pincode) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| --------- | ----- | -------- | ----------- | -| pincode | String | yes | The PIN Code of the area, e.g. 400059 | - - - -Use this API to retrieve a city by its PIN Code. - -*Returned Response:* - - - - -[GetPincodeCityResponse](#GetPincodeCityResponse) - -Success. Returns a JSON object containing the city name, state and country identified by its PIN Code. Check the example shown below or refer `GetPincodeCityResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - - - -### Schemas - - - - - #### [ProductListingActionPage](#ProductListingActionPage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | query | [String: Any]? | yes | | - | params | [String: Any]? | yes | | - | type | String? | yes | | - ---- - - - - - #### [ProductListingAction](#ProductListingAction) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | page | [ProductListingActionPage](#ProductListingActionPage)? | yes | | - | type | String? | yes | | - ---- - - - - - #### [Meta](#Meta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | source | String? | yes | | - ---- - - - - - #### [Media](#Media) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | meta | [Meta](#Meta)? | yes | | - | url | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [Price](#Price) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | max | Double? | yes | | - | currencySymbol | String? | yes | | - | currencyCode | String? | yes | | - | min | Double? | yes | | - ---- - - - - - #### [ProductListingPrice](#ProductListingPrice) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | marked | [Price](#Price)? | yes | | - | effective | [Price](#Price)? | yes | | - ---- - - - - - #### [ProductBrand](#ProductBrand) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | logo | [Media](#Media)? | yes | | - | action | [ProductListingAction](#ProductListingAction)? | yes | | - | name | String? | yes | | - | uid | Int? | yes | | - ---- - - - - - #### [ProductDetailAttribute](#ProductDetailAttribute) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String? | yes | | - | value | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [ProductDetailGroupedAttribute](#ProductDetailGroupedAttribute) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | details | [[ProductDetailAttribute](#ProductDetailAttribute)]? | yes | | - ---- - - - - - #### [ProductDetail](#ProductDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | ratingCount | Int? | yes | | - | shortDescription | String? | yes | | - | slug | String | no | | - | action | [ProductListingAction](#ProductListingAction)? | yes | | - | uid | Int? | yes | | - | discount | String? | yes | | - | rating | Double? | yes | | - | itemType | String? | yes | | - | name | String? | yes | | - | medias | [[Media](#Media)]? | yes | | - | price | [ProductListingPrice](#ProductListingPrice)? | yes | | - | similars | [String]? | yes | | - | color | String? | yes | | - | categories | [[ProductBrand](#ProductBrand)]? | yes | | - | itemCode | String? | yes | | - | type | String? | yes | | - | highlights | [String]? | yes | | - | hasVariant | Bool? | yes | | - | imageNature | String? | yes | | - | groupedAttributes | [[ProductDetailGroupedAttribute](#ProductDetailGroupedAttribute)]? | yes | | - | tryouts | [String]? | yes | | - | attributes | [String: Any]? | yes | | - | description | String? | yes | | - | teaserTag | String? | yes | | - | brand | [ProductBrand](#ProductBrand)? | yes | | - | productOnlineDate | String? | yes | | - ---- - - - - - #### [ErrorResponse](#ErrorResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | error | String? | yes | | - ---- - - - - - #### [ColumnHeader](#ColumnHeader) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | convertable | Bool? | yes | | - | value | String? | yes | | - ---- - - - - - #### [ColumnHeaders](#ColumnHeaders) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | col3 | [ColumnHeader](#ColumnHeader)? | yes | | - | col4 | [ColumnHeader](#ColumnHeader)? | yes | | - | col6 | [ColumnHeader](#ColumnHeader)? | yes | | - | col1 | [ColumnHeader](#ColumnHeader)? | yes | | - | col2 | [ColumnHeader](#ColumnHeader)? | yes | | - | col5 | [ColumnHeader](#ColumnHeader)? | yes | | - ---- - - - - - #### [SizeChartValues](#SizeChartValues) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | col3 | String? | yes | | - | col4 | String? | yes | | - | col6 | String? | yes | | - | col1 | String? | yes | | - | col2 | String? | yes | | - | col5 | String? | yes | | - ---- - - - - - #### [SizeChart](#SizeChart) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | image | String? | yes | | - | title | String? | yes | | - | headers | [ColumnHeaders](#ColumnHeaders)? | yes | | - | sizeTip | String? | yes | | - | description | String? | yes | | - | sizes | [[SizeChartValues](#SizeChartValues)]? | yes | | - | unit | String? | yes | | - ---- - - - - - #### [ProductSize](#ProductSize) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - | quantity | Int? | yes | | - | value | String? | yes | | - | isAvailable | Bool? | yes | | - ---- - - - - - #### [ProductSizeStores](#ProductSizeStores) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | count | Int? | yes | | - ---- - - - - - #### [ProductSizes](#ProductSizes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | sizeChart | [SizeChart](#SizeChart)? | yes | | - | sizes | [[ProductSize](#ProductSize)]? | yes | | - | price | [ProductListingPrice](#ProductListingPrice)? | yes | | - | stores | [ProductSizeStores](#ProductSizeStores)? | yes | | - | sellable | Bool? | yes | | - | discount | String? | yes | | - ---- - - - - - #### [ProductStockPrice](#ProductStockPrice) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | marked | Double? | yes | | - | currency | String? | yes | | - | effective | Double? | yes | | - ---- - - - - - #### [StrategyWiseListing](#StrategyWiseListing) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | distance | Int? | yes | | - | quantity | Int? | yes | | - | tat | Int? | yes | | - | pincode | Int? | yes | | - ---- - - - - - #### [Seller](#Seller) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | count | Int? | yes | | - | name | String? | yes | | - | uid | Int? | yes | | - ---- - - - - - #### [ReturnConfig](#ReturnConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | returnable | Bool? | yes | | - | time | Int? | yes | | - | unit | String? | yes | | - ---- - - - - - #### [ProductSetDistributionSize](#ProductSetDistributionSize) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | size | String? | yes | | - | pieces | Int? | yes | | - ---- - - - - - #### [ProductSetDistribution](#ProductSetDistribution) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | sizes | [[ProductSetDistributionSize](#ProductSetDistributionSize)]? | yes | | - ---- - - - - - #### [ProductSet](#ProductSet) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | quantity | Int? | yes | | - | sizeDistribution | [ProductSetDistribution](#ProductSetDistribution)? | yes | | - ---- - - - - - #### [ArticleAssignment](#ArticleAssignment) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | level | String? | yes | | - | strategy | String? | yes | | - ---- - - - - - #### [Store](#Store) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | count | Int? | yes | | - | name | String? | yes | | - | uid | Int? | yes | | - ---- - - - - - #### [Details](#Details) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String? | yes | | - | value | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [MarketPlaceSttributes](#MarketPlaceSttributes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | details | [[Details](#Details)]? | yes | | - ---- - - - - - #### [ProductSizePriceResponse](#ProductSizePriceResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pricePerPiece | [ProductStockPrice](#ProductStockPrice)? | yes | | - | strategyWiseListing | [[StrategyWiseListing](#StrategyWiseListing)]? | yes | | - | itemType | String? | yes | | - | articleId | String? | yes | | - | seller | [Seller](#Seller)? | yes | | - | longLat | [Double]? | yes | | - | returnConfig | [ReturnConfig](#ReturnConfig)? | yes | | - | pincode | Int? | yes | | - | specialBadge | String? | yes | | - | set | [ProductSet](#ProductSet)? | yes | | - | discount | String? | yes | | - | price | [ProductStockPrice](#ProductStockPrice)? | yes | | - | articleAssignment | [ArticleAssignment](#ArticleAssignment)? | yes | | - | store | [Store](#Store)? | yes | | - | quantity | Int? | yes | | - | sellerCount | Int? | yes | | - | marketplaceAttributes | [[MarketPlaceSttributes](#MarketPlaceSttributes)]? | yes | | - ---- - - - - - #### [ProductSizeSellerFilter](#ProductSizeSellerFilter) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | value | String? | yes | | - | isSelected | Bool? | yes | | - | name | String? | yes | | - ---- - - - - - #### [ProductSizeSellersResponse](#ProductSizeSellersResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | page | [Page](#Page) | no | | - | sortOn | [[ProductSizeSellerFilter](#ProductSizeSellerFilter)]? | yes | | - | items | [[ProductSizePriceResponse](#ProductSizePriceResponse)]? | yes | | - ---- - - - - - #### [AttributeDetail](#AttributeDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - | key | String? | yes | | - | logo | String? | yes | | - | description | String? | yes | | - ---- - - - - - #### [AttributeMetadata](#AttributeMetadata) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | details | [[AttributeDetail](#AttributeDetail)]? | yes | | - ---- - - - - - #### [ProductsComparisonResponse](#ProductsComparisonResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | attributesMetadata | [[AttributeMetadata](#AttributeMetadata)]? | yes | | - | items | [[ProductDetail](#ProductDetail)]? | yes | | - ---- - - - - - #### [ProductCompareResponse](#ProductCompareResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | attributesMetadata | [[AttributeMetadata](#AttributeMetadata)]? | yes | | - | title | String? | yes | | - | items | [[ProductDetail](#ProductDetail)]? | yes | | - | subtitle | String? | yes | | - ---- - - - - - #### [ProductFrequentlyComparedSimilarResponse](#ProductFrequentlyComparedSimilarResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | similars | [ProductCompareResponse](#ProductCompareResponse)? | yes | | - ---- - - - - - #### [ProductSimilarItem](#ProductSimilarItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | items | [[ProductDetail](#ProductDetail)]? | yes | | - | subtitle | String? | yes | | - ---- - - - - - #### [SimilarProductByTypeResponse](#SimilarProductByTypeResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | similars | [ProductSimilarItem](#ProductSimilarItem)? | yes | | - ---- - - - - - #### [ProductVariantItemResponse](#ProductVariantItemResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | color | String? | yes | | - | value | String? | yes | | - | slug | String? | yes | | - | action | [ProductListingAction](#ProductListingAction)? | yes | | - | name | String? | yes | | - | uid | Int? | yes | | - | isAvailable | Bool? | yes | | - | medias | [[Media](#Media)]? | yes | | - | colorName | String? | yes | | - ---- - - - - - #### [ProductVariantResponse](#ProductVariantResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | header | String? | yes | | - | key | String? | yes | | - | displayType | String? | yes | | - | items | [[ProductVariantItemResponse](#ProductVariantItemResponse)]? | yes | | - ---- - - - - - #### [ProductVariantsResponse](#ProductVariantsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | variants | [[ProductVariantResponse](#ProductVariantResponse)]? | yes | | - ---- - - - - - #### [CompanyDetail](#CompanyDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | id | Int? | yes | | - ---- - - - - - #### [StoreDetail](#StoreDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | city | String? | yes | | - | code | String? | yes | | - | name | String? | yes | | - | id | Int? | yes | | - ---- - - - - - #### [ProductStockStatusItem](#ProductStockStatusItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | size | String? | yes | | - | itemId | Int? | yes | | - | seller | [Seller](#Seller)? | yes | | - | company | [CompanyDetail](#CompanyDetail)? | yes | | - | identifier | [String: Any]? | yes | | - | uid | String? | yes | | - | price | [ProductStockPrice](#ProductStockPrice)? | yes | | - | store | [StoreDetail](#StoreDetail)? | yes | | - | quantity | Int? | yes | | - ---- - - - - - #### [ProductStockStatusResponse](#ProductStockStatusResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[ProductStockStatusItem](#ProductStockStatusItem)]? | yes | | - ---- - - - - - #### [ProductStockPolling](#ProductStockPolling) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | page | [Page](#Page) | no | | - | items | [[ProductStockStatusItem](#ProductStockStatusItem)]? | yes | | - ---- - - - - - #### [ProductFiltersValue](#ProductFiltersValue) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | selectedMax | Int? | yes | | - | value | String? | yes | | - | min | Int? | yes | | - | currencySymbol | String? | yes | | - | currencyCode | String? | yes | | - | selectedMin | Int? | yes | | - | displayFormat | String? | yes | | - | max | Int? | yes | | - | display | String | no | | - | queryFormat | String? | yes | | - | count | Int? | yes | | - | isSelected | Bool | no | | - ---- - - - - - #### [ProductFiltersKey](#ProductFiltersKey) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String | no | | - | logo | String? | yes | | - | kind | String? | yes | | - | name | String | no | | - ---- - - - - - #### [ProductFilters](#ProductFilters) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | values | [[ProductFiltersValue](#ProductFiltersValue)] | no | | - | key | [ProductFiltersKey](#ProductFiltersKey) | no | | - ---- - - - - - #### [ProductSortOn](#ProductSortOn) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | value | String? | yes | | - | isSelected | Bool? | yes | | - | name | String? | yes | | - ---- - - - - - #### [ProductListingDetail](#ProductListingDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | ratingCount | Int? | yes | | - | shortDescription | String? | yes | | - | slug | String | no | | - | action | [ProductListingAction](#ProductListingAction)? | yes | | - | uid | Int? | yes | | - | discount | String? | yes | | - | rating | Double? | yes | | - | itemType | String? | yes | | - | name | String? | yes | | - | medias | [[Media](#Media)]? | yes | | - | price | [ProductListingPrice](#ProductListingPrice)? | yes | | - | similars | [String]? | yes | | - | color | String? | yes | | - | categories | [[ProductBrand](#ProductBrand)]? | yes | | - | itemCode | String? | yes | | - | type | String? | yes | | - | highlights | [String]? | yes | | - | sellable | Bool? | yes | | - | hasVariant | Bool? | yes | | - | imageNature | String? | yes | | - | groupedAttributes | [[ProductDetailGroupedAttribute](#ProductDetailGroupedAttribute)]? | yes | | - | tryouts | [String]? | yes | | - | attributes | [String: Any]? | yes | | - | description | String? | yes | | - | teaserTag | String? | yes | | - | brand | [ProductBrand](#ProductBrand)? | yes | | - | productOnlineDate | String? | yes | | - ---- - - - - - #### [ProductListingResponse](#ProductListingResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | filters | [[ProductFilters](#ProductFilters)]? | yes | | - | page | [Page](#Page) | no | | - | sortOn | [[ProductSortOn](#ProductSortOn)]? | yes | | - | items | [[ProductListingDetail](#ProductListingDetail)]? | yes | | - ---- - - - - - #### [ImageUrls](#ImageUrls) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | portrait | [Media](#Media)? | yes | | - | landscape | [Media](#Media)? | yes | | - ---- - - - - - #### [BrandItem](#BrandItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | departments | [String]? | yes | | - | banners | [ImageUrls](#ImageUrls)? | yes | | - | action | [ProductListingAction](#ProductListingAction)? | yes | | - | logo | [Media](#Media)? | yes | | - | name | String? | yes | | - | uid | Int? | yes | | - | slug | String? | yes | | - | discount | String? | yes | | - ---- - - - - - #### [BrandListingResponse](#BrandListingResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | page | [Page](#Page) | no | | - | items | [[BrandItem](#BrandItem)]? | yes | | - ---- - - - - - #### [BrandDetailResponse](#BrandDetailResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | banners | [ImageUrls](#ImageUrls)? | yes | | - | logo | [Media](#Media)? | yes | | - | name | String? | yes | | - | uid | Int? | yes | | - ---- - - - - - #### [DepartmentIdentifier](#DepartmentIdentifier) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | slug | String? | yes | | - | uid | Int? | yes | | - ---- - - - - - #### [ThirdLevelChild](#ThirdLevelChild) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | banners | [ImageUrls](#ImageUrls)? | yes | | - | slug | String? | yes | | - | action | [ProductListingAction](#ProductListingAction)? | yes | | - | name | String? | yes | | - | uid | Int? | yes | | - | customJson | [String: Any]? | yes | | - | childs | [[String: Any]]? | yes | | - ---- - - - - - #### [SecondLevelChild](#SecondLevelChild) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | banners | [ImageUrls](#ImageUrls)? | yes | | - | slug | String? | yes | | - | action | [ProductListingAction](#ProductListingAction)? | yes | | - | name | String? | yes | | - | uid | Int? | yes | | - | customJson | [String: Any]? | yes | | - | childs | [[ThirdLevelChild](#ThirdLevelChild)]? | yes | | - ---- - - - - - #### [Child](#Child) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | banners | [ImageUrls](#ImageUrls)? | yes | | - | slug | String? | yes | | - | action | [ProductListingAction](#ProductListingAction)? | yes | | - | name | String? | yes | | - | uid | Int? | yes | | - | customJson | [String: Any]? | yes | | - | childs | [[SecondLevelChild](#SecondLevelChild)]? | yes | | - ---- - - - - - #### [CategoryItems](#CategoryItems) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | banners | [ImageUrls](#ImageUrls)? | yes | | - | slug | String? | yes | | - | action | [ProductListingAction](#ProductListingAction)? | yes | | - | name | String? | yes | | - | uid | Int? | yes | | - | childs | [[Child](#Child)]? | yes | | - ---- - - - - - #### [DepartmentCategoryTree](#DepartmentCategoryTree) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | department | String? | yes | | - | items | [[CategoryItems](#CategoryItems)]? | yes | | - ---- - - - - - #### [CategoryListingResponse](#CategoryListingResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | departments | [[DepartmentIdentifier](#DepartmentIdentifier)]? | yes | | - | data | [[DepartmentCategoryTree](#DepartmentCategoryTree)]? | yes | | - ---- - - - - - #### [CategoryMetaResponse](#CategoryMetaResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | banners | [ImageUrls](#ImageUrls)? | yes | | - | logo | [Media](#Media)? | yes | | - | name | String? | yes | | - | uid | Int? | yes | | - ---- - - - - - #### [HomeListingResponse](#HomeListingResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - | page | [Page](#Page) | no | | - | items | [[ProductListingDetail](#ProductListingDetail)]? | yes | | - ---- - - - - - #### [Department](#Department) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | slug | String? | yes | | - | priorityOrder | Int? | yes | | - | name | String? | yes | | - | uid | Int? | yes | | - | logo | [Media](#Media)? | yes | | - ---- - - - - - #### [DepartmentResponse](#DepartmentResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Department](#Department)]? | yes | | - ---- - - - - - #### [AutocompleteItem](#AutocompleteItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - | action | [ProductListingAction](#ProductListingAction)? | yes | | - | logo | [Media](#Media)? | yes | | - | type | String? | yes | | - ---- - - - - - #### [AutoCompleteResponse](#AutoCompleteResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[AutocompleteItem](#AutocompleteItem)]? | yes | | - ---- - - - - - #### [CollectionListingFilterTag](#CollectionListingFilterTag) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - | isSelected | Bool? | yes | | - | name | String? | yes | | - ---- - - - - - #### [CollectionListingFilterType](#CollectionListingFilterType) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - | isSelected | Bool? | yes | | - | name | String? | yes | | - ---- - - - - - #### [CollectionListingFilter](#CollectionListingFilter) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | tags | [[CollectionListingFilterTag](#CollectionListingFilterTag)]? | yes | | - | type | [[CollectionListingFilterType](#CollectionListingFilterType)]? | yes | | - ---- - - - - - #### [GetCollectionDetailNest](#GetCollectionDetailNest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | query | [String: Any]? | yes | | - | slug | String? | yes | | - | allowSort | Bool? | yes | | - | action | [ProductListingAction](#ProductListingAction)? | yes | | - | uid | String? | yes | | - | allowFacets | Bool? | yes | | - | appId | String? | yes | | - | schedule | [String: Any]? | yes | | - | banners | [ImageUrls](#ImageUrls)? | yes | | - | name | String? | yes | | - | badge | [String: Any]? | yes | | - | isActive | Bool? | yes | | - | tag | [String]? | yes | | - | cron | [String: Any]? | yes | | - | type | String? | yes | | - | visibleFacetsKeys | [String]? | yes | | - | description | String? | yes | | - | meta | [String: Any]? | yes | | - | logo | [Media](#Media)? | yes | | - ---- - - - - - #### [GetCollectionListingResponse](#GetCollectionListingResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | filters | [CollectionListingFilter](#CollectionListingFilter)? | yes | | - | page | [Page](#Page) | no | | - | items | [[GetCollectionDetailNest](#GetCollectionDetailNest)]? | yes | | - ---- - - - - - #### [CollectionDetailResponse](#CollectionDetailResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | tag | [String]? | yes | | - | schedule | [String: Any]? | yes | | - | banners | [ImageUrls](#ImageUrls)? | yes | | - | allowFacets | Bool? | yes | | - | query | [String: Any]? | yes | | - | slug | String? | yes | | - | description | String? | yes | | - | name | String? | yes | | - | cron | [String: Any]? | yes | | - | type | String? | yes | | - | allowSort | Bool? | yes | | - | visibleFacetsKeys | [String]? | yes | | - | badge | [String: Any]? | yes | | - | appId | String? | yes | | - | meta | [String: Any]? | yes | | - | isActive | Bool? | yes | | - | logo | [Media](#Media)? | yes | | - ---- - - - - - #### [GetFollowListingResponse](#GetFollowListingResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | page | [Page](#Page) | no | | - | items | [[ProductListingDetail](#ProductListingDetail)] | no | | - ---- - - - - - #### [FollowPostResponse](#FollowPostResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String | no | | - | id | String | no | | - ---- - - - - - #### [FollowerCountResponse](#FollowerCountResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | count | Int? | yes | | - ---- - - - - - #### [FollowIdsData](#FollowIdsData) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | collections | [Int]? | yes | | - | products | [Int]? | yes | | - | brands | [Int]? | yes | | - ---- - - - - - #### [FollowIdsResponse](#FollowIdsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | data | [FollowIdsData](#FollowIdsData)? | yes | | - ---- - - - - - #### [LatLong](#LatLong) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | coordinates | [Double]? | yes | | - | type | String? | yes | | - ---- - - - - - #### [Store1](#Store1) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | storeEmail | String? | yes | | - | city | String? | yes | | - | storeCode | String? | yes | | - | address | String? | yes | | - | pincode | Int? | yes | | - | latLong | [LatLong](#LatLong)? | yes | | - | name | String? | yes | | - | uid | Int? | yes | | - | country | String? | yes | | - | state | String? | yes | | - ---- - - - - - #### [StoreListingResponse](#StoreListingResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | page | [Page](#Page) | no | | - | items | [[Store1](#Store1)] | no | | - ---- - - - - - - - #### [PromiseFormatted](#PromiseFormatted) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | min | String? | yes | | - | max | String? | yes | | - ---- - - - - - #### [PromiseTimestamp](#PromiseTimestamp) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | min | Double? | yes | | - | max | Double? | yes | | - ---- - - - - - #### [ShipmentPromise](#ShipmentPromise) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | formatted | [PromiseFormatted](#PromiseFormatted)? | yes | | - | timestamp | [PromiseTimestamp](#PromiseTimestamp)? | yes | | - ---- - - - - - #### [RawBreakup](#RawBreakup) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | codCharge | Double? | yes | | - | subtotal | Double? | yes | | - | youSaved | Double? | yes | | - | vog | Double? | yes | | - | coupon | Double? | yes | | - | deliveryCharge | Double? | yes | | - | gstCharges | Double? | yes | | - | convenienceFee | Double? | yes | | - | fyndCash | Double? | yes | | - | mrpTotal | String? | yes | | - | discount | Double? | yes | | - | total | Double? | yes | | - ---- - - - - - #### [DisplayBreakup](#DisplayBreakup) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - | value | Double? | yes | | - | key | String? | yes | | - | currencySymbol | String? | yes | | - | currencyCode | String? | yes | | - | message | [String]? | yes | | - ---- - - - - - #### [CouponBreakup](#CouponBreakup) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isApplied | Bool? | yes | | - | uid | String? | yes | | - | type | String? | yes | | - | value | Double? | yes | | - | code | String? | yes | | - | message | String? | yes | | - ---- - - - - - #### [LoyaltyPoints](#LoyaltyPoints) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | isApplied | Bool? | yes | | - | applicable | Double? | yes | | - | total | Double? | yes | | - ---- - - - - - #### [CartBreakup](#CartBreakup) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | raw | [RawBreakup](#RawBreakup)? | yes | | - | display | [[DisplayBreakup](#DisplayBreakup)]? | yes | | - | coupon | [CouponBreakup](#CouponBreakup)? | yes | | - | loyaltyPoints | [LoyaltyPoints](#LoyaltyPoints)? | yes | | - ---- - - - - - #### [PaymentSelectionLock](#PaymentSelectionLock) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | paymentIdentifier | String? | yes | | - | defaultOptions | String? | yes | | - | enabled | Bool? | yes | | - ---- - - - - - #### [BasePrice](#BasePrice) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | effective | Double? | yes | | - | currencyCode | String? | yes | | - | currencySymbol | String? | yes | | - | marked | Double? | yes | | - ---- - - - - - #### [ArticlePriceInfo](#ArticlePriceInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | converted | [BasePrice](#BasePrice)? | yes | | - | base | [BasePrice](#BasePrice)? | yes | | - ---- - - - - - #### [BaseInfo](#BaseInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | uid | Int? | yes | | - ---- - - - - - #### [ProductArticle](#ProductArticle) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | extraMeta | [String: Any]? | yes | | - | uid | String? | yes | | - | type | String? | yes | | - | price | [ArticlePriceInfo](#ArticlePriceInfo)? | yes | | - | store | [BaseInfo](#BaseInfo)? | yes | | - | seller | [BaseInfo](#BaseInfo)? | yes | | - | size | String? | yes | | - | quantity | Int? | yes | | - ---- - - - - - #### [CartProductIdentifer](#CartProductIdentifer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | identifier | String? | yes | Article idenfier generated by cart | - ---- - - - - - #### [ProductAvailability](#ProductAvailability) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | otherStoreQuantity | Int? | yes | | - | outOfStock | Bool? | yes | | - | sizes | [String]? | yes | | - | isValid | Bool? | yes | | - | deliverable | Bool? | yes | | - ---- - - - - - #### [ActionQuery](#ActionQuery) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | productSlug | [String]? | yes | Contains list of product slug | - ---- - - - - - #### [ProductAction](#ProductAction) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | url | String? | yes | | - | query | [ActionQuery](#ActionQuery)? | yes | | - | type | String? | yes | | - ---- - - - - - #### [ProductImage](#ProductImage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | url | String? | yes | | - | aspectRatio | String? | yes | | - | secureUrl | String? | yes | | - ---- - - - - - #### [CategoryInfo](#CategoryInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | uid | Int? | yes | Product Category Id | - ---- - - - - - #### [CartProduct](#CartProduct) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | slug | String? | yes | Unique product url name generated via product name and other meta data | - | name | String? | yes | | - | action | [ProductAction](#ProductAction)? | yes | | - | uid | Int? | yes | | - | type | String? | yes | | - | images | [[ProductImage](#ProductImage)]? | yes | | - | categories | [[CategoryInfo](#CategoryInfo)]? | yes | | - | brand | [BaseInfo](#BaseInfo)? | yes | | - ---- - - - - - #### [ProductPrice](#ProductPrice) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | addOn | Double? | yes | | - | selling | Double? | yes | | - | marked | Double? | yes | | - | currencySymbol | String? | yes | | - | currencyCode | String? | yes | | - | effective | Double? | yes | | - ---- - - - - - #### [ProductPriceInfo](#ProductPriceInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | converted | [ProductPrice](#ProductPrice)? | yes | | - | base | [ProductPrice](#ProductPrice)? | yes | | - ---- - - - - - #### [PromoMeta](#PromoMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [CartProductInfo](#CartProductInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | article | [ProductArticle](#ProductArticle)? | yes | | - | identifiers | [CartProductIdentifer](#CartProductIdentifer) | no | | - | bulkOffer | [String: Any]? | yes | | - | availability | [ProductAvailability](#ProductAvailability)? | yes | | - | product | [CartProduct](#CartProduct)? | yes | | - | pricePerUnit | [ProductPriceInfo](#ProductPriceInfo)? | yes | | - | key | String? | yes | | - | price | [ProductPriceInfo](#ProductPriceInfo)? | yes | | - | couponMessage | String? | yes | | - | message | String? | yes | | - | promoMeta | [PromoMeta](#PromoMeta)? | yes | | - | isSet | Bool? | yes | | - | discount | String? | yes | | - | quantity | Int? | yes | | - ---- - - - - - #### [CartCurrency](#CartCurrency) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | symbol | String? | yes | | - | code | String? | yes | Currency code defined by ISO 4217:2015 | - ---- - - - - - #### [CartDetailResponse](#CartDetailResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | checkoutMode | String? | yes | | - | restrictCheckout | Bool? | yes | | - | lastModified | String? | yes | | - | deliveryPromise | [ShipmentPromise](#ShipmentPromise)? | yes | | - | couponText | String? | yes | | - | message | String? | yes | | - | breakupValues | [CartBreakup](#CartBreakup)? | yes | | - | gstin | String? | yes | | - | comment | String? | yes | | - | paymentSelectionLock | [PaymentSelectionLock](#PaymentSelectionLock)? | yes | | - | items | [[CartProductInfo](#CartProductInfo)]? | yes | | - | isValid | Bool? | yes | | - | deliveryChargeInfo | String? | yes | | - | currency | [CartCurrency](#CartCurrency)? | yes | | - ---- - - - - - #### [AddProductCart](#AddProductCart) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | sellerId | Int? | yes | | - | storeId | Int? | yes | | - | display | String? | yes | | - | extraMeta | [String: Any]? | yes | | - | itemId | Int? | yes | | - | itemSize | String? | yes | | - | pos | Bool? | yes | | - | articleId | String? | yes | | - | articleAssignment | [String: Any]? | yes | | - | quantity | Int? | yes | | - ---- - - - - - #### [AddCartRequest](#AddCartRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[AddProductCart](#AddProductCart)]? | yes | | - ---- - - - - - #### [AddCartDetailResponse](#AddCartDetailResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cart | [CartDetailResponse](#CartDetailResponse)? | yes | | - | partial | Bool? | yes | When adding multiple items check if all added. True if only few are added. | - | message | String? | yes | | - | success | Bool? | yes | True if all items are added successfully. False if partially added or not added. | - ---- - - - - - #### [UpdateProductCart](#UpdateProductCart) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | identifiers | [CartProductIdentifer](#CartProductIdentifer) | no | | - | extraMeta | [String: Any]? | yes | | - | itemId | Int? | yes | | - | itemSize | String? | yes | | - | articleId | String? | yes | | - | itemIndex | Int? | yes | | - | quantity | Int? | yes | | - ---- - - - - - #### [UpdateCartRequest](#UpdateCartRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[UpdateProductCart](#UpdateProductCart)]? | yes | | - | operation | String | no | | - ---- - - - - - #### [UpdateCartDetailResponse](#UpdateCartDetailResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cart | [CartDetailResponse](#CartDetailResponse)? | yes | | - | message | String? | yes | | - | success | Bool? | yes | True if all items are added successfully. False if partially added or not added. | - ---- - - - - - #### [CartItemCountResponse](#CartItemCountResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | userCartItemsCount | Int? | yes | Item count present in cart | - ---- - - - - - #### [Coupon](#Coupon) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | expiresOn | String? | yes | | - | couponValue | Double? | yes | | - | isApplied | Bool? | yes | | - | couponCode | String? | yes | | - | subTitle | String? | yes | | - | title | String? | yes | | - | message | String? | yes | | - | isApplicable | Bool? | yes | | - | maxDiscountValue | Double? | yes | | - | minimumCartValue | Double? | yes | | - ---- - - - - - #### [PageCoupon](#PageCoupon) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | current | Int? | yes | | - | hasPrevious | Bool? | yes | | - | totalItemCount | Int? | yes | | - | total | Int? | yes | | - | hasNext | Bool? | yes | | - ---- - - - - - #### [GetCouponResponse](#GetCouponResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | availableCouponList | [[Coupon](#Coupon)]? | yes | | - | page | [PageCoupon](#PageCoupon)? | yes | | - ---- - - - - - #### [ApplyCouponRequest](#ApplyCouponRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | couponCode | String | no | Coupon code to be applied | - ---- - - - - - #### [OfferSeller](#OfferSeller) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | uid | Int? | yes | Seller id | - ---- - - - - - #### [OfferPrice](#OfferPrice) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | marked | Int? | yes | Original price of product | - | bulkEffective | Double? | yes | Discounted per unit price for current offer object | - | currencySymbol | String? | yes | Currency symbol for currency | - | currencyCode | String? | yes | Currency code for all amounts | - | effective | Int? | yes | Current per unit price of product after existing deductions | - ---- - - - - - #### [OfferItem](#OfferItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | total | Double? | yes | Total price of offer quantity with discount | - | best | Bool? | yes | Is true for best offer from all offers present for all sellers | - | autoApplied | Bool? | yes | | - | type | String? | yes | Offer type | - | price | [OfferPrice](#OfferPrice)? | yes | | - | margin | Int? | yes | Percentage value of discount | - | quantity | Int? | yes | Quantity on which offer is applicable | - ---- - - - - - #### [BulkPriceOffer](#BulkPriceOffer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | seller | [OfferSeller](#OfferSeller)? | yes | | - | offers | [[OfferItem](#OfferItem)]? | yes | | - ---- - - - - - #### [BulkPriceResponse](#BulkPriceResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | data | [[BulkPriceOffer](#BulkPriceOffer)]? | yes | Consist of offers from multiple seller | - ---- - - - - - #### [RewardPointRequest](#RewardPointRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | points | Bool | no | | - ---- - - - - - #### [GeoLocation](#GeoLocation) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | longitude | Double? | yes | | - | latitude | Double? | yes | | - ---- - - - - - #### [Address](#Address) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | String? | yes | | - | id | String? | yes | | - | isDefaultAddress | Bool? | yes | | - | city | String? | yes | | - | areaCodeSlug | String? | yes | | - | area | String? | yes | | - | name | String? | yes | | - | geoLocation | [GeoLocation](#GeoLocation)? | yes | | - | areaCode | String? | yes | | - | userId | String? | yes | | - | countryCode | String? | yes | | - | addressType | String? | yes | | - | landmark | String? | yes | | - | state | String? | yes | | - | googleMapPoint | [String: Any]? | yes | | - | phone | String? | yes | | - | checkoutMode | String? | yes | | - | isActive | Bool? | yes | | - | country | String? | yes | | - | address | String? | yes | | - | meta | [String: Any]? | yes | | - | tags | [String]? | yes | | - ---- - - - - - #### [GetAddressesResponse](#GetAddressesResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | address | [[Address](#Address)]? | yes | | - ---- - - - - - #### [SaveAddressResponse](#SaveAddressResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | success | Bool? | yes | | - | isDefaultAddress | Bool? | yes | | - ---- - - - - - #### [UpdateAddressResponse](#UpdateAddressResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | success | Bool? | yes | | - | isDefaultAddress | Bool? | yes | | - | isUpdated | Bool? | yes | | - ---- - - - - - #### [DeleteAddressResponse](#DeleteAddressResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | isDeleted | Bool? | yes | | - ---- - - - - - #### [SelectCartAddressRequest](#SelectCartAddressRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | billingAddressId | String? | yes | | - | cartId | String? | yes | | - ---- - - - - - #### [UpdateCartPaymentRequest](#UpdateCartPaymentRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | paymentIdentifier | String? | yes | | - | addressId | String? | yes | | - | aggregatorName | String? | yes | | - | paymentMode | String? | yes | | - | id | String? | yes | | - | merchantCode | String? | yes | | - ---- - - - - - #### [CouponValidity](#CouponValidity) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | displayMessageEn | String? | yes | | - | code | String? | yes | | - | title | String? | yes | | - | discount | Double? | yes | | - | valid | Bool? | yes | | - ---- - - - - - #### [PaymentCouponValidate](#PaymentCouponValidate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | couponValidity | [CouponValidity](#CouponValidity)? | yes | | - | message | String? | yes | | - | success | Bool | no | | - ---- - - - - - #### [ShipmentResponse](#ShipmentResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | dpOptions | [String: Any]? | yes | | - | shipmentType | String? | yes | | - | fulfillmentId | Int? | yes | | - | promise | [ShipmentPromise](#ShipmentPromise)? | yes | | - | orderType | String? | yes | | - | dpId | Int? | yes | | - | shipments | Int? | yes | | - | boxType | String? | yes | | - | items | [[CartProductInfo](#CartProductInfo)]? | yes | | - | fulfillmentType | String? | yes | | - ---- - - - - - #### [CartShipmentsResponse](#CartShipmentsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uid | String? | yes | | - | id | String? | yes | | - | restrictCheckout | Bool? | yes | | - | breakupValues | [CartBreakup](#CartBreakup)? | yes | | - | paymentSelectionLock | [PaymentSelectionLock](#PaymentSelectionLock)? | yes | | - | isValid | Bool? | yes | | - | error | Bool? | yes | | - | shipments | [[ShipmentResponse](#ShipmentResponse)]? | yes | | - | currency | [CartCurrency](#CartCurrency)? | yes | | - | cartId | Int? | yes | | - | checkoutMode | String? | yes | | - | lastModified | String? | yes | | - | couponText | String? | yes | | - | message | String? | yes | | - | comment | String? | yes | | - | deliveryChargeInfo | String? | yes | | - | deliveryPromise | [ShipmentPromise](#ShipmentPromise)? | yes | | - | gstin | String? | yes | | - ---- - - - - - #### [StaffCheckout](#StaffCheckout) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | lastName | String | no | | - | firstName | String | no | | - | user | String | no | | - | id | String | no | | - ---- - - - - - #### [CartCheckoutDetailRequest](#CartCheckoutDetailRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | billingAddressId | String? | yes | | - | paymentAutoConfirm | Bool? | yes | | - | paymentIdentifier | String? | yes | | - | addressId | String? | yes | | - | deliveryAddress | [String: Any]? | yes | | - | orderingStore | Int? | yes | | - | paymentParams | [String: Any]? | yes | | - | paymentMode | String | no | | - | aggregator | String? | yes | | - | extraMeta | [String: Any]? | yes | | - | staff | [StaffCheckout](#StaffCheckout)? | yes | | - | merchantCode | String? | yes | | - | meta | [String: Any]? | yes | | - | fyndstoreEmpId | String? | yes | | - | callbackUrl | String? | yes | | - | billingAddress | [String: Any]? | yes | | - ---- - - - - - #### [CheckCart](#CheckCart) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | deliveryChargeOrderValue | Int? | yes | | - | uid | String? | yes | | - | id | String? | yes | | - | restrictCheckout | Bool? | yes | | - | userType | String? | yes | | - | codCharges | Int? | yes | | - | breakupValues | [CartBreakup](#CartBreakup)? | yes | | - | paymentSelectionLock | [PaymentSelectionLock](#PaymentSelectionLock)? | yes | | - | isValid | Bool? | yes | | - | storeEmps | [[String: Any]]? | yes | | - | orderId | String? | yes | | - | currency | [CartCurrency](#CartCurrency)? | yes | | - | cartId | Int? | yes | | - | codAvailable | Bool? | yes | | - | checkoutMode | String? | yes | | - | codMessage | String? | yes | | - | lastModified | String? | yes | | - | couponText | String? | yes | | - | message | String? | yes | | - | comment | String? | yes | | - | items | [[CartProductInfo](#CartProductInfo)]? | yes | | - | deliveryChargeInfo | String? | yes | | - | errorMessage | String? | yes | | - | deliveryPromise | [ShipmentPromise](#ShipmentPromise)? | yes | | - | deliveryCharges | Int? | yes | | - | storeCode | String? | yes | | - | gstin | String? | yes | | - | success | Bool? | yes | | - ---- - - - - - #### [CartCheckoutResponse](#CartCheckoutResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | orderId | String? | yes | | - | cart | [CheckCart](#CheckCart)? | yes | | - | message | String? | yes | | - | success | Bool? | yes | | - | callbackUrl | String? | yes | | - | data | [String: Any]? | yes | | - | appInterceptUrl | String? | yes | | - ---- - - - - - #### [CartMetaRequest](#CartMetaRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | checkoutMode | String? | yes | | - | pickUpCustomerDetails | [String: Any]? | yes | Customer contact details for customer pickup at store | - | comment | String? | yes | | - | gstin | String? | yes | | - ---- - - - - - #### [CartMetaResponse](#CartMetaResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [CartMetaMissingResponse](#CartMetaMissingResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | errors | [String]? | yes | | - ---- - - - - - #### [GetShareCartLinkRequest](#GetShareCartLinkRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | Cart uid for generating sharing | - | meta | [String: Any]? | yes | Staff, Ordering store or any other data. This data will be used to generate link as well as sent as shared details. | - | uid | Int | no | Cart uid for generating sharing | - ---- - - - - - #### [GetShareCartLinkResponse](#GetShareCartLinkResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | token | String? | yes | Short url unique id | - | shareUrl | String? | yes | Short shareable final url | - ---- - - - - - #### [SharedCartDetails](#SharedCartDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | token | String? | yes | Short link id | - | createdOn | String? | yes | | - | user | [String: Any]? | yes | User details of who generated share link | - | meta | [String: Any]? | yes | Meta data sent while generating share cart link | - | source | [String: Any]? | yes | Share link device and other source information | - ---- - - - - - #### [SharedCart](#SharedCart) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cartId | Int? | yes | | - | uid | String? | yes | | - | id | String? | yes | | - | checkoutMode | String? | yes | | - | restrictCheckout | Bool? | yes | | - | lastModified | String? | yes | | - | deliveryPromise | [ShipmentPromise](#ShipmentPromise)? | yes | | - | couponText | String? | yes | | - | message | String? | yes | | - | breakupValues | [CartBreakup](#CartBreakup)? | yes | | - | gstin | String? | yes | | - | comment | String? | yes | | - | paymentSelectionLock | [PaymentSelectionLock](#PaymentSelectionLock)? | yes | | - | items | [[CartProductInfo](#CartProductInfo)]? | yes | | - | isValid | Bool? | yes | | - | deliveryChargeInfo | String? | yes | | - | sharedCartDetails | [SharedCartDetails](#SharedCartDetails)? | yes | | - | currency | [CartCurrency](#CartCurrency)? | yes | | - ---- - - - - - #### [SharedCartResponse](#SharedCartResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cart | [SharedCart](#SharedCart)? | yes | | - | error | String? | yes | | - ---- - - - - - - - #### [LocationDefaultLanguage](#LocationDefaultLanguage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | code | String? | yes | | - ---- - - - - - #### [LocationDefaultCurrency](#LocationDefaultCurrency) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | symbol | String? | yes | | - | code | String? | yes | | - ---- - - - - - #### [LocationCountry](#LocationCountry) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | capital | String? | yes | | - | currency | String? | yes | | - | iso2 | String? | yes | | - | iso3 | String? | yes | | - | name | String? | yes | | - | parent | String? | yes | | - | phoneCode | String? | yes | | - | type | String? | yes | | - | uid | Int? | yes | | - | v | Int? | yes | | - | id | String? | yes | | - | defaultCurrency | [LocationDefaultCurrency](#LocationDefaultCurrency)? | yes | | - | defaultLanguage | [LocationDefaultLanguage](#LocationDefaultLanguage)? | yes | | - ---- - - - - - #### [Locations](#Locations) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[String: Any]]? | yes | | - ---- - - - - - - - #### [TicketList](#TicketList) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Ticket](#Ticket)]? | yes | List of tickets | - | filters | [Filter](#Filter)? | yes | All the filters available for tickets | - | page | [Page](#Page)? | yes | Describes the pagination state | - ---- - - - - - #### [Page](#Page) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | itemTotal | Int? | yes | | - | nextId | String? | yes | | - | hasPrevious | Bool? | yes | | - | hasNext | Bool? | yes | | - | current | Int? | yes | | - | type | String | no | | - | size | Int? | yes | | - ---- - - - - - #### [TicketHistoryList](#TicketHistoryList) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[TicketHistory](#TicketHistory)]? | yes | List of ticket history | - | page | [Page](#Page)? | yes | Describes the pagination state | - ---- - - - - - #### [CustomFormList](#CustomFormList) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[CustomForm](#CustomForm)]? | yes | List of forms | - | page | [Page](#Page)? | yes | Describes the pagination state | - ---- - - - - - #### [CreateCustomFormPayload](#CreateCustomFormPayload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | slug | String | no | Slug for the form | - | title | String | no | Title for the form | - | inputs | [[String: Any]] | no | List of all the form components | - | description | String? | yes | Description of the form | - | headerImage | String? | yes | Header image that is to be shown for the form | - | priority | [String: Any] | no | Describes the priority of the tickets created by the form | - | shouldNotify | Bool? | yes | Indicates if staff should be notified when a response is received | - | successMessage | String? | yes | Success message that will be shown on submission | - | pollForAssignment | [PollForAssignment](#PollForAssignment)? | yes | Describes how polling will be done for the tickets createds | - ---- - - - - - #### [EditCustomFormPayload](#EditCustomFormPayload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String | no | Title for the form | - | inputs | [[String: Any]] | no | List of all the form components | - | description | String? | yes | Description of the form | - | priority | [String: Any] | no | Describes the priority of the tickets created by the form | - | headerImage | String? | yes | Header image that is to be shown for the form | - | shouldNotify | Bool? | yes | Indicates if staff should be notified when a response is received | - | loginRequired | Bool? | yes | Denotes if login is required to make a form response submission | - | successMessage | String? | yes | Success message that will be shown on submission | - | pollForAssignment | [PollForAssignment](#PollForAssignment)? | yes | Describes how polling will be done for the tickets createds | - ---- - - - - - #### [EditTicketPayload](#EditTicketPayload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | content | [TicketContent](#TicketContent)? | yes | Ticket conetent details | - | category | String? | yes | Category assigned to the ticket | - | subCategory | String? | yes | Sub-category assigned to the ticket | - | source | String? | yes | Denotes if the ticket was created at company or application level | - | status | String? | yes | Denotes in what state is the ticket | - | priority | [String: Any]? | yes | Denotes the priority of ticket | - | assignedTo | [AgentChangePayload](#AgentChangePayload)? | yes | Details of support staff to whom ticket is assigned | - | tags | [String]? | yes | Tags relevant to ticket | - ---- - - - - - #### [AgentChangePayload](#AgentChangePayload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | agentId | String | no | Agent's unique ID | - ---- - - - - - #### [CreateVideoRoomResponse](#CreateVideoRoomResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uniqueName | String | no | Video Room's unique name | - ---- - - - - - #### [CloseVideoRoomResponse](#CloseVideoRoomResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Denotes if operation was successfully | - ---- - - - - - #### [CreateVideoRoomPayload](#CreateVideoRoomPayload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uniqueName | String | no | Ticket id | - | notify | [[NotifyUser](#NotifyUser)]? | yes | List of people to be notified | - ---- - - - - - #### [NotifyUser](#NotifyUser) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | countryCode | String | no | Country code | - | phoneNumber | String | no | Phone number | - ---- - - - - - #### [Filter](#Filter) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | priorities | [[Priority](#Priority)] | no | List of possible priorities for tickets | - | categories | [[TicketCategory](#TicketCategory)]? | yes | List of possible categories for tickets | - | statuses | [[Status](#Status)] | no | List of possible statuses for tickets | - | assignees | [[String: Any]] | no | List of support staff availble for tickets assignment | - ---- - - - - - #### [TicketHistoryPayload](#TicketHistoryPayload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | value | [String: Any] | no | Details of history event | - | type | [String: Any] | no | Type of history event | - ---- - - - - - #### [CustomFormSubmissionPayload](#CustomFormSubmissionPayload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | response | [[KeyValue](#KeyValue)] | no | Form response | - | attachments | [[TicketAsset](#TicketAsset)]? | yes | List of all attachments related to the form | - ---- - - - - - #### [KeyValue](#KeyValue) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String | no | Parameter for evaluating | - | value | [String: Any] | no | Response for the parameter | - ---- - - - - - #### [GetTokenForVideoRoomResponse](#GetTokenForVideoRoomResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | accessToken | String | no | Access token to be used for video room | - ---- - - - - - #### [GetParticipantsInsideVideoRoomResponse](#GetParticipantsInsideVideoRoomResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | participants | [[Participant](#Participant)] | no | List of participants of the video room | - ---- - - - - - #### [Participant](#Participant) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | user | [UserSchema](#UserSchema)? | yes | Details of participant | - | identity | String? | yes | Unique identifier of participant | - | status | String? | yes | Status of participant | - ---- - - - - - #### [PhoneNumber](#PhoneNumber) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool? | yes | Denotes if the phone number is active | - | primary | Bool? | yes | Denotes it's the primary phone number for the account | - | verified | Bool? | yes | Denotes it's a verified phone number | - | phone | String? | yes | Phone number | - | countryCode | Int? | yes | Country code | - ---- - - - - - #### [Email](#Email) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | primary | Bool? | yes | Denotes it's the primary email for the account | - | verified | Bool? | yes | Denotes it's a verified email | - | email | String? | yes | Email Address | - | active | Bool? | yes | Denotes if the email is active | - ---- - - - - - #### [Debug](#Debug) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | source | String? | yes | Source of user | - | platform | String? | yes | Platform of user | - ---- - - - - - #### [SubmitCustomFormResponse](#SubmitCustomFormResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | ticket | [Ticket](#Ticket) | no | Ticket created on form submission | - ---- - - - - - #### [TicketContext](#TicketContext) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | applicationId | String? | yes | Application ID related to the ticket | - | companyId | String | no | Company ID related to the ticket | - ---- - - - - - #### [CreatedOn](#CreatedOn) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | userAgent | String | no | Useragent details | - ---- - - - - - #### [TicketAsset](#TicketAsset) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | Display text for asset | - | value | String | no | To be used for details | - | type | [String: Any] | no | Type of asset | - ---- - - - - - #### [TicketContent](#TicketContent) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String | no | Title for ticket | - | description | String? | yes | Long description of issue | - | attachments | [[TicketAsset](#TicketAsset)]? | yes | List of all attachments related to the ticket | - ---- - - - - - #### [AddTicketPayload](#AddTicketPayload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdBy | [String: Any]? | yes | Creator of the ticket | - | status | String? | yes | Status of the ticket | - | priority | [String: Any]? | yes | Priority of the ticket | - | category | String | no | Category of the ticket | - | content | [TicketContent](#TicketContent) | no | Content for the ticket | - ---- - - - - - #### [Priority](#Priority) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | [PriorityEnum](#PriorityEnum) | no | Key for priority | - | display | String | no | Display text for priority | - | color | String | no | Color for priority | - ---- - - - - - #### [Status](#Status) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String | no | Key for status | - | display | String | no | Display text for status | - | color | String | no | Color for status | - ---- - - - - - #### [TicketCategory](#TicketCategory) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String | no | Key for category | - | display | String | no | Display text for category | - | form | [CustomForm](#CustomForm)? | yes | Form related to the category | - | subCategories | [[TicketSubCategory](#TicketSubCategory)]? | yes | Sub-category related to the category | - | feedbackForm | [TicketFeedbackForm](#TicketFeedbackForm)? | yes | Feedback form of category used to submit ticket feedback | - ---- - - - - - #### [TicketSubCategory](#TicketSubCategory) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String | no | Key for sub-category | - | display | String | no | Display text for sub-category | - ---- - - - - - #### [TicketFeedbackForm](#TicketFeedbackForm) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String | no | Feedback form title that will be shown to the user | - | display | [[String: Any]]? | yes | List of all the form fields | - ---- - - - - - #### [TicketFeedbackList](#TicketFeedbackList) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[TicketFeedback](#TicketFeedback)]? | yes | List of all ticket feedback for the ticket | - ---- - - - - - #### [TicketFeedbackPayload](#TicketFeedbackPayload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | formResponse | [String: Any]? | yes | Key-value pairs of all the form fields and their response | - ---- - - - - - #### [SubmitButton](#SubmitButton) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String | no | Title for submit button | - | titleColor | String | no | Title color submit button | - | backgroundColor | String | no | Color for submit button | - ---- - - - - - #### [PollForAssignment](#PollForAssignment) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | duration | Double | no | Duration for polling of staff | - | message | String | no | Message for polling | - | successMessage | String | no | Message for successful polling | - | failureMessage | String | no | Message if polling failed | - ---- - - - - - #### [CustomForm](#CustomForm) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | applicationId | String | no | Application ID for form | - | slug | String | no | Slug for the form, which is to be used for accessing the form | - | headerImage | String? | yes | Form header image that will be shown to the user | - | title | String | no | Form title that will be shown to the user | - | description | String? | yes | Form description that will be shown to the user | - | priority | [Priority](#Priority) | no | Sets priority of tickets created by form response | - | loginRequired | Bool | no | Denotes if login is required to make a form response submission | - | shouldNotify | Bool | no | Denotes if new response submission for the form should be notified to the assignees | - | successMessage | String? | yes | Message that is to be shown on succesfull form response submission | - | submitButton | [SubmitButton](#SubmitButton)? | yes | Details for submit button | - | inputs | [[String: Any]] | no | List of all the form fields | - | createdOn | [CreatedOn](#CreatedOn)? | yes | Gives details of when the form was created | - | createdBy | [String: Any]? | yes | Gives details of user who created the form | - | pollForAssignment | [PollForAssignment](#PollForAssignment)? | yes | Details of how polling should be done for support | - | id | String | no | Unique identifier for the form | - ---- - - - - - #### [FeedbackResponseItem](#FeedbackResponseItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String | no | Question/Title of the form field | - | key | String | no | Key of the form field | - | value | String | no | User response value for the form field | - ---- - - - - - #### [TicketFeedback](#TicketFeedback) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String | no | Unique identifier for the feedback | - | ticketId | String | no | Readable ticket number | - | companyId | String | no | Company id for which ticket was raised | - | response | [[FeedbackResponseItem](#FeedbackResponseItem)] | no | | - | category | String? | yes | Category of the ticket | - | user | [String: Any]? | yes | User who submitted the feedback | - | updatedAt | String? | yes | Time when the feedback was last updated | - | createdAt | String? | yes | Time when the feedback was created | - ---- - - - - - #### [TicketHistory](#TicketHistory) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String | no | Type of the history event | - | value | [String: Any] | no | Data of the history event | - | ticketId | String | no | Readable ticket number | - | createdOn | [CreatedOn](#CreatedOn)? | yes | Time of creation of the history event | - | createdBy | [String: Any]? | yes | User who created the history event | - | id | String | no | Unique identifier of the history event | - | updatedAt | String? | yes | Time of last update of the history event | - | createdAt | String? | yes | Time of creation of the history event | - ---- - - - - - #### [Ticket](#Ticket) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | context | [TicketContext](#TicketContext)? | yes | Details of company and application realated to the ticket | - | createdOn | [CreatedOn](#CreatedOn)? | yes | Details of company and application realated to the ticket | - | responseId | String? | yes | Details of company and application realated to the ticket | - | content | [TicketContent](#TicketContent)? | yes | Ticket conetent details | - | ticketId | String | no | Readable ticket number | - | category | [TicketCategory](#TicketCategory) | no | Category assigned to the ticket | - | subCategory | [TicketSubCategory](#TicketSubCategory)? | yes | Sub-category assigned to the ticket | - | source | [String: Any] | no | Denotes if the ticket was created at company or application level | - | status | [Status](#Status) | no | Denotes in what state is the ticket | - | priority | [Priority](#Priority) | no | Denotes the priority of ticket | - | createdBy | [String: Any]? | yes | User details of ticket creator | - | assignedTo | [String: Any]? | yes | Details of support staff to whom ticket is assigned | - | tags | [String]? | yes | Tags relevant to ticket | - | customJson | [String: Any]? | yes | custom json relevant to the ticket | - | isFeedbackPending | Bool? | yes | Denotes if feedback submission is pending for the ticket | - | id | String | no | Unique identifier for the ticket | - | updatedAt | String? | yes | Time when the ticket was last updated | - | createdAt | String? | yes | Time when the ticket was created | - ---- - - - - - - - #### [AvailablePageSchema](#AvailablePageSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | value | String? | yes | | - | text | String? | yes | | - | path | String? | yes | | - | type | String? | yes | | - | sections | [[AvailablePageSchemaSections](#AvailablePageSchemaSections)]? | yes | | - | sectionsMeta | [[AvailablePageSectionMetaAttributes](#AvailablePageSectionMetaAttributes)]? | yes | | - | theme | String? | yes | | - | seo | [AvailablePageSeo](#AvailablePageSeo)? | yes | | - | props | [[String: Any]]? | yes | | - | id | String? | yes | | - ---- - - - - - #### [AvailablePageSectionMetaAttributes](#AvailablePageSectionMetaAttributes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | attributes | [String: Any]? | yes | | - ---- - - - - - #### [AvailablePageSeo](#AvailablePageSeo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | description | String? | yes | | - | id | String? | yes | | - ---- - - - - - #### [AvailablePageSchemaSections](#AvailablePageSchemaSections) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | label | String? | yes | | - | props | [String: Any]? | yes | | - | blocks | [[String: Any]]? | yes | | - | preset | [String: Any]? | yes | | - | predicate | [AvailablePagePredicate](#AvailablePagePredicate)? | yes | | - ---- - - - - - #### [AvailablePageScreenPredicate](#AvailablePageScreenPredicate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | mobile | Bool? | yes | | - | desktop | Bool? | yes | | - | tablet | Bool? | yes | | - ---- - - - - - #### [AvailablePageUserPredicate](#AvailablePageUserPredicate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | authenticated | Bool? | yes | | - | anonymous | Bool? | yes | | - ---- - - - - - #### [AvailablePageRoutePredicate](#AvailablePageRoutePredicate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | selected | String? | yes | | - | exactUrl | String? | yes | | - | query | [String: Any]? | yes | | - ---- - - - - - #### [AvailablePagePredicate](#AvailablePagePredicate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | screen | [AvailablePageScreenPredicate](#AvailablePageScreenPredicate)? | yes | | - | user | [AvailablePageUserPredicate](#AvailablePageUserPredicate)? | yes | | - | route | [AvailablePageRoutePredicate](#AvailablePageRoutePredicate)? | yes | | - ---- - - - - - #### [AllAvailablePageSchema](#AllAvailablePageSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pages | [[AvailablePageSchema](#AvailablePageSchema)]? | yes | | - ---- - - - - - #### [PaginationSchema](#PaginationSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | size | Int? | yes | | - | itemTotal | Int? | yes | | - | hasNext | Bool? | yes | | - | type | String? | yes | | - | current | Int? | yes | | - ---- - - - - - #### [ThemesListingResponseSchema](#ThemesListingResponseSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[ThemesSchema](#ThemesSchema)]? | yes | | - | page | [PaginationSchema](#PaginationSchema)? | yes | | - ---- - - - - - #### [AddThemeRequestSchema](#AddThemeRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | themeId | String? | yes | | - ---- - - - - - #### [UpgradableThemeSchema](#UpgradableThemeSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | parentTheme | String? | yes | | - | appliedTheme | String? | yes | | - | upgrade | Bool? | yes | | - ---- - - - - - #### [FontsSchema](#FontsSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [FontsSchemaItems](#FontsSchemaItems)? | yes | | - | kind | String? | yes | | - ---- - - - - - #### [BlitzkriegApiErrorSchema](#BlitzkriegApiErrorSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [BlitzkriegNotFoundSchema](#BlitzkriegNotFoundSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [BlitzkriegInternalServerErrorSchema](#BlitzkriegInternalServerErrorSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [FontsSchemaItems](#FontsSchemaItems) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | family | String? | yes | | - | variants | [String]? | yes | | - | subsets | [String]? | yes | | - | version | String? | yes | | - | lastModified | String? | yes | | - | files | [FontsSchemaItemsFiles](#FontsSchemaItemsFiles)? | yes | | - | category | String? | yes | | - | kind | String? | yes | | - ---- - - - - - #### [FontsSchemaItemsFiles](#FontsSchemaItemsFiles) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | regular | String? | yes | | - | italic | String? | yes | | - | bold | String? | yes | | - ---- - - - - - #### [ThemesSchema](#ThemesSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | application | String? | yes | | - | applied | Bool? | yes | | - | customized | Bool? | yes | | - | published | Bool? | yes | | - | archived | Bool? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | version | String? | yes | | - | parentThemeVersion | String? | yes | | - | parentTheme | String? | yes | | - | information | [Information](#Information)? | yes | | - | tags | [String]? | yes | | - | src | [Src](#Src)? | yes | | - | assets | [AssetsSchema](#AssetsSchema)? | yes | | - | availableSections | [[availableSectionSchema](#availableSectionSchema)]? | yes | | - | constants | [String: Any]? | yes | | - | styles | [String: Any]? | yes | | - | config | [Config](#Config)? | yes | | - | settings | [String: Any]? | yes | | - | font | [Font](#Font)? | yes | | - | id | String? | yes | | - | v | Int? | yes | | - | colors | [Colors](#Colors)? | yes | | - ---- - - - - - #### [availableSectionSchema](#availableSectionSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | blocks | [[Blocks](#Blocks)]? | yes | | - | name | String? | yes | | - | label | String? | yes | | - | props | [[BlocksProps](#BlocksProps)]? | yes | | - ---- - - - - - #### [Information](#Information) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | images | [Images](#Images)? | yes | | - | features | [String]? | yes | | - | name | String? | yes | | - | description | String? | yes | | - ---- - - - - - #### [Images](#Images) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | desktop | [String]? | yes | | - | android | [String]? | yes | | - | ios | [String]? | yes | | - | thumbnail | [String]? | yes | | - ---- - - - - - #### [Src](#Src) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | link | String? | yes | | - ---- - - - - - #### [AssetsSchema](#AssetsSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | umdJs | [UmdJs](#UmdJs)? | yes | | - | commonJs | [CommonJs](#CommonJs)? | yes | | - | css | [Css](#Css)? | yes | | - ---- - - - - - #### [UmdJs](#UmdJs) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | link | String? | yes | | - ---- - - - - - #### [CommonJs](#CommonJs) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | link | String? | yes | | - ---- - - - - - #### [Css](#Css) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | link | String? | yes | | - ---- - - - - - #### [Seo](#Seo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | description | String? | yes | | - ---- - - - - - #### [Sections](#Sections) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | attributes | String? | yes | | - ---- - - - - - #### [Config](#Config) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | preset | [Preset](#Preset)? | yes | | - | globalSchema | [GlobalSchema](#GlobalSchema)? | yes | | - | current | String? | yes | | - | list | [[ListSchemaItem](#ListSchemaItem)]? | yes | | - ---- - - - - - #### [Preset](#Preset) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pages | [[AvailablePageSchema](#AvailablePageSchema)]? | yes | | - ---- - - - - - #### [GlobalSchema](#GlobalSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | props | [[GlobalSchemaProps](#GlobalSchemaProps)]? | yes | | - ---- - - - - - #### [ListSchemaItem](#ListSchemaItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | global | [String: Any]? | yes | | - | page | [[ConfigPage](#ConfigPage)]? | yes | | - | name | String? | yes | | - ---- - - - - - #### [Colors](#Colors) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | bgColor | String? | yes | | - | primaryColor | String? | yes | | - | secondaryColor | String? | yes | | - | accentColor | String? | yes | | - | linkColor | String? | yes | | - | buttonSecondaryColor | String? | yes | | - ---- - - - - - #### [Custom](#Custom) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | props | [String: Any]? | yes | | - ---- - - - - - #### [ConfigPage](#ConfigPage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | settings | [String: Any]? | yes | | - | page | String? | yes | | - ---- - - - - - #### [Font](#Font) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | family | String? | yes | | - | variants | [Variants](#Variants)? | yes | | - ---- - - - - - #### [Variants](#Variants) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | medium | [Medium](#Medium)? | yes | | - | semiBold | [SemiBold](#SemiBold)? | yes | | - | bold | [Bold](#Bold)? | yes | | - | light | [Light](#Light)? | yes | | - | regular | [Regular](#Regular)? | yes | | - ---- - - - - - #### [Medium](#Medium) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | file | String? | yes | | - ---- - - - - - #### [SemiBold](#SemiBold) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | file | String? | yes | | - ---- - - - - - #### [Bold](#Bold) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | file | String? | yes | | - ---- - - - - - #### [Light](#Light) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | file | String? | yes | | - ---- - - - - - #### [Regular](#Regular) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | file | String? | yes | | - ---- - - - - - #### [Blocks](#Blocks) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | name | String? | yes | | - | props | [[BlocksProps](#BlocksProps)]? | yes | | - ---- - - - - - #### [GlobalSchemaProps](#GlobalSchemaProps) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | label | String? | yes | | - | type | String? | yes | | - | category | String? | yes | | - ---- - - - - - #### [BlocksProps](#BlocksProps) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | label | String? | yes | | - | type | String? | yes | | - ---- - - - - - - - #### [EditEmailRequestSchema](#EditEmailRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | String? | yes | | - ---- - - - - - #### [SendVerificationLinkMobileRequestSchema](#SendVerificationLinkMobileRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | verified | Bool? | yes | | - | active | Bool? | yes | | - | countryCode | String? | yes | | - | phone | String? | yes | | - | primary | Bool? | yes | | - ---- - - - - - #### [EditMobileRequestSchema](#EditMobileRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | countryCode | String? | yes | | - | phone | String? | yes | | - ---- - - - - - #### [EditProfileRequestSchema](#EditProfileRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | firstName | String? | yes | | - | lastName | String? | yes | | - | mobile | [EditProfileMobileSchema](#EditProfileMobileSchema)? | yes | | - | countryCode | String? | yes | | - | email | String? | yes | | - | gender | String? | yes | | - | dob | String? | yes | | - | profilePicUrl | String? | yes | | - | androidHash | String? | yes | | - | sender | String? | yes | | - | registerToken | String? | yes | | - ---- - - - - - #### [EditProfileMobileSchema](#EditProfileMobileSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | phone | String? | yes | | - | countryCode | String? | yes | | - ---- - - - - - #### [SendEmailOtpRequestSchema](#SendEmailOtpRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | String? | yes | | - | action | String? | yes | | - | token | String? | yes | | - | registerToken | String? | yes | | - ---- - - - - - #### [VerifyEmailOtpRequestSchema](#VerifyEmailOtpRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | String? | yes | | - | action | String? | yes | | - | registerToken | String? | yes | | - | otp | String? | yes | | - ---- - - - - - #### [VerifyOtpRequestSchema](#VerifyOtpRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | requestId | String? | yes | | - | registerToken | String? | yes | | - | otp | String? | yes | | - ---- - - - - - #### [SendMobileOtpRequestSchema](#SendMobileOtpRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | mobile | String? | yes | | - | countryCode | String? | yes | | - | action | String? | yes | | - | token | String? | yes | | - | androidHash | String? | yes | | - | force | String? | yes | | - | captchaCode | String? | yes | | - ---- - - - - - #### [UpdatePasswordRequestSchema](#UpdatePasswordRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | oldPassword | String? | yes | | - | newPassword | String? | yes | | - ---- - - - - - #### [FormRegisterRequestSchema](#FormRegisterRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | firstName | String? | yes | | - | lastName | String? | yes | | - | gender | String? | yes | | - | email | String? | yes | | - | password | String? | yes | | - | phone | [FormRegisterRequestSchemaPhone](#FormRegisterRequestSchemaPhone)? | yes | | - | registerToken | String? | yes | | - ---- - - - - - #### [TokenRequestBodySchema](#TokenRequestBodySchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | token | String? | yes | | - ---- - - - - - #### [ForgotPasswordRequestSchema](#ForgotPasswordRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | code | String? | yes | | - | password | String? | yes | | - ---- - - - - - #### [CodeRequestBodySchema](#CodeRequestBodySchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | code | String? | yes | | - ---- - - - - - #### [SendResetPasswordEmailRequestSchema](#SendResetPasswordEmailRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | String? | yes | | - | captchaCode | String? | yes | | - ---- - - - - - #### [PasswordLoginRequestSchema](#PasswordLoginRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | captchaCode | String? | yes | | - | password | String? | yes | | - | username | String? | yes | | - ---- - - - - - #### [SendOtpRequestSchema](#SendOtpRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | countryCode | String? | yes | | - | captchaCode | String? | yes | | - | mobile | String? | yes | | - ---- - - - - - #### [OAuthRequestSchema](#OAuthRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isSignedIn | Bool? | yes | | - | oauth2 | [OAuthRequestSchemaOauth2](#OAuthRequestSchemaOauth2)? | yes | | - | profile | [OAuthRequestSchemaProfile](#OAuthRequestSchemaProfile)? | yes | | - ---- - - - - - #### [UserObjectSchema](#UserObjectSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | user | [UserSchema](#UserSchema)? | yes | | - ---- - - - - - #### [AuthSuccess](#AuthSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | registerToken | String? | yes | | - | userExists | Bool? | yes | | - | user | [UserSchema](#UserSchema)? | yes | | - ---- - - - - - #### [SendOtpResponse](#SendOtpResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | resendTimer | Int? | yes | | - | resendToken | String? | yes | | - | success | Bool? | yes | | - | requestId | String? | yes | | - | message | String? | yes | | - | mobile | String? | yes | | - | countryCode | String? | yes | | - | email | String? | yes | | - | resendEmailToken | String? | yes | | - | registerToken | String? | yes | | - | verifyEmailOtp | Bool? | yes | | - | verifyMobileOtp | Bool? | yes | | - | userExists | Bool? | yes | | - ---- - - - - - #### [ProfileEditSuccess](#ProfileEditSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | user | [UserSchema](#UserSchema)? | yes | | - | registerToken | String? | yes | | - | userExists | Bool? | yes | | - | verifyEmailLink | Bool? | yes | | - | verifyEmailOtp | Bool? | yes | | - | verifyMobileOtp | Bool? | yes | | - | email | String? | yes | | - ---- - - - - - #### [LoginSuccess](#LoginSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | user | [UserSchema](#UserSchema)? | yes | | - | requestId | String? | yes | | - | registerToken | String? | yes | | - ---- - - - - - #### [VerifyOtpSuccess](#VerifyOtpSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | user | [UserSchema](#UserSchema)? | yes | | - | userExists | Bool? | yes | | - | registerToken | String? | yes | | - ---- - - - - - #### [ResetPasswordSuccess](#ResetPasswordSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | status | String? | yes | | - ---- - - - - - #### [RegisterFormSuccess](#RegisterFormSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | String? | yes | | - | resendTimer | Int? | yes | | - | resendToken | String? | yes | | - | resendEmailToken | String? | yes | | - | registerToken | String? | yes | | - | success | Bool? | yes | | - | requestId | String? | yes | | - | message | String? | yes | | - | mobile | String? | yes | | - | countryCode | String? | yes | | - | verifyEmailOtp | Bool? | yes | | - | verifyMobileOtp | Bool? | yes | | - | userExists | Bool? | yes | | - ---- - - - - - #### [VerifyEmailSuccess](#VerifyEmailSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [HasPasswordSuccess](#HasPasswordSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | result | Bool? | yes | | - ---- - - - - - #### [LogoutSuccess](#LogoutSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | logout | Bool? | yes | | - ---- - - - - - #### [OtpSuccess](#OtpSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | resendTimer | Int? | yes | | - | resendToken | String? | yes | | - | registerToken | String? | yes | | - | success | Bool? | yes | | - | requestId | String? | yes | | - | message | String? | yes | | - | mobile | String? | yes | | - | countryCode | String? | yes | | - ---- - - - - - #### [EmailOtpSuccess](#EmailOtpSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool? | yes | | - ---- - - - - - #### [SessionListSuccess](#SessionListSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | sessions | [String]? | yes | | - ---- - - - - - #### [VerifyMobileOTPSuccess](#VerifyMobileOTPSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | user | [UserSchema](#UserSchema)? | yes | | - | verifyMobileLink | Bool? | yes | | - ---- - - - - - #### [VerifyEmailOTPSuccess](#VerifyEmailOTPSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | user | [UserSchema](#UserSchema)? | yes | | - | verifyEmailLink | Bool? | yes | | - ---- - - - - - #### [SendMobileVerifyLinkSuccess](#SendMobileVerifyLinkSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | verifyMobileLink | Bool? | yes | | - ---- - - - - - #### [SendEmailVerifyLinkSuccess](#SendEmailVerifyLinkSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | verifyEmailLink | Bool? | yes | | - ---- - - - - - #### [UserSearchResponseSchema](#UserSearchResponseSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | users | [[UserSchema](#UserSchema)]? | yes | | - ---- - - - - - #### [CustomerListResponseSchema](#CustomerListResponseSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[UserSchema](#UserSchema)]? | yes | | - | page | [PaginationSchema](#PaginationSchema)? | yes | | - ---- - - - - - #### [UnauthorizedSchema](#UnauthorizedSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [UnauthenticatedSchema](#UnauthenticatedSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | authenticated | Bool? | yes | | - ---- - - - - - #### [NotFoundSchema](#NotFoundSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [AuthenticationInternalServerErrorSchema](#AuthenticationInternalServerErrorSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [AuthenticationApiErrorSchema](#AuthenticationApiErrorSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [ProfileEditSuccessSchema](#ProfileEditSuccessSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | String? | yes | | - | verifyEmailOtp | Bool? | yes | | - | verifyEmailLink | Bool? | yes | | - | verifyMobileOtp | Bool? | yes | | - | user | String? | yes | | - | registerToken | String? | yes | | - | userExists | Bool? | yes | | - ---- - - - - - #### [FormRegisterRequestSchemaPhone](#FormRegisterRequestSchemaPhone) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | countryCode | String? | yes | | - | mobile | String? | yes | | - ---- - - - - - #### [OAuthRequestSchemaOauth2](#OAuthRequestSchemaOauth2) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | accessToken | String? | yes | | - | expiry | Int? | yes | | - | refreshToken | String? | yes | | - ---- - - - - - #### [OAuthRequestSchemaProfile](#OAuthRequestSchemaProfile) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | lastName | String? | yes | | - | image | String? | yes | | - | id | String? | yes | | - | email | String? | yes | | - | fullName | String? | yes | | - | firstName | String? | yes | | - ---- - - - - - #### [AuthSuccessUser](#AuthSuccessUser) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | firstName | String? | yes | | - | lastName | String? | yes | | - | debug | [AuthSuccessUserDebug](#AuthSuccessUserDebug)? | yes | | - | active | Bool? | yes | | - | emails | [AuthSuccessUserEmails](#AuthSuccessUserEmails)? | yes | | - ---- - - - - - #### [AuthSuccessUserDebug](#AuthSuccessUserDebug) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | platform | String? | yes | | - ---- - - - - - #### [AuthSuccessUserEmails](#AuthSuccessUserEmails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | String? | yes | | - | verified | Bool? | yes | | - | primary | Bool? | yes | | - | active | Bool? | yes | | - ---- - - - - - #### [CreateUserRequestSchema](#CreateUserRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | phoneNumber | String | no | | - | email | String? | yes | | - | firstName | String? | yes | | - | lastName | String? | yes | | - | gender | String? | yes | | - | username | String | no | | - | meta | [String: Any]? | yes | | - ---- - - - - - #### [CreateUserResponseSchema](#CreateUserResponseSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | user | [UserSchema](#UserSchema)? | yes | | - ---- - - - - - #### [CreateUserSessionRequestSchema](#CreateUserSessionRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | domain | String? | yes | | - | maxAge | Double? | yes | | - | userId | String? | yes | | - ---- - - - - - #### [CreateUserSessionResponseSchema](#CreateUserSessionResponseSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | domain | String? | yes | | - | maxAge | Double? | yes | | - | secure | Bool? | yes | | - | httpOnly | Bool? | yes | | - | cookie | [String: Any]? | yes | | - ---- - - - - - #### [PlatformSchema](#PlatformSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - | lookAndFeel | [LookAndFeel](#LookAndFeel)? | yes | | - | updatedAt | String? | yes | | - | active | Bool? | yes | | - | forgotPassword | Bool? | yes | | - | login | [Login](#Login)? | yes | | - | skipCaptcha | Bool? | yes | | - | name | String? | yes | | - | meta | [MetaSchema](#MetaSchema)? | yes | | - | id | String? | yes | | - | social | [Social](#Social)? | yes | | - | requiredFields | [RequiredFields](#RequiredFields)? | yes | | - | registerRequiredFields | [RegisterRequiredFields](#RegisterRequiredFields)? | yes | | - | skipLogin | Bool? | yes | | - | flashCard | [FlashCard](#FlashCard)? | yes | | - | subtext | String? | yes | | - | socialTokens | [SocialTokens](#SocialTokens)? | yes | | - | createdAt | String? | yes | | - | register | Bool? | yes | | - | mobileImage | String? | yes | | - | desktopImage | String? | yes | | - ---- - - - - - #### [LookAndFeel](#LookAndFeel) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cardPosition | String? | yes | | - | backgroundColor | String? | yes | | - ---- - - - - - #### [Login](#Login) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | password | Bool? | yes | | - | otp | Bool? | yes | | - ---- - - - - - #### [MetaSchema](#MetaSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | fyndDefault | Bool? | yes | | - ---- - - - - - #### [Social](#Social) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | accountKit | Bool? | yes | | - | facebook | Bool? | yes | | - | google | Bool? | yes | | - ---- - - - - - #### [RequiredFields](#RequiredFields) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | [PlatformEmail](#PlatformEmail)? | yes | | - | mobile | [PlatformMobile](#PlatformMobile)? | yes | | - ---- - - - - - #### [PlatformEmail](#PlatformEmail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isRequired | Bool? | yes | | - | level | String? | yes | | - ---- - - - - - #### [PlatformMobile](#PlatformMobile) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isRequired | Bool? | yes | | - | level | String? | yes | | - ---- - - - - - #### [RegisterRequiredFields](#RegisterRequiredFields) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | [RegisterRequiredFieldsEmail](#RegisterRequiredFieldsEmail)? | yes | | - | mobile | [RegisterRequiredFieldsMobile](#RegisterRequiredFieldsMobile)? | yes | | - ---- - - - - - #### [RegisterRequiredFieldsEmail](#RegisterRequiredFieldsEmail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isRequired | Bool? | yes | | - | level | String? | yes | | - ---- - - - - - #### [RegisterRequiredFieldsMobile](#RegisterRequiredFieldsMobile) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isRequired | Bool? | yes | | - | level | String? | yes | | - ---- - - - - - #### [FlashCard](#FlashCard) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | text | String? | yes | | - | textColor | String? | yes | | - | backgroundColor | String? | yes | | - ---- - - - - - #### [SocialTokens](#SocialTokens) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | facebook | [Facebook](#Facebook)? | yes | | - | accountKit | [Accountkit](#Accountkit)? | yes | | - | google | [Google](#Google)? | yes | | - ---- - - - - - #### [Facebook](#Facebook) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | appId | String? | yes | | - ---- - - - - - #### [Accountkit](#Accountkit) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | appId | String? | yes | | - ---- - - - - - #### [Google](#Google) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | appId | String? | yes | | - ---- - - - - - #### [UpdateUserRequestSchema](#UpdateUserRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | firstName | String? | yes | | - | lastName | String? | yes | | - | gender | String? | yes | | - | meta | [String: Any]? | yes | | - ---- - - - - - #### [UserSchema](#UserSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | firstName | String? | yes | | - | meta | [String: Any]? | yes | | - | lastName | String? | yes | | - | phoneNumbers | [[PhoneNumber](#PhoneNumber)]? | yes | | - | emails | [[Email](#Email)]? | yes | | - | gender | String? | yes | | - | dob | String? | yes | | - | active | Bool? | yes | | - | profilePicUrl | String? | yes | | - | username | String? | yes | | - | accountType | String? | yes | | - | uid | String? | yes | | - | debug | [Debug](#Debug)? | yes | | - | hasOldPasswordHash | Bool? | yes | | - | id | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - ---- - - - - - - - #### [ApplicationLegal](#ApplicationLegal) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | application | String? | yes | | - | tnc | String? | yes | | - | policy | String? | yes | | - | shipping | String? | yes | | - | faq | [[ApplicationLegalFAQ](#ApplicationLegalFAQ)]? | yes | | - | id | String? | yes | | - | updatedAt | String? | yes | | - | createdAt | String? | yes | | - ---- - - - - - #### [ApplicationLegalFAQ](#ApplicationLegalFAQ) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | question | String? | yes | | - | answer | String? | yes | | - ---- - - - - - #### [SeoComponent](#SeoComponent) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | seo | [SeoSchema](#SeoSchema)? | yes | | - ---- - - - - - #### [SeoSchema](#SeoSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | app | String? | yes | | - | id | String? | yes | | - | robotsTxt | String? | yes | | - | sitemapEnabled | Bool? | yes | | - | customMetaTags | [[CustomMetaTag](#CustomMetaTag)]? | yes | | - | details | [Detail](#Detail)? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - ---- - - - - - #### [CustomMetaTag](#CustomMetaTag) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | content | String? | yes | | - | id | String? | yes | | - ---- - - - - - #### [Detail](#Detail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | description | String? | yes | | - ---- - - - - - #### [AnnouncementPageSchema](#AnnouncementPageSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pageSlug | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [EditorMeta](#EditorMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | foregroundColor | String? | yes | | - | backgroundColor | String? | yes | | - | contentType | String? | yes | | - | content | String? | yes | | - ---- - - - - - #### [AnnouncementAuthorSchema](#AnnouncementAuthorSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdBy | String? | yes | | - | modifiedBy | String? | yes | | - ---- - - - - - #### [AdminAnnouncementSchema](#AdminAnnouncementSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | platforms | [String]? | yes | | - | title | String? | yes | | - | announcement | String? | yes | | - | pages | [[AnnouncementPageSchema](#AnnouncementPageSchema)]? | yes | | - | editorMeta | [EditorMeta](#EditorMeta)? | yes | | - | author | [AnnouncementAuthorSchema](#AnnouncementAuthorSchema)? | yes | | - | createdAt | String? | yes | | - | app | String? | yes | | - | modifiedAt | String? | yes | | - | schedule | [ScheduleSchema](#ScheduleSchema)? | yes | | - ---- - - - - - #### [ScheduleSchema](#ScheduleSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cron | String? | yes | | - | start | String? | yes | | - | end | String? | yes | | - | duration | Double? | yes | | - | nextSchedule | [[NextSchedule](#NextSchedule)]? | yes | | - ---- - - - - - #### [NextSchedule](#NextSchedule) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | start | String? | yes | | - | end | String? | yes | | - ---- - - - - - #### [AnnouncementSchema](#AnnouncementSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | announcement | String? | yes | | - | schedule | [ScheduleStartSchema](#ScheduleStartSchema)? | yes | | - ---- - - - - - #### [ScheduleStartSchema](#ScheduleStartSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | start | String? | yes | | - | end | String? | yes | | - ---- - - - - - #### [BlogGetResponse](#BlogGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[BlogSchema](#BlogSchema)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [ResourceContent](#ResourceContent) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | value | String? | yes | | - ---- - - - - - #### [Asset](#Asset) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | aspectRatio | String? | yes | | - | id | String? | yes | | - | secureUrl | String? | yes | | - ---- - - - - - #### [Author](#Author) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | designation | String? | yes | | - | id | String? | yes | | - | name | String? | yes | | - ---- - - - - - #### [BlogSchema](#BlogSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | customJson | [String: Any]? | yes | | - | application | String? | yes | | - | archived | Bool? | yes | | - | author | [Author](#Author)? | yes | | - | content | [[ResourceContent](#ResourceContent)]? | yes | | - | featureImage | [Asset](#Asset)? | yes | | - | published | Bool? | yes | | - | readingTime | String? | yes | | - | slug | String? | yes | | - | tags | [String]? | yes | | - | seo | [SEO](#SEO)? | yes | | - | schedule | [CronSchedule](#CronSchedule)? | yes | | - | title | String? | yes | | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - ---- - - - - - #### [SEO](#SEO) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | image | [SEOImage](#SEOImage)? | yes | | - | title | String? | yes | | - ---- - - - - - #### [SEOImage](#SEOImage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | url | String? | yes | | - ---- - - - - - #### [DateMeta](#DateMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdOn | String? | yes | | - | modifiedOn | String? | yes | | - ---- - - - - - #### [BlogRequest](#BlogRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | application | String? | yes | | - | customJson | [String: Any]? | yes | | - | author | [Author](#Author)? | yes | | - | content | [[ResourceContent](#ResourceContent)]? | yes | | - | featureImage | [Asset](#Asset)? | yes | | - | published | Bool? | yes | | - | readingTime | String? | yes | | - | slug | String? | yes | | - | tags | [String]? | yes | | - | title | String? | yes | | - | seo | [SEO](#SEO)? | yes | | - | schedule | [CronSchedule](#CronSchedule)? | yes | | - ---- - - - - - #### [GetAnnouncementListSchema](#GetAnnouncementListSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[AdminAnnouncementSchema](#AdminAnnouncementSchema)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [CreateAnnouncementSchema](#CreateAnnouncementSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - | data | [AdminAnnouncementSchema](#AdminAnnouncementSchema)? | yes | | - ---- - - - - - #### [Navigation](#Navigation) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | slug | String? | yes | | - | orientation | String? | yes | | - | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | id | String? | yes | | - | position | String? | yes | | - | application | String? | yes | | - | platform | String? | yes | | - | navigation | [NavigationReference](#NavigationReference)? | yes | | - ---- - - - - - #### [LocaleLanguage](#LocaleLanguage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | hi | [Language](#Language)? | yes | | - | ar | [Language](#Language)? | yes | | - | enUs | [Language](#Language)? | yes | | - ---- - - - - - #### [Language](#Language) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - ---- - - - - - #### [Action](#Action) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | page | [ActionPage](#ActionPage)? | yes | | - | popup | [ActionPage](#ActionPage)? | yes | | - | type | String? | yes | | - ---- - - - - - #### [ActionPage](#ActionPage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | params | [String: [String]]? | yes | | - | query | [String: [String]]? | yes | | - | url | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [NavigationReference](#NavigationReference) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | acl | [String]? | yes | | - | tags | [String]? | yes | | - | localeLanguage | [LocaleLanguage](#LocaleLanguage)? | yes | | - | image | String? | yes | | - | type | String? | yes | | - | action | [Action](#Action)? | yes | | - | active | Bool? | yes | | - | display | String? | yes | | - | sortOrder | Int? | yes | | - | subNavigation | [[NavigationReference](#NavigationReference)]? | yes | | - ---- - - - - - #### [LandingPage](#LandingPage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | data | [LandingPageSchema](#LandingPageSchema)? | yes | | - | success | Bool? | yes | | - ---- - - - - - #### [ConfigurationSchema](#ConfigurationSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | sleepTime | Int? | yes | | - | startOnLaunch | Bool? | yes | | - | duration | Int? | yes | | - | slideDirection | String? | yes | | - ---- - - - - - #### [SlideshowMedia](#SlideshowMedia) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | url | String? | yes | | - | bgColor | String? | yes | | - | duration | Int? | yes | | - | autoDecideDuration | Bool? | yes | | - | action | [Action](#Action)? | yes | | - ---- - - - - - #### [Slideshow](#Slideshow) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | data | [SlideshowSchema](#SlideshowSchema)? | yes | | - | success | Bool? | yes | | - ---- - - - - - #### [AnnouncementsResponseSchema](#AnnouncementsResponseSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | announcements | [String: [[AnnouncementSchema](#AnnouncementSchema)]]? | yes | | - | refreshRate | Int? | yes | number of seconds after which api should hit again to fetch new announcements | - | refreshPages | [String]? | yes | list of page slugs on which announcement should be fetched as soon as they are loaded | - ---- - - - - - #### [FaqResponseSchema](#FaqResponseSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | faqs | [[FaqSchema](#FaqSchema)]? | yes | | - ---- - - - - - #### [UpdateHandpickedSchema](#UpdateHandpickedSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | tag | [HandpickedTagSchema](#HandpickedTagSchema)? | yes | | - ---- - - - - - #### [HandpickedTagSchema](#HandpickedTagSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | position | String? | yes | | - | attributes | [String: Any]? | yes | | - | name | String? | yes | | - | url | String? | yes | | - | type | String? | yes | | - | subType | String? | yes | | - | content | String? | yes | | - ---- - - - - - #### [RemoveHandpickedSchema](#RemoveHandpickedSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | tags | [String]? | yes | | - ---- - - - - - #### [CreateTagSchema](#CreateTagSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | subType | String? | yes | | - | id | String? | yes | | - | type | String? | yes | | - | url | String? | yes | | - | position | String? | yes | | - | attributes | [String: Any]? | yes | | - | content | String? | yes | | - ---- - - - - - #### [CreateTagRequestSchema](#CreateTagRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | tags | [[CreateTagSchema](#CreateTagSchema)]? | yes | | - ---- - - - - - #### [TagDeleteSuccessResponse](#TagDeleteSuccessResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool? | yes | | - ---- - - - - - #### [APIError](#APIError) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - | status | Double? | yes | | - | code | String? | yes | | - | exception | String? | yes | | - | info | String? | yes | | - | requestId | String? | yes | | - | stackTrace | String? | yes | | - | meta | [String: Any]? | yes | | - ---- - - - - - #### [CategorySchema](#CategorySchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | index | Int? | yes | | - | title | String? | yes | | - | description | String? | yes | | - | children | [String]? | yes | | - | id | String? | yes | | - | slug | String? | yes | | - | application | String? | yes | | - | iconUrl | String? | yes | | - | customJson | [String: Any]? | yes | | - ---- - - - - - #### [ChildrenSchema](#ChildrenSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | question | String? | yes | | - | answer | String? | yes | | - | slug | String? | yes | | - | application | String? | yes | | - | id | String? | yes | | - ---- - - - - - #### [CategoryRequestSchema](#CategoryRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | slug | String? | yes | | - | title | String? | yes | | - ---- - - - - - #### [FAQCategorySchema](#FAQCategorySchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | index | Int? | yes | | - | title | String? | yes | | - | description | String? | yes | | - | children | [[ChildrenSchema](#ChildrenSchema)]? | yes | | - | id | String? | yes | | - | slug | String? | yes | | - | application | String? | yes | | - | iconUrl | String? | yes | | - | customJson | [String: Any]? | yes | | - ---- - - - - - #### [FaqSchema](#FaqSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | slug | String? | yes | | - | application | String? | yes | | - | id | String? | yes | | - | question | String? | yes | | - | answer | String? | yes | | - ---- - - - - - #### [FAQ](#FAQ) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | slug | String? | yes | | - | question | String? | yes | | - | answer | String? | yes | | - ---- - - - - - #### [CreateFaqResponseSchema](#CreateFaqResponseSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | faq | [FaqSchema](#FaqSchema)? | yes | | - ---- - - - - - #### [CreateFaqSchema](#CreateFaqSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | faq | [FAQ](#FAQ)? | yes | | - ---- - - - - - #### [GetFaqSchema](#GetFaqSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | faqs | [[FaqSchema](#FaqSchema)]? | yes | | - ---- - - - - - #### [UpdateFaqCategoryRequestSchema](#UpdateFaqCategoryRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | category | [CategorySchema](#CategorySchema)? | yes | | - ---- - - - - - #### [CreateFaqCategoryRequestSchema](#CreateFaqCategoryRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | category | [CategoryRequestSchema](#CategoryRequestSchema)? | yes | | - ---- - - - - - #### [CreateFaqCategorySchema](#CreateFaqCategorySchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | category | [CategorySchema](#CategorySchema)? | yes | | - ---- - - - - - #### [GetFaqCategoriesSchema](#GetFaqCategoriesSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | categories | [[CategorySchema](#CategorySchema)]? | yes | | - ---- - - - - - #### [GetFaqCategoryBySlugSchema](#GetFaqCategoryBySlugSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | category | [FAQCategorySchema](#FAQCategorySchema)? | yes | | - ---- - - - - - #### [LandingPageGetResponse](#LandingPageGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[LandingPageSchema](#LandingPageSchema)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [LandingPageSchema](#LandingPageSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | slug | String? | yes | | - | action | [Action](#Action)? | yes | | - | platform | [String]? | yes | | - | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | id | String? | yes | | - | application | String? | yes | | - | archived | Bool? | yes | | - | customJson | [String: Any]? | yes | | - ---- - - - - - #### [DefaultNavigationResponse](#DefaultNavigationResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[NavigationSchema](#NavigationSchema)]? | yes | | - ---- - - - - - #### [NavigationGetResponse](#NavigationGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[NavigationSchema](#NavigationSchema)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [Orientation](#Orientation) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | portrait | [String]? | yes | | - | landscape | [String]? | yes | | - ---- - - - - - #### [NavigationSchema](#NavigationSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | application | String? | yes | | - | archived | Bool? | yes | | - | name | String? | yes | | - | slug | String? | yes | | - | platform | [String]? | yes | | - | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | orientation | [Orientation](#Orientation)? | yes | | - | version | Double? | yes | | - | navigation | [[NavigationReference](#NavigationReference)]? | yes | | - ---- - - - - - #### [NavigationRequest](#NavigationRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | slug | String? | yes | | - | platform | [String]? | yes | | - | orientation | [Orientation](#Orientation)? | yes | | - | navigation | [[NavigationReference](#NavigationReference)]? | yes | | - ---- - - - - - #### [CustomPageSchema](#CustomPageSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | platform | String? | yes | | - | title | String? | yes | | - | slug | String? | yes | | - | type | String? | yes | | - | orientation | String? | yes | | - | application | String? | yes | | - | description | String? | yes | | - | published | Bool? | yes | | - | tags | [String]? | yes | | - | content | [[String: Any]]? | yes | | - | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | schedule | [ScheduleSchema](#ScheduleSchema)? | yes | | - ---- - - - - - #### [ContentSchema](#ContentSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | value | [String: Any]? | yes | | - ---- - - - - - #### [CustomPage](#CustomPage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | data | [CustomPageSchema](#CustomPageSchema)? | yes | | - ---- - - - - - #### [FeatureImage](#FeatureImage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | secureUrl | String? | yes | | - ---- - - - - - #### [PageGetResponse](#PageGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[PageSchema](#PageSchema)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [PageSpec](#PageSpec) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | specifications | [[PageSpecItem](#PageSpecItem)]? | yes | | - ---- - - - - - #### [PageSpecParam](#PageSpecParam) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String? | yes | | - | required | Bool? | yes | | - ---- - - - - - #### [PageSpecItem](#PageSpecItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pageType | String? | yes | | - | displayName | String? | yes | | - | params | [[PageSpecParam](#PageSpecParam)]? | yes | | - | query | [[PageSpecParam](#PageSpecParam)]? | yes | | - ---- - - - - - #### [PageSchema](#PageSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | application | String? | yes | | - | componentIds | [String]? | yes | Components can be used to store multiple components | - | content | [[String: Any]]? | yes | | - | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | description | String? | yes | | - | featureImage | [Asset](#Asset)? | yes | | - | pageMeta | [[String: Any]]? | yes | | - | schedule | [ScheduleSchema](#ScheduleSchema)? | yes | | - | customJson | [String: Any]? | yes | | - | orientation | String? | yes | | - | platform | String? | yes | | - | published | Bool? | yes | | - | slug | String? | yes | | - | tags | [String]? | yes | | - | title | String? | yes | | - | type | String? | yes | | - | seo | [SEO](#SEO)? | yes | | - | visibility | [String: Any]? | yes | | - | archived | Bool? | yes | | - ---- - - - - - #### [CreatedBySchema](#CreatedBySchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - ---- - - - - - #### [PageContent](#PageContent) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | value | [String: Any]? | yes | | - ---- - - - - - #### [PageMeta](#PageMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String? | yes | | - | value | [String: Any]? | yes | | - ---- - - - - - #### [PageRequest](#PageRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | schedule | [CronSchedule](#CronSchedule)? | yes | | - | application | String? | yes | | - | author | [Author](#Author)? | yes | | - | customJson | [String: Any]? | yes | | - | orientation | String? | yes | | - | content | [[String: Any]]? | yes | | - | featureImage | [Asset](#Asset)? | yes | | - | published | Bool? | yes | | - | readingTime | String? | yes | | - | slug | String? | yes | | - | tags | [String]? | yes | | - | seo | [SEO](#SEO)? | yes | | - | title | String? | yes | | - ---- - - - - - #### [CronSchedule](#CronSchedule) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cron | String? | yes | | - | start | String? | yes | | - | end | String? | yes | | - | duration | Double? | yes | | - ---- - - - - - #### [PagePublishRequest](#PagePublishRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | publish | Bool? | yes | | - ---- - - - - - #### [PageMetaSchema](#PageMetaSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | systemPages | [[NavigationSchema](#NavigationSchema)]? | yes | | - | customPages | [[PageSchema](#PageSchema)]? | yes | | - | applicationId | String? | yes | | - ---- - - - - - #### [SlideshowGetResponse](#SlideshowGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[SlideshowSchema](#SlideshowSchema)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [SlideshowSchema](#SlideshowSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | slug | String? | yes | | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | application | String? | yes | | - | platform | String? | yes | | - | configuration | [ConfigurationSchema](#ConfigurationSchema)? | yes | | - | media | [[SlideshowMedia](#SlideshowMedia)]? | yes | | - | active | Bool? | yes | | - | archived | Bool? | yes | | - | customJson | [String: Any]? | yes | | - ---- - - - - - #### [SlideshowRequest](#SlideshowRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | slug | String? | yes | | - | platform | String? | yes | | - | configuration | [ConfigurationSchema](#ConfigurationSchema)? | yes | | - | media | [SlideshowMedia](#SlideshowMedia)? | yes | | - | active | Bool? | yes | | - ---- - - - - - #### [Support](#Support) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | created | Bool? | yes | | - | id | String? | yes | | - | configType | String? | yes | | - | application | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | contact | [ContactSchema](#ContactSchema)? | yes | | - ---- - - - - - #### [PhoneProperties](#PhoneProperties) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String? | yes | | - | code | String? | yes | | - | number | String? | yes | | - ---- - - - - - #### [PhoneSchema](#PhoneSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool? | yes | | - | phone | [[PhoneProperties](#PhoneProperties)]? | yes | | - ---- - - - - - #### [EmailProperties](#EmailProperties) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String? | yes | | - | value | String? | yes | | - ---- - - - - - #### [EmailSchema](#EmailSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool? | yes | | - | email | [[EmailProperties](#EmailProperties)]? | yes | | - ---- - - - - - #### [ContactSchema](#ContactSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | phone | [PhoneSchema](#PhoneSchema)? | yes | | - | email | [EmailSchema](#EmailSchema)? | yes | | - ---- - - - - - #### [TagsSchema](#TagsSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | application | String? | yes | | - | id | String? | yes | | - | tags | [[TagSchema](#TagSchema)]? | yes | | - ---- - - - - - #### [TagSchema](#TagSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | url | String? | yes | | - | type | String? | yes | | - | subType | String? | yes | | - | id | String? | yes | | - | position | String? | yes | | - | attributes | [String: Any]? | yes | | - | content | String? | yes | | - ---- - - - - - - - #### [CommunicationConsentReq](#CommunicationConsentReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | response | String? | yes | | - | action | String? | yes | | - | channel | String? | yes | | - ---- - - - - - #### [CommunicationConsentRes](#CommunicationConsentRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | appId | String? | yes | | - | userId | String? | yes | | - | channels | [CommunicationConsentChannels](#CommunicationConsentChannels)? | yes | | - ---- - - - - - #### [CommunicationConsentChannelsEmail](#CommunicationConsentChannelsEmail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | response | String? | yes | | - | displayName | String? | yes | | - ---- - - - - - #### [CommunicationConsentChannelsSms](#CommunicationConsentChannelsSms) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | response | String? | yes | | - | displayName | String? | yes | | - ---- - - - - - #### [CommunicationConsentChannelsWhatsapp](#CommunicationConsentChannelsWhatsapp) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | response | String? | yes | | - | displayName | String? | yes | | - | countryCode | String? | yes | | - | phoneNumber | String? | yes | | - ---- - - - - - #### [CommunicationConsentChannels](#CommunicationConsentChannels) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | [CommunicationConsentChannelsEmail](#CommunicationConsentChannelsEmail)? | yes | | - | sms | [CommunicationConsentChannelsSms](#CommunicationConsentChannelsSms)? | yes | | - | whatsapp | [CommunicationConsentChannelsWhatsapp](#CommunicationConsentChannelsWhatsapp)? | yes | | - ---- - - - - - #### [CommunicationConsent](#CommunicationConsent) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | appId | String? | yes | | - | userId | String? | yes | | - | channels | [CommunicationConsentChannels](#CommunicationConsentChannels)? | yes | | - ---- - - - - - #### [PushtokenReq](#PushtokenReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | action | String? | yes | | - | bundleIdentifier | String? | yes | | - | pushToken | String? | yes | | - | uniqueDeviceId | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [PushtokenRes](#PushtokenRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | bundleIdentifier | String? | yes | | - | pushToken | String? | yes | | - | uniqueDeviceId | String? | yes | | - | type | String? | yes | | - | platform | String? | yes | | - | applicationId | String? | yes | | - | userId | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | expiredAt | String? | yes | | - ---- - - - - - - - #### [QRCodeResp](#QRCodeResp) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | link | String? | yes | | - | svg | String? | yes | | - ---- - - - - - #### [RedirectDevice](#RedirectDevice) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | link | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [WebRedirect](#WebRedirect) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | link | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [Redirects](#Redirects) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | ios | [RedirectDevice](#RedirectDevice)? | yes | | - | android | [RedirectDevice](#RedirectDevice)? | yes | | - | web | [WebRedirect](#WebRedirect)? | yes | | - | forceWeb | Bool? | yes | | - ---- - - - - - #### [CampaignShortLink](#CampaignShortLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | source | String? | yes | | - | medium | String? | yes | | - ---- - - - - - #### [Attribution](#Attribution) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | campaignCookieExpiry | String? | yes | | - ---- - - - - - #### [SocialMediaTags](#SocialMediaTags) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | description | String? | yes | | - | image | String? | yes | | - ---- - - - - - #### [ShortLinkReq](#ShortLinkReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String | no | Give a name to the link. | - | url | String | no | The web address to shorten. | - | hash | String? | yes | | - | active | Bool? | yes | | - | expireAt | String? | yes | | - | enableTracking | Bool? | yes | | - | personalized | Bool? | yes | To create personalized short links. | - | campaign | [CampaignShortLink](#CampaignShortLink)? | yes | | - | redirects | [Redirects](#Redirects)? | yes | | - | attribution | [Attribution](#Attribution)? | yes | | - | socialMediaTags | [SocialMediaTags](#SocialMediaTags)? | yes | | - | count | Int? | yes | | - ---- - - - - - #### [UrlInfo](#UrlInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | original | String? | yes | | - | short | String? | yes | | - | hash | String? | yes | | - ---- - - - - - #### [ShortLinkRes](#ShortLinkRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | url | [UrlInfo](#UrlInfo)? | yes | | - | createdBy | String? | yes | | - | appRedirect | Bool? | yes | | - | fallback | String? | yes | | - | active | Bool? | yes | | - | id | String? | yes | | - | enableTracking | Bool? | yes | | - | expireAt | String? | yes | | - | application | String? | yes | | - | userId | String? | yes | | - | createdAt | String? | yes | | - | meta | [String: Any]? | yes | | - | updatedAt | String? | yes | | - | personalized | Bool? | yes | To create personalized short links | - | campaign | [CampaignShortLink](#CampaignShortLink)? | yes | | - | redirects | [Redirects](#Redirects)? | yes | | - | attribution | [Attribution](#Attribution)? | yes | | - | socialMediaTags | [SocialMediaTags](#SocialMediaTags)? | yes | | - | count | Int? | yes | | - ---- - - - - - #### [ShortLinkList](#ShortLinkList) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[ShortLinkRes](#ShortLinkRes)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [ErrorRes](#ErrorRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - - - #### [FailedResponse](#FailedResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String | no | | - ---- - - - - - #### [CDN](#CDN) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | url | String | no | | - ---- - - - - - #### [Upload](#Upload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | expiry | Int | no | | - | url | String | no | | - ---- - - - - - #### [StartResponse](#StartResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | fileName | String | no | | - | filePath | String | no | | - | contentType | String | no | | - | method | String | no | | - | namespace | String | no | | - | operation | String | no | | - | size | Int | no | | - | upload | [Upload](#Upload) | no | | - | cdn | [CDN](#CDN) | no | | - | tags | [String]? | yes | | - ---- - - - - - #### [StartRequest](#StartRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | fileName | String | no | | - | contentType | String | no | | - | size | Int | no | | - | tags | [String]? | yes | | - | params | [String: Any]? | yes | | - ---- - - - - - #### [CompleteResponse](#CompleteResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String | no | | - | fileName | String | no | | - | filePath | String | no | | - | contentType | String | no | | - | method | String | no | | - | namespace | String | no | | - | operation | String | no | | - | size | Int | no | | - | upload | [Upload](#Upload) | no | | - | cdn | [CDN](#CDN) | no | | - | success | String | no | | - | tags | [String]? | yes | | - | createdOn | String | no | | - | modifiedOn | String | no | | - ---- - - - - - #### [Opts](#Opts) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | attempts | Int? | yes | | - | timestamp | Int? | yes | | - | delay | Int? | yes | | - ---- - - - - - #### [CopyFileTask](#CopyFileTask) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String | no | | - | name | String | no | | - | data | [BulkRequest](#BulkRequest) | no | | - | opts | [Opts](#Opts) | no | | - | progress | Int | no | | - | delay | Int | no | | - | timestamp | Int | no | | - | attemptsMade | Int | no | | - | stacktrace | [String]? | yes | | - | finishedOn | Int | no | | - | processedOn | Int | no | | - ---- - - - - - #### [BulkResponse](#BulkResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | trackingUrl | String | no | | - | task | [CopyFileTask](#CopyFileTask) | no | | - ---- - - - - - #### [ReqConfiguration](#ReqConfiguration) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | concurrency | Int? | yes | | - ---- - - - - - #### [Destination](#Destination) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | namespace | String | no | | - | rewrite | String | no | | - | basepath | String? | yes | | - ---- - - - - - #### [BulkRequest](#BulkRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | urls | [String] | no | | - | destination | [Destination](#Destination) | no | | - | configuration | [ReqConfiguration](#ReqConfiguration)? | yes | | - ---- - - - - - #### [Urls](#Urls) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | url | String | no | | - | signedUrl | String | no | | - | expiry | Int | no | | - ---- - - - - - #### [SignUrlResponse](#SignUrlResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | urls | [[Urls](#Urls)] | no | | - ---- - - - - - #### [SignUrlRequest](#SignUrlRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | expiry | Int | no | | - | urls | [String] | no | | - ---- - - - - - #### [DbRecord](#DbRecord) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | | - | tags | [String] | no | | - | id | String | no | | - | fileName | String | no | | - | operation | String? | yes | | - | namespace | String | no | | - | contentType | String | no | | - | filePath | String | no | | - | upload | [Upload](#Upload) | no | | - | cdn | [CDN](#CDN) | no | | - | createdOn | String | no | | - | modifiedOn | String | no | | - ---- - - - - - #### [BrowseResponse](#BrowseResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[DbRecord](#DbRecord)] | no | | - | page | [Page](#Page) | no | | - ---- - - - - - - - #### [ApplicationAboutResponse](#ApplicationAboutResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | applicationInfo | [ApplicationInfo](#ApplicationInfo)? | yes | | - | companyInfo | [CompanyInfo](#CompanyInfo)? | yes | | - | ownerInfo | [OwnerInfo](#OwnerInfo)? | yes | | - ---- - - - - - #### [ApplicationInfo](#ApplicationInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | domain | [Domain](#Domain)? | yes | | - | website | [ApplicationWebsite](#ApplicationWebsite)? | yes | | - | cors | [ApplicationCors](#ApplicationCors)? | yes | | - | description | String? | yes | | - | name | String? | yes | | - | meta | [ApplicationMeta](#ApplicationMeta)? | yes | | - | token | String? | yes | | - | secret | String? | yes | | - | createdAt | String? | yes | | - | banner | [SecureUrl](#SecureUrl)? | yes | | - | logo | [SecureUrl](#SecureUrl)? | yes | | - | isActive | Bool? | yes | | - ---- - - - - - #### [CompanyInfo](#CompanyInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | uid | Int? | yes | | - | createdOn | String? | yes | | - | isActive | Bool? | yes | | - | name | String? | yes | | - | addresses | [[CompanyAboutAddress](#CompanyAboutAddress)]? | yes | | - | notificationEmails | [String]? | yes | | - ---- - - - - - #### [OwnerInfo](#OwnerInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | emails | [[UserEmail](#UserEmail)]? | yes | | - | phoneNumbers | [[UserPhoneNumber](#UserPhoneNumber)]? | yes | | - | firstName | String? | yes | | - | lastName | String? | yes | | - | profilePic | String? | yes | | - ---- - - - - - #### [AppVersionRequest](#AppVersionRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | application | [ApplicationVersionRequest](#ApplicationVersionRequest) | no | | - | device | [Device](#Device) | no | | - | locale | String? | yes | | - | timezone | String? | yes | | - ---- - - - - - #### [ApplicationVersionRequest](#ApplicationVersionRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | name | String | no | | - | namespace | String? | yes | | - | token | String? | yes | | - | version | String | no | | - ---- - - - - - #### [Device](#Device) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | build | Int? | yes | | - | model | String? | yes | | - | os | [OS](#OS) | no | | - ---- - - - - - #### [OS](#OS) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String | no | | - | version | String? | yes | | - ---- - - - - - #### [SupportedLanguage](#SupportedLanguage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | code | String? | yes | | - ---- - - - - - #### [LanguageResponse](#LanguageResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[SupportedLanguage](#SupportedLanguage)]? | yes | | - ---- - - - - - #### [AppStaffResponse](#AppStaffResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | staffUsers | [[AppStaff](#AppStaff)]? | yes | | - ---- - - - - - #### [UpdateDialog](#UpdateDialog) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | interval | Int? | yes | | - ---- - - - - - #### [OrderingStoreSelectRequest](#OrderingStoreSelectRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | orderingStore | [OrderingStoreSelect](#OrderingStoreSelect) | no | | - ---- - - - - - #### [OrderingStoreSelect](#OrderingStoreSelect) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uid | Int | no | store uid | - ---- - - - - - #### [AppStaff](#AppStaff) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | orderIncent | Bool? | yes | | - | stores | [Int]? | yes | | - | application | String? | yes | | - | title | String? | yes | | - | user | String? | yes | | - | employeeCode | String? | yes | | - | firstName | String? | yes | | - | lastName | String? | yes | | - | profilePicUrl | String? | yes | | - ---- - - - - - #### [AppTokenResponse](#AppTokenResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | tokens | [Tokens](#Tokens)? | yes | | - | id | String? | yes | | - | application | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [Tokens](#Tokens) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | firebase | [Firebase](#Firebase)? | yes | | - | moengage | [Moengage](#Moengage)? | yes | | - | segment | [Segment](#Segment)? | yes | | - | gtm | [Gtm](#Gtm)? | yes | | - | freshchat | [Freshchat](#Freshchat)? | yes | | - | safetynet | [Safetynet](#Safetynet)? | yes | | - | fyndRewards | [FyndRewards](#FyndRewards)? | yes | | - | googleMap | [GoogleMap](#GoogleMap)? | yes | | - ---- - - - - - #### [Firebase](#Firebase) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | credentials | [Credentials](#Credentials)? | yes | | - | enabled | Bool? | yes | | - ---- - - - - - #### [Credentials](#Credentials) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | ios | [Ios](#Ios)? | yes | | - | android | [Android](#Android)? | yes | | - | projectId | String? | yes | | - | gcmSenderId | String? | yes | | - | applicationId | String? | yes | | - | apiKey | String? | yes | | - ---- - - - - - #### [Ios](#Ios) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | applicationId | String? | yes | | - | apiKey | String? | yes | | - ---- - - - - - #### [Android](#Android) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | applicationId | String? | yes | | - | apiKey | String? | yes | | - ---- - - - - - #### [Moengage](#Moengage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | credentials | [MoengageCredentials](#MoengageCredentials)? | yes | | - | enabled | Bool? | yes | | - ---- - - - - - #### [MoengageCredentials](#MoengageCredentials) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | appId | String? | yes | | - ---- - - - - - #### [Segment](#Segment) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | credentials | [SegmentCredentials](#SegmentCredentials)? | yes | | - | enabled | Bool? | yes | | - ---- - - - - - #### [SegmentCredentials](#SegmentCredentials) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | writeKey | String? | yes | | - ---- - - - - - #### [Gtm](#Gtm) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | credentials | [GtmCredentials](#GtmCredentials)? | yes | | - | enabled | Bool? | yes | | - ---- - - - - - #### [GtmCredentials](#GtmCredentials) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | apiKey | String? | yes | | - ---- - - - - - #### [Freshchat](#Freshchat) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | credentials | [FreshchatCredentials](#FreshchatCredentials)? | yes | | - | enabled | Bool? | yes | | - ---- - - - - - #### [FreshchatCredentials](#FreshchatCredentials) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | appId | String? | yes | | - | appKey | String? | yes | | - | webToken | String? | yes | | - ---- - - - - - #### [Safetynet](#Safetynet) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | credentials | [SafetynetCredentials](#SafetynetCredentials)? | yes | | - | enabled | Bool? | yes | | - ---- - - - - - #### [SafetynetCredentials](#SafetynetCredentials) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | apiKey | String? | yes | | - ---- - - - - - #### [FyndRewards](#FyndRewards) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | credentials | [FyndRewardsCredentials](#FyndRewardsCredentials)? | yes | | - ---- - - - - - #### [FyndRewardsCredentials](#FyndRewardsCredentials) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | publicKey | String? | yes | | - ---- - - - - - #### [GoogleMap](#GoogleMap) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | credentials | [GoogleMapCredentials](#GoogleMapCredentials)? | yes | | - ---- - - - - - #### [GoogleMapCredentials](#GoogleMapCredentials) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | apiKey | String? | yes | | - ---- - - - - - #### [RewardPointsConfig](#RewardPointsConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | credit | [Credit](#Credit)? | yes | | - | debit | [Debit](#Debit)? | yes | | - ---- - - - - - #### [Credit](#Credit) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - ---- - - - - - #### [Debit](#Debit) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - | autoApply | Bool? | yes | | - | strategyChannel | String? | yes | | - ---- - - - - - #### [ProductDetailFeature](#ProductDetailFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | similar | [String]? | yes | | - | sellerSelection | Bool? | yes | | - | updateProductMeta | Bool? | yes | | - | requestProduct | Bool? | yes | | - ---- - - - - - #### [LaunchPage](#LaunchPage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pageType | String? | yes | | - | params | [String: Any]? | yes | | - | query | [String: Any]? | yes | | - ---- - - - - - #### [LandingPageFeature](#LandingPageFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | launchPage | [LaunchPage](#LaunchPage)? | yes | | - | continueAsGuest | Bool? | yes | | - | loginBtnText | String? | yes | | - | showDomainTextbox | Bool? | yes | | - | showRegisterBtn | Bool? | yes | | - ---- - - - - - #### [RegistrationPageFeature](#RegistrationPageFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | askStoreAddress | Bool? | yes | | - ---- - - - - - #### [AppFeature](#AppFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | productDetail | [ProductDetailFeature](#ProductDetailFeature)? | yes | | - | landingPage | [LandingPageFeature](#LandingPageFeature)? | yes | | - | registrationPage | [RegistrationPageFeature](#RegistrationPageFeature)? | yes | | - | homePage | [HomePageFeature](#HomePageFeature)? | yes | | - | common | [CommonFeature](#CommonFeature)? | yes | | - | cart | [CartFeature](#CartFeature)? | yes | | - | qr | [QrFeature](#QrFeature)? | yes | | - | pcr | [PcrFeature](#PcrFeature)? | yes | | - | order | [OrderFeature](#OrderFeature)? | yes | | - | id | String? | yes | | - | app | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [HomePageFeature](#HomePageFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | orderProcessing | Bool? | yes | | - ---- - - - - - #### [CommonFeature](#CommonFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | communicationOptinDialog | [CommunicationOptinDialogFeature](#CommunicationOptinDialogFeature)? | yes | | - | deploymentStoreSelection | [DeploymentStoreSelectionFeature](#DeploymentStoreSelectionFeature)? | yes | | - | listingPrice | [ListingPriceFeature](#ListingPriceFeature)? | yes | | - | currency | [CurrencyFeature](#CurrencyFeature)? | yes | | - | revenueEngine | [RevenueEngineFeature](#RevenueEngineFeature)? | yes | | - | feedback | [FeedbackFeature](#FeedbackFeature)? | yes | | - | compareProducts | [CompareProductsFeature](#CompareProductsFeature)? | yes | | - | rewardPoints | [RewardPointsConfig](#RewardPointsConfig)? | yes | | - ---- - - - - - #### [CommunicationOptinDialogFeature](#CommunicationOptinDialogFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | visibility | Bool? | yes | | - ---- - - - - - #### [DeploymentStoreSelectionFeature](#DeploymentStoreSelectionFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - | type | String? | yes | | - ---- - - - - - #### [ListingPriceFeature](#ListingPriceFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | value | String? | yes | | - ---- - - - - - #### [CurrencyFeature](#CurrencyFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | value | [String]? | yes | | - | type | String? | yes | | - | defaultCurrency | String? | yes | | - ---- - - - - - #### [RevenueEngineFeature](#RevenueEngineFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - ---- - - - - - #### [FeedbackFeature](#FeedbackFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - ---- - - - - - #### [CompareProductsFeature](#CompareProductsFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - ---- - - - - - #### [CartFeature](#CartFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | gstInput | Bool? | yes | | - | staffSelection | Bool? | yes | | - | placingForCustomer | Bool? | yes | | - | googleMap | Bool? | yes | | - | revenueEngineCoupon | Bool? | yes | | - ---- - - - - - #### [QrFeature](#QrFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | application | Bool? | yes | | - | products | Bool? | yes | | - | collections | Bool? | yes | | - ---- - - - - - #### [PcrFeature](#PcrFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | staffSelection | Bool? | yes | | - ---- - - - - - #### [OrderFeature](#OrderFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | buyAgain | Bool? | yes | | - ---- - - - - - #### [AppFeatureRequest](#AppFeatureRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | feature | [AppFeature](#AppFeature)? | yes | | - ---- - - - - - #### [AppFeatureResponse](#AppFeatureResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | feature | [AppFeature](#AppFeature)? | yes | | - ---- - - - - - #### [Currency](#Currency) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | isActive | Bool? | yes | | - | name | String? | yes | | - | code | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | decimalDigits | Int? | yes | | - | symbol | String? | yes | | - ---- - - - - - #### [Domain](#Domain) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | verified | Bool? | yes | | - | isPrimary | Bool? | yes | | - | isDefault | Bool? | yes | | - | isShortlink | Bool? | yes | | - | id | String? | yes | | - | name | String? | yes | | - ---- - - - - - #### [ApplicationWebsite](#ApplicationWebsite) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - | basepath | String? | yes | | - ---- - - - - - #### [ApplicationCors](#ApplicationCors) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | domains | [String]? | yes | | - ---- - - - - - #### [ApplicationAuth](#ApplicationAuth) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - ---- - - - - - #### [ApplicationRedirections](#ApplicationRedirections) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | from | String? | yes | | - | redirectTo | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [ApplicationMeta](#ApplicationMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | value | String? | yes | | - ---- - - - - - #### [SecureUrl](#SecureUrl) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | secureUrl | String? | yes | | - ---- - - - - - #### [Application](#Application) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | website | [ApplicationWebsite](#ApplicationWebsite)? | yes | | - | cors | [ApplicationCors](#ApplicationCors)? | yes | | - | auth | [ApplicationAuth](#ApplicationAuth)? | yes | | - | description | String? | yes | | - | channelType | String? | yes | | - | cacheTtl | Int? | yes | | - | isInternal | Bool? | yes | | - | isActive | Bool? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | owner | String? | yes | | - | companyId | Int? | yes | | - | token | String? | yes | | - | redirections | [[ApplicationRedirections](#ApplicationRedirections)]? | yes | | - | meta | [[ApplicationMeta](#ApplicationMeta)]? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | v | Int? | yes | | - | banner | [SecureUrl](#SecureUrl)? | yes | | - | logo | [SecureUrl](#SecureUrl)? | yes | | - | favicon | [SecureUrl](#SecureUrl)? | yes | | - | domains | [[Domain](#Domain)]? | yes | | - | appType | String? | yes | | - | mobileLogo | [SecureUrl](#SecureUrl)? | yes | | - | domain | [Domain](#Domain)? | yes | | - ---- - - - - - #### [NotFound](#NotFound) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [UnhandledError](#UnhandledError) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [InvalidPayloadRequest](#InvalidPayloadRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [SuccessMessageResponse](#SuccessMessageResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [InventoryBrandRule](#InventoryBrandRule) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | criteria | String? | yes | Whether enable all or explicitly few brands as inventory | - | brands | [Int]? | yes | Brand uids in case of explicit criteria | - ---- - - - - - #### [StoreCriteriaRule](#StoreCriteriaRule) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | companies | [Int]? | yes | list of company uids | - | brands | [Int]? | yes | list of brand uids | - ---- - - - - - #### [InventoryStoreRule](#InventoryStoreRule) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | criteria | String? | yes | Whether enable all or explicitly few stores or use filter of brands and company as inventory stores | - | rules | [[StoreCriteriaRule](#StoreCriteriaRule)]? | yes | List of rules with company and brands uids. Used when critera is `filter` | - | stores | [Int]? | yes | List of store uids. Used when critera is `explicit` | - ---- - - - - - #### [InventoryPaymentConfig](#InventoryPaymentConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | modeOfPayment | String? | yes | | - | source | String? | yes | | - ---- - - - - - #### [StorePriorityRule](#StorePriorityRule) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - | storetypeOrder | [String]? | yes | | - ---- - - - - - #### [ArticleAssignmentRule](#ArticleAssignmentRule) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | storePriority | [StorePriorityRule](#StorePriorityRule)? | yes | | - ---- - - - - - #### [InventoryArticleAssignment](#InventoryArticleAssignment) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | postOrderReassignment | Bool? | yes | | - | rules | [ArticleAssignmentRule](#ArticleAssignmentRule)? | yes | | - ---- - - - - - #### [CompanyAboutAddress](#CompanyAboutAddress) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pincode | Int? | yes | | - | address1 | String? | yes | | - | address2 | String? | yes | | - | city | String? | yes | | - | state | String? | yes | | - | country | String? | yes | | - | addressType | String? | yes | | - ---- - - - - - #### [UserEmail](#UserEmail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool? | yes | | - | primary | Bool? | yes | | - | verified | Bool? | yes | | - | email | String? | yes | | - ---- - - - - - #### [UserPhoneNumber](#UserPhoneNumber) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool? | yes | | - | primary | Bool? | yes | | - | verified | Bool? | yes | | - | countryCode | Int? | yes | | - | phone | String? | yes | | - ---- - - - - - #### [ApplicationInformation](#ApplicationInformation) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | address | [InformationAddress](#InformationAddress)? | yes | | - | support | [InformationSupport](#InformationSupport)? | yes | | - | socialLinks | [SocialLinks](#SocialLinks)? | yes | | - | links | [Links](#Links)? | yes | | - | copyrightText | String? | yes | | - | id | String? | yes | | - | businessHighlights | [BusinessHighlights](#BusinessHighlights)? | yes | | - | application | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [InformationAddress](#InformationAddress) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | loc | String? | yes | | - | addressLine | [String]? | yes | | - | phone | [InformationPhone](#InformationPhone)? | yes | | - | city | String? | yes | | - | country | String? | yes | | - | pincode | Int? | yes | | - ---- - - - - - #### [InformationPhone](#InformationPhone) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | code | String? | yes | | - | number | String? | yes | | - ---- - - - - - #### [InformationSupport](#InformationSupport) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | phone | [String]? | yes | | - | email | [String]? | yes | | - | timing | String? | yes | | - ---- - - - - - #### [SocialLinks](#SocialLinks) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | facebook | [FacebookLink](#FacebookLink)? | yes | | - | instagram | [InstagramLink](#InstagramLink)? | yes | | - | twitter | [TwitterLink](#TwitterLink)? | yes | | - | pinterest | [PinterestLink](#PinterestLink)? | yes | | - | googlePlus | [GooglePlusLink](#GooglePlusLink)? | yes | | - | youtube | [YoutubeLink](#YoutubeLink)? | yes | | - | linkedIn | [LinkedInLink](#LinkedInLink)? | yes | | - | vimeo | [VimeoLink](#VimeoLink)? | yes | | - | blogLink | [BlogLink](#BlogLink)? | yes | | - ---- - - - - - #### [FacebookLink](#FacebookLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | icon | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [InstagramLink](#InstagramLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | icon | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [TwitterLink](#TwitterLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | icon | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [PinterestLink](#PinterestLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | icon | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [GooglePlusLink](#GooglePlusLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | icon | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [YoutubeLink](#YoutubeLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | icon | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [LinkedInLink](#LinkedInLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | icon | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [VimeoLink](#VimeoLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | icon | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [BlogLink](#BlogLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | icon | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [Links](#Links) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [BusinessHighlights](#BusinessHighlights) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | title | String? | yes | | - | icon | String? | yes | | - | subTitle | String? | yes | | - ---- - - - - - #### [ApplicationDetail](#ApplicationDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String | no | | - | description | String | no | | - | logo | [SecureUrl](#SecureUrl) | no | | - | mobileLogo | [SecureUrl](#SecureUrl) | no | | - | favicon | [SecureUrl](#SecureUrl) | no | | - | banner | [SecureUrl](#SecureUrl) | no | | - | domain | [Domain](#Domain)? | yes | | - | domains | [[Domain](#Domain)]? | yes | | - | id | String? | yes | | - ---- - - - - - #### [CurrenciesResponse](#CurrenciesResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Currency](#Currency)]? | yes | | - ---- - - - - - #### [DefaultCurrency](#DefaultCurrency) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | ref | String? | yes | | - | code | String? | yes | | - ---- - - - - - #### [AppCurrencyResponse](#AppCurrencyResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | application | String? | yes | | - | defaultCurrency | [DefaultCurrency](#DefaultCurrency)? | yes | | - | supportedCurrency | [[Currency](#Currency)]? | yes | | - ---- - - - - - #### [StoreLatLong](#StoreLatLong) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | coordinates | [Double]? | yes | | - ---- - - - - - #### [OptedStoreAddress](#OptedStoreAddress) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | state | String? | yes | | - | address1 | String? | yes | | - | latLong | [StoreLatLong](#StoreLatLong)? | yes | | - | address2 | String? | yes | | - | pincode | Int? | yes | | - | country | String? | yes | | - | city | String? | yes | | - ---- - - - - - #### [OrderingStore](#OrderingStore) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | address | [OptedStoreAddress](#OptedStoreAddress)? | yes | | - | id | String? | yes | | - | uid | Int? | yes | | - | name | String? | yes | | - | displayName | String? | yes | | - | storeType | String? | yes | | - | storeCode | String? | yes | | - | pincode | Int? | yes | | - | code | String? | yes | | - ---- - - - - - #### [OrderingStores](#OrderingStores) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | page | [Page](#Page)? | yes | | - | items | [[OrderingStore](#OrderingStore)]? | yes | | - | deployedStores | [Int]? | yes | | - | allStores | Bool? | yes | | - | enabled | Bool? | yes | | - | type | String? | yes | | - | id | String? | yes | | - | app | String? | yes | | - | v | Int? | yes | | - ---- - - - - - - - #### [AggregatorConfigDetail](#AggregatorConfigDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | sdk | Bool? | yes | SDK | - | merchantId | String? | yes | Unique merchant id | - | pin | String? | yes | Masked pin | - | key | String | no | Payment gateway api key | - | configType | String | no | Fynd or self payment gateway | - | api | String? | yes | Payment gateway api endpoint | - | merchantKey | String? | yes | Unique merchant key | - | secret | String | no | Masked payment gateway api secret | - | userId | String? | yes | Registered User id | - | verifyApi | String? | yes | Payment gateway verify payment api endpoint | - ---- - - - - - #### [AggregatorsConfigDetailResponse](#AggregatorsConfigDetailResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | mswipe | [AggregatorConfigDetail](#AggregatorConfigDetail)? | yes | | - | success | Bool | no | | - | stripe | [AggregatorConfigDetail](#AggregatorConfigDetail)? | yes | | - | juspay | [AggregatorConfigDetail](#AggregatorConfigDetail)? | yes | | - | env | String | no | Environment i.e Live or Test | - | simpl | [AggregatorConfigDetail](#AggregatorConfigDetail)? | yes | | - | razorpay | [AggregatorConfigDetail](#AggregatorConfigDetail)? | yes | | - | payumoney | [AggregatorConfigDetail](#AggregatorConfigDetail)? | yes | | - | rupifi | [AggregatorConfigDetail](#AggregatorConfigDetail)? | yes | | - | ccavenue | [AggregatorConfigDetail](#AggregatorConfigDetail)? | yes | | - ---- - - - - - #### [ErrorCodeAndDescription](#ErrorCodeAndDescription) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | code | String | no | Error descrption code. | - | description | String | no | Error human understandable description. | - ---- - - - - - #### [HttpErrorCodeAndResponse](#HttpErrorCodeAndResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not | - | error | [ErrorCodeAndDescription](#ErrorCodeAndDescription) | no | | - ---- - - - - - #### [AttachCardRequest](#AttachCardRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | refresh | Bool? | yes | Refresh cache flag. | - | cardId | String | no | Card token of payment gateway. | - | nameOnCard | String? | yes | | - | nickname | String? | yes | | - ---- - - - - - #### [AttachCardsResponse](#AttachCardsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not. | - | message | String? | yes | Human readable message. | - | data | [String: Any] | no | List of cards of customer. | - ---- - - - - - #### [CardPaymentGateway](#CardPaymentGateway) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | api | String? | yes | Payment gateway CARD api endpoint | - | customerId | String? | yes | Payment gateway customer id. | - | aggregator | String | no | Payment gateway name. | - ---- - - - - - #### [ActiveCardPaymentGatewayResponse](#ActiveCardPaymentGatewayResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not. | - | message | String | no | Human readable message. | - | cards | [CardPaymentGateway](#CardPaymentGateway) | no | Card's payment gateway with customer id. | - ---- - - - - - #### [Card](#Card) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cardIsin | String? | yes | card_isin | - | aggregatorName | String | no | aggregator_name | - | cardToken | String? | yes | card_token | - | expMonth | Int? | yes | exp_month | - | cardBrandImage | String? | yes | card_brand_image | - | expired | Bool? | yes | expired | - | cardNumber | String? | yes | card_number | - | cardBrand | String? | yes | card_brand | - | cardFingerprint | String? | yes | card_fingerprint | - | cardReference | String? | yes | card_reference | - | cardIssuer | String? | yes | card_issuer | - | cardType | String? | yes | card_type | - | cardId | String? | yes | card_id | - | cardName | String? | yes | card_name | - | expYear | Int? | yes | exp_year | - | nickname | String? | yes | nickname | - ---- - - - - - #### [ListCardsResponse](#ListCardsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not. | - | message | String | no | Human readable message. | - | data | [[Card](#Card)]? | yes | List of cards of customer. | - ---- - - - - - #### [DeletehCardRequest](#DeletehCardRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cardId | String | no | Card token of payment gateway. | - ---- - - - - - #### [DeleteCardsResponse](#DeleteCardsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not. | - | message | String? | yes | Human readable message. | - ---- - - - - - #### [ValidateCustomerRequest](#ValidateCustomerRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | phoneNumber | String | no | User mobile number without country code. | - | transactionAmountInPaise | Int | no | Payable amount in paise | - | payload | String | no | Hashed payload string. | - | merchantParams | [String: Any] | no | Extra meta fields. | - | aggregator | String | no | Payment gateway name in camel case i.e Simpl, Rupifi | - ---- - - - - - #### [ValidateCustomerResponse](#ValidateCustomerResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not | - | message | String | no | Error or success message. | - | data | [String: Any] | no | Payment gateway response data | - ---- - - - - - #### [ChargeCustomerRequest](#ChargeCustomerRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | orderId | String | no | Unique order id. | - | transactionToken | String? | yes | Transaction token of payment gateway. | - | verified | Bool? | yes | Already Verified flag from payment gateway i.e Mswipe | - | amount | Int | no | Chargable amount of order. | - | aggregator | String | no | Payment gateway name i.e Simpl, Mswipe | - ---- - - - - - #### [ChargeCustomerResponse](#ChargeCustomerResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | orderId | String | no | Unique order id. | - | success | Bool | no | Response is successful or not. | - | deliveryAddressId | String? | yes | Delivery adddress id of customer | - | message | String | no | Human readable message. | - | cartId | String? | yes | Cart id of customer | - | status | String | no | Status of charged payment. | - | aggregator | String | no | Payment gateway name i.e Simpl, Mswipe | - ---- - - - - - #### [PaymentInitializationRequest](#PaymentInitializationRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | razorpayPaymentId | String | no | Payment gateway payment id | - | aggregatorOrderId | String | no | Payment gateway order id | - | pollingUrl | String | no | Polling url to check payment status | - | timeout | Int | no | Payment polling timeout if not recieved response | - | customerId | String | no | Payment gateway customer id. | - | virtualId | String? | yes | Bharat QR code virtual id | - | merchantOrderId | String | no | Unique fynd order id | - | method | String | no | Payment method | - | aggregator | String | no | Payment gateway name | - ---- - - - - - #### [PaymentInitializationResponse](#PaymentInitializationResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | razorpayPaymentId | String? | yes | Payment id. | - | success | Bool | no | Response is successful or not. | - | aggregatorOrderId | String? | yes | Payment order id | - | method | String | no | Payment method | - | pollingUrl | String | no | Polling url. | - | timeout | Int? | yes | timeout. | - | vpa | String? | yes | Customer vpa address | - | virtualId | String? | yes | Payment virtual address. | - | bqrImage | String? | yes | Bharath qr image url. | - | customerId | String? | yes | Payment gateway customer id. | - | currency | String? | yes | Currency code. | - | merchantOrderId | String | no | order id | - | amount | Int? | yes | Payable amount. | - | status | String? | yes | Status of payment. | - | aggregator | String | no | Payment gateway name | - ---- - - - - - #### [PaymentStatusUpdateRequest](#PaymentStatusUpdateRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | orderId | String | no | Payment gateway order id | - | method | String | no | Payment method | - | contact | String | no | Customer valid mobile number | - | vpa | String | no | Customer vpa address | - | email | String | no | Customer valid email | - | customerId | String | no | Payment gateway customer id. | - | currency | String | no | Currency code. | - | merchantOrderId | String | no | Unique fynd order id | - | amount | Int | no | Payable amount. | - | status | String | no | Status of payment. | - | aggregator | String | no | Payment gateway name | - ---- - - - - - #### [PaymentStatusUpdateResponse](#PaymentStatusUpdateResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | aggregatorName | String | no | Payment gateway name | - | status | String | no | Payment status | - | retry | Bool | no | Response is successful or not. | - ---- - - - - - #### [AggregatorRoute](#AggregatorRoute) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | apiLink | String? | yes | api_link | - | data | [String: Any]? | yes | Data | - | paymentFlow | String? | yes | payment_flow | - ---- - - - - - #### [PaymentFlow](#PaymentFlow) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | bqrRazorpay | [AggregatorRoute](#AggregatorRoute)? | yes | BQR_Razorpay | - | stripe | [AggregatorRoute](#AggregatorRoute)? | yes | Stripe | - | juspay | [AggregatorRoute](#AggregatorRoute)? | yes | Juspay | - | upiRazorpay | [AggregatorRoute](#AggregatorRoute)? | yes | UPI_Razorpay | - | msipe | [AggregatorRoute](#AggregatorRoute)? | yes | mswipe | - | simpl | [AggregatorRoute](#AggregatorRoute)? | yes | simpl | - | razorpay | [AggregatorRoute](#AggregatorRoute)? | yes | Razorpay | - | rupifi | [AggregatorRoute](#AggregatorRoute)? | yes | Rupifi | - | payubiz | [AggregatorRoute](#AggregatorRoute)? | yes | Payubiz | - | ccavenue | [AggregatorRoute](#AggregatorRoute)? | yes | Ccavenue | - | fynd | [AggregatorRoute](#AggregatorRoute)? | yes | Fynd | - ---- - - - - - #### [PaymentModeLogo](#PaymentModeLogo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | large | String | no | large | - | small | String | no | smalll | - ---- - - - - - #### [PaymentModeList](#PaymentModeList) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | logoUrl | [PaymentModeLogo](#PaymentModeLogo)? | yes | Logo | - | expMonth | Int? | yes | exp_month | - | cardNumber | String? | yes | card_number | - | timeout | Int? | yes | timeout | - | cardReference | String? | yes | card_reference | - | retryCount | Int? | yes | retry_count | - | cardType | String? | yes | card_type | - | displayName | String? | yes | display name | - | cardId | String? | yes | card_id | - | cardIsin | String? | yes | card_isin | - | aggregatorName | String | no | aggregator_name | - | cardIssuer | String? | yes | card_issuer | - | intentAppErrorList | [String]? | yes | intent_app_error_list | - | cardName | String? | yes | card_name | - | nickname | String? | yes | nickname | - | merchantCode | String? | yes | merchant code | - | cardToken | String? | yes | card_token | - | cardBrandImage | String? | yes | card_brand_image | - | expired | Bool? | yes | expired | - | code | String? | yes | code | - | cardBrand | String? | yes | card_brand | - | displayPriority | Int? | yes | Dispaly Priority | - | cardFingerprint | String? | yes | card_fingerprint | - | intentFlow | String? | yes | intent_flow | - | name | String? | yes | name | - | expYear | Int? | yes | exp_year | - | fyndVpa | String? | yes | fynd_vpa | - ---- - - - - - #### [RootPaymentMode](#RootPaymentMode) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | list | [[PaymentModeList](#PaymentModeList)]? | yes | Payment mode | - | aggregatorName | String? | yes | Dispaly Priority | - | anonymousEnable | Bool? | yes | Annonymous card flag | - | displayPriority | Int | no | Dispaly Priority | - | addCardEnabled | Bool? | yes | Annonymous card flag | - | displayName | String | no | Payment mode display name | - | name | String | no | Payment mode name | - ---- - - - - - #### [PaymentOptionAndFlow](#PaymentOptionAndFlow) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | paymentFlows | [PaymentFlow](#PaymentFlow) | no | payment_flows | - | paymentOption | [[RootPaymentMode](#RootPaymentMode)] | no | Payment options | - ---- - - - - - #### [PaymentModeRouteResponse](#PaymentModeRouteResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not | - | paymentOptions | [PaymentOptionAndFlow](#PaymentOptionAndFlow) | no | payment_options | - ---- - - - - - #### [RupifiBannerData](#RupifiBannerData) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | status | String? | yes | Rupifi KYC status | - | kycUrl | String? | yes | Rupifi KYC banner url. | - ---- - - - - - #### [RupifiBannerResponse](#RupifiBannerResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Successful or not. | - | data | [RupifiBannerData](#RupifiBannerData) | no | Rupifi KYC banner details. | - ---- - - - - - #### [TransferItemsDetails](#TransferItemsDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String | no | | - | logoLarge | String | no | Beneficiary large Logo | - | logoSmall | String | no | Beneficiary small Logo | - | displayName | Bool? | yes | Beneficiary Display Name | - | name | String | no | Beneficiary Name | - ---- - - - - - #### [TransferModeDetails](#TransferModeDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[TransferItemsDetails](#TransferItemsDetails)]? | yes | Beneficiary Mode Items | - | displayName | String | no | Beneficiary Mode Name | - ---- - - - - - #### [TransferModeResponse](#TransferModeResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | data | [[TransferModeDetails](#TransferModeDetails)] | no | Response Object | - ---- - - - - - #### [UpdateRefundTransferModeRequest](#UpdateRefundTransferModeRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | transferMode | String | no | Transfer Mode of the Beneficiary to be added | - | enable | Bool | no | True for enabling the Transfer Mode | - ---- - - - - - #### [UpdateRefundTransferModeResponse](#UpdateRefundTransferModeResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool? | yes | Response is successful or not | - ---- - - - - - #### [OrderBeneficiaryDetails](#OrderBeneficiaryDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | modifiedOn | String | no | MOdification Date of Beneficiary | - | id | Int | no | | - | comment | Bool? | yes | Remarks | - | subtitle | String | no | SHort Title Of Account | - | mobile | Bool? | yes | MObile no of User | - | email | String | no | EMail of User | - | transferMode | String | no | Transfer Mode Of Account | - | displayName | String | no | Display Name Of Account | - | beneficiaryId | String | no | Benenficiary Id | - | ifscCode | String | no | Ifsc Code Of Account | - | bankName | String | no | Bank Name Of Account | - | isActive | Bool | no | Boolean Flag whether Beneficiary set or not | - | createdOn | String | no | Creation Date of Beneficiary | - | address | String | no | Address of User | - | branchName | Bool? | yes | Branch Name Of Account | - | delightsUserName | String | no | User Id Who filled the Beneficiary | - | accountHolder | String | no | Account Holder Name | - | title | String | no | Title Of Account | - | accountNo | String | no | Account Number | - ---- - - - - - #### [OrderBeneficiaryResponse](#OrderBeneficiaryResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | beneficiaries | [[OrderBeneficiaryDetails](#OrderBeneficiaryDetails)] | no | All Beneficiaries Of An Order | - | showBeneficiaryDetails | Bool? | yes | Show beneficiary details or not. | - ---- - - - - - #### [NotFoundResourceError](#NotFoundResourceError) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not | - | code | String | no | Bad Request Data | - | description | String | no | Not Found | - ---- - - - - - #### [IfscCodeResponse](#IfscCodeResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool? | yes | Response is successful or not | - | bankName | String | no | Bank Name Of Account | - | branchName | String | no | Branch Name Of Account | - ---- - - - - - #### [ErrorCodeDescription](#ErrorCodeDescription) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not | - | code | String | no | Error descrption code. | - | description | String | no | Error human understandable description. | - ---- - - - - - #### [AddBeneficiaryViaOtpVerificationRequest](#AddBeneficiaryViaOtpVerificationRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | otp | String | no | Otp sent to the given Mobile No | - | requestId | String | no | Request Id sent in | - | hashKey | String | no | Hash key of the beneficiary Id | - ---- - - - - - #### [AddBeneficiaryViaOtpVerificationResponse](#AddBeneficiaryViaOtpVerificationResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | otp | String | no | Otp sent to the given Mobile No | - | requestId | String | no | Request Id of the otp | - | hashKey | String | no | Hash key of the beneficiary Id | - ---- - - - - - #### [WrongOtpError](#WrongOtpError) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | String | no | Response is successful or not | - | description | String | no | Wrong OTP Code | - ---- - - - - - #### [BeneficiaryModeDetails](#BeneficiaryModeDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | address | String? | yes | Address of the User | - | wallet | String? | yes | | - | branchName | String | no | Branch Name of the Account | - | bankName | String | no | Bank Name of the Account | - | comment | String? | yes | Remarks added by The user | - | mobile | String | no | Moblie Number of the User | - | accountHolder | String | no | Name of the Account Holder | - | vpa | String? | yes | | - | email | String | no | Email of the Account Holder | - | ifscCode | String | no | Ifsc Code of the Account | - | accountNo | String | no | Account NUmber of the Account Holder | - ---- - - - - - #### [AddBeneficiaryDetailsRequest](#AddBeneficiaryDetailsRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | orderId | String | no | Merchant Order Id | - | details | [BeneficiaryModeDetails](#BeneficiaryModeDetails) | no | Beneficiary bank details | - | requestId | String? | yes | | - | otp | String? | yes | | - | transferMode | String | no | Transfer Mode of the Beneficiary to be added | - | shipmentId | String | no | Shipment Id of the respective Merchant Order Id | - | delights | Bool | no | True if beneficiary to be added by delights or False if by User | - ---- - - - - - #### [RefundAccountResponse](#RefundAccountResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Success or failure flag. | - | message | String | no | Response message | - | data | [String: Any]? | yes | Refund account data. | - ---- - - - - - #### [BankDetailsForOTP](#BankDetailsForOTP) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | branchName | String | no | | - | accountHolder | String | no | | - | accountNo | String | no | | - | ifscCode | String | no | | - | bankName | String | no | | - ---- - - - - - #### [AddBeneficiaryDetailsOTPRequest](#AddBeneficiaryDetailsOTPRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | orderId | String | no | | - | details | [BankDetailsForOTP](#BankDetailsForOTP) | no | | - ---- - - - - - #### [WalletOtpRequest](#WalletOtpRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | countryCode | String | no | Country Code of the Mobile Number | - | mobile | String | no | Wallet Moblie Number of the User | - ---- - - - - - #### [WalletOtpResponse](#WalletOtpResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool? | yes | Response is successful or not | - | requestId | String | no | request id | - | isVerifiedFlag | String | no | Boolean Flag whether OTP Validation is already done or not | - ---- - - - - - #### [SetDefaultBeneficiaryRequest](#SetDefaultBeneficiaryRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | orderId | String | no | Merchant Order Id | - | beneficiaryId | String | no | Beneficiary Hash Id of the beneficiary added | - ---- - - - - - #### [SetDefaultBeneficiaryResponse](#SetDefaultBeneficiaryResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool? | yes | Response is successful or not | - | isBeneficiarySet | Bool | no | Boolean Flag whether Beneficiary set or not | - ---- - - - - - - - #### [OrderById](#OrderById) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | order | [OrderSchema](#OrderSchema) | no | | - ---- - - - - - #### [OrderList](#OrderList) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[OrderSchema](#OrderSchema)] | no | | - | page | [OrderPage](#OrderPage) | no | | - | filters | [OrderFilters](#OrderFilters) | no | | - ---- - - - - - #### [OrderPage](#OrderPage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | itemTotal | Int? | yes | | - | type | String? | yes | | - | size | Int? | yes | | - | current | Int? | yes | | - | hasNext | Bool? | yes | | - ---- - - - - - #### [OrderFilters](#OrderFilters) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | statuses | [[OrderStatuses](#OrderStatuses)]? | yes | | - ---- - - - - - #### [OrderStatuses](#OrderStatuses) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - | value | Int? | yes | | - | isSelected | Bool? | yes | | - ---- - - - - - #### [ReqBodyVerifyOTPShipment](#ReqBodyVerifyOTPShipment) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | requestId | String | no | | - | otpCode | String | no | | - ---- - - - - - #### [ResponseVerifyOTPShipment](#ResponseVerifyOTPShipment) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | | - ---- - - - - - #### [sendOTPApplicationResponse](#sendOTPApplicationResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | | - | requestId | String | no | | - | message | String | no | | - | resendTimer | Int | no | | - ---- - - - - - #### [ShipmentById](#ShipmentById) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | shipment | [Shipments](#Shipments) | no | | - ---- - - - - - #### [CustomerDetailsByShipmentId](#CustomerDetailsByShipmentId) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | orderId | String | no | | - | shipmentId | String | no | | - | name | String | no | | - | phone | String | no | | - | country | String | no | | - ---- - - - - - #### [ShipmentReasons](#ShipmentReasons) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | reasons | [[Reasons](#Reasons)] | no | | - ---- - - - - - #### [ShipmentStatusUpdateBody](#ShipmentStatusUpdateBody) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | statuses | [[StatusesBody](#StatusesBody)] | no | | - | forceTransition | Bool | no | | - ---- - - - - - #### [StatusesBody](#StatusesBody) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | status | String? | yes | | - | shipments | [String: Any]? | yes | | - ---- - - - - - #### [ShipmentStatusUpdate](#ShipmentStatusUpdate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | [[String: Any]] | no | | - | status | Bool | no | | - ---- - - - - - #### [ShipmentTrack](#ShipmentTrack) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | results | [[Track](#Track)] | no | | - ---- - - - - - #### [OrderSchema](#OrderSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | orderId | String? | yes | | - | breakupValues | [[BreakupValues](#BreakupValues)]? | yes | | - | orderCreatedTime | String? | yes | | - | shipments | [[Shipments](#Shipments)]? | yes | | - | totalShipmentsInOrder | Int? | yes | | - | userInfo | [UserInfo](#UserInfo)? | yes | | - | bagsForReorder | [[BagsForReorder](#BagsForReorder)]? | yes | | - ---- - - - - - #### [BagsForReorder](#BagsForReorder) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | itemId | Int? | yes | | - | itemSize | String? | yes | | - | storeId | Int? | yes | | - | sellerId | Int? | yes | | - | quantity | Int? | yes | | - | articleAssignment | [BagsForReorderArticleAssignment](#BagsForReorderArticleAssignment)? | yes | | - ---- - - - - - #### [BagsForReorderArticleAssignment](#BagsForReorderArticleAssignment) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | level | String? | yes | | - | strategy | String? | yes | | - ---- - - - - - #### [PosOrderById](#PosOrderById) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | order | [OrderSchema](#OrderSchema) | no | | - ---- - - - - - #### [Bags](#Bags) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | item | [Item](#Item)? | yes | | - | prices | [Prices](#Prices)? | yes | | - | currentStatus | [CurrentStatus](#CurrentStatus)? | yes | | - | id | Int? | yes | | - | financialBreakup | [[FinancialBreakup](#FinancialBreakup)]? | yes | | - ---- - - - - - #### [Item](#Item) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | brand | [ItemBrand](#ItemBrand)? | yes | | - | name | String? | yes | | - | size | String? | yes | | - | slugKey | String? | yes | | - | image | [String]? | yes | | - | code | String? | yes | | - | id | Double? | yes | | - ---- - - - - - #### [Prices](#Prices) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amountPaidRoundoff | Double? | yes | | - | fyndCredits | Double? | yes | | - | codCharges | Double? | yes | | - | cashback | Double? | yes | | - | addedToFyndCash | Bool? | yes | | - | priceMarked | Double? | yes | | - | transferPrice | Double? | yes | | - | couponValue | Double? | yes | | - | priceEffective | Double? | yes | | - | refundCredit | Double? | yes | | - | amountPaid | Double? | yes | | - | refundAmount | Double? | yes | | - | cashbackApplied | Double? | yes | | - | gstTaxPercentage | Double? | yes | | - | valueOfGood | Double? | yes | | - | brandCalculatedAmount | Double? | yes | | - | promotionEffectiveDiscount | Double? | yes | | - | discount | Double? | yes | | - | couponEffectiveDiscount | Double? | yes | | - | deliveryCharge | Double? | yes | | - ---- - - - - - #### [CurrentStatus](#CurrentStatus) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | updatedAt | String? | yes | | - | status | String? | yes | | - | name | String? | yes | | - | journeyType | String? | yes | | - ---- - - - - - #### [FinancialBreakup](#FinancialBreakup) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | brandCalculatedAmount | Double? | yes | | - | couponValue | Double? | yes | | - | amountPaidRoundoff | Double? | yes | | - | gstFee | String? | yes | | - | refundCredit | Double? | yes | | - | cashback | Double? | yes | | - | refundAmount | Double? | yes | | - | valueOfGood | Double? | yes | | - | promotionEffectiveDiscount | Double? | yes | | - | size | String? | yes | | - | totalUnits | Int? | yes | | - | discount | Double? | yes | | - | amountPaid | Double? | yes | | - | fyndCredits | Double? | yes | | - | addedToFyndCash | Bool? | yes | | - | deliveryCharge | Double? | yes | | - | hsnCode | String? | yes | | - | couponEffectiveDiscount | Double? | yes | | - | transferPrice | Double? | yes | | - | identifiers | [Identifiers](#Identifiers)? | yes | | - | gstTag | String? | yes | | - | priceMarked | Double? | yes | | - | priceEffective | Double? | yes | | - | codCharges | Double? | yes | | - | itemName | String? | yes | | - | cashbackApplied | Double? | yes | | - | gstTaxPercentage | Double? | yes | | - ---- - - - - - #### [Identifiers](#Identifiers) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | ean | String? | yes | | - | skuCode | String? | yes | | - ---- - - - - - #### [ItemBrand](#ItemBrand) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | logo | String? | yes | | - ---- - - - - - #### [BreakupValues](#BreakupValues) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - | value | Double? | yes | | - | name | String? | yes | | - ---- - - - - - #### [DeliveryAddress](#DeliveryAddress) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pincode | String? | yes | | - | landmark | String? | yes | | - | contactPerson | String? | yes | | - | phone | String? | yes | | - | state | String? | yes | | - | version | String? | yes | | - | address1 | String? | yes | | - | createdAt | String? | yes | | - | addressType | String? | yes | | - | addressCategory | String? | yes | | - | area | String? | yes | | - | city | String? | yes | | - | latitude | Double? | yes | | - | longitude | Double? | yes | | - | email | String? | yes | | - | country | String? | yes | | - | address2 | String? | yes | | - | updatedAt | String? | yes | | - | name | String? | yes | | - | address | String? | yes | | - ---- - - - - - #### [FulfillingStore](#FulfillingStore) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | code | String? | yes | | - | id | Int? | yes | | - | name | String? | yes | | - | companyId | Int? | yes | | - ---- - - - - - #### [Invoice](#Invoice) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | updatedDate | String? | yes | | - | invoiceUrl | String? | yes | | - | labelUrl | String? | yes | | - ---- - - - - - #### [Promise](#Promise) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | timestamp | [Timestamp](#Timestamp)? | yes | | - ---- - - - - - #### [Timestamp](#Timestamp) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | min | String? | yes | | - | max | String? | yes | | - ---- - - - - - #### [Reasons](#Reasons) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | reasonText | String? | yes | | - | showTextArea | Bool? | yes | | - | feedbackType | String? | yes | | - | flow | String? | yes | | - | reasonId | Int? | yes | | - | priority | Int? | yes | | - ---- - - - - - #### [ShipmentStatus](#ShipmentStatus) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | hexCode | String? | yes | | - ---- - - - - - #### [ShipmentUserInfo](#ShipmentUserInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | gender | String? | yes | | - | mobile | String? | yes | | - | firstName | String? | yes | | - | lastName | String? | yes | | - ---- - - - - - #### [Shipments](#Shipments) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | orderId | String? | yes | | - | breakupValues | [[BreakupValues](#BreakupValues)]? | yes | | - | trackUrl | String? | yes | | - | trakingNo | String? | yes | | - | trackingDetails | [[TrackingDetails](#TrackingDetails)]? | yes | | - | beneficiaryDetails | Bool? | yes | | - | canReturn | Bool? | yes | | - | prices | [Prices](#Prices)? | yes | | - | needHelpUrl | String? | yes | | - | shipmentId | String? | yes | | - | totalBags | Int? | yes | | - | deliveryAddress | [DeliveryAddress](#DeliveryAddress)? | yes | | - | invoice | [Invoice](#Invoice)? | yes | | - | comment | String? | yes | | - | orderType | String? | yes | | - | promise | [Promise](#Promise)? | yes | | - | fulfillingStore | [FulfillingStore](#FulfillingStore)? | yes | | - | bags | [[Bags](#Bags)]? | yes | | - | canCancel | Bool? | yes | | - | payment | [ShipmentPayment](#ShipmentPayment)? | yes | | - | shipmentCreatedAt | String? | yes | | - | shipmentStatus | [ShipmentStatus](#ShipmentStatus)? | yes | | - | userInfo | [ShipmentUserInfo](#ShipmentUserInfo)? | yes | | - | sizeInfo | [String: Any]? | yes | | - | totalDetails | [ShipmentTotalDetails](#ShipmentTotalDetails)? | yes | | - ---- - - - - - #### [ShipmentTotalDetails](#ShipmentTotalDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | totalPrice | Double? | yes | | - | sizes | Int? | yes | | - | pieces | Int? | yes | | - ---- - - - - - #### [ShipmentPayment](#ShipmentPayment) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | logo | String? | yes | | - | mode | String? | yes | | - | status | String? | yes | | - ---- - - - - - #### [Track](#Track) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | awb | String? | yes | | - | updatedAt | String? | yes | | - | lastLocationRecievedAt | String? | yes | | - | reason | String? | yes | | - | shipmentType | String? | yes | | - | status | String? | yes | | - | updatedTime | String? | yes | | - | accountName | String? | yes | | - ---- - - - - - #### [TrackingDetails](#TrackingDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isCurrent | Bool? | yes | | - | status | String? | yes | | - | time | String? | yes | | - | isPassed | Bool? | yes | | - ---- - - - - - #### [UserInfo](#UserInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | gender | String? | yes | | - | mobile | String? | yes | | - | name | String? | yes | | - | email | String? | yes | | - ---- - - - - - #### [ApefaceApiError](#ApefaceApiError) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - - - #### [ActionPageParams](#ActionPageParams) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | slug | [String]? | yes | | - ---- - - - - - #### [CatalogueOrderRequest](#CatalogueOrderRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | articles | [[RewardsArticle](#RewardsArticle)]? | yes | | - ---- - - - - - #### [CatalogueOrderResponse](#CatalogueOrderResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | articles | [[RewardsArticle](#RewardsArticle)]? | yes | | - ---- - - - - - #### [DiscountProperties](#DiscountProperties) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | absolute | Double? | yes | | - | currency | String? | yes | | - | displayAbsolute | String? | yes | | - | displayPercent | String? | yes | | - | percent | Double? | yes | | - ---- - - - - - #### [Error](#Error) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | code | Int? | yes | | - | exception | String? | yes | | - | info | String? | yes | | - | message | String? | yes | | - ---- - - - - - #### [Offer](#Offer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | schedule | [Schedule](#Schedule)? | yes | | - | active | Bool? | yes | | - | applicationId | String? | yes | | - | bannerImage | [Asset](#Asset)? | yes | | - | createdAt | String? | yes | | - | name | String? | yes | | - | rule | [String: Any]? | yes | | - | share | [ShareMessages](#ShareMessages)? | yes | | - | subText | String? | yes | | - | text | String? | yes | | - | type | String? | yes | | - | updatedAt | String? | yes | | - | updatedBy | String? | yes | | - | url | String? | yes | | - ---- - - - - - #### [OrderDiscountRequest](#OrderDiscountRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | currency | String? | yes | | - | orderAmount | Double | no | | - ---- - - - - - #### [OrderDiscountResponse](#OrderDiscountResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | appliedRuleBucket | [OrderDiscountRuleBucket](#OrderDiscountRuleBucket)? | yes | | - | baseDiscount | [DiscountProperties](#DiscountProperties)? | yes | | - | discount | [DiscountProperties](#DiscountProperties)? | yes | | - | orderAmount | Double? | yes | | - | points | Double? | yes | | - ---- - - - - - #### [OrderDiscountRuleBucket](#OrderDiscountRuleBucket) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | high | Double? | yes | | - | low | Double? | yes | | - | max | Double? | yes | | - | value | Double? | yes | | - | valueType | String? | yes | | - ---- - - - - - #### [PointsHistory](#PointsHistory) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | applicationId | String? | yes | | - | claimed | Bool? | yes | | - | createdAt | String? | yes | | - | expiresOn | String? | yes | | - | meta | [String: Any]? | yes | | - | points | Double? | yes | | - | remainingPoints | Double? | yes | | - | text1 | String? | yes | | - | text2 | String? | yes | | - | text3 | String? | yes | | - | txnName | String? | yes | | - | updatedAt | String? | yes | | - | userId | String? | yes | | - ---- - - - - - #### [PointsHistoryResponse](#PointsHistoryResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[PointsHistory](#PointsHistory)]? | yes | History is the list of points transaction. | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [PointsResponse](#PointsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | points | Double? | yes | Points is the total available | - ---- - - - - - #### [RedeemReferralCodeRequest](#RedeemReferralCodeRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | deviceId | String | no | | - | referralCode | String | no | | - ---- - - - - - #### [RedeemReferralCodeResponse](#RedeemReferralCodeResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - | points | Double? | yes | | - | redeemed | Bool? | yes | | - | referrerId | String? | yes | | - | referrerInfo | String? | yes | | - ---- - - - - - #### [ReferralDetailsResponse](#ReferralDetailsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | referral | [Offer](#Offer)? | yes | | - | referrerInfo | String? | yes | | - | share | [ShareMessages](#ShareMessages)? | yes | | - | user | [ReferralDetailsUser](#ReferralDetailsUser)? | yes | | - ---- - - - - - #### [ReferralDetailsUser](#ReferralDetailsUser) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | blocked | Bool? | yes | | - | points | Double? | yes | | - | redeemed | Bool? | yes | | - | referralCode | String? | yes | | - ---- - - - - - #### [RewardsArticle](#RewardsArticle) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | points | Double? | yes | | - | price | Double? | yes | | - ---- - - - - - #### [Schedule](#Schedule) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cron | String? | yes | | - | duration | Int? | yes | | - | end | String? | yes | | - | start | String? | yes | | - ---- - - - - - #### [ShareMessages](#ShareMessages) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | String? | yes | | - | facebook | String? | yes | | - | fallback | String? | yes | | - | message | String? | yes | | - | messenger | String? | yes | | - | sms | String? | yes | | - | text | String? | yes | | - | twitter | String? | yes | | - | whatsapp | String? | yes | | - ---- - - - - - - - #### [AbuseReport](#AbuseReport) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | abused | Bool? | yes | | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | description | String? | yes | | - | entity | [Entity](#Entity)? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | state | [FeedbackState](#FeedbackState)? | yes | | - | tags | [[TagMeta](#TagMeta)]? | yes | | - ---- - - - - - #### [Access](#Access) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | answer | Bool? | yes | | - | askQuestion | Bool? | yes | | - | comment | Bool? | yes | | - | rnr | Bool? | yes | | - ---- - - - - - #### [AddMediaListRequest](#AddMediaListRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | entityId | String? | yes | | - | entityType | String? | yes | | - | mediaList | [[AddMediaRequest](#AddMediaRequest)]? | yes | | - | refId | String? | yes | | - | refType | String? | yes | | - ---- - - - - - #### [AddMediaRequest](#AddMediaRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cloudId | String? | yes | | - | cloudName | String? | yes | | - | cloudProvider | String? | yes | | - | entityId | String? | yes | | - | entityType | String? | yes | | - | mediaUrl | String? | yes | | - | refId | String? | yes | | - | refType | String? | yes | | - | tags | [String]? | yes | | - | thumbnailUrl | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [ApplicationSchema](#ApplicationSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - ---- - - - - - #### [Attribute](#Attribute) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | description | String? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | slug | String? | yes | | - | tags | [[TagMeta](#TagMeta)]? | yes | | - ---- - - - - - #### [AttributeObject](#AttributeObject) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | name | String | no | | - | slug | String? | yes | | - | title | String? | yes | | - | type | String | no | | - | value | Double | no | | - ---- - - - - - #### [AttributeResponse](#AttributeResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Attribute](#Attribute)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [AutoDetectors](#AutoDetectors) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | textDetector | [[TextDetector](#TextDetector)]? | yes | | - ---- - - - - - #### [CheckEligibilityResponse](#CheckEligibilityResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | access | [Access](#Access)? | yes | | - ---- - - - - - #### [Cloud](#Cloud) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | name | String? | yes | | - | provider | String? | yes | | - ---- - - - - - #### [Comment](#Comment) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | comment | [String]? | yes | | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | entity | [Entity](#Entity)? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | state | [FeedbackState](#FeedbackState)? | yes | | - | tags | [[TagMeta](#TagMeta)]? | yes | | - | voteCount | [VoteCount](#VoteCount)? | yes | | - ---- - - - - - #### [CommentGetResponse](#CommentGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Comment](#Comment)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [CommentRequest](#CommentRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | comment | [String] | no | | - | entityId | String | no | | - | entityType | String | no | | - ---- - - - - - #### [CreateQNARequest](#CreateQNARequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | choices | [String]? | yes | | - | entityId | String | no | | - | entityType | String | no | | - | maxLen | Int? | yes | | - | sortPriority | Int? | yes | | - | tags | [String]? | yes | | - | text | String | no | | - | type | String? | yes | | - ---- - - - - - #### [CreatedBy](#CreatedBy) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | name | String? | yes | | - | tags | [[TagMeta](#TagMeta)]? | yes | | - ---- - - - - - #### [CursorGetResponse](#CursorGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[String: Any]]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [CustomerReview](#CustomerReview) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | autoDetectors | [AutoDetectors](#AutoDetectors)? | yes | | - | createdOn | String? | yes | | - | deviceMeta | [DeviceMeta](#DeviceMeta)? | yes | | - | entity | [ProductEntity](#ProductEntity)? | yes | | - | id | String? | yes | | - | locationMeta | [LocationMeta](#LocationMeta)? | yes | | - | modifiedOn | String? | yes | | - | name | String? | yes | | - | rating | [ReviewRating](#ReviewRating)? | yes | | - | review | [Review](#Review)? | yes | | - | slug | String? | yes | | - | state | [State](#State)? | yes | | - | tags | [[TagMeta](#TagMeta)]? | yes | | - | template | [Template](#Template)? | yes | | - | voteCount | [VoteCount](#VoteCount)? | yes | | - ---- - - - - - #### [DeviceMeta](#DeviceMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | appVersion | String? | yes | | - | platform | String? | yes | | - ---- - - - - - #### [Entity](#Entity) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | type | String? | yes | entity type could be review/comment/ | - ---- - - - - - #### [EntityMeta](#EntityMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | orderId | String? | yes | | - | type | String? | yes | product, delivery,seller | - ---- - - - - - #### [FeedbackError](#FeedbackError) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | code | String? | yes | | - | exception | String? | yes | | - | info | String? | yes | | - | message | String? | yes | | - | meta | [String: Any]? | yes | | - | requestId | String? | yes | | - | stackTrace | String? | yes | | - | status | Int? | yes | | - ---- - - - - - #### [FeedbackMedia](#FeedbackMedia) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | application | [ApplicationSchema](#ApplicationSchema)? | yes | | - | cloud | [Cloud](#Cloud)? | yes | | - | createdBy | [CreatedBy](#CreatedBy)? | yes | | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | description | String? | yes | | - | entity | [Entity](#Entity)? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | reference | [Entity](#Entity)? | yes | | - | state | [MediaState](#MediaState)? | yes | | - | tags | [[TagMeta](#TagMeta)]? | yes | | - | type | String? | yes | | - | url | [Url](#Url)? | yes | | - ---- - - - - - #### [FeedbackState](#FeedbackState) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool? | yes | | - | archive | Bool? | yes | | - | media | String? | yes | | - | qna | Bool? | yes | | - | rating | Bool? | yes | | - | review | Bool? | yes | | - ---- - - - - - #### [GeoLoc](#GeoLoc) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | latitude | String? | yes | | - | longitude | String? | yes | | - ---- - - - - - #### [InsertResponse](#InsertResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | ids | String? | yes | | - ---- - - - - - #### [Location](#Location) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | countryCode | String? | yes | | - | flagUrl | String? | yes | | - | geoLoc | [GeoLoc](#GeoLoc)? | yes | | - | name | String? | yes | | - | pincode | String? | yes | | - ---- - - - - - #### [LocationMeta](#LocationMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | demand | [Location](#Location)? | yes | | - | supply | [Location](#Location)? | yes | | - ---- - - - - - #### [MediaGetResponse](#MediaGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[FeedbackMedia](#FeedbackMedia)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [MediaMeta](#MediaMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cloud | [Cloud](#Cloud)? | yes | | - | comment | [String]? | yes | | - | description | String? | yes | | - | id | String? | yes | | - | type | String? | yes | | - | url | [Url](#Url)? | yes | | - ---- - - - - - #### [MediaState](#MediaState) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | approve | Bool? | yes | | - | archive | Bool? | yes | | - ---- - - - - - #### [NumberGetResponse](#NumberGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[String: Any]]? | yes | | - | page | [PageNumber](#PageNumber)? | yes | | - ---- - - - - - #### [PageNumber](#PageNumber) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | current | Int? | yes | | - | hasNext | Bool? | yes | | - | itemTotal | Int? | yes | | - | size | Int? | yes | | - | type | String? | yes | | - ---- - - - - - #### [ProductEntity](#ProductEntity) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | For products, ID will be product ID, delivery, ID will be order id, seller ID will be company ID | - | meta | [EntityMeta](#EntityMeta)? | yes | | - | type | String? | yes | product, delivery, seller, app, order | - ---- - - - - - #### [QNA](#QNA) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | comments | [[Comment](#Comment)]? | yes | | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | entity | [Entity](#Entity)? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | question | [Question](#Question)? | yes | | - | state | [QNAState](#QNAState)? | yes | | - | tag | [String]? | yes | | - | tags | [[TagMeta](#TagMeta)]? | yes | | - ---- - - - - - #### [QNAGetResponse](#QNAGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[QNA](#QNA)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [QNAState](#QNAState) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool? | yes | | - | approve | Bool? | yes | | - | modify | Bool? | yes | | - | priority | Int? | yes | | - | reply | Bool? | yes | | - | vote | Bool? | yes | | - ---- - - - - - #### [Question](#Question) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | choices | [String]? | yes | | - | maxLen | Int? | yes | | - | text | String? | yes | | - | type | String? | yes | type could be single_choice/text/multi_choice | - ---- - - - - - #### [Rating](#Rating) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | attributes | [[Attribute](#Attribute)]? | yes | | - | attributesSlugs | [String]? | yes | | - | ui | [UI](#UI)? | yes | | - ---- - - - - - #### [RatingGetResponse](#RatingGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Rating](#Rating)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [RatingMetric](#RatingMetric) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | avg | Double? | yes | | - | count | Int? | yes | Valuetype could be average, count | - | name | String? | yes | Attribute name like Camera, Battery and rating name like a number 5,4,3 | - | slug | String? | yes | | - | type | String? | yes | type could be attribute_rating and rating | - ---- - - - - - #### [ReportAbuseGetResponse](#ReportAbuseGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[AbuseReport](#AbuseReport)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [ReportAbuseRequest](#ReportAbuseRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | entityId | String | no | | - | entityType | String | no | | - ---- - - - - - #### [Review](#Review) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | answerIds | [String]? | yes | | - | comments | [String]? | yes | | - | description | String? | yes | | - | mediaMeta | [[MediaMeta](#MediaMeta)]? | yes | | - | title | String? | yes | | - ---- - - - - - #### [ReviewFacet](#ReviewFacet) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - | name | String? | yes | | - | selected | Bool? | yes | | - | slug | String? | yes | | - | type | String? | yes | rating, attribute rating | - ---- - - - - - #### [ReviewGetResponse](#ReviewGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | facets | [[ReviewFacet](#ReviewFacet)]? | yes | | - | items | [[CustomerReview](#CustomerReview)]? | yes | | - | page | [Page](#Page)? | yes | | - | sort | [[SortMethod](#SortMethod)]? | yes | | - ---- - - - - - #### [ReviewMediaMeta](#ReviewMediaMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | maxCount | Double? | yes | | - | size | Double? | yes | | - | type | String? | yes | | - ---- - - - - - #### [ReviewMetric](#ReviewMetric) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | attributeMetric | [[RatingMetric](#RatingMetric)]? | yes | | - | createdOn | String? | yes | | - | entity | [Entity](#Entity)? | yes | entity could be product, seller, delivery | - | id | String? | yes | | - | modifiedOn | String? | yes | | - | ratingAvg | Double? | yes | | - | ratingCount | Int? | yes | total rating count | - | ratingMetric | [[RatingMetric](#RatingMetric)]? | yes | | - | reviewCount | Int? | yes | total review count | - ---- - - - - - #### [ReviewMetricGetResponse](#ReviewMetricGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[ReviewMetric](#ReviewMetric)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [ReviewRating](#ReviewRating) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | attributes | [[AttributeObject](#AttributeObject)]? | yes | | - | value | Double? | yes | | - ---- - - - - - #### [SaveAttributeRequest](#SaveAttributeRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | name | String | no | | - | slug | String | no | | - ---- - - - - - #### [SortMethod](#SortMethod) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | selected | Bool? | yes | | - | type | String? | yes | | - ---- - - - - - #### [State](#State) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool? | yes | | - | approve | Bool? | yes | | - | autoDecided | Bool? | yes | | - | status | Int? | yes | | - ---- - - - - - #### [TagMeta](#TagMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | media | [[MediaMeta](#MediaMeta)]? | yes | | - | name | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [Template](#Template) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | entity | [Entity](#Entity)? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | rating | [Rating](#Rating)? | yes | | - | review | [TemplateReview](#TemplateReview)? | yes | | - | state | [FeedbackState](#FeedbackState)? | yes | | - ---- - - - - - #### [TemplateGetResponse](#TemplateGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Template](#Template)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [TemplateReview](#TemplateReview) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | header | String? | yes | | - | imageMeta | [ReviewMediaMeta](#ReviewMediaMeta)? | yes | | - | title | String? | yes | | - | videoMeta | [ReviewMediaMeta](#ReviewMediaMeta)? | yes | | - | voteAllowed | Bool? | yes | | - ---- - - - - - #### [TextDetector](#TextDetector) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | confidence | Double? | yes | | - | text | String? | yes | | - | textClass | String? | yes | | - | textType | String? | yes | | - ---- - - - - - #### [UI](#UI) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | feedbackQuestion | [String]? | yes | | - | icon | [UIIcon](#UIIcon)? | yes | | - | text | [String]? | yes | | - | type | String? | yes | star | images | gifs | smileys | - ---- - - - - - #### [UIIcon](#UIIcon) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | String? | yes | | - | inactive | String? | yes | | - | selected | [String]? | yes | | - ---- - - - - - #### [UpdateAbuseStatusRequest](#UpdateAbuseStatusRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | abusive | Bool? | yes | | - | active | Bool? | yes | | - | approve | Bool? | yes | | - | description | String? | yes | | - | entityId | String? | yes | | - | entityType | String? | yes | | - | id | String? | yes | | - ---- - - - - - #### [UpdateAttributeRequest](#UpdateAttributeRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | name | String | no | | - | slug | String? | yes | | - ---- - - - - - #### [UpdateCommentRequest](#UpdateCommentRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool? | yes | | - | approve | Bool? | yes | | - | comment | [String] | no | | - | id | String | no | | - ---- - - - - - #### [UpdateMediaListRequest](#UpdateMediaListRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | approve | Bool? | yes | | - | archive | Bool? | yes | | - | entityType | String? | yes | | - | ids | [String]? | yes | | - ---- - - - - - #### [UpdateQNARequest](#UpdateQNARequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool? | yes | | - | approve | Bool? | yes | | - | choices | [String]? | yes | | - | id | String? | yes | | - | tags | [String]? | yes | | - ---- - - - - - #### [UpdateResponse](#UpdateResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - ---- - - - - - #### [UpdateReviewRequest](#UpdateReviewRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool? | yes | | - | application | String? | yes | | - | approve | Bool? | yes | | - | archive | Bool? | yes | | - | attributesRating | [[AttributeObject](#AttributeObject)]? | yes | | - | description | String? | yes | | - | deviceMeta | [DeviceMeta](#DeviceMeta)? | yes | | - | entityId | String? | yes | | - | entityType | String? | yes | | - | mediaResource | [[MediaMeta](#MediaMeta)]? | yes | | - | rating | Double? | yes | | - | reviewId | String? | yes | | - | templateId | String? | yes | | - | title | String? | yes | | - ---- - - - - - #### [UpdateVoteRequest](#UpdateVoteRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | action | String? | yes | | - | active | Bool? | yes | | - | id | String? | yes | | - | refId | String? | yes | | - | refType | String? | yes | | - ---- - - - - - #### [Url](#Url) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | main | String? | yes | | - | thumbnail | String? | yes | | - ---- - - - - - #### [Vote](#Vote) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | action | String? | yes | upvote and downvote | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | entity | [Entity](#Entity)? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | reference | [Entity](#Entity)? | yes | review | comment | - | state | [FeedbackState](#FeedbackState)? | yes | | - | tags | [[TagMeta](#TagMeta)]? | yes | | - ---- - - - - - #### [VoteCount](#VoteCount) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | downvote | Int? | yes | | - | upvote | Int? | yes | | - ---- - - - - - #### [VoteRequest](#VoteRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | action | String? | yes | | - | entityId | String? | yes | | - | entityType | String? | yes | | - | refId | String? | yes | | - | refType | String? | yes | review | comment | - ---- - - - - - #### [VoteResponse](#VoteResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Vote](#Vote)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - - - #### [UpdateCartShipmentItem](#UpdateCartShipmentItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | quantity | Int? | yes | Quantity of product in shipment | - | shipmentType | String | no | Shipment delivery type | - | articleUid | String | no | Article mongo id | - ---- - - - - - #### [UpdateCartShipmentRequest](#UpdateCartShipmentRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | shipments | [[UpdateCartShipmentItem](#UpdateCartShipmentItem)] | no | | - ---- - - - - - #### [Files](#Files) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | values | [String] | no | | - | key | String | no | | - ---- - - - - - #### [CartPosCheckoutDetailRequest](#CartPosCheckoutDetailRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | meta | [String: Any]? | yes | | - | addressId | String? | yes | | - | billingAddress | [String: Any]? | yes | | - | pos | Bool? | yes | | - | staff | [StaffCheckout](#StaffCheckout)? | yes | | - | deliveryAddress | [String: Any]? | yes | | - | files | [[Files](#Files)]? | yes | List of file url | - | fyndstoreEmpId | String? | yes | | - | aggregator | String? | yes | | - | orderType | String | no | | - | billingAddressId | String? | yes | | - | callbackUrl | String? | yes | | - | paymentMode | String | no | | - | extraMeta | [String: Any]? | yes | | - | paymentIdentifier | String? | yes | | - | paymentAutoConfirm | Bool? | yes | | - | merchantCode | String? | yes | | - | orderingStore | Int? | yes | | - | pickAtStoreUid | Int? | yes | | - | paymentParams | [String: Any]? | yes | | - ---- - - - - - #### [CartDeliveryModesResponse](#CartDeliveryModesResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pickupStores | [Int]? | yes | Store pick up available store uids | - | availableModes | [String]? | yes | Available delivery modes | - ---- - - - - - #### [PickupStoreDetail](#PickupStoreDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | city | String? | yes | | - | phone | String? | yes | | - | email | String? | yes | | - | storeCode | String? | yes | | - | uid | Int? | yes | | - | pincode | Int? | yes | | - | id | Int? | yes | | - | landmark | String? | yes | | - | addressType | String? | yes | | - | areaCode | String? | yes | | - | address | String? | yes | | - | name | String? | yes | | - | areaCodeSlug | String? | yes | | - | area | String? | yes | | - | country | String? | yes | | - | state | String? | yes | | - ---- - - - - - #### [StoreDetailsResponse](#StoreDetailsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[PickupStoreDetail](#PickupStoreDetail)]? | yes | | - ---- - - - - - - - #### [GetPincodeCityResponse](#GetPincodeCityResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | requestUuid | String | no | | - | stormbreakerUuid | String | no | | - | success | Bool | no | | - | data | [[LogisticPincodeData](#LogisticPincodeData)] | no | | - ---- - - - - - #### [LogisticPincodeData](#LogisticPincodeData) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | meta | [LogisticMeta](#LogisticMeta)? | yes | | - | parents | [[LogisticParents](#LogisticParents)]? | yes | | - | subType | String? | yes | | - | name | String? | yes | | - | error | [LogisticError](#LogisticError)? | yes | | - | uid | String? | yes | | - | displayName | String? | yes | | - ---- - - - - - #### [LogisticMeta](#LogisticMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | zone | String? | yes | | - | deliverables | [[String: Any]]? | yes | | - ---- - - - - - #### [LogisticParents](#LogisticParents) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | subType | String? | yes | | - | name | String? | yes | | - | displayName | String? | yes | | - | uid | String? | yes | | - ---- - - - - - #### [LogisticError](#LogisticError) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | value | String? | yes | | - | message | String? | yes | | - ---- - - - - - #### [GetTatProductReqBody](#GetTatProductReqBody) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | locationDetails | [[LocationDetailsReq](#LocationDetailsReq)] | no | | - | toPincode | String | no | | - | action | String? | yes | | - ---- - - - - - #### [LocationDetailsReq](#LocationDetailsReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | fromPincode | String? | yes | | - | articles | [[TatReqProductArticles](#TatReqProductArticles)]? | yes | | - | fulfillmentId | Int? | yes | | - ---- - - - - - #### [TatReqProductArticles](#TatReqProductArticles) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | category | [LogisticRequestCategory](#LogisticRequestCategory)? | yes | | - ---- - - - - - #### [LogisticRequestCategory](#LogisticRequestCategory) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | Int? | yes | | - | level | String? | yes | | - ---- - - - - - #### [GetTatProductResponse](#GetTatProductResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | locationDetails | [[LocationDetails](#LocationDetails)] | no | | - | requestUuid | String | no | | - | error | [String: Any] | no | | - | toCity | String | no | | - | source | String | no | | - | toPincode | String | no | | - | action | String | no | | - | stormbreakerUuid | String | no | | - | success | Bool | no | | - | identifier | String | no | | - | journey | String | no | | - ---- - - - - - #### [LocationDetails](#LocationDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | fromPincode | String? | yes | | - | articles | [[TatProductArticles](#TatProductArticles)]? | yes | | - | fulfillmentId | Int? | yes | | - ---- - - - - - #### [TatProductArticles](#TatProductArticles) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | error | [String: Any]? | yes | | - | category | [LogisticResponseCategory](#LogisticResponseCategory)? | yes | | - | promise | [LogisticPromise](#LogisticPromise)? | yes | | - ---- - - - - - #### [LogisticResponseCategory](#LogisticResponseCategory) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | Int? | yes | | - | level | String? | yes | | - ---- - - - - - #### [LogisticPromise](#LogisticPromise) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | timestamp | [LogisticTimestamp](#LogisticTimestamp)? | yes | | - | formatted | [Formatted](#Formatted)? | yes | | - ---- - - - - - #### [LogisticTimestamp](#LogisticTimestamp) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | min | Int? | yes | | - | max | Int? | yes | | - ---- - - - - - #### [Formatted](#Formatted) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | min | String? | yes | | - | max | String? | yes | | - ---- - - - - -### Enums - - - - - - - - - - - - #### [PriorityEnum](#PriorityEnum) - Type : string - - | Name | Value | Description | - | ---- | ----- | ----------- | - | low | low | This means ticket is low priority | - | medium | medium | This means ticket is medium priority | - | high | high | This means ticket is high priority | - | urgent | urgent | This means ticket is of urgent priority | - ---- - - - - #### [HistoryTypeEnum](#HistoryTypeEnum) - Type : string - - | Name | Value | Description | - | ---- | ----- | ----------- | - | rating | rating | This means history event is a rating | - | log | log | This means history event is a changelog | - | comment | comment | This means history event is a comment | - ---- - - - - #### [TicketAssetType](#TicketAssetType) - Type : string - - | Name | Value | Description | - | ---- | ----- | ----------- | - | image | image | Denotes asset is of image type | - | video | video | Denotes asset is of video type | - | file | file | Denotes asset is of file type | - | youtube | youtube | Denotes asset is an youtube link | - | product | product | Denotes asset is of product type | - | collection | collection | Denotes asset is of collection type | - | brand | brand | Denotes asset is of brand type | - | shipment | shipment | Denotes asset is of shipment type | - | order | order | Denotes asset is of order type | - ---- - - - - #### [TicketSourceEnum](#TicketSourceEnum) - Type : string - - | Name | Value | Description | - | ---- | ----- | ----------- | - | platformPanel | platform_panel | This means it is company level ticket | - | salesChannel | sales_channel | This means it is a application/sales channel level ticket | - ---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/documentation/PLATFORM.md b/documentation/PLATFORM.md deleted file mode 100644 index 38e6eaf56b..0000000000 --- a/documentation/PLATFORM.md +++ /dev/null @@ -1,59094 +0,0 @@ - - - - -# FDK Platform Front API Documentaion - - -* [Common](#Common) - Application configuration apis -* [Lead](#Lead) - Handles communication between Administrator <-> Staff and Staff <-> Users -* [Feedback](#Feedback) - User Reviews and Rating System -* [Theme](#Theme) - Responsible for themes -* [User](#User) - Authentication Service -* [Content](#Content) - Content System -* [Billing](#Billing) - Handle platform subscription -* [Communication](#Communication) - Manages email, sms, push notifications sent to users -* [Payment](#Payment) - Collect payment through many payment gateway i.e Stripe, Razorpay, Juspay etc.into Fynd or Self account -* [Order](#Order) - Handles Platform websites OMS -* [Catalog](#Catalog) - Catalog API's allows you to access list of products, prices, seller details, similar features, variants and many more useful features. -* [CompanyProfile](#CompanyProfile) - Company Profile API's allows you to access list of products, prices, seller details, similar features, variants and many more useful features. -* [FileStorage](#FileStorage) - File Storage -* [Share](#Share) - Short link and QR Code -* [Inventory](#Inventory) - -* [Configuration](#Configuration) - Application configuration apis -* [Cart](#Cart) - Cart APIs -* [Rewards](#Rewards) - Rewards -* [Analytics](#Analytics) - Perceptor analytics -* [Discount](#Discount) - Discount -* [Partner](#Partner) - Partner configuration apis -* [Webhook](#Webhook) - Webhook dispatcher with retry and one event to many subscriber vice versa - ----- - -### Classes and Methods - - -* ## [Common](#Common) - * Methods - * [getLocations](#getlocations) - - -* ## [Lead](#Lead) - * Methods - * [getTickets](#gettickets) - * [createTicket](#createticket) - * [getTickets](#gettickets) - * [getTicket](#getticket) - * [editTicket](#editticket) - * [getTicket](#getticket) - * [editTicket](#editticket) - * [createHistory](#createhistory) - * [getTicketHistory](#gettickethistory) - * [getFeedbacks](#getfeedbacks) - * [submitFeedback](#submitfeedback) - * [createHistory](#createhistory) - * [getTicketHistory](#gettickethistory) - * [getCustomForm](#getcustomform) - * [editCustomForm](#editcustomform) - * [getCustomForms](#getcustomforms) - * [createCustomForm](#createcustomform) - * [getTokenForVideoRoom](#gettokenforvideoroom) - * [getTokenForVideoRoom](#gettokenforvideoroom) - * [getVideoParticipants](#getvideoparticipants) - * [getVideoParticipants](#getvideoparticipants) - * [openVideoRoom](#openvideoroom) - * [closeVideoRoom](#closevideoroom) - - -* ## [Feedback](#Feedback) - * Methods - * [getAttributes](#getattributes) - * [getCustomerReviews](#getcustomerreviews) - * [updateApprove](#updateapprove) - * [getHistory](#gethistory) - * [getApplicationTemplates](#getapplicationtemplates) - * [createTemplate](#createtemplate) - * [getTemplateById](#gettemplatebyid) - * [updateTemplate](#updatetemplate) - * [updateTemplateStatus](#updatetemplatestatus) - - -* ## [Theme](#Theme) - * Methods - * [getAllPages](#getallpages) - * [createPage](#createpage) - * [updateMultiplePages](#updatemultiplepages) - * [getPage](#getpage) - * [updatePage](#updatepage) - * [deletePage](#deletepage) - * [getThemeLibrary](#getthemelibrary) - * [addToThemeLibrary](#addtothemelibrary) - * [applyTheme](#applytheme) - * [isUpgradable](#isupgradable) - * [upgradeTheme](#upgradetheme) - * [getPublicThemes](#getpublicthemes) - * [createTheme](#createtheme) - * [getAppliedTheme](#getappliedtheme) - * [getFonts](#getfonts) - * [getThemeById](#getthemebyid) - * [updateTheme](#updatetheme) - * [deleteTheme](#deletetheme) - * [getThemeForPreview](#getthemeforpreview) - * [publishTheme](#publishtheme) - * [unpublishTheme](#unpublishtheme) - * [archiveTheme](#archivetheme) - * [unarchiveTheme](#unarchivetheme) - - -* ## [User](#User) - * Methods - * [getCustomers](#getcustomers) - * [searchUsers](#searchusers) - * [createUser](#createuser) - * [updateUser](#updateuser) - * [createUserSession](#createusersession) - * [getPlatformConfig](#getplatformconfig) - * [updatePlatformConfig](#updateplatformconfig) - - -* ## [Content](#Content) - * Methods - * [getAnnouncementsList](#getannouncementslist) - * [createAnnouncement](#createannouncement) - * [getAnnouncementById](#getannouncementbyid) - * [updateAnnouncement](#updateannouncement) - * [updateAnnouncementSchedule](#updateannouncementschedule) - * [deleteAnnouncement](#deleteannouncement) - * [createBlog](#createblog) - * [getBlogs](#getblogs) - * [updateBlog](#updateblog) - * [deleteBlog](#deleteblog) - * [getComponentById](#getcomponentbyid) - * [getFaqCategories](#getfaqcategories) - * [getFaqCategoryBySlugOrId](#getfaqcategorybyslugorid) - * [createFaqCategory](#createfaqcategory) - * [updateFaqCategory](#updatefaqcategory) - * [deleteFaqCategory](#deletefaqcategory) - * [getFaqsByCategoryIdOrSlug](#getfaqsbycategoryidorslug) - * [addFaq](#addfaq) - * [updateFaq](#updatefaq) - * [deleteFaq](#deletefaq) - * [getFaqByIdOrSlug](#getfaqbyidorslug) - * [getLandingPages](#getlandingpages) - * [createLandingPage](#createlandingpage) - * [updateLandingPage](#updatelandingpage) - * [deleteLandingPage](#deletelandingpage) - * [getLegalInformation](#getlegalinformation) - * [updateLegalInformation](#updatelegalinformation) - * [getNavigations](#getnavigations) - * [createNavigation](#createnavigation) - * [getDefaultNavigations](#getdefaultnavigations) - * [getNavigationBySlug](#getnavigationbyslug) - * [updateNavigation](#updatenavigation) - * [deleteNavigation](#deletenavigation) - * [getPageMeta](#getpagemeta) - * [getPageSpec](#getpagespec) - * [createPage](#createpage) - * [getPages](#getpages) - * [createPagePreview](#createpagepreview) - * [updatePagePreview](#updatepagepreview) - * [updatePage](#updatepage) - * [deletePage](#deletepage) - * [getPageBySlug](#getpagebyslug) - * [getSEOConfiguration](#getseoconfiguration) - * [updateSEOConfiguration](#updateseoconfiguration) - * [getSlideshows](#getslideshows) - * [createSlideshow](#createslideshow) - * [getSlideshowBySlug](#getslideshowbyslug) - * [updateSlideshow](#updateslideshow) - * [deleteSlideshow](#deleteslideshow) - * [getSupportInformation](#getsupportinformation) - * [updateSupportInformation](#updatesupportinformation) - * [updateInjectableTag](#updateinjectabletag) - * [deleteAllInjectableTags](#deleteallinjectabletags) - * [getInjectableTags](#getinjectabletags) - * [addInjectableTag](#addinjectabletag) - * [removeInjectableTag](#removeinjectabletag) - * [editInjectableTag](#editinjectabletag) - - -* ## [Billing](#Billing) - * Methods - * [createSubscriptionCharge](#createsubscriptioncharge) - * [getSubscriptionCharge](#getsubscriptioncharge) - * [cancelSubscriptionCharge](#cancelsubscriptioncharge) - * [getInvoices](#getinvoices) - * [getInvoiceById](#getinvoicebyid) - * [getCustomerDetail](#getcustomerdetail) - * [upsertCustomerDetail](#upsertcustomerdetail) - * [getSubscription](#getsubscription) - * [getFeatureLimitConfig](#getfeaturelimitconfig) - * [activateSubscriptionPlan](#activatesubscriptionplan) - * [cancelSubscriptionPlan](#cancelsubscriptionplan) - - -* ## [Communication](#Communication) - * Methods - * [getCampaigns](#getcampaigns) - * [createCampaign](#createcampaign) - * [getCampaignById](#getcampaignbyid) - * [updateCampaignById](#updatecampaignbyid) - * [getStatsOfCampaignById](#getstatsofcampaignbyid) - * [getAudiences](#getaudiences) - * [createAudience](#createaudience) - * [getBigqueryHeaders](#getbigqueryheaders) - * [getAudienceById](#getaudiencebyid) - * [updateAudienceById](#updateaudiencebyid) - * [getNSampleRecordsFromCsv](#getnsamplerecordsfromcsv) - * [getEmailProviders](#getemailproviders) - * [createEmailProvider](#createemailprovider) - * [getEmailProviderById](#getemailproviderbyid) - * [updateEmailProviderById](#updateemailproviderbyid) - * [getEmailTemplates](#getemailtemplates) - * [createEmailTemplate](#createemailtemplate) - * [getSystemEmailTemplates](#getsystememailtemplates) - * [getEmailTemplateById](#getemailtemplatebyid) - * [updateEmailTemplateById](#updateemailtemplatebyid) - * [deleteEmailTemplateById](#deleteemailtemplatebyid) - * [getEventSubscriptions](#geteventsubscriptions) - * [getJobs](#getjobs) - * [triggerCampaignJob](#triggercampaignjob) - * [getJobLogs](#getjoblogs) - * [getCommunicationLogs](#getcommunicationlogs) - * [getSystemNotifications](#getsystemnotifications) - * [getSmsProviders](#getsmsproviders) - * [createSmsProvider](#createsmsprovider) - * [getSmsProviderById](#getsmsproviderbyid) - * [updateSmsProviderById](#updatesmsproviderbyid) - * [getSmsTemplates](#getsmstemplates) - * [createSmsTemplate](#createsmstemplate) - * [getSmsTemplateById](#getsmstemplatebyid) - * [updateSmsTemplateById](#updatesmstemplatebyid) - * [deleteSmsTemplateById](#deletesmstemplatebyid) - * [getSystemSystemTemplates](#getsystemsystemtemplates) - - -* ## [Payment](#Payment) - * Methods - * [getBrandPaymentGatewayConfig](#getbrandpaymentgatewayconfig) - * [saveBrandPaymentGatewayConfig](#savebrandpaymentgatewayconfig) - * [updateBrandPaymentGatewayConfig](#updatebrandpaymentgatewayconfig) - * [getPaymentModeRoutes](#getpaymentmoderoutes) - * [getAllPayouts](#getallpayouts) - * [savePayout](#savepayout) - * [updatePayout](#updatepayout) - * [activateAndDectivatePayout](#activateanddectivatepayout) - * [deletePayout](#deletepayout) - * [getSubscriptionPaymentMethod](#getsubscriptionpaymentmethod) - * [deleteSubscriptionPaymentMethod](#deletesubscriptionpaymentmethod) - * [getSubscriptionConfig](#getsubscriptionconfig) - * [saveSubscriptionSetupIntent](#savesubscriptionsetupintent) - * [addBeneficiaryDetails](#addbeneficiarydetails) - * [verifyIfscCode](#verifyifsccode) - * [getUserOrderBeneficiaries](#getuserorderbeneficiaries) - * [getUserBeneficiaries](#getuserbeneficiaries) - * [confirmPayment](#confirmpayment) - - -* ## [Order](#Order) - * Methods - * [shipmentStatusUpdate](#shipmentstatusupdate) - * [activityStatus](#activitystatus) - * [storeProcessShipmentUpdate](#storeprocessshipmentupdate) - * [checkRefund](#checkrefund) - * [getOrdersByCompanyId](#getordersbycompanyid) - * [getOrderLanesCountByCompanyId](#getorderlanescountbycompanyid) - * [getOrderDetails](#getorderdetails) - * [getPicklistOrdersByCompanyId](#getpicklistordersbycompanyid) - * [trackShipmentPlatform](#trackshipmentplatform) - * [trackOrder](#trackorder) - * [failedOrders](#failedorders) - * [reprocessOrder](#reprocessorder) - * [updateShipment](#updateshipment) - * [getPlatformShipmentReasons](#getplatformshipmentreasons) - * [getShipmentTrackDetails](#getshipmenttrackdetails) - * [getShipmentAddress](#getshipmentaddress) - * [updateShipmentAddress](#updateshipmentaddress) - * [getPing](#getping) - * [voiceCallback](#voicecallback) - * [voiceClickToCall](#voiceclicktocall) - - -* ## [Catalog](#Catalog) - * Methods - * [deleteSearchKeywords](#deletesearchkeywords) - * [updateSearchKeywords](#updatesearchkeywords) - * [getSearchKeywords](#getsearchkeywords) - * [createCustomKeyword](#createcustomkeyword) - * [getAllSearchKeyword](#getallsearchkeyword) - * [deleteAutocompleteKeyword](#deleteautocompletekeyword) - * [updateAutocompleteKeyword](#updateautocompletekeyword) - * [getAutocompleteKeywordDetail](#getautocompletekeyworddetail) - * [createCustomAutocompleteRule](#createcustomautocompleterule) - * [getAutocompleteConfig](#getautocompleteconfig) - * [createProductBundle](#createproductbundle) - * [getProductBundle](#getproductbundle) - * [updateProductBundle](#updateproductbundle) - * [getProductBundleDetail](#getproductbundledetail) - * [createSizeGuide](#createsizeguide) - * [getSizeGuides](#getsizeguides) - * [updateSizeGuide](#updatesizeguide) - * [getSizeGuide](#getsizeguide) - * [getCatalogConfiguration](#getcatalogconfiguration) - * [createConfigurationProductListing](#createconfigurationproductlisting) - * [getConfigurations](#getconfigurations) - * [createConfigurationByType](#createconfigurationbytype) - * [getConfigurationByType](#getconfigurationbytype) - * [getQueryFilters](#getqueryfilters) - * [createCollection](#createcollection) - * [getAllCollections](#getallcollections) - * [getCollectionDetail](#getcollectiondetail) - * [deleteCollection](#deletecollection) - * [updateCollection](#updatecollection) - * [addCollectionItems](#addcollectionitems) - * [getCollectionItems](#getcollectionitems) - * [getCatalogInsights](#getcataloginsights) - * [getSellerInsights](#getsellerinsights) - * [createMarketplaceOptin](#createmarketplaceoptin) - * [getMarketplaceOptinDetail](#getmarketplaceoptindetail) - * [getCompanyDetail](#getcompanydetail) - * [getCompanyBrandDetail](#getcompanybranddetail) - * [getCompanyMetrics](#getcompanymetrics) - * [getStoreDetail](#getstoredetail) - * [getGenderAttribute](#getgenderattribute) - * [listProductTemplateCategories](#listproducttemplatecategories) - * [listDepartmentsData](#listdepartmentsdata) - * [getDepartmentData](#getdepartmentdata) - * [listProductTemplate](#listproducttemplate) - * [validateProductTemplate](#validateproducttemplate) - * [downloadProductTemplateViews](#downloadproducttemplateviews) - * [downloadProductTemplateView](#downloadproducttemplateview) - * [validateProductTemplateSchema](#validateproducttemplateschema) - * [listHSNCodes](#listhsncodes) - * [listProductTemplateExportDetails](#listproducttemplateexportdetails) - * [listTemplateBrandTypeValues](#listtemplatebrandtypevalues) - * [createCategories](#createcategories) - * [listCategories](#listcategories) - * [updateCategory](#updatecategory) - * [getCategoryData](#getcategorydata) - * [createProduct](#createproduct) - * [getProducts](#getproducts) - * [deleteProduct](#deleteproduct) - * [editProduct](#editproduct) - * [getProduct](#getproduct) - * [getProductValidation](#getproductvalidation) - * [getProductSize](#getproductsize) - * [updateProductAssetsInBulk](#updateproductassetsinbulk) - * [getProductBulkUploadHistory](#getproductbulkuploadhistory) - * [deleteProductBulkJob](#deleteproductbulkjob) - * [createProductsInBulk](#createproductsinbulk) - * [getCompanyTags](#getcompanytags) - * [createProductAssetsInBulk](#createproductassetsinbulk) - * [getProductAssetsInBulk](#getproductassetsinbulk) - * [deleteSize](#deletesize) - * [addInventory](#addinventory) - * [getInventoryBySize](#getinventorybysize) - * [getInventoryBySizeIdentifier](#getinventorybysizeidentifier) - * [deleteInventory](#deleteinventory) - * [createBulkInventoryJob](#createbulkinventoryjob) - * [getInventoryBulkUploadHistory](#getinventorybulkuploadhistory) - * [deleteBulkInventoryJob](#deletebulkinventoryjob) - * [createBulkInventory](#createbulkinventory) - * [createInventoryExportJob](#createinventoryexportjob) - * [getInventoryExport](#getinventoryexport) - * [exportInventoryConfig](#exportinventoryconfig) - * [createHsnCode](#createhsncode) - * [getAllHsnCodes](#getallhsncodes) - * [updateHsnCode](#updatehsncode) - * [getHsnCode](#gethsncode) - * [bulkHsnCode](#bulkhsncode) - * [getApplicationBrands](#getapplicationbrands) - * [getDepartments](#getdepartments) - * [getCategories](#getcategories) - * [getAppicationProducts](#getappicationproducts) - * [getProductDetailBySlug](#getproductdetailbyslug) - * [getAppProducts](#getappproducts) - - -* ## [CompanyProfile](#CompanyProfile) - * Methods - * [cbsOnboardGet](#cbsonboardget) - * [updateCompany](#updatecompany) - * [getCompanyMetrics](#getcompanymetrics) - * [getBrand](#getbrand) - * [editBrand](#editbrand) - * [createBrand](#createbrand) - * [getBrands](#getbrands) - * [createCompanyBrandMapping](#createcompanybrandmapping) - * [getLocations](#getlocations) - * [createLocation](#createlocation) - * [getLocationDetail](#getlocationdetail) - * [updateLocation](#updatelocation) - * [createLocationBulk](#createlocationbulk) - - -* ## [FileStorage](#FileStorage) - * Methods - * [startUpload](#startupload) - * [completeUpload](#completeupload) - * [appStartUpload](#appstartupload) - * [appCompleteUpload](#appcompleteupload) - * [getSignUrls](#getsignurls) - * [copyFiles](#copyfiles) - * [appCopyFiles](#appcopyfiles) - * [browse](#browse) - * [browse](#browse) - * [proxy](#proxy) - - -* ## [Share](#Share) - * Methods - * [createShortLink](#createshortlink) - * [getShortLinks](#getshortlinks) - * [getShortLinkByHash](#getshortlinkbyhash) - * [updateShortLinkById](#updateshortlinkbyid) - - -* ## [Inventory](#Inventory) - * Methods - * [getJobsByCompany](#getjobsbycompany) - * [updateJob](#updatejob) - * [createJob](#createjob) - * [getJobByCompanyAndIntegration](#getjobbycompanyandintegration) - * [getJobConfigDefaults](#getjobconfigdefaults) - * [getJobByCode](#getjobbycode) - * [getJobCodeMetrics](#getjobcodemetrics) - * [getJobCodesByCompanyAndIntegration](#getjobcodesbycompanyandintegration) - - -* ## [Configuration](#Configuration) - * Methods - * [getBuildConfig](#getbuildconfig) - * [updateBuildConfig](#updatebuildconfig) - * [getPreviousVersions](#getpreviousversions) - * [getAppFeatures](#getappfeatures) - * [updateAppFeatures](#updateappfeatures) - * [getAppBasicDetails](#getappbasicdetails) - * [updateAppBasicDetails](#updateappbasicdetails) - * [getAppContactInfo](#getappcontactinfo) - * [updateAppContactInfo](#updateappcontactinfo) - * [getAppApiTokens](#getappapitokens) - * [updateAppApiTokens](#updateappapitokens) - * [getAppCompanies](#getappcompanies) - * [getAppStores](#getappstores) - * [getInventoryConfig](#getinventoryconfig) - * [updateInventoryConfig](#updateinventoryconfig) - * [partiallyUpdateInventoryConfig](#partiallyupdateinventoryconfig) - * [getAppCurrencyConfig](#getappcurrencyconfig) - * [updateAppCurrencyConfig](#updateappcurrencyconfig) - * [getOrderingStoresByFilter](#getorderingstoresbyfilter) - * [updateOrderingStoreConfig](#updateorderingstoreconfig) - * [getDomains](#getdomains) - * [addDomain](#adddomain) - * [removeDomainById](#removedomainbyid) - * [changeDomainType](#changedomaintype) - * [getDomainStatus](#getdomainstatus) - * [createApplication](#createapplication) - * [getApplications](#getapplications) - * [getApplicationById](#getapplicationbyid) - * [getCurrencies](#getcurrencies) - * [getDomainAvailibility](#getdomainavailibility) - * [getIntegrationById](#getintegrationbyid) - * [getAvailableOptIns](#getavailableoptins) - * [getSelectedOptIns](#getselectedoptins) - * [getIntegrationLevelConfig](#getintegrationlevelconfig) - * [getIntegrationByLevelId](#getintegrationbylevelid) - * [getLevelActiveIntegrations](#getlevelactiveintegrations) - * [getBrandsByCompany](#getbrandsbycompany) - * [getCompanyByBrands](#getcompanybybrands) - * [getStoreByBrands](#getstorebybrands) - * [getOtherSellerApplications](#getothersellerapplications) - * [getOtherSellerApplicationById](#getothersellerapplicationbyid) - * [optOutFromApplication](#optoutfromapplication) - - -* ## [Cart](#Cart) - * Methods - * [getCoupons](#getcoupons) - * [createCoupon](#createcoupon) - * [getCouponById](#getcouponbyid) - * [updateCoupon](#updatecoupon) - * [updateCouponPartially](#updatecouponpartially) - * [fetchAndvalidateCartItems](#fetchandvalidatecartitems) - * [checkCartServiceability](#checkcartserviceability) - * [checkoutCart](#checkoutcart) - - -* ## [Rewards](#Rewards) - * Methods - * [getGiveaways](#getgiveaways) - * [createGiveaway](#creategiveaway) - * [getGiveawayByID](#getgiveawaybyid) - * [updateGiveaway](#updategiveaway) - * [getOffers](#getoffers) - * [getOfferByName](#getofferbyname) - * [updateOfferByName](#updateofferbyname) - * [getUserAvailablePoints](#getuseravailablepoints) - * [updateUserStatus](#updateuserstatus) - * [getUserPointsHistory](#getuserpointshistory) - - -* ## [Analytics](#Analytics) - * Methods - * [getStatiscticsGroups](#getstatiscticsgroups) - * [getStatiscticsGroupComponents](#getstatiscticsgroupcomponents) - * [getComponentStatsCSV](#getcomponentstatscsv) - * [getComponentStatsPDF](#getcomponentstatspdf) - * [getComponentStats](#getcomponentstats) - * [getAbandonCartList](#getabandoncartlist) - * [getAbandonCartsCSV](#getabandoncartscsv) - * [getAbandonCartDetail](#getabandoncartdetail) - * [createExportJob](#createexportjob) - * [getExportJobStatus](#getexportjobstatus) - * [getLogsList](#getlogslist) - * [searchLogs](#searchlogs) - - -* ## [Discount](#Discount) - * Methods - * [getDiscounts](#getdiscounts) - * [createDiscount](#creatediscount) - * [getDiscount](#getdiscount) - * [updateDiscount](#updatediscount) - * [validateDiscountFile](#validatediscountfile) - * [downloadDiscountFile](#downloaddiscountfile) - * [getValidationJob](#getvalidationjob) - * [cancelValidationJob](#cancelvalidationjob) - * [getDownloadJob](#getdownloadjob) - * [cancelDownloadJob](#canceldownloadjob) - - -* ## [Partner](#Partner) - * Methods - * [addProxyPath](#addproxypath) - * [removeProxyPath](#removeproxypath) - - -* ## [Webhook](#Webhook) - * Methods - * [getSubscribersByCompany](#getsubscribersbycompany) - * [registerSubscriberToEvent](#registersubscribertoevent) - * [updateSubscriberConfig](#updatesubscriberconfig) - * [getSubscriberById](#getsubscriberbyid) - * [fetchAllEventConfigurations](#fetchalleventconfigurations) - - - ---- - - - -## Common - - -#### getLocations -Get countries, states, cities - - - -```swift -common.getLocations(locationType: locationType, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| locationType | String? | no | Provide location type to query on. Possible values : country, state, city | -| id | String? | no | Field is optional when location_type is country. If querying for state, provide id of country. If querying for city, provide id of state. | - - - - - -*Returned Response:* - - - - -[Locations](#Locations) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - - - -## Lead - - -#### getTickets -Gets the list of company level tickets and/or ticket filters depending on query params - - - -```swift -lead.getTickets(companyId: companyId, items: items, filters: filters, q: q, status: status, priority: priority, category: category, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID for which the data will be returned | -| items | Bool? | no | Decides that the reponse will contain the list of tickets | -| filters | Bool? | no | Decides that the reponse will contain the ticket filters | -| q | String? | no | Search through ticket titles and description | -| status | String? | no | Filter tickets on status | -| priority | PriorityEnum? | no | Filter tickets on priority | -| category | String? | no | Filter tickets on category | -| pageNo | Int? | no | The page number to navigate through the given set of results. | -| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | - - - -Gets the list of company level tickets and/or ticket filters - -*Returned Response:* - - - - -[TicketList](#TicketList) - -Success - - - - -
    -  Examples: - - -
    -  Without items - -```json -{ - "value": { - "filters": { - "statuses": [ - { - "display": "Pending", - "color": "#eae22b", - "key": "pending" - }, - { - "display": "In Progress", - "color": "#ffa951", - "key": "in_progress" - }, - { - "display": "Resolved", - "color": "#20c3a6", - "key": "resolved" - }, - { - "display": "Closed", - "color": "#41434c", - "key": "closed" - } - ], - "priorities": [ - { - "display": "Low", - "color": "#fed766", - "key": "low" - }, - { - "display": "Medium", - "color": "#f37736", - "key": "medium" - }, - { - "display": "High", - "color": "#fe4a49", - "key": "high" - } - ], - "assignees": [], - "categories": [ - { - "form": { - "login_required": false, - "should_notify": false, - "inputs": [ - { - "type": "email", - "showRegexInput": false, - "enum": [], - "regex": "\\S+@\\S+\\.\\S+", - "display": "email", - "required": true, - "key": "email" - } - ], - "available_assignees": [], - "_id": "602e900a2042255c03cadaf0", - "title": "service-test-satyen", - "description": "testing form from service", - "slug": "service-test-satyen", - "header_image": "https://hdn-1.addsale.com/x0/support-ticket/files/free/original/KZL86aN5l-service-test-satyen.jpeg", - "application_id": "000000000000000000000001", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.150" - }, - "os": { - "name": "macOS", - "version": "11.2.0" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5f8147abbd1a0a870f61f1a6", - "createdAt": "2021-02-18T16:04:26.495Z", - "updatedAt": "2021-02-18T16:04:26.495Z", - "__v": 0 - }, - "key": "service-test-satyen", - "display": "service-test-satyen" - } - ] - } - } -} -``` -
    - -
    -  With items - -```json -{ - "value": { - "docs": [ - { - "_id": "602d2652ce284d0b008d5c97", - "status": { - "display": "Pending", - "color": "#eae22b", - "key": "pending" - }, - "priority": { - "display": "Medium", - "color": "#f37736", - "key": "medium" - }, - "assigned_to": { - "agent_id": "5e79e721768c6bf54b783146", - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", - "hasOldPasswordHash": false, - "_id": "5e79e721768c6bf54b783146", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "nikhilmanapure@gofynd.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "nikhilmanapure@fynd.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "nikhilmanapure@uniket.store" - } - ], - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "username": "nikhilmanapure_gofynd_com_29298", - "createdAt": "2020-03-24T10:55:29.298Z", - "updatedAt": "2020-05-12T07:46:41.816Z", - "uid": "5567", - "__v": 2 - }, - "tags": [ - "asdf444" - ], - "context": { - "application_id": "000000000000000000000001", - "company_id": "1" - }, - "created_on": { - "user_agent": "Fynd Platform/0.0.1 (com.fynd.platform; build:3; iOS 14.2.0) Alamofire/5.0.2", - "platform": "web", - "meta": { - "browser": { - "name": "Fynd Platform", - "version": "0.0.1" - } - } - }, - "source": "sales_channel", - "content": { - "title": "asdf444 Response", - "description": "", - "attachments": [] - }, - "response_id": "602d2652ce284dee3c8d5c96", - "category": { - "form": { - "login_required": false, - "should_notify": true, - "inputs": [ - { - "type": "text", - "showRegexInput": false, - "enum": [], - "display": "asdf", - "key": "asdf" - }, - { - "type": "mobile", - "showRegexInput": false, - "enum": [], - "display": "mob num", - "regex": "[0-9]{10}$", - "key": "mob-num" - } - ], - "available_assignees": [ - "5e79e721768c6bf54b783146" - ], - "_id": "60124e4a4d2bc363625e1bf4", - "title": "asdf444", - "description": "adf", - "slug": "asdf444", - "application_id": "000000000000000000000001", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.96" - }, - "os": { - "name": "macOS", - "version": "10.15.7", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5e79e721768c6bf54b783146", - "createdAt": "2021-01-28T05:40:26.271Z", - "updatedAt": "2021-02-18T16:02:32.086Z", - "__v": 0, - "poll_for_assignment": { - "duration": 20, - "message": "We are looking for executive to connect you", - "success_message": "Executive found", - "failure_message": "All our executives are busy at the moment, We have accepted your request and someone will connect with you soon!" - } - }, - "key": "asdf444", - "display": "asdf444" - }, - "ticket_id": "472", - "createdAt": "2021-02-17T14:21:06.774Z", - "updatedAt": "2021-02-17T14:21:06.774Z", - "__v": 0, - "id": "602d2652ce284d0b008d5c97" - } - ], - "total": 472, - "limit": 10, - "page": 1, - "pages": 48, - "filters": { - "statuses": [ - { - "display": "Pending", - "color": "#eae22b", - "key": "pending" - }, - { - "display": "In Progress", - "color": "#ffa951", - "key": "in_progress" - }, - { - "display": "Resolved", - "color": "#20c3a6", - "key": "resolved" - }, - { - "display": "Closed", - "color": "#41434c", - "key": "closed" - } - ], - "priorities": [ - { - "display": "Low", - "color": "#fed766", - "key": "low" - }, - { - "display": "Medium", - "color": "#f37736", - "key": "medium" - }, - { - "display": "High", - "color": "#fe4a49", - "key": "high" - } - ], - "assignees": [], - "categories": [ - { - "form": { - "login_required": false, - "should_notify": false, - "inputs": [ - { - "type": "email", - "showRegexInput": false, - "enum": [], - "regex": "\\S+@\\S+\\.\\S+", - "display": "email", - "required": true, - "key": "email" - } - ], - "available_assignees": [], - "_id": "602e900a2042255c03cadaf0", - "title": "service-test-satyen", - "description": "testing form from service", - "slug": "service-test-satyen", - "header_image": "https://hdn-1.addsale.com/x0/support-ticket/files/free/original/KZL86aN5l-service-test-satyen.jpeg", - "application_id": "000000000000000000000001", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.150" - }, - "os": { - "name": "macOS", - "version": "11.2.0" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5f8147abbd1a0a870f61f1a6", - "createdAt": "2021-02-18T16:04:26.495Z", - "updatedAt": "2021-02-18T16:04:26.495Z", - "__v": 0 - }, - "key": "service-test-satyen", - "display": "service-test-satyen" - } - ] - } - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createTicket -Creates a company level ticket - - - -```swift -lead.createTicket(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID for which the data will be returned | -| body | AddTicketPayload | no | Request body | - - -Creates a company level ticket - -*Returned Response:* - - - - -[Ticket](#Ticket) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "context": { - "company_id": "884" - }, - "content": { - "title": "SOme title Response", - "description": "Single lineeee: asdf
    Email: asdf@asdf.com
    dfsdf: asdf
    ", - "attachments": [] - }, - "status": { - "display": "In Progress", - "color": "#ffa951", - "key": "in_progress" - }, - "priority": { - "display": "Medium", - "color": "#f37736", - "key": "medium" - }, - "assigned_to": { - "agent_id": "5d1363adf599d850df93175e", - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", - "hasOldPasswordHash": false, - "_id": "5d1363adf599d850df93175e", - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - } - ], - "username": "nikhilmshchs_gmail_com_38425_20500281", - "createdAt": "2019-01-01T17:22:38.528Z", - "updatedAt": "2021-01-22T10:02:42.258Z", - "uid": "20500281", - "__v": 56 - }, - "tags": [ - "some-title" - ], - "_id": "6012f38557751ee8fc162cf7", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.96" - }, - "os": { - "name": "macOS", - "version": "10.15.7", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "source": "sales_channel", - "created_by": { - "id": "5d1363adf599d850df93175e", - "user": { - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", - "hasOldPasswordHash": false, - "_id": "5d1363adf599d850df93175e", - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - } - ], - "username": "nikhilmshchs_gmail_com_38425_20500281", - "createdAt": "2019-01-01T17:22:38.528Z", - "updatedAt": "2021-01-22T10:02:42.258Z", - "uid": "20500281", - "__v": 56 - } - }, - "response_id": "6012f38457751e0fb8162cf6", - "category": { - "form": { - "login_required": false, - "should_notify": false, - "inputs": [ - { - "required": false, - "type": "text", - "enum": [], - "display": "Single lineeee", - "key": "single-lineeee", - "showRegexInput": false - }, - { - "required": false, - "type": "email", - "enum": [], - "display": "Email", - "regex": "\\S+@\\S+\\.\\S+", - "key": "email", - "showRegexInput": true - }, - { - "required": false, - "type": "text", - "enum": [], - "display": "dfsdf", - "key": "dfsdf", - "showRegexInput": false - } - ], - "available_assignees": [ - "5b9b98150df588546aaea6d2", - "5c45d78395d7504f76c2cb37" - ], - "_id": "5fd72db3dc250f8decfc61b2", - "title": "SOme title", - "description": "SOme big description", - "slug": "some-title", - "application_id": "000000000000000000000003", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "87.0.4280.88" - }, - "os": { - "name": "macOS", - "version": "10.15.6", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5d1363adf599d850df93175e", - "createdAt": "2020-12-14T09:17:39.953Z", - "updatedAt": "2021-01-28T18:48:07.717Z", - "__v": 0 - }, - "key": "some-title", - "display": "SOme title" - }, - "ticket_id": "43", - "createdAt": "2021-01-28T17:25:25.013Z", - "updatedAt": "2021-01-28T17:25:33.396Z", - "__v": 0, - "video_room_id": "6012f38557751ee8fc162cf7" - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getTickets -Gets the list of Application level Tickets and/or ticket filters depending on query params - - - -```swift -lead.getTickets(companyId: companyId, applicationId: applicationId, items: items, filters: filters, q: q, status: status, priority: priority, category: category) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID of the application | -| applicationId | String | yes | Application ID for which the data will be returned | -| items | Bool? | no | Decides that the reponse will contain the list of tickets | -| filters | Bool? | no | Decides that the reponse will contain the ticket filters | -| q | String? | no | Search through ticket titles and description | -| status | String? | no | Filter tickets on status | -| priority | PriorityEnum? | no | Filter tickets on priority | -| category | String? | no | Filter tickets on category | - - - -Gets the list of Application level Tickets and/or ticket filters - -*Returned Response:* - - - - -[TicketList](#TicketList) - -Success - - - - -
    -  Examples: - - -
    -  Without items - -```json -{ - "value": { - "filters": { - "statuses": [ - { - "display": "Pending", - "color": "#eae22b", - "key": "pending" - }, - { - "display": "In Progress", - "color": "#ffa951", - "key": "in_progress" - }, - { - "display": "Resolved", - "color": "#20c3a6", - "key": "resolved" - }, - { - "display": "Closed", - "color": "#41434c", - "key": "closed" - } - ], - "priorities": [ - { - "display": "Low", - "color": "#fed766", - "key": "low" - }, - { - "display": "Medium", - "color": "#f37736", - "key": "medium" - }, - { - "display": "High", - "color": "#fe4a49", - "key": "high" - } - ], - "assignees": [], - "categories": [ - { - "form": { - "login_required": false, - "should_notify": false, - "inputs": [ - { - "type": "email", - "showRegexInput": false, - "enum": [], - "regex": "\\S+@\\S+\\.\\S+", - "display": "email", - "required": true, - "key": "email" - } - ], - "available_assignees": [], - "_id": "602e900a2042255c03cadaf0", - "title": "service-test-satyen", - "description": "testing form from service", - "slug": "service-test-satyen", - "header_image": "https://hdn-1.addsale.com/x0/support-ticket/files/free/original/KZL86aN5l-service-test-satyen.jpeg", - "application_id": "000000000000000000000001", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.150" - }, - "os": { - "name": "macOS", - "version": "11.2.0" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5f8147abbd1a0a870f61f1a6", - "createdAt": "2021-02-18T16:04:26.495Z", - "updatedAt": "2021-02-18T16:04:26.495Z", - "__v": 0 - }, - "key": "service-test-satyen", - "display": "service-test-satyen" - } - ] - } - } -} -``` -
    - -
    -  With items - -```json -{ - "value": { - "docs": [ - { - "_id": "602d2652ce284d0b008d5c97", - "status": { - "display": "Pending", - "color": "#eae22b", - "key": "pending" - }, - "priority": { - "display": "Medium", - "color": "#f37736", - "key": "medium" - }, - "assigned_to": { - "agent_id": "5e79e721768c6bf54b783146", - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", - "hasOldPasswordHash": false, - "_id": "5e79e721768c6bf54b783146", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "nikhilmanapure@gofynd.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "nikhilmanapure@fynd.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "nikhilmanapure@uniket.store" - } - ], - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "username": "nikhilmanapure_gofynd_com_29298", - "createdAt": "2020-03-24T10:55:29.298Z", - "updatedAt": "2020-05-12T07:46:41.816Z", - "uid": "5567", - "__v": 2 - }, - "tags": [ - "asdf444" - ], - "context": { - "application_id": "000000000000000000000001", - "company_id": "1" - }, - "created_on": { - "user_agent": "Fynd Platform/0.0.1 (com.fynd.platform; build:3; iOS 14.2.0) Alamofire/5.0.2", - "platform": "web", - "meta": { - "browser": { - "name": "Fynd Platform", - "version": "0.0.1" - } - } - }, - "source": "sales_channel", - "content": { - "title": "asdf444 Response", - "description": "", - "attachments": [] - }, - "response_id": "602d2652ce284dee3c8d5c96", - "category": { - "form": { - "login_required": false, - "should_notify": true, - "inputs": [ - { - "type": "text", - "showRegexInput": false, - "enum": [], - "display": "asdf", - "key": "asdf" - }, - { - "type": "mobile", - "showRegexInput": false, - "enum": [], - "display": "mob num", - "regex": "[0-9]{10}$", - "key": "mob-num" - } - ], - "available_assignees": [ - "5e79e721768c6bf54b783146" - ], - "_id": "60124e4a4d2bc363625e1bf4", - "title": "asdf444", - "description": "adf", - "slug": "asdf444", - "application_id": "000000000000000000000001", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.96" - }, - "os": { - "name": "macOS", - "version": "10.15.7", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5e79e721768c6bf54b783146", - "createdAt": "2021-01-28T05:40:26.271Z", - "updatedAt": "2021-02-18T16:02:32.086Z", - "__v": 0, - "poll_for_assignment": { - "duration": 20, - "message": "We are looking for executive to connect you", - "success_message": "Executive found", - "failure_message": "All our executives are busy at the moment, We have accepted your request and someone will connect with you soon!" - } - }, - "key": "asdf444", - "display": "asdf444" - }, - "ticket_id": "472", - "createdAt": "2021-02-17T14:21:06.774Z", - "updatedAt": "2021-02-17T14:21:06.774Z", - "__v": 0, - "id": "602d2652ce284d0b008d5c97" - } - ], - "total": 472, - "limit": 10, - "page": 1, - "pages": 48, - "filters": { - "statuses": [ - { - "display": "Pending", - "color": "#eae22b", - "key": "pending" - }, - { - "display": "In Progress", - "color": "#ffa951", - "key": "in_progress" - }, - { - "display": "Resolved", - "color": "#20c3a6", - "key": "resolved" - }, - { - "display": "Closed", - "color": "#41434c", - "key": "closed" - } - ], - "priorities": [ - { - "display": "Low", - "color": "#fed766", - "key": "low" - }, - { - "display": "Medium", - "color": "#f37736", - "key": "medium" - }, - { - "display": "High", - "color": "#fe4a49", - "key": "high" - } - ], - "assignees": [], - "categories": [ - { - "form": { - "login_required": false, - "should_notify": false, - "inputs": [ - { - "type": "email", - "showRegexInput": false, - "enum": [], - "regex": "\\S+@\\S+\\.\\S+", - "display": "email", - "required": true, - "key": "email" - } - ], - "available_assignees": [], - "_id": "602e900a2042255c03cadaf0", - "title": "service-test-satyen", - "description": "testing form from service", - "slug": "service-test-satyen", - "header_image": "https://hdn-1.addsale.com/x0/support-ticket/files/free/original/KZL86aN5l-service-test-satyen.jpeg", - "application_id": "000000000000000000000001", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.150" - }, - "os": { - "name": "macOS", - "version": "11.2.0" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5f8147abbd1a0a870f61f1a6", - "createdAt": "2021-02-18T16:04:26.495Z", - "updatedAt": "2021-02-18T16:04:26.495Z", - "__v": 0 - }, - "key": "service-test-satyen", - "display": "service-test-satyen" - } - ] - } - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getTicket -Retreives ticket details of a company level ticket with ticket ID - - - -```swift -lead.getTicket(companyId: companyId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID for which the data will be returned | -| id | String | yes | Tiket ID of the ticket to be fetched | - - - -Retreives ticket details of a company level ticket - -*Returned Response:* - - - - -[Ticket](#Ticket) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "context": { - "company_id": "1" - }, - "content": { - "title": "SOme title Response", - "description": "Single lineeee: asdf
    Email: asdf@asdf.com
    dfsdf: asdf
    ", - "attachments": [] - }, - "status": { - "display": "In Progress", - "color": "#ffa951", - "key": "in_progress" - }, - "priority": { - "display": "Medium", - "color": "#f37736", - "key": "medium" - }, - "assigned_to": { - "agent_id": "5d1363adf599d850df93175e", - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", - "hasOldPasswordHash": false, - "_id": "5d1363adf599d850df93175e", - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - } - ], - "username": "nikhilmshchs_gmail_com_38425_20500281", - "createdAt": "2019-01-01T17:22:38.528Z", - "updatedAt": "2021-01-22T10:02:42.258Z", - "uid": "20500281", - "__v": 56 - }, - "tags": [ - "some-title" - ], - "_id": "6012f38557751ee8fc162cf7", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.96" - }, - "os": { - "name": "macOS", - "version": "10.15.7", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "source": "sales_channel", - "created_by": { - "id": "5d1363adf599d850df93175e", - "user": { - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", - "hasOldPasswordHash": false, - "_id": "5d1363adf599d850df93175e", - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - } - ], - "username": "nikhilmshchs_gmail_com_38425_20500281", - "createdAt": "2019-01-01T17:22:38.528Z", - "updatedAt": "2021-01-22T10:02:42.258Z", - "uid": "20500281", - "__v": 56 - } - }, - "response_id": "6012f38457751e0fb8162cf6", - "category": { - "form": { - "login_required": false, - "should_notify": false, - "inputs": [ - { - "required": false, - "type": "text", - "enum": [], - "display": "Single lineeee", - "key": "single-lineeee", - "showRegexInput": false - }, - { - "required": false, - "type": "email", - "enum": [], - "display": "Email", - "regex": "\\S+@\\S+\\.\\S+", - "key": "email", - "showRegexInput": true - }, - { - "required": false, - "type": "text", - "enum": [], - "display": "dfsdf", - "key": "dfsdf", - "showRegexInput": false - } - ], - "available_assignees": [ - "5b9b98150df588546aaea6d2", - "5c45d78395d7504f76c2cb37" - ], - "_id": "5fd72db3dc250f8decfc61b2", - "title": "SOme title", - "description": "SOme big description", - "slug": "some-title", - "application_id": "000000000000000000000003", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "87.0.4280.88" - }, - "os": { - "name": "macOS", - "version": "10.15.6", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5d1363adf599d850df93175e", - "createdAt": "2020-12-14T09:17:39.953Z", - "updatedAt": "2021-01-28T18:48:07.717Z", - "__v": 0 - }, - "key": "some-title", - "display": "SOme title" - }, - "ticket_id": "43", - "createdAt": "2021-01-28T17:25:25.013Z", - "updatedAt": "2021-01-28T17:25:33.396Z", - "__v": 0, - "video_room_id": "6012f38557751ee8fc162cf7" - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### editTicket -Edits ticket details of a company level ticket - - - -```swift -lead.editTicket(companyId: companyId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID for ticket | -| id | String | yes | Ticket ID of ticket to be edited | -| body | EditTicketPayload | no | Request body | - - -Edits ticket details of a company level ticket such as status, priority, category, tags, attachments, assigne & ticket content changes - -*Returned Response:* - - - - -[Ticket](#Ticket) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "context": { - "company_id": "1" - }, - "content": { - "title": "SOme title Response", - "description": "Single lineeee: asdf
    Email: asdf@asdf.com
    dfsdf: asdf
    ", - "attachments": [] - }, - "status": { - "display": "In Progress", - "color": "#ffa951", - "key": "in_progress" - }, - "priority": { - "display": "Medium", - "color": "#f37736", - "key": "medium" - }, - "assigned_to": { - "agent_id": "5d1363adf599d850df93175e", - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", - "hasOldPasswordHash": false, - "_id": "5d1363adf599d850df93175e", - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - } - ], - "username": "nikhilmshchs_gmail_com_38425_20500281", - "createdAt": "2019-01-01T17:22:38.528Z", - "updatedAt": "2021-01-22T10:02:42.258Z", - "uid": "20500281", - "__v": 56 - }, - "tags": [ - "some-title" - ], - "_id": "6012f38557751ee8fc162cf7", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.96" - }, - "os": { - "name": "macOS", - "version": "10.15.7", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "source": "sales_channel", - "created_by": { - "id": "5d1363adf599d850df93175e", - "user": { - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", - "hasOldPasswordHash": false, - "_id": "5d1363adf599d850df93175e", - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - } - ], - "username": "nikhilmshchs_gmail_com_38425_20500281", - "createdAt": "2019-01-01T17:22:38.528Z", - "updatedAt": "2021-01-22T10:02:42.258Z", - "uid": "20500281", - "__v": 56 - } - }, - "response_id": "6012f38457751e0fb8162cf6", - "category": { - "form": { - "login_required": false, - "should_notify": false, - "inputs": [ - { - "required": false, - "type": "text", - "enum": [], - "display": "Single lineeee", - "key": "single-lineeee", - "showRegexInput": false - }, - { - "required": false, - "type": "email", - "enum": [], - "display": "Email", - "regex": "\\S+@\\S+\\.\\S+", - "key": "email", - "showRegexInput": true - }, - { - "required": false, - "type": "text", - "enum": [], - "display": "dfsdf", - "key": "dfsdf", - "showRegexInput": false - } - ], - "available_assignees": [ - "5b9b98150df588546aaea6d2", - "5c45d78395d7504f76c2cb37" - ], - "_id": "5fd72db3dc250f8decfc61b2", - "title": "SOme title", - "description": "SOme big description", - "slug": "some-title", - "application_id": "000000000000000000000003", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "87.0.4280.88" - }, - "os": { - "name": "macOS", - "version": "10.15.6", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5d1363adf599d850df93175e", - "createdAt": "2020-12-14T09:17:39.953Z", - "updatedAt": "2021-01-28T18:48:07.717Z", - "__v": 0 - }, - "key": "some-title", - "display": "SOme title" - }, - "ticket_id": "43", - "createdAt": "2021-01-28T17:25:25.013Z", - "updatedAt": "2021-01-28T17:25:33.396Z", - "__v": 0, - "video_room_id": "6012f38557751ee8fc162cf7" - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getTicket -Retreives ticket details of a application level ticket - - - -```swift -lead.getTicket(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID of the application | -| applicationId | String | yes | Application ID for which the data will be returned | -| id | String | yes | Tiket ID of the ticket to be fetched | - - - -Retreives ticket details of a application level ticket with ticket ID - -*Returned Response:* - - - - -[Ticket](#Ticket) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "context": { - "application_id": "000000000000000000000003", - "company_id": "884" - }, - "content": { - "title": "SOme title Response", - "description": "Single lineeee: asdf
    Email: asdf@asdf.com
    dfsdf: asdf
    ", - "attachments": [] - }, - "status": { - "display": "In Progress", - "color": "#ffa951", - "key": "in_progress" - }, - "priority": { - "display": "Medium", - "color": "#f37736", - "key": "medium" - }, - "assigned_to": { - "agent_id": "5d1363adf599d850df93175e", - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", - "hasOldPasswordHash": false, - "_id": "5d1363adf599d850df93175e", - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - } - ], - "username": "nikhilmshchs_gmail_com_38425_20500281", - "createdAt": "2019-01-01T17:22:38.528Z", - "updatedAt": "2021-01-22T10:02:42.258Z", - "uid": "20500281", - "__v": 56 - }, - "tags": [ - "some-title" - ], - "_id": "6012f38557751ee8fc162cf7", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.96" - }, - "os": { - "name": "macOS", - "version": "10.15.7", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "source": "sales_channel", - "created_by": { - "id": "5d1363adf599d850df93175e", - "user": { - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", - "hasOldPasswordHash": false, - "_id": "5d1363adf599d850df93175e", - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - } - ], - "username": "nikhilmshchs_gmail_com_38425_20500281", - "createdAt": "2019-01-01T17:22:38.528Z", - "updatedAt": "2021-01-22T10:02:42.258Z", - "uid": "20500281", - "__v": 56 - } - }, - "response_id": "6012f38457751e0fb8162cf6", - "category": { - "form": { - "login_required": false, - "should_notify": false, - "inputs": [ - { - "required": false, - "type": "text", - "enum": [], - "display": "Single lineeee", - "key": "single-lineeee", - "showRegexInput": false - }, - { - "required": false, - "type": "email", - "enum": [], - "display": "Email", - "regex": "\\S+@\\S+\\.\\S+", - "key": "email", - "showRegexInput": true - }, - { - "required": false, - "type": "text", - "enum": [], - "display": "dfsdf", - "key": "dfsdf", - "showRegexInput": false - } - ], - "available_assignees": [ - "5b9b98150df588546aaea6d2", - "5c45d78395d7504f76c2cb37" - ], - "_id": "5fd72db3dc250f8decfc61b2", - "title": "SOme title", - "description": "SOme big description", - "slug": "some-title", - "application_id": "000000000000000000000003", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "87.0.4280.88" - }, - "os": { - "name": "macOS", - "version": "10.15.6", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5d1363adf599d850df93175e", - "createdAt": "2020-12-14T09:17:39.953Z", - "updatedAt": "2021-01-28T18:48:07.717Z", - "__v": 0 - }, - "key": "some-title", - "display": "SOme title" - }, - "ticket_id": "43", - "createdAt": "2021-01-28T17:25:25.013Z", - "updatedAt": "2021-01-28T17:25:33.396Z", - "__v": 0, - "video_room_id": "6012f38557751ee8fc162cf7" - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### editTicket -Edits ticket details of a application level ticket - - - -```swift -lead.editTicket(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID of the application | -| applicationId | String | yes | Application ID for ticket | -| id | String | yes | Ticket ID of ticket to be edited | -| body | EditTicketPayload | no | Request body | - - -Edits ticket details of a application level ticket such as status, priority, category, tags, attachments, assigne & ticket content changes - -*Returned Response:* - - - - -[Ticket](#Ticket) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "context": { - "application_id": "000000000000000000000003", - "company_id": "884" - }, - "content": { - "title": "SOme title Response", - "description": "Single lineeee: asdf
    Email: asdf@asdf.com
    dfsdf: asdf
    ", - "attachments": [] - }, - "status": { - "display": "In Progress", - "color": "#ffa951", - "key": "in_progress" - }, - "priority": { - "display": "Medium", - "color": "#f37736", - "key": "medium" - }, - "assigned_to": { - "agent_id": "5d1363adf599d850df93175e", - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", - "hasOldPasswordHash": false, - "_id": "5d1363adf599d850df93175e", - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - } - ], - "username": "nikhilmshchs_gmail_com_38425_20500281", - "createdAt": "2019-01-01T17:22:38.528Z", - "updatedAt": "2021-01-22T10:02:42.258Z", - "uid": "20500281", - "__v": 56 - }, - "tags": [ - "some-title" - ], - "_id": "6012f38557751ee8fc162cf7", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.96" - }, - "os": { - "name": "macOS", - "version": "10.15.7", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "source": "sales_channel", - "created_by": { - "id": "5d1363adf599d850df93175e", - "user": { - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", - "hasOldPasswordHash": false, - "_id": "5d1363adf599d850df93175e", - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - } - ], - "username": "nikhilmshchs_gmail_com_38425_20500281", - "createdAt": "2019-01-01T17:22:38.528Z", - "updatedAt": "2021-01-22T10:02:42.258Z", - "uid": "20500281", - "__v": 56 - } - }, - "response_id": "6012f38457751e0fb8162cf6", - "category": { - "form": { - "login_required": false, - "should_notify": false, - "inputs": [ - { - "required": false, - "type": "text", - "enum": [], - "display": "Single lineeee", - "key": "single-lineeee", - "showRegexInput": false - }, - { - "required": false, - "type": "email", - "enum": [], - "display": "Email", - "regex": "\\S+@\\S+\\.\\S+", - "key": "email", - "showRegexInput": true - }, - { - "required": false, - "type": "text", - "enum": [], - "display": "dfsdf", - "key": "dfsdf", - "showRegexInput": false - } - ], - "available_assignees": [ - "5b9b98150df588546aaea6d2", - "5c45d78395d7504f76c2cb37" - ], - "_id": "5fd72db3dc250f8decfc61b2", - "title": "SOme title", - "description": "SOme big description", - "slug": "some-title", - "application_id": "000000000000000000000003", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "87.0.4280.88" - }, - "os": { - "name": "macOS", - "version": "10.15.6", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5d1363adf599d850df93175e", - "createdAt": "2020-12-14T09:17:39.953Z", - "updatedAt": "2021-01-28T18:48:07.717Z", - "__v": 0 - }, - "key": "some-title", - "display": "SOme title" - }, - "ticket_id": "43", - "createdAt": "2021-01-28T17:25:25.013Z", - "updatedAt": "2021-01-28T17:25:33.396Z", - "__v": 0, - "video_room_id": "6012f38557751ee8fc162cf7" - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createHistory -Create history for specific company level ticket - - - -```swift -lead.createHistory(companyId: companyId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID for ticket | -| id | String | yes | Ticket ID for which history is created | -| body | TicketHistoryPayload | no | Request body | - - -Create history for specific company level ticket, this history is seen on ticket detail page, this can be comment, log or rating. - -*Returned Response:* - - - - -[TicketHistory](#TicketHistory) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "_id": "601a9d52c26687d086c499ef", - "ticket_id": "43", - "type": "comment", - "value": { - "text": "d", - "media": [] - }, - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.96" - }, - "os": { - "name": "macOS", - "version": "10.15.7", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5d1363adf599d850df93175e", - "createdAt": "2021-02-03T12:55:46.808Z", - "updatedAt": "2021-02-03T12:55:46.808Z", - "__v": 0 - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getTicketHistory -Gets history list for specific company level ticket - - - -```swift -lead.getTicketHistory(companyId: companyId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID for ticket | -| id | String | yes | Ticket ID for which history is to be fetched | - - - -Gets history list for specific company level ticket, this history is seen on ticket detail page, this can be comment, log or rating. - -*Returned Response:* - - - - -[TicketHistoryList](#TicketHistoryList) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "docs": [ - { - "_id": "602e5384204225eed5cadae7", - "ticket_id": "41", - "type": "comment", - "value": { - "text": "hello service", - "media": [] - }, - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.150" - }, - "os": { - "name": "macOS", - "version": "11.2.0" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": { - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://hdn-1.fynd.com/company/884/applications/000000000000000000000001/theme/pictures/free/original/default-profile_nxhzui.png", - "hasOldPasswordHash": false, - "_id": "5f8147abbd1a0a870f61f1a6", - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "phone": "8412805281", - "countryCode": 91 - } - ], - "firstName": "Satyen", - "lastName": "Maurya", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "satyenmaurya95@gmail.com" - } - ], - "username": "satyenmaurya95_gmail_com_11118", - "createdAt": "2020-10-10T05:33:31.119Z", - "updatedAt": "2020-10-10T05:33:31.119Z", - "uid": "5678", - "__v": 0 - }, - "createdAt": "2021-02-18T11:46:12.522Z", - "updatedAt": "2021-02-18T11:46:12.522Z", - "__v": 0, - "id": "602e5384204225eed5cadae7" - }, - { - "_id": "60372aa78a046d4d79c46e15", - "ticket_id": "41", - "type": "diff", - "value": { - "status": [ - "pending", - "in_progress" - ] - }, - "created_by": { - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", - "hasOldPasswordHash": false, - "_id": "5e79e721768c6bf54b783146", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "nikhilmanapure@gofynd.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "nikhilmanapure@fynd.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "nikhilmanapure@uniket.store" - } - ], - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "username": "nikhilmanapure_gofynd_com_29298", - "createdAt": "2020-03-24T10:55:29.298Z", - "updatedAt": "2020-05-12T07:46:41.816Z", - "uid": "5567", - "__v": 2 - }, - "createdAt": "2021-02-25T04:42:15.225Z", - "updatedAt": "2021-02-25T04:42:15.225Z", - "__v": 0, - "id": "60372aa78a046d4d79c46e15" - } - ], - "total": 2, - "limit": 100, - "page": 1, - "pages": 1 - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getFeedbacks -Gets a list of feedback submitted against that ticket - - - -```swift -lead.getFeedbacks(companyId: companyId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID for ticket | -| id | String | yes | Ticket ID for which feedbacks are to be fetched | - - - -Gets a list of feedback submitted against that ticket - -*Returned Response:* - - - - -[TicketFeedbackList](#TicketFeedbackList) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "items": [ - { - "_id": "60c255bf00ecabfad19e9601", - "company_id": "1", - "ticket_id": "6095812876d2bf17143cb3b3", - "user": { - "_id": "5f8147abbd1a0a870f61f1a6", - "authenticated": true, - "user_id": "5f8147abbd1a0a870f61f1a6" - }, - "category": "customers", - "response": { - "audio": 2, - "video": 6 - }, - "createdAt": "2021-06-10T18:11:11.349Z", - "updatedAt": "2021-06-10T18:11:11.349Z", - "__v": 0 - } - ] - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### submitFeedback -Submit a response for feeback form against that ticket - - - -```swift -lead.submitFeedback(companyId: companyId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID for ticket | -| id | String | yes | Ticket ID for which feedback is to be submitted | -| body | TicketFeedbackPayload | no | Request body | - - -Submit a response for feeback form against that ticket - -*Returned Response:* - - - - -[TicketFeedback](#TicketFeedback) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "_id": "60c255bf00ecabfad19e9601", - "company_id": "1", - "ticket_id": "6095812876d2bf17143cb3b3", - "user": { - "_id": "5f8147abbd1a0a870f61f1a6", - "authenticated": true, - "user_id": "5f8147abbd1a0a870f61f1a6" - }, - "category": "customers", - "response": { - "audio": 2, - "video": 6 - }, - "createdAt": "2021-06-10T18:11:11.349Z", - "updatedAt": "2021-06-10T18:11:11.349Z", - "__v": 0 - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createHistory -Create history for specific application level ticket - - - -```swift -lead.createHistory(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID of the application | -| applicationId | String | yes | Application ID for ticket | -| id | String | yes | Ticket ID for which history is created | -| body | TicketHistoryPayload | no | Request body | - - -Create history for specific application level ticket, this history is seen on ticket detail page, this can be comment, log or rating. - -*Returned Response:* - - - - -[TicketHistory](#TicketHistory) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "_id": "601a9d52c26687d086c499ef", - "ticket_id": "41", - "type": "comment", - "value": { - "text": "d", - "media": [] - }, - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.96" - }, - "os": { - "name": "macOS", - "version": "10.15.7", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5d1363adf599d850df93175e", - "createdAt": "2021-02-03T12:55:46.808Z", - "updatedAt": "2021-02-03T12:55:46.808Z", - "__v": 0 - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getTicketHistory -Gets history list for specific application level ticket - - - -```swift -lead.getTicketHistory(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID of application | -| applicationId | String | yes | Application ID for ticket | -| id | String | yes | Ticket ID for which history is to be fetched | - - - -Gets history list for specific application level ticket, this history is seen on ticket detail page, this can be comment, log or rating. - -*Returned Response:* - - - - -[TicketHistoryList](#TicketHistoryList) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "docs": [ - { - "_id": "602e5384204225eed5cadae7", - "ticket_id": "41", - "type": "comment", - "value": { - "text": "hello service", - "media": [] - }, - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.150" - }, - "os": { - "name": "macOS", - "version": "11.2.0" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": { - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://hdn-1.fynd.com/company/884/applications/000000000000000000000001/theme/pictures/free/original/default-profile_nxhzui.png", - "hasOldPasswordHash": false, - "_id": "5f8147abbd1a0a870f61f1a6", - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "phone": "8412805281", - "countryCode": 91 - } - ], - "firstName": "Satyen", - "lastName": "Maurya", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "satyenmaurya95@gmail.com" - } - ], - "username": "satyenmaurya95_gmail_com_11118", - "createdAt": "2020-10-10T05:33:31.119Z", - "updatedAt": "2020-10-10T05:33:31.119Z", - "uid": "5678", - "__v": 0 - }, - "createdAt": "2021-02-18T11:46:12.522Z", - "updatedAt": "2021-02-18T11:46:12.522Z", - "__v": 0, - "id": "602e5384204225eed5cadae7" - }, - { - "_id": "60372aa78a046d4d79c46e15", - "ticket_id": "41", - "type": "diff", - "value": { - "status": [ - "pending", - "in_progress" - ] - }, - "created_by": { - "gender": "male", - "accountType": "user", - "active": true, - "profilePicUrl": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", - "hasOldPasswordHash": false, - "_id": "5e79e721768c6bf54b783146", - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "nikhilmshchs@gmail.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "nikhilmanapure@gofynd.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "nikhilmanapure@fynd.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "nikhilmanapure@uniket.store" - } - ], - "phoneNumbers": [ - { - "active": true, - "primary": true, - "verified": true, - "countryCode": 91, - "phone": "9890425946" - } - ], - "firstName": "Nikhil", - "lastName": "Manapure", - "username": "nikhilmanapure_gofynd_com_29298", - "createdAt": "2020-03-24T10:55:29.298Z", - "updatedAt": "2020-05-12T07:46:41.816Z", - "uid": "5567", - "__v": 2 - }, - "createdAt": "2021-02-25T04:42:15.225Z", - "updatedAt": "2021-02-25T04:42:15.225Z", - "__v": 0, - "id": "60372aa78a046d4d79c46e15" - } - ], - "total": 2, - "limit": 100, - "page": 1, - "pages": 1 - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getCustomForm -Get specific custom form using it's slug - - - -```swift -lead.getCustomForm(companyId: companyId, applicationId: applicationId, slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID of the application | -| applicationId | String | yes | Application ID for the form | -| slug | String | yes | Slug of form whose response is getting submitted | - - - -Get specific custom form using it's slug, this is used to view the form. - -*Returned Response:* - - - - -[CustomForm](#CustomForm) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "login_required": false, - "should_notify": false, - "inputs": [ - { - "required": false, - "type": "text", - "display": "Name", - "placeholder": "Please enter your name", - "key": "name" - } - ], - "available_assignees": [], - "_id": "5fd258a9088f957f34c288fc", - "title": "trail form", - "description": "Trail form description", - "slug": "trail-form", - "application_id": "000000000000000000000003", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "87.0.4280.88" - }, - "os": { - "name": "macOS", - "version": "10.15.6", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5d1363adf599d850df93175e", - "createdAt": "2020-12-10T17:19:37.515Z", - "updatedAt": "2020-12-10T17:19:43.214Z", - "__v": 0 - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### editCustomForm -Edit the given custom form - - - -```swift -lead.editCustomForm(companyId: companyId, applicationId: applicationId, slug: slug, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID of the application | -| applicationId | String | yes | Application ID for the form | -| slug | String | yes | Slug of form whose response is getting submitted | -| body | EditCustomFormPayload | no | Request body | - - -Edit the given custom form field such as adding or deleting input, assignee, title, decription, notification and polling information. - -*Returned Response:* - - - - -[CustomForm](#CustomForm) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "login_required": false, - "should_notify": false, - "inputs": [ - { - "type": "email", - "showRegexInput": true, - "enum": [], - "regex": "\\S+@\\S+\\.\\S+", - "display": "email", - "required": true, - "key": "email" - }, - { - "type": "number", - "showRegexInput": false, - "enum": [], - "display": "Enter your fav number", - "placeholder": "123", - "key": "enter-your-fav-number" - } - ], - "available_assignees": [], - "_id": "602e900a2042255c03cadaf0", - "title": "service-test-satyen", - "description": "testing form from service", - "slug": "service-test-satyen", - "header_image": "https://hdn-1.addsale.com/x0/support-ticket/files/free/original/KZL86aN5l-service-test-satyen.jpeg", - "application_id": "000000000000000000000001", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.150" - }, - "os": { - "name": "macOS", - "version": "11.2.0" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5f8147abbd1a0a870f61f1a6", - "createdAt": "2021-02-18T16:04:26.495Z", - "updatedAt": "2021-02-26T10:16:49.272Z", - "__v": 0 - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getCustomForms -Get list of custom form - - - -```swift -lead.getCustomForms(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID of the application | -| applicationId | String | yes | Application ID for the form | - - - -Get list of custom form for given application - -*Returned Response:* - - - - -[CustomFormList](#CustomFormList) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "docs": [ - { - "_id": "602e900a2042255c03cadaf0", - "login_required": false, - "should_notify": false, - "inputs": [ - { - "type": "email", - "showRegexInput": true, - "enum": [], - "regex": "\\S+@\\S+\\.\\S+", - "display": "email", - "required": true, - "key": "email" - }, - { - "type": "number", - "showRegexInput": false, - "enum": [], - "display": "Enter your fav number", - "placeholder": "123", - "key": "enter-your-fav-number" - }, - { - "type": "textarea", - "showRegexInput": false, - "enum": [], - "display": "kjhgjhvjb", - "required": true, - "key": "kjhgjhvjb" - } - ], - "available_assignees": [], - "title": "service-test-satyen", - "description": "testing form from service", - "slug": "service-test-satyen", - "header_image": "https://hdn-1.addsale.com/x0/support-ticket/files/free/original/KZL86aN5l-service-test-satyen.jpeg", - "application_id": "000000000000000000000001", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.150" - }, - "os": { - "name": "macOS", - "version": "11.2.0" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5f8147abbd1a0a870f61f1a6", - "createdAt": "2021-02-18T16:04:26.495Z", - "updatedAt": "2021-02-24T15:49:56.256Z", - "__v": 0, - "id": "602e900a2042255c03cadaf0" - }, - { - "_id": "60124e4a4d2bc363625e1bf4", - "login_required": false, - "should_notify": true, - "inputs": [ - { - "type": "text", - "showRegexInput": false, - "enum": [], - "display": "asdf", - "key": "asdf" - }, - { - "type": "mobile", - "showRegexInput": false, - "enum": [], - "display": "mob num", - "regex": "[0-9]{10}$", - "key": "mob-num" - } - ], - "available_assignees": [ - "5e79e721768c6bf54b783146" - ], - "title": "asdf444", - "description": "adf", - "slug": "asdf444", - "application_id": "000000000000000000000001", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.96" - }, - "os": { - "name": "macOS", - "version": "10.15.7", - "versionName": "Catalina" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5e79e721768c6bf54b783146", - "createdAt": "2021-01-28T05:40:26.271Z", - "updatedAt": "2021-02-18T16:02:32.086Z", - "__v": 0, - "poll_for_assignment": { - "duration": 20, - "message": "We are looking for executive to connect you", - "success_message": "Executive found", - "failure_message": "All our executives are busy at the moment, We have accepted your request and someone will connect with you soon!" - }, - "id": "60124e4a4d2bc363625e1bf4" - } - ], - "total": 2, - "limit": 10, - "page": 1, - "pages": 1 - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createCustomForm -Creates a new custom form - - - -```swift -lead.createCustomForm(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID of the application | -| applicationId | String | yes | Application ID for the form | -| body | CreateCustomFormPayload | no | Request body | - - -Creates a new custom form for given application - -*Returned Response:* - - - - -[CustomForm](#CustomForm) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "login_required": false, - "should_notify": false, - "inputs": [ - { - "type": "email", - "showRegexInput": true, - "enum": [], - "regex": "\\S+@\\S+\\.\\S+", - "display": "email", - "required": true, - "key": "email" - }, - { - "type": "number", - "showRegexInput": false, - "enum": [], - "display": "Enter your fav number", - "placeholder": "123", - "key": "enter-your-fav-number" - } - ], - "available_assignees": [], - "_id": "602e900a2042255c03cadaf0", - "title": "service-test-satyen", - "description": "testing form from service", - "slug": "service-test-satyen", - "header_image": "https://hdn-1.addsale.com/x0/support-ticket/files/free/original/KZL86aN5l-service-test-satyen.jpeg", - "application_id": "000000000000000000000001", - "created_on": { - "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36", - "platform": "web", - "meta": { - "browser": { - "name": "Chrome", - "version": "88.0.4324.150" - }, - "os": { - "name": "macOS", - "version": "11.2.0" - }, - "platform": { - "type": "desktop", - "vendor": "Apple" - }, - "engine": { - "name": "Blink" - } - } - }, - "created_by": "5f8147abbd1a0a870f61f1a6", - "createdAt": "2021-02-18T16:04:26.495Z", - "updatedAt": "2021-02-26T10:16:49.272Z", - "__v": 0 - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getTokenForVideoRoom -Get Token to join a specific Video Room using it's unqiue name - - - -```swift -lead.getTokenForVideoRoom(companyId: companyId, uniqueName: uniqueName) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id for video room | -| uniqueName | String | yes | Unique name of video room | - - - -Get Token to join a specific Video Room using it's unqiue name, this Token is your ticket to Room and also creates your identity there. - -*Returned Response:* - - - - -[GetTokenForVideoRoomResponse](#GetTokenForVideoRoomResponse) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "access_token": "your_token_to_the_room" - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getTokenForVideoRoom -Get Token to join a specific Video Room using it's unqiue name - - - -```swift -lead.getTokenForVideoRoom(companyId: companyId, applicationId: applicationId, uniqueName: uniqueName) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID of the application | -| applicationId | String | yes | Application ID for video room | -| uniqueName | String | yes | Unique name of video room | - - - -Get Token to join a specific Video Room using it's unqiue name, this Token is your ticket to Room and also creates your identity there. - -*Returned Response:* - - - - -[GetTokenForVideoRoomResponse](#GetTokenForVideoRoomResponse) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "access_token": "your_token_to_the_room" - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getVideoParticipants -Get participants of a specific Video Room using it's unique name - - - -```swift -lead.getVideoParticipants(companyId: companyId, uniqueName: uniqueName) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id for video room | -| uniqueName | String | yes | Unique name of Video Room | - - - -Get participants of a specific Video Room using it's unique name, this can be used to check if people are already there in the room and also to show their names. - -*Returned Response:* - - - - -[GetParticipantsInsideVideoRoomResponse](#GetParticipantsInsideVideoRoomResponse) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "participants": [] - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getVideoParticipants -Get participants of a specific Video Room using it's unique name - - - -```swift -lead.getVideoParticipants(companyId: companyId, applicationId: applicationId, uniqueName: uniqueName) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID of the application | -| applicationId | String | yes | Application ID for video room | -| uniqueName | String | yes | Unique name of Video Room | - - - -Get participants of a specific Video Room using it's unique name, this can be used to check if people are already there in the room and also to show their names. - -*Returned Response:* - - - - -[GetParticipantsInsideVideoRoomResponse](#GetParticipantsInsideVideoRoomResponse) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "participants": [] - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### openVideoRoom -Open a video room. - - - -```swift -lead.openVideoRoom(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID of the application | -| applicationId | String | yes | Application ID for video room | -| body | CreateVideoRoomPayload | no | Request body | - - -Open a video room. - -*Returned Response:* - - - - -[CreateVideoRoomResponse](#CreateVideoRoomResponse) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "unique_name": "alphanumeric123" - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### closeVideoRoom -Close the video room and force all participants to leave. - - - -```swift -lead.closeVideoRoom(companyId: companyId, applicationId: applicationId, uniqueName: uniqueName) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID of the application | -| applicationId | String | yes | Application ID for video room | -| uniqueName | String | yes | Unique name of Video Room | - - - -Close the video room and force all participants to leave. - -*Returned Response:* - - - - -[CloseVideoRoomResponse](#CloseVideoRoomResponse) - -Success - - - - -
    -  Examples: - - -
    -  Default - -```json -{ - "value": { - "success": true - } -} -``` -
    - -
    - - - - - - - - - ---- - - - - -## Feedback - - -#### getAttributes -Get list of attribute data - - - -```swift -feedback.getAttributes(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| applicationId | String | yes | application id | -| pageNo | Int? | no | pagination page no | -| pageSize | Int? | no | pagination page size | - - - -Provides a list of all attribute data. - -*Returned Response:* - - - - -[FeedbackAttributes](#FeedbackAttributes) - -ok - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getCustomerReviews -Get list of customer reviews [admin] - - - -```swift -feedback.getCustomerReviews(companyId: companyId, applicationId: applicationId, id: id, entityId: entityId, entityType: entityType, userId: userId, media: media, rating: rating, attributeRating: attributeRating, facets: facets, sort: sort, next: next, start: start, limit: limit, count: count, pageId: pageId, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| applicationId | String | yes | application id | -| id | String? | no | review id | -| entityId | String? | no | entity id | -| entityType | String? | no | entity type | -| userId | String? | no | user id | -| media | String? | no | media type e.g. image | video | video_file | video_link | -| rating | [Double]? | no | rating filter, 1-5 | -| attributeRating | [String]? | no | attribute rating filter with ma,e of attribute | -| facets | Bool? | no | facets (true|false) | -| sort | String? | no | sort by : default | top | recent | -| next | String? | no | pagination next | -| start | String? | no | pagination start | -| limit | String? | no | pagination limit | -| count | String? | no | pagination count | -| pageId | String? | no | pagination page id | -| pageSize | Int? | no | pagination page size | - - - -The endpoint provides a list of customer reviews based on entity and provided filters - -*Returned Response:* - - - - -[GetReviewResponse](#GetReviewResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updateApprove -update approve details - - - -```swift -feedback.updateApprove(companyId: companyId, applicationId: applicationId, reviewId: reviewId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| applicationId | String | yes | application id | -| reviewId | String | yes | review id | -| body | ApproveRequest | yes | Request body | - - -The is used to update approve details like status and description text - -*Returned Response:* - - - - -[UpdateResponse](#UpdateResponse) - -ok - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getHistory -get history details - - - -```swift -feedback.getHistory(companyId: companyId, applicationId: applicationId, reviewId: reviewId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| applicationId | String | yes | application id | -| reviewId | String | yes | review id | - - - -The is used to get the history details like status and description text - -*Returned Response:* - - - - -[[ActivityDump]](#[ActivityDump]) - -ok - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getApplicationTemplates -Get list of templates - - - -```swift -feedback.getApplicationTemplates(companyId: companyId, applicationId: applicationId, pageId: pageId, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| applicationId | String | yes | application id | -| pageId | String? | no | pagination page id | -| pageSize | Int? | no | pagination page size | - - - -Get all templates of application - -*Returned Response:* - - - - -[TemplateGetResponse](#TemplateGetResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### createTemplate -Create a new template - - - -```swift -feedback.createTemplate(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| applicationId | String | yes | application id | -| body | TemplateRequestList | yes | Request body | - - -Create a new template for review with following data: -- Enable media, rating and review -- Rating - active/inactive/selected rate choices, attributes, text on rate, comment for each rate, type -- Review - header, title, description, image and video meta, enable votes - -*Returned Response:* - - - - -[InsertResponse](#InsertResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getTemplateById -Get a template by ID - - - -```swift -feedback.getTemplateById(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| applicationId | String | yes | application id | -| id | String | yes | template id | - - - -Get the template for product or l3 type by ID - -*Returned Response:* - - - - -[Template](#Template) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updateTemplate -Update a template's status - - - -```swift -feedback.updateTemplate(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| applicationId | String | yes | application id | -| id | String | yes | template id | -| body | UpdateTemplateRequest | yes | Request body | - - -Update existing template status, active/archive - -*Returned Response:* - - - - -[UpdateResponse](#UpdateResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updateTemplateStatus -Update a template's status - - - -```swift -feedback.updateTemplateStatus(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| applicationId | String | yes | application id | -| id | String | yes | template id | -| body | UpdateTemplateStatusRequest | yes | Request body | - - -Update existing template status, active/archive - -*Returned Response:* - - - - -[UpdateResponse](#UpdateResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - - - -## Theme - - -#### getAllPages -Get all pages of a theme - - - -```swift -theme.getAllPages(companyId: companyId, applicationId: applicationId, themeId: themeId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID | -| applicationId | String | yes | Application ID | -| themeId | String | yes | ID of the theme to be retrieved | - - - -Use this API to retrieve all the available pages of a theme by its ID. - -*Returned Response:* - - - - -[AllAvailablePageSchema](#AllAvailablePageSchema) - -Success. Returns an array all the pages of the theme. Refer `AllAvailablePageSchema` for more details. - - - - -
    -  Examples: - - -
    -  All pages - -```json -{ - "$ref": "#/components/examples/AllAvailablePagesExample" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createPage -Create a page - - - -```swift -theme.createPage(companyId: companyId, applicationId: applicationId, themeId: themeId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID | -| applicationId | String | yes | Application ID | -| themeId | String | yes | ID of the theme | -| body | AvailablePageSchema | no | Request body | - - -Use this API to create a page for a theme by its ID. - -*Returned Response:* - - - - -[AvailablePageSchema](#AvailablePageSchema) - -Success. Returns the page of the theme. Refer `AvailablePageSchema` for more details. - - - - -
    -  Examples: - - -
    -  page - -```json -{ - "$ref": "#/components/examples/AvailablePageExample" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateMultiplePages -Update multiple pages of a theme - - - -```swift -theme.updateMultiplePages(companyId: companyId, applicationId: applicationId, themeId: themeId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID | -| applicationId | String | yes | Application ID | -| themeId | String | yes | ID of the theme to be retrieved | -| body | AllAvailablePageSchema | no | Request body | - - -Use this API to update multiple pages of a theme by its ID. - -*Returned Response:* - - - - -[AllAvailablePageSchema](#AllAvailablePageSchema) - -Success. Returns an array all the pages of the theme. Refer `AllAvailablePageSchema` for more details. - - - - -
    -  Examples: - - -
    -  All pages - -```json -{ - "$ref": "#/components/examples/AllAvailablePagesExample" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getPage -Get page of a theme - - - -```swift -theme.getPage(companyId: companyId, applicationId: applicationId, themeId: themeId, pageValue: pageValue) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID | -| applicationId | String | yes | Application ID | -| themeId | String | yes | ID of the theme to be retrieved | -| pageValue | String | yes | Value of the page to be retrieved | - - - -Use this API to retrieve a page of a theme. - -*Returned Response:* - - - - -[AvailablePageSchema](#AvailablePageSchema) - -Success. Returns an object of the page. Refer `AvailablePageSchema` for more details. - - - - -
    -  Examples: - - -
    -  Home page - -```json -{ - "$ref": "#/components/examples/AvailablePageExample" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updatePage -Updates a page - - - -```swift -theme.updatePage(companyId: companyId, applicationId: applicationId, themeId: themeId, pageValue: pageValue, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID | -| applicationId | String | yes | Application ID | -| themeId | String | yes | ID of the theme | -| pageValue | String | yes | Value of the page to be updated | -| body | AvailablePageSchema | no | Request body | - - -Use this API to update a page for a theme by its ID. - -*Returned Response:* - - - - -[AvailablePageSchema](#AvailablePageSchema) - -Success. Returns a the page of the theme. Refer `AvailablePageSchema` for more details. - - - - -
    -  Examples: - - -
    -  page - -```json -{ - "$ref": "#/components/examples/AvailablePageExample" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### deletePage -Deletes a page - - - -```swift -theme.deletePage(companyId: companyId, applicationId: applicationId, themeId: themeId, pageValue: pageValue) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID | -| applicationId | String | yes | Application ID | -| themeId | String | yes | ID of the theme | -| pageValue | String | yes | Value of the page to be updated | - - - -Use this API to delete a page for a theme by its ID and page_value. - -*Returned Response:* - - - - -[AvailablePageSchema](#AvailablePageSchema) - -Success. Returns a the page of the theme. Refer `AvailablePageSchema` for more details. - - - - -
    -  Examples: - - -
    -  page - -```json -{ - "$ref": "#/components/examples/AvailablePageExample" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getThemeLibrary -Get a list of themes from the theme library - - - -```swift -theme.getThemeLibrary(companyId: companyId, applicationId: applicationId, pageSize: pageSize, pageNo: pageNo) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | -| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | - - - -Theme library is a personalized collection of themes that are chosen and added from the available themes. Use this API to fetch a list of themes from the library along with their configuration details. - -*Returned Response:* - - - - -[ThemesListingResponseSchema](#ThemesListingResponseSchema) - -Success. Refer `ThemesListingResponseSchema` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/ThemesListingResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### addToThemeLibrary -Add a theme to the theme library - - - -```swift -theme.addToThemeLibrary(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| body | AddThemeRequestSchema | no | Request body | - - -Theme library is a personalized collection of themes that are chosen and added from the available themes. Use this API to choose a theme and add it to the theme library. - -*Returned Response:* - - - - -[ThemesSchema](#ThemesSchema) - -Success. Refer `ThemesSchema` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/Themes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### applyTheme -Apply a theme - - - -```swift -theme.applyTheme(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| body | AddThemeRequestSchema | no | Request body | - - -Use this API to apply a theme to the website. - -*Returned Response:* - - - - -[ThemesSchema](#ThemesSchema) - -Success. Refer `ThemesSchema` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/Themes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### isUpgradable -Checks if theme is upgradable - - - -```swift -theme.isUpgradable(companyId: companyId, applicationId: applicationId, themeId: themeId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| themeId | String | yes | Theme ID | - - - -There's always a possibility that new features get added to a theme. Use this API to check if the applied theme has an upgrade available. - -*Returned Response:* - - - - -[UpgradableThemeSchema](#UpgradableThemeSchema) - -Success. If the boolean value of `upgrade` returns **true**, the theme can be upgraded. Refer `UpgradableThemeSchema` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/UpgradableTheme" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### upgradeTheme -Upgrade a theme - - - -```swift -theme.upgradeTheme(companyId: companyId, applicationId: applicationId, themeId: themeId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| themeId | String | yes | ID allotted to the theme. | - - - -Use this API to upgrade the current theme to its latest version. - -*Returned Response:* - - - - -[ThemesSchema](#ThemesSchema) - -Success. Upgrades the theme and shares the details of the new version in the response. Refer `ThemesSchema` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/Themes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getPublicThemes -Get all public themes - - - -```swift -theme.getPublicThemes(companyId: companyId, applicationId: applicationId, pageSize: pageSize, pageNo: pageNo) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | -| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | - - - -Use this API to get a list of free themes that you can apply to your website. - -*Returned Response:* - - - - -[ThemesListingResponseSchema](#ThemesListingResponseSchema) - -Success. Refer `ThemesListingResponseSchema` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/ThemesListingResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createTheme -Create a new theme - - - -```swift -theme.createTheme(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| body | ThemesSchema | no | Request body | - - -Themes improve the look and appearance of a website. Use this API to create a theme. - -*Returned Response:* - - - - -[ThemesSchema](#ThemesSchema) - -Theme - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/Themes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getAppliedTheme -Get the applied theme - - - -```swift -theme.getAppliedTheme(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | - - - -Use this API to retrieve the theme that is currently applied to the website along with its details. - -*Returned Response:* - - - - -[ThemesSchema](#ThemesSchema) - -Success. Refer `ThemesSchema` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/Themes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getFonts -Get all the supported fonts in a theme - - - -```swift -theme.getFonts(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | - - - -Font is a collection of characters with a similar design. Use this API to retrieve a list of website fonts. - -*Returned Response:* - - - - -[FontsSchema](#FontsSchema) - -Success. Refer `FontsSchema` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/FontsResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getThemeById -Gets theme by id - - - -```swift -theme.getThemeById(companyId: companyId, applicationId: applicationId, themeId: themeId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| themeId | String | yes | ID allotted to the theme. | - - - -Use this API to retrieve the details of a specific theme by using its ID. - -*Returned Response:* - - - - -[ThemesSchema](#ThemesSchema) - -Success. Refer `ThemesSchema` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/Themes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateTheme -Update a theme - - - -```swift -theme.updateTheme(companyId: companyId, applicationId: applicationId, themeId: themeId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| themeId | String | yes | ID allotted to the theme. | -| body | ThemesSchema | no | Request body | - - -Use this API to edit an existing theme. You can customize the website font, sections, images, styles, and many more. - -*Returned Response:* - - - - -[ThemesSchema](#ThemesSchema) - -Success. Refer `ThemesSchema` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/Themes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### deleteTheme -Delete a theme - - - -```swift -theme.deleteTheme(companyId: companyId, applicationId: applicationId, themeId: themeId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| themeId | String | yes | ID allotted to the theme. | - - - -Use this API to delete a theme from the theme library. - -*Returned Response:* - - - - -[ThemesSchema](#ThemesSchema) - -Success. Refer `ThemesSchema` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/Themes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getThemeForPreview -Get a theme preview - - - -```swift -theme.getThemeForPreview(companyId: companyId, applicationId: applicationId, themeId: themeId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| themeId | String | yes | ID allotted to the theme. | - - - -A theme can be previewed before applying it. Use this API to retrieve the theme preview by using its ID. - -*Returned Response:* - - - - -[ThemesSchema](#ThemesSchema) - -Success. Refer `ThemesSchema` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/Themes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### publishTheme -Publish a theme - - - -```swift -theme.publishTheme(companyId: companyId, applicationId: applicationId, themeId: themeId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| themeId | String | yes | ID allotted to the theme. | - - - -Use this API to publish a theme that is either newly created or edited. - -*Returned Response:* - - - - -[ThemesSchema](#ThemesSchema) - -Success. Refer `ThemesSchema` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/Themes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### unpublishTheme -Unpublish a theme - - - -```swift -theme.unpublishTheme(companyId: companyId, applicationId: applicationId, themeId: themeId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| themeId | String | yes | ID allotted to the theme. | - - - -Use this API to remove an existing theme from the list of available themes. - -*Returned Response:* - - - - -[ThemesSchema](#ThemesSchema) - -Success. Refer `ThemesSchema` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/Themes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### archiveTheme -Archive a theme - - - -```swift -theme.archiveTheme(companyId: companyId, applicationId: applicationId, themeId: themeId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| themeId | String | yes | ID allotted to the theme. | - - - -Use this API to store an existing theme but not delete it so that it can be used in future if required. - -*Returned Response:* - - - - -[ThemesSchema](#ThemesSchema) - -Success. Refer `ThemesSchema` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/Themes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### unarchiveTheme -Unarchive a theme - - - -```swift -theme.unarchiveTheme(companyId: companyId, applicationId: applicationId, themeId: themeId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| themeId | String | yes | ID allotted to the theme. | - - - -Use this API to restore an archived theme and bring it back for editing or publishing. - -*Returned Response:* - - - - -[ThemesSchema](#ThemesSchema) - -Success. Refer `ThemesSchema` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/Themes" -} -``` -
    - -
    - - - - - - - - - ---- - - - - -## User - - -#### getCustomers -Get a list of customers - - - -```swift -user.getCustomers(companyId: companyId, applicationId: applicationId, q: q, pageSize: pageSize, pageNo: pageNo) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| q | String? | no | The search query. Mobile number or email ID of a customer. | -| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | -| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | - - - -Use this API to retrieve a list of customers who have registered in the application. - -*Returned Response:* - - - - -[CustomerListResponseSchema](#CustomerListResponseSchema) - -Success. Refer `CustomerListResponseSchema` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/CustomersListResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### searchUsers -Search an existing user. - - - -```swift -user.searchUsers(companyId: companyId, applicationId: applicationId, q: q) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| q | String? | no | The search query. Mobile number or email ID of a customer. | - - - -Use this API to retrieve an existing user from a list. - -*Returned Response:* - - - - -[UserSearchResponseSchema](#UserSearchResponseSchema) - -Success. Returns first name, last name, emails, phone number and gender of the user. Refer `UserSearchResponseSchema` for more details. - - - - -
    -  Example: - -```json -{ - "users": [ - { - "_id": "5e68af49cfa09bf7233022f1", - "gender": "male", - "active": true, - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "akashmane@gofynd.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "akashmane@fynd.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "akashmane@uniket.store" - } - ], - "uid": "61", - "account_type": "user", - "first_name": "Akash", - "last_name": "Mane", - "phone_numbers": [ - { - "active": true, - "primary": true, - "verified": true, - "phone": "8652523958", - "country_code": 91 - } - ], - "created_at": "2020-03-11T09:28:41.982Z", - "updated_at": "2020-03-11T09:28:41.982Z" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### createUser -Create user - - - -```swift -user.createUser(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID | -| applicationId | String | yes | Application ID | -| body | CreateUserRequestSchema | yes | Request body | - - -Create user - -*Returned Response:* - - - - -[CreateUserResponseSchema](#CreateUserResponseSchema) - -User create - - - - -
    -  Example: - -```json -{ - "user": { - "_id": "5e68af49cfa09bf7233022f1", - "gender": "male", - "active": true, - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "akashmane@gofynd.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "akashmane@fynd.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "akashmane@uniket.store" - } - ], - "uid": "61", - "account_type": "user", - "first_name": "Akash", - "last_name": "Mane", - "phone_numbers": [ - { - "active": true, - "primary": true, - "verified": true, - "phone": "8652523958", - "country_code": 91 - } - ], - "meta": {}, - "created_at": "2020-03-11T09:28:41.982Z", - "updated_at": "2020-03-11T09:28:41.982Z" - } -} -``` -
    - - - - - - - - - ---- - - -#### updateUser -Update user - - - -```swift -user.updateUser(companyId: companyId, applicationId: applicationId, userId: userId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID | -| applicationId | String | yes | Application ID | -| userId | String | yes | User ID | -| body | UpdateUserRequestSchema | yes | Request body | - - -Update user - -*Returned Response:* - - - - -[CreateUserResponseSchema](#CreateUserResponseSchema) - -User update - - - - -
    -  Example: - -```json -{ - "user": { - "_id": "5e68af49cfa09bf7233022f1", - "gender": "male", - "active": true, - "emails": [ - { - "active": true, - "primary": true, - "verified": true, - "email": "akashmane@gofynd.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "akashmane@fynd.com" - }, - { - "active": true, - "primary": false, - "verified": true, - "email": "akashmane@uniket.store" - } - ], - "uid": "61", - "account_type": "user", - "first_name": "Akash", - "last_name": "Mane", - "phone_numbers": [ - { - "active": true, - "primary": true, - "verified": true, - "phone": "8652523958", - "country_code": 91 - } - ], - "meta": {}, - "created_at": "2020-03-11T09:28:41.982Z", - "updated_at": "2020-03-11T09:28:41.982Z" - } -} -``` -
    - - - - - - - - - ---- - - -#### createUserSession -Create user session - - - -```swift -user.createUserSession(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company ID | -| applicationId | String | yes | Application ID | -| body | CreateUserSessionRequestSchema | yes | Request body | - - -Create user session - -*Returned Response:* - - - - -[CreateUserSessionResponseSchema](#CreateUserSessionResponseSchema) - -Create user session - - - - -
    -  Example: - -```json -{ - "domain": "vinit.com", - "max_age": 4555555, - "secure": true, - "http_only": true, - "cookie": { - "f.session": "s%3A-LrEF5FVR8jrT5DCtCHSbAy7JFyX-f9T.uXOQwzje8nOfx4ODANrLi4yNX5fW2W5kLQ2rkBdO2xE" - } -} -``` -
    - - - - - - - - - ---- - - -#### getPlatformConfig -Get platform configurations - - - -```swift -user.getPlatformConfig(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | - - - -Use this API to get all the platform configurations such as mobile image, desktop image, social logins, and all other text. - -*Returned Response:* - - - - -[PlatformSchema](#PlatformSchema) - -Success. Returns a JSON object containing the all the platform configurations. Refer `PlatformSchema` for more details. - - - - -
    -  Example: - -```json -{ - "active": true, - "mobile_image": "", - "desktop_image": "", - "social": { - "facebook": true, - "google": true, - "account_kit": true - }, - "flash_card": { - "text": "", - "text_color": "#FFFFFF", - "background_color": "#EF5350" - }, - "register": true, - "forgot_password": true, - "login": { - "password": true, - "otp": true - }, - "skip_captcha": false, - "display": "Fynd", - "subtext": "Login to Fynd", - "name": "Fynd", - "meta": {}, - "required_fields": { - "email": { - "is_required": false, - "level": "hard" - }, - "mobile": { - "is_required": true, - "level": "hard" - } - }, - "register_required_fields": { - "email": { - "is_required": false, - "level": "hard" - }, - "mobile": { - "is_required": true, - "level": "hard" - } - }, - "skip_login": false, - "look_and_feel": { - "background_color": "#F5F5F5", - "card_position": "center" - }, - "social_tokens": { - "google": { - "appId": "token_123" - }, - "facebook": { - "appId": "token_123" - }, - "account_kit": { - "appId": "token_123" - } - }, - "_id": "5e04a5e5220bc15839ad9bc0", - "created_at": "2019-12-26T12:21:57.878Z", - "updated_at": "2020-08-13T14:31:09.878Z", - "__v": 0 -} -``` -
    - - - - - - - - - ---- - - -#### updatePlatformConfig -Update platform configurations - - - -```swift -user.updatePlatformConfig(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| body | PlatformSchema | yes | Request body | - - -Use this API to edit the existing platform configurations such as mobile image, desktop image, social logins, and all other text. - -*Returned Response:* - - - - -[PlatformSchema](#PlatformSchema) - -Success. Returns a JSON object with the updated platform configurations. Refer `PlatformSchema` for more details. - - - - -
    -  Example: - -```json -{ - "active": true, - "mobile_image": "", - "desktop_image": "", - "social": { - "facebook": true, - "google": true, - "account_kit": true - }, - "flash_card": { - "text": "", - "text_color": "#FFFFFF", - "background_color": "#EF5350" - }, - "register": true, - "forgot_password": true, - "login": { - "password": true, - "otp": true - }, - "skip_captcha": false, - "display": "Fynd", - "subtext": "Login to Fynd", - "name": "Fynd", - "meta": {}, - "required_fields": { - "email": { - "is_required": false, - "level": "hard" - }, - "mobile": { - "is_required": true, - "level": "hard" - } - }, - "register_required_fields": { - "email": { - "is_required": false, - "level": "hard" - }, - "mobile": { - "is_required": true, - "level": "hard" - } - }, - "skip_login": false, - "look_and_feel": { - "background_color": "#F5F5F5", - "card_position": "center" - }, - "social_tokens": { - "google": { - "appId": "token_123" - }, - "facebook": { - "appId": "token_123" - }, - "account_kit": { - "appId": "token_123" - } - }, - "_id": "5e04a5e5220bc15839ad9bc0", - "created_at": "2019-12-26T12:21:57.878Z", - "updated_at": "2020-08-13T14:31:09.878Z", - "__v": 0 -} -``` -
    - - - - - - - - - ---- - - - - -## Content - - -#### getAnnouncementsList -Get a list of announcements - - - -```swift -content.getAnnouncementsList(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | -| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | - - - -Announcements are useful to highlight a message or information on top of a webpage. Use this API to retrieve a list of announcements. - -*Returned Response:* - - - - -[GetAnnouncementListSchema](#GetAnnouncementListSchema) - -Success. Refer `GetAnnouncementListSchema` for more details. - - - - -
    -  Examples: - - -
    -  success - -```json -{ - "$ref": "#/components/examples/GetAnnouncementList" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createAnnouncement -Create an announcement - - - -```swift -content.createAnnouncement(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| body | AdminAnnouncementSchema | yes | Request body | - - -Announcements are useful to highlight a message or information on top of a webpage. Use this API to create an announcement. - -*Returned Response:* - - - - -[CreateAnnouncementSchema](#CreateAnnouncementSchema) - -Success. Refer `CreateAnnouncementSchema` for more details. - - - - -
    -  Examples: - - -
    -  success - -```json -{ - "$ref": "#/components/examples/CreateAnnouncement" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getAnnouncementById -Get announcement by ID - - - -```swift -content.getAnnouncementById(companyId: companyId, applicationId: applicationId, announcementId: announcementId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| announcementId | String | yes | ID allotted to the announcement. | - - - -Use this API to retrieve an announcement and its details such as the target platform and pages on which it's applicable - -*Returned Response:* - - - - -[AdminAnnouncementSchema](#AdminAnnouncementSchema) - -Success. Refer `AdminAnnouncementSchema` for more details. - - - - -
    -  Examples: - - -
    -  success - -```json -{ - "$ref": "#/components/examples/Announcement" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateAnnouncement -Update an announcement - - - -```swift -content.updateAnnouncement(companyId: companyId, applicationId: applicationId, announcementId: announcementId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| announcementId | String | yes | ID allotted to the announcement. | -| body | AdminAnnouncementSchema | yes | Request body | - - -Use this API to edit an existing announcement and its details such as the target platform and pages on which it's applicable - -*Returned Response:* - - - - -[CreateAnnouncementSchema](#CreateAnnouncementSchema) - -Success. Refer `CreateAnnouncementSchema` for more details. - - - - -
    -  Examples: - - -
    -  success - -```json -{ - "$ref": "#/components/examples/UpdateAnnouncement" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateAnnouncementSchedule -Update the schedule and the publish status of an announcement - - - -```swift -content.updateAnnouncementSchedule(companyId: companyId, applicationId: applicationId, announcementId: announcementId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| announcementId | String | yes | ID allotted to the announcement. | -| body | ScheduleSchema | yes | Request body | - - -Use this API to edit the duration, i.e. start date-time and end date-time of an announcement. Moreover, you can enable/disable an announcement using this API. - -*Returned Response:* - - - - -[CreateAnnouncementSchema](#CreateAnnouncementSchema) - -Success. Refer `CreateAnnouncementSchema` for more details. - - - - -
    -  Examples: - - -
    -  success - -```json -{ - "$ref": "#/components/examples/PatchAnnouncement" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### deleteAnnouncement -Delete announcement by id - - - -```swift -content.deleteAnnouncement(companyId: companyId, applicationId: applicationId, announcementId: announcementId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| announcementId | String | yes | ID allotted to the announcement. | - - - -Use this API to delete an existing announcement. - -*Returned Response:* - - - - -[CreateAnnouncementSchema](#CreateAnnouncementSchema) - -Success. - - - - -
    -  Examples: - - -
    -  success - -```json -{ - "$ref": "#/components/examples/DeleteAnnouncement" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createBlog -Create a blog - - - -```swift -content.createBlog(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| body | BlogRequest | yes | Request body | - - -Use this API to create a blog. - -*Returned Response:* - - - - -[BlogSchema](#BlogSchema) - -Success. Refer `BlogSchema` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/BlogResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getBlogs -Get blogs - - - -```swift -content.getBlogs(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | -| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | - - - -Use this API to get a list of blogs along with their details, such as the title, reading time, publish status, feature image, tags, author, etc. - -*Returned Response:* - - - - -[BlogGetResponse](#BlogGetResponse) - -Success. Refer `BlogGetResponse` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/BlogGetResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateBlog -Update a blog - - - -```swift -content.updateBlog(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| id | String | yes | ID allotted to the blog. | -| body | BlogRequest | yes | Request body | - - -Use this API to update the details of an existing blog which includes title, feature image, content, SEO details, expiry, etc. - -*Returned Response:* - - - - -[BlogSchema](#BlogSchema) - -Success. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/BlogResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### deleteBlog -Delete blogs - - - -```swift -content.deleteBlog(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| id | String | yes | ID allotted to the blog. | - - - -Use this API to delete a blog. - -*Returned Response:* - - - - -[BlogSchema](#BlogSchema) - -Success. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/BlogResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getComponentById -Get components of a blog - - - -```swift -content.getComponentById(companyId: companyId, applicationId: applicationId, slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a blog page. You can get slug value of a blog from `getBlogs` API. | - - - -Use this API to retrieve the components of a blog, such as title, slug, feature image, content, schedule, publish status, author, etc. - -*Returned Response:* - - - - -[BlogSchema](#BlogSchema) - -Success. Returns a a JSON object with components. Refer `BlogSchema` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/BlogResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getFaqCategories -Get a list of FAQ categories - - - -```swift -content.getFaqCategories(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | - - - -FAQs can be divided into categories. Use this API to get a list of FAQ categories. - -*Returned Response:* - - - - -[GetFaqCategoriesSchema](#GetFaqCategoriesSchema) - -Success. Refer `GetFaqCategoriesSchema` for more details. - - - - -
    -  Example: - -```json -{ - "categories": [ - { - "index": 0, - "children": [ - "6026426ae507768b168dee4b" - ], - "title": "Test", - "_id": "60263f80c83c1f89f2863a8a", - "slug": "test", - "application": "000000000000000000000001" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getFaqCategoryBySlugOrId -Get an FAQ category by slug or id - - - -```swift -content.getFaqCategoryBySlugOrId(companyId: companyId, applicationId: applicationId, idOrSlug: idOrSlug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| idOrSlug | String | yes | ID or the slug allotted to an FAQ category. Slug is a short, human-readable, URL-friendly identifier of an object. You can get slug value of an FAQ category from `getFaqCategories` API. | - - - -FAQs can be divided into categories. Use this API to get an FAQ categories using its slug or ID. - -*Returned Response:* - - - - -[GetFaqCategoryBySlugSchema](#GetFaqCategoryBySlugSchema) - -Success. Refer `GetFaqCategoryBySlugSchema` for more details. - - - - -
    -  Example: - -```json -{ - "category": { - "index": 0, - "children": [ - { - "_id": "6026426ae507768b168dee4b", - "question": "question 1", - "answer": "answer 1", - "slug": "question-1", - "application": "000000000000000000000001" - } - ], - "_id": "60263f80c83c1f89f2863a8a", - "slug": "test", - "title": "Test", - "application": "000000000000000000000001" - } -} -``` -
    - - - - - - - - - ---- - - -#### createFaqCategory -Create an FAQ category - - - -```swift -content.createFaqCategory(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| body | CreateFaqCategoryRequestSchema | no | Request body | - - -FAQs help users to solve an issue or know more about a process. FAQs can be categorized separately, for e.g. some questions can be related to payment, some could be related to purchase, shipping, navigating, etc. Use this API to create an FAQ category. - -*Returned Response:* - - - - -[CreateFaqCategorySchema](#CreateFaqCategorySchema) - -Success. - - - - -
    -  Example: - -```json -{ - "category": { - "index": 0, - "children": [], - "_id": "60263f80c83c1f89f2863a8a", - "slug": "test", - "application": "000000000000000000000001", - "title": "Test" - } -} -``` -
    - - - - - - - - - ---- - - -#### updateFaqCategory -Update an FAQ category - - - -```swift -content.updateFaqCategory(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| id | String | yes | ID allotted to an FAQ category. | -| body | UpdateFaqCategoryRequestSchema | no | Request body | - - -Use this API to edit an existing FAQ category. - -*Returned Response:* - - - - -[CreateFaqCategorySchema](#CreateFaqCategorySchema) - -Success. - - - - -
    -  Example: - -```json -{ - "category": { - "index": 0, - "children": [], - "_id": "60263f80c83c1f89f2863a8a", - "title": "Test Updated", - "slug": "test", - "application": "000000000000000000000001" - } -} -``` -
    - - - - - - - - - ---- - - -#### deleteFaqCategory -Delete an FAQ category - - - -```swift -content.deleteFaqCategory(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| id | String | yes | ID allotted to an FAQ category. | - - - -Use this API to delete an FAQ category. - -*Returned Response:* - - - - -[FaqSchema](#FaqSchema) - -Success. - - - - -
    -  Example: - -```json -{ - "category": { - "index": 0, - "children": [], - "_id": "60263f80c83c1f89f2863a8a", - "slug": "test", - "title": "Test", - "application": "000000000000000000000001", - "__v": 2 - } -} -``` -
    - - - - - - - - - ---- - - -#### getFaqsByCategoryIdOrSlug -Get question and answers within an FAQ category - - - -```swift -content.getFaqsByCategoryIdOrSlug(companyId: companyId, applicationId: applicationId, idOrSlug: idOrSlug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| idOrSlug | String | yes | ID or the slug allotted to an FAQ category. Slug is a short, human-readable, URL-friendly identifier of an object. You can get slug value of an FAQ category from `getFaqCategories` API. | - - - -Use this API to retrieve all the commonly asked question and answers belonging to an FAQ category. - -*Returned Response:* - - - - -[GetFaqSchema](#GetFaqSchema) - -Success. Refer `GetFaqSchema` for more details. - - - - -
    -  Example: - -```json -{ - "faqs": [ - { - "_id": "60265b64e507768b168dee4d", - "question": "question 1", - "answer": "answer 1", - "slug": "question-1", - "application": "000000000000000000000001" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### addFaq -Create an FAQ - - - -```swift -content.addFaq(companyId: companyId, applicationId: applicationId, categoryId: categoryId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| categoryId | String | yes | ID allotted to an FAQ category. | -| body | CreateFaqSchema | no | Request body | - - -FAQs help users to solve an issue or know more about a process. Use this API to create an FAQ for a given FAQ category. - -*Returned Response:* - - - - -[CreateFaqResponseSchema](#CreateFaqResponseSchema) - -Success. - - - - -
    -  Example: - -```json -{ - "faq": { - "_id": "60265b64e507768b168dee4d", - "question": "question 1", - "answer": "answer 1", - "slug": "question-1", - "application": "000000000000000000000001" - } -} -``` -
    - - - - - - - - - ---- - - -#### updateFaq -Update an FAQ - - - -```swift -content.updateFaq(companyId: companyId, applicationId: applicationId, categoryId: categoryId, faqId: faqId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| categoryId | String | yes | ID allotted to an FAQ category. | -| faqId | String | yes | ID allotted to an FAQ. | -| body | CreateFaqSchema | no | Request body | - - -Use this API to edit an existing FAQ. - -*Returned Response:* - - - - -[CreateFaqResponseSchema](#CreateFaqResponseSchema) - -Success. - - - - -
    -  Example: - -```json -{ - "faq": { - "_id": "60265b64e507768b168dee4d", - "question": "question 1 updated", - "answer": "answer 1", - "slug": "question-1", - "application": "000000000000000000000001" - } -} -``` -
    - - - - - - - - - ---- - - -#### deleteFaq -Delete an FAQ - - - -```swift -content.deleteFaq(companyId: companyId, applicationId: applicationId, categoryId: categoryId, faqId: faqId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| categoryId | String | yes | ID allotted to an FAQ category. | -| faqId | String | yes | ID allotted to an FAQ. | - - - -Use this API to delete an existing FAQ. - -*Returned Response:* - - - - -[CreateFaqResponseSchema](#CreateFaqResponseSchema) - -Success. - - - - -
    -  Example: - -```json -{ - "faq": { - "_id": "60265b64e507768b168dee4d", - "question": "question 1 updated", - "answer": "answer 1", - "slug": "question-1", - "application": "000000000000000000000001" - } -} -``` -
    - - - - - - - - - ---- - - -#### getFaqByIdOrSlug -Get an FAQ - - - -```swift -content.getFaqByIdOrSlug(companyId: companyId, applicationId: applicationId, idOrSlug: idOrSlug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| idOrSlug | String | yes | ID or the slug allotted to an FAQ category. Slug is a short, human-readable, URL-friendly identifier of an object. You can get slug value of an FAQ category from `getFaqCategories` API. | - - - -Use this API to retrieve a specific FAQ. You will get the question and answer of that FAQ. - -*Returned Response:* - - - - -[CreateFaqResponseSchema](#CreateFaqResponseSchema) - -Success. Refer `CreateFaqResponseSchema` for more details. - - - - -
    -  Example: - -```json -{ - "faq": { - "_id": "60265b64e507768b168dee4d", - "question": "question 1", - "answer": "answer 1", - "slug": "question-1", - "application": "000000000000000000000001" - } -} -``` -
    - - - - - - - - - ---- - - -#### getLandingPages -Get landing pages - - - -```swift -content.getLandingPages(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | -| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | - - - -Landing page is the first page that a prospect lands upon while visiting a website. Use this API to fetch a list of landing pages. - -*Returned Response:* - - - - -[LandingPageGetResponse](#LandingPageGetResponse) - -Success. Refer `LandingPageGetResponse` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/LandingPageGetResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createLandingPage -Create a landing page - - - -```swift -content.createLandingPage(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| body | LandingPageSchema | yes | Request body | - - -Landing page is the first page that a prospect lands upon while visiting a website. Use this API to create a landing page. - -*Returned Response:* - - - - -[LandingPageSchema](#LandingPageSchema) - -Success. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/LandingPageResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateLandingPage -Update a landing page - - - -```swift -content.updateLandingPage(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| id | String | yes | ID allotted to a landing page. | -| body | LandingPageSchema | yes | Request body | - - -Use this API to edit the details of an existing landing page. - -*Returned Response:* - - - - -[LandingPageSchema](#LandingPageSchema) - -Success. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/LandingPageResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### deleteLandingPage -Delete a landing page - - - -```swift -content.deleteLandingPage(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| id | String | yes | ID allotted to a landing page. | - - - -Use this API to delete an existing landing page. - -*Returned Response:* - - - - -[LandingPageSchema](#LandingPageSchema) - -Success. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "value": { - "_id": "5eaa451a21a4dd75f0fd96c5", - "application": "5d3ebd89f540e7506b8b3548", - "_custom_json": null, - "slug": "pnc-landing", - "action": { - "page": { - "type": "home" - }, - "popup": {}, - "type": "page" - }, - "platform": [ - "web" - ], - "created_by": { - "id": "000000000000000000000000" - }, - "date_meta": { - "created_on": "2020-04-30T03:25:14.549Z", - "modified_on": "2020-04-30T03:25:14.549Z" - }, - "archived": true - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getLegalInformation -Get legal information - - - -```swift -content.getLegalInformation(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | - - - -Use this API to get the legal information of an application, which includes Policy, Terms and Conditions, Shipping Policy and FAQ regarding the application. - -*Returned Response:* - - - - -[ApplicationLegal](#ApplicationLegal) - -Success. Refer `ApplicationLegal` for more details. - - - - -
    -  Examples: - - -
    -  Success - -```json -{ - "$ref": "#/components/examples/Legal" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateLegalInformation -Save legal information - - - -```swift -content.updateLegalInformation(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| body | ApplicationLegal | yes | Request body | - - -Use this API to edit, update and save the legal information of an application, which includes Policy, Terms and Conditions, Shipping Policy and FAQ regarding the application. - -*Returned Response:* - - - - -[ApplicationLegal](#ApplicationLegal) - -Success. Refer `ApplicationLegal` for more details. - - - - -
    -  Example: - -```json -{ - "tnc": "This is terms and condition", - "policy": "This is policy", - "faq": [ - { - "question": "This is question", - "answer": "This is answer" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getNavigations -Get navigations - - - -```swift -content.getNavigations(companyId: companyId, applicationId: applicationId, devicePlatform: devicePlatform, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| devicePlatform | String | yes | Filter navigations by platform. Acceptable values are: web, android, ios, all | -| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | -| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | - - - -Use this API to fetch the navigations details which includes the items of the navigation pane. It also shows the orientation, links, sub-navigations, etc. - -*Returned Response:* - - - - -[NavigationGetResponse](#NavigationGetResponse) - -Success. Refer `NavigationGetResponse` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/NavigationGetResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createNavigation -Create a navigation - - - -```swift -content.createNavigation(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| body | NavigationRequest | yes | Request body | - - -Navigation is the arrangement of navigational items to ease the accessibility of resources for users on a website. Use this API to create a navigation. - -*Returned Response:* - - - - -[NavigationSchema](#NavigationSchema) - -Success. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/NavigationResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getDefaultNavigations -Get default navigations - - - -```swift -content.getDefaultNavigations(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | - - - -On any website (application), there are navigations that are present by default. Use this API to retrieve those default navigations. - -*Returned Response:* - - - - -[DefaultNavigationResponse](#DefaultNavigationResponse) - -Success. Refer `DefaultNavigationResponse` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/DefaultNavigationResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getNavigationBySlug -Get a navigation by slug - - - -```swift -content.getNavigationBySlug(companyId: companyId, applicationId: applicationId, slug: slug, devicePlatform: devicePlatform) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a navigation. You can get slug value of a navigation from `getNavigations` API. | -| devicePlatform | String | yes | Filter navigations by platform. Acceptable values are: web, android, ios, all | - - - -Use this API to retrieve a navigation by its slug. - -*Returned Response:* - - - - -[NavigationSchema](#NavigationSchema) - -Success. Refer `NavigationSchema` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/NavigationResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateNavigation -Update a navigation - - - -```swift -content.updateNavigation(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| id | String | yes | ID allotted to the navigation. | -| body | NavigationRequest | yes | Request body | - - -Use this API to edit the details of an existing navigation. - -*Returned Response:* - - - - -[NavigationSchema](#NavigationSchema) - -Success. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/NavigationResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### deleteNavigation -Delete a navigation - - - -```swift -content.deleteNavigation(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| id | String | yes | ID allotted to the navigation. | - - - -Use this API to delete an existing navigation. - -*Returned Response:* - - - - -[NavigationSchema](#NavigationSchema) - -Success. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "value": { - "_id": "5ffbd9b90ac98678ae0458d7", - "application": "000000000000000000000001", - "_custom_json": null, - "name": "temp", - "slug": "temp", - "platform": "[web]", - "orientation": { - "portrait": [ - "left" - ] - }, - "navigation": [ - { - "display": "Home", - "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/mystore-tab_y0dqzt.png", - "sort_order": 1, - "type": "", - "action": { - "page": { - "url": "/", - "type": "home" - }, - "popup": {}, - "type": "page" - }, - "active": true, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "acl": [ - "all" - ], - "_locale_language": { - "hi": { - "display": "" - }, - "ar": { - "display": "" - }, - "en_us": { - "display": "" - } - }, - "sub_navigation": [ - { - "display": "Brands", - "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/brands-tab_sfinpk.png", - "sort_order": 1, - "type": "", - "action": { - "page": { - "url": "/brands/", - "type": "brands" - }, - "popup": {}, - "type": "page" - }, - "active": true, - "tags": null, - "acl": [ - "all" - ], - "_locale_language": { - "hi": { - "display": "" - }, - "ar": { - "display": "" - }, - "en_us": { - "display": "" - } - } - } - ] - }, - { - "display": "Collections", - "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/collections-tab_a0tg9c.png", - "sort_order": 2, - "type": "", - "action": { - "page": { - "url": "/collections/", - "type": "collections" - }, - "popup": {}, - "type": "page" - }, - "active": true, - "tags": null, - "acl": [ - "all" - ], - "_locale_language": { - "hi": { - "display": "" - }, - "ar": { - "display": "" - }, - "en_us": { - "display": "" - } - }, - "sub_navigation": [ - { - "display": "Categories", - "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148154/production/system/icons/categories-tab_ss8e0q.png", - "sort_order": 1, - "type": "", - "action": { - "page": { - "url": "/categories/", - "type": "categories" - }, - "popup": {}, - "type": "page" - }, - "active": true, - "tags": null, - "acl": [ - "all" - ], - "_locale_language": { - "hi": { - "display": "" - }, - "ar": { - "display": "" - }, - "en_us": { - "display": "" - } - } - } - ] - }, - { - "display": "Primary Menu", - "image": "", - "sort_order": 3, - "type": "", - "action": { - "page": { - "type": "home" - }, - "popup": {}, - "type": "page" - }, - "active": true, - "tags": null, - "acl": [ - "all" - ], - "_locale_language": { - "hi": { - "display": "" - }, - "ar": { - "display": "" - }, - "en_us": { - "display": "" - } - } - } - ], - "created_by": { - "id": "000000000000000000000000" - }, - "date_meta": { - "created_on": "2021-01-11T04:53:13.585Z", - "modified_on": "2021-01-14T10:24:34.485Z" - }, - "archived": true - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getPageMeta -Get page meta - - - -```swift -content.getPageMeta(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | - - - -Use this API to get the meta of custom pages (blog, page) and default system pages (e.g. home/brand/category/collection). - -*Returned Response:* - - - - -[PageMetaSchema](#PageMetaSchema) - -Success. Refer `PageMetaSchema` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/PageMeta" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getPageSpec -Get page spec - - - -```swift -content.getPageSpec(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | - - - -Use this API to get the specifications of a page, such as page type, display name, params and query. - -*Returned Response:* - - - - -[PageSpec](#PageSpec) - -Success. Refer `PageSpec` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "value": { - "specifications": [ - { - "page_type": "home", - "display_name": "Home", - "params": [], - "query": [] - }, - { - "page_type": "collections", - "display_name": "Collections", - "params": [], - "query": [] - }, - { - "page_type": "collection", - "display_name": "Collection", - "params": [ - { - "key": "slug", - "required": true - } - ], - "query": [] - } - ] - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createPage -Create a page - - - -```swift -content.createPage(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| body | PageRequest | yes | Request body | - - -Use this API to create a custom page using a title, seo, publish status, feature image, tags, meta, etc. - -*Returned Response:* - - - - -[PageSchema](#PageSchema) - -Success. Refer `PageSchema` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/PageResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getPages -Get a list of pages - - - -```swift -content.getPages(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | -| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | - - - -Use this API to retrieve a list of pages. - -*Returned Response:* - - - - -[PageGetResponse](#PageGetResponse) - -Success. Refer `PageGetResponse` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/PageGetResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createPagePreview -Create a page preview - - - -```swift -content.createPagePreview(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| body | PageRequest | yes | Request body | - - -Use this API to create a page preview to check the appearance of a custom page. - -*Returned Response:* - - - - -[PageSchema](#PageSchema) - -Success. Refer `PageSchema` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/PageResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updatePagePreview -Change the publish status of a page - - - -```swift -content.updatePagePreview(companyId: companyId, applicationId: applicationId, slug: slug, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a page. You can get slug value of a page from `getPages` API. | -| body | PagePublishRequest | yes | Request body | - - -Use this API to change the publish status of an existing page. Allows you to publish and unpublish the page. - -*Returned Response:* - - - - -[PageSchema](#PageSchema) - -Success. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/PageResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updatePage -Update a page - - - -```swift -content.updatePage(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| id | String | yes | ID allotted to the page. | -| body | PageSchema | yes | Request body | - - -Use this API to edit the details of an existing page, such as its title, seo, publish status, feature image, tags, schedule, etc. - -*Returned Response:* - - - - -[PageSchema](#PageSchema) - -Success. Refer `PageSchema` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/PageResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### deletePage -Delete a page - - - -```swift -content.deletePage(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| id | String | yes | ID allotted to the page. | - - - -Use this API to delete an existing page. - -*Returned Response:* - - - - -[PageSchema](#PageSchema) - -Success. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/PageResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getPageBySlug -Get pages by component Id - - - -```swift -content.getPageBySlug(companyId: companyId, applicationId: applicationId, slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a page. You can get slug value of a page from `getPages` API. | - - - -Use this API to retrieve the components of a page, such as its title, seo, publish status, feature image, tags, schedule, etc. - -*Returned Response:* - - - - -[PageSchema](#PageSchema) - -Success. Returns a JSON object of components. Refer `PageSchema` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/PageResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getSEOConfiguration -Get SEO configuration of an application - - - -```swift -content.getSEOConfiguration(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | - - - -Use this API to know how the SEO is configured in the application. This includes the sitemap, robot.txt, custom meta tags, etc. - -*Returned Response:* - - - - -[SeoComponent](#SeoComponent) - -Success. Refer `SeoComponent` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/Seo" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateSEOConfiguration -Update SEO of application - - - -```swift -content.updateSEOConfiguration(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| body | SeoComponent | yes | Request body | - - -Use this API to edit the SEO details of an application. This includes the sitemap, robot.txt, custom meta tags, etc. - -*Returned Response:* - - - - -[SeoSchema](#SeoSchema) - -Success. Refer `SeoSchema` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "value": { - "details": { - "title": "Zyosa Zyosa" - }, - "robots_txt": "User-agent: * \nAllow: / \nsancisciasn xwsaixjowqnxwsiwjs", - "sitemap_enabled": false, - "_id": "6009819ee463ad40de397eb2", - "app": "000000000000000000000001", - "created_at": "2021-01-21T13:29:02.543Z", - "updated_at": "2021-02-05T06:36:16.048Z", - "__v": 11, - "custom_meta_tags": [ - { - "name": "test 0000", - "content": "", - "_id": "6017c301bde3c21dbb13b284" - }, - { - "name": "cwdcdc", - "content": "", - "_id": "6017c675bde3c22cfb13b290" - } - ] - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getSlideshows -Get slideshows - - - -```swift -content.getSlideshows(companyId: companyId, applicationId: applicationId, devicePlatform: devicePlatform, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| devicePlatform | String | yes | Filter slideshows by platform. Acceptable values are: web, android, ios and all | -| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | -| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | - - - -A slideshow is a group of images, videos or a combination of both that are shown on the website in the form of slides. Use this API to fetch a list of slideshows. - -*Returned Response:* - - - - -[SlideshowGetResponse](#SlideshowGetResponse) - -Success. Refer `SlideshowGetResponse` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SlideshowGetResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createSlideshow -Create a slideshow - - - -```swift -content.createSlideshow(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| body | SlideshowRequest | yes | Request body | - - -A slideshow is a group of images, videos or a combination of both that are shown on the website in the form of slides. Use this API to create a slideshow. - -*Returned Response:* - - - - -[SlideshowSchema](#SlideshowSchema) - -Success. Refer `SlideshowSchema` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SlideshowResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getSlideshowBySlug -Get slideshow by slug - - - -```swift -content.getSlideshowBySlug(companyId: companyId, applicationId: applicationId, slug: slug, devicePlatform: devicePlatform) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| slug | String | yes | A short, human-readable, URL-friendly identifier of a slideshow. You can get slug value of a page from `getSlideshows` API. | -| devicePlatform | String | yes | Filter slideshows by platform. Acceptable values are: web, android, ios and all | - - - -Use this API to retrieve the details of a slideshow by its slug. - -*Returned Response:* - - - - -[SlideshowSchema](#SlideshowSchema) - -Success. Refer `SlideshowSchema` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SlideshowResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateSlideshow -Update a slideshow - - - -```swift -content.updateSlideshow(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| id | String | yes | ID allotted to the slideshow. | -| body | SlideshowRequest | yes | Request body | - - -Use this API to edit the details of an existing slideshow. - -*Returned Response:* - - - - -[SlideshowSchema](#SlideshowSchema) - -Success. Refer `SlideshowSchema` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SlideshowResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### deleteSlideshow -Delete a slideshow - - - -```swift -content.deleteSlideshow(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform | -| applicationId | String | yes | Numeric ID allotted to an application created within a business account. | -| id | String | yes | ID allotted to the slideshow. | - - - -Use this API to delete an existing slideshow. - -*Returned Response:* - - - - -[SlideshowSchema](#SlideshowSchema) - -Success. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "value": { - "date_meta": { - "created_on": "2021-03-14T05:27:12.319Z", - "modified_on": "2021-03-14T05:27:12.319Z" - }, - "archived": true, - "_id": "604d9eb975e9d136bb1b8b83", - "configuration": { - "start_on_launch": false, - "duration": 50, - "sleep_time": 100, - "slide_direction": "horizontal" - }, - "slug": "ss-sfsd-updated", - "platform": "ios", - "media": [ - { - "auto_decide_duration": false, - "type": "image", - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/brands-tab_sfinpk.png", - "bg_color": "#ffffff", - "duration": 10, - "action": { - "type": "" - } - }, - { - "auto_decide_duration": true, - "type": "youtube", - "url": "https://www.youtube.com/embed/9vJRopau0g0", - "bg_color": "#ffffff", - "duration": 909, - "action": { - "type": "" - } - } - ], - "application": "5cd3db5e9d692cfe5302a7bb", - "active": true - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getSupportInformation -Get support information - - - -```swift -content.getSupportInformation(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | - - - -Use this API to get the contact details for customer support, including emails and phone numbers. - -*Returned Response:* - - - - -[Support](#Support) - -Success. Refer `Support` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/Support" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateSupportInformation -Update the support data of an application - - - -```swift -content.updateSupportInformation(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| body | Support | yes | Request body | - - -Use this API to edit the existing contact details for customer support, including emails and phone numbers. - -*Returned Response:* - - - - -[Support](#Support) - -Success. Refer `Support` for more details. - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/Support" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateInjectableTag -Update a tag - - - -```swift -content.updateInjectableTag(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| body | CreateTagRequestSchema | no | Request body | - - -Use this API to edit the details of an existing tag. This includes the tag name, tag type (css/js), url and position of the tag. - -*Returned Response:* - - - - -[TagsSchema](#TagsSchema) - -Success. - - - - -
    -  Example: - -```json -{ - "_id": "601f77e7aa61066feda44487", - "tags": [ - { - "name": "Test", - "sub_type": "external", - "_id": "601f77e7aa61066feda44488", - "type": "js", - "url": "youtube.com/watch?v=AaxFIY-cWH0&list=PL3O3jhFJEElBHFbs6XsOqZAWZLtlEkZTw&index=31", - "position": "head" - }, - { - "name": "Test 2", - "sub_type": "external", - "_id": "601f77e7aa61066feda44489", - "type": "js", - "url": "youtube.com/watch?v=AaxFIY-cWH0&list=PL3O3jhFJEElBHFbs6XsOqZAWZLtlEkZTw&index=31", - "position": "head" - } - ], - "application": "000000000000000000000001", - "__v": 0 -} -``` -
    - - - - - - - - - ---- - - -#### deleteAllInjectableTags -Delete tags in application - - - -```swift -content.deleteAllInjectableTags(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | - - - -Use this API to delete all the existing tags at once. - -*Returned Response:* - - - - -[TagsSchema](#TagsSchema) - -Success. - - - - -
    -  Example: - -```json -{ - "_id": "601f77e7aa61066feda44487", - "tags": [ - { - "name": "Test", - "sub_type": "external", - "_id": "601f77e7aa61066feda44488", - "type": "js", - "url": "youtube.com/watch?v=AaxFIY-cWH0&list=PL3O3jhFJEElBHFbs6XsOqZAWZLtlEkZTw&index=31", - "position": "head" - }, - { - "name": "Test 2", - "sub_type": "external", - "_id": "601f77e7aa61066feda44489", - "type": "js", - "url": "youtube.com/watch?v=AaxFIY-cWH0&list=PL3O3jhFJEElBHFbs6XsOqZAWZLtlEkZTw&index=31", - "position": "head" - } - ], - "application": "000000000000000000000001", - "__v": 0 -} -``` -
    - - - - - - - - - ---- - - -#### getInjectableTags -Get all the tags in an application - - - -```swift -content.getInjectableTags(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | - - - -Use this API to get all the CSS and JS injected in the application in the form of tags. - -*Returned Response:* - - - - -[TagsSchema](#TagsSchema) - -Success. Refer `TagsSchema` for more details. - - - - -
    -  Example: - -```json -{ - "_id": "601f77e7aa61066feda44487", - "tags": [ - { - "name": "Test", - "sub_type": "external", - "_id": "601f77e7aa61066feda44488", - "type": "js", - "url": "youtube.com/watch?v=AaxFIY-cWH0&list=PL3O3jhFJEElBHFbs6XsOqZAWZLtlEkZTw&index=31", - "position": "head" - }, - { - "name": "Test 2", - "sub_type": "external", - "_id": "601f77e7aa61066feda44489", - "type": "js", - "url": "youtube.com/watch?v=AaxFIY-cWH0&list=PL3O3jhFJEElBHFbs6XsOqZAWZLtlEkZTw&index=31", - "position": "head" - } - ], - "application": "000000000000000000000001", - "__v": 0 -} -``` -
    - - - - - - - - - ---- - - -#### addInjectableTag -Add a tag - - - -```swift -content.addInjectableTag(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| body | CreateTagRequestSchema | no | Request body | - - -CSS and JS can be injected in the application (website) with the help of tags. Use this API to create such tags by entering the tag name, tag type (css/js), url and position of the tag. - -*Returned Response:* - - - - -[TagsSchema](#TagsSchema) - -Success. - - - - -
    -  Example: - -```json -{ - "_id": "601f77e7aa61066feda44487", - "tags": [ - { - "name": "Test", - "sub_type": "external", - "_id": "601f77e7aa61066feda44488", - "type": "js", - "url": "youtube.com/watch?v=AaxFIY-cWH0&list=PL3O3jhFJEElBHFbs6XsOqZAWZLtlEkZTw&index=31", - "position": "head" - } - ], - "application": "000000000000000000000001", - "__v": 0 -} -``` -
    - - - - - - - - - ---- - - -#### removeInjectableTag -Remove a tag - - - -```swift -content.removeInjectableTag(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| body | RemoveHandpickedSchema | no | Request body | - - -Use this API to delete an existing tag. - -*Returned Response:* - - - - -[TagDeleteSuccessResponse](#TagDeleteSuccessResponse) - -Success. - - - - -
    -  Example: - -```json -{ - "success": "true" -} -``` -
    - - - - - - - - - ---- - - -#### editInjectableTag -Edit a tag by id - - - -```swift -content.editInjectableTag(companyId: companyId, applicationId: applicationId, tagId: tagId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Numeric ID allotted to a business account on Fynd Platform. | -| applicationId | String | yes | Alphanumeric ID allotted to an application created within a business account. | -| tagId | String | yes | ID allotted to the tag. | -| body | UpdateHandpickedSchema | no | Request body | - - -Use this API to edit the details of an existing tag by its ID. - -*Returned Response:* - - - - -[TagsSchema](#TagsSchema) - -Success. - - - - -
    -  Example: - -```json -{ - "_id": "602671b3c0bac99158b10874", - "application": "000000000000000000000001", - "tags": [ - { - "_id": "601f77e7aa61066feda44488", - "name": "floating whatsapp", - "sub_type": "inline", - "type": "css", - "position": "head", - "content": ".float{\n\tposition:fixed;\n\twidth:60px;\n\theight:60px;\n\tbottom:40px;\n\tright:40px;\n\tbackground-color:#25d366;\n\tcolor:#FFF;\n\tborder-radius:50px;\n\ttext-align:center;\n font-size:30px;\n\tbox-shadow: 2px 2px 3px #999;\n z-index:100;\n}\n\n.my-float{\n\tmargin-top:16px;\n}" - } - ], - "__v": 1 -} -``` -
    - - - - - - - - - ---- - - - - -## Billing - - -#### createSubscriptionCharge -Create subscription charge - - - -```swift -billing.createSubscriptionCharge(companyId: companyId, extensionId: extensionId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Customer unique id. In case of company it will be company id. | -| extensionId | String | yes | Extension _id | -| body | CreateSubscriptionCharge | no | Request body | - - -Register subscription charge for a seller of your extension. - -*Returned Response:* - - - - -[CreateSubscriptionResponse](#CreateSubscriptionResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getSubscriptionCharge -Get subscription charge details - - - -```swift -billing.getSubscriptionCharge(companyId: companyId, extensionId: extensionId, subscriptionId: subscriptionId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Customer unique id. In case of company it will be company id. | -| extensionId | String | yes | Extension _id | -| subscriptionId | String | yes | Subscription charge _id | - - - -Get created subscription charge details - -*Returned Response:* - - - - -[EntitySubscription](#EntitySubscription) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### cancelSubscriptionCharge -Cancel subscription charge - - - -```swift -billing.cancelSubscriptionCharge(companyId: companyId, extensionId: extensionId, subscriptionId: subscriptionId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Customer unique id. In case of company it will be company id. | -| extensionId | String | yes | Extension _id | -| subscriptionId | String | yes | Subscription charge _id | - - - -Cancel subscription and attached charges. - -*Returned Response:* - - - - -[EntitySubscription](#EntitySubscription) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getInvoices -Get invoices - - - -```swift -billing.getInvoices(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Customer unique id. In case of company it will be company id. | - - - -Get invoices. - -*Returned Response:* - - - - -[Invoices](#Invoices) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/Invoices" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getInvoiceById -Get invoice by id - - - -```swift -billing.getInvoiceById(companyId: companyId, invoiceId: invoiceId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Customer unique id. In case of company it will be company id. | -| invoiceId | String | yes | Invoice id | - - - -Get invoice by id. - -*Returned Response:* - - - - -[Invoice](#Invoice) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/Invoice" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getCustomerDetail -Get subscription customer detail - - - -```swift -billing.getCustomerDetail(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Customer unique id. In case of company it will be company id. | - - - -Get subscription customer detail. - -*Returned Response:* - - - - -[SubscriptionCustomer](#SubscriptionCustomer) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SubscriptionCustomerRes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### upsertCustomerDetail -Upsert subscription customer detail - - - -```swift -billing.upsertCustomerDetail(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Customer unique id. In case of company it will be company id. | -| body | SubscriptionCustomerCreate | yes | Request body | - - -Upsert subscription customer detail. - -*Returned Response:* - - - - -[SubscriptionCustomer](#SubscriptionCustomer) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SubscriptionCustomerRes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getSubscription -Get current subscription detail - - - -```swift -billing.getSubscription(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Customer unique id. In case of company it will be company id. | - - - -If subscription is active then it will return is_enabled true and return subscription object. If subscription is not active then is_enabled false and message. - - -*Returned Response:* - - - - -[SubscriptionStatus](#SubscriptionStatus) - -Success - - - - -
    -  Examples: - - -
    -  Active subscription - -```json -{ - "$ref": "#/components/examples/SubscriptionActiveRes" -} -``` -
    - -
    -  Inactive subscription - -```json -{ - "$ref": "#/components/examples/SubscriptionInavtiveRes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getFeatureLimitConfig -Get subscription subscription limits - - - -```swift -billing.getFeatureLimitConfig(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Customer unique id. In case of company it will be company id. | - - - -Get subscription subscription limits. - -*Returned Response:* - - - - -[SubscriptionLimit](#SubscriptionLimit) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/CurrentLimitRes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### activateSubscriptionPlan -Activate subscription - - - -```swift -billing.activateSubscriptionPlan(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Customer unique id. In case of company it will be company id. | -| body | SubscriptionActivateReq | yes | Request body | - - -It will activate subscription plan for customer - -*Returned Response:* - - - - -[SubscriptionActivateRes](#SubscriptionActivateRes) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SubscriptionActivateRes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### cancelSubscriptionPlan -Cancel subscription - - - -```swift -billing.cancelSubscriptionPlan(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Customer unique id. In case of company it will be company id. | -| body | CancelSubscriptionReq | yes | Request body | - - -It will cancel current active subscription. - -*Returned Response:* - - - - -[CancelSubscriptionRes](#CancelSubscriptionRes) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/CancelSubscriptionRes" -} -``` -
    - -
    - - - - - - - - - ---- - - - - -## Communication - - -#### getCampaigns -Get campaigns - - - -```swift -communication.getCampaigns(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| pageNo | Int? | no | Current page no | -| pageSize | Int? | no | Current request items count | -| sort | [String: Any]? | no | To sort based on created_at | - - - -Get campaigns - -*Returned Response:* - - - - -[Campaigns](#Campaigns) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/Campaigns" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createCampaign -Create campaign - - - -```swift -communication.createCampaign(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| body | CampaignReq | yes | Request body | - - -Create campaign - -*Returned Response:* - - - - -[Campaign](#Campaign) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/Campaign" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getCampaignById -Get campaign by id - - - -```swift -communication.getCampaignById(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| id | String | yes | Campaign id | - - - -Get campaign by id - -*Returned Response:* - - - - -[Campaign](#Campaign) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/Campaign" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateCampaignById -Update campaign by id - - - -```swift -communication.updateCampaignById(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| id | String | yes | Campaign id | -| body | CampaignReq | yes | Request body | - - -Update campaign by id - -*Returned Response:* - - - - -[Campaign](#Campaign) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/Campaign" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getStatsOfCampaignById -Get stats of campaign by id - - - -```swift -communication.getStatsOfCampaignById(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| id | String | yes | Campaign id | - - - -Get stats of campaign by id - -*Returned Response:* - - - - -[GetStats](#GetStats) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/GetStats" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getAudiences -Get audiences - - - -```swift -communication.getAudiences(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| pageNo | Int? | no | Current page no | -| pageSize | Int? | no | Current request items count | -| sort | [String: Any]? | no | To sort based on created_at | - - - -Get audiences - -*Returned Response:* - - - - -[Audiences](#Audiences) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/Audiences" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createAudience -Create audience - - - -```swift -communication.createAudience(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| body | AudienceReq | yes | Request body | - - -Create audience - -*Returned Response:* - - - - -[Audience](#Audience) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/Audience" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getBigqueryHeaders -Get bigquery headers - - - -```swift -communication.getBigqueryHeaders(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| body | BigqueryHeadersReq | yes | Request body | - - -Get bigquery headers - -*Returned Response:* - - - - -[BigqueryHeadersRes](#BigqueryHeadersRes) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/BigqueryHeadersRes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getAudienceById -Get audience by id - - - -```swift -communication.getAudienceById(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| id | String | yes | Audience id | - - - -Get audience by id - -*Returned Response:* - - - - -[Audience](#Audience) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/Audience" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateAudienceById -Update audience by id - - - -```swift -communication.updateAudienceById(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| id | String | yes | Audience id | -| body | AudienceReq | yes | Request body | - - -Update audience by id - -*Returned Response:* - - - - -[Audience](#Audience) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/Audience" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getNSampleRecordsFromCsv -Get n sample records from csv - - - -```swift -communication.getNSampleRecordsFromCsv(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| body | GetNRecordsCsvReq | yes | Request body | - - -Get n sample records from csv - -*Returned Response:* - - - - -[GetNRecordsCsvRes](#GetNRecordsCsvRes) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/GetNRecordsCsvRes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getEmailProviders -Get email providers - - - -```swift -communication.getEmailProviders(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| pageNo | Int? | no | Current page no | -| pageSize | Int? | no | Current request items count | -| sort | [String: Any]? | no | To sort based on created_at | - - - -Get email providers - -*Returned Response:* - - - - -[EmailProviders](#EmailProviders) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/EmailProviders" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createEmailProvider -Create email provider - - - -```swift -communication.createEmailProvider(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| body | EmailProviderReq | yes | Request body | - - -Create email provider - -*Returned Response:* - - - - -[EmailProvider](#EmailProvider) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/EmailProvider" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getEmailProviderById -Get email provider by id - - - -```swift -communication.getEmailProviderById(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| id | String | yes | Email provider id | - - - -Get email provider by id - -*Returned Response:* - - - - -[EmailProvider](#EmailProvider) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/EmailProvider" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateEmailProviderById -Update email provider by id - - - -```swift -communication.updateEmailProviderById(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| id | String | yes | Email provider id | -| body | EmailProviderReq | yes | Request body | - - -Update email provider by id - -*Returned Response:* - - - - -[EmailProvider](#EmailProvider) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/EmailProvider" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getEmailTemplates -Get email templates - - - -```swift -communication.getEmailTemplates(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| pageNo | Int? | no | Current page no | -| pageSize | Int? | no | Current request items count | -| sort | [String: Any]? | no | To sort based on created_at | - - - -Get email templates - -*Returned Response:* - - - - -[EmailTemplates](#EmailTemplates) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/EmailTemplates" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createEmailTemplate -Create email template - - - -```swift -communication.createEmailTemplate(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| body | EmailTemplateReq | yes | Request body | - - -Create email template - -*Returned Response:* - - - - -[EmailTemplateRes](#EmailTemplateRes) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/EmailTemplateRes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getSystemEmailTemplates -Get system email templates - - - -```swift -communication.getSystemEmailTemplates(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| pageNo | Int? | no | Current page no | -| pageSize | Int? | no | Current request items count | -| sort | [String: Any]? | no | To sort based on created_at | - - - -Get system email templates - -*Returned Response:* - - - - -[SystemEmailTemplates](#SystemEmailTemplates) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SystemEmailTemplates" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getEmailTemplateById -Get email template by id - - - -```swift -communication.getEmailTemplateById(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| id | String | yes | Email template id | - - - -Get email template by id - -*Returned Response:* - - - - -[EmailTemplate](#EmailTemplate) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/EmailTemplate" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateEmailTemplateById -Update email template by id - - - -```swift -communication.updateEmailTemplateById(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| id | String | yes | Email template id | -| body | EmailTemplateReq | yes | Request body | - - -Update email template by id - -*Returned Response:* - - - - -[EmailTemplateRes](#EmailTemplateRes) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/EmailTemplateRes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### deleteEmailTemplateById -Delete email template by id - - - -```swift -communication.deleteEmailTemplateById(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| id | String | yes | Email template id | - - - -Delete email template by id - -*Returned Response:* - - - - -[EmailTemplateDeleteSuccessRes](#EmailTemplateDeleteSuccessRes) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/EmailTemplateDeleteSuccessRes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getEventSubscriptions -Get event subscriptions - - - -```swift -communication.getEventSubscriptions(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize, populate: populate) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| pageNo | Int? | no | Current page no | -| pageSize | Int? | no | Current request items count | -| populate | String? | no | populate fields | - - - -Get event subscriptions - -*Returned Response:* - - - - -[EventSubscriptions](#EventSubscriptions) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/EventSubscriptions" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getJobs -Get jobs - - - -```swift -communication.getJobs(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| pageNo | Int? | no | Current page no | -| pageSize | Int? | no | Current request items count | -| sort | [String: Any]? | no | To sort based on created_at | - - - -Get jobs - -*Returned Response:* - - - - -[Jobs](#Jobs) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/Jobs" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### triggerCampaignJob -Trigger campaign job - - - -```swift -communication.triggerCampaignJob(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| body | TriggerJobRequest | yes | Request body | - - -Trigger campaign job - -*Returned Response:* - - - - -[TriggerJobResponse](#TriggerJobResponse) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/TriggerJobResponse" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getJobLogs -Get job logs - - - -```swift -communication.getJobLogs(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| pageNo | Int? | no | Current page no | -| pageSize | Int? | no | Current request items count | -| sort | [String: Any]? | no | To sort based on created_at | - - - -Get job logs - -*Returned Response:* - - - - -[JobLogs](#JobLogs) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/JobLogs" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getCommunicationLogs -Get communication logs - - - -```swift -communication.getCommunicationLogs(companyId: companyId, applicationId: applicationId, pageId: pageId, pageSize: pageSize, sort: sort, query: query) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| pageId | String? | no | Current page no | -| pageSize | Int? | no | Current request items count | -| sort | [String: Any]? | no | To sort based on _id | -| query | [String: Any]? | no | | - - - -Get communication logs - -*Returned Response:* - - - - -[Logs](#Logs) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/Logs" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getSystemNotifications -Get system notifications - - - -```swift -communication.getSystemNotifications(companyId: companyId, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| pageNo | Int? | no | | -| pageSize | Int? | no | | - - - -Get system notifications - -*Returned Response:* - - - - -[SystemNotifications](#SystemNotifications) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SystemNotifications" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getSmsProviders -Get sms providers - - - -```swift -communication.getSmsProviders(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| pageNo | Int? | no | Current page no | -| pageSize | Int? | no | Current request items count | -| sort | [String: Any]? | no | To sort based on created_at | - - - -Get sms providers - -*Returned Response:* - - - - -[SmsProviders](#SmsProviders) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SmsProviders" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createSmsProvider -Create sms provider - - - -```swift -communication.createSmsProvider(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| body | SmsProviderReq | yes | Request body | - - -Create sms provider - -*Returned Response:* - - - - -[SmsProvider](#SmsProvider) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SmsProvider" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getSmsProviderById -Get sms provider by id - - - -```swift -communication.getSmsProviderById(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| id | String | yes | Sms provider id | - - - -Get sms provider by id - -*Returned Response:* - - - - -[SmsProvider](#SmsProvider) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SmsProvider" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateSmsProviderById -Update sms provider by id - - - -```swift -communication.updateSmsProviderById(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| id | String | yes | Sms provider id | -| body | SmsProviderReq | yes | Request body | - - -Update sms provider by id - -*Returned Response:* - - - - -[SmsProvider](#SmsProvider) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SmsProvider" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getSmsTemplates -Get sms templates - - - -```swift -communication.getSmsTemplates(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| pageNo | Int? | no | Current page no | -| pageSize | Int? | no | Current request items count | -| sort | [String: Any]? | no | To sort based on created_at | - - - -Get sms templates - -*Returned Response:* - - - - -[SmsTemplates](#SmsTemplates) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SmsTemplates" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createSmsTemplate -Create sms template - - - -```swift -communication.createSmsTemplate(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| body | SmsTemplateReq | yes | Request body | - - -Create sms template - -*Returned Response:* - - - - -[SmsTemplateRes](#SmsTemplateRes) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SmsTemplateRes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getSmsTemplateById -Get sms template by id - - - -```swift -communication.getSmsTemplateById(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| id | String | yes | Sms template id | - - - -Get sms template by id - -*Returned Response:* - - - - -[SmsTemplate](#SmsTemplate) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SmsTemplate" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### updateSmsTemplateById -Update sms template by id - - - -```swift -communication.updateSmsTemplateById(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| id | String | yes | Sms template id | -| body | SmsTemplateReq | yes | Request body | - - -Update sms template by id - -*Returned Response:* - - - - -[SmsTemplateRes](#SmsTemplateRes) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SmsTemplateRes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### deleteSmsTemplateById -Delete sms template by id - - - -```swift -communication.deleteSmsTemplateById(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| id | String | yes | Sms template id | - - - -Delete sms template by id - -*Returned Response:* - - - - -[SmsTemplateDeleteSuccessRes](#SmsTemplateDeleteSuccessRes) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SmsTemplateDeleteSuccessRes" -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getSystemSystemTemplates -Get system sms templates - - - -```swift -communication.getSystemSystemTemplates(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company id | -| applicationId | String | yes | Application id | -| pageNo | Int? | no | Current page no | -| pageSize | Int? | no | Current request items count | -| sort | [String: Any]? | no | To sort based on created_at | - - - -Get system sms templates - -*Returned Response:* - - - - -[SystemSmsTemplates](#SystemSmsTemplates) - -Success - - - - -
    -  Examples: - - -
    -  default - -```json -{ - "$ref": "#/components/examples/SystemSmsTemplates" -} -``` -
    - -
    - - - - - - - - - ---- - - - - -## Payment - - -#### getBrandPaymentGatewayConfig -Get All Brand Payment Gateway Config Secret - - - -```swift -payment.getBrandPaymentGatewayConfig(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| applicationId | String | yes | Application id | - - - -Get All Brand Payment Gateway Config Secret - -*Returned Response:* - - - - -[PaymentGatewayConfigResponse](#PaymentGatewayConfigResponse) - -Refund Transfer Mode - - - - -
    -  Example: - -```json -{ - "success": true, - "created": true, - "app_id": "000000000000000000000004", - "excluded_fields": [ - "config_type", - "aggregator" - ], - "display_fields": [ - "logo", - "display" - ], - "aggregators": [ - { - "key": "rrroooouuurrrrdddd", - "secret": "yyyyooo", - "is_active": false, - "config_type": "", - "merchant_key": "vvvvvvvvddd", - "aggregator": "juspay", - "display": { - "link": "", - "text": "Review in under process. Please wait while process completed or contact us for any further query.", - "description": "Juspay is not a Payment Gateway (like Citrus, CCAvenue, PayU) but it works with any gateway or aggregator with zero interference in the Merchant-PG relations.", - "reviewed": false - }, - "logo": "https://hdn-1.fynd.com/payment/juspay-pg-logo.jpg" - }, - { - "key": "", - "pin": "", - "secret": "", - "user_id": "", - "is_active": false, - "config_type": "", - "merchant_id": "", - "aggregator": "mswipe", - "display": { - "link": "", - "text": "Submitted request to be reviewed before going live. Please contact us for any further query.", - "description": "Mswipe card swipe machines are safe and secure and accepts all debit & credit cards." - }, - "logo": "https://hdn-1.fynd.com/payment/mswipe-pg-logo.png" - }, - { - "key": "tttyyyyyy", - "secret": "rerrrrrrrr", - "is_active": false, - "config_type": "", - "merchant_salt": "qqqqq", - "aggregator": "payumoney", - "display": { - "link": "", - "text": "Review in under process. Please wait while process completed or contact us for any further query.", - "description": "PayUmoney supports wide range of options for making online payments via wallets, UPI, cards, and netbanking.", - "reviewed": false - }, - "logo": "https://hdn-1.fynd.com/payment/payu_logo_large.png" - }, - { - "key": "test", - "secret": "test", - "is_active": true, - "config_type": "self", - "webhook_secret": "test", - "aggregator": "razorpay", - "display": { - "link": "", - "text": "Well done, You payment gateway successfully lived. Collect your payment at your end.", - "description": "Razorpay is a payments platform which accept online payments via Credit Card, Debit Card, Net banking, UPI, BharatQR and Wallets.", - "reviewed": true - }, - "logo": "https://hdn-1.fynd.com/payment/razorpay-pg-logo.jpg" - }, - { - "key": "", - "secret": "", - "is_active": false, - "config_type": "", - "aggregator": "rupifi", - "display": { - "link": "", - "text": "Submitted request to be reviewed before going live. Please contact us for any further query.", - "description": "Rupifi enables businesses to avail credits and allows a 'Buy now, Pay later' system for making transactions and purchases." - }, - "logo": "https://hdn-1.fynd.com/payment/Rupifi.png" - }, - { - "key": "12345", - "secret": "12345", - "is_active": false, - "config_type": "", - "aggregator": "simpl", - "display": { - "link": "", - "text": "Review in under process. Please wait while process completed or contact us for any further query.", - "description": "Simpl is a Pay Later payment method.", - "reviewed": false - }, - "logo": "https://hdn-1.fynd.com/payment/simpl-pg-logo.jpg" - }, - { - "key": "", - "secret": "", - "is_active": false, - "product_id": "", - "config_type": "", - "webhook_secret": "", - "aggregator": "stripe", - "display": { - "link": "", - "text": "Submitted request to be reviewed before going live. Please contact us for any further query.", - "description": "Stripe is a payment processor that supports online payments, credit cards, recurring subscriptions and direct payouts to bank accounts." - }, - "logo": "https://hdn-1.fynd.com/payment/Stripe.png" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### saveBrandPaymentGatewayConfig -Save Config Secret For Brand Payment Gateway - - - -```swift -payment.saveBrandPaymentGatewayConfig(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| applicationId | String | yes | Application id | -| body | PaymentGatewayConfigRequest | no | Request body | - - -Save Config Secret For Brand Payment Gateway - -*Returned Response:* - - - - -[PaymentGatewayToBeReviewed](#PaymentGatewayToBeReviewed) - -Save Config Secret For Brand Payment Gateway Success Response. - - - - -
    -  Example: - -```json -{ - "success": true, - "aggregators": [ - "razorpay" - ] -} -``` -
    - - - - - - - - - ---- - - -#### updateBrandPaymentGatewayConfig -Save Config Secret For Brand Payment Gateway - - - -```swift -payment.updateBrandPaymentGatewayConfig(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| applicationId | String | yes | Application id | -| body | PaymentGatewayConfigRequest | no | Request body | - - -Save Config Secret For Brand Payment Gateway - -*Returned Response:* - - - - -[PaymentGatewayToBeReviewed](#PaymentGatewayToBeReviewed) - -Save Config Secret For Brand Payment Gateway Success Response. - - - - -
    -  Example: - -```json -{ - "success": true, - "aggregators": [ - "razorpay" - ] -} -``` -
    - - - - - - - - - ---- - - -#### getPaymentModeRoutes -Get All Valid Payment Options - - - -```swift -payment.getPaymentModeRoutes(companyId: companyId, applicationId: applicationId, refresh: refresh, requestType: requestType) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| applicationId | String | yes | Application id | -| refresh | Bool | yes | | -| requestType | String | yes | | - - - -Use this API to get Get All Valid Payment Options for making payment - -*Returned Response:* - - - - -[PaymentOptionsResponse](#PaymentOptionsResponse) - -Success - - - - -
    -  Example: - -```json -{ - "success": true, - "payment_options": { - "payment_option": [ - { - "name": "CARD", - "display_priority": 2, - "payment_mode_id": 2, - "display_name": "Card", - "list": [], - "anonymous_enable": true, - "aggregator_name": "Razorpay", - "add_card_enabled": false, - "types": [], - "networks": [], - "banks": [] - }, - { - "name": "NB", - "display_priority": 3, - "payment_mode_id": 3, - "display_name": "Net Banking", - "list": [ - { - "aggregator_name": "Razorpay", - "name": "ICICI Bank", - "code": "ICIC", - "bank_name": "ICICI Bank", - "bank_code": "ICIC", - "url": "https://hdn-1.fynd.com/payment/NB_ICICI.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_ICICI.png", - "large": "https://hdn-1.fynd.com/payment/NB_ICICI.png" - }, - "merchant_code": "NB_ICICI", - "display_priority": 1, - "display_name": "ICICI Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "HDFC Bank", - "code": "HDFC", - "bank_name": "HDFC Bank", - "bank_code": "HDFC", - "url": "https://hdn-1.fynd.com/payment/NB_HDFC.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_HDFC.png", - "large": "https://hdn-1.fynd.com/payment/NB_HDFC.png" - }, - "merchant_code": "NB_HDFC", - "display_priority": 2, - "display_name": "HDFC Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Axis Bank", - "code": "UTIB", - "bank_name": "Axis Bank", - "bank_code": "UTIB", - "url": "https://hdn-1.fynd.com/payment/NB_AXIS.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_AXIS.png", - "large": "https://hdn-1.fynd.com/payment/NB_AXIS.png" - }, - "merchant_code": "NB_AXIS", - "display_priority": 3, - "display_name": "Axis Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "State Bank of India", - "code": "SBIN", - "bank_name": "State Bank of India", - "bank_code": "SBIN", - "url": "https://hdn-1.fynd.com/payment/NB_SBI.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_SBI.png", - "large": "https://hdn-1.fynd.com/payment/NB_SBI.png" - }, - "merchant_code": "NB_SBI", - "display_priority": 4, - "display_name": "State Bank of India" - }, - { - "aggregator_name": "Razorpay", - "name": "Kotak Mahindra Bank", - "code": "KKBK", - "bank_name": "Kotak Mahindra Bank", - "bank_code": "KKBK", - "url": "https://hdn-1.fynd.com/payment/NB_KOTAK.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_KOTAK.png", - "large": "https://hdn-1.fynd.com/payment/NB_KOTAK.png" - }, - "merchant_code": "NB_KOTAK", - "display_priority": 5, - "display_name": "Kotak Mahindra Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Indusind Bank", - "code": "INDB", - "bank_name": "Indusind Bank", - "bank_code": "INDB", - "url": "https://hdn-1.fynd.com/payment/NB_INDUS.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_INDUS.png", - "large": "https://hdn-1.fynd.com/payment/NB_INDUS.png" - }, - "merchant_code": "INDB", - "display_priority": 6, - "display_name": "Indusind Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "City Union Bank", - "code": "CIUB", - "bank_name": "City Union Bank", - "bank_code": "CIUB", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_CUB", - "display_priority": 9, - "display_name": "City Union Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Catholic Syrian Bank", - "code": "CSBK", - "bank_name": "Catholic Syrian Bank", - "bank_code": "CSBK", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "CSBK", - "display_priority": 11, - "display_name": "Catholic Syrian Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "State Bank of Hyderabad", - "code": "SBHY", - "bank_name": "State Bank of Hyderabad", - "bank_code": "SBHY", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_SBH", - "display_priority": 12, - "display_name": "State Bank of Hyderabad" - }, - { - "aggregator_name": "Razorpay", - "name": "Allahabad Bank", - "code": "ALLA", - "bank_name": "Allahabad Bank", - "bank_code": "ALLA", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "ALLA", - "display_priority": 15, - "display_name": "Allahabad Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Syndicate Bank", - "code": "SYNB", - "bank_name": "Syndicate Bank", - "bank_code": "SYNB", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "SYNB", - "display_priority": 17, - "display_name": "Syndicate Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Corporation Bank", - "code": "CORP", - "bank_name": "Corporation Bank", - "bank_code": "CORP", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_CORP", - "display_priority": 18, - "display_name": "Corporation Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Punjab National Bank - Corporate Banking", - "code": "PUNB_C", - "bank_name": "Punjab National Bank - Corporate Banking", - "bank_code": "PUNB_C", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "PUNB_C", - "display_priority": 19, - "display_name": "Punjab National Bank - Corporate Banking" - }, - { - "aggregator_name": "Razorpay", - "name": "Canara Bank", - "code": "CNRB", - "bank_name": "Canara Bank", - "bank_code": "CNRB", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_CANR", - "display_priority": 20, - "display_name": "Canara Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Saraswat Co-operative Bank", - "code": "SRCB", - "bank_name": "Saraswat Co-operative Bank", - "bank_code": "SRCB", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "SRCB", - "display_priority": 21, - "display_name": "Saraswat Co-operative Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Deutsche Bank", - "code": "DEUT", - "bank_name": "Deutsche Bank", - "bank_code": "DEUT", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_DEUT", - "display_priority": 22, - "display_name": "Deutsche Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Dhanlaxmi Bank", - "code": "DLXB", - "bank_name": "Dhanlaxmi Bank", - "bank_code": "DLXB", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "DLXB", - "display_priority": 24, - "display_name": "Dhanlaxmi Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Oriental Bank of Commerce", - "code": "ORBC", - "bank_name": "Oriental Bank of Commerce", - "bank_code": "ORBC", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "ORBC", - "display_priority": 25, - "display_name": "Oriental Bank of Commerce" - }, - { - "aggregator_name": "Razorpay", - "name": "Punjab National Bank - Retail Banking", - "code": "PUNB_R", - "bank_name": "Punjab National Bank - Retail Banking", - "bank_code": "PUNB_R", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "PUNB_R", - "display_priority": 26, - "display_name": "Punjab National Bank - Retail Banking" - }, - { - "aggregator_name": "Razorpay", - "name": "State Bank of Bikaner and Jaipur", - "code": "SBBJ", - "bank_name": "State Bank of Bikaner and Jaipur", - "bank_code": "SBBJ", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_SBBJ", - "display_priority": 27, - "display_name": "State Bank of Bikaner and Jaipur" - }, - { - "aggregator_name": "Razorpay", - "name": "Indian Overseas Bank", - "code": "IOBA", - "bank_name": "Indian Overseas Bank", - "bank_code": "IOBA", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_IOB", - "display_priority": 28, - "display_name": "Indian Overseas Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "State Bank of Travancore", - "code": "SBTR", - "bank_name": "State Bank of Travancore", - "bank_code": "SBTR", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_SBT", - "display_priority": 29, - "display_name": "State Bank of Travancore" - }, - { - "aggregator_name": "Razorpay", - "name": "Airtel Payments Bank", - "code": "AIRP", - "bank_name": "Airtel Payments Bank", - "bank_code": "AIRP", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "AIRP", - "display_priority": 30, - "display_name": "Airtel Payments Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Development Bank of Singapore", - "code": "DBSS", - "bank_name": "Development Bank of Singapore", - "bank_code": "DBSS", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "DBSS", - "display_priority": 31, - "display_name": "Development Bank of Singapore" - }, - { - "aggregator_name": "Razorpay", - "name": "Vijaya Bank", - "code": "VIJB", - "bank_name": "Vijaya Bank", - "bank_code": "VIJB", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_VJYB", - "display_priority": 32, - "display_name": "Vijaya Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "NKGSB Co-operative Bank", - "code": "NKGS", - "bank_name": "NKGSB Co-operative Bank", - "bank_code": "NKGS", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NKGS", - "display_priority": 33, - "display_name": "NKGSB Co-operative Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "RBL Bank", - "code": "RATN", - "bank_name": "RBL Bank", - "bank_code": "RATN", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "RATN", - "display_priority": 35, - "display_name": "RBL Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Bank of Baroda - Retail Banking", - "code": "BARB_R", - "bank_name": "Bank of Baroda - Retail Banking", - "bank_code": "BARB_R", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "BARB_R", - "display_priority": 36, - "display_name": "Bank of Baroda - Retail Banking" - }, - { - "aggregator_name": "Razorpay", - "name": "Karnataka Bank", - "code": "KARB", - "bank_name": "Karnataka Bank", - "bank_code": "KARB", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_KARN", - "display_priority": 37, - "display_name": "Karnataka Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Tamilnadu State Apex Co-operative Bank", - "code": "TNSC", - "bank_name": "Tamilnadu State Apex Co-operative Bank", - "bank_code": "TNSC", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "TNSC", - "display_priority": 38, - "display_name": "Tamilnadu State Apex Co-operative Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Tamilnadu Mercantile Bank", - "code": "TMBL", - "bank_name": "Tamilnadu Mercantile Bank", - "bank_code": "TMBL", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "TMBL", - "display_priority": 40, - "display_name": "Tamilnadu Mercantile Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Lakshmi Vilas Bank - Retail Banking", - "code": "LAVB_R", - "bank_name": "Lakshmi Vilas Bank - Retail Banking", - "bank_code": "LAVB_R", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "LAVB_R", - "display_priority": 42, - "display_name": "Lakshmi Vilas Bank - Retail Banking" - }, - { - "aggregator_name": "Razorpay", - "name": "Dena Bank", - "code": "BKDN", - "bank_name": "Dena Bank", - "bank_code": "BKDN", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "BKDN", - "display_priority": 43, - "display_name": "Dena Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Federal Bank", - "code": "FDRL", - "bank_name": "Federal Bank", - "bank_code": "FDRL", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_FED", - "display_priority": 44, - "display_name": "Federal Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Indian Bank", - "code": "IDIB", - "bank_name": "Indian Bank", - "bank_code": "IDIB", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_INDB", - "display_priority": 45, - "display_name": "Indian Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "South Indian Bank", - "code": "SIBL", - "bank_name": "South Indian Bank", - "bank_code": "SIBL", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_SOIB", - "display_priority": 46, - "display_name": "South Indian Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "IDBI", - "code": "IBKL", - "bank_name": "IDBI", - "bank_code": "IBKL", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "IBKL", - "display_priority": 49, - "display_name": "IDBI" - }, - { - "aggregator_name": "Razorpay", - "name": "Karur Vysya Bank", - "code": "KVBL", - "bank_name": "Karur Vysya Bank", - "bank_code": "KVBL", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_KVB", - "display_priority": 50, - "display_name": "Karur Vysya Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Punjab & Sind Bank", - "code": "PSIB", - "bank_name": "Punjab & Sind Bank", - "bank_code": "PSIB", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "PSIB", - "display_priority": 52, - "display_name": "Punjab & Sind Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "UCO Bank", - "code": "UCBA", - "bank_name": "UCO Bank", - "bank_code": "UCBA", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "UCBA", - "display_priority": 53, - "display_name": "UCO Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Bank of Bahrein and Kuwait", - "code": "BBKM", - "bank_name": "Bank of Bahrein and Kuwait", - "bank_code": "BBKM", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "BBKM", - "display_priority": 54, - "display_name": "Bank of Bahrein and Kuwait" - }, - { - "aggregator_name": "Razorpay", - "name": "Yes Bank", - "code": "YESB", - "bank_name": "Yes Bank", - "bank_code": "YESB", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_YESB", - "display_priority": 55, - "display_name": "Yes Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Punjab & Maharashtra Co-operative Bank", - "code": "PMCB", - "bank_name": "Punjab & Maharashtra Co-operative Bank", - "bank_code": "PMCB", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "PMCB", - "display_priority": 56, - "display_name": "Punjab & Maharashtra Co-operative Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Bank of India", - "code": "BKID", - "bank_name": "Bank of India", - "bank_code": "BKID", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_BOI", - "display_priority": 57, - "display_name": "Bank of India" - }, - { - "aggregator_name": "Razorpay", - "name": "Bank of Maharashtra", - "code": "MAHB", - "bank_name": "Bank of Maharashtra", - "bank_code": "MAHB", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_BOM", - "display_priority": 58, - "display_name": "Bank of Maharashtra" - }, - { - "aggregator_name": "Razorpay", - "name": "IDFC Bank", - "code": "IDFB", - "bank_name": "IDFC Bank", - "bank_code": "IDFB", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "IDFB", - "display_priority": 59, - "display_name": "IDFC Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Janata Sahakari Bank (Pune)", - "code": "JSBP", - "bank_name": "Janata Sahakari Bank (Pune)", - "bank_code": "JSBP", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "JSBP", - "display_priority": 60, - "display_name": "Janata Sahakari Bank (Pune)" - }, - { - "aggregator_name": "Razorpay", - "name": "Shamrao Vithal Co-operative Bank", - "code": "SVCB", - "bank_name": "Shamrao Vithal Co-operative Bank", - "bank_code": "SVCB", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "SVCB", - "display_priority": 61, - "display_name": "Shamrao Vithal Co-operative Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Cosmos Co-operative Bank", - "code": "COSB", - "bank_name": "Cosmos Co-operative Bank", - "bank_code": "COSB", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "COSB", - "display_priority": 62, - "display_name": "Cosmos Co-operative Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "State Bank of Mysore", - "code": "SBMY", - "bank_name": "State Bank of Mysore", - "bank_code": "SBMY", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_SBM", - "display_priority": 63, - "display_name": "State Bank of Mysore" - }, - { - "aggregator_name": "Razorpay", - "name": "Andhra Bank", - "code": "ANDB", - "bank_name": "Andhra Bank", - "bank_code": "ANDB", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "ANDB", - "display_priority": 65, - "display_name": "Andhra Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Jammu and Kashmir Bank", - "code": "JAKA", - "bank_name": "Jammu and Kashmir Bank", - "bank_code": "JAKA", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_JNK", - "display_priority": 66, - "display_name": "Jammu and Kashmir Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "United Bank of India", - "code": "UTBI", - "bank_name": "United Bank of India", - "bank_code": "UTBI", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "UTBI", - "display_priority": 67, - "display_name": "United Bank of India" - }, - { - "aggregator_name": "Razorpay", - "name": "Lakshmi Vilas Bank - Corporate Banking", - "code": "LAVB_C", - "bank_name": "Lakshmi Vilas Bank - Corporate Banking", - "bank_code": "LAVB_C", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "LAVB_C", - "display_priority": 69, - "display_name": "Lakshmi Vilas Bank - Corporate Banking" - }, - { - "aggregator_name": "Razorpay", - "name": "State Bank of Patiala", - "code": "STBP", - "bank_name": "State Bank of Patiala", - "bank_code": "STBP", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_SBP", - "display_priority": 70, - "display_name": "State Bank of Patiala" - }, - { - "aggregator_name": "Razorpay", - "name": "DCB Bank", - "code": "DCBL", - "bank_name": "DCB Bank", - "bank_code": "DCBL", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "DCBL", - "display_priority": 71, - "display_name": "DCB Bank" - }, - { - "aggregator_name": "Razorpay", - "name": "Union Bank of India", - "code": "UBIN", - "bank_name": "Union Bank of India", - "bank_code": "UBIN", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "NB_UBI", - "display_priority": 73, - "display_name": "Union Bank of India" - }, - { - "aggregator_name": "Razorpay", - "name": "Standard Chartered Bank", - "code": "SCBL", - "bank_name": "Standard Chartered Bank", - "bank_code": "SCBL", - "url": "https://hdn-1.fynd.com/payment/NB_generic.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/NB_generic.png", - "large": "https://hdn-1.fynd.com/payment/NB_generic.png" - }, - "merchant_code": "SCBL", - "display_priority": 74, - "display_name": "Standard Chartered Bank" - } - ] - }, - { - "name": "WL", - "display_priority": 4, - "payment_mode_id": 4, - "display_name": "Wallet", - "list": [ - { - "wallet_name": "Paytm", - "wallet_code": "paytm", - "name": "Paytm", - "display_name": "Paytm", - "code": "PAYTM", - "wallet_id": 4, - "merchant_code": "PAYTM", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/paytm_logo_small.png", - "large": "https://hdn-1.fynd.com/payment/paytm_logo_large.png" - }, - "aggregator_name": "Juspay", - "display_priority": 1 - }, - { - "wallet_name": "Mobikwik", - "wallet_code": "mobikwik", - "name": "Mobikwik", - "display_name": "Mobikwik", - "code": "MOBIKWIK", - "wallet_id": 5, - "merchant_code": "MOBIKWIK", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/mobikwik_logo_small.png", - "large": "https://hdn-1.fynd.com/payment/mobikwik_logo_small.png" - }, - "aggregator_name": "Juspay", - "display_priority": 3 - }, - { - "wallet_name": "Ola Money", - "wallet_code": "olamoney", - "name": "Ola Money", - "display_name": "Ola Money", - "code": "OLAMONEY", - "wallet_id": 6, - "merchant_code": "OLAMONEY", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/olamoney.png", - "large": "https://hdn-1.fynd.com/payment/olamoney.png" - }, - "aggregator_name": "Razorpay", - "display_priority": 4 - }, - { - "wallet_name": "Amazon Pay", - "wallet_code": "amazonpay", - "name": "Amazon Pay", - "display_name": "Amazon Pay", - "code": "AMAZONPAY", - "wallet_id": 10, - "merchant_code": "AMAZONPAY", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/amazon-pay.png", - "large": "https://hdn-1.fynd.com/payment/amazon-pay.png" - }, - "aggregator_name": "Razorpay", - "display_priority": 9 - }, - { - "wallet_name": "PayPal", - "wallet_code": "paypal", - "name": "PayPal", - "display_name": "PayPal", - "code": "PAYPAL", - "wallet_id": 11, - "merchant_code": "PAYPAL", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/paypal.jpg", - "large": "https://hdn-1.fynd.com/payment/paypal.jpg " - }, - "aggregator_name": "Razorpay", - "display_priority": 10 - } - ] - }, - { - "name": "UPI", - "display_priority": 9, - "payment_mode_id": 7, - "display_name": "UPI", - "list": [ - { - "aggregator_name": "Razorpay", - "name": "UPI", - "display_name": "BHIM UPI", - "code": "UPI", - "logo_url": { - "large": "https://hdn-1.fynd.com/payment/upi_150x100.png", - "small": "https://hdn-1.fynd.com/payment/upi_100x78.png" - }, - "merchant_code": "UPI", - "timeout": 240, - "retry_count": 0, - "fynd_vpa": "shopsense.rzp@hdfcbank", - "intent_flow": true, - "intent_app_error_list": [ - "com.csam.icici.bank.imobile", - "in.org.npci.upiapp", - "com.whatsapp" - ] - } - ] - }, - { - "name": "EMI", - "display_priority": 18, - "payment_mode_id": 19, - "display_name": "Easy EMI", - "list": [ - { - "aggregator_name": "Razorpay", - "name": "EMI", - "display_name": "Easy EMI", - "code": "EMI", - "logo_url": { - "large": "https://hdn-1.fynd.com/payment/Pos+Logo.png", - "small": "https://hdn-1.fynd.com/payment/Pos+Logo.png" - }, - "merchant_code": "EMI" - } - ] - }, - { - "name": "JUSPAYPG", - "display_priority": 18, - "payment_mode_id": 23, - "display_name": "Pay Using Juspay", - "list": [ - { - "aggregator_name": "Juspay", - "name": "JUSPAYPG", - "display_name": "Pay Using Juspay", - "code": "JUSPAYPG", - "logo_url": { - "large": "https://hdn-1.fynd.com/payment/netbanking.png", - "small": "https://hdn-1.fynd.com/payment/netbanking.png" - }, - "merchant_code": "JUSPAYPG" - } - ] - }, - { - "name": "PG_PAYMENT", - "display_priority": 20, - "display_name": "Other payment gateway", - "list": [ - { - "aggregator_name": "Stripe", - "name": "STRIPEPG", - "display_name": "Pay using Stripe", - "code": "STRIPEPG", - "logo_url": { - "large": "https://hdn-1.fynd.com/payment/Pos+Logo.png", - "small": "https://hdn-1.fynd.com/payment/Pos+Logo.png" - }, - "merchant_code": "STRIPEPG" - }, - { - "aggregator_name": "Ccavenue", - "name": "CCAVENUEPG", - "display_name": "Pay using Ccavenue", - "code": "CCAVENUEPG", - "logo_url": { - "large": "https://hdn-1.fynd.com/payment/Pos+Logo.png", - "small": "https://hdn-1.fynd.com/payment/Pos+Logo.png" - }, - "merchant_code": "CCAVENUEPG" - }, - { - "aggregator_name": "Payumoney", - "name": "PAYUMONEYPG", - "display_name": "Pay using Payumoney", - "code": "PAYUMONEYPG", - "logo_url": { - "large": "https://fynd-obscuro-media-new.s3.amazonaws.com/payment/payu_logo_large.png", - "small": "https://fynd-obscuro-media-new.s3.amazonaws.com/payment/payu_logo_small.png" - }, - "merchant_code": "PAYUMONEYPG" - }, - { - "aggregator_name": "Payubiz", - "name": "PAYUBIZPG", - "display_name": "Pay using Payubiz", - "code": "PAYUBIZPG", - "logo_url": { - "large": "https://hdn-1.fynd.com/payment/payu.png", - "small": "https://hdn-1.fynd.com/payment/payu.png" - }, - "merchant_code": "PAYUBIZPG" - } - ] - }, - { - "name": "PL", - "display_priority": 21, - "display_name": "Pay Later", - "list": [ - { - "aggregator_name": "Simpl", - "name": "Simpl", - "display_name": "Simpl", - "code": "SIMPL", - "merchant_code": "SIMPL", - "logo": "https://hdn-1.fynd.com/payment/simpl_logo.png", - "logo_url": { - "small": "https://hdn-1.fynd.com/payment/simpl_logo.png", - "large": "https://hdn-1.fynd.com/payment/simpl_logo.png" - } - }, - { - "aggregator_name": "Rupifi", - "name": "RUPIFIPG", - "display_name": "Pay using Rupifi", - "code": "RUPIFIPG", - "logo_url": { - "large": "https://hdn-1.fynd.com/payment/Rupifi.png", - "small": "https://hdn-1.fynd.com/payment/Rupifi.png" - }, - "merchant_code": "RUPIFIPG" - } - ] - } - ] - } -} -``` -
    - - - - - - - - - ---- - - -#### getAllPayouts -Get All Payouts - - - -```swift -payment.getAllPayouts(companyId: companyId, uniqueExternalId: uniqueExternalId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| uniqueExternalId | String? | no | Fetch payouts using unique external id | - - - -Get All Payouts - -*Returned Response:* - - - - -[PayoutsResponse](#PayoutsResponse) - -payouts response object - - - - -
    -  Example: - -```json -[ - { - "unique_transfer_no": "d2ff79fcd3459831864824da8c9d7e5f", - "more_attributes": { - "city": "", - "state": "", - "country": "", - "bank_name": "YES", - "ifsc_code": "IFSCYES101", - "account_no": "9876541234", - "branch_name": "Mumbai", - "account_type": "current", - "account_holder": "Vikas Kumar" - }, - "transfer_type": "bank", - "is_default": true, - "is_active": true, - "customers": { - "id": 2, - "name": "reliance retail", - "mobile": "1234567890", - "email": "reliance@gmail.com", - "unique_external_id": "company:1" - }, - "payouts_aggregators": [ - { - "payout_details_id": 888, - "aggregator_id": 3, - "aggregator_fund_id": null - } - ] - }, - { - "unique_transfer_no": "e388c1c5df4933fa01f6da9f92595589", - "more_attributes": { - "city": "", - "state": "", - "country": "", - "bank_name": "SBI", - "ifsc_code": "SBIN0011513", - "account_no": "9876543210", - "branch_name": "Mumbai", - "account_type": "saving", - "account_holder": "Vikas Kumar" - }, - "transfer_type": "bank", - "is_default": false, - "is_active": true, - "customers": { - "id": 2, - "name": "reliance retail", - "mobile": "1234567890", - "email": "reliance@gmail.com", - "unique_external_id": "company:1" - }, - "payouts_aggregators": [ - { - "payout_details_id": 891, - "aggregator_id": 3, - "aggregator_fund_id": null - } - ] - } -] -``` -
    - - - - - - - - - ---- - - -#### savePayout -Save Payout - - - -```swift -payment.savePayout(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| body | PayoutRequest | no | Request body | - - -Save Payout - -*Returned Response:* - - - - -[PayoutResponse](#PayoutResponse) - -save payout response object - - - - -
    -  Example: - -```json -{ - "success": true, - "is_active": true, - "bank_details": { - "account_type": "saving", - "account_holder": "Vikas Kumar", - "branch_name": "Mumbai", - "country": "", - "ifsc_code": "SBIN0011513", - "account_no": "9876543210", - "city": "", - "state": "", - "bank_name": "SBI" - }, - "unique_transfer_no": "e388c1c5df4933fa01f6da9f92595589", - "users": { - "name": "reliance retail", - "unique_external_id": "company:1", - "mobile": "1234567890", - "email": "reliance@gmail.com" - }, - "aggregator": "Razorpay", - "transfer_type": "bank", - "created": true, - "payouts": { - "aggregator_fund_id": null - }, - "payment_status": "payout_initiated" -} -``` -
    - - - - - - - - - ---- - - -#### updatePayout -Update Payout - - - -```swift -payment.updatePayout(companyId: companyId, uniqueTransferNo: uniqueTransferNo, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| uniqueTransferNo | String | yes | Unique transfer id | -| body | PayoutRequest | no | Request body | - - -Update Payout - -*Returned Response:* - - - - -[UpdatePayoutResponse](#UpdatePayoutResponse) - -save payout response object - - - - -
    -  Example: - -```json -{ - "success": true, - "is_default": true, - "is_active": true -} -``` -
    - - - - - - - - - ---- - - -#### activateAndDectivatePayout -Partial Update Payout - - - -```swift -payment.activateAndDectivatePayout(companyId: companyId, uniqueTransferNo: uniqueTransferNo, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| uniqueTransferNo | String | yes | Unique transfer id | -| body | UpdatePayoutRequest | no | Request body | - - -Partial Update Payout - -*Returned Response:* - - - - -[UpdatePayoutResponse](#UpdatePayoutResponse) - -save payout response object - - - - -
    -  Example: - -```json -{ - "success": true, - "is_default": true, - "is_active": true -} -``` -
    - - - - - - - - - ---- - - -#### deletePayout -Delete Payout - - - -```swift -payment.deletePayout(companyId: companyId, uniqueTransferNo: uniqueTransferNo) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| uniqueTransferNo | String | yes | Unique transfer id | - - - -Delete Payout - -*Returned Response:* - - - - -[DeletePayoutResponse](#DeletePayoutResponse) - -delete payout response object - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getSubscriptionPaymentMethod -List Subscription Payment Method - - - -```swift -payment.getSubscriptionPaymentMethod(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | - - - -Get all Subscription Payment Method - -*Returned Response:* - - - - -[SubscriptionPaymentMethodResponse](#SubscriptionPaymentMethodResponse) - -List Subscription Payment Method Response - - - - -
    -  Example: - -```json -{ - "success": true, - "data": [ - { - "id": 68, - "type": "card", - "pg_payment_method_id": "pm_1H8HyIJ1ZTFIN1aD5eDOL4nU", - "data": { - "brand": "visa", - "last4": "4242", - "checks": { - "cvc_check": "pass", - "address_line1_check": null, - "address_postal_code_check": null - }, - "wallet": null, - "country": "US", - "funding": "credit", - "exp_year": 2044, - "networks": { - "available": [ - "visa" - ], - "preferred": null - }, - "exp_month": 12, - "fingerprint": "0aror24meTf8iYfw", - "generated_from": null, - "three_d_secure_usage": { - "supported": true - } - }, - "is_default": false - }, - { - "id": 81, - "type": "card", - "pg_payment_method_id": "pm_1Hc7tMJ1ZTFIN1aDCvMIIBeT", - "data": { - "brand": "visa", - "last4": "4242", - "checks": { - "cvc_check": "pass", - "address_line1_check": null, - "address_postal_code_check": null - }, - "wallet": null, - "country": "US", - "funding": "credit", - "exp_year": 2020, - "networks": { - "available": [ - "visa" - ], - "preferred": null - }, - "exp_month": 11, - "fingerprint": "0aror24meTf8iYfw", - "generated_from": null, - "three_d_secure_usage": { - "supported": true - } - }, - "is_default": true - }, - { - "id": 93, - "type": "card", - "pg_payment_method_id": "pm_1HvddjJ1ZTFIN1aDgebQvuyi", - "data": { - "brand": "visa", - "last4": "4242", - "checks": { - "cvc_check": "pass", - "address_line1_check": "pass", - "address_postal_code_check": "pass" - }, - "wallet": null, - "country": "US", - "funding": "credit", - "exp_year": 2022, - "networks": { - "available": [ - "visa" - ], - "preferred": null - }, - "exp_month": 11, - "fingerprint": "0aror24meTf8iYfw", - "generated_from": null, - "three_d_secure_usage": { - "supported": true - } - }, - "is_default": false - }, - { - "id": 98, - "type": "card", - "pg_payment_method_id": "pm_1IJDF0J1ZTFIN1aDnJFi4i2v", - "data": { - "brand": "visa", - "last4": "1111", - "checks": { - "cvc_check": "pass", - "address_line1_check": "pass", - "address_postal_code_check": "pass" - }, - "wallet": null, - "country": "US", - "funding": "credit", - "exp_year": 2025, - "networks": { - "available": [ - "visa" - ], - "preferred": null - }, - "exp_month": 11, - "fingerprint": "ZtDTGycouUEup4Q4", - "generated_from": null, - "three_d_secure_usage": { - "supported": true - } - }, - "is_default": false - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### deleteSubscriptionPaymentMethod -Delete Subscription Payment Method - - - -```swift -payment.deleteSubscriptionPaymentMethod(companyId: companyId, uniqueExternalId: uniqueExternalId, paymentMethodId: paymentMethodId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| uniqueExternalId | String | yes | | -| paymentMethodId | String | yes | | - - - -Uses this api to Delete Subscription Payment Method - -*Returned Response:* - - - - -[DeleteSubscriptionPaymentMethodResponse](#DeleteSubscriptionPaymentMethodResponse) - -Delete Subscription Payment Method Response. - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getSubscriptionConfig -List Subscription Config - - - -```swift -payment.getSubscriptionConfig(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | - - - -Get all Subscription Config details - -*Returned Response:* - - - - -[SubscriptionConfigResponse](#SubscriptionConfigResponse) - -List Subscription Config Response - - - - -
    -  Example: - -```json -{ - "success": true, - "aggregator": "stripe", - "config": { - "public_key": "pk_test_lHBf12TZLa5" - } -} -``` -
    - - - - - - - - - ---- - - -#### saveSubscriptionSetupIntent -Save Subscription Setup Intent - - - -```swift -payment.saveSubscriptionSetupIntent(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| body | SaveSubscriptionSetupIntentRequest | no | Request body | - - -Uses this api to Save Subscription Setup Intent - -*Returned Response:* - - - - -[SaveSubscriptionSetupIntentResponse](#SaveSubscriptionSetupIntentResponse) - -Save Subscription Setup Intent Response. - - - - -
    -  Example: - -```json -{ - "success": true, - "data": { - "id": "test", - "object": "test", - "client_secret": "test", - "customer": "test", - "status": "requires_payment_method" - } -} -``` -
    - - - - - - - - - ---- - - -#### addBeneficiaryDetails -Save bank details for cancelled/returned order - - - -```swift -payment.addBeneficiaryDetails(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| applicationId | String | yes | Application id | -| body | AddBeneficiaryDetailsRequest | no | Request body | - - -Use this API to save bank details for returned/cancelled order to refund amount in his account. - -*Returned Response:* - - - - -[RefundAccountResponse](#RefundAccountResponse) - -Success - - - - -
    -  Example: - -```json -{ - "success": true, - "message": "Account successfully created", - "data": {} -} -``` -
    - - - - - - - - - ---- - - -#### verifyIfscCode -Ifsc Code Verification - - - -```swift -payment.verifyIfscCode(companyId: companyId, ifscCode: ifscCode) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| ifscCode | String? | no | | - - - -Get True/False for correct IFSC Code for adding bank details for refund - -*Returned Response:* - - - - -[IfscCodeResponse](#IfscCodeResponse) - -Bank details on correct Ifsc Code - - - - -
    -  Example: - -```json -{ - "branch_name": "MANPUR", - "bank_name": "GAYA", - "BRANCH": "MANPUR", - "CENTRE": "GAYA", - "DISTRICT": "GAYA", - "STATE": "BIHAR", - "ADDRESS": "POBUNIYADGANJBIHAR", - "CONTACT": "00", - "MICR": "816002103", - "UPI": true, - "RTGS": true, - "CITY": "GAYA", - "NEFT": true, - "IMPS": true, - "SWIFT": "", - "BANK": "State Bank of India", - "BANKCODE": "SBIN", - "IFSC": "SBIN0005611", - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getUserOrderBeneficiaries -List Order Beneficiary - - - -```swift -payment.getUserOrderBeneficiaries(orderId: orderId, companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| orderId | String | yes | | -| companyId | Int | yes | Company Id | -| applicationId | String | yes | Application id | - - - -Get all active beneficiary details added by the user for refund - -*Returned Response:* - - - - -[OrderBeneficiaryResponse](#OrderBeneficiaryResponse) - -List Order Beneficiary - - - - -
    -  Example: - -```json -{ - "beneficiaries": [ - { - "id": 3695, - "beneficiary_id": "4c86dd56e634a4c6a8fb51d195bc7b83", - "bank_name": "State Bank of India", - "branch_name": "BHOGAT", - "account_holder": "PRAKASH TEST", - "account_no": "3566342455454", - "ifsc_code": "SBIN0014982", - "mobile": "7819064010", - "email": "prakashtest@gmail.com", - "address": "49A, Dabhi seri, jodhpur, kalyanpur", - "comment": "COD Refund", - "is_active": null, - "created_on": "2021-01-22 11:31:02", - "modified_on": "2021-01-22 11:31:02", - "display_name": "BANK", - "transfer_mode": "bank", - "title": "Bank Account", - "subtitle": "35663423659", - "delights_user_name": "shreeniwas_24x7_gmail_com_45978_16624463" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getUserBeneficiaries -List User Beneficiary - - - -```swift -payment.getUserBeneficiaries(orderId: orderId, companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| orderId | String | yes | | -| companyId | Int | yes | Company Id | -| applicationId | String | yes | Application id | - - - -Get all active beneficiary details added by the user for refund - -*Returned Response:* - - - - -[OrderBeneficiaryResponse](#OrderBeneficiaryResponse) - -List User Beneficiary - - - - -
    -  Example: - -```json -{ - "beneficiaries": [ - { - "id": 221, - "beneficiary_id": "0f7e44a922df352c05c5f73cb40ba115", - "bank_name": "State Bank of India", - "branch_name": "State Bank of India", - "account_holder": "SHASHI TEST", - "account_no": "1234567891", - "ifsc_code": "SBIN0005611", - "mobile": "9112042174", - "email": "payment@gofynd.com", - "address": "204A", - "comment": "", - "is_active": null, - "created_on": "2020-06-29 12:38:39", - "modified_on": "2020-06-29 12:38:39", - "display_name": "BANK", - "transfer_mode": "bank", - "title": "Bank Account", - "subtitle": "1234567891", - "delights_user_name": null - } - ], - "show_beneficiary_details": false -} -``` -
    - - - - - - - - - ---- - - -#### confirmPayment -Confirm payment after successful payment from payment gateway - - - -```swift -payment.confirmPayment(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| applicationId | String | yes | Application id | -| body | PaymentConfirmationRequest | no | Request body | - - -Use this API to confirm payment after payment gateway accepted payment. - -*Returned Response:* - - - - -[PaymentConfirmationResponse](#PaymentConfirmationResponse) - -Success. Returns the status of payment. Check the example shown below or refer `PaymentConfirmationResponseSchema` for more details. - - - - -
    -  Example: - -```json -{ - "success": true, - "message": "Payment Successful", - "order_id": "FY60F90AEF01FF43E878" -} -``` -
    - - - - - - - - - ---- - - - - -## Order - - -#### shipmentStatusUpdate -Update status of Shipment - - - -```swift -order.shipmentStatusUpdate(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| body | UpdateShipmentStatusBody | yes | Request body | - - -Update Shipment Status - -*Returned Response:* - - - - -[UpdateShipmentStatusResponse](#UpdateShipmentStatusResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### activityStatus -Get Activity Status - - - -```swift -order.activityStatus(companyId: companyId, bagId: bagId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| bagId | String | yes | Bag Id | - - - -Get Activity Status - -*Returned Response:* - - - - -[GetActivityStatus](#GetActivityStatus) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### storeProcessShipmentUpdate -Update Store Process-Shipment - - - -```swift -order.storeProcessShipmentUpdate(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| body | UpdateProcessShipmenstRequestBody | yes | Request body | - - -Update Store Process-Shipment - -*Returned Response:* - - - - -[UpdateProcessShipmenstRequestResponse](#UpdateProcessShipmenstRequestResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### checkRefund -Check Refund is available or not - - - -```swift -order.checkRefund(companyId: companyId, shipmentId: shipmentId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| shipmentId | String | yes | Shipment Id | - - - -Check Refund is available or not - -*Returned Response:* - - - - -[[String: Any]](#[String: Any]) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getOrdersByCompanyId -Get Orders for company based on Company Id - - - -```swift -order.getOrdersByCompanyId(companyId: companyId, pageNo: pageNo, pageSize: pageSize, fromDate: fromDate, toDate: toDate, q: q, stage: stage, salesChannels: salesChannels, orderId: orderId, stores: stores, status: status, shortenUrls: shortenUrls, filterType: filterType) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| pageNo | String? | no | Current page number | -| pageSize | String? | no | Page limit | -| fromDate | String? | no | From Date | -| toDate | String? | no | To Date | -| q | String? | no | Keyword for Search | -| stage | String? | no | Specefic Order Stage | -| salesChannels | String? | no | Selected Sales Channel | -| orderId | String? | no | Order Id | -| stores | String? | no | Selected Stores | -| status | String? | no | Status of order | -| shortenUrls | Bool? | no | Shorten URL option | -| filterType | String? | no | Filters | - - - -Get Orders - -*Returned Response:* - - - - -[OrderListing](#OrderListing) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getOrderLanesCountByCompanyId -Get Order Lanes Count for company based on Company Id - - - -```swift -order.getOrderLanesCountByCompanyId(companyId: companyId, pageNo: pageNo, pageSize: pageSize, fromDate: fromDate, toDate: toDate, q: q, stage: stage, salesChannels: salesChannels, orderId: orderId, stores: stores, status: status, shortenUrls: shortenUrls, filterType: filterType) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| pageNo | String? | no | Current page number | -| pageSize | String? | no | Page limit | -| fromDate | String? | no | From Date | -| toDate | String? | no | To Date | -| q | String? | no | Keyword for Search | -| stage | String? | no | Specefic Order Stage | -| salesChannels | String? | no | Selected Sales Channel | -| orderId | String? | no | Order Id | -| stores | String? | no | Selected Stores | -| status | String? | no | Status of order | -| shortenUrls | Bool? | no | Shorten URL option | -| filterType | String? | no | Filters | - - - -Get Orders Seperate Lane Count - -*Returned Response:* - - - - -[OrderLanesCount](#OrderLanesCount) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getOrderDetails -Get Order Details for company based on Company Id and Order Id - - - -```swift -order.getOrderDetails(companyId: companyId, orderId: orderId, next: next, previous: previous) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| orderId | String? | no | Order Id | -| next | String? | no | Next | -| previous | String? | no | Previous | - - - -Get Orders - -*Returned Response:* - - - - -[OrderDetails](#OrderDetails) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getPicklistOrdersByCompanyId -Get Orders for company based on Company Id - - - -```swift -order.getPicklistOrdersByCompanyId(companyId: companyId, pageNo: pageNo, pageSize: pageSize, fromDate: fromDate, toDate: toDate, q: q, stage: stage, salesChannels: salesChannels, orderId: orderId, stores: stores, status: status, shortenUrls: shortenUrls, filterType: filterType) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| pageNo | String? | no | Current page number | -| pageSize | String? | no | Page limit | -| fromDate | String? | no | From Date | -| toDate | String? | no | To Date | -| q | String? | no | Keyword for Search | -| stage | String? | no | Specefic Order Stage | -| salesChannels | String? | no | Selected Sales Channel | -| orderId | String? | no | Order Id | -| stores | String? | no | Selected Stores | -| status | String? | no | Status of order | -| shortenUrls | Bool? | no | Shorten URL option | -| filterType | String? | no | Filters | - - - -Get Orders - -*Returned Response:* - - - - -[OrderPicklistListing](#OrderPicklistListing) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### trackShipmentPlatform -Track Shipment by shipment id, for application based on application Id - - - -```swift -order.trackShipmentPlatform(companyId: companyId, applicationId: applicationId, shipmentId: shipmentId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| applicationId | String | yes | Application Id | -| shipmentId | String | yes | Shipment Id | - - - -Shipment Track - -*Returned Response:* - - - - -[PlatformShipmentTrack](#PlatformShipmentTrack) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### trackOrder -Track Order by order id, for application based on application Id - - - -```swift -order.trackOrder(companyId: companyId, applicationId: applicationId, orderId: orderId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| applicationId | String | yes | Application Id | -| orderId | String | yes | Order Id | - - - -Order Track - -*Returned Response:* - - - - -[PlatformOrderTrack](#PlatformOrderTrack) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### failedOrders -Get all failed orders application wise - - - -```swift -order.failedOrders(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| applicationId | String | yes | Application Id | - - - -Failed Orders - -*Returned Response:* - - - - -[FailedOrders](#FailedOrders) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### reprocessOrder -Reprocess order by order id - - - -```swift -order.reprocessOrder(companyId: companyId, applicationId: applicationId, orderId: orderId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| applicationId | String | yes | Application Id | -| orderId | String | yes | Order Id | - - - -Order Reprocess - -*Returned Response:* - - - - -[UpdateOrderReprocessResponse](#UpdateOrderReprocessResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updateShipment -Use this API to update the shipment using its shipment ID. - - - -```swift -order.updateShipment(companyId: companyId, applicationId: applicationId, shipmentId: shipmentId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| applicationId | String | yes | Application Id | -| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | -| body | ShipmentUpdateRequest | yes | Request body | - - -Update the shipment - -*Returned Response:* - - - - -[ShipmentUpdateResponse](#ShipmentUpdateResponse) - -Success. Check the example shown below or refer `ShipmentUpdateRequest` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getPlatformShipmentReasons -Use this API to retrieve the issues that led to the cancellation of bags within a shipment. - - - -```swift -order.getPlatformShipmentReasons(companyId: companyId, applicationId: applicationId, action: action) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| applicationId | String | yes | Application Id | -| action | String | yes | Action | - - - -Get reasons behind full or partial cancellation of a shipment - -*Returned Response:* - - - - -[ShipmentReasonsResponse](#ShipmentReasonsResponse) - -Success. Check the example shown below or refer `ShipmentReasonsResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getShipmentTrackDetails -Use this API to track a shipment using its shipment ID. - - - -```swift -order.getShipmentTrackDetails(companyId: companyId, applicationId: applicationId, orderId: orderId, shipmentId: shipmentId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| applicationId | String | yes | Application Id | -| orderId | String | yes | ID of the order. | -| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | - - - -Track shipment - -*Returned Response:* - - - - -[ShipmentTrackResponse](#ShipmentTrackResponse) - -Success. Check the example shown below or refer `ShipmentTrackResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getShipmentAddress -Use this API to get address of a shipment using its shipment ID and Address Category. - - - -```swift -order.getShipmentAddress(companyId: companyId, shipmentId: shipmentId, addressCategory: addressCategory) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | -| addressCategory | String | yes | Category of the address it falls into(billing or delivery). | - - - -Get Shipment Address - -*Returned Response:* - - - - -[GetShipmentAddressResponse](#GetShipmentAddressResponse) - -Success. Check the example shown below or refer `GetShipmentAddressResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updateShipmentAddress -Use this API to update address of a shipment using its shipment ID and Address Category. - - - -```swift -order.updateShipmentAddress(companyId: companyId, shipmentId: shipmentId, addressCategory: addressCategory, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | -| addressCategory | String | yes | Category of the address it falls into(billing or delivery). | -| body | UpdateShipmentAddressRequest | yes | Request body | - - -Update Shipment Address - -*Returned Response:* - - - - -[UpdateShipmentAddressResponse](#UpdateShipmentAddressResponse) - -Success. Check the example shown below or refer `UpdateShipmentAddressResponse` for more details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getPing -Get Ping - - - -```swift -order.getPing(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | - - - -Get Ping - -*Returned Response:* - - - - -[GetPingResponse](#GetPingResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### voiceCallback -Get Voice Callback - - - -```swift -order.voiceCallback(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | - - - -Voice Callback - -*Returned Response:* - - - - -[GetVoiceCallbackResponse](#GetVoiceCallbackResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### voiceClickToCall -Get Voice Click to Call - - - -```swift -order.voiceClickToCall(companyId: companyId, caller: caller, receiver: receiver) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| caller | String | yes | Caller contact number | -| receiver | String | yes | Receiver contact number | - - - -Voice Click to Call - -*Returned Response:* - - - - -[GetClickToCallResponse](#GetClickToCallResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - - - -## Catalog - - -#### deleteSearchKeywords -Delete a Search Keywords - - - -```swift -catalog.deleteSearchKeywords(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| id | String | yes | A `id` is a unique identifier for a particular detail. Pass the `id` of the keywords which you want to delete. | - - - -Delete a keywords by it's id. Returns an object that tells whether the keywords was deleted successfully - -*Returned Response:* - - - - -[DeleteResponse](#DeleteResponse) - -Status object. Tells whether the operation was successful. See example below or refer `DeleteResponse` - - - - -
    -  Example: - -```json -{ - "message": "Words Deleted" -} -``` -
    - - - - - - - - - ---- - - -#### updateSearchKeywords -Update Search Keyword - - - -```swift -catalog.updateSearchKeywords(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| id | String | yes | A `id` is a unique identifier for a particular detail. Pass the `id` of the keywords which you want to delete. | -| body | CreateSearchKeyword | yes | Request body | - - -Update Search Keyword by its id. On successful request, returns the updated collection - -*Returned Response:* - - - - -[GetSearchWordsData](#GetSearchWordsData) - -The Collection object. See example below or refer `GetSearchWordsDataSchema` for details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getSearchKeywords -Get a Search Keywords Details - - - -```swift -catalog.getSearchKeywords(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| id | String | yes | A `id` is a unique identifier for a particular detail. Pass the `id` of the keywords which you want to retrieve. | - - - -Get the details of a words by its `id`. If successful, returns a Collection resource in the response body specified in `GetSearchWordsDetailResponseSchema` - -*Returned Response:* - - - - -[GetSearchWordsDetailResponse](#GetSearchWordsDetailResponse) - -The Collection object. See example below or refer `GetSearchWordsDetailResponseSchema` for details - - - - -
    -  Example: - -```json -{ - "uid": "602fa1e9a596ce349563f6b9", - "words": [ - "sds" - ], - "app_id": "000000000000000000000001", - "is_active": true, - "result": { - "query": { - "department": [ - "men" - ] - }, - "sort_on": "popular" - }, - "_custom_json": {} -} -``` -
    - - - - - - - - - ---- - - -#### createCustomKeyword -Add a Custom Search Keywords - - - -```swift -catalog.createCustomKeyword(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| body | CreateSearchKeyword | yes | Request body | - - -Create a Custom Search Keywords. See `CreateSearchKeywordSchema` for the list of attributes needed to create a mapping and /collections/query-options for the available options to create a rule. On successful request, returns a paginated list of collections specified in `CreateSearchKeywordSchema` - -*Returned Response:* - - - - -[GetSearchWordsData](#GetSearchWordsData) - -Get keyword object with id that is added. See example below or refer `GetSearchWordsDataSchema` for details - - - - -
    -  Example: - -```json -{ - "uid": "602fa1e9a596ce349563f6b9", - "words": [ - "sds" - ], - "app_id": "000000000000000000000001", - "is_active": true, - "result": { - "query": { - "department": [ - "men" - ] - }, - "sort_on": "popular" - }, - "_custom_json": {} -} -``` -
    - - - - - - - - - ---- - - -#### getAllSearchKeyword -List all Search Custom Keyword Listing - - - -```swift -catalog.getAllSearchKeyword(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | - - - -Custom Search Keyword allows you to map conditions with keywords to give you the ultimate results - -*Returned Response:* - - - - -[GetSearchWordsResponse](#GetSearchWordsResponse) - -List of custom search keywords. See example below or refer `GetSearchWordsResponseSchema` for details - - - - -
    -  Example: - -```json -{ - "page": { - "current": 1, - "size": 1, - "has_previous": false, - "has_next": false, - "item_count": 1 - }, - "items": [ - { - "uid": "602fa1e9a596ce349563f6b9", - "words": [ - "sds" - ], - "app_id": "000000000000000000000001", - "is_active": true, - "result": { - "query": { - "department": [ - "men" - ] - }, - "sort_on": "popular" - }, - "_custom_json": {} - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### deleteAutocompleteKeyword -Delete a Autocomplete Keywords - - - -```swift -catalog.deleteAutocompleteKeyword(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| id | String | yes | A `id` is a unique identifier for a particular detail. Pass the `id` of the keywords which you want to delete. | - - - -Delete a keywords by it's id. Returns an object that tells whether the keywords was deleted successfully - -*Returned Response:* - - - - -[DeleteResponse](#DeleteResponse) - -Status object. Tells whether the operation was successful. See example below or refer `DeleteResponse` - - - - -
    -  Example: - -```json -{ - "message": "Words Deleted" -} -``` -
    - - - - - - - - - ---- - - -#### updateAutocompleteKeyword -Create & Update Autocomplete Keyword - - - -```swift -catalog.updateAutocompleteKeyword(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| id | String | yes | A `id` is a unique identifier for a particular detail. Pass the `id` of the keywords which you want to delete. | -| body | CreateAutocompleteKeyword | yes | Request body | - - -Update a mapping by it's id. On successful request, returns the updated Keyword mapping - -*Returned Response:* - - - - -[GetAutocompleteWordsResponse](#GetAutocompleteWordsResponse) - -The Mapping object. See example below or refer `GetAutocompleteWordsResponseSchema` for details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getAutocompleteKeywordDetail -Get a Autocomplete Keywords Details - - - -```swift -catalog.getAutocompleteKeywordDetail(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| id | String | yes | A `id` is a unique identifier for a particular detail. Pass the `id` of the keywords which you want to retrieve. | - - - -Get the details of a words by its `id`. If successful, returns a keywords resource in the response body specified in `GetAutocompleteWordsResponseSchema` - -*Returned Response:* - - - - -[GetAutocompleteWordsResponse](#GetAutocompleteWordsResponse) - -The mapping object. See example below or refer `GetAutocompleteWordsResponseSchema` for details - - - - -
    -  Example: - -```json -{ - "uid": "602fa1eaa596ce349563f6c6", - "app_id": "000000000000000000000001", - "words": [ - "dasd" - ], - "is_active": true, - "results": [ - { - "_custom_json": {}, - "display": "Helllow", - "logo": { - "url": "https://hdn-1.addsale.com/addsale/company/61/applications/600a5b3fe0991a4718cdb448/company/1/application/000000000000000000000001/search/pictures/square-logo/original/n_8bvEaBw-Helllow.png" - }, - "action": { - "type": "page", - "page": { - "query": { - "brand": [ - "nike" - ] - }, - "type": "products", - "url": "/products/?brand=nike" - } - } - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### createCustomAutocompleteRule -Add a Custom Autocomplete Keywords - - - -```swift -catalog.createCustomAutocompleteRule(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| body | CreateAutocompleteKeyword | yes | Request body | - - -Create a Custom Autocomplete Keywords. See `CreateAutocompleteKeywordSchema` for the list of attributes needed to create a mapping and /collections/query-options for the available options to create a rule. On successful request, returns a paginated list of collections specified in `CreateAutocompleteKeywordSchema` - -*Returned Response:* - - - - -[CreateAutocompleteWordsResponse](#CreateAutocompleteWordsResponse) - -List of all the collections including the one you added. See example below or refer `CreateAutocompleteWordsResponseSchema` for details - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getAutocompleteConfig -List all Autocomplete Keyword Listing - - - -```swift -catalog.getAutocompleteConfig(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | - - - -Custom Autocomplete Keyword allows you to map conditions with keywords to give you the ultimate results - -*Returned Response:* - - - - -[GetAutocompleteWordsResponse](#GetAutocompleteWordsResponse) - -List of custom autocomplete keywords. See example below or refer `GetAutocompleteWordsResponseSchema` for details - - - - -
    -  Example: - -```json -{ - "page": { - "current": 1, - "size": 1, - "has_previous": false, - "has_next": false, - "item_count": 1 - }, - "items": [ - { - "uid": "602fa1eaa596ce349563f6c6", - "app_id": "000000000000000000000001", - "words": [ - "dasd" - ], - "is_active": true, - "results": [ - { - "_custom_json": {}, - "display": "Helllow", - "logo": { - "url": "https://hdn-1.addsale.com/addsale/company/61/applications/600a5b3fe0991a4718cdb448/company/1/application/000000000000000000000001/search/pictures/square-logo/original/n_8bvEaBw-Helllow.png" - }, - "action": { - "type": "page", - "page": { - "query": { - "brand": [ - "nike" - ] - }, - "type": "products", - "url": "/products/?brand=nike" - } - } - } - ] - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### createProductBundle -Create Product Bundle - - - -```swift -catalog.createProductBundle(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| body | ProductBundleRequest | yes | Request body | - - -Create Product Bundle. See `ProductBundleRequest` for the request body parameter need to create a product bundle. On successful request, returns in `ProductBundleRequest` with id - -*Returned Response:* - - - - -[GetProductBundleCreateResponse](#GetProductBundleCreateResponse) - -Get bundle with id that is added. See example below or refer `GetProductBundleCreateResponse` for details - - - - -
    -  Example: - -```json -{ - "slug": "bag", - "logo": "http://g.com/poo.png/", - "name": "Bag", - "choice": "multi", - "products": [ - { - "product_uid": 7500001, - "max_quantity": 1, - "min_quantity": 1, - "auto_add_to_cart": false, - "auto_select": false, - "allow_remove": true - } - ], - "meta": {}, - "same_store_assignment": true, - "is_active": true, - "page_visibility": [ - "pdp" - ], - "created_by": { - "username": "917827311650_22960", - "uid": "123" - }, - "company_id": 1, - "created_on": "2021-02-19 16:40:26.310007", - "modified_by": { - "username": "917827311650_22960", - "uid": "123" - }, - "modified_on": "2021-02-19 16:40:26.310027", - "id": "602f9ca2a596ce312f5956f9" -} -``` -
    - - - - - - - - - ---- - - -#### getProductBundle -List all Product Bundles - - - -```swift -catalog.getProductBundle(companyId: companyId, q: q) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| q | String? | no | A search string that is searched with product bundle name. | - - - -Get all product bundles for a particular company - -*Returned Response:* - - - - -[GetProductBundleListingResponse](#GetProductBundleListingResponse) - -List of bundle configured for a company. See example below or refer `GetProductBundleListingResponse` for details - - - - -
    -  Example: - -```json -{ - "page": { - "current": 1, - "total": 1, - "has_previous": false, - "has_next": false, - "total_item_count": 4 - }, - "items": [ - { - "slug": "bag", - "logo": "http://g.com/poo.png/", - "name": "Bag", - "choice": "multi", - "products": [ - { - "product_uid": 7500001, - "max_quantity": 1, - "min_quantity": 1, - "auto_add_to_cart": false, - "auto_select": false, - "allow_remove": true - } - ], - "meta": {}, - "same_store_assignment": true, - "is_active": true, - "page_visibility": [ - "pdp" - ], - "created_by": { - "username": "917827311650_22960", - "uid": "123" - }, - "company_id": 1, - "created_on": "2021-02-19 16:40:26.310007", - "modified_by": { - "username": "917827311650_22960", - "uid": "123" - }, - "modified_on": "2021-02-19 16:40:26.310027", - "id": "602f9ca2a596ce312f5956f9" - }, - { - "choice": "multi", - "same_store_assignment": true, - "products": [ - { - "auto_select": false, - "allow_remove": true, - "auto_add_to_cart": false, - "max_quantity": 1, - "product_uid": 7500001, - "min_quantity": 1 - } - ], - "is_active": true, - "slug": "bag", - "meta": {}, - "logo": "http://g.com/poo.png/", - "page_visibility": [ - "pdp" - ], - "name": "Bag", - "created_by": { - "username": "917827311650_22960", - "uid": "123" - }, - "company_id": 1, - "created_on": "2021-02-19 16:21:35.091512", - "modified_by": { - "username": "917827311650_22960", - "uid": "123" - }, - "modified_on": "2021-02-19 16:21:35.091540", - "id": "602f9837a596ce2edf9868e2" - }, - { - "slug": "bag", - "is_active": true, - "same_store_assignment": true, - "meta": {}, - "choice": "multi", - "logo": "http://g.com/poo.png/", - "page_visibility": [ - "pdp" - ], - "name": "Bag", - "products": [ - { - "auto_select": false, - "min_quantity": 1, - "allow_remove": true, - "auto_add_to_cart": false, - "max_quantity": 1, - "product_uid": 7500001 - } - ], - "created_by": { - "username": "917827311650_22960", - "uid": "123" - }, - "company_id": 1, - "created_on": "2021-02-19 16:20:24.605207", - "modified_by": { - "username": "917827311650_22960", - "uid": "123" - }, - "modified_on": "2021-02-19 16:20:24.605230", - "id": "602f97f0a596ce2ead47cd0b" - }, - { - "products": [ - { - "auto_select": false, - "auto_add_to_cart": false, - "min_quantity": 1, - "allow_remove": true, - "max_quantity": 1, - "product_uid": 7500001 - } - ], - "is_active": true, - "logo": "http://g.com/poo.png/", - "name": "Bag", - "choice": "multi", - "slug": "bag", - "same_store_assignment": true, - "page_visibility": [ - "pdp" - ], - "meta": {}, - "created_by": { - "username": "917827311650_22960", - "uid": "123" - }, - "company_id": 1, - "created_on": "2021-02-19 16:16:46.196449", - "modified_by": { - "username": "917827311650_22960", - "uid": "123" - }, - "modified_on": "2021-02-19 16:16:46.196467", - "id": "602f9716a596ce2e415196df" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### updateProductBundle -Update a Product Bundle - - - -```swift -catalog.updateProductBundle(companyId: companyId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| id | String | yes | A `id` is a unique identifier for a particular detail. Pass the `id` of the keywords which you want to delete. | -| body | ProductBundleUpdateRequest | yes | Request body | - - -Update a Product Bundle by its id. On successful request, returns the updated product bundle - -*Returned Response:* - - - - -[GetProductBundleCreateResponse](#GetProductBundleCreateResponse) - -The Collection object. See example below or refer `GetProductBundleCreateResponse` for details. - - - - -
    -  Example: - -```json -{ - "slug": "bag", - "logo": "http://g.com/poo.png/", - "name": "Bag", - "choice": "multi", - "products": [ - { - "product_uid": 7500001, - "max_quantity": 1, - "min_quantity": 1, - "auto_add_to_cart": false, - "auto_select": false, - "allow_remove": true - } - ], - "meta": {}, - "same_store_assignment": true, - "is_active": true, - "page_visibility": [ - "pdp" - ], - "created_by": { - "username": "917827311650_22960", - "uid": "123" - }, - "company_id": 1, - "created_on": "2021-02-19 16:40:26.310007", - "modified_by": { - "username": "917827311650_22960", - "uid": "123" - }, - "modified_on": "2021-02-19 16:40:26.310027", - "id": "602f9ca2a596ce312f5956f9" -} -``` -
    - - - - - - - - - ---- - - -#### getProductBundleDetail -Get a particular Product Bundle details - - - -```swift -catalog.getProductBundleDetail(companyId: companyId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| id | String | yes | A `id` is a unique identifier for a particular detail. Pass the `id` of the keywords which you want to retrieve. | - - - -Get a particular Bundle details by its `id`. If successful, returns a Product bundle resource in the response body specified in `GetProductBundleResponse` - -*Returned Response:* - - - - -[GetProductBundleResponse](#GetProductBundleResponse) - -The Collection object. See example below or refer `GetProductBundleResponse` for details - - - - -
    -  Example: - -```json -{ - "slug": "bag", - "company_id": 1, - "logo": "http://g.com/poo.png/", - "name": "Bag", - "choice": "multi", - "products": [ - { - "product_uid": 7500001, - "product_details": { - "country_of_origin": "India", - "slug": "slug-1", - "item_code": "760B3BFF-4905-44B8-A50E-082829E7107F", - "attributes": { - "brand_name": "brand 2" - }, - "name": "Some Phone", - "images": [ - "https://hdn-1.addsale.com/x0/media/pictures/tagged_items/original/random_code_4/FE6DUR_000000.png" - ], - "uid": 7500001 - }, - "max_quantity": 1, - "min_quantity": 1, - "auto_add_to_cart": false, - "auto_select": false, - "allow_remove": true - } - ], - "meta": {}, - "same_store_assignment": true, - "page_visibility": [ - "pdp" - ] -} -``` -
    - - - - - - - - - ---- - - -#### createSizeGuide -Create a size guide. - - - -```swift -catalog.createSizeGuide(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company inside which the size guide is to be created. | -| body | ValidateSizeGuide | yes | Request body | - - -This API allows to create a size guide associated to a brand. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getSizeGuides -Get list of size guides - - - -```swift -catalog.getSizeGuides(companyId: companyId, active: active, q: q, tag: tag, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company for which the size guides are to be fetched. | -| active | Bool? | no | filter size guide on basis of active, in-active | -| q | String? | no | Query that is to be searched. | -| tag | String? | no | to filter size guide on basis of tag. | -| pageNo | Int? | no | The page number to navigate through the given set of results | -| pageSize | Int? | no | Number of items to retrieve in each page. Default is 10. | - - - -This API allows to view all the size guides associated to the seller. - -*Returned Response:* - - - - -[ListSizeGuide](#ListSizeGuide) - -Size guide object. See example below or refer `ListSizeGuide` for details - - - - -
    -  Example: - -```json -{ - "items": [ - { - "modified_by": { - "username": "silverbolt", - "user_id": "-1" - }, - "active": true, - "id": "60364384f08385bee776f83d", - "title": "Demo SG", - "modified_on": "2021-02-24T17:46:04.146000Z", - "brand_id": 2, - "created_by": { - "username": "silverbolt", - "user_id": "-1" - }, - "subtitle": "I am demo", - "company_id": 12, - "created_on": "2021-02-24T17:46:04.146000Z", - "guide": { - "meta": { - "values": [ - { - "col_1": "10", - "col_2": "20" - }, - { - "col_1": "12", - "col_2": "22" - }, - { - "col_1": "14", - "col_2": "24" - } - ], - "unit": "cm", - "headers": { - "col_1": { - "value": "Head", - "convertable": false - }, - "col_2": { - "value": "Shoulder", - "convertable": true - } - } - } - }, - "tag": "demo", - "name": "Demo" - } - ], - "page": { - "current": 1, - "size": 1, - "has_previous": false, - "has_next": false, - "item_count": 1 - } -} -``` -
    - - - - - - - - - ---- - - -#### updateSizeGuide -Edit a size guide. - - - -```swift -catalog.updateSizeGuide(companyId: companyId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company. | -| id | String | yes | Mongo id of the size guide to be edited | -| body | ValidateSizeGuide | yes | Request body | - - -This API allows to edit a size guide. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getSizeGuide -Get a single size guide. - - - -```swift -catalog.getSizeGuide(companyId: companyId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company associated to size guide. | -| id | String | yes | Id of the size guide to be viewed. | - - - -This API helps to get data associated to a size guide. - -*Returned Response:* - - - - -[SizeGuideResponse](#SizeGuideResponse) - -Brand object. See example below or refer `SizeGuideResponseSchema` for details - - - - -
    -  Example: - -```json -{ - "active": true, - "brand_id": 1, - "created_on": "2021-02-24T17:46:04.146000Z", - "modified_on": "2021-02-25T15:19:30.822000Z", - "created_by": { - "username": "silverbolt", - "user_id": "-1" - }, - "modified_by": { - "username": "917827311650_22960", - "user_id": "123" - }, - "name": "edited size guide", - "company_id": 1, - "guide": { - "meta": { - "headers": { - "col_1": { - "value": "Head", - "convertable": false - }, - "col_2": { - "value": "Shoulder", - "convertable": true - } - }, - "values": [ - { - "col_1": "10", - "col_2": "20" - }, - { - "col_1": "12", - "col_2": "22" - }, - { - "col_1": "14", - "col_2": "24" - } - ], - "unit": "cm" - } - }, - "tag": "demo", - "title": "Demo SG", - "subtitle": "I am demo", - "id": "60364384f08385bee776f83d" -} -``` -
    - - - - - - - - - ---- - - -#### getCatalogConfiguration -Get configuration meta details for catalog for admin panel - - - -```swift -catalog.getCatalogConfiguration(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | - - - -configuration meta details for catalog. - -*Returned Response:* - - - - -[GetCatalogConfigurationMetaData](#GetCatalogConfigurationMetaData) - -configuration details for catalog. See example below or refer `GetCatalogConfigurationMetaDataSchema` for details - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### createConfigurationProductListing -Add configuration for products & listings - - - -```swift -catalog.createConfigurationProductListing(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| body | AppConfiguration | yes | Request body | - - -Add configuration for products & listing. - -*Returned Response:* - - - - -[GetAppCatalogConfiguration](#GetAppCatalogConfiguration) - -success flag will tell whether the operation was successful. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getConfigurations -Get configured details for catalog - - - -```swift -catalog.getConfigurations(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | - - - -configured details for catalog. - -*Returned Response:* - - - - -[GetAppCatalogConfiguration](#GetAppCatalogConfiguration) - -Get application level configured catalog details. See example below or refer `GetAppCatalogConfigurationSchema` for details - - - - -
    -  Example: - -```json -{ - "data": { - "app_id": "000000000000000000000001", - "listing": { - "filter": { - "attribute_config": [ - { - "key": "gender", - "priority": 1, - "type": "multivalued", - "name": "Gender", - "value_config": { - "condition": "OR", - "sort": "count", - "value": "", - "bucket_points": [], - "map": {} - }, - "is_active": true - }, - { - "key": "min_price_effective", - "priority": 2, - "type": "range", - "name": "Price", - "value_config": { - "condition": "OR", - "sort": "count", - "value": "", - "bucket_points": [], - "map": { - "< 500": "Below Rs. 500", - ">= 6000": "Above Rs. 6000" - } - }, - "is_active": true - }, - { - "key": "departments", - "priority": 3, - "type": "multivalued", - "name": "Department", - "value_config": { - "condition": "OR", - "sort": "count", - "value": "metadata", - "bucket_points": [], - "map": {} - }, - "is_active": true - }, - { - "key": "brand_id", - "priority": 4, - "type": "multivalued", - "name": "Brand", - "value_config": { - "condition": "OR", - "sort": "ascending", - "value": "metadata", - "bucket_points": [], - "map": { - "5th Avenue": "A {{value}}" - } - }, - "is_active": true - }, - { - "key": "season", - "priority": 5, - "type": "multivalued", - "name": "Season", - "value_config": { - "condition": "OR", - "sort": "count", - "value": "", - "bucket_points": [], - "map": { - "": "" - } - }, - "is_active": false - }, - { - "key": "is_set", - "priority": 6, - "type": "multivalued", - "name": "Set", - "value_config": { - "condition": "OR", - "sort": "descending", - "value": "", - "bucket_points": [], - "map": { - "true": "Yes", - "false": "No" - } - }, - "is_active": true - }, - { - "key": "rating", - "priority": 7, - "type": "multivalued", - "name": "Rating", - "value_config": { - "condition": "OR", - "sort": "count", - "value": "", - "bucket_points": [], - "map": { - "": "" - } - }, - "is_active": true - }, - { - "key": "size_depth", - "priority": 8, - "type": "range", - "name": "Size Depth", - "value_config": { - "condition": "OR", - "sort": "count", - "value": "", - "bucket_points": [], - "map": { - "{} - {}": "{} - {}" - } - }, - "is_active": true - } - ], - "allow_single": false - }, - "sort": { - "default": "", - "config": [ - { - "key": "price_dsc", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Price%20High%20to%20Low.png", - "priority": 1, - "name": "Price High to Low", - "is_active": false - }, - { - "key": "rating_dsc", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Rating.png", - "priority": 2, - "name": "Rating", - "is_active": true - }, - { - "key": "depth_desc", - "priority": 3, - "name": "Size Depth (High to Low)", - "is_active": true - }, - { - "key": "discount_dsc", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Discount%20Low%20to%20High.png", - "priority": 4, - "name": "Discount High to Low", - "is_active": true - }, - { - "key": "popular", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Popularity.png", - "priority": 5, - "name": "Popularity", - "is_active": true - }, - { - "key": "relevance", - "priority": 6, - "name": "Relevance", - "is_active": true - }, - { - "key": "price_asc", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Price%20Low%20to%20High.png", - "priority": 7, - "name": "Price Low to High", - "is_active": true - } - ] - } - }, - "product": { - "similar": { - "config": [ - { - "key": "seller", - "size": { - "max": 10, - "min": 2 - }, - "priority": 1, - "title": "Seller", - "is_active": true, - "subtitle": "" - }, - { - "key": "visual", - "size": { - "max": 10, - "min": 2 - }, - "priority": 2, - "title": "Visual", - "is_active": true, - "subtitle": "" - }, - { - "key": "brand", - "size": { - "max": 10, - "min": 2 - }, - "priority": 3, - "title": "Brand", - "is_active": true, - "subtitle": "" - }, - { - "key": "specs", - "size": { - "max": 10, - "min": 2 - }, - "priority": 4, - "title": "Specs", - "is_active": true, - "subtitle": "" - } - ] - }, - "variant": { - "config": [ - { - "key": "color", - "display_type": "image", - "size": { - "max": 10, - "min": 2 - }, - "priority": 1, - "name": "Additional Colors12", - "is_active": true - }, - { - "key": "storage", - "display_type": "text", - "size": { - "max": 10, - "min": 2 - }, - "priority": 2, - "name": "Memory", - "is_active": true - }, - { - "key": "visual", - "display_type": "image", - "size": { - "max": 10, - "min": 2 - }, - "priority": 3, - "name": "Additional Colors", - "is_active": true - }, - { - "key": "ram_storage", - "display_type": "text", - "size": { - "max": 10, - "min": 2 - }, - "priority": 4, - "name": "Ram_Storage", - "is_active": true - }, - { - "key": "shade", - "display_type": "color", - "size": { - "max": 10, - "min": 2 - }, - "priority": 5, - "name": "Additional Shades", - "is_active": true - }, - { - "key": "water_resistant", - "display_type": "text", - "size": { - "max": 10, - "min": 2 - }, - "priority": 6, - "name": "Water_Resistant", - "is_active": true - } - ] - } - }, - "config_id": "000000000000000000000001", - "config_type": "app" - }, - "is_default": false -} -``` -
    - - - - - - - - - ---- - - -#### createConfigurationByType -Add configuration for categories and brands - - - -```swift -catalog.createConfigurationByType(companyId: companyId, applicationId: applicationId, type: type, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| type | String | yes | type can be brands, categories etc. | -| body | AppConfiguration | yes | Request body | - - -Add configuration for categories & brands. - -*Returned Response:* - - - - -[GetAppCatalogConfiguration](#GetAppCatalogConfiguration) - -success flag will tell whether the operation was successful. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getConfigurationByType -Get configured details for catalog - - - -```swift -catalog.getConfigurationByType(companyId: companyId, applicationId: applicationId, type: type) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| type | String | yes | type can be brands, categories etc. | - - - -configured details for catalog. - -*Returned Response:* - - - - -[GetAppCatalogEntityConfiguration](#GetAppCatalogEntityConfiguration) - -Get application level configured catalog details. See example below or refer `GetAppCatalogEntityConfigurationSchema` for details - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getQueryFilters -Get query filters to configure a collection - - - -```swift -catalog.getQueryFilters(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | - - - -Get query filters to configure a collection - -*Returned Response:* - - - - -[GetCollectionQueryOptionResponse](#GetCollectionQueryOptionResponse) - -The attached items of an collection. See example below or refer `GetCollectionQueryOptionResponse` for details - - - - -
    -  Example: - -```json -{ - "filters": [ - { - "key": { - "display": "Department", - "name": "department", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Department.png" - }, - "values": [ - { - "display": "Men's Fashion", - "count": 2113, - "is_selected": false, - "value": "men", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/category_tab_icons/department/Men.png" - } - } - ] - }, - { - "key": { - "display": "Category", - "name": "category", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Category.png" - }, - "values": [ - { - "display": "T-Shirts", - "count": 968, - "is_selected": false, - "value": "192", - "logo": "https://hdn-1.fynd.com/media/logo/category/original/15442_57fdc97abfd248aaaf8841f097a4ed67.jpg" - } - ] - }, - { - "key": { - "display": "Size", - "name": "sizes", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Sizes.png" - }, - "values": [ - { - "display": "S", - "count": 1438, - "is_selected": false, - "value": "S" - } - ] - }, - { - "key": { - "display": "Brand", - "name": "brand", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Brand%20ID.png" - }, - "values": [ - { - "display": "Superdry", - "count": 4263, - "is_selected": false, - "value": "235", - "logo": "https://hdn-1.fynd.com/media/logo/brand/original/1008_238113b8e11448f792e9bf860aac30f2.jpg" - } - ] - }, - { - "key": { - "display": "Rating", - "name": "rating", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Rating.png" - }, - "values": [ - { - "count": 3, - "display": "5 ★", - "value": "[4 TO *}", - "is_selected": false - } - ] - }, - { - "key": { - "display": "Company", - "name": "company_id_list", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Store%20ID%20List.png" - }, - "values": [ - { - "display": "RELIANCE BRANDS LIMITED", - "count": 4262, - "is_selected": false, - "value": "46" - } - ] - }, - { - "key": { - "display": "Store Ids", - "name": "store_id_list", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Store%20ID%20List.png" - }, - "values": [ - { - "display": "PHOENIX, ,PALLADIUM, LOWER PAREL - 5410", - "count": 1385, - "is_selected": false, - "value": "2201" - } - ] - }, - { - "key": { - "display": "Image", - "name": "image_nature", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/image%20Nature.png" - }, - "values": [ - { - "display": "Good Quality", - "count": 3111, - "is_selected": false, - "value": "standard" - }, - { - "display": "No Image", - "count": 1152, - "is_selected": false, - "value": "default" - } - ] - }, - { - "key": { - "display": "Set", - "name": "is_set", - "kind": "multivalued", - "logo": "" - }, - "values": [ - { - "display": "No", - "count": 4263, - "is_selected": false, - "value": false - } - ] - }, - { - "key": { - "display": "Product Fit", - "name": "product_fit", - "kind": "multivalued", - "logo": "" - }, - "values": [ - { - "display": "Regular", - "count": 14, - "is_selected": false, - "value": "Regular" - } - ] - }, - { - "key": { - "display": "Primary Material", - "name": "primary_material", - "kind": "multivalued", - "logo": "" - }, - "values": [ - { - "display": "Cotton", - "count": 1246, - "is_selected": false, - "value": "Cotton" - } - ] - }, - { - "key": { - "display": "Gender", - "name": "gender", - "kind": "multivalued", - "logo": "" - }, - "values": [ - { - "display": "Men", - "count": 2125, - "is_selected": false, - "value": "Men" - }, - { - "display": "Women", - "count": 1492, - "is_selected": false, - "value": "Women" - } - ] - }, - { - "key": { - "display": "Primary Colour", - "name": "primary_color", - "kind": "multivalued", - "logo": "" - }, - "values": [ - { - "display": "Multi", - "count": 1403, - "is_selected": false, - "value": "Multi" - } - ] - }, - { - "key": { - "display": "Size Depth", - "name": "size_depth", - "kind": "range", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Size%20Depth.png" - }, - "values": [ - { - "count": 4263, - "min": 0, - "max": 9, - "is_selected": false, - "selected_min": 0, - "selected_max": 9, - "query_format": "[{} TO {}]", - "display_format": "{} - {}", - "display": "0 - 9" - } - ] - }, - { - "key": { - "display": "Price", - "name": "min_price_effective", - "kind": "range", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Min%20price%20effective.png" - }, - "values": [ - { - "count": 4263, - "min": 398, - "max": 24999, - "is_selected": false, - "selected_min": 398.8, - "selected_max": 24998.77, - "currency_code": "INR", - "currency_symbol": "₹", - "query_format": "[{},INR TO {},INR]" - } - ] - }, - { - "key": { - "display": "Discount", - "name": "platform_discount", - "kind": "range", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Platform%20Discount.png" - }, - "values": [ - { - "count": 4263, - "min": 0, - "max": 50, - "is_selected": false, - "selected_min": 0, - "selected_max": 50, - "query_format": "[{} TO {}]", - "display_format": "{} - {}", - "display": "0 - 50" - } - ] - } - ], - "sort_on": [ - { - "display": "Latest Products", - "name": "Latest Products", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Latest%20Products.png", - "value": "latest", - "is_selected": true - }, - { - "display": "Popularity", - "name": "Popularity", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Popularity.png", - "value": "popular", - "is_selected": false - }, - { - "display": "Price Low to High", - "name": "Price Low to High", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Price%20High%20to%20Low.png", - "value": "price_asc", - "is_selected": false - }, - { - "display": "Price High to Low", - "name": "Price High to Low", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Price%20High%20to%20Low.png", - "value": "price_dsc", - "is_selected": false - }, - { - "display": "Discount Low to High", - "name": "Discount Low to High", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Discount%20Low%20to%20High.png", - "value": "discount_asc", - "is_selected": false - }, - { - "display": "Discount High to Low", - "name": "Discount High to Low", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Discount%20Low%20to%20High.png", - "value": "discount_dsc", - "is_selected": false - }, - { - "display": "Rating", - "name": "Rating", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Rating.png", - "value": "rating_dsc", - "is_selected": false - }, - { - "display": "Size Depth (High to Low)", - "name": "Size Depth (High to Low)", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Size%20Depth.png", - "value": "depth_desc", - "is_selected": false - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### createCollection -Add a Collection - - - -```swift -catalog.createCollection(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| body | CreateCollection | yes | Request body | - - -Create a collection. See `CreateCollectionRequestSchema` for the list of attributes needed to create a collection and collections/query-options for the available options to create a collection. On successful request, returns a paginated list of collections specified in `CollectionCreateResponse` - -*Returned Response:* - - - - -[CollectionCreateResponse](#CollectionCreateResponse) - -List of all the collections including the one you added. See example below or refer `CollectionCreateResponse` for details - - - - -
    -  Example: - -```json -{ - "uid": "604f585a7051e30001173ac1", - "type": "query", - "query": {}, - "name": "New", - "banners": { - "portrait": { - "type": "image", - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588858137/production/applications/app_000000000000000000000001/media/collection/portrait/xzuftshmmw4yuwzb12pm.png" - }, - "landscape": { - "type": "image", - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857999/production/applications/app_000000000000000000000001/media/collection/landscape/avm7xibo2jgk8glc4bwl.png" - } - }, - "logo": { - "type": "image", - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857854/production/applications/app_000000000000000000000001/media/collection/logo/w9ns7nfgv7fk45xqrpoh.png" - }, - "published": true, - "description": "", - "is_active": true, - "tags": [], - "slug": "new", - "action": { - "page": { - "type": "collection", - "query": { - "collection": [ - "new" - ] - } - }, - "type": "page" - }, - "allow_facets": true, - "allow_sort": true, - "visible_facets_keys": [], - "meta": {}, - "badge": { - "color": "#ffffff", - "text": "" - }, - "sort_on": "depth_desc", - "_custom_json": {}, - "_locale_language": {}, - "_schedule": { - "start": "2021-03-15T12:51:21.333000+00:00Z", - "next_schedule": [ - { - "start": "2021-03-15T12:51:21.333000+00:00Z", - "end": null - } - ], - "end": null - }, - "seo": { - "title": "Test", - "description": "Test description" - } -} -``` -
    - - - - - - - - - ---- - - -#### getAllCollections -List all the collections - - - -```swift -catalog.getAllCollections(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | - - - -A Collection allows you to organize your products into hierarchical groups. For example, a dress might be in the category _Clothing_, the individual product might also be in the collection _Summer_. On successful request, returns all the collections as specified in `CollectionListingSchema` - -*Returned Response:* - - - - -[GetCollectionListingResponse](#GetCollectionListingResponse) - -List of collections. See example below or refer `GetCollectionListingResponse` for details - - - - -
    -  Example: - -```json -{ - "page": { - "current": 1, - "size": 19, - "has_previous": false, - "has_next": true, - "item_total": 190 - }, - "items": [ - { - "uid": "6040fed076d8a500011ef829", - "type": "query", - "query": { - "brand": [ - "6", - "3", - "4", - "2" - ], - "min_price_effective": "[6319,INR TO 11805,INR]", - "platform_discount": "[15 TO 39]", - "sort_on": "price_asc" - }, - "name": "test1", - "banners": { - "portrait": { - "type": "image", - "url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000001/collections/pictures/portrait-banner/original/mP6OnINGR-1601466767814.jpeg" - }, - "landscape": { - "type": "image", - "url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000001/collections/pictures/landscape-banner/original/3jSEzw9CN-1601465376892.jpeg" - } - }, - "logo": { - "type": "image", - "url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000001/collections/pictures/square-logo/original/y_-XUYXwx-1602326103322.jpeg" - }, - "published": true, - "description": "this is description", - "is_active": true, - "tags": [], - "slug": "test1", - "action": { - "page": { - "type": "collection", - "query": { - "collection": [ - "test1" - ] - } - }, - "type": "page" - }, - "allow_facets": true, - "allow_sort": true, - "visible_facets_keys": [], - "meta": {}, - "badge": { - "text": "", - "color": "#ffffff" - }, - "sort_on": "price_asc", - "_custom_json": {}, - "_locale_language": {}, - "_schedule": { - "start": "2021-03-04T15:35:13.640000Z", - "next_schedule": [ - { - "start": "2021-03-04T15:35:13.640000Z", - "end": null - } - ], - "end": null - } - }, - { - "uid": "6040a9b250f97e0001886294", - "type": "items", - "query": {}, - "name": "newapiplaform", - "banners": { - "portrait": { - "type": "image", - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588858137/production/applications/app_000000000000000000000001/media/collection/portrait/xzuftshmmw4yuwzb12pm.png" - }, - "landscape": { - "type": "image", - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857999/production/applications/app_000000000000000000000001/media/collection/landscape/avm7xibo2jgk8glc4bwl.png" - } - }, - "logo": { - "type": "image", - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857854/production/applications/app_000000000000000000000001/media/collection/logo/w9ns7nfgv7fk45xqrpoh.png" - }, - "published": true, - "description": "sadasd", - "is_active": true, - "tags": [ - "sdsadas", - "asd" - ], - "slug": "newapiplaform", - "action": { - "page": { - "type": "collection", - "query": { - "collection": [ - "newapiplaform" - ] - } - }, - "type": "page" - }, - "allow_facets": true, - "allow_sort": true, - "visible_facets_keys": [], - "meta": {}, - "badge": { - "text": "", - "color": "#aa2727" - }, - "sort_on": "popular", - "_custom_json": {}, - "_locale_language": {}, - "_schedule": { - "start": "2021-03-04T09:33:53.686000Z", - "next_schedule": [ - { - "start": "2021-03-04T09:33:53.686000Z", - "end": null - } - ], - "end": null - } - }, - { - "uid": "603f68fd953a69000145dc92", - "type": "query", - "query": {}, - "name": "new", - "banners": { - "portrait": { - "type": "image", - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588858137/production/applications/app_000000000000000000000001/media/collection/portrait/xzuftshmmw4yuwzb12pm.png" - }, - "landscape": { - "type": "image", - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857999/production/applications/app_000000000000000000000001/media/collection/landscape/avm7xibo2jgk8glc4bwl.png" - } - }, - "logo": { - "type": "image", - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857854/production/applications/app_000000000000000000000001/media/collection/logo/w9ns7nfgv7fk45xqrpoh.png" - }, - "published": true, - "description": "", - "is_active": true, - "tags": [], - "slug": "old", - "action": { - "page": { - "type": "collection", - "query": { - "collection": [ - "old" - ] - } - }, - "type": "page" - }, - "allow_facets": true, - "allow_sort": true, - "visible_facets_keys": [], - "meta": {}, - "badge": { - "color": "#ffffff", - "text": "" - }, - "sort_on": "popular", - "_custom_json": {}, - "_locale_language": {}, - "_schedule": { - "start": "2021-03-03T10:45:40.544000Z", - "next_schedule": [ - { - "start": "2021-03-03T10:45:40.544000Z", - "end": null - } - ], - "end": null - } - } - ], - "filters": { - "tags": [ - { - "name": "1+", - "is_selected": false, - "display": "1+" - }, - { - "name": "aa", - "is_selected": false, - "display": "aa" - }, - { - "name": "asd", - "is_selected": false, - "display": "asd" - }, - { - "name": "dda", - "is_selected": false, - "display": "dda" - }, - { - "name": "fahim", - "is_selected": false, - "display": "fahim" - }, - { - "name": "gfg", - "is_selected": false, - "display": "gfg" - }, - { - "name": "sakri", - "is_selected": false, - "display": "sakri" - }, - { - "name": "sdsadas", - "is_selected": false, - "display": "sdsadas" - }, - { - "name": "uuy", - "is_selected": false, - "display": "uuy" - } - ], - "type": [ - { - "name": "items", - "is_selected": false, - "display": "items" - }, - { - "name": "query", - "is_selected": false, - "display": "query" - } - ] - } -} -``` -
    - - - - - - - - - ---- - - -#### getCollectionDetail -Get a particular collection - - - -```swift -catalog.getCollectionDetail(companyId: companyId, applicationId: applicationId, slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| slug | String | yes | A `slug` is a human readable, URL friendly unique identifier of an object. Pass the `slug` of the collection which you want to retrieve. | - - - -Get the details of a collection by its `slug`. If successful, returns a Collection resource in the response body specified in `CollectionDetailResponse` - -*Returned Response:* - - - - -[CollectionDetailResponse](#CollectionDetailResponse) - -The Collection object. See example below or refer `CollectionDetailResponse` for details - - - - -
    -  Example: - -```json -{ - "uid": "5ec5fc757cb1e4740a17da23", - "type": "query", - "query": { - "l3_categories": [ - "12" - ], - "sort_on": "discount_asc" - }, - "name": "new", - "banners": { - "portrait": { - "type": "image", - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588858137/production/applications/app_000000000000000000000001/media/collection/portrait/xzuftshmmw4yuwzb12pm.png" - }, - "landscape": { - "type": "image", - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857999/production/applications/app_000000000000000000000001/media/collection/landscape/avm7xibo2jgk8glc4bwl.png" - } - }, - "logo": { - "type": "image", - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857854/production/applications/app_000000000000000000000001/media/collection/logo/w9ns7nfgv7fk45xqrpoh.png" - }, - "published": true, - "description": "", - "is_active": true, - "tags": [], - "slug": "new", - "action": { - "page": { - "type": "collection", - "query": { - "collection": [ - "new" - ] - } - }, - "type": "page" - }, - "allow_facets": true, - "allow_sort": true, - "visible_facets_keys": [], - "meta": {}, - "badge": { - "color": "#ffffff", - "text": "" - }, - "sort_on": "popular", - "_custom_json": {}, - "_locale_language": {}, - "_schedule": { - "start": "2020-05-21T03:58:41.237000Z", - "next_schedule": [ - { - "start": "2020-05-21T03:58:41.237000Z", - "end": null - } - ], - "end": null - } -} -``` -
    - - - - - - - - - ---- - - -#### deleteCollection -Delete a Collection - - - -```swift -catalog.deleteCollection(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| id | String | yes | A `id` is a unique identifier of a collection. | - - - -Delete a collection by it's id. Returns an object that tells whether the collection was deleted successfully - -*Returned Response:* - - - - -[DeleteResponse](#DeleteResponse) - -Status object. Tells whether the operation was successful. See example below or refer `DeleteResponse` - - - - -
    -  Example: - -```json -{ - "message": "Collection Deleted" -} -``` -
    - - - - - - - - - ---- - - -#### updateCollection -Update a collection - - - -```swift -catalog.updateCollection(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| id | String | yes | A `id` is a unique identifier of a collection. | -| body | UpdateCollection | yes | Request body | - - -Update a collection by it's id. On successful request, returns the updated collection - -*Returned Response:* - - - - -[UpdateCollection](#UpdateCollection) - -The Collection object. See example below or refer `UpdateCollectionSchema` for details. - - - - -
    -  Example: - -```json -{ - "uid": "604f585a7051e30001173ac1", - "type": "query", - "query": {}, - "name": "New", - "banners": { - "portrait": { - "type": "image", - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588858137/production/applications/app_000000000000000000000001/media/collection/portrait/xzuftshmmw4yuwzb12pm.png" - }, - "landscape": { - "type": "image", - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857999/production/applications/app_000000000000000000000001/media/collection/landscape/avm7xibo2jgk8glc4bwl.png" - } - }, - "logo": { - "type": "image", - "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857854/production/applications/app_000000000000000000000001/media/collection/logo/w9ns7nfgv7fk45xqrpoh.png" - }, - "published": true, - "description": "", - "is_active": true, - "tags": [], - "slug": "new", - "action": { - "page": { - "type": "collection", - "query": { - "collection": [ - "new" - ] - } - }, - "type": "page" - }, - "allow_facets": true, - "allow_sort": true, - "visible_facets_keys": [], - "meta": {}, - "badge": { - "color": "#ffffff", - "text": "" - }, - "sort_on": "depth_desc", - "_custom_json": {}, - "_locale_language": {}, - "_schedule": { - "start": "2021-03-15T12:51:21.333000+00:00Z", - "next_schedule": [ - { - "start": "2021-03-15T12:51:21.333000+00:00Z", - "end": null - } - ], - "end": null - }, - "seo": { - "title": "Test", - "description": "Test description" - } -} -``` -
    - - - - - - - - - ---- - - -#### addCollectionItems -Add items to a collection - - - -```swift -catalog.addCollectionItems(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| id | String | yes | A `id` is a unique identifier of a collection. | -| body | CollectionItemRequest | yes | Request body | - - -Adds items to a collection specified by its `id`. See `CollectionItemRequest` for the list of attributes needed to add items to an collection. - -*Returned Response:* - - - - -[UpdatedResponse](#UpdatedResponse) - -Status object. Tells whether the operation was successful. - - - - -
    -  Example: - -```json -{ - "message": "items updated" -} -``` -
    - - - - - - - - - ---- - - -#### getCollectionItems -Get the items for a collection - - - -```swift -catalog.getCollectionItems(companyId: companyId, applicationId: applicationId, id: id, sortOn: sortOn, pageId: pageId, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| id | String | yes | A `id` is a unique identifier of a collection. | -| sortOn | String? | no | Each response will contain sort_on param, which should be sent back to make pagination work. | -| pageId | String? | no | Each response will contain next_id param, which should be sent back to make pagination work. | -| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | - - - -Get items from a collection specified by its `id`. - -*Returned Response:* - - - - -[GetCollectionItemsResponse](#GetCollectionItemsResponse) - -The attached items of an collection. See example below or refer `GetCollectionItemsResponseSchema` for details - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getCatalogInsights -Analytics data of catalog and inventory. - - - -```swift -catalog.getCatalogInsights(companyId: companyId, applicationId: applicationId, brand: brand) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| brand | String? | no | Brand slug | - - - -Catalog Insights api returns the count of catalog related data like products, brands, departments and categories that have been made live as per configuration of the app. - -*Returned Response:* - - - - -[CatalogInsightResponse](#CatalogInsightResponse) - -Response Data - - - - -
    -  Example: - -```json -{ - "item": { - "count": 637707, - "out_of_stock_count": 452806, - "sellable_count": 184901 - } -} -``` -
    - - - - - - - - - ---- - - -#### getSellerInsights -Analytics data of catalog and inventory that are being cross-selled. - - - -```swift -catalog.getSellerInsights(companyId: companyId, sellerAppId: sellerAppId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| sellerAppId | String | yes | Id of the seller application which is serving the invetory/catalog of the company | - - - -Analytics data of catalog and inventory that are being cross-selled. - -*Returned Response:* - - - - -[CrossSellingResponse](#CrossSellingResponse) - -Response Data - - - - -
    -  Example: - -```json -{ - "products": 18, - "articles": 18 -} -``` -
    - - - - - - - - - ---- - - -#### createMarketplaceOptin -Create/Update opt-in infomation. - - - -```swift -catalog.createMarketplaceOptin(companyId: companyId, marketplace: marketplace, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | The company id for which the detail needs to be retrieved. | -| marketplace | String | yes | The marketplace for which the detail needs to be retrieved. | -| body | OptInPostRequest | yes | Request body | - - -Use this API to create/update opt-in information for given platform. If successful, returns data in the response body as specified in `OptInPostResponseSchema` - -*Returned Response:* - - - - -[UpdatedResponse](#UpdatedResponse) - -See example below or refer `UpdatedResponse` for details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getMarketplaceOptinDetail -Get opt-in infomation. - - - -```swift -catalog.getMarketplaceOptinDetail(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | | - - - -Use this API to fetch opt-in information for all the platforms. If successful, returns a logs in the response body as specified in `GetOptInPlatformSchema` - -*Returned Response:* - - - - -[GetOptInPlatform](#GetOptInPlatform) - -See example below or refer `GetOptInPlatformSchema` for details. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getCompanyDetail -Get the Company details. - - - -```swift -catalog.getCompanyDetail(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | The company id for which the detail needs to be retrieved. | - - - -Get the details of the company associated with the given company_id passed. - -*Returned Response:* - - - - -[OptinCompanyDetail](#OptinCompanyDetail) - -See example below or refer `OptinCompanyDetailSchema` for details - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getCompanyBrandDetail -Get the Company Brand details of Optin. - - - -```swift -catalog.getCompanyBrandDetail(companyId: companyId, isActive: isActive, q: q, pageNo: pageNo, pageSize: pageSize, marketplace: marketplace) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | The company id for which the detail needs to be retrieved. | -| isActive | Bool? | no | The is_active status for the optin id. | -| q | Bool? | no | The search value to filter the list. | -| pageNo | Int? | no | The number of page for the company id. | -| pageSize | Int? | no | Number of records that can be seen on the page for the company id. | -| marketplace | String? | no | The marketplace platform associated with the company id. | - - - -Get the details of the Brands associated with the given company_id passed. - -*Returned Response:* - - - - -[OptinCompanyBrandDetailsView](#OptinCompanyBrandDetailsView) - -See example below or refer `OptinCompanyBrandDetailsView` for details - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getCompanyMetrics -Get the Company metrics - - - -```swift -catalog.getCompanyMetrics(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | The company id for which the detail needs to be retrieved. | - - - -Get the Company metrics associated with the company ID passed. - -*Returned Response:* - - - - -[OptinCompanyMetrics](#OptinCompanyMetrics) - -See example below or refer `OptinCompanyMetrics` for details - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getStoreDetail -Get the Store details. - - - -```swift -catalog.getStoreDetail(companyId: companyId, q: q, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | The company id for which the detail needs to be retrieved. | -| q | String? | no | The search related the store for the company id. | -| pageNo | Int? | no | The number of page for the company id. | -| pageSize | Int? | no | Number of records that can be seen on the page for the company id. | - - - -Get the details of the store associated with the company ID passed. - -*Returned Response:* - - - - -[OptinStoreDetails](#OptinStoreDetails) - -See example below or refer `OptinStoreDetailsSchema` for details - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getGenderAttribute -Get gender attribute details - - - -```swift -catalog.getGenderAttribute(companyId: companyId, attributeSlug: attributeSlug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | company for which you want to view the genders | -| attributeSlug | String | yes | slug of the attribute for which you want to view the genders | - - - -This API allows to view the gender attribute details. - -*Returned Response:* - - - - -[GenderDetail](#GenderDetail) - -Size guide object. See example below or refer `GenderDetailSchema` for details - - - - -
    -  Example: - -```json -{ - "description": "Clothing department needs gener attribute", - "schema": { - "format": "", - "mandatory": false, - "multi": true, - "enum": [ - "Men", - "Women", - "Boy", - "Girl", - "more", - "men" - ], - "type": "str" - }, - "meta": { - "enriched": false, - "mandatory_details": { - "l3_keys": [] - } - }, - "slug": "gender", - "name": "Gender", - "enabled_for_end_consumer": true, - "details": { - "display_type": "text" - }, - "is_nested": true, - "filters": { - "indexing": true, - "priority": 2 - }, - "departments": [ - "men-s-fashion", - "kids", - "women-s-fashion", - "beauty-personal-care" - ], - "logo": "https://hdn-1.addsale.com/x0/products/pictures/attribute/logo/original/Rhv89tqRo-brand-website-logo.png", - "id": "5ed11eb0be8d5e00016f0335" -} -``` -
    - - - - - - - - - ---- - - -#### listProductTemplateCategories -List Department specifiec product categories - - - -```swift -catalog.listProductTemplateCategories(companyId: companyId, departments: departments, itemType: itemType) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| departments | String | yes | A `department` is name of a departments whose category needs to be listed. Can specify multiple departments. | -| itemType | String | yes | An `item_type` is the type of item, it can be `set`, `standard`, `digital`, etc. | - - - -Allows you to list all product categories values for the departments specified - -*Returned Response:* - - - - -[ProdcutTemplateCategoriesResponse](#ProdcutTemplateCategoriesResponse) - -List of all categories attached to departments specified. See example below or refer `ProdcutTemplateCategoriesResponse` for details - - - - -
    -  Example: - -```json -{ - "page": {}, - "items": [] -} -``` -
    - - - - - - - - - ---- - - -#### listDepartmentsData -List all Departments - - - -```swift -catalog.listDepartmentsData(companyId: companyId, pageNo: pageNo, pageSize: pageSize, name: name, search: search, isActive: isActive) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| pageNo | Int? | no | The page number to navigate through the given set of results | -| pageSize | Int? | no | Number of items to retrieve in each page. Default is 10. | -| name | String? | no | Can search departments by passing name. | -| search | String? | no | Can search departments by passing name of the department in search parameter. | -| isActive | Bool? | no | Can query for departments based on whether they are active or inactive. | - - - -Allows you to list all departments, also can search using name and filter active and incative departments, and item type - -*Returned Response:* - - - - -[DepartmentsResponse](#DepartmentsResponse) - -List of departments data. See example below or refer `DepartmentsResponse` for details - - - - -
    -  Example: - -```json -{ - "page": { - "current": 1, - "size": 1, - "has_previous": false, - "has_next": false, - "item_total": 12 - }, - "items": [ - { - "uid": 5, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "918793638893_86554", - "user_id": "3" - }, - "created_on": "2020-07-01T05:33:39.325000Z", - "is_active": true, - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/BSQ9Gk_123522-best-starry-sky-wallpaper-1920x1200-ipad-pro.jpgc7d0c15c-c1ff-47eb-8423-6e2df51f2ddf/BSQ9Gk_123522-best-starry-sky-wallpaper-1920x1200-ipad-pro.jpg", - "modified_by": { - "username": "917753852478_51632", - "user_id": "5677" - }, - "modified_on": "2021-03-03T15:55:25.118000Z", - "name": "Sample Dept", - "platforms": {}, - "priority_order": 111, - "slug": "sample-dept", - "synonyms": [ - "test", - "sampe" - ], - "tags": [], - "id": "5efc2033623d390001782238" - }, - { - "uid": 2, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "app@fynd.com", - "user_id": "0" - }, - "created_on": "2020-05-19T06:53:37.629000Z", - "is_active": true, - "logo": "https://hdn-1.addsale.com/addsale/media/logo/department/original/15974_381e2236c2a348cc851c29a5d05c66a9.png", - "modified_by": { - "user_id": "10", - "username": "fahimsakri_gofynd_com_44938" - }, - "modified_on": "2021-03-04T14:01:02.556000Z", - "name": "Men's Fashion", - "platforms": { - "fynd": true, - "fynd_store": true, - "marketplace": true, - "openapi": true, - "uniket_store": true, - "uniket_wholesale": true - }, - "priority_order": 111, - "slug": "men-s-fashion", - "synonyms": [], - "tags": [], - "id": "5ec3827156a7200001c9aeea" - }, - { - "uid": 4, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "fahimsakri_gofynd_com_44938", - "user_id": "10" - }, - "created_on": "2020-06-29T10:59:33.620000Z", - "is_active": true, - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/ywPVrU_preview_a637ca6e4da6e38f03eb0d650ac5d6ba.jpgc73cc22f-b5ee-4fd4-a585-8ada35762d68/ywPVrU_preview_a637ca6e4da6e38f03eb0d650ac5d6ba.jpg", - "modified_by": { - "username": "918793638893_86554", - "user_id": "3" - }, - "modified_on": "2020-08-06T18:08:02.675000Z", - "name": "Groceries", - "platforms": {}, - "priority_order": 10, - "slug": "groceries", - "synonyms": [], - "tags": [], - "id": "5ef9c9959b04f00001e40dba" - }, - { - "uid": 1, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "app@fynd.com", - "user_id": "0" - }, - "created_on": "2020-05-18T16:14:41.689000Z", - "is_active": true, - "logo": "https://hdn-1.addsale.com/x0/platform/pictures/free-logo/original/_G1Z2Fg1L-http:d3p8ifzkmzds37.cloudfront.netmedialogodepartmentoriginal15870_c287d3c2431a432bb0e49363ef6b82bc.png.png", - "modified_by": { - "user_id": "5677", - "username": "917753852478_51632" - }, - "modified_on": "2021-03-04T15:39:38.528000Z", - "name": "Electronics", - "platforms": { - "fynd": true, - "fynd_store": true, - "marketplace": true, - "openapi": true, - "uniket_store": true, - "uniket_wholesale": true - }, - "priority_order": 100, - "slug": "electronics", - "synonyms": [], - "tags": [], - "id": "5ec2b471661a4100019fca0d" - }, - { - "uid": 3, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "918793638893_86554", - "user_id": "3" - }, - "created_on": "2020-05-27T12:04:19.111000Z", - "is_active": true, - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/landscape-banner/original/g2plam_logo_Jio.pngeeb392ca-3958-46a0-9f13-23c205b596f7/g2plam_logo_Jio.png", - "modified_by": { - "username": "918793638893_86554", - "user_id": "3" - }, - "modified_on": "2020-08-06T18:07:46.060000Z", - "name": "Industrial Supplies", - "platforms": {}, - "priority_order": 111, - "slug": "industrial-supplies", - "synonyms": [], - "tags": [], - "id": "5ece5743cd1bae0001440427" - }, - { - "uid": 6, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "abhinavsrivastava_gofynd_com_05674", - "user_id": "13" - }, - "created_on": "2020-07-06T07:56:01.508000Z", - "is_active": false, - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/wTcfEi_crysis_-_1.jpg14580947-a659-486d-b2d3-d2ca025b1cac/wTcfEi_crysis_-_1.jpg", - "modified_by": { - "username": "918793638893_86554", - "user_id": "3" - }, - "modified_on": "2020-08-06T18:08:12.576000Z", - "name": "Clothing", - "platforms": {}, - "priority_order": 1, - "slug": "clothing", - "synonyms": [], - "tags": [], - "id": "5f02d9116b0ae500018923dd" - }, - { - "uid": 8, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "asavarijadhav_gofynd_com_99880", - "user_id": "5634" - }, - "created_on": "2020-08-05T09:04:33.604000Z", - "is_active": true, - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/RxTsd8_0DEFAULT-LOGO.jpg000ccfc1-2f79-4426-9ac3-de2468c2fcb9/RxTsd8_0DEFAULT-LOGO.jpg", - "modified_by": { - "username": "asavarijadhav_gofynd_com_99880", - "user_id": "5634" - }, - "modified_on": "2020-08-05T09:44:01.234000Z", - "name": "Kids", - "platforms": {}, - "priority_order": 3, - "slug": "kids", - "synonyms": [], - "tags": [], - "id": "5f2a762131c66700018cdc47" - }, - { - "uid": 9, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "asavarijadhav_gofynd_com_99880", - "user_id": "5634" - }, - "created_on": "2020-08-05T09:44:46.632000Z", - "is_active": true, - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/tKkDB8_0DEFAULT-LOGO.jpg1c324d4d-f667-4af8-8d98-37205d34e3b5/tKkDB8_0DEFAULT-LOGO.jpg", - "modified_by": { - "username": "918793638893_86554", - "user_id": "3" - }, - "modified_on": "2020-08-06T18:07:35.231000Z", - "name": "Women's Fashion", - "platforms": {}, - "priority_order": 2, - "slug": "women-s-fashion", - "synonyms": [], - "tags": [], - "id": "5f2a7f8e31c66700018cdc49" - }, - { - "uid": 10, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "asavarijadhav_gofynd_com_99880", - "user_id": "5634" - }, - "created_on": "2020-08-05T09:45:12.075000Z", - "is_active": true, - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/oLoxiL_0DEFAULT-LOGO.jpgbd050200-700a-4a3e-9da6-e6b78fbee943/oLoxiL_0DEFAULT-LOGO.jpg", - "modified_by": { - "username": "asavarijadhav_gofynd_com_99880", - "user_id": "5634" - }, - "modified_on": "2020-08-05T09:48:01.660000Z", - "name": "Beauty & Personal Care", - "platforms": {}, - "priority_order": 4, - "slug": "beauty-personal-care", - "synonyms": [], - "tags": [], - "id": "5f2a7fa831c66700018cdc4a" - }, - { - "uid": 11, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "asavarijadhav_gofynd_com_99880", - "user_id": "5634" - }, - "created_on": "2020-08-05T09:45:39.797000Z", - "is_active": true, - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/vQv4ot_0DEFAULT-LOGO.jpg701cb5af-2024-4abf-ae5d-b68bc1a3cd43/vQv4ot_0DEFAULT-LOGO.jpg", - "modified_by": { - "username": "918793638893_86554", - "user_id": "3" - }, - "modified_on": "2020-08-06T11:38:57.599000Z", - "name": "Home & Living", - "platforms": {}, - "priority_order": 5, - "slug": "home-living", - "synonyms": [], - "tags": [], - "id": "5f2a7fc331c66700018cdc4b" - }, - { - "uid": 14, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "asavarijadhav_gofynd_com_99880", - "user_id": "5634" - }, - "created_on": "2020-08-05T09:48:42.347000Z", - "is_active": false, - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/hTobjV_0DEFAULT-LOGO.jpga020159c-7fe7-4c1c-a11a-4be61a60da9f/hTobjV_0DEFAULT-LOGO.jpg", - "modified_by": { - "username": "asavarijadhav_gofynd_com_99880", - "user_id": "5634" - }, - "modified_on": "2020-08-05T09:48:42.347000Z", - "name": "Baby Care & Kids Essentials", - "platforms": {}, - "priority_order": 7, - "slug": "baby-care-kids-essentials", - "synonyms": [], - "tags": [], - "id": "5f2a807a31c66700018cdc4e" - }, - { - "_cls": "Department", - "created_on": "2021-01-13T10:12:33.002000Z", - "modified_on": "2021-01-13T13:50:55.415000Z", - "created_by": { - "username": "919821012599_75351", - "user_id": "5721" - }, - "modified_by": { - "username": "919821012599_75351", - "user_id": "5721" - }, - "uid": 21, - "name": "Skin care products", - "slug": "skin-care-produts", - "logo": "https://hdn-1.addsale.com/x0/department/pictures/square-logo/original/rNz8grLys-.png", - "tags": [], - "is_active": true, - "priority_order": 10235, - "platforms": {}, - "synonyms": [ - "skin", - "care" - ], - "_custom_json": {}, - "id": "5ffec79192813f0001eb6560" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getDepartmentData -Get specific departments details by passing in unique id of the department - - - -```swift -catalog.getDepartmentData(companyId: companyId, uid: uid) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| uid | String | yes | A `uid` is a unique identifier of a department. | - - - -Allows you to get department data, by uid - -*Returned Response:* - - - - -[DepartmentsResponse](#DepartmentsResponse) - -Departments Data. See example below or refer `DepartmentsResponse` for details - - - - -
    -  Example: - -```json -{ - "page": {}, - "items": [ - { - "uid": 5, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "918793638893_86554", - "user_id": "3" - }, - "created_on": "2020-07-01T05:33:39.325000Z", - "is_active": true, - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/BSQ9Gk_123522-best-starry-sky-wallpaper-1920x1200-ipad-pro.jpgc7d0c15c-c1ff-47eb-8423-6e2df51f2ddf/BSQ9Gk_123522-best-starry-sky-wallpaper-1920x1200-ipad-pro.jpg", - "modified_by": { - "username": "917753852478_51632", - "user_id": "5677" - }, - "modified_on": "2021-03-03T15:55:25.118000Z", - "name": "Sample Dept", - "platforms": {}, - "priority_order": 111, - "slug": "sample-dept", - "synonyms": [ - "test", - "sampe" - ], - "tags": [], - "id": "5efc2033623d390001782238" - }, - { - "uid": 2, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "app@fynd.com", - "user_id": "0" - }, - "created_on": "2020-05-19T06:53:37.629000Z", - "is_active": true, - "logo": "https://hdn-1.addsale.com/addsale/media/logo/department/original/15974_381e2236c2a348cc851c29a5d05c66a9.png", - "modified_by": { - "user_id": "10", - "username": "fahimsakri_gofynd_com_44938" - }, - "modified_on": "2021-03-04T14:01:02.556000Z", - "name": "Men's Fashion", - "platforms": { - "fynd": true, - "fynd_store": true, - "marketplace": true, - "openapi": true, - "uniket_store": true, - "uniket_wholesale": true - }, - "priority_order": 111, - "slug": "men-s-fashion", - "synonyms": [], - "tags": [], - "id": "5ec3827156a7200001c9aeea" - }, - { - "uid": 4, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "fahimsakri_gofynd_com_44938", - "user_id": "10" - }, - "created_on": "2020-06-29T10:59:33.620000Z", - "is_active": true, - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/ywPVrU_preview_a637ca6e4da6e38f03eb0d650ac5d6ba.jpgc73cc22f-b5ee-4fd4-a585-8ada35762d68/ywPVrU_preview_a637ca6e4da6e38f03eb0d650ac5d6ba.jpg", - "modified_by": { - "username": "918793638893_86554", - "user_id": "3" - }, - "modified_on": "2020-08-06T18:08:02.675000Z", - "name": "Groceries", - "platforms": {}, - "priority_order": 10, - "slug": "groceries", - "synonyms": [], - "tags": [], - "id": "5ef9c9959b04f00001e40dba" - }, - { - "uid": 1, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "app@fynd.com", - "user_id": "0" - }, - "created_on": "2020-05-18T16:14:41.689000Z", - "is_active": true, - "logo": "https://hdn-1.addsale.com/x0/platform/pictures/free-logo/original/_G1Z2Fg1L-http:d3p8ifzkmzds37.cloudfront.netmedialogodepartmentoriginal15870_c287d3c2431a432bb0e49363ef6b82bc.png.png", - "modified_by": { - "user_id": "5677", - "username": "917753852478_51632" - }, - "modified_on": "2021-03-04T15:39:38.528000Z", - "name": "Electronics", - "platforms": { - "fynd": true, - "fynd_store": true, - "marketplace": true, - "openapi": true, - "uniket_store": true, - "uniket_wholesale": true - }, - "priority_order": 100, - "slug": "electronics", - "synonyms": [], - "tags": [], - "id": "5ec2b471661a4100019fca0d" - }, - { - "uid": 3, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "918793638893_86554", - "user_id": "3" - }, - "created_on": "2020-05-27T12:04:19.111000Z", - "is_active": true, - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/landscape-banner/original/g2plam_logo_Jio.pngeeb392ca-3958-46a0-9f13-23c205b596f7/g2plam_logo_Jio.png", - "modified_by": { - "username": "918793638893_86554", - "user_id": "3" - }, - "modified_on": "2020-08-06T18:07:46.060000Z", - "name": "Industrial Supplies", - "platforms": {}, - "priority_order": 111, - "slug": "industrial-supplies", - "synonyms": [], - "tags": [], - "id": "5ece5743cd1bae0001440427" - }, - { - "uid": 6, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "abhinavsrivastava_gofynd_com_05674", - "user_id": "13" - }, - "created_on": "2020-07-06T07:56:01.508000Z", - "is_active": false, - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/wTcfEi_crysis_-_1.jpg14580947-a659-486d-b2d3-d2ca025b1cac/wTcfEi_crysis_-_1.jpg", - "modified_by": { - "username": "918793638893_86554", - "user_id": "3" - }, - "modified_on": "2020-08-06T18:08:12.576000Z", - "name": "Clothing", - "platforms": {}, - "priority_order": 1, - "slug": "clothing", - "synonyms": [], - "tags": [], - "id": "5f02d9116b0ae500018923dd" - }, - { - "uid": 8, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "asavarijadhav_gofynd_com_99880", - "user_id": "5634" - }, - "created_on": "2020-08-05T09:04:33.604000Z", - "is_active": true, - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/RxTsd8_0DEFAULT-LOGO.jpg000ccfc1-2f79-4426-9ac3-de2468c2fcb9/RxTsd8_0DEFAULT-LOGO.jpg", - "modified_by": { - "username": "asavarijadhav_gofynd_com_99880", - "user_id": "5634" - }, - "modified_on": "2020-08-05T09:44:01.234000Z", - "name": "Kids", - "platforms": {}, - "priority_order": 3, - "slug": "kids", - "synonyms": [], - "tags": [], - "id": "5f2a762131c66700018cdc47" - }, - { - "uid": 9, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "asavarijadhav_gofynd_com_99880", - "user_id": "5634" - }, - "created_on": "2020-08-05T09:44:46.632000Z", - "is_active": true, - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/tKkDB8_0DEFAULT-LOGO.jpg1c324d4d-f667-4af8-8d98-37205d34e3b5/tKkDB8_0DEFAULT-LOGO.jpg", - "modified_by": { - "username": "918793638893_86554", - "user_id": "3" - }, - "modified_on": "2020-08-06T18:07:35.231000Z", - "name": "Women's Fashion", - "platforms": {}, - "priority_order": 2, - "slug": "women-s-fashion", - "synonyms": [], - "tags": [], - "id": "5f2a7f8e31c66700018cdc49" - }, - { - "uid": 10, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "asavarijadhav_gofynd_com_99880", - "user_id": "5634" - }, - "created_on": "2020-08-05T09:45:12.075000Z", - "is_active": true, - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/oLoxiL_0DEFAULT-LOGO.jpgbd050200-700a-4a3e-9da6-e6b78fbee943/oLoxiL_0DEFAULT-LOGO.jpg", - "modified_by": { - "username": "asavarijadhav_gofynd_com_99880", - "user_id": "5634" - }, - "modified_on": "2020-08-05T09:48:01.660000Z", - "name": "Beauty & Personal Care", - "platforms": {}, - "priority_order": 4, - "slug": "beauty-personal-care", - "synonyms": [], - "tags": [], - "id": "5f2a7fa831c66700018cdc4a" - }, - { - "uid": 11, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "asavarijadhav_gofynd_com_99880", - "user_id": "5634" - }, - "created_on": "2020-08-05T09:45:39.797000Z", - "is_active": true, - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/vQv4ot_0DEFAULT-LOGO.jpg701cb5af-2024-4abf-ae5d-b68bc1a3cd43/vQv4ot_0DEFAULT-LOGO.jpg", - "modified_by": { - "username": "918793638893_86554", - "user_id": "3" - }, - "modified_on": "2020-08-06T11:38:57.599000Z", - "name": "Home & Living", - "platforms": {}, - "priority_order": 5, - "slug": "home-living", - "synonyms": [], - "tags": [], - "id": "5f2a7fc331c66700018cdc4b" - }, - { - "uid": 14, - "_cls": "Department", - "_custom_json": {}, - "created_by": { - "username": "asavarijadhav_gofynd_com_99880", - "user_id": "5634" - }, - "created_on": "2020-08-05T09:48:42.347000Z", - "is_active": false, - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/hTobjV_0DEFAULT-LOGO.jpga020159c-7fe7-4c1c-a11a-4be61a60da9f/hTobjV_0DEFAULT-LOGO.jpg", - "modified_by": { - "username": "asavarijadhav_gofynd_com_99880", - "user_id": "5634" - }, - "modified_on": "2020-08-05T09:48:42.347000Z", - "name": "Baby Care & Kids Essentials", - "platforms": {}, - "priority_order": 7, - "slug": "baby-care-kids-essentials", - "synonyms": [], - "tags": [], - "id": "5f2a807a31c66700018cdc4e" - }, - { - "_cls": "Department", - "created_on": "2021-01-13T10:12:33.002000Z", - "modified_on": "2021-01-13T13:50:55.415000Z", - "created_by": { - "username": "919821012599_75351", - "user_id": "5721" - }, - "modified_by": { - "username": "919821012599_75351", - "user_id": "5721" - }, - "uid": 21, - "name": "Skin care products", - "slug": "skin-care-produts", - "logo": "https://hdn-1.addsale.com/x0/department/pictures/square-logo/original/rNz8grLys-.png", - "tags": [], - "is_active": true, - "priority_order": 10235, - "platforms": {}, - "synonyms": [ - "skin", - "care" - ], - "_custom_json": {}, - "id": "5ffec79192813f0001eb6560" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### listProductTemplate -List all Templates - - - -```swift -catalog.listProductTemplate(companyId: companyId, departments: departments) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| departments | String | yes | A `departments` is the name of a particular department. | - - - -Allows you to list all product templates, also can filter by department - -*Returned Response:* - - - - -[TemplatesResponse](#TemplatesResponse) - -List of product templates. See example below or refer `TemplatesResponse` for details - - - - -
    -  Example: - -```json -{ - "page": { - "current": 1, - "size": 3, - "has_previous": false, - "has_next": true, - "item_total": 36 - }, - "items": [ - { - "name": "Accessories", - "categories": [ - "accessories-adornments", - "messenger-bags", - "wallets", - "satchels", - "backpacks", - "laptop-bags", - "briefcases", - "suitcases", - "duffles", - "analog-watches", - "chronograph-watches", - "digital-watches", - "aviators", - "wayfarers", - "round-sunglasses", - "cateye-sunglasses", - "rectangle-sunglasses", - "oversized-sunglasses", - "browline-sunglasses", - "square-sunglasses", - "sports-sunglasses", - "belts", - "ties", - "cufflinks", - "pocket-squares", - "tie-pins", - "brooches", - "baseball-caps", - "hats", - "shawls", - "mufflers", - "stoles", - "socks", - "dupattas", - "handbags", - "clutches", - "totes", - "sling-bags", - "hobos", - "scarves", - "stockings", - "hairbands", - "hair-clips", - "pouches", - "oval-sunglasses", - "gloves", - "frames", - "maang-tikka", - "bags", - "sunglasses", - "mittens", - "money-clips", - "card-cases", - "brushes", - "horns", - "spray", - "cleaner", - "cream", - "polishes", - "decoration-charms", - "care-kits", - "trees", - "shoe-bag", - "laces", - "insoles", - "handkerchief", - "toy-box", - "play-gym", - "camera-bag", - "fanny-pack", - "usb-cable", - "rca-cable", - "usb-c-to-multiport-adapter", - "batteries", - "power-banks", - "lightning-cable", - "tos-cable", - "aux-cable", - "hdmi-cable", - "charging-cable", - "mini-display-port-hdmi-cable", - "thunderbolt-cable", - "bluetooth-headphones", - "headphone", - "bluetooth-earphones", - "earphones", - "hard-disk-drive", - "photo-frame", - "notebook", - "pen", - "luggage-tag", - "stationery-combo", - "jewellery-case", - "folder", - "key-chain", - "suspender", - "cummerbund", - "cravet", - "toiletry-bag", - "cosmetic-bag", - "gift-bag", - "packaging-material", - "spectacle-case", - "cuff-bands", - "playing-cards", - "kalangi", - "kataar", - "safa", - "watch-case", - "paper-weight", - "caps", - "visor-caps", - "bucket-hats", - "beanie-caps", - "cowboy-hats", - "gatsby-caps", - "fedora-hats", - "rain-cover", - "round-glasses", - "rectangle-glasses", - "cateye-glasses", - "aviator-glasses", - "square-glasses", - "oval-glasses", - "almond-glasses", - "wayfarer-glasses", - "toric-contact-lenses", - "daily-disposable", - "monthly-reusable", - "multifocal-varifocal", - "solutions-accessories", - "coloured-lenses" - ], - "description": "This is the file validation template for the fashion department and accessories category.", - "departments": [ - "electronics", - "men", - "women", - "kids", - "toys" - ], - "attributes": [ - "gender", - "age-group", - "occasion", - "collection", - "season", - "color", - "material", - "product_type", - "pattern", - "closure_type", - "product_length", - "feature", - "care_instructions", - "package_contents", - "essential", - "gst-inclusive", - "gst-if-exclusive", - "fragile", - "manufacturer-packer-importer-name", - "manufacturer-packer-importer-address" - ], - "slug": "accessories", - "banner": "https://hdn-1.fynd.com/seller/pictures/landscape-banner/original/F4W6Pd_DEFAULT-BANNER_LANDSCAPE.jpgd54cb24d-dd2c-441c-bca0-8f65ea3b101c/F4W6Pd_DEFAULT-BANNER_LANDSCAPE.jpg", - "logo": "https://hdn-1.fynd.com/seller/pictures/logo/original/hkE1dC_0DEFAULT-LOGO.jpgfb5b1b31-9449-43db-9049-435fec88ee77/hkE1dC_0DEFAULT-LOGO.jpg", - "is_physical": true, - "id": "5f04a23544a2e5404274bc07" - }, - { - "slug": "all-attributes-template", - "categories": [ - "hd-television" - ], - "banner": "https://hdn-1.addsale.com/x0/seller/pictures/landscape-banner/original/tBqIbw_dj.jpg0b8e229f-45bd-4a96-97a5-3e5b193828d2/tBqIbw_dj.jpg", - "name": "All attributes Template", - "attributes": [ - "test-attribute-3", - "test-attribute", - "test-attribute-1", - "test-attribute-4", - "gender", - "neck-type", - "qwertyu", - "testtt-attribute-5", - "storage_humidity", - "operating_humidity", - "certifications", - "aspect_ratio", - "storage_temperature", - "memory_details", - "cache_memory", - "operating_temperature", - "expansion_slots", - "included_software", - "web_camera", - "video_memory", - "optical_drive", - "hard_drive_speed", - "hard_drive_type", - "hard_drive", - "speaker_type", - "core_type", - "processor_core", - "processor_model_number", - "processor_speed", - "processor_brand", - "processor_sub_brand", - "battery_cell", - "laptop_type", - "graphics_card_model", - "accessories", - "services", - "promotion_freebie", - "action", - "home_delivery", - "colour_reproduction", - "brightness", - "data_transfer_on_cloud", - "card_reader", - "battery_filter", - "volumetric_weight_in_kg", - "price_filter", - "brands_filter", - "number_of_usb_ports_filter", - "number_of_hdmi_ports_filter", - "smart_tv_filter", - "resolution_filter", - "display_technology", - "panel_type", - "record_as_you_watch", - "schedule_recording", - "no_of_channels", - "additional_side_panel_ports", - "response_time", - "contrast_ratio", - "hdmi_arc", - "tv_operating_system", - "refresh_rate", - "connect_to_router_via", - "connect_to_home_theatre_via", - "no_of_hdmi_ports", - "no_of_usb_ports", - "standby_power_consumption", - "connect_to_set_top_box_via", - "stream_content_from_devices", - "surround_sound_technology", - "tv_speaker_type", - "graphics_card_sub_brand", - "hdr", - "power_supply", - "power_consumption", - "connect_to_dvd_players_via", - "graphics_card_brand", - "rated_speaker_output_power_rms", - "3d_technology", - "optimized_heat_dissipation", - "backlit_keyboard_support", - "ethernet_lan_support", - "hdmi_support", - "anti_glare_screen", - "phone_network_and_connectivity", - "storage_filter", - "ram_filter", - "pallet", - "waterproof", - "selfie_camera_filter", - "primary_camera_filter", - "screen_size_filter", - "battery_power_features", - "in_the_box_warranty", - "features", - "screen_display_camera", - "phone_battery_charge_time", - "network_inter_device_connectivity", - "phone_os", - "phone_build_convenience", - "phone_hardware_storage", - "testcomparsion", - "country_of_origin", - "manufacturer_packer_importer_address", - "manufacturer_packer_importer_name", - "warranty_type", - "dlna_compliant", - "user_guides_attachment", - "resq_support_guide_attachment", - "water_resistant", - "speaker_support", - "fm_radio", - "nfc_support", - "package_content", - "talk_time", - "standby_time", - "quick_charge", - "preloaded_apps", - "metal_frame", - "touch_screen", - "glass_type", - "meta_description", - "short_description", - "is_flammable", - "transfer_price_tp", - "screen_size", - "bluetooth", - "wi_fi", - "3g", - "internal_storage", - "in_the_box", - "memory_ram", - "4g", - "usb", - "otg_support", - "edge", - "nfc", - "microphone", - "dummy_int", - "product_details", - "subtitle", - "general_information", - "expandable", - "style_note", - "is_waterproof", - "brand_name", - "color", - "model", - "product_type", - "series", - "product_identifiers", - "style", - "sub_brand", - "socks_length", - "heel_height", - "occasion", - "storage", - "season", - "processor", - "collection", - "storage_type", - "topwear_length", - "bottomwear_length", - "denim_type", - "boot_length", - "dial_shape", - "thickness", - "lens_colour", - "sensors", - "dial_colour", - "material", - "usb_support", - "fingerprint_recognition", - "strap_type", - "operating_system", - "frame_style", - "brand_rating", - "operating_system_type", - "4g_bands", - "strap_colour", - "4g_support", - "2g_bands", - "frame_colour", - "video_formats", - "3g_bands", - "feature", - "3g_support", - "movement_type", - "bluetooth_version", - "pattern", - "wi_fi_support", - "bluetooth_support", - "inner_material", - "selfie_camera", - "closure_type", - "screen_resolution", - "product_fit", - "screen_size_diagonal", - "dimensions", - "display_type", - "plating", - "primary_camera", - "toe_type", - "dual_camera_rear", - "clasp_type", - "ram", - "padding", - "microphone_support", - "sim_type", - "capacity", - "arch_type", - "stone_type", - "warranty_description", - "additional_connectivity", - "compartments", - "audio_formats", - "sleeve_type", - "audio_jack", - "diameter", - "battery_capacity", - "sleeve_length", - "battery_operated", - "product_length", - "battery_run_time", - "neck_type", - "battery_type", - "collar_type", - "battery_voltage", - "cellular_technology", - "waist_rise", - "edge_support", - "coverage", - "expandable_memory", - "package_contents", - "gprs_support", - "care_instructions", - "hybrid_sim_slot", - "model_info", - "variant", - "warranty", - "complexion", - "skin_type", - "spf", - "speciality", - "finish", - "lasting_power", - "benefits", - "hair_type", - "fragrance_family", - "fragrance_type", - "product_format", - "active_ingredients", - "ingredients", - "how_to_use", - "shelf_life", - "safety_warning", - "testtt-attribute-6" - ], - "departments": [ - "electronics" - ], - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/7V0z2B_dj.jpg21ac07ea-9f83-403e-ad37-69076c6c5c46/7V0z2B_dj.jpg", - "description": "Blah Blah", - "is_physical": true, - "id": "5ed5f84d2abe0f0001174d73" - }, - { - "name": "Baby Care & Toys", - "categories": [ - "kids-puzzles", - "kids-shirts" - ], - "description": "This is the file validation template for the Baby Care & Toys department.", - "departments": [ - "baby-care-kids-essentials", - "toys", - "kids" - ], - "attributes": [ - "gender", - "age-group", - "occasion", - "collection", - "season", - "color", - "material", - "product_type", - "no-of-pieces", - "battery_operated", - "is-portable", - "is_flammable", - "capacity", - "carrying-capacity", - "inner-dimension", - "seat-dimension", - "package_contents", - "additional-features", - "certification", - "essential", - "gst-inclusive", - "gst-if-exclusive", - "fragile", - "manufacturer-packer-importer-name", - "manufacturer-packer-importer-address" - ], - "slug": "baby-care-toys", - "banner": "https://hdn-1.fynd.com/seller/pictures/landscape-banner/original/Ikt1sK_DEFAULT-BANNER_LANDSCAPE.jpg7f923d3d-abc9-4a2e-9a49-204a36e1073c/Ikt1sK_DEFAULT-BANNER_LANDSCAPE.jpg", - "logo": "https://hdn-1.fynd.com/seller/pictures/logo/original/saEu9Z_0DEFAULT-LOGO.jpg4cd36f29-a15b-4ec1-ab33-1162ede2c61f/saEu9Z_0DEFAULT-LOGO.jpg", - "is_physical": true, - "id": "5f04a24944a2e5404274bc09" - }, - { - "name": "Bags", - "categories": [ - "seal-bags", - "reusable-bag", - "poly-bag", - "shoe-bag", - "sling-bags", - "bags" - ], - "description": "This is the file validation template for the fashion department and bags category.", - "departments": [ - "kids", - "women", - "men" - ], - "attributes": [ - "gender", - "age-group", - "color", - "outer-material", - "inner_material", - "product_type", - "collection", - "occasion", - "season", - "pattern", - "closure_type", - "care_instructions", - "compartments", - "expandable", - "water-resistence", - "water-resistence-details", - "water-proof", - "water-proof-details", - "warranty_type", - "warranty_description", - "package_contents", - "essential", - "gst-inclusive", - "gst-if-exclusive", - "fragile", - "manufacturer-packer-importer-name", - "manufacturer-packer-importer-address" - ], - "slug": "bags", - "banner": "https://hdn-1.fynd.com/seller/pictures/landscape-banner/original/ejcGMm_DEFAULT-BANNER_LANDSCAPE.jpg658c38fd-d6de-4fcf-9f0e-3a886b2e2225/ejcGMm_DEFAULT-BANNER_LANDSCAPE.jpg", - "logo": "https://hdn-1.fynd.com/seller/pictures/logo/original/GIysAV_0DEFAULT-LOGO.jpgf1942433-2bcb-4939-9128-675f66cd6d70/GIysAV_0DEFAULT-LOGO.jpg", - "is_physical": true, - "id": "5f04a24a44a2e5404274bc0b" - }, - { - "modified_on": "2020-08-19T04:04:30.421000Z", - "logo": "https://hdn-1.addsale.com/x0/products/pictures/template/logo/original/fW2zqHspe-q1.png", - "created_on": "2020-08-19T04:04:30.421000Z", - "banner": "https://hdn-1.addsale.com/x0/products/pictures/template/banner/original/_YRvLuMDn-q1.jpeg", - "attributes": [ - "base-material" - ], - "modified_by": { - "username": "fahimsakri_gofynd_com_44938", - "user_id": "10" - }, - "departments": [ - "men-s-fashion", - "kids", - "women-s-fashion", - "beauty-personal-care" - ], - "slug": "base-template", - "description": "ad", - "name": "Base Template", - "categories": [ - "adcdas" - ], - "created_by": { - "username": "fahimsakri_gofynd_com_44938", - "user_id": "10" - }, - "is_physical": true, - "id": "5f3ca4ce3f7e74000111925f" - }, - { - "description": "This is the file validation template for the Beauty & Personal Care department. ", - "name": "Beauty & Personal Care", - "slug": "beauty-personal-care", - "departments": [ - "beauty-personal-care" - ], - "attributes": [ - "gender", - "age-group", - "occasion", - "collection", - "season", - "color", - "product_type", - "complexion", - "skin_type", - "spf", - "speciality", - "finish", - "lasting_power", - "coverage", - "hair_type", - "fragrance_family", - "fragrance_type", - "closure_type", - "capacity", - "product_format", - "active_ingredients", - "benefits", - "how-to-use", - "shelf_life", - "safety_warning", - "mask_type", - "material", - "adjustable", - "reusable", - "foldable", - "filtration", - "compatible_filter", - "package_contents", - "warranty_type", - "warranty_description", - "essential", - "gst-inclusive", - "gst-if-exclusive", - "fragile", - "manufacturer-packer-importer-name", - "manufacturer-packer-importer-address" - ], - "categories": [ - "foundation", - "concealer", - "mascara", - "kajal", - "eyeshadow", - "false-eyelashes", - "eyebrow-enhancer", - "eyeliner", - "personal-care-gift-sets", - "primer", - "compact", - "hair-removal-cream", - "lip-liner", - "nail-polish-remover", - "liquid-lipstick", - "lipstick", - "nail-polish", - "moisturizing-socks", - "hand-cream", - "sindoor", - "crayon-lipstick", - "eye-brushes", - "manicure-kits", - "lip-gloss", - "makeup-remover", - "nail-art-kit", - "foot-cream", - "bb-cream", - "brush-sets", - "pedicure-kits", - "face-brushes", - "highlighters", - "lip-balm", - "lip-brushes", - "sunscreen", - "trimmer", - "facial-kits", - "colour-contact-lens", - "body-wash", - "toners", - "cleanser", - "epilator", - "eye-gels", - "face-wash", - "eye-masks", - "eye-creams", - "facial-wipes", - "masks", - "perfume", - "moisturizer", - "serum", - "night-cream", - "shoe-deodorant", - "razor", - "soaps", - "body-scrubs", - "day-cream", - "deodorants", - "eye-roll-on", - "eye-serums", - "attar", - "bath-sets", - "bathing-accessories", - "scrubs", - "sets", - "underarm-roll-on", - "wax-strips", - "body-creams", - "body-lotions", - "talcum-powders", - "body-butters", - "body-mousse", - "hair-brushes", - "combs", - "hair-spa", - "hair-colour", - "hair-spa-kits", - "hair-cream", - "hair-extensions", - "anti-stretch-mark-cream", - "body-oils", - "body-souffles", - "conditioner", - "hair-accessories", - "hair-oil", - "hair-serum", - "hair-spray", - "shampoo", - "body-mists", - "body-sprays", - "liquid-soap", - "beard-oil", - "beard-colour", - "beard-wash", - "beard-balm", - "nail-cutter", - "home-fragrance", - "gift-set", - "hand-soap", - "hand-sanitizer", - "face-oil", - "body-massage-balm", - "face-gel", - "face-mist", - "bath-oil", - "insect-repellent", - "anti-ageing-cream", - "bath-salt", - "anti-acne-cream", - "face-massage-cream", - "whitening-cream", - "anti-wrinkle-cream", - "foot-spray", - "anti-blemish-cream", - "blush", - "makeup-fixer", - "makeup-kit", - "sponge", - "foot-scrub", - "eyeshadow-palette", - "cc-cream", - "eye-wipes", - "head-wrap", - "patches", - "nipple-butter", - "pillow-spray", - "pillow-roll-on", - "fragrance-plug", - "pain-relief-balm", - "headache-roll-on", - "mirror", - "toilet-seat-spray", - "intimate-wash", - "massager", - "makeup-accessories", - "pillow", - "nail-accessories", - "sanitary-napkins", - "protective-mask", - "kohl-kajal", - "natural-lipstick", - "pearl-lipstick", - "creme-lipstick", - "matte-lipstick", - "glossy-lipstick", - "compact-spray", - "compact-stick", - "compact-powder", - "highlighter-cake", - "blush-highlighter", - "kajal-stick", - "compact-cake", - "roll-on-kajal-pencil", - "liquid-compact", - "stick-highlighter", - "kajal-pencil", - "gel-kajal", - "liquid-glossy-lipstick", - "liquid-matte-lipstick", - "crayon-matte-lipstick", - "liquid-creme-lipstick", - "crayon-glossy-lipstick", - "natural-lip-gloss", - "liquid-natural-lipstick", - "crayon-creme-lipstick", - "pearl-lip-gloss", - "liquid-pearl-lipstick", - "crayon-natural-lipstick", - "liquid-highlighter", - "crayon-pearl-lipstick", - "glossy-lip-gloss", - "matte-lip-gloss", - "creme-lip-gloss", - "eye-concealer", - "object-disinfectant", - "face-disinfectant", - "vegetable-fruit-wash", - "infrared-thermometer", - "safety-goggle", - "personal-protective-equipment-kit", - "examination-gloves", - "face-shield" - ], - "banner": "https://hdn-1.fynd.com/seller/pictures/landscape-banner/original/ZxNlYp_DEFAULT-BANNER_LANDSCAPE.jpg66a71bf3-c1a7-4aa0-98e6-f2a837caa59a/ZxNlYp_DEFAULT-BANNER_LANDSCAPE.jpg", - "logo": "https://hdn-1.fynd.com/seller/pictures/logo/original/OInLCX_0DEFAULT-LOGO.jpg03aeaeb8-2d04-4694-b641-f60fbdea5c4d/OInLCX_0DEFAULT-LOGO.jpg", - "is_physical": true, - "id": "5f05b34844a2e571575f3047" - }, - { - "name": "Clothing", - "categories": [ - "casual-shirts", - "formal-shirts", - "sweaters", - "sweatshirts", - "hoodies", - "cardigans", - "suits", - "front-open-jackets", - "blazers", - "waistcoats", - "jeans", - "chinos", - "cargos", - "corduroys", - "formal-trousers", - "3-4ths", - "trunks", - "boardshorts", - "rashguard", - "briefs", - "trackpants", - "tracksuits", - "joggers", - "t-shirts", - "shorts", - "gowns", - "blouson-top", - "tunics", - "corsets", - "kaftan-top", - "shift-dress", - "jumpsuits", - "jeggings", - "skirts", - "palazzos", - "culottes", - "leggings", - "shrugs", - "sports-bra", - "bikinis", - "swimsuit", - "sarong", - "kaftan", - "shapewear", - "camisole", - "activewear-tops", - "tights", - "yoga-pants", - "capris", - "harem", - "bomber-jackets", - "gilet", - "leather-jackets", - "polos", - "bodycon-dress", - "off-shoulder-dress", - "skater-dress", - "maxi-dress", - "sheath-dress", - "sweater-dress", - "tube-dress", - "slip-dress", - "asymmetric-dress", - "bodysuit", - "peplum-top", - "crop-top", - "tiered-dress", - "maxi-top", - "tank-top", - "tube-top", - "strappy-top", - "activewear-jackets", - "denim-jackets", - "windcheater", - "peplum-dress", - "off-shoulder-top", - "shirt-dress", - "kids-shirts", - "twin-sets", - "dungarees", - "trousers", - "western-jackets", - "frocks", - "dresses", - "tops", - "casual-pants", - "beachwear-bottoms", - "coat", - "fusion-set", - "indowestern-kurta", - "tapered-jeans", - "joggers-jeans", - "straight-chinos", - "tapered-chinos", - "double-breasted-suits", - "activewear-crop-tops", - "flat-front-formal-trousers", - "pleated-formal-trousers", - "straight-formal-trousers", - "straight-jeans", - "flared-jeans", - "tapered-formal-trousers", - "straight-skirt", - "flared-skirt", - "asymmetric-skirt", - "pleated-corduroys", - "tapered-corduroys", - "straight-corduroys", - "cropped-chinos", - "cropped-corduroys", - "bootcut-jeans", - "drop-crotch-jeans", - "cropped-jeans", - "bootcut-formal-trousers", - "cropped-formal-trousers", - "five-buttoned-suits", - "tuxedo-suits", - "one-buttoned-suits", - "two-buttoned-suits", - "four-buttoned-suits", - "three-buttoned-suits", - "pleated-chinos", - "pleated-jeans", - "beachwear-bikini-tops", - "pleated-skirt", - "flared-formal-trousers", - "activewear-tank-tops", - "beachwear-bikini-bottoms", - "pencil-skirt", - "activewear-blouse", - "casual-joggers" - ], - "description": "This is the file validation template for the fashion department and clothing category.", - "departments": [ - "men", - "women", - "kids", - "clothing" - ], - "attributes": [ - "gender", - "age-group", - "color", - "material", - "occasion", - "collection", - "season", - "product_fit", - "product_type", - "product_length", - "pattern", - "sleeve_type", - "sleeve_length", - "closure_type", - "neck_type", - "waist_rise", - "denim-fade", - "care_instructions", - "package_contents", - "number-of-pockets", - "model_info", - "essential", - "gst-inclusive", - "gst-if-exclusive", - "fragile", - "manufacturer-packer-importer-name", - "manufacturer-packer-importer-address" - ], - "slug": "clothing", - "banner": "https://hdn-1.fynd.com/seller/pictures/landscape-banner/original/720R34_DEFAULT-BANNER_LANDSCAPE.jpga765babe-cfaa-4cc5-9da7-f4e1402fa97e/720R34_DEFAULT-BANNER_LANDSCAPE.jpg", - "logo": "https://hdn-1.fynd.com/seller/pictures/logo/original/jKZEs7_0DEFAULT-LOGO.jpg78413c0a-11a8-43f8-88ad-1442e9fdb898/jKZEs7_0DEFAULT-LOGO.jpg", - "is_physical": true, - "id": "5f04a25044a2e5404274bc0e" - }, - { - "description": "asdd", - "attributes": [ - "color", - "warranty_type", - "care_instructions" - ], - "modified_on": "2020-08-20T16:15:33.598000Z", - "modified_by": { - "username": "fahimsakri_gofynd_com_44938", - "user_id": "10" - }, - "name": "FA-Template", - "categories": [ - "vision-qa-f9447f89-d2da-41fc-ac33-b9f286308c14" - ], - "logo": "https://hdn-1.addsale.com/x0/products/pictures/template/logo/original/fW2zqHspe-q1.png", - "departments": [ - "electronics" - ], - "banner": "https://hdn-1.addsale.com/x0/products/pictures/template/banner/original/L_u77Mz4T-FA-Template.png", - "slug": "fa-template", - "created_on": "2020-08-19T09:51:08.215000Z", - "created_by": { - "username": "fahimsakri_gofynd_com_44938", - "user_id": "10" - }, - "is_physical": true, - "id": "5f3cf60c9788cc00018ab276" - }, - { - "name": "Footwear", - "categories": [ - "sneakers", - "running-shoes", - "hiking-shoes", - "football-shoes", - "indoor-sports-shoes", - "trainers", - "outdoor-sports-shoes", - "moccasins", - "loafers", - "boat-shoes", - "brogues", - "derby-shoes", - "oxfords", - "monk-strap-shoes", - "lace-ups", - "formal-slip-ons", - "boots", - "sandals", - "flip-flops", - "floaters", - "d-orsay", - "espadrilles", - "pointed-toe", - "flat-slip-ons", - "gladiators", - "flat-sandals", - "stilettos", - "wedges", - "block-heels", - "kitten-heels", - "louis-heels", - "cone-heels", - "heel-sandals", - "ballerinas", - "casual-slip-ons", - "casual-lace-ups", - "ethnic-sandals", - "clogs", - "slippers", - "school-shoes", - "high-heels", - "flats", - "mules", - "crocs", - "heels-pumps", - "mojaris", - "jutties", - "labour-shoes" - ], - "description": "This is the file validation template for the fashion department and footwear category.", - "departments": [ - "men", - "women", - "kids" - ], - "attributes": [ - "gender", - "age-group", - "color", - "outer-material", - "inner_material", - "sole-material", - "occasion", - "collection", - "season", - "product_type", - "pattern", - "closure_type", - "toe_type", - "arch_type", - "heel_height", - "heel-height-unit-of-measure", - "care_instructions", - "package_contents", - "water-resistence", - "water-resistence-details", - "water-proof", - "water-proof-details", - "warranty_type", - "warranty_description", - "essential", - "gst-inclusive", - "gst-if-exclusive", - "fragile", - "manufacturer-packer-importer-name", - "manufacturer-packer-importer-address" - ], - "slug": "footwear", - "banner": "https://hdn-1.fynd.com/seller/pictures/landscape-banner/original/phMzNh_DEFAULT-BANNER_LANDSCAPE.jpgf06e7d2f-15a0-405a-b37b-1333c618abdb/phMzNh_DEFAULT-BANNER_LANDSCAPE.jpg", - "logo": "https://hdn-1.fynd.com/seller/pictures/logo/original/PkIwbo_0DEFAULT-LOGO.jpgbb9acb1b-5e2c-44d4-918a-9429367ccb7d/PkIwbo_0DEFAULT-LOGO.jpg", - "is_physical": true, - "id": "5f04a25344a2e5404274bc10" - }, - { - "slug": "groceries", - "name": "Groceries", - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/EtkWQm_fruit___vegetable_logo.jpgc541c78c-dabc-4823-bb72-c4bd3e5db449/EtkWQm_fruit___vegetable_logo.jpg", - "departments": [ - "groceries" - ], - "description": "Groceries", - "banner": "https://hdn-1.addsale.com/x0/seller/pictures/landscape-banner/original/BPjEl6_fruit___vegetable_logo.jpg577eb6bb-de4e-444c-a86a-bc23e0d97178/BPjEl6_fruit___vegetable_logo.jpg", - "attributes": [ - "ingredient-type", - "manufacturer_packer_importer_address" - ], - "categories": [ - "buns", - "non-veg-pickle", - "condensed-milk", - "shoe-shiners", - "bath-stool-tub-basin-sets", - "soda-cocktail-mix", - "tofu", - "buckets-mugs", - "fresh-mutton", - "games-calculators", - "kolam", - "namkeen-savoury-snacks", - "gift-bags", - "honey", - "cutlery-spoons-fork", - "pita", - "potato-onion-tomato", - "apples-pomegranate", - "dishwash-powder", - "country-eggs", - "fish-tuna", - "coconut-milk", - "sugarfree-sweeteners", - "cups-mugs-tumblers", - "turkey", - "breakfast-snack-mixes", - "diabetic-drinks", - "other-dal", - "herbs-seasoning", - "incense-sticks", - "scissor", - "slice-cakes", - "dips-dressings", - "files", - "lavash", - "flakes", - "tawa-sauce-pan", - "breads", - "jaggery", - "soya-chunks", - "exotic-vegetables", - "wine-rise-vinegar", - "recipe-packs", - "pen", - "cookware-sets", - "jam-conserve-marmalade", - "holi-pichkari", - "knives-peelers", - "chicken-sausages", - "poha", - "jowar-flour", - "cook-serve", - "unsweetened-cold-press", - "decorations", - "dust-cloth-wipes", - "jelly", - "gift-boxes", - "organic-cold-press-oil", - "glucose-powder-tablets", - "frozen-non-veg-snacks", - "leafy-vegetables", - "salted-biscuits", - "cooking-chocolates-cocoa", - "marinated-meat", - "berries", - "basmati-rice", - "ground-coffee", - "cut-vegetables", - "moong-dal", - "glue", - "fabric-pre-post-wash", - "canola-rapeseed-oil", - "water-fridge-bottle", - "frozen-fish-seafood", - "choppers-graters", - "soya", - "kiwi-melon-citrus-fruits", - "buttermilk", - "focaccia", - "healthy-baked-snacks", - "bowls", - "car-freshener", - "nachos", - "powdered-spices", - "rawa", - "pressure-cookers", - "chips", - "cream-rolls", - "tape", - "bajra", - "jowar", - "ice-cream", - "wicks", - "cooking-pastes", - "erasers-sharpeners", - "imported-fruits", - "notebooks", - "masoor-dal", - "canned-seafood", - "regular-white-vinegar", - "croissants-bread", - "pasta", - "root-vegetables", - "whole-spices", - "chana-dal", - "glassware", - "cucumber-gourds-capsicum", - "papads-ready-to-fry", - "lamp", - "hakka-noodles", - "balsamic-cider-vinegar", - "garbage-bags", - "pumpkin-drumstick", - "other-plastic-ware", - "frozen-indian-breads", - "glucose-milk-biscuits", - "non-alcoholic-drinks", - "paneer", - "toor-dal", - "fresh-salads-sprouts", - "fresh-chicken", - "wheat-flour", - "fruits-pulps", - "cheese-spread", - "camphor", - "cabbage-broccoli-cauliflower", - "sugar", - "candles", - "plates", - "mangoes", - "aerated-drinks", - "toffee-candy-lollypop", - "pizza-base", - "thai-asian-sauce", - "shoe-brushes", - "gas-stove", - "sports-energy-drinks", - "shrikhand", - "hangers-clips-ropes", - "croutons", - "floor-other-cleaners", - "toilet-cleaners", - "macaroni", - "folders", - "choco-nut-spread", - "salts", - "butter", - "pavs", - "hangers", - "khari", - "frozen-veg-snacks", - "tea-cakes", - "seasonal-fruits", - "olive", - "seasonal-accessories", - "cream", - "heat-eat-ready-meals", - "dishwash-liquid-paste", - "rubs", - "beans-pulses", - "seasonal-vegetables", - "besan", - "shoe-polish", - "packaged-water", - "kids-cereal", - "instant-coffee", - "powdered-milk", - "dishwash-bar", - "home-baking", - "laundry-storage-baskets", - "detergent-liquid", - "instant-noodles", - "canned-food", - "disposable-cups-plates", - "brinjals", - "imported-cleaners", - "tinned-packed-sweets", - "container-set", - "lamp-oil", - "mayonnaise", - "wall-hooks", - "spreads", - "juices", - "quinoa-grains", - "pooja-thali", - "milk", - "syrups-concentrates", - "cut-fruit-tender-coconut", - "kitchen-rolls", - "cold-drinks", - "vessels", - "premium-cookies", - "pooja-bells", - "other-pooja-needs", - "rise-flour", - "breadcrumbs", - "cup-cakes", - "berry", - "regional-rice", - "regional-grains", - "chilli-soya-sauce", - "gourmet-popcorn", - "beans-okra", - "wafers", - "sparkling-drinks", - "muffins", - "daliya", - "match-box", - "bagels-bread", - "rice-products", - "dry-fruits", - "dal-mix", - "flavoured-water", - "roasted-seeds-nuts", - "marshmallow", - "toilet-paper", - "wet-wipes", - "fruit-baskets", - "leaf-dust-tea", - "rakhi", - "insect-repellent", - "bajra-flour", - "ghee", - "lunch-boxes", - "cup-noodles", - "chocolates", - "candle-holder", - "frozen-mutton", - "marie-health-digestive", - "pencils", - "turkey-duck", - "vermicelli", - "exotic-flavoured-tea", - "powdered-mixes", - "urad-dal", - "toilet-other-brushes", - "jalapeno", - "maida", - "chutney", - "fresh-sweets", - "dessert-mixes", - "instant-pasta", - "kitchen-tools-other-accessories", - "mushrooms", - "chilli-lemon-garlic-ginger", - "gherkin", - "cooking-oil", - "curry-paste", - "tumblers", - "lamb", - "cheese", - "other-seafood", - "other-meat", - "frozen-chicken", - "banana-sapota-papaya", - "granola-cereal-bars", - "sabudana", - "cream-biscuits", - "bread-sticks", - "chia-seeds", - "utensil-scrub-pad-glove", - "soya-granules", - "soups", - "spring-water", - "rusks", - "olive-oil", - "organic-eggs", - "aluminium-foil-cling-wrap", - "colours-crayons", - "corn-snacks", - "pulses", - "protein-eggs", - "tomatoes-vegetables", - "cookies", - "still-drinks", - "mustard-cheese-sauce", - "regional-flour", - "detergent-powder", - "flavoured-other-oils", - "chikki-gajak", - "curd", - "strainers-ladle-spatula", - "holi-colours", - "trail-cocktail-mixes", - "baking-cake-decoration", - "biscuits", - "pencil-box", - "muesli", - "air-freshener", - "quinoa", - "metal-furniture-cleaners", - "green-tea", - "paper-napkin", - "flavoured-milk", - "mints-chewing-gum", - "lighters", - "lassi", - "edamame-beans", - "dry-fish", - "blended-masalas", - "tomato-ketchup", - "kadai-fry-pans", - "dustbins", - "syrups", - "wheat", - "kitchen-glass-drains", - "pork-ham", - "panini", - "flours-pre-mixes", - "cfl-led-bulbs", - "baguette-bread", - "brooms-dust-pans", - "prawns-shrimps", - "soap-cases-dispensers", - "oats-porridge", - "mops-wipers", - "exam-pads", - "tea-bags", - "pastries", - "mosquito-repellent", - "cut-peeled-veggies", - "pickle", - "brownies", - "margarine", - "soya-milk", - "fresh-fish", - "cloth-dryer-iron-table", - "gift-wrap", - "farm-eggs", - "detergent-bar", - "battery-electricals" - ], - "is_physical": true, - "id": "5efc43b13b4ca00001328666" - }, - { - "description": "This is the file validation template for the Home & Living Department", - "name": "Home & Living", - "slug": "home-living", - "departments": [ - "home-living" - ], - "categories": [ - "slippers", - "chairs", - "table", - "beds", - "vases", - "bed-sheets", - "dining-table", - "blankets", - "bath-robe", - "bathing-accessories", - "napkins", - "hanger", - "lunch-box", - "photo-frame", - "toiletry-bag", - "pillow", - "cup-saucer", - "pet-collar-charm", - "alarm-clocks", - "dessert-plates", - "vintage-clocks", - "tissue-holder", - "flush-mount-lights", - "jewellery-box-stands", - "desk-accessories", - "serving-sets", - "cake-stands", - "bath-towel", - "cutlery", - "knives", - "knives-holder", - "pillow-covers", - "placemats", - "saucer", - "coasters", - "tea-sets", - "forks", - "shower-curtains", - "serving-bowls", - "soap-dispensers", - "spoons", - "bath-mats", - "table-runner", - "bed-covers", - "tea-coffee-accessories", - "coverlets", - "soap-dishes", - "duvet", - "bed-sheets-sets", - "duvet-cover", - "bolster-pillows", - "quilts-rajais", - "mattress", - "bed-linen-set", - "candles", - "clothes-storage", - "shoe-racks", - "cushion-fillers", - "scented-candles", - "art-pieces", - "key-holder", - "planters", - "showpieces", - "decals-stickers", - "mirrors", - "clocks", - "coffee-tables", - "dining-benches", - "ottoman", - "artificial-flowers", - "dining-chair", - "dining-table-set", - "drapery", - "console-table", - "baking-mould", - "cup", - "dohars", - "cushion-covers", - "fountains", - "comforters", - "mugs", - "flowerpot", - "cushions", - "decorative-objects", - "napkin-holder", - "trays", - "table-cloth", - "tea-cosy", - "shower-caps", - "shower-mats", - "bed-skirts", - "wardrobe-organisers", - "mattress-protectors", - "pillow-protectors", - "tea-light-candles", - "sculptures", - "faux-plants", - "vintage-finds", - "wall-art", - "dressing-tables", - "benches", - "sofas", - "storage-trunks", - "curtains", - "side-table", - "pillow-shams", - "wind-chimes", - "candle-holders", - "cheese-boards", - "serving-platters", - "pitchers", - "drinking-glasses", - "pet-collar", - "bathroom-faucets", - "lamp-bases", - "wreath", - "pendant-lamps", - "hearth-fireplace", - "sconces", - "succulents-plants", - "fireplace-screens", - "garlands", - "electric-fireplaces", - "storage-boxes", - "elecrtonics-tech-accessories", - "diffusers", - "potpourri", - "throws", - "ceiling-lights", - "pet-feeding-bowl", - "chandeliers", - "carpets", - "salad-plates", - "room-partitions", - "bar-accessories", - "decorative-lights", - "hand-towel", - "lamp-shades", - "face-towel", - "study-table-lamps", - "floor-runner", - "wall-lamps", - "frying-pan", - "door-mats", - "carafe", - "dinner-plates", - "snifter", - "dinner-set", - "peg-measure", - "platters", - "shot-bottles", - "bathroom-caddy", - "vinegar-dispenser", - "toilet-brush-holder", - "cutlery-holder", - "toothbrush-holder", - "kitchen-trolly", - "stemware", - "measuring-cup", - "baking-tray", - "strainer", - "stew-pan", - "whisk", - "cocktail-shaker", - "flask", - "food-container", - "string-lights", - "bottle-holder", - "poufs", - "chopping-board", - "fireplace-tools", - "dish-rack", - "log-racks-holders", - "ladle", - "aroma-oils", - "peeler", - "incense-sticks-holders", - "tongs", - "incense-sticks", - "kettle", - "kulladhs", - "table-linen-set", - "handbag-organiser", - "upholstery", - "laundry-bag", - "floor-lamps", - "magazine-organiser", - "lighting-accessories", - "makeup-organiser", - "table-lamps", - "shelf-liner", - "rugs-dhurries", - "shoes-organiser", - "sweater-bag", - "bowls", - "decanters", - "garbage-bag", - "beach-towel", - "bookcase", - "towel-set", - "pool-table", - "bath-rug", - "poker-table", - "shower-holder", - "table-tennis", - "towel-holder", - "bar-counter-stools", - "bath-mirror", - "bar-carts", - "towel-rod", - "bar-furniture", - "floor-mats", - "bedside-table", - "kadhai", - "foundations", - "sauce-pan", - "pillow-inserts", - "tawa", - "bathroom-vanities", - "cocktail-set", - "lounging-relaxing-furniture", - "canister", - "oil-dispenser", - "salt-pepper-shakers", - "spatula", - "casserole", - "handi", - "glasses", - "kitchen-linen-set", - "wardrobe-organiser", - "jewellery-organiser", - "separators", - "closet-storage", - "garbage-bag-holder", - "hooks", - "foosball-table", - "board-game", - "wall-shelves", - "media-furniture", - "file-cabinets", - "leather-furniture", - "buffets-sidebars", - "mattress-pads", - "wastebaskets", - "hampers-baskets", - "outdoor-dining-furniture", - "entry-furniture", - "water-jugs", - "table-covers", - "lanterns", - "desk-organiser", - "drawer-organiser", - "suit-organiser", - "swab-storage", - "tote-basket", - "hanger-holder", - "cabinet", - "hockey-table", - "shuffleboard", - "game-accessories", - "desk", - "office-chairs", - "dining-storage", - "kitchen-island", - "nightstands", - "duvet-inserts", - "mattress-toppers", - "medicine-cabinets", - "bathroom-hardware-accessories", - "salt-pepper-grinders", - "water-bottle" - ], - "attributes": [ - "occasion", - "collection", - "color", - "material", - "product_type", - "bed_size", - "utility", - "quality", - "pattern", - "filling", - "shape", - "sheet-type", - "sheet_size", - "thread_count", - "product-dimensions", - "pocket_depth", - "group-id", - "variation-type", - "variation-based-on", - "capacity", - "dishwasher_safe", - "microwave_safe", - "oven_safe", - "additional-features", - "care_instructions", - "package_contents", - "sales_package", - "warranty_type", - "warranty_description", - "gst-inclusive", - "gst-if-exclusive", - "fragile", - "manufacturer-packer-importer-name", - "manufacturer-packer-importer-address" - ], - "banner": "https://hdn-1.fynd.com/seller/pictures/landscape-banner/original/EHRCqs_DEFAULT-BANNER_LANDSCAPE.jpgc596e149-f6e1-4695-9446-9a8b88797d4c/EHRCqs_DEFAULT-BANNER_LANDSCAPE.jpg", - "logo": "https://hdn-1.fynd.com/seller/pictures/logo/original/UAiJlq_0DEFAULT-LOGO.jpg25c9816d-2376-4eaf-b4ab-accb37e9a564/UAiJlq_0DEFAULT-LOGO.jpg", - "is_physical": true, - "id": "5f05acfa44a2e55081728be2" - }, - { - "categories": [ - "3-ply-box", - "5-ply-box", - "7-ply-box", - "9-ply-box", - "bubble-roll", - "card-board-roll", - "courier-bag", - "courier-pouch", - "die-cut-box", - "double-side-tape", - "drawer-box", - "duct-tape", - "filament-tape", - "laminated-box", - "packaging-tape", - "poly-bag", - "printed-tape", - "reusable-bag", - "seal-bags", - "stretch-wrap", - "suit-box", - "zip-lock-bags", - "box" - ], - "name": "Industrial Supplies", - "banner": "https://hdn-1.fynd.com/seller/pictures/landscape-banner/original/9DpMn3_Beauty_&_Personal_Care_L.jpg80d89967-9c2c-498b-a79c-d176b3e71ea5/9DpMn3_Beauty_and_Personal_Care_L.jpg", - "slug": "industrial-supplies", - "attributes": [ - "color", - "primary_color", - "style", - "features", - "safety_warning", - "is_flammable", - "water_resistant", - "product_details", - "package_contents", - "essential", - "pallet" - ], - "logo": "https://hdn-1.fynd.com/seller/pictures/logo/original/I2NV2c_indi.jpg2eaf85b5-8076-4b0b-8f01-f119d6d8b559/I2NV2c_indi.jpg", - "departments": [ - "industrial-supplies" - ], - "description": "Products used for business and industrial manufacturing process comes under this category. Example: Packaging Material", - "modified_by": { - "username": "meghagolecha_fynd_com_89167", - "user_id": "23244269" - }, - "modified_on": "2020-08-20T19:12:26.040000Z", - "is_active": true, - "is_physical": true, - "id": "5f11eced5ca7f90001685a70" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### validateProductTemplate -Validate Product Template Schema - - - -```swift -catalog.validateProductTemplate(companyId: companyId, slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| slug | String | yes | A `slug` is a unique identifier for a particular template. | - - - -Allows you to list all product templates validation values for all the fields present in the database - -*Returned Response:* - - - - -[TemplatesValidationResponse](#TemplatesValidationResponse) - -List of fields and validation values fro each. See example below or refer `TemplatesValidationResponse` for details - - - - -
    -  Example: - -```json -null -``` -
    - - - - - - - - - ---- - - -#### downloadProductTemplateViews -Download Product Template View - - - -```swift -catalog.downloadProductTemplateViews(companyId: companyId, slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| slug | String | yes | A `slug` is a unique identifier for a particular template. | - - - -Allows you to download product template data - -*Returned Response:* - - - - -[String](#String) - -CSV File of product template data. See example below or refer `TemplatesResponse` for details - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### downloadProductTemplateView -Download Product Template View - - - -```swift -catalog.downloadProductTemplateView(companyId: companyId, itemType: itemType) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| itemType | String | yes | An `item_type` defines the type of item. | - - - -Allows you to download product template data - -*Returned Response:* - - - - -[String](#String) - -CSV File of product template data. - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### validateProductTemplateSchema -Validate Product Template Schema - - - -```swift -catalog.validateProductTemplateSchema(companyId: companyId, itemType: itemType) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| itemType | String | yes | An `item_type` defines the type of item. The default value is standard. | - - - -Allows you to list all product templates validation values for all the fields present in the database - -*Returned Response:* - - - - -[InventoryValidationResponse](#InventoryValidationResponse) - -List of fields and validation values fro each. See example below or refer `InventoryValidationResponse` for details - - - - -
    -  Example: - -```json -{ - "data": { - "title": "InventoryValidationResponse", - "type": "object", - "properties": { - "item": { - "$ref": "" - }, - "sizes": { - "title": "Sizes", - "type": "array", - "items": { - "$ref": "" - } - } - }, - "required": [ - "item", - "sizes" - ], - "definitions": { - "ItemQuery": { - "title": "ItemQuery", - "type": "object", - "properties": { - "uid": { - "title": "Uid", - "type": "integer" - }, - "brand_uid": { - "title": "Brand Uid", - "type": "integer" - }, - "item_code": { - "title": "Item Code", - "type": "integer" - } - } - }, - "InventoryBaseSchema": { - "title": "InventoryBaseSchema", - "type": "object", - "properties": { - "price": { - "title": "Actual Price", - "exclusiveMinimum": 1, - "type": "number" - }, - "price_effective": { - "title": "Selling Price", - "exclusiveMinimum": 1, - "type": "number" - }, - "seller_identifier": { - "title": "Gtin Value", - "pattern": "^[A-Za-z0-9]*$", - "type": "string" - }, - "quantity": { - "title": "Quantity", - "minimum": 0, - "type": "integer" - }, - "store_code": { - "title": "Store Code", - "type": "string", - "enum": [ - "RUOSH43", - "S106", - "S108", - "TIO9", - "talha" - ] - }, - "currency": { - "title": "Currency", - "enum": [ - "INR", - "QAR" - ], - "type": "string" - }, - "size": { - "title": "Size", - "type": "string" - } - }, - "required": [ - "price", - "price_effective", - "seller_identifier", - "quantity", - "store_code", - "currency", - "size" - ] - } - } - }, - "message": "Success" -} -``` -
    - - - - - - - - - ---- - - -#### listHSNCodes -List HSN Codes - - - -```swift -catalog.listHSNCodes(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | - - - -Allows you to list all hsn Codes - -*Returned Response:* - - - - -[HSNCodesResponse](#HSNCodesResponse) - -List of all HSN Codes. See example below or refer `HSNCodesResponse` for details - - - - -
    -  Example: - -```json -{ - "data": { - "country_of_origin": [ - "India" - ], - "hsn_code": [ - "11111111" - ] - }, - "message": "Success" -} -``` -
    - - - - - - - - - ---- - - -#### listProductTemplateExportDetails -Allows you to list all product templates export list details - - - -```swift -catalog.listProductTemplateExportDetails(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | - - - -Can view details including trigger data, task id , etc. - -*Returned Response:* - - - - -[ProductDownloadsResponse](#ProductDownloadsResponse) - -List of Product Downloads Data. See example below or refer `ProductDownloadsResponse` for details - - - - -
    -  Example: - -```json -{ - "page": {}, - "items": [ - { - "created_by": { - "username": "917972410891_48194", - "user_id": "5646" - }, - "data": { - "type": "csv", - "brand": [ - "ruosh" - ], - "templates": [ - "mobile-phones-and-tablet" - ] - }, - "status": "success", - "task_id": "c4b54ace-44ef-11eb-9806-1ef9bc4a2da1", - "template_tags": { - "mobile-phones-and-tablet": { - "display": "Mobile Phones & Tablet", - "logo": "https://hdn-1.jiox0.de/jiox0/seller/pictures/logo/original/Oda39B_99946594-portable-devices-with-tablet-and-mobile-phone-vector-icon-for-apps-and-websites.jpgcc2dff44-7fae-4002-9ebe-d2b59c8bee91/Oda39B_99946594-portable-devices-with-tablet-and-mobile-phone-vector-icon-for-apps-and-websites.jpg" - } - }, - "trigger_on": "2020-12-23T07:23:35.302000Z", - "seller_id": 3, - "completed_on": "2020-12-23T07:23:41.031000Z", - "url": "https://regrowth.s3.amazonaws.com/slingshot-catalogues/seller-catalog/3/c4b54ace-44ef-11eb-9806-1ef9bc4a2da1/c4b54ace-44ef-11eb-9806-1ef9bc4a2da1.zip", - "id": "5fe2f077516d980001880943" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### listTemplateBrandTypeValues -Allows you to list all values for Templates, Brands or Type - - - -```swift -catalog.listTemplateBrandTypeValues(companyId: companyId, filter: filter) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| filter | String | yes | A `filter` is the unique identifier of the type of value required. | - - - -The filter type query parameter defines what type of data to return. The type of query returns the valid values for the same - -*Returned Response:* - - - - -[ProductConfigurationDownloads](#ProductConfigurationDownloads) - -See example below or refer `ProductConfigurationDownloadsSchema` for details - - - - -
    -  Example: - -```json -{ - "data": [ - { - "display": "csv", - "value": "csv" - }, - { - "display": "excel", - "value": "excel" - } - ], - "multivalue": false -} -``` -
    - - - - - - - - - ---- - - -#### createCategories -Create product categories - - - -```swift -catalog.createCategories(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| body | CategoryRequestBody | yes | Request body | - - -This API lets user create product categories - -*Returned Response:* - - - - -[CategoryCreateResponse](#CategoryCreateResponse) - -Category Meta. See example below or refer `CategoryCreateResponse` for details - - - - -
    -  Example: - -```json -{ - "message": "Success", - "uid": 0 -} -``` -
    - - - - - - - - - ---- - - -#### listCategories -Get product categories list - - - -```swift -catalog.listCategories(companyId: companyId, level: level, departments: departments, q: q, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| level | String? | no | Get category for multiple levels | -| departments | String? | no | Get category for multiple departments filtered | -| q | String? | no | Get multiple categories filtered by search string | -| pageNo | Int? | no | The page number to navigate through the given set of results | -| pageSize | Int? | no | Number of items to retrieve in each page. Default is 10. | - - - -This API gets meta associated to product categories. - -*Returned Response:* - - - - -[CategoryResponse](#CategoryResponse) - -Category Meta. See example below or refer `CategoryResponse` for details - - - - -
    -  Example: - -```json -{ - "page": { - "current": 1, - "size": 58, - "has_previous": false, - "has_next": true, - "item_total": 574 - }, - "items": [ - { - "name": "Air Conditioners", - "media": { - "logo": "https://hdn-1.addsale.com/x0/category/pictures/square-logo/original/zTgh1zslj-.png", - "portrait": "https://hdn-1.addsale.com/x0/category/pictures/portrait-banner/original/VKqwRngFh-.png", - "landscape": "https://hdn-1.addsale.com/x0/category/pictures/landscape-banner/original/_7GDi3tyi-.png" - }, - "marketplaces": {}, - "tryouts": [], - "is_active": true, - "created_by": { - "username": "917972410891_48194", - "user_id": "5646" - }, - "uid": 22330, - "slug": "air-conditioners", - "priority": 1, - "synonyms": [], - "modified_by": { - "username": "917972410891_48194", - "user_id": "5646" - }, - "level": 3, - "hierarchy": [ - { - "l1": 1, - "department": 1, - "l2": 22329 - } - ], - "created_on": "2021-04-02T15:43:59.410000Z", - "departments": [ - 1 - ], - "modified_on": "2021-04-02T15:43:59.410000Z", - "id": "60673bbf7896da00017885ad" - }, - { - "name": "Home Appliances", - "media": { - "logo": "https://hdn-1.addsale.com/x0/category/pictures/square-logo/original/zTgh1zslj-.png", - "portrait": "https://hdn-1.addsale.com/x0/category/pictures/portrait-banner/original/VKqwRngFh-.png", - "landscape": "https://hdn-1.addsale.com/x0/category/pictures/landscape-banner/original/_7GDi3tyi-.png" - }, - "is_active": true, - "created_by": { - "username": "917972410891_48194", - "user_id": "5646" - }, - "uid": 22329, - "slug": "home-appliances", - "priority": 1, - "synonyms": [], - "modified_by": { - "username": "917972410891_48194", - "user_id": "5646" - }, - "level": 2, - "hierarchy": [], - "created_on": "2021-04-02T15:42:55.405000Z", - "departments": [ - 1 - ], - "modified_on": "2021-04-02T15:42:55.405000Z", - "id": "60673b7f7896da00017885ac" - }, - { - "created_by": { - "username": "919821012599_75351", - "user_id": "5721" - }, - "slug": "dummy-category-level-2", - "level": 2, - "uid": 22323, - "is_active": true, - "media": { - "portrait": "https://hdn-1.addsale.com/x0/category/pictures/portrait-banner/original/VKqwRngFh-.png", - "landscape": "https://hdn-1.addsale.com/x0/category/pictures/landscape-banner/original/0wCdjxWpI-.png", - "logo": "https://hdn-1.addsale.com/x0/category/pictures/square-logo/original/zTgh1zslj-.png" - }, - "name": "Dummy category level 2 by fahim", - "modified_on": "2021-03-04T15:43:50.495000Z", - "modified_by": { - "username": "917753852478_51632", - "user_id": "5677" - }, - "synonyms": [ - "skin", - "care", - "asdasd" - ], - "created_on": "2021-01-14T05:28:02.148000Z", - "priority": 123456, - "hierarchy": [], - "departments": [ - 21 - ], - "id": "5fffd662e64eb40001fc8a42" - }, - { - "synonyms": [], - "marketplaces": {}, - "created_on": "2021-02-25T00:00:47.589000Z", - "modified_by": { - "username": "917753852478_51632", - "user_id": "5677" - }, - "media": { - "landscape": "https://hdn-1.addsale.com/x0/category/pictures/landscape-banner/original/0wCdjxWpI-.png", - "logo": "https://hdn-1.addsale.com/x0/category/pictures/square-logo/original/EfCt9iXx8-http/d3p8ifzkmzds37.cloudfront.net/media/logo/department/original/15870_c287d3c2431a432bb0e49363ef6b82bc.png.jpeg", - "portrait": "https://hdn-1.addsale.com/x0/category/pictures/portrait-banner/original/S1axCMOJ4-.png" - }, - "modified_on": "2021-03-04T15:39:52.108000Z", - "hierarchy": [ - { - "l2": 22323, - "l1": 22322, - "department": 21 - } - ], - "name": "Dummy level 4", - "is_active": true, - "slug": "dummy-level-4", - "departments": [ - 21 - ], - "level": 3, - "tryouts": [], - "uid": 22325, - "priority": 986532, - "created_by": { - "username": "silverbolt", - "user_id": "-1" - }, - "id": "60369b57d23031d14be92c18" - }, - { - "created_by": { - "username": "919821012599_75351", - "user_id": "5721" - }, - "slug": "dummy-level-3", - "level": 3, - "uid": 22324, - "is_active": true, - "media": { - "landscape": "https://hdn-1.addsale.com/x0/category/pictures/landscape-banner/original/0wCdjxWpI-.png", - "logo": "https://hdn-1.addsale.com/x0/category/pictures/square-logo/original/EfCt9iXx8-http/d3p8ifzkmzds37.cloudfront.net/media/logo/department/original/15870_c287d3c2431a432bb0e49363ef6b82bc.png.jpeg", - "portrait": "https://hdn-1.addsale.com/x0/category/pictures/portrait-banner/original/S1axCMOJ4-.png" - }, - "name": "Dummy level 3 by fahim", - "tryouts": [ - "Lipstick", - "Eyeliner" - ], - "modified_on": "2021-03-04T15:39:46.246000Z", - "modified_by": { - "username": "917753852478_51632", - "user_id": "5677" - }, - "synonyms": [], - "marketplaces": {}, - "created_on": "2021-01-14T05:28:59.852000Z", - "priority": 986532, - "hierarchy": [ - { - "l2": 22323, - "l1": 22322, - "department": 21 - }, - { - "l2": 3732, - "l1": 3672, - "department": 4 - }, - { - "l2": 730, - "l1": 595, - "department": 2 - } - ], - "departments": [ - 2, - 4, - 21 - ], - "id": "5fffd69be64eb40001fc8a65" - }, - { - "uid": 3151, - "departments": [ - 4 - ], - "is_active": true, - "level": 1, - "media": { - "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/YHIeoQ_fruit___vegetable_logo.jpg16aab608-a78a-458f-b60b-524525f27dec/YHIeoQ_fruit___vegetable_logo.jpg", - "portrait": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/ywPVrU_preview_a637ca6e4da6e38f03eb0d650ac5d6ba.jpgc73cc22f-b5ee-4fd4-a585-8ada35762d68/ywPVrU_preview_a637ca6e4da6e38f03eb0d650ac5d6ba.jpg", - "landscape": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/ywPVrU_preview_a637ca6e4da6e38f03eb0d650ac5d6ba.jpgc73cc22f-b5ee-4fd4-a585-8ada35762d68/ywPVrU_preview_a637ca6e4da6e38f03eb0d650ac5d6ba.jpg" - }, - "name": "Gourmet & World Food", - "priority": 123, - "slug": "gourmet-world-food", - "synonyms": [ - "gourmet & world food", - "food", - "gourmet" - ], - "created_on": "2016-04-09T06:44:35Z", - "hierarchy": [], - "modified_by": { - "username": "917753852478_51632", - "uid": "5677" - }, - "modified_on": "2021-03-03T09:35:50.415000Z", - "id": "5fabab8ea18a1284b97ff6c4" - }, - { - "modified_by": { - "username": "917753852478_51632", - "uid": "5677" - }, - "marketplaces": {}, - "hierarchy": [ - { - "l1": 595, - "l2": 714, - "department": 2 - }, - { - "l1": 2, - "l2": 4, - "department": 1 - } - ], - "created_on": "2021-03-03T06:30:08.342000Z", - "created_by": { - "username": "917753852478_51632", - "uid": "5677" - }, - "level": 3, - "name": "Test Category kaf", - "media": { - "landscape": "https://hdn-1.addsale.com/x0/category/pictures/landscape-banner/original/0wCdjxWpI-.png", - "logo": "https://hdn-1.addsale.com/x0/category/pictures/square-logo/original/EfCt9iXx8-http/d3p8ifzkmzds37.cloudfront.net/media/logo/department/original/15870_c287d3c2431a432bb0e49363ef6b82bc.png.jpeg", - "portrait": "https://hdn-1.addsale.com/x0/category/pictures/portrait-banner/original/VKqwRngFh-.png" - }, - "tryouts": [ - "Lipstick", - "Blush" - ], - "is_active": true, - "slug": "test-category-kaf", - "uid": 22328, - "synonyms": [ - "test", - "category" - ], - "priority": 23, - "departments": [ - 1, - 2 - ], - "modified_on": "2021-03-03T08:34:47.999000Z", - "id": "603f2cf0aac0360001c00731" - }, - { - "level": 3, - "departments": [ - 1 - ], - "is_active": false, - "created_by": { - "username": "silverbolt", - "user_id": "-1" - }, - "created_on": "2021-02-25T09:26:53.123000Z", - "tryouts": [], - "slug": "smart-cell", - "marketplaces": {}, - "priority": 5, - "media": { - "portrait": "http://cdn4.gofynd.com/media/logo/department/original/13239_660c6f5b2b8d458789de4552d241ea1b.jpg", - "landscape": "https://hdn-1.fynd.com/media/banner/category/original/16128_380bed8bff064a0b981041df65e0d8b3.jpg", - "logo": "http://d3p8ifzkmzds37.cloudfront.net/media/logo/department/original/15870_c287d3c2431a432bb0e49363ef6b82bc.png" - }, - "modified_on": "2021-02-25T09:26:53.123000Z", - "synonyms": [], - "uid": 22327, - "hierarchy": [ - { - "l1": 2, - "l2": 3, - "department": 1 - } - ], - "name": "Smart Cell", - "modified_by": { - "username": "silverbolt", - "user_id": "-1" - }, - "id": "60372005d230311fe9e51f0b" - }, - { - "is_active": true, - "hierarchy": [ - { - "department": 21, - "l1": 22322, - "l2": 22323 - } - ], - "slug": "dummy-level-98", - "priority": 986532, - "uid": 22326, - "departments": [ - 21 - ], - "created_by": { - "username": "silverbolt", - "user_id": "-1" - }, - "modified_on": "2021-02-25T00:09:35.026000Z", - "marketplaces": {}, - "tryouts": [], - "synonyms": [], - "media": { - "landscape": "https://hdn-1.addsale.com/x0/category/pictures/landscape-banner/original/0wCdjxWpI-.png", - "portrait": "https://hdn-1.addsale.com/x0/category/pictures/portrait-banner/original/S1axCMOJ4-.png", - "logo": "https://hdn-1.addsale.com/x0/category/pictures/square-logo/original/EfCt9iXx8-http/d3p8ifzkmzds37.cloudfront.net/media/logo/department/original/15870_c287d3c2431a432bb0e49363ef6b82bc.png.jpeg" - }, - "level": 3, - "name": "Dummy level 98", - "created_on": "2021-02-25T00:09:35.026000Z", - "modified_by": { - "username": "silverbolt", - "user_id": "-1" - }, - "id": "60369d67d2303111b8924dcf" - }, - { - "uid": 315, - "created_on": "2016-04-09T06:44:35Z", - "departments": [ - 2, - 3 - ], - "hierarchy": [ - { - "l1": 65, - "l2": 66, - "department": 2 - }, - { - "l1": 442, - "l2": 26, - "department": 2 - }, - { - "l1": 442, - "l2": 26, - "department": 3 - } - ], - "is_active": true, - "level": 3, - "marketplaces": {}, - "media": { - "landscape": "https://hdn-1.fynd.com/media/banner/category/original/19961_f042f1f4a90f4e828b6d77d6dbea264d.jpg", - "logo": "https://hdn-1.fynd.com/media/logo/category/original/81ef023d375044e9b9daa66b81ec411f.jpg", - "portrait": "https://hdn-1.fynd.com/media/banner_portrait/category/original/19960_c679d51cb1bd4ca99f00f9050aa647a4.jpg" - }, - "modified_by": { - "username": "917753852478_51632", - "user_id": "5677" - }, - "modified_on": "2021-02-15T15:48:05.329000Z", - "name": "Sports Bra", - "priority": 281, - "slug": "sports-bra", - "synonyms": [ - "Sports Bra", - "activewear bra", - "gym bra" - ], - "tryouts": [], - "id": "5fdba984642de8d93efb0d71" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### updateCategory -Update product categories - - - -```swift -catalog.updateCategory(companyId: companyId, uid: uid, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| uid | String | yes | Category unique id | -| body | CategoryRequestBody | yes | Request body | - - -Update a product category using this apu - -*Returned Response:* - - - - -[CategoryUpdateResponse](#CategoryUpdateResponse) - -Category Meta. See example below or refer `CategoryUpdateResponse` for details - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getCategoryData -Get product category by uid - - - -```swift -catalog.getCategoryData(companyId: companyId, uid: uid) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| uid | String | yes | Category unique id | - - - -This API gets meta associated to product categories. - -*Returned Response:* - - - - -[SingleCategoryResponse](#SingleCategoryResponse) - -Get Data for one category. See example below or refer `CategoryResponse` for details - - - - -
    -  Example: - -```json -{ - "data": { - "name": "Air Conditioners", - "media": { - "portrait": "https://hdn-1.addsale.com/x0/category/pictures/portrait-banner/original/_4p7Kz9Yp-banner.png", - "landscape": "https://hdn-1.addsale.com/x0/category/pictures/landscape-banner/original/nsi0nJ6gX-landscape.png", - "logo": "https://hdn-1.addsale.com/x0/category/pictures/square-logo/original/zTgh1zslj-.png" - }, - "marketplaces": {}, - "tryouts": [], - "is_active": true, - "created_by": { - "username": "917972410891_48194", - "user_id": "5646" - }, - "uid": 22330, - "slug": "air-conditioners", - "priority": 1, - "synonyms": [], - "modified_by": { - "username": "nikhilmhatre_gofynd_com_97636", - "user_id": "16" - }, - "level": 3, - "hierarchy": [ - { - "l1": 1, - "department": 1, - "l2": 22329 - } - ], - "created_on": "2021-04-02T15:43:59.410000Z", - "departments": [ - 1 - ], - "modified_on": "2021-04-13T13:57:56.443000Z", - "id": "60673bbf7896da00017885ad" - } -} -``` -
    - - - - - - - - - ---- - - -#### createProduct -Create a product. - - - -```swift -catalog.createProduct(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company associated to product that is to be viewed. | -| body | ProductCreateUpdate | yes | Request body | - - -This API allows to create product. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getProducts -Get product list - - - -```swift -catalog.getProducts(companyId: companyId, brandIds: brandIds, categoryIds: categoryIds, itemIds: itemIds, departmentIds: departmentIds, itemCode: itemCode, q: q, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Get list of products filtered by company Id | -| brandIds | [Int]? | no | Get multiple products filtered by Brand Ids | -| categoryIds | [Int]? | no | Get multiple products filtered by Category Ids | -| itemIds | [Int]? | no | Get multiple products filtered by Item Ids | -| departmentIds | [Int]? | no | Get multiple products filtered by Department Ids | -| itemCode | [Double]? | no | Get multiple products filtered by Item Code | -| q | String? | no | Get multiple products filtered by q string | -| pageNo | Int? | no | The page number to navigate through the given set of results | -| pageSize | Int? | no | Number of items to retrieve in each page. Default is 10. | - - - -This API gets meta associated to products. - -*Returned Response:* - - - - -[ProductListingResponse](#ProductListingResponse) - -Product Meta. See example below for details - - - - -
    -  Example: - -```json -{ - "items": [ - { - "name": "TV Set", - "description": "Tv", - "country_of_origin": "India", - "currency": "INR", - "short_description": "", - "is_set": true, - "item_code": "TVSET111", - "brand_uid": 1, - "template_tag": "television", - "highlights": [ - "42 Inch" - ], - "slug": "tv-set", - "_custom_json": {}, - "l3_mapping": [ - "electronics>qled_television" - ], - "image_nature": "standard", - "departments": [ - 1 - ], - "created_on": 1599024995, - "created_by": { - "username": "919049753052_37528", - "user_id": "5" - }, - "modified_on": 1627642010, - "modified_by": { - "username": "xxxxxxxxxx", - "user_id": "xxxxxxxxxxx" - }, - "stage": "verified", - "uid": 7501547, - "verified_by": { - "username": "Silverbolt", - "user_id": "0" - }, - "verified_on": 1626965521, - "all_sizes": [ - { - "item_code": "TVSET111", - "brand_uid": 1, - "seller_identifier": "HGS272727272", - "identifiers": [ - { - "gtin_type": "ean", - "gtin_value": "HGS272727272", - "primary": true - } - ], - "company_id": 1, - "size": "XXLX23, MX11, LX67, XLX45 (146 PCS)", - "marked_price": 35000 - } - ], - "category_slug": "qled-television", - "is_image_less_product": false, - "media": [ - { - "url": "https://hdn-1.addsale.com/x0/products/pictures/item/free/135x0/dcizgsG_Y-Tv-Set.png", - "type": "image" - } - ], - "variants": {}, - "product_publish": { - "is_set": false, - "product_online_date": 1627642009 - }, - "is_dependent": false, - "is_physical": true, - "item_type": "set", - "category_uid": 1, - "custom_order": { - "manufacturing_time": 2, - "is_custom_order": true, - "manufacturing_time_unit": "days" - }, - "moq": { - "minimum": 1, - "is_set": false - }, - "multi_size": true, - "no_of_boxes": 1, - "product_group_tag": [], - "size_guide": "slim-fit-shirts-for-men", - "tags": [], - "teaser_tag": {}, - "synonyms": [], - "hsn_code": "11111111", - "return_config": { - "unit": "days", - "returnable": false, - "time": 0 - }, - "all_company_ids": [ - 1 - ], - "all_identifiers": [ - "19WE100" - ], - "trader": { - "address": "sdfdsfsdf", - "name": "asdasd" - }, - "trader_type": "Packer", - "verification_status": "pending", - "sizes": [ - { - "size": "FGX33, GHX33 (66 PCS)", - "store_count": 1 - }, - { - "size": "XSE WE23X100 (100 PCS)", - "store_count": 2 - }, - { - "size": "XSEX100 (100 PCS)", - "store_count": 3 - }, - { - "size": "XXLX23, MX11, LX67, XLX45 (146 PCS)", - "store_count": 3 - } - ], - "id": "5f4f2f6371a5970001f13655", - "brand": { - "name": "Apple", - "logo": { - "aspect_ratio": "1:1", - "aspect_ratio_f": 1, - "url": "https://hdn-1.jiox0.de/jioecomm/seller/pictures/logo/50x0/apple-7f951c/logo_apple.png", - "secure_url": "https://hdn-1.jiox0.de/jioecomm/seller/pictures/logo/50x0/apple-7f951c/logo_apple.png" - }, - "uid": 13 - }, - "images": [ - { - "aspect_ratio": "16:25", - "aspect_ratio_f": 0.64, - "url": "https://hdn-1.addsale.com/x0/products/pictures/item/free/135x0/dcizgsG_Y-Tv-Set.png", - "secure_url": "https://hdn-1.addsale.com/x0/products/pictures/item/free/135x0/dcizgsG_Y-Tv-Set.png" - } - ], - "price": { - "marked": { - "min": 35000, - "max": 35000 - }, - "effective": { - "min": 25000, - "max": 25000 - } - } - } - ], - "page": { - "type": "number", - "current": 1, - "size": 1, - "item_total": 1, - "has_previous": false, - "has_next": false - } -} -``` -
    - - - - - - - - - ---- - - -#### deleteProduct -Delete a product. - - - -```swift -catalog.deleteProduct(companyId: companyId, itemId: itemId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id of the company associated to product that is to be deleted. | -| itemId | Int | yes | Id of the product to be updated. | - - - -This API allows to delete product. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### editProduct -Edit a product. - - - -```swift -catalog.editProduct(companyId: companyId, itemId: itemId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company associated to product that is to be viewed. | -| itemId | Int | yes | Id of the product to be updated. | -| body | ProductCreateUpdate | yes | Request body | - - -This API allows to edit product. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "uid": 1, - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getProduct -Get a single product. - - - -```swift -catalog.getProduct(itemCode: itemCode, companyId: companyId, itemId: itemId, brandUid: brandUid, uid: uid) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| itemCode | String? | no | Item code of the product. | -| companyId | Int | yes | Company Id of the product. | -| itemId | Int | yes | Item Id of the product. | -| brandUid | Int? | no | Brand Id of the product. | -| uid | Int? | no | Id of the product. | - - - -This API helps to get data associated to a particular product. - -*Returned Response:* - - - - -[Product](#Product) - -Product object. See example below or refer `product.utils.format_product_response` for details - - - - -
    -  Example: - -```json -{ - "data": { - "template_tag": "industrial-supplies", - "brand_uid": 1486, - "currency": "INR", - "item_code": "TP_FS_01", - "slug": "printed-fyndstore-packaging-tape-4inch-x-6-meter-length-pack-of-2-49d7343fc677", - "name": "Printed Fyndstore Packaging Tape (4inch X 6 Meter length) - Pack of 2", - "hsn_code": "48190000", - "country_of_origin": "India", - "description": "FyndStore 4 inch Printed BOPP Tapes ", - "is_set": true, - "is_active": true, - "departments": [ - 11 - ], - "uid": 1282497, - "category_slug": "printed-tape", - "company_id": 884, - "media": [ - { - "url": "https://hdn-1.fynd.com/media/pictures/tagged_items/original/TPFS01/IMG20200624130956.jpg", - "type": "image" - } - ], - "variants": {}, - "is_dependent": false, - "item_type": "set", - "multi_size": true, - "product_publish": { - "is_set": false, - "product_online_date": "2020-09-10T15:16:12.322000Z" - }, - "id": "5f5a433c74f3f400017cdaa0", - "brand": { - "name": "RollUp", - "logo": { - "aspect_ratio": "1:1", - "aspect_ratio_f": 1, - "url": "https://hdn-1.fynd.com/brands/pictures/square-logo/50x0/mPBaWqGRnjR-RMOnlpdMPKm-yjn5mua63gfmzdpombb1.png", - "secure_url": "https://hdn-1.fynd.com/brands/pictures/square-logo/50x0/mPBaWqGRnjR-RMOnlpdMPKm-yjn5mua63gfmzdpombb1.png" - }, - "uid": 1486 - }, - "return_config": { - "returnable": true, - "time": 30, - "unit": "days" - }, - "sizes": [ - { - "item_dimensions_unit_of_measure": "cm", - "item_weight": 0.15, - "set": { - "quantity": 1, - "size_distribution": { - "sizes": [ - { - "pieces": 1, - "size": "OS" - } - ] - } - }, - "item_height": 10.16, - "item_width": 10.16, - "price_effective": 999, - "size": "OS", - "seller_identifier": "TP_FS_01", - "brand_uid": 1486, - "price": 1000, - "item_weight_unit_of_measure": "gram", - "currency": "INR", - "item_length": 10.16, - "item_code": "TP_FS_01", - "company_id": 884, - "is_set": true, - "track_inventory": true, - "identifiers": [ - { - "gtin_value": "TP_FS_01", - "primary": true, - "gtin_type": "sku_code" - } - ], - "price_transfer": 0, - "id": "5f5a433c74f3f400017cdaa1", - "store_count": 1 - } - ], - "attributes": { - "style": "TPFS01", - "color": "White", - "pallet": 1, - "l3_mapping": [ - "industrial_supplies>printed_tape" - ], - "image_nature": "standard", - "created_on": "2020-09-10T15:16:12.322000Z", - "created_by": { - "username": "sumitdafda_gofynd_com_68387", - "user_id": "23108029", - "company_id": 884 - }, - "modified_on": "2020-09-24T04:51:00.229000Z", - "modified_by": { - "username": "sumitdafda_gofynd_com_68387", - "user_id": "23108029", - "company_id": 884 - }, - "stage": "verified", - "verified_by": { - "username": "sumitdafda_gofynd_com_68387", - "user_id": "23108029", - "company_id": 884 - }, - "verified_on": 1600923060, - "is_image_less_product": false, - "other_available_sizes": [] - } - } -} -``` -
    - - - - - - - - - ---- - - -#### getProductValidation -Validate product/size data - - - -```swift -catalog.getProductValidation(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Validates data against given company | - - - -This API validates product data. - -*Returned Response:* - - - - -[ValidateProduct](#ValidateProduct) - -Validate Meta. See example below for details - - - - -
    -  Example: - -```json -{ - "valid": true -} -``` -
    - - - - - - - - - ---- - - -#### getProductSize -Get a single product size. - - - -```swift -catalog.getProductSize(itemCode: itemCode, companyId: companyId, itemId: itemId, brandUid: brandUid, uid: uid) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| itemCode | String? | no | Item code of the product size. | -| companyId | Int | yes | Company Id of the product size. | -| itemId | Int | yes | Item Id of the product size. | -| brandUid | Int? | no | Brand Id of the product size. | -| uid | Int? | no | Id of the product size. | - - - -This API helps to get data associated to a particular product size. - -*Returned Response:* - - - - -[ProductListingResponse](#ProductListingResponse) - -Product object. See example below for details - - - - -
    -  Example: - -```json -{ - "name": "SQUADMTGIVESPACE", - "country_of_origin": "India", - "highlights": null, - "hsn_code": "61099090", - "item_code": "ACTESTCREATELISTING1", - "is_set": false, - "description": "", - "currency": "INR", - "slug": "play-clan-squadmtgivespace-857587-e928b0", - "template_tag": "topwear", - "is_active": false, - "departments": [ - 1 - ], - "uid": 857587, - "all_sizes": [ - "3XL" - ], - "category_slug": "t-shirts", - "company_id": 61, - "media": [], - "size_guide": "play-clan-men-casual-tees", - "is_dependent": false, - "item_type": "standard", - "multi_size": true, - "product_publish": { - "is_set": false, - "product_online_date": 1595478043 - }, - "id": "5f19101b99ee0500011dc896", - "brand": { - "name": "play clan", - "logo": { - "aspect_ratio": "1:1", - "aspect_ratio_f": 1, - "url": "https://hdn-1.fynd.com/brands/pictures/square-logo/50x0/zjt4-wU8Lk-VQYu0pcokb-r6yteuannoorjkq9f4tk.jpg", - "secure_url": "https://hdn-1.fynd.com/brands/pictures/square-logo/50x0/zjt4-wU8Lk-VQYu0pcokb-r6yteuannoorjkq9f4tk.jpg" - }, - "uid": 85 - }, - "images": [], - "sizes": [ - { - "price_transfer": 0, - "price_effective": 10000, - "price": 10000, - "currency": "INR", - "is_set": false, - "size": "3XL", - "identifiers": [ - { - "gtin_type": "sku_code", - "gtin_value": "ACTESTCREATELISTING1_3XL", - "primary": true - } - ] - } - ], - "attributes": { - "essential": "Yes", - "color": "Red", - "gender": [ - "Men" - ], - "material": "cotton", - "pattern": "Printed", - "product_fit": "Regular", - "sleeve_length": "Short", - "neck_type": "Round Neck", - "primary_color": "Red", - "primary_material": "Others", - "l3_mapping": [ - "men>casual_tees", - "women>casual_tees", - "girls>casual_tees", - "more>casual_tees" - ], - "image_nature": "standard", - "meta_nature": "standard", - "created_on": "2020-07-23T04:20:43.810000Z", - "created_by": { - "username": "silverbolt", - "user_id": "-1", - "company_id": 1181 - }, - "modified_on": "2020-07-23T04:20:44.185000Z", - "modified_by": { - "username": "silverbolt", - "user_id": "-1", - "company_id": 61 - }, - "stage": "verified", - "verified_by": { - "username": "Silverbolt", - "user_id": "0" - }, - "verified_on": 1595478044, - "is_image_less_product": false - } -} -``` -
    - - - - - - - - - ---- - - -#### updateProductAssetsInBulk -Create a Bulk asset upload Job. - - - -```swift -catalog.updateProductAssetsInBulk(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id in which assets to be uploaded. | -| body | BulkJob | yes | Request body | - - -This API helps to create a bulk asset upload job. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getProductBulkUploadHistory -Get a list of all bulk product upload jobs. - - - -```swift -catalog.getProductBulkUploadHistory(companyId: companyId, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id of of which Product Bulk Upload History to be obtained. | -| pageNo | Int? | no | The page number to navigate through the given set of results | -| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | - - - -This API helps to get bulk product upload jobs data. - -*Returned Response:* - - - - -[ProductBulkRequestList](#ProductBulkRequestList) - -List of bulk product upload jobs. See `BulkRequestGetSchema` for details - - - - -
    -  Example: - -```json -{ - "items": [ - { - "stage": "completed", - "company_id": 61, - "is_active": true, - "cancelled_records": [], - "failed": 0, - "template_tag": "footwear", - "modified_on": "2021-03-12T08:11:08.646000Z", - "created_on": "2021-03-12T08:11:06.848000Z", - "failed_records": [], - "created_by": { - "username": "yadavanuja039_gmail_com_82948", - "user_id": "23218433", - "full_name": "Anuja Yadav" - }, - "total": 1, - "file_path": "https://hdn-1.fynd.com/company/61/self/documents/product-import/free/original/mkX5ApRmw-sample_bulk_products_footwear.xlsx", - "succeed": 1, - "modified_by": { - "username": "Silverbolt", - "user_id": "0" - }, - "cancelled": 0, - "template": { - "name": "Footwear", - "banner": "https://hdn-1.fynd.com/seller/pictures/landscape-banner/original/nFPtXR_Beauty_&_Personal_Care_L.jpgf30455a5-d265-4382-b513-65afb9240320/nFPtXR_Beauty_and_Personal_Care_L.jpg", - "slug": "footwear", - "logo": "https://hdn-1.fynd.com/seller/pictures/logo/original/9Y2UEp_ssssss.jpg7359e4c6-4c53-4dbe-a920-ef8ac658afb1/9Y2UEp_ssssss.jpg", - "departments": [ - "men", - "women", - "kids", - "fashion" - ], - "description": "Footwear is a garment worn on the feet to protect against environmental adversities like heat or ground textures. Example: Sports Shoes" - }, - "id": "604b221a73bfa20001cb00e8" - } - ], - "page": { - "current": 1, - "size": 26, - "has_previous": false, - "has_next": true, - "item_total": 251 - } -} -``` -
    - - - - - - - - - ---- - - -#### deleteProductBulkJob -Delete Bulk product job. - - - -```swift -catalog.deleteProductBulkJob(companyId: companyId, batchId: batchId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id of the company associated to size that is to be deleted. | -| batchId | Int | yes | Batch Id of the bulk product job to be deleted. | - - - -This API allows to delete bulk product job associated with company. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### createProductsInBulk -Create products in bulk associated with given batch Id. - - - -```swift -catalog.createProductsInBulk(companyId: companyId, batchId: batchId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id in which assets to be uploaded. | -| batchId | String | yes | Batch Id in which assets to be uploaded. | -| body | BulkProductRequest | yes | Request body | - - -This API helps to create products in bulk push to kafka for approval/creation. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getCompanyTags -Get a list of all tags associated with company. - - - -```swift -catalog.getCompanyTags(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id of the product size. | - - - -This API helps to get tags data associated to a particular copmpany. - -*Returned Response:* - - - - -[ProductTagsViewResponse](#ProductTagsViewResponse) - -Tag List. See example below for details - - - - -
    -  Example: - -```json -{ - "items": { - "tags": [ - "demo", - "custom" - ] - } -} -``` -
    - - - - - - - - - ---- - - -#### createProductAssetsInBulk -Create a Bulk asset upload Job. - - - -```swift -catalog.createProductAssetsInBulk(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id in which assets to be uploaded. | -| body | ProductBulkAssets | yes | Request body | - - -This API helps to create a bulk asset upload job. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getProductAssetsInBulk -Get a list of all bulk asset jobs. - - - -```swift -catalog.getProductAssetsInBulk(companyId: companyId, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id of the product size. | -| pageNo | Int? | no | The page number to navigate through the given set of results | -| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | - - - -This API helps to get bulk asset jobs data associated to a particular company. - -*Returned Response:* - - - - -[BulkAssetResponse](#BulkAssetResponse) - -List of bulk asset jobs List. See `BulkUtil.modify_batch_response` for details - - - - -
    -  Example: - -```json -{ - "items": [ - { - "created_on": "2021-02-25T16:45:22.425000Z", - "file_path": "https://hdn-1.fynd.com/company/61/self/documents/product-import/free/original/ZUSmmXHmZ-U8mTYx3KR-Nike-hoddie.zip", - "succeed": 1, - "cancelled_records": [], - "failed": 0, - "failed_records": [], - "stage": "completed", - "is_active": true, - "modified_by": { - "user_id": "23175373", - "username": "nikhilmhatre_gofynd_com_28085_23175373" - }, - "modified_on": "2021-02-25T16:47:24.551000Z", - "retry": 1, - "total": 1, - "company_id": 61, - "created_by": { - "user_id": "23175373", - "username": "nikhilmhatre_gofynd_com_28085_23175373", - "full_name": "nikhil mhatre" - }, - "cancelled": 0, - "tracking_url": "https://api.fynd.com/common/assets/v1/asset/status/extract-zips/3296", - "id": "6037d422aa879600015c6d1d" - } - ], - "page": { - "current": 1, - "size": 3, - "has_previous": false, - "has_next": false, - "item_total": 1 - } -} -``` -
    - - - - - - - - - ---- - - -#### deleteSize -Delete a Size associated with product. - - - -```swift -catalog.deleteSize(companyId: companyId, itemId: itemId, size: size) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id of the company associated to size that is to be deleted. | -| itemId | Int | yes | Item Id of the product associated with size to be deleted. | -| size | Int | yes | size to be deleted. | - - - -This API allows to delete size associated with product. - -*Returned Response:* - - - - -[ProductSizeDeleteResponse](#ProductSizeDeleteResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### addInventory -Add Inventory for particular size and store. - - - -```swift -catalog.addInventory(companyId: companyId, itemId: itemId, size: size, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company associated to product that is to be viewed. | -| itemId | Double | yes | Item code of the product of which size is to be get. | -| size | String | yes | Size in which inventory is to be added. | -| body | InventoryRequest | yes | Request body | - - -This API allows add Inventory for particular size and store. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getInventoryBySize -Get Inventory for company - - - -```swift -catalog.getInventoryBySize(companyId: companyId, itemId: itemId, size: size, pageNo: pageNo, pageSize: pageSize, q: q) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company associated to product that is to be viewed. | -| itemId | String | yes | Item code of the product of which size is to be get. | -| size | String | yes | Size of which inventory is to get. | -| pageNo | Int? | no | The page number to navigate through the given set of results | -| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | -| q | String? | no | Search with help of store code. | - - - -This API allows get Inventory data for particular company grouped by size and store. - -*Returned Response:* - - - - -[InventoryResponse](#InventoryResponse) - -returns a list of all inventory grouped by size and store - - - - -
    -  Example: - -```json -{ - "items": [ - { - "store": { - "name": "yosss sdd dsdyo", - "store_code": "sanic6sdfsf7", - "uid": 59, - "address": { - "state": "MAHARASHTRA", - "address1": "A/204, SAI VANDAN, NARAYAN NAGAR, TULINJ ROAD", - "lat_long": { - "type": "Point", - "coordinates": [ - 72.8231511, - 19.4232024 - ] - }, - "address2": "", - "pincode": 401209, - "country": "INDIA", - "city": "MUMBAI", - "landmark": "" - }, - "manager": { - "name": "abc", - "email": "a@b.com", - "mobile_no": { - "number": "2382634324", - "country_code": 91 - } - }, - "integration_type": { - "order": "browntape", - "inventory": "browntape" - }, - "_custom_json": {} - }, - "uid": "59_RTYUIDSDFV", - "size": "AAX1 (1 PCS)", - "inventory_updated_on": "2021-04-06T03:30:01.487000", - "seller_identifier": "RTYUIDSDFV", - "item_id": 7500651, - "quantity": 10, - "price": 1234, - "price_effective": 1234, - "price_transfer": 0, - "currency": "INR", - "sellable_quantity": 10, - "identifiers": [ - { - "gtin_type": "sku_code", - "gtin_value": "RTYUIDSDFV", - "primary": true - } - ] - }, - { - "store": { - "name": "Saran Ledonne", - "store_code": "af6198fe-2c23-4441-bbf4-e694c96e255c", - "uid": 10, - "address": { - "state": "MAHA", - "address1": "NO", - "lat_long": { - "type": "Point", - "coordinates": [ - 1, - 1 - ] - }, - "address2": "", - "pincode": 400072, - "country": "INDIA", - "city": "MUMBAI" - }, - "manager": { - "name": "abc", - "email": "rehman@cashkart.com", - "mobile_no": { - "number": "9167943983", - "country_code": 91 - } - }, - "integration_type": { - "order": "browntape", - "inventory": "browntape" - }, - "_custom_json": {} - }, - "uid": "10_RTYUIDSDFV", - "size": "AAX1 (1 PCS)", - "inventory_updated_on": "2021-04-06T03:29:35.291000", - "seller_identifier": "RTYUIDSDFV", - "item_id": 7500651, - "quantity": 10, - "price": 1234, - "price_effective": 1234, - "price_transfer": 0, - "currency": "INR", - "sellable_quantity": 10, - "identifiers": [ - { - "gtin_type": "sku_code", - "gtin_value": "RTYUIDSDFV", - "primary": true - } - ] - }, - { - "store": { - "name": "ABC-1-17", - "store_code": "ABC-1-17", - "uid": 11061, - "address": { - "state": "MAHARASHTRA", - "address1": "14/1, VINOBHA BHAVE NAGAR", - "lat_long": { - "type": "Point", - "coordinates": [ - 1, - 1 - ] - }, - "address2": "VINOBHA BHAVE NAGAR, KURLA WEST, KURLA, ", - "pincode": 400070, - "country": "INDIA", - "city": "MUMBAI" - }, - "manager": { - "name": "Fahim", - "email": "fahimsakri@gofynd.com", - "mobile_no": { - "number": "9594495254", - "country_code": 91 - } - }, - "integration_type": { - "order": "browntape", - "inventory": "browntape" - }, - "_custom_json": {} - }, - "uid": "11061_RTYUIDSDFV", - "size": "AAX1 (1 PCS)", - "inventory_updated_on": "2021-03-17T12:35:29.992000", - "seller_identifier": "RTYUIDSDFV", - "item_id": 7500651, - "quantity": 10000000, - "price": 1234, - "price_effective": 1234, - "price_transfer": 0, - "currency": "INR", - "sellable_quantity": 10000000, - "order_committed_quantity": 0, - "identifiers": [ - { - "gtin_type": "sku_code", - "gtin_value": "RTYUIDSDFV", - "primary": true - } - ] - }, - { - "store": { - "name": "RRL01", - "store_code": "WH_8513", - "uid": 1, - "address": { - "state": "MAHARASHTRA", - "address1": "SHOPSENSE RETAIL TECHNOLOGIES PRIVATE LIMITED 1ST FLOOR WEWORK VIJAY DIAMOND, CROSS RD B, AJIT NAGAR,", - "lat_long": { - "type": "Point", - "coordinates": [ - 72.8691788, - 19.1174114 - ] - }, - "address2": "KONDIVITA, ANDHERI EAST, MUMBAI, MAHARASHTRA 400069", - "pincode": 400059, - "country": "INDIA", - "city": "MUMBAI" - }, - "manager": { - "name": "ASHISH CHANDORKAR", - "email": "ASHISHCHANDORKAR@FYND.COM", - "mobile_no": { - "number": "8369782851", - "country_code": 91 - } - }, - "integration_type": { - "order": "browntape", - "inventory": "browntape" - }, - "_custom_json": {} - }, - "uid": "1_RTYUIDSDFV", - "size": "AAX1 (1 PCS)", - "inventory_updated_on": "2021-03-31T19:00:10.943000", - "seller_identifier": "RTYUIDSDFV", - "item_id": 7500651, - "quantity": 39, - "price": 1234, - "price_effective": 1234, - "price_transfer": 0, - "currency": "INR", - "sellable_quantity": 18, - "order_committed_quantity": 7, - "not_available_quantity": 0, - "damaged_quantity": 0, - "identifiers": [ - { - "gtin_type": "sku_code", - "gtin_value": "RTYUIDSDFV", - "primary": true - } - ] - }, - { - "store": { - "name": "RRL01", - "store_code": "WH_8513", - "uid": 1, - "address": { - "state": "MAHARASHTRA", - "address1": "SHOPSENSE RETAIL TECHNOLOGIES PRIVATE LIMITED 1ST FLOOR WEWORK VIJAY DIAMOND, CROSS RD B, AJIT NAGAR,", - "lat_long": { - "type": "Point", - "coordinates": [ - 72.8691788, - 19.1174114 - ] - }, - "address2": "KONDIVITA, ANDHERI EAST, MUMBAI, MAHARASHTRA 400069", - "pincode": 400059, - "country": "INDIA", - "city": "MUMBAI" - }, - "manager": { - "name": "ASHISH CHANDORKAR", - "email": "ASHISHCHANDORKAR@FYND.COM", - "mobile_no": { - "number": "8369782851", - "country_code": 91 - } - }, - "integration_type": { - "order": "browntape", - "inventory": "browntape" - }, - "_custom_json": {} - }, - "uid": "1_rtyuidsdfv", - "size": "AAX1 (1 PCS)", - "inventory_updated_on": "2020-07-07T10:37:06.146000", - "seller_identifier": "RTYUIDSDFV", - "item_id": 7500651, - "quantity": 39, - "price": 1234, - "price_effective": 1234, - "price_transfer": 0, - "currency": "INR", - "sellable_quantity": 0, - "order_committed_quantity": 39, - "identifiers": [ - { - "gtin_type": "sku_code", - "gtin_value": "RTYUIDSDFV", - "primary": true - } - ] - } - ], - "page": { - "type": "number", - "current": 1, - "size": 1, - "item_total": 5, - "has_previous": false, - "has_next": false - } -} -``` -
    - - - - - - - - - ---- - - -#### getInventoryBySizeIdentifier -Get Inventory for company - - - -```swift -catalog.getInventoryBySizeIdentifier(companyId: companyId, itemId: itemId, sizeIdentifier: sizeIdentifier, pageNo: pageNo, pageSize: pageSize, q: q, locationIds: locationIds) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company associated to product that is to be viewed. | -| itemId | String | yes | Item code of the product of which size is to be get. | -| sizeIdentifier | String | yes | Size Identifier (Seller Identifier or Primary Identifier) of which inventory is to get. | -| pageNo | Int? | no | The page number to navigate through the given set of results | -| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | -| q | String? | no | Search with help of store code. | -| locationIds | [Int]? | no | Search by store ids. | - - - -This API allows get Inventory data for particular company grouped by size and store. - -*Returned Response:* - - - - -[InventoryResponse](#InventoryResponse) - -returns a list of all inventory grouped by size and store - - - - -
    -  Example: - -```json -{ - "items": [ - { - "store": { - "name": "yosss sdd dsdyo", - "store_code": "sanic6sdfsf7", - "uid": 59, - "address": { - "state": "MAHARASHTRA", - "address1": "A/204, SAI VANDAN, NARAYAN NAGAR, TULINJ ROAD", - "lat_long": { - "type": "Point", - "coordinates": [ - 72.8231511, - 19.4232024 - ] - }, - "address2": "", - "pincode": 401209, - "country": "INDIA", - "city": "MUMBAI", - "landmark": "" - }, - "manager": { - "name": "abc", - "email": "a@b.com", - "mobile_no": { - "number": "2382634324", - "country_code": 91 - } - }, - "integration_type": { - "order": "browntape", - "inventory": "browntape" - }, - "_custom_json": {} - }, - "uid": "59_RTYUIDSDFV", - "size": "AAX1 (1 PCS)", - "inventory_updated_on": "2021-04-06T03:30:01.487000", - "seller_identifier": "RTYUIDSDFV", - "item_id": 7500651, - "quantity": 10, - "price": 1234, - "price_effective": 1234, - "price_transfer": 0, - "currency": "INR", - "sellable_quantity": 10, - "identifiers": [ - { - "gtin_type": "sku_code", - "gtin_value": "RTYUIDSDFV", - "primary": true - } - ] - }, - { - "store": { - "name": "Saran Ledonne", - "store_code": "af6198fe-2c23-4441-bbf4-e694c96e255c", - "uid": 10, - "address": { - "state": "MAHA", - "address1": "NO", - "lat_long": { - "type": "Point", - "coordinates": [ - 1, - 1 - ] - }, - "address2": "", - "pincode": 400072, - "country": "INDIA", - "city": "MUMBAI" - }, - "manager": { - "name": "abc", - "email": "rehman@cashkart.com", - "mobile_no": { - "number": "9167943983", - "country_code": 91 - } - }, - "integration_type": { - "order": "browntape", - "inventory": "browntape" - }, - "_custom_json": {} - }, - "uid": "10_RTYUIDSDFV", - "size": "AAX1 (1 PCS)", - "inventory_updated_on": "2021-04-06T03:29:35.291000", - "seller_identifier": "RTYUIDSDFV", - "item_id": 7500651, - "quantity": 10, - "price": 1234, - "price_effective": 1234, - "price_transfer": 0, - "currency": "INR", - "sellable_quantity": 10, - "identifiers": [ - { - "gtin_type": "sku_code", - "gtin_value": "RTYUIDSDFV", - "primary": true - } - ] - }, - { - "store": { - "name": "ABC-1-17", - "store_code": "ABC-1-17", - "uid": 11061, - "address": { - "state": "MAHARASHTRA", - "address1": "14/1, VINOBHA BHAVE NAGAR", - "lat_long": { - "type": "Point", - "coordinates": [ - 1, - 1 - ] - }, - "address2": "VINOBHA BHAVE NAGAR, KURLA WEST, KURLA, ", - "pincode": 400070, - "country": "INDIA", - "city": "MUMBAI" - }, - "manager": { - "name": "Fahim", - "email": "fahimsakri@gofynd.com", - "mobile_no": { - "number": "9594495254", - "country_code": 91 - } - }, - "integration_type": { - "order": "browntape", - "inventory": "browntape" - }, - "_custom_json": {} - }, - "uid": "11061_RTYUIDSDFV", - "size": "AAX1 (1 PCS)", - "inventory_updated_on": "2021-03-17T12:35:29.992000", - "seller_identifier": "RTYUIDSDFV", - "item_id": 7500651, - "quantity": 10000000, - "price": 1234, - "price_effective": 1234, - "price_transfer": 0, - "currency": "INR", - "sellable_quantity": 10000000, - "order_committed_quantity": 0, - "identifiers": [ - { - "gtin_type": "sku_code", - "gtin_value": "RTYUIDSDFV", - "primary": true - } - ] - }, - { - "store": { - "name": "RRL01", - "store_code": "WH_8513", - "uid": 1, - "address": { - "state": "MAHARASHTRA", - "address1": "SHOPSENSE RETAIL TECHNOLOGIES PRIVATE LIMITED 1ST FLOOR WEWORK VIJAY DIAMOND, CROSS RD B, AJIT NAGAR,", - "lat_long": { - "type": "Point", - "coordinates": [ - 72.8691788, - 19.1174114 - ] - }, - "address2": "KONDIVITA, ANDHERI EAST, MUMBAI, MAHARASHTRA 400069", - "pincode": 400059, - "country": "INDIA", - "city": "MUMBAI" - }, - "manager": { - "name": "ASHISH CHANDORKAR", - "email": "ASHISHCHANDORKAR@FYND.COM", - "mobile_no": { - "number": "8369782851", - "country_code": 91 - } - }, - "integration_type": { - "order": "browntape", - "inventory": "browntape" - }, - "_custom_json": {} - }, - "uid": "1_RTYUIDSDFV", - "size": "AAX1 (1 PCS)", - "inventory_updated_on": "2021-03-31T19:00:10.943000", - "seller_identifier": "RTYUIDSDFV", - "item_id": 7500651, - "quantity": 39, - "price": 1234, - "price_effective": 1234, - "price_transfer": 0, - "currency": "INR", - "sellable_quantity": 18, - "order_committed_quantity": 7, - "not_available_quantity": 0, - "damaged_quantity": 0, - "identifiers": [ - { - "gtin_type": "sku_code", - "gtin_value": "RTYUIDSDFV", - "primary": true - } - ] - }, - { - "store": { - "name": "RRL01", - "store_code": "WH_8513", - "uid": 1, - "address": { - "state": "MAHARASHTRA", - "address1": "SHOPSENSE RETAIL TECHNOLOGIES PRIVATE LIMITED 1ST FLOOR WEWORK VIJAY DIAMOND, CROSS RD B, AJIT NAGAR,", - "lat_long": { - "type": "Point", - "coordinates": [ - 72.8691788, - 19.1174114 - ] - }, - "address2": "KONDIVITA, ANDHERI EAST, MUMBAI, MAHARASHTRA 400069", - "pincode": 400059, - "country": "INDIA", - "city": "MUMBAI" - }, - "manager": { - "name": "ASHISH CHANDORKAR", - "email": "ASHISHCHANDORKAR@FYND.COM", - "mobile_no": { - "number": "8369782851", - "country_code": 91 - } - }, - "integration_type": { - "order": "browntape", - "inventory": "browntape" - }, - "_custom_json": {} - }, - "uid": "1_rtyuidsdfv", - "size": "AAX1 (1 PCS)", - "inventory_updated_on": "2020-07-07T10:37:06.146000", - "seller_identifier": "RTYUIDSDFV", - "item_id": 7500651, - "quantity": 39, - "price": 1234, - "price_effective": 1234, - "price_transfer": 0, - "currency": "INR", - "sellable_quantity": 0, - "order_committed_quantity": 39, - "identifiers": [ - { - "gtin_type": "sku_code", - "gtin_value": "RTYUIDSDFV", - "primary": true - } - ] - } - ], - "page": { - "type": "number", - "current": 1, - "size": 1, - "item_total": 5, - "has_previous": false, - "has_next": false - } -} -``` -
    - - - - - - - - - ---- - - -#### deleteInventory -Delete a Inventory. - - - -```swift -catalog.deleteInventory(companyId: companyId, size: size, itemId: itemId, locationId: locationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id of the company associated with Inventory that is to be deleted. | -| size | String | yes | size that is to be deleted. | -| itemId | Int | yes | Id of the product associated with Inventory to be deleted. | -| locationId | Double | yes | Location ID of store of which inventory is to be deleted. | - - - -This API allows to delete inventory of a particular product for particular company. - -*Returned Response:* - - - - -[InventoryDelete](#InventoryDelete) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### createBulkInventoryJob -Create a Bulk Inventory upload Job. - - - -```swift -catalog.createBulkInventoryJob(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id in which Inventory to be uploaded. | -| body | BulkJob | yes | Request body | - - -This API helps to create a bulk Inventory upload job. - -*Returned Response:* - - - - -[CommonResponse](#CommonResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getInventoryBulkUploadHistory -Get a list of all bulk Inventory upload jobs. - - - -```swift -catalog.getInventoryBulkUploadHistory(companyId: companyId, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id of of which Inventory Bulk Upload History to be obtained. | -| pageNo | Int? | no | The page number to navigate through the given set of results | -| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | - - - -This API helps to get bulk Inventory upload jobs data. - -*Returned Response:* - - - - -[BulkInventoryGet](#BulkInventoryGet) - -List of bulk Inventory upload jobs. See `BulkInventoryGetSchema` for details - - - - -
    -  Example: - -```json -{ - "items": [ - { - "succeed": 1, - "stage": "completed", - "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/50DbgKLND-NtnL_EAVb-REicn1sDv-V8ZrKdnLt-product_inventory.csv", - "created_on": "2021-03-11T10:54:44.998000Z", - "cancelled_records": [], - "created_by": { - "username": "nikhilmhatre_gofynd_com_97636", - "user_id": "16", - "full_name": "Nikhil Mhatre" - }, - "modified_on": "2021-03-11T10:54:45.296000Z", - "cancelled": 0, - "failed": 0, - "modified_by": { - "user_id": "0", - "username": "Silverbolt" - }, - "company_id": 1, - "total": 1, - "is_active": true, - "failed_records": [], - "id": "6049f6f5723043000125a9ea" - }, - { - "created_by": { - "username": "silverbolt", - "user_id": "-1" - }, - "cancelled": 0, - "modified_by": { - "username": "Silverbolt", - "user_id": "0" - }, - "created_on": "2021-03-04T09:46:51.714000Z", - "company_id": 1, - "failed": 0, - "failed_records": [], - "succeed": 1, - "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/NtnL_EAVb-REicn1sDv-V8ZrKdnLt-product_inventory.csv", - "cancelled_records": [], - "total": 1, - "is_active": true, - "modified_on": "2021-03-04T09:46:55.349000Z", - "stage": "completed", - "id": "6040ac8b1803830001fcc1ed" - }, - { - "company_id": 1, - "failed": 0, - "modified_by": { - "user_id": "-1", - "username": "silverbolt" - }, - "cancelled": 0, - "is_active": true, - "cancelled_records": [], - "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/bmBZY9iAX-REicn1sDv-V8ZrKdnLt-product_inventory.csv", - "created_by": { - "user_id": "-1", - "username": "silverbolt" - }, - "modified_on": "2021-03-04T09:22:32.222000Z", - "succeed": 0, - "failed_records": [], - "stage": "terminated", - "created_on": "2021-03-04T09:22:32.222000Z", - "total": 1, - "id": "6040a6d8104f110001a85061" - }, - { - "company_id": 1, - "failed": 0, - "modified_by": { - "user_id": "-1", - "username": "silverbolt" - }, - "cancelled": 0, - "is_active": true, - "cancelled_records": [], - "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/m73yWRT3v-REicn1sDv-V8ZrKdnLt-product_inventory.csv", - "created_by": { - "user_id": "-1", - "username": "silverbolt" - }, - "modified_on": "2021-03-04T09:20:29.719000Z", - "succeed": 0, - "failed_records": [], - "stage": "terminated", - "created_on": "2021-03-04T09:20:29.719000Z", - "total": 1, - "id": "6040a65d104f110001a85060" - }, - { - "created_on": "2021-03-04T08:50:49.367000Z", - "cancelled_records": [], - "failed_records": [], - "succeed": 0, - "cancelled": 0, - "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/W9lxe19Uu-REicn1sDv-V8ZrKdnLt-product_inventory.csv", - "total": 1, - "created_by": { - "username": "silverbolt", - "user_id": "-1" - }, - "is_active": true, - "modified_by": { - "username": "silverbolt", - "user_id": "-1" - }, - "company_id": 1, - "failed": 0, - "modified_on": "2021-03-04T08:50:49.367000Z", - "stage": "terminated", - "id": "60409f699b21e30001c1e6b5" - }, - { - "total": 1, - "succeed": 1, - "created_on": "2021-02-10T10:57:57.236000Z", - "failed": 0, - "modified_by": { - "user_id": "0", - "username": "Silverbolt" - }, - "created_by": { - "username": "917972410891_48194", - "user_id": "5646", - "full_name": "Sourabh Nilakhe" - }, - "is_active": true, - "cancelled_records": [], - "failed_records": [], - "company_id": 1, - "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/REicn1sDv-V8ZrKdnLt-product_inventory.csv", - "modified_on": "2021-02-10T10:57:57.571000Z", - "stage": "completed", - "cancelled": 0, - "id": "6023bc35c85ca1000171e08a" - }, - { - "total": 1, - "succeed": 1, - "created_on": "2021-02-10T10:57:22.535000Z", - "failed": 0, - "modified_by": { - "user_id": "0", - "username": "Silverbolt" - }, - "created_by": { - "username": "917972410891_48194", - "user_id": "5646", - "full_name": "Sourabh Nilakhe" - }, - "is_active": true, - "cancelled_records": [], - "failed_records": [], - "company_id": 1, - "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/Oth_LaVyI-V8ZrKdnLt-product_inventory.csv", - "modified_on": "2021-02-10T10:57:23.311000Z", - "stage": "completed", - "cancelled": 0, - "id": "6023bc12c85ca1000171e089" - }, - { - "created_by": { - "user_id": "16", - "username": "nikhilmhatre_gofynd_com_97636", - "full_name": "Nikhil Mhatre" - }, - "succeed": 1, - "failed": 0, - "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/V8ZrKdnLt-product_inventory.csv", - "company_id": 1, - "created_on": "2021-01-13T13:58:06.155000Z", - "stage": "completed", - "modified_by": { - "username": "Silverbolt", - "user_id": "0" - }, - "is_active": true, - "total": 1, - "failed_records": [], - "modified_on": "2021-01-13T13:58:06.369000Z", - "cancelled_records": [], - "cancelled": 0, - "id": "5ffefc6ee2db8f000183fab8" - }, - { - "succeed": 0, - "is_active": true, - "cancelled": 0, - "failed_records": [ - { - "identifiers": "1.91887E+11", - "message": "Invalid identifier: 1.91887E+11. Product not found." - } - ], - "total": 1, - "stage": "failed", - "modified_by": { - "username": "Silverbolt", - "user_id": "0" - }, - "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/t3T6X2Riy-product_inventory.csv", - "cancelled_records": [], - "created_by": { - "username": "nikhilmhatre_gofynd_com_97636", - "user_id": "16", - "full_name": "Nikhil Mhatre" - }, - "created_on": "2021-01-13T13:57:38.598000Z", - "company_id": 1, - "failed": 1, - "modified_on": "2021-01-13T13:57:38.832000Z", - "id": "5ffefc5252f31100012ea981" - }, - { - "total": 1, - "company_id": 1, - "created_by": { - "user_id": "16", - "username": "nikhilmhatre_gofynd_com_97636", - "full_name": "Nikhil Mhatre" - }, - "failed": 1, - "modified_on": "2021-01-13T13:57:13.847000Z", - "succeed": 0, - "stage": "failed", - "cancelled_records": [], - "failed_records": [ - { - "identifiers": "1.91887E+11", - "message": "Invalid identifier: 1.91887E+11. Product not found." - } - ], - "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/NSTuhgsgq-product_inventory.csv", - "is_active": true, - "created_on": "2021-01-13T13:57:13.639000Z", - "cancelled": 0, - "modified_by": { - "username": "Silverbolt", - "user_id": "0" - }, - "id": "5ffefc39a0d1e20001ae118c" - }, - { - "succeed": 1, - "failed": 0, - "failed_records": [], - "cancelled": 0, - "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/cwQV-Z6gT-product_inventory.xlsx", - "created_on": "2021-01-12T06:37:06.167000Z", - "is_active": true, - "cancelled_records": [], - "created_by": { - "user_id": "16", - "username": "nikhilmhatre_gofynd_com_97636", - "full_name": "Nikhil Mhatre" - }, - "company_id": 1, - "stage": "completed", - "modified_by": { - "username": "Silverbolt", - "user_id": "0" - }, - "modified_on": "2021-01-12T06:37:06.307000Z", - "total": 1, - "id": "5ffd4392b4c34d000170697b" - }, - { - "succeed": 1, - "failed": 0, - "failed_records": [], - "cancelled": 0, - "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/gccehef2f-product_inventory.xlsx", - "created_on": "2021-01-12T06:36:24.292000Z", - "is_active": true, - "cancelled_records": [], - "created_by": { - "user_id": "16", - "username": "nikhilmhatre_gofynd_com_97636", - "full_name": "Nikhil Mhatre" - }, - "company_id": 1, - "stage": "completed", - "modified_by": { - "username": "Silverbolt", - "user_id": "0" - }, - "modified_on": "2021-01-12T06:36:24.535000Z", - "total": 1, - "id": "5ffd4368b4c34d0001706960" - } - ], - "page": { - "type": "number", - "current": 1, - "size": 4, - "item_total": 39, - "has_previous": false, - "has_next": true - } -} -``` -
    - - - - - - - - - ---- - - -#### deleteBulkInventoryJob -Delete Bulk Inventory job. - - - -```swift -catalog.deleteBulkInventoryJob(companyId: companyId, batchId: batchId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id of the company of which bulk Inventory job is to be deleted. | -| batchId | String | yes | Batch Id of the bulk delete job. | - - - -This API allows to delete bulk Inventory job associated with company. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### createBulkInventory -Create products in bulk associated with given batch Id. - - - -```swift -catalog.createBulkInventory(companyId: companyId, batchId: batchId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id in which Inventory is to be uploaded. | -| batchId | String | yes | Batch Id of the bulk create job. | -| body | InventoryBulkRequest | yes | Request body | - - -This API helps to create products in bulk push to kafka for approval/creation. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### createInventoryExportJob -Create a Inventory export Job. - - - -```swift -catalog.createInventoryExportJob(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id in which assets to be uploaded. | -| body | InventoryExportRequest | yes | Request body | - - -This API helps to create a Inventory export job. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getInventoryExport -Get Inventory export history. - - - -```swift -catalog.getInventoryExport(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id in which assets to be uploaded. | - - - -This API helps to get Inventory export history. - -*Returned Response:* - - - - -[InventoryExportJob](#InventoryExportJob) - -Returns a list of inventory export jobs - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### exportInventoryConfig -Get List of different filters for inventory export - - - -```swift -catalog.exportInventoryConfig(companyId: companyId, filterType: filterType) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company associated to product that is to be viewed. | -| filterType | String? | no | filter type from any one of ['brand', 'store', 'type'] | - - - -This API allows get List of different filters like brand, store, and type for inventory export. - -*Returned Response:* - - - - -[InventoryConfig](#InventoryConfig) - -returns filters configuration for inventory export - - - - -
    -  Example: - -```json -[ - { - "display": "csv", - "value": "csv" - }, - { - "display": "excel", - "value": "excel" - } -] -``` -
    - - - - - - - - - ---- - - -#### createHsnCode -Create Hsn Code. - - - -```swift -catalog.createHsnCode(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| body | HsnUpsert | yes | Request body | - - -Create Hsn Code. - -*Returned Response:* - - - - -[HsnCode](#HsnCode) - -See example below for details - - - - -
    -  Example: - -```json -{ - "data": { - "company_id": 1, - "hs2_code": "xx", - "modified_by": { - "username": "narutouzumaki", - "user_id": "0" - }, - "id": "xxxxxxxxxxxx", - "tax_on": "esp", - "slabs": [ - { - "tax": 0, - "threshold": 999999 - }, - { - "tax": 0, - "threshold": 0 - } - ], - "hsn_code": "xxxxxxxx" - } -} -``` -
    - - - - - - - - - ---- - - -#### getAllHsnCodes -Hsn Code List. - - - -```swift -catalog.getAllHsnCodes(companyId: companyId, pageNo: pageNo, pageSize: pageSize, q: q) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| pageNo | Int? | no | page no | -| pageSize | Int? | no | page size | -| q | String? | no | search using hsn code. | - - - -Hsn Code List. - -*Returned Response:* - - - - -[HsnCodesListingResponse](#HsnCodesListingResponse) - -List of all HSN Codes. See example below or refer `HsnCodesListingResponseSchema` for details - - - - -
    -  Example: - -```json -{ - "items": [ - { - "company_id": 1, - "hs2_code": "xx", - "hsn_code": "xxxxxxxx", - "tax1": 0, - "tax2": 0, - "threshold1": 999999, - "threshold2": 0, - "tax_on_esp": true, - "tax_on_mrp": false, - "id": "xxxxxxxxxxxx" - } - ], - "page": { - "current": 1, - "size": 2, - "has_previous": false, - "has_next": true, - "item_total": 20 - } -} -``` -
    - - - - - - - - - ---- - - -#### updateHsnCode -Update Hsn Code. - - - -```swift -catalog.updateHsnCode(companyId: companyId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| id | String | yes | Unique id | -| body | HsnUpsert | yes | Request body | - - -Update Hsn Code. - -*Returned Response:* - - - - -[HsnCode](#HsnCode) - -See example below for details - - - - -
    -  Example: - -```json -{ - "data": { - "company_id": 1, - "hs2_code": "xx", - "modified_by": { - "username": "narutouzumaki", - "user_id": "0" - }, - "id": "xxxxxxxxxxxx", - "tax_on": "esp", - "slabs": [ - { - "tax": 0, - "threshold": 999999 - }, - { - "tax": 0, - "threshold": 0 - } - ], - "hsn_code": "xxxxxxxx" - } -} -``` -
    - - - - - - - - - ---- - - -#### getHsnCode -Fetch Hsn Code. - - - -```swift -catalog.getHsnCode(companyId: companyId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| id | String | yes | Unique id | - - - -Fetch Hsn Code. - -*Returned Response:* - - - - -[HsnCode](#HsnCode) - -See example below details - - - - -
    -  Example: - -```json -{ - "data": { - "company_id": 1, - "hs2_code": "xx", - "modified_by": { - "username": "narutouzumaki", - "user_id": "0" - }, - "id": "xxxxxxxxxxxx", - "tax_on": "esp", - "slabs": [ - { - "tax": 0, - "threshold": 999999 - }, - { - "tax": 0, - "threshold": 0 - } - ], - "hsn_code": "xxxxxxxx" - } -} -``` -
    - - - - - - - - - ---- - - -#### bulkHsnCode -Bulk Create or Update Hsn Code. - - - -```swift -catalog.bulkHsnCode(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| body | BulkHsnUpsert | yes | Request body | - - -Bulk Create or Update Hsn Code. - -*Returned Response:* - - - - -[BulkHsnResponse](#BulkHsnResponse) - -See example below for details - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getApplicationBrands -List all the brands - - - -```swift -catalog.getApplicationBrands(companyId: companyId, applicationId: applicationId, department: department, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| department | String? | no | The name of the department. Use this parameter to filter products by a particular department. See below the list of available departments. You can retrieve available departments from the **v1.0/departments/** API | -| pageNo | Int? | no | The page number to navigate through the given set of results | -| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | - - - -A brand is the name under which a product is being sold. Use this API to list all the brands. You can pass optionally filter the brands by the department. If successful, returns a paginated list of brands specified in `BrandListingResponse` - -*Returned Response:* - - - - -[BrandListingResponse](#BrandListingResponse) - -List of Brands. See example below or refer `BrandListingResponse` for details - - - - -
    -  Example: - -```json -{ - "items": [ - { - "uid": 1, - "name": "Barry, Jennings and Larson", - "slug": "Hess-Inc", - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "banners": { - "portrait": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/12537_9cdfc6835e814b0986ee1643d38cf6cd.png" - } - }, - "en_name": "Barry, Jennings and Larson" - } - ], - "page": { - "current": 1, - "total": 1, - "has_previous": false, - "has_next": false, - "item_total": 1, - "type": "number" - } -} -``` -
    - - - - - - - - - ---- - - -#### getDepartments -List all the departments - - - -```swift -catalog.getDepartments(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | - - - -Departments are a way to categorise similar products. A product can lie in multiple departments. For example, a skirt can below to the 'Women's Fashion' Department while a handbag can lie in 'Women's Accessories' Department. Use this API to list all the departments. If successful, returns the list of departments specified in `DepartmentResponse` - -*Returned Response:* - - - - -[DepartmentResponse](#DepartmentResponse) - -List of Departments. See example below or refer `DepartmentResponse` for details. - - - - -
    -  Example: - -```json -{ - "items": [ - { - "uid": 1, - "name": "Zachary Harris", - "slug": "Zachary-Harris", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "uid": 2, - "name": "Aaron Reilly", - "slug": "Aaron-Reilly", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "uid": 3, - "name": "Bobby Sandoval", - "slug": "Bobby-Sandoval", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "uid": 4, - "name": "Seth Hughes", - "slug": "Seth-Hughes", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "uid": 5, - "name": "Michelle Moore", - "slug": "Michelle-Moore", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "uid": 6, - "name": "Annette Baldwin", - "slug": "Annette-Baldwin", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "uid": 7, - "name": "Chris Mata", - "slug": "Chris-Mata", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "uid": 8, - "name": "Nicole Jacobs", - "slug": "Nicole-Jacobs", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "uid": 9, - "name": "Pamela Smith", - "slug": "Pamela-Smith", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "uid": 10, - "name": "Nicole Simon", - "slug": "Nicole-Simon", - "priority_order": 7, - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getCategories -List all the categories - - - -```swift -catalog.getCategories(companyId: companyId, applicationId: applicationId, department: department) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| department | String? | no | The name of the department. Use this parameter to filter products by a particular department. See below the list of available departments. You can retrieve available departments from the **v1.0/departments/** API | - - - -List all the categories. You can optionally pass filter the brands by the department. If successful, returns a paginated list of brands specified in `CategoryListingResponse` - -*Returned Response:* - - - - -[CategoryListingResponse](#CategoryListingResponse) - -List of Categories. See example below or refer `CategoryListingResponse` for details. - - - - -
    -  Example: - -```json -{ - "departments": [ - { - "slug": "Cody-Doyle", - "uid": 1 - } - ], - "data": [ - { - "department": "Cody-Doyle", - "items": [ - { - "name": "Janet Parker", - "image": { - "aspect_ratio": "13:20", - "aspect_ratio_f": 0.65, - "url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/banner_portrait/category/resize-w:130,h:200/12064_e69e1d8b5e934d3488f0dc8663d8a158.jpg" - }, - "uid": 1, - "slug": "Janet-Parker", - "_custom_json": {}, - "action": { - "type": "category", - "url": "https://api.addsale.com/platform/content/v1/products/?l1_category=Janet-Parker&department=Jaime-Chambers", - "query": { - "l1_category": [ - "Janet-Parker" - ], - "department": [ - "Jaime-Chambers" - ] - } - }, - "childs": [ - { - "name": "Hannah Lawson", - "image": { - "aspect_ratio": "13:20", - "aspect_ratio_f": 0.65, - "url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/banner_portrait/category/resize-w:130,h:200/12064_e69e1d8b5e934d3488f0dc8663d8a158.jpg" - }, - "uid": 2, - "slug": "Hannah-Lawson", - "_custom_json": {}, - "action": { - "type": "category", - "url": "https://api.addsale.com/platform/content/v1/products/?l2_category=Hannah-Lawson&department=Jaime-Chambers", - "query": { - "l2_category": [ - "Hannah-Lawson" - ], - "department": [ - "Jaime-Chambers" - ] - } - }, - "childs": [ - { - "name": "Logan Black", - "image": { - "aspect_ratio": "13:20", - "aspect_ratio_f": 0.65, - "url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/banner_portrait/category/resize-w:130,h:200/12064_e69e1d8b5e934d3488f0dc8663d8a158.jpg" - }, - "uid": 3, - "slug": "Logan-Black", - "_custom_json": {}, - "action": { - "type": "category", - "url": "https://api.addsale.com/platform/content/v1/products/?category=Logan-Black&department=Jaime-Chambers", - "query": { - "category": [ - "Logan-Black" - ], - "department": [ - "Jaime-Chambers" - ] - } - }, - "childs": [] - } - ] - } - ] - } - ] - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getAppicationProducts -List the products - - - -```swift -catalog.getAppicationProducts(companyId: companyId, applicationId: applicationId, q: q, f: f, filters: filters, sortOn: sortOn, pageId: pageId, pageSize: pageSize, pageNo: pageNo, pageType: pageType) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| q | String? | no | The search query. This can be a partial or complete name of a either a product, brand or category | -| f | String? | no | The search filter parameters. All the parameter filtered from filter parameters will be passed in **f** parameter in this format. **?f=brand:voi-jeans||and:::category:t-shirts||shirts** | -| filters | Bool? | no | Pass `filters` parameter to fetch the filter details. This flag is used to fetch all filters | -| sortOn | String? | no | The order to sort the list of products on. The supported sort parameters are popularity, price, redemption and discount in either ascending or descending order. See the supported values below. | -| pageId | String? | no | Each response will contain **page_id** param, which should be sent back to make pagination work. | -| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | -| pageNo | Int? | no | If page_type is number then pass it to fetch page items. Default is 1. | -| pageType | String? | no | For pagination type should be cursor or number. Default is cursor. | - - - -List all the products associated with a brand, collection or category in a requested sort order. The API additionally supports arbitrary search queries that may refer the name of any product, brand, category or collection. If successful, returns a paginated list of products specified in `ApplicationProductListingResponse` - -*Returned Response:* - - - - -[ApplicationProductListingResponse](#ApplicationProductListingResponse) - -List of Products. See example below or refer `ApplicationProductListingResponse` for details - - - - -
    -  Example: - -```json -{ - "filters": [ - { - "key": { - "display": "Department", - "name": "department", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Department.svg" - }, - "values": [ - { - "display": "Debra Villarreal", - "count": 15, - "is_selected": false, - "value": "Debra-Villarreal", - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - }, - { - "display": "Tracey Miller", - "count": 15, - "is_selected": false, - "value": "Tracey-Miller", - "logo": { - "type": "image", - "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" - } - } - ] - }, - { - "key": { - "display": "Category", - "name": "category", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Category.svg" - }, - "values": [ - { - "display": "Amy Kim DDS", - "count": 15, - "is_selected": false, - "value": "3", - "logo": "http://cdn4.gofynd.com/media/banner/category/original/12063_a5bb91bd5cb44c3c9db98c2a0e6b3d99.jpg" - } - ] - }, - { - "key": { - "display": "Gender", - "name": "gender", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Gender.svg" - }, - "values": [ - { - "display": "Men", - "count": 15, - "is_selected": false, - "value": "men" - }, - { - "display": "Women", - "count": 15, - "is_selected": false, - "value": "women" - } - ] - }, - { - "key": { - "display": "Size", - "name": "sizes", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Sizes.svg" - }, - "values": [ - { - "display": "13", - "count": 15, - "is_selected": false, - "value": "13" - } - ] - }, - { - "key": { - "display": "Brand", - "name": "brand", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Brand%20ID.svg" - }, - "values": [ - { - "display": "Barry, Jennings and Larson", - "count": 15, - "is_selected": false, - "value": "1", - "logo": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - } - ] - }, - { - "key": { - "display": "Rating", - "name": "rating", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/Rating.svg" - }, - "values": [ - { - "count": 15, - "display": "2 - 3", - "value": "[2 TO 3}", - "is_selected": false - } - ] - }, - { - "key": { - "display": "Image", - "name": "image_nature", - "kind": "multivalued", - "logo": "https://hdn-1.fynd.com/global/menu-icons/image%20Nature.svg" - }, - "values": [ - { - "display": "GoodQuality", - "count": 15, - "is_selected": false, - "value": "standard" - } - ] - }, - { - "key": { - "display": "Monica Hampton", - "name": "material", - "kind": "multivalued", - "logo": "" - }, - "values": [ - { - "display": "Neoprene", - "count": 15, - "is_selected": false, - "value": "Neoprene" - } - ] - }, - { - "key": { - "display": "John Mendoza", - "name": "weight", - "kind": "multivalued", - "logo": "" - }, - "values": [ - { - "display": "100", - "count": 15, - "is_selected": false, - "value": "100" - } - ] - }, - { - "key": { - "display": "Kimberly Mcdaniel", - "name": "gender", - "kind": "multivalued", - "logo": "" - }, - "values": [ - { - "display": "['Men', 'Women']", - "count": 15, - "is_selected": false, - "value": "['Men', 'Women']" - } - ] - }, - { - "key": { - "display": "Kimberly Davidson", - "name": "color", - "kind": "multivalued", - "logo": "" - }, - "values": [ - { - "display": "Grey", - "count": 15, - "is_selected": false, - "value": "808080" - } - ] - }, - { - "key": { - "display": "Availability", - "name": "exclude_out_of_stock", - "kind": "multivalued", - "logo": "" - }, - "values": [ - { - "display": "Exclude out of Stock", - "is_selected": false, - "value": true - } - ] - } - ], - "items": [ - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "benchmark collaborative paradigms", - "slug": "benchmark-collaborative-paradigms", - "uid": 1, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "benchmark-collaborative-paradigms" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "item_code": "ITEM_CODE_1", - "rating": 2.7 - }, - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "architect granular e-business", - "slug": "architect-granular-e-business", - "uid": 10, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "architect-granular-e-business" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "item_code": "ITEM_CODE_2", - "rating": 2.7 - }, - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "facilitate enterprise supply-chains", - "slug": "facilitate-enterprise-supply-chains", - "uid": 11, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "facilitate-enterprise-supply-chains" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "item_code": "ITEM_CODE_3", - "rating": 2.7 - }, - { - "type": "product", - "attributes": { - "primary_color_hex": "808080", - "weight": "100", - "gender": "women", - "material": "Neoprene", - "primary_color": "DarkGrey" - }, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "sellable": true, - "name": "optimize web-enabled e-tailers", - "slug": "optimize-web-enabled-e-tailers", - "uid": 12, - "item_type": "set", - "brand": { - "type": "brand", - "name": "Hess Inc", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "action": { - "page": { - "type": "product", - "query": { - "slug": "optimize-web-enabled-e-tailers" - } - }, - "type": "page" - }, - "medias": [ - { - "type": "image", - "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" - } - ], - "discount": "14% OFF", - "price": { - "marked": { - "min": 1399, - "max": 1499, - "currency_code": "INR", - "currency_symbol": "₹" - }, - "effective": { - "min": 1199, - "max": 1399, - "currency_code": "INR", - "currency_symbol": "₹" - } - }, - "is_tryout": false, - "promo_meta": { - "title": "", - "subtitle": "" - }, - "item_code": "ITEM_CODE_4", - "rating": 2.7 - } - ], - "sort_on": [ - { - "display": "Latest Products.", - "name": "Latest Products.", - "logo": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/360x0/56_MKT02AI060CORAL/1_1567590349681.jpg", - "value": "latest", - "is_selected": true - } - ], - "page": { - "current": 1, - "total": 2, - "has_previous": false, - "has_next": true, - "item_total": 15, - "type": "number" - } -} -``` -
    - - - - - - - - - ---- - - -#### getProductDetailBySlug -Get a product - - - -```swift -catalog.getProductDetailBySlug(companyId: companyId, applicationId: applicationId, slug: slug) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| slug | String | yes | The unique identifier of a product. i.e; `slug` of a product. You can retrieve these from the APIs that list products like **v1.0/products/** | - - - -Products are the core resource of an application. Products can be associated by categories, collections, brands and more. This API retrieves the product specified by the given **slug**. If successful, returns a Product resource in the response body specified in `ProductDetail` - -*Returned Response:* - - - - -[ProductDetail](#ProductDetail) - -The Product object. See example below or refer `ProductDetail` for details. - - - - -
    -  Example: - -```json -{ - "type": "product", - "grouped_attributes": [ - { - "title": "Alexander Sawyer", - "details": [ - { - "key": "Kimberly Davidson", - "type": "text", - "value": "DarkGrey" - }, - { - "key": "Kimberly Mcdaniel", - "type": "text", - "value": "Men,Women" - }, - { - "key": "Monica Hampton", - "type": "text", - "value": "Neoprene" - }, - { - "key": "John Mendoza", - "type": "text", - "value": "100 g" - } - ] - } - ], - "medias": [ - { - "type": "image", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1309_LGLAPTOPSLEEVE5/1_1564735832806.jpg" - } - ], - "brand": { - "name": "Barry, Jennings and Larson", - "uid": 1, - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" - }, - "action": { - "page": { - "type": "products", - "query": { - "brand": [ - "Hess-Inc" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - }, - "uid": 1, - "slug": "benchmark-collaborative-paradigms", - "attributes": { - "color_hex": "808080", - "weight": 100, - "product_type": "LaptopBags", - "gender": [ - "Men", - "Women" - ], - "material": "Neoprene", - "style_note": "Shape up your overall appeal with this stunning laptop bag. The amazing storage and great design will let you carry your laptop in style!", - "item_code": "LGLAPTOPSLEEVE5", - "occasion": "Casual", - "primary_color": "Grey", - "primary_material": "Others", - "variant": "LGLAPTOPSLEEVE5", - "color": "DarkGrey", - "product_details": "This is a Unisex Product.", - "primary_color_hex": "808080", - "brand": "Barry, Jennings and Larson" - }, - "name": "benchmark collaborative paradigms", - "has_variant": true, - "categories": [ - { - "id": 3, - "uid": 3, - "name": "Amy Kim DDS", - "logo": { - "type": "image", - "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" - }, - "action": { - "page": { - "type": "category", - "query": { - "category": [ - "Amy-Kim-DDS" - ] - } - }, - "type": "page" - }, - "_custom_json": {} - } - ], - "tryouts": [], - "rating": 2.7, - "rating_count": 2, - "image_nature": "standard", - "tags": [ - "Digital" - ], - "teaser_tag": {}, - "no_of_boxes": 1, - "product_online_date": "2021-02-03T07:22:29Z", - "custom_order": {}, - "color": "808080", - "similars": [ - "brand" - ] -} -``` -
    - - - - - - - - - ---- - - -#### getAppProducts -Get applicationwise products - - - -```swift -catalog.getAppProducts(companyId: companyId, applicationId: applicationId, brandIds: brandIds, categoryIds: categoryIds, departmentIds: departmentIds, pageNo: pageNo, pageSize: pageSize, q: q) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| applicationId | String | yes | A `application_id` is a unique identifier for a particular sale channel. | -| brandIds | [Int]? | no | Get multiple products filtered by Brand Ids | -| categoryIds | [Int]? | no | Get multiple products filtered by Category Ids | -| departmentIds | [Int]? | no | Get multiple products filtered by Department Ids | -| pageNo | Int? | no | The page number to navigate through the given set of results | -| pageSize | Int? | no | Number of items to retrieve in each page. Default is 10. | -| q | String? | no | Search with Item Code, Name, Slug or Identifier. | - - - -Products are the core resource of an application. Products can be associated by categories, collections, brands and more. If successful, returns a Product resource in the response body specified in `ApplicationProductListingResponseDatabasePowered` - -*Returned Response:* - - - - -[ProductListingResponse](#ProductListingResponse) - -The Product object. See example below or refer `ApplicationProductListingResponseDatabasePowered` for details. - - - - -
    -  Example: - -```json -{ - "items": [ - { - "name": "TV Set", - "description": "Tv", - "country_of_origin": "India", - "currency": "INR", - "short_description": "", - "is_set": true, - "item_code": "TVSET111", - "brand_uid": 1, - "template_tag": "television", - "highlights": [ - "42 Inch" - ], - "slug": "tv-set", - "_custom_json": {}, - "l3_mapping": [ - "electronics>qled_television" - ], - "image_nature": "standard", - "departments": [ - 1 - ], - "created_on": 1599024995, - "created_by": { - "username": "919049753052_37528", - "user_id": "5" - }, - "modified_on": 1627642010, - "modified_by": { - "username": "xxxxxxxxxx", - "user_id": "xxxxxxxxxxx" - }, - "stage": "verified", - "uid": 7501547, - "verified_by": { - "username": "Silverbolt", - "user_id": "0" - }, - "verified_on": 1626965521, - "all_sizes": [ - { - "item_code": "TVSET111", - "brand_uid": 1, - "seller_identifier": "HGS272727272", - "identifiers": [ - { - "gtin_type": "ean", - "gtin_value": "HGS272727272", - "primary": true - } - ], - "company_id": 1, - "size": "XXLX23, MX11, LX67, XLX45 (146 PCS)", - "marked_price": 35000 - } - ], - "category_slug": "qled-television", - "is_image_less_product": false, - "media": [ - { - "url": "https://hdn-1.addsale.com/x0/products/pictures/item/free/135x0/dcizgsG_Y-Tv-Set.png", - "type": "image" - } - ], - "variants": {}, - "product_publish": { - "is_set": false, - "product_online_date": 1627642009 - }, - "is_dependent": false, - "is_physical": true, - "item_type": "set", - "category_uid": 1, - "custom_order": { - "manufacturing_time": 2, - "is_custom_order": true, - "manufacturing_time_unit": "days" - }, - "moq": { - "minimum": 1, - "is_set": false - }, - "multi_size": true, - "no_of_boxes": 1, - "product_group_tag": [], - "size_guide": "slim-fit-shirts-for-men", - "tags": [], - "teaser_tag": {}, - "synonyms": [], - "hsn_code": "11111111", - "return_config": { - "unit": "days", - "returnable": false, - "time": 0 - }, - "all_company_ids": [ - 1 - ], - "all_identifiers": [ - "19WE100" - ], - "trader": { - "address": "sdfdsfsdf", - "name": "asdasd" - }, - "trader_type": "Packer", - "verification_status": "pending", - "sizes": [ - { - "size": "FGX33, GHX33 (66 PCS)", - "store_count": 1 - }, - { - "size": "XSE WE23X100 (100 PCS)", - "store_count": 2 - }, - { - "size": "XSEX100 (100 PCS)", - "store_count": 3 - }, - { - "size": "XXLX23, MX11, LX67, XLX45 (146 PCS)", - "store_count": 3 - } - ], - "id": "5f4f2f6371a5970001f13655", - "brand": { - "name": "Apple", - "logo": { - "aspect_ratio": "1:1", - "aspect_ratio_f": 1, - "url": "https://hdn-1.jiox0.de/jioecomm/seller/pictures/logo/50x0/apple-7f951c/logo_apple.png", - "secure_url": "https://hdn-1.jiox0.de/jioecomm/seller/pictures/logo/50x0/apple-7f951c/logo_apple.png" - }, - "uid": 13 - }, - "images": [ - { - "aspect_ratio": "16:25", - "aspect_ratio_f": 0.64, - "url": "https://hdn-1.addsale.com/x0/products/pictures/item/free/135x0/dcizgsG_Y-Tv-Set.png", - "secure_url": "https://hdn-1.addsale.com/x0/products/pictures/item/free/135x0/dcizgsG_Y-Tv-Set.png" - } - ], - "price": { - "marked": { - "min": 35000, - "max": 35000 - }, - "effective": { - "min": 25000, - "max": 25000 - } - } - } - ], - "page": { - "type": "number", - "current": 1, - "size": 1, - "item_total": 1, - "has_previous": false, - "has_next": false - } -} -``` -
    - - - - - - - - - ---- - - - - -## CompanyProfile - - -#### cbsOnboardGet -Get company profile - - - -```swift -companyprofile.cbsOnboardGet(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | - - - -This API allows to view the company profile of the seller account. - -*Returned Response:* - - - - -[GetCompanyProfileSerializerResponse](#GetCompanyProfileSerializerResponse) - -Company profile object. See example below or refer `GetCompanyProfileSerializerResponse` for details - - - - -
    -  Example: - -```json -{ - "documents": [ - { - "verified": true, - "legal_name": "SHOPSENSE RETAIL TECHNOLOGIES PRIVATE LIMITED", - "value": "AALCA0442L", - "type": "pan" - } - ], - "created_by": { - "user_id": "123", - "username": "917827311650_22960" - }, - "business_info": "I sell", - "franchise_enabled": true, - "company_type": "mbo", - "warnings": {}, - "business_details": { - "website": { - "url": "https://www.google.com" - } - }, - "addresses": [ - { - "country": "India", - "longitude": 72.8231511, - "state": "Maharashtra", - "address1": "A/204, Sai Vandan, Tulinj Road. Nallasopara East, ", - "country_code": "IN", - "latitude": 19.4232024, - "pincode": 401209, - "address_type": "office", - "city": "Mumbai" - }, - { - "country": "India", - "longitude": 72.8231511, - "state": "Maharashtra", - "address1": "A/204, Sai Vandan, Tulinj Road. Nallasopara East, ", - "country_code": "IN", - "latitude": 19.4232024, - "pincode": 401209, - "address_type": "registered", - "city": "Mumbai" - } - ], - "modified_by": { - "user_id": "123", - "username": "917827311650_22960" - }, - "notification_emails": [ - "gaurangpatel@gofynd.com" - ], - "business_type": "huf", - "name": "Cache Company", - "stage": "verified", - "uid": 1, - "business_country_info": { - "country": "India", - "country_code": "IN" - } -} -``` -
    - - - - - - - - - ---- - - -#### updateCompany -Edit company profile - - - -```swift -companyprofile.updateCompany(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | -| body | UpdateCompany | yes | Request body | - - -This API allows to edit the company profile of the seller account. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success message - - - - -
    -  Example: - -```json -{ - "uid": 1, - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getCompanyMetrics -Get company metrics - - - -```swift -companyprofile.getCompanyMetrics(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | A `company_id` is a unique identifier for a particular seller account. | - - - -This API allows to view the company metrics, i.e. the status of its brand and stores. Also its allows to view the number of products, company documents & store documents which are verified and unverified. - -*Returned Response:* - - - - -[MetricsSerializer](#MetricsSerializer) - -Metrics response object. See example below or refer `MetricsSerializer` for details - - - - -
    -  Example: - -```json -{ - "uid": 1, - "stage": "complete", - "store": { - "verified": 1, - "pending": 1 - }, - "brand": { - "verified": 1, - "pending": 1 - }, - "product": { - "verified": 0, - "pending": 0 - }, - "company_documents": { - "verified": 1, - "pending": 0 - }, - "store_documents": { - "verified": 0, - "pending": 2 - } -} -``` -
    - - - - - - - - - ---- - - -#### getBrand -Get a single brand. - - - -```swift -companyprofile.getBrand(companyId: companyId, brandId: brandId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company associated to brand that is to be viewed. | -| brandId | String | yes | Id of the brand to be viewed. | - - - -This API helps to get data associated to a particular brand. - -*Returned Response:* - - - - -[GetBrandResponseSerializer](#GetBrandResponseSerializer) - -Brand object. See example below or refer `GetBrandResponseSerializer` for details - - - - -
    -  Example: - -```json -{ - "stage": "verified", - "_custom_json": {}, - "uid": 1, - "logo": "http://cdn4.gofynd.com/media/logo/brand/original/4597_40d1ce44d61940d4829a3c54951bd9ee.jpg", - "warnings": {}, - "_locale_language": {}, - "name": "edited brand", - "slug_key": "brand-2", - "banner": { - "portrait": "http://cdn4.gofynd.com/media/banner_portrait/brand/original/7021_16fc50205c40477daf419b64ec64c64c.jpg", - "landscape": "http://cdn4.gofynd.com/media/banner/brand/original/7020_f9e91f7d501c4f2985c09bd196ed304d.jpg" - }, - "created_by": { - "username": "silverbolt", - "user_id": "0" - }, - "modified_by": { - "username": "917827311650_22960", - "user_id": "123" - }, - "verified_by": { - "username": "917827311650_22960", - "user_id": "123" - }, - "synonyms": [ - "xyz" - ] -} -``` -
    - - - - - - - - - ---- - - -#### editBrand -Edit a brand. - - - -```swift -companyprofile.editBrand(companyId: companyId, brandId: brandId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company associated to brand that is to be viewed. | -| brandId | String | yes | Id of the brand to be viewed. | -| body | CreateUpdateBrandRequestSerializer | yes | Request body | - - -This API allows to edit meta of a brand. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "uid": 1, - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### createBrand -Create a Brand. - - - -```swift -companyprofile.createBrand(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company. | -| body | CreateUpdateBrandRequestSerializer | yes | Request body | - - -This API allows to create a brand associated to a company. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "uid": 1, - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getBrands -Get brands associated to a company - - - -```swift -companyprofile.getBrands(companyId: companyId, pageNo: pageNo, pageSize: pageSize, q: q) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company. | -| pageNo | Int? | no | The page number to navigate through the given set of results | -| pageSize | Int? | no | Number of items to retrieve in each page. Default is 10. | -| q | String? | no | Search term for name. | - - - -This API helps to get view brands associated to a particular company. - -*Returned Response:* - - - - -[CompanyBrandListSerializer](#CompanyBrandListSerializer) - -Brand object. See example below or refer `CompanyBrandListSerializer` for details - - - - -
    -  Example: - -```json -{ - "items": [ - { - "brand": { - "stage": "complete", - "uid": 2, - "banner": { - "portrait": "http://cdn4.gofynd.com/media/banner_portrait/brand/original/7021_16fc50205c40477daf419b64ec64c64c.jpg", - "landscape": "http://cdn4.gofynd.com/media/banner/brand/original/7020_f9e91f7d501c4f2985c09bd196ed304d.jpg" - }, - "modified_by": { - "user_id": "123", - "username": "917827311650_22960" - }, - "slug_key": "test-post", - "synonyms": [ - "xyz" - ], - "created_on": "2021-02-25T15:21:57.666000+00:00", - "created_by": { - "user_id": "123", - "username": "917827311650_22960" - }, - "modified_on": "2021-02-25T15:21:57.666000+00:00", - "name": "test_post", - "logo": "http://cdn4.gofynd.com/media/logo/brand/original/4597_40d1ce44d61940d4829a3c54951bd9ee.jpg" - }, - "stage": "complete", - "uid": 2, - "modified_by": { - "user_id": "123", - "username": "917827311650_22960" - }, - "company": { - "business_type": "huf", - "stage": "complete", - "uid": 1, - "addresses": [ - { - "city": "Mumbai Suburban", - "latitude": 19.058461, - "longitude": 72.871395, - "address1": "Chunabhatti Phatak, Maharashtra Nagar, Maharashtra Nagar, ", - "country_code": "IN", - "state": "Maharashtra", - "country": "India", - "pincode": 400070, - "address_type": "office" - }, - { - "city": "Mumbai Suburban", - "latitude": 19.058461, - "longitude": 72.871395, - "address1": "Chunabhatti Phatak, Maharashtra Nagar, Maharashtra Nagar, ", - "country_code": "IN", - "state": "Maharashtra", - "country": "India", - "pincode": 400070, - "address_type": "registered" - } - ], - "modified_by": { - "user_id": "-1", - "username": "silverbolt" - }, - "company_type": "mbo", - "created_on": "2021-02-25T15:21:51.526000+00:00", - "created_by": { - "user_id": "123", - "username": "917827311650_22960" - }, - "modified_on": "2021-02-25T17:44:55.722000+00:00", - "name": "Cache Company" - }, - "created_by": { - "user_id": "123", - "username": "917827311650_22960" - } - } - ], - "page": { - "current": 1, - "size": 1, - "has_previous": false, - "has_next": false, - "item_count": 1 - } -} -``` -
    - - - - - - - - - ---- - - -#### createCompanyBrandMapping -Create a company brand mapping. - - - -```swift -companyprofile.createCompanyBrandMapping(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company inside which the brand is to be mapped. | -| body | CompanyBrandPostRequestSerializer | yes | Request body | - - -This API allows to create a company brand mapping, for a already existing brand in the system. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getLocations -Get list of locations - - - -```swift -companyprofile.getLocations(companyId: companyId, storeType: storeType, q: q, stage: stage, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company whose locations are to fetched | -| storeType | String? | no | Helps to sort the location list on the basis of location type. | -| q | String? | no | Query that is to be searched. | -| stage | String? | no | to filter companies on basis of verified or unverified companies. | -| pageNo | Int? | no | The page number to navigate through the given set of results | -| pageSize | Int? | no | Number of items to retrieve in each page. Default is 10. | - - - -This API allows to view all the locations asscoiated to a company. - -*Returned Response:* - - - - -[LocationListSerializer](#LocationListSerializer) - -Company profile object. See example below or refer `LocationListSerializer` for details - - - - -
    -  Example: - -```json -{ - "items": [ - { - "company": { - "business_type": "huf", - "stage": "complete", - "uid": 1, - "addresses": [ - { - "city": "Mumbai Suburban", - "latitude": 19.058461, - "longitude": 72.871395, - "address1": "Chunabhatti Phatak, Maharashtra Nagar, Maharashtra Nagar, ", - "country_code": "IN", - "state": "Maharashtra", - "country": "India", - "pincode": 400070, - "address_type": "office" - }, - { - "city": "Mumbai Suburban", - "latitude": 19.058461, - "longitude": 72.871395, - "address1": "Chunabhatti Phatak, Maharashtra Nagar, Maharashtra Nagar, ", - "country_code": "IN", - "state": "Maharashtra", - "country": "India", - "pincode": 400070, - "address_type": "registered" - } - ], - "modified_by": { - "user_id": "-1", - "username": "silverbolt" - }, - "company_type": "mbo", - "created_on": "2021-02-25T15:21:51.526000+00:00", - "created_by": { - "user_id": "123", - "username": "917827311650_22960" - }, - "modified_on": "2021-02-25T17:44:55.722000+00:00", - "name": "Cache Company" - }, - "address": { - "city": "MUMBAI", - "latitude": 19.4232024, - "longitude": 72.8231511, - "address1": "A/204, SAI VANDAN, NARAYAN NAGAR, TULINJ ROAD", - "state": "MAHARASHTRA", - "country": "INDIA", - "pincode": 401209 - }, - "timing": [ - { - "closing": { - "minute": 0, - "hour": 22 - }, - "opening": { - "minute": 0, - "hour": 11 - }, - "open": true, - "weekday": "monday" - }, - { - "closing": { - "minute": 0, - "hour": 22 - }, - "opening": { - "minute": 0, - "hour": 11 - }, - "open": true, - "weekday": "tuesday" - }, - { - "closing": { - "minute": 0, - "hour": 22 - }, - "opening": { - "minute": 0, - "hour": 11 - }, - "open": true, - "weekday": "wednesday" - }, - { - "closing": { - "minute": 0, - "hour": 22 - }, - "opening": { - "minute": 0, - "hour": 11 - }, - "open": true, - "weekday": "thursday" - }, - { - "closing": { - "minute": 0, - "hour": 22 - }, - "opening": { - "minute": 0, - "hour": 11 - }, - "open": true, - "weekday": "friday" - }, - { - "closing": { - "minute": 0, - "hour": 22 - }, - "opening": { - "minute": 0, - "hour": 11 - }, - "open": true, - "weekday": "saturday" - }, - { - "closing": { - "minute": 0, - "hour": 22 - }, - "opening": { - "minute": 0, - "hour": 11 - }, - "open": true, - "weekday": "sunday" - } - ], - "documents": [], - "display_name": "new store", - "manager": { - "name": "Yrf", - "mobile_no": { - "country_code": 91, - "number": "83456774567" - }, - "email": "gbp@jkl.com" - }, - "code": "code2", - "product_return_config": { - "on_same_store": true - }, - "created_on": "2021-02-25T15:22:04.913000+00:00", - "created_by": { - "user_id": "123", - "username": "917827311650_22960" - }, - "name": "location2", - "gst_credentials": { - "e_invoice": { - "enabled": false - } - }, - "store_type": "high_street", - "contact_numbers": [ - { - "country_code": 91, - "number": "7208229698" - } - ], - "stage": "complete", - "uid": 2, - "notification_emails": [] - } - ], - "page": { - "current": 1, - "size": 1, - "has_previous": false, - "has_next": false, - "item_count": 1 - } -} -``` -
    - - - - - - - - - ---- - - -#### createLocation -Create a location asscoiated to a company. - - - -```swift -companyprofile.createLocation(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company inside which the location is to be created. | -| body | LocationSerializer | yes | Request body | - - -This API allows to create a location associated to a company. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "uid": 1, - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### getLocationDetail -Get details of a specific location. - - - -```swift -companyprofile.getLocationDetail(companyId: companyId, locationId: locationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company inside which the location lies. | -| locationId | String | yes | Id of the location which you want to view. | - - - -This API helps to get data associated to a specific location. - -*Returned Response:* - - - - -[GetLocationSerializer](#GetLocationSerializer) - -Brand object. See example below or refer `GetLocationSerializer` for details - - - - -
    -  Example: - -```json -{ - "verified_on": "2021-02-25T15:22:07.140000+00:00", - "company": { - "business_type": "huf", - "stage": "complete", - "uid": 1, - "addresses": [ - { - "city": "Mumbai Suburban", - "latitude": 19.058461, - "longitude": 72.871395, - "address1": "Chunabhatti Phatak, Maharashtra Nagar, Maharashtra Nagar, ", - "country_code": "IN", - "state": "Maharashtra", - "country": "India", - "pincode": 400070, - "address_type": "office" - }, - { - "city": "Mumbai Suburban", - "latitude": 19.058461, - "longitude": 72.871395, - "address1": "Chunabhatti Phatak, Maharashtra Nagar, Maharashtra Nagar, ", - "country_code": "IN", - "state": "Maharashtra", - "country": "India", - "pincode": 400070, - "address_type": "registered" - } - ], - "modified_by": { - "user_id": "-1", - "username": "silverbolt" - }, - "company_type": "mbo", - "created_by": { - "user_id": "123", - "username": "917827311650_22960" - }, - "name": "Cache Company" - }, - "address": { - "city": "MUMBAI", - "landmark": "", - "latitude": 19.4232024, - "longitude": 72.8231511, - "address2": "", - "address1": "A/204, SAI VANDAN, NARAYAN NAGAR, TULINJ ROAD", - "state": "MAHARASHTRA", - "country": "INDIA", - "pincode": 401209 - }, - "timing": [ - { - "closing": { - "minute": 0, - "hour": 22 - }, - "opening": { - "minute": 0, - "hour": 11 - }, - "open": true, - "weekday": "monday" - }, - { - "closing": { - "minute": 0, - "hour": 22 - }, - "opening": { - "minute": 0, - "hour": 11 - }, - "open": true, - "weekday": "tuesday" - }, - { - "closing": { - "minute": 0, - "hour": 22 - }, - "opening": { - "minute": 0, - "hour": 11 - }, - "open": true, - "weekday": "wednesday" - }, - { - "closing": { - "minute": 0, - "hour": 22 - }, - "opening": { - "minute": 0, - "hour": 11 - }, - "open": true, - "weekday": "thursday" - }, - { - "closing": { - "minute": 0, - "hour": 22 - }, - "opening": { - "minute": 0, - "hour": 11 - }, - "open": true, - "weekday": "friday" - }, - { - "closing": { - "minute": 0, - "hour": 22 - }, - "opening": { - "minute": 0, - "hour": 11 - }, - "open": true, - "weekday": "saturday" - }, - { - "closing": { - "minute": 0, - "hour": 22 - }, - "opening": { - "minute": 0, - "hour": 11 - }, - "open": true, - "weekday": "sunday" - } - ], - "documents": [], - "warnings": {}, - "display_name": "new store", - "manager": { - "name": "Yrf", - "mobile_no": { - "country_code": 91, - "number": "83456774567" - }, - "email": "gbp@jkl.com" - }, - "code": "store1", - "product_return_config": { - "on_same_store": true - }, - "modified_by": { - "user_id": "-1", - "username": "silverbolt" - }, - "created_by": { - "user_id": "123", - "username": "917827311650_22960" - }, - "name": "edited_store", - "gst_credentials": { - "e_invoice": { - "enabled": false - } - }, - "verified_by": { - "user_id": "-1", - "username": "silverbolt" - }, - "store_type": "high_street", - "contact_numbers": [ - { - "country_code": 91, - "number": "7208229698" - } - ], - "stage": "verified", - "uid": 1, - "integration_type": { - "inventory": "pulse", - "order": "pulse" - }, - "notification_emails": [] -} -``` -
    - - - - - - - - - ---- - - -#### updateLocation -Edit a location asscoiated to a company. - - - -```swift -companyprofile.updateLocation(companyId: companyId, locationId: locationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company inside which the location is to be created. | -| locationId | String | yes | Id of the location which you want to edit. | -| body | LocationSerializer | yes | Request body | - - -This API allows to edit a location associated to a company. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "uid": 1, - "success": true -} -``` -
    - - - - - - - - - ---- - - -#### createLocationBulk -Create a location asscoiated to a company in bulk. - - - -```swift -companyprofile.createLocationBulk(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Id of the company inside which the location is to be created. | -| body | BulkLocationSerializer | yes | Request body | - - -This API allows to create a location associated to a company. - -*Returned Response:* - - - - -[SuccessResponse](#SuccessResponse) - -Returns a success response - - - - -
    -  Example: - -```json -{ - "message": "10 stores inserted", - "success": true -} -``` -
    - - - - - - - - - ---- - - - - -## FileStorage - - -#### startUpload -This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob. - - - -```swift -filestorage.startUpload(namespace: namespace, companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| namespace | String | yes | bucket name | -| companyId | Int | yes | company_id | -| body | StartRequest | no | Request body | - - -Uploads an arbitrarily sized buffer or blob. - -It has three Major Steps: -* Start -* Upload -* Complete - -### Start -Initiates the assets upload using `startUpload`. -It returns the storage link in response. - -### Upload -Use the storage link to upload a file (Buffer or Blob) to the File Storage. -Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body. - -### Complete -After successfully upload, call `completeUpload` api to complete the upload process. -This operation will return the url for the uploaded file. - - -*Returned Response:* - - - - -[StartResponse](#StartResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### completeUpload -This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process. - - - -```swift -filestorage.completeUpload(namespace: namespace, companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| namespace | String | yes | bucket name | -| companyId | Int | yes | company_id | -| body | StartResponse | no | Request body | - - -Uploads an arbitrarily sized buffer or blob. - -It has three Major Steps: -* Start -* Upload -* Complete - -### Start -Initiates the assets upload using `startUpload`. -It returns the storage link in response. - -### Upload -Use the storage link to upload a file (Buffer or Blob) to the File Storage. -Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body. - -### Complete -After successfully upload, call `completeUpload` api to complete the upload process. -This operation will return the url for the uploaded file. - - -*Returned Response:* - - - - -[CompleteResponse](#CompleteResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### appStartUpload -This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob. - - - -```swift -filestorage.appStartUpload(namespace: namespace, companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| namespace | String | yes | bucket name | -| companyId | Int | yes | company_id | -| applicationId | String | yes | application id | -| body | StartRequest | no | Request body | - - -Uploads an arbitrarily sized buffer or blob. - -It has three Major Steps: -* Start -* Upload -* Complete - -### Start -Initiates the assets upload using `appStartUpload`. -It returns the storage link in response. - -### Upload -Use the storage link to upload a file (Buffer or Blob) to the File Storage. -Make a `PUT` request on storage link received from `appStartUpload` api with file (Buffer or Blob) as a request body. - -### Complete -After successfully upload, call `appCompleteUpload` api to complete the upload process. -This operation will return the url for the uploaded file. - - -*Returned Response:* - - - - -[StartResponse](#StartResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### appCompleteUpload -This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process. - - - -```swift -filestorage.appCompleteUpload(namespace: namespace, companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| namespace | String | yes | bucket name | -| companyId | Int | yes | company_id | -| applicationId | String | yes | application id | -| body | StartResponse | no | Request body | - - -Uploads an arbitrarily sized buffer or blob. - -It has three Major Steps: -* Start -* Upload -* Complete - -### Start -Initiates the assets upload using `appStartUpload`. -It returns the storage link in response. - -### Upload -Use the storage link to upload a file (Buffer or Blob) to the File Storage. -Make a `PUT` request on storage link received from `appStartUpload` api with file (Buffer or Blob) as a request body. - -### Complete -After successfully upload, call `appCompleteUpload` api to complete the upload process. -This operation will return the url for the uploaded file. - - -*Returned Response:* - - - - -[CompleteResponse](#CompleteResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getSignUrls -Explain here - - - -```swift -filestorage.getSignUrls(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | company_id | -| body | SignUrlRequest | no | Request body | - - -Describe here - -*Returned Response:* - - - - -[SignUrlResponse](#SignUrlResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### copyFiles -Copy Files - - - -```swift -filestorage.copyFiles(sync: sync, companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| sync | Bool? | no | sync | -| companyId | Int | yes | company_id | -| body | BulkRequest | no | Request body | - - -Copy Files - -*Returned Response:* - - - - -[BulkResponse](#BulkResponse) - -Success - - - - -
    -  Example: - -```json -{ - "tracking_url": "https://xxx.xxx.xxx/2", - "task": { - "id": "2", - "name": "__default__", - "data": { - "urls": [ - "https://xxx.xxx.xxx/files.csv" - ], - "destination": { - "namespace": "/domaine/path", - "rewrite": "{{namespace}}/bar/{{dest.path}}" - } - }, - "opts": { - "attempts": 1, - "delay": 0, - "timestamp": 1613534206645 - }, - "progress": 0, - "delay": 0, - "timestamp": 1613534206645, - "attempts_made": 0, - "stacktrace": [], - "finished_on": 1613534206645, - "processed_on": 1613534206645 - } -} -``` -
    - - - - - - - - - ---- - - -#### appCopyFiles -Copy Files - - - -```swift -filestorage.appCopyFiles(sync: sync, companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| sync | Bool? | no | sync | -| companyId | Int | yes | company_id | -| applicationId | Int | yes | application_id | -| body | BulkRequest | no | Request body | - - -Copy Files - -*Returned Response:* - - - - -[BulkResponse](#BulkResponse) - -Success - - - - -
    -  Example: - -```json -{ - "tracking_url": "https://xxx.xxx.xxx/2", - "task": { - "id": "2", - "name": "__default__", - "data": { - "urls": [ - "https://xxx.xxx.xxx/files.csv" - ], - "destination": { - "namespace": "/domaine/path", - "rewrite": "{{namespace}}/bar/{{dest.path}}" - } - }, - "opts": { - "attempts": 1, - "delay": 0, - "timestamp": 1613534206645 - }, - "progress": 0, - "delay": 0, - "timestamp": 1613534206645, - "attempts_made": 0, - "stacktrace": [], - "finished_on": 1613534206645, - "processed_on": 1613534206645 - } -} -``` -
    - - - - - - - - - ---- - - -#### browse -Browse Files - - - -```swift -filestorage.browse(namespace: namespace, companyId: companyId, pageNo: pageNo) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| namespace | String | yes | bucket name | -| companyId | Int | yes | company_id | -| pageNo | Int? | no | page no | - - - -Browse Files - -*Returned Response:* - - - - -[BrowseResponse](#BrowseResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### browse -Browse Files - - - -```swift -filestorage.browse(namespace: namespace, companyId: companyId, applicationId: applicationId, pageNo: pageNo) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| namespace | String | yes | bucket name | -| companyId | Int | yes | company_id | -| applicationId | Int | yes | application_id | -| pageNo | Int? | no | page no | - - - -Browse Files - -*Returned Response:* - - - - -[BrowseResponse](#BrowseResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### proxy -Proxy - - - -```swift -filestorage.proxy(companyId: companyId, url: url) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | company_id | -| url | String | yes | url | - - - -Proxy - -*Returned Response:* - - - - -[String](#String) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - - - -## Share - - -#### createShortLink -Create short link - - - -```swift -share.createShortLink(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| applicationId | String | yes | Application Id | -| body | ShortLinkReq | no | Request body | - - -Create short link - -*Returned Response:* - - - - -[ShortLinkRes](#ShortLinkRes) - -Success - - - - -
    -  Example: - -```json -{ - "url": { - "original": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh", - "short": "https://0icof6vvsf.hostx0.de/l/3qKlnsq-x", - "hash": "3qKlnsq-x" - }, - "redirects": { - "ios": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "android": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "web": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "force_web": false - }, - "created_by": "team", - "personalized": false, - "app_redirect": false, - "fallback": "web", - "enable_tracking": false, - "active": true, - "count": 0, - "_id": "601a54054c0349592e76c8f3", - "title": "new ", - "meta": { - "type": "brand" - }, - "expire_at": null, - "application": "5eda528b97457fe43a733ace", - "user_id": "5e4d01e2c39837ab66144f6d", - "created_at": "2021-02-03T07:43:01.342Z", - "updated_at": "2021-02-03T07:43:01.342Z" -} -``` -
    - - - - - - - - - ---- - - -#### getShortLinks -Get short links - - - -```swift -share.getShortLinks(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize, createdBy: createdBy, active: active, q: q) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| applicationId | String | yes | Application Id | -| pageNo | Int? | no | Current page number | -| pageSize | Int? | no | Current page size | -| createdBy | String? | no | Short link creator | -| active | String? | no | Short link active status | -| q | String? | no | Search text for original and short url | - - - -Get short links - -*Returned Response:* - - - - -[ShortLinkList](#ShortLinkList) - -Success - - - - -
    -  Example: - -```json -{ - "items": [ - { - "url": { - "original": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh", - "short": "https://0icof6vvsf.hostx0.de/l/3qKlnsq-x", - "hash": "3qKlnsq-x" - }, - "redirects": { - "ios": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "android": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "web": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "force_web": false - }, - "created_by": "team", - "personalized": false, - "app_redirect": false, - "fallback": "web", - "enable_tracking": false, - "active": true, - "count": 0, - "_id": "601a54054c0349592e76c8f3", - "title": "new ", - "meta": { - "type": "brand" - }, - "expire_at": null, - "application": "5eda528b97457fe43a733ace", - "user_id": "5e4d01e2c39837ab66144f6d", - "created_at": "2021-02-03T07:43:01.342Z", - "updated_at": "2021-02-03T07:43:01.342Z" - } - ], - "page": { - "size": 10, - "type": "number", - "page": 1, - "item_total": 30, - "has_next": true - } -} -``` -
    - - - - - - - - - ---- - - -#### getShortLinkByHash -Get short link by hash - - - -```swift -share.getShortLinkByHash(companyId: companyId, applicationId: applicationId, hash: hash) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| applicationId | String | yes | Application Id | -| hash | String | yes | Hash of short url | - - - -Get short link by hash - -*Returned Response:* - - - - -[ShortLinkRes](#ShortLinkRes) - -Success - - - - -
    -  Example: - -```json -{ - "url": { - "original": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh", - "short": "https://0icof6vvsf.hostx0.de/l/3qKlnsq-x", - "hash": "3qKlnsq-x" - }, - "redirects": { - "ios": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "android": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "web": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "force_web": false - }, - "created_by": "team", - "personalized": false, - "app_redirect": false, - "fallback": "web", - "enable_tracking": false, - "active": true, - "count": 0, - "_id": "601a54054c0349592e76c8f3", - "title": "new ", - "meta": { - "type": "brand" - }, - "expire_at": null, - "application": "5eda528b97457fe43a733ace", - "user_id": "5e4d01e2c39837ab66144f6d", - "created_at": "2021-02-03T07:43:01.342Z", - "updated_at": "2021-02-03T07:43:01.342Z" -} -``` -
    - - - - - - - - - ---- - - -#### updateShortLinkById -Update short link by id - - - -```swift -share.updateShortLinkById(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| applicationId | String | yes | Application Id | -| id | String | yes | Short link document identifier | -| body | ShortLinkReq | no | Request body | - - -Update short link by id - -*Returned Response:* - - - - -[ShortLinkRes](#ShortLinkRes) - -Success - - - - -
    -  Example: - -```json -{ - "url": { - "original": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh", - "short": "https://0icof6vvsf.hostx0.de/l/3qKlnsq-x", - "hash": "3qKlnsq-x" - }, - "redirects": { - "ios": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "android": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "web": { - "type": "web", - "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" - }, - "force_web": false - }, - "created_by": "team", - "personalized": false, - "app_redirect": false, - "fallback": "web", - "enable_tracking": false, - "active": true, - "count": 0, - "_id": "601a54054c0349592e76c8f3", - "title": "new ", - "meta": { - "type": "brand" - }, - "expire_at": null, - "application": "5eda528b97457fe43a733ace", - "user_id": "5e4d01e2c39837ab66144f6d", - "created_at": "2021-02-03T07:43:01.342Z", - "updated_at": "2021-02-03T07:43:01.342Z" -} -``` -
    - - - - - - - - - ---- - - - - -## Inventory - - -#### getJobsByCompany -Get Job Configs For A Company - - - -```swift -inventory.getJobsByCompany(companyId: companyId, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| pageNo | Int? | no | Page Number | -| pageSize | Int? | no | Page Size | - - - -REST Endpoint that returns all job configs for a company - -*Returned Response:* - - - - -[ResponseEnvelopeListJobConfigRawDTO](#ResponseEnvelopeListJobConfigRawDTO) - -Successful operation - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updateJob -Updates An Existing Job Config - - - -```swift -inventory.updateJob(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| body | JobConfigDTO | yes | Request body | - - -REST Endpoint that updates a job config - -*Returned Response:* - - - - -[ResponseEnvelopeString](#ResponseEnvelopeString) - -Job Config Updated Successfully - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### createJob -Creates A New Job Config - - - -```swift -inventory.createJob(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| body | JobConfigDTO | yes | Request body | - - -REST Endpoint that creates a new job config - -*Returned Response:* - - - - -[ResponseEnvelopeString](#ResponseEnvelopeString) - -Job Config Created Successfully - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getJobByCompanyAndIntegration -Get Job Configs By Company And Integration - - - -```swift -inventory.getJobByCompanyAndIntegration(companyId: companyId, integrationId: integrationId, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| integrationId | String | yes | Integration Id | -| pageNo | Int? | no | Page Number | -| pageSize | Int? | no | Page Size | - - - -REST Endpoint that returns all job configs by company And integration - -*Returned Response:* - - - - -[ResponseEnvelopeListJobConfigDTO](#ResponseEnvelopeListJobConfigDTO) - -Successful operation - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getJobConfigDefaults -Get Job Configs Defaults - - - -```swift -inventory.getJobConfigDefaults(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | - - - -REST Endpoint that returns default fields job configs by company And integration - -*Returned Response:* - - - - -[ResponseEnvelopeJobConfigDTO](#ResponseEnvelopeJobConfigDTO) - -Successful operation - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getJobByCode -Get Job Config By Code - - - -```swift -inventory.getJobByCode(companyId: companyId, code: code) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| code | String | yes | Job Code | - - - -REST Endpoint that returns job config by code - -*Returned Response:* - - - - -[ResponseEnvelopeJobConfigDTO](#ResponseEnvelopeJobConfigDTO) - -Successful operation - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getJobCodeMetrics -Get Job Metrics - - - -```swift -inventory.getJobCodeMetrics(companyId: companyId, code: code, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| code | String | yes | Code | -| pageNo | Int? | no | Page Number | -| pageSize | Int? | no | Page Size | - - - -REST Endpoint that returns Inventory Run History For A Job Code - -*Returned Response:* - - - - -[ResponseEnvelopeJobMetricsDto](#ResponseEnvelopeJobMetricsDto) - -Successful operation - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getJobCodesByCompanyAndIntegration -Get Job Codes By Company And Integration - - - -```swift -inventory.getJobCodesByCompanyAndIntegration(companyId: companyId, integrationId: integrationId, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id | -| integrationId | String | yes | Integration Id | -| pageNo | Int? | no | Page Number | -| pageSize | Int? | no | Page Size | - - - -REST Endpoint that returns all job codes by company And integration - -*Returned Response:* - - - - -[ResponseEnvelopeListJobConfigListDTO](#ResponseEnvelopeListJobConfigListDTO) - -Successful operation - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - - - -## Configuration - - -#### getBuildConfig -Get latest build config - - - -```swift -configuration.getBuildConfig(companyId: companyId, applicationId: applicationId, platformType: platformType) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| platformType | String | yes | Current platform name | - - - -Get latest build config - -*Returned Response:* - - - - -[MobileAppConfiguration](#MobileAppConfiguration) - -Success - - - - -
    -  Example: - -```json -{ - "is_active": true, - "_id": "5ea9b318bc23a343ab6d442f", - "app_name": "TestUniket", - "landing_image": { - "aspect_ratio": "57/51", - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/mobile-build/pictures/free-landing/original/yKnXY1ATx-store-landing-image.png" - }, - "splash_image": { - "aspect_ratio": "1/1", - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/mobile-build/pictures/free-splash/original/s6d7oYfY6-store-splash-image.png" - }, - "application": "000000000000000000000004", - "platform_type": "android", - "created_at": "2020-04-29T17:02:16.976Z", - "modified_at": "2021-02-23T17:10:26.872Z", - "__v": 0, - "package_name": "com.fynd.store.x000000000000000000000004" -} -``` -
    - - - - - - - - - ---- - - -#### updateBuildConfig -Update build config for next build - - - -```swift -configuration.updateBuildConfig(companyId: companyId, applicationId: applicationId, platformType: platformType, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| platformType | String | yes | Current platform name | -| body | MobileAppConfigRequest | no | Request body | - - -Update build config for next build - -*Returned Response:* - - - - -[MobileAppConfiguration](#MobileAppConfiguration) - -Success - - - - -
    -  Example: - -```json -{ - "is_active": true, - "_id": "5ea9b318bc23a343ab6d442f", - "app_name": "TestUniket", - "landing_image": { - "aspect_ratio": "57/51", - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/mobile-build/pictures/free-landing/original/yKnXY1ATx-store-landing-image.png" - }, - "splash_image": { - "aspect_ratio": "1/1", - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/mobile-build/pictures/free-splash/original/s6d7oYfY6-store-splash-image.png" - }, - "application": "000000000000000000000004", - "platform_type": "android", - "created_at": "2020-04-29T17:02:16.976Z", - "modified_at": "2021-02-23T17:10:26.872Z", - "__v": 0, - "package_name": "com.fynd.store.x000000000000000000000004" -} -``` -
    - - - - - - - - - ---- - - -#### getPreviousVersions -Get previous build versions - - - -```swift -configuration.getPreviousVersions(companyId: companyId, applicationId: applicationId, platformType: platformType) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| platformType | String | yes | Current platform name | - - - -Get previous build versions - -*Returned Response:* - - - - -[BuildVersionHistory](#BuildVersionHistory) - -Success - - - - -
    -  Example: - -```json -{ - "versions": [ - { - "_id": "6035376ab937c5f7c5462888", - "application": "000000000000000000000004", - "platform_type": "android", - "build_status": "pending", - "version_name": "0.5.6", - "version_code": 1, - "created_at": "2021-02-23T17:12:10.977Z", - "modified_at": "2021-02-23T17:12:10.977Z", - "__v": 0 - } - ], - "latest_available_version_name": "0.5.7" -} -``` -
    - - - - - - - - - ---- - - -#### getAppFeatures -Get features of application - - - -```swift -configuration.getAppFeatures(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | - - - -Get features of application - -*Returned Response:* - - - - -[AppFeatureResponse](#AppFeatureResponse) - -Success - - - - -
    -  Example: - -```json -{ - "feature": { - "product_detail": { - "similar": [ - "basic", - "visual", - "brand", - "category", - "seller", - "price", - "specs" - ], - "seller_selection": true, - "update_product_meta": true, - "request_product": true - }, - "landing_page": { - "launch_page": { - "page_type": "home", - "params": null, - "query": null - }, - "continue_as_guest": true, - "login_btn_text": "Click here to sign-in", - "show_domain_textbox": true, - "show_register_btn": true - }, - "registration_page": { - "ask_store_address": false - }, - "home_page": { - "order_processing": true - }, - "common": { - "communication_optin_dialog": { - "visibility": true - }, - "deployment_store_selection": { - "enabled": true, - "type": "hard" - }, - "listing_price": { - "value": "min", - "sort": "min" - }, - "currency": { - "value": [ - "INR" - ], - "type": "explicit", - "default_currency": "INR" - }, - "revenue_engine": { - "enabled": false - }, - "feedback": { - "enabled": true - }, - "compare_products": { - "enabled": true - }, - "reward_points": { - "credit": { - "enabled": true - }, - "debit": { - "enabled": true, - "auto_apply": false, - "strategy_channel": "REWARDS" - } - } - }, - "cart": { - "gst_input": true, - "staff_selection": true, - "placing_for_customer": true, - "google_map": true, - "revenue_engine_coupon": false - }, - "qr": { - "application": true, - "products": true, - "collections": true - }, - "pcr": { - "staff_selection": true - }, - "order": { - "buy_again": true - }, - "_id": "5e57643c986e4119c973df7d", - "app": "000000000000000000000004", - "created_at": "2020-02-27T06:39:56.088Z", - "modified_at": "2021-02-02T11:04:14.289Z", - "__v": 1 - } -} -``` -
    - - - - - - - - - ---- - - -#### updateAppFeatures -Update features of application - - - -```swift -configuration.updateAppFeatures(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| body | AppFeatureRequest | yes | Request body | - - -Update features of application - -*Returned Response:* - - - - -[AppFeature](#AppFeature) - -Success - - - - -
    -  Example: - -```json -{ - "product_detail": { - "similar": [ - "basic", - "visual", - "brand", - "category", - "seller", - "price", - "specs" - ], - "seller_selection": true, - "update_product_meta": true, - "request_product": true - }, - "landing_page": { - "launch_page": { - "page_type": "home", - "params": null, - "query": null - }, - "continue_as_guest": true, - "login_btn_text": "Click here to sign-in", - "show_domain_textbox": true, - "show_register_btn": true - }, - "registration_page": { - "ask_store_address": false - }, - "home_page": { - "order_processing": true - }, - "common": { - "communication_optin_dialog": { - "visibility": true - }, - "deployment_store_selection": { - "enabled": true, - "type": "hard" - }, - "listing_price": { - "value": "min", - "sort": "min" - }, - "currency": { - "value": [ - "INR" - ], - "type": "explicit", - "default_currency": "INR" - }, - "revenue_engine": { - "enabled": false - }, - "feedback": { - "enabled": true - }, - "compare_products": { - "enabled": true - } - }, - "cart": { - "gst_input": true, - "staff_selection": true, - "placing_for_customer": true, - "google_map": true, - "revenue_engine_coupon": false - }, - "qr": { - "application": true, - "products": true, - "collections": true - }, - "pcr": { - "staff_selection": true - }, - "order": { - "buy_again": true - }, - "_id": "5e57643c986e4119c973df7d", - "app": "000000000000000000000004", - "created_at": "2020-02-27T06:39:56.088Z", - "modified_at": "2021-03-09T15:40:29.188Z", - "__v": 1 -} -``` -
    - - - - - - - - - ---- - - -#### getAppBasicDetails -Get basic application details - - - -```swift -configuration.getAppBasicDetails(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | - - - -Get basic application details like name - -*Returned Response:* - - - - -[ApplicationDetail](#ApplicationDetail) - -Success - - - - -
    -  Example: - -```json -{ - "name": "Uniket B2B", - "description": "Uniket B2B - India's Fastest Growing Retail Store - Aapki Badhti Dukaan", - "logo": { - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/free-logo/original/oEf3SQjda-Uniket-B2B.png" - }, - "mobile_logo": { - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/free-logo/original/oEf3SQjda-Uniket-B2B.png" - }, - "favicon": { - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/favicon/original/y3h6SSlY5-Uniket-B2B.png" - }, - "banner": { - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/landscape-banner/original/uSwlNpygq-Uniket-B2B.png" - }, - "domain": { - "verified": true, - "is_primary": true, - "is_default": true, - "is_shortlink": false, - "_id": "5eb1177748312a3bd55d0f1e", - "name": "uniket.hostx0.de" - }, - "domains": [ - { - "verified": true, - "is_primary": true, - "is_default": true, - "is_shortlink": false, - "_id": "5eb1177748312a3bd55d0f1e", - "name": "uniket.hostx0.de" - }, - { - "verified": true, - "is_primary": false, - "is_default": false, - "is_shortlink": true, - "_id": "5f0858c5f86e00cd42dccc8d", - "name": "jd.hostx0.de" - } - ], - "company_id": 1, - "_id": "000000000000000000000004" -} -``` -
    - - - - - - - - - ---- - - -#### updateAppBasicDetails -Add or update application's basic details - - - -```swift -configuration.updateAppBasicDetails(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| body | ApplicationDetail | yes | Request body | - - -Add or update application's basic details - -*Returned Response:* - - - - -[ApplicationDetail](#ApplicationDetail) - -Success - - - - -
    -  Example: - -```json -{ - "name": "Uniket B2B", - "description": "Uniket B2B - India's Fastest Growing Retail Store - Aapki Badhti Dukaan", - "logo": { - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/free-logo/original/oEf3SQjda-Uniket-B2B.png" - }, - "mobile_logo": { - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/free-logo/original/oEf3SQjda-Uniket-B2B.png" - }, - "favicon": { - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/favicon/original/y3h6SSlY5-Uniket-B2B.png" - }, - "banner": { - "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/landscape-banner/original/uSwlNpygq-Uniket-B2B.png" - }, - "domain": { - "verified": true, - "is_primary": true, - "is_default": true, - "is_shortlink": false, - "_id": "5eb1177748312a3bd55d0f1e", - "name": "uniket.hostx0.de" - }, - "domains": [ - { - "verified": true, - "is_primary": true, - "is_default": true, - "is_shortlink": false, - "_id": "5eb1177748312a3bd55d0f1e", - "name": "uniket.hostx0.de" - }, - { - "verified": true, - "is_primary": false, - "is_default": false, - "is_shortlink": true, - "_id": "5f0858c5f86e00cd42dccc8d", - "name": "jd.hostx0.de" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getAppContactInfo -Get application information - - - -```swift -configuration.getAppContactInfo(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | - - - -Get Application Current Information. This includes information about social links, address and contact information of company/seller/brand of the application. - -*Returned Response:* - - - - -[ApplicationInformation](#ApplicationInformation) - -Success - - - - -
    -  Example: - -```json -{ - "value": { - "address": { - "loc": null, - "address_line": [ - "Warehouse 5, Near Industrial Complex", - "2nd Lane, Andheri" - ], - "phone": [ - { - "code": "+91", - "number": "9988776654" - } - ], - "city": "Mumbai , Maharashtra , India", - "country": "India", - "pincode": 400059 - }, - "support": { - "phone": [], - "email": [], - "timing": "9 AM to 9 PM" - }, - "social_links": { - "facebook": { - "title": "Facebook", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/hQAbAKdvHK-facebookfooteraopcjq.svg", - "link": "" - }, - "instagram": { - "title": "Instagram", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/UZYsGWOqXp-instagramfooterl3utrr.svg", - "link": "" - }, - "twitter": { - "title": "Twitter", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/oT2hW-BJjq-twitterfooternajsyr.svg", - "link": "" - }, - "pinterest": { - "title": "Pinterest", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/v0erlcMk8p-pinterestfooternzmq4b.svg", - "link": "" - }, - "google_plus": { - "title": "Google+", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/lw3Y5S58h4-googleplusysukr1.png", - "link": "" - }, - "youtube": { - "title": "Youtube", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/EYV03PDST_-youtubefootermqhcr7.svg", - "link": "" - }, - "linked_in": { - "title": "LinkedIn", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/qa7gx_bW9O-linkedinfooterrcr0yq.svg", - "link": "" - }, - "vimeo": { - "title": "Vimeo", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/Ttc80b3U78-vimeofooternho4br.svg", - "link": "" - }, - "blog_link": { - "title": "Blog", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/LKpxTk1I3s-mediumfooterdtvrva.svg", - "link": "" - } - }, - "links": [ - { - "title": "Shipping", - "link": "www.uniket.store/shipping-details" - }, - { - "title": "Returns", - "link": "www.uniket.store/policy/return-policy" - }, - { - "title": "Privacy", - "link": "www.uniket.store/policy/privacy-policy" - }, - { - "title": "Terms", - "link": "www.uniket.store/policy/terms-conditions" - } - ], - "copyright_text": "#MadeInIndia © 2020 Shopsense Retail Technologies", - "_id": "5e6627bd0732616083e83750", - "business_highlights": [ - { - "_id": "5fc901611dfba6c2e87d1ca9", - "title": "100% Genuine Products", - "icon": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/business-highlights/pictures/square-logo/original/bVlx43F2a-H6pvZ9tzp-business-logo-icon.png", - "sub_title": "Directly from brands" - }, - { - "_id": "5fc901611dfba64ce57d1caa", - "title": "Credit Facility Available", - "icon": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/business-highlights/pictures/square-logo/original/VMnltS1m3-QuUnEjOsA-business-logo-icon.png", - "sub_title": "Free 30 Days Credit" - }, - { - "_id": "5fc901611dfba64b2e7d1cab", - "title": "Assured Returns", - "icon": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/business-highlights/pictures/square-logo/original/cTHzgHJXK-sROtLMalN-business-logo-icon.png", - "sub_title": "For all damaged/wrong items" - } - ], - "application": "000000000000000000000004", - "created_at": "2020-03-09T11:25:49.921Z", - "modified_at": "2020-12-03T15:16:49.087Z", - "__v": 99 - } -} -``` -
    - - - - - - - - - ---- - - -#### updateAppContactInfo -Get application information - - - -```swift -configuration.updateAppContactInfo(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| body | ApplicationInformation | yes | Request body | - - -Save Application Current Information. This includes information about social links, address and contact information of an application. - -*Returned Response:* - - - - -[ApplicationInformation](#ApplicationInformation) - -Success - - - - -
    -  Example: - -```json -{ - "_id": "5e6627bd0732616083e83750", - "address": { - "address_line": [ - "Warehouse 5, Near Industrial Complex", - "2nd Lane, Andheri" - ], - "phone": [ - { - "code": "+91", - "number": "9988776654" - } - ], - "city": "Mumbai , Maharashtra , India", - "country": "India", - "pincode": 400059, - "loc": null - }, - "social_links": { - "facebook": { - "title": "Facebook", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/hQAbAKdvHK-facebookfooteraopcjq.svg", - "link": "" - }, - "instagram": { - "title": "Instagram", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/UZYsGWOqXp-instagramfooterl3utrr.svg", - "link": "" - }, - "twitter": { - "title": "Twitter", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/oT2hW-BJjq-twitterfooternajsyr.svg", - "link": "" - }, - "pinterest": { - "title": "Pinterest", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/v0erlcMk8p-pinterestfooternzmq4b.svg", - "link": "" - }, - "google_plus": { - "title": "Google+", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/lw3Y5S58h4-googleplusysukr1.png", - "link": "" - }, - "youtube": { - "title": "Youtube", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/EYV03PDST_-youtubefootermqhcr7.svg", - "link": "" - }, - "linked_in": { - "title": "LinkedIn", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/qa7gx_bW9O-linkedinfooterrcr0yq.svg", - "link": "" - }, - "blog_link": { - "title": "Blog", - "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/LKpxTk1I3s-mediumfooterdtvrva.svg", - "link": "" - } - }, - "links": [ - { - "title": "Shipping", - "link": "www.uniket.store/shipping-details" - }, - { - "title": "Returns", - "link": "www.uniket.store/policy/return-policy" - }, - { - "title": "Privacy", - "link": "www.uniket.store/policy/privacy-policy" - }, - { - "title": "Terms", - "link": "www.uniket.store/policy/terms-conditions" - } - ], - "copyright_text": "#MadeInIndia © 2020 Shopsense Retail Technologies", - "support": { - "timing": "9 AM to 9 PM", - "phone": [], - "email": [] - }, - "business_highlights": [ - { - "_id": "60479413a32f774d754b00ef", - "title": "100% Genuine Products", - "icon": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/business-highlights/pictures/square-logo/original/bVlx43F2a-H6pvZ9tzp-business-logo-icon.png", - "sub_title": "Directly from brands" - }, - { - "_id": "60479413a32f7717df4b00f0", - "title": "Credit Facility Available", - "icon": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/business-highlights/pictures/square-logo/original/VMnltS1m3-QuUnEjOsA-business-logo-icon.png", - "sub_title": "Free 30 Days Credit" - }, - { - "_id": "60479413a32f77e70b4b00f1", - "title": "Assured Returns", - "icon": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/business-highlights/pictures/square-logo/original/cTHzgHJXK-sROtLMalN-business-logo-icon.png", - "sub_title": "For all damaged/wrong items" - } - ], - "application": "000000000000000000000004", - "created_at": "2020-03-09T11:25:49.921Z", - "modified_at": "2021-03-09T15:28:19.598Z", - "__v": 101 -} -``` -
    - - - - - - - - - ---- - - -#### getAppApiTokens -Get social tokens - - - -```swift -configuration.getAppApiTokens(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | - - - -Get social tokens. - -*Returned Response:* - - - - -[TokenResponse](#TokenResponse) - -Success - - - - -
    -  Example: - -```json -{ - "tokens": { - "firebase": { - "credentials": { - "ios": { - "application_id": "test", - "api_key": "test" - }, - "android": { - "application_id": "test", - "api_key": "test" - }, - "project_id": "uniket-d8cdc", - "gcm_sender_id": "test", - "application_id": "test", - "api_key": "test" - }, - "enabled": true - }, - "moengage": { - "credentials": { - "app_id": "test" - }, - "enabled": true - }, - "segment": { - "credentials": { - "write_key": "test" - }, - "enabled": true - }, - "gtm": { - "credentials": { - "api_key": "test" - }, - "enabled": false - }, - "freshchat": { - "credentials": { - "app_id": "123456", - "app_key": "123456789", - "web_token": "" - }, - "enabled": false - }, - "safetynet": { - "credentials": { - "api_key": "test" - }, - "enabled": true - }, - "fynd_rewards": { - "credentials": { - "public_key": "test" - } - }, - "auth": { - "google": { - "appId": "test" - }, - "facebook": { - "appId": "test" - }, - "accountkit": { - "appId": "" - } - }, - "google_map": { - "credentials": { - "api_key": "test" - } - } - }, - "_id": "5e66282a073261060ee83751", - "application": "000000000000000000000004", - "created_at": "2020-03-09T11:27:38.894Z", - "modified_at": "2020-12-24T05:39:17.054Z", - "__v": 0 -} -``` -
    - - - - - - - - - ---- - - -#### updateAppApiTokens -Add social tokens - - - -```swift -configuration.updateAppApiTokens(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| body | TokenResponse | no | Request body | - - -Add social tokens. - -*Returned Response:* - - - - -[TokenResponse](#TokenResponse) - -Success - - - - -
    -  Example: - -```json -{ - "tokens": { - "firebase": { - "credentials": { - "ios": { - "application_id": "test", - "api_key": "test" - }, - "android": { - "application_id": "test", - "api_key": "test" - }, - "project_id": "uniket-d8cdc", - "gcm_sender_id": "test", - "application_id": "test", - "api_key": "test" - }, - "enabled": true - }, - "moengage": { - "credentials": { - "app_id": "test" - }, - "enabled": true - }, - "segment": { - "credentials": { - "write_key": "test" - }, - "enabled": true - }, - "gtm": { - "credentials": { - "api_key": "1234567890" - }, - "enabled": false - }, - "freshchat": { - "credentials": { - "app_id": "123456", - "app_key": "123456789", - "web_token": "" - }, - "enabled": false - }, - "safetynet": { - "credentials": { - "api_key": "test" - }, - "enabled": true - }, - "fynd_rewards": { - "credentials": { - "public_key": "test" - } - }, - "auth": { - "google": { - "appId": "test" - }, - "facebook": { - "appId": "test" - }, - "accountkit": { - "appId": "" - } - }, - "google_map": { - "credentials": { - "api_key": "test" - } - } - }, - "_id": "5e66282a073261060ee83751", - "application": "000000000000000000000004", - "created_at": "2020-03-09T11:27:38.894Z", - "modified_at": "2020-12-24T05:39:17.054Z", - "__v": 0 -} -``` -
    - - - - - - - - - ---- - - -#### getAppCompanies -Application inventory enabled companies - - - -```swift -configuration.getAppCompanies(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| pageNo | Int? | no | Current page no | -| pageSize | Int? | no | Current request items count | - - - -Application inventory enabled companies. - -*Returned Response:* - - - - -[CompaniesResponse](#CompaniesResponse) - -Success - - - - -
    -  Example: - -```json -{ - "items": [ - { - "uid": 108, - "name": "Sample2 Company", - "company_type": "mbo" - }, - { - "uid": 13, - "name": "Isabel Mazanec", - "company_type": "franchisee" - }, - { - "uid": 7, - "name": "Zack Burgdorf", - "company_type": "distributor" - } - ], - "page": { - "type": "number", - "size": 200, - "current": 1, - "has_next": false, - "item_total": 3 - } -} -``` -
    - - - - - - - - - ---- - - -#### getAppStores -Application inventory enabled stores - - - -```swift -configuration.getAppStores(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| pageNo | Int? | no | Current page no | -| pageSize | Int? | no | Current request items count | - - - -Application inventory enabled stores. - -*Returned Response:* - - - - -[StoresResponse](#StoresResponse) - -Success - - - - -
    -  Example: - -```json -{ - "items": [ - { - "_id": "5ec2c0b168fc2800017112f5", - "uid": 1, - "name": "RRL01", - "display_name": "RRL01", - "store_type": "warehouse", - "store_code": "WH_8513", - "company_id": 1 - }, - { - "_id": "5ec3b09a68fc28000171137c", - "modified_on": "2020-06-30T10:02:41.208Z", - "uid": 10, - "name": "Saran Ledonne", - "display_name": "", - "store_type": "high_street", - "store_code": "af6198fe-2c23-4441-bbf4-e694c96e255c", - "company_id": 1 - }, - { - "_id": "5f099b2c931b1c0001e7ccb2", - "display_name": "cbs 2", - "store_code": "HS-c9bac", - "name": "cbs 2", - "company_id": 80, - "store_type": "high_street", - "uid": 11014 - } - ], - "page": { - "type": "number", - "size": 200, - "current": 1, - "has_next": true, - "item_total": 3 - } -} -``` -
    - - - - - - - - - ---- - - -#### getInventoryConfig -Get application configuration - - - -```swift -configuration.getInventoryConfig(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | - - - -Get application configuration for various features and data - -*Returned Response:* - - - - -[ApplicationInventory](#ApplicationInventory) - -Success - - - - -
    -  Example: - -```json -{ - "inventory": { - "brand": { - "criteria": "all", - "brands": [] - }, - "store": { - "criteria": "filter", - "stores": [], - "rules": [ - { - "companies": [ - 1, - 3, - 4 - ], - "brands": [] - } - ] - }, - "category": { - "criteria": "all", - "categories": [] - }, - "price": { - "min": 1, - "max": 10000 - }, - "discount": { - "min": 0, - "max": 100 - }, - "out_of_stock": true, - "franchise_enabled": true, - "exclude_category": [], - "image": [ - "standard", - "substandard", - "default" - ], - "company_store": [] - }, - "authentication": { - "required": true, - "provider": "fynd" - }, - "article_assignment": { - "rules": { - "store_priority": { - "enabled": false, - "storetype_order": [] - } - }, - "post_order_reassignment": true - }, - "reward_points": { - "credit": { - "enabled": true - }, - "debit": { - "enabled": true, - "auto_apply": false, - "strategy_channel": "rewards" - } - }, - "cart": { - "delivery_charges": { - "enabled": true, - "charges": [ - { - "threshold": 1000, - "charges": 49 - }, - { - "threshold": 200000, - "charges": 79 - } - ] - }, - "enabled": true, - "max_cart_items": 0, - "min_cart_value": 120, - "bulk_coupons": true - }, - "payment": { - "callback_url": { - "app": "", - "web": "" - }, - "methods": { - "pl": { - "enabled": true - }, - "card": { - "enabled": true - }, - "nb": { - "enabled": true - }, - "wl": { - "enabled": true - }, - "ps": { - "enabled": true - }, - "upi": { - "enabled": true - }, - "qr": { - "enabled": true - }, - "cod": { - "enabled": true - }, - "pp": { - "enabled": true - }, - "jp": { - "enabled": false - }, - "pac": { - "enabled": false - }, - "fc": { - "enabled": false - }, - "jiopp": { - "enabled": false - }, - "stripepg": { - "enabled": true - }, - "juspaypg": { - "enabled": false - }, - "payubizpg": { - "enabled": true - }, - "payumoneypg": { - "enabled": true - }, - "rupifipg": { - "enabled": false - }, - "simpl": { - "enabled": true - } - }, - "payment_selection_lock": { - "enabled": false, - "default_options": "", - "payment_identifier": "" - }, - "mode_of_payment": "uniket_b2b", - "source": "uniket", - "enabled": true, - "cod_amount_limit": 100000, - "cod_charges": 1500 - }, - "order": { - "enabled": true, - "force_reassignment": false - }, - "logistics": { - "logistics_by_seller": false, - "serviceability_check": true, - "same_day_delivery": true, - "dp_assignment": true - }, - "business": "retail", - "comms_enabled": true, - "platforms": [ - "uniket_wholesale" - ], - "_id": "5e04c76b8dd8c003577fdd0a", - "loyalty_points": { - "enabled": true, - "auto_apply": false - }, - "app": "000000000000000000000004", - "created_at": "2019-12-26t14:44:59.835z", - "modified_at": "2021-03-09t15:40:29.208z", - "__v": 3, - "modified_by": "5e199eed98cfe16dc61385de" -} -``` -
    - - - - - - - - - ---- - - -#### updateInventoryConfig -Update application configuration - - - -```swift -configuration.updateInventoryConfig(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| body | ApplicationInventory | no | Request body | - - -Update application configuration for various features and data - -*Returned Response:* - - - - -[ApplicationInventory](#ApplicationInventory) - -Success - - - - -
    -  Example: - -```json -{ - "inventory": { - "brand": { - "criteria": "all", - "brands": [] - }, - "store": { - "criteria": "filter", - "stores": [], - "rules": [ - { - "companies": [ - 1, - 3, - 4 - ], - "brands": [] - } - ] - }, - "category": { - "criteria": "all", - "categories": [] - }, - "price": { - "min": 1, - "max": 10000 - }, - "discount": { - "min": 0, - "max": 100 - }, - "out_of_stock": true, - "franchise_enabled": true, - "exclude_category": [], - "image": [ - "standard", - "substandard", - "default" - ], - "company_store": [] - }, - "authentication": { - "required": true, - "provider": "fynd" - }, - "article_assignment": { - "rules": { - "store_priority": { - "enabled": false, - "storetype_order": [] - } - }, - "post_order_reassignment": true - }, - "reward_points": { - "credit": { - "enabled": true - }, - "debit": { - "enabled": true, - "auto_apply": false, - "strategy_channel": "REWARDS" - } - }, - "cart": { - "delivery_charges": { - "enabled": true, - "charges": [ - { - "threshold": 1000, - "charges": 49 - }, - { - "threshold": 200000, - "charges": 79 - } - ] - }, - "enabled": true, - "max_cart_items": 0, - "min_cart_value": 120, - "bulk_coupons": true - }, - "payment": { - "callback_url": { - "app": "", - "web": "" - }, - "methods": { - "PL": { - "enabled": true - }, - "CARD": { - "enabled": true - }, - "NB": { - "enabled": true - }, - "WL": { - "enabled": true - }, - "PS": { - "enabled": true - }, - "UPI": { - "enabled": true - }, - "QR": { - "enabled": true - }, - "COD": { - "enabled": true - }, - "PP": { - "enabled": true - }, - "JP": { - "enabled": false - }, - "PAC": { - "enabled": false - }, - "FC": { - "enabled": false - }, - "JIOPP": { - "enabled": false - }, - "STRIPEPG": { - "enabled": true - }, - "JUSPAYPG": { - "enabled": false - }, - "PAYUBIZPG": { - "enabled": true - }, - "PAYUMONEYPG": { - "enabled": true - }, - "RUPIFIPG": { - "enabled": false - }, - "SIMPL": { - "enabled": true - } - }, - "payment_selection_lock": { - "enabled": false, - "default_options": "", - "payment_identifier": "" - }, - "mode_of_payment": "UNIKET_B2B", - "source": "UNIKET", - "enabled": true, - "cod_amount_limit": 100000, - "cod_charges": 1500 - }, - "order": { - "enabled": true, - "force_reassignment": false - }, - "logistics": { - "logistics_by_seller": false, - "serviceability_check": true, - "same_day_delivery": true, - "dp_assignment": true - }, - "business": "retail", - "comms_enabled": true, - "platforms": [ - "uniket_wholesale" - ], - "_id": "5e04c76b8dd8c003577fdd0a", - "loyalty_points": { - "enabled": true, - "auto_apply": false - }, - "app": "000000000000000000000004", - "created_at": "2019-12-26T14:44:59.835Z", - "modified_at": "2021-03-09T15:40:29.208Z", - "__v": 3, - "modified_by": "5e199eed98cfe16dc61385de" -} -``` -
    - - - - - - - - - ---- - - -#### partiallyUpdateInventoryConfig -Partially update application configuration - - - -```swift -configuration.partiallyUpdateInventoryConfig(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| body | AppInventoryPartialUpdate | no | Request body | - - -Partially update application configuration for various features and data - -*Returned Response:* - - - - -[ApplicationInventory](#ApplicationInventory) - -Success - - - - -
    -  Example: - -```json -{ - "inventory": { - "brand": { - "criteria": "all", - "brands": [] - }, - "store": { - "criteria": "filter", - "stores": [], - "rules": [ - { - "companies": [ - 1, - 3, - 4 - ], - "brands": [] - } - ] - }, - "category": { - "criteria": "all", - "categories": [] - }, - "price": { - "min": 1, - "max": 10000 - }, - "discount": { - "min": 0, - "max": 100 - }, - "out_of_stock": true, - "franchise_enabled": true, - "exclude_category": [], - "image": [ - "standard", - "substandard", - "default" - ], - "company_store": [] - }, - "authentication": { - "required": true, - "provider": "fynd" - }, - "article_assignment": { - "rules": { - "store_priority": { - "enabled": false, - "storetype_order": [] - } - }, - "post_order_reassignment": true - }, - "reward_points": { - "credit": { - "enabled": true - }, - "debit": { - "enabled": true, - "auto_apply": false, - "strategy_channel": "REWARDS" - } - }, - "cart": { - "delivery_charges": { - "enabled": true, - "charges": [ - { - "threshold": 1000, - "charges": 49 - }, - { - "threshold": 200000, - "charges": 79 - } - ] - }, - "enabled": true, - "max_cart_items": 0, - "min_cart_value": 120, - "bulk_coupons": true - }, - "payment": { - "callback_url": { - "app": "", - "web": "" - }, - "methods": { - "PL": { - "enabled": true - }, - "CARD": { - "enabled": true - }, - "NB": { - "enabled": true - }, - "WL": { - "enabled": true - }, - "PS": { - "enabled": true - }, - "UPI": { - "enabled": true - }, - "QR": { - "enabled": true - }, - "COD": { - "enabled": true - }, - "PP": { - "enabled": true - }, - "JP": { - "enabled": false - }, - "PAC": { - "enabled": false - }, - "FC": { - "enabled": false - }, - "JIOPP": { - "enabled": false - }, - "STRIPEPG": { - "enabled": true - }, - "JUSPAYPG": { - "enabled": false - }, - "PAYUBIZPG": { - "enabled": true - }, - "PAYUMONEYPG": { - "enabled": true - }, - "RUPIFIPG": { - "enabled": false - }, - "SIMPL": { - "enabled": true - } - }, - "payment_selection_lock": { - "enabled": false, - "default_options": "", - "payment_identifier": "" - }, - "mode_of_payment": "UNIKET_B2B", - "source": "UNIKET", - "enabled": true, - "cod_amount_limit": 100000, - "cod_charges": 1500 - }, - "order": { - "enabled": true, - "force_reassignment": false - }, - "logistics": { - "logistics_by_seller": false, - "serviceability_check": true, - "same_day_delivery": true, - "dp_assignment": true - }, - "business": "retail", - "comms_enabled": true, - "platforms": [ - "uniket_wholesale" - ], - "_id": "5e04c76b8dd8c003577fdd0a", - "loyalty_points": { - "enabled": true, - "auto_apply": false - }, - "app": "000000000000000000000004", - "created_at": "2019-12-26T14:44:59.835Z", - "modified_at": "2021-03-09T15:40:29.208Z", - "__v": 3, - "modified_by": "5e199eed98cfe16dc61385de" -} -``` -
    - - - - - - - - - ---- - - -#### getAppCurrencyConfig -Get application enabled currency list - - - -```swift -configuration.getAppCurrencyConfig(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | - - - -Get application enabled currency list - -*Returned Response:* - - - - -[AppSupportedCurrency](#AppSupportedCurrency) - -Success - - - - -
    -  Example: - -```json -{ - "_id": "5ec7a85965c3893857538d93", - "supported_currency": [ - "5ec75d11f7bfb5a7d38f3524", - "5ec75d11f7bfb54d798f3516", - "5ec75d11f7bfb553b88f355f", - "5ec75d11f7bfb559d08f34d5", - "5ec75d11f7bfb5d1e98f34da" - ], - "application": "000000000000000000000004", - "default_currency": { - "ref": "5ec75d11f7bfb54d798f3516", - "code": "USD" - }, - "created_at": "2020-05-22T10:24:25.984Z", - "modified_at": "2021-03-09T10:47:32.664Z" -} -``` -
    - - - - - - - - - ---- - - -#### updateAppCurrencyConfig -Add initial application supported currency - - - -```swift -configuration.updateAppCurrencyConfig(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| body | AppSupportedCurrency | no | Request body | - - -Add initial application supported currency for various features and data. Default INR will be enabled. - -*Returned Response:* - - - - -[AppSupportedCurrency](#AppSupportedCurrency) - -Success - - - - -
    -  Example: - -```json -{ - "_id": "5ec7a85965c3893857538d93", - "supported_currency": [ - "5ec75d11f7bfb5a7d38f3524", - "5ec75d11f7bfb54d798f3516", - "5ec75d11f7bfb553b88f355f", - "5ec75d11f7bfb559d08f34d5", - "5ec75d11f7bfb5d1e98f34da" - ], - "application": "000000000000000000000004", - "default_currency": { - "ref": "5ec75d11f7bfb54d798f3516", - "code": "USD" - }, - "created_at": "2020-05-22T10:24:25.984Z", - "modified_at": "2021-03-09T10:47:32.664Z" -} -``` -
    - - - - - - - - - ---- - - -#### getOrderingStoresByFilter -Get ordering store by filter - - - -```swift -configuration.getOrderingStoresByFilter(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| pageNo | Int? | no | Current page no | -| pageSize | Int? | no | Current request items count | -| body | FilterOrderingStoreRequest | no | Request body | - - -Get ordering store by filter - -*Returned Response:* - - - - -[OrderingStores](#OrderingStores) - -Success - - - - -
    -  Example: - -```json -{ - "page": { - "type": "number", - "size": 10, - "current": 1, - "has_next": true, - "item_total": 583 - }, - "items": [ - { - "address": { - "state": "MAHARASHTRA", - "address1": "SAGAR TECH PLAZA, SAKINAKA", - "lat_long": { - "type": "Point", - "coordinates": [ - 1, - 1 - ] - }, - "pincode": 400070, - "country": "INDIA", - "city": "MUMBAI" - }, - "_id": "5f586563f509dd000145c02d", - "store_type": "high_street", - "uid": 11016, - "store_code": "HS-0c532", - "display_name": " Brand Company Store 11", - "name": " Brand Company Store 11", - "pincode": 400070, - "code": "HS-0c532" - }, - { - "address": { - "state": "MAHARASHTRA", - "address1": "UNNAMED ROAD, VASAI EAST SALT PLANT", - "lat_long": { - "type": "Point", - "coordinates": [ - 72.84293219999999, - 19.3805675 - ] - }, - "address2": "VASAI EAST SALT PLANT, VASAI EAST, ", - "pincode": 401208, - "country": "INDIA", - "city": "VIRAR", - "landmark": "" - }, - "_id": "5f585934f509dd000145c025", - "store_type": "high_street", - "uid": 11567, - "store_code": "123456", - "display_name": "2nd Store", - "name": "2nd Store", - "pincode": 401208, - "code": "123456" - }, - { - "address": { - "state": "GUJARAT", - "address1": "32, AANAND SHOPPING CENTRE ", - "lat_long": { - "type": "Point", - "coordinates": [ - 1, - 1 - ] - }, - "pincode": 380001, - "country": "INDIA", - "city": "AHMEDABAD" - }, - "_id": "5f587b5ef509dd000145c02f", - "store_type": "high_street", - "uid": 11568, - "store_code": "12345", - "display_name": "3rd ", - "name": "3rd ", - "pincode": 380001, - "code": "12345" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### updateOrderingStoreConfig -Add/Update ordering store config - - - -```swift -configuration.updateOrderingStoreConfig(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| body | OrderingStoreConfig | no | Request body | - - -Add/Update ordering store config. - -*Returned Response:* - - - - -[DeploymentMeta](#DeploymentMeta) - -Success - - - - -
    -  Example: - -```json -{ - "deployed_stores": [ - 1, - 10 - ], - "all_stores": false, - "enabled": true, - "type": "hard", - "_id": "5e7e5e4d6b5f3b4b54c95f9c", - "app": "000000000000000000000004", - "__v": 6 -} -``` -
    - - - - - - - - - ---- - - -#### getDomains -Get attached domain list - - - -```swift -configuration.getDomains(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | - - - -Get attached domain list. - -*Returned Response:* - - - - -[DomainsResponse](#DomainsResponse) - -Success - - - - -
    -  Example: - -```json -{ - "domains": [ - { - "_id": "5eb1177748312a3bd55d0f1e", - "verified": true, - "name": "uniket.hostx0.de", - "is_primary": true, - "is_default": true, - "is_shortlink": false - }, - { - "verified": true, - "is_primary": false, - "is_default": false, - "is_shortlink": true, - "_id": "5f0858c5f86e00cd42dccc8d", - "name": "jd.hostx0.de" - }, - { - "verified": true, - "is_primary": false, - "is_default": false, - "is_shortlink": false, - "_id": "6048497e87f5730423149190", - "name": "testdm.hostx0.de" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### addDomain -Add new domain to application - - - -```swift -configuration.addDomain(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| body | DomainAddRequest | no | Request body | - - -Add new domain to application. - -*Returned Response:* - - - - -[Domain](#Domain) - -Success - - - - -
    -  Example: - -```json -{ - "name": "testdm.hostx0.de", - "verified": true, - "txtRecords": [], - "message": "New domain added successfully", - "is_primary": false, - "is_default": false, - "is_shortlink": false, - "_id": "6048497e87f5730423149190" -} -``` -
    - - - - - - - - - ---- - - -#### removeDomainById -Remove attached domain - - - -```swift -configuration.removeDomainById(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| id | String | yes | Domain _id | - - - -Remove attached domain. - -*Returned Response:* - - - - -[SuccessMessageResponse](#SuccessMessageResponse) - -Success - - - - -
    -  Example: - -```json -{ - "message": "Domain removed successfully" -} -``` -
    - - - - - - - - - ---- - - -#### changeDomainType -Change domain type - - - -```swift -configuration.changeDomainType(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| body | UpdateDomainTypeRequest | no | Request body | - - -Change a domain to Primary or Shortlink domain - -*Returned Response:* - - - - -[DomainsResponse](#DomainsResponse) - -Success - - - - -
    -  Example: - -```json -{ - "domains": [ - { - "_id": "5eb1177748312a3bd55d0f1e", - "verified": true, - "name": "uniket.hostx0.de", - "is_primary": true, - "is_default": true, - "is_shortlink": false - }, - { - "verified": true, - "is_primary": false, - "is_default": false, - "is_shortlink": true, - "_id": "5f0858c5f86e00cd42dccc8d", - "name": "jd.hostx0.de" - }, - { - "verified": true, - "is_primary": false, - "is_default": false, - "is_shortlink": false, - "_id": "6048497e87f5730423149190", - "name": "testdm.hostx0.de" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getDomainStatus -Get domain connected status. - - - -```swift -configuration.getDomainStatus(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| body | DomainStatusRequest | no | Request body | - - -Get domain connected status. Check if domain is live and mapped to appropriate IP to fynd servers. - -*Returned Response:* - - - - -[DomainStatusResponse](#DomainStatusResponse) - -Success - - - - -
    -  Example: - -```json -{ - "connected": true, - "status": [ - { - "display": "Domain TXT record entry 5d65089e031f9029f8e8dc2f", - "status": true - }, - { - "display": "Domain pointing to 18.217.232.69 A record", - "status": true - }, - { - "display": "Domain pointing to 18.188.115.251 A record", - "status": true - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### createApplication -Create application - - - -```swift -configuration.createApplication(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| body | CreateApplicationRequest | no | Request body | - - -Create new application - -*Returned Response:* - - - - -[CreateAppResponse](#CreateAppResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getApplications -Get list of application under company - - - -```swift -configuration.getApplications(companyId: companyId, pageNo: pageNo, pageSize: pageSize, q: q) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| pageNo | Int? | no | | -| pageSize | Int? | no | | -| q | String? | no | Url encoded object used as mongodb query | - - - -Get list of application under company - -*Returned Response:* - - - - -[ApplicationsResponse](#ApplicationsResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getApplicationById -Get application data from id - - - -```swift -configuration.getApplicationById(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | - - - -Get application data from id - -*Returned Response:* - - - - -[Application](#Application) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getCurrencies -Get all currencies - - - -```swift -configuration.getCurrencies(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | - - - -Get all currencies - -*Returned Response:* - - - - -[CurrenciesResponse](#CurrenciesResponse) - -Currencies Success response - - - - -
    -  Example: - -```json -{ - "items": [ - { - "_id": "5ec75d11f7bfb54d798f3516", - "is_active": true, - "name": "United States Dollar", - "code": "USD", - "created_at": "2020-05-22T05:03:13.354Z", - "modified_at": "2020-06-05T09:12:04.248Z", - "decimal_digits": 2, - "symbol": "$" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getDomainAvailibility -Check domain availibility before linking to application - - - -```swift -configuration.getDomainAvailibility(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| body | DomainSuggestionsRequest | no | Request body | - - -Check domain availibility before linking to application. Also sends domain suggestions with similar to queried domain. \ Custom domain search is currently powered by GoDaddy provider. - -*Returned Response:* - - - - -[DomainSuggestionsResponse](#DomainSuggestionsResponse) - -Success - - - - -
    -  Examples: - - -
    -  Suggestions for fynd domains - -```json -{ - "value": { - "domains": [ - { - "name": "test.hostx1.de", - "is_available": false - }, - { - "name": "testhive.hostx1.de", - "is_available": true - } - ] - } -} -``` -
    - -
    -  Suggestions for custom domains - -```json -{ - "value": { - "domains": [ - { - "name": "test25.in", - "unsupported": false, - "is_available": false - }, - { - "name": "try25.in", - "unsupported": false, - "is_available": true, - "price": 14.99, - "currency": "USD" - } - ] - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### getIntegrationById -Get integration data - - - -```swift -configuration.getIntegrationById(companyId: companyId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| id | Int | yes | Integration id | - - - -Get integration data - -*Returned Response:* - - - - -[Integration](#Integration) - -Success - - - - -
    -  Example: - -```json -{ - "_id": "5ec376ce848a005189acb312", - "validators": { - "company": { - "browser_script": "", - "json_schema": { - "type": "object", - "required": [ - "ip_address", - "icode", - "gds_entity_id", - "auth_key" - ], - "properties": { - "gds_entity_id": { - "type": "string", - "title": "GDS Entity ID", - "minLength": 3, - "maxLength": 10, - "pattern": "^[a-zA-Z0-9]+$", - "description": "GDS Entity ID is a unique identifier provided by Ginesys to you." - }, - "ip_address": { - "type": "string", - "title": "IP Address", - "pattern": "(\\d{1,3}\\.){3}\\d{1,3}", - "description": "Enter IP address provided by Ginesys for your POS server" - }, - "auth_key": { - "title": "Auth Key", - "type": "string", - "maxLength": 500, - "description": "Provide authentication token provided by Ginesys to you." - }, - "icode": { - "title": "ICODE", - "type": "string", - "enum": [ - "ean", - "upc", - "alu", - "sku_code" - ], - "description": "Please select the correct SKU identifier that you use to provide inventory to Fynd." - } - } - } - }, - "store": { - "browser_script": "", - "json_schema": { - "type": "object", - "properties": { - "location_id": { - "type": "string", - "title": "Location ID", - "description": "Provide site code as per POS/SAP." - }, - "ip_address": { - "type": "string", - "title": "IP Address", - "pattern": "(\\d{1,3}\\.){3}\\d{1,3}", - "description": "Enter IP address provided by Ginesys for your POS server" - } - } - } - } - }, - "description": "Sap Integration west ELM brands", - "constants": {}, - "name": "SAP RBL Integration", - "meta": [ - { - "public": true, - "_id": "5ee3e246129be17ce0b59ef4", - "name": "price_level", - "value": "store" - } - ], - "icon": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1589868232/addsale/platform/integrations/icon/z3kj9p8nidx4zzmdutdu.svg", - "owner": "5e60e43dcd08cf01069eb23e", - "created_at": "2020-05-19T06:03:58.757Z", - "modified_at": "2020-06-15T12:00:42.598Z", - "token": "qk60vXqk-", - "secret": "Gp0dYInpUV", - "__v": 13, - "description_html": "" -} -``` -
    - - - - - - - - - ---- - - -#### getAvailableOptIns -Get all available integration opt-ins - - - -```swift -configuration.getAvailableOptIns(companyId: companyId, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| pageNo | Int? | no | Current page no | -| pageSize | Int? | no | Current request items count | - - - -Get all available integration opt-ins - -*Returned Response:* - - - - -[GetIntegrationsOptInsResponse](#GetIntegrationsOptInsResponse) - -Success - - - - -
    -  Example: - -```json -{ - "items": [ - { - "validators": { - "company": { - "json_schema": [ - { - "display": "Host", - "key": "host", - "type": "text", - "tooltip": "Enter host address" - } - ], - "browser_script": "" - }, - "store": { - "json_schema": [], - "browser_script": "" - }, - "inventory": { - "json_schema": [], - "browser_script": "" - }, - "order": { - "json_schema": [], - "browser_script": "" - } - }, - "description": "awesome integration", - "description_html": "", - "constants": "{\"mop_mapping\":{\"FYND\":\"FYND\"}}", - "companies": [], - "support": [ - "inventory", - "order" - ], - "_id": "5e56089f4265cf2846d1e58c", - "name": "x0-1", - "meta": [ - { - "public": true, - "_id": "5e56089f4265cf81e1d1e58e", - "name": "wow", - "value": "1" - } - ], - "icon": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1582696589/addsale/platform/integrations/icon/jihgcoibfmdttgiukwg0.png", - "owner": "5e55fe074bda3c392ed9eab2", - "created_at": "2020-02-26T05:56:47.214Z", - "modified_at": "2021-03-02T12:29:03.554Z", - "token": "fKoHRW5H", - "secret": "d1E85CTmf", - "__v": 12 - }, - { - "validators": { - "company": { - "json_schema": [], - "browser_script": "" - }, - "store": { - "json_schema": [], - "browser_script": "" - }, - "inventory": { - "json_schema": [], - "browser_script": "" - }, - "order": { - "json_schema": [], - "browser_script": "" - } - }, - "description": "jabardast", - "description_html": "", - "constants": "{\"mop_mapping\":{\"FYND\":\"FYND\"}}", - "companies": [], - "support": [ - "inventory", - "order" - ], - "_id": "5e5608bf4265cf7198d1e58f", - "name": "x0-2", - "meta": [ - { - "public": false, - "_id": "5e5608bf4265cf813fd1e590", - "name": "wow", - "value": "1" - } - ], - "icon": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1582696633/addsale/platform/integrations/icon/cstvvkgjgip1ja56gq4x.png", - "owner": "5e55fe074bda3c392ed9eab2", - "created_at": "2020-02-26T05:57:19.875Z", - "modified_at": "2021-02-15T05:23:55.962Z", - "token": "3h3_mnzp", - "secret": "dgGHrIlFG", - "__v": 7 - } - ], - "page": { - "type": "number", - "current": 1, - "size": 50, - "item_total": 24, - "has_next": false - } -} -``` -
    - - - - - - - - - ---- - - -#### getSelectedOptIns -Get company/store level integration opt-ins - - - -```swift -configuration.getSelectedOptIns(companyId: companyId, level: level, uid: uid, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| level | String | yes | Integration level | -| uid | Int | yes | Integration level uid | -| pageNo | Int? | no | Current page no | -| pageSize | Int? | no | Current request items count | - - - -Get company/store level integration opt-ins - -*Returned Response:* - - - - -[GetIntegrationsOptInsResponse](#GetIntegrationsOptInsResponse) - -Success - - - - -
    -  Example: - -```json -{ - "items": [ - { - "validators": { - "company": { - "json_schema": [ - { - "display": "Host", - "key": "host", - "type": "text", - "tooltip": "Enter host address" - } - ], - "browser_script": "" - }, - "store": { - "json_schema": [], - "browser_script": "" - }, - "inventory": { - "json_schema": [], - "browser_script": "" - }, - "order": { - "json_schema": [], - "browser_script": "" - } - }, - "description": "awesome integration", - "description_html": "", - "constants": "{\"mop_mapping\":{\"FYND\":\"FYND\"}}", - "companies": [], - "support": [ - "inventory", - "order" - ], - "_id": "5e56089f4265cf2846d1e58c", - "name": "x0-1", - "meta": [ - { - "public": true, - "_id": "5e56089f4265cf81e1d1e58e", - "name": "wow", - "value": "1" - } - ], - "icon": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1582696589/addsale/platform/integrations/icon/jihgcoibfmdttgiukwg0.png", - "owner": "5e55fe074bda3c392ed9eab2", - "created_at": "2020-02-26T05:56:47.214Z", - "modified_at": "2021-03-02T12:29:03.554Z", - "token": "fKoHRW5H", - "secret": "d1E85CTmf", - "__v": 12 - }, - { - "validators": { - "company": { - "json_schema": [], - "browser_script": "" - }, - "store": { - "json_schema": [], - "browser_script": "" - }, - "inventory": { - "json_schema": [], - "browser_script": "" - }, - "order": { - "json_schema": [], - "browser_script": "" - } - }, - "description": "jabardast", - "description_html": "", - "constants": "{\"mop_mapping\":{\"FYND\":\"FYND\"}}", - "companies": [], - "support": [ - "inventory", - "order" - ], - "_id": "5e5608bf4265cf7198d1e58f", - "name": "x0-2", - "meta": [ - { - "public": false, - "_id": "5e5608bf4265cf813fd1e590", - "name": "wow", - "value": "1" - } - ], - "icon": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1582696633/addsale/platform/integrations/icon/cstvvkgjgip1ja56gq4x.png", - "owner": "5e55fe074bda3c392ed9eab2", - "created_at": "2020-02-26T05:57:19.875Z", - "modified_at": "2021-02-15T05:23:55.962Z", - "token": "3h3_mnzp", - "secret": "dgGHrIlFG", - "__v": 7 - } - ], - "page": { - "type": "number", - "current": 1, - "size": 50, - "item_total": 24, - "has_next": false - } -} -``` -
    - - - - - - - - - ---- - - -#### getIntegrationLevelConfig -Get integration level config - - - -```swift -configuration.getIntegrationLevelConfig(companyId: companyId, id: id, level: level, opted: opted, checkPermission: checkPermission) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| id | String | yes | Integration id | -| level | String | yes | Integration level | -| opted | Bool? | no | Filter on opted stores | -| checkPermission | Bool? | no | Filter on if permissions are present | - - - -Get integration/integration-opt-in level config - -*Returned Response:* - - - - -[IntegrationConfigResponse](#IntegrationConfigResponse) - -Success - - - - -
    -  Example: - -```json -{ - "items": [ - { - "opted": false, - "permissions": [], - "last_patch": [], - "_id": "5ec377f2848a0073feacb31b", - "integration": "5ec376ce848a005189acb312", - "level": "store", - "uid": 1, - "meta": [], - "token": "1RuGX0Fyp", - "created_at": "2020-05-19T06:08:50.199Z", - "modified_at": "2020-08-17T07:54:01.809Z", - "__v": 14, - "data": { - "location_id": "09876", - "ip_address": "1.2.3.4" - } - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getIntegrationByLevelId -Get level data for integration - - - -```swift -configuration.getIntegrationByLevelId(companyId: companyId, id: id, level: level, uid: uid) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| id | String | yes | Integration id | -| level | String | yes | Integration level | -| uid | Int | yes | Integration level uid | - - - -Get level data for integration - -*Returned Response:* - - - - -[IntegrationLevel](#IntegrationLevel) - -Success - - - - -
    -  Example: - -```json -{ - "opted": false, - "permissions": [], - "last_patch": [], - "_id": "5ec377f2848a0073feacb31b", - "integration": "5ec376ce848a005189acb312", - "level": "store", - "uid": 1, - "meta": [], - "token": "1RuGX0Fyp", - "created_at": "2020-05-19T06:08:50.199Z", - "modified_at": "2020-08-17T07:54:01.809Z", - "__v": 14, - "data": { - "location_id": "09876", - "ip_address": "1.2.3.4" - } -} -``` -
    - - - - - - - - - ---- - - -#### getLevelActiveIntegrations -Check store has active integration - - - -```swift -configuration.getLevelActiveIntegrations(companyId: companyId, id: id, level: level, uid: uid) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| id | String | yes | Integration id | -| level | String | yes | Integration level | -| uid | Int | yes | Integration level uid | - - - -API checks if a store is already opted in any other integrations - -*Returned Response:* - - - - -[OptedStoreIntegration](#OptedStoreIntegration) - -Success - - - - -
    -  Example: - -```json -{ - "opted": false, - "permissions": [], - "last_patch": [], - "_id": "5ec377f2848a0073feacb31b", - "integration": "5ec376ce848a005189acb312", - "level": "store", - "uid": 1, - "meta": [], - "token": "1RuGX0Fyp", - "created_at": "2020-05-19T06:08:50.199Z", - "modified_at": "2020-08-17T07:54:01.809Z", - "__v": 14, - "data": { - "location_id": "09876", - "ip_address": "1.2.3.4" - } -} -``` -
    - - - - - - - - - ---- - - -#### getBrandsByCompany -Get brands by company - - - -```swift -configuration.getBrandsByCompany(companyId: companyId, q: q) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| q | String? | no | Search text for brand name | - - - -Get brands by company - -*Returned Response:* - - - - -[BrandsByCompanyResponse](#BrandsByCompanyResponse) - -Success - - - - -
    -  Example: - -```json -{ - "brands": [ - { - "name": "5th Avenue", - "value": 476, - "brand_logo_url": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/--unnamed--/1595615012186.jpeg", - "brand_banner_url": "https://hdn-1.addsale.com/x0/seller/pictures/landscape-banner/original/--unnamed--/1595615012724.jpeg", - "brand_banner_portrait_url": "https://hdn-1.addsale.com/x0/seller/pictures/portrait-banner/original/--unnamed--/1595615013203.jpeg" - }, - { - "name": "Abhay", - "value": 47, - "brand_logo_url": "https://hdn-1.fynd.com/brands/pictures/square-logo/resize-h:200,w:0/9fG6jZUJV-brand-Slamay.png", - "brand_banner_url": "https://hdn-1.addsale.com/x0/seller/pictures/landscape-banner/original/cpApcg_insta_01.jpg034422ca-b739-4a30-ba9c-87ca32e8c2ef/cpApcg_insta_01.jpg", - "brand_banner_portrait_url": "https://hdn-1.addsale.com/x0/seller/pictures/portrait-banner/original/mtaSMv_insta_01.jpga088b881-886d-4b5a-b82f-139bd2aa3f35/mtaSMv_insta_01.jpg" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getCompanyByBrands -Get company by brand uids - - - -```swift -configuration.getCompanyByBrands(companyId: companyId, pageNo: pageNo, pageSize: pageSize, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| pageNo | Int? | no | Current page no | -| pageSize | Int? | no | Current request items count | -| body | CompanyByBrandsRequest | no | Request body | - - -Get company by brand uids - -*Returned Response:* - - - - -[CompanyByBrandsResponse](#CompanyByBrandsResponse) - -Success - - - - -
    -  Example: - -```json -{ - "items": [ - { - "company_name": "RELIANCE RETAIL LTD", - "company_id": 1 - }, - { - "company_name": "SARASUOLE PRIVATE LIMITED", - "company_id": 3 - }, - { - "company_name": "Lloyd Palek", - "company_id": 4 - } - ], - "page": { - "type": "number", - "current": 1, - "size": 200, - "item_total": 171, - "has_next": false - } -} -``` -
    - - - - - - - - - ---- - - -#### getStoreByBrands -Get stores by brand uids - - - -```swift -configuration.getStoreByBrands(companyId: companyId, pageNo: pageNo, pageSize: pageSize, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| pageNo | Int? | no | Current page no | -| pageSize | Int? | no | Current request items count | -| body | StoreByBrandsRequest | no | Request body | - - -Get stores by brand uids - -*Returned Response:* - - - - -[StoreByBrandsResponse](#StoreByBrandsResponse) - -Success - - - - -
    -  Example: - -```json -{ - "items": [ - { - "store_name": "RRL01", - "store_id": 1, - "store_type": "warehouse", - "store_code": "WH_8513", - "store_address": { - "state": "MAHARASHTRA", - "address1": "SHOPSENSE RETAIL TECHNOLOGIES PRIVATE LIMITED 1ST FLOOR WEWORK VIJAY DIAMOND, CROSS RD B, AJIT NAGAR,", - "lat_long": { - "type": "Point", - "coordinates": [ - 72.8691788, - 19.1174114 - ] - }, - "address2": "KONDIVITA, ANDHERI EAST, MUMBAI, MAHARASHTRA 400069", - "pincode": 400059, - "country": "INDIA", - "city": "MUMBAI" - }, - "company": { - "uid": 1, - "name": "RELIANCE RETAIL LTD" - } - }, - { - "store_name": "RUOSH WAREHOUSE", - "store_id": 2, - "store_type": "warehouse", - "store_code": "RUOSH43", - "store_address": { - "state": "MAHARASHTRA", - "address1": "RAUNAK CITY SECTOR 4 D10, SAPAD GAON", - "lat_long": { - "type": "Point", - "coordinates": [ - 73.121952, - 19.2645048 - ] - }, - "address2": "SAPAD GAON, KHADAKPADA, ", - "pincode": 421301, - "country": "INDIA", - "city": "THANE", - "landmark": "near taj" - }, - "company": { - "uid": 3, - "name": "SARASUOLE PRIVATE LIMITED" - } - } - ], - "page": { - "type": "number", - "current": 1, - "size": 200, - "item_total": 762, - "has_next": true - } -} -``` -
    - - - - - - - - - ---- - - -#### getOtherSellerApplications -Get other seller applications - - - -```swift -configuration.getOtherSellerApplications(companyId: companyId, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| pageNo | Int? | no | Current page no | -| pageSize | Int? | no | Current request items count | - - - -Get other seller applications who has opted current company as inventory - -*Returned Response:* - - - - -[OtherSellerApplications](#OtherSellerApplications) - -Success - - - - -
    -  Example: - -```json -{ - "items": [ - { - "name": "intent 2", - "description": "", - "_id": "5f030880f019afd636889afc", - "domain": "intent.hostx0.de", - "company": { - "uid": 94, - "name": "DummyImran" - }, - "opt_type": "store" - }, - { - "name": "new application imran", - "description": "", - "_id": "5f03f5d17692029e2d1a50a5", - "domain": "imranstore.hostx0.de", - "company": { - "uid": 94, - "name": "DummyImran" - }, - "opt_type": "store" - }, - { - "name": "helo", - "description": "", - "_id": "5f03f63b769202170c1a50a9", - "domain": "helo.hostx0.de", - "company": { - "uid": 7, - "name": "Zack Burgdorf" - }, - "opt_type": "store" - } - ], - "page": { - "type": "number", - "current": 1, - "size": 10, - "item_total": 20, - "has_next": true - } -} -``` -
    - - - - - - - - - ---- - - -#### getOtherSellerApplicationById -Get other seller applications - - - -```swift -configuration.getOtherSellerApplicationById(companyId: companyId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| id | String | yes | Application Id | - - - -Get other seller application - -*Returned Response:* - - - - -[OptedApplicationResponse](#OptedApplicationResponse) - -Success - - - - -
    -  Example: - -```json -{ - "name": "intent 2", - "description": "", - "_id": "5f030880f019afd636889afc", - "domain": "intent.hostx0.de", - "company": { - "uid": 94, - "name": "DummyImran" - }, - "opted_inventory": { - "opt_type": { - "key": "store", - "display": "Store" - }, - "items": [ - { - "name": "RRL01", - "id": 1, - "store_code": "WH_8513", - "_id": "5ec2c0b168fc2800017112f5", - "modified_on": "2020-09-09T04:25:55.843Z", - "uid": 1, - "address": { - "state": "MAHARASHTRA", - "address1": "SHOPSENSE RETAIL TECHNOLOGIES PRIVATE LIMITED 1ST FLOOR WEWORK VIJAY DIAMOND, CROSS RD B, AJIT NAGAR,", - "lat_long": { - "type": "Point", - "coordinates": [ - 72.8691788, - 19.1174114 - ] - }, - "address2": "KONDIVITA, ANDHERI EAST, MUMBAI, MAHARASHTRA 400069", - "pincode": 400059, - "country": "INDIA", - "city": "MUMBAI" - }, - "display_name": "RRL01", - "store_type": "warehouse", - "company_id": 1 - } - ] - }, - "opt_out_inventory": { - "store": [], - "company": [] - } -} -``` -
    - - - - - - - - - ---- - - -#### optOutFromApplication -Opt out company or store from other seller application - - - -```swift -configuration.optOutFromApplication(companyId: companyId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| id | String | yes | Application Id | -| body | OptOutInventory | no | Request body | - - -Opt out company or store from other seller application - -*Returned Response:* - - - - -[SuccessMessageResponse](#SuccessMessageResponse) - -Success - - - - -
    -  Example: - -```json -{ - "message": "Updated opt out data" -} -``` -
    - - - - - - - - - ---- - - - - -## Cart - - -#### getCoupons -Get with single coupon details or coupon list - - - -```swift -cart.getCoupons(companyId: companyId, applicationId: applicationId, pageNo: pageNo, pageSize: pageSize, isArchived: isArchived, title: title, isPublic: isPublic, isDisplay: isDisplay, typeSlug: typeSlug, code: code) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current Application _id | -| pageNo | Int? | no | | -| pageSize | Int? | no | | -| isArchived | Bool? | no | | -| title | String? | no | | -| isPublic | Bool? | no | | -| isDisplay | Bool? | no | | -| typeSlug | String? | no | | -| code | String? | no | | - - - -Get coupon list with pagination - -*Returned Response:* - - - - -[CouponsResponse](#CouponsResponse) - -Coupon List for sent page_size and page_no - - - - -
    -  Examples: - - -
    -  Coupon list for sent filter and page size - -```json -{ - "value": { - "items": [ - { - "_id": "5e1d9bec6d6b7e000146c840", - "display_meta": { - "title": "percent50 title" - }, - "_schedule": { - "next_schedule": [ - { - "start": "2020-01-14T10:45:03.600000+00:00", - "end": "2020-01-16T10:45:03+00:00" - } - ], - "duration": null, - "start": "2020-01-14T10:45:03.600000+00:00", - "end": "2020-01-16T10:45:03+00:00", - "cron": "" - }, - "state": { - "is_public": true, - "is_display": true, - "is_archived": false - }, - "ownership": { - "payable_category": "seller", - "payable_by": "" - }, - "code": "percent50", - "rule_definition": { - "type": "percentage", - "scope": [ - "category_id" - ], - "applicable_on": "quantity" - } - } - ], - "page": { - "has_next": true, - "size": 10, - "current": 1, - "item_total": 30 - } - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### createCoupon -Create new coupon - - - -```swift -cart.createCoupon(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current Application _id | -| body | CouponAdd | no | Request body | - - -Create new coupon - -*Returned Response:* - - - - -[SuccessMessage](#SuccessMessage) - -Coupon Created successfully - - - - -
    -  Example: - -```json -{ - "success": true, - "message": "Coupon Created" -} -``` -
    - - - - - - - - - ---- - - -#### getCouponById -Get with single coupon details or coupon list - - - -```swift -cart.getCouponById(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current Application _id | -| id | String | yes | | - - - -Get single coupon details with `id` in path param - -*Returned Response:* - - - - -[CouponUpdate](#CouponUpdate) - -Coupon object for sent `id` - - - - -
    -  Example: - -```json -{ - "_id": "5e1d9bec6d6b7e000146c840", - "validation": { - "anonymous": true, - "app_id": [ - "5cd3db5e9d692cfe5302a7ba" - ], - "user_registered_after": null - }, - "rule": [ - { - "key": 1, - "max": 1500, - "min": 3000, - "value": 50 - } - ], - "display_meta": { - "title": "percent50 title", - "description": "percent50 description", - "auto": { - "title": "", - "subtitle": "" - }, - "subtitle": "percent50 subtitle", - "remove": { - "title": "", - "subtitle": "" - }, - "apply": { - "title": "percen50 mt", - "subtitle": "percen50 ms" - } - }, - "date_meta": { - "modified_on": "2020-02-04T14:27:00.577000+00:00", - "created_on": "2020-01-14T10:46:04.474000+00:00" - }, - "action": { - "action_date": null, - "txn_mode": "coupon" - }, - "identifiers": { - "category_id": [ - 465, - 192, - 133, - 134, - 150, - 151, - 155, - 193, - 157, - 191, - 154, - 152, - 417, - 168, - 416, - 167, - 166, - 162, - 161, - 163, - 165, - 160 - ], - "user_id": [], - "store_id": [], - "company_id": [] - }, - "author": { - "modified_by": "23109086", - "created_by": "23206328" - }, - "_schedule": { - "next_schedule": [ - { - "start": "2020-01-14T10:45:03.600000+00:00", - "end": "2020-01-16T10:45:03+00:00" - } - ], - "duration": null, - "start": "2020-01-14T10:45:03.600000+00:00", - "end": "2020-01-16T10:45:03+00:00", - "cron": "" - }, - "state": { - "is_public": true, - "is_display": true, - "is_archived": false - }, - "ownership": { - "payable_category": "seller", - "payable_by": "" - }, - "validity": { - "priority": 0 - }, - "code": "percent50", - "rule_definition": { - "calculate_on": "esp", - "value_type": "percentage", - "is_exact": false, - "type": "percentage", - "scope": [ - "category_id" - ], - "auto_apply": false, - "applicable_on": "quantity", - "currency_code": "INR" - }, - "restrictions": { - "price_range": { - "max": -1, - "min": -1 - }, - "uses": { - "remaining": { - "app": -1, - "user": -1, - "total": -1 - }, - "maximum": { - "app": -1, - "user": -1, - "total": -1 - } - }, - "post_order": { - "cancellation_allowed": true, - "return_allowed": true - }, - "platforms": [ - "web", - "android", - "ios" - ] - }, - "type_slug": "percentage_quantity_percentage" -} -``` -
    - - - - - - - - - ---- - - -#### updateCoupon -Update existing coupon configuration - - - -```swift -cart.updateCoupon(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current Application _id | -| id | String | yes | | -| body | CouponUpdate | no | Request body | - - -Update coupon with id sent in `id` - -*Returned Response:* - - - - -[SuccessMessage](#SuccessMessage) - -Coupon updated successfully - - - - -
    -  Example: - -```json -{ - "success": true, - "message": "Coupon Updated" -} -``` -
    - - - - - - - - - ---- - - -#### updateCouponPartially -Update coupon archive state and schedule - - - -```swift -cart.updateCouponPartially(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current Application _id | -| id | String | yes | | -| body | CouponPartialUpdate | no | Request body | - - -Update archive/unarchive and change schedule for coupon - -*Returned Response:* - - - - -[SuccessMessage](#SuccessMessage) - -Coupon updated successfully - - - - -
    -  Examples: - - -
    -  Archive or Unarchive coupon - -```json -{ - "value": { - "success": true, - "message": "Coupon Updated" - } -} -``` -
    - -
    -  Coupon schedule updated successfully - -```json -{ - "value": { - "success": true, - "message": "Coupon schedule updated" - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### fetchAndvalidateCartItems -Fetch Cart Details - - - -```swift -cart.fetchAndvalidateCartItems(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current Application _id | -| body | OpenapiCartDetailsRequest | no | Request body | - - -Get all the details of cart for a list of provided `cart_items` - -*Returned Response:* - - - - -[OpenapiCartDetailsResponse](#OpenapiCartDetailsResponse) - -Cart details with breakup - - - - -
    -  Example: - -```json -{ - "items": [ - { - "quantity": 1, - "message": "", - "coupon_message": "", - "product": { - "type": "product", - "uid": 803140, - "name": "Green Solid T-Shirt", - "slug": "celio-green-solid-t-shirt-803140-dd9e2c", - "brand": { - "uid": 44, - "name": "celio" - }, - "categories": [ - { - "uid": 192, - "name": "T-Shirts" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/44_NEMIEL@GREENBRITISH/1_1548161273344.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/44_NEMIEL@GREENBRITISH/1_1548161273344.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/celio-green-solid-t-shirt-803140-dd9e2c/", - "query": { - "product_slug": [ - "celio-green-solid-t-shirt-803140-dd9e2c" - ] - } - } - }, - "article": { - "type": "article", - "uid": "25_44_A7050_NEMIEL@GREENBRITISH_S", - "size": "S", - "seller": { - "uid": 25, - "name": "CELIO FUTURE FASHION PRIVATE LIMITED" - }, - "store": { - "uid": 1486, - "name": "Forum Mall" - }, - "quantity": 1, - "price": { - "base": { - "marked": 1299, - "effective": 649.5, - "currency_code": "INR" - }, - "converted": { - "marked": 1299, - "effective": 649.5, - "currency_code": "INR" - } - } - }, - "key": "803140_S", - "discount": "50% OFF", - "price": { - "base": { - "add_on": 0, - "marked": 1299, - "effective": 649.5, - "selling": 649.5, - "currency_code": "INR" - }, - "converted": { - "add_on": 0, - "marked": 1299, - "effective": 649.5, - "selling": 649.5, - "currency_code": "INR" - } - }, - "availability": { - "sizes": [ - "L", - "XL", - "M", - "S" - ], - "other_store_quantity": 0, - "out_of_stock": false, - "deliverable": true, - "is_valid": true, - "available_sizes": [ - { - "is_available": true, - "display": "L", - "value": "L" - }, - { - "is_available": true, - "display": "XXL", - "value": "XXL" - }, - { - "is_available": true, - "display": "XL", - "value": "XL" - }, - { - "is_available": true, - "display": "M", - "value": "M" - }, - { - "is_available": true, - "display": "S", - "value": "S" - }, - { - "is_available": false, - "display": "30", - "value": "30" - } - ] - }, - "bulk_offer": {} - }, - { - "quantity": 1, - "message": "Out of stock. Please remove item", - "coupon_message": "", - "product": { - "type": "product", - "uid": 803140, - "name": "Green Solid T-Shirt", - "slug": "celio-green-solid-t-shirt-803140-dd9e2c", - "brand": { - "uid": 44, - "name": "celio" - }, - "categories": [ - { - "uid": 192, - "name": "T-Shirts" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/44_NEMIEL@GREENBRITISH/1_1548161273344.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/44_NEMIEL@GREENBRITISH/1_1548161273344.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/celio-green-solid-t-shirt-803140-dd9e2c/", - "query": { - "product_slug": [ - "celio-green-solid-t-shirt-803140-dd9e2c" - ] - } - } - }, - "article": {}, - "key": "803140_S", - "discount": "", - "price": { - "base": { - "add_on": 0, - "marked": 1299, - "effective": 1299, - "selling": 1299, - "currency_code": "INR" - }, - "converted": { - "add_on": 0, - "marked": 1299, - "effective": 1299, - "selling": 1299, - "currency_code": "INR" - } - }, - "availability": { - "sizes": [ - "L", - "XXL", - "XL", - "M", - "S" - ], - "other_store_quantity": 0, - "out_of_stock": true, - "deliverable": false, - "is_valid": false, - "available_sizes": [ - { - "is_available": true, - "display": "L", - "value": "L" - }, - { - "is_available": true, - "display": "XXL", - "value": "XXL" - }, - { - "is_available": true, - "display": "XL", - "value": "XL" - }, - { - "is_available": true, - "display": "M", - "value": "M" - }, - { - "is_available": true, - "display": "S", - "value": "S" - }, - { - "is_available": false, - "display": "30", - "value": "30" - } - ] - }, - "bulk_offer": {} - } - ], - "is_valid": false, - "breakup_values": { - "display": [ - { - "display": "MRP Total", - "key": "mrp_total", - "value": 2598, - "currency_code": "INR" - }, - { - "display": "Discount", - "key": "discount", - "value": -649, - "currency_code": "INR" - }, - { - "display": "Subtotal", - "key": "subtotal", - "value": 1949, - "currency_code": "INR" - }, - { - "display": "Total", - "key": "total", - "value": 1949, - "currency_code": "INR" - } - ], - "raw": { - "cod_charge": 0, - "convenience_fee": 0, - "coupon": 0, - "delivery_charge": 0, - "discount": -649.5, - "fynd_cash": 0, - "gst_charges": 170.11, - "mrp_total": 2598, - "subtotal": 1948.5, - "total": 1948.5, - "vog": 1778.39, - "you_saved": 0 - } - } -} -``` -
    - - - - - - - - - ---- - - -#### checkCartServiceability -Check Pincode Serviceability - - - -```swift -cart.checkCartServiceability(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current Application _id | -| body | OpenApiCartServiceabilityRequest | no | Request body | - - -Check Pincode serviceability for cart items provided in `cart_items` and address pincode in `shipping_address` - -*Returned Response:* - - - - -[OpenApiCartServiceabilityResponse](#OpenApiCartServiceabilityResponse) - -Cart details with pincode validity information at item level - - - - -
    -  Examples: - - -
    -  Valid pincode - -```json -{ - "value": { - "items": [ - { - "quantity": 1, - "message": "", - "coupon_message": "", - "product": { - "type": "product", - "uid": 803140, - "name": "Green Solid T-Shirt", - "slug": "celio-green-solid-t-shirt-803140-dd9e2c", - "brand": { - "uid": 44, - "name": "celio" - }, - "categories": [ - { - "uid": 192, - "name": "T-Shirts" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/44_NEMIEL@GREENBRITISH/1_1548161273344.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/44_NEMIEL@GREENBRITISH/1_1548161273344.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/celio-green-solid-t-shirt-803140-dd9e2c/", - "query": { - "product_slug": [ - "celio-green-solid-t-shirt-803140-dd9e2c" - ] - } - } - }, - "article": { - "type": "article", - "uid": "25_44_A7050_NEMIEL@GREENBRITISH_S", - "size": "S", - "seller": { - "uid": 25, - "name": "CELIO FUTURE FASHION PRIVATE LIMITED" - }, - "store": { - "uid": 1486, - "name": "Forum Mall" - }, - "quantity": 1, - "price": { - "base": { - "marked": 1299, - "effective": 649.5, - "currency_code": "INR" - }, - "converted": { - "marked": 1299, - "effective": 649.5, - "currency_code": "INR" - } - } - }, - "key": "803140_S", - "discount": "50% OFF", - "price": { - "base": { - "add_on": 0, - "marked": 1299, - "effective": 649.5, - "selling": 649.5, - "currency_code": "INR" - }, - "converted": { - "add_on": 0, - "marked": 1299, - "effective": 649.5, - "selling": 649.5, - "currency_code": "INR" - } - }, - "availability": { - "sizes": [ - "L", - "XL", - "M", - "S" - ], - "other_store_quantity": 0, - "out_of_stock": false, - "deliverable": true, - "is_valid": true, - "delivery_promise": { - "timestamp": { - "min": 1605306343, - "max": 1605468343 - }, - "formatted": { - "min": "Sat, 14 Nov", - "max": "Mon, 16 Nov" - } - }, - "available_sizes": [ - { - "is_available": true, - "display": "L", - "value": "L" - }, - { - "is_available": true, - "display": "XXL", - "value": "XXL" - }, - { - "is_available": true, - "display": "XL", - "value": "XL" - }, - { - "is_available": true, - "display": "M", - "value": "M" - }, - { - "is_available": true, - "display": "S", - "value": "S" - }, - { - "is_available": false, - "display": "30", - "value": "30" - } - ] - }, - "bulk_offer": {} - }, - { - "quantity": 1, - "message": "Out of stock. Please remove item", - "coupon_message": "", - "product": { - "type": "product", - "uid": 803140, - "name": "Green Solid T-Shirt", - "slug": "celio-green-solid-t-shirt-803140-dd9e2c", - "brand": { - "uid": 44, - "name": "celio" - }, - "categories": [ - { - "uid": 192, - "name": "T-Shirts" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/44_NEMIEL@GREENBRITISH/1_1548161273344.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/44_NEMIEL@GREENBRITISH/1_1548161273344.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/celio-green-solid-t-shirt-803140-dd9e2c/", - "query": { - "product_slug": [ - "celio-green-solid-t-shirt-803140-dd9e2c" - ] - } - } - }, - "article": {}, - "key": "803140_S", - "discount": "", - "price": { - "base": { - "add_on": 0, - "marked": 1299, - "effective": 1299, - "selling": 1299, - "currency_code": "INR" - }, - "converted": { - "add_on": 0, - "marked": 1299, - "effective": 1299, - "selling": 1299, - "currency_code": "INR" - } - }, - "availability": { - "sizes": [ - "L", - "XXL", - "XL", - "M", - "S" - ], - "other_store_quantity": 0, - "out_of_stock": true, - "deliverable": false, - "is_valid": false, - "delivery_promise": { - "timestamp": { - "min": 1605306343, - "max": 1605468343 - }, - "formatted": { - "min": "Sat, 14 Nov", - "max": "Mon, 16 Nov" - } - }, - "available_sizes": [ - { - "is_available": true, - "display": "L", - "value": "L" - }, - { - "is_available": true, - "display": "XXL", - "value": "XXL" - }, - { - "is_available": true, - "display": "XL", - "value": "XL" - }, - { - "is_available": true, - "display": "M", - "value": "M" - }, - { - "is_available": true, - "display": "S", - "value": "S" - }, - { - "is_available": false, - "display": "30", - "value": "30" - } - ] - }, - "bulk_offer": {} - } - ], - "delivery_promise": { - "timestamp": { - "min": 1605306343, - "max": 1605468343 - }, - "formatted": { - "min": "Sat, 14 Nov", - "max": "Mon, 16 Nov" - } - }, - "is_valid": true - } -} -``` -
    - -
    -  Invalid pincode - -```json -{ - "value": { - "message": "All of the items in your cart are not deliverable to 800108", - "is_valid": false, - "items": [ - { - "discount": "15% OFF", - "price": { - "base": { - "add_on": 0, - "marked": 2195, - "effective": 1866, - "selling": 1866, - "currency_code": "INR" - }, - "converted": { - "add_on": 0, - "marked": 2195, - "effective": 1866, - "selling": 1866, - "currency_code": "INR" - } - }, - "product": { - "type": "product", - "uid": 876245, - "name": "Brown Sandals", - "slug": "red-chief-brown-sandals-876245-c92507", - "brand": { - "uid": 433, - "name": "" - }, - "categories": [ - { - "uid": 176, - "name": "" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/433_RC330004/1_1564147181287.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/433_RC330004/1_1564147181287.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/red-chief-brown-sandals-876245-c92507/", - "query": { - "product_slug": [ - "red-chief-brown-sandals-876245-c92507" - ] - } - }, - "item_code": "RC330004" - }, - "bulk_offer": {}, - "key": "876245_6", - "message": "We are not delivering to 800108", - "delivery_promise": null, - "coupon_message": "", - "availability": { - "sizes": [ - "7", - "6", - "10", - "8" - ], - "other_store_quantity": 21, - "out_of_stock": false, - "deliverable": false, - "is_valid": true, - "available_sizes": [ - { - "is_available": false, - "display": "9", - "value": "9" - }, - { - "is_available": true, - "display": "10", - "value": "10" - }, - { - "is_available": true, - "display": "6", - "value": "6" - }, - { - "is_available": true, - "display": "7", - "value": "7" - }, - { - "is_available": true, - "display": "8", - "value": "8" - } - ] - }, - "quantity": 1, - "article": { - "type": "article", - "uid": "304_433_LGPL30402_RC330004_6", - "size": "6", - "seller": { - "uid": 304, - "name": "LEAYAN GLOBAL PVT. LTD." - }, - "store": { - "uid": 9767, - "name": "Udyog Kunj, Kanpur" - }, - "quantity": 3, - "price": { - "base": { - "marked": 2195, - "effective": 1866, - "currency_code": "INR" - }, - "converted": { - "marked": 2195, - "effective": 1866, - "currency_code": "INR" - } - } - } - }, - { - "discount": "15% OFF", - "price": { - "base": { - "add_on": 0, - "marked": 2195, - "effective": 1866, - "selling": 1866, - "currency_code": "INR" - }, - "converted": { - "add_on": 0, - "marked": 2195, - "effective": 1866, - "selling": 1866, - "currency_code": "INR" - } - }, - "product": { - "type": "product", - "uid": 876245, - "name": "Brown Sandals", - "slug": "red-chief-brown-sandals-876245-c92507", - "brand": { - "uid": 433, - "name": "" - }, - "categories": [ - { - "uid": 176, - "name": "" - } - ], - "images": [ - { - "aspect_ratio": "16:25", - "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/433_RC330004/1_1564147181287.jpg", - "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/433_RC330004/1_1564147181287.jpg" - } - ], - "action": { - "type": "product", - "url": "https://api.addsale.com/platform/content/v1/products/red-chief-brown-sandals-876245-c92507/", - "query": { - "product_slug": [ - "red-chief-brown-sandals-876245-c92507" - ] - } - }, - "item_code": "RC330004" - }, - "bulk_offer": {}, - "key": "876245_6", - "message": "We are not delivering to 800108", - "coupon_message": "", - "availability": { - "sizes": [ - "7", - "6", - "10", - "8" - ], - "other_store_quantity": 21, - "out_of_stock": false, - "deliverable": false, - "is_valid": true, - "available_sizes": [ - { - "is_available": false, - "display": "9", - "value": "9" - }, - { - "is_available": true, - "display": "10", - "value": "10" - }, - { - "is_available": true, - "display": "6", - "value": "6" - }, - { - "is_available": true, - "display": "7", - "value": "7" - }, - { - "is_available": true, - "display": "8", - "value": "8" - } - ] - }, - "quantity": 1, - "article": { - "type": "article", - "uid": "304_433_LGPL30402_RC330004_6", - "size": "6", - "seller": { - "uid": 304, - "name": "LEAYAN GLOBAL PVT. LTD." - }, - "store": { - "uid": 9767, - "name": "Udyog Kunj, Kanpur" - }, - "quantity": 3, - "price": { - "base": { - "marked": 2195, - "effective": 1866, - "currency_code": "INR" - }, - "converted": { - "marked": 2195, - "effective": 1866, - "currency_code": "INR" - } - } - } - } - ] - } -} -``` -
    - -
    - - - - - - - - - ---- - - -#### checkoutCart -Create Fynd order with cart details - - - -```swift -cart.checkoutCart(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current Application _id | -| body | OpenApiPlatformCheckoutReq | no | Request body | - - -Generate Fynd order for cart details send with provided `cart_items` - -*Returned Response:* - - - - -[OpenApiCheckoutResponse](#OpenApiCheckoutResponse) - -Checkout cart and create Fynd order id - - - - -
    -  Example: - -```json -{ - "success": true, - "order_id": "FY5E182A9D0A5E405446", - "message": "Order initiation completed", - "order_ref_id": null -} -``` -
    - - - - - - - - - ---- - - - - -## Rewards - - -#### getGiveaways -List of giveaways of the current application. - - - -```swift -rewards.getGiveaways(companyId: companyId, applicationId: applicationId, pageId: pageId, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| applicationId | String | yes | application id | -| pageId | String? | no | pagination page id | -| pageSize | Int? | no | pagination page size | - - - -List of giveaways of the current application. - -*Returned Response:* - - - - -[GiveawayResponse](#GiveawayResponse) - -ok - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### createGiveaway -Adds a new giveaway. - - - -```swift -rewards.createGiveaway(companyId: companyId, applicationId: applicationId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| applicationId | String | yes | application id | -| body | Giveaway | yes | Request body | - - -Adds a new giveaway. - -*Returned Response:* - - - - -[Giveaway](#Giveaway) - -ok - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getGiveawayByID -Get giveaway by ID. - - - -```swift -rewards.getGiveawayByID(companyId: companyId, applicationId: applicationId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| applicationId | String | yes | application id | -| id | String | yes | Giveaway ID | - - - -Get giveaway by ID. - -*Returned Response:* - - - - -[Giveaway](#Giveaway) - -ok - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updateGiveaway -Updates the giveaway by it's ID. - - - -```swift -rewards.updateGiveaway(companyId: companyId, applicationId: applicationId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| applicationId | String | yes | application id | -| id | String | yes | Giveaway ID | -| body | Giveaway | yes | Request body | - - -Updates the giveaway by it's ID. - -*Returned Response:* - - - - -[Giveaway](#Giveaway) - -ok - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getOffers -List of offer of the current application. - - - -```swift -rewards.getOffers(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| applicationId | String | yes | application id | - - - -List of offer of the current application. - -*Returned Response:* - - - - -[[Offer]](#[Offer]) - -ok - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getOfferByName -Get offer by name. - - - -```swift -rewards.getOfferByName(companyId: companyId, applicationId: applicationId, cookie: cookie, name: name) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| applicationId | String | yes | application id | -| cookie | String | yes | User's session cookie. This cookie is set in browser cookie when logged-in to fynd's authentication system i.e. `Grimlock` or by using grimlock-backend SDK for backend implementation. | -| name | String | yes | Offer name | - - - -Get offer by name. - -*Returned Response:* - - - - -[Offer](#Offer) - -ok - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updateOfferByName -Updates the offer by name. - - - -```swift -rewards.updateOfferByName(companyId: companyId, applicationId: applicationId, name: name, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| applicationId | String | yes | application id | -| name | String | yes | Offer name | -| body | Offer | yes | Request body | - - -Updates the offer by name. - -*Returned Response:* - - - - -[Offer](#Offer) - -ok - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getUserAvailablePoints -User's reward details. - - - -```swift -rewards.getUserAvailablePoints(companyId: companyId, applicationId: applicationId, userId: userId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| applicationId | String | yes | application id | -| userId | String | yes | user id | - - - -User's reward details. - -*Returned Response:* - - - - -[UserRes](#UserRes) - -ok - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updateUserStatus -Update User status - - - -```swift -rewards.updateUserStatus(companyId: companyId, applicationId: applicationId, userId: userId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| applicationId | String | yes | application id | -| userId | String | yes | user id | -| body | AppUser | yes | Request body | - - -Update user status, active/archive - -*Returned Response:* - - - - -[AppUser](#AppUser) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getUserPointsHistory -Get list of points transactions. - - - -```swift -rewards.getUserPointsHistory(companyId: companyId, applicationId: applicationId, userId: userId, pageId: pageId, pageLimit: pageLimit, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | company id | -| applicationId | String | yes | application id | -| userId | String | yes | user id | -| pageId | String? | no | PageID is the ID of the requested page. For first request it should be kept empty. | -| pageLimit | Int? | no | PageLimit is the number of requested items in response. | -| pageSize | Int? | no | PageSize is the number of requested items in response. | - - - -Get list of points transactions. -The list of points history is paginated. - -*Returned Response:* - - - - -[HistoryRes](#HistoryRes) - -ok - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - - - -## Analytics - - -#### getStatiscticsGroups -Get statistics groups - - - -```swift -analytics.getStatiscticsGroups(companyId: companyId, applicationId: applicationId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| applicationId | String | yes | Application Id | - - - -Get statistics groups - -*Returned Response:* - - - - -[StatsGroups](#StatsGroups) - -Success - - - - -
    -  Example: - -```json -{ - "groups": [ - { - "key": "general", - "url": "/v1/group/general", - "title": "General" - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getStatiscticsGroupComponents -Get statistics group components - - - -```swift -analytics.getStatiscticsGroupComponents(companyId: companyId, applicationId: applicationId, groupName: groupName) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| applicationId | String | yes | Application Id | -| groupName | String | yes | Group name | - - - -Get statistics group components - -*Returned Response:* - - - - -[StatsGroupComponents](#StatsGroupComponents) - -Success - - - - -
    -  Example: - -```json -{ - "title": "Catalogue & Inventory", - "components": [ - { - "key": "catalogue-basic", - "title": "Catalogue Basic", - "type": "text-blocks", - "url": "/stats/component/catalogue-basic", - "filters": {} - } - ] -} -``` -
    - - - - - - - - - ---- - - -#### getComponentStatsCSV -Get component statistics csv - - - -```swift -analytics.getComponentStatsCSV(companyId: companyId, applicationId: applicationId, componentName: componentName) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| applicationId | String | yes | Application Id | -| componentName | String | yes | Component name | - - - -Get component statistics csv - -*Returned Response:* - - - - -[String](#String) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getComponentStatsPDF -Get component statistics pdf - - - -```swift -analytics.getComponentStatsPDF(companyId: companyId, applicationId: applicationId, componentName: componentName) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| applicationId | String | yes | Application Id | -| componentName | String | yes | Component name | - - - -Get component statistics pdf - -*Returned Response:* - - - - -[String](#String) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getComponentStats -Get component statistics - - - -```swift -analytics.getComponentStats(companyId: companyId, applicationId: applicationId, componentName: componentName) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| applicationId | String | yes | Application Id | -| componentName | String | yes | Component name | - - - -Get component statistics - -*Returned Response:* - - - - -[StatsRes](#StatsRes) - -Success - - - - -
    -  Example: - -```json -{ - "key": "article-distribution", - "title": "Inventory Distribution", - "type": "chart.pie", - "data": { - "raw": [ - { - "name": "Fatimah Logero", - "available_articles": 8, - "total_articles": 9, - "available_sizes": 3, - "total_sizes": 3, - "article_freshness": 9, - "count": 0, - "percent": "NaN" - } - ], - "type": "pie", - "data": { - "datasets": [ - { - "label": "# of products", - "backgroundColor": [ - "#7986CB", - "#3F51B5" - ], - "data": [ - 8, - 1 - ], - "percent": [ - "88.89", - "11.11" - ] - } - ], - "labels": [ - "Available Articles", - "Articles Out Of Stock" - ] - }, - "options": { - "responsive": true, - "display": false - }, - "cache_hit": false - } -} -``` -
    - - - - - - - - - ---- - - -#### getAbandonCartList -Get abandon carts list - - - -```swift -analytics.getAbandonCartList(companyId: companyId, applicationId: applicationId, fromDate: fromDate, toDate: toDate, pageNo: pageNo, pageSize: pageSize) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| applicationId | String | yes | Application Id | -| fromDate | String | yes | From date | -| toDate | String | yes | To date | -| pageNo | Int? | no | Current page number | -| pageSize | Int? | no | Current page size | - - - -Get abandon carts list - -*Returned Response:* - - - - -[AbandonCartsList](#AbandonCartsList) - -Success - - - - -
    -  Example: - -```json -{ - "items": { - "properties_cart_id": 11517, - "context_traits_first_name": "Ahmed", - "context_traits_last_name": "Sakri", - "context_traits_phone_number": "8433859662", - "context_traits_email": "ahmedsakri@gofynd.com", - "context_app_application_id": "000000000000000000000001", - "properties_breakup_values_raw_total": 4020, - "received_at": { - "value": "2021-03-09T05:09:06.840Z" - } - }, - "page": { - "type": "number", - "size": 10, - "current": 1, - "has_next": true, - "item_total": 15 - } -} -``` -
    - - - - - - - - - ---- - - -#### getAbandonCartsCSV -Get abandon carts csv - - - -```swift -analytics.getAbandonCartsCSV(companyId: companyId, applicationId: applicationId, fromDate: fromDate, toDate: toDate) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| applicationId | String | yes | Application Id | -| fromDate | String | yes | From date | -| toDate | String | yes | To date | - - - -Get abandon carts csv - -*Returned Response:* - - - - -[String](#String) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getAbandonCartDetail -Get abandon carts details - - - -```swift -analytics.getAbandonCartDetail(companyId: companyId, applicationId: applicationId, cartId: cartId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| applicationId | String | yes | Application Id | -| cartId | String | yes | Cart Id | - - - -Get abandon cart details - -*Returned Response:* - - - - -[AbandonCartDetail](#AbandonCartDetail) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### createExportJob -Create data export job in required format - - - -```swift -analytics.createExportJob(companyId: companyId, exportType: exportType, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| exportType | String | yes | Export type / format | -| body | ExportJobReq | no | Request body | - - -Create data export job in required format - -*Returned Response:* - - - - -[ExportJobRes](#ExportJobRes) - -Success - - - - -
    -  Example: - -```json -{ - "status": "queued", - "job_id": "6047c67060ad8241a948ee42" -} -``` -
    - - - - - - - - - ---- - - -#### getExportJobStatus -Get data export job status - - - -```swift -analytics.getExportJobStatus(companyId: companyId, exportType: exportType, jobId: jobId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| exportType | String | yes | Export type / format | -| jobId | String | yes | Export job id | - - - -Get data export job status - -*Returned Response:* - - - - -[ExportJobStatusRes](#ExportJobStatusRes) - -Success - - - - -
    -  Example: - -```json -{ - "download_url": "https://marketplace-sync-logs-production.s3.ap-south-1.amazonaws.com/inv-log-37-flipkartAssured-Full_Inventory_Update.csv", - "status": "success", - "job_id": "6047c67060ad8241a948ee42" -} -``` -
    - - - - - - - - - ---- - - -#### getLogsList -Get logs list - - - -```swift -analytics.getLogsList(companyId: companyId, logType: logType, pageNo: pageNo, pageSize: pageSize, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| logType | String | yes | Log type | -| pageNo | Int? | no | Current page number | -| pageSize | Int? | no | Current page size | -| body | GetLogsListReq | no | Request body | - - -Get logs list - -*Returned Response:* - - - - -[GetLogsListRes](#GetLogsListRes) - -Success - - - - -
    -  Example: - -```json -{ - "items": [ - { - "start_time_iso": "2021-04-06T19:00:17.013Z", - "end_time_iso": "2021-04-06T19:00:17.015Z", - "event_type": "FULL_PRICE_UPDATE", - "trace_id": "marketplaces.aa18fa48-b3e8-4e1e-8396-69488e254ace", - "count": 17, - "status": "failed" - } - ], - "page": { - "type": "number", - "size": 10, - "current": 1, - "has_next": true, - "item_total": 88 - } -} -``` -
    - - - - - - - - - ---- - - -#### searchLogs -Search logs - - - -```swift -analytics.searchLogs(companyId: companyId, pageNo: pageNo, pageSize: pageSize, logType: logType, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Company Id | -| pageNo | Int? | no | Current page number | -| pageSize | Int? | no | Current page size | -| logType | String | yes | Log type | -| body | SearchLogReq | no | Request body | - - -Search logs - -*Returned Response:* - - - - -[SearchLogRes](#SearchLogRes) - -Success - - - - -
    -  Example: - -```json -{ - "items": [ - { - "_id": "606cafc19c2c466b24098437", - "status": "failed", - "event_type": "FULL_PRICE_UPDATE", - "marketplace_name": "myntra", - "event": "APPLICATION_FULL_INVENTORY", - "trace_id": "marketplaces.aa18fa48-b3e8-4e1e-8396-69488e254ace", - "company_id": 28, - "brand_id": 44, - "store_id": 57, - "item_id": 882857, - "article_id": "57_sku_102831159-TBUCKBEIGE_301066XL", - "seller_identifier": "SKU_102831159-TBUCKBEIGE_392826XL" - } - ], - "page": { - "type": "number", - "size": 10, - "current": 1, - "has_next": true, - "item_total": 88 - } -} -``` -
    - - - - - - - - - ---- - - - - -## Discount - - -#### getDiscounts -Fetch discount list. - - - -```swift -discount.getDiscounts(companyId: companyId, view: view, q: q, pageNo: pageNo, pageSize: pageSize, archived: archived, month: month, year: year, type: type, appIds: appIds) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | company_id | -| view | String? | no | listing or calender. Default is listing. | -| q | String? | no | The search query. This can be a partial or complete name of a discount. | -| pageNo | Int? | no | page number. Default is 1. | -| pageSize | Int? | no | page size. Default is 12. | -| archived | Bool? | no | archived. Default is false. | -| month | Int? | no | month. Default is current month. | -| year | Int? | no | year. Default is current year. | -| type | String? | no | basic or custom. | -| appIds | [String]? | no | application ids. | - - - -Fetch discount list. - -*Returned Response:* - - - - -[ListOrCalender](#ListOrCalender) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### createDiscount -Create Discount. - - - -```swift -discount.createDiscount(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | company_id | -| body | CreateUpdateDiscount | yes | Request body | - - -Create Discount. - -*Returned Response:* - - - - -[DiscountJob](#DiscountJob) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getDiscount -Fetch discount. - - - -```swift -discount.getDiscount(companyId: companyId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | company_id | -| id | String | yes | unique id. | - - - -Fetch discount. - -*Returned Response:* - - - - -[DiscountJob](#DiscountJob) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updateDiscount -Create Discount. - - - -```swift -discount.updateDiscount(companyId: companyId, id: id, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | company_id | -| id | String | yes | id | -| body | CreateUpdateDiscount | yes | Request body | - - -Create Discount. - -*Returned Response:* - - - - -[DiscountJob](#DiscountJob) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### validateDiscountFile -Validate File. - - - -```swift -discount.validateDiscountFile(companyId: companyId, discount: discount, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | company_id | -| discount | String? | no | discount | -| body | DiscountJob | yes | Request body | - - -Validate File. - -*Returned Response:* - - - - -[FileJobResponse](#FileJobResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### downloadDiscountFile -Validate File. - - - -```swift -discount.downloadDiscountFile(companyId: companyId, type: type, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | company_id | -| type | String | yes | type | -| body | DownloadFileJob | yes | Request body | - - -Validate File. - -*Returned Response:* - - - - -[FileJobResponse](#FileJobResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getValidationJob -Validate File Job. - - - -```swift -discount.getValidationJob(companyId: companyId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | company_id | -| id | String | yes | id | - - - -Validate File Job. - -*Returned Response:* - - - - -[FileJobResponse](#FileJobResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### cancelValidationJob -Cancel Validation Job. - - - -```swift -discount.cancelValidationJob(companyId: companyId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | company_id | -| id | String | yes | id | - - - -Cancel Validation Job. - -*Returned Response:* - - - - -[CancelJobResponse](#CancelJobResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getDownloadJob -Download File Job. - - - -```swift -discount.getDownloadJob(companyId: companyId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | company_id | -| id | String | yes | id | - - - -Download File Job. - -*Returned Response:* - - - - -[FileJobResponse](#FileJobResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### cancelDownloadJob -Cancel Download Job. - - - -```swift -discount.cancelDownloadJob(companyId: companyId, id: id) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | company_id | -| id | String | yes | id | - - - -Cancel Download Job. - -*Returned Response:* - - - - -[CancelJobResponse](#CancelJobResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - - - -## Partner - - -#### addProxyPath -Add proxy path for external url - - - -```swift -partner.addProxyPath(companyId: companyId, applicationId: applicationId, extensionId: extensionId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| extensionId | String | yes | Extension id | -| body | AddProxyReq | no | Request body | - - -Add proxy path for external url - -*Returned Response:* - - - - -[AddProxyResponse](#AddProxyResponse) - -Success - - - - -
    -  Example: - -```json -{ - "_id": "607406b8a472cd527303692f", - "attached_path": "test", - "proxy_url": "https://www.abc.com", - "company_id": "1", - "application_id": "000000000000000000000004", - "extension_id": "6073280be899ea5b1150fd9d", - "created_at": "2021-04-12T08:37:12.077Z", - "modified_at": "2021-04-12T08:37:12.077Z" -} -``` -
    - - - - - - - - - ---- - - -#### removeProxyPath -Remove proxy path for external url - - - -```swift -partner.removeProxyPath(companyId: companyId, applicationId: applicationId, extensionId: extensionId, attachedPath: attachedPath) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | String | yes | Current company id | -| applicationId | String | yes | Current application id | -| extensionId | String | yes | Extension id | -| attachedPath | String | yes | Attachaed path slug | - - - -Remove proxy path for external url - -*Returned Response:* - - - - -[RemoveProxyResponse](#RemoveProxyResponse) - -Success - - - - -
    -  Example: - -```json -{ - "message": "Proxy URL deleted", - "data": { - "_id": "607406b8a472cd527303692f", - "attached_path": "test", - "proxy_url": "https://www.abc.com", - "company_id": "1", - "application_id": "000000000000000000000004", - "extension_id": "6073280be899ea5b1150fd9d", - "created_at": "2021-04-12T08:37:12.077Z", - "modified_at": "2021-04-12T08:37:12.077Z" - } -} -``` -
    - - - - - - - - - ---- - - - - -## Webhook - - -#### getSubscribersByCompany -Get Subscribers By Company ID - - - -```swift -webhook.getSubscribersByCompany(pageNo: pageNo, pageSize: pageSize, companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| pageNo | Int? | no | Page Number | -| pageSize | Int? | no | Page Size | -| companyId | Int | yes | Company ID of the application | - - - -Get Subscribers By CompanyId - -*Returned Response:* - - - - -[SubscriberResponse](#SubscriberResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### registerSubscriberToEvent -Register Subscriber - - - -```swift -webhook.registerSubscriberToEvent(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company Id of the application | -| body | SubscriberConfig | no | Request body | - - -Register Subscriber - -*Returned Response:* - - - - -[SubscriberConfig](#SubscriberConfig) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### updateSubscriberConfig -Update Subscriber - - - -```swift -webhook.updateSubscriberConfig(companyId: companyId, body: body) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company ID of the application | -| body | SubscriberConfig | no | Request body | - - -Update Subscriber - -*Returned Response:* - - - - -[SubscriberConfig](#SubscriberConfig) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### getSubscriberById -Get Subscriber By Subscriber ID - - - -```swift -webhook.getSubscriberById(companyId: companyId, subscriberId: subscriberId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company ID of the application | -| subscriberId | Int | yes | Subscriber ID | - - - -Get Subscriber By Subscriber ID - -*Returned Response:* - - - - -[SubscriberResponse](#SubscriberResponse) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - -#### fetchAllEventConfigurations -Get All Webhook Events - - - -```swift -webhook.fetchAllEventConfigurations(companyId: companyId) { (response, error) in - // Use response -} -``` - - - -| Argument | Type | Required | Description | -| -------- | ---- | -------- | ----------- | -| companyId | Int | yes | Company ID of the application | - - - -Get All Webhook Events - -*Returned Response:* - - - - -[EventConfigList](#EventConfigList) - -Success - - - - -
    -  Example: - -```json - -``` -
    - - - - - - - - - ---- - - - - -### Schemas - - - - - #### [LocationDefaultLanguage](#LocationDefaultLanguage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | code | String? | yes | | - ---- - - - - - #### [LocationDefaultCurrency](#LocationDefaultCurrency) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | symbol | String? | yes | | - | code | String? | yes | | - ---- - - - - - #### [LocationCountry](#LocationCountry) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | capital | String? | yes | | - | currency | String? | yes | | - | iso2 | String? | yes | | - | iso3 | String? | yes | | - | name | String? | yes | | - | parent | String? | yes | | - | phoneCode | String? | yes | | - | type | String? | yes | | - | uid | Int? | yes | | - | v | Int? | yes | | - | id | String? | yes | | - | defaultCurrency | [LocationDefaultCurrency](#LocationDefaultCurrency)? | yes | | - | defaultLanguage | [LocationDefaultLanguage](#LocationDefaultLanguage)? | yes | | - ---- - - - - - #### [Locations](#Locations) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[String: Any]]? | yes | | - ---- - - - - - - - #### [TicketList](#TicketList) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Ticket](#Ticket)]? | yes | List of tickets | - | filters | [Filter](#Filter)? | yes | All the filters available for tickets | - | page | [Page](#Page)? | yes | Describes the pagination state | - ---- - - - - - #### [Page](#Page) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | itemTotal | Int? | yes | | - | nextId | String? | yes | | - | hasPrevious | Bool? | yes | | - | hasNext | Bool? | yes | | - | current | Int? | yes | | - | type | String | no | | - | size | Int? | yes | | - ---- - - - - - #### [TicketHistoryList](#TicketHistoryList) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[TicketHistory](#TicketHistory)]? | yes | List of ticket history | - | page | [Page](#Page)? | yes | Describes the pagination state | - ---- - - - - - #### [CustomFormList](#CustomFormList) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[CustomForm](#CustomForm)]? | yes | List of forms | - | page | [Page](#Page)? | yes | Describes the pagination state | - ---- - - - - - #### [CreateCustomFormPayload](#CreateCustomFormPayload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | slug | String | no | Slug for the form | - | title | String | no | Title for the form | - | inputs | [[String: Any]] | no | List of all the form components | - | description | String? | yes | Description of the form | - | headerImage | String? | yes | Header image that is to be shown for the form | - | priority | [String: Any] | no | Describes the priority of the tickets created by the form | - | shouldNotify | Bool? | yes | Indicates if staff should be notified when a response is received | - | successMessage | String? | yes | Success message that will be shown on submission | - | pollForAssignment | [PollForAssignment](#PollForAssignment)? | yes | Describes how polling will be done for the tickets createds | - ---- - - - - - #### [EditCustomFormPayload](#EditCustomFormPayload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String | no | Title for the form | - | inputs | [[String: Any]] | no | List of all the form components | - | description | String? | yes | Description of the form | - | priority | [String: Any] | no | Describes the priority of the tickets created by the form | - | headerImage | String? | yes | Header image that is to be shown for the form | - | shouldNotify | Bool? | yes | Indicates if staff should be notified when a response is received | - | loginRequired | Bool? | yes | Denotes if login is required to make a form response submission | - | successMessage | String? | yes | Success message that will be shown on submission | - | pollForAssignment | [PollForAssignment](#PollForAssignment)? | yes | Describes how polling will be done for the tickets createds | - ---- - - - - - #### [EditTicketPayload](#EditTicketPayload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | content | [TicketContent](#TicketContent)? | yes | Ticket conetent details | - | category | String? | yes | Category assigned to the ticket | - | subCategory | String? | yes | Sub-category assigned to the ticket | - | source | String? | yes | Denotes if the ticket was created at company or application level | - | status | String? | yes | Denotes in what state is the ticket | - | priority | [String: Any]? | yes | Denotes the priority of ticket | - | assignedTo | [AgentChangePayload](#AgentChangePayload)? | yes | Details of support staff to whom ticket is assigned | - | tags | [String]? | yes | Tags relevant to ticket | - ---- - - - - - #### [AgentChangePayload](#AgentChangePayload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | agentId | String | no | Agent's unique ID | - ---- - - - - - #### [CreateVideoRoomResponse](#CreateVideoRoomResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uniqueName | String | no | Video Room's unique name | - ---- - - - - - #### [CloseVideoRoomResponse](#CloseVideoRoomResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Denotes if operation was successfully | - ---- - - - - - #### [CreateVideoRoomPayload](#CreateVideoRoomPayload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uniqueName | String | no | Ticket id | - | notify | [[NotifyUser](#NotifyUser)]? | yes | List of people to be notified | - ---- - - - - - #### [NotifyUser](#NotifyUser) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | countryCode | String | no | Country code | - | phoneNumber | String | no | Phone number | - ---- - - - - - #### [Filter](#Filter) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | priorities | [[Priority](#Priority)] | no | List of possible priorities for tickets | - | categories | [[TicketCategory](#TicketCategory)]? | yes | List of possible categories for tickets | - | statuses | [[Status](#Status)] | no | List of possible statuses for tickets | - | assignees | [[String: Any]] | no | List of support staff availble for tickets assignment | - ---- - - - - - #### [TicketHistoryPayload](#TicketHistoryPayload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | value | [String: Any] | no | Details of history event | - | type | [String: Any] | no | Type of history event | - ---- - - - - - #### [CustomFormSubmissionPayload](#CustomFormSubmissionPayload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | response | [[KeyValue](#KeyValue)] | no | Form response | - | attachments | [[TicketAsset](#TicketAsset)]? | yes | List of all attachments related to the form | - ---- - - - - - #### [KeyValue](#KeyValue) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String | no | Parameter for evaluating | - | value | [String: Any] | no | Response for the parameter | - ---- - - - - - #### [GetTokenForVideoRoomResponse](#GetTokenForVideoRoomResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | accessToken | String | no | Access token to be used for video room | - ---- - - - - - #### [GetParticipantsInsideVideoRoomResponse](#GetParticipantsInsideVideoRoomResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | participants | [[Participant](#Participant)] | no | List of participants of the video room | - ---- - - - - - #### [Participant](#Participant) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | user | [UserSchema](#UserSchema)? | yes | Details of participant | - | identity | String? | yes | Unique identifier of participant | - | status | String? | yes | Status of participant | - ---- - - - - - #### [PhoneNumber](#PhoneNumber) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool? | yes | Denotes if the phone number is active | - | primary | Bool? | yes | Denotes it's the primary phone number for the account | - | verified | Bool? | yes | Denotes it's a verified phone number | - | phone | String? | yes | Phone number | - | countryCode | Int? | yes | Country code | - ---- - - - - - #### [Email](#Email) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | primary | Bool? | yes | Denotes it's the primary email for the account | - | verified | Bool? | yes | Denotes it's a verified email | - | email | String? | yes | Email Address | - | active | Bool? | yes | Denotes if the email is active | - ---- - - - - - #### [Debug](#Debug) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | source | String? | yes | Source of user | - | platform | String? | yes | Platform of user | - ---- - - - - - #### [SubmitCustomFormResponse](#SubmitCustomFormResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | ticket | [Ticket](#Ticket) | no | Ticket created on form submission | - ---- - - - - - #### [TicketContext](#TicketContext) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | applicationId | String? | yes | Application ID related to the ticket | - | companyId | String | no | Company ID related to the ticket | - ---- - - - - - #### [CreatedOn](#CreatedOn) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | userAgent | String | no | Useragent details | - ---- - - - - - #### [TicketAsset](#TicketAsset) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | Display text for asset | - | value | String | no | To be used for details | - | type | [String: Any] | no | Type of asset | - ---- - - - - - #### [TicketContent](#TicketContent) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String | no | Title for ticket | - | description | String? | yes | Long description of issue | - | attachments | [[TicketAsset](#TicketAsset)]? | yes | List of all attachments related to the ticket | - ---- - - - - - #### [AddTicketPayload](#AddTicketPayload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdBy | [String: Any]? | yes | Creator of the ticket | - | status | String? | yes | Status of the ticket | - | priority | [String: Any]? | yes | Priority of the ticket | - | category | String | no | Category of the ticket | - | content | [TicketContent](#TicketContent) | no | Content for the ticket | - ---- - - - - - #### [Priority](#Priority) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | [PriorityEnum](#PriorityEnum) | no | Key for priority | - | display | String | no | Display text for priority | - | color | String | no | Color for priority | - ---- - - - - - #### [Status](#Status) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String | no | Key for status | - | display | String | no | Display text for status | - | color | String | no | Color for status | - ---- - - - - - #### [TicketCategory](#TicketCategory) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String | no | Key for category | - | display | String | no | Display text for category | - | form | [CustomForm](#CustomForm)? | yes | Form related to the category | - | subCategories | [[TicketSubCategory](#TicketSubCategory)]? | yes | Sub-category related to the category | - | feedbackForm | [TicketFeedbackForm](#TicketFeedbackForm)? | yes | Feedback form of category used to submit ticket feedback | - ---- - - - - - #### [TicketSubCategory](#TicketSubCategory) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String | no | Key for sub-category | - | display | String | no | Display text for sub-category | - ---- - - - - - #### [TicketFeedbackForm](#TicketFeedbackForm) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String | no | Feedback form title that will be shown to the user | - | display | [[String: Any]]? | yes | List of all the form fields | - ---- - - - - - #### [TicketFeedbackList](#TicketFeedbackList) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[TicketFeedback](#TicketFeedback)]? | yes | List of all ticket feedback for the ticket | - ---- - - - - - #### [TicketFeedbackPayload](#TicketFeedbackPayload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | formResponse | [String: Any]? | yes | Key-value pairs of all the form fields and their response | - ---- - - - - - #### [SubmitButton](#SubmitButton) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String | no | Title for submit button | - | titleColor | String | no | Title color submit button | - | backgroundColor | String | no | Color for submit button | - ---- - - - - - #### [PollForAssignment](#PollForAssignment) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | duration | Double | no | Duration for polling of staff | - | message | String | no | Message for polling | - | successMessage | String | no | Message for successful polling | - | failureMessage | String | no | Message if polling failed | - ---- - - - - - #### [CustomForm](#CustomForm) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | applicationId | String | no | Application ID for form | - | slug | String | no | Slug for the form, which is to be used for accessing the form | - | headerImage | String? | yes | Form header image that will be shown to the user | - | title | String | no | Form title that will be shown to the user | - | description | String? | yes | Form description that will be shown to the user | - | priority | [Priority](#Priority) | no | Sets priority of tickets created by form response | - | loginRequired | Bool | no | Denotes if login is required to make a form response submission | - | shouldNotify | Bool | no | Denotes if new response submission for the form should be notified to the assignees | - | successMessage | String? | yes | Message that is to be shown on succesfull form response submission | - | submitButton | [SubmitButton](#SubmitButton)? | yes | Details for submit button | - | inputs | [[String: Any]] | no | List of all the form fields | - | createdOn | [CreatedOn](#CreatedOn)? | yes | Gives details of when the form was created | - | createdBy | [String: Any]? | yes | Gives details of user who created the form | - | pollForAssignment | [PollForAssignment](#PollForAssignment)? | yes | Details of how polling should be done for support | - | id | String | no | Unique identifier for the form | - ---- - - - - - #### [FeedbackResponseItem](#FeedbackResponseItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String | no | Question/Title of the form field | - | key | String | no | Key of the form field | - | value | String | no | User response value for the form field | - ---- - - - - - #### [TicketFeedback](#TicketFeedback) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String | no | Unique identifier for the feedback | - | ticketId | String | no | Readable ticket number | - | companyId | String | no | Company id for which ticket was raised | - | response | [[FeedbackResponseItem](#FeedbackResponseItem)] | no | | - | category | String? | yes | Category of the ticket | - | user | [String: Any]? | yes | User who submitted the feedback | - | updatedAt | String? | yes | Time when the feedback was last updated | - | createdAt | String? | yes | Time when the feedback was created | - ---- - - - - - #### [TicketHistory](#TicketHistory) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String | no | Type of the history event | - | value | [String: Any] | no | Data of the history event | - | ticketId | String | no | Readable ticket number | - | createdOn | [CreatedOn](#CreatedOn)? | yes | Time of creation of the history event | - | createdBy | [String: Any]? | yes | User who created the history event | - | id | String | no | Unique identifier of the history event | - | updatedAt | String? | yes | Time of last update of the history event | - | createdAt | String? | yes | Time of creation of the history event | - ---- - - - - - #### [Ticket](#Ticket) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | context | [TicketContext](#TicketContext)? | yes | Details of company and application realated to the ticket | - | createdOn | [CreatedOn](#CreatedOn)? | yes | Details of company and application realated to the ticket | - | responseId | String? | yes | Details of company and application realated to the ticket | - | content | [TicketContent](#TicketContent)? | yes | Ticket conetent details | - | ticketId | String | no | Readable ticket number | - | category | [TicketCategory](#TicketCategory) | no | Category assigned to the ticket | - | subCategory | [TicketSubCategory](#TicketSubCategory)? | yes | Sub-category assigned to the ticket | - | source | [String: Any] | no | Denotes if the ticket was created at company or application level | - | status | [Status](#Status) | no | Denotes in what state is the ticket | - | priority | [Priority](#Priority) | no | Denotes the priority of ticket | - | createdBy | [String: Any]? | yes | User details of ticket creator | - | assignedTo | [String: Any]? | yes | Details of support staff to whom ticket is assigned | - | tags | [String]? | yes | Tags relevant to ticket | - | customJson | [String: Any]? | yes | custom json relevant to the ticket | - | isFeedbackPending | Bool? | yes | Denotes if feedback submission is pending for the ticket | - | id | String | no | Unique identifier for the ticket | - | updatedAt | String? | yes | Time when the ticket was last updated | - | createdAt | String? | yes | Time when the ticket was created | - ---- - - - - - - - #### [Activity](#Activity) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | currentState | [String: Any]? | yes | | - | documentId | String? | yes | | - | previousState | [String: Any]? | yes | | - ---- - - - - - #### [ActivityDump](#ActivityDump) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | activity | [Activity](#Activity)? | yes | | - | createdBy | [CreatedBy](#CreatedBy)? | yes | | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | id | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [AddMediaListRequest](#AddMediaListRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | entityId | String? | yes | | - | entityType | String? | yes | | - | mediaList | [[AddMediaRequest](#AddMediaRequest)]? | yes | | - | refId | String? | yes | | - | refType | String? | yes | | - ---- - - - - - #### [AddMediaRequest](#AddMediaRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cloudId | String? | yes | | - | cloudName | String? | yes | | - | cloudProvider | String? | yes | | - | entityId | String? | yes | | - | entityType | String? | yes | | - | mediaUrl | String? | yes | | - | refId | String? | yes | | - | refType | String? | yes | | - | tags | [String]? | yes | | - | thumbnailUrl | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [ApproveRequest](#ApproveRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | approve | Bool? | yes | | - | entityType | String? | yes | | - | id | String | no | | - | reason | String? | yes | | - ---- - - - - - #### [Attribute](#Attribute) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | description | String? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | slug | String? | yes | | - | tags | [[TagMeta](#TagMeta)]? | yes | | - ---- - - - - - #### [AttributeObject](#AttributeObject) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | name | String | no | | - | slug | String? | yes | | - | title | String? | yes | | - | type | String | no | | - | value | Double | no | | - ---- - - - - - #### [CreatedBy](#CreatedBy) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | name | String? | yes | | - | tags | [[TagMeta](#TagMeta)]? | yes | | - ---- - - - - - #### [CursorGetResponse](#CursorGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[String: Any]]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [DateMeta](#DateMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdOn | String? | yes | | - | modifiedOn | String? | yes | | - ---- - - - - - #### [DeviceMeta](#DeviceMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | appVersion | String? | yes | | - | platform | String? | yes | | - ---- - - - - - #### [Entity](#Entity) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [EntityRequest](#EntityRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | entityId | String? | yes | | - | entityType | String? | yes | | - ---- - - - - - #### [FeedbackAttributes](#FeedbackAttributes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Attribute](#Attribute)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [FeedbackError](#FeedbackError) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | code | [String: Any]? | yes | | - | exception | String? | yes | | - | info | String? | yes | | - | message | String? | yes | | - | meta | [String: Any]? | yes | | - | requestId | String? | yes | | - | stackTrace | String? | yes | | - | status | Int? | yes | | - ---- - - - - - #### [FeedbackState](#FeedbackState) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool? | yes | | - | archive | Bool? | yes | | - | media | String? | yes | image, video, any | - | qna | Bool? | yes | | - | rating | Bool? | yes | | - | review | Bool? | yes | | - ---- - - - - - #### [GetResponse](#GetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | data | [String: Any]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [GetReviewResponse](#GetReviewResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | facets | [[ReviewFacet](#ReviewFacet)]? | yes | | - | items | [[String: Any]]? | yes | | - | page | [Page](#Page)? | yes | | - | sort | [[SortMethod](#SortMethod)]? | yes | | - ---- - - - - - #### [InsertResponse](#InsertResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | count | Int? | yes | | - ---- - - - - - #### [MediaMeta](#MediaMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | maxCount | Int? | yes | | - | size | Int? | yes | | - | type | String? | yes | | - ---- - - - - - #### [MediaMetaRequest](#MediaMetaRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | maxCount | Int | no | | - | size | Int | no | | - ---- - - - - - #### [NumberGetResponse](#NumberGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[String: Any]]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [PageCursor](#PageCursor) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | current | Int? | yes | | - | hasNext | Bool? | yes | | - | hasPrevious | Bool? | yes | | - | itemTotal | Int? | yes | | - | nextId | String? | yes | | - | size | Int | no | | - | type | String | no | | - ---- - - - - - #### [PageNumber](#PageNumber) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | current | Int? | yes | | - | hasNext | Bool? | yes | | - | itemTotal | Int? | yes | | - | size | Int? | yes | | - | type | String? | yes | | - ---- - - - - - #### [Rating](#Rating) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | attributes | [[Attribute](#Attribute)]? | yes | | - | attributesSlugs | [String]? | yes | | - | ui | [UI](#UI)? | yes | | - ---- - - - - - #### [RatingRequest](#RatingRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | attributes | [String] | no | | - | ui | [UI](#UI)? | yes | | - ---- - - - - - #### [ReportAbuseRequest](#ReportAbuseRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | entityId | String | no | | - | entityType | String | no | | - ---- - - - - - #### [Review](#Review) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | header | String? | yes | | - | imageMeta | [MediaMeta](#MediaMeta)? | yes | | - | title | String? | yes | | - | videoMeta | [MediaMeta](#MediaMeta)? | yes | | - | voteAllowed | Bool? | yes | | - ---- - - - - - #### [ReviewFacet](#ReviewFacet) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - | name | String? | yes | | - | selected | Bool? | yes | | - | slug | String? | yes | | - | type | String? | yes | rating, attributerating | - ---- - - - - - #### [ReviewRequest](#ReviewRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String | no | | - | header | String | no | | - | imageMeta | [MediaMetaRequest](#MediaMetaRequest) | no | | - | isVoteAllowed | Bool | no | | - | title | String | no | | - | videoMeta | [MediaMetaRequest](#MediaMetaRequest) | no | | - ---- - - - - - #### [SaveAttributeRequest](#SaveAttributeRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | name | String | no | | - | slug | String | no | | - ---- - - - - - #### [SortMethod](#SortMethod) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | selected | Bool? | yes | | - | type | String? | yes | | - ---- - - - - - #### [TagMeta](#TagMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | media | [[MediaMeta](#MediaMeta)]? | yes | | - | name | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [Template](#Template) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | entity | [Entity](#Entity)? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | rating | [Rating](#Rating)? | yes | | - | review | [Review](#Review)? | yes | | - | state | [FeedbackState](#FeedbackState)? | yes | | - | tags | [[TagMeta](#TagMeta)]? | yes | | - ---- - - - - - #### [TemplateGetResponse](#TemplateGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Template](#Template)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [TemplateRequest](#TemplateRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool | no | | - | enableMediaType | String? | yes | image | video | any | - | enableQna | Bool? | yes | | - | enableRating | Bool | no | | - | enableReview | Bool | no | | - | entity | [EntityRequest](#EntityRequest) | no | | - | rating | [RatingRequest](#RatingRequest) | no | | - | review | [ReviewRequest](#ReviewRequest) | no | | - ---- - - - - - #### [TemplateRequestList](#TemplateRequestList) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | templateList | [[TemplateRequest](#TemplateRequest)] | no | | - ---- - - - - - #### [UI](#UI) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | feedbackQuestion | [String]? | yes | | - | icon | [UIIcon](#UIIcon)? | yes | | - | text | [String]? | yes | | - | type | String? | yes | star | images | gifs | smileys | - ---- - - - - - #### [UIIcon](#UIIcon) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | String? | yes | | - | inactive | String? | yes | | - | selected | [String]? | yes | | - ---- - - - - - #### [UpdateAttributeRequest](#UpdateAttributeRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | name | String | no | | - | slug | String? | yes | | - ---- - - - - - #### [UpdateResponse](#UpdateResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | count | Int? | yes | | - ---- - - - - - #### [UpdateReviewRequest](#UpdateReviewRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool? | yes | | - | application | String? | yes | | - | approve | Bool? | yes | | - | archive | Bool? | yes | | - | attributesRating | [[AttributeObject](#AttributeObject)]? | yes | | - | description | String? | yes | | - | deviceMeta | [DeviceMeta](#DeviceMeta)? | yes | | - | entityId | String? | yes | | - | entityType | String? | yes | | - | mediaResource | [[MediaMeta](#MediaMeta)]? | yes | | - | rating | Double? | yes | | - | reviewId | String? | yes | | - | templateId | String? | yes | | - | title | String? | yes | | - ---- - - - - - #### [UpdateTemplateRequest](#UpdateTemplateRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool | no | | - | enableMediaType | String? | yes | image | video | any | - | enableQna | Bool? | yes | | - | enableRating | Bool | no | | - | enableReview | Bool | no | | - | entity | [EntityRequest](#EntityRequest) | no | | - | rating | [RatingRequest](#RatingRequest) | no | | - | review | [ReviewRequest](#ReviewRequest) | no | | - ---- - - - - - #### [UpdateTemplateStatusRequest](#UpdateTemplateStatusRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool? | yes | | - | archive | Bool? | yes | | - ---- - - - - - - - #### [AvailablePageSchema](#AvailablePageSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | value | String? | yes | | - | text | String? | yes | | - | path | String? | yes | | - | type | String? | yes | | - | sections | [[AvailablePageSchemaSections](#AvailablePageSchemaSections)]? | yes | | - | sectionsMeta | [[AvailablePageSectionMetaAttributes](#AvailablePageSectionMetaAttributes)]? | yes | | - | theme | String? | yes | | - | seo | [AvailablePageSeo](#AvailablePageSeo)? | yes | | - | props | [[String: Any]]? | yes | | - | id | String? | yes | | - ---- - - - - - #### [AvailablePageSectionMetaAttributes](#AvailablePageSectionMetaAttributes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | attributes | [String: Any]? | yes | | - ---- - - - - - #### [AvailablePageSeo](#AvailablePageSeo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | description | String? | yes | | - | id | String? | yes | | - ---- - - - - - #### [AvailablePageSchemaSections](#AvailablePageSchemaSections) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | label | String? | yes | | - | props | [String: Any]? | yes | | - | blocks | [[String: Any]]? | yes | | - | preset | [String: Any]? | yes | | - | predicate | [AvailablePagePredicate](#AvailablePagePredicate)? | yes | | - ---- - - - - - #### [AvailablePageScreenPredicate](#AvailablePageScreenPredicate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | mobile | Bool? | yes | | - | desktop | Bool? | yes | | - | tablet | Bool? | yes | | - ---- - - - - - #### [AvailablePageUserPredicate](#AvailablePageUserPredicate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | authenticated | Bool? | yes | | - | anonymous | Bool? | yes | | - ---- - - - - - #### [AvailablePageRoutePredicate](#AvailablePageRoutePredicate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | selected | String? | yes | | - | exactUrl | String? | yes | | - | query | [String: Any]? | yes | | - ---- - - - - - #### [AvailablePagePredicate](#AvailablePagePredicate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | screen | [AvailablePageScreenPredicate](#AvailablePageScreenPredicate)? | yes | | - | user | [AvailablePageUserPredicate](#AvailablePageUserPredicate)? | yes | | - | route | [AvailablePageRoutePredicate](#AvailablePageRoutePredicate)? | yes | | - ---- - - - - - #### [AllAvailablePageSchema](#AllAvailablePageSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pages | [[AvailablePageSchema](#AvailablePageSchema)]? | yes | | - ---- - - - - - #### [PaginationSchema](#PaginationSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | size | Int? | yes | | - | itemTotal | Int? | yes | | - | hasNext | Bool? | yes | | - | type | String? | yes | | - | current | Int? | yes | | - ---- - - - - - #### [ThemesListingResponseSchema](#ThemesListingResponseSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[ThemesSchema](#ThemesSchema)]? | yes | | - | page | [PaginationSchema](#PaginationSchema)? | yes | | - ---- - - - - - #### [AddThemeRequestSchema](#AddThemeRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | themeId | String? | yes | | - ---- - - - - - #### [UpgradableThemeSchema](#UpgradableThemeSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | parentTheme | String? | yes | | - | appliedTheme | String? | yes | | - | upgrade | Bool? | yes | | - ---- - - - - - #### [FontsSchema](#FontsSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [FontsSchemaItems](#FontsSchemaItems)? | yes | | - | kind | String? | yes | | - ---- - - - - - #### [BlitzkriegApiErrorSchema](#BlitzkriegApiErrorSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [BlitzkriegNotFoundSchema](#BlitzkriegNotFoundSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [BlitzkriegInternalServerErrorSchema](#BlitzkriegInternalServerErrorSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [FontsSchemaItems](#FontsSchemaItems) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | family | String? | yes | | - | variants | [String]? | yes | | - | subsets | [String]? | yes | | - | version | String? | yes | | - | lastModified | String? | yes | | - | files | [FontsSchemaItemsFiles](#FontsSchemaItemsFiles)? | yes | | - | category | String? | yes | | - | kind | String? | yes | | - ---- - - - - - #### [FontsSchemaItemsFiles](#FontsSchemaItemsFiles) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | regular | String? | yes | | - | italic | String? | yes | | - | bold | String? | yes | | - ---- - - - - - #### [ThemesSchema](#ThemesSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | application | String? | yes | | - | applied | Bool? | yes | | - | customized | Bool? | yes | | - | published | Bool? | yes | | - | archived | Bool? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | version | String? | yes | | - | parentThemeVersion | String? | yes | | - | parentTheme | String? | yes | | - | information | [Information](#Information)? | yes | | - | tags | [String]? | yes | | - | src | [Src](#Src)? | yes | | - | assets | [AssetsSchema](#AssetsSchema)? | yes | | - | availableSections | [[availableSectionSchema](#availableSectionSchema)]? | yes | | - | constants | [String: Any]? | yes | | - | styles | [String: Any]? | yes | | - | config | [Config](#Config)? | yes | | - | settings | [String: Any]? | yes | | - | font | [Font](#Font)? | yes | | - | id | String? | yes | | - | v | Int? | yes | | - | colors | [Colors](#Colors)? | yes | | - ---- - - - - - #### [availableSectionSchema](#availableSectionSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | blocks | [[Blocks](#Blocks)]? | yes | | - | name | String? | yes | | - | label | String? | yes | | - | props | [[BlocksProps](#BlocksProps)]? | yes | | - ---- - - - - - #### [Information](#Information) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | images | [Images](#Images)? | yes | | - | features | [String]? | yes | | - | name | String? | yes | | - | description | String? | yes | | - ---- - - - - - #### [Images](#Images) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | desktop | [String]? | yes | | - | android | [String]? | yes | | - | ios | [String]? | yes | | - | thumbnail | [String]? | yes | | - ---- - - - - - #### [Src](#Src) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | link | String? | yes | | - ---- - - - - - #### [AssetsSchema](#AssetsSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | umdJs | [UmdJs](#UmdJs)? | yes | | - | commonJs | [CommonJs](#CommonJs)? | yes | | - | css | [Css](#Css)? | yes | | - ---- - - - - - #### [UmdJs](#UmdJs) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | link | String? | yes | | - ---- - - - - - #### [CommonJs](#CommonJs) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | link | String? | yes | | - ---- - - - - - #### [Css](#Css) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | link | String? | yes | | - ---- - - - - - #### [Seo](#Seo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | description | String? | yes | | - ---- - - - - - #### [Sections](#Sections) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | attributes | String? | yes | | - ---- - - - - - #### [Config](#Config) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | preset | [Preset](#Preset)? | yes | | - | globalSchema | [GlobalSchema](#GlobalSchema)? | yes | | - | current | String? | yes | | - | list | [[ListSchemaItem](#ListSchemaItem)]? | yes | | - ---- - - - - - #### [Preset](#Preset) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pages | [[AvailablePageSchema](#AvailablePageSchema)]? | yes | | - ---- - - - - - #### [GlobalSchema](#GlobalSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | props | [[GlobalSchemaProps](#GlobalSchemaProps)]? | yes | | - ---- - - - - - #### [ListSchemaItem](#ListSchemaItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | global | [String: Any]? | yes | | - | page | [[ConfigPage](#ConfigPage)]? | yes | | - | name | String? | yes | | - ---- - - - - - #### [Colors](#Colors) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | bgColor | String? | yes | | - | primaryColor | String? | yes | | - | secondaryColor | String? | yes | | - | accentColor | String? | yes | | - | linkColor | String? | yes | | - | buttonSecondaryColor | String? | yes | | - ---- - - - - - #### [Custom](#Custom) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | props | [String: Any]? | yes | | - ---- - - - - - #### [ConfigPage](#ConfigPage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | settings | [String: Any]? | yes | | - | page | String? | yes | | - ---- - - - - - #### [Font](#Font) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | family | String? | yes | | - | variants | [Variants](#Variants)? | yes | | - ---- - - - - - #### [Variants](#Variants) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | medium | [Medium](#Medium)? | yes | | - | semiBold | [SemiBold](#SemiBold)? | yes | | - | bold | [Bold](#Bold)? | yes | | - | light | [Light](#Light)? | yes | | - | regular | [Regular](#Regular)? | yes | | - ---- - - - - - #### [Medium](#Medium) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | file | String? | yes | | - ---- - - - - - #### [SemiBold](#SemiBold) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | file | String? | yes | | - ---- - - - - - #### [Bold](#Bold) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | file | String? | yes | | - ---- - - - - - #### [Light](#Light) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | file | String? | yes | | - ---- - - - - - #### [Regular](#Regular) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | file | String? | yes | | - ---- - - - - - #### [Blocks](#Blocks) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | name | String? | yes | | - | props | [[BlocksProps](#BlocksProps)]? | yes | | - ---- - - - - - #### [GlobalSchemaProps](#GlobalSchemaProps) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | label | String? | yes | | - | type | String? | yes | | - | category | String? | yes | | - ---- - - - - - #### [BlocksProps](#BlocksProps) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | label | String? | yes | | - | type | String? | yes | | - ---- - - - - - - - #### [EditEmailRequestSchema](#EditEmailRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | String? | yes | | - ---- - - - - - #### [SendVerificationLinkMobileRequestSchema](#SendVerificationLinkMobileRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | verified | Bool? | yes | | - | active | Bool? | yes | | - | countryCode | String? | yes | | - | phone | String? | yes | | - | primary | Bool? | yes | | - ---- - - - - - #### [EditMobileRequestSchema](#EditMobileRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | countryCode | String? | yes | | - | phone | String? | yes | | - ---- - - - - - #### [EditProfileRequestSchema](#EditProfileRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | firstName | String? | yes | | - | lastName | String? | yes | | - | mobile | [EditProfileMobileSchema](#EditProfileMobileSchema)? | yes | | - | countryCode | String? | yes | | - | email | String? | yes | | - | gender | String? | yes | | - | dob | String? | yes | | - | profilePicUrl | String? | yes | | - | androidHash | String? | yes | | - | sender | String? | yes | | - | registerToken | String? | yes | | - ---- - - - - - #### [EditProfileMobileSchema](#EditProfileMobileSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | phone | String? | yes | | - | countryCode | String? | yes | | - ---- - - - - - #### [SendEmailOtpRequestSchema](#SendEmailOtpRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | String? | yes | | - | action | String? | yes | | - | token | String? | yes | | - | registerToken | String? | yes | | - ---- - - - - - #### [VerifyEmailOtpRequestSchema](#VerifyEmailOtpRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | String? | yes | | - | action | String? | yes | | - | registerToken | String? | yes | | - | otp | String? | yes | | - ---- - - - - - #### [VerifyOtpRequestSchema](#VerifyOtpRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | requestId | String? | yes | | - | registerToken | String? | yes | | - | otp | String? | yes | | - ---- - - - - - #### [SendMobileOtpRequestSchema](#SendMobileOtpRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | mobile | String? | yes | | - | countryCode | String? | yes | | - | action | String? | yes | | - | token | String? | yes | | - | androidHash | String? | yes | | - | force | String? | yes | | - | captchaCode | String? | yes | | - ---- - - - - - #### [UpdatePasswordRequestSchema](#UpdatePasswordRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | oldPassword | String? | yes | | - | newPassword | String? | yes | | - ---- - - - - - #### [FormRegisterRequestSchema](#FormRegisterRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | firstName | String? | yes | | - | lastName | String? | yes | | - | gender | String? | yes | | - | email | String? | yes | | - | password | String? | yes | | - | phone | [FormRegisterRequestSchemaPhone](#FormRegisterRequestSchemaPhone)? | yes | | - | registerToken | String? | yes | | - ---- - - - - - #### [TokenRequestBodySchema](#TokenRequestBodySchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | token | String? | yes | | - ---- - - - - - #### [ForgotPasswordRequestSchema](#ForgotPasswordRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | code | String? | yes | | - | password | String? | yes | | - ---- - - - - - #### [CodeRequestBodySchema](#CodeRequestBodySchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | code | String? | yes | | - ---- - - - - - #### [SendResetPasswordEmailRequestSchema](#SendResetPasswordEmailRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | String? | yes | | - | captchaCode | String? | yes | | - ---- - - - - - #### [PasswordLoginRequestSchema](#PasswordLoginRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | captchaCode | String? | yes | | - | password | String? | yes | | - | username | String? | yes | | - ---- - - - - - #### [SendOtpRequestSchema](#SendOtpRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | countryCode | String? | yes | | - | captchaCode | String? | yes | | - | mobile | String? | yes | | - ---- - - - - - #### [OAuthRequestSchema](#OAuthRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isSignedIn | Bool? | yes | | - | oauth2 | [OAuthRequestSchemaOauth2](#OAuthRequestSchemaOauth2)? | yes | | - | profile | [OAuthRequestSchemaProfile](#OAuthRequestSchemaProfile)? | yes | | - ---- - - - - - #### [UserObjectSchema](#UserObjectSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | user | [UserSchema](#UserSchema)? | yes | | - ---- - - - - - #### [AuthSuccess](#AuthSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | registerToken | String? | yes | | - | userExists | Bool? | yes | | - | user | [UserSchema](#UserSchema)? | yes | | - ---- - - - - - #### [SendOtpResponse](#SendOtpResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | resendTimer | Int? | yes | | - | resendToken | String? | yes | | - | success | Bool? | yes | | - | requestId | String? | yes | | - | message | String? | yes | | - | mobile | String? | yes | | - | countryCode | String? | yes | | - | email | String? | yes | | - | resendEmailToken | String? | yes | | - | registerToken | String? | yes | | - | verifyEmailOtp | Bool? | yes | | - | verifyMobileOtp | Bool? | yes | | - | userExists | Bool? | yes | | - ---- - - - - - #### [ProfileEditSuccess](#ProfileEditSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | user | [UserSchema](#UserSchema)? | yes | | - | registerToken | String? | yes | | - | userExists | Bool? | yes | | - | verifyEmailLink | Bool? | yes | | - | verifyEmailOtp | Bool? | yes | | - | verifyMobileOtp | Bool? | yes | | - | email | String? | yes | | - ---- - - - - - #### [LoginSuccess](#LoginSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | user | [UserSchema](#UserSchema)? | yes | | - | requestId | String? | yes | | - | registerToken | String? | yes | | - ---- - - - - - #### [VerifyOtpSuccess](#VerifyOtpSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | user | [UserSchema](#UserSchema)? | yes | | - | userExists | Bool? | yes | | - | registerToken | String? | yes | | - ---- - - - - - #### [ResetPasswordSuccess](#ResetPasswordSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | status | String? | yes | | - ---- - - - - - #### [RegisterFormSuccess](#RegisterFormSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | String? | yes | | - | resendTimer | Int? | yes | | - | resendToken | String? | yes | | - | resendEmailToken | String? | yes | | - | registerToken | String? | yes | | - | success | Bool? | yes | | - | requestId | String? | yes | | - | message | String? | yes | | - | mobile | String? | yes | | - | countryCode | String? | yes | | - | verifyEmailOtp | Bool? | yes | | - | verifyMobileOtp | Bool? | yes | | - | userExists | Bool? | yes | | - ---- - - - - - #### [VerifyEmailSuccess](#VerifyEmailSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [HasPasswordSuccess](#HasPasswordSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | result | Bool? | yes | | - ---- - - - - - #### [LogoutSuccess](#LogoutSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | logout | Bool? | yes | | - ---- - - - - - #### [OtpSuccess](#OtpSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | resendTimer | Int? | yes | | - | resendToken | String? | yes | | - | registerToken | String? | yes | | - | success | Bool? | yes | | - | requestId | String? | yes | | - | message | String? | yes | | - | mobile | String? | yes | | - | countryCode | String? | yes | | - ---- - - - - - #### [EmailOtpSuccess](#EmailOtpSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool? | yes | | - ---- - - - - - #### [SessionListSuccess](#SessionListSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | sessions | [String]? | yes | | - ---- - - - - - #### [VerifyMobileOTPSuccess](#VerifyMobileOTPSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | user | [UserSchema](#UserSchema)? | yes | | - | verifyMobileLink | Bool? | yes | | - ---- - - - - - #### [VerifyEmailOTPSuccess](#VerifyEmailOTPSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | user | [UserSchema](#UserSchema)? | yes | | - | verifyEmailLink | Bool? | yes | | - ---- - - - - - #### [SendMobileVerifyLinkSuccess](#SendMobileVerifyLinkSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | verifyMobileLink | Bool? | yes | | - ---- - - - - - #### [SendEmailVerifyLinkSuccess](#SendEmailVerifyLinkSuccess) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | verifyEmailLink | Bool? | yes | | - ---- - - - - - #### [UserSearchResponseSchema](#UserSearchResponseSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | users | [[UserSchema](#UserSchema)]? | yes | | - ---- - - - - - #### [CustomerListResponseSchema](#CustomerListResponseSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[UserSchema](#UserSchema)]? | yes | | - | page | [PaginationSchema](#PaginationSchema)? | yes | | - ---- - - - - - #### [UnauthorizedSchema](#UnauthorizedSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [UnauthenticatedSchema](#UnauthenticatedSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | authenticated | Bool? | yes | | - ---- - - - - - #### [NotFoundSchema](#NotFoundSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [AuthenticationInternalServerErrorSchema](#AuthenticationInternalServerErrorSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [AuthenticationApiErrorSchema](#AuthenticationApiErrorSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [ProfileEditSuccessSchema](#ProfileEditSuccessSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | String? | yes | | - | verifyEmailOtp | Bool? | yes | | - | verifyEmailLink | Bool? | yes | | - | verifyMobileOtp | Bool? | yes | | - | user | String? | yes | | - | registerToken | String? | yes | | - | userExists | Bool? | yes | | - ---- - - - - - #### [FormRegisterRequestSchemaPhone](#FormRegisterRequestSchemaPhone) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | countryCode | String? | yes | | - | mobile | String? | yes | | - ---- - - - - - #### [OAuthRequestSchemaOauth2](#OAuthRequestSchemaOauth2) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | accessToken | String? | yes | | - | expiry | Int? | yes | | - | refreshToken | String? | yes | | - ---- - - - - - #### [OAuthRequestSchemaProfile](#OAuthRequestSchemaProfile) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | lastName | String? | yes | | - | image | String? | yes | | - | id | String? | yes | | - | email | String? | yes | | - | fullName | String? | yes | | - | firstName | String? | yes | | - ---- - - - - - #### [AuthSuccessUser](#AuthSuccessUser) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | firstName | String? | yes | | - | lastName | String? | yes | | - | debug | [AuthSuccessUserDebug](#AuthSuccessUserDebug)? | yes | | - | active | Bool? | yes | | - | emails | [AuthSuccessUserEmails](#AuthSuccessUserEmails)? | yes | | - ---- - - - - - #### [AuthSuccessUserDebug](#AuthSuccessUserDebug) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | platform | String? | yes | | - ---- - - - - - #### [AuthSuccessUserEmails](#AuthSuccessUserEmails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | String? | yes | | - | verified | Bool? | yes | | - | primary | Bool? | yes | | - | active | Bool? | yes | | - ---- - - - - - #### [CreateUserRequestSchema](#CreateUserRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | phoneNumber | String | no | | - | email | String? | yes | | - | firstName | String? | yes | | - | lastName | String? | yes | | - | gender | String? | yes | | - | username | String | no | | - | meta | [String: Any]? | yes | | - ---- - - - - - #### [CreateUserResponseSchema](#CreateUserResponseSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | user | [UserSchema](#UserSchema)? | yes | | - ---- - - - - - #### [CreateUserSessionRequestSchema](#CreateUserSessionRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | domain | String? | yes | | - | maxAge | Double? | yes | | - | userId | String? | yes | | - ---- - - - - - #### [CreateUserSessionResponseSchema](#CreateUserSessionResponseSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | domain | String? | yes | | - | maxAge | Double? | yes | | - | secure | Bool? | yes | | - | httpOnly | Bool? | yes | | - | cookie | [String: Any]? | yes | | - ---- - - - - - #### [PlatformSchema](#PlatformSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - | lookAndFeel | [LookAndFeel](#LookAndFeel)? | yes | | - | updatedAt | String? | yes | | - | active | Bool? | yes | | - | forgotPassword | Bool? | yes | | - | login | [Login](#Login)? | yes | | - | skipCaptcha | Bool? | yes | | - | name | String? | yes | | - | meta | [MetaSchema](#MetaSchema)? | yes | | - | id | String? | yes | | - | social | [Social](#Social)? | yes | | - | requiredFields | [RequiredFields](#RequiredFields)? | yes | | - | registerRequiredFields | [RegisterRequiredFields](#RegisterRequiredFields)? | yes | | - | skipLogin | Bool? | yes | | - | flashCard | [FlashCard](#FlashCard)? | yes | | - | subtext | String? | yes | | - | socialTokens | [SocialTokens](#SocialTokens)? | yes | | - | createdAt | String? | yes | | - | register | Bool? | yes | | - | mobileImage | String? | yes | | - | desktopImage | String? | yes | | - ---- - - - - - #### [LookAndFeel](#LookAndFeel) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cardPosition | String? | yes | | - | backgroundColor | String? | yes | | - ---- - - - - - #### [Login](#Login) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | password | Bool? | yes | | - | otp | Bool? | yes | | - ---- - - - - - #### [MetaSchema](#MetaSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | fyndDefault | Bool? | yes | | - ---- - - - - - #### [Social](#Social) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | accountKit | Bool? | yes | | - | facebook | Bool? | yes | | - | google | Bool? | yes | | - ---- - - - - - #### [RequiredFields](#RequiredFields) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | [PlatformEmail](#PlatformEmail)? | yes | | - | mobile | [PlatformMobile](#PlatformMobile)? | yes | | - ---- - - - - - #### [PlatformEmail](#PlatformEmail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isRequired | Bool? | yes | | - | level | String? | yes | | - ---- - - - - - #### [PlatformMobile](#PlatformMobile) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isRequired | Bool? | yes | | - | level | String? | yes | | - ---- - - - - - #### [RegisterRequiredFields](#RegisterRequiredFields) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | [RegisterRequiredFieldsEmail](#RegisterRequiredFieldsEmail)? | yes | | - | mobile | [RegisterRequiredFieldsMobile](#RegisterRequiredFieldsMobile)? | yes | | - ---- - - - - - #### [RegisterRequiredFieldsEmail](#RegisterRequiredFieldsEmail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isRequired | Bool? | yes | | - | level | String? | yes | | - ---- - - - - - #### [RegisterRequiredFieldsMobile](#RegisterRequiredFieldsMobile) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isRequired | Bool? | yes | | - | level | String? | yes | | - ---- - - - - - #### [FlashCard](#FlashCard) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | text | String? | yes | | - | textColor | String? | yes | | - | backgroundColor | String? | yes | | - ---- - - - - - #### [SocialTokens](#SocialTokens) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | facebook | [Facebook](#Facebook)? | yes | | - | accountKit | [Accountkit](#Accountkit)? | yes | | - | google | [Google](#Google)? | yes | | - ---- - - - - - #### [Facebook](#Facebook) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | appId | String? | yes | | - ---- - - - - - #### [Accountkit](#Accountkit) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | appId | String? | yes | | - ---- - - - - - #### [Google](#Google) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | appId | String? | yes | | - ---- - - - - - #### [UpdateUserRequestSchema](#UpdateUserRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | firstName | String? | yes | | - | lastName | String? | yes | | - | gender | String? | yes | | - | meta | [String: Any]? | yes | | - ---- - - - - - #### [UserSchema](#UserSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | firstName | String? | yes | | - | meta | [String: Any]? | yes | | - | lastName | String? | yes | | - | phoneNumbers | [[PhoneNumber](#PhoneNumber)]? | yes | | - | emails | [[Email](#Email)]? | yes | | - | gender | String? | yes | | - | dob | String? | yes | | - | active | Bool? | yes | | - | profilePicUrl | String? | yes | | - | username | String? | yes | | - | accountType | String? | yes | | - | uid | String? | yes | | - | debug | [Debug](#Debug)? | yes | | - | hasOldPasswordHash | Bool? | yes | | - | id | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - ---- - - - - - - - #### [ApplicationLegal](#ApplicationLegal) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | application | String? | yes | | - | tnc | String? | yes | | - | policy | String? | yes | | - | shipping | String? | yes | | - | faq | [[ApplicationLegalFAQ](#ApplicationLegalFAQ)]? | yes | | - | id | String? | yes | | - | updatedAt | String? | yes | | - | createdAt | String? | yes | | - ---- - - - - - #### [ApplicationLegalFAQ](#ApplicationLegalFAQ) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | question | String? | yes | | - | answer | String? | yes | | - ---- - - - - - #### [SeoComponent](#SeoComponent) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | seo | [SeoSchema](#SeoSchema)? | yes | | - ---- - - - - - #### [SeoSchema](#SeoSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | app | String? | yes | | - | id | String? | yes | | - | robotsTxt | String? | yes | | - | sitemapEnabled | Bool? | yes | | - | customMetaTags | [[CustomMetaTag](#CustomMetaTag)]? | yes | | - | details | [Detail](#Detail)? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - ---- - - - - - #### [CustomMetaTag](#CustomMetaTag) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | content | String? | yes | | - | id | String? | yes | | - ---- - - - - - #### [Detail](#Detail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | description | String? | yes | | - ---- - - - - - #### [AnnouncementPageSchema](#AnnouncementPageSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pageSlug | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [EditorMeta](#EditorMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | foregroundColor | String? | yes | | - | backgroundColor | String? | yes | | - | contentType | String? | yes | | - | content | String? | yes | | - ---- - - - - - #### [AnnouncementAuthorSchema](#AnnouncementAuthorSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdBy | String? | yes | | - | modifiedBy | String? | yes | | - ---- - - - - - #### [AdminAnnouncementSchema](#AdminAnnouncementSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | platforms | [String]? | yes | | - | title | String? | yes | | - | announcement | String? | yes | | - | pages | [[AnnouncementPageSchema](#AnnouncementPageSchema)]? | yes | | - | editorMeta | [EditorMeta](#EditorMeta)? | yes | | - | author | [AnnouncementAuthorSchema](#AnnouncementAuthorSchema)? | yes | | - | createdAt | String? | yes | | - | app | String? | yes | | - | modifiedAt | String? | yes | | - | schedule | [ScheduleSchema](#ScheduleSchema)? | yes | | - ---- - - - - - #### [ScheduleSchema](#ScheduleSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cron | String? | yes | | - | start | String? | yes | | - | end | String? | yes | | - | duration | Double? | yes | | - | nextSchedule | [[NextSchedule](#NextSchedule)]? | yes | | - ---- - - - - - #### [NextSchedule](#NextSchedule) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | start | String? | yes | | - | end | String? | yes | | - ---- - - - - - #### [AnnouncementSchema](#AnnouncementSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | announcement | String? | yes | | - | schedule | [ScheduleStartSchema](#ScheduleStartSchema)? | yes | | - ---- - - - - - #### [ScheduleStartSchema](#ScheduleStartSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | start | String? | yes | | - | end | String? | yes | | - ---- - - - - - #### [BlogGetResponse](#BlogGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[BlogSchema](#BlogSchema)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [ResourceContent](#ResourceContent) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | value | String? | yes | | - ---- - - - - - #### [Asset](#Asset) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | aspectRatio | String? | yes | | - | id | String? | yes | | - | secureUrl | String? | yes | | - ---- - - - - - #### [Author](#Author) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | designation | String? | yes | | - | id | String? | yes | | - | name | String? | yes | | - ---- - - - - - #### [BlogSchema](#BlogSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | customJson | [String: Any]? | yes | | - | application | String? | yes | | - | archived | Bool? | yes | | - | author | [Author](#Author)? | yes | | - | content | [[ResourceContent](#ResourceContent)]? | yes | | - | featureImage | [Asset](#Asset)? | yes | | - | published | Bool? | yes | | - | readingTime | String? | yes | | - | slug | String? | yes | | - | tags | [String]? | yes | | - | seo | [SEO](#SEO)? | yes | | - | schedule | [CronSchedule](#CronSchedule)? | yes | | - | title | String? | yes | | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - ---- - - - - - #### [SEO](#SEO) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | image | [SEOImage](#SEOImage)? | yes | | - | title | String? | yes | | - ---- - - - - - #### [SEOImage](#SEOImage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | url | String? | yes | | - ---- - - - - - #### [BlogRequest](#BlogRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | application | String? | yes | | - | customJson | [String: Any]? | yes | | - | author | [Author](#Author)? | yes | | - | content | [[ResourceContent](#ResourceContent)]? | yes | | - | featureImage | [Asset](#Asset)? | yes | | - | published | Bool? | yes | | - | readingTime | String? | yes | | - | slug | String? | yes | | - | tags | [String]? | yes | | - | title | String? | yes | | - | seo | [SEO](#SEO)? | yes | | - | schedule | [CronSchedule](#CronSchedule)? | yes | | - ---- - - - - - #### [GetAnnouncementListSchema](#GetAnnouncementListSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[AdminAnnouncementSchema](#AdminAnnouncementSchema)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [CreateAnnouncementSchema](#CreateAnnouncementSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - | data | [AdminAnnouncementSchema](#AdminAnnouncementSchema)? | yes | | - ---- - - - - - #### [Navigation](#Navigation) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | slug | String? | yes | | - | orientation | String? | yes | | - | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | id | String? | yes | | - | position | String? | yes | | - | application | String? | yes | | - | platform | String? | yes | | - | navigation | [NavigationReference](#NavigationReference)? | yes | | - ---- - - - - - #### [LocaleLanguage](#LocaleLanguage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | hi | [Language](#Language)? | yes | | - | ar | [Language](#Language)? | yes | | - | enUs | [Language](#Language)? | yes | | - ---- - - - - - #### [Language](#Language) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - ---- - - - - - #### [Action](#Action) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | page | [ActionPage](#ActionPage)? | yes | | - | popup | [ActionPage](#ActionPage)? | yes | | - | type | String? | yes | | - ---- - - - - - #### [ActionPage](#ActionPage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | params | [String: [String]]? | yes | | - | query | [String: [String]]? | yes | | - | url | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [NavigationReference](#NavigationReference) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | acl | [String]? | yes | | - | tags | [String]? | yes | | - | localeLanguage | [LocaleLanguage](#LocaleLanguage)? | yes | | - | image | String? | yes | | - | type | String? | yes | | - | action | [Action](#Action)? | yes | | - | active | Bool? | yes | | - | display | String? | yes | | - | sortOrder | Int? | yes | | - | subNavigation | [[NavigationReference](#NavigationReference)]? | yes | | - ---- - - - - - #### [LandingPage](#LandingPage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | data | [LandingPageSchema](#LandingPageSchema)? | yes | | - | success | Bool? | yes | | - ---- - - - - - #### [ConfigurationSchema](#ConfigurationSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | sleepTime | Int? | yes | | - | startOnLaunch | Bool? | yes | | - | duration | Int? | yes | | - | slideDirection | String? | yes | | - ---- - - - - - #### [SlideshowMedia](#SlideshowMedia) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | url | String? | yes | | - | bgColor | String? | yes | | - | duration | Int? | yes | | - | autoDecideDuration | Bool? | yes | | - | action | [Action](#Action)? | yes | | - ---- - - - - - #### [Slideshow](#Slideshow) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | data | [SlideshowSchema](#SlideshowSchema)? | yes | | - | success | Bool? | yes | | - ---- - - - - - #### [AnnouncementsResponseSchema](#AnnouncementsResponseSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | announcements | [String: [[AnnouncementSchema](#AnnouncementSchema)]]? | yes | | - | refreshRate | Int? | yes | number of seconds after which api should hit again to fetch new announcements | - | refreshPages | [String]? | yes | list of page slugs on which announcement should be fetched as soon as they are loaded | - ---- - - - - - #### [FaqResponseSchema](#FaqResponseSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | faqs | [[FaqSchema](#FaqSchema)]? | yes | | - ---- - - - - - #### [UpdateHandpickedSchema](#UpdateHandpickedSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | tag | [HandpickedTagSchema](#HandpickedTagSchema)? | yes | | - ---- - - - - - #### [HandpickedTagSchema](#HandpickedTagSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | position | String? | yes | | - | attributes | [String: Any]? | yes | | - | name | String? | yes | | - | url | String? | yes | | - | type | String? | yes | | - | subType | String? | yes | | - | content | String? | yes | | - ---- - - - - - #### [RemoveHandpickedSchema](#RemoveHandpickedSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | tags | [String]? | yes | | - ---- - - - - - #### [CreateTagSchema](#CreateTagSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | subType | String? | yes | | - | id | String? | yes | | - | type | String? | yes | | - | url | String? | yes | | - | position | String? | yes | | - | attributes | [String: Any]? | yes | | - | content | String? | yes | | - ---- - - - - - #### [CreateTagRequestSchema](#CreateTagRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | tags | [[CreateTagSchema](#CreateTagSchema)]? | yes | | - ---- - - - - - #### [TagDeleteSuccessResponse](#TagDeleteSuccessResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool? | yes | | - ---- - - - - - #### [APIError](#APIError) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - | status | Double? | yes | | - | code | String? | yes | | - | exception | String? | yes | | - | info | String? | yes | | - | requestId | String? | yes | | - | stackTrace | String? | yes | | - | meta | [String: Any]? | yes | | - ---- - - - - - #### [CategorySchema](#CategorySchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | index | Int? | yes | | - | title | String? | yes | | - | description | String? | yes | | - | children | [String]? | yes | | - | id | String? | yes | | - | slug | String? | yes | | - | application | String? | yes | | - | iconUrl | String? | yes | | - | customJson | [String: Any]? | yes | | - ---- - - - - - #### [ChildrenSchema](#ChildrenSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | question | String? | yes | | - | answer | String? | yes | | - | slug | String? | yes | | - | application | String? | yes | | - | id | String? | yes | | - ---- - - - - - #### [CategoryRequestSchema](#CategoryRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | slug | String? | yes | | - | title | String? | yes | | - ---- - - - - - #### [FAQCategorySchema](#FAQCategorySchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | index | Int? | yes | | - | title | String? | yes | | - | description | String? | yes | | - | children | [[ChildrenSchema](#ChildrenSchema)]? | yes | | - | id | String? | yes | | - | slug | String? | yes | | - | application | String? | yes | | - | iconUrl | String? | yes | | - | customJson | [String: Any]? | yes | | - ---- - - - - - #### [FaqSchema](#FaqSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | slug | String? | yes | | - | application | String? | yes | | - | id | String? | yes | | - | question | String? | yes | | - | answer | String? | yes | | - ---- - - - - - #### [FAQ](#FAQ) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | slug | String? | yes | | - | question | String? | yes | | - | answer | String? | yes | | - ---- - - - - - #### [CreateFaqResponseSchema](#CreateFaqResponseSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | faq | [FaqSchema](#FaqSchema)? | yes | | - ---- - - - - - #### [CreateFaqSchema](#CreateFaqSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | faq | [FAQ](#FAQ)? | yes | | - ---- - - - - - #### [GetFaqSchema](#GetFaqSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | faqs | [[FaqSchema](#FaqSchema)]? | yes | | - ---- - - - - - #### [UpdateFaqCategoryRequestSchema](#UpdateFaqCategoryRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | category | [CategorySchema](#CategorySchema)? | yes | | - ---- - - - - - #### [CreateFaqCategoryRequestSchema](#CreateFaqCategoryRequestSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | category | [CategoryRequestSchema](#CategoryRequestSchema)? | yes | | - ---- - - - - - #### [CreateFaqCategorySchema](#CreateFaqCategorySchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | category | [CategorySchema](#CategorySchema)? | yes | | - ---- - - - - - #### [GetFaqCategoriesSchema](#GetFaqCategoriesSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | categories | [[CategorySchema](#CategorySchema)]? | yes | | - ---- - - - - - #### [GetFaqCategoryBySlugSchema](#GetFaqCategoryBySlugSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | category | [FAQCategorySchema](#FAQCategorySchema)? | yes | | - ---- - - - - - #### [LandingPageGetResponse](#LandingPageGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[LandingPageSchema](#LandingPageSchema)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [LandingPageSchema](#LandingPageSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | slug | String? | yes | | - | action | [Action](#Action)? | yes | | - | platform | [String]? | yes | | - | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | id | String? | yes | | - | application | String? | yes | | - | archived | Bool? | yes | | - | customJson | [String: Any]? | yes | | - ---- - - - - - #### [DefaultNavigationResponse](#DefaultNavigationResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[NavigationSchema](#NavigationSchema)]? | yes | | - ---- - - - - - #### [NavigationGetResponse](#NavigationGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[NavigationSchema](#NavigationSchema)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [Orientation](#Orientation) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | portrait | [String]? | yes | | - | landscape | [String]? | yes | | - ---- - - - - - #### [NavigationSchema](#NavigationSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | application | String? | yes | | - | archived | Bool? | yes | | - | name | String? | yes | | - | slug | String? | yes | | - | platform | [String]? | yes | | - | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | orientation | [Orientation](#Orientation)? | yes | | - | version | Double? | yes | | - | navigation | [[NavigationReference](#NavigationReference)]? | yes | | - ---- - - - - - #### [NavigationRequest](#NavigationRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | slug | String? | yes | | - | platform | [String]? | yes | | - | orientation | [Orientation](#Orientation)? | yes | | - | navigation | [[NavigationReference](#NavigationReference)]? | yes | | - ---- - - - - - #### [CustomPageSchema](#CustomPageSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | platform | String? | yes | | - | title | String? | yes | | - | slug | String? | yes | | - | type | String? | yes | | - | orientation | String? | yes | | - | application | String? | yes | | - | description | String? | yes | | - | published | Bool? | yes | | - | tags | [String]? | yes | | - | content | [[String: Any]]? | yes | | - | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | schedule | [ScheduleSchema](#ScheduleSchema)? | yes | | - ---- - - - - - #### [ContentSchema](#ContentSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | value | [String: Any]? | yes | | - ---- - - - - - #### [CustomPage](#CustomPage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | data | [CustomPageSchema](#CustomPageSchema)? | yes | | - ---- - - - - - #### [FeatureImage](#FeatureImage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | secureUrl | String? | yes | | - ---- - - - - - #### [PageGetResponse](#PageGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[PageSchema](#PageSchema)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [PageSpec](#PageSpec) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | specifications | [[PageSpecItem](#PageSpecItem)]? | yes | | - ---- - - - - - #### [PageSpecParam](#PageSpecParam) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String? | yes | | - | required | Bool? | yes | | - ---- - - - - - #### [PageSpecItem](#PageSpecItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pageType | String? | yes | | - | displayName | String? | yes | | - | params | [[PageSpecParam](#PageSpecParam)]? | yes | | - | query | [[PageSpecParam](#PageSpecParam)]? | yes | | - ---- - - - - - #### [PageSchema](#PageSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | application | String? | yes | | - | componentIds | [String]? | yes | Components can be used to store multiple components | - | content | [[String: Any]]? | yes | | - | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | description | String? | yes | | - | featureImage | [Asset](#Asset)? | yes | | - | pageMeta | [[String: Any]]? | yes | | - | schedule | [ScheduleSchema](#ScheduleSchema)? | yes | | - | customJson | [String: Any]? | yes | | - | orientation | String? | yes | | - | platform | String? | yes | | - | published | Bool? | yes | | - | slug | String? | yes | | - | tags | [String]? | yes | | - | title | String? | yes | | - | type | String? | yes | | - | seo | [SEO](#SEO)? | yes | | - | visibility | [String: Any]? | yes | | - | archived | Bool? | yes | | - ---- - - - - - #### [CreatedBySchema](#CreatedBySchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - ---- - - - - - #### [PageContent](#PageContent) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | value | [String: Any]? | yes | | - ---- - - - - - #### [PageMeta](#PageMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String? | yes | | - | value | [String: Any]? | yes | | - ---- - - - - - #### [PageRequest](#PageRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | schedule | [CronSchedule](#CronSchedule)? | yes | | - | application | String? | yes | | - | author | [Author](#Author)? | yes | | - | customJson | [String: Any]? | yes | | - | orientation | String? | yes | | - | content | [[String: Any]]? | yes | | - | featureImage | [Asset](#Asset)? | yes | | - | published | Bool? | yes | | - | readingTime | String? | yes | | - | slug | String? | yes | | - | tags | [String]? | yes | | - | seo | [SEO](#SEO)? | yes | | - | title | String? | yes | | - ---- - - - - - #### [CronSchedule](#CronSchedule) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cron | String? | yes | | - | start | String? | yes | | - | end | String? | yes | | - | duration | Double? | yes | | - ---- - - - - - #### [PagePublishRequest](#PagePublishRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | publish | Bool? | yes | | - ---- - - - - - #### [PageMetaSchema](#PageMetaSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | systemPages | [[NavigationSchema](#NavigationSchema)]? | yes | | - | customPages | [[PageSchema](#PageSchema)]? | yes | | - | applicationId | String? | yes | | - ---- - - - - - #### [SlideshowGetResponse](#SlideshowGetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[SlideshowSchema](#SlideshowSchema)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [SlideshowSchema](#SlideshowSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | slug | String? | yes | | - | dateMeta | [DateMeta](#DateMeta)? | yes | | - | application | String? | yes | | - | platform | String? | yes | | - | configuration | [ConfigurationSchema](#ConfigurationSchema)? | yes | | - | media | [[SlideshowMedia](#SlideshowMedia)]? | yes | | - | active | Bool? | yes | | - | archived | Bool? | yes | | - | customJson | [String: Any]? | yes | | - ---- - - - - - #### [SlideshowRequest](#SlideshowRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | slug | String? | yes | | - | platform | String? | yes | | - | configuration | [ConfigurationSchema](#ConfigurationSchema)? | yes | | - | media | [SlideshowMedia](#SlideshowMedia)? | yes | | - | active | Bool? | yes | | - ---- - - - - - #### [Support](#Support) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | created | Bool? | yes | | - | id | String? | yes | | - | configType | String? | yes | | - | application | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | contact | [ContactSchema](#ContactSchema)? | yes | | - ---- - - - - - #### [PhoneProperties](#PhoneProperties) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String? | yes | | - | code | String? | yes | | - | number | String? | yes | | - ---- - - - - - #### [PhoneSchema](#PhoneSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool? | yes | | - | phone | [[PhoneProperties](#PhoneProperties)]? | yes | | - ---- - - - - - #### [EmailProperties](#EmailProperties) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String? | yes | | - | value | String? | yes | | - ---- - - - - - #### [EmailSchema](#EmailSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool? | yes | | - | email | [[EmailProperties](#EmailProperties)]? | yes | | - ---- - - - - - #### [ContactSchema](#ContactSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | phone | [PhoneSchema](#PhoneSchema)? | yes | | - | email | [EmailSchema](#EmailSchema)? | yes | | - ---- - - - - - #### [TagsSchema](#TagsSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | application | String? | yes | | - | id | String? | yes | | - | tags | [[TagSchema](#TagSchema)]? | yes | | - ---- - - - - - #### [TagSchema](#TagSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | url | String? | yes | | - | type | String? | yes | | - | subType | String? | yes | | - | id | String? | yes | | - | position | String? | yes | | - | attributes | [String: Any]? | yes | | - | content | String? | yes | | - ---- - - - - - - - #### [UnauthenticatedUser](#UnauthenticatedUser) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | Failure message. | - ---- - - - - - #### [UnauthenticatedApplication](#UnauthenticatedApplication) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | Failure message. | - ---- - - - - - #### [BadRequest](#BadRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | Failure message. | - ---- - - - - - #### [ResourceNotFound](#ResourceNotFound) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | Resource not found with {id} | - ---- - - - - - #### [InternalServerError](#InternalServerError) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | Internal server Server error | - | code | String? | yes | Error code | - ---- - - - - - #### [PlanRecurring](#PlanRecurring) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | interval | String? | yes | | - | intervalCount | Double? | yes | | - ---- - - - - - #### [Plan](#Plan) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | recurring | [PlanRecurring](#PlanRecurring)? | yes | | - | isTrialPlan | Bool? | yes | | - | planGroup | String? | yes | | - | tagLines | [String]? | yes | | - | currency | String? | yes | | - | isActive | Bool? | yes | | - | isVisible | Bool? | yes | | - | trialPeriod | Double? | yes | | - | addons | [String]? | yes | | - | tags | [String]? | yes | | - | type | String? | yes | | - | country | String? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | description | String? | yes | | - | amount | Double? | yes | | - | productSuiteId | String? | yes | | - | createdAt | String? | yes | | - | modifiedAt | String? | yes | | - ---- - - - - - #### [DetailedPlanComponents](#DetailedPlanComponents) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | slug | String? | yes | | - | description | String? | yes | | - | group | String? | yes | | - | icon | String? | yes | | - | links | [String: Any]? | yes | | - | enabled | Bool? | yes | | - | displayText | String? | yes | | - ---- - - - - - #### [DetailedPlan](#DetailedPlan) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | recurring | [PlanRecurring](#PlanRecurring)? | yes | | - | isTrialPlan | Bool? | yes | | - | planGroup | String? | yes | | - | tagLines | [String]? | yes | | - | currency | String? | yes | | - | isActive | Bool? | yes | | - | isVisible | Bool? | yes | | - | trialPeriod | Double? | yes | | - | addons | [String]? | yes | | - | tags | [String]? | yes | | - | type | String? | yes | | - | country | String? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | description | String? | yes | | - | amount | Double? | yes | | - | productSuiteId | String? | yes | | - | createdAt | String? | yes | | - | modifiedAt | String? | yes | | - | components | [[DetailedPlanComponents](#DetailedPlanComponents)]? | yes | | - ---- - - - - - #### [SubscriptionTrialPeriod](#SubscriptionTrialPeriod) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | startDate | String? | yes | | - | endDate | String? | yes | | - ---- - - - - - #### [EntityChargePrice](#EntityChargePrice) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amount | Double | no | Amount for price. Minimum value 1 | - | currencyCode | String | no | | - ---- - - - - - #### [EntityChargeRecurring](#EntityChargeRecurring) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | interval | String | no | | - ---- - - - - - #### [ChargeLineItem](#ChargeLineItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String | no | | - | term | String | no | | - | pricingType | String | no | | - | price | [EntityChargePrice](#EntityChargePrice) | no | | - | recurring | [EntityChargeRecurring](#EntityChargeRecurring)? | yes | | - | cappedAmount | Double? | yes | | - | trialDays | Int? | yes | | - | isTest | Bool? | yes | | - | metadata | [String: Any]? | yes | | - ---- - - - - - #### [CreateSubscriptionCharge](#CreateSubscriptionCharge) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String | no | | - | trialDays | Int? | yes | | - | lineItems | [[ChargeLineItem](#ChargeLineItem)] | no | | - | isTest | Bool? | yes | | - | returnUrl | String | no | | - ---- - - - - - #### [CurrentPeriod](#CurrentPeriod) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | startDate | String? | yes | | - | endDate | String? | yes | | - ---- - - - - - #### [SubscriptionCharge](#SubscriptionCharge) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | name | String? | yes | | - | term | String? | yes | | - | pricingType | String? | yes | | - | price | [EntityChargePrice](#EntityChargePrice)? | yes | | - | recurring | [EntityChargeRecurring](#EntityChargeRecurring)? | yes | | - | cappedAmount | Double? | yes | | - | activatedOn | String? | yes | | - | cancelledOn | String? | yes | | - | billingDate | String? | yes | | - | currentPeriod | [CurrentPeriod](#CurrentPeriod)? | yes | | - | status | String? | yes | | - | isTest | Bool? | yes | | - | metadata | [String: Any]? | yes | | - ---- - - - - - #### [EntitySubscription](#EntitySubscription) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | name | String? | yes | | - | status | String? | yes | | - | companyId | Int? | yes | | - | activatedOn | String? | yes | | - | cancelledOn | String? | yes | | - | trialDays | Int? | yes | | - | trialPeriod | [SubscriptionTrialPeriod](#SubscriptionTrialPeriod)? | yes | | - | metadata | [String: Any]? | yes | | - | lineItems | [[SubscriptionCharge](#SubscriptionCharge)]? | yes | | - ---- - - - - - #### [CreateSubscriptionResponse](#CreateSubscriptionResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | subscription | [EntitySubscription](#EntitySubscription)? | yes | | - | confirmUrl | String? | yes | | - ---- - - - - - #### [InvoiceDetailsPeriod](#InvoiceDetailsPeriod) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | start | String? | yes | | - | end | String? | yes | | - ---- - - - - - #### [InvoiceDetailsClient](#InvoiceDetailsClient) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | addressLines | [String]? | yes | | - | name | String? | yes | | - | email | String? | yes | | - | phone | String? | yes | | - ---- - - - - - #### [InvoiceDetailsStatusTrail](#InvoiceDetailsStatusTrail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | value | String? | yes | | - | timestamp | String? | yes | | - ---- - - - - - #### [InvoiceDetailsPaymentMethodsDataChecks](#InvoiceDetailsPaymentMethodsDataChecks) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cvcCheck | String? | yes | | - | addressLine1Check | String? | yes | | - | addressPostalCodeCheck | String? | yes | | - ---- - - - - - #### [InvoiceDetailsPaymentMethodsDataNetworks](#InvoiceDetailsPaymentMethodsDataNetworks) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | available | [String]? | yes | | - | preferred | String? | yes | | - ---- - - - - - #### [InvoiceDetailsPaymentMethodsDataThreeDSecureUsage](#InvoiceDetailsPaymentMethodsDataThreeDSecureUsage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | supported | Bool? | yes | | - ---- - - - - - #### [InvoiceDetailsPaymentMethodsData](#InvoiceDetailsPaymentMethodsData) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | brand | String? | yes | | - | last4 | String? | yes | | - | checks | [InvoiceDetailsPaymentMethodsDataChecks](#InvoiceDetailsPaymentMethodsDataChecks)? | yes | | - | wallet | String? | yes | | - | country | String? | yes | | - | funding | String? | yes | | - | expYear | Int? | yes | | - | networks | [InvoiceDetailsPaymentMethodsDataNetworks](#InvoiceDetailsPaymentMethodsDataNetworks)? | yes | | - | expMonth | Int? | yes | | - | fingerprint | String? | yes | | - | generatedFrom | String? | yes | | - | threeDSecureUsage | [InvoiceDetailsPaymentMethodsDataThreeDSecureUsage](#InvoiceDetailsPaymentMethodsDataThreeDSecureUsage)? | yes | | - ---- - - - - - #### [InvoiceDetailsPaymentMethods](#InvoiceDetailsPaymentMethods) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | Int? | yes | | - | type | String? | yes | | - | pgPaymentMethodId | String? | yes | | - | data | [InvoiceDetailsPaymentMethodsData](#InvoiceDetailsPaymentMethodsData)? | yes | | - | isDefault | Bool? | yes | | - ---- - - - - - #### [InvoicePaymentMethod](#InvoicePaymentMethod) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pgPaymentMethodId | String? | yes | | - ---- - - - - - #### [InvoiceDetails](#InvoiceDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | period | [InvoiceDetailsPeriod](#InvoiceDetailsPeriod)? | yes | | - | client | [InvoiceDetailsClient](#InvoiceDetailsClient)? | yes | | - | autoAdvance | Bool? | yes | | - | currency | String? | yes | | - | paid | Bool? | yes | | - | attemp | Int? | yes | | - | id | String? | yes | | - | collectionMethod | String? | yes | | - | subscriberId | String? | yes | | - | invoiceUrl | String? | yes | | - | number | String? | yes | | - | pgData | [String: Any]? | yes | | - | receiptNumber | String? | yes | | - | statementDescriptor | String? | yes | | - | currentStatus | String? | yes | | - | statusTrail | [[InvoiceDetailsStatusTrail](#InvoiceDetailsStatusTrail)]? | yes | | - | subtotal | Double? | yes | | - | total | Double? | yes | | - | subscription | String? | yes | | - | nextActionTime | String? | yes | | - | createdAt | String? | yes | | - | modifiedAt | String? | yes | | - | hashIdentifier | String? | yes | | - | paymentMethod | [InvoicePaymentMethod](#InvoicePaymentMethod)? | yes | | - ---- - - - - - #### [InvoiceItemsPlanRecurring](#InvoiceItemsPlanRecurring) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | interval | String? | yes | | - | intervalCount | Int? | yes | | - ---- - - - - - #### [InvoiceItemsPlan](#InvoiceItemsPlan) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | recurring | [InvoiceItemsPlanRecurring](#InvoiceItemsPlanRecurring)? | yes | | - | isTrialPlan | Bool? | yes | | - | planGroup | String? | yes | | - | tagLines | [String]? | yes | | - | currency | String? | yes | | - | isActive | Bool? | yes | | - | isVisible | Bool? | yes | | - | trialPeriod | Int? | yes | | - | addons | [String]? | yes | | - | tags | [String]? | yes | | - | type | String? | yes | | - | country | String? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | description | String? | yes | | - | amount | Int? | yes | | - | productSuiteId | String? | yes | | - | createdAt | String? | yes | | - | modifiedAt | String? | yes | | - ---- - - - - - #### [InvoiceItemsPeriod](#InvoiceItemsPeriod) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | start | String? | yes | | - | end | String? | yes | | - ---- - - - - - #### [InvoiceItems](#InvoiceItems) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | currency | String? | yes | | - | plan | [InvoiceItemsPlan](#InvoiceItemsPlan)? | yes | | - | name | String? | yes | | - | quantity | Int? | yes | | - | description | String? | yes | | - | period | [InvoiceItemsPeriod](#InvoiceItemsPeriod)? | yes | | - | unitAmount | Double? | yes | | - | amount | Double? | yes | | - | type | String? | yes | | - | invoiceId | String? | yes | | - | createdAt | String? | yes | | - | modifiedAt | String? | yes | | - ---- - - - - - #### [Invoice](#Invoice) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | invoice | [InvoiceDetails](#InvoiceDetails)? | yes | | - | invoiceItems | [[InvoiceItems](#InvoiceItems)]? | yes | | - ---- - - - - - #### [InvoicesDataClient](#InvoicesDataClient) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | email | String? | yes | | - | phone | String? | yes | | - | addressLines | [String]? | yes | | - ---- - - - - - #### [InvoicesDataPeriod](#InvoicesDataPeriod) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | start | String? | yes | | - | end | String? | yes | | - ---- - - - - - #### [InvoicesDataPaymentMethod](#InvoicesDataPaymentMethod) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pgPaymentMethodId | String? | yes | | - ---- - - - - - #### [InvoicesData](#InvoicesData) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | client | [InvoicesDataClient](#InvoicesDataClient)? | yes | | - | autoAdvance | Bool? | yes | | - | currency | String? | yes | | - | paid | Bool? | yes | | - | attemp | Int? | yes | | - | collectionMethod | String? | yes | | - | subscriberId | String? | yes | | - | invoiceUrl | String? | yes | | - | number | String? | yes | | - | pgData | [String: Any]? | yes | | - | period | [InvoicesDataPeriod](#InvoicesDataPeriod)? | yes | | - | receiptNumber | String? | yes | | - | statementDescriptor | String? | yes | | - | currentStatus | String? | yes | | - | statusTrail | [[InvoiceDetailsStatusTrail](#InvoiceDetailsStatusTrail)]? | yes | | - | subtotal | Double? | yes | | - | total | Double? | yes | | - | subscription | String? | yes | | - | nextActionTime | String? | yes | | - | createdAt | String? | yes | | - | modifiedAt | String? | yes | | - | hashIdentifier | String? | yes | | - | paymentMethod | [InvoicesDataPaymentMethod](#InvoicesDataPaymentMethod)? | yes | | - | invoiceItems | [[InvoiceItems](#InvoiceItems)]? | yes | | - ---- - - - - - #### [Invoices](#Invoices) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | data | [[InvoicesData](#InvoicesData)]? | yes | | - | start | Int? | yes | | - | end | Int? | yes | | - | limit | Int? | yes | | - | page | Int? | yes | | - | total | Int? | yes | | - ---- - - - - - #### [Phone](#Phone) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | phoneNumber | String? | yes | | - | phoneCountryCode | String? | yes | | - ---- - - - - - #### [SubscriptionBillingAddress](#SubscriptionBillingAddress) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | country | String? | yes | | - | state | String? | yes | | - | city | String? | yes | | - | line1 | String? | yes | | - | line2 | String? | yes | | - | postalCode | String? | yes | | - ---- - - - - - #### [SubscriptionCustomer](#SubscriptionCustomer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | phone | [Phone](#Phone)? | yes | | - | billingAddress | [SubscriptionBillingAddress](#SubscriptionBillingAddress)? | yes | | - | id | String? | yes | | - | uniqueId | String? | yes | | - | type | String? | yes | | - | name | String? | yes | | - | email | String? | yes | | - | createdAt | String? | yes | | - | modifiedAt | String? | yes | | - | data | [String: Any]? | yes | | - ---- - - - - - #### [SubscriptionCustomerCreate](#SubscriptionCustomerCreate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | phone | [Phone](#Phone)? | yes | | - | billingAddress | [SubscriptionBillingAddress](#SubscriptionBillingAddress)? | yes | | - | uniqueId | String? | yes | | - | type | String? | yes | | - | name | String? | yes | | - | email | String? | yes | | - ---- - - - - - #### [SubscriptionCurrentPeriod](#SubscriptionCurrentPeriod) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | start | String? | yes | | - | end | String? | yes | | - ---- - - - - - #### [SubscriptionPauseCollection](#SubscriptionPauseCollection) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | behavior | String? | yes | | - | resumeAt | String? | yes | | - ---- - - - - - #### [SubscriptionTrial](#SubscriptionTrial) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | start | String? | yes | | - | end | String? | yes | | - ---- - - - - - #### [SubscriptionInvoiceSettings](#SubscriptionInvoiceSettings) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | generation | Bool? | yes | | - | charging | Bool? | yes | | - ---- - - - - - #### [Subscription](#Subscription) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | currentPeriod | [SubscriptionCurrentPeriod](#SubscriptionCurrentPeriod)? | yes | | - | pauseCollection | [SubscriptionPauseCollection](#SubscriptionPauseCollection)? | yes | | - | trial | [SubscriptionTrial](#SubscriptionTrial)? | yes | | - | invoiceSettings | [SubscriptionInvoiceSettings](#SubscriptionInvoiceSettings)? | yes | | - | isActive | Bool? | yes | | - | cancelAtPeriodEnd | Bool? | yes | | - | id | String? | yes | | - | subscriberId | String? | yes | | - | planId | String? | yes | | - | productSuiteId | String? | yes | | - | planData | [Plan](#Plan)? | yes | | - | currentStatus | String? | yes | | - | collectionMethod | String? | yes | | - | createdAt | String? | yes | | - | modifiedAt | String? | yes | | - | latestInvoice | String? | yes | | - ---- - - - - - #### [SubscriptionStatus](#SubscriptionStatus) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isEnabled | Bool? | yes | | - | subscription | [Subscription](#Subscription)? | yes | | - ---- - - - - - #### [SubscriptionLimitApplication](#SubscriptionLimitApplication) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - | hardLimit | Int? | yes | | - | softLimit | Int? | yes | | - ---- - - - - - #### [SubscriptionLimitMarketplace](#SubscriptionLimitMarketplace) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - ---- - - - - - #### [SubscriptionLimitOtherPlatform](#SubscriptionLimitOtherPlatform) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - ---- - - - - - #### [SubscriptionLimitTeam](#SubscriptionLimitTeam) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | limit | Int? | yes | | - ---- - - - - - #### [SubscriptionLimitProducts](#SubscriptionLimitProducts) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | bulk | Bool? | yes | | - | limit | Int? | yes | | - ---- - - - - - #### [SubscriptionLimitExtensions](#SubscriptionLimitExtensions) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - | limit | Int? | yes | | - ---- - - - - - #### [SubscriptionLimitIntegrations](#SubscriptionLimitIntegrations) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - | limit | Int? | yes | | - ---- - - - - - #### [SubscriptionLimit](#SubscriptionLimit) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | application | [SubscriptionLimitApplication](#SubscriptionLimitApplication)? | yes | | - | marketplace | [SubscriptionLimitMarketplace](#SubscriptionLimitMarketplace)? | yes | | - | otherPlatform | [SubscriptionLimitOtherPlatform](#SubscriptionLimitOtherPlatform)? | yes | | - | team | [SubscriptionLimitTeam](#SubscriptionLimitTeam)? | yes | | - | products | [SubscriptionLimitProducts](#SubscriptionLimitProducts)? | yes | | - | extensions | [SubscriptionLimitExtensions](#SubscriptionLimitExtensions)? | yes | | - | integrations | [SubscriptionLimitIntegrations](#SubscriptionLimitIntegrations)? | yes | | - | isTrialPlan | Bool? | yes | | - ---- - - - - - #### [SubscriptionActivateReq](#SubscriptionActivateReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uniqueId | String? | yes | | - | type | String? | yes | | - | productSuite | String? | yes | | - | planId | String? | yes | | - | paymentMethod | String? | yes | | - ---- - - - - - #### [SubscriptionActivateRes](#SubscriptionActivateRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool? | yes | | - | data | [Subscription](#Subscription)? | yes | | - ---- - - - - - #### [CancelSubscriptionReq](#CancelSubscriptionReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uniqueId | String? | yes | | - | type | String? | yes | | - | productSuite | String? | yes | | - | subscriptionId | String? | yes | | - ---- - - - - - #### [CancelSubscriptionRes](#CancelSubscriptionRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool? | yes | | - | data | [Subscription](#Subscription)? | yes | | - ---- - - - - - - - #### [StatsImported](#StatsImported) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | count | Int? | yes | | - ---- - - - - - #### [StatsProcessedEmail](#StatsProcessedEmail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Int? | yes | | - | failed | Int? | yes | | - | suppressed | Int? | yes | | - ---- - - - - - #### [StatsProcessedSms](#StatsProcessedSms) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Int? | yes | | - | failed | Int? | yes | | - | suppressed | Int? | yes | | - ---- - - - - - #### [StatsProcessed](#StatsProcessed) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | [StatsProcessedEmail](#StatsProcessedEmail)? | yes | | - | sms | [StatsProcessedSms](#StatsProcessedSms)? | yes | | - ---- - - - - - #### [Stats](#Stats) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | imported | [String: Any]? | yes | | - | processed | [String: Any]? | yes | | - ---- - - - - - #### [GetStats](#GetStats) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Stats](#Stats)]? | yes | | - ---- - - - - - #### [CampaignReq](#CampaignReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | tags | [String]? | yes | | - | headers | [String]? | yes | | - | isActive | Bool? | yes | | - | name | String? | yes | | - | fileUrl | String? | yes | | - | type | String? | yes | | - | recordsCount | Int? | yes | | - | application | String? | yes | | - ---- - - - - - #### [RecipientHeaders](#RecipientHeaders) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | String? | yes | | - ---- - - - - - #### [CampaignEmailTemplate](#CampaignEmailTemplate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String? | yes | | - | value | String? | yes | | - ---- - - - - - #### [CampignEmailProvider](#CampignEmailProvider) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | fromName | String? | yes | | - | fromEmail | String? | yes | | - ---- - - - - - #### [CampaignEmail](#CampaignEmail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | template | [CampaignEmailTemplate](#CampaignEmailTemplate)? | yes | | - | provider | [CampignEmailProvider](#CampignEmailProvider)? | yes | | - ---- - - - - - #### [Campaign](#Campaign) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | recipientHeaders | [RecipientHeaders](#RecipientHeaders)? | yes | | - | email | [CampaignEmail](#CampaignEmail)? | yes | | - | description | String? | yes | | - | tags | [[String: Any]]? | yes | | - | isActive | Bool? | yes | | - | id | String? | yes | | - | datasource | String? | yes | | - | type | String? | yes | | - | name | String? | yes | | - | application | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | slug | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [Campaigns](#Campaigns) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Campaign](#Campaign)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [BigqueryHeadersReq](#BigqueryHeadersReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | query | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [BigqueryHeadersResHeaders](#BigqueryHeadersResHeaders) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [BigqueryHeadersRes](#BigqueryHeadersRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | headers | [[BigqueryHeadersResHeaders](#BigqueryHeadersResHeaders)]? | yes | | - ---- - - - - - #### [GetNRecordsCsvReq](#GetNRecordsCsvReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | url | String? | yes | | - | header | Bool? | yes | | - | count | Int? | yes | | - ---- - - - - - #### [GetNRecordsCsvResItems](#GetNRecordsCsvResItems) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | phoneNumber | String? | yes | | - | email | String? | yes | | - | firstname | String? | yes | | - | lastname | String? | yes | | - | orderid | String? | yes | | - ---- - - - - - #### [GetNRecordsCsvRes](#GetNRecordsCsvRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[GetNRecordsCsvResItems](#GetNRecordsCsvResItems)]? | yes | | - ---- - - - - - #### [AudienceReq](#AudienceReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | tags | [String]? | yes | | - | headers | [String]? | yes | | - | isActive | Bool? | yes | | - | name | String? | yes | | - | fileUrl | String? | yes | | - | type | String? | yes | | - | recordsCount | Int? | yes | | - | application | String? | yes | | - ---- - - - - - #### [Audience](#Audience) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | tags | [String]? | yes | | - | headers | [String]? | yes | | - | isActive | Bool? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | fileUrl | String? | yes | | - | type | String? | yes | | - | recordsCount | Int? | yes | | - | application | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | slug | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [Audiences](#Audiences) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Audience](#Audience)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [EmailProviderReqFrom](#EmailProviderReqFrom) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | email | String? | yes | | - | isDefault | Bool? | yes | | - ---- - - - - - #### [EmailProviderReq](#EmailProviderReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | description | String? | yes | | - | apiKey | String? | yes | | - | type | String? | yes | | - | provider | String? | yes | | - | from | [[EmailProviderReqFrom](#EmailProviderReqFrom)]? | yes | | - ---- - - - - - #### [EmailProvider](#EmailProvider) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | provider | String? | yes | | - | from | [[EmailProviderReqFrom](#EmailProviderReqFrom)]? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | description | String? | yes | | - | apiKey | String? | yes | | - | application | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | slug | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [EmailProviders](#EmailProviders) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[EmailProvider](#EmailProvider)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [EmailTemplateDeleteSuccessRes](#EmailTemplateDeleteSuccessRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool? | yes | | - | message | String? | yes | | - ---- - - - - - #### [EmailTemplateDeleteFailureRes](#EmailTemplateDeleteFailureRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool? | yes | | - | message | String? | yes | | - ---- - - - - - #### [EmailTemplateKeys](#EmailTemplateKeys) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | to | String? | yes | | - | cc | String? | yes | | - | bcc | String? | yes | | - ---- - - - - - #### [EmailTemplateHeaders](#EmailTemplateHeaders) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String? | yes | | - | value | String? | yes | | - ---- - - - - - #### [EmailTemplateReq](#EmailTemplateReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | description | String? | yes | | - | keys | [EmailTemplateKeys](#EmailTemplateKeys)? | yes | | - | from | String? | yes | | - | staticTo | [String]? | yes | | - | staticCc | [String]? | yes | | - | staticBcc | [String]? | yes | | - | replyTo | String? | yes | | - | headers | [[EmailTemplateHeaders](#EmailTemplateHeaders)]? | yes | | - | subject | [TemplateAndType](#TemplateAndType)? | yes | | - | html | [TemplateAndType](#TemplateAndType)? | yes | | - | text | [TemplateAndType](#TemplateAndType)? | yes | | - | attachments | [[String: Any]]? | yes | | - | priority | String? | yes | | - ---- - - - - - #### [TemplateAndType](#TemplateAndType) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | templateType | String? | yes | | - | template | String? | yes | | - ---- - - - - - #### [EmailTemplateRes](#EmailTemplateRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isSystem | Bool? | yes | | - | isInternal | Bool? | yes | | - | description | String? | yes | | - | staticTo | [String]? | yes | | - | staticCc | [String]? | yes | | - | staticBcc | [String]? | yes | | - | tags | [[String: Any]]? | yes | | - | priority | String? | yes | | - | published | Bool? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | keys | [EmailTemplateKeys](#EmailTemplateKeys)? | yes | | - | from | String? | yes | | - | replyTo | String? | yes | | - | headers | [[EmailTemplateHeaders](#EmailTemplateHeaders)]? | yes | | - | subject | [TemplateAndType](#TemplateAndType)? | yes | | - | html | [TemplateAndType](#TemplateAndType)? | yes | | - | text | [TemplateAndType](#TemplateAndType)? | yes | | - | attachments | [[String: Any]]? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | slug | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [EmailTemplate](#EmailTemplate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isSystem | Bool? | yes | | - | isInternal | Bool? | yes | | - | description | String? | yes | | - | staticTo | [[String: Any]]? | yes | | - | staticCc | [[String: Any]]? | yes | | - | staticBcc | [[String: Any]]? | yes | | - | tags | [[String: Any]]? | yes | | - | priority | String? | yes | | - | published | Bool? | yes | | - | id | String? | yes | | - | slug | String? | yes | | - | name | String? | yes | | - | from | String? | yes | | - | fromName | String? | yes | | - | subject | [TemplateAndType](#TemplateAndType)? | yes | | - | html | [TemplateAndType](#TemplateAndType)? | yes | | - | text | [TemplateAndType](#TemplateAndType)? | yes | | - | headers | [[String: Any]]? | yes | | - | attachments | [[String: Any]]? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [SystemEmailTemplate](#SystemEmailTemplate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isSystem | Bool? | yes | | - | isInternal | Bool? | yes | | - | description | String? | yes | | - | staticTo | [[String: Any]]? | yes | | - | staticCc | [[String: Any]]? | yes | | - | staticBcc | [[String: Any]]? | yes | | - | tags | [[String: Any]]? | yes | | - | priority | String? | yes | | - | published | Bool? | yes | | - | id | String? | yes | | - | slug | String? | yes | | - | name | String? | yes | | - | from | String? | yes | | - | fromName | String? | yes | | - | subject | [TemplateAndType](#TemplateAndType)? | yes | | - | html | [TemplateAndType](#TemplateAndType)? | yes | | - | text | [TemplateAndType](#TemplateAndType)? | yes | | - | headers | [[String: Any]]? | yes | | - | attachments | [[String: Any]]? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [EmailTemplates](#EmailTemplates) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[EmailTemplate](#EmailTemplate)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [SystemEmailTemplates](#SystemEmailTemplates) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[SystemEmailTemplate](#SystemEmailTemplate)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [EventSubscriptionTemplateSms](#EventSubscriptionTemplateSms) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | subscribed | Bool? | yes | | - | template | String? | yes | | - ---- - - - - - #### [EventSubscriptionTemplateEmail](#EventSubscriptionTemplateEmail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | subscribed | Bool? | yes | | - | template | String? | yes | | - ---- - - - - - #### [EventSubscriptionTemplate](#EventSubscriptionTemplate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | sms | [EventSubscriptionTemplateSms](#EventSubscriptionTemplateSms)? | yes | | - | email | [EventSubscriptionTemplateEmail](#EventSubscriptionTemplateEmail)? | yes | | - ---- - - - - - #### [EventSubscription](#EventSubscription) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | template | [EventSubscriptionTemplate](#EventSubscriptionTemplate)? | yes | | - | isDefault | Bool? | yes | | - | id | String? | yes | | - | application | String? | yes | | - | event | String? | yes | | - | slug | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [EventSubscriptions](#EventSubscriptions) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[EventSubscription](#EventSubscription)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [TriggerJobResponse](#TriggerJobResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | status | Int? | yes | | - ---- - - - - - #### [TriggerJobRequest](#TriggerJobRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | jobId | String? | yes | | - ---- - - - - - #### [Job](#Job) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | completed | Bool? | yes | | - | isActive | Bool? | yes | | - | id | String? | yes | | - | campaign | String? | yes | | - | application | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [Jobs](#Jobs) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Job](#Job)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [JobLog](#JobLog) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | imported | [String: Any]? | yes | | - | processed | [String: Any]? | yes | | - | id | String? | yes | | - | job | String? | yes | | - | campaign | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [JobLogs](#JobLogs) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[JobLog](#JobLog)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [LogEmail](#LogEmail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | template | String? | yes | | - ---- - - - - - #### [LogPushnotification](#LogPushnotification) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pushtokens | [String]? | yes | | - ---- - - - - - #### [LogMeta](#LogMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | identifier | String? | yes | | - | key | String? | yes | | - | offset | String? | yes | | - | partition | String? | yes | | - | topic | String? | yes | | - ---- - - - - - #### [Log](#Log) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | [LogEmail](#LogEmail)? | yes | | - | pushnotification | [LogPushnotification](#LogPushnotification)? | yes | | - | meta | [LogMeta](#LogMeta)? | yes | | - | id | String? | yes | | - | application | String? | yes | | - | service | String? | yes | | - | step | String? | yes | | - | status | String? | yes | | - | data | [String: Any]? | yes | | - | expireAt | String? | yes | | - | createdAt | String? | yes | | - ---- - - - - - #### [Logs](#Logs) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Log](#Log)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [PushtokenReq](#PushtokenReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | action | String? | yes | | - | bundleIdentifier | String? | yes | | - | pushToken | String? | yes | | - | uniqueDeviceId | String? | yes | | - ---- - - - - - #### [PushtokenRes](#PushtokenRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | bundleIdentifier | String? | yes | | - | pushToken | String? | yes | | - | uniqueDeviceId | String? | yes | | - | type | String? | yes | | - | platform | String? | yes | | - | applicationId | String? | yes | | - | userId | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | expiredAt | String? | yes | | - ---- - - - - - #### [SmsProviderReq](#SmsProviderReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | description | String? | yes | | - | sender | String? | yes | | - | username | String? | yes | | - | authkey | String? | yes | | - | type | String? | yes | | - | provider | String? | yes | | - ---- - - - - - #### [SmsProvider](#SmsProvider) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | rpt | Int? | yes | | - | type | String? | yes | | - | provider | String? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | description | String? | yes | | - | sender | String? | yes | | - | username | String? | yes | | - | authkey | String? | yes | | - | application | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | slug | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [SmsProviders](#SmsProviders) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[SmsProvider](#SmsProvider)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [SmsTemplateDeleteSuccessRes](#SmsTemplateDeleteSuccessRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool? | yes | | - | message | String? | yes | | - ---- - - - - - #### [SmsTemplateDeleteFailureRes](#SmsTemplateDeleteFailureRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool? | yes | | - | message | String? | yes | | - ---- - - - - - #### [SmsTemplateMessage](#SmsTemplateMessage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | templateType | String? | yes | | - | template | String? | yes | | - ---- - - - - - #### [SmsTemplateReq](#SmsTemplateReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | description | String? | yes | | - | message | [SmsTemplateMessage](#SmsTemplateMessage)? | yes | | - | templateVariables | [String: Any]? | yes | | - | attachments | [[String: Any]]? | yes | | - | priority | String? | yes | | - ---- - - - - - #### [SmsTemplateRes](#SmsTemplateRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isSystem | Bool? | yes | | - | isInternal | Bool? | yes | | - | description | String? | yes | | - | tags | [[String: Any]]? | yes | | - | priority | String? | yes | | - | published | Bool? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | message | [SmsTemplateMessage](#SmsTemplateMessage)? | yes | | - | templateVariables | [String: Any]? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | slug | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [SmsTemplate](#SmsTemplate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isSystem | Bool? | yes | | - | isInternal | Bool? | yes | | - | description | String? | yes | | - | priority | String? | yes | | - | tags | [[String: Any]]? | yes | | - | published | Bool? | yes | | - | id | String? | yes | | - | slug | String? | yes | | - | name | String? | yes | | - | message | [SmsTemplateMessage](#SmsTemplateMessage)? | yes | | - | templateVariables | [String: Any]? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [SystemSmsTemplate](#SystemSmsTemplate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isSystem | Bool? | yes | | - | isInternal | Bool? | yes | | - | description | String? | yes | | - | tags | [[String: Any]]? | yes | | - | priority | String? | yes | | - | published | Bool? | yes | | - | id | String? | yes | | - | slug | String? | yes | | - | name | String? | yes | | - | message | [SmsTemplateMessage](#SmsTemplateMessage)? | yes | | - | templateVariables | [String: Any]? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [SmsTemplates](#SmsTemplates) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[SmsTemplate](#SmsTemplate)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [SystemSmsTemplates](#SystemSmsTemplates) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[SystemSmsTemplate](#SystemSmsTemplate)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [Notification](#Notification) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | body | String? | yes | | - | subtitle | String? | yes | | - | icon | String? | yes | | - | deeplink | String? | yes | | - | clickAction | String? | yes | | - ---- - - - - - #### [SystemNotificationUser](#SystemNotificationUser) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | value | String? | yes | | - ---- - - - - - #### [SystemNotificationSettings](#SystemNotificationSettings) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | sound | Bool? | yes | | - | priority | String? | yes | | - | timeToLive | String? | yes | | - ---- - - - - - #### [SystemNotification](#SystemNotification) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | notification | [Notification](#Notification)? | yes | | - | user | [SystemNotificationUser](#SystemNotificationUser)? | yes | | - | settings | [SystemNotificationUser](#SystemNotificationUser)? | yes | | - | id | String? | yes | | - | group | String? | yes | | - | createdAt | String? | yes | | - ---- - - - - - #### [SystemNotificationsPage](#SystemNotificationsPage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | current | Int? | yes | | - | size | Int? | yes | | - | itemTotal | Int? | yes | | - | hasNext | Bool? | yes | | - ---- - - - - - #### [SystemNotifications](#SystemNotifications) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[SystemNotification](#SystemNotification)]? | yes | | - | lastReadAnchor | Int? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - - - #### [PaymentGatewayConfigResponse](#PaymentGatewayConfigResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not | - | created | Bool | no | Response is created or not | - | appId | String | no | Application Id to which Payment config Mapped | - | displayFields | [String] | no | List of all included options with their Details. | - | excludedFields | [String] | no | List of all excluded options with their Details. | - | aggregators | [[String: Any]]? | yes | List of all speceific Payment options with their Details. | - ---- - - - - - #### [ErrorCodeDescription](#ErrorCodeDescription) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not | - | description | String | no | Error human understandable description. | - | code | String | no | Error descrption code. | - ---- - - - - - #### [PaymentGatewayConfig](#PaymentGatewayConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String | no | Api key of the payment aggregator | - | configType | String | no | Config Type of the aggregator | - | secret | String | no | Secret Key of the payment aggregator | - | isActive | Bool? | yes | Enable/ Disable Flag | - | merchantSalt | String | no | Merchant key of the payment aggregator | - ---- - - - - - #### [PaymentGatewayConfigRequest](#PaymentGatewayConfigRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isActive | Bool? | yes | Enable/ Disable Flag | - | appId | String | no | Application Id to which Payment config Mapped | - | aggregatorName | [PaymentGatewayConfig](#PaymentGatewayConfig)? | yes | | - ---- - - - - - #### [PaymentGatewayToBeReviewed](#PaymentGatewayToBeReviewed) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not | - | aggregator | [String] | no | List of added payment gateway | - ---- - - - - - #### [ErrorCodeAndDescription](#ErrorCodeAndDescription) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String | no | Error human understandable description. | - | code | String | no | Error descrption code. | - ---- - - - - - #### [HttpErrorCodeAndResponse](#HttpErrorCodeAndResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not | - | error | [ErrorCodeAndDescription](#ErrorCodeAndDescription) | no | | - ---- - - - - - #### [PaymentModeLogo](#PaymentModeLogo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | large | String | no | large | - | small | String | no | smalll | - ---- - - - - - #### [PaymentModeList](#PaymentModeList) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | logoUrl | [PaymentModeLogo](#PaymentModeLogo)? | yes | Logo | - | aggregatorName | String | no | aggregator_name | - | cardToken | String? | yes | card_token | - | code | String? | yes | code | - | name | String? | yes | name | - | expired | Bool? | yes | expired | - | nickname | String? | yes | nickname | - | fyndVpa | String? | yes | fynd_vpa | - | displayPriority | Int? | yes | Dispaly Priority | - | cardBrand | String? | yes | card_brand | - | cardBrandImage | String? | yes | card_brand_image | - | intentAppErrorList | [String]? | yes | intent_app_error_list | - | cardIssuer | String? | yes | card_issuer | - | timeout | Int? | yes | timeout | - | cardType | String? | yes | card_type | - | merchantCode | String? | yes | merchant code | - | retryCount | Int? | yes | retry_count | - | cardFingerprint | String? | yes | card_fingerprint | - | cardName | String? | yes | card_name | - | cardId | String? | yes | card_id | - | intentFlow | String? | yes | intent_flow | - | displayName | String? | yes | display name | - | expYear | Int? | yes | exp_year | - | cardReference | String? | yes | card_reference | - | cardNumber | String? | yes | card_number | - | cardIsin | String? | yes | card_isin | - | expMonth | Int? | yes | exp_month | - ---- - - - - - #### [RootPaymentMode](#RootPaymentMode) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | anonymousEnable | Bool? | yes | Annonymous card flag | - | addCardEnabled | Bool? | yes | Annonymous card flag | - | aggregatorName | String? | yes | Dispaly Priority | - | displayPriority | Int | no | Dispaly Priority | - | displayName | String | no | Payment mode display name | - | name | String | no | Payment mode name | - | list | [[PaymentModeList](#PaymentModeList)]? | yes | Payment mode | - ---- - - - - - #### [PaymentOptions](#PaymentOptions) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | paymentOption | [[RootPaymentMode](#RootPaymentMode)] | no | Payment options | - ---- - - - - - #### [PaymentOptionsResponse](#PaymentOptionsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not | - | paymentOptions | [PaymentOptions](#PaymentOptions) | no | Payment options | - ---- - - - - - #### [PayoutsResponse](#PayoutsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | moreAttributes | [String: Any] | no | bank details object | - | isDefault | Bool | no | default or not | - | transferType | String | no | transafer type | - | uniqueTransferNo | [String: Any] | no | display priority of the payment mode | - | isActive | Bool | no | Enable/DIsable Flag Payout | - | customers | [String: Any] | no | customers details object | - | payoutsAggregators | [[String: Any]] | no | payout aggregator object | - ---- - - - - - #### [PayoutBankDetails](#PayoutBankDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | ifscCode | String | no | | - | country | String? | yes | | - | bankName | String? | yes | | - | branchName | String? | yes | | - | accountType | String | no | | - | state | String? | yes | | - | pincode | Int? | yes | | - | city | String? | yes | | - | accountHolder | String? | yes | | - | accountNo | String? | yes | | - ---- - - - - - #### [PayoutRequest](#PayoutRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | bankDetails | [PayoutBankDetails](#PayoutBankDetails) | no | payout bank details object | - | transferType | String | no | transafer type | - | users | [String: Any] | no | payout users object | - | isActive | Bool | no | Enable/Disable Flag Payout | - | aggregator | String | no | Aggregator Name | - | uniqueExternalId | String | no | Unique Id of Payout | - ---- - - - - - #### [PayoutResponse](#PayoutResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not | - | bankDetails | [String: Any] | no | payout bank_details object | - | created | Bool | no | created flag | - | transferType | String | no | transfer type | - | uniqueTransferNo | String | no | unique transfer no | - | users | [String: Any] | no | users details object | - | isActive | Bool | no | Enable/DIsable Flag Payout | - | paymentStatus | String | no | status of payment | - | aggregator | String | no | Aggregator Name | - | payouts | [String: Any] | no | payout object | - ---- - - - - - #### [UpdatePayoutResponse](#UpdatePayoutResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not | - | isActive | Bool | no | Enable/DIsable Flag Payout | - | isDefault | Bool | no | Enable/Disable Default Payout | - ---- - - - - - #### [UpdatePayoutRequest](#UpdatePayoutRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isActive | Bool | no | Enable/Disable Flag Payout | - | isDefault | Bool | no | Enable/Disable Default Payout | - | uniqueExternalId | String | no | Unique Id of Payout | - ---- - - - - - #### [DeletePayoutResponse](#DeletePayoutResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not | - ---- - - - - - #### [SubscriptionPaymentMethodResponse](#SubscriptionPaymentMethodResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not | - | data | [[String: Any]] | no | Subscription Payment Method Object | - ---- - - - - - #### [DeleteSubscriptionPaymentMethodResponse](#DeleteSubscriptionPaymentMethodResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Success or failure. | - ---- - - - - - #### [SubscriptionConfigResponse](#SubscriptionConfigResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not | - | config | [String: Any] | no | Aggregator Config | - | aggregator | String | no | Aggregator Name | - ---- - - - - - #### [SaveSubscriptionSetupIntentRequest](#SaveSubscriptionSetupIntentRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uniqueExternalId | String | no | Unique id i.e company:id | - ---- - - - - - #### [SaveSubscriptionSetupIntentResponse](#SaveSubscriptionSetupIntentResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not | - | data | [String: Any] | no | Subscription Payment Method Object | - ---- - - - - - #### [BeneficiaryModeDetails](#BeneficiaryModeDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | wallet | String? | yes | | - | address | String? | yes | Address of the User | - | ifscCode | String | no | Ifsc Code of the Account | - | bankName | String | no | Bank Name of the Account | - | mobile | String | no | Moblie Number of the User | - | branchName | String | no | Branch Name of the Account | - | email | String | no | Email of the Account Holder | - | vpa | String? | yes | | - | accountHolder | String | no | Name of the Account Holder | - | accountNo | String | no | Account NUmber of the Account Holder | - | comment | String? | yes | Remarks added by The user | - ---- - - - - - #### [AddBeneficiaryDetailsRequest](#AddBeneficiaryDetailsRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | shipmentId | String | no | Shipment Id of the respective Merchant Order Id | - | transferMode | String | no | Transfer Mode of the Beneficiary to be added | - | delights | Bool | no | True if beneficiary to be added by delights or False if by User | - | requestId | String? | yes | | - | otp | String? | yes | | - | orderId | String | no | Merchant Order Id | - | details | [BeneficiaryModeDetails](#BeneficiaryModeDetails) | no | Beneficiary bank details | - ---- - - - - - #### [RefundAccountResponse](#RefundAccountResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Success or failure flag. | - | data | [String: Any]? | yes | Refund account data. | - | message | String | no | Response message | - ---- - - - - - #### [NotFoundResourceError](#NotFoundResourceError) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Response is successful or not | - | description | String | no | Not Found | - | code | String | no | Bad Request Data | - ---- - - - - - #### [IfscCodeResponse](#IfscCodeResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool? | yes | Response is successful or not | - | bankName | String | no | Bank Name Of Account | - | branchName | String | no | Branch Name Of Account | - ---- - - - - - #### [OrderBeneficiaryDetails](#OrderBeneficiaryDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | address | String | no | Address of User | - | modifiedOn | String | no | MOdification Date of Beneficiary | - | bankName | String | no | Bank Name Of Account | - | email | String | no | EMail of User | - | isActive | Bool | no | Boolean Flag whether Beneficiary set or not | - | branchName | Bool? | yes | Branch Name Of Account | - | beneficiaryId | String | no | Benenficiary Id | - | createdOn | String | no | Creation Date of Beneficiary | - | transferMode | String | no | Transfer Mode Of Account | - | accountHolder | String | no | Account Holder Name | - | mobile | Bool? | yes | MObile no of User | - | delightsUserName | String | no | User Id Who filled the Beneficiary | - | title | String | no | Title Of Account | - | accountNo | String | no | Account Number | - | id | Int | no | | - | displayName | String | no | Display Name Of Account | - | subtitle | String | no | SHort Title Of Account | - | ifscCode | String | no | Ifsc Code Of Account | - | comment | Bool? | yes | Remarks | - ---- - - - - - #### [OrderBeneficiaryResponse](#OrderBeneficiaryResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | showBeneficiaryDetails | Bool? | yes | Show beneficiary details or not. | - | beneficiaries | [[OrderBeneficiaryDetails](#OrderBeneficiaryDetails)] | no | All Beneficiaries Of An Order | - ---- - - - - - #### [PaymentConfirmationMode](#PaymentConfirmationMode) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | Payment mode name | - | meta | [String: Any]? | yes | Payment meta i.e payment id, order id, gateway | - | amount | Double | no | Payment amount | - | mode | String | no | Payment mode | - ---- - - - - - #### [PaymentConfirmationRequest](#PaymentConfirmationRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | paymentMethods | [[PaymentConfirmationMode](#PaymentConfirmationMode)] | no | | - | orderId | String | no | Unique order id | - ---- - - - - - #### [PaymentConfirmationResponse](#PaymentConfirmationResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | Payment confirmation updated or not. | - | orderId | String | no | Unique order id | - | message | String | no | Message | - ---- - - - - - - - #### [GetActivityStatus](#GetActivityStatus) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | activityHistory | [ActivityHistory](#ActivityHistory) | no | | - ---- - - - - - #### [ActivityHistory](#ActivityHistory) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdat | String? | yes | | - | message | String? | yes | | - | type | String? | yes | | - | user | String? | yes | | - ---- - - - - - #### [FailedOrders](#FailedOrders) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | orders | [FailOrder](#FailOrder) | no | | - ---- - - - - - #### [FailOrder](#FailOrder) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | updatedAt | String? | yes | | - | id | String? | yes | | - | reason | String? | yes | | - | marketplaceOrder | [MarketplaceOrder](#MarketplaceOrder)? | yes | | - | marketplaceOrderId | String? | yes | | - | createdAt | String? | yes | | - | appId | String? | yes | | - | marketplace | String? | yes | | - | companyId | Int? | yes | | - ---- - - - - - #### [MarketplaceOrder](#MarketplaceOrder) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | orderStatusUrl | String? | yes | | - | adminGraphqlApiId | String? | yes | | - | email | String? | yes | | - | test | Bool? | yes | | - | note | String? | yes | | - | totalPrice | String? | yes | | - | appId | Int? | yes | | - | totalDiscountsSet | [TotalDiscountsSet](#TotalDiscountsSet)? | yes | | - | totalPriceSet | [TotalPriceSet](#TotalPriceSet)? | yes | | - | totalTaxSet | [TotalTaxSet](#TotalTaxSet)? | yes | | - | gateway | String? | yes | | - | name | String? | yes | | - | subtotalPriceSet | [SubtotalPriceSet](#SubtotalPriceSet)? | yes | | - | number | Int? | yes | | - | buyerAcceptsMarketing | Bool? | yes | | - | contactEmail | String? | yes | | - | token | String? | yes | | - | sourceName | String? | yes | | - | paymentGatewayNames | [[String: Any]]? | yes | | - | presentmentCurrency | String? | yes | | - | subtotalPrice | String? | yes | | - | processedAt | String? | yes | | - | orderNumber | Int? | yes | | - | totalTipReceived | String? | yes | | - | id | Int? | yes | | - | confirmed | Bool? | yes | | - | currency | String? | yes | | - | totalLineItemsPrice | String? | yes | | - | lineItems | [LineItems](#LineItems)? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | totalWeight | Int? | yes | | - | billingAddress | [BillingAddress](#BillingAddress)? | yes | | - | totalShippingPriceSet | [TotalShippingPriceSet](#TotalShippingPriceSet)? | yes | | - | customer | [Customer](#Customer)? | yes | | - | totalDiscounts | String? | yes | | - | totalLineItemsPriceSet | [TotalLineItemsPriceSet](#TotalLineItemsPriceSet)? | yes | | - | tags | String? | yes | | - | totalPriceUsd | String? | yes | | - | userId | Int? | yes | | - | totalTax | String? | yes | | - | processingMethod | String? | yes | | - | shippingAddress | [OrderShippingAddress](#OrderShippingAddress)? | yes | | - | taxesIncluded | Bool? | yes | | - | financialStatus | String? | yes | | - ---- - - - - - #### [TotalDiscountsSet](#TotalDiscountsSet) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | presentmentMoney | [PresentmentMoney](#PresentmentMoney)? | yes | | - | shopMoney | [ShopMoney](#ShopMoney)? | yes | | - ---- - - - - - #### [PresentmentMoney](#PresentmentMoney) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amount | String? | yes | | - | currencyCode | String? | yes | | - ---- - - - - - #### [ShopMoney](#ShopMoney) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amount | String? | yes | | - | currencyCode | String? | yes | | - ---- - - - - - #### [TotalPriceSet](#TotalPriceSet) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | shopMoney | [TotalPriceSetShopMoney](#TotalPriceSetShopMoney)? | yes | | - | presentmentMoney | [TotalPriceSetPresentmentMoney](#TotalPriceSetPresentmentMoney)? | yes | | - ---- - - - - - #### [TotalPriceSetShopMoney](#TotalPriceSetShopMoney) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amount | String? | yes | | - | currencyCode | String? | yes | | - ---- - - - - - #### [TotalPriceSetPresentmentMoney](#TotalPriceSetPresentmentMoney) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amount | String? | yes | | - | currencyCode | String? | yes | | - ---- - - - - - #### [TotalTaxSet](#TotalTaxSet) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | shopMoney | [TotalTaxSetShopMoney](#TotalTaxSetShopMoney)? | yes | | - | presentmentMoney | [TotalTaxSetPresentmentMoney](#TotalTaxSetPresentmentMoney)? | yes | | - ---- - - - - - #### [TotalTaxSetShopMoney](#TotalTaxSetShopMoney) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amount | String? | yes | | - | currencyCode | String? | yes | | - ---- - - - - - #### [TotalTaxSetPresentmentMoney](#TotalTaxSetPresentmentMoney) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amount | String? | yes | | - | currencyCode | String? | yes | | - ---- - - - - - #### [SubtotalPriceSet](#SubtotalPriceSet) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | shopMoney | [SubtotalPriceSetShopMoney](#SubtotalPriceSetShopMoney)? | yes | | - | presentmentMoney | [SubtotalPriceSetPresentmentMoney](#SubtotalPriceSetPresentmentMoney)? | yes | | - ---- - - - - - #### [SubtotalPriceSetShopMoney](#SubtotalPriceSetShopMoney) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amount | String? | yes | | - | currencyCode | String? | yes | | - ---- - - - - - #### [SubtotalPriceSetPresentmentMoney](#SubtotalPriceSetPresentmentMoney) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amount | String? | yes | | - | currencyCode | String? | yes | | - ---- - - - - - #### [LineItems](#LineItems) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | sku | String? | yes | | - | fulfillableQuantity | Int? | yes | | - | grams | Int? | yes | | - | totalDiscount | String? | yes | | - | article | [LineItemsArticle](#LineItemsArticle)? | yes | | - | title | String? | yes | | - | variantInventoryManagement | String? | yes | | - | id | Int? | yes | | - | variantId | Int? | yes | | - | variantTitle | String? | yes | | - | productExists | Bool? | yes | | - | price | String? | yes | | - | adminGraphqlApiId | String? | yes | | - | quantity | Int? | yes | | - | vendor | String? | yes | | - | fulfillmentService | String? | yes | | - | taxable | Bool? | yes | | - | name | String? | yes | | - | productId | Int? | yes | | - | priceSet | [PriceSet](#PriceSet)? | yes | | - | taxLines | [TaxLines](#TaxLines)? | yes | | - | requiresShipping | Bool? | yes | | - | giftCard | Bool? | yes | | - | totalDiscountSet | [TotalDiscountSet](#TotalDiscountSet)? | yes | | - ---- - - - - - #### [LineItemsArticle](#LineItemsArticle) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | quantities | [Quantities](#Quantities)? | yes | | - | oldArticleUid | String? | yes | | - | totalQuantity | Int? | yes | | - | manufacturer | [Manufacturer](#Manufacturer)? | yes | | - | price | [ArticlePrice](#ArticlePrice)? | yes | | - | trackInventory | Bool? | yes | | - | company | [Company](#Company)? | yes | | - | isActive | Bool? | yes | | - | dateMeta | [FailOrderDateMeta](#FailOrderDateMeta)? | yes | | - | fragile | Bool? | yes | | - | marketplaceIdentifiers | [MarketplaceIdentifiers](#MarketplaceIdentifiers)? | yes | | - | size | String? | yes | | - | isSet | Bool? | yes | | - | dimension | [Dimension](#Dimension)? | yes | | - | weight | [Weight](#Weight)? | yes | | - | store | [Store](#Store)? | yes | | - | meta | [ArticleMeta](#ArticleMeta)? | yes | | - | uid | String? | yes | | - | brand | [ArticleBrand](#ArticleBrand)? | yes | | - | itemId | Int? | yes | | - | fyndArticleCode | String? | yes | | - | id | String? | yes | | - | identifier | [LineItemsArticleIdentifier](#LineItemsArticleIdentifier)? | yes | | - | sellerIdentifier | String? | yes | | - | fyndItemCode | String? | yes | | - | countryOfOrigin | String? | yes | | - ---- - - - - - #### [Quantities](#Quantities) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | notAvailable | [NotAvailable](#NotAvailable)? | yes | | - | sellable | [Sellable](#Sellable)? | yes | | - | orderCommitted | [OrderCommitted](#OrderCommitted)? | yes | | - | damaged | [Damaged](#Damaged)? | yes | | - ---- - - - - - #### [NotAvailable](#NotAvailable) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | count | Int? | yes | | - | updatedAt | String? | yes | | - ---- - - - - - #### [Sellable](#Sellable) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | count | Int? | yes | | - | updatedAt | String? | yes | | - ---- - - - - - #### [OrderCommitted](#OrderCommitted) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | count | Int? | yes | | - | updatedAt | String? | yes | | - ---- - - - - - #### [Damaged](#Damaged) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | updatedAt | String? | yes | | - | count | Int? | yes | | - ---- - - - - - #### [Manufacturer](#Manufacturer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isDefault | Bool? | yes | | - | address | String? | yes | | - | name | String? | yes | | - ---- - - - - - #### [ArticlePrice](#ArticlePrice) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | marked | Int? | yes | | - | currency | String? | yes | | - | effective | Int? | yes | | - | transfer | Int? | yes | | - ---- - - - - - #### [Company](#Company) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | Int? | yes | | - | companyType | String? | yes | | - | businessType | String? | yes | | - | companyName | String? | yes | | - | createdOn | String? | yes | | - | panNo | String? | yes | | - | returnAllowed | Bool? | yes | | - | meta | String? | yes | | - | exchangeAllowed | Bool? | yes | | - | agreementStartDate | String? | yes | | - | exchangeWithinDays | Int? | yes | | - | paymentProcesingCharge | Int? | yes | | - | fyndAFitAvailable | Bool? | yes | | - | modifiedOn | String? | yes | | - | returnWithinDays | Int? | yes | | - ---- - - - - - #### [FailOrderDateMeta](#FailOrderDateMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | addedOnStore | String? | yes | | - | inventoryUpdatedOn | String? | yes | | - | createdOn | String? | yes | | - | modifiedOn | String? | yes | | - ---- - - - - - #### [MarketplaceIdentifiers](#MarketplaceIdentifiers) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | tatacliqLuxury | [TatacliqLuxury](#TatacliqLuxury)? | yes | | - ---- - - - - - #### [TatacliqLuxury](#TatacliqLuxury) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | sku | String? | yes | | - ---- - - - - - #### [Dimension](#Dimension) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | height | Int? | yes | | - | width | Int? | yes | | - | unit | String? | yes | | - | length | Int? | yes | | - | isDefault | Bool? | yes | | - ---- - - - - - #### [Weight](#Weight) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isDefault | Bool? | yes | | - | unit | String? | yes | | - | shipping | Int? | yes | | - ---- - - - - - #### [Store](#Store) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | Int? | yes | | - ---- - - - - - #### [ArticleMeta](#ArticleMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | service | String? | yes | | - ---- - - - - - #### [ArticleBrand](#ArticleBrand) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | id | Int? | yes | | - ---- - - - - - #### [LineItemsArticleIdentifier](#LineItemsArticleIdentifier) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | skuCode | String? | yes | | - ---- - - - - - #### [PriceSet](#PriceSet) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | shopMoney | [PriceSetShopMoney](#PriceSetShopMoney)? | yes | | - | presentmentMoney | [PriceSetPresentmentMoney](#PriceSetPresentmentMoney)? | yes | | - ---- - - - - - #### [PriceSetShopMoney](#PriceSetShopMoney) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amount | String? | yes | | - | currencyCode | String? | yes | | - ---- - - - - - #### [PriceSetPresentmentMoney](#PriceSetPresentmentMoney) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amount | String? | yes | | - | currencyCode | String? | yes | | - ---- - - - - - #### [TaxLines](#TaxLines) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | price | String? | yes | | - | rate | Int? | yes | | - | priceSet | [TaxLinesPriceSet](#TaxLinesPriceSet)? | yes | | - ---- - - - - - #### [TaxLinesPriceSet](#TaxLinesPriceSet) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | shopMoney | [TaxLinesPriceSetShopMoney](#TaxLinesPriceSetShopMoney)? | yes | | - | presentmentMoney | [TaxLinesPriceSetPresentmentMoney](#TaxLinesPriceSetPresentmentMoney)? | yes | | - ---- - - - - - #### [TaxLinesPriceSetShopMoney](#TaxLinesPriceSetShopMoney) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amount | String? | yes | | - | currencyCode | String? | yes | | - ---- - - - - - #### [TaxLinesPriceSetPresentmentMoney](#TaxLinesPriceSetPresentmentMoney) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | currencyCode | String? | yes | | - | amount | String? | yes | | - ---- - - - - - #### [TotalDiscountSet](#TotalDiscountSet) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | presentmentMoney | [TotalDiscountSetPresentmentMoney](#TotalDiscountSetPresentmentMoney)? | yes | | - | shopMoney | [TotalDiscountSetShopMoney](#TotalDiscountSetShopMoney)? | yes | | - ---- - - - - - #### [TotalDiscountSetPresentmentMoney](#TotalDiscountSetPresentmentMoney) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amount | String? | yes | | - | currencyCode | String? | yes | | - ---- - - - - - #### [TotalDiscountSetShopMoney](#TotalDiscountSetShopMoney) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amount | String? | yes | | - | currencyCode | String? | yes | | - ---- - - - - - #### [BillingAddress](#BillingAddress) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | address1 | String? | yes | | - | city | String? | yes | | - | zip | String? | yes | | - | lastName | String? | yes | | - | address2 | String? | yes | | - | longitude | Double? | yes | | - | provinceCode | String? | yes | | - | phone | String? | yes | | - | company | String? | yes | | - | latitude | Double? | yes | | - | name | String? | yes | | - | country | String? | yes | | - | countryCode | String? | yes | | - | firstName | String? | yes | | - | province | String? | yes | | - ---- - - - - - #### [TotalShippingPriceSet](#TotalShippingPriceSet) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | shopMoney | [TotalShippingPriceSetShopMoney](#TotalShippingPriceSetShopMoney)? | yes | | - | presentmentMoney | [TotalShippingPriceSetPresentmentMoney](#TotalShippingPriceSetPresentmentMoney)? | yes | | - ---- - - - - - #### [TotalShippingPriceSetShopMoney](#TotalShippingPriceSetShopMoney) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amount | String? | yes | | - | currencyCode | String? | yes | | - ---- - - - - - #### [TotalShippingPriceSetPresentmentMoney](#TotalShippingPriceSetPresentmentMoney) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amount | String? | yes | | - | currencyCode | String? | yes | | - ---- - - - - - #### [Customer](#Customer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdAt | String? | yes | | - | id | Int? | yes | | - | lastName | String? | yes | | - | state | String? | yes | | - | lastOrderId | Int? | yes | | - | note | String? | yes | | - | verifiedEmail | Bool? | yes | | - | phone | String? | yes | | - | acceptsMarketing | Bool? | yes | | - | firstName | String? | yes | | - | tags | String? | yes | | - | lastOrderName | String? | yes | | - | ordersCount | Int? | yes | | - | totalSpent | String? | yes | | - | taxExempt | Bool? | yes | | - | currency | String? | yes | | - | acceptsMarketingUpdatedAt | String? | yes | | - | email | String? | yes | | - | updatedAt | String? | yes | | - | adminGraphqlApiId | String? | yes | | - | defaultAddress | [DefaultAddress](#DefaultAddress)? | yes | | - ---- - - - - - #### [DefaultAddress](#DefaultAddress) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | lastName | String? | yes | | - | name | String? | yes | | - | provinceCode | String? | yes | | - | countryCode | String? | yes | | - | isDefault | Bool? | yes | | - | id | Int? | yes | | - | customerId | Int? | yes | | - | firstName | String? | yes | | - | address1 | String? | yes | | - | phone | String? | yes | | - | countryName | String? | yes | | - | company | String? | yes | | - | address2 | String? | yes | | - | city | String? | yes | | - | province | String? | yes | | - | country | String? | yes | | - | zip | String? | yes | | - ---- - - - - - #### [TotalLineItemsPriceSet](#TotalLineItemsPriceSet) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | shopMoney | [TotalLineItemsPriceSetShopMoney](#TotalLineItemsPriceSetShopMoney)? | yes | | - | presentmentMoney | [TotalLineItemsPriceSetPresentmentMoney](#TotalLineItemsPriceSetPresentmentMoney)? | yes | | - ---- - - - - - #### [TotalLineItemsPriceSetShopMoney](#TotalLineItemsPriceSetShopMoney) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amount | String? | yes | | - | currencyCode | String? | yes | | - ---- - - - - - #### [TotalLineItemsPriceSetPresentmentMoney](#TotalLineItemsPriceSetPresentmentMoney) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amount | String? | yes | | - | currencyCode | String? | yes | | - ---- - - - - - #### [OrderShippingAddress](#OrderShippingAddress) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | address1 | String? | yes | | - | zip | String? | yes | | - | address2 | String? | yes | | - | countryCode | String? | yes | | - | country | String? | yes | | - | lastName | String? | yes | | - | latitude | Double? | yes | | - | provinceCode | String? | yes | | - | firstName | String? | yes | | - | phone | String? | yes | | - | province | String? | yes | | - | longitude | Double? | yes | | - | city | String? | yes | | - | company | String? | yes | | - | name | String? | yes | | - ---- - - - - - #### [OrderListing](#OrderListing) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[OrderItems](#OrderItems)] | no | | - | filters | [Filters](#Filters) | no | | - | nextOrderStatus | [String: Any] | no | | - | page | [PlatformOrderPage](#PlatformOrderPage) | no | | - | appliedFilters | [AppliedFilters](#AppliedFilters) | no | | - ---- - - - - - #### [OrderItems](#OrderItems) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | user | [PlatformOrderUserInfo](#PlatformOrderUserInfo)? | yes | | - | deliveryAddress | [PlatformDeliveryAddress](#PlatformDeliveryAddress)? | yes | | - | channel | [Channel](#Channel)? | yes | | - | id | String? | yes | | - | application | [PlatformApplication](#PlatformApplication)? | yes | | - | shipments | [PlatformShipment](#PlatformShipment)? | yes | | - | createdAt | String? | yes | | - | totalShipmentsInOrder | Int? | yes | | - ---- - - - - - #### [PlatformOrderUserInfo](#PlatformOrderUserInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | mobile | String? | yes | | - | firstName | String? | yes | | - | gender | String? | yes | | - | email | String? | yes | | - | lastName | String? | yes | | - | isAnonymousUser | Bool? | yes | | - | uid | Int? | yes | | - | avisUserId | String? | yes | | - ---- - - - - - #### [PlatformDeliveryAddress](#PlatformDeliveryAddress) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | area | String? | yes | | - | state | String? | yes | | - | country | String? | yes | | - | version | String? | yes | | - | address1 | String? | yes | | - | latitude | Double? | yes | | - | updatedAt | String? | yes | | - | city | String? | yes | | - | landmark | String? | yes | | - | createdAt | String? | yes | | - | name | String? | yes | | - | address | String? | yes | | - | phone | String? | yes | | - | longitude | Double? | yes | | - | addressType | String? | yes | | - | email | String? | yes | | - | pincode | String? | yes | | - | address2 | String? | yes | | - | contactPerson | String? | yes | | - | addressCategory | String? | yes | | - ---- - - - - - #### [Channel](#Channel) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | logo | String? | yes | | - ---- - - - - - #### [PlatformApplication](#PlatformApplication) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - ---- - - - - - #### [PlatformShipment](#PlatformShipment) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | status | [PlatformShipmentStatus](#PlatformShipmentStatus)? | yes | | - | bags | [Bags](#Bags)? | yes | | - | prices | [ShipmentPrices](#ShipmentPrices)? | yes | | - | id | String? | yes | | - | gst | [ShipmentGst](#ShipmentGst)? | yes | | - | totalShipmentBags | Int? | yes | | - ---- - - - - - #### [PlatformShipmentStatus](#PlatformShipmentStatus) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | Int? | yes | | - | bagList | [Int]? | yes | | - | createdAt | String? | yes | | - | status | String? | yes | | - | name | String? | yes | | - | progress | Int? | yes | | - | shipmentId | String? | yes | | - | currentShipmentStatus | String? | yes | | - | colorCode | String? | yes | | - ---- - - - - - #### [Bags](#Bags) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | item | [BagItem](#BagItem)? | yes | | - | id | Int? | yes | | - ---- - - - - - #### [BagItem](#BagItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | Int? | yes | | - | size | String? | yes | | - | slugKey | String? | yes | | - | canReturn | Bool? | yes | | - | brandId | Int? | yes | | - | l2Category | [String]? | yes | | - | name | String? | yes | | - | code | String? | yes | | - | canCancel | Bool? | yes | | - | attributes | [BagItemAttributes](#BagItemAttributes)? | yes | | - | l3CategoryName | String? | yes | | - | l3Category | Int? | yes | | - | l1Category | [String]? | yes | | - | image | [String]? | yes | | - | brand | String? | yes | | - | lastUpdatedAt | String? | yes | | - ---- - - - - - #### [BagItemAttributes](#BagItemAttributes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | itemCode | String? | yes | | - | brandName | String? | yes | | - | countryOfOrigin | String? | yes | | - ---- - - - - - #### [ShipmentPrices](#ShipmentPrices) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | refundAmount | Double? | yes | | - | cashbackApplied | Double? | yes | | - | transferPrice | Double? | yes | | - | couponValue | Double? | yes | | - | amountPaid | Double? | yes | | - | deliveryCharge | Double? | yes | | - | couponEffectiveDiscount | Double? | yes | | - | codCharges | Double? | yes | | - | refundCredit | Double? | yes | | - | addedToFyndCash | Bool? | yes | | - | gstTaxPercentage | Double? | yes | | - | priceMarked | Double? | yes | | - | priceEffective | Double? | yes | | - | discount | Double? | yes | | - | promotionEffectiveDiscount | Double? | yes | | - | amountPaidRoundoff | Double? | yes | | - | fyndCredits | Double? | yes | | - | brandCalculatedAmount | Double? | yes | | - | cashback | Double? | yes | | - | valueOfGood | Double? | yes | | - ---- - - - - - #### [Payments](#Payments) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isActive | Bool? | yes | | - | displayName | String? | yes | | - | logo | String? | yes | | - | source | String? | yes | | - | sourceNickname | String? | yes | | - | displayPriority | Int? | yes | | - | id | Int? | yes | | - | mode | String? | yes | | - | paymentIdentifier | String? | yes | | - ---- - - - - - #### [Filters](#Filters) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | stage | [Stage](#Stage)? | yes | | - | stages | [Stages](#Stages)? | yes | | - ---- - - - - - #### [Stage](#Stage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | text | String? | yes | | - | value | String? | yes | | - | isDefault | Bool? | yes | | - | filters | [StagesFilters](#StagesFilters)? | yes | | - ---- - - - - - #### [StagesFilters](#StagesFilters) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | text | String? | yes | | - | value | String? | yes | | - | type | String? | yes | | - | options | [Options](#Options)? | yes | | - ---- - - - - - #### [Options](#Options) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | text | String? | yes | | - | value | String? | yes | | - ---- - - - - - #### [PlatformOrderPage](#PlatformOrderPage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | next | String? | yes | | - | previous | String? | yes | | - | type | String? | yes | | - | size | Int? | yes | | - | current | Int? | yes | | - | hasNext | Bool? | yes | | - | total | Int? | yes | | - | itemTotal | [ItemTotal](#ItemTotal)? | yes | | - ---- - - - - - #### [AppliedFilters](#AppliedFilters) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | stage | String? | yes | | - | stores | [String]? | yes | | - | fromDate | String? | yes | | - | toDate | String? | yes | | - ---- - - - - - #### [OrderDetails](#OrderDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[OrderPicklistListing](#OrderPicklistListing)] | no | | - | page | [PlatformOrderPage](#PlatformOrderPage) | no | | - | filters | [Filters](#Filters) | no | | - | nextOrderStatus | [String: Any] | no | | - | appliedFilters | [AppliedFilters](#AppliedFilters) | no | | - ---- - - - - - #### [OrderDetailsItem](#OrderDetailsItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | user | [PlatformOrderUserInfo](#PlatformOrderUserInfo)? | yes | | - | deliveryAddress | [PlatformDeliveryAddress](#PlatformDeliveryAddress)? | yes | | - | channel | [Channel](#Channel)? | yes | | - | fyndstoreEmp | [String: Any]? | yes | | - | orderingStore | [String: Any]? | yes | | - | breakupValues | [PlatformBreakupValues](#PlatformBreakupValues)? | yes | | - | id | String? | yes | | - | application | [PlatformApplication](#PlatformApplication)? | yes | | - | shipments | [PlatformShipmentDetails](#PlatformShipmentDetails)? | yes | | - | createdAt | String? | yes | | - | totalShipmentsInOrder | Int? | yes | | - | payments | [ItemsPayments](#ItemsPayments)? | yes | | - ---- - - - - - #### [PlatformBreakupValues](#PlatformBreakupValues) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - | value | Double? | yes | | - | name | String? | yes | | - ---- - - - - - #### [ArticleAssignment](#ArticleAssignment) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | strategy | String? | yes | | - | level | String? | yes | | - ---- - - - - - #### [PlatformShipmentDetails](#PlatformShipmentDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | status | [PlatformShipmentDetailsStatus](#PlatformShipmentDetailsStatus)? | yes | | - | bags | [BagsDetails](#BagsDetails)? | yes | | - | prices | [ShipmentPrices](#ShipmentPrices)? | yes | | - | breakupValues | [ShipmentBreakupValues](#ShipmentBreakupValues)? | yes | | - | id | String? | yes | | - | dpDetails | [DpDetails](#DpDetails)? | yes | | - | invoice | [ShipmentInvoice](#ShipmentInvoice)? | yes | | - | fulfillingStore | [PlatformFulfillingStore](#PlatformFulfillingStore)? | yes | | - | payments | [Payments](#Payments)? | yes | | - | gst | [ShipmentGst](#ShipmentGst)? | yes | | - | company | [Company](#Company)? | yes | | - | brand | [PlatformShipmentDetailsBrand](#PlatformShipmentDetailsBrand)? | yes | | - | coupon | [String: Any]? | yes | | - | orderSource | String? | yes | | - | isNotFyndSource | Bool? | yes | | - | comment | String? | yes | | - | promise | [Promise](#Promise)? | yes | | - | trackingDetails | [ShipmentTrackingDetails](#ShipmentTrackingDetails)? | yes | | - | isFyndCoupon | Bool? | yes | | - | orderType | String? | yes | | - | totalShipmentBags | Int? | yes | | - | pod | [String: Any]? | yes | | - | lockStatus | Bool? | yes | | - | orderingChannel | String? | yes | | - ---- - - - - - #### [PlatformShipmentDetailsStatus](#PlatformShipmentDetailsStatus) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | Int? | yes | | - | bagList | [Int]? | yes | | - | createdAt | String? | yes | | - | status | String? | yes | | - | name | String? | yes | | - | progress | Int? | yes | | - | shipmentId | String? | yes | | - | currentShipmentStatus | String? | yes | | - | colorCode | String? | yes | | - ---- - - - - - #### [BagsDetails](#BagsDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | financialBreakup | [[BagFinancialBreakup](#BagFinancialBreakup)]? | yes | | - | status | [BagCurrStatus](#BagCurrStatus)? | yes | | - | item | [BagItem](#BagItem)? | yes | | - | article | [BagArticle](#BagArticle)? | yes | | - | id | Int? | yes | | - | prices | [BagPrices](#BagPrices)? | yes | | - | gstDetails | [GstDetails](#GstDetails)? | yes | | - | breakupValues | [BagBreakupValues](#BagBreakupValues)? | yes | | - | updateTime | Int? | yes | | - | currentStatus | [BagCurrentStatus](#BagCurrentStatus)? | yes | | - | bagStatus | [BagStatus](#BagStatus)? | yes | | - ---- - - - - - #### [BagFinancialBreakup](#BagFinancialBreakup) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | valueOfGood | Double? | yes | | - | hsnCode | String? | yes | | - | priceEffective | Double? | yes | | - | codCharges | Double? | yes | | - | gstFee | String? | yes | | - | fyndCredits | Double? | yes | | - | refundAmount | Double? | yes | | - | cashbackApplied | Double? | yes | | - | transferPrice | Double? | yes | | - | amountPaidRoundoff | Double? | yes | | - | couponValue | Double? | yes | | - | amountPaid | Double? | yes | | - | gstTaxPercentage | Double? | yes | | - | size | String? | yes | | - | totalUnits | Int? | yes | | - | discount | Double? | yes | | - | couponEffectiveDiscount | Double? | yes | | - | cashback | Double? | yes | | - | promotionEffectiveDiscount | Double? | yes | | - | gstTag | String? | yes | | - | deliveryCharge | Double? | yes | | - | refundCredit | Double? | yes | | - | priceMarked | Double? | yes | | - | identifiers | [Identifiers](#Identifiers)? | yes | | - | itemName | String? | yes | | - | addedToFyndCash | Bool? | yes | | - | brandCalculatedAmount | Double? | yes | | - ---- - - - - - #### [Identifiers](#Identifiers) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | ean | String? | yes | | - ---- - - - - - #### [BagCurrStatus](#BagCurrStatus) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enableTracking | Bool? | yes | | - | isCustomerReturnAllowed | Bool? | yes | | - | isActive | Bool? | yes | | - | isReturnable | Bool? | yes | | - | canBeCancelled | Bool? | yes | | - ---- - - - - - #### [BagArticle](#BagArticle) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | identifiers | [ArticleIdentifiers](#ArticleIdentifiers)? | yes | | - | espModified | Bool? | yes | | - | isSet | Bool? | yes | | - | size | String? | yes | | - | code | String? | yes | | - | set | [Set](#Set)? | yes | | - | sellerIdentifier | String? | yes | | - | returnConfig | [BagArticleReturnConfig](#BagArticleReturnConfig)? | yes | | - | id | String? | yes | | - | uid | String? | yes | | - | childDetails | [String: Any]? | yes | | - ---- - - - - - #### [ArticleIdentifiers](#ArticleIdentifiers) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | ean | String? | yes | | - ---- - - - - - #### [Set](#Set) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | quantity | Int? | yes | | - | sizeDistribution | [SetSizeDistribution](#SetSizeDistribution)? | yes | | - ---- - - - - - #### [SetSizeDistribution](#SetSizeDistribution) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | sizes | [Sizes](#Sizes)? | yes | | - ---- - - - - - #### [Sizes](#Sizes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | size | String? | yes | | - | pieces | Int? | yes | | - ---- - - - - - #### [BagArticleReturnConfig](#BagArticleReturnConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | time | Int? | yes | | - | unit | String? | yes | | - | returnable | Bool? | yes | | - ---- - - - - - #### [GstDetails](#GstDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | brandCalculatedAmount | Double? | yes | | - | gstFee | String? | yes | | - | gstTag | String? | yes | | - | hsnCode | String? | yes | | - | valueOfGood | Double? | yes | | - | gstTaxPercentage | Double? | yes | | - | isDefaultHsnCode | Bool? | yes | | - ---- - - - - - #### [BagBreakupValues](#BagBreakupValues) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | display | String? | yes | | - | value | Double? | yes | | - ---- - - - - - #### [BagCurrentStatus](#BagCurrentStatus) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | updatedAt | String? | yes | | - | bagStateMapper | [BagStateMapper](#BagStateMapper)? | yes | | - | status | String? | yes | | - | stateType | String? | yes | | - ---- - - - - - #### [BagStateMapper](#BagStateMapper) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | appStateName | String? | yes | | - | isActive | Bool? | yes | | - | displayName | String? | yes | | - | name | String? | yes | | - | appDisplayName | String? | yes | | - ---- - - - - - #### [BagStatus](#BagStatus) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | status | String? | yes | | - | stateType | String? | yes | | - | updatedAt | String? | yes | | - | bagStateMapper | [BagStatusBagStateMapper](#BagStatusBagStateMapper)? | yes | | - ---- - - - - - #### [BagStatusBagStateMapper](#BagStatusBagStateMapper) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isActive | Bool? | yes | | - | displayName | String? | yes | | - | name | String? | yes | | - | appDisplayName | String? | yes | | - | appStateName | String? | yes | | - ---- - - - - - #### [BagPrices](#BagPrices) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cashback | Double? | yes | | - | refundCredit | Double? | yes | | - | couponValue | Double? | yes | | - | deliveryCharge | Double? | yes | | - | fyndCredits | Double? | yes | | - | priceMarked | Double? | yes | | - | cashbackApplied | Double? | yes | | - | valueOfGood | Double? | yes | | - | amountPaidRoundoff | Double? | yes | | - | amountPaid | Double? | yes | | - | codCharges | Double? | yes | | - | priceEffective | Double? | yes | | - | refundAmount | Double? | yes | | - | discount | Double? | yes | | - ---- - - - - - #### [ShipmentBreakupValues](#ShipmentBreakupValues) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | display | String? | yes | | - | value | Double? | yes | | - ---- - - - - - #### [DpDetails](#DpDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | gstTag | String? | yes | | - ---- - - - - - #### [ShipmentInvoice](#ShipmentInvoice) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | paymentType | String? | yes | | - | updatedDate | String? | yes | | - | invoiceUrl | String? | yes | | - | labelUrl | String? | yes | | - | paymentMode | String? | yes | | - | amountToCollect | Double? | yes | | - | rtoAddress | [RtoAddress](#RtoAddress)? | yes | | - ---- - - - - - #### [RtoAddress](#RtoAddress) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | id | Int? | yes | | - | phone | String? | yes | | - | locationType | String? | yes | | - | storeAddressJson | [StoreAddressJson](#StoreAddressJson)? | yes | | - | code | String? | yes | | - | address1 | String? | yes | | - | city | String? | yes | | - | country | String? | yes | | - | pincode | String? | yes | | - | companyId | Int? | yes | | - | contactPerson | String? | yes | | - | state | String? | yes | | - | storeEmail | String? | yes | | - | address2 | String? | yes | | - ---- - - - - - #### [StoreAddressJson](#StoreAddressJson) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | country | String? | yes | | - | latitude | Double? | yes | | - | updatedAt | String? | yes | | - | area | String? | yes | | - | state | String? | yes | | - | addressType | String? | yes | | - | city | String? | yes | | - | pincode | String? | yes | | - | address1 | String? | yes | | - | address2 | String? | yes | | - | longitude | Double? | yes | | - | email | String? | yes | | - | phone | String? | yes | | - | createdAt | String? | yes | | - | contactPerson | String? | yes | | - | addressCategory | String? | yes | | - | version | String? | yes | | - | landmark | String? | yes | | - ---- - - - - - #### [PlatformFulfillingStore](#PlatformFulfillingStore) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | packagingMaterialCount | Int? | yes | | - | locationType | String? | yes | | - | code | String? | yes | | - | city | String? | yes | | - | meta | [FulfillingStoreMeta](#FulfillingStoreMeta)? | yes | | - | name | String? | yes | | - | isActive | Bool? | yes | | - | address1 | String? | yes | | - | storeEmail | String? | yes | | - | isArchived | Bool? | yes | | - | state | String? | yes | | - | address2 | String? | yes | | - | contactPerson | String? | yes | | - | phone | String? | yes | | - | isEnabledForRecon | Bool? | yes | | - | fulfillmentChannel | String? | yes | | - | createdAt | String? | yes | | - | id | Int? | yes | | - | pincode | String? | yes | | - | brandStoreTags | [String]? | yes | | - | companyId | Int? | yes | | - | storeAddressJson | [FulfillingStoreStoreAddressJson](#FulfillingStoreStoreAddressJson)? | yes | | - | updatedAt | String? | yes | | - | loginUsername | String? | yes | | - | country | String? | yes | | - ---- - - - - - #### [FulfillingStoreMeta](#FulfillingStoreMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | additionalContactDetails | [AdditionalContactDetails](#AdditionalContactDetails)? | yes | | - | documents | [Documents](#Documents)? | yes | | - | gstNumber | String? | yes | | - | displayName | String? | yes | | - | productReturnConfig | [ProductReturnConfig](#ProductReturnConfig)? | yes | | - | allowDpAssignmentFromFynd | Bool? | yes | | - | stage | String? | yes | | - | timing | [Timing](#Timing)? | yes | | - ---- - - - - - #### [AdditionalContactDetails](#AdditionalContactDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | number | [String]? | yes | | - ---- - - - - - #### [Documents](#Documents) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | gst | [Gst](#Gst)? | yes | | - ---- - - - - - #### [Gst](#Gst) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | legalName | String? | yes | | - | type | String? | yes | | - | value | String? | yes | | - | verified | Bool? | yes | | - ---- - - - - - #### [ProductReturnConfig](#ProductReturnConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | onSameStore | Bool? | yes | | - ---- - - - - - #### [Timing](#Timing) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | opening | [Opening](#Opening)? | yes | | - | weekday | String? | yes | | - | open | Bool? | yes | | - | closing | [Closing](#Closing)? | yes | | - ---- - - - - - #### [Opening](#Opening) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | minute | Int? | yes | | - | hour | Int? | yes | | - ---- - - - - - #### [Closing](#Closing) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | hour | Int? | yes | | - | minute | Int? | yes | | - ---- - - - - - #### [FulfillingStoreStoreAddressJson](#FulfillingStoreStoreAddressJson) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | address2 | String? | yes | | - | area | String? | yes | | - | email | String? | yes | | - | phone | String? | yes | | - | state | String? | yes | | - | contactPerson | String? | yes | | - | country | String? | yes | | - | pincode | String? | yes | | - | version | String? | yes | | - | createdAt | String? | yes | | - | addressType | String? | yes | | - | city | String? | yes | | - | address1 | String? | yes | | - | landmark | String? | yes | | - | latitude | Double? | yes | | - | longitude | Double? | yes | | - | updatedAt | String? | yes | | - | addressCategory | String? | yes | | - ---- - - - - - #### [ShipmentGst](#ShipmentGst) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | brandCalculatedAmount | Double? | yes | | - | valueOfGood | Double? | yes | | - | gstFee | Double? | yes | | - ---- - - - - - #### [PlatformShipmentDetailsBrand](#PlatformShipmentDetailsBrand) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | creditNoteAllowed | Bool? | yes | | - | brandName | String? | yes | | - | modifiedOn | String? | yes | | - | id | Int? | yes | | - | isVirtualInvoice | Bool? | yes | | - | createdOn | String? | yes | | - | logo | String? | yes | | - ---- - - - - - #### [Promise](#Promise) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | timestamp | [Timestamp](#Timestamp)? | yes | | - ---- - - - - - #### [Timestamp](#Timestamp) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | min | String? | yes | | - | max | String? | yes | | - ---- - - - - - #### [ShipmentTrackingDetails](#ShipmentTrackingDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | status | String? | yes | | - | time | String? | yes | | - | isPassed | Bool? | yes | | - | isCurrent | Bool? | yes | | - ---- - - - - - #### [ItemsPayments](#ItemsPayments) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | displayPriority | Int? | yes | | - | id | Int? | yes | | - | isActive | Bool? | yes | | - | displayName | String? | yes | | - | logo | String? | yes | | - | paymentIdentifier | String? | yes | | - | sourceNickname | String? | yes | | - | mode | String? | yes | | - | source | String? | yes | | - ---- - - - - - #### [PlatformOrderDetailsPage](#PlatformOrderDetailsPage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | next | String? | yes | | - | previous | String? | yes | | - ---- - - - - - #### [OrderLanesCount](#OrderLanesCount) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | stages | [[StageItem](#StageItem)] | no | | - ---- - - - - - #### [StageItem](#StageItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | count | Int? | yes | | - | text | String? | yes | | - | value | String? | yes | | - ---- - - - - - #### [UpdateOrderReprocessResponse](#UpdateOrderReprocessResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | status | String | no | | - ---- - - - - - #### [PlatformOrderTrack](#PlatformOrderTrack) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | | - | requestId | String | no | | - | message | String | no | | - | mobile | String | no | | - | countryCode | String | no | | - | resendTimer | Int | no | | - | resendToken | String? | yes | | - ---- - - - - - #### [OrderPicklistListing](#OrderPicklistListing) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | user | [PlatformOrderUserInfo](#PlatformOrderUserInfo)? | yes | | - | deliveryAddress | [PlatformDeliveryAddress](#PlatformDeliveryAddress)? | yes | | - | channel | [Channel](#Channel)? | yes | | - | fyndstoreEmp | [String: Any]? | yes | | - | orderingStore | [String: Any]? | yes | | - | breakupValues | [PlatformBreakupValues](#PlatformBreakupValues)? | yes | | - | id | String? | yes | | - | application | [PlatformApplication](#PlatformApplication)? | yes | | - | shipments | [PlatformShipmentDetails](#PlatformShipmentDetails)? | yes | | - | createdAt | String? | yes | | - | totalShipmentsInOrder | Int? | yes | | - | payments | [ItemsPayments](#ItemsPayments)? | yes | | - ---- - - - - - #### [Stages](#Stages) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | text | String? | yes | | - | value | String? | yes | | - | isDefault | Bool? | yes | | - | filters | [StagesFilters](#StagesFilters)? | yes | | - ---- - - - - - #### [ItemTotal](#ItemTotal) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | new | Int? | yes | | - | processing | Int? | yes | | - | returns | Int? | yes | | - | all | Int? | yes | | - ---- - - - - - #### [GetPingResponse](#GetPingResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | ping | String | no | | - ---- - - - - - #### [GetShipmentAddressResponse](#GetShipmentAddressResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String | no | | - | data | [DataShipmentAddress](#DataShipmentAddress) | no | | - | success | Bool | no | | - ---- - - - - - #### [DataShipmentAddress](#DataShipmentAddress) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | city | String? | yes | | - | country | String? | yes | | - | pincode | String? | yes | | - | phone | String? | yes | | - | area | String? | yes | | - | address | String? | yes | | - | landmark | String? | yes | | - | state | String? | yes | | - | addressType | String? | yes | | - | addressCategory | String? | yes | | - | email | String? | yes | | - | name | String? | yes | | - ---- - - - - - #### [UpdateShipmentAddressRequest](#UpdateShipmentAddressRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | String | no | | - | address | String | no | | - | pincode | String | no | | - | state | String | no | | - | addressType | String | no | | - | country | String | no | | - | name | String | no | | - | phone | String | no | | - | area | String | no | | - | landmark | String | no | | - | city | String | no | | - ---- - - - - - #### [UpdateShipmentAddressResponse](#UpdateShipmentAddressResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | | - | message | String | no | | - ---- - - - - - #### [ShipmentTrackResponse](#ShipmentTrackResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | bagList | [[ShipmentTrackResponseBagListItem](#ShipmentTrackResponseBagListItem)] | no | | - | message | String | no | | - | orderValue | Int | no | | - ---- - - - - - #### [ShipmentTrackResponseBagListItem](#ShipmentTrackResponseBagListItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enableTracking | Bool? | yes | | - | price | String? | yes | | - | timeSlot | String? | yes | | - | productName | String? | yes | | - | canReturn | Bool? | yes | | - | orderDate | String? | yes | | - | isTryAtHome | Bool? | yes | | - | breakupValues | [[ShipmentTrackResponseBagListItemBreakValues](#ShipmentTrackResponseBagListItemBreakValues)]? | yes | | - | statuses | [[ShipmentTrackResponseBagListItemStatuses](#ShipmentTrackResponseBagListItemStatuses)]? | yes | | - | isActive | Bool? | yes | | - | bagId | String? | yes | | - | orderId | String? | yes | | - | size | String? | yes | | - | paymentModeSource | String? | yes | | - | dpDetails | [ShipmentTrackResponseBagListItemDpDetails](#ShipmentTrackResponseBagListItemDpDetails)? | yes | | - | productId | Int? | yes | | - | productImage | [ShipmentTrackResponseBagListItemsProductImage](#ShipmentTrackResponseBagListItemsProductImage)? | yes | | - | brandName | String? | yes | | - | priceMarked | String? | yes | | - | status | String? | yes | | - | canCancel | Bool? | yes | | - | paymentMode | String? | yes | | - | fyndCashMsg | String? | yes | | - | deliveryAddress | String? | yes | | - ---- - - - - - #### [ShipmentTrackResponseBagListItemBreakValues](#ShipmentTrackResponseBagListItemBreakValues) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | display | String? | yes | | - | value | String? | yes | | - ---- - - - - - #### [ShipmentTrackResponseBagListItemStatuses](#ShipmentTrackResponseBagListItemStatuses) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | npsRating | Int? | yes | | - | npsString | String? | yes | | - | progressStatus | [[ShipmentTrackResponseBagListItemStatusesProgress](#ShipmentTrackResponseBagListItemStatusesProgress)]? | yes | | - | flowType | String? | yes | | - | statusProgress | Int? | yes | | - | isNpsDone | Bool? | yes | | - | headerMessage | String? | yes | | - | isDelayed | String? | yes | | - | trackingList | [[ShipmentTrackResponseBagListItemStatusesTrack](#ShipmentTrackResponseBagListItemStatusesTrack)]? | yes | | - ---- - - - - - #### [ShipmentTrackResponseBagListItemStatusesProgress](#ShipmentTrackResponseBagListItemStatusesProgress) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | type | String? | yes | | - | state | Bool? | yes | | - ---- - - - - - #### [ShipmentTrackResponseBagListItemStatusesTrack](#ShipmentTrackResponseBagListItemStatusesTrack) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | status | String? | yes | | - | time | String? | yes | | - | isPassed | Bool? | yes | | - | isCurrent | Bool? | yes | | - ---- - - - - - #### [ShipmentTrackResponseBagListItemDpDetails](#ShipmentTrackResponseBagListItemDpDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | trackingNo | String? | yes | | - | courier | String? | yes | | - ---- - - - - - #### [ShipmentTrackResponseBagListItemsProductImage](#ShipmentTrackResponseBagListItemsProductImage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | aspectRatio | String? | yes | | - | url | String? | yes | | - ---- - - - - - #### [UpdateShipmentStatusResponse](#UpdateShipmentStatusResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | shipments | [String: Any] | no | | - | errorShipments | [[String: Any]]? | yes | | - ---- - - - - - #### [UpdateShipmentStatusBody](#UpdateShipmentStatusBody) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | shipments | [String: Any] | no | | - | forceTransition | Bool | no | | - | task | Bool | no | | - ---- - - - - - #### [ShipmentReasonsResponse](#ShipmentReasonsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | | - | message | String | no | | - | reasons | [[ShipmentResponseReasons](#ShipmentResponseReasons)] | no | | - ---- - - - - - #### [ShipmentResponseReasons](#ShipmentResponseReasons) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | reasonId | Double? | yes | | - | reason | String? | yes | | - ---- - - - - - #### [PlatformShipmentTrack](#PlatformShipmentTrack) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | results | [Results](#Results) | no | | - ---- - - - - - #### [Results](#Results) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | awb | String? | yes | | - | updatedAt | String? | yes | | - | lastLocationRecievedAt | String? | yes | | - | reason | String? | yes | | - | shipmentType | String? | yes | | - | status | String? | yes | | - | updatedTime | String? | yes | | - | accountName | String? | yes | | - ---- - - - - - #### [ShipmentUpdateRequest](#ShipmentUpdateRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | bags | [String] | no | | - | reason | [String: Any] | no | | - | comments | String | no | | - | action | String | no | | - ---- - - - - - #### [ShipmentUpdateResponse](#ShipmentUpdateResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | | - | message | String | no | | - ---- - - - - - #### [UpdateProcessShipmenstRequestBody](#UpdateProcessShipmenstRequestBody) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | shipmentIds | [String] | no | | - | expectedStatus | String | no | | - ---- - - - - - #### [UpdateProcessShipmenstRequestResponse](#UpdateProcessShipmenstRequestResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | | - | message | String | no | | - ---- - - - - - #### [GetVoiceCallbackResponse](#GetVoiceCallbackResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String | no | | - ---- - - - - - #### [GetClickToCallResponse](#GetClickToCallResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String | no | | - ---- - - - - - #### [ApefaceApiError](#ApefaceApiError) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - - - #### [DeleteResponse](#DeleteResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [ErrorResponse](#ErrorResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | meta | [String: Any]? | yes | | - | message | String? | yes | | - | status | Int? | yes | | - | code | String? | yes | | - ---- - - - - - #### [SearchKeywordResult](#SearchKeywordResult) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | query | [String: Any] | no | | - | sortOn | String | no | | - ---- - - - - - #### [CreateSearchKeyword](#CreateSearchKeyword) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | result | [SearchKeywordResult](#SearchKeywordResult) | no | | - | isActive | Bool? | yes | | - | appId | String? | yes | | - | customJson | [String: Any]? | yes | | - | words | [String]? | yes | | - ---- - - - - - #### [GetSearchWordsData](#GetSearchWordsData) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | result | [String: Any]? | yes | | - | appId | String? | yes | | - | customJson | [String: Any]? | yes | | - | words | [String]? | yes | | - | uid | String? | yes | | - ---- - - - - - #### [GetSearchWordsDetailResponse](#GetSearchWordsDetailResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [GetSearchWordsData](#GetSearchWordsData)? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [GetSearchWordsResponse](#GetSearchWordsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[GetSearchWordsData](#GetSearchWordsData)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [Media](#Media) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | url | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [AutocompletePageAction](#AutocompletePageAction) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | query | [String: Any] | no | | - | url | String? | yes | | - | params | [String: Any]? | yes | | - | type | String | no | | - ---- - - - - - #### [AutocompleteAction](#AutocompleteAction) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | page | [AutocompletePageAction](#AutocompletePageAction)? | yes | | - | type | String? | yes | | - ---- - - - - - #### [AutocompleteResult](#AutocompleteResult) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | customJson | [String: Any]? | yes | | - | logo | [Media](#Media)? | yes | | - | display | String? | yes | | - | action | [AutocompleteAction](#AutocompleteAction)? | yes | | - ---- - - - - - #### [CreateAutocompleteKeyword](#CreateAutocompleteKeyword) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isActive | Bool? | yes | | - | results | [[AutocompleteResult](#AutocompleteResult)]? | yes | | - | appId | String? | yes | | - | customJson | [String: Any]? | yes | | - | words | [String]? | yes | | - ---- - - - - - #### [GetAutocompleteWordsData](#GetAutocompleteWordsData) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | results | [[String: Any]]? | yes | | - | appId | String? | yes | | - | customJson | [String: Any]? | yes | | - | words | [String]? | yes | | - | uid | String? | yes | | - ---- - - - - - #### [GetAutocompleteWordsResponse](#GetAutocompleteWordsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[GetAutocompleteWordsData](#GetAutocompleteWordsData)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [CreateAutocompleteWordsResponse](#CreateAutocompleteWordsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | appId | String? | yes | | - | customJson | [String: Any]? | yes | | - | words | [String]? | yes | | - | results | [[String: Any]]? | yes | | - ---- - - - - - #### [ProductBundleItem](#ProductBundleItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | minQuantity | Int | no | | - | autoAddToCart | Bool? | yes | | - | allowRemove | Bool? | yes | | - | maxQuantity | Int | no | | - | autoSelect | Bool? | yes | | - | productUid | Int | no | | - ---- - - - - - #### [ProductBundleRequest](#ProductBundleRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdBy | [String: Any]? | yes | | - | choice | String | no | | - | pageVisibility | [String]? | yes | | - | createdOn | String? | yes | | - | slug | String | no | | - | products | [[ProductBundleItem](#ProductBundleItem)] | no | | - | meta | [String: Any]? | yes | | - | logo | String? | yes | | - | modifiedBy | [String: Any]? | yes | | - | isActive | Bool | no | | - | modifiedOn | String? | yes | | - | sameStoreAssignment | Bool? | yes | | - | name | String | no | | - ---- - - - - - #### [GetProductBundleCreateResponse](#GetProductBundleCreateResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdBy | [String: Any]? | yes | | - | choice | String | no | | - | companyId | Int? | yes | | - | pageVisibility | [String]? | yes | | - | createdOn | String? | yes | | - | slug | String | no | | - | products | [[ProductBundleItem](#ProductBundleItem)] | no | | - | meta | [String: Any]? | yes | | - | logo | String? | yes | | - | modifiedBy | [String: Any]? | yes | | - | isActive | Bool | no | | - | modifiedOn | String? | yes | | - | sameStoreAssignment | Bool? | yes | | - | id | String? | yes | | - | name | String | no | | - ---- - - - - - #### [GetProductBundleListingResponse](#GetProductBundleListingResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[GetProductBundleCreateResponse](#GetProductBundleCreateResponse)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [ProductBundleUpdateRequest](#ProductBundleUpdateRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | choice | String | no | | - | pageVisibility | [String]? | yes | | - | slug | String | no | | - | products | [[ProductBundleItem](#ProductBundleItem)] | no | | - | meta | [String: Any]? | yes | | - | logo | String? | yes | | - | modifiedBy | [String: Any]? | yes | | - | isActive | Bool | no | | - | modifiedOn | String? | yes | | - | sameStoreAssignment | Bool? | yes | | - | name | String | no | | - ---- - - - - - #### [LimitedProductData](#LimitedProductData) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | shortDescription | String? | yes | | - | name | String? | yes | | - | images | [String]? | yes | | - | attributes | [String: Any]? | yes | | - | itemCode | String? | yes | | - | countryOfOrigin | String? | yes | | - | quantity | Int? | yes | | - | sizes | [String]? | yes | | - | slug | String? | yes | | - | uid | Int? | yes | | - | identifier | [String: Any]? | yes | | - | price | [String: Any]? | yes | | - ---- - - - - - #### [Size](#Size) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isAvailable | Bool? | yes | | - | display | String? | yes | | - | quantity | Int? | yes | | - | value | String? | yes | | - ---- - - - - - #### [Price](#Price) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | minEffective | Double? | yes | | - | minMarked | Double? | yes | | - | maxMarked | Double? | yes | | - | currency | String? | yes | | - | maxEffective | Double? | yes | | - ---- - - - - - #### [GetProducts](#GetProducts) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | minQuantity | Int? | yes | | - | autoAddToCart | Bool? | yes | | - | allowRemove | Bool? | yes | | - | maxQuantity | Int? | yes | | - | productDetails | [LimitedProductData](#LimitedProductData)? | yes | | - | sizes | [[Size](#Size)]? | yes | | - | autoSelect | Bool? | yes | | - | productUid | Int? | yes | | - | price | [Price](#Price)? | yes | | - ---- - - - - - #### [GetProductBundleResponse](#GetProductBundleResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | choice | String? | yes | | - | companyId | Int? | yes | | - | pageVisibility | [String]? | yes | | - | slug | String? | yes | | - | products | [[GetProducts](#GetProducts)]? | yes | | - | meta | [String: Any]? | yes | | - | logo | String? | yes | | - | isActive | Bool? | yes | | - | sameStoreAssignment | Bool? | yes | | - | name | String? | yes | | - ---- - - - - - #### [Meta](#Meta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | values | [[String: Any]]? | yes | | - | unit | String? | yes | | - | headers | [String: Any]? | yes | | - ---- - - - - - #### [Guide](#Guide) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | meta | [Meta](#Meta)? | yes | | - ---- - - - - - #### [ValidateSizeGuide](#ValidateSizeGuide) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | createdBy | [String: Any]? | yes | | - | tag | String? | yes | | - | companyId | Int? | yes | | - | createdOn | String? | yes | | - | guide | [Guide](#Guide)? | yes | | - | active | Bool? | yes | | - | modifiedOn | String? | yes | | - | image | String? | yes | | - | id | String? | yes | | - | modifiedBy | [String: Any]? | yes | | - | title | String | no | | - | subtitle | String? | yes | | - | name | String | no | | - | brandId | Int? | yes | | - ---- - - - - - #### [SuccessResponse](#SuccessResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uid | Int? | yes | | - | success | Bool? | yes | | - ---- - - - - - #### [ListSizeGuide](#ListSizeGuide) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[String: Any]]? | yes | | - | page | [String: Any]? | yes | | - ---- - - - - - #### [SizeGuideResponse](#SizeGuideResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdBy | [String: Any]? | yes | | - | tag | String? | yes | | - | companyId | Int? | yes | | - | createdOn | String? | yes | | - | guide | [String: Any]? | yes | | - | active | Bool? | yes | | - | modifiedOn | String? | yes | | - | id | String? | yes | | - | modifiedBy | [String: Any]? | yes | | - | title | String? | yes | | - | subtitle | String? | yes | | - | name | String? | yes | | - | brandId | Int? | yes | | - ---- - - - - - #### [MetaDataListingFilterMetaResponse](#MetaDataListingFilterMetaResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | filterTypes | [String]? | yes | | - | display | String? | yes | | - | key | String? | yes | | - | units | [[String: Any]]? | yes | | - ---- - - - - - #### [MetaDataListingFilterResponse](#MetaDataListingFilterResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | data | [[MetaDataListingFilterMetaResponse](#MetaDataListingFilterMetaResponse)]? | yes | | - ---- - - - - - #### [MetaDataListingSortMetaResponse](#MetaDataListingSortMetaResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - | key | String? | yes | | - ---- - - - - - #### [MetaDataListingSortResponse](#MetaDataListingSortResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | data | [[MetaDataListingSortMetaResponse](#MetaDataListingSortMetaResponse)]? | yes | | - ---- - - - - - #### [MetaDataListingResponse](#MetaDataListingResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | filter | [MetaDataListingFilterResponse](#MetaDataListingFilterResponse) | no | | - | sort | [MetaDataListingSortResponse](#MetaDataListingSortResponse) | no | | - ---- - - - - - #### [GetCatalogConfigurationDetailsProduct](#GetCatalogConfigurationDetailsProduct) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | variant | [String: Any]? | yes | | - | detail | [String: Any]? | yes | | - | compare | [String: Any]? | yes | | - | similar | [String: Any]? | yes | | - ---- - - - - - #### [GetCatalogConfigurationMetaData](#GetCatalogConfigurationMetaData) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | listing | [MetaDataListingResponse](#MetaDataListingResponse)? | yes | | - | product | [GetCatalogConfigurationDetailsProduct](#GetCatalogConfigurationDetailsProduct)? | yes | | - ---- - - - - - #### [ProductSize](#ProductSize) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | max | Int | no | | - | min | Int | no | | - ---- - - - - - #### [ConfigurationProductVariantConfig](#ConfigurationProductVariantConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String | no | | - | logo | String? | yes | | - | isActive | Bool | no | | - | size | [ProductSize](#ProductSize) | no | | - | displayType | String | no | | - | priority | Int | no | | - | name | String | no | | - ---- - - - - - #### [ConfigurationProductVariant](#ConfigurationProductVariant) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | config | [[ConfigurationProductVariantConfig](#ConfigurationProductVariantConfig)]? | yes | | - ---- - - - - - #### [ConfigurationProductConfig](#ConfigurationProductConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String | no | | - | logo | String? | yes | | - | isActive | Bool | no | | - | size | [ProductSize](#ProductSize)? | yes | | - | priority | Int | no | | - | title | String? | yes | | - | subtitle | String? | yes | | - ---- - - - - - #### [ConfigurationProductSimilar](#ConfigurationProductSimilar) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | config | [[ConfigurationProductConfig](#ConfigurationProductConfig)]? | yes | | - ---- - - - - - #### [ConfigurationProduct](#ConfigurationProduct) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | variant | [ConfigurationProductVariant](#ConfigurationProductVariant) | no | | - | similar | [ConfigurationProductSimilar](#ConfigurationProductSimilar) | no | | - ---- - - - - - #### [ConfigurationBucketPoints](#ConfigurationBucketPoints) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | end | Double? | yes | | - | start | Double? | yes | | - ---- - - - - - #### [ConfigurationListingFilterValue](#ConfigurationListingFilterValue) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | map | [String: Any]? | yes | | - | condition | String? | yes | | - | bucketPoints | [[ConfigurationBucketPoints](#ConfigurationBucketPoints)]? | yes | | - | sort | String? | yes | | - | value | String? | yes | | - ---- - - - - - #### [ConfigurationListingFilterConfig](#ConfigurationListingFilterConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | valueConfig | [ConfigurationListingFilterValue](#ConfigurationListingFilterValue)? | yes | | - | type | String | no | | - | key | String | no | | - | logo | String? | yes | | - | isActive | Bool | no | | - | priority | Int | no | | - | name | String? | yes | | - ---- - - - - - #### [ConfigurationListingFilter](#ConfigurationListingFilter) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | allowSingle | Bool | no | | - | attributeConfig | [[ConfigurationListingFilterConfig](#ConfigurationListingFilterConfig)]? | yes | | - ---- - - - - - #### [ConfigurationListingSortConfig](#ConfigurationListingSortConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String | no | | - | logo | String? | yes | | - | isActive | Bool | no | | - | priority | Int | no | | - | name | String? | yes | | - ---- - - - - - #### [ConfigurationListingSort](#ConfigurationListingSort) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | defaultKey | String | no | | - | config | [[ConfigurationListingSortConfig](#ConfigurationListingSortConfig)]? | yes | | - ---- - - - - - #### [ConfigurationListing](#ConfigurationListing) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | filter | [ConfigurationListingFilter](#ConfigurationListingFilter) | no | | - | sort | [ConfigurationListingSort](#ConfigurationListingSort) | no | | - ---- - - - - - #### [AppConfiguration](#AppConfiguration) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | product | [ConfigurationProduct](#ConfigurationProduct)? | yes | | - | configId | String? | yes | | - | configType | String | no | | - | appId | String | no | | - | listing | [ConfigurationListing](#ConfigurationListing)? | yes | | - ---- - - - - - #### [AppCatalogConfiguration](#AppCatalogConfiguration) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | product | [ConfigurationProduct](#ConfigurationProduct)? | yes | | - | configId | String? | yes | | - | configType | String | no | | - | id | String? | yes | | - | appId | String | no | | - | listing | [ConfigurationListing](#ConfigurationListing)? | yes | | - ---- - - - - - #### [GetAppCatalogConfiguration](#GetAppCatalogConfiguration) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isDefault | Bool? | yes | | - | data | [AppCatalogConfiguration](#AppCatalogConfiguration)? | yes | | - ---- - - - - - #### [GetCatalogConfigurationDetailsSchemaListing](#GetCatalogConfigurationDetailsSchemaListing) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | filter | [String: Any]? | yes | | - | sort | [String: Any]? | yes | | - ---- - - - - - #### [EntityConfiguration](#EntityConfiguration) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | product | [GetCatalogConfigurationDetailsProduct](#GetCatalogConfigurationDetailsProduct)? | yes | | - | configId | String? | yes | | - | configType | String | no | | - | id | String? | yes | | - | appId | String | no | | - | listing | [GetCatalogConfigurationDetailsSchemaListing](#GetCatalogConfigurationDetailsSchemaListing)? | yes | | - ---- - - - - - #### [GetAppCatalogEntityConfiguration](#GetAppCatalogEntityConfiguration) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isDefault | Bool? | yes | | - | data | [EntityConfiguration](#EntityConfiguration)? | yes | | - ---- - - - - - #### [ProductSortOn](#ProductSortOn) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isSelected | Bool? | yes | | - | name | String? | yes | | - | value | String? | yes | | - ---- - - - - - #### [ProductFiltersValue](#ProductFiltersValue) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | currencyCode | String? | yes | | - | queryFormat | String? | yes | | - | selectedMax | Int? | yes | | - | currencySymbol | String? | yes | | - | display | String | no | | - | displayFormat | String? | yes | | - | max | Int? | yes | | - | isSelected | Bool | no | | - | count | Int? | yes | | - | min | Int? | yes | | - | selectedMin | Int? | yes | | - | value | String | no | | - ---- - - - - - #### [ProductFiltersKey](#ProductFiltersKey) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | logo | String? | yes | | - | display | String | no | | - | kind | String? | yes | | - | name | String | no | | - ---- - - - - - #### [ProductFilters](#ProductFilters) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | values | [[ProductFiltersValue](#ProductFiltersValue)] | no | | - | key | [ProductFiltersKey](#ProductFiltersKey) | no | | - ---- - - - - - #### [GetCollectionQueryOptionResponse](#GetCollectionQueryOptionResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | sortOn | [[ProductSortOn](#ProductSortOn)]? | yes | | - | filters | [[ProductFilters](#ProductFilters)]? | yes | | - ---- - - - - - #### [CollectionBadge](#CollectionBadge) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | text | String? | yes | | - | color | String? | yes | | - ---- - - - - - #### [CollectionImage](#CollectionImage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | url | String | no | | - | aspectRatio | String | no | | - ---- - - - - - #### [CollectionBanner](#CollectionBanner) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | landscape | [CollectionImage](#CollectionImage) | no | | - | portrait | [CollectionImage](#CollectionImage) | no | | - ---- - - - - - #### [SeoDetail](#SeoDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | title | String? | yes | | - ---- - - - - - #### [UserInfo](#UserInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uid | String? | yes | | - | email | String? | yes | | - | username | String? | yes | | - | userId | String? | yes | | - ---- - - - - - #### [Schedule](#Schedule) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cron | String? | yes | | - | end | String? | yes | | - | start | String? | yes | | - | duration | Int? | yes | | - ---- - - - - - #### [CreateCollection](#CreateCollection) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | localeLanguage | [String: Any]? | yes | | - | allowSort | Bool? | yes | | - | visibleFacetsKeys | [String]? | yes | | - | badge | [CollectionBadge](#CollectionBadge)? | yes | | - | published | Bool? | yes | | - | isActive | Bool? | yes | | - | banners | [CollectionBanner](#CollectionBanner) | no | | - | seo | [SeoDetail](#SeoDetail)? | yes | | - | modifiedBy | [UserInfo](#UserInfo)? | yes | | - | appId | String | no | | - | sortOn | String? | yes | | - | allowFacets | Bool? | yes | | - | customJson | [String: Any]? | yes | | - | query | [String: Any]? | yes | | - | createdBy | [UserInfo](#UserInfo)? | yes | | - | description | String? | yes | | - | logo | [CollectionImage](#CollectionImage) | no | | - | meta | [String: Any]? | yes | | - | name | String | no | | - | type | String | no | | - | slug | String | no | | - | schedule | [Schedule](#Schedule)? | yes | | - | tags | [String]? | yes | | - ---- - - - - - #### [BannerImage](#BannerImage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | url | String? | yes | | - | aspectRatio | String? | yes | | - ---- - - - - - #### [ImageUrls](#ImageUrls) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | landscape | [BannerImage](#BannerImage)? | yes | | - | portrait | [BannerImage](#BannerImage)? | yes | | - ---- - - - - - #### [CollectionCreateResponse](#CollectionCreateResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | banners | [ImageUrls](#ImageUrls)? | yes | | - | query | [String: Any]? | yes | | - | tag | [String]? | yes | | - | type | String? | yes | | - | allowSort | Bool? | yes | | - | visibleFacetsKeys | [String]? | yes | | - | badge | [String: Any]? | yes | | - | slug | String? | yes | | - | schedule | [String: Any]? | yes | | - | logo | [BannerImage](#BannerImage)? | yes | | - | meta | [String: Any]? | yes | | - | isActive | Bool? | yes | | - | appId | String? | yes | | - | cron | [String: Any]? | yes | | - | allowFacets | Bool? | yes | | - | name | String? | yes | | - ---- - - - - - #### [Media1](#Media1) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | meta | [String: Any]? | yes | | - | url | String | no | | - | type | String? | yes | | - ---- - - - - - #### [ProductListingActionPage](#ProductListingActionPage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | query | [String: Any]? | yes | | - | type | String? | yes | | - ---- - - - - - #### [ProductListingAction](#ProductListingAction) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | page | [ProductListingActionPage](#ProductListingActionPage)? | yes | | - | type | String? | yes | | - ---- - - - - - #### [GetCollectionDetailNest](#GetCollectionDetailNest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | allowSort | Bool? | yes | | - | visibleFacetsKeys | [String]? | yes | | - | badge | [String: Any]? | yes | | - | isActive | Bool? | yes | | - | banners | [ImageUrls](#ImageUrls)? | yes | | - | appId | String? | yes | | - | allowFacets | Bool? | yes | | - | description | String? | yes | | - | query | [String: Any]? | yes | | - | tag | [String]? | yes | | - | logo | [Media1](#Media1)? | yes | | - | meta | [String: Any]? | yes | | - | uid | String? | yes | | - | name | String? | yes | | - | type | String? | yes | | - | action | [ProductListingAction](#ProductListingAction)? | yes | | - | slug | String? | yes | | - | schedule | [String: Any]? | yes | | - | cron | [String: Any]? | yes | | - ---- - - - - - #### [CollectionListingFilterTag](#CollectionListingFilterTag) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isSelected | Bool? | yes | | - | display | String? | yes | | - | name | String? | yes | | - ---- - - - - - #### [CollectionListingFilterType](#CollectionListingFilterType) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isSelected | Bool? | yes | | - | display | String? | yes | | - | name | String? | yes | | - ---- - - - - - #### [CollectionListingFilter](#CollectionListingFilter) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | tags | [[CollectionListingFilterTag](#CollectionListingFilterTag)]? | yes | | - | type | [[CollectionListingFilterType](#CollectionListingFilterType)]? | yes | | - ---- - - - - - #### [GetCollectionListingResponse](#GetCollectionListingResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[GetCollectionDetailNest](#GetCollectionDetailNest)]? | yes | | - | page | [Page](#Page)? | yes | | - | filters | [CollectionListingFilter](#CollectionListingFilter)? | yes | | - ---- - - - - - #### [CollectionDetailResponse](#CollectionDetailResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | banners | [ImageUrls](#ImageUrls)? | yes | | - | query | [String: Any]? | yes | | - | tag | [String]? | yes | | - | type | String? | yes | | - | allowSort | Bool? | yes | | - | visibleFacetsKeys | [String]? | yes | | - | badge | [String: Any]? | yes | | - | slug | String? | yes | | - | schedule | [String: Any]? | yes | | - | logo | [Media1](#Media1)? | yes | | - | meta | [String: Any]? | yes | | - | isActive | Bool? | yes | | - | appId | String? | yes | | - | cron | [String: Any]? | yes | | - | allowFacets | Bool? | yes | | - | name | String? | yes | | - ---- - - - - - #### [UpdateCollection](#UpdateCollection) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | localeLanguage | [String: Any]? | yes | | - | allowSort | Bool? | yes | | - | badge | [CollectionBadge](#CollectionBadge)? | yes | | - | visibleFacetsKeys | [String]? | yes | | - | published | Bool? | yes | | - | isActive | Bool? | yes | | - | banners | [CollectionBanner](#CollectionBanner)? | yes | | - | seo | [SeoDetail](#SeoDetail)? | yes | | - | modifiedBy | [UserInfo](#UserInfo)? | yes | | - | sortOn | String? | yes | | - | customJson | [String: Any]? | yes | | - | allowFacets | Bool? | yes | | - | description | String? | yes | | - | query | [String: Any]? | yes | | - | logo | [CollectionImage](#CollectionImage)? | yes | | - | meta | [String: Any]? | yes | | - | name | String? | yes | | - | slug | String? | yes | | - | schedule | [Schedule](#Schedule)? | yes | | - | tags | [String]? | yes | | - ---- - - - - - #### [CollectionItemRequest](#CollectionItemRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pageNo | Int | no | | - | pageSize | Int | no | | - ---- - - - - - #### [UpdatedResponse](#UpdatedResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [ProductBrand](#ProductBrand) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uid | Int? | yes | | - | logo | [Media1](#Media1)? | yes | | - | name | String? | yes | | - | action | [ProductListingAction](#ProductListingAction)? | yes | | - ---- - - - - - #### [ProductDetailAttribute](#ProductDetailAttribute) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | key | String? | yes | | - | value | String? | yes | | - ---- - - - - - #### [ProductDetailGroupedAttribute](#ProductDetailGroupedAttribute) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | details | [[ProductDetailAttribute](#ProductDetailAttribute)]? | yes | | - ---- - - - - - #### [Price1](#Price1) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | max | Double? | yes | | - | currencySymbol | String? | yes | | - | min | Double? | yes | | - | currencyCode | String? | yes | | - ---- - - - - - #### [ProductListingPrice](#ProductListingPrice) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | marked | [Price1](#Price1)? | yes | | - | effective | [Price1](#Price1)? | yes | | - ---- - - - - - #### [ProductListingDetail](#ProductListingDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | shortDescription | String? | yes | | - | attributes | [String: Any]? | yes | | - | hasVariant | Bool? | yes | | - | color | String? | yes | | - | promoMeta | [String: Any]? | yes | | - | discount | String? | yes | | - | productOnlineDate | String? | yes | | - | brand | [ProductBrand](#ProductBrand)? | yes | | - | highlights | [String]? | yes | | - | groupedAttributes | [[ProductDetailGroupedAttribute](#ProductDetailGroupedAttribute)]? | yes | | - | teaserTag | [String: Any]? | yes | | - | description | String? | yes | | - | similars | [String]? | yes | | - | itemCode | String? | yes | | - | medias | [[Media1](#Media1)]? | yes | | - | tryouts | [String]? | yes | | - | imageNature | String? | yes | | - | uid | Int? | yes | | - | ratingCount | Int? | yes | | - | name | String? | yes | | - | sellable | Bool? | yes | | - | type | String? | yes | | - | itemType | String? | yes | | - | slug | String | no | | - | rating | Double? | yes | | - | price | [ProductListingPrice](#ProductListingPrice)? | yes | | - ---- - - - - - #### [GetCollectionItemsResponse](#GetCollectionItemsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[ProductListingDetail](#ProductListingDetail)]? | yes | | - | sortOn | [[ProductSortOn](#ProductSortOn)]? | yes | | - | page | [Page](#Page)? | yes | | - | filters | [[ProductFilters](#ProductFilters)]? | yes | | - ---- - - - - - #### [CatalogInsightBrand](#CatalogInsightBrand) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | availableSizes | Int? | yes | | - | articleFreshness | Int? | yes | | - | availableArticles | Int? | yes | | - | totalSizes | Int? | yes | | - | totalArticles | Int? | yes | | - | name | String? | yes | | - ---- - - - - - #### [CatalogInsightItem](#CatalogInsightItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | outOfStockCount | Int? | yes | | - | sellableCount | Int? | yes | | - | count | Int? | yes | | - ---- - - - - - #### [CatalogInsightResponse](#CatalogInsightResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | brandDistribution | [CatalogInsightBrand](#CatalogInsightBrand)? | yes | | - | item | [CatalogInsightItem](#CatalogInsightItem)? | yes | | - ---- - - - - - #### [CrossSellingData](#CrossSellingData) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | products | Int? | yes | | - | articles | Int? | yes | | - ---- - - - - - #### [CrossSellingResponse](#CrossSellingResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | brandDistribution | [CatalogInsightBrand](#CatalogInsightBrand)? | yes | | - | data | [CrossSellingData](#CrossSellingData)? | yes | | - ---- - - - - - #### [OptInPostRequest](#OptInPostRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | storeIds | [Int]? | yes | | - | brandIds | [Int]? | yes | | - | optLevel | String | no | | - | enabled | Bool? | yes | | - ---- - - - - - #### [CompanyOptIn](#CompanyOptIn) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdBy | [String: Any]? | yes | | - | optLevel | String | no | | - | platform | String | no | | - | enabled | Bool | no | | - | companyId | Int | no | | - | brandIds | [Int] | no | | - | createdOn | Int | no | | - | modifiedOn | Int | no | | - | modifiedBy | [String: Any]? | yes | | - | storeIds | [Int] | no | | - ---- - - - - - #### [GetOptInPlatform](#GetOptInPlatform) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[CompanyOptIn](#CompanyOptIn)] | no | | - | page | [Page](#Page) | no | | - ---- - - - - - #### [OptinCompanyDetail](#OptinCompanyDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uid | Int? | yes | | - | businessType | String? | yes | | - | name | String? | yes | | - | companyType | String? | yes | | - ---- - - - - - #### [CompanyBrandDetail](#CompanyBrandDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | companyId | Int? | yes | | - | totalArticle | Int? | yes | | - | brandName | String? | yes | | - | brandId | Int? | yes | | - ---- - - - - - #### [OptinCompanyBrandDetailsView](#OptinCompanyBrandDetailsView) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[CompanyBrandDetail](#CompanyBrandDetail)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [OptinCompanyMetrics](#OptinCompanyMetrics) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | store | Int? | yes | | - | brand | Int? | yes | | - | company | String? | yes | | - ---- - - - - - #### [StoreDetail](#StoreDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | storeType | String? | yes | | - | documents | [[String: Any]]? | yes | | - | displayName | String? | yes | | - | storeCode | String? | yes | | - | companyId | Int? | yes | | - | createdOn | String? | yes | | - | modifiedOn | String? | yes | | - | additionalContacts | [[String: Any]]? | yes | | - | uid | Int? | yes | | - | timing | [String: Any]? | yes | | - | name | String? | yes | | - ---- - - - - - #### [OptinStoreDetails](#OptinStoreDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[StoreDetail](#StoreDetail)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [AttributeMasterDetails](#AttributeMasterDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | displayType | String | no | | - ---- - - - - - #### [AttributeMasterFilter](#AttributeMasterFilter) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | priority | Int? | yes | | - | indexing | Bool | no | | - | dependsOn | [String]? | yes | | - ---- - - - - - #### [AttributeMasterMandatoryDetails](#AttributeMasterMandatoryDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | l3Keys | [String]? | yes | | - ---- - - - - - #### [AttributeMasterMeta](#AttributeMasterMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enriched | Bool? | yes | | - | mandatoryDetails | [AttributeMasterMandatoryDetails](#AttributeMasterMandatoryDetails) | no | | - ---- - - - - - #### [AttributeSchemaRange](#AttributeSchemaRange) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | max | Int? | yes | | - | min | Int? | yes | | - ---- - - - - - #### [AttributeMaster](#AttributeMaster) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String | no | | - | mandatory | Bool? | yes | | - | allowedValues | [String]? | yes | | - | format | String? | yes | | - | multi | Bool? | yes | | - | range | [AttributeSchemaRange](#AttributeSchemaRange)? | yes | | - ---- - - - - - #### [GenderDetail](#GenderDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | details | [AttributeMasterDetails](#AttributeMasterDetails)? | yes | | - | departments | [String]? | yes | | - | filters | [AttributeMasterFilter](#AttributeMasterFilter)? | yes | | - | slug | String? | yes | | - | enabledForEndConsumer | Bool? | yes | | - | meta | [AttributeMasterMeta](#AttributeMasterMeta)? | yes | | - | schema | [AttributeMaster](#AttributeMaster)? | yes | | - | logo | String? | yes | | - | id | String? | yes | | - | isNested | Bool? | yes | | - | name | String? | yes | | - ---- - - - - - #### [ProdcutTemplateCategoriesResponse](#ProdcutTemplateCategoriesResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[String: Any]]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [PTErrorResponse](#PTErrorResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - | code | String? | yes | | - | meta | [String: Any]? | yes | | - | status | Int? | yes | | - | errors | [String: Any]? | yes | | - ---- - - - - - #### [UserSerializer](#UserSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | username | String? | yes | | - | contact | String? | yes | | - | userId | String? | yes | | - ---- - - - - - #### [GetDepartment](#GetDepartment) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdBy | [UserSerializer](#UserSerializer)? | yes | | - | pageSize | Int? | yes | | - | priorityOrder | Int? | yes | | - | itemType | String? | yes | | - | pageNo | Int? | yes | | - | search | String? | yes | | - | createdOn | String? | yes | | - | slug | String? | yes | | - | modifiedOn | String? | yes | | - | logo | String? | yes | | - | modifiedBy | [UserSerializer](#UserSerializer)? | yes | | - | isActive | Bool? | yes | | - | uid | Int? | yes | | - | synonyms | [String]? | yes | | - | name | String? | yes | | - ---- - - - - - #### [DepartmentsResponse](#DepartmentsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[GetDepartment](#GetDepartment)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [DepartmentErrorResponse](#DepartmentErrorResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - | code | String? | yes | | - | meta | [String: Any]? | yes | | - | status | Int? | yes | | - | errors | [String: Any]? | yes | | - ---- - - - - - #### [ProductTemplate](#ProductTemplate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | createdBy | [String: Any]? | yes | | - | isPhysical | Bool | no | | - | tag | String? | yes | | - | categories | [String]? | yes | | - | attributes | [String]? | yes | | - | isArchived | Bool? | yes | | - | departments | [String]? | yes | | - | createdOn | String? | yes | | - | slug | String | no | | - | modifiedOn | String? | yes | | - | logo | String? | yes | | - | modifiedBy | [String: Any]? | yes | | - | isActive | Bool? | yes | | - | name | String? | yes | | - ---- - - - - - #### [TemplatesResponse](#TemplatesResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [ProductTemplate](#ProductTemplate)? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [TemplateDetails](#TemplateDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | isPhysical | Bool | no | | - | tag | String? | yes | | - | categories | [String]? | yes | | - | attributes | [String]? | yes | | - | isArchived | Bool? | yes | | - | departments | [String]? | yes | | - | slug | String | no | | - | logo | String? | yes | | - | id | String? | yes | | - | isActive | Bool? | yes | | - | name | String? | yes | | - ---- - - - - - #### [Properties](#Properties) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | shortDescription | [String: Any]? | yes | | - | countryOfOrigin | [String: Any]? | yes | | - | categorySlug | [String: Any]? | yes | | - | noOfBoxes | [String: Any]? | yes | | - | isActive | [String: Any]? | yes | | - | customOrder | [String: Any]? | yes | | - | media | [String: Any]? | yes | | - | command | [String: Any]? | yes | | - | moq | [String: Any]? | yes | | - | highlights | [String: Any]? | yes | | - | productGroupTag | [String: Any]? | yes | | - | sizes | [String: Any]? | yes | | - | teaserTag | [String: Any]? | yes | | - | multiSize | [String: Any]? | yes | | - | description | [String: Any]? | yes | | - | isDependent | [String: Any]? | yes | | - | itemCode | [String: Any]? | yes | | - | sizeGuide | [String: Any]? | yes | | - | currency | [String: Any]? | yes | | - | productPublish | [String: Any]? | yes | | - | name | [String: Any]? | yes | | - | traderType | [String: Any]? | yes | | - | returnConfig | [String: Any]? | yes | | - | brandUid | [String: Any]? | yes | | - | itemType | [String: Any]? | yes | | - | slug | [String: Any]? | yes | | - | trader | [String: Any]? | yes | | - | hsnCode | [String: Any]? | yes | | - | variants | [String: Any]? | yes | | - | tags | [String: Any]? | yes | | - ---- - - - - - #### [GlobalValidation](#GlobalValidation) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | description | String? | yes | | - | type | String? | yes | | - | definitions | [String: Any]? | yes | | - | required | [String]? | yes | | - | properties | [Properties](#Properties)? | yes | | - | title | String? | yes | | - ---- - - - - - #### [TemplateValidationData](#TemplateValidationData) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | templateValidation | [String: Any]? | yes | | - | globalValidation | [GlobalValidation](#GlobalValidation)? | yes | | - ---- - - - - - #### [TemplatesValidationResponse](#TemplatesValidationResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | templateDetails | [TemplateDetails](#TemplateDetails)? | yes | | - | data | [TemplateValidationData](#TemplateValidationData)? | yes | | - ---- - - - - - #### [InventoryValidationResponse](#InventoryValidationResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - | data | [String: Any]? | yes | | - ---- - - - - - #### [HSNData](#HSNData) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | countryOfOrigin | [String]? | yes | | - | hsnCode | [String]? | yes | | - ---- - - - - - #### [HSNCodesResponse](#HSNCodesResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - | data | [HSNData](#HSNData)? | yes | | - ---- - - - - - #### [VerifiedBy](#VerifiedBy) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | username | String? | yes | | - | userId | String? | yes | | - ---- - - - - - #### [ProductDownloadItemsData](#ProductDownloadItemsData) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | templates | [String]? | yes | | - | brand | [String]? | yes | | - | type | String? | yes | | - ---- - - - - - #### [ProductDownloadsItems](#ProductDownloadsItems) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdBy | [VerifiedBy](#VerifiedBy)? | yes | | - | url | String? | yes | | - | sellerId | Double? | yes | | - | templateTags | [String: Any]? | yes | | - | id | String? | yes | | - | status | String? | yes | | - | triggerOn | String? | yes | | - | completedOn | String? | yes | | - | data | [ProductDownloadItemsData](#ProductDownloadItemsData)? | yes | | - | taskId | String? | yes | | - ---- - - - - - #### [ProductDownloadsResponse](#ProductDownloadsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [ProductDownloadsItems](#ProductDownloadsItems)? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [ProductConfigurationDownloads](#ProductConfigurationDownloads) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | data | [[String: Any]]? | yes | | - | multivalue | Bool? | yes | | - ---- - - - - - #### [Hierarchy](#Hierarchy) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | l2 | Int | no | | - | l1 | Int | no | | - | department | Int | no | | - ---- - - - - - #### [CategoryMappingValues](#CategoryMappingValues) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | catalogId | Int? | yes | | - | name | String | no | | - ---- - - - - - #### [CategoryMapping](#CategoryMapping) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | facebook | [CategoryMappingValues](#CategoryMappingValues)? | yes | | - | google | [CategoryMappingValues](#CategoryMappingValues)? | yes | | - | ajio | [CategoryMappingValues](#CategoryMappingValues)? | yes | | - ---- - - - - - #### [Media2](#Media2) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | logo | String | no | | - | landscape | String | no | | - | portrait | String | no | | - ---- - - - - - #### [CategoryRequestBody](#CategoryRequestBody) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | hierarchy | [[Hierarchy](#Hierarchy)]? | yes | | - | priority | Int? | yes | | - | departments | [Int] | no | | - | level | Int | no | | - | marketplaces | [CategoryMapping](#CategoryMapping)? | yes | | - | slug | String? | yes | | - | tryouts | [String]? | yes | | - | isActive | Bool | no | | - | synonyms | [String]? | yes | | - | media | [Media2](#Media2)? | yes | | - | name | String | no | | - ---- - - - - - #### [CategoryCreateResponse](#CategoryCreateResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uid | Int? | yes | | - | message | String? | yes | | - ---- - - - - - #### [Category](#Category) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdBy | [String: Any]? | yes | | - | hierarchy | [[Hierarchy](#Hierarchy)]? | yes | | - | priority | Int? | yes | | - | departments | [Int] | no | | - | createdOn | String? | yes | | - | level | Int | no | | - | marketplaces | [CategoryMapping](#CategoryMapping)? | yes | | - | slug | String? | yes | | - | modifiedOn | String? | yes | | - | tryouts | [String]? | yes | | - | isActive | Bool | no | | - | modifiedBy | [String: Any]? | yes | | - | uid | Int? | yes | | - | synonyms | [String]? | yes | | - | media | [Media2](#Media2)? | yes | | - | name | String | no | | - | id | String? | yes | | - ---- - - - - - #### [CategoryResponse](#CategoryResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Category](#Category)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [CategoryUpdateResponse](#CategoryUpdateResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool? | yes | | - | message | String? | yes | | - ---- - - - - - #### [SingleCategoryResponse](#SingleCategoryResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | data | [Category](#Category)? | yes | | - ---- - - - - - #### [CustomOrder](#CustomOrder) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | manufacturingTimeUnit | String? | yes | | - | isCustomOrder | Bool? | yes | | - | manufacturingTime | Int? | yes | | - ---- - - - - - #### [OrderQuantity](#OrderQuantity) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | minimum | Int? | yes | | - | isSet | Bool? | yes | | - | maximum | Int? | yes | | - ---- - - - - - #### [TeaserTag](#TeaserTag) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | url | String? | yes | | - | tag | String? | yes | | - ---- - - - - - #### [ProductPublish](#ProductPublish) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | productOnlineDate | String? | yes | | - | isSet | Bool? | yes | | - ---- - - - - - #### [ReturnConfig](#ReturnConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | unit | String? | yes | | - | time | Int? | yes | | - | returnable | Bool? | yes | | - ---- - - - - - #### [Trader](#Trader) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | address | String | no | | - | name | String | no | | - ---- - - - - - #### [ProductCreateUpdate](#ProductCreateUpdate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | shortDescription | String? | yes | | - | isImageLessProduct | Bool? | yes | | - | companyId | Int | no | | - | countryOfOrigin | String | no | | - | changeRequestId | String? | yes | | - | templateTag | String | no | | - | categorySlug | String | no | | - | noOfBoxes | Int? | yes | | - | isActive | Bool? | yes | | - | customOrder | [CustomOrder](#CustomOrder)? | yes | | - | media | [[Media1](#Media1)]? | yes | | - | isSet | Bool? | yes | | - | moq | [OrderQuantity](#OrderQuantity)? | yes | | - | highlights | [String]? | yes | | - | productGroupTag | [String]? | yes | | - | departments | [Int] | no | | - | teaserTag | [TeaserTag](#TeaserTag)? | yes | | - | multiSize | Bool? | yes | | - | customJson | [String: Any]? | yes | | - | requester | String? | yes | | - | description | String? | yes | | - | isDependent | Bool? | yes | | - | itemCode | String | no | | - | sizeGuide | String? | yes | | - | currency | String | no | | - | productPublish | [ProductPublish](#ProductPublish)? | yes | | - | uid | Int? | yes | | - | name | String | no | | - | brandUid | Int | no | | - | traderType | String? | yes | | - | returnConfig | [ReturnConfig](#ReturnConfig)? | yes | | - | itemType | String | no | | - | slug | String | no | | - | trader | [Trader](#Trader)? | yes | | - | hsnCode | String | no | | - | variants | [String: Any]? | yes | | - | tags | [String]? | yes | | - ---- - - - - - #### [Image](#Image) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | url | String? | yes | | - | secureUrl | String? | yes | | - | aspectRatioF | Double? | yes | | - | aspectRatio | String? | yes | | - ---- - - - - - #### [Logo](#Logo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | url | String? | yes | | - | secureUrl | String? | yes | | - | aspectRatioF | Int? | yes | | - | aspectRatio | String? | yes | | - ---- - - - - - #### [Brand](#Brand) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uid | Int? | yes | | - | logo | [Logo](#Logo)? | yes | | - | name | String? | yes | | - ---- - - - - - #### [ProductPublished](#ProductPublished) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | productOnlineDate | Int? | yes | | - | isSet | Bool? | yes | | - ---- - - - - - #### [Product](#Product) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | shortDescription | String? | yes | | - | images | [[Image](#Image)]? | yes | | - | countryOfOrigin | String? | yes | | - | color | String? | yes | | - | primaryColor | String? | yes | | - | templateTag | String? | yes | | - | categorySlug | String? | yes | | - | isActive | Bool? | yes | | - | customOrder | [String: Any]? | yes | | - | media | [[Media1](#Media1)]? | yes | | - | isSet | Bool? | yes | | - | brand | [Brand](#Brand)? | yes | | - | moq | [String: Any]? | yes | | - | highlights | [String]? | yes | | - | allSizes | [[String: Any]]? | yes | | - | departments | [Int]? | yes | | - | sizes | [[String: Any]]? | yes | | - | id | String? | yes | | - | multiSize | Bool? | yes | | - | l3Mapping | [String]? | yes | | - | customJson | [String: Any]? | yes | | - | description | String? | yes | | - | isPhysical | Bool? | yes | | - | categoryUid | Int? | yes | | - | isDependent | Bool? | yes | | - | itemCode | String? | yes | | - | sizeGuide | String? | yes | | - | currency | String? | yes | | - | productPublish | [ProductPublished](#ProductPublished)? | yes | | - | imageNature | String? | yes | | - | uid | Int? | yes | | - | name | String? | yes | | - | brandUid | Int? | yes | | - | itemType | String? | yes | | - | slug | String? | yes | | - | hsnCode | String? | yes | | - | variants | [String: Any]? | yes | | - ---- - - - - - #### [ProductListingResponse](#ProductListingResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Product](#Product)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [ValidateProduct](#ValidateProduct) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | valid | Bool? | yes | | - ---- - - - - - #### [UserInfo1](#UserInfo1) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uid | String? | yes | | - | email | String? | yes | | - | username | String? | yes | | - | userId | String? | yes | | - ---- - - - - - #### [BulkJob](#BulkJob) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdBy | [UserInfo1](#UserInfo1)? | yes | | - | stage | String? | yes | | - | failedRecords | [[String: Any]]? | yes | | - | failed | Int? | yes | | - | companyId | Int | no | | - | createdOn | String | no | | - | templateTag | String? | yes | | - | modifiedOn | String? | yes | | - | customTemplateTag | String? | yes | | - | cancelled | Int? | yes | | - | modifiedBy | [UserInfo1](#UserInfo1)? | yes | | - | isActive | Bool? | yes | | - | cancelledRecords | [[String: Any]]? | yes | | - | succeed | Int? | yes | | - | filePath | String? | yes | | - | total | Int | no | | - | trackingUrl | String? | yes | | - ---- - - - - - #### [UserDetail](#UserDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | username | String? | yes | | - | fullName | String? | yes | | - | userId | String? | yes | | - ---- - - - - - #### [ProductBulkRequest](#ProductBulkRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdBy | [UserDetail](#UserDetail)? | yes | | - | stage | String? | yes | | - | failedRecords | [String]? | yes | | - | failed | Int? | yes | | - | companyId | Int? | yes | | - | template | [ProductTemplate](#ProductTemplate)? | yes | | - | createdOn | String? | yes | | - | templateTag | String? | yes | | - | modifiedOn | String? | yes | | - | cancelled | Int? | yes | | - | modifiedBy | [UserDetail](#UserDetail)? | yes | | - | isActive | Bool? | yes | | - | cancelledRecords | [String]? | yes | | - | succeed | Int? | yes | | - | filePath | String? | yes | | - | total | Int? | yes | | - ---- - - - - - #### [ProductBulkRequestList](#ProductBulkRequestList) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [ProductBulkRequest](#ProductBulkRequest)? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [BulkProductRequest](#BulkProductRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | companyId | Int | no | | - | data | [[String: Any]] | no | | - | batchId | String | no | | - | templateTag | String | no | | - ---- - - - - - #### [NestedTags](#NestedTags) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | tags | [String]? | yes | | - ---- - - - - - #### [ProductTagsViewResponse](#ProductTagsViewResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [NestedTags](#NestedTags)? | yes | | - ---- - - - - - #### [ProductBulkAssets](#ProductBulkAssets) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | companyId | Int? | yes | | - | url | String | no | | - | user | [String: Any] | no | | - ---- - - - - - #### [UserCommon](#UserCommon) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | username | String? | yes | | - | companyId | Int? | yes | | - | userId | String? | yes | | - ---- - - - - - #### [Items](#Items) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdBy | [UserCommon](#UserCommon)? | yes | | - | stage | String? | yes | | - | failedRecords | [String]? | yes | | - | failed | Int? | yes | | - | companyId | Int? | yes | | - | createdOn | String? | yes | | - | total | Int? | yes | | - | modifiedOn | String? | yes | | - | cancelled | Int? | yes | | - | retry | Int? | yes | | - | modifiedBy | [UserCommon](#UserCommon)? | yes | | - | isActive | Bool? | yes | | - | cancelledRecords | [String]? | yes | | - | id | String? | yes | | - | filePath | String? | yes | | - | succeed | Int? | yes | | - | trackingUrl | String? | yes | | - ---- - - - - - #### [BulkAssetResponse](#BulkAssetResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Items](#Items)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [ProductSizeDeleteDataResponse](#ProductSizeDeleteDataResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | size | String? | yes | | - | itemId | Int? | yes | | - | companyId | Int? | yes | | - ---- - - - - - #### [ProductSizeDeleteResponse](#ProductSizeDeleteResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool? | yes | | - | data | [ProductSizeDeleteDataResponse](#ProductSizeDeleteDataResponse)? | yes | | - ---- - - - - - #### [ItemQuery](#ItemQuery) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uid | Int? | yes | | - | itemCode | String? | yes | | - | brandUid | Int? | yes | | - ---- - - - - - #### [GTIN](#GTIN) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | gtinType | String | no | | - | primary | Bool? | yes | | - | gtinValue | String | no | | - ---- - - - - - #### [SetSize](#SetSize) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | size | String | no | | - | pieces | Int | no | | - ---- - - - - - #### [SizeDistribution](#SizeDistribution) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | sizes | [[SetSize](#SetSize)] | no | | - ---- - - - - - #### [InventorySet](#InventorySet) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | sizeDistribution | [SizeDistribution](#SizeDistribution) | no | | - | quantity | Int? | yes | | - ---- - - - - - #### [InvSize](#InvSize) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | itemHeight | Double? | yes | | - | itemWeightUnitOfMeasure | String? | yes | | - | storeCode | String | no | | - | quantity | Int | no | | - | itemWeight | Double? | yes | | - | identifiers | [[GTIN](#GTIN)] | no | | - | itemLength | Double? | yes | | - | currency | String | no | | - | priceEffective | Double | no | | - | itemDimensionsUnitOfMeasure | String? | yes | | - | price | Double | no | | - | priceTransfer | Double? | yes | | - | size | String | no | | - | isSet | Bool? | yes | | - | set | [InventorySet](#InventorySet)? | yes | | - | itemWidth | Double? | yes | | - ---- - - - - - #### [InventoryRequest](#InventoryRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | companyId | Int | no | | - | item | [ItemQuery](#ItemQuery) | no | | - | sizes | [[InvSize](#InvSize)] | no | | - ---- - - - - - #### [InventoryResponse](#InventoryResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | store | [String: Any]? | yes | | - | quantity | Int? | yes | | - | sellerIdentifier | Int? | yes | | - | identifiers | [String: Any]? | yes | | - | currency | String? | yes | | - | itemId | Int? | yes | | - | priceEffective | Int? | yes | | - | sellableQuantity | Int? | yes | | - | priceTransfer | Int? | yes | | - | uid | String? | yes | | - | size | String? | yes | | - | inventoryUpdatedOn | String? | yes | | - | price | Int? | yes | | - ---- - - - - - #### [InventoryDeleteData](#InventoryDeleteData) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | locationId | Int? | yes | | - | size | String? | yes | | - | itemId | Int? | yes | | - ---- - - - - - #### [InventoryDelete](#InventoryDelete) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool? | yes | | - | data | [InventoryDeleteData](#InventoryDeleteData)? | yes | | - ---- - - - - - #### [CommonResponse](#CommonResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | String? | yes | | - ---- - - - - - #### [BulkInventoryGetItems](#BulkInventoryGetItems) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdBy | [String: Any]? | yes | | - | stage | String? | yes | | - | failedRecords | [String]? | yes | | - | failed | Int? | yes | | - | companyId | Int? | yes | | - | createdOn | String? | yes | | - | total | Int? | yes | | - | modifiedOn | String? | yes | | - | cancelled | Int? | yes | | - | id | String? | yes | | - | modifiedBy | [String: Any]? | yes | | - | isActive | Bool? | yes | | - | cancelledRecords | [String]? | yes | | - | filePath | String? | yes | | - | succeed | Int? | yes | | - ---- - - - - - #### [BulkInventoryGet](#BulkInventoryGet) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[BulkInventoryGetItems](#BulkInventoryGetItems)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [Size1](#Size1) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | itemHeight | Double? | yes | | - | itemWeightUnitOfMeasure | String? | yes | | - | storeCode | String | no | | - | quantity | Int | no | | - | sellerIdentifier | String | no | | - | itemWeight | Double? | yes | | - | identifiers | [[String: Any]]? | yes | | - | itemLength | Double? | yes | | - | currency | String | no | | - | priceEffective | Double | no | | - | itemDimensionsUnitOfMeasure | String? | yes | | - | price | Double | no | | - | priceTransfer | Double? | yes | | - | size | String? | yes | | - | isSet | Bool? | yes | | - | set | [InventorySet](#InventorySet)? | yes | | - | itemWidth | Double? | yes | | - ---- - - - - - #### [InventoryBulkRequest](#InventoryBulkRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | companyId | Int | no | | - | batchId | String | no | | - | user | [String: Any]? | yes | | - | sizes | [[Size1](#Size1)] | no | | - ---- - - - - - #### [InventoryExportRequest](#InventoryExportRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | store | [Int]? | yes | | - | brand | [Int]? | yes | | - | type | String? | yes | | - ---- - - - - - #### [InventoryExportJob](#InventoryExportJob) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | url | String? | yes | | - | sellerId | Int | no | | - | status | String? | yes | | - | triggerOn | String? | yes | | - | requestParams | [String: Any]? | yes | | - | completedOn | String? | yes | | - | taskId | String | no | | - ---- - - - - - #### [FilerList](#FilerList) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - | value | String? | yes | | - ---- - - - - - #### [InventoryConfig](#InventoryConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | multivalues | Bool? | yes | | - | data | [[FilerList](#FilerList)]? | yes | | - ---- - - - - - #### [HsnUpsert](#HsnUpsert) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | tax2 | Double? | yes | | - | taxOnMrp | Bool | no | | - | companyId | Int | no | | - | threshold2 | Double? | yes | | - | threshold1 | Double | no | | - | hs2Code | String | no | | - | uid | Int? | yes | | - | hsnCode | String | no | | - | taxOnEsp | Bool? | yes | | - | tax1 | Double | no | | - ---- - - - - - #### [HsnCodesObject](#HsnCodesObject) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | tax2 | Double? | yes | | - | taxOnMrp | Bool? | yes | | - | companyId | Int? | yes | | - | threshold2 | Double? | yes | | - | threshold1 | Double? | yes | | - | modifiedOn | String? | yes | | - | hs2Code | String? | yes | | - | id | String? | yes | | - | hsnCode | String? | yes | | - | taxOnEsp | Bool? | yes | | - | tax1 | Double? | yes | | - ---- - - - - - #### [HsnCode](#HsnCode) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | data | [HsnCodesObject](#HsnCodesObject)? | yes | | - ---- - - - - - #### [PageResponse](#PageResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | current | String? | yes | | - | itemTotal | Int? | yes | | - | hasNext | Bool? | yes | | - | size | Int? | yes | | - | hasPrevious | Bool? | yes | | - ---- - - - - - #### [HsnCodesListingResponse](#HsnCodesListingResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[HsnCodesObject](#HsnCodesObject)]? | yes | | - | page | [PageResponse](#PageResponse)? | yes | | - ---- - - - - - #### [BulkHsnUpsert](#BulkHsnUpsert) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | data | [[HsnUpsert](#HsnUpsert)] | no | | - ---- - - - - - #### [BulkHsnResponse](#BulkHsnResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool? | yes | | - ---- - - - - - #### [BrandItem](#BrandItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | banners | [ImageUrls](#ImageUrls)? | yes | | - | departments | [String]? | yes | | - | action | [ProductListingAction](#ProductListingAction)? | yes | | - | slug | String? | yes | | - | logo | [Media](#Media)? | yes | | - | discount | String? | yes | | - | uid | Int? | yes | | - | name | String? | yes | | - ---- - - - - - #### [BrandListingResponse](#BrandListingResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[BrandItem](#BrandItem)]? | yes | | - | page | [Page](#Page) | no | | - ---- - - - - - #### [Department](#Department) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | priorityOrder | Int? | yes | | - | slug | String? | yes | | - | logo | [Media](#Media)? | yes | | - | uid | Int? | yes | | - | name | String? | yes | | - ---- - - - - - #### [DepartmentResponse](#DepartmentResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Department](#Department)]? | yes | | - ---- - - - - - #### [DepartmentIdentifier](#DepartmentIdentifier) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uid | Int? | yes | | - | slug | String? | yes | | - ---- - - - - - #### [ThirdLevelChild](#ThirdLevelChild) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | banners | [ImageUrls](#ImageUrls)? | yes | | - | childs | [[String: Any]]? | yes | | - | action | [ProductListingAction](#ProductListingAction)? | yes | | - | slug | String? | yes | | - | uid | Int? | yes | | - | customJson | [String: Any]? | yes | | - | name | String? | yes | | - ---- - - - - - #### [SecondLevelChild](#SecondLevelChild) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | banners | [ImageUrls](#ImageUrls)? | yes | | - | childs | [[ThirdLevelChild](#ThirdLevelChild)]? | yes | | - | action | [ProductListingAction](#ProductListingAction)? | yes | | - | slug | String? | yes | | - | uid | Int? | yes | | - | customJson | [String: Any]? | yes | | - | name | String? | yes | | - ---- - - - - - #### [Child](#Child) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | banners | [ImageUrls](#ImageUrls)? | yes | | - | childs | [[SecondLevelChild](#SecondLevelChild)]? | yes | | - | action | [ProductListingAction](#ProductListingAction)? | yes | | - | slug | String? | yes | | - | uid | Int? | yes | | - | customJson | [String: Any]? | yes | | - | name | String? | yes | | - ---- - - - - - #### [CategoryItems](#CategoryItems) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | banners | [ImageUrls](#ImageUrls)? | yes | | - | childs | [[Child](#Child)]? | yes | | - | action | [ProductListingAction](#ProductListingAction)? | yes | | - | slug | String? | yes | | - | uid | Int? | yes | | - | name | String? | yes | | - ---- - - - - - #### [DepartmentCategoryTree](#DepartmentCategoryTree) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[CategoryItems](#CategoryItems)]? | yes | | - | department | String? | yes | | - ---- - - - - - #### [CategoryListingResponse](#CategoryListingResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | departments | [[DepartmentIdentifier](#DepartmentIdentifier)]? | yes | | - | data | [[DepartmentCategoryTree](#DepartmentCategoryTree)]? | yes | | - ---- - - - - - #### [ApplicationProductListingResponse](#ApplicationProductListingResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[ProductListingDetail](#ProductListingDetail)]? | yes | | - | sortOn | [[ProductSortOn](#ProductSortOn)]? | yes | | - | page | [Page](#Page) | no | | - | filters | [[ProductFilters](#ProductFilters)]? | yes | | - ---- - - - - - #### [ProductDetail](#ProductDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | shortDescription | String? | yes | | - | attributes | [String: Any]? | yes | | - | hasVariant | Bool? | yes | | - | color | String? | yes | | - | promoMeta | [String: Any]? | yes | | - | productOnlineDate | String? | yes | | - | brand | [ProductBrand](#ProductBrand)? | yes | | - | highlights | [String]? | yes | | - | groupedAttributes | [[ProductDetailGroupedAttribute](#ProductDetailGroupedAttribute)]? | yes | | - | teaserTag | [String: Any]? | yes | | - | description | String? | yes | | - | similars | [String]? | yes | | - | itemCode | String? | yes | | - | medias | [[Media1](#Media1)]? | yes | | - | tryouts | [String]? | yes | | - | imageNature | String? | yes | | - | uid | Int? | yes | | - | ratingCount | Int? | yes | | - | name | String? | yes | | - | type | String? | yes | | - | itemType | String? | yes | | - | slug | String | no | | - | rating | Double? | yes | | - ---- - - - - - - - #### [BusinessCountryInfo](#BusinessCountryInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | countryCode | String? | yes | | - | country | String? | yes | | - ---- - - - - - #### [Website](#Website) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | url | String? | yes | | - ---- - - - - - #### [BusinessDetails](#BusinessDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | website | [Website](#Website)? | yes | | - ---- - - - - - #### [GetAddressSerializer](#GetAddressSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | countryCode | String? | yes | | - | landmark | String? | yes | | - | country | String? | yes | | - | latitude | Double? | yes | | - | longitude | Double? | yes | | - | state | String? | yes | | - | addressType | String? | yes | | - | address1 | String? | yes | | - | city | String? | yes | | - | pincode | Int? | yes | | - | address2 | String? | yes | | - ---- - - - - - #### [Document](#Document) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | legalName | String? | yes | | - | url | String? | yes | | - | verified | Bool? | yes | | - | value | String | no | | - | type | String | no | | - ---- - - - - - #### [SellerPhoneNumber](#SellerPhoneNumber) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | number | String | no | | - | countryCode | Int | no | | - ---- - - - - - #### [ContactDetails](#ContactDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | phone | [[SellerPhoneNumber](#SellerPhoneNumber)]? | yes | | - | emails | [String]? | yes | | - ---- - - - - - #### [GetCompanyProfileSerializerResponse](#GetCompanyProfileSerializerResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | modifiedOn | String? | yes | | - | createdOn | String? | yes | | - | businessInfo | String? | yes | | - | name | String? | yes | | - | verifiedBy | [UserSerializer](#UserSerializer)? | yes | | - | businessCountryInfo | [BusinessCountryInfo](#BusinessCountryInfo)? | yes | | - | createdBy | [UserSerializer](#UserSerializer)? | yes | | - | uid | Int | no | | - | warnings | [String: Any]? | yes | | - | verifiedOn | String? | yes | | - | modifiedBy | [UserSerializer](#UserSerializer)? | yes | | - | businessDetails | [BusinessDetails](#BusinessDetails)? | yes | | - | mode | String? | yes | | - | addresses | [[GetAddressSerializer](#GetAddressSerializer)]? | yes | | - | businessType | String | no | | - | documents | [[Document](#Document)]? | yes | | - | contactDetails | [ContactDetails](#ContactDetails)? | yes | | - | franchiseEnabled | Bool? | yes | | - | companyType | String | no | | - | notificationEmails | [String]? | yes | | - | stage | String? | yes | | - ---- - - - - - #### [CreateUpdateAddressSerializer](#CreateUpdateAddressSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | countryCode | String? | yes | | - | landmark | String? | yes | | - | country | String | no | | - | latitude | Double | no | | - | longitude | Double | no | | - | state | String | no | | - | addressType | String | no | | - | address1 | String | no | | - | city | String | no | | - | pincode | Int | no | | - | address2 | String? | yes | | - ---- - - - - - #### [UpdateCompany](#UpdateCompany) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | businessInfo | String? | yes | | - | businessType | String? | yes | | - | contactDetails | [ContactDetails](#ContactDetails)? | yes | | - | documents | [[Document](#Document)]? | yes | | - | name | String? | yes | | - | franchiseEnabled | Bool? | yes | | - | companyType | String? | yes | | - | notificationEmails | [String]? | yes | | - | businessDetails | [BusinessDetails](#BusinessDetails)? | yes | | - | addresses | [[CreateUpdateAddressSerializer](#CreateUpdateAddressSerializer)]? | yes | | - | warnings | [String: Any]? | yes | | - | rejectReason | String? | yes | | - ---- - - - - - #### [DocumentsObj](#DocumentsObj) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pending | Int? | yes | | - | verified | Int? | yes | | - ---- - - - - - #### [MetricsSerializer](#MetricsSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | stage | String? | yes | | - | product | [DocumentsObj](#DocumentsObj)? | yes | | - | brand | [DocumentsObj](#DocumentsObj)? | yes | | - | companyDocuments | [DocumentsObj](#DocumentsObj)? | yes | | - | uid | Int? | yes | | - | store | [DocumentsObj](#DocumentsObj)? | yes | | - | storeDocuments | [DocumentsObj](#DocumentsObj)? | yes | | - ---- - - - - - #### [BrandBannerSerializer](#BrandBannerSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | landscape | String? | yes | | - | portrait | String? | yes | | - ---- - - - - - #### [UserSerializer1](#UserSerializer1) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | contact | String? | yes | | - | userId | String? | yes | | - | username | String? | yes | | - ---- - - - - - #### [GetBrandResponseSerializer](#GetBrandResponseSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | modifiedOn | String? | yes | | - | createdOn | String? | yes | | - | banner | [BrandBannerSerializer](#BrandBannerSerializer)? | yes | | - | stage | String? | yes | | - | name | String | no | | - | createdBy | [UserSerializer1](#UserSerializer1)? | yes | | - | uid | Int? | yes | | - | localeLanguage | [String: Any]? | yes | | - | customJson | [String: Any]? | yes | | - | logo | String? | yes | | - | description | String? | yes | | - | synonyms | [String]? | yes | | - | verifiedBy | [UserSerializer1](#UserSerializer1)? | yes | | - | warnings | [String: Any]? | yes | | - | verifiedOn | String? | yes | | - | modifiedBy | [UserSerializer1](#UserSerializer1)? | yes | | - | slugKey | String? | yes | | - | rejectReason | String? | yes | | - ---- - - - - - #### [CreateUpdateBrandRequestSerializer](#CreateUpdateBrandRequestSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | banner | [BrandBannerSerializer](#BrandBannerSerializer)? | yes | | - | name | String | no | | - | brandTier | String? | yes | | - | localeLanguage | [String: Any]? | yes | | - | companyId | Int? | yes | | - | customJson | [String: Any]? | yes | | - | logo | String | no | | - | description | String? | yes | | - | uid | Int? | yes | | - | synonyms | [String]? | yes | | - ---- - - - - - #### [GetCompanySerializer](#GetCompanySerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | modifiedOn | String? | yes | | - | createdOn | String? | yes | | - | businessType | String? | yes | | - | stage | String? | yes | | - | addresses | [[GetAddressSerializer](#GetAddressSerializer)]? | yes | | - | name | String? | yes | | - | createdBy | [UserSerializer](#UserSerializer)? | yes | | - | uid | Int? | yes | | - | companyType | String? | yes | | - | verifiedBy | [UserSerializer](#UserSerializer)? | yes | | - | verifiedOn | String? | yes | | - | modifiedBy | [UserSerializer](#UserSerializer)? | yes | | - | rejectReason | String? | yes | | - ---- - - - - - #### [CompanyBrandSerializer](#CompanyBrandSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | modifiedOn | String? | yes | | - | createdOn | String? | yes | | - | stage | String? | yes | | - | createdBy | [UserSerializer1](#UserSerializer1)? | yes | | - | uid | Int? | yes | | - | brand | [GetBrandResponseSerializer](#GetBrandResponseSerializer)? | yes | | - | verifiedBy | [UserSerializer1](#UserSerializer1)? | yes | | - | warnings | [String: Any]? | yes | | - | verifiedOn | String? | yes | | - | company | [GetCompanySerializer](#GetCompanySerializer)? | yes | | - | modifiedBy | [UserSerializer1](#UserSerializer1)? | yes | | - | rejectReason | String? | yes | | - ---- - - - - - #### [CompanyBrandListSerializer](#CompanyBrandListSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | page | [Page](#Page)? | yes | | - | items | [[CompanyBrandSerializer](#CompanyBrandSerializer)]? | yes | | - ---- - - - - - #### [CompanyBrandPostRequestSerializer](#CompanyBrandPostRequestSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | brands | [Int] | no | | - | company | Int | no | | - | uid | Int? | yes | | - ---- - - - - - #### [LocationIntegrationType](#LocationIntegrationType) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | inventory | String? | yes | | - | order | String? | yes | | - ---- - - - - - #### [LocationManagerSerializer](#LocationManagerSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | mobileNo | [SellerPhoneNumber](#SellerPhoneNumber) | no | | - | email | String? | yes | | - | name | String? | yes | | - ---- - - - - - #### [InvoiceCredSerializer](#InvoiceCredSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | password | String? | yes | | - | enabled | Bool? | yes | | - | username | String? | yes | | - ---- - - - - - #### [InvoiceDetailsSerializer](#InvoiceDetailsSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | eWaybill | [InvoiceCredSerializer](#InvoiceCredSerializer)? | yes | | - | eInvoice | [InvoiceCredSerializer](#InvoiceCredSerializer)? | yes | | - ---- - - - - - #### [ProductReturnConfigSerializer](#ProductReturnConfigSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | storeUid | Int? | yes | | - | onSameStore | Bool? | yes | | - ---- - - - - - #### [LocationTimingSerializer](#LocationTimingSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | minute | Int? | yes | | - | hour | Int? | yes | | - ---- - - - - - #### [LocationDayWiseSerializer](#LocationDayWiseSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | open | Bool | no | | - | closing | [LocationTimingSerializer](#LocationTimingSerializer)? | yes | | - | opening | [LocationTimingSerializer](#LocationTimingSerializer)? | yes | | - | weekday | String | no | | - ---- - - - - - #### [GetLocationSerializer](#GetLocationSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | modifiedOn | String? | yes | | - | createdOn | String? | yes | | - | name | String | no | | - | verifiedBy | [UserSerializer1](#UserSerializer1)? | yes | | - | address | [GetAddressSerializer](#GetAddressSerializer) | no | | - | displayName | String | no | | - | contactNumbers | [[SellerPhoneNumber](#SellerPhoneNumber)]? | yes | | - | createdBy | [UserSerializer1](#UserSerializer1)? | yes | | - | uid | Int? | yes | | - | warnings | [String: Any]? | yes | | - | verifiedOn | String? | yes | | - | modifiedBy | [UserSerializer1](#UserSerializer1)? | yes | | - | code | String | no | | - | integrationType | [LocationIntegrationType](#LocationIntegrationType)? | yes | | - | customJson | [String: Any]? | yes | | - | manager | [LocationManagerSerializer](#LocationManagerSerializer)? | yes | | - | gstCredentials | [InvoiceDetailsSerializer](#InvoiceDetailsSerializer)? | yes | | - | storeType | String? | yes | | - | documents | [[Document](#Document)]? | yes | | - | productReturnConfig | [ProductReturnConfigSerializer](#ProductReturnConfigSerializer)? | yes | | - | phoneNumber | String | no | | - | notificationEmails | [String]? | yes | | - | company | [GetCompanySerializer](#GetCompanySerializer)? | yes | | - | stage | String? | yes | | - | timing | [[LocationDayWiseSerializer](#LocationDayWiseSerializer)]? | yes | | - ---- - - - - - #### [LocationListSerializer](#LocationListSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | page | [Page](#Page)? | yes | | - | items | [[GetLocationSerializer](#GetLocationSerializer)]? | yes | | - ---- - - - - - #### [GetAddressSerializer1](#GetAddressSerializer1) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | countryCode | String? | yes | | - | landmark | String? | yes | | - | country | String? | yes | | - | latitude | Double? | yes | | - | longitude | Double? | yes | | - | state | String? | yes | | - | addressType | String? | yes | | - | address1 | String? | yes | | - | city | String? | yes | | - | pincode | Int? | yes | | - | address2 | String? | yes | | - ---- - - - - - #### [LocationSerializer](#LocationSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | contactNumbers | [[SellerPhoneNumber](#SellerPhoneNumber)]? | yes | | - | documents | [[Document](#Document)]? | yes | | - | productReturnConfig | [ProductReturnConfigSerializer](#ProductReturnConfigSerializer)? | yes | | - | name | String | no | | - | code | String | no | | - | address | [GetAddressSerializer1](#GetAddressSerializer1) | no | | - | storeType | String? | yes | | - | customJson | [String: Any]? | yes | | - | manager | [LocationManagerSerializer](#LocationManagerSerializer)? | yes | | - | notificationEmails | [String]? | yes | | - | uid | Int? | yes | | - | warnings | [String: Any]? | yes | | - | gstCredentials | [InvoiceDetailsSerializer](#InvoiceDetailsSerializer)? | yes | | - | company | Int | no | | - | stage | String? | yes | | - | displayName | String | no | | - | timing | [[LocationDayWiseSerializer](#LocationDayWiseSerializer)]? | yes | | - ---- - - - - - #### [BulkLocationSerializer](#BulkLocationSerializer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | data | [[LocationSerializer](#LocationSerializer)]? | yes | | - ---- - - - - - - - #### [FailedResponse](#FailedResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String | no | | - ---- - - - - - #### [CDN](#CDN) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | url | String | no | | - ---- - - - - - #### [Upload](#Upload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | expiry | Int | no | | - | url | String | no | | - ---- - - - - - #### [StartResponse](#StartResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | fileName | String | no | | - | filePath | String | no | | - | contentType | String | no | | - | method | String | no | | - | namespace | String | no | | - | operation | String | no | | - | size | Int | no | | - | upload | [Upload](#Upload) | no | | - | cdn | [CDN](#CDN) | no | | - | tags | [String]? | yes | | - ---- - - - - - #### [StartRequest](#StartRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | fileName | String | no | | - | contentType | String | no | | - | size | Int | no | | - | tags | [String]? | yes | | - | params | [String: Any]? | yes | | - ---- - - - - - #### [CompleteResponse](#CompleteResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String | no | | - | fileName | String | no | | - | filePath | String | no | | - | contentType | String | no | | - | method | String | no | | - | namespace | String | no | | - | operation | String | no | | - | size | Int | no | | - | upload | [Upload](#Upload) | no | | - | cdn | [CDN](#CDN) | no | | - | success | String | no | | - | tags | [String]? | yes | | - | createdOn | String | no | | - | modifiedOn | String | no | | - ---- - - - - - #### [Opts](#Opts) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | attempts | Int? | yes | | - | timestamp | Int? | yes | | - | delay | Int? | yes | | - ---- - - - - - #### [CopyFileTask](#CopyFileTask) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String | no | | - | name | String | no | | - | data | [BulkRequest](#BulkRequest) | no | | - | opts | [Opts](#Opts) | no | | - | progress | Int | no | | - | delay | Int | no | | - | timestamp | Int | no | | - | attemptsMade | Int | no | | - | stacktrace | [String]? | yes | | - | finishedOn | Int | no | | - | processedOn | Int | no | | - ---- - - - - - #### [BulkResponse](#BulkResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | trackingUrl | String | no | | - | task | [CopyFileTask](#CopyFileTask) | no | | - ---- - - - - - #### [ReqConfiguration](#ReqConfiguration) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | concurrency | Int? | yes | | - ---- - - - - - #### [Destination](#Destination) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | namespace | String | no | | - | rewrite | String | no | | - | basepath | String? | yes | | - ---- - - - - - #### [BulkRequest](#BulkRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | urls | [String] | no | | - | destination | [Destination](#Destination) | no | | - | configuration | [ReqConfiguration](#ReqConfiguration)? | yes | | - ---- - - - - - #### [Urls](#Urls) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | url | String | no | | - | signedUrl | String | no | | - | expiry | Int | no | | - ---- - - - - - #### [SignUrlResponse](#SignUrlResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | urls | [[Urls](#Urls)] | no | | - ---- - - - - - #### [SignUrlRequest](#SignUrlRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | expiry | Int | no | | - | urls | [String] | no | | - ---- - - - - - #### [DbRecord](#DbRecord) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | | - | tags | [String] | no | | - | id | String | no | | - | fileName | String | no | | - | operation | String? | yes | | - | namespace | String | no | | - | contentType | String | no | | - | filePath | String | no | | - | upload | [Upload](#Upload) | no | | - | cdn | [CDN](#CDN) | no | | - | createdOn | String | no | | - | modifiedOn | String | no | | - ---- - - - - - #### [BrowseResponse](#BrowseResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[DbRecord](#DbRecord)] | no | | - | page | [Page](#Page) | no | | - ---- - - - - - - - #### [RedirectDevice](#RedirectDevice) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | link | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [WebRedirect](#WebRedirect) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | link | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [Redirects](#Redirects) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | ios | [RedirectDevice](#RedirectDevice)? | yes | | - | android | [RedirectDevice](#RedirectDevice)? | yes | | - | web | [WebRedirect](#WebRedirect)? | yes | | - | forceWeb | Bool? | yes | | - ---- - - - - - #### [CampaignShortLink](#CampaignShortLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | source | String? | yes | | - | medium | String? | yes | | - ---- - - - - - #### [Attribution](#Attribution) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | campaignCookieExpiry | String? | yes | | - ---- - - - - - #### [SocialMediaTags](#SocialMediaTags) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | description | String? | yes | | - | image | String? | yes | | - ---- - - - - - #### [ShortLinkReq](#ShortLinkReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String | no | Give a name to the link. | - | url | String | no | The web address to shorten. | - | hash | String? | yes | | - | active | Bool? | yes | | - | expireAt | String? | yes | | - | enableTracking | Bool? | yes | | - | personalized | Bool? | yes | To create personalized short links. | - | campaign | [CampaignShortLink](#CampaignShortLink)? | yes | | - | redirects | [Redirects](#Redirects)? | yes | | - | attribution | [Attribution](#Attribution)? | yes | | - | socialMediaTags | [SocialMediaTags](#SocialMediaTags)? | yes | | - | count | Int? | yes | | - ---- - - - - - #### [UrlInfo](#UrlInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | original | String? | yes | | - | short | String? | yes | | - | hash | String? | yes | | - ---- - - - - - #### [ShortLinkRes](#ShortLinkRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | url | [UrlInfo](#UrlInfo)? | yes | | - | createdBy | String? | yes | | - | appRedirect | Bool? | yes | | - | fallback | String? | yes | | - | active | Bool? | yes | | - | id | String? | yes | | - | enableTracking | Bool? | yes | | - | expireAt | String? | yes | | - | application | String? | yes | | - | userId | String? | yes | | - | createdAt | String? | yes | | - | meta | [String: Any]? | yes | | - | updatedAt | String? | yes | | - | personalized | Bool? | yes | To create personalized short links | - | campaign | [CampaignShortLink](#CampaignShortLink)? | yes | | - | redirects | [Redirects](#Redirects)? | yes | | - | attribution | [Attribution](#Attribution)? | yes | | - | socialMediaTags | [SocialMediaTags](#SocialMediaTags)? | yes | | - | count | Int? | yes | | - ---- - - - - - #### [ShortLinkList](#ShortLinkList) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[ShortLinkRes](#ShortLinkRes)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [ErrorRes](#ErrorRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - - - #### [DataTresholdDTO](#DataTresholdDTO) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | minPrice | Double? | yes | | - | safeStock | Int? | yes | | - | periodThreshold | Int? | yes | | - | periodThresholdType | String? | yes | | - | periodTypeList | [[GenericDTO](#GenericDTO)]? | yes | | - ---- - - - - - #### [GenericDTO](#GenericDTO) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | text | String? | yes | | - | value | [String: Any]? | yes | | - ---- - - - - - #### [JobConfigDTO](#JobConfigDTO) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | integration | String | no | | - | integrationData | [String: Any]? | yes | | - | companyName | String? | yes | | - | companyId | Int | no | | - | taskDetails | [TaskDTO](#TaskDTO)? | yes | | - | thresholdDetails | [DataTresholdDTO](#DataTresholdDTO)? | yes | | - | jobCode | String? | yes | | - | alias | String? | yes | | - ---- - - - - - #### [TaskDTO](#TaskDTO) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | Int? | yes | | - | groupList | [[GenericDTO](#GenericDTO)]? | yes | | - ---- - - - - - #### [ResponseEnvelopeString](#ResponseEnvelopeString) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | timestamp | String? | yes | | - | status | Int? | yes | | - | error | String? | yes | | - | exception | String? | yes | | - | message | String? | yes | | - | totalTimeTakenInMillis | Int? | yes | | - | httpStatus | String? | yes | | - | items | String? | yes | | - | payload | String? | yes | | - | traceId | String? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [AWSS3config](#AWSS3config) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | bucket | String? | yes | | - | region | String? | yes | | - | dir | String? | yes | | - | accessKey | String? | yes | | - | secretKey | String? | yes | | - | localFilePath | String? | yes | | - | archivePath | String? | yes | | - | archive | Bool? | yes | | - | delete | Bool? | yes | | - | unzip | Bool? | yes | | - | zipFormat | String? | yes | | - | fileRegex | String? | yes | | - | archiveConfig | [ArchiveConfig](#ArchiveConfig)? | yes | | - ---- - - - - - #### [ArchiveConfig](#ArchiveConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | delete | Bool? | yes | | - | archive | Bool? | yes | | - | archiveDir | String? | yes | | - ---- - - - - - #### [Audit](#Audit) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdBy | String? | yes | | - | modifiedBy | String? | yes | | - | createdOn | String? | yes | | - | modifiedOn | String? | yes | | - ---- - - - - - #### [CatalogMasterConfig](#CatalogMasterConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | sourceSlug | String? | yes | | - ---- - - - - - #### [CompanyConfig](#CompanyConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | companyId | Int? | yes | | - | excludeSteps | [Int]? | yes | | - | hiddenClosetKeys | [String]? | yes | | - | openTags | [String: Any]? | yes | | - | taxIdentifiers | [String]? | yes | | - | deleteQuantityThreshold | Int? | yes | | - ---- - - - - - #### [DBConfig](#DBConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | vendor | String? | yes | | - | host | String? | yes | | - | port | Int? | yes | | - | username | String? | yes | | - | password | String? | yes | | - | dbname | String? | yes | | - | query | String? | yes | | - | procedure | Bool? | yes | | - | driverClass | String? | yes | | - | jdbcUrl | String? | yes | | - | optionalProperties | [String: String]? | yes | | - ---- - - - - - #### [DBConnectionProfile](#DBConnectionProfile) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | inventory | String? | yes | | - ---- - - - - - #### [DBParamConfig](#DBParamConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | params | [String: Any]? | yes | | - ---- - - - - - #### [DefaultHeadersDTO](#DefaultHeadersDTO) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | store | [PropBeanDTO](#PropBeanDTO)? | yes | | - | intfArticleId | [PropBeanDTO](#PropBeanDTO)? | yes | | - | priceEffective | [PropBeanDTO](#PropBeanDTO)? | yes | | - | quantity | [PropBeanDTO](#PropBeanDTO)? | yes | | - ---- - - - - - #### [DocMappingConfig](#DocMappingConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | properties | [String: Any]? | yes | | - | junkDataThresholdCount | Int? | yes | | - | propBeanConfigs | [[PropBeanConfig](#PropBeanConfig)]? | yes | | - | unwindField | String? | yes | | - | defaultHeaders | [DefaultHeadersDTO](#DefaultHeadersDTO)? | yes | | - ---- - - - - - #### [EmailConfig](#EmailConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | recepient | String? | yes | | - | host | String? | yes | | - | username | String? | yes | | - | password | String? | yes | | - | unzip | Bool? | yes | | - | readFromContent | Bool? | yes | | - | filterBasedOnRecepients | Bool? | yes | | - | pcol | String? | yes | | - | subjectLineRegex | String? | yes | | - | senderAddress | String? | yes | | - | localDir | String? | yes | | - | folderNameHierarchies | [String]? | yes | | - | attachmentRegex | String? | yes | | - | bodyContentRegex | String? | yes | | - | passwordProtected | Bool? | yes | | - | zipFormat | String? | yes | | - | attachmentMandate | Bool? | yes | | - | filterFilesAfterExtraction | Bool? | yes | | - | archiveConfig | [ArchiveConfig](#ArchiveConfig)? | yes | | - | readAllUnreadMails | Bool? | yes | | - | contentType | String? | yes | | - | downloadableLink | Bool? | yes | | - | properties | [String: String]? | yes | | - ---- - - - - - #### [FTPConfig](#FTPConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | host | String? | yes | | - | port | Int? | yes | | - | username | String? | yes | | - | password | String? | yes | | - | unzip | Bool? | yes | | - | retries | Int? | yes | | - | interval | Int? | yes | | - | localDir | String? | yes | | - | remoteDir | String? | yes | | - | zipFileRegex | String? | yes | | - | archiveConfig | [ArchiveConfig](#ArchiveConfig)? | yes | | - | fileRegex | String? | yes | | - | zipFormat | String? | yes | | - | readAllFiles | Bool? | yes | | - ---- - - - - - #### [FileConfig](#FileConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | delimiter | String? | yes | | - | charset | String? | yes | | - | properties | [String: Any]? | yes | | - | fileHasHeader | Bool? | yes | | - | headerIndex | Int? | yes | | - | headerArray | [String]? | yes | | - | dataStartIndex | Int? | yes | | - | propBeanConfigs | [[PropBeanConfig](#PropBeanConfig)]? | yes | | - | junkDataThresholdCount | Int? | yes | | - | fileType | String? | yes | | - | lineValidityCheck | Bool? | yes | | - | sheetNames | [String]? | yes | | - | readAllSheets | Bool? | yes | | - | quoteChar | String? | yes | | - | escapeChar | String? | yes | | - | defaultHeaders | [DefaultHeadersDTO](#DefaultHeadersDTO)? | yes | | - ---- - - - - - #### [GoogleSpreadSheetConfig](#GoogleSpreadSheetConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | range | String? | yes | | - | sheetId | String? | yes | | - | clientSecretLocation | String? | yes | | - | credStorageDirectory | String? | yes | | - | localDir | String? | yes | | - | archiveConfig | [ArchiveConfig](#ArchiveConfig)? | yes | | - ---- - - - - - #### [HttpConfig](#HttpConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | hosturl | String? | yes | | - | username | String? | yes | | - | password | String? | yes | | - | requestParams | [String: String]? | yes | | - | httpMethod | String? | yes | | - | requestPayload | String? | yes | | - | localPath | String? | yes | | - | archiveConfig | [ArchiveConfig](#ArchiveConfig)? | yes | | - ---- - - - - - #### [JobConfig](#JobConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | Int? | yes | | - | jobCode | String? | yes | | - | taskType | String? | yes | | - | syncDelay | Int? | yes | | - | cronExpression | String? | yes | | - | storeFilter | [StoreFilter](#StoreFilter)? | yes | | - | processConfig | [ProcessConfig](#ProcessConfig)? | yes | | - | storeConfig | [[StoreConfig](#StoreConfig)]? | yes | | - | properties | [String: String]? | yes | | - | immediateFirstRun | Bool? | yes | | - | disable | Bool? | yes | | - | dependentJobCodes | [String]? | yes | | - | companyConfig | [[CompanyConfig](#CompanyConfig)]? | yes | | - | companyIds | [Int]? | yes | | - | taxIdentifiers | [String]? | yes | | - | priority | String? | yes | | - | periodThreshold | Int? | yes | | - | periodThresholdType | String? | yes | | - | dbConnectionProfile | [DBConnectionProfile](#DBConnectionProfile)? | yes | | - | params | [String: Any]? | yes | | - | openTags | [String: Any]? | yes | | - | deleteQuantityThreshold | Int? | yes | | - | catalogMasterConfig | [CatalogMasterConfig](#CatalogMasterConfig)? | yes | | - | aggregatorTypes | [String]? | yes | | - | integrationType | String? | yes | | - | minPrice | Double? | yes | | - | audit | [Audit](#Audit)? | yes | | - | version | Int? | yes | | - | alias | String? | yes | | - ---- - - - - - #### [JobConfigRawDTO](#JobConfigRawDTO) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | integration | String | no | | - | companyName | String | no | | - | companyId | Int | no | | - | data | [JobConfig](#JobConfig)? | yes | | - ---- - - - - - #### [JsonDocConfig](#JsonDocConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | propBeanConfigs | [[PropBeanConfig](#PropBeanConfig)]? | yes | | - ---- - - - - - #### [LocalFileConfig](#LocalFileConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | retries | Int? | yes | | - | interval | Int? | yes | | - | localDir | String? | yes | | - | workingDir | String? | yes | | - | unzip | Bool? | yes | | - | zipFileRegex | String? | yes | | - | fileRegex | String? | yes | | - | zipFormat | String? | yes | | - | archiveConfig | [ArchiveConfig](#ArchiveConfig)? | yes | | - | readAllFiles | Bool? | yes | | - ---- - - - - - #### [MongoDocConfig](#MongoDocConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | collectionName | String? | yes | | - | findQuery | [String: Any]? | yes | | - | projectionQuery | [String: Any]? | yes | | - | propBeanConfigs | [[PropBeanConfig](#PropBeanConfig)]? | yes | | - | aggregatePipeline | [[String: Any]]? | yes | | - | skipSave | Bool? | yes | | - ---- - - - - - #### [OAuthConfig](#OAuthConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | limit | Int? | yes | | - | pages | Int? | yes | | - | interval | Int? | yes | | - | consumerKey | String? | yes | | - | consumerSecret | String? | yes | | - | token | String? | yes | | - | tokenSecret | String? | yes | | - | restUrl | String? | yes | | - | restBaseUrl | String? | yes | | - | functionName | String? | yes | | - ---- - - - - - #### [ProcessConfig](#ProcessConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | dbConfig | [DBConfig](#DBConfig)? | yes | | - | dbParamConfig | [DBParamConfig](#DBParamConfig)? | yes | | - | sftpConfig | [SFTPConfig](#SFTPConfig)? | yes | | - | awsS3Config | [AWSS3config](#AWSS3config)? | yes | | - | mongoDocConfig | [MongoDocConfig](#MongoDocConfig)? | yes | | - | ftpConfig | [FTPConfig](#FTPConfig)? | yes | | - | emailConfig | [EmailConfig](#EmailConfig)? | yes | | - | fileConfig | [FileConfig](#FileConfig)? | yes | | - | jsonDocConfig | [JsonDocConfig](#JsonDocConfig)? | yes | | - | docMappingConfig | [DocMappingConfig](#DocMappingConfig)? | yes | | - | taskStepConfig | [TaskStepConfig](#TaskStepConfig)? | yes | | - | httpConfig | [HttpConfig](#HttpConfig)? | yes | | - | localFileConfig | [LocalFileConfig](#LocalFileConfig)? | yes | | - | oauthConfig | [OAuthConfig](#OAuthConfig)? | yes | | - | googleSpreadsheetConfig | [GoogleSpreadSheetConfig](#GoogleSpreadSheetConfig)? | yes | | - ---- - - - - - #### [PropBeanConfig](#PropBeanConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | required | Bool? | yes | | - | mapping | [String: [PropBeanConfig](#PropBeanConfig)]? | yes | | - | optional | Bool? | yes | | - | send | [Send](#Send)? | yes | | - | validations | [[String: Any]]? | yes | | - | values | [String]? | yes | | - | include | Bool? | yes | | - | sourceField | String? | yes | | - | sourceFields | [String]? | yes | | - | destinationField | String? | yes | | - | dataType | String? | yes | | - | defaultValue | [String: Any]? | yes | | - | constValue | [String: Any]? | yes | | - | concatStr | String? | yes | | - | functionName | String? | yes | | - | transformerName | String? | yes | | - | allParamFunctionName | String? | yes | | - | subSeparator | String? | yes | | - | indexField | String? | yes | | - | ignoreIfNotExists | Bool? | yes | | - | identifierType | String? | yes | | - | projectionQuery | [String: Any]? | yes | | - | enrichFromMaster | Bool? | yes | | - ---- - - - - - #### [PropBeanDTO](#PropBeanDTO) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | required | Bool? | yes | | - | optional | Bool? | yes | | - | include | Bool? | yes | | - | sourceField | String? | yes | | - | sourceFields | [String]? | yes | | - | destinationField | String? | yes | | - | dataType | String? | yes | | - | defaultValue | [String: Any]? | yes | | - | constValue | [String: Any]? | yes | | - | concatStr | String? | yes | | - | functionName | String? | yes | | - | transformerName | String? | yes | | - | allParamFunctionName | String? | yes | | - | subSeparator | String? | yes | | - | indexField | String? | yes | | - | ignoreIfNotExists | Bool? | yes | | - | identifierType | String? | yes | | - | projectionQuery | [String: Any]? | yes | | - | enrichFromMaster | Bool? | yes | | - ---- - - - - - #### [ResponseEnvelopeListJobConfigRawDTO](#ResponseEnvelopeListJobConfigRawDTO) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | timestamp | String? | yes | | - | status | Int? | yes | | - | error | String? | yes | | - | exception | String? | yes | | - | message | String? | yes | | - | totalTimeTakenInMillis | Int? | yes | | - | httpStatus | String? | yes | | - | items | [[JobConfigRawDTO](#JobConfigRawDTO)]? | yes | | - | payload | [[JobConfigRawDTO](#JobConfigRawDTO)]? | yes | | - | traceId | String? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [SFTPConfig](#SFTPConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | host | String? | yes | | - | port | Int? | yes | | - | username | String? | yes | | - | password | String? | yes | | - | unzip | Bool? | yes | | - | retries | Int? | yes | | - | interval | Int? | yes | | - | privateKeyPath | String? | yes | | - | strictHostKeyChecking | Bool? | yes | | - | localDir | String? | yes | | - | remoteDir | String? | yes | | - | passwordProtected | Bool? | yes | | - | zipFileRegex | String? | yes | | - | fileRegex | String? | yes | | - | zipFormat | String? | yes | | - | archiveConfig | [ArchiveConfig](#ArchiveConfig)? | yes | | - | readAllFiles | Bool? | yes | | - ---- - - - - - #### [Send](#Send) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | raw | Bool? | yes | | - | processed | Bool? | yes | | - ---- - - - - - #### [StoreConfig](#StoreConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | jobCode | String? | yes | | - | storeid | String? | yes | | - | storeAlias | String? | yes | | - | storeFileRegex | String? | yes | | - | storeFileName | String? | yes | | - | processConfig | [ProcessConfig](#ProcessConfig)? | yes | | - | properties | [String: String]? | yes | | - ---- - - - - - #### [StoreFilter](#StoreFilter) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | includeTags | [String]? | yes | | - | excludeTags | [String]? | yes | | - | query | [String: Any]? | yes | | - ---- - - - - - #### [TaskConfig](#TaskConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | taskConfigId | Int? | yes | | - | taskParams | [[TaskParam](#TaskParam)]? | yes | | - ---- - - - - - #### [TaskParam](#TaskParam) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | value | [String: Any]? | yes | | - ---- - - - - - #### [TaskStepConfig](#TaskStepConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | taskConfigs | [[TaskConfig](#TaskConfig)]? | yes | | - | taskConfigIds | [Int]? | yes | | - | taskConfigGroupIds | [Int]? | yes | | - ---- - - - - - #### [ResponseEnvelopeListJobConfigDTO](#ResponseEnvelopeListJobConfigDTO) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | timestamp | String? | yes | | - | status | Int? | yes | | - | error | String? | yes | | - | exception | String? | yes | | - | message | String? | yes | | - | totalTimeTakenInMillis | Int? | yes | | - | httpStatus | String? | yes | | - | items | [[JobConfigDTO](#JobConfigDTO)]? | yes | | - | payload | [[JobConfigDTO](#JobConfigDTO)]? | yes | | - | traceId | String? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [ResponseEnvelopeJobConfigDTO](#ResponseEnvelopeJobConfigDTO) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | timestamp | String? | yes | | - | status | Int? | yes | | - | error | String? | yes | | - | exception | String? | yes | | - | message | String? | yes | | - | totalTimeTakenInMillis | Int? | yes | | - | httpStatus | String? | yes | | - | items | [JobConfigDTO](#JobConfigDTO)? | yes | | - | payload | [JobConfigDTO](#JobConfigDTO)? | yes | | - | traceId | String? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [JobHistoryDto](#JobHistoryDto) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | totalAddedCount | Int? | yes | | - | totalUpdatedCount | Int? | yes | | - | totalSuppressedCount | Int? | yes | | - | jobId | Int? | yes | | - | status | String? | yes | | - | jobCode | String? | yes | | - | processedOn | String? | yes | | - | filename | [String]? | yes | | - ---- - - - - - #### [JobMetricsDto](#JobMetricsDto) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | jobCode | String? | yes | | - | isRunMoreThanUsual | String? | yes | | - | jobHistory | [[JobHistoryDto](#JobHistoryDto)]? | yes | | - | totalSuccessCount | Int? | yes | | - | totalFailureCount | Int? | yes | | - | totalWarningCount | Int? | yes | | - | totalSuppressedCount | Int? | yes | | - | totalJobRuns | Int? | yes | | - ---- - - - - - #### [ResponseEnvelopeJobMetricsDto](#ResponseEnvelopeJobMetricsDto) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | timestamp | String? | yes | | - | status | Int? | yes | | - | error | String? | yes | | - | exception | String? | yes | | - | message | String? | yes | | - | totalTimeTakenInMillis | Int? | yes | | - | httpStatus | String? | yes | | - | items | [JobMetricsDto](#JobMetricsDto)? | yes | | - | payload | [JobMetricsDto](#JobMetricsDto)? | yes | | - | traceId | String? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [JobConfigListDTO](#JobConfigListDTO) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | code | String? | yes | | - | alias | String? | yes | | - | modifiedBy | String? | yes | | - | createdBy | String? | yes | | - | modifiedOn | String? | yes | | - | createdOn | String? | yes | | - | active | Bool? | yes | | - | type | String? | yes | | - ---- - - - - - #### [ResponseEnvelopeListJobConfigListDTO](#ResponseEnvelopeListJobConfigListDTO) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | timestamp | String? | yes | | - | status | Int? | yes | | - | error | String? | yes | | - | exception | String? | yes | | - | message | String? | yes | | - | totalTimeTakenInMillis | Int? | yes | | - | httpStatus | String? | yes | | - | items | [[JobConfigListDTO](#JobConfigListDTO)]? | yes | | - | payload | [[JobConfigListDTO](#JobConfigListDTO)]? | yes | | - | traceId | String? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - - - #### [ApplicationInventory](#ApplicationInventory) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | inventory | [AppInventoryConfig](#AppInventoryConfig)? | yes | | - | authentication | [AuthenticationConfig](#AuthenticationConfig)? | yes | | - | articleAssignment | [ArticleAssignmentConfig](#ArticleAssignmentConfig)? | yes | | - | rewardPoints | [RewardPointsConfig](#RewardPointsConfig)? | yes | | - | cart | [AppCartConfig](#AppCartConfig)? | yes | | - | payment | [AppPaymentConfig](#AppPaymentConfig)? | yes | | - | order | [AppOrderConfig](#AppOrderConfig)? | yes | | - | logistics | [AppLogisticsConfig](#AppLogisticsConfig)? | yes | | - | business | String? | yes | | - | commsEnabled | Bool? | yes | | - | platforms | [String]? | yes | | - | id | String? | yes | | - | loyaltyPoints | [LoyaltyPointsConfig](#LoyaltyPointsConfig)? | yes | | - | app | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | modifiedBy | String? | yes | | - ---- - - - - - #### [AppInventoryConfig](#AppInventoryConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | brand | [InventoryBrand](#InventoryBrand)? | yes | | - | store | [InventoryStore](#InventoryStore)? | yes | | - | category | [InventoryCategory](#InventoryCategory)? | yes | | - | price | [InventoryPrice](#InventoryPrice)? | yes | | - | discount | [InventoryDiscount](#InventoryDiscount)? | yes | | - | outOfStock | Bool? | yes | | - | franchiseEnabled | Bool? | yes | | - | excludeCategory | [[String: Any]]? | yes | | - | image | [String]? | yes | | - | companyStore | [[String: Any]]? | yes | | - ---- - - - - - #### [InventoryBrand](#InventoryBrand) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | criteria | String? | yes | | - | brands | [[String: Any]]? | yes | | - ---- - - - - - #### [InventoryStore](#InventoryStore) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | criteria | String? | yes | | - | stores | [[String: Any]]? | yes | | - | rules | [AppStoreRules](#AppStoreRules)? | yes | | - ---- - - - - - #### [AppStoreRules](#AppStoreRules) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | companies | [Int]? | yes | | - | brands | [[String: Any]]? | yes | | - ---- - - - - - #### [InventoryCategory](#InventoryCategory) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | criteria | String? | yes | | - | categories | [[String: Any]]? | yes | | - ---- - - - - - #### [InventoryPrice](#InventoryPrice) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | min | Double? | yes | | - | max | Double? | yes | | - ---- - - - - - #### [InventoryDiscount](#InventoryDiscount) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | min | Double? | yes | | - | max | Double? | yes | | - ---- - - - - - #### [AuthenticationConfig](#AuthenticationConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | required | Bool? | yes | | - | provider | String? | yes | | - ---- - - - - - #### [ArticleAssignmentConfig](#ArticleAssignmentConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | rules | [ArticleAssignmentRules](#ArticleAssignmentRules)? | yes | | - | postOrderReassignment | Bool? | yes | | - ---- - - - - - #### [ArticleAssignmentRules](#ArticleAssignmentRules) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | storePriority | [StorePriority](#StorePriority)? | yes | | - ---- - - - - - #### [StorePriority](#StorePriority) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - | storetypeOrder | [[String: Any]]? | yes | | - ---- - - - - - #### [AppCartConfig](#AppCartConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | deliveryCharges | [DeliveryCharges](#DeliveryCharges)? | yes | | - | enabled | Bool? | yes | | - | maxCartItems | Int? | yes | | - | minCartValue | Double? | yes | | - | bulkCoupons | Bool? | yes | | - ---- - - - - - #### [DeliveryCharges](#DeliveryCharges) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - | charges | [Charges](#Charges)? | yes | | - ---- - - - - - #### [Charges](#Charges) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | threshold | Double? | yes | | - | charges | Double? | yes | | - ---- - - - - - #### [AppPaymentConfig](#AppPaymentConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | callbackUrl | [CallbackUrl](#CallbackUrl)? | yes | | - | methods | [Methods](#Methods)? | yes | | - | paymentSelectionLock | [PaymentSelectionLock](#PaymentSelectionLock)? | yes | | - | modeOfPayment | String? | yes | | - | source | String? | yes | | - | enabled | Bool? | yes | | - | codAmountLimit | Double? | yes | | - | codCharges | Double? | yes | | - ---- - - - - - #### [CallbackUrl](#CallbackUrl) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | app | String? | yes | | - | web | String? | yes | | - ---- - - - - - #### [Methods](#Methods) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pl | [PaymentModeConfig](#PaymentModeConfig)? | yes | | - | card | [PaymentModeConfig](#PaymentModeConfig)? | yes | | - | nb | [PaymentModeConfig](#PaymentModeConfig)? | yes | | - | wl | [PaymentModeConfig](#PaymentModeConfig)? | yes | | - | ps | [PaymentModeConfig](#PaymentModeConfig)? | yes | | - | upi | [PaymentModeConfig](#PaymentModeConfig)? | yes | | - | qr | [PaymentModeConfig](#PaymentModeConfig)? | yes | | - | cod | [PaymentModeConfig](#PaymentModeConfig)? | yes | | - | pp | [PaymentModeConfig](#PaymentModeConfig)? | yes | | - | jp | [PaymentModeConfig](#PaymentModeConfig)? | yes | | - | pac | [PaymentModeConfig](#PaymentModeConfig)? | yes | | - | fc | [PaymentModeConfig](#PaymentModeConfig)? | yes | | - | jiopp | [PaymentModeConfig](#PaymentModeConfig)? | yes | | - | stripepg | [PaymentModeConfig](#PaymentModeConfig)? | yes | | - | juspaypg | [PaymentModeConfig](#PaymentModeConfig)? | yes | | - | payubizpg | [PaymentModeConfig](#PaymentModeConfig)? | yes | | - | payumoneypg | [PaymentModeConfig](#PaymentModeConfig)? | yes | | - | rupifipg | [PaymentModeConfig](#PaymentModeConfig)? | yes | | - | simpl | [PaymentModeConfig](#PaymentModeConfig)? | yes | | - ---- - - - - - #### [PaymentModeConfig](#PaymentModeConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - ---- - - - - - #### [PaymentSelectionLock](#PaymentSelectionLock) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - | defaultOptions | String? | yes | | - | paymentIdentifier | String? | yes | | - ---- - - - - - #### [AppOrderConfig](#AppOrderConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - | forceReassignment | Bool? | yes | | - | message | String? | yes | | - ---- - - - - - #### [AppLogisticsConfig](#AppLogisticsConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | logisticsBySeller | Bool? | yes | | - | serviceabilityCheck | Bool? | yes | | - | sameDayDelivery | Bool? | yes | | - | dpAssignment | Bool? | yes | | - ---- - - - - - #### [LoyaltyPointsConfig](#LoyaltyPointsConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - | autoApply | Bool? | yes | | - ---- - - - - - #### [AppInventoryPartialUpdate](#AppInventoryPartialUpdate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | rewardPoints | [RewardPointsConfig](#RewardPointsConfig)? | yes | | - | cart | [AppCartConfig](#AppCartConfig)? | yes | | - | payment | [AppPaymentConfig](#AppPaymentConfig)? | yes | | - | loyaltyPoints | [LoyaltyPointsConfig](#LoyaltyPointsConfig)? | yes | | - | commsEnabled | Bool? | yes | | - ---- - - - - - #### [BrandCompanyInfo](#BrandCompanyInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | companyName | String? | yes | | - | companyId | Int? | yes | | - ---- - - - - - #### [CompanyByBrandsRequest](#CompanyByBrandsRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | brands | Int | no | Brand uids | - | searchText | String? | yes | Search company by name | - ---- - - - - - #### [CompanyByBrandsResponse](#CompanyByBrandsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[BrandCompanyInfo](#BrandCompanyInfo)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [StoreByBrandsRequest](#StoreByBrandsRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | companyId | Int? | yes | Current company id for current company stores only. Don't send in case of cross selling enabled | - | brands | Int | no | Brand uids | - | searchText | String? | yes | Search store by name or store code | - ---- - - - - - #### [StoreByBrandsResponse](#StoreByBrandsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[BrandStoreInfo](#BrandStoreInfo)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [BrandStoreInfo](#BrandStoreInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | storeName | String? | yes | | - | storeId | Int? | yes | | - | storeType | String? | yes | | - | storeCode | String? | yes | | - | storeAddress | [OptedStoreAddress](#OptedStoreAddress)? | yes | | - | company | [OptedCompany](#OptedCompany)? | yes | | - ---- - - - - - #### [CompanyBrandInfo](#CompanyBrandInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | value | Int? | yes | | - | brandLogoUrl | String? | yes | | - | brandBannerUrl | String? | yes | | - | brandBannerPortraitUrl | String? | yes | | - ---- - - - - - #### [BrandsByCompanyResponse](#BrandsByCompanyResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | brands | [CompanyBrandInfo](#CompanyBrandInfo)? | yes | | - ---- - - - - - #### [CreateApplicationRequest](#CreateApplicationRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | app | [App](#App)? | yes | | - | configuration | [AppInventory](#AppInventory)? | yes | | - | domain | [AppDomain](#AppDomain)? | yes | | - ---- - - - - - #### [CreateAppResponse](#CreateAppResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | app | [Application](#Application)? | yes | | - | configuration | [ApplicationInventory](#ApplicationInventory)? | yes | | - ---- - - - - - #### [ApplicationsResponse](#ApplicationsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Application](#Application)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [MobileAppConfiguration](#MobileAppConfiguration) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isActive | Bool? | yes | | - | id | String? | yes | | - | appName | String? | yes | | - | landingImage | [LandingImage](#LandingImage)? | yes | | - | splashImage | [SplashImage](#SplashImage)? | yes | | - | application | String? | yes | | - | platformType | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | v | Int? | yes | | - | packageName | String? | yes | | - ---- - - - - - #### [LandingImage](#LandingImage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | aspectRatio | String? | yes | | - | secureUrl | String? | yes | | - ---- - - - - - #### [SplashImage](#SplashImage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | aspectRatio | String? | yes | | - | secureUrl | String? | yes | | - ---- - - - - - #### [MobileAppConfigRequest](#MobileAppConfigRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | appName | String? | yes | | - | landingImage | [LandingImage](#LandingImage)? | yes | | - | splashImage | [SplashImage](#SplashImage)? | yes | | - | isActive | Bool? | yes | | - ---- - - - - - #### [BuildVersionHistory](#BuildVersionHistory) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | versions | [BuildVersion](#BuildVersion)? | yes | | - | latestAvailableVersionName | String? | yes | | - ---- - - - - - #### [BuildVersion](#BuildVersion) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | application | String? | yes | | - | platformType | String? | yes | | - | buildStatus | String? | yes | | - | versionName | String? | yes | | - | versionCode | Int? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [AppSupportedCurrency](#AppSupportedCurrency) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | supportedCurrency | [String]? | yes | | - | application | String? | yes | | - | defaultCurrency | [DefaultCurrency](#DefaultCurrency)? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - ---- - - - - - #### [DefaultCurrency](#DefaultCurrency) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | ref | String? | yes | | - | code | String? | yes | | - ---- - - - - - #### [CurrencyConfig](#CurrencyConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | isActive | Bool? | yes | | - | name | String? | yes | | - | code | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | decimalDigits | Int? | yes | | - | symbol | String? | yes | | - ---- - - - - - #### [DomainAdd](#DomainAdd) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | Full domain name | - ---- - - - - - #### [DomainAddRequest](#DomainAddRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | domain | [DomainAdd](#DomainAdd)? | yes | | - ---- - - - - - #### [DomainsResponse](#DomainsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | domains | [[Domain](#Domain)]? | yes | | - ---- - - - - - #### [UpdateDomain](#UpdateDomain) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - ---- - - - - - #### [UpdateDomainTypeRequest](#UpdateDomainTypeRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | domain | [UpdateDomain](#UpdateDomain)? | yes | | - | action | String? | yes | | - ---- - - - - - #### [DomainStatusRequest](#DomainStatusRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | domainUrl | String? | yes | Domain url | - ---- - - - - - #### [DomainStatus](#DomainStatus) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - | status | Bool? | yes | | - ---- - - - - - #### [DomainStatusResponse](#DomainStatusResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | connected | Bool? | yes | | - | status | [[DomainStatus](#DomainStatus)]? | yes | | - ---- - - - - - #### [DomainSuggestionsRequest](#DomainSuggestionsRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | domainUrl | String? | yes | Domain url | - | custom | Bool? | yes | Get suggestion for custom domains or fynd domains | - ---- - - - - - #### [DomainSuggestion](#DomainSuggestion) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String | no | | - | unsupported | Bool? | yes | Whether TLD domain is supported or not | - | isAvailable | Bool | no | | - | price | Double? | yes | Price for purchasing a custom domain. Not present for fynd domain | - | currency | String? | yes | Custom domain price currency. Not present for fynd domain | - ---- - - - - - #### [DomainSuggestionsResponse](#DomainSuggestionsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | domains | [[DomainSuggestion](#DomainSuggestion)]? | yes | Domain url | - ---- - - - - - #### [GetIntegrationsOptInsResponse](#GetIntegrationsOptInsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [IntegrationOptIn](#IntegrationOptIn)? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [IntegrationOptIn](#IntegrationOptIn) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | validators | [Validators](#Validators)? | yes | | - | description | String? | yes | | - | descriptionHtml | String? | yes | | - | constants | String? | yes | | - | companies | [[String: Any]]? | yes | | - | support | [String]? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | meta | [IntegrationMeta](#IntegrationMeta)? | yes | | - | icon | String? | yes | | - | owner | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | token | String? | yes | | - | secret | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [Validators](#Validators) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | company | [CompanyValidator](#CompanyValidator)? | yes | | - | store | [StoreValidator](#StoreValidator)? | yes | | - | inventory | [InventoryValidator](#InventoryValidator)? | yes | | - | order | [OrderValidator](#OrderValidator)? | yes | | - ---- - - - - - #### [CompanyValidator](#CompanyValidator) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | jsonSchema | [JsonSchema](#JsonSchema)? | yes | | - | browserScript | String? | yes | | - ---- - - - - - #### [JsonSchema](#JsonSchema) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - | key | String? | yes | | - | type | String? | yes | | - | tooltip | String? | yes | | - ---- - - - - - #### [StoreValidator](#StoreValidator) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | jsonSchema | [[JsonSchema](#JsonSchema)]? | yes | | - | browserScript | String? | yes | | - ---- - - - - - #### [InventoryValidator](#InventoryValidator) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | jsonSchema | [[JsonSchema](#JsonSchema)]? | yes | | - | browserScript | String? | yes | | - ---- - - - - - #### [OrderValidator](#OrderValidator) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | jsonSchema | [[JsonSchema](#JsonSchema)]? | yes | | - | browserScript | String? | yes | | - ---- - - - - - #### [IntegrationMeta](#IntegrationMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isPublic | Bool? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | value | String? | yes | | - ---- - - - - - #### [Integration](#Integration) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | validators | [Validators](#Validators)? | yes | | - | description | String? | yes | | - | descriptionHtml | String? | yes | | - | constants | [String: Any]? | yes | | - | companies | [[String: Any]]? | yes | | - | support | [String]? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | meta | [IntegrationMeta](#IntegrationMeta)? | yes | | - | icon | String? | yes | | - | owner | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | token | String? | yes | | - | secret | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [IntegrationConfigResponse](#IntegrationConfigResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [IntegrationLevel](#IntegrationLevel)? | yes | | - ---- - - - - - #### [IntegrationLevel](#IntegrationLevel) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | opted | Bool? | yes | | - | permissions | [[String: Any]]? | yes | | - | lastPatch | [[String: Any]]? | yes | | - | id | String? | yes | | - | integration | String? | yes | | - | level | String? | yes | | - | uid | Int? | yes | | - | meta | [[String: Any]]? | yes | | - | token | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | v | Int? | yes | | - | data | [String: Any]? | yes | | - ---- - - - - - #### [OptedStoreIntegration](#OptedStoreIntegration) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | otherOpted | Bool? | yes | | - | otherIntegration | [IntegrationOptIn](#IntegrationOptIn)? | yes | | - | otherEntity | [OtherEntity](#OtherEntity)? | yes | | - ---- - - - - - #### [OtherEntity](#OtherEntity) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | opted | Bool? | yes | | - | permissions | [String]? | yes | | - | lastPatch | [LastPatch](#LastPatch)? | yes | | - | id | String? | yes | | - | integration | String? | yes | | - | level | String? | yes | | - | uid | Int? | yes | | - | data | [OtherEntityData](#OtherEntityData)? | yes | | - | meta | [[String: Any]]? | yes | | - | token | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [LastPatch](#LastPatch) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | op | String? | yes | | - | path | String? | yes | | - | value | String? | yes | | - ---- - - - - - #### [OtherEntityData](#OtherEntityData) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | articleIdentifier | String? | yes | | - ---- - - - - - #### [App](#App) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | companyId | String? | yes | Current company id | - | channelType | String? | yes | | - | auth | [ApplicationAuth](#ApplicationAuth)? | yes | | - | name | String? | yes | User friendly name for application | - | desc | String? | yes | Basic description of application | - ---- - - - - - #### [AppInventory](#AppInventory) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | brand | [InventoryBrandRule](#InventoryBrandRule)? | yes | | - | store | [InventoryStoreRule](#InventoryStoreRule)? | yes | | - | image | [String]? | yes | | - | franchiseEnabled | Bool? | yes | | - | outOfStock | Bool? | yes | | - | payment | [InventoryPaymentConfig](#InventoryPaymentConfig)? | yes | | - | articleAssignment | [InventoryArticleAssignment](#InventoryArticleAssignment)? | yes | | - ---- - - - - - #### [AppDomain](#AppDomain) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - ---- - - - - - #### [CompaniesResponse](#CompaniesResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [AppInventoryCompanies](#AppInventoryCompanies)? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [AppInventoryCompanies](#AppInventoryCompanies) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uid | Int? | yes | | - | name | String? | yes | | - | companyType | String? | yes | | - ---- - - - - - #### [StoresResponse](#StoresResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [AppInventoryStores](#AppInventoryStores)? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [AppInventoryStores](#AppInventoryStores) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | modifiedOn | String? | yes | | - | uid | Int? | yes | | - | name | String? | yes | | - | displayName | String? | yes | | - | storeType | String? | yes | | - | storeCode | String? | yes | | - | companyId | Int? | yes | | - ---- - - - - - #### [FilterOrderingStoreRequest](#FilterOrderingStoreRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | allStores | Bool? | yes | | - | deployedStores | [Int]? | yes | | - | q | String? | yes | | - ---- - - - - - #### [DeploymentMeta](#DeploymentMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | deployedStores | [Int]? | yes | | - | allStores | Bool? | yes | | - | enabled | Bool? | yes | | - | type | String? | yes | | - | id | String? | yes | | - | app | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [OrderingStoreConfig](#OrderingStoreConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | deploymentMeta | [DeploymentMeta](#DeploymentMeta)? | yes | | - ---- - - - - - #### [OtherSellerCompany](#OtherSellerCompany) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uid | Int? | yes | | - | name | String? | yes | | - ---- - - - - - #### [OtherSellerApplication](#OtherSellerApplication) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | description | String? | yes | | - | id | String? | yes | | - | domain | String? | yes | | - | company | [OtherSellerCompany](#OtherSellerCompany)? | yes | | - | optType | String? | yes | | - ---- - - - - - #### [OtherSellerApplications](#OtherSellerApplications) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[OtherSellerApplication](#OtherSellerApplication)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [OptedApplicationResponse](#OptedApplicationResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | description | String? | yes | | - | id | String? | yes | | - | domain | String? | yes | | - | company | [OptedCompany](#OptedCompany)? | yes | | - | optedInventory | [OptedInventory](#OptedInventory)? | yes | | - | optOutInventory | [OptOutInventory](#OptOutInventory)? | yes | | - ---- - - - - - #### [OptedCompany](#OptedCompany) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | uid | Int? | yes | | - | name | String? | yes | | - ---- - - - - - #### [OptedInventory](#OptedInventory) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | optType | [OptType](#OptType)? | yes | | - | items | [String: Any]? | yes | | - ---- - - - - - #### [OptType](#OptType) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String? | yes | | - | display | String? | yes | | - ---- - - - - - #### [OptedStore](#OptedStore) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | storeCode | String? | yes | | - | id | String? | yes | | - | modifiedOn | String? | yes | | - | uid | Int? | yes | | - | address | [OptedStoreAddress](#OptedStoreAddress)? | yes | | - | displayName | String? | yes | | - | storeType | String? | yes | | - | companyId | Int? | yes | | - ---- - - - - - #### [OptOutInventory](#OptOutInventory) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | store | [Int] | no | | - | company | [Int] | no | | - ---- - - - - - #### [TokenResponse](#TokenResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | tokens | [Tokens](#Tokens)? | yes | | - | id | String? | yes | | - | application | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [Tokens](#Tokens) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | firebase | [Firebase](#Firebase)? | yes | | - | moengage | [Moengage](#Moengage)? | yes | | - | segment | [Segment](#Segment)? | yes | | - | gtm | [Gtm](#Gtm)? | yes | | - | freshchat | [Freshchat](#Freshchat)? | yes | | - | safetynet | [Safetynet](#Safetynet)? | yes | | - | fyndRewards | [FyndRewards](#FyndRewards)? | yes | | - | googleMap | [GoogleMap](#GoogleMap)? | yes | | - ---- - - - - - #### [Firebase](#Firebase) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | credentials | [Credentials](#Credentials)? | yes | | - | enabled | Bool? | yes | | - ---- - - - - - #### [Credentials](#Credentials) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | ios | [Ios](#Ios)? | yes | | - | android | [Android](#Android)? | yes | | - | projectId | String? | yes | | - | gcmSenderId | String? | yes | | - | applicationId | String? | yes | | - | apiKey | String? | yes | | - ---- - - - - - #### [Ios](#Ios) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | applicationId | String? | yes | | - | apiKey | String? | yes | | - ---- - - - - - #### [Android](#Android) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | applicationId | String? | yes | | - | apiKey | String? | yes | | - ---- - - - - - #### [Moengage](#Moengage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | credentials | [MoengageCredentials](#MoengageCredentials)? | yes | | - | enabled | Bool? | yes | | - ---- - - - - - #### [MoengageCredentials](#MoengageCredentials) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | appId | String? | yes | | - ---- - - - - - #### [Segment](#Segment) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | credentials | [SegmentCredentials](#SegmentCredentials)? | yes | | - | enabled | Bool? | yes | | - ---- - - - - - #### [SegmentCredentials](#SegmentCredentials) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | writeKey | String? | yes | | - ---- - - - - - #### [Gtm](#Gtm) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | credentials | [GtmCredentials](#GtmCredentials)? | yes | | - | enabled | Bool? | yes | | - ---- - - - - - #### [GtmCredentials](#GtmCredentials) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | apiKey | String? | yes | | - ---- - - - - - #### [Freshchat](#Freshchat) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | credentials | [FreshchatCredentials](#FreshchatCredentials)? | yes | | - | enabled | Bool? | yes | | - ---- - - - - - #### [FreshchatCredentials](#FreshchatCredentials) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | appId | String? | yes | | - | appKey | String? | yes | | - | webToken | String? | yes | | - ---- - - - - - #### [Safetynet](#Safetynet) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | credentials | [SafetynetCredentials](#SafetynetCredentials)? | yes | | - | enabled | Bool? | yes | | - ---- - - - - - #### [SafetynetCredentials](#SafetynetCredentials) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | apiKey | String? | yes | | - ---- - - - - - #### [FyndRewards](#FyndRewards) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | credentials | [FyndRewardsCredentials](#FyndRewardsCredentials)? | yes | | - ---- - - - - - #### [FyndRewardsCredentials](#FyndRewardsCredentials) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | publicKey | String? | yes | | - ---- - - - - - #### [GoogleMap](#GoogleMap) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | credentials | [GoogleMapCredentials](#GoogleMapCredentials)? | yes | | - ---- - - - - - #### [GoogleMapCredentials](#GoogleMapCredentials) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | apiKey | String? | yes | | - ---- - - - - - #### [RewardPointsConfig](#RewardPointsConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | credit | [Credit](#Credit)? | yes | | - | debit | [Debit](#Debit)? | yes | | - ---- - - - - - #### [Credit](#Credit) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - ---- - - - - - #### [Debit](#Debit) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - | autoApply | Bool? | yes | | - | strategyChannel | String? | yes | | - ---- - - - - - #### [ProductDetailFeature](#ProductDetailFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | similar | [String]? | yes | | - | sellerSelection | Bool? | yes | | - | updateProductMeta | Bool? | yes | | - | requestProduct | Bool? | yes | | - ---- - - - - - #### [LaunchPage](#LaunchPage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pageType | String? | yes | | - | params | [String: Any]? | yes | | - | query | [String: Any]? | yes | | - ---- - - - - - #### [LandingPageFeature](#LandingPageFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | launchPage | [LaunchPage](#LaunchPage)? | yes | | - | continueAsGuest | Bool? | yes | | - | loginBtnText | String? | yes | | - | showDomainTextbox | Bool? | yes | | - | showRegisterBtn | Bool? | yes | | - ---- - - - - - #### [RegistrationPageFeature](#RegistrationPageFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | askStoreAddress | Bool? | yes | | - ---- - - - - - #### [AppFeature](#AppFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | productDetail | [ProductDetailFeature](#ProductDetailFeature)? | yes | | - | landingPage | [LandingPageFeature](#LandingPageFeature)? | yes | | - | registrationPage | [RegistrationPageFeature](#RegistrationPageFeature)? | yes | | - | homePage | [HomePageFeature](#HomePageFeature)? | yes | | - | common | [CommonFeature](#CommonFeature)? | yes | | - | cart | [CartFeature](#CartFeature)? | yes | | - | qr | [QrFeature](#QrFeature)? | yes | | - | pcr | [PcrFeature](#PcrFeature)? | yes | | - | order | [OrderFeature](#OrderFeature)? | yes | | - | id | String? | yes | | - | app | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [HomePageFeature](#HomePageFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | orderProcessing | Bool? | yes | | - ---- - - - - - #### [CommonFeature](#CommonFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | communicationOptinDialog | [CommunicationOptinDialogFeature](#CommunicationOptinDialogFeature)? | yes | | - | deploymentStoreSelection | [DeploymentStoreSelectionFeature](#DeploymentStoreSelectionFeature)? | yes | | - | listingPrice | [ListingPriceFeature](#ListingPriceFeature)? | yes | | - | currency | [CurrencyFeature](#CurrencyFeature)? | yes | | - | revenueEngine | [RevenueEngineFeature](#RevenueEngineFeature)? | yes | | - | feedback | [FeedbackFeature](#FeedbackFeature)? | yes | | - | compareProducts | [CompareProductsFeature](#CompareProductsFeature)? | yes | | - | rewardPoints | [RewardPointsConfig](#RewardPointsConfig)? | yes | | - ---- - - - - - #### [CommunicationOptinDialogFeature](#CommunicationOptinDialogFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | visibility | Bool? | yes | | - ---- - - - - - #### [DeploymentStoreSelectionFeature](#DeploymentStoreSelectionFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - | type | String? | yes | | - ---- - - - - - #### [ListingPriceFeature](#ListingPriceFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | value | String? | yes | | - ---- - - - - - #### [CurrencyFeature](#CurrencyFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | value | [String]? | yes | | - | type | String? | yes | | - | defaultCurrency | String? | yes | | - ---- - - - - - #### [RevenueEngineFeature](#RevenueEngineFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - ---- - - - - - #### [FeedbackFeature](#FeedbackFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - ---- - - - - - #### [CompareProductsFeature](#CompareProductsFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - ---- - - - - - #### [CartFeature](#CartFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | gstInput | Bool? | yes | | - | staffSelection | Bool? | yes | | - | placingForCustomer | Bool? | yes | | - | googleMap | Bool? | yes | | - | revenueEngineCoupon | Bool? | yes | | - ---- - - - - - #### [QrFeature](#QrFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | application | Bool? | yes | | - | products | Bool? | yes | | - | collections | Bool? | yes | | - ---- - - - - - #### [PcrFeature](#PcrFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | staffSelection | Bool? | yes | | - ---- - - - - - #### [OrderFeature](#OrderFeature) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | buyAgain | Bool? | yes | | - ---- - - - - - #### [AppFeatureRequest](#AppFeatureRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | feature | [AppFeature](#AppFeature)? | yes | | - ---- - - - - - #### [AppFeatureResponse](#AppFeatureResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | feature | [AppFeature](#AppFeature)? | yes | | - ---- - - - - - #### [Currency](#Currency) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | isActive | Bool? | yes | | - | name | String? | yes | | - | code | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | decimalDigits | Int? | yes | | - | symbol | String? | yes | | - ---- - - - - - #### [Domain](#Domain) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | verified | Bool? | yes | | - | isPrimary | Bool? | yes | | - | isDefault | Bool? | yes | | - | isShortlink | Bool? | yes | | - | id | String? | yes | | - | name | String? | yes | | - ---- - - - - - #### [ApplicationWebsite](#ApplicationWebsite) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - | basepath | String? | yes | | - ---- - - - - - #### [ApplicationCors](#ApplicationCors) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | domains | [String]? | yes | | - ---- - - - - - #### [ApplicationAuth](#ApplicationAuth) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - ---- - - - - - #### [ApplicationRedirections](#ApplicationRedirections) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | from | String? | yes | | - | redirectTo | String? | yes | | - | type | String? | yes | | - ---- - - - - - #### [ApplicationMeta](#ApplicationMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | value | String? | yes | | - ---- - - - - - #### [SecureUrl](#SecureUrl) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | secureUrl | String? | yes | | - ---- - - - - - #### [Application](#Application) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | website | [ApplicationWebsite](#ApplicationWebsite)? | yes | | - | cors | [ApplicationCors](#ApplicationCors)? | yes | | - | auth | [ApplicationAuth](#ApplicationAuth)? | yes | | - | description | String? | yes | | - | channelType | String? | yes | | - | cacheTtl | Int? | yes | | - | isInternal | Bool? | yes | | - | isActive | Bool? | yes | | - | id | String? | yes | | - | name | String? | yes | | - | owner | String? | yes | | - | companyId | Int? | yes | | - | token | String? | yes | | - | redirections | [[ApplicationRedirections](#ApplicationRedirections)]? | yes | | - | meta | [[ApplicationMeta](#ApplicationMeta)]? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | v | Int? | yes | | - | banner | [SecureUrl](#SecureUrl)? | yes | | - | logo | [SecureUrl](#SecureUrl)? | yes | | - | favicon | [SecureUrl](#SecureUrl)? | yes | | - | domains | [[Domain](#Domain)]? | yes | | - | appType | String? | yes | | - | mobileLogo | [SecureUrl](#SecureUrl)? | yes | | - | domain | [Domain](#Domain)? | yes | | - ---- - - - - - #### [NotFound](#NotFound) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [UnhandledError](#UnhandledError) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [InvalidPayloadRequest](#InvalidPayloadRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [SuccessMessageResponse](#SuccessMessageResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [InventoryBrandRule](#InventoryBrandRule) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | criteria | String? | yes | Whether enable all or explicitly few brands as inventory | - | brands | [Int]? | yes | Brand uids in case of explicit criteria | - ---- - - - - - #### [StoreCriteriaRule](#StoreCriteriaRule) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | companies | [Int]? | yes | list of company uids | - | brands | [Int]? | yes | list of brand uids | - ---- - - - - - #### [InventoryStoreRule](#InventoryStoreRule) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | criteria | String? | yes | Whether enable all or explicitly few stores or use filter of brands and company as inventory stores | - | rules | [[StoreCriteriaRule](#StoreCriteriaRule)]? | yes | List of rules with company and brands uids. Used when critera is `filter` | - | stores | [Int]? | yes | List of store uids. Used when critera is `explicit` | - ---- - - - - - #### [InventoryPaymentConfig](#InventoryPaymentConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | modeOfPayment | String? | yes | | - | source | String? | yes | | - ---- - - - - - #### [StorePriorityRule](#StorePriorityRule) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | enabled | Bool? | yes | | - | storetypeOrder | [String]? | yes | | - ---- - - - - - #### [ArticleAssignmentRule](#ArticleAssignmentRule) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | storePriority | [StorePriorityRule](#StorePriorityRule)? | yes | | - ---- - - - - - #### [InventoryArticleAssignment](#InventoryArticleAssignment) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | postOrderReassignment | Bool? | yes | | - | rules | [ArticleAssignmentRule](#ArticleAssignmentRule)? | yes | | - ---- - - - - - #### [CompanyAboutAddress](#CompanyAboutAddress) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | pincode | Int? | yes | | - | address1 | String? | yes | | - | address2 | String? | yes | | - | city | String? | yes | | - | state | String? | yes | | - | country | String? | yes | | - | addressType | String? | yes | | - ---- - - - - - #### [UserEmail](#UserEmail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool? | yes | | - | primary | Bool? | yes | | - | verified | Bool? | yes | | - | email | String? | yes | | - ---- - - - - - #### [UserPhoneNumber](#UserPhoneNumber) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | active | Bool? | yes | | - | primary | Bool? | yes | | - | verified | Bool? | yes | | - | countryCode | Int? | yes | | - | phone | String? | yes | | - ---- - - - - - #### [ApplicationInformation](#ApplicationInformation) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | address | [InformationAddress](#InformationAddress)? | yes | | - | support | [InformationSupport](#InformationSupport)? | yes | | - | socialLinks | [SocialLinks](#SocialLinks)? | yes | | - | links | [Links](#Links)? | yes | | - | copyrightText | String? | yes | | - | id | String? | yes | | - | businessHighlights | [BusinessHighlights](#BusinessHighlights)? | yes | | - | application | String? | yes | | - | createdAt | String? | yes | | - | updatedAt | String? | yes | | - | v | Int? | yes | | - ---- - - - - - #### [InformationAddress](#InformationAddress) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | loc | String? | yes | | - | addressLine | [String]? | yes | | - | phone | [InformationPhone](#InformationPhone)? | yes | | - | city | String? | yes | | - | country | String? | yes | | - | pincode | Int? | yes | | - ---- - - - - - #### [InformationPhone](#InformationPhone) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | code | String? | yes | | - | number | String? | yes | | - ---- - - - - - #### [InformationSupport](#InformationSupport) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | phone | [String]? | yes | | - | email | [String]? | yes | | - | timing | String? | yes | | - ---- - - - - - #### [SocialLinks](#SocialLinks) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | facebook | [FacebookLink](#FacebookLink)? | yes | | - | instagram | [InstagramLink](#InstagramLink)? | yes | | - | twitter | [TwitterLink](#TwitterLink)? | yes | | - | pinterest | [PinterestLink](#PinterestLink)? | yes | | - | googlePlus | [GooglePlusLink](#GooglePlusLink)? | yes | | - | youtube | [YoutubeLink](#YoutubeLink)? | yes | | - | linkedIn | [LinkedInLink](#LinkedInLink)? | yes | | - | vimeo | [VimeoLink](#VimeoLink)? | yes | | - | blogLink | [BlogLink](#BlogLink)? | yes | | - ---- - - - - - #### [FacebookLink](#FacebookLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | icon | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [InstagramLink](#InstagramLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | icon | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [TwitterLink](#TwitterLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | icon | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [PinterestLink](#PinterestLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | icon | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [GooglePlusLink](#GooglePlusLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | icon | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [YoutubeLink](#YoutubeLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | icon | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [LinkedInLink](#LinkedInLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | icon | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [VimeoLink](#VimeoLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | icon | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [BlogLink](#BlogLink) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | icon | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [Links](#Links) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | link | String? | yes | | - ---- - - - - - #### [BusinessHighlights](#BusinessHighlights) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | title | String? | yes | | - | icon | String? | yes | | - | subTitle | String? | yes | | - ---- - - - - - #### [ApplicationDetail](#ApplicationDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String | no | | - | description | String | no | | - | logo | [SecureUrl](#SecureUrl) | no | | - | mobileLogo | [SecureUrl](#SecureUrl) | no | | - | favicon | [SecureUrl](#SecureUrl) | no | | - | banner | [SecureUrl](#SecureUrl) | no | | - | domain | [Domain](#Domain)? | yes | | - | domains | [[Domain](#Domain)]? | yes | | - | id | String? | yes | | - ---- - - - - - #### [CurrenciesResponse](#CurrenciesResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Currency](#Currency)]? | yes | | - ---- - - - - - #### [AppCurrencyResponse](#AppCurrencyResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | application | String? | yes | | - | defaultCurrency | [DefaultCurrency](#DefaultCurrency)? | yes | | - | supportedCurrency | [[Currency](#Currency)]? | yes | | - ---- - - - - - #### [StoreLatLong](#StoreLatLong) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | coordinates | [Double]? | yes | | - ---- - - - - - #### [OptedStoreAddress](#OptedStoreAddress) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | state | String? | yes | | - | address1 | String? | yes | | - | latLong | [StoreLatLong](#StoreLatLong)? | yes | | - | address2 | String? | yes | | - | pincode | Int? | yes | | - | country | String? | yes | | - | city | String? | yes | | - ---- - - - - - #### [OrderingStore](#OrderingStore) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | address | [OptedStoreAddress](#OptedStoreAddress)? | yes | | - | id | String? | yes | | - | uid | Int? | yes | | - | name | String? | yes | | - | displayName | String? | yes | | - | storeType | String? | yes | | - | storeCode | String? | yes | | - | pincode | Int? | yes | | - | code | String? | yes | | - ---- - - - - - #### [OrderingStores](#OrderingStores) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | page | [Page](#Page)? | yes | | - | items | [[OrderingStore](#OrderingStore)]? | yes | | - | deployedStores | [Int]? | yes | | - | allStores | Bool? | yes | | - | enabled | Bool? | yes | | - | type | String? | yes | | - | id | String? | yes | | - | app | String? | yes | | - | v | Int? | yes | | - ---- - - - - - - - #### [CouponDateMeta](#CouponDateMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | modifiedOn | String? | yes | | - | createdOn | String? | yes | | - ---- - - - - - #### [Validation](#Validation) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | userRegisteredAfter | String? | yes | | - | appId | [String]? | yes | | - | anonymous | Bool? | yes | | - ---- - - - - - #### [DisplayMetaDict](#DisplayMetaDict) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | subtitle | String? | yes | | - ---- - - - - - #### [DisplayMeta](#DisplayMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | subtitle | String? | yes | | - | auto | [DisplayMetaDict](#DisplayMetaDict)? | yes | | - | remove | [DisplayMetaDict](#DisplayMetaDict)? | yes | | - | title | String? | yes | | - | apply | [DisplayMetaDict](#DisplayMetaDict)? | yes | | - | description | String? | yes | | - ---- - - - - - #### [PaymentAllowValue](#PaymentAllowValue) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | max | Int? | yes | | - ---- - - - - - #### [PaymentModes](#PaymentModes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | types | [String]? | yes | | - | codes | [String]? | yes | | - | uses | [PaymentAllowValue](#PaymentAllowValue)? | yes | | - | networks | [String]? | yes | | - ---- - - - - - #### [PaymentCodes](#PaymentCodes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | ps | [PaymentModes](#PaymentModes)? | yes | | - | qr | [PaymentModes](#PaymentModes)? | yes | | - | nb | [PaymentModes](#PaymentModes)? | yes | | - | stripepg | [PaymentModes](#PaymentModes)? | yes | | - | wl | [PaymentModes](#PaymentModes)? | yes | | - | card | [PaymentModes](#PaymentModes)? | yes | | - | simpl | [PaymentModes](#PaymentModes)? | yes | | - | pl | [PaymentModes](#PaymentModes)? | yes | | - | rupifipg | [PaymentModes](#PaymentModes)? | yes | | - | upi | [PaymentModes](#PaymentModes)? | yes | | - ---- - - - - - #### [PriceRange](#PriceRange) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | max | Int? | yes | | - | min | Int? | yes | | - ---- - - - - - #### [PostOrder](#PostOrder) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cancellationAllowed | Bool? | yes | | - | returnAllowed | Bool? | yes | | - ---- - - - - - #### [BulkBundleRestriction](#BulkBundleRestriction) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | multiStoreAllowed | Bool | no | | - ---- - - - - - #### [UsesRemaining](#UsesRemaining) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | total | Int? | yes | | - | user | Int? | yes | | - | app | Int? | yes | | - ---- - - - - - #### [UsesRestriction](#UsesRestriction) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | remaining | [UsesRemaining](#UsesRemaining)? | yes | | - | maximum | [UsesRemaining](#UsesRemaining)? | yes | | - ---- - - - - - #### [Restrictions](#Restrictions) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | payments | [PaymentCodes](#PaymentCodes)? | yes | | - | priceRange | [PriceRange](#PriceRange)? | yes | | - | postOrder | [PostOrder](#PostOrder)? | yes | | - | bulkBundle | [BulkBundleRestriction](#BulkBundleRestriction)? | yes | | - | couponAllowed | Bool? | yes | | - | uses | [UsesRestriction](#UsesRestriction)? | yes | | - | platforms | [String]? | yes | | - | orderingStores | [Int]? | yes | | - ---- - - - - - #### [RuleDefinition](#RuleDefinition) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | valueType | String | no | | - | type | String | no | | - | applicableOn | String | no | | - | currencyCode | String? | yes | | - | isExact | Bool? | yes | | - | autoApply | Bool? | yes | | - | scope | [String]? | yes | | - | calculateOn | String | no | | - ---- - - - - - #### [Identifier](#Identifier) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | storeId | [Int]? | yes | | - | categoryId | [Int]? | yes | | - | itemId | [Int]? | yes | | - | articleId | [String]? | yes | | - | brandId | [Int]? | yes | | - | collectionId | [String]? | yes | | - | companyId | [Int]? | yes | | - | userId | [String]? | yes | | - ---- - - - - - #### [Validity](#Validity) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | priority | Int? | yes | | - ---- - - - - - #### [Ownership](#Ownership) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | payableCategory | String | no | | - | payableBy | String | no | | - ---- - - - - - #### [CouponAuthor](#CouponAuthor) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | createdBy | String? | yes | | - | modifiedBy | String? | yes | | - ---- - - - - - #### [State](#State) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isDisplay | Bool? | yes | | - | isArchived | Bool? | yes | | - | isPublic | Bool? | yes | | - ---- - - - - - #### [CouponAction](#CouponAction) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | actionDate | String? | yes | | - | txnMode | String? | yes | | - ---- - - - - - #### [CouponSchedule](#CouponSchedule) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cron | String? | yes | | - | end | String? | yes | | - | nextSchedule | [[String: Any]]? | yes | | - | duration | Int? | yes | | - | start | String? | yes | | - ---- - - - - - #### [Rule](#Rule) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | max | Double? | yes | | - | key | Double? | yes | | - | value | Double? | yes | | - | discountQty | Double? | yes | | - | min | Double? | yes | | - ---- - - - - - #### [CouponAdd](#CouponAdd) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | tags | [String]? | yes | | - | dateMeta | [CouponDateMeta](#CouponDateMeta)? | yes | | - | validation | [Validation](#Validation)? | yes | | - | displayMeta | [DisplayMeta](#DisplayMeta) | no | | - | typeSlug | String | no | | - | restrictions | [Restrictions](#Restrictions)? | yes | | - | ruleDefinition | [RuleDefinition](#RuleDefinition) | no | | - | identifiers | [Identifier](#Identifier) | no | | - | validity | [Validity](#Validity) | no | | - | ownership | [Ownership](#Ownership) | no | | - | author | [CouponAuthor](#CouponAuthor)? | yes | | - | state | [State](#State)? | yes | | - | action | [CouponAction](#CouponAction)? | yes | | - | schedule | [CouponSchedule](#CouponSchedule)? | yes | | - | code | String | no | | - | rule | [[Rule](#Rule)] | no | | - ---- - - - - - #### [CouponsResponse](#CouponsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | page | [Page](#Page)? | yes | | - | items | [CouponAdd](#CouponAdd)? | yes | | - ---- - - - - - #### [SuccessMessage](#SuccessMessage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - | success | Bool? | yes | | - ---- - - - - - #### [OperationErrorResponse](#OperationErrorResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - | success | Bool? | yes | | - ---- - - - - - #### [CouponUpdate](#CouponUpdate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | tags | [String]? | yes | | - | dateMeta | [CouponDateMeta](#CouponDateMeta)? | yes | | - | validation | [Validation](#Validation)? | yes | | - | displayMeta | [DisplayMeta](#DisplayMeta) | no | | - | typeSlug | String | no | | - | restrictions | [Restrictions](#Restrictions)? | yes | | - | ruleDefinition | [RuleDefinition](#RuleDefinition) | no | | - | identifiers | [Identifier](#Identifier) | no | | - | validity | [Validity](#Validity) | no | | - | ownership | [Ownership](#Ownership) | no | | - | author | [CouponAuthor](#CouponAuthor)? | yes | | - | state | [State](#State)? | yes | | - | action | [CouponAction](#CouponAction)? | yes | | - | schedule | [CouponSchedule](#CouponSchedule)? | yes | | - | code | String | no | | - | rule | [[Rule](#Rule)] | no | | - ---- - - - - - #### [CouponPartialUpdate](#CouponPartialUpdate) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | archive | Bool? | yes | Send true to unpublish coupon | - | schedule | [CouponSchedule](#CouponSchedule)? | yes | | - ---- - - - - - #### [CartItem](#CartItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | productId | String | no | | - | size | String | no | | - | quantity | Int? | yes | | - ---- - - - - - #### [OpenapiCartDetailsRequest](#OpenapiCartDetailsRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cartItems | [CartItem](#CartItem)? | yes | | - ---- - - - - - #### [CouponBreakup](#CouponBreakup) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isApplied | Bool? | yes | | - | type | String? | yes | | - | uid | String? | yes | | - | message | String? | yes | | - | value | Double? | yes | | - | code | String? | yes | | - ---- - - - - - #### [DisplayBreakup](#DisplayBreakup) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | display | String? | yes | | - | currencyCode | String? | yes | | - | message | [String]? | yes | | - | key | String? | yes | | - | value | Double? | yes | | - | currencySymbol | String? | yes | | - ---- - - - - - #### [RawBreakup](#RawBreakup) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | total | Double? | yes | | - | youSaved | Double? | yes | | - | mrpTotal | String? | yes | | - | vog | Double? | yes | | - | subtotal | Double? | yes | | - | convenienceFee | Double? | yes | | - | deliveryCharge | Double? | yes | | - | discount | Double? | yes | | - | coupon | Double? | yes | | - | fyndCash | Double? | yes | | - | gstCharges | Double? | yes | | - | codCharge | Double? | yes | | - ---- - - - - - #### [LoyaltyPoints](#LoyaltyPoints) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | total | Double? | yes | | - | isApplied | Bool? | yes | | - | applicable | Double? | yes | | - | description | String? | yes | | - ---- - - - - - #### [CartBreakup](#CartBreakup) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | coupon | [CouponBreakup](#CouponBreakup)? | yes | | - | display | [[DisplayBreakup](#DisplayBreakup)]? | yes | | - | raw | [RawBreakup](#RawBreakup)? | yes | | - | loyaltyPoints | [LoyaltyPoints](#LoyaltyPoints)? | yes | | - ---- - - - - - #### [BaseInfo](#BaseInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | uid | Int? | yes | | - ---- - - - - - #### [ProductImage](#ProductImage) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | secureUrl | String? | yes | | - | aspectRatio | String? | yes | | - | url | String? | yes | | - ---- - - - - - #### [CategoryInfo](#CategoryInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String? | yes | | - | uid | Int? | yes | Product Category Id | - ---- - - - - - #### [ActionQuery](#ActionQuery) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | productSlug | [String]? | yes | Contains list of product slug | - ---- - - - - - #### [ProductAction](#ProductAction) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | query | [ActionQuery](#ActionQuery)? | yes | | - | url | String? | yes | | - ---- - - - - - #### [CartProduct](#CartProduct) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | brand | [BaseInfo](#BaseInfo)? | yes | | - | images | [[ProductImage](#ProductImage)]? | yes | | - | type | String? | yes | | - | uid | Int? | yes | | - | categories | [[CategoryInfo](#CategoryInfo)]? | yes | | - | action | [ProductAction](#ProductAction)? | yes | | - | name | String? | yes | | - | slug | String? | yes | Unique product url name generated via product name and other meta data | - ---- - - - - - #### [BasePrice](#BasePrice) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | currencyCode | String? | yes | | - | effective | Double? | yes | | - | marked | Double? | yes | | - | currencySymbol | String? | yes | | - ---- - - - - - #### [ArticlePriceInfo](#ArticlePriceInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | base | [BasePrice](#BasePrice)? | yes | | - | converted | [BasePrice](#BasePrice)? | yes | | - ---- - - - - - #### [ProductArticle](#ProductArticle) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | size | String? | yes | | - | type | String? | yes | | - | uid | String? | yes | | - | quantity | Int? | yes | | - | extraMeta | [String: Any]? | yes | | - | price | [ArticlePriceInfo](#ArticlePriceInfo)? | yes | | - | seller | [BaseInfo](#BaseInfo)? | yes | | - | store | [BaseInfo](#BaseInfo)? | yes | | - ---- - - - - - #### [ProductPrice](#ProductPrice) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | marked | Double? | yes | | - | selling | Double? | yes | | - | currencyCode | String? | yes | | - | effective | Double? | yes | | - | addOn | Double? | yes | | - | currencySymbol | String? | yes | | - ---- - - - - - #### [ProductPriceInfo](#ProductPriceInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | base | [ProductPrice](#ProductPrice)? | yes | | - | converted | [ProductPrice](#ProductPrice)? | yes | | - ---- - - - - - #### [CartProductIdentifer](#CartProductIdentifer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | identifier | String? | yes | Article idenfier generated by cart | - ---- - - - - - #### [ProductAvailability](#ProductAvailability) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | deliverable | Bool? | yes | | - | outOfStock | Bool? | yes | | - | isValid | Bool? | yes | | - | otherStoreQuantity | Int? | yes | | - | sizes | [String]? | yes | | - ---- - - - - - #### [PromoMeta](#PromoMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - ---- - - - - - #### [CartProductInfo](#CartProductInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | product | [CartProduct](#CartProduct)? | yes | | - | article | [ProductArticle](#ProductArticle)? | yes | | - | pricePerUnit | [ProductPriceInfo](#ProductPriceInfo)? | yes | | - | identifiers | [CartProductIdentifer](#CartProductIdentifer) | no | | - | availability | [ProductAvailability](#ProductAvailability)? | yes | | - | quantity | Int? | yes | | - | bulkOffer | [String: Any]? | yes | | - | message | String? | yes | | - | key | String? | yes | | - | discount | String? | yes | | - | promoMeta | [PromoMeta](#PromoMeta)? | yes | | - | price | [ProductPriceInfo](#ProductPriceInfo)? | yes | | - | isSet | Bool? | yes | | - | couponMessage | String? | yes | | - ---- - - - - - #### [OpenapiCartDetailsResponse](#OpenapiCartDetailsResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - | breakupValues | [CartBreakup](#CartBreakup)? | yes | | - | isValid | Bool? | yes | | - | items | [[CartProductInfo](#CartProductInfo)]? | yes | | - ---- - - - - - #### [OpenApiErrorResponse](#OpenApiErrorResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | errors | [String: Any]? | yes | Contains field name which has error as key and error message as value | - | message | String? | yes | | - | success | Bool? | yes | | - ---- - - - - - #### [ShippingAddress](#ShippingAddress) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | areaCodeSlug | String? | yes | | - | pincode | Int? | yes | | - | phone | Int? | yes | | - | city | String | no | | - | area | String? | yes | | - | state | String | no | | - | landmark | String? | yes | | - | meta | [String: Any]? | yes | | - | areaCode | String | no | | - | name | String? | yes | | - | addressType | String? | yes | | - | country | String | no | | - | address | String? | yes | | - | countryCode | String? | yes | | - | email | String? | yes | | - ---- - - - - - #### [OpenApiCartServiceabilityRequest](#OpenApiCartServiceabilityRequest) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | cartItems | [CartItem](#CartItem)? | yes | | - | shippingAddress | [ShippingAddress](#ShippingAddress) | no | | - ---- - - - - - #### [PromiseFormatted](#PromiseFormatted) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | max | String? | yes | | - | min | String? | yes | | - ---- - - - - - #### [PromiseTimestamp](#PromiseTimestamp) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | max | Double? | yes | | - | min | Double? | yes | | - ---- - - - - - #### [ShipmentPromise](#ShipmentPromise) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | formatted | [PromiseFormatted](#PromiseFormatted)? | yes | | - | timestamp | [PromiseTimestamp](#PromiseTimestamp)? | yes | | - ---- - - - - - #### [OpenApiCartServiceabilityResponse](#OpenApiCartServiceabilityResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | isValid | Bool? | yes | | - | items | [[CartProductInfo](#CartProductInfo)]? | yes | | - | message | String? | yes | | - | breakupValues | [CartBreakup](#CartBreakup)? | yes | | - | deliveryPromise | [ShipmentPromise](#ShipmentPromise)? | yes | | - ---- - - - - - #### [OpenApiFiles](#OpenApiFiles) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String | no | | - | values | [String] | no | | - ---- - - - - - #### [CartItemMeta](#CartItemMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | groupId | String? | yes | | - | primaryItem | Bool? | yes | | - ---- - - - - - #### [MultiTenderPaymentMeta](#MultiTenderPaymentMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | currentStatus | String? | yes | | - | orderId | String? | yes | | - | paymentGateway | String? | yes | | - | extraMeta | [String: Any]? | yes | | - | paymentId | String? | yes | | - ---- - - - - - #### [MultiTenderPaymentMethod](#MultiTenderPaymentMethod) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | meta | [MultiTenderPaymentMeta](#MultiTenderPaymentMeta)? | yes | | - | mode | String | no | | - | name | String? | yes | Payment mode name | - | amount | Double | no | Payment amount | - ---- - - - - - #### [OpenApiOrderItem](#OpenApiOrderItem) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | couponEffectiveDiscount | Double | no | | - | codCharges | Double | no | | - | priceMarked | Double | no | | - | files | [[OpenApiFiles](#OpenApiFiles)]? | yes | | - | productId | Int | no | | - | quantity | Int? | yes | | - | cashbackApplied | Double | no | | - | meta | [CartItemMeta](#CartItemMeta)? | yes | | - | priceEffective | Double | no | | - | discount | Double | no | | - | deliveryCharges | Double | no | | - | loyaltyDiscount | Double? | yes | | - | amountPaid | Double | no | | - | extraMeta | [String: Any]? | yes | | - | paymentMethods | [[MultiTenderPaymentMethod](#MultiTenderPaymentMethod)] | no | | - | size | String | no | | - | employeeDiscount | Double? | yes | | - ---- - - - - - #### [OpenApiPlatformCheckoutReq](#OpenApiPlatformCheckoutReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | codCharges | Double | no | | - | files | [[OpenApiFiles](#OpenApiFiles)]? | yes | | - | cashbackApplied | Double | no | | - | shippingAddress | [ShippingAddress](#ShippingAddress)? | yes | | - | couponCode | String | no | | - | employeeDiscount | [String: Any]? | yes | | - | couponValue | Double | no | | - | cartItems | [[OpenApiOrderItem](#OpenApiOrderItem)] | no | | - | loyaltyDiscount | Double? | yes | | - | deliveryCharges | Double | no | | - | paymentMethods | [[MultiTenderPaymentMethod](#MultiTenderPaymentMethod)] | no | | - | coupon | String? | yes | | - | currencyCode | String? | yes | | - | paymentMode | String? | yes | | - | affiliateOrderId | String? | yes | | - | billingAddress | [ShippingAddress](#ShippingAddress) | no | | - | orderId | String? | yes | | - | cartValue | Double | no | | - ---- - - - - - #### [OpenApiCheckoutResponse](#OpenApiCheckoutResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - | success | Bool? | yes | | - | orderId | String | no | Fynd order id | - | orderRefId | String? | yes | Order id sent in request | - ---- - - - - - - - #### [AppUser](#AppUser) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | active | Bool? | yes | | - | applicationId | String? | yes | | - | blockReason | String? | yes | | - | updatedAt | String? | yes | | - | updatedBy | String? | yes | | - | userId | String? | yes | | - ---- - - - - - #### [E](#E) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | code | [String: Any]? | yes | | - | exception | String? | yes | | - | info | String? | yes | | - | message | String? | yes | | - | requestId | String? | yes | | - | stackTrace | String? | yes | | - | status | Int? | yes | | - ---- - - - - - #### [Giveaway](#Giveaway) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | schedule | [Schedule](#Schedule)? | yes | | - | active | Bool? | yes | | - | applicationId | String? | yes | | - | audience | [RewardsAudience](#RewardsAudience)? | yes | | - | bannerImage | [Asset](#Asset)? | yes | | - | createdAt | String? | yes | | - | description | String? | yes | | - | name | String? | yes | | - | rule | [RewardsRule](#RewardsRule)? | yes | | - | title | String? | yes | | - | updatedAt | String? | yes | | - ---- - - - - - #### [GiveawayResponse](#GiveawayResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[Giveaway](#Giveaway)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [HistoryPretty](#HistoryPretty) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | applicationId | String? | yes | | - | claimed | Bool? | yes | | - | createdAt | String? | yes | | - | expiresOn | String? | yes | | - | points | Double? | yes | | - | remainingPoints | Double? | yes | | - | text1 | String? | yes | | - | text2 | String? | yes | | - | text3 | String? | yes | | - | txnName | String? | yes | | - | updatedAt | String? | yes | | - | userId | String? | yes | | - ---- - - - - - #### [HistoryRes](#HistoryRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[HistoryPretty](#HistoryPretty)]? | yes | | - | page | [Page](#Page)? | yes | | - | points | Double? | yes | | - ---- - - - - - #### [Offer](#Offer) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | schedule | [Schedule](#Schedule)? | yes | | - | active | Bool? | yes | | - | applicationId | String? | yes | | - | bannerImage | [Asset](#Asset)? | yes | | - | createdAt | String? | yes | | - | name | String? | yes | | - | rule | [String: Any]? | yes | | - | share | [ShareMessages](#ShareMessages)? | yes | | - | subText | String? | yes | | - | text | String? | yes | | - | type | String? | yes | | - | updatedAt | String? | yes | | - | updatedBy | String? | yes | | - | url | String? | yes | | - ---- - - - - - #### [Points](#Points) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | available | Double? | yes | | - ---- - - - - - #### [Referral](#Referral) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | code | String? | yes | | - ---- - - - - - #### [RewardUser](#RewardUser) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | active | Bool? | yes | | - | createdAt | String? | yes | | - | referral | [Referral](#Referral)? | yes | | - | uid | Int? | yes | | - | updatedAt | String? | yes | | - | userBlockReason | String? | yes | | - | userId | String? | yes | | - ---- - - - - - #### [RewardsAudience](#RewardsAudience) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | headerUserId | String? | yes | | - | id | String? | yes | | - ---- - - - - - #### [RewardsRule](#RewardsRule) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | amount | Double? | yes | | - ---- - - - - - #### [ShareMessages](#ShareMessages) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | email | String? | yes | | - | facebook | String? | yes | | - | fallback | String? | yes | | - | message | String? | yes | | - | messenger | String? | yes | | - | sms | String? | yes | | - | text | String? | yes | | - | twitter | String? | yes | | - | whatsapp | String? | yes | | - ---- - - - - - #### [UserRes](#UserRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | points | [Points](#Points)? | yes | | - | user | [RewardUser](#RewardUser)? | yes | | - ---- - - - - - - - #### [StatGroup](#StatGroup) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String? | yes | | - | url | String? | yes | | - | title | String? | yes | | - ---- - - - - - #### [StatsGroups](#StatsGroups) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | groups | [[StatGroup](#StatGroup)]? | yes | | - ---- - - - - - #### [StatsGroupComponent](#StatsGroupComponent) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String? | yes | | - | url | String? | yes | | - | title | String? | yes | | - | type | String? | yes | | - | filters | [String: Any]? | yes | | - ---- - - - - - #### [StatsGroupComponents](#StatsGroupComponents) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | title | String? | yes | | - | components | [[StatsGroupComponent](#StatsGroupComponent)]? | yes | | - ---- - - - - - #### [StatsRes](#StatsRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | key | String? | yes | | - | title | String? | yes | | - | type | String? | yes | | - | data | [String: Any]? | yes | | - ---- - - - - - #### [ReceivedAt](#ReceivedAt) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | value | String? | yes | | - ---- - - - - - #### [AbandonCartsDetail](#AbandonCartsDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | propertiesCartId | String? | yes | | - | contextTraitsFirstName | String? | yes | | - | contextTraitsLastName | String? | yes | | - | contextTraitsPhoneNumber | String? | yes | | - | contextTraitsEmail | String? | yes | | - | contextAppApplicationId | String? | yes | | - | propertiesBreakupValuesRawTotal | String? | yes | | - | receivedAt | [ReceivedAt](#ReceivedAt)? | yes | | - ---- - - - - - #### [AbandonCartsList](#AbandonCartsList) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[AbandonCartsDetail](#AbandonCartsDetail)]? | yes | | - | cartTotal | String? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [AbandonCartDetail](#AbandonCartDetail) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | userId | String? | yes | | - | cartValue | String? | yes | | - | articles | [[String: Any]]? | yes | | - | breakup | [String: Any]? | yes | | - | address | [String: Any]? | yes | | - ---- - - - - - #### [ExportJobReq](#ExportJobReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | marketplaceName | String? | yes | | - | startTime | String? | yes | | - | endTime | String? | yes | | - | eventType | String? | yes | | - | traceId | String? | yes | | - ---- - - - - - #### [ExportJobRes](#ExportJobRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | status | String? | yes | | - | jobId | String? | yes | | - ---- - - - - - #### [ExportJobStatusRes](#ExportJobStatusRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | status | String? | yes | | - | jobId | String? | yes | | - | downloadUrl | String? | yes | | - ---- - - - - - #### [GetLogsListReq](#GetLogsListReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | marketplaceName | String? | yes | | - | startDate | String? | yes | | - | companyId | String? | yes | | - | endDate | String? | yes | | - ---- - - - - - #### [MkpLogsResp](#MkpLogsResp) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | startTimeIso | String? | yes | | - | endTimeIso | String? | yes | | - | eventType | String? | yes | | - | traceId | String? | yes | | - | count | String? | yes | | - | status | String? | yes | | - ---- - - - - - #### [GetLogsListRes](#GetLogsListRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[MkpLogsResp](#MkpLogsResp)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [SearchLogReq](#SearchLogReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | marketplaceName | String? | yes | | - | startDate | String? | yes | | - | companyId | String? | yes | | - | endDate | String? | yes | | - | identifier | String? | yes | | - | identifierValue | String? | yes | | - ---- - - - - - #### [LogInfo](#LogInfo) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | status | String? | yes | | - | eventType | String? | yes | | - | marketplaceName | String? | yes | | - | event | String? | yes | | - | traceId | String? | yes | | - | companyId | Double? | yes | | - | brandId | Double? | yes | | - | storeCode | String? | yes | | - | storeId | Double? | yes | | - | itemId | Double? | yes | | - | articleId | String? | yes | | - | sellerIdentifier | String? | yes | | - ---- - - - - - #### [SearchLogRes](#SearchLogRes) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[LogInfo](#LogInfo)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - - - #### [ValidityObject](#ValidityObject) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | start | String | no | | - | end | String | no | | - ---- - - - - - #### [CreateUpdateDiscount](#CreateUpdateDiscount) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | name | String | no | | - | companyId | Int | no | | - | isActive | Bool | no | | - | appIds | [String] | no | | - | jobType | String | no | | - | discountType | String | no | | - | discountLevel | String | no | | - | value | Int? | yes | | - | filePath | String? | yes | | - | brandIds | [Int]? | yes | | - | storeIds | [Int]? | yes | | - | validity | [ValidityObject](#ValidityObject) | no | | - ---- - - - - - #### [DiscountJob](#DiscountJob) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String | no | | - | name | String | no | | - | companyId | Int | no | | - | isActive | Bool | no | | - | appIds | [String]? | yes | | - | jobType | String? | yes | | - | discountType | String? | yes | | - | discountLevel | String? | yes | | - | value | Int? | yes | | - | filePath | String? | yes | | - | brandIds | [Int]? | yes | | - | storeIds | [Int]? | yes | | - | validity | [ValidityObject](#ValidityObject) | no | | - | createdOn | String | no | | - | modifiedOn | String | no | | - | createdBy | [UserDetails](#UserDetails) | no | | - | modifiedBy | [UserDetails](#UserDetails) | no | | - | meta | [String: Any]? | yes | | - ---- - - - - - #### [ListOrCalender](#ListOrCalender) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[DiscountJob](#DiscountJob)] | no | | - | page | [Page](#Page) | no | | - ---- - - - - - #### [FileJobResponse](#FileJobResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | stage | String | no | | - | total | Int | no | | - | failed | Int | no | | - | companyId | Int | no | | - | body | [String: Any]? | yes | | - | type | String | no | | - | fileType | String | no | | - ---- - - - - - #### [DownloadFileJob](#DownloadFileJob) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | brandIds | [Int]? | yes | | - | storeIds | [Int]? | yes | | - ---- - - - - - #### [CancelJobResponse](#CancelJobResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | success | Bool | no | | - ---- - - - - - #### [UserDetails](#UserDetails) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | username | String | no | | - | userId | String | no | | - ---- - - - - - #### [BadRequestObject](#BadRequestObject) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String | no | | - ---- - - - - - - - #### [AddProxyReq](#AddProxyReq) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | attachedPath | String? | yes | Proxy path slug | - | proxyUrl | String? | yes | Proxied url | - ---- - - - - - #### [AddProxyResponse](#AddProxyResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | String? | yes | | - | attachedPath | String? | yes | | - | proxyUrl | String? | yes | | - | companyId | String? | yes | | - | applicationId | String? | yes | | - | extensionId | String? | yes | | - | createdAt | String? | yes | | - | modifiedAt | String? | yes | | - ---- - - - - - #### [ApiError](#ApiError) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | code | String? | yes | | - | message | String? | yes | | - | meta | [String: Any]? | yes | | - ---- - - - - - #### [RemoveProxyResponse](#RemoveProxyResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | message | String? | yes | | - | data | [String: Any]? | yes | | - ---- - - - - - - - #### [EventConfig](#EventConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | Int? | yes | | - | eventName | String? | yes | | - | eventType | String? | yes | | - | eventCategory | String? | yes | | - | version | String? | yes | | - | displayName | String? | yes | | - | description | String? | yes | | - | createdOn | String? | yes | | - ---- - - - - - #### [EventConfigList](#EventConfigList) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[EventConfig](#EventConfig)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [SubscriberConfigList](#SubscriberConfigList) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | items | [[SubscriberResponse](#SubscriberResponse)]? | yes | | - | page | [Page](#Page)? | yes | | - ---- - - - - - #### [EventProcessedStatus](#EventProcessedStatus) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | Int? | yes | | - | subscriberId | String? | yes | | - | attempt | Int? | yes | | - | responseCode | String? | yes | | - | responseMessage | String? | yes | | - | createdOn | String? | yes | | - | processedOn | String? | yes | | - | status | Bool? | yes | | - ---- - - - - - #### [EventPayload](#EventPayload) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | Int? | yes | | - | eventTraceId | String? | yes | | - | messageId | String? | yes | | - | eventName | String? | yes | | - | eventType | String? | yes | | - | version | String? | yes | | - | status | Bool? | yes | | - ---- - - - - - #### [SubscriberConfig](#SubscriberConfig) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | Int? | yes | | - | name | String? | yes | | - | webhookUrl | String? | yes | | - | association | [Association](#Association)? | yes | | - | status | [SubscriberStatus](#SubscriberStatus)? | yes | | - | emailId | String? | yes | | - | authMeta | [AuthMeta](#AuthMeta)? | yes | | - | eventId | [Int]? | yes | | - ---- - - - - - #### [SubscriberResponse](#SubscriberResponse) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | Int? | yes | | - | name | String? | yes | | - | webhookUrl | String? | yes | | - | association | [Association](#Association)? | yes | | - | status | [SubscriberStatus](#SubscriberStatus)? | yes | | - | authMeta | [AuthMeta](#AuthMeta)? | yes | | - | createdOn | String? | yes | | - | updatedOn | String? | yes | | - | eventConfigs | [[EventConfig](#EventConfig)]? | yes | | - ---- - - - - - #### [SubscriberEvent](#SubscriberEvent) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | id | Int? | yes | | - | subscriberId | Int? | yes | | - | eventId | Int? | yes | | - | createdDate | String? | yes | | - ---- - - - - - #### [AuthMeta](#AuthMeta) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | type | String? | yes | | - | secret | String? | yes | | - ---- - - - - - #### [Association](#Association) - - | Properties | Type | Nullable | Description | - | ---------- | ---- | -------- | ----------- | - | companyId | Int? | yes | | - | applicationId | [String]? | yes | | - | extensionId | String? | yes | | - ---- - - - - -### Enums - - - - - - - - #### [PriorityEnum](#PriorityEnum) - Type : string - - | Name | Value | Description | - | ---- | ----- | ----------- | - | low | low | This means ticket is low priority | - | medium | medium | This means ticket is medium priority | - | high | high | This means ticket is high priority | - | urgent | urgent | This means ticket is of urgent priority | - ---- - - - - #### [HistoryTypeEnum](#HistoryTypeEnum) - Type : string - - | Name | Value | Description | - | ---- | ----- | ----------- | - | rating | rating | This means history event is a rating | - | log | log | This means history event is a changelog | - | comment | comment | This means history event is a comment | - ---- - - - - #### [TicketAssetType](#TicketAssetType) - Type : string - - | Name | Value | Description | - | ---- | ----- | ----------- | - | image | image | Denotes asset is of image type | - | video | video | Denotes asset is of video type | - | file | file | Denotes asset is of file type | - | youtube | youtube | Denotes asset is an youtube link | - | product | product | Denotes asset is of product type | - | collection | collection | Denotes asset is of collection type | - | brand | brand | Denotes asset is of brand type | - | shipment | shipment | Denotes asset is of shipment type | - | order | order | Denotes asset is of order type | - ---- - - - - #### [TicketSourceEnum](#TicketSourceEnum) - Type : string - - | Name | Value | Description | - | ---- | ----- | ----------- | - | platformPanel | platform_panel | This means it is company level ticket | - | salesChannel | sales_channel | This means it is a application/sales channel level ticket | - ---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #### [SubscriberStatus](#SubscriberStatus) - Type : string - - | Name | Value | Description | - | ---- | ----- | ----------- | - | active | active | Status is active | - | inactive | inactive | Status is inactive | - ---- - - - - - diff --git a/documentation/application/CART.md b/documentation/application/CART.md new file mode 100644 index 0000000000..193ded847c --- /dev/null +++ b/documentation/application/CART.md @@ -0,0 +1,6719 @@ + + + + +##### [Back to Application docs](./README.md) + +## Cart Methods +Cart APIs +* [getCart](#getcart) +* [getCartLastModified](#getcartlastmodified) +* [addItems](#additems) +* [updateCart](#updatecart) +* [getItemCount](#getitemcount) +* [getCoupons](#getcoupons) +* [applyCoupon](#applycoupon) +* [removeCoupon](#removecoupon) +* [getBulkDiscountOffers](#getbulkdiscountoffers) +* [applyRewardPoints](#applyrewardpoints) +* [getAddresses](#getaddresses) +* [addAddress](#addaddress) +* [getAddressById](#getaddressbyid) +* [updateAddress](#updateaddress) +* [removeAddress](#removeaddress) +* [selectAddress](#selectaddress) +* [selectPaymentMode](#selectpaymentmode) +* [validateCouponForPayment](#validatecouponforpayment) +* [getShipments](#getshipments) +* [checkoutCart](#checkoutcart) +* [updateCartMeta](#updatecartmeta) +* [getCartShareLink](#getcartsharelink) +* [getCartSharedItems](#getcartshareditems) +* [updateCartWithSharedItems](#updatecartwithshareditems) + + + +## Methods with example and description + + +#### getCart +Fetch all items added to the cart + + + + +```swift +cart.getCart(id: id, i: i, b: b, assignCardId: assignCardId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | | +| i | Bool? | no | | +| b | Bool? | no | | +| assignCardId | Int? | no | | + + + +Use this API to get details of all the items added to a cart. + +*Returned Response:* + + + + +[CartDetailResponse](#CartDetailResponse) + +Success. Returns a Cart object. Check the example shown below or refer `CartDetailResponse` for more details. + + + + +
    +  Example: + +```json +{ + "items": [ + { + "bulk_offer": {}, + "discount": "67% OFF", + "article": { + "type": "article", + "uid": "604_902_SSTC60401_636BLUE_1", + "size": "1", + "seller": { + "uid": 604, + "name": "SHRI SHANTINATH TRADING COMPANY" + }, + "store": { + "uid": 4579, + "name": "Gandhi Nagar" + }, + "quantity": 108, + "price": { + "base": { + "marked": 2999, + "effective": 999, + "currency_code": "INR" + }, + "converted": { + "marked": 2999, + "effective": 999, + "currency_code": "INR" + } + } + }, + "coupon_message": "", + "key": "707569_1", + "availability": { + "sizes": [ + "1", + "8", + "7", + "2", + "9", + "5", + "3", + "6" + ], + "other_store_quantity": 107, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 707569, + "name": "Blue and Gold Printed Ethnic Set", + "slug": "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a", + "brand": { + "uid": 902, + "name": "" + }, + "categories": [ + { + "uid": 525, + "name": "" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/v1/products/aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a/", + "query": { + "product_slug": [ + "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a" + ] + } + } + }, + "price": { + "base": { + "add_on": 999, + "marked": 2999, + "effective": 999, + "selling": 999, + "currency_code": "INR" + }, + "converted": { + "add_on": 999, + "marked": 2999, + "effective": 999, + "selling": 999, + "currency_code": "INR" + } + }, + "message": "", + "quantity": 1 + } + ], + "cart_id": 54, + "uid": "54", + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": -2000, + "fynd_cash": 0, + "gst_charges": 47.57, + "mrp_total": 2999, + "subtotal": 999, + "total": 999, + "vog": 951.43, + "you_saved": 0 + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 2999, + "currency_code": "INR" + }, + { + "display": "Discount", + "key": "discount", + "value": -2000, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 999, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 999, + "currency_code": "INR" + } + ], + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + } + }, + "delivery_charge_info": "", + "coupon_text": "View all offers", + "gstin": null, + "checkout_mode": "self", + "restrict_checkout": false, + "is_valid": true, + "last_modified": "Tue, 03 Sep 2019 05:35:59 GMT" +} +``` +
    + + + + + + + + + +--- + + +#### getCartLastModified +Fetch last-modified timestamp + + + + +```swift +cart.getCartLastModified(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | | + + + +Use this API to fetch Last-Modified timestamp in header metadata. + +*Returned Response:* + + + + + + + + +--- + + +#### addItems +Add items to cart + + + + +```swift +cart.addItems(i: i, b: b, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| i | Bool? | no | | +| b | Bool? | no | | +| body | AddCartRequest | yes | Request body | + + +Use this API to add items to the cart. + +*Returned Response:* + + + + +[AddCartDetailResponse](#AddCartDetailResponse) + +Success. Returns a cart object as shown below. Refer `AddCartDetailResponse` for more details. + + + + +
    +  Examples: + + +
    +  Product has been added to your cart + +```json +{ + "value": { + "message": "Product has been added to your cart", + "success": true, + "cart": { + "breakup_values": { + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 17486, + "currency_code": "INR" + }, + { + "display": "Discount", + "key": "discount", + "value": -3540, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 13946, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 13946, + "currency_code": "INR" + } + ], + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": -3540, + "fynd_cash": 0, + "gst_charges": 1529.96, + "mrp_total": 17486, + "subtotal": 13946, + "total": 13946, + "vog": 12416.04, + "you_saved": 0 + }, + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + } + }, + "items": [ + { + "key": "751083_10", + "article": { + "type": "article", + "uid": "612_9_SE61201_19100302_10", + "size": "10", + "seller": { + "uid": 612, + "name": "SSR ENTERPRISE" + }, + "store": { + "uid": 4431, + "name": "Motilal Nagar 1, Goregaon" + }, + "quantity": 4, + "price": { + "base": { + "marked": 3999, + "effective": 2399, + "currency_code": "INR" + }, + "converted": { + "marked": 3999, + "effective": 2399, + "currency_code": "INR" + } + } + }, + "price": { + "base": { + "add_on": 4798, + "marked": 7998, + "effective": 4798, + "selling": 4798, + "currency_code": "INR" + }, + "converted": { + "add_on": 4798, + "marked": 7998, + "effective": 4798, + "selling": 4798, + "currency_code": "INR" + } + }, + "availability": { + "sizes": [ + "10" + ], + "other_store_quantity": 2, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 751083, + "name": "Carson 2", + "slug": "puma-carson-2-751083-6ad98d", + "brand": { + "uid": 9, + "name": "Puma" + }, + "categories": [ + { + "uid": 165, + "name": "Outdoor Sports Shoes" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/9_19100302/1_1542807042296.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/9_19100302/1_1542807042296.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/puma-carson-2-751083-6ad98d/", + "query": { + "product_slug": [ + "puma-carson-2-751083-6ad98d" + ] + } + } + }, + "coupon_message": "", + "quantity": 2, + "message": "", + "bulk_offer": {}, + "discount": "41% OFF" + }, + { + "key": "246228_S", + "article": { + "type": "article", + "uid": "46_235_TM62_M11029ONDSXNS_S", + "size": "S", + "seller": { + "uid": 46, + "name": "RELIANCE BRANDS LIMITED" + }, + "store": { + "uid": 4550, + "name": "VR Mall" + }, + "quantity": 1, + "price": { + "base": { + "marked": 4490, + "effective": 4490, + "currency_code": "INR" + }, + "converted": { + "marked": 4490, + "effective": 4490, + "currency_code": "INR" + } + } + }, + "price": { + "base": { + "add_on": 4490, + "marked": 4490, + "effective": 4490, + "selling": 4490, + "currency_code": "INR" + }, + "converted": { + "add_on": 4490, + "marked": 4490, + "effective": 4490, + "selling": 4490, + "currency_code": "INR" + } + }, + "availability": { + "sizes": [ + "L", + "M", + "S", + "XL", + "XXL" + ], + "other_store_quantity": 0, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 246228, + "name": "Blue Solid T-Shirt", + "slug": "superdry-blue-solid-t-shirt-2", + "brand": { + "uid": 235, + "name": "Superdry" + }, + "categories": [ + { + "uid": 192, + "name": "T-Shirts" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/235_M11029ONDSXNS/1.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/235_M11029ONDSXNS/1.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/superdry-blue-solid-t-shirt-2/", + "query": { + "product_slug": [ + "superdry-blue-solid-t-shirt-2" + ] + } + } + }, + "coupon_message": "", + "quantity": 1, + "message": "", + "bulk_offer": {}, + "discount": "" + }, + { + "key": "443175_S", + "article": { + "type": "article", + "uid": "162_207_1271_LJ03LBLUDN88_S", + "size": "S", + "seller": { + "uid": 162, + "name": "GO FASHION INDIA PRIVATE LIMITED" + }, + "store": { + "uid": 5784, + "name": "Vega City mall" + }, + "quantity": 3, + "price": { + "base": { + "marked": 1599, + "effective": 1599, + "currency_code": "INR" + }, + "converted": { + "marked": 1599, + "effective": 1599, + "currency_code": "INR" + } + } + }, + "price": { + "base": { + "add_on": 1599, + "marked": 1599, + "effective": 1599, + "selling": 1599, + "currency_code": "INR" + }, + "converted": { + "add_on": 1599, + "marked": 1599, + "effective": 1599, + "selling": 1599, + "currency_code": "INR" + } + }, + "availability": { + "sizes": [ + "XL", + "M", + "L", + "S" + ], + "other_store_quantity": 8, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 443175, + "name": "Light Blue Denim Jeggings", + "slug": "go-colors-light-blue-denim-jeggings-443175-3c688c", + "brand": { + "uid": 207, + "name": "Go Colors" + }, + "categories": [ + { + "uid": 267, + "name": "Jeggings" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/207_LJ03LBLUDN88/1_1512382513548.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/207_LJ03LBLUDN88/1_1512382513548.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/go-colors-light-blue-denim-jeggings-443175-3c688c/", + "query": { + "product_slug": [ + "go-colors-light-blue-denim-jeggings-443175-3c688c" + ] + } + } + }, + "coupon_message": "", + "quantity": 1, + "message": "", + "bulk_offer": {}, + "discount": "" + }, + { + "key": "778937_OS", + "article": { + "type": "article", + "uid": "686_963_IC68601_PWUPC01977_OS", + "size": "OS", + "seller": { + "uid": 686, + "name": "INDUS CORPORATION" + }, + "store": { + "uid": 5059, + "name": "Vidyaranyapura Main Road" + }, + "quantity": 3, + "price": { + "base": { + "marked": 3399, + "effective": 3059, + "currency_code": "INR" + }, + "converted": { + "marked": 3399, + "effective": 3059, + "currency_code": "INR" + } + } + }, + "price": { + "base": { + "add_on": 3059, + "marked": 3399, + "effective": 3059, + "selling": 3059, + "currency_code": "INR" + }, + "converted": { + "add_on": 3059, + "marked": 3399, + "effective": 3059, + "selling": 3059, + "currency_code": "INR" + } + }, + "availability": { + "sizes": [ + "OS" + ], + "other_store_quantity": 2, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 778937, + "name": "Colourful Carnival Bouncer", + "slug": "fisher-price-colourful-carnival-bouncer-778937-fafa1f", + "brand": { + "uid": 963, + "name": "Fisher-Price" + }, + "categories": [ + { + "uid": 576, + "name": "Cradles" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/963_PWUPC01977/1_1545308400588.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/963_PWUPC01977/1_1545308400588.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/fisher-price-colourful-carnival-bouncer-778937-fafa1f/", + "query": { + "product_slug": [ + "fisher-price-colourful-carnival-bouncer-778937-fafa1f" + ] + } + } + }, + "coupon_message": "", + "quantity": 1, + "message": "", + "bulk_offer": {}, + "discount": "11% OFF" + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "cart_id": 7927, + "uid": "7927", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Tue, 03 Sep 2019 06:00:43 GMT", + "restrict_checkout": false, + "is_valid": true + }, + "result": {} + } +} +``` +
    + +
    +  Sorry, item is out of stock + +```json +{ + "value": { + "message": "Sorry, item is out of stock", + "success": false, + "cart": { + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": -202000, + "fynd_cash": 0, + "gst_charges": 4804.71, + "mrp_total": 302899, + "subtotal": 100899, + "total": 100899, + "vog": 96094.29, + "you_saved": 0 + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 302899, + "currency_code": "INR" + }, + { + "display": "Discount", + "key": "discount", + "value": -202000, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 100899, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 100899, + "currency_code": "INR" + } + ], + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + } + }, + "items": [ + { + "bulk_offer": {}, + "discount": "67% OFF", + "article": { + "type": "article", + "uid": "604_902_SSTC60401_636BLUE_1", + "size": "1", + "seller": { + "uid": 604, + "name": "SHRI SHANTINATH TRADING COMPANY" + }, + "store": { + "uid": 4579, + "name": "Gandhi Nagar" + }, + "quantity": 108, + "price": { + "base": { + "marked": 2999, + "effective": 999, + "currency_code": "INR" + }, + "converted": { + "marked": 2999, + "effective": 999, + "currency_code": "INR" + } + } + }, + "coupon_message": "", + "key": "707569_1", + "availability": { + "sizes": [ + "1", + "8", + "7", + "2", + "9", + "5", + "3", + "6" + ], + "other_store_quantity": 7, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 707569, + "name": "Blue and Gold Printed Ethnic Set", + "slug": "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a", + "brand": { + "uid": 902, + "name": "" + }, + "categories": [ + { + "uid": 525, + "name": "" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/v1/products/aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a/", + "query": { + "product_slug": [ + "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a" + ] + } + } + }, + "price": { + "base": { + "add_on": 100899, + "marked": 302899, + "effective": 100899, + "selling": 100899, + "currency_code": "INR" + }, + "converted": { + "add_on": 100899, + "marked": 302899, + "effective": 100899, + "selling": 100899, + "currency_code": "INR" + } + }, + "message": "", + "quantity": 101 + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "cart_id": 54, + "uid": "54", + "gstin": null, + "checkout_mode": "self", + "restrict_checkout": false, + "is_valid": false, + "last_modified": "Tue, 03 Sep 2019 09:55:40 GMT" + }, + "result": {} + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateCart +Update items in the cart + + + + +```swift +cart.updateCart(id: id, i: i, b: b, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | | +| i | Bool? | no | | +| b | Bool? | no | | +| body | UpdateCartRequest | yes | Request body | + + +

    Use this API to update items added to the cart with the help of a request object containing attributes like item_quantity and item_size. These attributes will be fetched from the following APIs

    • operation Operation for current api call. update_item for update items. remove_item for removing items.
    • item_id "/platform/content/v1/products/"
    • item_size "/platform/content/v1/products/:slug/sizes/"
    • quantity item quantity (must be greater than or equal to 1)
    • article_id "/content​/v1​/products​/:identifier​/sizes​/price​/"
    • item_index item position in the cart (must be greater than or equal to 0)
    + +*Returned Response:* + + + + +[UpdateCartDetailResponse](#UpdateCartDetailResponse) + +Success. Updates and returns a cart object as shown below. Refer `UpdateCartDetailResponse` for more details. + + + + +
    +  Examples: + + +
    +  Nothing updated + +```json +{ + "value": { + "cart": { + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": -202000, + "fynd_cash": 0, + "gst_charges": 4804.71, + "mrp_total": 302899, + "subtotal": 100899, + "total": 100899, + "vog": 96094.29, + "you_saved": 0 + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 302899, + "currency_code": "INR" + }, + { + "display": "Discount", + "key": "discount", + "value": -202000, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 100899, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 100899, + "currency_code": "INR" + } + ], + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + } + }, + "items": [ + { + "bulk_offer": {}, + "discount": "67% OFF", + "article": { + "type": "article", + "uid": "604_902_SSTC60401_636BLUE_1", + "size": "1", + "seller": { + "uid": 604, + "name": "SHRI SHANTINATH TRADING COMPANY" + }, + "store": { + "uid": 4579, + "name": "Gandhi Nagar" + }, + "quantity": 108, + "price": { + "base": { + "marked": 2999, + "effective": 999, + "currency_code": "INR" + }, + "converted": { + "marked": 2999, + "effective": 999, + "currency_code": "INR" + } + } + }, + "coupon_message": "", + "key": "707569_1", + "availability": { + "sizes": [ + "1", + "8", + "7", + "2", + "9", + "5", + "3", + "6" + ], + "other_store_quantity": 7, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 707569, + "name": "Blue and Gold Printed Ethnic Set", + "slug": "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a", + "brand": { + "uid": 902, + "name": "" + }, + "categories": [ + { + "uid": 525, + "name": "" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/v1/products/aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a/", + "query": { + "product_slug": [ + "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a" + ] + } + } + }, + "price": { + "base": { + "add_on": 100899, + "marked": 302899, + "effective": 100899, + "selling": 100899, + "currency_code": "INR" + }, + "converted": { + "add_on": 100899, + "marked": 302899, + "effective": 100899, + "selling": 100899, + "currency_code": "INR" + } + }, + "message": "", + "quantity": 101 + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "cart_id": 54, + "uid": "54", + "gstin": null, + "checkout_mode": "self", + "restrict_checkout": false, + "is_valid": true, + "last_modified": "Tue, 03 Sep 2019 10:19:20 GMT" + }, + "result": { + "707569_90": { + "success": true, + "message": "Nothing updated" + } + }, + "message": "Nothing updated", + "success": true + } +} +``` +
    + +
    +  Item updated in the cart + +```json +{ + "value": { + "cart": { + "breakup_values": { + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + }, + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + }, + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 838.83, + "mrp_total": 5499, + "subtotal": 5499, + "total": 5499, + "vog": 4660.17, + "you_saved": 0 + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 5499, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 5499, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 5499, + "currency_code": "INR" + } + ] + }, + "items": [ + { + "key": "437414_7", + "message": "", + "bulk_offer": {}, + "price": { + "base": { + "add_on": 5499, + "marked": 5499, + "effective": 5499, + "selling": 5499, + "currency_code": "INR" + }, + "converted": { + "add_on": 5499, + "marked": 5499, + "effective": 5499, + "selling": 5499, + "currency_code": "INR" + } + }, + "quantity": 1, + "discount": "", + "product": { + "type": "product", + "uid": 437414, + "name": "Suede Classic", + "slug": "puma-suede-classic-437414-6e6bbf", + "brand": { + "uid": 9, + "name": "Puma" + }, + "categories": [ + { + "uid": 165, + "name": "Outdoor Sports Shoes" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/9_35656851/1_1511171811830.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/9_35656851/1_1511171811830.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/puma-suede-classic-437414-6e6bbf/", + "query": { + "product_slug": [ + "puma-suede-classic-437414-6e6bbf" + ] + } + } + }, + "article": { + "type": "article", + "uid": "507_9_96099_35656851_7", + "size": "7", + "seller": { + "uid": 507, + "name": "PUMA SPORTS INDIA PVT LTD" + }, + "store": { + "uid": 3632, + "name": "Colaba Causway" + }, + "quantity": 5, + "price": { + "base": { + "marked": 5499, + "effective": 5499, + "currency_code": "INR" + }, + "converted": { + "marked": 5499, + "effective": 5499, + "currency_code": "INR" + } + } + }, + "coupon_message": "", + "availability": { + "sizes": [ + "10", + "11", + "6", + "9", + "7", + "8" + ], + "other_store_quantity": 22, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + } + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "cart_id": 12426, + "uid": "12426", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Thu, 22 Aug 2019 04:51:42 GMT", + "restrict_checkout": false, + "is_valid": true + }, + "result": { + "437414_7": { + "success": true, + "message": "Item updated in the bag" + } + }, + "message": "Item updated in the bag", + "success": true + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getItemCount +Count items in the cart + + + + +```swift +cart.getItemCount(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | The unique identifier of the cart. | + + + +Use this API to get the total number of items present in cart. + +*Returned Response:* + + + + +[CartItemCountResponse](#CartItemCountResponse) + +Success. Returns the total count of items in a user's cart. + + + + +
    +  Example: + +```json +{ + "user_cart_items_count": 0 +} +``` +
    + + + + + + + + + +--- + + +#### getCoupons +Fetch Coupon + + + + +```swift +cart.getCoupons(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | | + + + +Use this API to get a list of available coupons along with their details. + +*Returned Response:* + + + + +[GetCouponResponse](#GetCouponResponse) + +Success. Returns a coupon object which has a list of all the eligible coupons. Refer `GetCouponResponse` for more details. + + + + +
    +  Example: + +```json +{ + "available_coupon_list": [ + { + "coupon_value": 500, + "minimum_cart_value": 0, + "coupon_code": "RAJA500", + "title": "RAJA500 | Fynd coupon", + "sub_title": "NA", + "message": "TEST500", + "max_discount_value": 500, + "uid": 17921, + "is_applicable": true, + "is_applied": false, + "expires_on": "28 Aug, 19" + }, + { + "coupon_value": 2250, + "minimum_cart_value": 0, + "coupon_code": "PRISMC22250111", + "title": "celio 2 time coupn to kalim hsp", + "sub_title": "celio 2 time coupn to kalim hsp", + "message": "celio 2 time coupn to kalim hsp", + "max_discount_value": 2250, + "uid": 17743, + "is_applicable": true, + "is_applied": false, + "expires_on": "24 Jan, 20" + } + ], + "page": { + "current": 1, + "total": 0, + "has_previous": false, + "has_next": false, + "total_item_count": 0 + } +} +``` +
    + + + + + + + + + +--- + + +#### applyCoupon +Apply Coupon + + + + +```swift +cart.applyCoupon(i: i, b: b, p: p, id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| i | Bool? | no | | +| b | Bool? | no | | +| p | Bool? | no | | +| id | String? | no | | +| body | ApplyCouponRequest | yes | Request body | + + +Use this API to apply coupons on items in the cart. + +*Returned Response:* + + + + +[CartDetailResponse](#CartDetailResponse) + +Success. Returns coupons applied to the cart along with item details and price breakup. Refer `CartDetailResponse` for more details. + + + + +
    +  Example: + +```json +{ + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": -2250, + "delivery_charge": 0, + "discount": -7240.2163, + "fynd_cash": 0, + "gst_charges": 2139.08, + "mrp_total": 26983, + "subtotal": 19742.7837, + "total": 17492.7837, + "vog": 15353.7, + "you_saved": 0 + }, + "coupon": { + "type": "cash", + "code": "PRISMC22250111", + "uid": 17743, + "value": 2250, + "is_applied": true, + "message": "coupn applied" + }, + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 26983, + "currency_code": "INR" + }, + { + "display": "Discount", + "key": "discount", + "value": -7240, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 19743, + "currency_code": "INR" + }, + { + "display": "Coupon", + "key": "coupon", + "value": -2250, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 17493, + "currency_code": "INR" + } + ] + }, + "items": [ + { + "availability": { + "sizes": [ + "10" + ], + "other_store_quantity": 0, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 751083, + "name": "Carson 2", + "slug": "puma-carson-2-751083-6ad98d", + "brand": { + "uid": 9, + "name": "Puma" + }, + "categories": [ + { + "uid": 165, + "name": "Outdoor Sports Shoes" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/9_19100302/1_1542807042296.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/9_19100302/1_1542807042296.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/puma-carson-2-751083-6ad98d/", + "query": { + "product_slug": [ + "puma-carson-2-751083-6ad98d" + ] + } + } + }, + "quantity": 4, + "discount": "41% OFF", + "price": { + "base": { + "add_on": 9596, + "marked": 15996, + "effective": 9596, + "selling": 9596, + "currency_code": "INR" + }, + "converted": { + "add_on": 9596, + "marked": 15996, + "effective": 9596, + "selling": 9596, + "currency_code": "INR" + } + }, + "message": "", + "bulk_offer": {}, + "key": "751083_10", + "coupon_message": "", + "article": { + "type": "article", + "uid": "612_9_SE61201_19100302_10", + "size": "10", + "seller": { + "uid": 612, + "name": "SSR ENTERPRISE" + }, + "store": { + "uid": 4431, + "name": "Motilal Nagar 1, Goregaon" + }, + "quantity": 4, + "price": { + "base": { + "marked": 3999, + "effective": 2399, + "currency_code": "INR" + }, + "converted": { + "marked": 3999, + "effective": 2399, + "currency_code": "INR" + } + } + } + }, + { + "availability": { + "sizes": [ + "L", + "M", + "S", + "XL", + "XXL" + ], + "other_store_quantity": 0, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 246228, + "name": "Blue Solid T-Shirt", + "slug": "superdry-blue-solid-t-shirt-2", + "brand": { + "uid": 235, + "name": "Superdry" + }, + "categories": [ + { + "uid": 192, + "name": "T-Shirts" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/235_M11029ONDSXNS/1.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/235_M11029ONDSXNS/1.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/superdry-blue-solid-t-shirt-2/", + "query": { + "product_slug": [ + "superdry-blue-solid-t-shirt-2" + ] + } + } + }, + "quantity": 1, + "discount": "", + "price": { + "base": { + "add_on": 4490, + "marked": 4490, + "effective": 4490, + "selling": 4490, + "currency_code": "INR" + }, + "converted": { + "add_on": 4490, + "marked": 4490, + "effective": 4490, + "selling": 4490, + "currency_code": "INR" + } + }, + "message": "", + "bulk_offer": {}, + "key": "246228_S", + "coupon_message": "", + "article": { + "type": "article", + "uid": "46_235_TM62_M11029ONDSXNS_S", + "size": "S", + "seller": { + "uid": 46, + "name": "RELIANCE BRANDS LIMITED" + }, + "store": { + "uid": 4550, + "name": "VR Mall" + }, + "quantity": 1, + "price": { + "base": { + "marked": 4490, + "effective": 4490, + "currency_code": "INR" + }, + "converted": { + "marked": 4490, + "effective": 4490, + "currency_code": "INR" + } + } + } + }, + { + "availability": { + "sizes": [ + "XL", + "M", + "L", + "S" + ], + "other_store_quantity": 8, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 443175, + "name": "Light Blue Denim Jeggings", + "slug": "go-colors-light-blue-denim-jeggings-443175-3c688c", + "brand": { + "uid": 207, + "name": "Go Colors" + }, + "categories": [ + { + "uid": 267, + "name": "Jeggings" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/207_LJ03LBLUDN88/1_1512382513548.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/207_LJ03LBLUDN88/1_1512382513548.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/go-colors-light-blue-denim-jeggings-443175-3c688c/", + "query": { + "product_slug": [ + "go-colors-light-blue-denim-jeggings-443175-3c688c" + ] + } + } + }, + "quantity": 1, + "discount": "", + "price": { + "base": { + "add_on": 1599, + "marked": 1599, + "effective": 1599, + "selling": 1599, + "currency_code": "INR" + }, + "converted": { + "add_on": 1599, + "marked": 1599, + "effective": 1599, + "selling": 1599, + "currency_code": "INR" + } + }, + "message": "", + "bulk_offer": {}, + "key": "443175_S", + "coupon_message": "", + "article": { + "type": "article", + "uid": "162_207_1271_LJ03LBLUDN88_S", + "size": "S", + "seller": { + "uid": 162, + "name": "GO FASHION INDIA PRIVATE LIMITED" + }, + "store": { + "uid": 5784, + "name": "Vega City mall" + }, + "quantity": 3, + "price": { + "base": { + "marked": 1599, + "effective": 1599, + "currency_code": "INR" + }, + "converted": { + "marked": 1599, + "effective": 1599, + "currency_code": "INR" + } + } + } + }, + { + "availability": { + "sizes": [ + "OS" + ], + "other_store_quantity": 12, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 842716, + "name": "Blue Backpack", + "slug": "istorm-blue-backpack-842716-951b5a", + "brand": { + "uid": 1177, + "name": "iStorm" + }, + "categories": [ + { + "uid": 198, + "name": "Backpacks" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1177_IS483/1_1551353288247.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1177_IS483/1_1551353288247.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/istorm-blue-backpack-842716-951b5a/", + "query": { + "product_slug": [ + "istorm-blue-backpack-842716-951b5a" + ] + } + } + }, + "quantity": 1, + "discount": "34% OFF", + "price": { + "base": { + "add_on": 998.7837, + "marked": 1499, + "effective": 998.7837, + "selling": 998.7837, + "currency_code": "INR" + }, + "converted": { + "add_on": 998.7837, + "marked": 1499, + "effective": 998.7837, + "selling": 998.7837, + "currency_code": "INR" + } + }, + "message": "", + "bulk_offer": {}, + "key": "842716_OS", + "coupon_message": "", + "article": { + "type": "article", + "uid": "638_1177_CRSL63802_IS483_OS", + "size": "OS", + "seller": { + "uid": 638, + "name": "COUNFREEDISE RETAIL SERVICES LTD" + }, + "store": { + "uid": 4630, + "name": "Bhiwandi" + }, + "quantity": 4, + "price": { + "base": { + "marked": 1499, + "effective": 998.7837, + "currency_code": "INR" + }, + "converted": { + "marked": 1499, + "effective": 998.7837, + "currency_code": "INR" + } + } + } + }, + { + "availability": { + "sizes": [ + "OS" + ], + "other_store_quantity": 2, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 778937, + "name": "Colourful Carnival Bouncer", + "slug": "fisher-price-colourful-carnival-bouncer-778937-fafa1f", + "brand": { + "uid": 963, + "name": "Fisher-Price" + }, + "categories": [ + { + "uid": 576, + "name": "Cradles" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/963_PWUPC01977/1_1545308400588.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/963_PWUPC01977/1_1545308400588.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/fisher-price-colourful-carnival-bouncer-778937-fafa1f/", + "query": { + "product_slug": [ + "fisher-price-colourful-carnival-bouncer-778937-fafa1f" + ] + } + } + }, + "quantity": 1, + "discount": "11% OFF", + "price": { + "base": { + "add_on": 3059, + "marked": 3399, + "effective": 3059, + "selling": 3059, + "currency_code": "INR" + }, + "converted": { + "add_on": 3059, + "marked": 3399, + "effective": 3059, + "selling": 3059, + "currency_code": "INR" + } + }, + "message": "", + "bulk_offer": {}, + "key": "778937_OS", + "coupon_message": "", + "article": { + "type": "article", + "uid": "686_963_IC68601_PWUPC01977_OS", + "size": "OS", + "seller": { + "uid": 686, + "name": "INDUS CORPORATION" + }, + "store": { + "uid": 5059, + "name": "Vidyaranyapura Main Road" + }, + "quantity": 3, + "price": { + "base": { + "marked": 3399, + "effective": 3059, + "currency_code": "INR" + }, + "converted": { + "marked": 3399, + "effective": 3059, + "currency_code": "INR" + } + } + } + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "cart_id": 7927, + "uid": "7927", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Wed, 04 Sep 2019 04:52:21 GMT", + "restrict_checkout": false, + "is_valid": true +} +``` +
    + + + + + + + + + +--- + + +#### removeCoupon +Remove Coupon Applied + + + + +```swift +cart.removeCoupon(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | The unique identifier of the cart | + + + +Remove Coupon applied on the cart by passing uid in request body. + +*Returned Response:* + + + + +[CartDetailResponse](#CartDetailResponse) + +Success. Returns coupons removed from the cart along with item details and price breakup. Refer `CartDetailResponse` for more details. + + + + +
    +  Example: + +```json +{ + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 342.75, + "mrp_total": 3199, + "subtotal": 3199, + "total": 3199, + "vog": 2856.25, + "you_saved": 0 + }, + "coupon": { + "type": "cash", + "code": "prismc22250111", + "uid": 17743, + "value": 0, + "is_applied": false, + "message": "Coupon successfully removed" + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 3199, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 3199, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 3199, + "currency_code": "INR" + } + ], + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + } + }, + "items": [ + { + "message": "", + "availability": { + "sizes": [ + "M", + "S", + "L", + "XXL", + "XL" + ], + "other_store_quantity": 10, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "bulk_offer": {}, + "key": "857596_S", + "quantity": 1, + "price": { + "base": { + "add_on": 3199, + "marked": 3199, + "effective": 3199, + "selling": 3199, + "currency_code": "INR" + }, + "converted": { + "add_on": 3199, + "marked": 3199, + "effective": 3199, + "selling": 3199, + "currency_code": "INR" + } + }, + "discount": "", + "coupon_message": "", + "product": { + "type": "product", + "uid": 857596, + "name": "Pink Solid Hoodie", + "slug": "883-police-pink-solid-hoodie-857596-111bdc", + "brand": { + "uid": 610, + "name": "883 Police" + }, + "categories": [ + { + "uid": 144, + "name": "Hoodies" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/883-police-pink-solid-hoodie-857596-111bdc/", + "query": { + "product_slug": [ + "883-police-pink-solid-hoodie-857596-111bdc" + ] + } + } + }, + "article": { + "type": "article", + "uid": "381_610_IGPL01_LETTER19APINK_S", + "size": "S", + "seller": { + "uid": 381, + "name": "INTERSOURCE GARMENTS PVT LTD" + }, + "store": { + "uid": 3009, + "name": "Kormangala" + }, + "quantity": 11, + "price": { + "base": { + "marked": 3199, + "effective": 3199, + "currency_code": "INR" + }, + "converted": { + "marked": 3199, + "effective": 3199, + "currency_code": "INR" + } + } + } + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "cart_id": 7477, + "uid": "7477", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Thu, 22 Aug 2019 10:55:05 GMT", + "restrict_checkout": false, + "is_valid": true +} +``` +
    + + + + + + + + + +--- + + +#### getBulkDiscountOffers +Get discount offers based on quantity + + + + +```swift +cart.getBulkDiscountOffers(itemId: itemId, articleId: articleId, uid: uid, slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| itemId | Int? | no | The Item ID of the product | +| articleId | String? | no | Article Mongo ID | +| uid | Int? | no | UID of the product | +| slug | String? | no | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | + + + +Use this API to get a list of applicable offers along with current, next and best offer for given product. Either one of uid, item_id, slug should be present. + +*Returned Response:* + + + + +[BulkPriceResponse](#BulkPriceResponse) + +Success. Returns a data object containing the seller details and available offers (if exists) on bulk products. Refer `BulkPriceResponse` for more details. + + + + +
    +  Examples: + + +
    +  Offers found + +```json +{ + "value": { + "data": [ + { + "seller": { + "uid": 248, + "name": "MANYAVAR CREATIONS PRIVATE LIMITED" + }, + "offers": [ + { + "quantity": 1, + "auto_applied": true, + "margin": 10, + "type": "bundle", + "price": { + "marked": 3999, + "effective": 3999, + "bulk_effective": 3599.1, + "currency_code": "INR" + }, + "total": 3599.1 + }, + { + "quantity": 3, + "auto_applied": true, + "margin": 20, + "type": "bundle", + "price": { + "marked": 3999, + "effective": 3999, + "bulk_effective": 3199.2, + "currency_code": "INR" + }, + "total": 9597.6 + }, + { + "quantity": 9, + "auto_applied": true, + "margin": 30, + "type": "bundle", + "price": { + "marked": 3999, + "effective": 3999, + "bulk_effective": 3443.4444444444, + "currency_code": "INR" + }, + "total": 30991, + "best": true + } + ] + } + ] + } +} +``` +
    + +
    +  Offers not found + +```json +{ + "value": { + "data": [] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### applyRewardPoints +Apply reward points at cart + + + + +```swift +cart.applyRewardPoints(id: id, i: i, b: b, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | | +| i | Bool? | no | | +| b | Bool? | no | | +| body | RewardPointRequest | yes | Request body | + + +Use this API to redeem a fixed no. of reward points by applying it to the cart. + +*Returned Response:* + + + + +[CartDetailResponse](#CartDetailResponse) + +Success. Returns a Cart object. Check the example shown below or refer `CartDetailResponse` for more details. + + + + +
    +  Example: + +```json +{ + "items": [ + { + "bulk_offer": {}, + "discount": "67% OFF", + "article": { + "type": "article", + "uid": "604_902_SSTC60401_636BLUE_1", + "size": "1", + "seller": { + "uid": 604, + "name": "SHRI SHANTINATH TRADING COMPANY" + }, + "store": { + "uid": 4579, + "name": "Gandhi Nagar" + }, + "quantity": 108, + "price": { + "base": { + "marked": 2999, + "effective": 999, + "currency_code": "INR" + }, + "converted": { + "marked": 2999, + "effective": 999, + "currency_code": "INR" + } + } + }, + "coupon_message": "", + "key": "707569_1", + "availability": { + "sizes": [ + "1", + "8", + "7", + "2", + "9", + "5", + "3", + "6" + ], + "other_store_quantity": 107, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 707569, + "name": "Blue and Gold Printed Ethnic Set", + "slug": "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a", + "brand": { + "uid": 902, + "name": "" + }, + "categories": [ + { + "uid": 525, + "name": "" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/v1/products/aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a/", + "query": { + "product_slug": [ + "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a" + ] + } + } + }, + "price": { + "base": { + "add_on": 999, + "marked": 2999, + "effective": 999, + "selling": 999, + "currency_code": "INR" + }, + "converted": { + "add_on": 999, + "marked": 2999, + "effective": 999, + "selling": 999, + "currency_code": "INR" + } + }, + "message": "", + "quantity": 1 + } + ], + "cart_id": 54, + "uid": "54", + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": -2000, + "fynd_cash": 0, + "gst_charges": 47.57, + "mrp_total": 2999, + "subtotal": 999, + "total": 999, + "vog": 951.43, + "you_saved": 0 + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 2999, + "currency_code": "INR" + }, + { + "display": "Discount", + "key": "discount", + "value": -2000, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 999, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 999, + "currency_code": "INR" + } + ], + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + } + }, + "delivery_charge_info": "", + "coupon_text": "View all offers", + "gstin": null, + "checkout_mode": "self", + "restrict_checkout": false, + "is_valid": true, + "last_modified": "Tue, 03 Sep 2019 05:35:59 GMT" +} +``` +
    + + + + + + + + + +--- + + +#### getAddresses +Fetch address + + + + +```swift +cart.getAddresses(cartId: cartId, mobileNo: mobileNo, checkoutMode: checkoutMode, tags: tags, isDefault: isDefault) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| cartId | String? | no | | +| mobileNo | String? | no | | +| checkoutMode | String? | no | | +| tags | String? | no | | +| isDefault | Bool? | no | | + + + +Use this API to get all the addresses associated with an account. If successful, returns a Address resource in the response body specified in GetAddressesResponse.attibutes listed below are optional
    • uid
    • address_id
    • mobile_no
    • checkout_mode
    • tags
    • default
    + +*Returned Response:* + + + + +[GetAddressesResponse](#GetAddressesResponse) + +Success. Returns an Address object containing a list of address saved in the account. Refer `GetAddressesResponse` for more details. + + + + +
    +  Example: + +```json +{ + "address": [ + { + "landmark": "", + "area_code": { + "slug": "pincode", + "id": 400093 + }, + "id": "8b526f521bb14a2593a8b9e3ce8c76b3", + "state": "Maharashtra", + "meta": {}, + "user_id": "8b526f521bb14a2593a8b9e3ce8c76b3", + "country_code": "IND", + "phone": 9915347757, + "geo_location": {}, + "country": "India", + "is_default_address": true, + "is_active": true, + "city": "Mumbai", + "pincode": 400093, + "checkout_mode": "self", + "address_type": "home", + "tags": [], + "area": "Sector 127", + "name": "abc", + "email": "ankur@gofynd1.com", + "address": "Megatron2", + "store_name": "store123" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### addAddress +Add address to an account + + + + +```swift +cart.addAddress(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | Address | yes | Request body | + + +Use this API to add an address to an account. + +*Returned Response:* + + + + +[SaveAddressResponse](#SaveAddressResponse) + +Success. Returns the address ID, a flag whether the address is set as default, and a success message. Refer `SaveAddressResponse` for more details. + + + + +
    +  Example: + +```json +{ + "id": "mongo_object_id", + "is_default_address": true, + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getAddressById +Fetch a single address by its ID + + + + +```swift +cart.getAddressById(id: id, cartId: cartId, mobileNo: mobileNo, checkoutMode: checkoutMode, tags: tags, isDefault: isDefault) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | | +| cartId | String? | no | | +| mobileNo | String? | no | | +| checkoutMode | String? | no | | +| tags | String? | no | | +| isDefault | Bool? | no | | + + + +Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional
    • mobile_no
    • checkout_mode
    • tags
    • default
    + +*Returned Response:* + + + + +[Address](#Address) + +Success. Returns an Address object containing a list of address saved in the account. Refer `Address` for more details. + + + + +
    +  Example: + +```json +{ + "landmark": "", + "area_code": { + "slug": "pincode", + "id": 400093 + }, + "state": "Maharashtra", + "meta": {}, + "user_id": "8b526f521bb14a2593a8b9e3ce8c76b3", + "country_code": "IND", + "phone": 9915347757, + "geo_location": {}, + "country": "India", + "is_default_address": true, + "is_active": true, + "city": "Mumbai", + "pincode": 400093, + "checkout_mode": "self", + "address_type": "home", + "uid": 1145, + "tags": [], + "area": "Sector 127", + "name": "abc", + "address_id": 1145, + "email": "ankur@gofynd1.com", + "address": "Megatron2", + "store_name": "store123" +} +``` +
    + + + + + + + + + +--- + + +#### updateAddress +Update address added to an account + + + + +```swift +cart.updateAddress(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | ID allotted to the selected address | +| body | Address | yes | Request body | + + +

    Use this API to update an existing address in the account. Request object should contain attributes mentioned in Address can be updated. These attributes are:

    • is_default_address
    • landmark
    • area
    • pincode
    • email
    • address_type
    • name
    • address_id
    • address
    + +*Returned Response:* + + + + +[UpdateAddressResponse](#UpdateAddressResponse) + +Success. Returns the address ID and a message indicating a successful address updation. + + + + +
    +  Example: + +```json +{ + "is_updated": true, + "id": "", + "is_default_address": true, + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### removeAddress +Remove address associated with an account + + + + +```swift +cart.removeAddress(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | ID allotted to the selected address | + + + +Use this API to delete an address by its ID. This will returns an object that will indicate whether the address was deleted successfully or not. + +*Returned Response:* + + + + +[DeleteAddressResponse](#DeleteAddressResponse) + +Returns a Status object indicating the success or failure of address deletion. + + + + +
    +  Example: + +```json +{ + "id": "", + "is_deleted": true +} +``` +
    + + + + + + + + + +--- + + +#### selectAddress +Select an address from available addresses + + + + +```swift +cart.selectAddress(cartId: cartId, i: i, b: b, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| cartId | String? | no | | +| i | Bool? | no | | +| b | Bool? | no | | +| body | SelectCartAddressRequest | yes | Request body | + + +

    Select Address from all addresses associated with the account in order to ship the cart items to that address, otherwise default address will be selected implicitly. See `SelectCartAddressRequest` in schema of request body for the list of attributes needed to select Address from account. On successful request, this API returns a Cart object. Below address attributes are required.

    • address_id
    • billing_address_id
    • uid

    + +*Returned Response:* + + + + +[CartDetailResponse](#CartDetailResponse) + +Success. Returns a Cart object as shown below. Refer `CartDetailResponse` for more details. . + + + + +
    +  Example: + +```json +{ + "is_valid": true, + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": -2250, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 315.86, + "mrp_total": 5198, + "subtotal": 5198, + "total": 2948, + "vog": 2632.15, + "you_saved": 0 + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 5198, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 5198, + "currency_code": "INR" + }, + { + "display": "Coupon", + "key": "coupon", + "value": -2250, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 2948, + "currency_code": "INR" + } + ], + "coupon": { + "type": "cash", + "code": "PRISMC22250111", + "uid": 17743, + "value": 2250, + "is_applied": true, + "message": "coupn applied" + }, + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + } + }, + "items": [ + { + "message": "", + "quantity": 1, + "availability": { + "sizes": [ + "M", + "S", + "L", + "XXL", + "XL" + ], + "other_store_quantity": 10, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "coupon_message": "PRISMC22250111 coupon applied", + "price": { + "base": { + "add_on": 3199, + "marked": 3199, + "effective": 3199, + "selling": 3199, + "currency_code": "INR" + }, + "converted": { + "add_on": 3199, + "marked": 3199, + "effective": 3199, + "selling": 3199, + "currency_code": "INR" + } + }, + "bulk_offer": {}, + "article": { + "type": "article", + "uid": "381_610_IGPL01_LETTER19APINK_S", + "size": "S", + "seller": { + "uid": 381, + "name": "INTERSOURCE GARMENTS PVT LTD" + }, + "store": { + "uid": 3009, + "name": "Kormangala" + }, + "quantity": 11, + "price": { + "base": { + "marked": 3199, + "effective": 3199, + "currency_code": "INR" + }, + "converted": { + "marked": 3199, + "effective": 3199, + "currency_code": "INR" + } + } + }, + "product": { + "type": "product", + "uid": 857596, + "name": "Pink Solid Hoodie", + "slug": "883-police-pink-solid-hoodie-857596-111bdc", + "brand": { + "uid": 610, + "name": "883 Police" + }, + "categories": [ + { + "uid": 144, + "name": "Hoodies" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/883-police-pink-solid-hoodie-857596-111bdc/", + "query": { + "product_slug": [ + "883-police-pink-solid-hoodie-857596-111bdc" + ] + } + } + }, + "key": "857596_S", + "discount": "" + }, + { + "message": "", + "quantity": 1, + "availability": { + "sizes": [ + "L", + "XL", + "XXL" + ], + "other_store_quantity": 1, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "coupon_message": "PRISMC22250111 coupon applied", + "price": { + "base": { + "add_on": 1999, + "marked": 1999, + "effective": 1999, + "selling": 1999, + "currency_code": "INR" + }, + "converted": { + "add_on": 1999, + "marked": 1999, + "effective": 1999, + "selling": 1999, + "currency_code": "INR" + } + }, + "bulk_offer": {}, + "article": { + "type": "article", + "uid": "381_610_IGPL01_SPIRAL19ANAVY_L", + "size": "L", + "seller": { + "uid": 381, + "name": "INTERSOURCE GARMENTS PVT LTD" + }, + "store": { + "uid": 3009, + "name": "Kormangala" + }, + "quantity": 2, + "price": { + "base": { + "marked": 1999, + "effective": 1999, + "currency_code": "INR" + }, + "converted": { + "marked": 1999, + "effective": 1999, + "currency_code": "INR" + } + } + }, + "product": { + "type": "product", + "uid": 820312, + "name": "Navy Blue Melange Shorts", + "slug": "883-police-navy-blue-melange-shorts-820312-4943a8", + "brand": { + "uid": 610, + "name": "883 Police" + }, + "categories": [ + { + "uid": 193, + "name": "Shorts" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/883-police-navy-blue-melange-shorts-820312-4943a8/", + "query": { + "product_slug": [ + "883-police-navy-blue-melange-shorts-820312-4943a8" + ] + } + } + }, + "key": "820312_L", + "discount": "" + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "uid": "7477", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Fri, 23 Aug 2019 08:03:12 GMT", + "restrict_checkout": false +} +``` +
    + + + + + + + + + +--- + + +#### selectPaymentMode +Update cart payment + + + + +```swift +cart.selectPaymentMode(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | | +| body | UpdateCartPaymentRequest | yes | Request body | + + +Use this API to update cart payment. + +*Returned Response:* + + + + +[CartDetailResponse](#CartDetailResponse) + +Success. Returns a Cart object as shown below. Refer `CartDetailResponse` for more details. + + + + +
    +  Example: + +```json +{ + "success": true, + "error_message": "Note: Your order delivery will be delayed by 7-10 Days", + "user_type": "Store User", + "cod_charges": 0, + "order_id": null, + "cod_available": true, + "cod_message": "No additional COD charges applicable", + "delivery_charges": 0, + "delivery_charge_order_value": 0, + "store_code": "", + "store_emps": [], + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": -2250, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 315.86, + "mrp_total": 5198, + "subtotal": 5198, + "total": 2948, + "vog": 2632.15, + "you_saved": 0 + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 5198, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 5198, + "currency_code": "INR" + }, + { + "display": "Coupon", + "key": "coupon", + "value": -2250, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 2948, + "currency_code": "INR" + } + ], + "coupon": { + "type": "cash", + "code": "PRISMC22250111", + "uid": 17743, + "value": 2250, + "is_applied": true, + "message": "coupn applied" + }, + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + } + }, + "items": [ + { + "message": "", + "quantity": 1, + "availability": { + "sizes": [ + "M", + "S", + "L", + "XXL", + "XL" + ], + "other_store_quantity": 10, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "coupon_message": "PRISMC22250111 coupon applied", + "price": { + "base": { + "add_on": 3199, + "marked": 3199, + "effective": 3199, + "selling": 3199, + "currency_code": "INR" + }, + "converted": { + "add_on": 3199, + "marked": 3199, + "effective": 3199, + "selling": 3199, + "currency_code": "INR" + } + }, + "bulk_offer": {}, + "article": { + "type": "article", + "uid": "381_610_IGPL01_LETTER19APINK_S", + "size": "S", + "seller": { + "uid": 381, + "name": "INTERSOURCE GARMENTS PVT LTD" + }, + "store": { + "uid": 3009, + "name": "Kormangala" + }, + "quantity": 11, + "price": { + "base": { + "marked": 3199, + "effective": 3199, + "currency_code": "INR" + }, + "converted": { + "marked": 3199, + "effective": 3199, + "currency_code": "INR" + } + } + }, + "product": { + "type": "product", + "uid": 857596, + "name": "Pink Solid Hoodie", + "slug": "883-police-pink-solid-hoodie-857596-111bdc", + "brand": { + "uid": 610, + "name": "883 Police" + }, + "categories": [ + { + "uid": 144, + "name": "Hoodies" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/883-police-pink-solid-hoodie-857596-111bdc/", + "query": { + "product_slug": [ + "883-police-pink-solid-hoodie-857596-111bdc" + ] + } + } + }, + "key": "857596_S", + "discount": "" + }, + { + "message": "", + "quantity": 1, + "availability": { + "sizes": [ + "L", + "XL", + "XXL" + ], + "other_store_quantity": 1, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "coupon_message": "PRISMC22250111 coupon applied", + "price": { + "base": { + "add_on": 1999, + "marked": 1999, + "effective": 1999, + "selling": 1999, + "currency_code": "INR" + }, + "converted": { + "add_on": 1999, + "marked": 1999, + "effective": 1999, + "selling": 1999, + "currency_code": "INR" + } + }, + "bulk_offer": {}, + "article": { + "type": "article", + "uid": "381_610_IGPL01_SPIRAL19ANAVY_L", + "size": "L", + "seller": { + "uid": 381, + "name": "INTERSOURCE GARMENTS PVT LTD" + }, + "store": { + "uid": 3009, + "name": "Kormangala" + }, + "quantity": 2, + "price": { + "base": { + "marked": 1999, + "effective": 1999, + "currency_code": "INR" + }, + "converted": { + "marked": 1999, + "effective": 1999, + "currency_code": "INR" + } + } + }, + "product": { + "type": "product", + "uid": 820312, + "name": "Navy Blue Melange Shorts", + "slug": "883-police-navy-blue-melange-shorts-820312-4943a8", + "brand": { + "uid": 610, + "name": "883 Police" + }, + "categories": [ + { + "uid": 193, + "name": "Shorts" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/883-police-navy-blue-melange-shorts-820312-4943a8/", + "query": { + "product_slug": [ + "883-police-navy-blue-melange-shorts-820312-4943a8" + ] + } + } + }, + "key": "820312_L", + "discount": "" + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "cart_id": 7477, + "uid": "7477", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Fri, 23 Aug 2019 08:03:04 GMT", + "restrict_checkout": false, + "is_valid": true +} +``` +
    + + + + + + + + + +--- + + +#### validateCouponForPayment +Verify the coupon eligibility against the payment mode + + + + +```swift +cart.validateCouponForPayment(id: id, addressId: addressId, paymentMode: paymentMode, paymentIdentifier: paymentIdentifier, aggregatorName: aggregatorName, merchantCode: merchantCode) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | | +| addressId | String? | no | | +| paymentMode | String? | no | | +| paymentIdentifier | String? | no | | +| aggregatorName | String? | no | | +| merchantCode | String? | no | | + + + +Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc. + +*Returned Response:* + + + + +[PaymentCouponValidate](#PaymentCouponValidate) + +Success. Returns a success message and the coupon validity. Refer `PaymentCouponValidate` for more details. + + + + +
    +  Example: + +```json +{ + "success": true, + "message": "", + "coupon_validity": { + "valid": true, + "discount": 499.5, + "code": "testpayment", + "display_message_en": "", + "title": "Coupon value will change." + } +} +``` +
    + + + + + + + + + +--- + + +#### getShipments +Get delivery date and options before checkout + + + + +```swift +cart.getShipments(p: p, id: id, addressId: addressId, areaCode: areaCode) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| p | Bool? | no | This is a boolean value. Select `true` for getting a payment option in response. | +| id | String? | no | The unique identifier of the cart | +| addressId | String? | no | ID allotted to the selected address | +| areaCode | String? | no | The PIN Code of the destination address, e.g. 400059 | + + + +Use this API to get shipment details, expected delivery date, items and price breakup of the shipment. + +*Returned Response:* + + + + +[CartShipmentsResponse](#CartShipmentsResponse) + +Success. Returns delivery promise along with shipment details and price breakup. Refer `CartShipmentsResponse` for more details. + + + + +
    +  Examples: + + +
    +  Shipment Generated + +```json +{ + "value": { + "items": [], + "cart_id": 7501, + "uid": "7501", + "success": true, + "error_message": "Note: Your order delivery will be delayed by 7-10 Days", + "payment_options": { + "payment_option": [ + { + "name": "COD", + "display_name": "Cash on Delivery", + "display_priority": 1, + "payment_mode_id": 11, + "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png" + }, + "list": [] + }, + { + "name": "CARD", + "display_priority": 2, + "payment_mode_id": 2, + "display_name": "Card", + "list": [] + }, + { + "name": "NB", + "display_priority": 3, + "payment_mode_id": 3, + "display_name": "Net Banking", + "list": [ + { + "aggregator_name": "Razorpay", + "bank_name": "ICICI Bank", + "bank_code": "ICIC", + "url": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png" + }, + "merchant_code": "NB_ICICI", + "display_priority": 1 + } + ] + }, + { + "name": "WL", + "display_priority": 4, + "payment_mode_id": 4, + "display_name": "Wallet", + "list": [ + { + "wallet_name": "Paytm", + "wallet_code": "paytm", + "wallet_id": 4, + "merchant_code": "PAYTM", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_small.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_large.png" + }, + "aggregator_name": "Juspay", + "display_priority": 1 + } + ] + }, + { + "name": "UPI", + "display_priority": 9, + "payment_mode_id": 6, + "display_name": "UPI", + "list": [ + { + "aggregator_name": "UPI_Razorpay", + "name": "UPI", + "display_name": "BHIM UPI", + "code": "UPI", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_100x78.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_150x100.png" + }, + "merchant_code": "UPI", + "timeout": 240, + "retry_count": 0, + "fynd_vpa": "shopsense.rzp@hdfcbank", + "intent_flow": true, + "intent_app_error_list": [ + "com.csam.icici.bank.imobile", + "in.org.npci.upiapp", + "com.whatsapp" + ] + } + ] + }, + { + "name": "PL", + "display_priority": 11, + "payment_mode_id": 1, + "display_name": "Pay Later", + "list": [ + { + "aggregator_name": "Simpl", + "name": "Simpl", + "code": "simpl", + "merchant_code": "SIMPL", + "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png" + } + } + ] + } + ], + "payment_flows": { + "Simpl": { + "data": { + "gateway": { + "route": "simpl", + "entity": "sdk", + "is_customer_validation_required": true, + "cust_validation_url": "https://api.addsale.com/gringotts/api/v1/validate-customer/", + "sdk": { + "config": { + "redirect": false, + "callback_url": null, + "action_url": "https://api.addsale.com/avis/api/v1/payments/charge-gringotts-transaction/" + }, + "data": { + "user_phone": "8452996729", + "user_email": "paymentsdummy@gofynd.com" + } + }, + "return_url": null + } + }, + "api_link": "", + "payment_flow": "sdk" + }, + "Juspay": { + "data": {}, + "api_link": "https://sandbox.juspay.in/txns", + "payment_flow": "api" + }, + "Razorpay": { + "data": {}, + "api_link": "", + "payment_flow": "sdk" + }, + "UPI_Razorpay": { + "data": {}, + "api_link": "https://api.addsale.com/gringotts/api/v1/external/payment-initialisation/", + "payment_flow": "api" + }, + "Fynd": { + "data": {}, + "api_link": "", + "payment_flow": "api" + } + }, + "default": {} + }, + "user_type": "Store User", + "cod_charges": 0, + "order_id": null, + "cod_available": true, + "cod_message": "No additional COD charges applicable", + "delivery_charges": 0, + "delivery_charge_order_value": 0, + "delivery_slots": [ + { + "date": "Sat, 24 Aug", + "delivery_slot": [ + { + "delivery_slot_timing": "By 9:00 PM", + "default": true, + "delivery_slot_id": 1 + } + ] + } + ], + "store_code": "", + "store_emps": [], + "breakup_values": { + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + }, + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 214.18, + "mrp_total": 1999, + "subtotal": 1999, + "total": 1999, + "vog": 1784.82, + "you_saved": 0 + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 1999, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 1999, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 1999, + "currency_code": "INR" + } + ] + }, + "shipments": [ + { + "fulfillment_id": 3009, + "shipment_type": "single_shipment", + "fulfillment_type": "store", + "dp_id": "29", + "dp_options": { + "4": { + "f_priority": 4, + "r_priority": 5, + "is_cod": true, + "is_prepaid": true, + "is_reverse": true + }, + "7": { + "f_priority": 3, + "r_priority": 4, + "is_cod": true, + "is_prepaid": true, + "is_reverse": true + }, + "29": { + "f_priority": 1, + "r_priority": 2, + "is_cod": true, + "is_prepaid": true, + "is_reverse": true + } + }, + "promise": { + "timestamp": { + "min": 1566678108, + "max": 1567023708 + }, + "formatted": { + "min": "Aug 24", + "max": "Aug 28" + } + }, + "box_type": "Small Courier bag", + "shipments": 1, + "items": [ + { + "quantity": 1, + "product": { + "type": "product", + "uid": 820312, + "name": "Navy Blue Melange Shorts", + "slug": "883-police-navy-blue-melange-shorts-820312-4943a8", + "brand": { + "uid": 610, + "name": "883 Police" + }, + "categories": [ + { + "uid": 193, + "name": "Shorts" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/883-police-navy-blue-melange-shorts-820312-4943a8/", + "query": { + "product_slug": [ + "883-police-navy-blue-melange-shorts-820312-4943a8" + ] + } + } + }, + "discount": "", + "bulk_offer": {}, + "key": "820312_L", + "price": { + "base": { + "add_on": 1999, + "marked": 1999, + "effective": 1999, + "selling": 1999, + "currency_code": "INR" + }, + "converted": { + "add_on": 1999, + "marked": 1999, + "effective": 1999, + "selling": 1999, + "currency_code": "INR" + } + }, + "article": { + "type": "article", + "uid": "381_610_IGPL01_SPIRAL19ANAVY_L", + "size": "L", + "seller": { + "uid": 381, + "name": "INTERSOURCE GARMENTS PVT LTD" + }, + "store": { + "uid": 3009, + "name": "Kormangala" + }, + "quantity": 2, + "price": { + "base": { + "marked": 1999, + "effective": 1999, + "currency_code": "INR" + }, + "converted": { + "marked": 1999, + "effective": 1999, + "currency_code": "INR" + } + } + }, + "availability": { + "sizes": [ + "L", + "XL", + "XXL" + ], + "other_store_quantity": 1, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "coupon_message": "", + "message": "" + } + ] + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Thu, 22 Aug 2019 20:21:48 GMT", + "restrict_checkout": false, + "is_valid": true + } +} +``` +
    + +
    +  Shipment Generation Failed + +```json +{ + "value": { + "items": [], + "cart_id": 7501, + "uid": "7501", + "success": true, + "error_message": "Note: Your order delivery will be delayed by 7-10 Days", + "payment_options": { + "payment_option": [ + { + "name": "COD", + "display_name": "Cash on Delivery", + "display_priority": 1, + "payment_mode_id": 11, + "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png" + }, + "list": [] + }, + { + "name": "CARD", + "display_priority": 2, + "payment_mode_id": 2, + "display_name": "Card", + "list": [] + }, + { + "name": "NB", + "display_priority": 3, + "payment_mode_id": 3, + "display_name": "Net Banking", + "list": [ + { + "aggregator_name": "Razorpay", + "bank_name": "ICICI Bank", + "bank_code": "ICIC", + "url": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png" + }, + "merchant_code": "NB_ICICI", + "display_priority": 1 + } + ] + }, + { + "name": "WL", + "display_priority": 4, + "payment_mode_id": 4, + "display_name": "Wallet", + "list": [ + { + "wallet_name": "Paytm", + "wallet_code": "paytm", + "wallet_id": 4, + "merchant_code": "PAYTM", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_small.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_large.png" + }, + "aggregator_name": "Juspay", + "display_priority": 1 + } + ] + }, + { + "name": "UPI", + "display_priority": 9, + "payment_mode_id": 6, + "display_name": "UPI", + "list": [ + { + "aggregator_name": "UPI_Razorpay", + "name": "UPI", + "display_name": "BHIM UPI", + "code": "UPI", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_100x78.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_150x100.png" + }, + "merchant_code": "UPI", + "timeout": 240, + "retry_count": 0, + "fynd_vpa": "shopsense.rzp@hdfcbank", + "intent_flow": true, + "intent_app_error_list": [ + "com.csam.icici.bank.imobile", + "in.org.npci.upiapp", + "com.whatsapp" + ] + } + ] + }, + { + "name": "PL", + "display_priority": 11, + "payment_mode_id": 1, + "display_name": "Pay Later", + "list": [ + { + "aggregator_name": "Simpl", + "name": "Simpl", + "code": "simpl", + "merchant_code": "SIMPL", + "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png" + } + } + ] + } + ], + "payment_flows": { + "Simpl": { + "data": { + "gateway": { + "route": "simpl", + "entity": "sdk", + "is_customer_validation_required": true, + "cust_validation_url": "https://api.addsale.com/gringotts/api/v1/validate-customer/", + "sdk": { + "config": { + "redirect": false, + "callback_url": null, + "action_url": "https://api.addsale.com/avis/api/v1/payments/charge-gringotts-transaction/" + }, + "data": { + "user_phone": "8452996729", + "user_email": "paymentsdummy@gofynd.com" + } + }, + "return_url": null + } + }, + "api_link": "", + "payment_flow": "sdk" + }, + "Juspay": { + "data": {}, + "api_link": "https://sandbox.juspay.in/txns", + "payment_flow": "api" + }, + "Razorpay": { + "data": {}, + "api_link": "", + "payment_flow": "sdk" + }, + "UPI_Razorpay": { + "data": {}, + "api_link": "https://api.addsale.com/gringotts/api/v1/external/payment-initialisation/", + "payment_flow": "api" + }, + "Fynd": { + "data": {}, + "api_link": "", + "payment_flow": "api" + } + }, + "default": {} + }, + "user_type": "Store User", + "cod_charges": 0, + "order_id": null, + "cod_available": true, + "cod_message": "No additional COD charges applicable", + "delivery_charges": 0, + "delivery_charge_order_value": 0, + "delivery_slots": [ + { + "date": "Sat, 24 Aug", + "delivery_slot": [ + { + "delivery_slot_timing": "By 9:00 PM", + "default": true, + "delivery_slot_id": 1 + } + ] + } + ], + "store_code": "", + "store_emps": [], + "breakup_values": { + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + }, + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 214.18, + "mrp_total": 1999, + "subtotal": 1999, + "total": 1999, + "vog": 1784.82, + "you_saved": 0 + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 1999, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 1999, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 1999, + "currency_code": "INR" + } + ] + }, + "shipments": [], + "message": "Shipments could not be generated. Please Try again after some time.", + "delivery_charge_info": "", + "coupon_text": "View all offers", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Thu, 22 Aug 2019 20:21:48 GMT", + "restrict_checkout": false, + "is_valid": false + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### checkoutCart +Checkout all items in the cart + + + + +```swift +cart.checkoutCart(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CartCheckoutDetailRequest | yes | Request body | + + +Use this API to checkout all items in the cart for payment and order generation. For COD, order will be directly generated, whereas for other checkout modes, user will be redirected to a payment gateway. + +*Returned Response:* + + + + +[CartCheckoutResponse](#CartCheckoutResponse) + +Success. Returns the status of cart checkout. Refer `CartCheckoutResponseSchema` for more details. + + + + +
    +  Examples: + + +
    +  Address id not found + +```json +{ + "value": { + "success": false, + "message": "No address found with address id {address_id}" + } +} +``` +
    + +
    +  Missing address_id + +```json +{ + "value": { + "address_id": [ + "Missing data for required field." + ] + } +} +``` +
    + +
    +  Successful checkout cod payment + +```json +{ + "value": { + "success": true, + "cart": { + "success": true, + "error_message": "Note: Your order delivery will be delayed by 7-10 Days", + "payment_options": { + "payment_option": [ + { + "name": "COD", + "display_name": "Cash on Delivery", + "display_priority": 1, + "payment_mode_id": 11, + "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png" + }, + "list": [] + }, + { + "name": "CARD", + "display_priority": 2, + "payment_mode_id": 2, + "display_name": "Card", + "list": [] + }, + { + "name": "NB", + "display_priority": 3, + "payment_mode_id": 3, + "display_name": "Net Banking", + "list": [ + { + "aggregator_name": "Razorpay", + "bank_name": "ICICI Bank", + "bank_code": "ICIC", + "url": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png" + }, + "merchant_code": "NB_ICICI", + "display_priority": 1 + } + ] + }, + { + "name": "WL", + "display_priority": 4, + "payment_mode_id": 4, + "display_name": "Wallet", + "list": [ + { + "wallet_name": "Paytm", + "wallet_code": "paytm", + "wallet_id": 4, + "merchant_code": "PAYTM", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_small.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_large.png" + }, + "aggregator_name": "Juspay", + "display_priority": 1 + } + ] + }, + { + "name": "UPI", + "display_priority": 9, + "payment_mode_id": 6, + "display_name": "UPI", + "list": [ + { + "aggregator_name": "UPI_Razorpay", + "name": "UPI", + "display_name": "BHIM UPI", + "code": "UPI", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_100x78.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_150x100.png" + }, + "merchant_code": "UPI", + "timeout": 240, + "retry_count": 0, + "fynd_vpa": "shopsense.rzp@hdfcbank", + "intent_flow": true, + "intent_app_error_list": [ + "com.csam.icici.bank.imobile", + "in.org.npci.upiapp", + "com.whatsapp" + ] + } + ] + }, + { + "name": "PL", + "display_priority": 11, + "payment_mode_id": 1, + "display_name": "Pay Later", + "list": [ + { + "aggregator_name": "Simpl", + "name": "Simpl", + "code": "simpl", + "merchant_code": "SIMPL", + "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png" + } + } + ] + } + ], + "payment_flows": { + "Simpl": { + "data": { + "gateway": { + "route": "simpl", + "entity": "sdk", + "is_customer_validation_required": true, + "cust_validation_url": "https://api.addsale.com/gringotts/api/v1/validate-customer/", + "sdk": { + "config": { + "redirect": false, + "callback_url": null, + "action_url": "https://api.addsale.com/avis/api/v1/payments/charge-gringotts-transaction/" + }, + "data": { + "user_phone": "8452996729", + "user_email": "paymentsdummy@gofynd.com" + } + }, + "return_url": null + } + }, + "api_link": "", + "payment_flow": "sdk" + }, + "Juspay": { + "data": {}, + "api_link": "https://sandbox.juspay.in/txns", + "payment_flow": "api" + }, + "Razorpay": { + "data": {}, + "api_link": "", + "payment_flow": "sdk" + }, + "UPI_Razorpay": { + "data": {}, + "api_link": "https://api.addsale.com/gringotts/api/v1/external/payment-initialisation/", + "payment_flow": "api" + }, + "Fynd": { + "data": {}, + "api_link": "", + "payment_flow": "api" + } + }, + "default": {} + }, + "user_type": "Store User", + "cod_charges": 0, + "order_id": "FY5D5E215CF287584CE6", + "cod_available": true, + "cod_message": "No additional COD charges applicable", + "delivery_charges": 0, + "delivery_charge_order_value": 0, + "delivery_slots": [ + { + "date": "Sat, 24 Aug", + "delivery_slot": [ + { + "delivery_slot_timing": "By 9:00 PM", + "default": true, + "delivery_slot_id": 1 + } + ] + } + ], + "store_code": "", + "store_emps": [], + "breakup_values": { + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + }, + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + }, + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 214.18, + "mrp_total": 1999, + "subtotal": 1999, + "total": 1999, + "vog": 1784.82, + "you_saved": 0 + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 1999, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 1999, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 1999, + "currency_code": "INR" + } + ] + }, + "items": [ + { + "key": "820312_L", + "message": "", + "bulk_offer": {}, + "price": { + "base": { + "add_on": 1999, + "marked": 1999, + "effective": 1999, + "selling": 1999, + "currency_code": "INR" + }, + "converted": { + "add_on": 1999, + "marked": 1999, + "effective": 1999, + "selling": 1999, + "currency_code": "INR" + } + }, + "quantity": 1, + "discount": "", + "product": { + "type": "product", + "uid": 820312, + "name": "Navy Blue Melange Shorts", + "slug": "883-police-navy-blue-melange-shorts-820312-4943a8", + "brand": { + "uid": 610, + "name": "883 Police" + }, + "categories": [ + { + "uid": 193, + "name": "Shorts" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/883-police-navy-blue-melange-shorts-820312-4943a8/", + "query": { + "product_slug": [ + "883-police-navy-blue-melange-shorts-820312-4943a8" + ] + } + } + }, + "article": { + "type": "article", + "uid": "381_610_IGPL01_SPIRAL19ANAVY_L", + "size": "L", + "seller": { + "uid": 381, + "name": "INTERSOURCE GARMENTS PVT LTD" + }, + "store": { + "uid": 3009, + "name": "Kormangala" + }, + "quantity": 2, + "price": { + "base": { + "marked": 1999, + "effective": 1999, + "currency_code": "INR" + }, + "converted": { + "marked": 1999, + "effective": 1999, + "currency_code": "INR" + } + } + }, + "coupon_message": "", + "availability": { + "sizes": [ + "L", + "XL", + "XXL" + ], + "other_store_quantity": 1, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + } + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "cart_id": 7483, + "uid": "7483", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Thu, 22 Aug 2019 04:58:44 GMT", + "restrict_checkout": false, + "is_valid": true + }, + "callback_url": "https://api.addsale.com/gringotts/api/v1/external/payment-callback/", + "app_intercept_url": "http://uniket-testing.addsale.link/cart/order-status", + "message": "", + "data": { + "order_id": "FY5D5E215CF287584CE6" + }, + "order_id": "FY5D5E215CF287584CE6" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateCartMeta +Update the cart meta + + + + +```swift +cart.updateCartMeta(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | The unique identifier of the cart | +| body | CartMetaRequest | yes | Request body | + + +Use this API to update cart meta like checkout_mode and gstin. + +*Returned Response:* + + + + +[CartMetaResponse](#CartMetaResponse) + +Returns a message indicating the success of cart meta updation as shown below. + + + + +
    +  Example: + +```json +{ + "message": "cart meta updated" +} +``` +
    + + + + + + + + + +--- + + +#### getCartShareLink +Generate token for sharing the cart + + + + +```swift +cart.getCartShareLink(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | GetShareCartLinkRequest | yes | Request body | + + +Use this API to generate a shared cart snapshot and return a shortlink token. The link can be shared with other users for getting the same items in their cart. + +*Returned Response:* + + + + +[GetShareCartLinkResponse](#GetShareCartLinkResponse) + +Returns a URL to share and a token as shown below. + + + + +
    +  Examples: + + +
    +  Token Generated + +```json +{ + "value": { + "token": "ZweG1XyX", + "share_url": "https://uniket-testing.addsale.link/shared-cart/ZweG1XyX" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getCartSharedItems +Get details of a shared cart + + + + +```swift +cart.getCartSharedItems(token: token) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| token | String | yes | Token of the shared short link | + + + +Use this API to get the shared cart details as per the token generated using the share-cart API. + +*Returned Response:* + + + + +[SharedCartResponse](#SharedCartResponse) + +Success. Returns a Cart object as per the valid token. Refer `SharedCartResponse` for more details. + + + + +
    +  Example: + +```json +{ + "cart": { + "shared_cart_details": { + "token": "BQ9jySQ9", + "user": { + "user_id": "23109086", + "is_anonymous": false + }, + "meta": { + "selected_staff": "", + "ordering_store": null + }, + "selected_staff": "", + "ordering_store": null, + "source": {}, + "created_on": "2019-12-18T14:00:07.165000" + }, + "items": [ + { + "key": "791651_6", + "discount": "", + "bulk_offer": {}, + "coupon_message": "", + "article": { + "type": "article", + "uid": "304_1054_9036_R1005753_6", + "size": "6", + "seller": { + "uid": 304, + "name": "LEAYAN GLOBAL PVT. LTD." + }, + "store": { + "uid": 5322, + "name": "Vaisali Nagar" + }, + "quantity": 1, + "price": { + "base": { + "marked": 2095, + "effective": 2095, + "currency_code": "INR" + }, + "converted": { + "marked": 2095, + "effective": 2095, + "currency_code": "INR" + } + } + }, + "product": { + "type": "product", + "uid": 791651, + "name": "Black Running Shoes", + "slug": "furo-black-running-shoes-791651-f8bcc3", + "brand": { + "uid": 1054, + "name": "Furo" + }, + "categories": [ + { + "uid": 160, + "name": "Running Shoes" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/furo-black-running-shoes-791651-f8bcc3/", + "query": { + "product_slug": [ + "furo-black-running-shoes-791651-f8bcc3" + ] + } + } + }, + "message": "", + "quantity": 1, + "availability": { + "sizes": [ + "7", + "8", + "9", + "10", + "6" + ], + "other_store_quantity": 12, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "price": { + "base": { + "add_on": 2095, + "marked": 2095, + "effective": 2095, + "selling": 2095, + "currency_code": "INR" + }, + "converted": { + "add_on": 2095, + "marked": 2095, + "effective": 2095, + "selling": 2095, + "currency_code": "INR" + } + } + }, + { + "key": "791651_7", + "discount": "", + "bulk_offer": {}, + "coupon_message": "", + "article": { + "type": "article", + "uid": "304_1054_9036_R1005753_7", + "size": "7", + "seller": { + "uid": 304, + "name": "LEAYAN GLOBAL PVT. LTD." + }, + "store": { + "uid": 5322, + "name": "Vaisali Nagar" + }, + "quantity": 2, + "price": { + "base": { + "marked": 2095, + "effective": 2095, + "currency_code": "INR" + }, + "converted": { + "marked": 2095, + "effective": 2095, + "currency_code": "INR" + } + } + }, + "product": { + "type": "product", + "uid": 791651, + "name": "Black Running Shoes", + "slug": "furo-black-running-shoes-791651-f8bcc3", + "brand": { + "uid": 1054, + "name": "Furo" + }, + "categories": [ + { + "uid": 160, + "name": "Running Shoes" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/furo-black-running-shoes-791651-f8bcc3/", + "query": { + "product_slug": [ + "furo-black-running-shoes-791651-f8bcc3" + ] + } + } + }, + "message": "", + "quantity": 2, + "availability": { + "sizes": [ + "7", + "8", + "9", + "10", + "6" + ], + "other_store_quantity": 7, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "price": { + "base": { + "add_on": 4190, + "marked": 4190, + "effective": 4190, + "selling": 4190, + "currency_code": "INR" + }, + "converted": { + "add_on": 4190, + "marked": 4190, + "effective": 4190, + "selling": 4190, + "currency_code": "INR" + } + } + } + ], + "cart_id": 13055, + "uid": "13055", + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 958.73, + "mrp_total": 6285, + "subtotal": 6285, + "total": 6285, + "vog": 5326.27, + "you_saved": 0 + }, + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid coupon" + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 6285, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 6285, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 6285, + "currency_code": "INR" + } + ] + }, + "delivery_charge_info": "", + "coupon_text": "View all offers", + "gstin": null, + "comment": "", + "checkout_mode": "self", + "payment_selection_lock": { + "enabled": false, + "default_options": "COD", + "payment_identifier": null + }, + "restrict_checkout": false, + "is_valid": true, + "last_modified": "Mon, 16 Dec 2019 07:02:18 GMT" + }, + "error": "" +} +``` +
    + + + + + + + + + +--- + + +#### updateCartWithSharedItems +Merge or replace existing cart + + + + +```swift +cart.updateCartWithSharedItems(token: token, action: action) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| token | String | yes | Token of the shared short link | +| action | String | yes | Operation to perform on the existing cart merge or replace. | + + + +Use this API to merge the shared cart with existing cart, or replace the existing cart with the shared cart. The `action` parameter is used to indicate the operation Merge or Replace. + +*Returned Response:* + + + + +[SharedCartResponse](#SharedCartResponse) + +Success. Returns a merged or replaced cart as per the valid token. Refer `SharedCartResponse` for more details. + + + + +
    +  Examples: + + +
    +  Cart Merged/Replaced + +```json +{ + "value": { + "cart": { + "shared_cart_details": { + "token": "BQ9jySQ9", + "user": { + "user_id": "23109086", + "is_anonymous": false + }, + "meta": { + "selected_staff": "", + "ordering_store": null + }, + "selected_staff": "", + "ordering_store": null, + "source": {}, + "created_on": "2019-12-18T14:00:07.165000" + }, + "items": [ + { + "key": "791651_6", + "discount": "", + "bulk_offer": {}, + "coupon_message": "", + "article": { + "type": "article", + "uid": "304_1054_9036_R1005753_6", + "size": "6", + "seller": { + "uid": 304, + "name": "LEAYAN GLOBAL PVT. LTD." + }, + "store": { + "uid": 5322, + "name": "Vaisali Nagar" + }, + "quantity": 1, + "price": { + "base": { + "marked": 2095, + "effective": 2095, + "currency_code": "INR" + }, + "converted": { + "marked": 2095, + "effective": 2095, + "currency_code": "INR" + } + } + }, + "product": { + "type": "product", + "uid": 791651, + "name": "Black Running Shoes", + "slug": "furo-black-running-shoes-791651-f8bcc3", + "brand": { + "uid": 1054, + "name": "Furo" + }, + "categories": [ + { + "uid": 160, + "name": "Running Shoes" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/furo-black-running-shoes-791651-f8bcc3/", + "query": { + "product_slug": [ + "furo-black-running-shoes-791651-f8bcc3" + ] + } + } + }, + "message": "", + "quantity": 1, + "availability": { + "sizes": [ + "7", + "8", + "9", + "10", + "6" + ], + "other_store_quantity": 12, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "price": { + "base": { + "add_on": 2095, + "marked": 2095, + "effective": 2095, + "selling": 2095, + "currency_code": "INR" + }, + "converted": { + "add_on": 2095, + "marked": 2095, + "effective": 2095, + "selling": 2095, + "currency_code": "INR" + } + } + }, + { + "key": "791651_7", + "discount": "", + "bulk_offer": {}, + "coupon_message": "", + "article": { + "type": "article", + "uid": "304_1054_9036_R1005753_7", + "size": "7", + "seller": { + "uid": 304, + "name": "LEAYAN GLOBAL PVT. LTD." + }, + "store": { + "uid": 5322, + "name": "Vaisali Nagar" + }, + "quantity": 2, + "price": { + "base": { + "marked": 2095, + "effective": 2095, + "currency_code": "INR" + }, + "converted": { + "marked": 2095, + "effective": 2095, + "currency_code": "INR" + } + } + }, + "product": { + "type": "product", + "uid": 791651, + "name": "Black Running Shoes", + "slug": "furo-black-running-shoes-791651-f8bcc3", + "brand": { + "uid": 1054, + "name": "Furo" + }, + "categories": [ + { + "uid": 160, + "name": "Running Shoes" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/furo-black-running-shoes-791651-f8bcc3/", + "query": { + "product_slug": [ + "furo-black-running-shoes-791651-f8bcc3" + ] + } + } + }, + "message": "", + "quantity": 2, + "availability": { + "sizes": [ + "7", + "8", + "9", + "10", + "6" + ], + "other_store_quantity": 7, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "price": { + "base": { + "add_on": 4190, + "marked": 4190, + "effective": 4190, + "selling": 4190, + "currency_code": "INR" + }, + "converted": { + "add_on": 4190, + "marked": 4190, + "effective": 4190, + "selling": 4190, + "currency_code": "INR" + } + } + } + ], + "cart_id": 13055, + "uid": "13055", + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 958.73, + "mrp_total": 6285, + "subtotal": 6285, + "total": 6285, + "vog": 5326.27, + "you_saved": 0 + }, + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid coupon" + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 6285, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 6285, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 6285, + "currency_code": "INR" + } + ] + }, + "delivery_charge_info": "", + "coupon_text": "View all offers", + "gstin": null, + "comment": "", + "checkout_mode": "self", + "payment_selection_lock": { + "enabled": false, + "default_options": "COD", + "payment_identifier": null + }, + "restrict_checkout": false, + "is_valid": true, + "last_modified": "Mon, 16 Dec 2019 07:02:18 GMT" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [CartCurrency](#CartCurrency) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | code | String? | yes | Currency code defined by ISO 4217:2015 | + | symbol | String? | yes | | + +--- + + + + + #### [PaymentSelectionLock](#PaymentSelectionLock) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | defaultOptions | String? | yes | | + | enabled | Bool? | yes | | + | paymentIdentifier | String? | yes | | + +--- + + + + + #### [PromiseTimestamp](#PromiseTimestamp) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | min | Double? | yes | | + | max | Double? | yes | | + +--- + + + + + #### [PromiseFormatted](#PromiseFormatted) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | min | String? | yes | | + | max | String? | yes | | + +--- + + + + + #### [ShipmentPromise](#ShipmentPromise) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | timestamp | [PromiseTimestamp](#PromiseTimestamp)? | yes | | + | formatted | [PromiseFormatted](#PromiseFormatted)? | yes | | + +--- + + + + + #### [LoyaltyPoints](#LoyaltyPoints) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | applicable | Double? | yes | | + | isApplied | Bool? | yes | | + | total | Double? | yes | | + | description | String? | yes | | + +--- + + + + + #### [DisplayBreakup](#DisplayBreakup) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | value | Double? | yes | | + | display | String? | yes | | + | key | String? | yes | | + | currencySymbol | String? | yes | | + | currencyCode | String? | yes | | + | message | [String]? | yes | | + +--- + + + + + #### [RawBreakup](#RawBreakup) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | codCharge | Double? | yes | | + | discount | Double? | yes | | + | gstCharges | Double? | yes | | + | convenienceFee | Double? | yes | | + | coupon | Double? | yes | | + | total | Double? | yes | | + | deliveryCharge | Double? | yes | | + | youSaved | Double? | yes | | + | mrpTotal | Double? | yes | | + | fyndCash | Double? | yes | | + | subtotal | Double? | yes | | + | vog | Double? | yes | | + +--- + + + + + #### [CouponBreakup](#CouponBreakup) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | String? | yes | | + | value | Double? | yes | | + | code | String? | yes | | + | isApplied | Bool? | yes | | + | message | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [CartBreakup](#CartBreakup) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | loyaltyPoints | [LoyaltyPoints](#LoyaltyPoints)? | yes | | + | display | [[DisplayBreakup](#DisplayBreakup)]? | yes | | + | raw | [RawBreakup](#RawBreakup)? | yes | | + | coupon | [CouponBreakup](#CouponBreakup)? | yes | | + +--- + + + + + #### [ProductAvailability](#ProductAvailability) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isValid | Bool? | yes | | + | sizes | [String]? | yes | | + | otherStoreQuantity | Int? | yes | | + | deliverable | Bool? | yes | | + | outOfStock | Bool? | yes | | + +--- + + + + + #### [BasePrice](#BasePrice) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | currencyCode | String? | yes | | + | effective | Double? | yes | | + | marked | Double? | yes | | + | currencySymbol | String? | yes | | + +--- + + + + + #### [ArticlePriceInfo](#ArticlePriceInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | converted | [BasePrice](#BasePrice)? | yes | | + | base | [BasePrice](#BasePrice)? | yes | | + +--- + + + + + #### [BaseInfo](#BaseInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | name | String? | yes | | + +--- + + + + + #### [ProductArticle](#ProductArticle) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | String? | yes | | + | price | [ArticlePriceInfo](#ArticlePriceInfo)? | yes | | + | extraMeta | [String: Any]? | yes | | + | store | [BaseInfo](#BaseInfo)? | yes | | + | size | String? | yes | | + | seller | [BaseInfo](#BaseInfo)? | yes | | + | quantity | Int? | yes | | + | type | String? | yes | | + +--- + + + + + #### [ProductPrice](#ProductPrice) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | selling | Double? | yes | | + | currencySymbol | String? | yes | | + | currencyCode | String? | yes | | + | marked | Double? | yes | | + | addOn | Double? | yes | | + | effective | Double? | yes | | + +--- + + + + + #### [ProductPriceInfo](#ProductPriceInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | converted | [ProductPrice](#ProductPrice)? | yes | | + | base | [ProductPrice](#ProductPrice)? | yes | | + +--- + + + + + #### [CategoryInfo](#CategoryInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | Product Category Id | + | name | String? | yes | | + +--- + + + + + #### [ActionQuery](#ActionQuery) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | productSlug | [String]? | yes | Contains list of product slug | + +--- + + + + + #### [ProductAction](#ProductAction) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | url | String? | yes | | + | query | [ActionQuery](#ActionQuery)? | yes | | + | type | String? | yes | | + +--- + + + + + #### [ProductImage](#ProductImage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | url | String? | yes | | + | secureUrl | String? | yes | | + | aspectRatio | String? | yes | | + +--- + + + + + #### [CartProduct](#CartProduct) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | categories | [[CategoryInfo](#CategoryInfo)]? | yes | | + | slug | String? | yes | Unique product url name generated via product name and other meta data | + | action | [ProductAction](#ProductAction)? | yes | | + | images | [[ProductImage](#ProductImage)]? | yes | | + | name | String? | yes | | + | brand | [BaseInfo](#BaseInfo)? | yes | | + | type | String? | yes | | + +--- + + + + + #### [PromoMeta](#PromoMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [CartProductIdentifer](#CartProductIdentifer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | identifier | String? | yes | Article idenfier generated by cart | + +--- + + + + + #### [CartProductInfo](#CartProductInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | availability | [ProductAvailability](#ProductAvailability)? | yes | | + | discount | String? | yes | | + | article | [ProductArticle](#ProductArticle)? | yes | | + | key | String? | yes | | + | isSet | Bool? | yes | | + | pricePerUnit | [ProductPriceInfo](#ProductPriceInfo)? | yes | | + | product | [CartProduct](#CartProduct)? | yes | | + | couponMessage | String? | yes | | + | promoMeta | [PromoMeta](#PromoMeta)? | yes | | + | message | String? | yes | | + | quantity | Int? | yes | | + | bulkOffer | [String: Any]? | yes | | + | identifiers | [CartProductIdentifer](#CartProductIdentifer) | no | | + | price | [ProductPriceInfo](#ProductPriceInfo)? | yes | | + +--- + + + + + #### [CartDetailResponse](#CartDetailResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | restrictCheckout | Bool? | yes | | + | isValid | Bool? | yes | | + | currency | [CartCurrency](#CartCurrency)? | yes | | + | lastModified | String? | yes | | + | id | String? | yes | | + | gstin | String? | yes | | + | couponText | String? | yes | | + | paymentSelectionLock | [PaymentSelectionLock](#PaymentSelectionLock)? | yes | | + | deliveryPromise | [ShipmentPromise](#ShipmentPromise)? | yes | | + | breakupValues | [CartBreakup](#CartBreakup)? | yes | | + | deliveryChargeInfo | String? | yes | | + | message | String? | yes | | + | comment | String? | yes | | + | items | [[CartProductInfo](#CartProductInfo)]? | yes | | + | checkoutMode | String? | yes | | + +--- + + + + + #### [AddProductCart](#AddProductCart) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | display | String? | yes | | + | extraMeta | [String: Any]? | yes | | + | sellerId | Int? | yes | | + | storeId | Int? | yes | | + | articleId | String? | yes | | + | pos | Bool? | yes | | + | itemSize | String? | yes | | + | quantity | Int? | yes | | + | itemId | Int? | yes | | + | articleAssignment | [String: Any]? | yes | | + +--- + + + + + #### [AddCartRequest](#AddCartRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[AddProductCart](#AddProductCart)]? | yes | | + +--- + + + + + #### [AddCartDetailResponse](#AddCartDetailResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | True if all items are added successfully. False if partially added or not added. | + | partial | Bool? | yes | When adding multiple items check if all added. True if only few are added. | + | cart | [CartDetailResponse](#CartDetailResponse)? | yes | | + | message | String? | yes | | + +--- + + + + + #### [UpdateProductCart](#UpdateProductCart) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | extraMeta | [String: Any]? | yes | | + | articleId | String? | yes | | + | itemSize | String? | yes | | + | quantity | Int? | yes | | + | itemId | Int? | yes | | + | itemIndex | Int? | yes | | + | identifiers | [CartProductIdentifer](#CartProductIdentifer) | no | | + +--- + + + + + #### [UpdateCartRequest](#UpdateCartRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[UpdateProductCart](#UpdateProductCart)]? | yes | | + | operation | String | no | | + +--- + + + + + #### [UpdateCartDetailResponse](#UpdateCartDetailResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | True if all items are added successfully. False if partially added or not added. | + | cart | [CartDetailResponse](#CartDetailResponse)? | yes | | + | message | String? | yes | | + +--- + + + + + #### [CartItemCountResponse](#CartItemCountResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | userCartItemsCount | Int? | yes | Item count present in cart | + +--- + + + + + #### [PageCoupon](#PageCoupon) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | hasPrevious | Bool? | yes | | + | totalItemCount | Int? | yes | | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + | total | Int? | yes | | + +--- + + + + + #### [Coupon](#Coupon) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | couponCode | String? | yes | | + | couponValue | Double? | yes | | + | title | String? | yes | | + | isApplied | Bool? | yes | | + | isApplicable | Bool? | yes | | + | expiresOn | String? | yes | | + | subTitle | String? | yes | | + | message | String? | yes | | + | maxDiscountValue | Double? | yes | | + | minimumCartValue | Double? | yes | | + +--- + + + + + #### [GetCouponResponse](#GetCouponResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [PageCoupon](#PageCoupon)? | yes | | + | availableCouponList | [[Coupon](#Coupon)]? | yes | | + +--- + + + + + #### [ApplyCouponRequest](#ApplyCouponRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | couponCode | String | no | Coupon code to be applied | + +--- + + + + + #### [OfferPrice](#OfferPrice) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | bulkEffective | Double? | yes | Discounted per unit price for current offer object | + | currencySymbol | String? | yes | Currency symbol for currency | + | currencyCode | String? | yes | Currency code for all amounts | + | marked | Int? | yes | Original price of product | + | effective | Int? | yes | Current per unit price of product after existing deductions | + +--- + + + + + #### [OfferItem](#OfferItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | best | Bool? | yes | Is true for best offer from all offers present for all sellers | + | margin | Int? | yes | Percentage value of discount | + | total | Double? | yes | Total price of offer quantity with discount | + | autoApplied | Bool? | yes | Whether offer discount is auto applied in cart | + | quantity | Int? | yes | Quantity on which offer is applicable | + | type | String? | yes | Offer type | + | price | [OfferPrice](#OfferPrice)? | yes | | + +--- + + + + + #### [OfferSeller](#OfferSeller) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | Seller id | + | name | String? | yes | | + +--- + + + + + #### [BulkPriceOffer](#BulkPriceOffer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | offers | [[OfferItem](#OfferItem)]? | yes | | + | seller | [OfferSeller](#OfferSeller)? | yes | | + +--- + + + + + #### [BulkPriceResponse](#BulkPriceResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [[BulkPriceOffer](#BulkPriceOffer)]? | yes | Consist of offers from multiple seller | + +--- + + + + + #### [RewardPointRequest](#RewardPointRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | points | Bool | no | | + +--- + + + + + #### [GeoLocation](#GeoLocation) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | longitude | Double? | yes | | + | latitude | Double? | yes | | + +--- + + + + + #### [Address](#Address) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | state | String? | yes | | + | country | String? | yes | | + | tags | [String]? | yes | | + | address | String? | yes | | + | name | String? | yes | | + | isDefaultAddress | Bool? | yes | | + | userId | String? | yes | | + | checkoutMode | String? | yes | | + | area | String? | yes | | + | isActive | Bool? | yes | | + | id | String? | yes | | + | areaCodeSlug | String? | yes | | + | googleMapPoint | [String: Any]? | yes | | + | city | String? | yes | | + | countryCode | String? | yes | | + | areaCode | String? | yes | | + | phone | String? | yes | | + | meta | [String: Any]? | yes | | + | email | String? | yes | | + | landmark | String? | yes | | + | addressType | String? | yes | | + | geoLocation | [GeoLocation](#GeoLocation)? | yes | | + +--- + + + + + #### [GetAddressesResponse](#GetAddressesResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | address | [[Address](#Address)]? | yes | | + +--- + + + + + #### [SaveAddressResponse](#SaveAddressResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | | + | id | String? | yes | | + | isDefaultAddress | Bool? | yes | | + +--- + + + + + #### [UpdateAddressResponse](#UpdateAddressResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | | + | id | String? | yes | | + | isDefaultAddress | Bool? | yes | | + | isUpdated | Bool? | yes | | + +--- + + + + + #### [DeleteAddressResponse](#DeleteAddressResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | isDeleted | Bool? | yes | | + +--- + + + + + #### [SelectCartAddressRequest](#SelectCartAddressRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | billingAddressId | String? | yes | | + | cartId | String? | yes | | + +--- + + + + + #### [UpdateCartPaymentRequest](#UpdateCartPaymentRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | merchantCode | String? | yes | | + | paymentMode | String? | yes | | + | addressId | String? | yes | | + | aggregatorName | String? | yes | | + | paymentIdentifier | String? | yes | | + +--- + + + + + #### [CouponValidity](#CouponValidity) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | discount | Double? | yes | | + | title | String? | yes | | + | valid | Bool? | yes | | + | code | String? | yes | | + | displayMessageEn | String? | yes | | + +--- + + + + + #### [PaymentCouponValidate](#PaymentCouponValidate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | | + | message | String? | yes | | + | couponValidity | [CouponValidity](#CouponValidity)? | yes | | + +--- + + + + + #### [ShipmentResponse](#ShipmentResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | promise | [ShipmentPromise](#ShipmentPromise)? | yes | | + | fulfillmentId | Int? | yes | | + | shipmentType | String? | yes | | + | dpId | String? | yes | | + | shipments | Int? | yes | | + | orderType | String? | yes | | + | dpOptions | [String: Any]? | yes | | + | boxType | String? | yes | | + | fulfillmentType | String? | yes | | + | items | [[CartProductInfo](#CartProductInfo)]? | yes | | + +--- + + + + + #### [CartShipmentsResponse](#CartShipmentsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | String? | yes | | + | error | Bool? | yes | | + | id | String? | yes | | + | message | String? | yes | | + | paymentSelectionLock | [PaymentSelectionLock](#PaymentSelectionLock)? | yes | | + | lastModified | String? | yes | | + | restrictCheckout | Bool? | yes | | + | isValid | Bool? | yes | | + | currency | [CartCurrency](#CartCurrency)? | yes | | + | shipments | [[ShipmentResponse](#ShipmentResponse)]? | yes | | + | gstin | String? | yes | | + | cartId | Int? | yes | | + | couponText | String? | yes | | + | deliveryPromise | [ShipmentPromise](#ShipmentPromise)? | yes | | + | breakupValues | [CartBreakup](#CartBreakup)? | yes | | + | deliveryChargeInfo | String? | yes | | + | comment | String? | yes | | + | checkoutMode | String? | yes | | + +--- + + + + + #### [StaffCheckout](#StaffCheckout) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | String | no | | + | firstName | String | no | | + | lastName | String | no | | + | id | String | no | | + +--- + + + + + #### [CartCheckoutDetailRequest](#CartCheckoutDetailRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | orderingStore | Int? | yes | | + | extraMeta | [String: Any]? | yes | | + | callbackUrl | String? | yes | | + | aggregator | String? | yes | | + | paymentAutoConfirm | Bool? | yes | | + | merchantCode | String? | yes | | + | meta | [String: Any]? | yes | | + | staff | [StaffCheckout](#StaffCheckout)? | yes | | + | paymentMode | String | no | | + | addressId | String? | yes | | + | billingAddressId | String? | yes | | + | billingAddress | [String: Any]? | yes | | + | paymentParams | [String: Any]? | yes | | + | deliveryAddress | [String: Any]? | yes | | + | paymentIdentifier | String? | yes | | + +--- + + + + + #### [CheckCart](#CheckCart) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | String? | yes | | + | storeEmps | [[String: Any]]? | yes | | + | message | String? | yes | | + | paymentSelectionLock | [PaymentSelectionLock](#PaymentSelectionLock)? | yes | | + | lastModified | String? | yes | | + | codCharges | Int? | yes | | + | restrictCheckout | Bool? | yes | | + | isValid | Bool? | yes | | + | gstin | String? | yes | | + | deliveryPromise | [ShipmentPromise](#ShipmentPromise)? | yes | | + | errorMessage | String? | yes | | + | comment | String? | yes | | + | checkoutMode | String? | yes | | + | id | String? | yes | | + | codMessage | String? | yes | | + | success | Bool? | yes | | + | storeCode | String? | yes | | + | deliveryCharges | Int? | yes | | + | userType | String? | yes | | + | orderId | String? | yes | | + | currency | [CartCurrency](#CartCurrency)? | yes | | + | cartId | Int? | yes | | + | couponText | String? | yes | | + | codAvailable | Bool? | yes | | + | deliveryChargeOrderValue | Int? | yes | | + | breakupValues | [CartBreakup](#CartBreakup)? | yes | | + | deliveryChargeInfo | String? | yes | | + | items | [[CartProductInfo](#CartProductInfo)]? | yes | | + +--- + + + + + #### [CartCheckoutResponse](#CartCheckoutResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | orderId | String? | yes | | + | callbackUrl | String? | yes | | + | paymentConfirmUrl | String? | yes | | + | success | Bool? | yes | | + | message | String? | yes | | + | data | [String: Any]? | yes | | + | appInterceptUrl | String? | yes | | + | cart | [CheckCart](#CheckCart)? | yes | | + +--- + + + + + #### [CartMetaRequest](#CartMetaRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | gstin | String? | yes | | + | pickUpCustomerDetails | [String: Any]? | yes | Customer contact details for customer pickup at store | + | checkoutMode | String? | yes | | + | comment | String? | yes | | + +--- + + + + + #### [CartMetaResponse](#CartMetaResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [CartMetaMissingResponse](#CartMetaMissingResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | errors | [String]? | yes | | + +--- + + + + + #### [GetShareCartLinkRequest](#GetShareCartLinkRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | Cart uid for generating sharing | + | meta | [String: Any]? | yes | Staff, Ordering store or any other data. This data will be used to generate link as well as sent as shared details. | + +--- + + + + + #### [GetShareCartLinkResponse](#GetShareCartLinkResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | shareUrl | String? | yes | Short shareable final url | + | token | String? | yes | Short url unique id | + +--- + + + + + #### [SharedCartDetails](#SharedCartDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [String: Any]? | yes | User details of who generated share link | + | createdOn | String? | yes | | + | meta | [String: Any]? | yes | Meta data sent while generating share cart link | + | source | [String: Any]? | yes | Share link device and other source information | + | token | String? | yes | Short link id | + +--- + + + + + #### [SharedCart](#SharedCart) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | restrictCheckout | Bool? | yes | | + | uid | String? | yes | | + | isValid | Bool? | yes | | + | sharedCartDetails | [SharedCartDetails](#SharedCartDetails)? | yes | | + | currency | [CartCurrency](#CartCurrency)? | yes | | + | lastModified | String? | yes | | + | cartId | Int? | yes | | + | id | String? | yes | | + | gstin | String? | yes | | + | couponText | String? | yes | | + | paymentSelectionLock | [PaymentSelectionLock](#PaymentSelectionLock)? | yes | | + | deliveryPromise | [ShipmentPromise](#ShipmentPromise)? | yes | | + | breakupValues | [CartBreakup](#CartBreakup)? | yes | | + | deliveryChargeInfo | String? | yes | | + | message | String? | yes | | + | comment | String? | yes | | + | items | [[CartProductInfo](#CartProductInfo)]? | yes | | + | checkoutMode | String? | yes | | + +--- + + + + + #### [SharedCartResponse](#SharedCartResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cart | [SharedCart](#SharedCart)? | yes | | + | error | String? | yes | | + +--- + + + diff --git a/documentation/application/CATALOG.md b/documentation/application/CATALOG.md new file mode 100644 index 0000000000..0629fa63e4 --- /dev/null +++ b/documentation/application/CATALOG.md @@ -0,0 +1,8167 @@ + + + + +##### [Back to Application docs](./README.md) + +## Catalog Methods +Catalog API's allows you to access list of products, prices, seller details, similar features, variants and many more useful features. +* [getProductDetailBySlug](#getproductdetailbyslug) +* [getProductSizesBySlug](#getproductsizesbyslug) +* [getProductComparisonBySlugs](#getproductcomparisonbyslugs) +* [getSimilarComparisonProductBySlug](#getsimilarcomparisonproductbyslug) +* [getComparedFrequentlyProductBySlug](#getcomparedfrequentlyproductbyslug) +* [getProductSimilarByIdentifier](#getproductsimilarbyidentifier) +* [getProductVariantsBySlug](#getproductvariantsbyslug) +* [getProductStockByIds](#getproductstockbyids) +* [getProductStockForTimeByIds](#getproductstockfortimebyids) +* [getProducts](#getproducts) +* [getBrands](#getbrands) +* [getBrandDetailBySlug](#getbranddetailbyslug) +* [getCategories](#getcategories) +* [getCategoryDetailBySlug](#getcategorydetailbyslug) +* [getHomeProducts](#gethomeproducts) +* [getDepartments](#getdepartments) +* [getSearchResults](#getsearchresults) +* [getCollections](#getcollections) +* [getCollectionItemsBySlug](#getcollectionitemsbyslug) +* [getCollectionDetailBySlug](#getcollectiondetailbyslug) +* [getFollowedListing](#getfollowedlisting) +* [unfollowById](#unfollowbyid) +* [followById](#followbyid) +* [getFollowerCountById](#getfollowercountbyid) +* [getFollowIds](#getfollowids) +* [getStores](#getstores) +* [getInStockLocations](#getinstocklocations) +* [getLocationDetailsById](#getlocationdetailsbyid) +* [getProductBundlesBySlug](#getproductbundlesbyslug) +* [getProductPriceBySlug](#getproductpricebyslug) +* [getProductSellersBySlug](#getproductsellersbyslug) + + + +## Methods with example and description + + +#### getProductDetailBySlug +Get a product + + + + +```swift +catalog.getProductDetailBySlug(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | + + + +Use this API to retrieve a product by its slug value. + +*Returned Response:* + + + + +[ProductDetail](#ProductDetail) + +Success. Returns a Product object. Check the example shown below or refer `ProductDetail` for more details. + + + + +
    +  Example: + +```json +{ + "type": "product", + "grouped_attributes": [ + { + "title": "Alexander Sawyer", + "details": [ + { + "key": "Kimberly Davidson", + "type": "text", + "value": "DarkGrey" + }, + { + "key": "Kimberly Mcdaniel", + "type": "text", + "value": "Men,Women" + }, + { + "key": "Monica Hampton", + "type": "text", + "value": "Neoprene" + }, + { + "key": "John Mendoza", + "type": "text", + "value": "100 g" + } + ] + } + ], + "medias": [ + { + "type": "image", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1309_LGLAPTOPSLEEVE5/1_1564735832806.jpg" + } + ], + "brand": { + "name": "Barry, Jennings and Larson", + "uid": 1, + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "uid": 1, + "slug": "benchmark-collaborative-paradigms", + "attributes": { + "color_hex": "808080", + "weight": 100, + "product_type": "LaptopBags", + "gender": [ + "Men", + "Women" + ], + "material": "Neoprene", + "style_note": "Shape up your overall appeal with this stunning laptop bag. The amazing storage and great design will let you carry your laptop in style!", + "item_code": "LGLAPTOPSLEEVE5", + "occasion": "Casual", + "primary_color": "Grey", + "primary_material": "Others", + "variant": "LGLAPTOPSLEEVE5", + "color": "DarkGrey", + "product_details": "This is a Unisex Product.", + "primary_color_hex": "808080", + "brand": "Barry, Jennings and Larson" + }, + "name": "benchmark collaborative paradigms", + "has_variant": true, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "tryouts": [], + "rating": 2.7, + "rating_count": 2, + "image_nature": "standard", + "tags": [ + "Digital" + ], + "teaser_tag": {}, + "no_of_boxes": 1, + "custom_order": {}, + "color": "808080", + "similars": [ + "brand" + ], + "_custom_json": {} +} +``` +
    + + + + + + + + + +--- + + +#### getProductSizesBySlug +Get the sizes of a product + + + + +```swift +catalog.getProductSizesBySlug(slug: slug, storeId: storeId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | +| storeId | Int? | no | The ID of the store that is selling the product, e.g. 1,2,3. | + + + +A product can have multiple sizes. Use this API to fetch all the available sizes of a product. + +*Returned Response:* + + + + +[ProductSizes](#ProductSizes) + +Success. Returns a ProductSize object. Check the example shown below or refer `ProductSizes` for more details. + + + + +
    +  Example: + +```json +{ + "sellable": true, + "sizes": [ + { + "display": "13", + "value": "13", + "quantity": 10, + "is_available": true + } + ], + "discount": "", + "stores": { + "count": 1 + }, + "size_chart": {}, + "price": { + "marked": { + "min": 66.5, + "max": 66.5, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 66.5, + "max": 66.5, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "tags": [ + "Digital" + ] +} +``` +
    + + + + + + + + + +--- + + +#### getProductComparisonBySlugs +Compare products + + + + +```swift +catalog.getProductComparisonBySlugs(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | [String] | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/. | + + + +Use this API to compare the features of products belonging to the same category. Note that at least one slug is mandatory in the request query. + +*Returned Response:* + + + + +[ProductsComparisonResponse](#ProductsComparisonResponse) + +Success. Returns an array of objects containing the attributes for comparision. Check the example shown below or refer `ProductsComparisonResponse` for more details. + + + + +
    +  Example: + +```json +{ + "attributes_metadata": [ + { + "title": "Alexander Sawyer", + "details": [ + { + "key": "color", + "display": "Kimberly Davidson", + "description": "" + }, + { + "key": "gender", + "display": "Kimberly Mcdaniel", + "description": "" + }, + { + "key": "material", + "display": "Monica Hampton", + "description": "" + }, + { + "key": "weight", + "display": "John Mendoza", + "description": "" + } + ] + } + ], + "items": [ + { + "type": "product", + "name": "benchmark collaborative paradigms", + "item_type": "set", + "slug": "benchmark-collaborative-paradigms", + "id": 1, + "brand": { + "type": "brand", + "name": "Barry, Jennings and Larson", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "benchmark-collaborative-paradigms" + } + }, + "type": "page" + }, + "attributes": { + "color_hex": "808080", + "weight": 100, + "product_type": "LaptopBags", + "gender": [ + "Men", + "Women" + ], + "material": "Neoprene", + "style_note": "Shape up your overall appeal with this stunning laptop bag. The amazing storage and great design will let you carry your laptop in style!", + "item_code": "LGLAPTOPSLEEVE5", + "occasion": "Casual", + "primary_color": "Grey", + "primary_material": "Others", + "variant": "LGLAPTOPSLEEVE5", + "color": "DarkGrey", + "product_details": "This is a Unisex Product.", + "primary_color_hex": "808080" + }, + "medias": [ + { + "type": "image", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1309_LGLAPTOPSLEEVE5/1_1564735832806.jpg" + } + ], + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "rating": 2.7, + "rating_count": 2 + }, + { + "type": "product", + "name": "deploy viral systems", + "item_type": "set", + "slug": "deploy-viral-systems", + "id": 2, + "brand": { + "type": "brand", + "name": "Barry, Jennings and Larson", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "deploy-viral-systems" + } + }, + "type": "page" + }, + "attributes": { + "color_hex": "808080", + "weight": 100, + "product_type": "LaptopBags", + "gender": [ + "Men", + "Women" + ], + "material": "Neoprene", + "style_note": "Shape up your overall appeal with this stunning laptop bag. The amazing storage and great design will let you carry your laptop in style!", + "item_code": "LGLAPTOPSLEEVE5", + "occasion": "Casual", + "primary_color": "Grey", + "primary_material": "Others", + "variant": "LGLAPTOPSLEEVE5", + "color": "DarkGrey", + "product_details": "This is a Unisex Product.", + "primary_color_hex": "808080" + }, + "medias": [ + { + "type": "image", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1309_LGLAPTOPSLEEVE5/1_1564735832806.jpg" + } + ], + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "rating": 2.7, + "rating_count": 2 + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getSimilarComparisonProductBySlug +Get comparison between similar products + + + + +```swift +catalog.getSimilarComparisonProductBySlug(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | + + + +Use this API to compare a given product automatically with similar products. Only one slug is needed. + +*Returned Response:* + + + + +[ProductCompareResponse](#ProductCompareResponse) + +Success. Returns an array of objects containing the attributes for comparision. Check the example shown below or refer `ProductCompareResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getComparedFrequentlyProductBySlug +Get comparison between frequently compared products with the given product + + + + +```swift +catalog.getComparedFrequentlyProductBySlug(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | + + + +Use this API to compare a given product automatically with products that are frequently compared with it. Only one slug is needed. + +*Returned Response:* + + + + +[ProductFrequentlyComparedSimilarResponse](#ProductFrequentlyComparedSimilarResponse) + +Success. Returns an array of objects containing the attributes for comparision. Check the example shown below or refer `ProductFrequentlyComparedSimilarResponse` for more details. + + + + +
    +  Example: + +```json +{ + "similars": { + "title": "Most Compared", + "subtitle": "We bet you would love these!", + "attributes_metadata": [ + { + "title": "Alexander Sawyer", + "details": [ + { + "key": "color", + "display": "Kimberly Davidson", + "description": "" + }, + { + "key": "gender", + "display": "Kimberly Mcdaniel", + "description": "" + }, + { + "key": "material", + "display": "Monica Hampton", + "description": "" + }, + { + "key": "weight", + "display": "John Mendoza", + "description": "" + } + ] + } + ], + "items": [ + { + "type": "product", + "name": "benchmark collaborative paradigms", + "item_type": "set", + "slug": "benchmark-collaborative-paradigms", + "id": 1, + "brand": { + "type": "brand", + "name": "Barry, Jennings and Larson", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "benchmark-collaborative-paradigms" + } + }, + "type": "page" + }, + "attributes": { + "color_hex": "808080", + "weight": 100, + "product_type": "LaptopBags", + "gender": [ + "Men", + "Women" + ], + "material": "Neoprene", + "style_note": "Shape up your overall appeal with this stunning laptop bag. The amazing storage and great design will let you carry your laptop in style!", + "item_code": "LGLAPTOPSLEEVE5", + "occasion": "Casual", + "primary_color": "Grey", + "primary_material": "Others", + "variant": "LGLAPTOPSLEEVE5", + "color": "DarkGrey", + "product_details": "This is a Unisex Product.", + "primary_color_hex": "808080" + }, + "medias": [ + { + "type": "image", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1309_LGLAPTOPSLEEVE5/1_1564735832806.jpg" + } + ], + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "rating": 2.7, + "rating_count": 2 + }, + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "deploy viral systems", + "slug": "deploy-viral-systems", + "uid": 2, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "deploy-viral-systems" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "rating": 2.7 + } + ] + } +} +``` +
    + + + + + + + + + +--- + + +#### getProductSimilarByIdentifier +Get similar products + + + + +```swift +catalog.getProductSimilarByIdentifier(slug: slug, similarType: similarType) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | +| similarType | String | yes | Similarity criteria such as basic, visual, price, seller, category and spec. Visual - Products having similar patterns, Price - Products in similar price range, Seller - Products sold by the same seller, Category - Products belonging to the same category, e.g. sports shoes, Spec - Products having similar specifications, e.g. phones with same memory. | + + + +Use this API to retrieve products similar to the one specified by its slug. You can search not only similar looking products, but also those that are sold by same seller, or those that belong to the same category, price, specifications, etc. + +*Returned Response:* + + + + +[SimilarProductByTypeResponse](#SimilarProductByTypeResponse) + +Success. Returns a group of similar products based on type. Check the example shown below or refer `SimilarProductByTypeResponse` for more details. + + + + +
    +  Example: + +```json +{ + "similars": { + "title": "Brand", + "subtitle": "", + "type": "brand", + "items": [ + { + "type": "product", + "attributes": { + "primary_color_hex": null, + "features": "
  • Dura-pump Technology
  • i-Pure Technology
  • Powerful Air Throw
  • Cool Flow Dispenser
  • Engg. Plastic: Blower
  • Blower/Fan Diameter (mm): 180
  • Ice Chamber
  • Cool Flow Dispenser
  • Cooling Media: Honeycomb
  • Air Throw Distance (mt): 9/30
  • ", + "model": "DiET 35T", + "air-cooler-type": "Portable", + "primary_color": "" + }, + "categories": [ + { + "id": 2717, + "uid": 2717, + "name": "Air Coolers", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "category": [ + "air-coolers" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "Symphony Diet 35t Portable Air Cooler", + "slug": "symphony-diet-35t-portable-air-cooler", + "uid": 7502019, + "item_type": "standard", + "item_code": "491297014", + "brand": { + "type": "brand", + "name": "Symphony", + "logo": { + "type": "image", + "url": "https://hdn-1.jiox0.de/jiox0/brands/pictures/square-logo/original/69sKmY_CX-Logo.jpeg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "symphony" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "params": { + "slug": [ + "symphony-diet-35t-portable-air-cooler" + ] + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.jiox0.de/jiox0/products/pictures/item/free/original/63/491297014/0/5aKOS19APd-symphony-diet-35t-air-coolers-491297014-i-1-1200wx1200h.jpeg" + }, + { + "type": "image", + "url": "https://hdn-1.jiox0.de/jiox0/products/pictures/item/free/original/63/491297014/1/NY6IJ7xfug-symphony-diet-35t-air-coolers-491297014-i-2-1200wx1200h.jpeg" + } + ], + "discount": "", + "price": { + "marked": { + "min": 9299, + "max": 9299, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 9299, + "max": 9299, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "_custom_json": {}, + "highlights": [ + "Powerful Air Throw ", + "Large 35 Litre Tank Capacity ", + "Automatic Louvers ", + "Multi Directional Wheels ", + "High Efficiency Honey Comb Pad" + ], + "description": "Exclusively suited for your cozy bedroom, Symphony DiET 35T Portable Air Cooler, assures you your comfort while it makes summers fun. Powered by a 35 litre tank, a high efficiency honeycomb pad and ice chamber, it is indeed your coolest buddy in summers. Automatic louvers, multi-directional wheels and three speed remote controlled setting options make it an ideal buy.", + "country_of_origin": "India" + } + ] + } +} +``` +
    + + + + + + + + + +--- + + +#### getProductVariantsBySlug +Get variant of a particular product + + + + +```swift +catalog.getProductVariantsBySlug(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | + + + +A product can have a different type of variants such as colour, shade, memory. Use this API to fetch all the available variants of a product using its slug. + +*Returned Response:* + + + + +[ProductVariantsResponse](#ProductVariantsResponse) + +Success. Returns all variants of a product. Check the example shown below or refer `ProductVariantsResponse` for more details. For `display_type:image`, `color` key will be present otherwise `value` key will be shown. + + + + +
    +  Example: + +```json +{ + "variants": [ + { + "header": "Addtn. Color", + "key": "color", + "display_type": "image", + "logo": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/360x0/56_MKT02AI060CORAL/1_1567590349681.jpg", + "items": [ + { + "action": { + "page": { + "type": "product", + "query": { + "slug": "benchmark-collaborative-paradigms" + } + }, + "type": "page" + }, + "uid": 1, + "slug": "benchmark-collaborative-paradigms", + "medias": [ + { + "type": "image", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1309_LGLAPTOPSLEEVE5/1_1564735832806.jpg" + } + ], + "name": "benchmark collaborative paradigms", + "is_available": true, + "color_name": "DarkGrey", + "color": "808080" + } + ] + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getProductStockByIds +Get the stock of a product + + + + +```swift +catalog.getProductStockByIds(itemId: itemId, alu: alu, skuCode: skuCode, ean: ean, upc: upc) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| itemId | String? | no | The Item ID of the product (Max. 50 allowed) | +| alu | String? | no | ALU of the product (limited upto 50 ALU identifier in a single request) | +| skuCode | String? | no | Stock-keeping Unit of the product (limited upto 50 SKU Code in a single request) | +| ean | String? | no | European Article Number of the product (limited upto 50 EAN identifier in a single request) | +| upc | String? | no | Universal Product Code of the product (limited upto 50 UPC identifier in a single request) | + + + +Retrieve the available stock of the products. Use this API to retrieve stock of multiple products (up to 50) at a time. + +*Returned Response:* + + + + +[ProductStockStatusResponse](#ProductStockStatusResponse) + +Success. Returns the status of the product stock.Check the example shown below or refer `ProductStockStatusResponse` for more details. + + + + +
    +  Example: + +```json +{ + "items": [ + { + "uid": "1", + "item_id": 1, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "2", + "item_id": 1, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "3", + "item_id": 2, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "4", + "item_id": 2, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "5", + "item_id": 3, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "6", + "item_id": 3, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "7", + "item_id": 4, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "8", + "item_id": 4, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "9", + "item_id": 5, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "10", + "item_id": 5, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "11", + "item_id": 6, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "12", + "item_id": 6, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "13", + "item_id": 7, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "14", + "item_id": 7, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "15", + "item_id": 8, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "16", + "item_id": 8, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "17", + "item_id": 9, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "18", + "item_id": 9, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "19", + "item_id": 10, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "20", + "item_id": 10, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "21", + "item_id": 11, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "22", + "item_id": 11, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "23", + "item_id": 12, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "24", + "item_id": 12, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "25", + "item_id": 13, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "26", + "item_id": 13, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "27", + "item_id": 14, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "28", + "item_id": 14, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "29", + "item_id": 15, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + }, + { + "uid": "30", + "item_id": 15, + "identifier": { + "sku_code": "P10101101154425S" + }, + "price": { + "effective": 399, + "marked": 399, + "currency": "INR" + }, + "size": "13", + "company": { + "id": 1, + "name": "Natalie Norman" + }, + "store": { + "id": 1, + "name": "Wayne Lamb", + "code": "Wayne-Lamb" + }, + "quantity": 5 + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getProductStockForTimeByIds +Get the stock of a product + + + + +```swift +catalog.getProductStockForTimeByIds(timestamp: timestamp, pageSize: pageSize, pageId: pageId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| timestamp | String | yes | Timestamp in UTC format (2020-07-23T10:27:50Z) | +| pageSize | Int? | no | The number of items to retrieve in each page. | +| pageId | String? | no | Page ID to retrieve next set of results. | + + + +Retrieve the available stock of the products. Use this API to get the stock status of products whose inventory is updated at the specified time + +*Returned Response:* + + + + +[ProductStockPolling](#ProductStockPolling) + +Success. Returns the status of the product stock.Check the example shown below or refer `ProductStockPolling` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getProducts +Get all the products + + + + +```swift +catalog.getProducts(q: q, f: f, filters: filters, sortOn: sortOn, pageId: pageId, pageSize: pageSize, pageNo: pageNo, pageType: pageType) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| q | String? | no | The search query for entering partial or full name of product, brand, category, or collection. | +| f | String? | no | The search filter parameters. Filter parameters will be passed in f parameter as shown in the example below. Double Pipe (||) denotes the OR condition, whereas Triple-colon (:::) indicates a new filter paramater applied as an AND condition. | +| filters | Bool? | no | This is a boolean value, True for fetching all filter parameters and False for disabling the filter parameters. | +| sortOn | String? | no | The order in which the list of products should be sorted, e.g. popularity, price, latest and discount, in either ascending or descending order. See the supported values below. | +| pageId | String? | no | Page ID to retrieve next set of results. | +| pageSize | Int? | no | The number of items to retrieve in each page. | +| pageNo | Int? | no | The page number to navigate through the given set of results. | +| pageType | String? | no | Available pagination types are cursor or number. | + + + +Use this API to list all the products. You may choose a sort order or make arbitrary search queries by entering the product name, brand, category or collection. + +*Returned Response:* + + + + +[ProductListingResponse](#ProductListingResponse) + +Success. Returns a paginated list of products..Check the example shown below or refer `ProductListingResponse` for more details. + + + + +
    +  Example: + +```json +{ + "filters": [ + { + "key": { + "display": "Department", + "name": "department", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Department.svg" + }, + "values": [ + { + "display": "Debra Villarreal", + "count": 15, + "is_selected": false, + "value": "Debra-Villarreal", + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "display": "Tracey Miller", + "count": 15, + "is_selected": false, + "value": "Tracey-Miller", + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + } + ] + }, + { + "key": { + "display": "Category", + "name": "category", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Category.svg" + }, + "values": [ + { + "display": "Amy Kim DDS", + "count": 15, + "is_selected": false, + "value": "3", + "logo": "http://cdn4.gofynd.com/media/banner/category/original/12063_a5bb91bd5cb44c3c9db98c2a0e6b3d99.jpg" + } + ] + }, + { + "key": { + "display": "Gender", + "name": "gender", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Gender.svg" + }, + "values": [ + { + "display": "Men", + "count": 15, + "is_selected": false, + "value": "men" + }, + { + "display": "Women", + "count": 15, + "is_selected": false, + "value": "women" + } + ] + }, + { + "key": { + "display": "Size", + "name": "sizes", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Sizes.svg" + }, + "values": [ + { + "display": "13", + "count": 15, + "is_selected": false, + "value": "13" + } + ] + }, + { + "key": { + "display": "Brand", + "name": "brand", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Brand%20ID.svg" + }, + "values": [ + { + "display": "Barry, Jennings and Larson", + "count": 15, + "is_selected": false, + "value": "1", + "logo": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + } + ] + }, + { + "key": { + "display": "Rating", + "name": "rating", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Rating.svg" + }, + "values": [ + { + "count": 15, + "display": "2 - 3", + "value": "[2 TO 3}", + "is_selected": false + } + ] + }, + { + "key": { + "display": "Image", + "name": "image_nature", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/image%20Nature.svg" + }, + "values": [ + { + "display": "GoodQuality", + "count": 15, + "is_selected": false, + "value": "standard" + } + ] + }, + { + "key": { + "display": "Monica Hampton", + "name": "material", + "kind": "multivalued", + "logo": "" + }, + "values": [ + { + "display": "Neoprene", + "count": 15, + "is_selected": false, + "value": "Neoprene" + } + ] + }, + { + "key": { + "display": "John Mendoza", + "name": "weight", + "kind": "multivalued", + "logo": "" + }, + "values": [ + { + "display": "100", + "count": 15, + "is_selected": false, + "value": "100" + } + ] + }, + { + "key": { + "display": "Kimberly Mcdaniel", + "name": "gender", + "kind": "multivalued", + "logo": "" + }, + "values": [ + { + "display": "['Men', 'Women']", + "count": 15, + "is_selected": false, + "value": "['Men', 'Women']" + } + ] + }, + { + "key": { + "display": "Kimberly Davidson", + "name": "color", + "kind": "multivalued", + "logo": "" + }, + "values": [ + { + "display": "Grey", + "count": 15, + "is_selected": false, + "value": "808080" + } + ] + }, + { + "key": { + "display": "Available", + "name": "is_available", + "kind": "singlevalued" + }, + "values": [ + { + "display": "Available", + "count": 3, + "is_selected": false, + "value": "true" + } + ] + } + ], + "items": [ + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "benchmark collaborative paradigms", + "slug": "benchmark-collaborative-paradigms", + "uid": 1, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "benchmark-collaborative-paradigms" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "item_code": "ITEM_CODE_1", + "rating": 2.7 + }, + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "architect granular e-business", + "slug": "architect-granular-e-business", + "uid": 10, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "architect-granular-e-business" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "item_code": "ITEM_CODE_2", + "rating": 2.7 + }, + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "facilitate enterprise supply-chains", + "slug": "facilitate-enterprise-supply-chains", + "uid": 11, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "facilitate-enterprise-supply-chains" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "item_code": "ITEM_CODE_3", + "rating": 2.7 + }, + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "optimize web-enabled e-tailers", + "slug": "optimize-web-enabled-e-tailers", + "uid": 12, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "optimize-web-enabled-e-tailers" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "item_code": "ITEM_CODE_4", + "rating": 2.7 + } + ], + "sort_on": [ + { + "display": "Latest Products.", + "name": "Latest Products.", + "logo": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/360x0/56_MKT02AI060CORAL/1_1567590349681.jpg", + "value": "latest", + "is_selected": true + } + ], + "page": { + "current": 1, + "total": 2, + "has_previous": false, + "has_next": true, + "item_total": 15, + "type": "number" + } +} +``` +
    + + + + + + + + + +--- + + +#### getBrands +Get all the brands + + + + +```swift +catalog.getBrands(department: department, pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| department | String? | no | The name of the department. Use this parameter to filter products by a particular department. See the list of available departments below. Also, you can get available departments from the endpoint /service/application/catalog/v1.0/departments/ | +| pageNo | Int? | no | The page number to navigate through the given set of results. | +| pageSize | Int? | no | The number of items to retrieve in each page. | + + + +A brand is the name under which a product is sold. Use this API to list all the brands. You can also filter the brands by department. + +*Returned Response:* + + + + +[BrandListingResponse](#BrandListingResponse) + +Success. Returns a paginated list of brands. Check the example shown below or refer `BrandListingResponse` for more details. + + + + +
    +  Example: + +```json +{ + "items": [ + { + "uid": 1, + "name": "Barry, Jennings and Larson", + "slug": "Hess-Inc", + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "banners": { + "portrait": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/12537_9cdfc6835e814b0986ee1643d38cf6cd.png" + } + }, + "en_name": "Barry, Jennings and Larson" + } + ], + "page": { + "current": 1, + "total": 1, + "has_previous": false, + "has_next": false, + "item_total": 1, + "type": "number" + } +} +``` +
    + + + + + + + + + +--- + + +#### getBrandDetailBySlug +Get metadata of a brand + + + + +```swift +catalog.getBrandDetailBySlug(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a brand. You can get slug value from the endpoint /service/application/catalog/v1.0/brands/. | + + + +Fetch metadata of a brand such as name, information, logo, banner, etc. + +*Returned Response:* + + + + +[BrandDetailResponse](#BrandDetailResponse) + +Success. Returns a metadata object. Check the example shown below or refer `BrandDetailResponse` for more details. + + + + +
    +  Example: + +```json +{ + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "banners": { + "portrait": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/12537_9cdfc6835e814b0986ee1643d38cf6cd.png" + }, + "landscape": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner/brand/original/12536_e1a5cdcefc7540e68cedd8c2b0673179.png" + } + }, + "uid": 1, + "name": "Hess Inc" +} +``` +
    + + + + + + + + + +--- + + +#### getCategories +List all the categories + + + + +```swift +catalog.getCategories(department: department) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| department | String? | no | The name of the department. Use this parameter to filter products by a particular department. See the list of available departments below. Also, you can get available departments from the endpoint /service/application/catalog/v1.0/departments/ | + + + +Use this API to list all the categories. You can also filter the categories by department. + +*Returned Response:* + + + + +[CategoryListingResponse](#CategoryListingResponse) + +Success. Returns a list of categories. Check the example shown below or refer `CategoryListingResponse` for more details. + + + + +
    +  Example: + +```json +{ + "departments": [ + { + "slug": "Cody-Doyle", + "uid": 1 + } + ], + "data": [ + { + "department": "Cody-Doyle", + "items": [ + { + "name": "Janet Parker", + "image": { + "aspect_ratio": "13:20", + "aspect_ratio_f": 0.65, + "url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/banner_portrait/category/resize-w:130,h:200/12064_e69e1d8b5e934d3488f0dc8663d8a158.jpg" + }, + "uid": 1, + "slug": "Janet-Parker", + "_custom_json": {}, + "action": { + "type": "category", + "url": "https://api.addsale.com/platform/content/v1/products/?l1_category=Janet-Parker&department=Jaime-Chambers", + "query": { + "l1_category": [ + "Janet-Parker" + ], + "department": [ + "Jaime-Chambers" + ] + } + }, + "childs": [ + { + "name": "Hannah Lawson", + "image": { + "aspect_ratio": "13:20", + "aspect_ratio_f": 0.65, + "url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/banner_portrait/category/resize-w:130,h:200/12064_e69e1d8b5e934d3488f0dc8663d8a158.jpg" + }, + "uid": 2, + "slug": "Hannah-Lawson", + "_custom_json": {}, + "action": { + "type": "category", + "url": "https://api.addsale.com/platform/content/v1/products/?l2_category=Hannah-Lawson&department=Jaime-Chambers", + "query": { + "l2_category": [ + "Hannah-Lawson" + ], + "department": [ + "Jaime-Chambers" + ] + } + }, + "childs": [ + { + "name": "Logan Black", + "image": { + "aspect_ratio": "13:20", + "aspect_ratio_f": 0.65, + "url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/banner_portrait/category/resize-w:130,h:200/12064_e69e1d8b5e934d3488f0dc8663d8a158.jpg" + }, + "uid": 3, + "slug": "Logan-Black", + "_custom_json": {}, + "action": { + "type": "category", + "url": "https://api.addsale.com/platform/content/v1/products/?category=Logan-Black&department=Jaime-Chambers", + "query": { + "category": [ + "Logan-Black" + ], + "department": [ + "Jaime-Chambers" + ] + } + }, + "childs": [] + } + ] + } + ] + } + ] + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getCategoryDetailBySlug +Get metadata of a category + + + + +```swift +catalog.getCategoryDetailBySlug(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a brand. You can get slug value from the endpoint /service/application/catalog/v1.0/brands/. | + + + +Fetch metadata of a category such as name, information, logo, banner, etc. + +*Returned Response:* + + + + +[CategoryMetaResponse](#CategoryMetaResponse) + +Success. Returns metadata of a category. Check the example shown below or refer `CategoryMetaResponse` for more details. + + + + +
    +  Example: + +```json +{ + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/banner/category/original/12063_a5bb91bd5cb44c3c9db98c2a0e6b3d99.jpg" + }, + "uid": 1, + "name": "Kyle Cabrera", + "banners": { + "portrait": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/banner_portrait/category/original/12064_e69e1d8b5e934d3488f0dc8663d8a158.jpg" + }, + "landscape": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/banner/category/original/12063_a5bb91bd5cb44c3c9db98c2a0e6b3d99.jpg" + } + }, + "_custom_json": {} +} +``` +
    + + + + + + + + + +--- + + +#### getHomeProducts +List the products + + + + +```swift +catalog.getHomeProducts(sortOn: sortOn, pageId: pageId, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| sortOn | String? | no | The order in which the list of products should be sorted, e.g. popularity, price, latest and discount, in either ascending or descending order. | +| pageId | String? | no | Page ID to retrieve next set of results. | +| pageSize | Int? | no | The number of items to retrieve in each page. | + + + +List all the products associated with a brand, collection or category in a random order. + +*Returned Response:* + + + + +[HomeListingResponse](#HomeListingResponse) + +Success. Returns a paginated list of products. Check the example shown below or refer `HomeListingResponse` for more details. + + + + +
    +  Example: + +```json +{ + "items": [ + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "whiteboard holistic functionalities", + "slug": "whiteboard-holistic-functionalities", + "uid": 7, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "whiteboard-holistic-functionalities" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "rating": 2.7 + }, + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "envisioneer user-centric technologies", + "slug": "envisioneer-user-centric-technologies", + "uid": 6, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "envisioneer-user-centric-technologies" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "rating": 2.7 + }, + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "deploy viral systems", + "slug": "deploy-viral-systems", + "uid": 2, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "deploy-viral-systems" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "rating": 2.7 + }, + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "syndicate compelling e-commerce", + "slug": "syndicate-compelling-e-commerce", + "uid": 8, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "syndicate-compelling-e-commerce" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "rating": 2.7 + }, + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "leverage granular e-commerce", + "slug": "leverage-granular-e-commerce", + "uid": 3, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "leverage-granular-e-commerce" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "rating": 2.7 + }, + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "deliver bleeding-edge systems", + "slug": "deliver-bleeding-edge-systems", + "uid": 13, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "deliver-bleeding-edge-systems" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "rating": 2.7 + }, + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "optimize web-enabled e-tailers", + "slug": "optimize-web-enabled-e-tailers", + "uid": 12, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "optimize-web-enabled-e-tailers" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "rating": 2.7 + }, + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "architect granular e-business", + "slug": "architect-granular-e-business", + "uid": 10, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "architect-granular-e-business" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "rating": 2.7 + }, + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "drive scalable applications", + "slug": "drive-scalable-applications", + "uid": 5, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "drive-scalable-applications" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "rating": 2.7 + }, + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "cultivate web-enabled e-tailers", + "slug": "cultivate-web-enabled-e-tailers", + "uid": 4, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "cultivate-web-enabled-e-tailers" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "rating": 2.7 + }, + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "facilitate enterprise supply-chains", + "slug": "facilitate-enterprise-supply-chains", + "uid": 11, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "facilitate-enterprise-supply-chains" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "rating": 2.7 + }, + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "benchmark collaborative paradigms", + "slug": "benchmark-collaborative-paradigms", + "uid": 1, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "benchmark-collaborative-paradigms" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "rating": 2.7 + } + ], + "page": { + "next_id": "AoJftsmkNiEx", + "has_previous": false, + "has_next": true, + "item_total": 15, + "type": "number" + }, + "sort_on": "random_36547cfbb4c54a1a992c17aa5 asc" +} +``` +
    + + + + + + + + + +--- + + +#### getDepartments +List all the departments + + + + +```swift +catalog.getDepartments() { (response, error) in + // Use response +} +``` + + + + + + +Departments are a way to categorise similar products. A product can lie in multiple departments. For example, a skirt can below to the 'Women's Fashion' Department while a handbag can lie in 'Women's Accessories' Department. Use this API to list all the departments. If successful, returns the list of departments specified in `DepartmentResponse` + +*Returned Response:* + + + + +[DepartmentResponse](#DepartmentResponse) + +List of Departments. See example below or refer `DepartmentResponse` for details. + + + + +
    +  Example: + +```json +{ + "items": [ + { + "uid": 1, + "name": "Zachary Harris", + "slug": "Zachary-Harris", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "uid": 2, + "name": "Aaron Reilly", + "slug": "Aaron-Reilly", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "uid": 3, + "name": "Bobby Sandoval", + "slug": "Bobby-Sandoval", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "uid": 4, + "name": "Seth Hughes", + "slug": "Seth-Hughes", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "uid": 5, + "name": "Michelle Moore", + "slug": "Michelle-Moore", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "uid": 6, + "name": "Annette Baldwin", + "slug": "Annette-Baldwin", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "uid": 7, + "name": "Chris Mata", + "slug": "Chris-Mata", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "uid": 8, + "name": "Nicole Jacobs", + "slug": "Nicole-Jacobs", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "uid": 9, + "name": "Pamela Smith", + "slug": "Pamela-Smith", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "uid": 10, + "name": "Nicole Simon", + "slug": "Nicole-Simon", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getSearchResults +Get relevant suggestions for a search query + + + + +```swift +catalog.getSearchResults(q: q) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| q | String | yes | The search query for entering partial or full name of a product, brand or category. For example, if the given search query `q` is _ski_, the relevant search suggestions could be _skirt_, _ski shoes_, __skin cream_ etc. | + + + +Retrieves a list of suggestions for a given search query. Each suggestion is a valid search term that's generated on the basis of query. This is particularly useful to enhance the user experience while using the search tool. + +*Returned Response:* + + + + +[AutoCompleteResponse](#AutoCompleteResponse) + +Success. Returns a list autocomplete suggestions for the search query `q`. Check the example shown below or refer `AutoCompleteResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getCollections +List all the collections + + + + +```swift +catalog.getCollections(pageNo: pageNo, pageSize: pageSize, tag: tag) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results. | +| pageSize | Int? | no | The number of items to retrieve in each page. | +| tag | [String]? | no | List of tags to filter collections | + + + +Collections are a great way to organize your products and can improve the ability for customers to find items quickly and efficiently. + +*Returned Response:* + + + + +[GetCollectionListingResponse](#GetCollectionListingResponse) + +Success. Returns a list of collections. Check the example shown below or refer `GetCollectionListingResponse` for more details. + + + + +
    +  Example: + +```json +{ + "page": { + "type": "number", + "current": 1, + "total": 1, + "has_previous": false, + "has_next": false, + "item_total": 2 + }, + "items": [ + { + "uid": "601a4f39448327cfa83e7db2", + "type": "query", + "query": { + "category": [ + "Anna-Navarro" + ] + }, + "name": "collection with Anna-Navarro", + "banners": { + "portrait": { + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1571729908/production/applications/app_000000000000000000000001/media/collection/portrait/pewrpnjrhcrca1dmtvx5.png", + "aspect_ratio": "13:20" + }, + "landscape": { + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1571729858/production/applications/app_000000000000000000000001/media/collection/landscape/tkclmj847hdvfbudeqbr.png", + "aspect_ratio": "27:20" + } + }, + "logo": { + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1571729838/production/applications/app_000000000000000000000001/media/collection/logo/xierjsrcwhd2fphzyjod.png", + "aspect_ratio": "1:1" + }, + "published": true, + "description": "Crimsoune Club | Upto 70% Off", + "is_active": true, + "tags": [ + "men", + "women" + ], + "slug": "crimsoune-club-upto-70-off-754fa043", + "action": { + "type": "collection", + "url": "https://api.addsale.com/platform/content/v1/collections/crimsoune-club-upto-70-off-754fa043/items/" + }, + "allow_facets": true, + "allow_sort": true, + "visible_facets_keys": [], + "meta": {}, + "badge": {}, + "sort_on": "popular", + "_custom_json": {}, + "_locale_language": {}, + "_schedule": {} + }, + { + "uid": "601a4f39448327cfa83e7db0", + "type": "items", + "query": {}, + "name": "collection with items", + "banners": { + "portrait": { + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1571729908/production/applications/app_000000000000000000000001/media/collection/portrait/pewrpnjrhcrca1dmtvx5.png", + "aspect_ratio": "13:20" + }, + "landscape": { + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1571729858/production/applications/app_000000000000000000000001/media/collection/landscape/tkclmj847hdvfbudeqbr.png", + "aspect_ratio": "27:20" + } + }, + "logo": { + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1571729838/production/applications/app_000000000000000000000001/media/collection/logo/xierjsrcwhd2fphzyjod.png", + "aspect_ratio": "1:1" + }, + "published": true, + "description": "Crimsoune Club | Upto 70% Off", + "is_active": true, + "tags": [ + "men", + "women" + ], + "slug": "crimsoune-club-upto-70-off-754fa043", + "action": { + "type": "collection", + "url": "https://api.addsale.com/platform/content/v1/collections/crimsoune-club-upto-70-off-754fa043/items/" + }, + "allow_facets": true, + "allow_sort": true, + "visible_facets_keys": [], + "meta": {}, + "badge": {}, + "sort_on": "popular", + "_custom_json": {}, + "_locale_language": {}, + "_schedule": {} + } + ], + "filters": { + "tags": [ + { + "name": "men", + "is_selected": false, + "display": "men" + }, + { + "name": "women", + "is_selected": false, + "display": "women" + } + ], + "type": [ + { + "name": "items", + "is_selected": false, + "display": "items" + }, + { + "name": "query", + "is_selected": false, + "display": "query" + } + ] + } +} +``` +
    + + + + + + + + + +--- + + +#### getCollectionItemsBySlug +Get the items in a collection + + + + +```swift +catalog.getCollectionItemsBySlug(slug: slug, f: f, filters: filters, sortOn: sortOn, pageId: pageId, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a collection. You can get slug value from the endpoint /service/application/catalog/v1.0/collections/. | +| f | String? | no | The search filter parameters. Filter parameters will be passed in f parameter as shown in the example below. Double Pipe (||) denotes the OR condition, whereas Triple-colon (:::) indicates a new filter paramater applied as an AND condition. | +| filters | Bool? | no | This is a boolean value, True for fetching all filter parameters and False for disabling the filter parameters. | +| sortOn | String? | no | The order in which the list of products should be sorted, e.g. popularity, price, latest and discount, in either ascending or descending order. See the supported values below. | +| pageId | String? | no | Page ID to retrieve next set of results. | +| pageSize | Int? | no | The number of items to retrieve in each page. | + + + +Get items in a collection specified by its `slug`. + +*Returned Response:* + + + + +[ProductListingResponse](#ProductListingResponse) + +Success. Returns a list items in a given collection. Check the example shown below or refer `ProductListingResponse` for more details. + + + + +
    +  Example: + +```json +{ + "filters": [ + { + "key": { + "display": "Department", + "name": "department", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Department.svg" + }, + "values": [ + { + "display": "Debra Villarreal", + "count": 1, + "is_selected": false, + "value": "Debra-Villarreal", + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "display": "Tracey Miller", + "count": 1, + "is_selected": false, + "value": "Tracey-Miller", + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + } + ] + }, + { + "key": { + "display": "Category", + "name": "category", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Category.svg" + }, + "values": [ + { + "display": "Amy Kim DDS", + "count": 1, + "is_selected": false, + "value": "3", + "logo": "http://cdn4.gofynd.com/media/banner/category/original/12063_a5bb91bd5cb44c3c9db98c2a0e6b3d99.jpg" + } + ] + }, + { + "key": { + "display": "Gender", + "name": "gender", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Gender.svg" + }, + "values": [ + { + "display": "Men", + "count": 1, + "is_selected": false, + "value": "men" + }, + { + "display": "Women", + "count": 1, + "is_selected": false, + "value": "women" + } + ] + }, + { + "key": { + "display": "Size", + "name": "sizes", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Sizes.svg" + }, + "values": [ + { + "display": "13", + "count": 1, + "is_selected": false, + "value": "13" + } + ] + }, + { + "key": { + "display": "Brand", + "name": "brand", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Brand%20ID.svg" + }, + "values": [ + { + "display": "Barry, Jennings and Larson", + "count": 1, + "is_selected": false, + "value": "1", + "logo": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + } + ] + }, + { + "key": { + "display": "Rating", + "name": "rating", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Rating.svg" + }, + "values": [ + { + "count": 1, + "display": "2 - 3", + "value": "[2 TO 3}", + "is_selected": false + } + ] + }, + { + "key": { + "display": "Image", + "name": "image_nature", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/image%20Nature.svg" + }, + "values": [ + { + "display": "GoodQuality", + "count": 1, + "is_selected": false, + "value": "standard" + } + ] + }, + { + "key": { + "display": "Monica Hampton", + "name": "material", + "kind": "multivalued", + "logo": "" + }, + "values": [ + { + "display": "Neoprene", + "count": 1, + "is_selected": false, + "value": "Neoprene" + } + ] + }, + { + "key": { + "display": "John Mendoza", + "name": "weight", + "kind": "multivalued", + "logo": "" + }, + "values": [ + { + "display": "100", + "count": 1, + "is_selected": false, + "value": "100" + } + ] + }, + { + "key": { + "display": "Kimberly Mcdaniel", + "name": "gender", + "kind": "multivalued", + "logo": "" + }, + "values": [ + { + "display": "['Men', 'Women']", + "count": 1, + "is_selected": false, + "value": "['Men', 'Women']" + } + ] + }, + { + "key": { + "display": "Kimberly Davidson", + "name": "color", + "kind": "multivalued", + "logo": "" + }, + "values": [ + { + "display": "Grey", + "count": 1, + "is_selected": false, + "value": "808080" + } + ] + }, + { + "key": { + "display": "Available", + "name": "is_available", + "kind": "singlevalued" + }, + "values": [ + { + "display": "Available", + "count": 3, + "is_selected": false, + "value": "true" + } + ] + } + ], + "items": [ + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "benchmark collaborative paradigms", + "slug": "benchmark-collaborative-paradigms", + "uid": 1, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "benchmark-collaborative-paradigms" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "rating": 2.7 + } + ], + "sort_on": [ + { + "display": "Latest Products.", + "name": "Latest Products.", + "logo": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/360x0/56_MKT02AI060CORAL/1_1567590349681.jpg", + "value": "latest", + "is_selected": false + } + ], + "page": { + "type": "number", + "current": 1, + "total": 1, + "has_previous": false, + "has_next": false, + "item_total": 1 + } +} +``` +
    + + + + + + + + + +--- + + +#### getCollectionDetailBySlug +Get a particular collection + + + + +```swift +catalog.getCollectionDetailBySlug(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a collection. You can get slug value from the endpoint /service/application/catalog/v1.0/collections/. | + + + +Get the details of a collection by its `slug`. + +*Returned Response:* + + + + +[CollectionDetailResponse](#CollectionDetailResponse) + +Success. Returns a Collection object. Check the example shown below or refer `CollectionDetailResponse` for more details. + + + + +
    +  Example: + +```json +{ + "uid": "601a4f39448327cfa83e7db0", + "type": "items", + "query": {}, + "name": "collection with items", + "banners": { + "portrait": { + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1571729908/production/applications/app_000000000000000000000001/media/collection/portrait/pewrpnjrhcrca1dmtvx5.png" + }, + "landscape": { + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1571729858/production/applications/app_000000000000000000000001/media/collection/landscape/tkclmj847hdvfbudeqbr.png" + } + }, + "logo": { + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1571729838/production/applications/app_000000000000000000000001/media/collection/logo/xierjsrcwhd2fphzyjod.png" + }, + "published": true, + "description": "Crimsoune Club | Upto 70% Off", + "is_active": true, + "tags": [ + "men", + "women" + ], + "slug": "crimsoune-club-upto-70-off-754fa043", + "action": { + "page": { + "type": "collection", + "query": { + "collection": [ + "crimsoune-club-upto-70-off-754fa043" + ] + } + }, + "type": "page" + }, + "allow_facets": true, + "allow_sort": true, + "visible_facets_keys": [], + "meta": {}, + "badge": {}, + "sort_on": "popular", + "_custom_json": {}, + "_locale_language": {}, + "_schedule": {} +} +``` +
    + + + + + + + + + +--- + + +#### getFollowedListing +Get a list of followed Products, Brands, Collections + + + + +```swift +catalog.getFollowedListing(collectionType: collectionType, pageId: pageId, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| collectionType | String | yes | Type of collection followed, i.e. products, brands, or collections. | +| pageId | String? | no | Page ID to retrieve next set of results. | +| pageSize | Int? | no | Page ID to retrieve next set of results. | + + + +Users can follow a product they like. This API retrieves the products the user have followed. + +*Returned Response:* + + + + +[GetFollowListingResponse](#GetFollowListingResponse) + +Success. Returns a Followed resource object. Check the example shown below or refer `GetFollowListingResponse` for more details. + + + + +
    +  Example: + +```json +{ + "items": [ + { + "type": "product", + "name": "revolutionize end-to-end technologies", + "item_type": "set", + "slug": "revolutionize-end-to-end-technologies", + "uid": 1, + "brand": { + "type": "brand", + "name": "Chen PLC", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Chen-PLC" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "sellable": false, + "action": { + "page": { + "type": "product", + "query": { + "slug": "revolutionize-end-to-end-technologies" + } + }, + "type": "page" + }, + "attributes": { + "color_hex": "808080", + "weight": 100, + "product_type": "LaptopBags", + "gender": [ + "Men", + "Women" + ], + "material": "Neoprene", + "style_note": "Shape up your overall appeal with this stunning laptop bag. The amazing storage and great design will let you carry your laptop in style!", + "item_code": "LGLAPTOPSLEEVE5", + "occasion": "Casual", + "primary_color": "Grey", + "primary_material": "Others", + "variant": "LGLAPTOPSLEEVE5", + "color": "DarkGrey", + "product_details": "This is a Unisex Product.", + "primary_color_hex": "808080" + }, + "medias": [ + { + "type": "image", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1309_LGLAPTOPSLEEVE5/1_1564735832806.jpg" + } + ], + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Paul Palmer", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Paul-Palmer" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "rating": 2.7, + "rating_count": 2 + }, + { + "type": "product", + "name": "grow B2B experiences", + "item_type": "set", + "slug": "grow-B2B-experiences", + "uid": 15, + "brand": { + "type": "brand", + "name": "Chen PLC", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Chen-PLC" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "sellable": false, + "action": { + "page": { + "type": "product", + "query": { + "slug": "grow-B2B-experiences" + } + }, + "type": "page" + }, + "attributes": { + "color_hex": "808080", + "weight": 100, + "product_type": "LaptopBags", + "gender": [ + "Men", + "Women" + ], + "material": "Neoprene", + "style_note": "Shape up your overall appeal with this stunning laptop bag. The amazing storage and great design will let you carry your laptop in style!", + "item_code": "LGLAPTOPSLEEVE5", + "occasion": "Casual", + "primary_color": "Grey", + "primary_material": "Others", + "variant": "LGLAPTOPSLEEVE5", + "color": "DarkGrey", + "product_details": "This is a Unisex Product.", + "primary_color_hex": "808080" + }, + "medias": [ + { + "type": "image", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1309_LGLAPTOPSLEEVE5/1_1564735832806.jpg" + } + ], + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Paul Palmer", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Paul-Palmer" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "rating": 2.7, + "rating_count": 2 + }, + { + "type": "product", + "name": "target robust systems", + "item_type": "set", + "slug": "target-robust-systems", + "uid": 14, + "brand": { + "type": "brand", + "name": "Chen PLC", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Chen-PLC" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "sellable": false, + "action": { + "page": { + "type": "product", + "query": { + "slug": "target-robust-systems" + } + }, + "type": "page" + }, + "attributes": { + "color_hex": "808080", + "weight": 100, + "product_type": "LaptopBags", + "gender": [ + "Men", + "Women" + ], + "material": "Neoprene", + "style_note": "Shape up your overall appeal with this stunning laptop bag. The amazing storage and great design will let you carry your laptop in style!", + "item_code": "LGLAPTOPSLEEVE5", + "occasion": "Casual", + "primary_color": "Grey", + "primary_material": "Others", + "variant": "LGLAPTOPSLEEVE5", + "color": "DarkGrey", + "product_details": "This is a Unisex Product.", + "primary_color_hex": "808080" + }, + "medias": [ + { + "type": "image", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1309_LGLAPTOPSLEEVE5/1_1564735832806.jpg" + } + ], + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Paul Palmer", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Paul-Palmer" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "rating": 2.7, + "rating_count": 2 + } + ], + "page": { + "next_id": "6066fc7b3b17fd7038c46317", + "has_previous": false, + "has_next": true, + "item_total": 15, + "type": "number" + } +} +``` +
    + + + + + + + + + +--- + + +#### unfollowById +Unfollow an entity (product/brand/collection) + + + + +```swift +catalog.unfollowById(collectionType: collectionType, collectionId: collectionId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| collectionType | String | yes | Type of collection followed, i.e. products, brands, or collections. | +| collectionId | String | yes | The ID of the collection type. | + + + +You can undo a followed product, brand or collection by its ID. This action is referred as _unfollow_. + +*Returned Response:* + + + + +[FollowPostResponse](#FollowPostResponse) + +Success. Returns a response object. Check the example shown below or refer `FollowPostResponse` for more details. + + + + +
    +  Example: + +```json +{ + "message": "Products Removed From Wishlist", + "id": "1" +} +``` +
    + + + + + + + + + +--- + + +#### followById +Follow an entity (product/brand/collection) + + + + +```swift +catalog.followById(collectionType: collectionType, collectionId: collectionId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| collectionType | String | yes | Type of collection followed, i.e. products, brands, or collections. | +| collectionId | String | yes | The ID of the collection type. | + + + +Follow a particular entity such as product, brand, collection specified by its ID. + +*Returned Response:* + + + + +[FollowPostResponse](#FollowPostResponse) + +Success. Returns a response object. Check the example shown below or refer `FollowPostResponse` for more details. + + + + +
    +  Example: + +```json +{ + "message": "Brands Added To Wishlist", + "id": "1" +} +``` +
    + + + + + + + + + +--- + + +#### getFollowerCountById +Get Follow Count + + + + +```swift +catalog.getFollowerCountById(collectionType: collectionType, collectionId: collectionId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| collectionType | String | yes | Type of collection, i.e. products, brands, or collections. | +| collectionId | String | yes | The ID of the collection type. | + + + +Get the total count of followers for a given collection type and collection ID. + +*Returned Response:* + + + + +[FollowerCountResponse](#FollowerCountResponse) + +Success. Returns the number of followers for a given collection type. Check the example shown below or refer `FollowerCountResponse` for more details. + + + + +
    +  Example: + +```json +{ + "count": 0 +} +``` +
    + + + + + + + + + +--- + + +#### getFollowIds +Get the IDs of followed products, brands and collections. + + + + +```swift +catalog.getFollowIds(collectionType: collectionType) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| collectionType | String? | no | Type of collection, i.e. products, brands, collections. | + + + +You can get the IDs of all the followed Products, Brands and Collections. Pass collection_type as query parameter to fetch specific Ids + +*Returned Response:* + + + + +[FollowIdsResponse](#FollowIdsResponse) + +Success. Returns the IDs of all the Products, Brands and Collections which were followed. Check the example shown below or refer `FollowIdsResponse` for more details. + + + + +
    +  Example: + +```json +{ + "data": { + "products": [ + 1, + 15, + 14, + 13, + 12, + 11, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2 + ], + "brands": [ + 1 + ], + "collections": [] + } +} +``` +
    + + + + + + + + + +--- + + +#### getStores +Get store meta information. + + + + +```swift +catalog.getStores(pageNo: pageNo, pageSize: pageSize, q: q, city: city, range: range, latitude: latitude, longitude: longitude) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results. | +| pageSize | Int? | no | Number of items to retrieve in each page. | +| q | String? | no | Search a store by its name or store_code. | +| city | String? | no | Search stores by the city in which they are situated. | +| range | Int? | no | Use this to retrieve stores within a particular range in meters, e.g. 10000, to indicate a 10km range | +| latitude | Double? | no | Latitude of the location from where one wants to retreive the nearest stores, e.g. 72.8691788 | +| longitude | Double? | no | Longitude of the location from where one wants to retreive the nearest stores, e.g. 19.1174114 | + + + +Use this API to get a list of stores in a specific application. + +*Returned Response:* + + + + +[StoreListingResponse](#StoreListingResponse) + +Success. Returns a list of selling locations. Check the example shown below or refer `StoreListingResponse` for more details. + + + + +
    +  Example: + +```json +{ + "page": { + "type": "number", + "current": 1, + "total": 1, + "has_previous": false, + "has_next": false, + "item_total": 1 + }, + "data": [ + { + "pincode": 400059, + "city": "MUMBAI", + "state": "MAHARASHTRA", + "country": "INDIA", + "address": "SHOPSENSE RETAIL TECHNOLOGIES PRIVATE LIMITED 1ST FLOOR WEWORK VIJAY DIAMOND, CROSS RD B, AJIT NAGAR,", + "store_email": "ASHISHCHANDORKAR@FYND.COM", + "lat_long": { + "type": "Point", + "coordinates": [ + 72.8691788, + 19.1174114 + ] + }, + "name": "RRL01", + "store_code": "WH_8513", + "uid": 1 + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getInStockLocations +Get store meta information. + + + + +```swift +catalog.getInStockLocations(pageNo: pageNo, pageSize: pageSize, q: q, city: city, range: range, latitude: latitude, longitude: longitude) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results. | +| pageSize | Int? | no | Number of items to retrieve in each page. | +| q | String? | no | Search a store by its name or store_code. | +| city | String? | no | Search stores by the city in which they are situated. | +| range | Int? | no | Use this to retrieve stores within a particular range in meters, e.g. 10000, to indicate a 10km range | +| latitude | Double? | no | Latitude of the location from where one wants to retreive the nearest stores, e.g. 72.8691788 | +| longitude | Double? | no | Longitude of the location from where one wants to retreive the nearest stores, e.g. 19.1174114 | + + + +Use this API to get a list of stores in a specific application. + +*Returned Response:* + + + + +[ApplicationStoreListing](#ApplicationStoreListing) + +Success. Returns a list of selling locations. Check the example shown below or refer `StoreListingResponse` for more details. + + + + +
    +  Example: + +```json +{ + "page": { + "current": 1, + "type": "number", + "total": 1, + "has_previous": false, + "has_next": false, + "item_total": 5 + }, + "items": [ + { + "uid": 1, + "_custom_json": {}, + "additional_contacts": [ + { + "country_code": 91, + "number": "9594495254" + } + ], + "address": { + "lat_long": { + "type": "Point", + "coordinates": [ + 72.809786, + 19.138787 + ] + }, + "city": "MUMBAI", + "pincode": 400061, + "state": "MAHARASHTRA", + "country": "INDIA", + "landmark": "", + "address2": "", + "address1": "YARI ROAD, ANDHERI WEST" + }, + "company_id": 1, + "display_name": "Reliance Digital P. Ltd", + "manager": { + "mobile_no": { + "country_code": 91, + "number": "9594495254" + }, + "name": "Fahim Sakri", + "email": "fahimsakri@gmail.com" + }, + "name": "Reliance Digital P. Ltd", + "store_code": "HS-52b69", + "store_type": "high_street", + "company": { + "company_type": "mbo", + "business_type": "ltd/pvt ltd", + "name": "Reliance Digital P. Ltd1234789123", + "uid": 1 + }, + "departments": [ + { + "priority_order": 7, + "name": "Baby Care & Kids Essentials", + "uid": 7, + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/category_tab_icons/department/Babycareandkidsessential.png" + }, + "is_active": true, + "slug": "baby-care-kids-essentials" + }, + { + "priority_order": 9, + "name": "Industrial Supplies", + "uid": 11, + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/department/original/15483_a8803bf3fc244c748180588166df82da.jpg" + }, + "is_active": true, + "slug": "industrial-supplies" + }, + { + "priority_order": 10, + "name": "Electricals", + "uid": 14, + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/department/pictures/square-logo/original/M93qfyuh1-https:hdn-1.fynd.commedialogodepartmentoriginal17588_44516b7413fd4a4a858556857aa0c4c8.jpg.jpeg" + }, + "is_active": true, + "slug": "electricals" + }, + { + "priority_order": 1, + "name": "Fashion", + "uid": 21, + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/department/pictures/square-logo/original/jSt0jjI7D-https/hdn-1.fynd.com/department/pictures/square-logo/original/6ouiCBSSn-https/hdn-1.fynd.com/department/pictures/square-logo/original/o2Rti5if7-.jpeg.jpeg.jpeg" + }, + "is_active": true, + "slug": "fashion" + }, + { + "slug": "automobile", + "is_active": true, + "logo": { + "type": "image", + "url": "https://hdn-1.addsale.com/x0/department/pictures/square-logo/original/kRhYFHWZ5-.jpeg" + }, + "name": "AUTOMOBILE", + "uid": 24, + "priority_order": 1 + } + ] + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getLocationDetailsById +Get store meta information. + + + + +```swift +catalog.getLocationDetailsById(locationId: locationId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| locationId | Int | yes | Unique Location ID. | + + + +Use this API to get meta details for a store. + +*Returned Response:* + + + + +[StoreDetails](#StoreDetails) + +Success. Returns a metadata object. Check the example shown below or refer `StoreDetails` for more details. + + + + +
    +  Example: + +```json +{ + "uid": 1, + "_custom_json": {}, + "additional_contacts": [ + { + "country_code": 91, + "number": "9594495254" + } + ], + "address": { + "lat_long": { + "type": "Point", + "coordinates": [ + 72.809786, + 19.138787 + ] + }, + "city": "MUMBAI", + "pincode": 400061, + "state": "MAHARASHTRA", + "country": "INDIA", + "landmark": "", + "address2": "", + "address1": "YARI ROAD, ANDHERI WEST" + }, + "company_id": 1, + "display_name": "Reliance Digital P. Ltd", + "manager": { + "mobile_no": { + "country_code": 91, + "number": "9594495254" + }, + "name": "Fahim Sakri", + "email": "fahimsakri@gmail.com" + }, + "name": "Reliance Digital P. Ltd", + "store_code": "HS-52b69", + "store_type": "high_street", + "timing": [ + { + "weekday": "monday", + "open": true, + "closing": { + "minute": 30, + "hour": 21 + }, + "opening": { + "minute": 0, + "hour": 11 + } + }, + { + "weekday": "tuesday", + "open": true, + "closing": { + "minute": 30, + "hour": 21 + }, + "opening": { + "minute": 0, + "hour": 11 + } + }, + { + "weekday": "wednesday", + "open": true, + "closing": { + "minute": 30, + "hour": 21 + }, + "opening": { + "minute": 0, + "hour": 11 + } + }, + { + "weekday": "thursday", + "open": true, + "closing": { + "minute": 30, + "hour": 21 + }, + "opening": { + "minute": 0, + "hour": 11 + } + }, + { + "weekday": "friday", + "open": true, + "closing": { + "minute": 30, + "hour": 21 + }, + "opening": { + "minute": 0, + "hour": 11 + } + }, + { + "weekday": "saturday", + "open": true, + "closing": { + "minute": 30, + "hour": 21 + }, + "opening": { + "minute": 0, + "hour": 11 + } + }, + { + "weekday": "sunday", + "open": true, + "closing": { + "minute": 30, + "hour": 21 + }, + "opening": { + "minute": 0, + "hour": 11 + } + } + ], + "company": { + "company_type": "mbo", + "business_type": "ltd/pvt ltd", + "name": "Reliance Digital P. Ltd1234789123", + "uid": 1 + } +} +``` +
    + + + + + + + + + +--- + + +#### getProductBundlesBySlug +Get product bundles + + + + +```swift +catalog.getProductBundlesBySlug(slug: slug, id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String? | no | Product slug for which bundles need to be fetched. | +| id | String? | no | Product uid | + + + +Use this API to retrieve products bundles to the one specified by its slug. + +*Returned Response:* + + + + +[ProductBundle](#ProductBundle) + +Success. Returns a group of products bundle. + + + + +
    +  Example: + +```json +{ + "items": [ + { + "company_id": 1, + "page_visibility": [], + "name": "Test bundle", + "choice": "multi", + "same_store_assignment": true, + "slug": "test-bundle", + "logo": null, + "meta": {}, + "products": [ + { + "product_uid": 7502119, + "min_quantity": 1, + "product_details": { + "name": "Neopack WSLTBR42 42 & 44 mm Leather Strap, Brown", + "out_of_stock": false, + "is_set": false, + "identifier": { + "sku_code": [ + "491667188" + ] + }, + "country_of_origin": "India", + "media": [ + { + "type": "image", + "url": "https://hdn-1.jiox0.de/jiox5/products/pictures/item/free/original/G8moRC9NMj-neopack-wsltbr42-smart-watch-bands-491667188-i-1-1200wx1200h.jpeg" + }, + { + "type": "image", + "url": "https://hdn-1.jiox0.de/jiox5/products/pictures/item/free/original/3Xumb2A0tV-neopack-wsltbr42-smart-watch-bands-491667188-i-2-1200wx1200h.jpeg" + }, + { + "type": "image", + "url": "https://hdn-1.jiox0.de/jiox5/products/pictures/item/free/original/ZOnlihkNUS-neopack-wsltbr42-smart-watch-bands-491667188-i-3-1200wx1200h.jpeg" + }, + { + "type": "image", + "url": "https://hdn-1.jiox0.de/jiox5/products/pictures/item/free/original/mu9B2afklQ-neopack-wsltbr42-smart-watch-bands-491667188-i-4-1200wx1200h.jpeg" + } + ], + "template_tag": "health-care", + "description": "Personalize your Apple Watch with this Classic and fashionable Neopack WSLTBR42 Leather Strap that fits your different mood and outfits in daily life & any occasion. It is a Perfect Replacement for original straps and is fully adjustable so that it can be adjusted and fit perfectly. The wrist strap is made of genuine calf leather and includes Space Grey Adapter and buckle.", + "images": [ + "https://hdn-1.jiox0.de/jiox5/products/pictures/item/free/original/G8moRC9NMj-neopack-wsltbr42-smart-watch-bands-491667188-i-1-1200wx1200h.jpeg", + "https://hdn-1.jiox0.de/jiox5/products/pictures/item/free/original/3Xumb2A0tV-neopack-wsltbr42-smart-watch-bands-491667188-i-2-1200wx1200h.jpeg", + "https://hdn-1.jiox0.de/jiox5/products/pictures/item/free/original/ZOnlihkNUS-neopack-wsltbr42-smart-watch-bands-491667188-i-3-1200wx1200h.jpeg", + "https://hdn-1.jiox0.de/jiox5/products/pictures/item/free/original/mu9B2afklQ-neopack-wsltbr42-smart-watch-bands-491667188-i-4-1200wx1200h.jpeg" + ], + "attributes": { + "color": "Brown", + "model": "WSLTBR42", + "action": "upsert", + "warranty": "1 Year", + "product_details": "Personalize your Apple Watch with this Classic and fashionable Neopack WSLTBR42 Leather Strap that fits your different mood and outfits in daily life & any occasion. It is a Perfect Replacement for original straps and is fully adjustable so that it can be adjusted and fit perfectly. The wrist strap is made of genuine calf leather and includes Space Grey Adapter and buckle.", + "brand_name": "Neopack", + "primary_color_hex": "8B572A" + }, + "hsn_code": 91130000, + "image_nature": "standard", + "slug": "neopack-wsltbr42-42-and-44-mm-leather-strap-brown", + "brand_uid": 90, + "item_code": "491667188" + }, + "allow_remove": true, + "auto_add_to_cart": false, + "price": { + "min_marked": 2499, + "min_effective": 1499, + "currency": "INR", + "max_effective": 1499, + "max_marked": 2499 + }, + "sizes": [ + { + "value": "OS", + "is_available": true, + "quantity": 30000, + "display": "OS" + } + ], + "max_quantity": 1, + "auto_select": false + } + ] + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getProductPriceBySlug +Get the price of a product size at a PIN Code + + + + +```swift +catalog.getProductPriceBySlug(slug: slug, size: size, storeId: storeId, pincode: pincode) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | +| size | String | yes | A string indicating the size of the product, e.g. S, M, XL. You can get slug value from the endpoint /service/application/catalog/v1.0/products/sizes | +| storeId | Int? | no | The ID of the store that is selling the product, e.g. 1,2,3. | +| pincode | String? | no | The PIN Code of the area near which the selling locations should be searched, e.g. 400059. | + + + +Prices may vary for different sizes of a product. Use this API to retrieve the price of a product size at all the selling locations near to a PIN Code. + +*Returned Response:* + + + + +[ProductSizePriceResponseV2](#ProductSizePriceResponseV2) + +Success. Returns a ProductSizePriceV2 object. Check the example shown below or refer `ProductSizePriceResponseV2` for more details. + + + + +
    +  Example: + +```json +{ + "price_per_piece": { + "effective": 66.5, + "marked": 66.5, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "price": { + "effective": 399, + "marked": 399, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "quantity": 5, + "pincode": 400603, + "article_id": "1", + "long_lat": [ + 72.9159784, + 19.0990231 + ], + "item_type": "set", + "discount": "", + "article_assignment": { + "level": "multi-companies", + "strategy": "optimal" + }, + "seller": { + "uid": 1, + "name": "Natalie Norman" + }, + "store": { + "uid": 1, + "name": "Wayne Lamb", + "count": 2 + }, + "strategy_wise_listing": [ + { + "distance": 11, + "quantity": 5, + "tat": 2592000, + "pincode": 400603 + }, + { + "distance": 11, + "quantity": 5, + "tat": 2592000, + "pincode": 400603 + } + ], + "set": { + "size_distribution": { + "sizes": [ + { + "size": "5", + "pieces": 1 + }, + { + "size": "7", + "pieces": 1 + }, + { + "size": "8", + "pieces": 2 + }, + { + "size": "9", + "pieces": 1 + }, + { + "size": "10", + "pieces": 1 + } + ] + }, + "quantity": 6 + } +} +``` +
    + + + + + + + + + +--- + + +#### getProductSellersBySlug +Get the sellers of a product size at a PIN Code + + + + +```swift +catalog.getProductSellersBySlug(slug: slug, size: size, pincode: pincode, strategy: strategy, pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | +| size | String | yes | A string indicating the size of the product, e.g. S, M, XL. You can get slug value from the endpoint /service/application/catalog/v1.0/products/sizes | +| pincode | String? | no | The 6-digit PIN Code of the area near which the selling locations should be searched, e.g. 400059 | +| strategy | String? | no | Sort stores on the basis of strategy. eg, fast-delivery, low-price, optimal. | +| pageNo | Int? | no | The page number to navigate through the given set of results. | +| pageSize | Int? | no | The number of items to retrieve in each page. | + + + +A product of a particular size may be sold by multiple sellers. Use this API to fetch the sellers having the stock of a particular size at a given PIN Code. + +*Returned Response:* + + + + +[ProductSizeSellersResponseV2](#ProductSizeSellersResponseV2) + +Success. Returns a ProductSizeSellerV2 object. Check the example shown below or refer `ProductSizeSellersResponseV2` for more details. + + + + +
    +  Example: + +```json +{ + "items": [ + { + "price_per_piece": { + "effective": 66.5, + "marked": 66.5, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "price": { + "effective": 399, + "marked": 399, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "quantity": 5, + "pincode": 400603, + "article_id": "1", + "discount": "", + "article_assignment": { + "level": "single-company", + "strategy": "optimal" + }, + "seller": { + "uid": 1, + "name": "Natalie Norman" + }, + "store": { + "uid": 1, + "name": "Wayne Lamb" + } + }, + { + "price_per_piece": { + "effective": 66.5, + "marked": 66.5, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "price": { + "effective": 399, + "marked": 399, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "quantity": 5, + "pincode": 400603, + "article_id": "2", + "discount": "", + "article_assignment": { + "level": "single-company", + "strategy": "optimal" + }, + "seller": { + "uid": 1, + "name": "Natalie Norman" + }, + "store": { + "uid": 1, + "name": "Wayne Lamb" + } + } + ], + "page": { + "current": 1, + "total": 1, + "has_previous": false, + "has_next": false, + "item_total": 2, + "type": "number" + }, + "sort_on": [ + { + "default": true, + "is_selected": true, + "name": "Best price & fast delivery", + "value": "optimal" + }, + { + "default": false, + "is_selected": false, + "name": "Best Price", + "value": "low-price" + }, + { + "default": false, + "is_selected": false, + "name": "Fastest Delivery", + "value": "fast-delivery" + } + ] +} +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [ProductListingActionPage](#ProductListingActionPage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | params | [String: Any]? | yes | | + | query | [String: Any]? | yes | | + | type | String? | yes | | + +--- + + + + + #### [ProductListingAction](#ProductListingAction) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [ProductListingActionPage](#ProductListingActionPage)? | yes | | + | type | String? | yes | | + +--- + + + + + #### [Meta](#Meta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | source | String? | yes | | + +--- + + + + + #### [Media](#Media) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | url | String? | yes | | + | type | String? | yes | | + | meta | [Meta](#Meta)? | yes | | + +--- + + + + + #### [Price](#Price) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | currencyCode | String? | yes | | + | max | Double? | yes | | + | min | Double? | yes | | + | currencySymbol | String? | yes | | + +--- + + + + + #### [ProductListingPrice](#ProductListingPrice) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | marked | [Price](#Price)? | yes | | + | effective | [Price](#Price)? | yes | | + +--- + + + + + #### [MetaFields](#MetaFields) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String | no | | + | value | String | no | | + +--- + + + + + #### [ProductBrand](#ProductBrand) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | name | String? | yes | | + | action | [ProductListingAction](#ProductListingAction)? | yes | | + | logo | [Media](#Media)? | yes | | + +--- + + + + + #### [ProductDetailAttribute](#ProductDetailAttribute) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | type | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [ProductDetailGroupedAttribute](#ProductDetailGroupedAttribute) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | details | [[ProductDetailAttribute](#ProductDetailAttribute)]? | yes | | + | title | String? | yes | | + +--- + + + + + #### [ProductDetail](#ProductDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String | no | | + | similars | [String]? | yes | | + | rating | Double? | yes | | + | name | String? | yes | | + | action | [ProductListingAction](#ProductListingAction)? | yes | | + | medias | [[Media](#Media)]? | yes | | + | hasVariant | Bool? | yes | | + | description | String? | yes | | + | color | String? | yes | | + | productOnlineDate | String? | yes | | + | ratingCount | Int? | yes | | + | shortDescription | String? | yes | | + | price | [ProductListingPrice](#ProductListingPrice)? | yes | | + | customMeta | [[MetaFields](#MetaFields)]? | yes | | + | itemCode | String? | yes | | + | brand | [ProductBrand](#ProductBrand)? | yes | | + | categories | [[ProductBrand](#ProductBrand)]? | yes | | + | imageNature | String? | yes | | + | teaserTag | String? | yes | | + | groupedAttributes | [[ProductDetailGroupedAttribute](#ProductDetailGroupedAttribute)]? | yes | | + | attributes | [String: Any]? | yes | | + | type | String? | yes | | + | uid | Int? | yes | | + | highlights | [String]? | yes | | + | discount | String? | yes | | + | itemType | String? | yes | | + | tryouts | [String]? | yes | | + +--- + + + + + #### [ErrorResponse](#ErrorResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | error | String? | yes | | + +--- + + + + + #### [ProductSizeStores](#ProductSizeStores) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | count | Int? | yes | | + +--- + + + + + #### [ColumnHeader](#ColumnHeader) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | value | String? | yes | | + | convertable | Bool? | yes | | + +--- + + + + + #### [ColumnHeaders](#ColumnHeaders) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | col5 | [ColumnHeader](#ColumnHeader)? | yes | | + | col4 | [ColumnHeader](#ColumnHeader)? | yes | | + | col6 | [ColumnHeader](#ColumnHeader)? | yes | | + | col1 | [ColumnHeader](#ColumnHeader)? | yes | | + | col2 | [ColumnHeader](#ColumnHeader)? | yes | | + | col3 | [ColumnHeader](#ColumnHeader)? | yes | | + +--- + + + + + #### [SizeChartValues](#SizeChartValues) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | col5 | String? | yes | | + | col4 | String? | yes | | + | col6 | String? | yes | | + | col1 | String? | yes | | + | col2 | String? | yes | | + | col3 | String? | yes | | + +--- + + + + + #### [SizeChart](#SizeChart) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | headers | [ColumnHeaders](#ColumnHeaders)? | yes | | + | title | String? | yes | | + | sizeTip | String? | yes | | + | unit | String? | yes | | + | image | String? | yes | | + | sizes | [[SizeChartValues](#SizeChartValues)]? | yes | | + | description | String? | yes | | + +--- + + + + + #### [ProductSize](#ProductSize) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | display | String? | yes | | + | value | String? | yes | | + | isAvailable | Bool? | yes | | + | quantity | Int? | yes | | + +--- + + + + + #### [ProductSizes](#ProductSizes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | sellable | Bool? | yes | | + | stores | [ProductSizeStores](#ProductSizeStores)? | yes | | + | discount | String? | yes | | + | price | [ProductListingPrice](#ProductListingPrice)? | yes | | + | sizeChart | [SizeChart](#SizeChart)? | yes | | + | sizes | [[ProductSize](#ProductSize)]? | yes | | + +--- + + + + + #### [AttributeDetail](#AttributeDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | display | String? | yes | | + | logo | String? | yes | | + | key | String? | yes | | + | description | String? | yes | | + +--- + + + + + #### [AttributeMetadata](#AttributeMetadata) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | details | [[AttributeDetail](#AttributeDetail)]? | yes | | + | title | String? | yes | | + +--- + + + + + #### [ProductsComparisonResponse](#ProductsComparisonResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[ProductDetail](#ProductDetail)]? | yes | | + | attributesMetadata | [[AttributeMetadata](#AttributeMetadata)]? | yes | | + +--- + + + + + #### [ProductCompareResponse](#ProductCompareResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[ProductDetail](#ProductDetail)]? | yes | | + | subtitle | String? | yes | | + | attributesMetadata | [[AttributeMetadata](#AttributeMetadata)]? | yes | | + | title | String? | yes | | + +--- + + + + + #### [ProductFrequentlyComparedSimilarResponse](#ProductFrequentlyComparedSimilarResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | similars | [ProductCompareResponse](#ProductCompareResponse)? | yes | | + +--- + + + + + #### [ProductSimilarItem](#ProductSimilarItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[ProductDetail](#ProductDetail)]? | yes | | + | subtitle | String? | yes | | + | title | String? | yes | | + +--- + + + + + #### [SimilarProductByTypeResponse](#SimilarProductByTypeResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | similars | [ProductSimilarItem](#ProductSimilarItem)? | yes | | + +--- + + + + + #### [ProductVariantItemResponse](#ProductVariantItemResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String? | yes | | + | colorName | String? | yes | | + | color | String? | yes | | + | name | String? | yes | | + | isAvailable | Bool? | yes | | + | medias | [[Media](#Media)]? | yes | | + | action | [ProductListingAction](#ProductListingAction)? | yes | | + | value | String? | yes | | + | uid | Int? | yes | | + +--- + + + + + #### [ProductVariantResponse](#ProductVariantResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | header | String? | yes | | + | items | [[ProductVariantItemResponse](#ProductVariantItemResponse)]? | yes | | + | key | String? | yes | | + | displayType | String? | yes | | + +--- + + + + + #### [ProductVariantsResponse](#ProductVariantsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | variants | [[ProductVariantResponse](#ProductVariantResponse)]? | yes | | + +--- + + + + + #### [StoreDetail](#StoreDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | name | String? | yes | | + | code | String? | yes | | + | city | String? | yes | | + +--- + + + + + #### [Seller](#Seller) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | name | String? | yes | | + | count | Int? | yes | | + +--- + + + + + #### [CompanyDetail](#CompanyDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | name | String? | yes | | + +--- + + + + + #### [ProductStockPrice](#ProductStockPrice) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | currency | String? | yes | | + | marked | Double? | yes | | + | effective | Double? | yes | | + +--- + + + + + #### [ProductStockStatusItem](#ProductStockStatusItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | store | [StoreDetail](#StoreDetail)? | yes | | + | quantity | Int? | yes | | + | size | String? | yes | | + | seller | [Seller](#Seller)? | yes | | + | company | [CompanyDetail](#CompanyDetail)? | yes | | + | itemId | Int? | yes | | + | uid | String? | yes | | + | price | [ProductStockPrice](#ProductStockPrice)? | yes | | + | identifier | [String: Any]? | yes | | + +--- + + + + + #### [ProductStockStatusResponse](#ProductStockStatusResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[ProductStockStatusItem](#ProductStockStatusItem)]? | yes | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemTotal | Int? | yes | | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + | size | Int? | yes | | + | type | String | no | | + | hasPrevious | Bool? | yes | | + | nextId | String? | yes | | + +--- + + + + + #### [ProductStockPolling](#ProductStockPolling) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page) | no | | + | items | [[ProductStockStatusItem](#ProductStockStatusItem)]? | yes | | + +--- + + + + + #### [ProductListingDetail](#ProductListingDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String | no | | + | similars | [String]? | yes | | + | rating | Double? | yes | | + | name | String? | yes | | + | action | [ProductListingAction](#ProductListingAction)? | yes | | + | medias | [[Media](#Media)]? | yes | | + | hasVariant | Bool? | yes | | + | description | String? | yes | | + | color | String? | yes | | + | productOnlineDate | String? | yes | | + | ratingCount | Int? | yes | | + | shortDescription | String? | yes | | + | price | [ProductListingPrice](#ProductListingPrice)? | yes | | + | customMeta | [[MetaFields](#MetaFields)]? | yes | | + | itemCode | String? | yes | | + | brand | [ProductBrand](#ProductBrand)? | yes | | + | categories | [[ProductBrand](#ProductBrand)]? | yes | | + | imageNature | String? | yes | | + | teaserTag | String? | yes | | + | groupedAttributes | [[ProductDetailGroupedAttribute](#ProductDetailGroupedAttribute)]? | yes | | + | attributes | [String: Any]? | yes | | + | type | String? | yes | | + | uid | Int? | yes | | + | sellable | Bool? | yes | | + | highlights | [String]? | yes | | + | discount | String? | yes | | + | itemType | String? | yes | | + | tryouts | [String]? | yes | | + +--- + + + + + #### [ProductFiltersKey](#ProductFiltersKey) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | kind | String? | yes | | + | display | String | no | | + | name | String | no | | + | logo | String? | yes | | + +--- + + + + + #### [ProductFiltersValue](#ProductFiltersValue) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | currencySymbol | String? | yes | | + | queryFormat | String? | yes | | + | selectedMin | Int? | yes | | + | isSelected | Bool | no | | + | min | Int? | yes | | + | selectedMax | Int? | yes | | + | count | Int? | yes | | + | max | Int? | yes | | + | value | String? | yes | | + | display | String | no | | + | currencyCode | String? | yes | | + | displayFormat | String? | yes | | + +--- + + + + + #### [ProductFilters](#ProductFilters) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | [ProductFiltersKey](#ProductFiltersKey) | no | | + | values | [[ProductFiltersValue](#ProductFiltersValue)] | no | | + +--- + + + + + #### [ProductSortOn](#ProductSortOn) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isSelected | Bool? | yes | | + | name | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [ProductListingResponse](#ProductListingResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page) | no | | + | items | [[ProductListingDetail](#ProductListingDetail)]? | yes | | + | filters | [[ProductFilters](#ProductFilters)]? | yes | | + | sortOn | [[ProductSortOn](#ProductSortOn)]? | yes | | + +--- + + + + + #### [ImageUrls](#ImageUrls) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | portrait | [Media](#Media)? | yes | | + | landscape | [Media](#Media)? | yes | | + +--- + + + + + #### [BrandItem](#BrandItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String? | yes | | + | name | String? | yes | | + | discount | String? | yes | | + | banners | [ImageUrls](#ImageUrls)? | yes | | + | action | [ProductListingAction](#ProductListingAction)? | yes | | + | logo | [Media](#Media)? | yes | | + | uid | Int? | yes | | + | departments | [String]? | yes | | + +--- + + + + + #### [BrandListingResponse](#BrandListingResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page) | no | | + | items | [[BrandItem](#BrandItem)]? | yes | | + +--- + + + + + #### [BrandDetailResponse](#BrandDetailResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | name | String? | yes | | + | banners | [ImageUrls](#ImageUrls)? | yes | | + | logo | [Media](#Media)? | yes | | + +--- + + + + + #### [DepartmentIdentifier](#DepartmentIdentifier) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | slug | String? | yes | | + +--- + + + + + #### [ThirdLevelChild](#ThirdLevelChild) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | customJson | [String: Any]? | yes | | + | slug | String? | yes | | + | name | String? | yes | | + | banners | [ImageUrls](#ImageUrls)? | yes | | + | childs | [[String: Any]]? | yes | | + | action | [ProductListingAction](#ProductListingAction)? | yes | | + | uid | Int? | yes | | + +--- + + + + + #### [SecondLevelChild](#SecondLevelChild) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | customJson | [String: Any]? | yes | | + | slug | String? | yes | | + | name | String? | yes | | + | banners | [ImageUrls](#ImageUrls)? | yes | | + | childs | [[ThirdLevelChild](#ThirdLevelChild)]? | yes | | + | action | [ProductListingAction](#ProductListingAction)? | yes | | + | uid | Int? | yes | | + +--- + + + + + #### [Child](#Child) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | customJson | [String: Any]? | yes | | + | slug | String? | yes | | + | name | String? | yes | | + | banners | [ImageUrls](#ImageUrls)? | yes | | + | childs | [[SecondLevelChild](#SecondLevelChild)]? | yes | | + | action | [ProductListingAction](#ProductListingAction)? | yes | | + | uid | Int? | yes | | + +--- + + + + + #### [CategoryItems](#CategoryItems) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String? | yes | | + | name | String? | yes | | + | banners | [ImageUrls](#ImageUrls)? | yes | | + | childs | [[Child](#Child)]? | yes | | + | action | [ProductListingAction](#ProductListingAction)? | yes | | + | uid | Int? | yes | | + +--- + + + + + #### [DepartmentCategoryTree](#DepartmentCategoryTree) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[CategoryItems](#CategoryItems)]? | yes | | + | department | String? | yes | | + +--- + + + + + #### [CategoryListingResponse](#CategoryListingResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | departments | [[DepartmentIdentifier](#DepartmentIdentifier)]? | yes | | + | data | [[DepartmentCategoryTree](#DepartmentCategoryTree)]? | yes | | + +--- + + + + + #### [CategoryMetaResponse](#CategoryMetaResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | name | String? | yes | | + | banners | [ImageUrls](#ImageUrls)? | yes | | + | logo | [Media](#Media)? | yes | | + +--- + + + + + #### [HomeListingResponse](#HomeListingResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + | page | [Page](#Page) | no | | + | items | [[ProductListingDetail](#ProductListingDetail)]? | yes | | + +--- + + + + + #### [Department](#Department) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String? | yes | | + | name | String? | yes | | + | logo | [Media](#Media)? | yes | | + | uid | Int? | yes | | + | priorityOrder | Int? | yes | | + +--- + + + + + #### [DepartmentResponse](#DepartmentResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Department](#Department)]? | yes | | + +--- + + + + + #### [AutocompleteItem](#AutocompleteItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | action | [ProductListingAction](#ProductListingAction)? | yes | | + | display | String? | yes | | + | type | String? | yes | | + | logo | [Media](#Media)? | yes | | + +--- + + + + + #### [AutoCompleteResponse](#AutoCompleteResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[AutocompleteItem](#AutocompleteItem)]? | yes | | + +--- + + + + + #### [GetCollectionDetailNest](#GetCollectionDetailNest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String? | yes | | + | name | String? | yes | | + | banners | [ImageUrls](#ImageUrls)? | yes | | + | action | [ProductListingAction](#ProductListingAction)? | yes | | + | description | String? | yes | | + | meta | [String: Any]? | yes | | + | visibleFacetsKeys | [String]? | yes | | + | query | [String: Any]? | yes | | + | badge | [String: Any]? | yes | | + | type | String? | yes | | + | allowFacets | Bool? | yes | | + | logo | [Media](#Media)? | yes | | + | uid | String? | yes | | + | appId | String? | yes | | + | schedule | [String: Any]? | yes | | + | isActive | Bool? | yes | | + | allowSort | Bool? | yes | | + | cron | [String: Any]? | yes | | + | tag | [String]? | yes | | + +--- + + + + + #### [CollectionListingFilterType](#CollectionListingFilterType) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isSelected | Bool? | yes | | + | name | String? | yes | | + | display | String? | yes | | + +--- + + + + + #### [CollectionListingFilterTag](#CollectionListingFilterTag) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isSelected | Bool? | yes | | + | name | String? | yes | | + | display | String? | yes | | + +--- + + + + + #### [CollectionListingFilter](#CollectionListingFilter) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | [[CollectionListingFilterType](#CollectionListingFilterType)]? | yes | | + | tags | [[CollectionListingFilterTag](#CollectionListingFilterTag)]? | yes | | + +--- + + + + + #### [GetCollectionListingResponse](#GetCollectionListingResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page) | no | | + | items | [[GetCollectionDetailNest](#GetCollectionDetailNest)]? | yes | | + | filters | [CollectionListingFilter](#CollectionListingFilter)? | yes | | + +--- + + + + + #### [CollectionDetailResponse](#CollectionDetailResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appId | String? | yes | | + | slug | String? | yes | | + | schedule | [String: Any]? | yes | | + | isActive | Bool? | yes | | + | allowFacets | Bool? | yes | | + | name | String? | yes | | + | banners | [ImageUrls](#ImageUrls)? | yes | | + | allowSort | Bool? | yes | | + | badge | [String: Any]? | yes | | + | meta | [String: Any]? | yes | | + | cron | [String: Any]? | yes | | + | tag | [String]? | yes | | + | type | String? | yes | | + | logo | [Media](#Media)? | yes | | + | visibleFacetsKeys | [String]? | yes | | + | query | [String: Any]? | yes | | + | description | String? | yes | | + +--- + + + + + #### [GetFollowListingResponse](#GetFollowListingResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page) | no | | + | items | [[ProductListingDetail](#ProductListingDetail)] | no | | + +--- + + + + + #### [FollowPostResponse](#FollowPostResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String | no | | + | message | String | no | | + +--- + + + + + #### [FollowerCountResponse](#FollowerCountResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | count | Int? | yes | | + +--- + + + + + #### [FollowIdsData](#FollowIdsData) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | products | [Int]? | yes | | + | collections | [Int]? | yes | | + | brands | [Int]? | yes | | + +--- + + + + + #### [FollowIdsResponse](#FollowIdsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [FollowIdsData](#FollowIdsData)? | yes | | + +--- + + + + + #### [LatLong](#LatLong) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | coordinates | [Double]? | yes | | + | type | String? | yes | | + +--- + + + + + #### [Store](#Store) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | address | String? | yes | | + | name | String? | yes | | + | uid | Int? | yes | | + | storeEmail | String? | yes | | + | pincode | Int? | yes | | + | state | String? | yes | | + | city | String? | yes | | + | latLong | [LatLong](#LatLong)? | yes | | + | country | String? | yes | | + | storeCode | String? | yes | | + +--- + + + + + #### [StoreListingResponse](#StoreListingResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page) | no | | + | items | [[Store](#Store)] | no | | + +--- + + + + + #### [StoreAddressSerializer](#StoreAddressSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | address2 | String? | yes | | + | longitude | Double? | yes | | + | address1 | String? | yes | | + | pincode | Int? | yes | | + | latitude | Double? | yes | | + | state | String? | yes | | + | city | String? | yes | | + | landmark | String? | yes | | + | country | String? | yes | | + +--- + + + + + #### [SellerPhoneNumber](#SellerPhoneNumber) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | number | String | no | | + | countryCode | Int | no | | + +--- + + + + + #### [StoreManagerSerializer](#StoreManagerSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + | name | String? | yes | | + | mobileNo | [SellerPhoneNumber](#SellerPhoneNumber)? | yes | | + +--- + + + + + #### [CompanyStore](#CompanyStore) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | name | String? | yes | | + | companyType | String? | yes | | + | businessType | String? | yes | | + +--- + + + + + #### [StoreDepartments](#StoreDepartments) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String? | yes | | + | name | String? | yes | | + | logo | String? | yes | | + | uid | Int? | yes | | + | priorityOrder | Int? | yes | | + +--- + + + + + #### [AppStore](#AppStore) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | address | [StoreAddressSerializer](#StoreAddressSerializer)? | yes | | + | manager | [StoreManagerSerializer](#StoreManagerSerializer)? | yes | | + | name | String? | yes | | + | company | [CompanyStore](#CompanyStore)? | yes | | + | uid | Int? | yes | | + | departments | [[StoreDepartments](#StoreDepartments)]? | yes | | + | contactNumbers | [[SellerPhoneNumber](#SellerPhoneNumber)]? | yes | | + +--- + + + + + #### [ApplicationStoreListing](#ApplicationStoreListing) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [[AppStore](#AppStore)]? | yes | | + | filters | [[StoreDepartments](#StoreDepartments)]? | yes | | + +--- + + + + + #### [Time](#Time) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | hour | Int? | yes | | + | minute | Int? | yes | | + +--- + + + + + #### [StoreTiming](#StoreTiming) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | open | Bool? | yes | | + | closing | [Time](#Time)? | yes | | + | opening | [Time](#Time)? | yes | | + | weekday | String? | yes | | + +--- + + + + + #### [StoreDetails](#StoreDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | address | [StoreAddressSerializer](#StoreAddressSerializer)? | yes | | + | customJson | [String: Any]? | yes | | + | manager | [StoreManagerSerializer](#StoreManagerSerializer)? | yes | | + | name | String? | yes | | + | timing | [[StoreTiming](#StoreTiming)]? | yes | | + | company | [CompanyStore](#CompanyStore)? | yes | | + | uid | Int? | yes | | + | departments | [[StoreDepartments](#StoreDepartments)]? | yes | | + | contactNumbers | [[SellerPhoneNumber](#SellerPhoneNumber)]? | yes | | + +--- + + + + + #### [ProductDetails](#ProductDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String? | yes | | + | rating | Double? | yes | | + | name | String? | yes | | + | images | [[String: Any]]? | yes | | + | isSet | Bool? | yes | | + | hasVariant | Bool? | yes | | + | identifier | [String: Any]? | yes | | + | description | String? | yes | | + | ratingCount | Int? | yes | | + | shortDescription | String? | yes | | + | hsnCode | Int? | yes | | + | outOfStock | Bool? | yes | | + | countryOfOrigin | String? | yes | | + | itemCode | String? | yes | | + | imageNature | String? | yes | | + | attributes | [String: Any]? | yes | | + | groupedAttributes | [String: Any]? | yes | | + | media | [[String: Any]]? | yes | | + | brandUid | Int? | yes | | + | templateTag | String? | yes | | + +--- + + + + + #### [Price1](#Price1) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | maxEffective | Double? | yes | | + | maxMarked | Double? | yes | | + | minEffective | Double? | yes | | + | currency | String? | yes | | + | minMarked | Double? | yes | | + +--- + + + + + #### [Size](#Size) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | display | String? | yes | | + | value | String? | yes | | + | isAvailable | Bool? | yes | | + | quantity | Int? | yes | | + +--- + + + + + #### [Products](#Products) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | autoAddToCart | Bool? | yes | | + | allowRemove | Bool? | yes | | + | maxQuantity | Int? | yes | | + | minQuantity | Int? | yes | | + | productDetails | [ProductDetails](#ProductDetails)? | yes | | + | price | [Price1](#Price1)? | yes | | + | productUid | Int? | yes | | + | sizes | [[Size](#Size)]? | yes | | + | autoSelect | Bool? | yes | | + +--- + + + + + #### [GetGroupedProducts](#GetGroupedProducts) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String? | yes | | + | name | String? | yes | | + | sameStoreAssignment | Bool? | yes | | + | pageVisibility | [String]? | yes | | + | meta | [String: Any]? | yes | | + | products | [[Products](#Products)]? | yes | | + | active | Bool? | yes | | + | logo | String? | yes | | + | companyId | Int? | yes | | + | choice | String? | yes | | + +--- + + + + + #### [ProductBundle](#ProductBundle) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[GetGroupedProducts](#GetGroupedProducts)]? | yes | | + +--- + + + + + #### [StoreV2](#StoreV2) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | name | String? | yes | | + | count | Int? | yes | | + +--- + + + + + #### [DetailsSchemaV2](#DetailsSchemaV2) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | type | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [MarketPlaceSttributesSchemaV2](#MarketPlaceSttributesSchemaV2) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | details | [[DetailsSchemaV2](#DetailsSchemaV2)]? | yes | | + | title | String? | yes | | + +--- + + + + + #### [StrategyWiseListingSchemaV2](#StrategyWiseListingSchemaV2) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | quantity | Int? | yes | | + | tat | Int? | yes | | + | pincode | Int? | yes | | + | distance | Int? | yes | | + +--- + + + + + #### [ProductSetDistributionSizeV2](#ProductSetDistributionSizeV2) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pieces | Int? | yes | | + | size | String? | yes | | + +--- + + + + + #### [ProductSetDistributionV2](#ProductSetDistributionV2) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | sizes | [[ProductSetDistributionSizeV2](#ProductSetDistributionSizeV2)]? | yes | | + +--- + + + + + #### [ProductSetV2](#ProductSetV2) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | sizeDistribution | [ProductSetDistributionV2](#ProductSetDistributionV2)? | yes | | + | quantity | Int? | yes | | + +--- + + + + + #### [ReturnConfigSchemaV2](#ReturnConfigSchemaV2) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | returnable | Bool? | yes | | + | time | Int? | yes | | + | unit | String? | yes | | + +--- + + + + + #### [ArticleAssignmentV2](#ArticleAssignmentV2) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | level | String? | yes | | + | strategy | String? | yes | | + +--- + + + + + #### [SellerV2](#SellerV2) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | name | String? | yes | | + | count | Int? | yes | | + +--- + + + + + #### [ProductStockPriceV2](#ProductStockPriceV2) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | currency | String? | yes | | + | marked | Double? | yes | | + | effective | Double? | yes | | + +--- + + + + + #### [ProductSizePriceResponseV2](#ProductSizePriceResponseV2) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | store | [StoreV2](#StoreV2)? | yes | | + | marketplaceAttributes | [[MarketPlaceSttributesSchemaV2](#MarketPlaceSttributesSchemaV2)]? | yes | | + | strategyWiseListing | [[StrategyWiseListingSchemaV2](#StrategyWiseListingSchemaV2)]? | yes | | + | discount | String? | yes | | + | itemType | String? | yes | | + | set | [ProductSetV2](#ProductSetV2)? | yes | | + | pincode | Int? | yes | | + | quantity | Int? | yes | | + | returnConfig | [ReturnConfigSchemaV2](#ReturnConfigSchemaV2)? | yes | | + | articleAssignment | [ArticleAssignmentV2](#ArticleAssignmentV2)? | yes | | + | longLat | [Double]? | yes | | + | seller | [SellerV2](#SellerV2)? | yes | | + | price | [ProductStockPriceV2](#ProductStockPriceV2)? | yes | | + | articleId | String? | yes | | + | specialBadge | String? | yes | | + | pricePerPiece | [ProductStockPriceV2](#ProductStockPriceV2)? | yes | | + | sellerCount | Int? | yes | | + +--- + + + + + #### [ProductSizeSellerFilterSchemaV2](#ProductSizeSellerFilterSchemaV2) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isSelected | Bool? | yes | | + | name | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [ProductSizeSellersResponseV2](#ProductSizeSellersResponseV2) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page) | no | | + | items | [[ProductSizePriceResponseV2](#ProductSizePriceResponseV2)]? | yes | | + | sortOn | [[ProductSizeSellerFilterSchemaV2](#ProductSizeSellerFilterSchemaV2)]? | yes | | + +--- + + + diff --git a/documentation/application/COMMON.md b/documentation/application/COMMON.md new file mode 100644 index 0000000000..e915a5bfbc --- /dev/null +++ b/documentation/application/COMMON.md @@ -0,0 +1,440 @@ + + + + +##### [Back to Application docs](./README.md) + +## Common Methods +Application configuration apis +* [searchApplication](#searchapplication) +* [getLocations](#getlocations) + + + +## Methods with example and description + + +#### searchApplication +Search Application + + + + +```swift +common.searchApplication(authorization: authorization, query: query) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| authorization | String? | no | | +| query | String? | no | Provide application name | + + + +Provide application name or domain url + +*Returned Response:* + + + + +[ApplicationResponse](#ApplicationResponse) + +Success + + + + +
    +  Example: + +```json +{ + "application": { + "website": { + "enabled": true, + "basepath": "/" + }, + "cors": { + "domains": [] + }, + "auth": { + "enabled": true + }, + "description": "test", + "channel_type": "store", + "cache_ttl": -1, + "internal": false, + "is_active": true, + "mode": "live", + "_id": "620b931ee7bfb11f910bf4a3", + "company_id": 2, + "name": "test", + "owner": "5b9b98150df588546aaea6d2", + "logo": { + "secure_url": "https://hdn-1.addsale.com/x0/company/164/applications/5efc9913f474c329718e3690/application/pictures/free-logo/original/olqHM8LNr-JioMart-Groceries.png" + }, + "favicon": { + "secure_url": "https://hdn-1.addsale.com/x0/company/164/applications/5efc9913f474c329718e3690/application/pictures/free-logo/original/olqHM8LNr-JioMart-Groceries.png" + }, + "banner": { + "secure_url": "https://hdn-1.addsale.com/x0/company/164/applications/5efc9913f474c329718e3690/application/pictures/landscape-banner/original/D2fr98CUH-JioMart-Groceries.png" + }, + "token": "tPQv0nc23", + "tokens": [ + { + "token": "tPQv0nc23", + "created_at": "2022-02-15T11:48:46.909Z" + } + ], + "domains": [ + { + "verified": true, + "is_primary": true, + "is_shortlink": true, + "_id": "620b931ee7bfb11f910bf4a4", + "name": "qckvv5lhp.hostfynd.dev" + } + ], + "redirections": [], + "meta": [], + "created_at": "2022-02-15T11:48:46.909Z", + "modified_at": "2022-02-15T11:48:46.909Z", + "__v": 0, + "domain": { + "verified": true, + "is_primary": true, + "is_shortlink": true, + "_id": "620b931ee7bfb11f910bf4a4", + "name": "qckvv5lhp.hostfynd.dev" + }, + "id": "620b931ee7bfb11f910bf4a3" + } +} +``` +
    + + + + + + + + + +--- + + +#### getLocations +Get countries, states, cities + + + + +```swift +common.getLocations(locationType: locationType, id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| locationType | String? | no | Provide location type to query on. Possible values : country, state, city | +| id | String? | no | Field is optional when location_type is country. If querying for state, provide id of country. If querying for city, provide id of state. | + + + + + +*Returned Response:* + + + + +[Locations](#Locations) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [ApplicationResponse](#ApplicationResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | [Application](#Application)? | yes | | + +--- + + + + + #### [Currency](#Currency) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | isActive | Bool? | yes | | + | name | String? | yes | | + | code | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | decimalDigits | Int? | yes | | + | symbol | String? | yes | | + +--- + + + + + #### [Domain](#Domain) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | verified | Bool? | yes | | + | isPrimary | Bool? | yes | | + | isShortlink | Bool? | yes | | + | id | String? | yes | | + | name | String? | yes | | + +--- + + + + + #### [ApplicationWebsite](#ApplicationWebsite) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | basepath | String? | yes | | + +--- + + + + + #### [ApplicationCors](#ApplicationCors) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | domains | [String]? | yes | | + +--- + + + + + #### [ApplicationAuth](#ApplicationAuth) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + +--- + + + + + #### [ApplicationRedirections](#ApplicationRedirections) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | redirectFrom | String? | yes | | + | redirectTo | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [ApplicationMeta](#ApplicationMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [SecureUrl](#SecureUrl) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | secureUrl | String? | yes | | + +--- + + + + + #### [Application](#Application) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | website | [ApplicationWebsite](#ApplicationWebsite)? | yes | | + | cors | [ApplicationCors](#ApplicationCors)? | yes | | + | auth | [ApplicationAuth](#ApplicationAuth)? | yes | | + | description | String? | yes | | + | channelType | String? | yes | | + | cacheTtl | Int? | yes | | + | isInternal | Bool? | yes | | + | isActive | Bool? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | owner | String? | yes | | + | companyId | Int? | yes | | + | token | String? | yes | | + | redirections | [[ApplicationRedirections](#ApplicationRedirections)]? | yes | | + | meta | [[ApplicationMeta](#ApplicationMeta)]? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + | banner | [SecureUrl](#SecureUrl)? | yes | | + | logo | [SecureUrl](#SecureUrl)? | yes | | + | favicon | [SecureUrl](#SecureUrl)? | yes | | + | domains | [[Domain](#Domain)]? | yes | | + | appType | String? | yes | | + | mobileLogo | [SecureUrl](#SecureUrl)? | yes | | + | domain | [Domain](#Domain)? | yes | | + +--- + + + + + #### [NotFound](#NotFound) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [BadRequest](#BadRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | Failure message. | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String | no | | + | size | Int? | yes | | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + +--- + + + + + #### [LocationDefaultLanguage](#LocationDefaultLanguage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | code | String? | yes | | + +--- + + + + + #### [LocationDefaultCurrency](#LocationDefaultCurrency) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | symbol | String? | yes | | + | code | String? | yes | | + +--- + + + + + #### [LocationCountry](#LocationCountry) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | capital | String? | yes | | + | currency | String? | yes | | + | iso2 | String? | yes | | + | iso3 | String? | yes | | + | name | String? | yes | | + | parent | String? | yes | | + | phoneCode | String? | yes | | + | type | String? | yes | | + | uid | Int? | yes | | + | v | Int? | yes | | + | id | String? | yes | | + | defaultCurrency | [LocationDefaultCurrency](#LocationDefaultCurrency)? | yes | | + | defaultLanguage | [LocationDefaultLanguage](#LocationDefaultLanguage)? | yes | | + +--- + + + + + #### [Locations](#Locations) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[String: Any]]? | yes | | + +--- + + + diff --git a/documentation/application/COMMUNICATION.md b/documentation/application/COMMUNICATION.md new file mode 100644 index 0000000000..6400db1ff5 --- /dev/null +++ b/documentation/application/COMMUNICATION.md @@ -0,0 +1,436 @@ + + + + +##### [Back to Application docs](./README.md) + +## Communication Methods +Manages email, sms, push notifications sent to users +* [getCommunicationConsent](#getcommunicationconsent) +* [upsertCommunicationConsent](#upsertcommunicationconsent) +* [upsertAppPushtoken](#upsertapppushtoken) + + + +## Methods with example and description + + +#### getCommunicationConsent +Get communication consent + + + + +```swift +communication.getCommunicationConsent() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to retrieve the consent provided by the user for receiving communication messages over Email/SMS/WhatsApp. + +*Returned Response:* + + + + +[CommunicationConsent](#CommunicationConsent) + +Success. Returns all available communication opt-ins along with the consent details. Check the example shown below or refer `CommunicationConsent` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "app_id": "000000000000000000000004", + "user_id": "5e56021c4bda3ccab6d9f884", + "channels": { + "email": { + "response": "yes", + "display_name": "Email" + }, + "sms": { + "response": "yes", + "display_name": "SMS" + }, + "whatsapp": { + "response": "yes", + "display_name": "WhatsApp", + "country_code": "91", + "phone_number": "9869821300" + } + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### upsertCommunicationConsent +Upsert communication consent + + + + +```swift +communication.upsertCommunicationConsent(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CommunicationConsentReq | yes | Request body | + + +Use this API to update and insert the consent provided by the user for receiving communication messages over Email/SMS/WhatsApp. + +*Returned Response:* + + + + +[CommunicationConsentRes](#CommunicationConsentRes) + +Success. Updates the channels for which user has consented. Check the example shown below or refer `CommunicationConsentRes` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "appId": "000000000000000000000004", + "userId": "5e56021c4bda3ccab6d9f884", + "channels": { + "email": { + "response": "yes", + "displayName": "Email" + }, + "sms": { + "response": "yes", + "displayName": "SMS" + }, + "whatsapp": { + "response": "noaction", + "displayName": "WhatsApp" + } + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### upsertAppPushtoken +Upsert push token of a user + + + + +```swift +communication.upsertAppPushtoken(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | PushtokenReq | yes | Request body | + + +Use this API to update and insert the push token of the user. + +*Returned Response:* + + + + +[PushtokenRes](#PushtokenRes) + +Success. Check the example shown below or refer `PushtokenRes` for more details. + + + + +
    +  Examples: + + +
    +  create + +```json +{ + "value": { + "_id": "601b6924d8ea9a061570a09f", + "bundle_identifier": "000002", + "push_token": "45", + "unique_device_id": "3", + "type": "fynd-platform", + "platform": "web", + "application_id": "000000000000000000000004", + "user_id": "5e56021c4bda3ccab6d9f884", + "created_at": "2021-02-04T03:25:24.765Z", + "updated_at": "2021-02-04T03:25:51.152Z" + } +} +``` +
    + +
    +  update + +```json +{ + "value": { + "_id": "601b6924d8ea9a061570a09f", + "bundle_identifier": "000002", + "push_token": "45", + "unique_device_id": "3", + "type": "fynd-platform", + "platform": "web", + "application_id": "000000000000000000000004", + "user_id": "5e56021c4bda3ccab6d9f884", + "created_at": "2021-02-04T03:25:24.765Z", + "updated_at": "2021-02-04T03:25:51.152Z" + } +} +``` +
    + +
    +  reset + +```json +{ + "value": { + "_id": "601b6924d8ea9a061570a09f", + "bundle_identifier": "000002", + "push_token": "45", + "unique_device_id": "3", + "type": "fynd-platform", + "platform": "web", + "application_id": "000000000000000000000004", + "user_id": "5e56021c4bda3ccab6d9f884", + "created_at": "2021-02-04T03:25:24.765Z", + "updated_at": "2021-02-04T03:25:51.152Z", + "expired_at": "2021-02-05T03:25:51.138Z" + } +} +``` +
    + +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [CommunicationConsentReq](#CommunicationConsentReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | response | String? | yes | | + | action | String? | yes | | + | channel | String? | yes | | + +--- + + + + + #### [CommunicationConsentRes](#CommunicationConsentRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appId | String? | yes | | + | userId | String? | yes | | + | channels | [CommunicationConsentChannels](#CommunicationConsentChannels)? | yes | | + +--- + + + + + #### [CommunicationConsentChannelsEmail](#CommunicationConsentChannelsEmail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | response | String? | yes | | + | displayName | String? | yes | | + +--- + + + + + #### [CommunicationConsentChannelsSms](#CommunicationConsentChannelsSms) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | response | String? | yes | | + | displayName | String? | yes | | + +--- + + + + + #### [CommunicationConsentChannelsWhatsapp](#CommunicationConsentChannelsWhatsapp) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | response | String? | yes | | + | displayName | String? | yes | | + | countryCode | String? | yes | | + | phoneNumber | String? | yes | | + +--- + + + + + #### [CommunicationConsentChannels](#CommunicationConsentChannels) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | [CommunicationConsentChannelsEmail](#CommunicationConsentChannelsEmail)? | yes | | + | sms | [CommunicationConsentChannelsSms](#CommunicationConsentChannelsSms)? | yes | | + | whatsapp | [CommunicationConsentChannelsWhatsapp](#CommunicationConsentChannelsWhatsapp)? | yes | | + +--- + + + + + #### [CommunicationConsent](#CommunicationConsent) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appId | String? | yes | | + | userId | String? | yes | | + | channels | [CommunicationConsentChannels](#CommunicationConsentChannels)? | yes | | + +--- + + + + + #### [PushtokenReq](#PushtokenReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | action | String? | yes | | + | bundleIdentifier | String? | yes | | + | pushToken | String? | yes | | + | uniqueDeviceId | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [PushtokenRes](#PushtokenRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | bundleIdentifier | String? | yes | | + | pushToken | String? | yes | | + | uniqueDeviceId | String? | yes | | + | type | String? | yes | | + | platform | String? | yes | | + | applicationId | String? | yes | | + | userId | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | expiredAt | String? | yes | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String | no | | + | size | Int? | yes | | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + +--- + + + diff --git a/documentation/application/CONFIGURATION.md b/documentation/application/CONFIGURATION.md new file mode 100644 index 0000000000..552036da11 --- /dev/null +++ b/documentation/application/CONFIGURATION.md @@ -0,0 +1,2796 @@ + + + + +##### [Back to Application docs](./README.md) + +## Configuration Methods +Application configuration apis +* [getApplication](#getapplication) +* [getOwnerInfo](#getownerinfo) +* [getBasicDetails](#getbasicdetails) +* [getIntegrationTokens](#getintegrationtokens) +* [getOrderingStores](#getorderingstores) +* [getStoreDetailById](#getstoredetailbyid) +* [getFeatures](#getfeatures) +* [getContactInfo](#getcontactinfo) +* [getCurrencies](#getcurrencies) +* [getCurrencyById](#getcurrencybyid) +* [getAppCurrencies](#getappcurrencies) +* [getLanguages](#getlanguages) +* [getOrderingStoreCookie](#getorderingstorecookie) +* [removeOrderingStoreCookie](#removeorderingstorecookie) +* [getAppStaffs](#getappstaffs) + + + +## Methods with example and description + + +#### getApplication +Get current application details + + + + +```swift +configuration.getApplication() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get the current application details which includes configurations that indicate the status of the website, domain, ID, tokens, images, etc. + +*Returned Response:* + + + + +[Application](#Application) + +Success. Check the example shown below or refer `Application` for more details. + + + + +
    +  Example: + +```json +{ + "website": { + "enabled": true, + "basepath": "/" + }, + "cors": { + "domains": [] + }, + "auth": { + "enabled": false + }, + "description": "Uniket B2B - India's Fastest Growing Retail Store - Aapki Badhti Dukaan", + "channel_type": "uniket", + "cache_ttl": -1, + "internal": false, + "is_active": true, + "_id": "000000000000000000000004", + "name": "Uniket B2B", + "owner": "5e71a60dc671daffd81992ea", + "company_id": 1, + "token": "iTNjY_yAI", + "redirections": [], + "meta": [], + "created_at": "2019-12-26T13:22:23.619Z", + "modified_at": "2020-12-02T05:49:41.610Z", + "__v": 29, + "banner": { + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/landscape-banner/original/uSwlNpygq-Uniket-B2B.png" + }, + "logo": { + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/free-logo/original/oEf3SQjda-Uniket-B2B.png" + }, + "favicon": { + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/favicon/original/y3h6SSlY5-Uniket-B2B.png" + }, + "domains": [ + { + "verified": true, + "is_primary": true, + "is_shortlink": true, + "_id": "5eb1177748312a3bd55d0f1e", + "name": "uniket.hostx0.de" + }, + { + "verified": true, + "is_primary": false, + "is_shortlink": false, + "_id": "5f0858c5f86e00cd42dccc8d", + "name": "jd.hostx0.de" + } + ], + "app_type": "live", + "mobile_logo": { + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/free-logo/original/oEf3SQjda-Uniket-B2B.png" + }, + "domain": { + "verified": true, + "is_primary": true, + "is_shortlink": true, + "_id": "5eb1177748312a3bd55d0f1e", + "name": "uniket.hostx0.de" + }, + "id": "000000000000000000000004" +} +``` +
    + + + + + + + + + +--- + + +#### getOwnerInfo +Get application, owner and seller information + + + + +```swift +configuration.getOwnerInfo() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get the current application details which includes channel name, description, banner, logo, favicon, domain details, etc. This API also retrieves the seller and owner information such as address, email address, and phone number. + +*Returned Response:* + + + + +[ApplicationAboutResponse](#ApplicationAboutResponse) + +Success. Check the example shown below or refer `ApplicationAboutResponse` for more details. + + + + +
    +  Example: + +```json +{ + "application_info": { + "domains": [ + { + "verified": true, + "name": "uniket-testing.addsale.link", + "custom": false, + "is_primary": true + } + ], + "website": { + "enabled": true, + "basepath": "/" + }, + "cors": { + "domains": [] + }, + "description": "R-City Mall,Ghatkoper East,Mumbai", + "is_active": true, + "_id": "5cd3db5e9d692cfe5302a7ba", + "name": "Shivam Clothing Store", + "meta": [ + { + "name": "tes", + "value": "test" + } + ], + "token": "xOfcP-aYE", + "secret": "", + "created_at": "2019-05-09T07:48:46.218Z", + "banner": { + "secure_url": "https://res.cloudinary.com/jkvora/image/upload/v1561551809/fqt2djkddoe2yjjlln2h.png" + }, + "logo": { + "secure_url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1577513094/addsale/applications/app_5cd3db5e9d692cfe5302a7ba/media/store/logo/ayrkk2uzfknst2ohluzc.png" + }, + "id": "5cd3db5e9d692cfe5302a7ba", + "company_info": { + "_id": "5da4274a723af4000188a66c", + "uid": 873, + "created_on": "2019-10-14T07:44:10.391Z", + "is_active": true, + "name": "SAPPER LIFESTYLE PRIVATE LIMITED", + "addresses": [ + { + "pincode": 110042, + "address1": "412, SISODIA MOHALLA BADALI VILLAGE", + "city": "NEW DELHI", + "state": "DELHI", + "country": "INDIA", + "address_type": "registered" + }, + { + "pincode": 110042, + "address1": "412, SISODIA MOHALLA BADALI VILLAGE", + "city": "NEW DELHI", + "state": "DELHI", + "country": "INDIA", + "address_type": "office" + } + ], + "notification_emails": [ + "ecom.sapperlifestyle@f2fretail.com" + ] + }, + "owner_info": { + "_id": "5c77921fa1bf7d8695ed57fd", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "jalakvora@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "jalakvora@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "jalakvora@uniket.store" + } + ], + "phone_numbers": [ + { + "active": true, + "primary": true, + "verified": true, + "country_code": 91, + "phone": "9408282323" + } + ], + "first_name": "Jalak", + "last_name": "Vora", + "profile_pic": "" + } + } +} +``` +
    + + + + + + + + + +--- + + +#### getBasicDetails +Get basic application details + + + + +```swift +configuration.getBasicDetails() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to retrieve only the basic details of the application which includes channel name, description, banner, logo, favicon, domain details, etc. + +*Returned Response:* + + + + +[ApplicationDetail](#ApplicationDetail) + +Success. Check the example shown below or refer `ApplicationDetail` for more details. + + + + +
    +  Example: + +```json +{ + "name": "Uniket B2B", + "description": "Uniket B2B - India's Fastest Growing Retail Store - Aapki Badhti Dukaan", + "logo": { + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/free-logo/original/oEf3SQjda-Uniket-B2B.png" + }, + "mobile_logo": { + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/free-logo/original/oEf3SQjda-Uniket-B2B.png" + }, + "favicon": { + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/favicon/original/y3h6SSlY5-Uniket-B2B.png" + }, + "banner": { + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/landscape-banner/original/uSwlNpygq-Uniket-B2B.png" + }, + "domain": { + "verified": true, + "is_primary": true, + "is_shortlink": false, + "_id": "5eb1177748312a3bd55d0f1e", + "name": "uniket.hostx0.de" + }, + "domains": [ + { + "verified": true, + "is_primary": true, + "is_shortlink": false, + "_id": "5eb1177748312a3bd55d0f1e", + "name": "uniket.hostx0.de" + }, + { + "verified": true, + "is_primary": false, + "is_shortlink": true, + "_id": "5f0858c5f86e00cd42dccc8d", + "name": "jd.hostx0.de" + } + ], + "company_id": 1, + "_id": "000000000000000000000004" +} +``` +
    + + + + + + + + + +--- + + +#### getIntegrationTokens +Get integration tokens + + + + +```swift +configuration.getIntegrationTokens() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to retrieve the tokens used while integrating Firebase, MoEngage, Segment, GTM, Freshchat, Safetynet, Google Map and Facebook. **Note** - Token values are encrypted with AES encryption using a secret key. Kindly reach out to the developers for obtaining the secret key. + +*Returned Response:* + + + + +[AppTokenResponse](#AppTokenResponse) + +Success. Check the example shown below or refer `AppTokenResponse` for more details. + + + + +
    +  Example: + +```json +{ + "tokens": { + "firebase": { + "credentials": { + "project_id": "", + "gcm_sender_id": "", + "application_id": "", + "api_key": "" + }, + "enabled": false + }, + "moengage": { + "credentials": { + "app_id": "" + }, + "enabled": false + }, + "segment": { + "credentials": { + "write_key": "U2FsdGVkX18E920z+xtaD+GnGWoK/5SNxu61phXf6/o=" + }, + "enabled": false + }, + "gtm": { + "credentials": { + "api_key": "" + }, + "enabled": false + }, + "freshchat": { + "credentials": { + "app_id": "U2FsdGVkX19+Egjfy8alIB4S+n2IQEXz2X4yxzimxbGzq9M5+iFsvGjrBAyQrDZ/iIXgWQyWOFRHmf9xhFGajQ==", + "app_key": "U2FsdGVkX18OydYSvUBRKJDsLD1KCcwK6+jJVGma4Ck2PVwOv6BW5vyiM2sZ4kEpHbRV38KBPZPqlx3EfZd6mw==" + }, + "enabled": true + }, + "safetynet": { + "credentials": { + "api_key": "U2FsdGVkX1/Ex0BXvB16B81dwWIfVK8LPwexMMbVC3/nB9Y5n4stcnOMUCDalDs8Z92MecOQKydWg+E17QfZ4Q==" + }, + "enabled": true + }, + "fynd_rewards": { + "credentials": { + "public_key": "U2FsdGVkX1/C7x0hybxKPpWSMYBEKukQCVjnm7wfW3lrTJPmcr06xvLzVatPQJTKXeXvay0rdvcXuHlp8n/VAX7v9Usobmp1znadnPWt07GOvq5aPK9zDlg05tb+TX8Wx0q2rVonRK0Q6ZyMcn6Oy+Z812TpRAlcU1AmSrDtl/PMjuH1rSRTxKJLD0HzXk9zPl2M6GOKmgzjpHD4ZmtRSfJmm/h+qbZZ4AuD9upTbJzDm/pcp4S4cYu9rSV31JpOtAkrCxZFzCT8seWKa2eU8VdleRltwF5DO1x8Pny/hKNmhrUqxdkevY6lm4aEQjThA/EeBv1UPq52EFDteXLsZ6yBXyNAxcFNuPupour+K8hi0nfgbd/fsFqu5NUBOwz0hsqQh9OsTGt7SdiIyMSQgCttphaqhBbJ926UlG9d/O1W1u+i9rn7pECcH1eyUYlsNbYqghciz9pTrfRdqA8AIa2j7H/3Lxq37arxZCIDlTgl+Kk/8QUTsTefk+seGZsyiDyIkxW+FcmHBZLr3y85ST23szWSnyweV2hQHtPWnCE=" + } + }, + "auth": { + "google": { + "app_id": "U2FsdGVkX19ZkUS8HAnz17Sbcixaj0N4xDcaxztzAPdkxsc2i56kuEL+hVDv5z47HjiY4jOFN0zd5HbO9vf5/adwr6L8QQVEmz1BEEGEze13a5PgONGZlfQkxeuQLBT9" + }, + "facebook": { + "app_id": "U2FsdGVkX1/kPjoWmEvESc276Ect4VZmAFVTkQKKjsxgk6LXWjj73vPrBsnJyPpR" + }, + "accountkit": { + "app_id": "" + } + }, + "google_map": { + "credentials": { + "api_key": "U2FsdGVkX1+5tBH/3lREPiDwVukCS/Q2ftu/CYD9RdLYK8hGO/XJfrs2zpoGDKCJBhgTDRESItRKR7Lt/w+zeQ==" + } + } + }, + "_id": "5e285cb1df7e5b1421d5f840", + "application": "000000000000000000000004", + "created_at": "2020-01-22T14:31:13.192Z", + "modified_at": "2020-05-01T04:14:42.117Z", + "__v": 0 +} +``` +
    + + + + + + + + + +--- + + +#### getOrderingStores +Get deployment stores + + + + +```swift +configuration.getOrderingStores(pageNo: pageNo, pageSize: pageSize, q: q) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | +| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | +| q | String? | no | Store code or name of the ordering store. | + + + +Use this API to retrieve the details of all the deployment stores (the selling locations where the application will be utilized for placing orders). + +*Returned Response:* + + + + +[OrderingStores](#OrderingStores) + +Success. Check the example shown below or refer `OrderingStores` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getStoreDetailById +Get ordering store details + + + + +```swift +configuration.getStoreDetailById(storeId: storeId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| storeId | Int | yes | Store uid | + + + +Use this API to retrieve the details of given stores uid (the selling locations where the application will be utilized for placing orders). + +*Returned Response:* + + + + +[OrderingStore](#OrderingStore) + +Success. Check the example shown below or refer `OrderingStore` for more details. + + + + +
    +  Example: + +```json +{ + "uid": 1060, + "name": "THE MANDHANA PARK KAMLANAGAR DELHI", + "pincode": 110007, + "store_code": "MRVLB22", + "code": "MRVLB22", + "display_name": "Kamla Nagar", + "store_type": "mall" +} +``` +
    + + + + + + + + + +--- + + +#### getFeatures +Get features of application + + + + +```swift +configuration.getFeatures() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to retrieve the configuration of features such as product detail, landing page, options in the login/registration screen, communication opt-in, cart options and many more. + +*Returned Response:* + + + + +[AppFeatureResponse](#AppFeatureResponse) + +Success. Check the example shown below or refer `AppFeatureResponse` for more details. + + + + +
    +  Example: + +```json +{ + "feature": { + "product_detail": { + "similar": [ + "basic", + "visual", + "brand", + "category", + "seller", + "price", + "specs" + ], + "seller_selection": true, + "update_product_meta": true, + "request_product": true + }, + "landing_page": { + "launch_page": { + "page_type": "home", + "params": null, + "query": null + }, + "continue_as_guest": true, + "login_btn_text": "Click here to sign-in", + "show_domain_textbox": true, + "show_register_btn": true + }, + "registration_page": { + "ask_store_address": false + }, + "home_page": { + "order_processing": true + }, + "common": { + "communication_optin_dialog": { + "visibility": true + }, + "deployment_store_selection": { + "enabled": true, + "type": "hard" + }, + "listing_price": { + "value": "min", + "sort": "min" + }, + "currency": { + "value": [ + "INR" + ], + "type": "explicit", + "default_currency": "INR" + }, + "revenue_engine": { + "enabled": false + }, + "feedback": { + "enabled": true + }, + "compare_products": { + "enabled": true + }, + "reward_points": { + "credit": { + "enabled": true + }, + "debit": { + "enabled": true, + "auto_apply": false, + "strategy_channel": "REWARDS" + } + } + }, + "cart": { + "gst_input": true, + "staff_selection": true, + "placing_for_customer": true, + "google_map": true + }, + "qr": { + "application": true, + "products": true, + "collections": true + }, + "pcr": { + "staff_selection": true + }, + "order": { + "buy_again": true + }, + "_id": "5e57643c986e4119c973df7d", + "app": "000000000000000000000004", + "created_at": "2020-02-27T06:39:56.088Z", + "modified_at": "2021-02-02T11:04:14.289Z", + "__v": 1 + } +} +``` +
    + + + + + + + + + +--- + + +#### getContactInfo +Get application information + + + + +```swift +configuration.getContactInfo() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to retrieve information about the social links, address and contact information of the company/seller/brand operating the application. + +*Returned Response:* + + + + +[ApplicationInformation](#ApplicationInformation) + +Success. Check the example shown below or refer `ApplicationAboutResponse` for more details. + + + + +
    +  Example: + +```json +{ + "value": { + "address": { + "loc": null, + "address_line": [ + "Warehouse 5, Near Industrial Complex", + "2nd Lane, Andheri" + ], + "phone": [ + { + "code": "+91", + "number": "9988776654" + } + ], + "city": "Mumbai , Maharashtra , India", + "country": "India", + "pincode": 400059 + }, + "support": { + "phone": [], + "email": [], + "timing": "9 AM to 9 PM" + }, + "social_links": { + "facebook": { + "title": "Facebook", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/hQAbAKdvHK-facebookfooteraopcjq.svg", + "link": "" + }, + "instagram": { + "title": "Instagram", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/UZYsGWOqXp-instagramfooterl3utrr.svg", + "link": "" + }, + "twitter": { + "title": "Twitter", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/oT2hW-BJjq-twitterfooternajsyr.svg", + "link": "" + }, + "pinterest": { + "title": "Pinterest", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/v0erlcMk8p-pinterestfooternzmq4b.svg", + "link": "" + }, + "google_plus": { + "title": "Google+", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/lw3Y5S58h4-googleplusysukr1.png", + "link": "" + }, + "youtube": { + "title": "Youtube", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/EYV03PDST_-youtubefootermqhcr7.svg", + "link": "" + }, + "linked_in": { + "title": "LinkedIn", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/qa7gx_bW9O-linkedinfooterrcr0yq.svg", + "link": "" + }, + "vimeo": { + "title": "Vimeo", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/Ttc80b3U78-vimeofooternho4br.svg", + "link": "" + }, + "blog_link": { + "title": "Blog", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/LKpxTk1I3s-mediumfooterdtvrva.svg", + "link": "" + } + }, + "links": [ + { + "title": "Shipping", + "link": "www.uniket.store/shipping-details" + }, + { + "title": "Returns", + "link": "www.uniket.store/policy/return-policy" + }, + { + "title": "Privacy", + "link": "www.uniket.store/policy/privacy-policy" + }, + { + "title": "Terms", + "link": "www.uniket.store/policy/terms-conditions" + } + ], + "copyright_text": "#MadeInIndia © 2020 Shopsense Retail Technologies", + "_id": "5e6627bd0732616083e83750", + "business_highlights": [ + { + "_id": "5fc901611dfba6c2e87d1ca9", + "title": "100% Genuine Products", + "icon": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/business-highlights/pictures/square-logo/original/bVlx43F2a-H6pvZ9tzp-business-logo-icon.png", + "sub_title": "Directly from brands" + }, + { + "_id": "5fc901611dfba64ce57d1caa", + "title": "Credit Facility Available", + "icon": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/business-highlights/pictures/square-logo/original/VMnltS1m3-QuUnEjOsA-business-logo-icon.png", + "sub_title": "Free 30 Days Credit" + }, + { + "_id": "5fc901611dfba64b2e7d1cab", + "title": "Assured Returns", + "icon": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/business-highlights/pictures/square-logo/original/cTHzgHJXK-sROtLMalN-business-logo-icon.png", + "sub_title": "For all damaged/wrong items" + } + ], + "application": "000000000000000000000004", + "created_at": "2020-03-09T11:25:49.921Z", + "modified_at": "2020-12-03T15:16:49.087Z", + "__v": 99 + } +} +``` +
    + + + + + + + + + +--- + + +#### getCurrencies +Get all currencies list + + + + +```swift +configuration.getCurrencies() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get a list of currencies available. Moreover, get the name, code, symbol, and the decimal digits of the currencies. + +*Returned Response:* + + + + +[CurrenciesResponse](#CurrenciesResponse) + +Success. Check the example shown below or refer `CurrenciesResponse` for more details. + + + + +
    +  Example: + +```json +{ + "items": [ + { + "_id": "5ec75d11f7bfb54d798f3516", + "is_active": true, + "name": "United States Dollar", + "code": "USD", + "created_at": "2020-05-22T05:03:13.354Z", + "modified_at": "2020-06-05T09:12:04.248Z", + "decimal_digits": 2, + "symbol": "$" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getCurrencyById +Get currency by its ID + + + + +```swift +configuration.getCurrencyById(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Object ID assigned to the currency | + + + +Use this API to retrieve a currency using its ID. + +*Returned Response:* + + + + +[Currency](#Currency) + +Success. Check the example shown below or refer `Currency` for more details. + + + + +
    +  Example: + +```json +{ + "_id": "5ec75d11f7bfb501d88f3559", + "is_active": true, + "name": "Gold Ounce", + "code": "XAU", + "created_at": "2020-05-22T05:03:13.429Z", + "modified_at": "2020-06-05T09:12:04.248Z", + "decimal_digits": null, + "symbol": null +} +``` +
    + + + + + + + + + +--- + + +#### getAppCurrencies +Get currencies enabled in the application + + + + +```swift +configuration.getAppCurrencies() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get a list of currencies allowed in the current application. Moreover, get the name, code, symbol, and the decimal digits of the currencies. + +*Returned Response:* + + + + +[AppCurrencyResponse](#AppCurrencyResponse) + +Success. Check the example shown below or refer `AppCurrencyResponse` for more details. + + + + +
    +  Example: + +```json +{ + "application": "000000000000000000000001", + "default_currency": { + "ref": "5ecf6122d953d4242c044907", + "code": "INR" + }, + "supported_currency": [ + { + "_id": "5ecf6122d953d4242c044907", + "is_active": true, + "name": "Indian Rupee", + "code": "INR", + "decimal_digits": 2, + "symbol": "₹", + "created_at": "2020-05-28T06:58:42.532Z", + "modified_at": "2021-04-05T16:44:14.358Z" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getLanguages +Get list of languages + + + + +```swift +configuration.getLanguages() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get a list of languages supported in the application. + +*Returned Response:* + + + + +[LanguageResponse](#LanguageResponse) + +Success. Check the example shown below or refer `LanguageResponse` for more details. + + + + +
    +  Example: + +```json +{ + "items": [ + { + "name": "हिन्दी", + "code": "hi-IN" + }, + { + "name": "English", + "code": "en-IN" + }, + { + "name": "عربى", + "code": "ar-AE" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getOrderingStoreCookie +Get an Ordering Store signed cookie on selection of ordering store. + + + + +```swift +configuration.getOrderingStoreCookie(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | OrderingStoreSelectRequest | yes | Request body | + + +Use this API to get an Ordering Store signed cookie upon selecting an ordering store. This will be used by the cart service to verify a coupon against the selected ordering store in cart. + +*Returned Response:* + + + + +[SuccessMessageResponse](#SuccessMessageResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### removeOrderingStoreCookie +Unset the Ordering Store signed cookie. + + + + +```swift +configuration.removeOrderingStoreCookie() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to unset the Ordering Store cookie upon changing the sales channel, by its domain URL, in the Universal Fynd Store app. + +*Returned Response:* + + + + +[SuccessMessageResponse](#SuccessMessageResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getAppStaffs +Get a list of staff. + + + + +```swift +configuration.getAppStaffs(orderIncent: orderIncent, orderingStore: orderingStore, user: user) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| orderIncent | Bool? | no | This is a boolean value. Select `true` to retrieve the staff members eligible for getting incentives on orders. | +| orderingStore | Int? | no | ID of the ordering store. Helps in retrieving staff members working at a particular ordering store. | +| user | String? | no | Mongo ID of the staff. Helps in retrieving the details of a particular staff member. | + + + +Use this API to get a list of staff including the names, employee code, incentive status, assigned ordering stores, and title of each staff added to the application. + +*Returned Response:* + + + + +[AppStaffResponse](#AppStaffResponse) + +Success. Check the example shown below or refer `AppStaffResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [ApplicationAboutResponse](#ApplicationAboutResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | applicationInfo | [ApplicationInfo](#ApplicationInfo)? | yes | | + | companyInfo | [CompanyInfo](#CompanyInfo)? | yes | | + | ownerInfo | [OwnerInfo](#OwnerInfo)? | yes | | + +--- + + + + + #### [ApplicationInfo](#ApplicationInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | domain | [Domain](#Domain)? | yes | | + | website | [ApplicationWebsite](#ApplicationWebsite)? | yes | | + | cors | [ApplicationCors](#ApplicationCors)? | yes | | + | description | String? | yes | | + | name | String? | yes | | + | meta | [ApplicationMeta](#ApplicationMeta)? | yes | | + | token | String? | yes | | + | secret | String? | yes | | + | createdAt | String? | yes | | + | banner | [SecureUrl](#SecureUrl)? | yes | | + | logo | [SecureUrl](#SecureUrl)? | yes | | + | isActive | Bool? | yes | | + +--- + + + + + #### [CompanyInfo](#CompanyInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | uid | Int? | yes | | + | createdOn | String? | yes | | + | isActive | Bool? | yes | | + | name | String? | yes | | + | addresses | [[CompanyAboutAddress](#CompanyAboutAddress)]? | yes | | + | notificationEmails | [String]? | yes | | + +--- + + + + + #### [OwnerInfo](#OwnerInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | emails | [[UserEmail](#UserEmail)]? | yes | | + | phoneNumbers | [[UserPhoneNumber](#UserPhoneNumber)]? | yes | | + | firstName | String? | yes | | + | lastName | String? | yes | | + | profilePic | String? | yes | | + +--- + + + + + #### [AppVersionRequest](#AppVersionRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | [ApplicationVersionRequest](#ApplicationVersionRequest) | no | | + | device | [Device](#Device) | no | | + | locale | String? | yes | | + | timezone | String? | yes | | + +--- + + + + + #### [ApplicationVersionRequest](#ApplicationVersionRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | name | String | no | | + | namespace | String? | yes | | + | token | String? | yes | | + | version | String | no | | + +--- + + + + + #### [Device](#Device) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | build | Int? | yes | | + | model | String? | yes | | + | os | [OS](#OS) | no | | + +--- + + + + + #### [OS](#OS) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String | no | | + | version | String? | yes | | + +--- + + + + + #### [SupportedLanguage](#SupportedLanguage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | code | String? | yes | | + +--- + + + + + #### [LanguageResponse](#LanguageResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[SupportedLanguage](#SupportedLanguage)]? | yes | | + +--- + + + + + #### [AppStaffResponse](#AppStaffResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | staffUsers | [[AppStaff](#AppStaff)]? | yes | | + +--- + + + + + #### [UpdateDialog](#UpdateDialog) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | interval | Int? | yes | | + +--- + + + + + #### [OrderingStoreSelectRequest](#OrderingStoreSelectRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | orderingStore | [OrderingStoreSelect](#OrderingStoreSelect) | no | | + +--- + + + + + #### [OrderingStoreSelect](#OrderingStoreSelect) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int | no | store uid | + +--- + + + + + #### [AppStaff](#AppStaff) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | orderIncent | Bool? | yes | | + | stores | [Int]? | yes | | + | application | String? | yes | | + | title | String? | yes | | + | user | String? | yes | | + | employeeCode | String? | yes | | + | firstName | String? | yes | | + | lastName | String? | yes | | + | profilePicUrl | String? | yes | | + +--- + + + + + #### [AppTokenResponse](#AppTokenResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | tokens | [Tokens](#Tokens)? | yes | | + | id | String? | yes | | + | application | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [Tokens](#Tokens) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | firebase | [Firebase](#Firebase)? | yes | | + | moengage | [Moengage](#Moengage)? | yes | | + | segment | [Segment](#Segment)? | yes | | + | gtm | [Gtm](#Gtm)? | yes | | + | freshchat | [Freshchat](#Freshchat)? | yes | | + | safetynet | [Safetynet](#Safetynet)? | yes | | + | fyndRewards | [FyndRewards](#FyndRewards)? | yes | | + | googleMap | [GoogleMap](#GoogleMap)? | yes | | + +--- + + + + + #### [Firebase](#Firebase) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | credentials | [Credentials](#Credentials)? | yes | | + | enabled | Bool? | yes | | + +--- + + + + + #### [Credentials](#Credentials) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | ios | [Ios](#Ios)? | yes | | + | android | [Android](#Android)? | yes | | + | projectId | String? | yes | | + | gcmSenderId | String? | yes | | + | applicationId | String? | yes | | + | apiKey | String? | yes | | + +--- + + + + + #### [Ios](#Ios) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | applicationId | String? | yes | | + | apiKey | String? | yes | | + +--- + + + + + #### [Android](#Android) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | applicationId | String? | yes | | + | apiKey | String? | yes | | + +--- + + + + + #### [Moengage](#Moengage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | credentials | [MoengageCredentials](#MoengageCredentials)? | yes | | + | enabled | Bool? | yes | | + +--- + + + + + #### [MoengageCredentials](#MoengageCredentials) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appId | String? | yes | | + +--- + + + + + #### [Segment](#Segment) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | credentials | [SegmentCredentials](#SegmentCredentials)? | yes | | + | enabled | Bool? | yes | | + +--- + + + + + #### [SegmentCredentials](#SegmentCredentials) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | writeKey | String? | yes | | + +--- + + + + + #### [Gtm](#Gtm) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | credentials | [GtmCredentials](#GtmCredentials)? | yes | | + | enabled | Bool? | yes | | + +--- + + + + + #### [GtmCredentials](#GtmCredentials) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | apiKey | String? | yes | | + +--- + + + + + #### [Freshchat](#Freshchat) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | credentials | [FreshchatCredentials](#FreshchatCredentials)? | yes | | + | enabled | Bool? | yes | | + +--- + + + + + #### [FreshchatCredentials](#FreshchatCredentials) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appId | String? | yes | | + | appKey | String? | yes | | + | webToken | String? | yes | | + +--- + + + + + #### [Safetynet](#Safetynet) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | credentials | [SafetynetCredentials](#SafetynetCredentials)? | yes | | + | enabled | Bool? | yes | | + +--- + + + + + #### [SafetynetCredentials](#SafetynetCredentials) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | apiKey | String? | yes | | + +--- + + + + + #### [FyndRewards](#FyndRewards) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | credentials | [FyndRewardsCredentials](#FyndRewardsCredentials)? | yes | | + +--- + + + + + #### [FyndRewardsCredentials](#FyndRewardsCredentials) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | publicKey | String? | yes | | + +--- + + + + + #### [GoogleMap](#GoogleMap) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | credentials | [GoogleMapCredentials](#GoogleMapCredentials)? | yes | | + +--- + + + + + #### [GoogleMapCredentials](#GoogleMapCredentials) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | apiKey | String? | yes | | + +--- + + + + + #### [RewardPointsConfig](#RewardPointsConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | credit | [Credit](#Credit)? | yes | | + | debit | [Debit](#Debit)? | yes | | + +--- + + + + + #### [Credit](#Credit) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + +--- + + + + + #### [Debit](#Debit) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | autoApply | Bool? | yes | | + | strategyChannel | String? | yes | | + +--- + + + + + #### [ProductDetailFeature](#ProductDetailFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | similar | [String]? | yes | | + | sellerSelection | Bool? | yes | | + | updateProductMeta | Bool? | yes | | + | requestProduct | Bool? | yes | | + +--- + + + + + #### [LaunchPage](#LaunchPage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pageType | String? | yes | | + | params | [String: Any]? | yes | | + | query | [String: Any]? | yes | | + +--- + + + + + #### [LandingPageFeature](#LandingPageFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | launchPage | [LaunchPage](#LaunchPage)? | yes | | + | continueAsGuest | Bool? | yes | | + | loginBtnText | String? | yes | | + | showDomainTextbox | Bool? | yes | | + | showRegisterBtn | Bool? | yes | | + +--- + + + + + #### [RegistrationPageFeature](#RegistrationPageFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | askStoreAddress | Bool? | yes | | + +--- + + + + + #### [AppFeature](#AppFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | productDetail | [ProductDetailFeature](#ProductDetailFeature)? | yes | | + | landingPage | [LandingPageFeature](#LandingPageFeature)? | yes | | + | registrationPage | [RegistrationPageFeature](#RegistrationPageFeature)? | yes | | + | homePage | [HomePageFeature](#HomePageFeature)? | yes | | + | common | [CommonFeature](#CommonFeature)? | yes | | + | cart | [CartFeature](#CartFeature)? | yes | | + | qr | [QrFeature](#QrFeature)? | yes | | + | pcr | [PcrFeature](#PcrFeature)? | yes | | + | order | [OrderFeature](#OrderFeature)? | yes | | + | id | String? | yes | | + | app | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [HomePageFeature](#HomePageFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | orderProcessing | Bool? | yes | | + +--- + + + + + #### [CommonFeature](#CommonFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | communicationOptinDialog | [CommunicationOptinDialogFeature](#CommunicationOptinDialogFeature)? | yes | | + | deploymentStoreSelection | [DeploymentStoreSelectionFeature](#DeploymentStoreSelectionFeature)? | yes | | + | listingPrice | [ListingPriceFeature](#ListingPriceFeature)? | yes | | + | currency | [CurrencyFeature](#CurrencyFeature)? | yes | | + | revenueEngine | [RevenueEngineFeature](#RevenueEngineFeature)? | yes | | + | feedback | [FeedbackFeature](#FeedbackFeature)? | yes | | + | compareProducts | [CompareProductsFeature](#CompareProductsFeature)? | yes | | + | rewardPoints | [RewardPointsConfig](#RewardPointsConfig)? | yes | | + +--- + + + + + #### [CommunicationOptinDialogFeature](#CommunicationOptinDialogFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | visibility | Bool? | yes | | + +--- + + + + + #### [DeploymentStoreSelectionFeature](#DeploymentStoreSelectionFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | type | String? | yes | | + +--- + + + + + #### [ListingPriceFeature](#ListingPriceFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | value | String? | yes | | + +--- + + + + + #### [CurrencyFeature](#CurrencyFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | value | [String]? | yes | | + | type | String? | yes | | + | defaultCurrency | String? | yes | | + +--- + + + + + #### [RevenueEngineFeature](#RevenueEngineFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + +--- + + + + + #### [FeedbackFeature](#FeedbackFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + +--- + + + + + #### [CompareProductsFeature](#CompareProductsFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + +--- + + + + + #### [CartFeature](#CartFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | gstInput | Bool? | yes | | + | staffSelection | Bool? | yes | | + | placingForCustomer | Bool? | yes | | + | googleMap | Bool? | yes | | + | revenueEngineCoupon | Bool? | yes | | + +--- + + + + + #### [QrFeature](#QrFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | Bool? | yes | | + | products | Bool? | yes | | + | collections | Bool? | yes | | + +--- + + + + + #### [PcrFeature](#PcrFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | staffSelection | Bool? | yes | | + +--- + + + + + #### [OrderFeature](#OrderFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | buyAgain | Bool? | yes | | + +--- + + + + + #### [AppFeatureRequest](#AppFeatureRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | feature | [AppFeature](#AppFeature)? | yes | | + +--- + + + + + #### [AppFeatureResponse](#AppFeatureResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | feature | [AppFeature](#AppFeature)? | yes | | + +--- + + + + + #### [Currency](#Currency) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | isActive | Bool? | yes | | + | name | String? | yes | | + | code | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | decimalDigits | Int? | yes | | + | symbol | String? | yes | | + +--- + + + + + #### [Domain](#Domain) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | verified | Bool? | yes | | + | isPrimary | Bool? | yes | | + | isShortlink | Bool? | yes | | + | id | String? | yes | | + | name | String? | yes | | + +--- + + + + + #### [ApplicationWebsite](#ApplicationWebsite) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | basepath | String? | yes | | + +--- + + + + + #### [ApplicationCors](#ApplicationCors) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | domains | [String]? | yes | | + +--- + + + + + #### [ApplicationAuth](#ApplicationAuth) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + +--- + + + + + #### [ApplicationRedirections](#ApplicationRedirections) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | redirectFrom | String? | yes | | + | redirectTo | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [ApplicationMeta](#ApplicationMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [SecureUrl](#SecureUrl) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | secureUrl | String? | yes | | + +--- + + + + + #### [Application](#Application) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | website | [ApplicationWebsite](#ApplicationWebsite)? | yes | | + | cors | [ApplicationCors](#ApplicationCors)? | yes | | + | auth | [ApplicationAuth](#ApplicationAuth)? | yes | | + | description | String? | yes | | + | channelType | String? | yes | | + | cacheTtl | Int? | yes | | + | isInternal | Bool? | yes | | + | isActive | Bool? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | owner | String? | yes | | + | companyId | Int? | yes | | + | token | String? | yes | | + | redirections | [[ApplicationRedirections](#ApplicationRedirections)]? | yes | | + | meta | [[ApplicationMeta](#ApplicationMeta)]? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + | banner | [SecureUrl](#SecureUrl)? | yes | | + | logo | [SecureUrl](#SecureUrl)? | yes | | + | favicon | [SecureUrl](#SecureUrl)? | yes | | + | domains | [[Domain](#Domain)]? | yes | | + | appType | String? | yes | | + | mobileLogo | [SecureUrl](#SecureUrl)? | yes | | + | domain | [Domain](#Domain)? | yes | | + +--- + + + + + #### [NotFound](#NotFound) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [UnhandledError](#UnhandledError) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [InvalidPayloadRequest](#InvalidPayloadRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [SuccessMessageResponse](#SuccessMessageResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [InventoryBrandRule](#InventoryBrandRule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | criteria | String? | yes | Whether enable all or explicitly few brands as inventory | + | brands | [Int]? | yes | Brand uids in case of explicit criteria | + +--- + + + + + #### [StoreCriteriaRule](#StoreCriteriaRule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | companies | [Int]? | yes | list of company uids | + | brands | [Int]? | yes | list of brand uids | + +--- + + + + + #### [InventoryStoreRule](#InventoryStoreRule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | criteria | String? | yes | Whether enable all or explicitly few stores or use filter of brands and company as inventory stores | + | rules | [[StoreCriteriaRule](#StoreCriteriaRule)]? | yes | List of rules with company and brands uids. Used when critera is `filter` | + | stores | [Int]? | yes | List of store uids. Used when critera is `explicit` | + +--- + + + + + #### [InventoryPaymentConfig](#InventoryPaymentConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | modeOfPayment | String? | yes | | + | source | String? | yes | | + +--- + + + + + #### [StorePriorityRule](#StorePriorityRule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | storetypeOrder | [String]? | yes | | + +--- + + + + + #### [ArticleAssignmentRule](#ArticleAssignmentRule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | storePriority | [StorePriorityRule](#StorePriorityRule)? | yes | | + +--- + + + + + #### [InventoryArticleAssignment](#InventoryArticleAssignment) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | postOrderReassignment | Bool? | yes | | + | rules | [ArticleAssignmentRule](#ArticleAssignmentRule)? | yes | | + +--- + + + + + #### [CompanyAboutAddress](#CompanyAboutAddress) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pincode | Int? | yes | | + | address1 | String? | yes | | + | address2 | String? | yes | | + | city | String? | yes | | + | state | String? | yes | | + | country | String? | yes | | + | addressType | String? | yes | | + +--- + + + + + #### [UserEmail](#UserEmail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | | + | primary | Bool? | yes | | + | verified | Bool? | yes | | + | email | String? | yes | | + +--- + + + + + #### [UserPhoneNumber](#UserPhoneNumber) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | | + | primary | Bool? | yes | | + | verified | Bool? | yes | | + | countryCode | Int? | yes | | + | phone | String? | yes | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String | no | | + | size | Int? | yes | | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + +--- + + + + + #### [ApplicationInformation](#ApplicationInformation) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | address | [InformationAddress](#InformationAddress)? | yes | | + | support | [InformationSupport](#InformationSupport)? | yes | | + | socialLinks | [SocialLinks](#SocialLinks)? | yes | | + | links | [Links](#Links)? | yes | | + | copyrightText | String? | yes | | + | id | String? | yes | | + | businessHighlights | [BusinessHighlights](#BusinessHighlights)? | yes | | + | application | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [InformationAddress](#InformationAddress) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | loc | String? | yes | | + | addressLine | [String]? | yes | | + | phone | [InformationPhone](#InformationPhone)? | yes | | + | city | String? | yes | | + | country | String? | yes | | + | pincode | Int? | yes | | + +--- + + + + + #### [InformationPhone](#InformationPhone) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | code | String? | yes | | + | number | String? | yes | | + +--- + + + + + #### [InformationSupport](#InformationSupport) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | phone | [String]? | yes | | + | email | [String]? | yes | | + | timing | String? | yes | | + +--- + + + + + #### [SocialLinks](#SocialLinks) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | facebook | [FacebookLink](#FacebookLink)? | yes | | + | instagram | [InstagramLink](#InstagramLink)? | yes | | + | twitter | [TwitterLink](#TwitterLink)? | yes | | + | pinterest | [PinterestLink](#PinterestLink)? | yes | | + | googlePlus | [GooglePlusLink](#GooglePlusLink)? | yes | | + | youtube | [YoutubeLink](#YoutubeLink)? | yes | | + | linkedIn | [LinkedInLink](#LinkedInLink)? | yes | | + | vimeo | [VimeoLink](#VimeoLink)? | yes | | + | blogLink | [BlogLink](#BlogLink)? | yes | | + +--- + + + + + #### [FacebookLink](#FacebookLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | icon | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [InstagramLink](#InstagramLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | icon | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [TwitterLink](#TwitterLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | icon | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [PinterestLink](#PinterestLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | icon | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [GooglePlusLink](#GooglePlusLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | icon | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [YoutubeLink](#YoutubeLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | icon | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [LinkedInLink](#LinkedInLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | icon | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [VimeoLink](#VimeoLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | icon | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [BlogLink](#BlogLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | icon | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [Links](#Links) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [BusinessHighlights](#BusinessHighlights) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | title | String? | yes | | + | icon | String? | yes | | + | subTitle | String? | yes | | + +--- + + + + + #### [ApplicationDetail](#ApplicationDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String | no | | + | description | String | no | | + | logo | [SecureUrl](#SecureUrl) | no | | + | mobileLogo | [SecureUrl](#SecureUrl) | no | | + | favicon | [SecureUrl](#SecureUrl) | no | | + | banner | [SecureUrl](#SecureUrl) | no | | + | domain | [Domain](#Domain)? | yes | | + | domains | [[Domain](#Domain)]? | yes | | + | id | String? | yes | | + +--- + + + + + #### [CurrenciesResponse](#CurrenciesResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Currency](#Currency)]? | yes | | + +--- + + + + + #### [DefaultCurrency](#DefaultCurrency) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | ref | String? | yes | | + | code | String? | yes | | + +--- + + + + + #### [AppCurrencyResponse](#AppCurrencyResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | String? | yes | | + | defaultCurrency | [DefaultCurrency](#DefaultCurrency)? | yes | | + | supportedCurrency | [[Currency](#Currency)]? | yes | | + +--- + + + + + #### [StoreLatLong](#StoreLatLong) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | coordinates | [Double]? | yes | | + +--- + + + + + #### [OptedStoreAddress](#OptedStoreAddress) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | state | String? | yes | | + | address1 | String? | yes | | + | latLong | [StoreLatLong](#StoreLatLong)? | yes | | + | address2 | String? | yes | | + | pincode | Int? | yes | | + | country | String? | yes | | + | city | String? | yes | | + +--- + + + + + #### [OrderingStore](#OrderingStore) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | address | [OptedStoreAddress](#OptedStoreAddress)? | yes | | + | id | String? | yes | | + | uid | Int? | yes | | + | name | String? | yes | | + | displayName | String? | yes | | + | storeType | String? | yes | | + | storeCode | String? | yes | | + | pincode | Int? | yes | | + | code | String? | yes | | + +--- + + + + + #### [OrderingStores](#OrderingStores) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [[OrderingStore](#OrderingStore)]? | yes | | + | deployedStores | [Int]? | yes | | + | allStores | Bool? | yes | | + | enabled | Bool? | yes | | + | type | String? | yes | | + | id | String? | yes | | + | app | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [OrderingStoresResponse](#OrderingStoresResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [[OrderingStore](#OrderingStore)]? | yes | | + +--- + + + diff --git a/documentation/application/CONTENT.md b/documentation/application/CONTENT.md new file mode 100644 index 0000000000..baabe3954b --- /dev/null +++ b/documentation/application/CONTENT.md @@ -0,0 +1,3290 @@ + + + + +##### [Back to Application docs](./README.md) + +## Content Methods +Content System +* [getAnnouncements](#getannouncements) +* [getBlog](#getblog) +* [getBlogs](#getblogs) +* [getDataLoaders](#getdataloaders) +* [getFaqs](#getfaqs) +* [getFaqCategories](#getfaqcategories) +* [getFaqBySlug](#getfaqbyslug) +* [getFaqCategoryBySlug](#getfaqcategorybyslug) +* [getFaqsByCategorySlug](#getfaqsbycategoryslug) +* [getLandingPage](#getlandingpage) +* [getLegalInformation](#getlegalinformation) +* [getNavigations](#getnavigations) +* [getSEOConfiguration](#getseoconfiguration) +* [getSlideshows](#getslideshows) +* [getSlideshow](#getslideshow) +* [getSupportInformation](#getsupportinformation) +* [getTags](#gettags) +* [getPage](#getpage) +* [getPages](#getpages) + + + +## Methods with example and description + + +#### getAnnouncements +Get live announcements + + + + +```swift +content.getAnnouncements() { (response, error) in + // Use response +} +``` + + + + + + +Announcements are useful to highlight a message or information on top of a webpage. Use this API to retrieve live announcements. Get announcements on individual pages or for all pages. + +*Returned Response:* + + + + +[AnnouncementsResponseSchema](#AnnouncementsResponseSchema) + +Success. Returns a JSON object with the details of the announcement shown on an individual page. `$all` is a special slug to indicate that an announcement is being shown on all the pages. Check the example shown below or refer `AnnouncementsResponseSchema` for more details. + + + + +
    +  Examples: + + +
    +  Announcements enabled + +```json +{ + "value": { + "announcements": { + "$all": [ + { + "announcement": "

    test Announcement

    \n
    ", + "schedule": { + "start": "2021-03-31T11:22:08.167Z" + } + } + ] + }, + "refresh_rate": 900, + "refresh_pages": [] + } +} +``` +
    + +
    +  No Announcement enabled + +```json +{ + "value": { + "announcements": {}, + "refresh_rate": 900, + "refresh_pages": [] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getBlog +Get a blog + + + + +```swift +content.getBlog(slug: slug, rootId: rootId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a blog. You can get slug value from the endpoint /service/application/content/v1.0/blogs/. | +| rootId | String? | no | ID given to the HTML element | + + + +Use this API to get the details of a blog using its slug. Details include the title, reading time, publish status, feature image, tags, author, etc. + +*Returned Response:* + + + + +[BlogSchema](#BlogSchema) + +Success. Returns a JSON object with blog details. Check the example shown below or refer `BlogSchema` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "_id": "5eaa451a21a4dd75f0fd96c5", + "application": "5d3ebd89f540e7506b8b3548", + "tags": [ + "abhinav" + ], + "title": "my first blog", + "slug": "1st_blog", + "feature_image": { + "secure_url": "https://google.com" + }, + "content": [ + { + "type": "html", + "value": "

    hey there!

    " + } + ], + "_schedule": { + "cron": "* 10 * * *", + "start": "2021-03-31T23:30:00.000Z", + "end": "2021-03-31T23:55:00.000Z", + "duration": 1000, + "next_schedule": [ + { + "start": "2021-03-17T04:30:00.000Z", + "end": "2021-03-17T04:46:40.000Z" + } + ] + }, + "published": true, + "author": { + "name": "Fynd App" + }, + "date_meta": { + "created_on": "2021-03-14T06:49:03.945Z", + "modified_on": "2021-03-14T06:49:03.945Z" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getBlogs +Get a list of blogs + + + + +```swift +content.getBlogs(pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | +| pageSize | Int? | no | The number of items to retrieve in each page. | + + + +Use this API to get all the blogs. + +*Returned Response:* + + + + +[BlogGetResponse](#BlogGetResponse) + +Success. Check the example shown below or refer `BlogGetResponse` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "date_meta": { + "created_on": "2021-03-14T06:49:03.945Z", + "modified_on": "2021-03-14T06:49:03.945Z" + }, + "tags": [], + "_id": "604db275b3ae202873964d94", + "content": [ + { + "type": "html", + "value": "

    test abhinav

    " + } + ], + "title": "1st Blog", + "slug": "1st-blog", + "published": true, + "_schedule": { + "next_schedule": [ + {} + ], + "start": "2021-04-08T07:15:13.000Z", + "end": "2021-04-10T02:00:00.000Z" + }, + "feature_image": { + "secure_url": "" + }, + "application": "000000000000000000000001", + "author": { + "name": "Fynd App" + } + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 2, + "has_next": true + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getDataLoaders +Get the data loaders associated with an application + + + + +```swift +content.getDataLoaders() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get all selected data loaders of the application in the form of tags. + +*Returned Response:* + + + + +[DataLoadersSchema](#DataLoadersSchema) + +Success. Returns a JSON object containing all the data loaders injected in the application. Check the example shown below or refer `DataLoadersSchema` for more details. + + + + +
    +  Example: + +```json +{ + "items": [ + { + "name": "Algolia", + "is_selected": false, + "type": "url", + "_id": "61bc4523a7ffc7504f4de4a5", + "service": "catalog", + "operation_id": "fetchSuggestions", + "url": "/ext/example/url" + }, + { + "name": "Algolia v3", + "is_selected": false, + "type": "url", + "_id": "61bc452da7ffc7504f4de4a7", + "service": "catalog", + "operation_id": "fetchSuggestions", + "url": "/ext/example/url" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getFaqs +Get a list of FAQs + + + + +```swift +content.getFaqs() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get a list of frequently asked questions. Users will benefit from it when facing any issue with the website. + +*Returned Response:* + + + + +[FaqResponseSchema](#FaqResponseSchema) + +Success. Returns a JSON object with question and answers. Check the example shown below or refer `FaqResponseSchema` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "faqs": [ + { + "_id": "5eb2db750a8ebf497e315028", + "question": "how to refer my friend", + "answer": "1. Click on refer and earn image in fynd app\n2. Click on share the code\n3. Use any method for sharing\n4. Once the user activates the app with your code, both of you will get the refereal credits.", + "slug": "how to refer", + "application": "000000000000000000000001" + } + ] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getFaqCategories +Get a list of FAQ categories + + + + +```swift +content.getFaqCategories() { (response, error) in + // Use response +} +``` + + + + + + +FAQs can be divided into categories. Use this API to get a list of FAQ categories. + +*Returned Response:* + + + + +[GetFaqCategoriesSchema](#GetFaqCategoriesSchema) + +Success. Returns a JSON object with categories of FAQ. Check the example shown below or refer `GetFaqCategoriesSchema` for more details. + + + + +
    +  Example: + +```json +{ + "categories": [ + { + "index": 0, + "children": [ + "6026426ae507768b168dee4b" + ], + "title": "Test", + "_id": "60263f80c83c1f89f2863a8a", + "slug": "test", + "application": "000000000000000000000001" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getFaqBySlug +Get an FAQ + + + + +```swift +content.getFaqBySlug(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of an FAQ. You can get slug value from the endpoint /service/application/content/v1.0/faq. | + + + +Use this API to get a particular FAQ by its slug. + +*Returned Response:* + + + + +[FaqSchema](#FaqSchema) + +Success. Returns a question and answer by its slug. Check the example shown below or refer `FaqSchema` for more details. + + + + +
    +  Example: + +```json +{ + "_id": "5eb2db750a8ebf497e315028", + "question": "how to refer my friend", + "answer": "1. Click on refer and earn image in fynd app\n2. Click on share the code\n3. Use any method for sharing\n4. Once the user activates the app with your code, both of you will get the refereal credits.", + "slug": "how to refer", + "application": "000000000000000000000001" +} +``` +
    + + + + + + + + + +--- + + +#### getFaqCategoryBySlug +Get the FAQ category + + + + +```swift +content.getFaqCategoryBySlug(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of an FAQ category. You can get slug value from the endpoint /service/application/content/v1.0/faq/categories. | + + + +FAQs can be divided into categories. Use this API to get the category to which an FAQ belongs. + +*Returned Response:* + + + + +[GetFaqCategoryBySlugSchema](#GetFaqCategoryBySlugSchema) + +Success. Returns a FAQ category with its slug. Check the example shown below or refer `GetFaqCategoryBySlugSchema` for more details. + + + + +
    +  Example: + +```json +{ + "category": { + "index": 0, + "children": [ + { + "_id": "6026426ae507768b168dee4b", + "question": "question 1", + "answer": "answer 1", + "slug": "question-1", + "application": "000000000000000000000001" + } + ], + "_id": "60263f80c83c1f89f2863a8a", + "slug": "test", + "title": "Test", + "application": "000000000000000000000001" + } +} +``` +
    + + + + + + + + + +--- + + +#### getFaqsByCategorySlug +Get FAQs using the slug of FAQ category + + + + +```swift +content.getFaqsByCategorySlug(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of an FAQ category. You can get slug value from the endpoint /service/application/content/v1.0/faq/categories. | + + + +FAQs can be divided into categories. Use this API to get all the FAQs belonging to a category by using the category slug. + +*Returned Response:* + + + + +[GetFaqSchema](#GetFaqSchema) + +Success. Returns a categorized list of question and answers using its slug. Check the example shown below or refer `GetFaqSchema` for more details. + + + + +
    +  Example: + +```json +{ + "faqs": [ + { + "_id": "60265b64e507768b168dee4d", + "question": "question 1", + "answer": "answer 1", + "slug": "question-1", + "application": "000000000000000000000001" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getLandingPage +Get the landing page + + + + +```swift +content.getLandingPage() { (response, error) in + // Use response +} +``` + + + + + + +Landing page is the first page that a prospect lands upon while visiting a website. Use this API to fetch the details of a landing page. + +*Returned Response:* + + + + +[LandingPageSchema](#LandingPageSchema) + +Success. Returns the landing page details. Check the example shown below or refer `LandingPageSchema` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "_id": "5eaa451a21a4dd75f0fd96c5", + "application": "5d3ebd89f540e7506b8b3548", + "_custom_json": null, + "slug": "pnc-landing", + "action": { + "page": { + "type": "home" + }, + "popup": {}, + "type": "page" + }, + "platform": [ + "web" + ], + "created_by": { + "id": "000000000000000000000000" + }, + "date_meta": { + "created_on": "2020-04-30T03:25:14.549Z", + "modified_on": "2020-04-30T03:25:14.549Z" + }, + "archived": false + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getLegalInformation +Get legal information + + + + +```swift +content.getLegalInformation() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get the legal information of an application, which includes Privacy Policy, Terms and Conditions, Shipping Policy and FAQs regarding the usage of the application. + +*Returned Response:* + + + + +[ApplicationLegal](#ApplicationLegal) + +Success. Returns the T&C, Shipping Policy, Privacy Policy and Return Policy. Check the example shown below or refer `ApplicationLegal` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "tnc": "TERMS AND CONDITIONS FOR RECURRING PAYMENTS ON FYND PLATFORM\n\nUpdated On: July 11, 2020\n\nWhen you purchase (“**Services**”) from Fynd Platform (“**Fynd Platform**”, “**We**” or “**Us**”), you have the option to make payments on a recurring basis (“**Recurring Payments**”) on the (“**Terms and Conditions**”) below for your monthly usage charges towards the services provided to you under the account you operate with Fynd Platform (“**Account**”). We may, at our sole discretion, refuse Recurring Payments to anyone without notice for any reason at any time. \n\n\n1. **Recurring Payments** - You are not required to make Recurring Payments, and you may cancel Recurring Payments for your Account at your discretion. We will make Recurring Payments available to you only if you have designated an eligible payment method for your Account that is current, valid and otherwise acceptable to us. Such a method is hereinafter referred to as \"Payment Method\". We reserve the right to decide the payment methods eligible for Recurring Payments and we will automatically charge your Payment Method. You are solely responsible for the accuracy of the information you provide us regarding your Payment Method. We may limit the amount that you can pay using Recurring Payments every month.\n\n2. **Enabling Recurring Payments**- You agree that Recurring Payments will be enabled automatically for your Account if you chose an eligible Payment Method. Once Recurring Payments have been enabled for your Account, you authorize us to use your Payment Method to pay for your monthly invoices automatically until you cancel Recurring Payments for your Account. In Addition, once Recurring Payments has been enabled, you authorize us to charge the fees for the Services, unless you cancel or disable Recurring Payment, by means specified by us and applicable at such time, in which case you will be required to take action and pay for the Services.\n\n3. **Verification and Authentication**- Before Recurring Payments are enabled for your Fynd Platform Account, verification and authentication of your Payment Method will be performed. Once the verification and authentication are successful, you will be registered for Recurring Payments. This verification and authentication may also be repeated if (a) there are changes to your Account or Payment Method; (b) you cancel or disable Recurring Payments; (c) one of your Recurring Payments is declined for any reason whatsoever, including without limitation, expiry of your card.\n\n4. **Third Party Payment Processors** - You agree, understand and acknowledge that Fynd Platform may engage third party payment processors or gateway service providers to process Recurring Payments. Therefore, you may be required to agree to the terms and conditions of the third party payment processors or gateway service providers as communicated to you from time to time.\n\n5. **Cancelling Recurring Payments** - You have the right to cancel Recurring Payments for your Fynd Platform Account by contacting our customer support.\n\n6. **Notifications** - You authorize us to communicate with you by email regarding Recurring Payments. You acknowledge that we may also communicate with you through our affiliates that provide Services to you.\n\n7. **Disclaimer of Liability** - You agree that we will not be liable for any losses or damages suffered by you because of your use of Recurring Payments for your Fynd Platform Account, including any fraud in connection with any payment using your Payment Method. You realize that neither Fynd Platform nor Shopsense Retail Technologies Pvt. Ltd. which fully owns and controls the Fynd Platform, will be held responsible for any damages, whether partial or full.\n\n\n8. **Agreement Changes** - We may in our discretion change these Terms and Conditions at any time. If any change is found to be invalid, void, or for any reason unenforceable, that change is severable and does not affect the validity and enforceability of any other changes or the remainder of these Terms and Conditions.\n\nYOUR CONTINUED USE OF RECURRING PAYMENTS FOR YOUR FYND PLATFORM ACCOUNT AFTER WE CHANGE THESE TERMS AND CONDITIONS CONSTITUTES YOUR ACCEPTANCE OF THESE CHANGES.", + "policy": "**Privacy policy test**", + "shipping": "**Shipping term and conditions**", + "returns": "**Terms & conditions for returns **", + "_id": "5e8b2b96abe7dc94c02c9ac9", + "application": "000000000000000000000001", + "faq": [ + { + "question": "New Question", + "answer": "New Answer" + }, + { + "question": "New", + "answer": "sdfghjhg" + }, + { + "question": "test", + "answer": "test" + }, + { + "question": "New Test", + "answer": "New Test answer" + }, + { + "question": "test", + "answer": "test" + } + ], + "created_at": "2020-04-06T13:16:06.818Z", + "updated_at": "2020-07-16T09:47:40.751Z", + "__v": 260 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getNavigations +Get the navigation + + + + +```swift +content.getNavigations(pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | +| pageSize | Int? | no | The number of items to retrieve in each page. | + + + +Use this API to fetch the navigations details which includes the items of the navigation pane. It also shows the links and sub-navigations. + +*Returned Response:* + + + + +[NavigationGetResponse](#NavigationGetResponse) + +Success. Returns a JSON object with navigation details. Check the example shown below or refer `NavigationGetResponse` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "_id": "5ffbd9b90ac98678ae0458d7", + "application": "000000000000000000000001", + "_custom_json": null, + "name": "temp", + "slug": "temp", + "platform": "web", + "position": "top", + "orientation": "landscape", + "navigation": [ + { + "display": "Home", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/mystore-tab_y0dqzt.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/", + "type": "home" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + }, + "sub_navigation": [ + { + "display": "Brands", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/brands-tab_sfinpk.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/brands/", + "type": "brands" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + } + } + ] + }, + { + "display": "Collections", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/collections-tab_a0tg9c.png", + "sort_order": 2, + "type": "", + "action": { + "page": { + "url": "/collections/", + "type": "collections" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + }, + "sub_navigation": [ + { + "display": "Categories", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148154/production/system/icons/categories-tab_ss8e0q.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/categories/", + "type": "categories" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + } + } + ] + }, + { + "display": "Primary Menu", + "image": "", + "sort_order": 3, + "type": "", + "action": { + "page": { + "type": "home" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + } + } + ], + "created_by": { + "id": "000000000000000000000000" + }, + "date_meta": { + "created_on": "2021-01-11T04:53:13.585Z", + "modified_on": "2021-01-14T10:24:34.485Z" + } + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 2, + "has_next": true + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getSEOConfiguration +Get the SEO of an application + + + + +```swift +content.getSEOConfiguration() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get the SEO details of an application, which includes a robot.txt, meta-tags and sitemap. + +*Returned Response:* + + + + +[SeoComponent](#SeoComponent) + +Success. Returns a JSON object SEO details such as robots.txt, meta-tags, and sitemap. Check the example shown below or refer `SeoComponent` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "seo": { + "details": { + "title": "Zyosa Zyosa" + }, + "robots_txt": "User-agent: * \nAllow: / \nsancisciasn xwsaixjowqnxwsiwjs", + "sitemap_enabled": false, + "_id": "6009819ee463ad40de397eb2", + "app": "000000000000000000000001", + "created_at": "2021-01-21T13:29:02.543Z", + "updated_at": "2021-02-05T06:36:16.048Z", + "__v": 11, + "custom_meta_tags": [ + { + "name": "test 0000", + "content": "", + "_id": "6017c301bde3c21dbb13b284" + }, + { + "name": "cwdcdc", + "content": "", + "_id": "6017c675bde3c22cfb13b290" + } + ] + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getSlideshows +Get the slideshows + + + + +```swift +content.getSlideshows(pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | +| pageSize | Int? | no | The number of items to retrieve in each page. | + + + +Use this API to get a list of slideshows along with their details. + +*Returned Response:* + + + + +[SlideshowGetResponse](#SlideshowGetResponse) + +Success. Check the example shown below or refer `SlideshowGetResponse` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "date_meta": { + "created_on": "2021-03-14T05:27:12.319Z", + "modified_on": "2021-03-14T05:27:12.319Z" + }, + "archived": false, + "_id": "604d9eb975e9d136bb1b8b83", + "configuration": { + "start_on_launch": false, + "duration": 50, + "sleep_time": 100, + "slide_direction": "horizontal" + }, + "slug": "ss-sfsd-updated", + "platform": "ios", + "media": [ + { + "auto_decide_duration": false, + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/brands-tab_sfinpk.png", + "bg_color": "#ffffff", + "duration": 10, + "action": { + "type": "" + } + }, + { + "auto_decide_duration": true, + "type": "youtube", + "url": "https://www.youtube.com/embed/9vJRopau0g0", + "bg_color": "#ffffff", + "duration": 909, + "action": { + "type": "" + } + } + ], + "application": "5cd3db5e9d692cfe5302a7bb", + "active": true, + "__v": 0 + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 2, + "has_next": true + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getSlideshow +Get a slideshow + + + + +```swift +content.getSlideshow(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a slideshow. You can get slug value from the endpoint /service/application/content/v1.0/slideshow/. | + + + +A slideshow is a group of images, videos or a combination of both that are shown on the website in the form of slides. Use this API to fetch a slideshow using its `slug`. + +*Returned Response:* + + + + +[SlideshowSchema](#SlideshowSchema) + +Success. Returns the details of how a slideshow is configured. Check the example shown below or refer `SlideshowSchema` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "date_meta": { + "created_on": "2021-03-14T05:27:12.319Z", + "modified_on": "2021-03-14T05:27:12.319Z" + }, + "archived": false, + "_id": "604d9eb975e9d136bb1b8b83", + "configuration": { + "start_on_launch": false, + "duration": 50, + "sleep_time": 100, + "slide_direction": "horizontal" + }, + "slug": "ss-sfsd-updated", + "platform": "ios", + "media": [ + { + "auto_decide_duration": false, + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/brands-tab_sfinpk.png", + "bg_color": "#ffffff", + "duration": 10, + "action": { + "type": "" + } + }, + { + "auto_decide_duration": true, + "type": "youtube", + "url": "https://www.youtube.com/embed/9vJRopau0g0", + "bg_color": "#ffffff", + "duration": 909, + "action": { + "type": "" + } + } + ], + "application": "5cd3db5e9d692cfe5302a7bb", + "active": true + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getSupportInformation +Get the support information + + + + +```swift +content.getSupportInformation() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get contact details for customer support including emails and phone numbers. + +*Returned Response:* + + + + +[Support](#Support) + +Success. Returns all support information including email and phone number. Check the example shown below or refer `Support` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "_id": "5ea4980b87a7944094216193", + "config_type": "app", + "application": "000000000000000000000001", + "created_at": "2020-04-25T20:05:31.300Z", + "updated_at": "2020-12-04T10:48:12.194Z", + "contact": { + "phone": { + "active": true, + "phone": [ + { + "key": "Jane Doe", + "code": "91", + "number": "9988776655" + } + ] + }, + "email": { + "active": false, + "email": [] + } + }, + "created": true + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getTags +Get the tags associated with an application + + + + +```swift +content.getTags() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get all the CSS and JS injected in the application in the form of tags. + +*Returned Response:* + + + + +[TagsSchema](#TagsSchema) + +Success. Returns a JSON object containing all the tags injected in the application. Check the example shown below or refer `TagsSchema` for more details. + + + + +
    +  Example: + +```json +{ + "application": "000000000000000000000001", + "_id": "5f7c37b2dd0144bb3a353c5f", + "tags": [ + { + "name": "Tapfiliate JS", + "sub_type": "external", + "_id": "5f7c37b2dd0144f1f8353c60", + "type": "js", + "url": "https://script.tapfiliate.com/tapfiliate.js", + "position": "body-bottom", + "attributes": { + "async": true + } + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getPage +Get a page + + + + +```swift +content.getPage(slug: slug, rootId: rootId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a page. You can get slug value from the endpoint /service/application/content/v2.0/pages/. | +| rootId | String? | no | ID given to the HTML element | + + + +Use this API to get the details of a page using its slug. Details include the title, seo, publish status, feature image, tags, meta, etc. + +*Returned Response:* + + + + +[PageSchema](#PageSchema) + +Success. Returns a JSON object with page details. Check the example shown below or refer `CustomPageSchema` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "date_meta": { + "created_on": "2021-03-16T08:24:19.197Z", + "modified_on": "2021-03-16T08:24:19.197Z" + }, + "tags": [ + "my first page" + ], + "published": true, + "component_ids": [], + "archived": false, + "_id": "60506dcad18cb33946026862", + "title": "my first page", + "slug": "1st_page", + "feature_image": { + "secure_url": "https://google.com/some-image" + }, + "content_path": "https://hdn-1.fynd.com/company/1526/applications/61012f6a9250ccd1b9ef8a1d/pages/content/page_slug.html", + "platform": "web", + "description": "hey this is my first page", + "visibility": { + "test": true + }, + "_schedule": { + "start": "2021-04-23T23:50:00.000Z", + "next_schedule": [ + {} + ] + }, + "seo": { + "title": "my first page", + "description": "hey this is my first page", + "image": { + "url": "" + } + }, + "type": "rawhtml", + "application": "000000000000000000000001", + "orientation": "portrait", + "page_meta": [] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getPages +Get all pages + + + + +```swift +content.getPages(pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | +| pageSize | Int? | no | The number of items to retrieve in each page. | + + + +Use this API to get a list of pages. + +*Returned Response:* + + + + +[PageGetResponse](#PageGetResponse) + +Success. Returns a list of pages along with their details. Check the example shown below or refer `PageGetStorefrontResponse` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "date_meta": { + "created_on": "2021-03-14T06:49:03.945Z", + "modified_on": "2021-03-14T06:49:03.945Z" + }, + "tags": [ + "my first page" + ], + "_id": "604db275b3ae202873964d94", + "content_path": "https://hdn-1.fynd.com/company/1526/applications/61012f6a9250ccd1b9ef8a1d/pages/content/page_slug.html", + "title": "test-page", + "slug": "test-page", + "published": true, + "_schedule": { + "next_schedule": [ + {} + ], + "start": "2021-04-08T07:15:13.000Z", + "end": "2021-04-10T02:00:00.000Z" + }, + "feature_image": { + "secure_url": "https://google.com/some-image" + }, + "seo": { + "title": "my first page", + "description": "hey this is my first page", + "image": { + "url": "" + } + }, + "application": "000000000000000000000001", + "author": { + "name": "Abhinav Maurya" + } + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 2, + "has_next": true + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [ApplicationLegal](#ApplicationLegal) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | String? | yes | | + | tnc | String? | yes | | + | policy | String? | yes | | + | shipping | String? | yes | | + | faq | [[ApplicationLegalFAQ](#ApplicationLegalFAQ)]? | yes | | + | id | String? | yes | | + | updatedAt | String? | yes | | + | createdAt | String? | yes | | + +--- + + + + + #### [ApplicationLegalFAQ](#ApplicationLegalFAQ) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | question | String? | yes | | + | answer | String? | yes | | + +--- + + + + + #### [PathMappingSchema](#PathMappingSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | String? | yes | | + | redirections | [[RedirectionSchema](#RedirectionSchema)]? | yes | | + | id | String? | yes | | + | updatedAt | String? | yes | | + | createdAt | String? | yes | | + +--- + + + + + #### [RedirectionSchema](#RedirectionSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | redirectFrom | String? | yes | | + | redirectTo | String? | yes | | + +--- + + + + + #### [SeoComponent](#SeoComponent) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | seo | [SeoSchema](#SeoSchema)? | yes | | + +--- + + + + + #### [SeoSchema](#SeoSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | app | String? | yes | | + | id | String? | yes | | + | robotsTxt | String? | yes | | + | sitemapEnabled | Bool? | yes | | + | customMetaTags | [[CustomMetaTag](#CustomMetaTag)]? | yes | | + | details | [Detail](#Detail)? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + +--- + + + + + #### [CustomMetaTag](#CustomMetaTag) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | content | String? | yes | | + | id | String? | yes | | + +--- + + + + + #### [Detail](#Detail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | description | String? | yes | | + +--- + + + + + #### [AnnouncementPageSchema](#AnnouncementPageSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pageSlug | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [EditorMeta](#EditorMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | foregroundColor | String? | yes | | + | backgroundColor | String? | yes | | + | contentType | String? | yes | | + | content | String? | yes | | + +--- + + + + + #### [AnnouncementAuthorSchema](#AnnouncementAuthorSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | createdBy | String? | yes | | + | modifiedBy | String? | yes | | + +--- + + + + + #### [AdminAnnouncementSchema](#AdminAnnouncementSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | platforms | [String]? | yes | | + | title | String? | yes | | + | announcement | String? | yes | | + | pages | [[AnnouncementPageSchema](#AnnouncementPageSchema)]? | yes | | + | editorMeta | [EditorMeta](#EditorMeta)? | yes | | + | author | [AnnouncementAuthorSchema](#AnnouncementAuthorSchema)? | yes | | + | createdAt | String? | yes | | + | app | String? | yes | | + | modifiedAt | String? | yes | | + | schedule | [ScheduleSchema](#ScheduleSchema)? | yes | | + +--- + + + + + #### [ScheduleSchema](#ScheduleSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cron | String? | yes | | + | start | String? | yes | | + | end | String? | yes | | + | duration | Double? | yes | | + | nextSchedule | [[NextSchedule](#NextSchedule)]? | yes | | + +--- + + + + + #### [NextSchedule](#NextSchedule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | start | String? | yes | | + | end | String? | yes | | + +--- + + + + + #### [AnnouncementSchema](#AnnouncementSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | announcement | String? | yes | | + | schedule | [ScheduleStartSchema](#ScheduleStartSchema)? | yes | | + +--- + + + + + #### [ScheduleStartSchema](#ScheduleStartSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | start | String? | yes | | + | end | String? | yes | | + +--- + + + + + #### [BlogGetResponse](#BlogGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[BlogSchema](#BlogSchema)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [ResourceContent](#ResourceContent) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [Asset](#Asset) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | aspectRatio | String? | yes | | + | id | String? | yes | | + | secureUrl | String? | yes | | + +--- + + + + + #### [Author](#Author) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | designation | String? | yes | | + | id | String? | yes | | + | name | String? | yes | | + +--- + + + + + #### [BlogSchema](#BlogSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | customJson | [String: Any]? | yes | | + | application | String? | yes | | + | archived | Bool? | yes | | + | author | [Author](#Author)? | yes | | + | content | [[ResourceContent](#ResourceContent)]? | yes | | + | featureImage | [Asset](#Asset)? | yes | | + | published | Bool? | yes | | + | readingTime | String? | yes | | + | slug | String? | yes | | + | tags | [String]? | yes | | + | seo | [SEO](#SEO)? | yes | | + | schedule | [CronSchedule](#CronSchedule)? | yes | | + | title | String? | yes | | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + +--- + + + + + #### [SEO](#SEO) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String? | yes | | + | image | [SEOImage](#SEOImage)? | yes | | + | title | String? | yes | | + +--- + + + + + #### [SEOImage](#SEOImage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | url | String? | yes | | + +--- + + + + + #### [DateMeta](#DateMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | createdOn | String? | yes | | + | modifiedOn | String? | yes | | + +--- + + + + + #### [BlogRequest](#BlogRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | String? | yes | | + | customJson | [String: Any]? | yes | | + | author | [Author](#Author)? | yes | | + | content | [[ResourceContent](#ResourceContent)]? | yes | | + | featureImage | [Asset](#Asset)? | yes | | + | published | Bool? | yes | | + | readingTime | String? | yes | | + | slug | String? | yes | | + | tags | [String]? | yes | | + | title | String? | yes | | + | seo | [SEO](#SEO)? | yes | | + | schedule | [CronSchedule](#CronSchedule)? | yes | | + +--- + + + + + #### [GetAnnouncementListSchema](#GetAnnouncementListSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[AdminAnnouncementSchema](#AdminAnnouncementSchema)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [CreateAnnouncementSchema](#CreateAnnouncementSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + | data | [AdminAnnouncementSchema](#AdminAnnouncementSchema)? | yes | | + +--- + + + + + #### [DataLoaderResponseSchema](#DataLoaderResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | String? | yes | | + | company | String? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | service | String? | yes | | + | operationId | String? | yes | | + | type | String? | yes | | + | url | String? | yes | | + | content | String? | yes | | + | source | [DataLoaderSourceSchema](#DataLoaderSourceSchema)? | yes | | + +--- + + + + + #### [DataLoaderResetResponseSchema](#DataLoaderResetResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | reset | String? | yes | | + +--- + + + + + #### [Navigation](#Navigation) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | slug | String? | yes | | + | orientation | String? | yes | | + | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | id | String? | yes | | + | position | String? | yes | | + | application | String? | yes | | + | platform | String? | yes | | + | navigation | [NavigationReference](#NavigationReference)? | yes | | + +--- + + + + + #### [LocaleLanguage](#LocaleLanguage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | hi | [Language](#Language)? | yes | | + | ar | [Language](#Language)? | yes | | + | enUs | [Language](#Language)? | yes | | + +--- + + + + + #### [Language](#Language) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | display | String? | yes | | + +--- + + + + + #### [Action](#Action) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [ActionPage](#ActionPage)? | yes | | + | popup | [ActionPage](#ActionPage)? | yes | | + | type | String? | yes | | + +--- + + + + + #### [ActionPage](#ActionPage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | params | [String: [String]]? | yes | | + | query | [String: [String]]? | yes | | + | url | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [NavigationReference](#NavigationReference) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | acl | [String]? | yes | | + | tags | [String]? | yes | | + | localeLanguage | [LocaleLanguage](#LocaleLanguage)? | yes | | + | image | String? | yes | | + | type | String? | yes | | + | action | [Action](#Action)? | yes | | + | active | Bool? | yes | | + | display | String? | yes | | + | sortOrder | Int? | yes | | + | subNavigation | [[NavigationReference](#NavigationReference)]? | yes | | + +--- + + + + + #### [LandingPage](#LandingPage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [LandingPageSchema](#LandingPageSchema)? | yes | | + | success | Bool? | yes | | + +--- + + + + + #### [ConfigurationSchema](#ConfigurationSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | sleepTime | Int? | yes | | + | startOnLaunch | Bool? | yes | | + | duration | Int? | yes | | + | slideDirection | String? | yes | | + +--- + + + + + #### [SlideshowMedia](#SlideshowMedia) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | url | String? | yes | | + | bgColor | String? | yes | | + | duration | Int? | yes | | + | autoDecideDuration | Bool? | yes | | + | action | [Action](#Action)? | yes | | + +--- + + + + + #### [Slideshow](#Slideshow) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [SlideshowSchema](#SlideshowSchema)? | yes | | + | success | Bool? | yes | | + +--- + + + + + #### [AnnouncementsResponseSchema](#AnnouncementsResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | announcements | [String: [[AnnouncementSchema](#AnnouncementSchema)]]? | yes | | + | refreshRate | Int? | yes | number of seconds after which api should hit again to fetch new announcements | + | refreshPages | [String]? | yes | list of page slugs on which announcement should be fetched as soon as they are loaded | + +--- + + + + + #### [FaqResponseSchema](#FaqResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | faqs | [[FaqSchema](#FaqSchema)]? | yes | | + +--- + + + + + #### [UpdateHandpickedSchema](#UpdateHandpickedSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | tag | [HandpickedTagSchema](#HandpickedTagSchema)? | yes | | + +--- + + + + + #### [HandpickedTagSchema](#HandpickedTagSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | position | String? | yes | | + | attributes | [String: Any]? | yes | | + | name | String? | yes | | + | url | String? | yes | | + | type | String? | yes | | + | subType | String? | yes | | + | content | String? | yes | | + +--- + + + + + #### [RemoveHandpickedSchema](#RemoveHandpickedSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | tags | [String]? | yes | | + +--- + + + + + #### [CreateTagSchema](#CreateTagSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | subType | String? | yes | | + | id | String? | yes | | + | type | String? | yes | | + | url | String? | yes | | + | position | String? | yes | | + | attributes | [String: Any]? | yes | | + | content | String? | yes | | + +--- + + + + + #### [CreateTagRequestSchema](#CreateTagRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | tags | [[CreateTagSchema](#CreateTagSchema)]? | yes | | + +--- + + + + + #### [DataLoaderSchema](#DataLoaderSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | service | String? | yes | | + | operationId | String? | yes | | + | type | String? | yes | | + | url | String? | yes | | + | content | String? | yes | | + | source | [DataLoaderSourceSchema](#DataLoaderSourceSchema)? | yes | | + +--- + + + + + #### [DataLoaderSourceSchema](#DataLoaderSourceSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | id | String? | yes | | + +--- + + + + + #### [DataLoadersSchema](#DataLoadersSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[DataLoaderSchema](#DataLoaderSchema)]? | yes | | + +--- + + + + + #### [TagDeleteSuccessResponse](#TagDeleteSuccessResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | | + +--- + + + + + #### [ContentAPIError](#ContentAPIError) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + | status | Double? | yes | | + | code | String? | yes | | + | exception | String? | yes | | + | info | String? | yes | | + | requestId | String? | yes | | + | stackTrace | String? | yes | | + | meta | [String: Any]? | yes | | + +--- + + + + + #### [CategorySchema](#CategorySchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | index | Int? | yes | | + | title | String? | yes | | + | description | String? | yes | | + | children | [String]? | yes | | + | id | String? | yes | | + | slug | String? | yes | | + | application | String? | yes | | + | iconUrl | String? | yes | | + | customJson | [String: Any]? | yes | | + +--- + + + + + #### [ChildrenSchema](#ChildrenSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | question | String? | yes | | + | answer | String? | yes | | + | slug | String? | yes | | + | application | String? | yes | | + | id | String? | yes | | + +--- + + + + + #### [CategoryRequestSchema](#CategoryRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String? | yes | | + | title | String? | yes | | + +--- + + + + + #### [FAQCategorySchema](#FAQCategorySchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | index | Int? | yes | | + | title | String? | yes | | + | description | String? | yes | | + | children | [[ChildrenSchema](#ChildrenSchema)]? | yes | | + | id | String? | yes | | + | slug | String? | yes | | + | application | String? | yes | | + | iconUrl | String? | yes | | + | customJson | [String: Any]? | yes | | + +--- + + + + + #### [FaqSchema](#FaqSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String? | yes | | + | application | String? | yes | | + | id | String? | yes | | + | question | String? | yes | | + | answer | String? | yes | | + +--- + + + + + #### [FAQ](#FAQ) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String? | yes | | + | question | String? | yes | | + | answer | String? | yes | | + +--- + + + + + #### [CreateFaqResponseSchema](#CreateFaqResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | faq | [FaqSchema](#FaqSchema)? | yes | | + +--- + + + + + #### [CreateFaqSchema](#CreateFaqSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | faq | [FAQ](#FAQ)? | yes | | + +--- + + + + + #### [GetFaqSchema](#GetFaqSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | faqs | [[FaqSchema](#FaqSchema)]? | yes | | + +--- + + + + + #### [UpdateFaqCategoryRequestSchema](#UpdateFaqCategoryRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | category | [CategorySchema](#CategorySchema)? | yes | | + +--- + + + + + #### [CreateFaqCategoryRequestSchema](#CreateFaqCategoryRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | category | [CategoryRequestSchema](#CategoryRequestSchema)? | yes | | + +--- + + + + + #### [CreateFaqCategorySchema](#CreateFaqCategorySchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | category | [CategorySchema](#CategorySchema)? | yes | | + +--- + + + + + #### [GetFaqCategoriesSchema](#GetFaqCategoriesSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | categories | [[CategorySchema](#CategorySchema)]? | yes | | + +--- + + + + + #### [GetFaqCategoryBySlugSchema](#GetFaqCategoryBySlugSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | category | [FAQCategorySchema](#FAQCategorySchema)? | yes | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + | hasNext | Bool? | yes | | + | current | Int? | yes | | + | type | String | no | | + | size | Int? | yes | | + +--- + + + + + #### [LandingPageGetResponse](#LandingPageGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[LandingPageSchema](#LandingPageSchema)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [LandingPageSchema](#LandingPageSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String? | yes | | + | action | [Action](#Action)? | yes | | + | platform | [String]? | yes | | + | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | id | String? | yes | | + | application | String? | yes | | + | archived | Bool? | yes | | + | customJson | [String: Any]? | yes | | + +--- + + + + + #### [DefaultNavigationResponse](#DefaultNavigationResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[NavigationSchema](#NavigationSchema)]? | yes | | + +--- + + + + + #### [NavigationGetResponse](#NavigationGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[NavigationSchema](#NavigationSchema)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [Orientation](#Orientation) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | portrait | [String]? | yes | | + | landscape | [String]? | yes | | + +--- + + + + + #### [NavigationSchema](#NavigationSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | application | String? | yes | | + | archived | Bool? | yes | | + | name | String? | yes | | + | slug | String? | yes | | + | platform | [String]? | yes | | + | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | orientation | [Orientation](#Orientation)? | yes | | + | version | Double? | yes | | + | navigation | [[NavigationReference](#NavigationReference)]? | yes | | + +--- + + + + + #### [NavigationRequest](#NavigationRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | slug | String? | yes | | + | platform | [String]? | yes | | + | orientation | [Orientation](#Orientation)? | yes | | + | navigation | [[NavigationReference](#NavigationReference)]? | yes | | + +--- + + + + + #### [CustomPageSchema](#CustomPageSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | platform | String? | yes | | + | title | String? | yes | | + | slug | String? | yes | | + | type | String? | yes | | + | orientation | String? | yes | | + | application | String? | yes | | + | description | String? | yes | | + | published | Bool? | yes | | + | tags | [String]? | yes | | + | content | [[String: Any]]? | yes | | + | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | schedule | [ScheduleSchema](#ScheduleSchema)? | yes | | + +--- + + + + + #### [ContentSchema](#ContentSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | value | [String: Any]? | yes | | + +--- + + + + + #### [CustomPage](#CustomPage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [CustomPageSchema](#CustomPageSchema)? | yes | | + +--- + + + + + #### [FeatureImage](#FeatureImage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | secureUrl | String? | yes | | + +--- + + + + + #### [PageGetResponse](#PageGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[PageSchema](#PageSchema)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [PageSpec](#PageSpec) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | specifications | [[PageSpecItem](#PageSpecItem)]? | yes | | + +--- + + + + + #### [PageSpecParam](#PageSpecParam) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | required | Bool? | yes | | + +--- + + + + + #### [PageSpecItem](#PageSpecItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pageType | String? | yes | | + | displayName | String? | yes | | + | params | [[PageSpecParam](#PageSpecParam)]? | yes | | + | query | [[PageSpecParam](#PageSpecParam)]? | yes | | + +--- + + + + + #### [PageSchema](#PageSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | application | String? | yes | | + | componentIds | [String]? | yes | Components can be used to store multiple components | + | content | [[String: Any]]? | yes | | + | contentPath | String? | yes | | + | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | description | String? | yes | | + | featureImage | [Asset](#Asset)? | yes | | + | pageMeta | [[String: Any]]? | yes | | + | schedule | [ScheduleSchema](#ScheduleSchema)? | yes | | + | customJson | [String: Any]? | yes | | + | orientation | String? | yes | | + | platform | String? | yes | | + | published | Bool? | yes | | + | slug | String? | yes | | + | tags | [String]? | yes | | + | title | String? | yes | | + | type | String? | yes | | + | seo | [SEO](#SEO)? | yes | | + | visibility | [String: Any]? | yes | | + | archived | Bool? | yes | | + +--- + + + + + #### [CreatedBySchema](#CreatedBySchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + +--- + + + + + #### [PageContent](#PageContent) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | value | [String: Any]? | yes | | + +--- + + + + + #### [PageMeta](#PageMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | value | [String: Any]? | yes | | + +--- + + + + + #### [PageRequest](#PageRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | schedule | [CronSchedule](#CronSchedule)? | yes | | + | application | String? | yes | | + | author | [Author](#Author)? | yes | | + | customJson | [String: Any]? | yes | | + | orientation | String? | yes | | + | content | [[String: Any]]? | yes | | + | featureImage | [Asset](#Asset)? | yes | | + | published | Bool? | yes | | + | readingTime | String? | yes | | + | slug | String? | yes | | + | tags | [String]? | yes | | + | seo | [SEO](#SEO)? | yes | | + | title | String? | yes | | + +--- + + + + + #### [CronSchedule](#CronSchedule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cron | String? | yes | | + | start | String? | yes | | + | end | String? | yes | | + | duration | Double? | yes | | + +--- + + + + + #### [PagePublishRequest](#PagePublishRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | publish | Bool? | yes | | + +--- + + + + + #### [PageMetaSchema](#PageMetaSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | systemPages | [[NavigationSchema](#NavigationSchema)]? | yes | | + | customPages | [[PageSchema](#PageSchema)]? | yes | | + | applicationId | String? | yes | | + +--- + + + + + #### [SlideshowGetResponse](#SlideshowGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[SlideshowSchema](#SlideshowSchema)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [SlideshowSchema](#SlideshowSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | slug | String? | yes | | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | application | String? | yes | | + | platform | String? | yes | | + | configuration | [ConfigurationSchema](#ConfigurationSchema)? | yes | | + | media | [[SlideshowMedia](#SlideshowMedia)]? | yes | | + | active | Bool? | yes | | + | archived | Bool? | yes | | + | customJson | [String: Any]? | yes | | + +--- + + + + + #### [SlideshowRequest](#SlideshowRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String? | yes | | + | platform | String? | yes | | + | configuration | [ConfigurationSchema](#ConfigurationSchema)? | yes | | + | media | [SlideshowMedia](#SlideshowMedia)? | yes | | + | active | Bool? | yes | | + +--- + + + + + #### [Support](#Support) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | created | Bool? | yes | | + | id | String? | yes | | + | configType | String? | yes | | + | application | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | contact | [ContactSchema](#ContactSchema)? | yes | | + +--- + + + + + #### [PhoneProperties](#PhoneProperties) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | code | String? | yes | | + | number | String? | yes | | + +--- + + + + + #### [PhoneSchema](#PhoneSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | | + | phone | [[PhoneProperties](#PhoneProperties)]? | yes | | + +--- + + + + + #### [EmailProperties](#EmailProperties) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [EmailSchema](#EmailSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | | + | email | [[EmailProperties](#EmailProperties)]? | yes | | + +--- + + + + + #### [ContactSchema](#ContactSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | phone | [PhoneSchema](#PhoneSchema)? | yes | | + | email | [EmailSchema](#EmailSchema)? | yes | | + +--- + + + + + #### [TagsSchema](#TagsSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | String? | yes | | + | id | String? | yes | | + | tags | [[TagSchema](#TagSchema)]? | yes | | + +--- + + + + + #### [TagSchema](#TagSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | url | String? | yes | | + | type | String? | yes | | + | subType | String? | yes | | + | id | String? | yes | | + | position | String? | yes | | + | attributes | [String: Any]? | yes | | + | content | String? | yes | | + | source | [TagSourceSchema](#TagSourceSchema)? | yes | | + +--- + + + + + #### [TagSourceSchema](#TagSourceSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | id | String? | yes | | + +--- + + + + +### Enums + + + + + + #### [PageType](#PageType) + Type : string + + | Name | Value | Description | + | ---- | ----- | ----------- | + | aboutUs | about-us | Symbolic link for About Us: /about-us | + | addresses | addresses | Symbolic link for Saved Addresses: /profile/address | + | blog | blog | Symbolic link for Blog: /blog/:slug | + | brands | brands | Symbolic link for Brands: /brands/:department | + | cards | cards | Symbolic link for Saved Cards: /profile/my-cards | + | cart | cart | Symbolic link for Cart: /cart/bag/ | + | categories | categories | Symbolic link for Categories: /categories/:department | + | brand | brand | Symbolic link for Brand: /brand/:slug | + | category | category | Symbolic link for Category: /category/:slug | + | collection | collection | Symbolic link for Collection: /collection/:slug | + | collections | collections | Symbolic link for Collections: /collections/ | + | contactUs | contact-us | Symbolic link for Contact Us: /contact-us/ | + | externalLink | external | Symbolic link for External Link: /external/:url | + | faq | faq | Symbolic link for FAQ: /faq/:category | + | freshchat | freshchat | Symbolic link for Chat by Freshchat: /freshchat | + | home | home | Symbolic link for Home: / | + | notificationSettings | notification-settings | Symbolic link for Notification Settings: /notification-settings | + | orders | orders | Symbolic link for Orders: /profile/orders | + | page | page | Symbolic link for Page: /page/:slug | + | policy | policy | Symbolic link for Privacy Policy: /privacy-policy | + | product | product | Symbolic link for Product: /product/:slug | + | productReviews | product-reviews | Symbolic link for Product Reviews: /product/:slug/reviews | + | addProductReview | add-product-review | Symbolic link for Add Product review: /product/:slug/add-review | + | productRequest | product-request | Symbolic link for Product Request: /product-request/ | + | products | products | Symbolic link for Products: /products/ | + | profile | profile | Symbolic link for Profile: /profile | + | profileBasic | profile-basic | Symbolic link for Basic Profile: /profile/details | + | profileCompany | profile-company | Symbolic link for Profile Company: /profile/company | + | profileEmails | profile-emails | Symbolic link for Profile Emails: /profile/email | + | profilePhones | profile-phones | Symbolic link for Profile Phones: /profile/phone | + | rateUs | rate-us | Symbolic link for Rate Us: /rate-us | + | referEarn | refer-earn | Symbolic link for Refer & Earn: /profile/refer-earn | + | settings | settings | Symbolic link for Settings: /setting/currency | + | sharedCart | shared-cart | Symbolic link for Shared Cart: /shared-cart/:token | + | tnc | tnc | Symbolic link for Terms and Conditions: /terms-and-conditions | + | trackOrder | track-order | Symbolic link for Track Order: /order-tracking/:orderId | + | wishlist | wishlist | Symbolic link for Wishlist: /wishlist/ | + | sections | sections | Symbolic link for Sections: /sections/:group | + | form | form | Symbolic link for Form: /form/:slug | + | cartDelivery | cart-delivery | Symbolic link for Cart Delivery: /cart/delivery | + | cartPayment | cart-payment | Symbolic link for Cart Payment Information: /cart/payment-info | + | cartReview | cart-review | Symbolic link for Cart Order Review: /cart/order-review | + +--- + + + + + diff --git a/documentation/application/FEEDBACK.md b/documentation/application/FEEDBACK.md new file mode 100644 index 0000000000..1f5bf35f4c --- /dev/null +++ b/documentation/application/FEEDBACK.md @@ -0,0 +1,2582 @@ + + + + +##### [Back to Application docs](./README.md) + +## Feedback Methods +User Reviews and Rating System +* [createAbuseReport](#createabusereport) +* [updateAbuseReport](#updateabusereport) +* [getAbuseReports](#getabusereports) +* [getAttributes](#getattributes) +* [createAttribute](#createattribute) +* [getAttribute](#getattribute) +* [updateAttribute](#updateattribute) +* [createComment](#createcomment) +* [updateComment](#updatecomment) +* [getComments](#getcomments) +* [checkEligibility](#checkeligibility) +* [deleteMedia](#deletemedia) +* [createMedia](#createmedia) +* [updateMedia](#updatemedia) +* [getMedias](#getmedias) +* [getReviewSummaries](#getreviewsummaries) +* [createReview](#createreview) +* [updateReview](#updatereview) +* [getReviews](#getreviews) +* [getTemplates](#gettemplates) +* [createQuestion](#createquestion) +* [updateQuestion](#updatequestion) +* [getQuestionAndAnswers](#getquestionandanswers) +* [getVotes](#getvotes) +* [createVote](#createvote) +* [updateVote](#updatevote) + + + +## Methods with example and description + + +#### createAbuseReport +Post a new abuse request + + + + +```swift +feedback.createAbuseReport(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | ReportAbuseRequest | yes | Request body | + + +Use this API to report a specific entity (question/review/comment) for abuse. + +*Returned Response:* + + + + +[InsertResponse](#InsertResponse) + +Success. Returns an abuse ID. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updateAbuseReport +Update abuse details + + + + +```swift +feedback.updateAbuseReport(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | UpdateAbuseStatusRequest | yes | Request body | + + +Use this API to update the abuse details, i.e. status and description. + +*Returned Response:* + + + + +[UpdateResponse](#UpdateResponse) + +Success. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getAbuseReports +Get a list of abuse data + + + + +```swift +feedback.getAbuseReports(entityId: entityId, entityType: entityType, id: id, pageId: pageId, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| entityId | String | yes | ID of the eligible entity as specified in the entity type (question ID/review ID/comment ID). | +| entityType | String | yes | Type of entity, e.g. question, review or comment. | +| id | String? | no | abuse id | +| pageId | String? | no | Pagination page ID to retrieve next set of results. | +| pageSize | Int? | no | The number of items to retrieve in each page. | + + + +Use this API to retrieve a list of abuse data from entity type and entity ID. + +*Returned Response:* + + + + +[ReportAbuseGetResponse](#ReportAbuseGetResponse) + +Success. Check the example shown below or refer `ReportAbuseGetResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getAttributes +Get a list of attribute data + + + + +```swift +feedback.getAttributes(pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | +| pageSize | Int? | no | The number of items to retrieve in each page. | + + + +Use this API to retrieve a list of all attribute data, e.g. quality, material, product fitting, packaging, etc. + +*Returned Response:* + + + + +[AttributeResponse](#AttributeResponse) + +Success. Check the example shown below or refer `AttributeResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### createAttribute +Add a new attribute request + + + + +```swift +feedback.createAttribute(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | SaveAttributeRequest | yes | Request body | + + +Use this API to add a new attribute (e.g. product quality/material/value for money) with its name, slug and description. + +*Returned Response:* + + + + +[InsertResponse](#InsertResponse) + +Success. Returns an attribute ID. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getAttribute +Get data of a single attribute + + + + +```swift +feedback.getAttribute(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of an attribute. You can get slug value from the endpoint 'service/application/feedback/v1.0/attributes'. | + + + +Use this API to retrieve a single attribute data from a given slug. + +*Returned Response:* + + + + +[Attribute](#Attribute) + +Success. Check the example shown below or refer `Attribute` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updateAttribute +Update details of an attribute + + + + +```swift +feedback.updateAttribute(slug: slug, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of an attribute. You can get slug value from the endpoint 'service/application/feedback/v1.0/attributes'. | +| body | UpdateAttributeRequest | yes | Request body | + + +Use this API update the attribute's name and description. + +*Returned Response:* + + + + +[UpdateResponse](#UpdateResponse) + +Success. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### createComment +Post a new comment + + + + +```swift +feedback.createComment(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CommentRequest | yes | Request body | + + +Use this API to add a new comment for a specific entity. + +*Returned Response:* + + + + +[InsertResponse](#InsertResponse) + +Success. Returns a comment ID. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updateComment +Update the status of a comment + + + + +```swift +feedback.updateComment(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | UpdateCommentRequest | yes | Request body | + + +Use this API to update the comment status (active or approve) along with new comment if any. + +*Returned Response:* + + + + +[UpdateResponse](#UpdateResponse) + +Success. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getComments +Get a list of comments + + + + +```swift +feedback.getComments(entityType: entityType, id: id, entityId: entityId, userId: userId, pageId: pageId, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| entityType | String | yes | Type of entity, e.g. question, review or comment. | +| id | String? | no | Comment ID | +| entityId | String? | no | ID of the eligible entity as specified in the entity type (question ID/review ID/comment ID). | +| userId | String? | no | User ID - a flag/filter to get comments for a user. | +| pageId | String? | no | Pagination page ID to retrieve next set of results. | +| pageSize | Int? | no | The number of items to retrieve in each page. | + + + +Use this API to retrieve a list of comments for a specific entity type, e.g. products. + +*Returned Response:* + + + + +[CommentGetResponse](#CommentGetResponse) + +Success. Check the example shown below or refer `CommentGetResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### checkEligibility +Checks eligibility to rate and review, and shows the cloud media configuration + + + + +```swift +feedback.checkEligibility(entityType: entityType, entityId: entityId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| entityType | String | yes | Type of entity, e.g. question, rate, review, answer, or comment. | +| entityId | String | yes | ID of the eligible entity as specified in the entity type. | + + + +Use this API to check whether an entity is eligible to be rated and reviewed. Moreover, it shows the cloud media configuration too. + +*Returned Response:* + + + + +[CheckEligibilityResponse](#CheckEligibilityResponse) + +Success. Returns a Product object. Check the example shown below or refer `CheckEligibilityResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### deleteMedia +Delete Media + + + + +```swift +feedback.deleteMedia(ids: ids) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| ids | [String] | yes | List of media ID | + + + +Use this API to delete media for an entity ID. + +*Returned Response:* + + + + +[UpdateResponse](#UpdateResponse) + +Success. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### createMedia +Add Media + + + + +```swift +feedback.createMedia(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | AddMediaListRequest | yes | Request body | + + +Use this API to add media to an entity, e.g. review. + +*Returned Response:* + + + + +[InsertResponse](#InsertResponse) + +Success. Returns media IDs. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updateMedia +Update Media + + + + +```swift +feedback.updateMedia(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | UpdateMediaListRequest | yes | Request body | + + +Use this API to update media (archive/approve) for an entity. + +*Returned Response:* + + + + +[UpdateResponse](#UpdateResponse) + +Success. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getMedias +Get Media + + + + +```swift +feedback.getMedias(entityType: entityType, entityId: entityId, id: id, type: type, pageId: pageId, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| entityType | String | yes | Type of entity, e.g. question or product. | +| entityId | String | yes | ID of the eligible entity as specified in the entity type(question ID/product ID). | +| id | String? | no | ID of the media. | +| type | String? | no | Media type. | +| pageId | String? | no | Pagination page ID to retrieve next set of results. | +| pageSize | Int? | no | The number of items to retrieve in each page. | + + + +Use this API to retrieve all media from an entity. + +*Returned Response:* + + + + +[MediaGetResponse](#MediaGetResponse) + +Success. Check the example shown below or refer `MediaGetResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getReviewSummaries +Get a review summary + + + + +```swift +feedback.getReviewSummaries(entityType: entityType, entityId: entityId, id: id, pageId: pageId, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| entityType | String | yes | Type of entity, e.g. product, delivery, seller, order placed, order delivered, application, or template. | +| entityId | String | yes | ID of the eligible entity as specified in the entity type. | +| id | String? | no | Review summary identifier. | +| pageId | String? | no | Pagination page ID to retrieve next set of results. | +| pageSize | Int? | no | The number of items to retrieve in each page. | + + + +Review summary gives ratings and attribute metrics of a review per entity. Use this API to retrieve the following response data: review count, rating average. 'review metrics'/'attribute rating metrics' which contains name, type, average and count. + +*Returned Response:* + + + + +[ReviewMetricGetResponse](#ReviewMetricGetResponse) + +Success. Check the example shown below or refer `ReviewMetricGetResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### createReview +Add customer reviews + + + + +```swift +feedback.createReview(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | UpdateReviewRequest | yes | Request body | + + +Use this API to add customer reviews for a specific entity along with the following data: attributes rating, entity rating, title, description, media resources and template ID. + +*Returned Response:* + + + + +[UpdateResponse](#UpdateResponse) + +Success. Returns a review ID. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updateReview +Update customer reviews + + + + +```swift +feedback.updateReview(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | UpdateReviewRequest | yes | Request body | + + +Use this API to update customer reviews for a specific entity along with following data: attributes rating, entity rating, title, description, media resources and template ID. + +*Returned Response:* + + + + +[UpdateResponse](#UpdateResponse) + +Success. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getReviews +Get list of customer reviews + + + + +```swift +feedback.getReviews(entityType: entityType, entityId: entityId, id: id, userId: userId, media: media, rating: rating, attributeRating: attributeRating, facets: facets, sort: sort, active: active, approve: approve, pageId: pageId, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| entityType | String | yes | Type of entity, e.g. product, delivery, seller, l3, order placed, order delivered, application, or template. | +| entityId | String | yes | ID of the eligible entity as specified in the entity type. | +| id | String? | no | ID of the review. | +| userId | String? | no | ID of the user. | +| media | String? | no | media type, e.g. image | video | video_file | video_link | +| rating | [Double]? | no | rating filter, e.g. 1-5 | +| attributeRating | [String]? | no | Filter for attribute rating. | +| facets | Bool? | no | This is a boolean value for enabling metadata (facets). Selecting *true* will enable facets. | +| sort | String? | no | Sort by: default | top | recent | +| active | Bool? | no | Get the active reviews. | +| approve | Bool? | no | Get the approved reviews. | +| pageId | String? | no | Pagination page ID to retrieve next set of results. | +| pageSize | Int? | no | The number of items to retrieve in each page. | + + + +Use this API to retrieve a list of customer reviews based on entity and filters provided. + +*Returned Response:* + + + + +[ReviewGetResponse](#ReviewGetResponse) + +Success. Check the example shown below or refer `ReviewGetResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getTemplates +Get the feedback templates for a product or l3 + + + + +```swift +feedback.getTemplates(templateId: templateId, entityId: entityId, entityType: entityType) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| templateId | String? | no | ID of the feedback template. | +| entityId | String? | no | ID of the eligible entity as specified in the entity type. | +| entityType | String? | no | Type of entity, e.g. product, delivery, seller, l3, order placed, order delivered, or application. | + + + +Use this API to retrieve the details of the following feedback template. order, delivered, application, seller, order, placed, product + +*Returned Response:* + + + + +[TemplateGetResponse](#TemplateGetResponse) + +Success. Check the example shown below or refer `TemplateGetResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### createQuestion +Create a new question + + + + +```swift +feedback.createQuestion(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CreateQNARequest | yes | Request body | + + +Use this API to create a new question with following data- tags, text, type, choices for MCQ type questions, maximum length of answer. + +*Returned Response:* + + + + +[InsertResponse](#InsertResponse) + +Success. Returns a qna ID. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updateQuestion +Update a question + + + + +```swift +feedback.updateQuestion(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | UpdateQNARequest | yes | Request body | + + +Use this API to update the status of a question, its tags and its choices. + +*Returned Response:* + + + + +[UpdateResponse](#UpdateResponse) + +Success. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getQuestionAndAnswers +Get a list of QnA + + + + +```swift +feedback.getQuestionAndAnswers(entityType: entityType, entityId: entityId, id: id, userId: userId, showAnswer: showAnswer, pageId: pageId, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| entityType | String | yes | Type of entity, e.g. product, l3, etc. | +| entityId | String | yes | ID of the eligible entity as specified in the entity type. | +| id | String? | no | QNA ID | +| userId | String? | no | User ID | +| showAnswer | Bool? | no | This is a boolean value. Select *true* to display answers given. | +| pageId | String? | no | Pagination page ID to retrieve next set of results. | +| pageSize | Int? | no | The number of items to retrieve in each page. | + + + +Use this API to retrieve a list of questions and answers for a given entity. + +*Returned Response:* + + + + +[QNAGetResponse](#QNAGetResponse) + +Success. Check the example shown below or refer `QNAGetResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getVotes +Get a list of votes + + + + +```swift +feedback.getVotes(id: id, refType: refType, pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | vote ID | +| refType | String? | no | Entity type, e.g. review | comment. | +| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | +| pageSize | Int? | no | The number of items to retrieve in each page. | + + + +Use this API to retrieve a list of votes of a current logged in user. Votes can be filtered using `ref_type`, i.e. review | comment. + +*Returned Response:* + + + + +[VoteResponse](#VoteResponse) + +Success. Check the example shown below or refer `VoteResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### createVote +Create a new vote + + + + +```swift +feedback.createVote(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | VoteRequest | yes | Request body | + + +Use this API to create a new vote, where the action could be an upvote or a downvote. This is useful when you want to give a vote (say upvote) to a review (ref_type) of a product (entity_type). + +*Returned Response:* + + + + +[InsertResponse](#InsertResponse) + +Success. Returns a vote ID. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updateVote +Update a vote + + + + +```swift +feedback.updateVote(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | UpdateVoteRequest | yes | Request body | + + +Use this API to update a vote with a new action, i.e. either an upvote or a downvote. + +*Returned Response:* + + + + +[UpdateResponse](#UpdateResponse) + +Success. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [AbuseReport](#AbuseReport) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | abused | Bool? | yes | | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | description | String? | yes | | + | entity | [Entity](#Entity)? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | state | [FeedbackState](#FeedbackState)? | yes | | + | tags | [[TagMeta](#TagMeta)]? | yes | | + +--- + + + + + #### [Access](#Access) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | answer | Bool? | yes | | + | askQuestion | Bool? | yes | | + | comment | Bool? | yes | | + | rnr | Bool? | yes | | + +--- + + + + + #### [AddMediaListRequest](#AddMediaListRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | entityId | String? | yes | | + | entityType | String? | yes | | + | mediaList | [[AddMediaRequest](#AddMediaRequest)]? | yes | | + | refId | String? | yes | | + | refType | String? | yes | | + +--- + + + + + #### [AddMediaRequest](#AddMediaRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cloudId | String? | yes | | + | cloudName | String? | yes | | + | cloudProvider | String? | yes | | + | entityId | String? | yes | | + | entityType | String? | yes | | + | mediaUrl | String? | yes | | + | refId | String? | yes | | + | refType | String? | yes | | + | tags | [String]? | yes | | + | thumbnailUrl | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [ApplicationSchema](#ApplicationSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + +--- + + + + + #### [Attribute](#Attribute) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | description | String? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | slug | String? | yes | | + | tags | [[TagMeta](#TagMeta)]? | yes | | + +--- + + + + + #### [AttributeObject](#AttributeObject) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String? | yes | | + | name | String | no | | + | slug | String? | yes | | + | title | String? | yes | | + | type | String | no | | + | value | Double | no | | + +--- + + + + + #### [AttributeResponse](#AttributeResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Attribute](#Attribute)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [AutoDetectors](#AutoDetectors) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | textDetector | [[TextDetector](#TextDetector)]? | yes | | + +--- + + + + + #### [CheckEligibilityResponse](#CheckEligibilityResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | access | [Access](#Access)? | yes | | + +--- + + + + + #### [Cloud](#Cloud) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | name | String? | yes | | + | provider | String? | yes | | + +--- + + + + + #### [Comment](#Comment) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | comment | [String]? | yes | | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | entity | [Entity](#Entity)? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | state | [FeedbackState](#FeedbackState)? | yes | | + | tags | [[TagMeta](#TagMeta)]? | yes | | + | voteCount | [VoteCount](#VoteCount)? | yes | | + +--- + + + + + #### [CommentGetResponse](#CommentGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Comment](#Comment)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [CommentRequest](#CommentRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | comment | [String] | no | | + | entityId | String | no | | + | entityType | String | no | | + +--- + + + + + #### [CreateQNARequest](#CreateQNARequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | choices | [String]? | yes | | + | entityId | String | no | | + | entityType | String | no | | + | maxLen | Int? | yes | | + | sortPriority | Int? | yes | | + | tags | [String]? | yes | | + | text | String | no | | + | type | String? | yes | | + +--- + + + + + #### [CreatedBy](#CreatedBy) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | name | String? | yes | | + | tags | [[TagMeta](#TagMeta)]? | yes | | + +--- + + + + + #### [CursorGetResponse](#CursorGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[String: Any]]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [CustomerReview](#CustomerReview) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | autoDetectors | [AutoDetectors](#AutoDetectors)? | yes | | + | createdOn | String? | yes | | + | deviceMeta | [DeviceMeta](#DeviceMeta)? | yes | | + | entity | [ProductEntity](#ProductEntity)? | yes | | + | id | String? | yes | | + | locationMeta | [LocationMeta](#LocationMeta)? | yes | | + | modifiedOn | String? | yes | | + | name | String? | yes | | + | rating | [ReviewRating](#ReviewRating)? | yes | | + | review | [Review](#Review)? | yes | | + | slug | String? | yes | | + | state | [State](#State)? | yes | | + | tags | [[TagMeta](#TagMeta)]? | yes | | + | template | [Template](#Template)? | yes | | + | voteCount | [VoteCount](#VoteCount)? | yes | | + +--- + + + + + #### [DateMeta](#DateMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | createdOn | String? | yes | | + | modifiedOn | String? | yes | | + +--- + + + + + #### [DeviceMeta](#DeviceMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appVersion | String? | yes | | + | platform | String? | yes | | + +--- + + + + + #### [Entity](#Entity) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | type | String? | yes | entity type could be review/comment/ | + +--- + + + + + #### [EntityMeta](#EntityMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | orderId | String? | yes | | + | type | String? | yes | product, delivery,seller | + +--- + + + + + #### [FeedbackError](#FeedbackError) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | code | String? | yes | | + | exception | String? | yes | | + | info | String? | yes | | + | message | String? | yes | | + | meta | [String: Any]? | yes | | + | requestId | String? | yes | | + | stackTrace | String? | yes | | + | status | Int? | yes | | + +--- + + + + + #### [FeedbackMedia](#FeedbackMedia) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | [ApplicationSchema](#ApplicationSchema)? | yes | | + | cloud | [Cloud](#Cloud)? | yes | | + | createdBy | [CreatedBy](#CreatedBy)? | yes | | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | description | String? | yes | | + | entity | [Entity](#Entity)? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | reference | [Entity](#Entity)? | yes | | + | state | [MediaState](#MediaState)? | yes | | + | tags | [[TagMeta](#TagMeta)]? | yes | | + | type | String? | yes | | + | url | [Url](#Url)? | yes | | + +--- + + + + + #### [FeedbackState](#FeedbackState) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | | + | archive | Bool? | yes | | + | media | String? | yes | | + | qna | Bool? | yes | | + | rating | Bool? | yes | | + | review | Bool? | yes | | + +--- + + + + + #### [GeoLoc](#GeoLoc) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | latitude | String? | yes | | + | longitude | String? | yes | | + +--- + + + + + #### [InsertResponse](#InsertResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | ids | String? | yes | | + +--- + + + + + #### [Location](#Location) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | countryCode | String? | yes | | + | flagUrl | String? | yes | | + | geoLoc | [GeoLoc](#GeoLoc)? | yes | | + | name | String? | yes | | + | pincode | String? | yes | | + +--- + + + + + #### [LocationMeta](#LocationMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | demand | [Location](#Location)? | yes | | + | supply | [Location](#Location)? | yes | | + +--- + + + + + #### [MediaGetResponse](#MediaGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[FeedbackMedia](#FeedbackMedia)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [MediaMeta](#MediaMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cloud | [Cloud](#Cloud)? | yes | | + | comment | [String]? | yes | | + | description | String? | yes | | + | id | String? | yes | | + | type | String? | yes | | + | url | [Url](#Url)? | yes | | + +--- + + + + + #### [MediaState](#MediaState) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | approve | Bool? | yes | | + | archive | Bool? | yes | | + +--- + + + + + #### [NumberGetResponse](#NumberGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[String: Any]]? | yes | | + | page | [PageNumber](#PageNumber)? | yes | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + | hasPrevious | Bool? | yes | | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | size | Int? | yes | | + | type | String | no | | + +--- + + + + + #### [PageNumber](#PageNumber) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + | itemTotal | Int? | yes | | + | size | Int? | yes | | + | type | String? | yes | | + +--- + + + + + #### [ProductEntity](#ProductEntity) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | For products, ID will be product ID, delivery, ID will be order id, seller ID will be company ID | + | meta | [EntityMeta](#EntityMeta)? | yes | | + | type | String? | yes | product, delivery, seller, app, order | + +--- + + + + + #### [QNA](#QNA) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | comments | [[Comment](#Comment)]? | yes | | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | entity | [Entity](#Entity)? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | question | [Question](#Question)? | yes | | + | state | [QNAState](#QNAState)? | yes | | + | tag | [String]? | yes | | + | tags | [[TagMeta](#TagMeta)]? | yes | | + +--- + + + + + #### [QNAGetResponse](#QNAGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[QNA](#QNA)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [QNAState](#QNAState) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | | + | approve | Bool? | yes | | + | modify | Bool? | yes | | + | priority | Int? | yes | | + | reply | Bool? | yes | | + | vote | Bool? | yes | | + +--- + + + + + #### [Question](#Question) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | choices | [String]? | yes | | + | maxLen | Int? | yes | | + | text | String? | yes | | + | type | String? | yes | type could be single_choice/text/multi_choice | + +--- + + + + + #### [Rating](#Rating) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | attributes | [[Attribute](#Attribute)]? | yes | | + | attributesSlugs | [String]? | yes | | + | ui | [UI](#UI)? | yes | | + +--- + + + + + #### [RatingGetResponse](#RatingGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Rating](#Rating)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [RatingMetric](#RatingMetric) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | avg | Double? | yes | | + | count | Int? | yes | Valuetype could be average, count | + | name | String? | yes | Attribute name like Camera, Battery and rating name like a number 5,4,3 | + | slug | String? | yes | | + | type | String? | yes | type could be attribute_rating and rating | + +--- + + + + + #### [ReportAbuseGetResponse](#ReportAbuseGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[AbuseReport](#AbuseReport)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [ReportAbuseRequest](#ReportAbuseRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String? | yes | | + | entityId | String | no | | + | entityType | String | no | | + +--- + + + + + #### [Review](#Review) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | answerIds | [String]? | yes | | + | comments | [String]? | yes | | + | description | String? | yes | | + | mediaMeta | [[MediaMeta](#MediaMeta)]? | yes | | + | title | String? | yes | | + +--- + + + + + #### [ReviewFacet](#ReviewFacet) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | display | String? | yes | | + | name | String? | yes | | + | selected | Bool? | yes | | + | slug | String? | yes | | + | type | String? | yes | rating, attribute rating | + +--- + + + + + #### [ReviewGetResponse](#ReviewGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | facets | [[ReviewFacet](#ReviewFacet)]? | yes | | + | items | [[CustomerReview](#CustomerReview)]? | yes | | + | page | [Page](#Page)? | yes | | + | sort | [[SortMethod](#SortMethod)]? | yes | | + +--- + + + + + #### [ReviewMediaMeta](#ReviewMediaMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | maxCount | Double? | yes | | + | size | Double? | yes | | + | type | String? | yes | | + +--- + + + + + #### [ReviewMetric](#ReviewMetric) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | attributeMetric | [[RatingMetric](#RatingMetric)]? | yes | | + | createdOn | String? | yes | | + | entity | [Entity](#Entity)? | yes | entity could be product, seller, delivery | + | id | String? | yes | | + | modifiedOn | String? | yes | | + | ratingAvg | Double? | yes | | + | ratingCount | Int? | yes | total rating count | + | ratingMetric | [[RatingMetric](#RatingMetric)]? | yes | | + | reviewCount | Int? | yes | total review count | + +--- + + + + + #### [ReviewMetricGetResponse](#ReviewMetricGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[ReviewMetric](#ReviewMetric)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [ReviewRating](#ReviewRating) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | attributes | [[AttributeObject](#AttributeObject)]? | yes | | + | value | Double? | yes | | + +--- + + + + + #### [SaveAttributeRequest](#SaveAttributeRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String? | yes | | + | name | String | no | | + | slug | String | no | | + +--- + + + + + #### [SortMethod](#SortMethod) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | selected | Bool? | yes | | + | type | String? | yes | | + +--- + + + + + #### [State](#State) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | | + | approve | Bool? | yes | | + | autoDecided | Bool? | yes | | + | status | Int? | yes | | + +--- + + + + + #### [TagMeta](#TagMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | media | [[MediaMeta](#MediaMeta)]? | yes | | + | name | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [Template](#Template) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | entity | [Entity](#Entity)? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | rating | [Rating](#Rating)? | yes | | + | review | [TemplateReview](#TemplateReview)? | yes | | + | state | [FeedbackState](#FeedbackState)? | yes | | + +--- + + + + + #### [TemplateGetResponse](#TemplateGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Template](#Template)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [TemplateReview](#TemplateReview) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String? | yes | | + | header | String? | yes | | + | imageMeta | [ReviewMediaMeta](#ReviewMediaMeta)? | yes | | + | title | String? | yes | | + | videoMeta | [ReviewMediaMeta](#ReviewMediaMeta)? | yes | | + | voteAllowed | Bool? | yes | | + +--- + + + + + #### [TextDetector](#TextDetector) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | confidence | Double? | yes | | + | text | String? | yes | | + | textClass | String? | yes | | + | textType | String? | yes | | + +--- + + + + + #### [UI](#UI) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | feedbackQuestion | [String]? | yes | | + | icon | [UIIcon](#UIIcon)? | yes | | + | text | [String]? | yes | | + | type | String? | yes | star | images | gifs | smileys | + +--- + + + + + #### [UIIcon](#UIIcon) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | String? | yes | | + | inactive | String? | yes | | + | selected | [String]? | yes | | + +--- + + + + + #### [UpdateAbuseStatusRequest](#UpdateAbuseStatusRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | abusive | Bool? | yes | | + | active | Bool? | yes | | + | approve | Bool? | yes | | + | description | String? | yes | | + | entityId | String? | yes | | + | entityType | String? | yes | | + | id | String? | yes | | + +--- + + + + + #### [UpdateAttributeRequest](#UpdateAttributeRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String? | yes | | + | name | String | no | | + | slug | String? | yes | | + +--- + + + + + #### [UpdateCommentRequest](#UpdateCommentRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | | + | approve | Bool? | yes | | + | comment | [String] | no | | + | id | String | no | | + +--- + + + + + #### [UpdateMediaListRequest](#UpdateMediaListRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | approve | Bool? | yes | | + | archive | Bool? | yes | | + | entityType | String? | yes | | + | ids | [String]? | yes | | + +--- + + + + + #### [UpdateQNARequest](#UpdateQNARequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | | + | approve | Bool? | yes | | + | choices | [String]? | yes | | + | id | String? | yes | | + | tags | [String]? | yes | | + +--- + + + + + #### [UpdateResponse](#UpdateResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + +--- + + + + + #### [UpdateReviewRequest](#UpdateReviewRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | | + | application | String? | yes | | + | approve | Bool? | yes | | + | archive | Bool? | yes | | + | attributesRating | [[AttributeObject](#AttributeObject)]? | yes | | + | description | String? | yes | | + | deviceMeta | [DeviceMeta](#DeviceMeta)? | yes | | + | entityId | String? | yes | | + | entityType | String? | yes | | + | mediaResource | [[MediaMeta](#MediaMeta)]? | yes | | + | rating | Double? | yes | | + | reviewId | String? | yes | | + | templateId | String? | yes | | + | title | String? | yes | | + +--- + + + + + #### [UpdateVoteRequest](#UpdateVoteRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | action | String? | yes | | + | active | Bool? | yes | | + | id | String? | yes | | + | refId | String? | yes | | + | refType | String? | yes | | + +--- + + + + + #### [Url](#Url) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | main | String? | yes | | + | thumbnail | String? | yes | | + +--- + + + + + #### [Vote](#Vote) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | action | String? | yes | upvote and downvote | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | entity | [Entity](#Entity)? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | reference | [Entity](#Entity)? | yes | review | comment | + | state | [FeedbackState](#FeedbackState)? | yes | | + | tags | [[TagMeta](#TagMeta)]? | yes | | + +--- + + + + + #### [VoteCount](#VoteCount) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | downvote | Int? | yes | | + | upvote | Int? | yes | | + +--- + + + + + #### [VoteRequest](#VoteRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | action | String? | yes | | + | entityId | String? | yes | | + | entityType | String? | yes | | + | refId | String? | yes | | + | refType | String? | yes | review | comment | + +--- + + + + + #### [VoteResponse](#VoteResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Vote](#Vote)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + diff --git a/documentation/application/FILESTORAGE.md b/documentation/application/FILESTORAGE.md new file mode 100644 index 0000000000..298957e9e1 --- /dev/null +++ b/documentation/application/FILESTORAGE.md @@ -0,0 +1,484 @@ + + + + +##### [Back to Application docs](./README.md) + +## FileStorage Methods +File Storage +* [startUpload](#startupload) +* [completeUpload](#completeupload) +* [signUrls](#signurls) + + + +## Methods with example and description + + +#### startUpload +Initiates an upload and returns a storage link that is valid for 30 minutes. You can use the storage link to make subsequent upload request with file buffer or blob. + + + + +```swift +filestorage.startUpload(namespace: namespace, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| namespace | String | yes | Name of the bucket created for storing objects. | +| body | StartRequest | yes | Request body | + + +Use this API to perform the first step of uploading (i.e. **Start**) an arbitrarily sized buffer or blob. + +The three major steps are: +* Start +* Upload +* Complete + +### Start +Initiates the assets upload using `startUpload`. +It returns a storage link in response. + +### Upload +Use the storage link to upload a file (Buffer or Blob) to the File Storage. +Make a `PUT` request on storage link received from `startUpload` API with the file (Buffer or Blob) in the request body. + +### Complete +After successfully upload, call the `completeUpload` API to finish the upload process. +This operation will return the URL of the uploaded file. + + +*Returned Response:* + + + + +[StartResponse](#StartResponse) + +Success. Next, call the `completeUpload` API and pass the response payload of this API to finish the upload process. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### completeUpload +Completes the upload process. After successfully uploading a file, call this API to finish the upload process. + + + + +```swift +filestorage.completeUpload(namespace: namespace, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| namespace | String | yes | Name of the bucket created for storing objects. | +| body | StartResponse | yes | Request body | + + +Use this API to perform the third step of uploading (i.e. **Complete**) an arbitrarily sized buffer or blob. + +The three major steps are: +* Start +* Upload +* Complete + +### Start +Initiates the assets upload using `startUpload`. +It returns a storage link in response. + +### Upload +Use the storage link to upload a file (Buffer or Blob) to the File Storage. +Make a `PUT` request on storage link received from `startUpload` API with the file (Buffer or Blob) in the request body. + +### Complete +After successfully upload, call the `completeUpload` API to finish the upload process. +This operation will return the URL of the uploaded file. + + +*Returned Response:* + + + + +[CompleteResponse](#CompleteResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### signUrls +Explain here + + + + +```swift +filestorage.signUrls(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | SignUrlRequest | yes | Request body | + + +Describe here + +*Returned Response:* + + + + +[SignUrlResponse](#SignUrlResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [FailedResponse](#FailedResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String | no | | + +--- + + + + + #### [CDN](#CDN) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | url | String | no | | + +--- + + + + + #### [Upload](#Upload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | expiry | Int | no | | + | url | String | no | | + +--- + + + + + #### [StartResponse](#StartResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | fileName | String | no | | + | filePath | String | no | | + | contentType | String | no | | + | method | String | no | | + | namespace | String | no | | + | operation | String | no | | + | size | Int | no | | + | upload | [Upload](#Upload) | no | | + | cdn | [CDN](#CDN) | no | | + | tags | [String]? | yes | | + +--- + + + + + #### [StartRequest](#StartRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | fileName | String | no | | + | contentType | String | no | | + | size | Int | no | | + | tags | [String]? | yes | | + | params | [String: Any]? | yes | | + +--- + + + + + #### [CompleteResponse](#CompleteResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String | no | | + | fileName | String | no | | + | filePath | String | no | | + | contentType | String | no | | + | method | String | no | | + | namespace | String | no | | + | operation | String | no | | + | size | Int | no | | + | upload | [Upload](#Upload) | no | | + | cdn | [CDN](#CDN) | no | | + | success | String | no | | + | tags | [String]? | yes | | + | createdOn | String | no | | + | modifiedOn | String | no | | + +--- + + + + + #### [Opts](#Opts) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | attempts | Int? | yes | | + | timestamp | Int? | yes | | + | delay | Int? | yes | | + +--- + + + + + #### [CopyFileTask](#CopyFileTask) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String | no | | + | name | String | no | | + | data | [BulkRequest](#BulkRequest) | no | | + | opts | [Opts](#Opts) | no | | + | progress | Int | no | | + | delay | Int | no | | + | timestamp | Int | no | | + | attemptsMade | Int | no | | + | stacktrace | [String]? | yes | | + | finishedOn | Int | no | | + | processedOn | Int | no | | + +--- + + + + + #### [BulkResponse](#BulkResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | trackingUrl | String | no | | + | task | [CopyFileTask](#CopyFileTask) | no | | + +--- + + + + + #### [ReqConfiguration](#ReqConfiguration) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | concurrency | Int? | yes | | + +--- + + + + + #### [Destination](#Destination) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | namespace | String | no | | + | rewrite | String | no | | + | basepath | String? | yes | | + +--- + + + + + #### [BulkRequest](#BulkRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | urls | [String] | no | | + | destination | [Destination](#Destination) | no | | + | configuration | [ReqConfiguration](#ReqConfiguration)? | yes | | + +--- + + + + + #### [Urls](#Urls) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | url | String | no | | + | signedUrl | String | no | | + | expiry | Int | no | | + +--- + + + + + #### [SignUrlResponse](#SignUrlResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | urls | [[Urls](#Urls)] | no | | + +--- + + + + + #### [SignUrlRequest](#SignUrlRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | expiry | Int | no | | + | urls | [String] | no | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + | hasNext | Bool? | yes | | + | current | Int? | yes | | + | type | Int | no | | + | size | Int? | yes | | + +--- + + + + + #### [DbRecord](#DbRecord) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | | + | tags | [String] | no | | + | id | String | no | | + | fileName | String | no | | + | operation | String? | yes | | + | namespace | String | no | | + | contentType | String | no | | + | filePath | String | no | | + | upload | [Upload](#Upload) | no | | + | cdn | [CDN](#CDN) | no | | + | createdOn | String | no | | + | modifiedOn | String | no | | + +--- + + + + + #### [BrowseResponse](#BrowseResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[DbRecord](#DbRecord)] | no | | + | page | [Page](#Page) | no | | + +--- + + + diff --git a/documentation/application/LEAD.md b/documentation/application/LEAD.md new file mode 100644 index 0000000000..fa58290f65 --- /dev/null +++ b/documentation/application/LEAD.md @@ -0,0 +1,1786 @@ + + + + +##### [Back to Application docs](./README.md) + +## Lead Methods +Handles communication between Staff and Users +* [getTicket](#getticket) +* [createHistory](#createhistory) +* [createTicket](#createticket) +* [getCustomForm](#getcustomform) +* [submitCustomForm](#submitcustomform) +* [getParticipantsInsideVideoRoom](#getparticipantsinsidevideoroom) +* [getTokenForVideoRoom](#gettokenforvideoroom) + + + +## Methods with example and description + + +#### getTicket +Get Ticket with the specific id + + + + +```swift +lead.getTicket(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | ID of ticket to be retrieved | + + + +Get Ticket with the specific id, this is used to view the ticket details + +*Returned Response:* + + + + +[Ticket](#Ticket) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "context": { + "application_id": "000000000000000000000003", + "company_id": "884" + }, + "content": { + "title": "SOme title Response", + "description": "Single lineeee: asdf
    Email: asdf@asdf.com
    dfsdf: asdf
    ", + "attachments": [] + }, + "status": { + "display": "In Progress", + "color": "#ffa951", + "key": "in_progress" + }, + "priority": { + "display": "Medium", + "color": "#f37736", + "key": "medium" + }, + "assigned_to": { + "agent_id": "5d1363adf599d850df93175e", + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", + "hasOldPasswordHash": false, + "_id": "5d1363adf599d850df93175e", + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + } + ], + "username": "nikhilmshchs_gmail_com_38425_20500281", + "createdAt": "2019-01-01T17:22:38.528Z", + "updatedAt": "2021-01-22T10:02:42.258Z", + "uid": "20500281", + "__v": 56 + }, + "tags": [ + "some-title" + ], + "_id": "6012f38557751ee8fc162cf7", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.96" + }, + "os": { + "name": "macOS", + "version": "10.15.7", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "source": "sales_channel", + "created_by": { + "id": "5d1363adf599d850df93175e", + "user": { + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", + "hasOldPasswordHash": false, + "_id": "5d1363adf599d850df93175e", + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + } + ], + "username": "nikhilmshchs_gmail_com_38425_20500281", + "createdAt": "2019-01-01T17:22:38.528Z", + "updatedAt": "2021-01-22T10:02:42.258Z", + "uid": "20500281", + "__v": 56 + } + }, + "response_id": "6012f38457751e0fb8162cf6", + "category": { + "form": { + "login_required": false, + "should_notify": false, + "inputs": [ + { + "required": false, + "type": "text", + "enum": [], + "display": "Single lineeee", + "key": "single-lineeee", + "showRegexInput": false + }, + { + "required": false, + "type": "email", + "enum": [], + "display": "Email", + "regex": "\\S+@\\S+\\.\\S+", + "key": "email", + "showRegexInput": true + }, + { + "required": false, + "type": "text", + "enum": [], + "display": "dfsdf", + "key": "dfsdf", + "showRegexInput": false + } + ], + "available_assignees": [ + "5b9b98150df588546aaea6d2", + "5c45d78395d7504f76c2cb37" + ], + "_id": "5fd72db3dc250f8decfc61b2", + "title": "SOme title", + "description": "SOme big description", + "slug": "some-title", + "application_id": "000000000000000000000003", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "87.0.4280.88" + }, + "os": { + "name": "macOS", + "version": "10.15.6", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5d1363adf599d850df93175e", + "createdAt": "2020-12-14T09:17:39.953Z", + "updatedAt": "2021-01-28T18:48:07.717Z", + "__v": 0 + }, + "key": "some-title", + "display": "SOme title" + }, + "ticket_id": "43", + "createdAt": "2021-01-28T17:25:25.013Z", + "updatedAt": "2021-01-28T17:25:33.396Z", + "__v": 0, + "video_room_id": "6012f38557751ee8fc162cf7" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createHistory +Create history for specific Ticket + + + + +```swift +lead.createHistory(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Ticket ID for which history is created | +| body | TicketHistoryPayload | yes | Request body | + + +Create history for specific Ticket, this history is seen on ticket detail page, this can be comment, log or rating. + +*Returned Response:* + + + + +[TicketHistory](#TicketHistory) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "_id": "601a9d52c26687d086c499ef", + "ticket_id": "41", + "type": "comment", + "value": { + "text": "d", + "media": [] + }, + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.96" + }, + "os": { + "name": "macOS", + "version": "10.15.7", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5d1363adf599d850df93175e", + "createdAt": "2021-02-03T12:55:46.808Z", + "updatedAt": "2021-02-03T12:55:46.808Z", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createTicket +Create Ticket + + + + +```swift +lead.createTicket(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | AddTicketPayload | yes | Request body | + + +This is used to Create Ticket. + +*Returned Response:* + + + + +[Ticket](#Ticket) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "context": { + "application_id": "000000000000000000000003", + "company_id": "884" + }, + "content": { + "title": "SOme title Response", + "description": "Single lineeee: asdf
    Email: asdf@asdf.com
    dfsdf: asdf
    ", + "attachments": [] + }, + "status": { + "display": "In Progress", + "color": "#ffa951", + "key": "in_progress" + }, + "priority": { + "display": "Medium", + "color": "#f37736", + "key": "medium" + }, + "assigned_to": { + "agent_id": "5d1363adf599d850df93175e", + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", + "hasOldPasswordHash": false, + "_id": "5d1363adf599d850df93175e", + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + } + ], + "username": "nikhilmshchs_gmail_com_38425_20500281", + "createdAt": "2019-01-01T17:22:38.528Z", + "updatedAt": "2021-01-22T10:02:42.258Z", + "uid": "20500281", + "__v": 56 + }, + "tags": [ + "some-title" + ], + "_id": "6012f38557751ee8fc162cf7", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.96" + }, + "os": { + "name": "macOS", + "version": "10.15.7", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "source": "sales_channel", + "created_by": { + "id": "5d1363adf599d850df93175e", + "user": { + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", + "hasOldPasswordHash": false, + "_id": "5d1363adf599d850df93175e", + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + } + ], + "username": "nikhilmshchs_gmail_com_38425_20500281", + "createdAt": "2019-01-01T17:22:38.528Z", + "updatedAt": "2021-01-22T10:02:42.258Z", + "uid": "20500281", + "__v": 56 + } + }, + "response_id": "6012f38457751e0fb8162cf6", + "category": { + "form": { + "login_required": false, + "should_notify": false, + "inputs": [ + { + "required": false, + "type": "text", + "enum": [], + "display": "Single lineeee", + "key": "single-lineeee", + "showRegexInput": false + }, + { + "required": false, + "type": "email", + "enum": [], + "display": "Email", + "regex": "\\S+@\\S+\\.\\S+", + "key": "email", + "showRegexInput": true + }, + { + "required": false, + "type": "text", + "enum": [], + "display": "dfsdf", + "key": "dfsdf", + "showRegexInput": false + } + ], + "available_assignees": [ + "5b9b98150df588546aaea6d2", + "5c45d78395d7504f76c2cb37" + ], + "_id": "5fd72db3dc250f8decfc61b2", + "title": "SOme title", + "description": "SOme big description", + "slug": "some-title", + "application_id": "000000000000000000000003", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "87.0.4280.88" + }, + "os": { + "name": "macOS", + "version": "10.15.6", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5d1363adf599d850df93175e", + "createdAt": "2020-12-14T09:17:39.953Z", + "updatedAt": "2021-01-28T18:48:07.717Z", + "__v": 0 + }, + "key": "some-title", + "display": "SOme title" + }, + "ticket_id": "43", + "createdAt": "2021-01-28T17:25:25.013Z", + "updatedAt": "2021-01-28T17:25:33.396Z", + "__v": 0, + "video_room_id": "6012f38557751ee8fc162cf7" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getCustomForm +Get specific Custom Form using it's slug + + + + +```swift +lead.getCustomForm(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | Slug of form whose response is getting submitted | + + + +Get specific Custom Form using it's slug, this is used to view the form. + +*Returned Response:* + + + + +[CustomForm](#CustomForm) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "login_required": false, + "should_notify": false, + "inputs": [ + { + "required": false, + "type": "text", + "display": "Name", + "placeholder": "Please enter your name", + "key": "name" + } + ], + "available_assignees": [], + "_id": "5fd258a9088f957f34c288fc", + "title": "trail form", + "description": "Trail form description", + "slug": "trail-form", + "application_id": "000000000000000000000003", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "87.0.4280.88" + }, + "os": { + "name": "macOS", + "version": "10.15.6", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5d1363adf599d850df93175e", + "createdAt": "2020-12-10T17:19:37.515Z", + "updatedAt": "2020-12-10T17:19:43.214Z", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### submitCustomForm +Submit Response for a specific Custom Form using it's slug + + + + +```swift +lead.submitCustomForm(slug: slug, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | Slug of form whose response is getting submitted | +| body | CustomFormSubmissionPayload | yes | Request body | + + +Submit Response for a specific Custom Form using it's slug, this response is then used to create a ticket on behalf of the user. + +*Returned Response:* + + + + +[SubmitCustomFormResponse](#SubmitCustomFormResponse) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "ticket": { + "context": { + "application_id": "000000000000000000000003", + "company_id": "884" + }, + "content": { + "title": "SOme title Response", + "description": "Single lineeee: asdf
    Email: asdf@asdf.com
    dfsdf: asdf
    ", + "attachments": [] + }, + "status": { + "display": "In Progress", + "color": "#ffa951", + "key": "in_progress" + }, + "priority": { + "display": "Medium", + "color": "#f37736", + "key": "medium" + }, + "assigned_to": { + "agent_id": "5d1363adf599d850df93175e", + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", + "hasOldPasswordHash": false, + "_id": "5d1363adf599d850df93175e", + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + } + ], + "username": "nikhilmshchs_gmail_com_38425_20500281", + "createdAt": "2019-01-01T17:22:38.528Z", + "updatedAt": "2021-01-22T10:02:42.258Z", + "uid": "20500281", + "__v": 56 + }, + "tags": [ + "some-title" + ], + "_id": "6012f38557751ee8fc162cf7", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.96" + }, + "os": { + "name": "macOS", + "version": "10.15.7", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "source": "sales_channel", + "created_by": { + "id": "5d1363adf599d850df93175e", + "user": { + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", + "hasOldPasswordHash": false, + "_id": "5d1363adf599d850df93175e", + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + } + ], + "username": "nikhilmshchs_gmail_com_38425_20500281", + "createdAt": "2019-01-01T17:22:38.528Z", + "updatedAt": "2021-01-22T10:02:42.258Z", + "uid": "20500281", + "__v": 56 + } + }, + "response_id": "6012f38457751e0fb8162cf6", + "category": { + "form": { + "login_required": false, + "should_notify": false, + "inputs": [ + { + "required": false, + "type": "text", + "enum": [], + "display": "Single lineeee", + "key": "single-lineeee", + "showRegexInput": false + }, + { + "required": false, + "type": "email", + "enum": [], + "display": "Email", + "regex": "\\S+@\\S+\\.\\S+", + "key": "email", + "showRegexInput": true + }, + { + "required": false, + "type": "text", + "enum": [], + "display": "dfsdf", + "key": "dfsdf", + "showRegexInput": false + } + ], + "available_assignees": [ + "5b9b98150df588546aaea6d2", + "5c45d78395d7504f76c2cb37" + ], + "_id": "5fd72db3dc250f8decfc61b2", + "title": "SOme title", + "description": "SOme big description", + "slug": "some-title", + "application_id": "000000000000000000000003", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "87.0.4280.88" + }, + "os": { + "name": "macOS", + "version": "10.15.6", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5d1363adf599d850df93175e", + "createdAt": "2020-12-14T09:17:39.953Z", + "updatedAt": "2021-01-28T18:48:07.717Z", + "__v": 0 + }, + "key": "some-title", + "display": "SOme title" + }, + "ticket_id": "43", + "createdAt": "2021-01-28T17:25:25.013Z", + "updatedAt": "2021-01-28T17:25:33.396Z", + "__v": 0, + "video_room_id": "6012f38557751ee8fc162cf7" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getParticipantsInsideVideoRoom +Get participants of a specific Video Room using it's unique name + + + + +```swift +lead.getParticipantsInsideVideoRoom(uniqueName: uniqueName) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| uniqueName | String | yes | Unique name of Video Room | + + + +Get participants of a specific Video Room using it's unique name, this can be used to check if people are already there in the room and also to show their names. + +*Returned Response:* + + + + +[GetParticipantsInsideVideoRoomResponse](#GetParticipantsInsideVideoRoomResponse) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "participants": [] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getTokenForVideoRoom +Get Token to join a specific Video Room using it's unqiue name + + + + +```swift +lead.getTokenForVideoRoom(uniqueName: uniqueName) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| uniqueName | String | yes | Unique name of Video Room | + + + +Get Token to join a specific Video Room using it's unqiue name, this Token is your ticket to Room and also creates your identity there. + +*Returned Response:* + + + + +[GetTokenForVideoRoomResponse](#GetTokenForVideoRoomResponse) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "access_token": "your_token_to_the_room" + } +} +``` +
    + +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [TicketList](#TicketList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Ticket](#Ticket)]? | yes | List of tickets | + | filters | [Filter](#Filter)? | yes | All the filters available for tickets | + | page | [Page](#Page)? | yes | Describes the pagination state | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + | hasNext | Bool? | yes | | + | current | Int? | yes | | + | type | String | no | | + | size | Int? | yes | | + +--- + + + + + #### [TicketHistoryList](#TicketHistoryList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[TicketHistory](#TicketHistory)]? | yes | List of ticket history | + | page | [Page](#Page)? | yes | Describes the pagination state | + +--- + + + + + #### [CustomFormList](#CustomFormList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[CustomForm](#CustomForm)]? | yes | List of forms | + | page | [Page](#Page)? | yes | Describes the pagination state | + +--- + + + + + #### [CreateCustomFormPayload](#CreateCustomFormPayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String | no | Slug for the form | + | title | String | no | Title for the form | + | inputs | [[String: Any]] | no | List of all the form components | + | description | String? | yes | Description of the form | + | headerImage | String? | yes | Header image that is to be shown for the form | + | priority | [PriorityEnum](#PriorityEnum) | no | Describes the priority of the tickets created by the form | + | shouldNotify | Bool? | yes | Indicates if staff should be notified when a response is received | + | successMessage | String? | yes | Success message that will be shown on submission | + | pollForAssignment | [PollForAssignment](#PollForAssignment)? | yes | Describes how polling will be done for the tickets createds | + +--- + + + + + #### [EditCustomFormPayload](#EditCustomFormPayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String | no | Title for the form | + | inputs | [[String: Any]] | no | List of all the form components | + | description | String? | yes | Description of the form | + | priority | [PriorityEnum](#PriorityEnum) | no | Describes the priority of the tickets created by the form | + | headerImage | String? | yes | Header image that is to be shown for the form | + | shouldNotify | Bool? | yes | Indicates if staff should be notified when a response is received | + | loginRequired | Bool? | yes | Denotes if login is required to make a form response submission | + | successMessage | String? | yes | Success message that will be shown on submission | + | pollForAssignment | [PollForAssignment](#PollForAssignment)? | yes | Describes how polling will be done for the tickets createds | + +--- + + + + + #### [EditTicketPayload](#EditTicketPayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | content | [TicketContent](#TicketContent)? | yes | Ticket conetent details | + | category | String? | yes | Category assigned to the ticket | + | subCategory | String? | yes | Sub-category assigned to the ticket | + | source | String? | yes | Denotes if the ticket was created at company or application level | + | status | String? | yes | Denotes in what state is the ticket | + | priority | [PriorityEnum](#PriorityEnum)? | yes | Denotes the priority of ticket | + | assignedTo | [AgentChangePayload](#AgentChangePayload)? | yes | Details of support staff to whom ticket is assigned | + | tags | [String]? | yes | Tags relevant to ticket | + +--- + + + + + #### [AgentChangePayload](#AgentChangePayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | agentId | String | no | Agent's unique ID | + +--- + + + + + #### [CreateVideoRoomResponse](#CreateVideoRoomResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uniqueName | String | no | Video Room's unique name | + +--- + + + + + #### [CloseVideoRoomResponse](#CloseVideoRoomResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Denotes if operation was successfully | + +--- + + + + + #### [CreateVideoRoomPayload](#CreateVideoRoomPayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uniqueName | String | no | Ticket id | + | notify | [[NotifyUser](#NotifyUser)]? | yes | List of people to be notified | + +--- + + + + + #### [NotifyUser](#NotifyUser) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | countryCode | String | no | Country code | + | phoneNumber | String | no | Phone number | + +--- + + + + + #### [Filter](#Filter) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | priorities | [[Priority](#Priority)] | no | List of possible priorities for tickets | + | categories | [[TicketCategory](#TicketCategory)]? | yes | List of possible categories for tickets | + | statuses | [[Status](#Status)] | no | List of possible statuses for tickets | + | assignees | [[String: Any]] | no | List of support staff availble for tickets assignment | + +--- + + + + + #### [TicketHistoryPayload](#TicketHistoryPayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | value | [String: Any] | no | Details of history event | + | type | [HistoryTypeEnum](#HistoryTypeEnum) | no | Type of history event | + +--- + + + + + #### [CustomFormSubmissionPayload](#CustomFormSubmissionPayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | response | [[String: Any]] | no | Form response | + | attachments | [[TicketAsset](#TicketAsset)]? | yes | List of all attachments related to the form | + +--- + + + + + #### [GetTokenForVideoRoomResponse](#GetTokenForVideoRoomResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | accessToken | String | no | Access token to be used for video room | + +--- + + + + + #### [GetParticipantsInsideVideoRoomResponse](#GetParticipantsInsideVideoRoomResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | participants | [[Participant](#Participant)] | no | List of participants of the video room | + +--- + + + + + #### [Participant](#Participant) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [UserSchema](#UserSchema)? | yes | Details of participant | + | identity | String? | yes | Unique identifier of participant | + | status | String? | yes | Status of participant | + +--- + + + + + #### [UserSchema](#UserSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | firstName | String? | yes | First name | + | lastName | String? | yes | Last name | + | phoneNumbers | [[PhoneNumber](#PhoneNumber)]? | yes | List of phone numbers | + | emails | [[Email](#Email)]? | yes | List of email addresses | + | gender | String? | yes | Gender of user | + | active | Bool? | yes | Is account active | + | profilePicUrl | String? | yes | URL for profile pic | + | username | String? | yes | username of user | + | accountType | String? | yes | Type of account | + | uid | String? | yes | Unique identifier of user | + | debug | [Debug](#Debug)? | yes | Used for debugging | + | hasOldPasswordHash | Bool? | yes | Denotes if user has old password hash | + | id | String? | yes | Unique identifier of user | + | createdAt | String? | yes | Time of user creation | + | updatedAt | String? | yes | Last time of user details update | + +--- + + + + + #### [PhoneNumber](#PhoneNumber) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | Denotes if the phone number is active | + | primary | Bool? | yes | Denotes it's the primary phone number for the account | + | verified | Bool? | yes | Denotes it's a verified phone number | + | phone | String? | yes | Phone number | + | countryCode | Int? | yes | Country code | + +--- + + + + + #### [Email](#Email) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | primary | Bool? | yes | Denotes it's the primary email for the account | + | verified | Bool? | yes | Denotes it's a verified email | + | email | String? | yes | Email Address | + | active | Bool? | yes | Denotes if the email is active | + +--- + + + + + #### [Debug](#Debug) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | source | String? | yes | Source of user | + | platform | String? | yes | Platform of user | + +--- + + + + + #### [SubmitCustomFormResponse](#SubmitCustomFormResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | ticket | [Ticket](#Ticket) | no | Ticket created on form submission | + +--- + + + + + #### [TicketContext](#TicketContext) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | applicationId | String? | yes | Application ID related to the ticket | + | companyId | String | no | Company ID related to the ticket | + +--- + + + + + #### [CreatedOn](#CreatedOn) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | userAgent | String | no | Useragent details | + +--- + + + + + #### [TicketAsset](#TicketAsset) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | display | String? | yes | Display text for asset | + | value | String | no | To be used for details | + | type | [TicketAssetTypeEnum](#TicketAssetTypeEnum) | no | Type of asset | + +--- + + + + + #### [TicketContent](#TicketContent) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String | no | Title for ticket | + | description | String? | yes | Long description of issue | + | attachments | [[TicketAsset](#TicketAsset)]? | yes | List of all attachments related to the ticket | + +--- + + + + + #### [AddTicketPayload](#AddTicketPayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | createdBy | [String: Any]? | yes | Creator of the ticket | + | status | String? | yes | Status of the ticket | + | priority | [PriorityEnum](#PriorityEnum)? | yes | Priority of the ticket | + | category | String | no | Category of the ticket | + | content | [TicketContent](#TicketContent) | no | Content for the ticket | + +--- + + + + + #### [Priority](#Priority) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | [PriorityEnum](#PriorityEnum) | no | Key for priority | + | display | String | no | Display text for priority | + | color | String | no | Color for priority | + +--- + + + + + #### [Status](#Status) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String | no | Key for status | + | display | String | no | Display text for status | + | color | String | no | Color for status | + +--- + + + + + #### [TicketCategory](#TicketCategory) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String | no | Key for category | + | display | String | no | Display text for category | + | form | [CustomForm](#CustomForm)? | yes | Form related to the category | + | subCategories | [[TicketSubCategory](#TicketSubCategory)]? | yes | Sub-category related to the category | + | feedbackForm | [TicketFeedbackForm](#TicketFeedbackForm)? | yes | Feedback form of category used to submit ticket feedback | + +--- + + + + + #### [TicketSubCategory](#TicketSubCategory) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String | no | Key for sub-category | + | display | String | no | Display text for sub-category | + +--- + + + + + #### [TicketFeedbackForm](#TicketFeedbackForm) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String | no | Feedback form title that will be shown to the user | + | display | [[String: Any]]? | yes | List of all the form fields | + +--- + + + + + #### [TicketFeedbackList](#TicketFeedbackList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[TicketFeedback](#TicketFeedback)]? | yes | List of all ticket feedback for the ticket | + +--- + + + + + #### [TicketFeedbackPayload](#TicketFeedbackPayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | formResponse | [String: Any]? | yes | Key-value pairs of all the form fields and their response | + +--- + + + + + #### [SubmitButton](#SubmitButton) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String | no | Title for submit button | + | titleColor | String | no | Title color submit button | + | backgroundColor | String | no | Color for submit button | + +--- + + + + + #### [PollForAssignment](#PollForAssignment) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | duration | Double | no | Duration for polling of staff | + | message | String | no | Message for polling | + | successMessage | String | no | Message for successful polling | + | failureMessage | String | no | Message if polling failed | + +--- + + + + + #### [CustomForm](#CustomForm) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | applicationId | String | no | Application ID for form | + | slug | String | no | Slug for the form, which is to be used for accessing the form | + | headerImage | String? | yes | Form header image that will be shown to the user | + | title | String | no | Form title that will be shown to the user | + | description | String? | yes | Form description that will be shown to the user | + | priority | [Priority](#Priority) | no | Sets priority of tickets created by form response | + | loginRequired | Bool | no | Denotes if login is required to make a form response submission | + | shouldNotify | Bool | no | Denotes if new response submission for the form should be notified to the assignees | + | successMessage | String? | yes | Message that is to be shown on succesfull form response submission | + | submitButton | [SubmitButton](#SubmitButton)? | yes | Details for submit button | + | inputs | [[String: Any]] | no | List of all the form fields | + | createdOn | [CreatedOn](#CreatedOn)? | yes | Gives details of when the form was created | + | createdBy | [String: Any]? | yes | Gives details of user who created the form | + | pollForAssignment | [PollForAssignment](#PollForAssignment)? | yes | Details of how polling should be done for support | + | id | String | no | Unique identifier for the form | + +--- + + + + + #### [FeedbackResponseItem](#FeedbackResponseItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | display | String | no | Question/Title of the form field | + | key | String | no | Key of the form field | + | value | String | no | User response value for the form field | + +--- + + + + + #### [TicketFeedback](#TicketFeedback) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String | no | Unique identifier for the feedback | + | ticketId | String | no | Readable ticket number | + | companyId | String | no | Company id for which ticket was raised | + | response | [[FeedbackResponseItem](#FeedbackResponseItem)] | no | | + | category | String? | yes | Category of the ticket | + | user | [String: Any]? | yes | User who submitted the feedback | + | updatedAt | String? | yes | Time when the feedback was last updated | + | createdAt | String? | yes | Time when the feedback was created | + +--- + + + + + #### [TicketHistory](#TicketHistory) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String | no | Type of the history event | + | value | [String: Any] | no | Data of the history event | + | ticketId | String | no | Readable ticket number | + | createdOn | [CreatedOn](#CreatedOn)? | yes | Time of creation of the history event | + | createdBy | [String: Any]? | yes | User who created the history event | + | id | String | no | Unique identifier of the history event | + | updatedAt | String? | yes | Time of last update of the history event | + | createdAt | String? | yes | Time of creation of the history event | + +--- + + + + + #### [Ticket](#Ticket) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | context | [TicketContext](#TicketContext)? | yes | Details of company and application realated to the ticket | + | createdOn | [CreatedOn](#CreatedOn)? | yes | Details of company and application realated to the ticket | + | responseId | String? | yes | Details of company and application realated to the ticket | + | content | [TicketContent](#TicketContent)? | yes | Ticket conetent details | + | ticketId | String | no | Readable ticket number | + | category | [TicketCategory](#TicketCategory) | no | Category assigned to the ticket | + | subCategory | [TicketSubCategory](#TicketSubCategory)? | yes | Sub-category assigned to the ticket | + | source | [TicketSourceEnum](#TicketSourceEnum) | no | Denotes if the ticket was created at company or application level | + | status | [Status](#Status) | no | Denotes in what state is the ticket | + | priority | [Priority](#Priority) | no | Denotes the priority of ticket | + | createdBy | [String: Any]? | yes | User details of ticket creator | + | assignedTo | [String: Any]? | yes | Details of support staff to whom ticket is assigned | + | tags | [String]? | yes | Tags relevant to ticket | + | customJson | [String: Any]? | yes | custom json relevant to the ticket | + | isFeedbackPending | Bool? | yes | Denotes if feedback submission is pending for the ticket | + | id | String | no | Unique identifier for the ticket | + | updatedAt | String? | yes | Time when the ticket was last updated | + | createdAt | String? | yes | Time when the ticket was created | + +--- + + + + +### Enums + + + + + + #### [PriorityEnum](#PriorityEnum) + Type : string + + | Name | Value | Description | + | ---- | ----- | ----------- | + | low | low | This means ticket is low priority | + | medium | medium | This means ticket is medium priority | + | high | high | This means ticket is high priority | + | urgent | urgent | This means ticket is of urgent priority | + +--- + + + + #### [HistoryTypeEnum](#HistoryTypeEnum) + Type : string + + | Name | Value | Description | + | ---- | ----- | ----------- | + | rating | rating | This means history event is a rating | + | log | log | This means history event is a changelog | + | comment | comment | This means history event is a comment | + +--- + + + + #### [TicketAssetTypeEnum](#TicketAssetTypeEnum) + Type : string + + | Name | Value | Description | + | ---- | ----- | ----------- | + | image | image | Denotes asset is of image type | + | video | video | Denotes asset is of video type | + | file | file | Denotes asset is of file type | + | youtube | youtube | Denotes asset is an youtube link | + | product | product | Denotes asset is of product type | + | collection | collection | Denotes asset is of collection type | + | brand | brand | Denotes asset is of brand type | + | shipment | shipment | Denotes asset is of shipment type | + | order | order | Denotes asset is of order type | + +--- + + + + #### [TicketSourceEnum](#TicketSourceEnum) + Type : string + + | Name | Value | Description | + | ---- | ----- | ----------- | + | platformPanel | platform_panel | This means it is company level ticket | + | salesChannel | sales_channel | This means it is a application/sales channel level ticket | + +--- + + + + + diff --git a/documentation/application/LOGISTIC.md b/documentation/application/LOGISTIC.md new file mode 100644 index 0000000000..dd487c3ee1 --- /dev/null +++ b/documentation/application/LOGISTIC.md @@ -0,0 +1,354 @@ + + + + +##### [Back to Application docs](./README.md) + +## Logistic Methods +Handles Platform websites OMS +* [getTatProduct](#gettatproduct) +* [getPincodeCity](#getpincodecity) + + + +## Methods with example and description + + +#### getTatProduct +Get TAT of a product + + + + +```swift +logistic.getTatProduct(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | GetTatProductReqBody | yes | Request body | + + +Use this API to know the delivery turnaround time (TAT) by entering the product details along with the PIN Code of the location. + +*Returned Response:* + + + + +[GetTatProductResponse](#GetTatProductResponse) + +Success. Check the example shown below or refer `GetTatProductResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getPincodeCity +Get city from PIN Code + + + + +```swift +logistic.getPincodeCity(pincode: pincode) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pincode | String | yes | The PIN Code of the area, e.g. 400059 | + + + +Use this API to retrieve a city by its PIN Code. + +*Returned Response:* + + + + +[GetPincodeCityResponse](#GetPincodeCityResponse) + +Success. Returns a JSON object containing the city name, state and country identified by its PIN Code. Check the example shown below or refer `GetPincodeCityResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [GetPincodeCityResponse](#GetPincodeCityResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | requestUuid | String | no | | + | stormbreakerUuid | String | no | | + | success | Bool | no | | + | data | [[LogisticPincodeData](#LogisticPincodeData)] | no | | + +--- + + + + + #### [LogisticPincodeData](#LogisticPincodeData) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | meta | [LogisticMeta](#LogisticMeta)? | yes | | + | parents | [[LogisticParents](#LogisticParents)]? | yes | | + | subType | String? | yes | | + | name | String? | yes | | + | error | [LogisticError](#LogisticError)? | yes | | + | uid | String? | yes | | + | displayName | String? | yes | | + +--- + + + + + #### [LogisticMeta](#LogisticMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | zone | String? | yes | | + | deliverables | [[String: Any]]? | yes | | + +--- + + + + + #### [LogisticParents](#LogisticParents) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | subType | String? | yes | | + | name | String? | yes | | + | displayName | String? | yes | | + | uid | String? | yes | | + +--- + + + + + #### [LogisticError](#LogisticError) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | value | String? | yes | | + | message | String? | yes | | + +--- + + + + + #### [GetTatProductReqBody](#GetTatProductReqBody) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | locationDetails | [[LocationDetailsReq](#LocationDetailsReq)] | no | | + | toPincode | String | no | | + | action | String? | yes | | + +--- + + + + + #### [LocationDetailsReq](#LocationDetailsReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | fromPincode | String? | yes | | + | articles | [[TatReqProductArticles](#TatReqProductArticles)]? | yes | | + | fulfillmentId | Int? | yes | | + +--- + + + + + #### [TatReqProductArticles](#TatReqProductArticles) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | category | [LogisticRequestCategory](#LogisticRequestCategory)? | yes | | + +--- + + + + + #### [LogisticRequestCategory](#LogisticRequestCategory) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | level | String? | yes | | + +--- + + + + + #### [GetTatProductResponse](#GetTatProductResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | locationDetails | [[LocationDetails](#LocationDetails)] | no | | + | requestUuid | String | no | | + | error | [String: Any] | no | | + | toCity | String | no | | + | source | String | no | | + | toPincode | String | no | | + | action | String | no | | + | stormbreakerUuid | String | no | | + | success | Bool | no | | + | identifier | String | no | | + | journey | String | no | | + +--- + + + + + #### [LocationDetails](#LocationDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | fromPincode | String? | yes | | + | articles | [[TatProductArticles](#TatProductArticles)]? | yes | | + | fulfillmentId | Int? | yes | | + +--- + + + + + #### [TatProductArticles](#TatProductArticles) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | error | [String: Any]? | yes | | + | category | [LogisticResponseCategory](#LogisticResponseCategory)? | yes | | + | promise | [LogisticPromise](#LogisticPromise)? | yes | | + +--- + + + + + #### [LogisticResponseCategory](#LogisticResponseCategory) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | level | String? | yes | | + +--- + + + + + #### [LogisticPromise](#LogisticPromise) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | timestamp | [LogisticTimestamp](#LogisticTimestamp)? | yes | | + | formatted | [Formatted](#Formatted)? | yes | | + +--- + + + + + #### [LogisticTimestamp](#LogisticTimestamp) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | min | Int? | yes | | + | max | Int? | yes | | + +--- + + + + + #### [Formatted](#Formatted) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | min | String? | yes | | + | max | String? | yes | | + +--- + + + + + #### [ApefaceApiError](#ApefaceApiError) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + diff --git a/documentation/application/ORDER.md b/documentation/application/ORDER.md new file mode 100644 index 0000000000..5210d30a1a --- /dev/null +++ b/documentation/application/ORDER.md @@ -0,0 +1,1219 @@ + + + + +##### [Back to Application docs](./README.md) + +## Order Methods +Handles Platform websites OMS +* [getOrders](#getorders) +* [getOrderById](#getorderbyid) +* [getShipmentById](#getshipmentbyid) +* [getShipmentReasons](#getshipmentreasons) +* [updateShipmentStatus](#updateshipmentstatus) +* [trackShipment](#trackshipment) +* [getPosOrderById](#getposorderbyid) +* [getCustomerDetailsByShipmentId](#getcustomerdetailsbyshipmentid) +* [sendOtpToShipmentCustomer](#sendotptoshipmentcustomer) +* [verifyOtpShipmentCustomer](#verifyotpshipmentcustomer) + + + +## Methods with example and description + + +#### getOrders +Get all orders + + + + +```swift +order.getOrders(pageNo: pageNo, pageSize: pageSize, fromDate: fromDate, toDate: toDate, status: status) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | +| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | +| fromDate | String? | no | The date from which the orders should be retrieved. | +| toDate | String? | no | The date till which the orders should be retrieved. | +| status | Int? | no | A filter to retrieve orders by their current status such as _placed_, _delivered_, etc. | + + + +Use this API to retrieve all the orders. + +*Returned Response:* + + + + +[OrderList](#OrderList) + +Success. Returns all the orders. Check the example shown below or refer `OrderList` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getOrderById +Get details of an order + + + + +```swift +order.getOrderById(orderId: orderId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| orderId | String | yes | A unique number used for identifying and tracking your orders. | + + + +Use this API to retrieve order details such as tracking details, shipment, store information using Fynd Order ID. + +*Returned Response:* + + + + +[OrderById](#OrderById) + +Success. Check the example shown below or refer `OrderById` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getShipmentById +Get details of a shipment + + + + +```swift +order.getShipmentById(shipmentId: shipmentId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | + + + +Use this API to retrieve shipment details such as price breakup, tracking details, store information, etc. using Shipment ID. + +*Returned Response:* + + + + +[ShipmentById](#ShipmentById) + +Success. Check the example shown below or refer `ShipmentById` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getShipmentReasons +Get reasons behind full or partial cancellation of a shipment + + + + +```swift +order.getShipmentReasons(shipmentId: shipmentId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | + + + +Use this API to retrieve the issues that led to the cancellation of bags within a shipment. + +*Returned Response:* + + + + +[ShipmentReasons](#ShipmentReasons) + +Success. Check the example shown below or refer `ShipmentReasons` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updateShipmentStatus +Update the shipment status + + + + +```swift +order.updateShipmentStatus(shipmentId: shipmentId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | +| body | ShipmentStatusUpdateBody | yes | Request body | + + +Use this API to update the status of a shipment using its shipment ID. + +*Returned Response:* + + + + +[ShipmentStatusUpdate](#ShipmentStatusUpdate) + +Success. Check the example shown below or refer `ShipmentStatusUpdateBody` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### trackShipment +Track shipment + + + + +```swift +order.trackShipment(shipmentId: shipmentId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | + + + +Use this API to track a shipment using its shipment ID. + +*Returned Response:* + + + + +[ShipmentTrack](#ShipmentTrack) + +Success. Check the example shown below or refer `ShipmentTrack` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getPosOrderById +Get POS Order + + + + +```swift +order.getPosOrderById(orderId: orderId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| orderId | String | yes | A unique number used for identifying and tracking your orders. | + + + +Use this API to retrieve a POS order and all its details such as tracking details, shipment, store information using Fynd Order ID. + +*Returned Response:* + + + + +[PosOrderById](#PosOrderById) + +Success. Check the example shown below or refer `PosOrderById` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getCustomerDetailsByShipmentId +Get Customer Details by Shipment Id + + + + +```swift +order.getCustomerDetailsByShipmentId(orderId: orderId, shipmentId: shipmentId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| orderId | String | yes | A unique number used for identifying and tracking your orders. | +| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | + + + +Use this API to retrieve customer details such as mobileno using Shipment ID. + +*Returned Response:* + + + + +[CustomerDetailsByShipmentId](#CustomerDetailsByShipmentId) + +Success. Check the example shown below or refer `CustomerDetailsByShipmentId` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### sendOtpToShipmentCustomer +Send and Resend Otp code to Order-Shipment customer + + + + +```swift +order.sendOtpToShipmentCustomer(orderId: orderId, shipmentId: shipmentId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| orderId | String | yes | A unique number used for identifying and tracking your orders. | +| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | + + + +Use this API to send OTP to the customer of the mapped Shipment. + +*Returned Response:* + + + + +[sendOTPApplicationResponse](#sendOTPApplicationResponse) + +Success to acknowledge the service was notified + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### verifyOtpShipmentCustomer +Verify Otp code + + + + +```swift +order.verifyOtpShipmentCustomer(orderId: orderId, shipmentId: shipmentId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| orderId | String | yes | A unique number used for identifying and tracking your orders. | +| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | +| body | ReqBodyVerifyOTPShipment | yes | Request body | + + +Use this API to verify OTP and create a session token with custom payload. + +*Returned Response:* + + + + +[ResponseVerifyOTPShipment](#ResponseVerifyOTPShipment) + +Success, the code is valid and returns a session token + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [OrderById](#OrderById) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | order | [OrderSchema](#OrderSchema) | no | | + +--- + + + + + #### [OrderList](#OrderList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[OrderSchema](#OrderSchema)] | no | | + | page | [OrderPage](#OrderPage) | no | | + | filters | [OrderFilters](#OrderFilters) | no | | + +--- + + + + + #### [OrderPage](#OrderPage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemTotal | Int? | yes | | + | type | String? | yes | | + | size | Int? | yes | | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + +--- + + + + + #### [OrderFilters](#OrderFilters) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | statuses | [[OrderStatuses](#OrderStatuses)]? | yes | | + +--- + + + + + #### [OrderStatuses](#OrderStatuses) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | display | String? | yes | | + | value | Int? | yes | | + | isSelected | Bool? | yes | | + +--- + + + + + #### [ReqBodyVerifyOTPShipment](#ReqBodyVerifyOTPShipment) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | requestId | String | no | | + | otpCode | String | no | | + +--- + + + + + #### [ResponseVerifyOTPShipment](#ResponseVerifyOTPShipment) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | | + +--- + + + + + #### [sendOTPApplicationResponse](#sendOTPApplicationResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | | + | requestId | String | no | | + | message | String | no | | + | resendTimer | Int | no | | + +--- + + + + + #### [ShipmentById](#ShipmentById) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | shipment | [Shipments](#Shipments) | no | | + +--- + + + + + #### [CustomerDetailsByShipmentId](#CustomerDetailsByShipmentId) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | orderId | String | no | | + | shipmentId | String | no | | + | name | String | no | | + | phone | String | no | | + | country | String | no | | + +--- + + + + + #### [ShipmentReasons](#ShipmentReasons) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | reasons | [[Reasons](#Reasons)] | no | | + +--- + + + + + #### [ShipmentStatusUpdateBody](#ShipmentStatusUpdateBody) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | statuses | [[StatusesBody](#StatusesBody)] | no | | + | forceTransition | Bool | no | | + +--- + + + + + #### [StatusesBody](#StatusesBody) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | status | String? | yes | | + | shipments | [String: Any]? | yes | | + +--- + + + + + #### [ShipmentStatusUpdate](#ShipmentStatusUpdate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | [[String: Any]] | no | | + | status | Bool | no | | + +--- + + + + + #### [ShipmentTrack](#ShipmentTrack) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | results | [[Track](#Track)] | no | | + +--- + + + + + #### [OrderSchema](#OrderSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | orderId | String? | yes | | + | breakupValues | [[BreakupValues](#BreakupValues)]? | yes | | + | orderCreatedTime | String? | yes | | + | shipments | [[Shipments](#Shipments)]? | yes | | + | totalShipmentsInOrder | Int? | yes | | + | userInfo | [UserInfo](#UserInfo)? | yes | | + | bagsForReorder | [[BagsForReorder](#BagsForReorder)]? | yes | | + +--- + + + + + #### [BagsForReorder](#BagsForReorder) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemId | Int? | yes | | + | itemSize | String? | yes | | + | storeId | Int? | yes | | + | sellerId | Int? | yes | | + | quantity | Int? | yes | | + | articleAssignment | [BagsForReorderArticleAssignment](#BagsForReorderArticleAssignment)? | yes | | + +--- + + + + + #### [BagsForReorderArticleAssignment](#BagsForReorderArticleAssignment) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | level | String? | yes | | + | strategy | String? | yes | | + +--- + + + + + #### [PosOrderById](#PosOrderById) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | order | [OrderSchema](#OrderSchema) | no | | + +--- + + + + + #### [Bags](#Bags) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | item | [Item](#Item)? | yes | | + | prices | [Prices](#Prices)? | yes | | + | currentStatus | [CurrentStatus](#CurrentStatus)? | yes | | + | id | Int? | yes | | + | financialBreakup | [[FinancialBreakup](#FinancialBreakup)]? | yes | | + +--- + + + + + #### [Item](#Item) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | brand | [ItemBrand](#ItemBrand)? | yes | | + | name | String? | yes | | + | size | String? | yes | | + | slugKey | String? | yes | | + | image | [String]? | yes | | + | code | String? | yes | | + | id | Double? | yes | | + +--- + + + + + #### [Prices](#Prices) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amountPaidRoundoff | Double? | yes | | + | fyndCredits | Double? | yes | | + | codCharges | Double? | yes | | + | cashback | Double? | yes | | + | addedToFyndCash | Bool? | yes | | + | priceMarked | Double? | yes | | + | transferPrice | Double? | yes | | + | couponValue | Double? | yes | | + | priceEffective | Double? | yes | | + | refundCredit | Double? | yes | | + | amountPaid | Double? | yes | | + | refundAmount | Double? | yes | | + | cashbackApplied | Double? | yes | | + | gstTaxPercentage | Double? | yes | | + | valueOfGood | Double? | yes | | + | brandCalculatedAmount | Double? | yes | | + | promotionEffectiveDiscount | Double? | yes | | + | discount | Double? | yes | | + | couponEffectiveDiscount | Double? | yes | | + | deliveryCharge | Double? | yes | | + +--- + + + + + #### [CurrentStatus](#CurrentStatus) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | updatedAt | String? | yes | | + | status | String? | yes | | + | name | String? | yes | | + | journeyType | String? | yes | | + +--- + + + + + #### [FinancialBreakup](#FinancialBreakup) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | brandCalculatedAmount | Double? | yes | | + | couponValue | Double? | yes | | + | amountPaidRoundoff | Double? | yes | | + | gstFee | String? | yes | | + | refundCredit | Double? | yes | | + | cashback | Double? | yes | | + | refundAmount | Double? | yes | | + | valueOfGood | Double? | yes | | + | promotionEffectiveDiscount | Double? | yes | | + | size | String? | yes | | + | totalUnits | Int? | yes | | + | discount | Double? | yes | | + | amountPaid | Double? | yes | | + | fyndCredits | Double? | yes | | + | addedToFyndCash | Bool? | yes | | + | deliveryCharge | Double? | yes | | + | hsnCode | String? | yes | | + | couponEffectiveDiscount | Double? | yes | | + | transferPrice | Double? | yes | | + | identifiers | [Identifiers](#Identifiers)? | yes | | + | gstTag | String? | yes | | + | priceMarked | Double? | yes | | + | priceEffective | Double? | yes | | + | codCharges | Double? | yes | | + | itemName | String? | yes | | + | cashbackApplied | Double? | yes | | + | gstTaxPercentage | Double? | yes | | + +--- + + + + + #### [Identifiers](#Identifiers) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | ean | String? | yes | | + | skuCode | String? | yes | | + +--- + + + + + #### [ItemBrand](#ItemBrand) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | logo | String? | yes | | + +--- + + + + + #### [BreakupValues](#BreakupValues) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | display | String? | yes | | + | value | Double? | yes | | + | name | String? | yes | | + +--- + + + + + #### [DeliveryAddress](#DeliveryAddress) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pincode | String? | yes | | + | landmark | String? | yes | | + | contactPerson | String? | yes | | + | phone | String? | yes | | + | state | String? | yes | | + | version | String? | yes | | + | address1 | String? | yes | | + | createdAt | String? | yes | | + | addressType | String? | yes | | + | addressCategory | String? | yes | | + | area | String? | yes | | + | city | String? | yes | | + | latitude | Double? | yes | | + | longitude | Double? | yes | | + | email | String? | yes | | + | country | String? | yes | | + | address2 | String? | yes | | + | updatedAt | String? | yes | | + | name | String? | yes | | + | address | String? | yes | | + +--- + + + + + #### [FulfillingStore](#FulfillingStore) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | code | String? | yes | | + | id | Int? | yes | | + | name | String? | yes | | + | companyId | Int? | yes | | + | companyName | String? | yes | | + +--- + + + + + #### [Invoice](#Invoice) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | updatedDate | String? | yes | | + | invoiceUrl | String? | yes | | + | labelUrl | String? | yes | | + +--- + + + + + #### [Promise](#Promise) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | timestamp | [Timestamp](#Timestamp)? | yes | | + +--- + + + + + #### [Timestamp](#Timestamp) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | min | String? | yes | | + | max | String? | yes | | + +--- + + + + + #### [Reasons](#Reasons) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | reasonText | String? | yes | | + | showTextArea | Bool? | yes | | + | feedbackType | String? | yes | | + | flow | String? | yes | | + | reasonId | Int? | yes | | + | priority | Int? | yes | | + +--- + + + + + #### [ShipmentStatus](#ShipmentStatus) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | hexCode | String? | yes | | + +--- + + + + + #### [ShipmentUserInfo](#ShipmentUserInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | gender | String? | yes | | + | mobile | String? | yes | | + | firstName | String? | yes | | + | lastName | String? | yes | | + +--- + + + + + #### [Shipments](#Shipments) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | orderId | String? | yes | | + | breakupValues | [[BreakupValues](#BreakupValues)]? | yes | | + | trackUrl | String? | yes | | + | trakingNo | String? | yes | | + | awbNo | String? | yes | | + | dpName | String? | yes | | + | trackingDetails | [[TrackingDetails](#TrackingDetails)]? | yes | | + | beneficiaryDetails | Bool? | yes | | + | canReturn | Bool? | yes | | + | canBreak | [String: Any]? | yes | | + | prices | [Prices](#Prices)? | yes | | + | needHelpUrl | String? | yes | | + | shipmentId | String? | yes | | + | totalBags | Int? | yes | | + | deliveryAddress | [DeliveryAddress](#DeliveryAddress)? | yes | | + | invoice | [Invoice](#Invoice)? | yes | | + | comment | String? | yes | | + | orderType | String? | yes | | + | promise | [Promise](#Promise)? | yes | | + | fulfillingStore | [FulfillingStore](#FulfillingStore)? | yes | | + | bags | [[Bags](#Bags)]? | yes | | + | canCancel | Bool? | yes | | + | payment | [ShipmentPayment](#ShipmentPayment)? | yes | | + | shipmentCreatedAt | String? | yes | | + | shipmentStatus | [ShipmentStatus](#ShipmentStatus)? | yes | | + | userInfo | [ShipmentUserInfo](#ShipmentUserInfo)? | yes | | + | sizeInfo | [String: Any]? | yes | | + | totalDetails | [ShipmentTotalDetails](#ShipmentTotalDetails)? | yes | | + +--- + + + + + #### [ShipmentTotalDetails](#ShipmentTotalDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | totalPrice | Double? | yes | | + | sizes | Int? | yes | | + | pieces | Int? | yes | | + +--- + + + + + #### [ShipmentPayment](#ShipmentPayment) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | logo | String? | yes | | + | mode | String? | yes | | + | status | String? | yes | | + +--- + + + + + #### [Track](#Track) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | awb | String? | yes | | + | updatedAt | String? | yes | | + | lastLocationRecievedAt | String? | yes | | + | reason | String? | yes | | + | shipmentType | String? | yes | | + | status | String? | yes | | + | updatedTime | String? | yes | | + | accountName | String? | yes | | + +--- + + + + + #### [TrackingDetails](#TrackingDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isCurrent | Bool? | yes | | + | status | String? | yes | | + | time | String? | yes | | + | isPassed | Bool? | yes | | + +--- + + + + + #### [UserInfo](#UserInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | gender | String? | yes | | + | mobile | String? | yes | | + | name | String? | yes | | + | email | String? | yes | | + +--- + + + + + #### [ApefaceApiError](#ApefaceApiError) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + diff --git a/documentation/application/PAYMENT.md b/documentation/application/PAYMENT.md new file mode 100644 index 0000000000..fb4ea0915d --- /dev/null +++ b/documentation/application/PAYMENT.md @@ -0,0 +1,2894 @@ + + + + +##### [Back to Application docs](./README.md) + +## Payment Methods +Collect payment through many payment gateway i.e Stripe, Razorpay, Juspay etc.into Fynd or Self account +* [getAggregatorsConfig](#getaggregatorsconfig) +* [attachCardToCustomer](#attachcardtocustomer) +* [getActiveCardAggregator](#getactivecardaggregator) +* [getActiveUserCards](#getactiveusercards) +* [deleteUserCard](#deleteusercard) +* [verifyCustomerForPayment](#verifycustomerforpayment) +* [verifyAndChargePayment](#verifyandchargepayment) +* [initialisePayment](#initialisepayment) +* [checkAndUpdatePaymentStatus](#checkandupdatepaymentstatus) +* [getPaymentModeRoutes](#getpaymentmoderoutes) +* [getPosPaymentModeRoutes](#getpospaymentmoderoutes) +* [getRupifiBannerDetails](#getrupifibannerdetails) +* [getActiveRefundTransferModes](#getactiverefundtransfermodes) +* [enableOrDisableRefundTransferMode](#enableordisablerefundtransfermode) +* [getUserBeneficiariesDetail](#getuserbeneficiariesdetail) +* [verifyIfscCode](#verifyifsccode) +* [getOrderBeneficiariesDetail](#getorderbeneficiariesdetail) +* [verifyOtpAndAddBeneficiaryForBank](#verifyotpandaddbeneficiaryforbank) +* [addBeneficiaryDetails](#addbeneficiarydetails) +* [addRefundBankAccountUsingOTP](#addrefundbankaccountusingotp) +* [verifyOtpAndAddBeneficiaryForWallet](#verifyotpandaddbeneficiaryforwallet) +* [updateDefaultBeneficiary](#updatedefaultbeneficiary) + + + +## Methods with example and description + + +#### getAggregatorsConfig +Get payment gateway keys + + + + +```swift +payment.getAggregatorsConfig(xApiToken: xApiToken, refresh: refresh) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| xApiToken | String? | no | Used for basic authentication. | +| refresh | Bool? | no | This is a boolean value. Select `true` to remove temporary cache files on payment gateway and replace with the latest one. | + + + +Use this API to retrieve the payment gateway key, secrets, merchant, SDK/API details to complete a payment at front-end. + +*Returned Response:* + + + + +[AggregatorsConfigDetailResponse](#AggregatorsConfigDetailResponse) + +Success. Returns the keys of all payment gateways. Check the example shown below or refer `AggregatorsConfigDetailResponse` for more details. + + + + +
    +  Example: + +```json +{ + "simpl": { + "key": "bf9d0ff65ffe6e54223a871e733bbd1c", + "secret": "XXXX-XXXX-XXXX-XXXX", + "config_type": "fynd", + "sdk": true + }, + "juspay": { + "key": "XXXX-XXXX-XXXX-XXXX", + "secret": "XXXX-XXXX-XXXX-XXXX", + "config_type": "fynd", + "merchant_key": "XXXX-XXXX-XXXX-XXXX", + "sdk": false, + "api": "https://api.juspay.in" + }, + "mswipe": { + "key": "XXXX-XXXX-XXXX-XXXX", + "secret": "XXXX-XXXX-XXXX-XXXX", + "config_type": "fynd", + "merchant_id": "XXXX-XXXX-XXXX-XXXX", + "user_id": "XXXX-XXXX-XXXX-XXXX", + "pin": "XXXX-XXXX-XXXX-XXXX", + "sdk": true, + "verify_api": "https://www.mswipetech.com/verificationapi/api/VerificationApi/MswipeCardSaleVerificationApi" + }, + "razorpay": { + "key": "XXXX-XXXX-XXXX-XXXX", + "secret": "XXXX-XXXX-XXXX-XXXX", + "config_type": "fynd", + "webhook_secret": "XXXX-XXXX-XXXX-XXXX", + "sdk": true, + "api": "https://api.razorpay.com/v1/", + "vpa": "XXXX-XXXX-XXXX-XXXX" + }, + "success": true, + "env": "live" +} +``` +
    + + + + + + + + + +--- + + +#### attachCardToCustomer +Attach a saved card to customer. + + + + +```swift +payment.attachCardToCustomer(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | AttachCardRequest | yes | Request body | + + +Use this API to attach a customer's saved card at the payment gateway, such as Stripe, Juspay. + +*Returned Response:* + + + + +[AttachCardsResponse](#AttachCardsResponse) + +Success. Check the example shown below or refer `AttachCardsResponse` for more details. + + + + +
    +  Example: + +```json +{ + "success": true, + "message": "", + "data": { + "id": "pm_1IGQlvHY5NCLOJpYNTBP6WpY", + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 11, + "exp_year": 2025, + "fingerprint": "poKWfSweJ0I5CvEA", + "funding": "credit", + "generated_from": null, + "last4": "1111", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + } +} +``` +
    + + + + + + + + + +--- + + +#### getActiveCardAggregator +Fetch active payment gateway for card payments + + + + +```swift +payment.getActiveCardAggregator(refresh: refresh) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| refresh | Bool? | no | | + + + +Use this API to retrieve an active payment aggregator along with the Customer ID. This is applicable for cards payments only. + +*Returned Response:* + + + + +[ActiveCardPaymentGatewayResponse](#ActiveCardPaymentGatewayResponse) + +Success. Returns an active payment gateway. Check the example shown below or refer `ActiveCardPaymentGatewayResponse` for more details. + + + + +
    +  Example: + +```json +{ + "success": true, + "message": "", + "cards": { + "aggregator": "Stripe", + "api": "https://www.example.com/cards/", + "customer_id": "lorem_12345" + } +} +``` +
    + + + + + + + + + +--- + + +#### getActiveUserCards +Fetch the list of cards saved by the user + + + + +```swift +payment.getActiveUserCards(forceRefresh: forceRefresh) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| forceRefresh | Bool? | no | | + + + +Use this API to retrieve a list of cards stored by user from an active payment gateway. + +*Returned Response:* + + + + +[ListCardsResponse](#ListCardsResponse) + +Success. Returns a list of cards saved by the user. Check the example shown below or refer `ListCardsResponse` for more details. + + + + +
    +  Example: + +```json +{ + "success": true, + "message": "Success", + "data": [ + { + "aggregator_name": "Razorpay", + "card_id": "token_lorem_ipsum_001", + "card_token": "card_token_lorem_ipsum_001", + "card_reference": "ref_lorem_ipsum_001", + "card_number": "XXXX-XXXX-XXXX-1111", + "card_isin": "001", + "exp_year": 2025, + "exp_month": 5, + "card_type": "credit", + "card_issuer": "ICIC", + "card_brand": "VISA", + "nickname": "Visa", + "card_name": "Lorem Ipsum", + "expired": false, + "card_fingerprint": null, + "card_brand_image": "https://hdn-1.fynd.com/payment/visa.png" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### deleteUserCard +Delete a card + + + + +```swift +payment.deleteUserCard(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | DeletehCardRequest | yes | Request body | + + +Use this API to delete a card added by a user on the payment gateway and clear the cache. + +*Returned Response:* + + + + +[DeleteCardsResponse](#DeleteCardsResponse) + +Success. Returns a success message if card is deleted. + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### verifyCustomerForPayment +Validate customer for payment + + + + +```swift +payment.verifyCustomerForPayment(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | ValidateCustomerRequest | yes | Request body | + + +Use this API to check if the customer is eligible to use credit-line facilities such as Simpl Pay Later and Rupifi. + +*Returned Response:* + + + + +[ValidateCustomerResponse](#ValidateCustomerResponse) + +Success. Check the example shown below or refer `ValidateCustomerResponse` for more details. + + + + +
    +  Example: + +```json +{ + "success": true, + "message": "data fetched", + "data": { + "api_version": 2, + "data": { + "approved": true, + "button_text": "Buy Now, Pay Later", + "first_transaction": false + }, + "aggregator": "Simpl" + } +} +``` +
    + + + + + + + + + +--- + + +#### verifyAndChargePayment +Verify and charge payment + + + + +```swift +payment.verifyAndChargePayment(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | ChargeCustomerRequest | yes | Request body | + + +Use this API to verify and check the status of a payment transaction (server-to-server) made through aggregators like Simpl and Mswipe. + +*Returned Response:* + + + + +[ChargeCustomerResponse](#ChargeCustomerResponse) + +Success. Check the example shown below or refer `ChargeCustomerResponse` for more details. + + + + +
    +  Example: + +```json +{ + "success": true, + "message": "Payment Successful", + "status": "complete", + "order_id": "FY000000001000000101", + "aggregator": "Simpl", + "cart_id": "0000000", + "delivery_address_id": "0000000" +} +``` +
    + + + + + + + + + +--- + + +#### initialisePayment +Initialize a payment (server-to-server) for UPI and BharatQR + + + + +```swift +payment.initialisePayment(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | PaymentInitializationRequest | yes | Request body | + + +PUse this API to inititate payment using UPI, BharatQR, wherein the UPI requests are send to the app and QR code is displayed on the screen. + +*Returned Response:* + + + + +[PaymentInitializationResponse](#PaymentInitializationResponse) + +Success. Check the example shown below or refer `PaymentInitializationResponse` for more details. + + + + +
    +  Example: + +```json +{ + "success": true, + "aggregator": "UPI_Razorpay", + "method": "upi", + "status": "success", + "merchant_order_id": "FY000120000101", + "aggregator_order_id": "lorem_GX8W00p2ipsum", + "polling_url": "https://api.fynd.com/service/application/payment/v0.1/payments/confirm/polling/?app_id=000000000000000000000001", + "timeout": 240, + "virtual_id": null, + "razorpay_payment_id": "pay_dummy_001", + "customer_id": "cust_dummy_001" +} +``` +
    + + + + + + + + + +--- + + +#### checkAndUpdatePaymentStatus +Performs continuous polling to check status of payment on the server + + + + +```swift +payment.checkAndUpdatePaymentStatus(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | PaymentStatusUpdateRequest | yes | Request body | + + +Use this API to perform continuous polling at intervals to check the status of payment until timeout. + +*Returned Response:* + + + + +[PaymentStatusUpdateResponse](#PaymentStatusUpdateResponse) + +Success. Returns the status of payment. Check the example shown below or refer `PaymentStatusUpdateResponse` for more details. + + + + +
    +  Example: + +```json +{ + "aggregator_name": "UPI_Razorpay", + "status": "success", + "retry": false +} +``` +
    + + + + + + + + + +--- + + +#### getPaymentModeRoutes +Get applicable payment options + + + + +```swift +payment.getPaymentModeRoutes(amount: amount, cartId: cartId, pincode: pincode, checkoutMode: checkoutMode, refresh: refresh, cardReference: cardReference, userDetails: userDetails) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| amount | Int | yes | Payable amount. | +| cartId | String | yes | Identifier of the cart. | +| pincode | String | yes | The PIN Code of the destination address, e.g. 400059 | +| checkoutMode | String | yes | Option to checkout for self or for others. | +| refresh | Bool? | no | This is a boolean value. Select `true` to remove temporary cache files on payment gateway and replace with the latest one. | +| cardReference | String? | no | Card reference id of user's debit or credit card. | +| userDetails | String? | no | URIencoded JSON containing details of an anonymous user. | + + + +Use this API to get all valid payment options for doing a payment. + +*Returned Response:* + + + + +[PaymentModeRouteResponse](#PaymentModeRouteResponse) + +Success. Returns all available options for payment. Check the example shown below or refer `PaymentModeRouteResponse` for more details. + + + + +
    +  Example: + +```json +{ + "success": true, + "payment_options": { + "payment_option": [ + { + "name": "CARD", + "display_priority": 2, + "payment_mode_id": 2, + "display_name": "Card", + "list": [], + "anonymous_enable": true, + "aggregator_name": "Razorpay", + "add_card_enabled": false + }, + { + "name": "NB", + "display_priority": 3, + "payment_mode_id": 3, + "display_name": "Net Banking", + "list": [ + { + "aggregator_name": "Razorpay", + "name": "ICICI Bank", + "code": "ICIC", + "bank_name": "ICICI Bank", + "bank_code": "ICIC", + "url": "https://hdn-1.fynd.com/payment/NB_ICICI.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_ICICI.png", + "large": "https://hdn-1.fynd.com/payment/NB_ICICI.png" + }, + "merchant_code": "NB_ICICI", + "display_priority": 1, + "display_name": "ICICI Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "HDFC Bank", + "code": "HDFC", + "bank_name": "HDFC Bank", + "bank_code": "HDFC", + "url": "https://hdn-1.fynd.com/payment/NB_HDFC.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_HDFC.png", + "large": "https://hdn-1.fynd.com/payment/NB_HDFC.png" + }, + "merchant_code": "NB_HDFC", + "display_priority": 2, + "display_name": "HDFC Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Axis Bank", + "code": "UTIB", + "bank_name": "Axis Bank", + "bank_code": "UTIB", + "url": "https://hdn-1.fynd.com/payment/NB_AXIS.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_AXIS.png", + "large": "https://hdn-1.fynd.com/payment/NB_AXIS.png" + }, + "merchant_code": "NB_AXIS", + "display_priority": 3, + "display_name": "Axis Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "State Bank of India", + "code": "SBIN", + "bank_name": "State Bank of India", + "bank_code": "SBIN", + "url": "https://hdn-1.fynd.com/payment/NB_SBI.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_SBI.png", + "large": "https://hdn-1.fynd.com/payment/NB_SBI.png" + }, + "merchant_code": "NB_SBI", + "display_priority": 4, + "display_name": "State Bank of India" + }, + { + "aggregator_name": "Razorpay", + "name": "Kotak Mahindra Bank", + "code": "KKBK", + "bank_name": "Kotak Mahindra Bank", + "bank_code": "KKBK", + "url": "https://hdn-1.fynd.com/payment/NB_KOTAK.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_KOTAK.png", + "large": "https://hdn-1.fynd.com/payment/NB_KOTAK.png" + }, + "merchant_code": "NB_KOTAK", + "display_priority": 5, + "display_name": "Kotak Mahindra Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Indusind Bank", + "code": "INDB", + "bank_name": "Indusind Bank", + "bank_code": "INDB", + "url": "https://hdn-1.fynd.com/payment/NB_INDUS.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_INDUS.png", + "large": "https://hdn-1.fynd.com/payment/NB_INDUS.png" + }, + "merchant_code": "INDB", + "display_priority": 6, + "display_name": "Indusind Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "City Union Bank", + "code": "CIUB", + "bank_name": "City Union Bank", + "bank_code": "CIUB", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_CUB", + "display_priority": 9, + "display_name": "City Union Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Catholic Syrian Bank", + "code": "CSBK", + "bank_name": "Catholic Syrian Bank", + "bank_code": "CSBK", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "CSBK", + "display_priority": 11, + "display_name": "Catholic Syrian Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "State Bank of Hyderabad", + "code": "SBHY", + "bank_name": "State Bank of Hyderabad", + "bank_code": "SBHY", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_SBH", + "display_priority": 12, + "display_name": "State Bank of Hyderabad" + }, + { + "aggregator_name": "Razorpay", + "name": "Allahabad Bank", + "code": "ALLA", + "bank_name": "Allahabad Bank", + "bank_code": "ALLA", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "ALLA", + "display_priority": 15, + "display_name": "Allahabad Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Syndicate Bank", + "code": "SYNB", + "bank_name": "Syndicate Bank", + "bank_code": "SYNB", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "SYNB", + "display_priority": 17, + "display_name": "Syndicate Bank" + } + ] + }, + { + "name": "WL", + "display_priority": 4, + "payment_mode_id": 4, + "display_name": "Wallet", + "list": [ + { + "wallet_name": "Paytm", + "wallet_code": "paytm", + "name": "Paytm", + "display_name": "Paytm", + "code": "paytm", + "wallet_id": 4, + "merchant_code": "PAYTM", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/paytm_logo_small.png", + "large": "https://hdn-1.fynd.com/payment/paytm_logo_large.png" + }, + "aggregator_name": "Juspay", + "display_priority": 1 + }, + { + "wallet_name": "Amazon Pay", + "wallet_code": "amazonpay", + "name": "Amazon Pay", + "display_name": "Amazon Pay", + "code": "amazonpay", + "wallet_id": 10, + "merchant_code": "AMAZONPAY", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/amazon-pay.png", + "large": "https://hdn-1.fynd.com/payment/amazon-pay.png" + }, + "aggregator_name": "Razorpay", + "display_priority": 9 + } + ] + }, + { + "name": "UPI", + "display_priority": 9, + "payment_mode_id": 7, + "display_name": "UPI", + "list": [ + { + "aggregator_name": "Razorpay", + "name": "UPI", + "display_name": "BHIM UPI", + "code": "UPI", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/upi_100x78.png", + "large": "https://hdn-1.fynd.com/payment/upi_150x100.png" + }, + "merchant_code": "UPI", + "timeout": 310, + "retry_count": 0, + "fynd_vpa": "shopsense.rzp@hdfcbank", + "intent_flow": true, + "intent_app": [ + { + "code": "google_pay", + "display_name": "Google Pay", + "package_name": "com.google.android.apps.nbu.paisa.user", + "logos": { + "small": "https://hdn-1.fynd.com/payment/upi-google-pay.png", + "large": "https://hdn-1.fynd.com/payment/upi-google-pay.png" + } + } + ], + "intent_app_error_list": [ + "com.csam.icici.bank.imobile", + "in.org.npci.upiapp", + "com.whatsapp" + ], + "intent_app_error_dict_list": [ + { + "package_name": "com.csam.icici.bank.imobile", + "code": "icici" + }, + { + "package_name": "in.org.npci.upiapp", + "code": "upiapp" + }, + { + "package_name": "com.whatsapp", + "code": "whatsapp" + } + ] + } + ] + }, + { + "name": "JUSPAYPG", + "display_priority": 18, + "payment_mode_id": 24, + "display_name": "Pay Using Juspay", + "list": [] + }, + { + "name": "PL", + "display_priority": 21, + "display_name": "Pay Later", + "list": [ + { + "aggregator_name": "Simpl", + "name": "Simpl", + "display_name": "Simpl", + "code": "simpl", + "merchant_code": "SIMPL", + "logo": "https://hdn-1.fynd.com/payment/simpl_logo.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/simpl_logo.png", + "large": "https://hdn-1.fynd.com/payment/simpl_logo.png" + } + } + ] + } + ], + "payment_flows": { + "simpl": { + "data": { + "gateway": { + "route": "simpl", + "entity": "sdk", + "is_customer_validation_required": true, + "cust_validation_url": "https://api.fyndx0.de/gringotts/api/v1/validate-customer/?app_id=000000000000000000000001", + "sdk": { + "config": { + "redirect": false, + "callback_url": null, + "action_url": "https://api.fyndx0.de/platform/payment/v2/external/payments/confirm/charge/?app_id=000000000000000000000001" + }, + "data": { + "user_phone": "9999632145", + "user_email": "app@fynd.com" + } + }, + "return_url": null + } + }, + "api_link": "", + "payment_flow": "sdk", + "payment_flow_data": { + "is_customer_validation_required": true, + "cust_validation_url": "https://api.fyndx0.de/platform/payment/api/v1/validate-customer/?app_id=000000000000000000000001", + "config": { + "redirect": false, + "final_payment_action_url": "https://api.fyndx0.de/platform/payment/v2/external/payments/confirm/charge/?app_id=000000000000000000000001" + }, + "data": { + "user_phone": null, + "user_email": null + }, + "return_url": null + } + }, + "mswipe": { + "data": { + "gateway": { + "sdk": { + "config": { + "redirect": false, + "action_url": "url", + "webhook_url": "url", + "timeout": 60 + } + } + } + }, + "api_link": "", + "payment_flow": "sdk" + }, + "juspay": { + "data": {}, + "api_link": "https://sandbox.juspay.in/txns", + "payment_flow": "api" + }, + "razorpay": { + "data": {}, + "api_link": "", + "payment_flow": "sdk" + }, + "bqr_razorpay": { + "data": {}, + "api_link": "https://api.fyndx0.de/platform/payment/v2/external/payments/request/?app_id=000000000000000000000001", + "payment_flow": "api" + }, + "fynd": { + "data": {}, + "api_link": "", + "payment_flow": "api" + }, + "jio": { + "data": {}, + "api_link": "", + "payment_flow": "api" + }, + "stripe": { + "data": {}, + "api_link": "", + "payment_flow": "sdk" + }, + "ccavenue": { + "data": {}, + "api_link": "", + "payment_flow": "sdk" + }, + "payumoney": { + "data": {}, + "api_link": "", + "payment_flow": "sdk" + }, + "rupifi": { + "data": {}, + "api_link": "", + "return_url": "", + "payment_flow": "api", + "cust_validation_url": "https://api.jiox0.de/gringotts/api/v1/validate-customer/", + "payment_flow_data": { + "is_customer_validation_required": true, + "cust_validation_url": "https://api.fyndx0.de/platform/payment/api/v1/validate-customer/?app_id=000000000000000000000001", + "config": { + "redirect": false, + "final_payment_action_url": "https://api.fyndx0.de/platform/payment/v2/external/payments/confirm/charge/?app_id=000000000000000000000001" + }, + "data": { + "user_phone": null, + "user_email": null + }, + "return_url": null + } + } + } + } +} +``` +
    + + + + + + + + + +--- + + +#### getPosPaymentModeRoutes +Get applicable payment options for Point-of-Sale (POS) + + + + +```swift +payment.getPosPaymentModeRoutes(amount: amount, cartId: cartId, pincode: pincode, checkoutMode: checkoutMode, refresh: refresh, cardReference: cardReference, orderType: orderType, userDetails: userDetails) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| amount | Int | yes | Payable amount. | +| cartId | String | yes | Identifier of the cart. | +| pincode | String | yes | The PIN Code of the destination address, e.g. 400059 | +| checkoutMode | String | yes | Option to checkout for self or for others. | +| refresh | Bool? | no | This is a boolean value. Select `true` to remove temporary cache files on payment gateway and replace with the latest one. | +| cardReference | String? | no | Card reference id of user's debit or credit card. | +| orderType | String | yes | The order type of shipment * HomeDelivery - If the customer wants the order home-delivered * PickAtStore - If the customer wants the handover of an order at the store itself. | +| userDetails | String? | no | URIencoded JSON containing details of an anonymous user. | + + + +Use this API to get all valid payment options for doing a payment in POS. + +*Returned Response:* + + + + +[PaymentModeRouteResponse](#PaymentModeRouteResponse) + +Success. Returns all available options for payment. Check the example shown below or refer `PaymentModeRouteResponse` for more details. + + + + +
    +  Example: + +```json +{ + "success": true, + "payment_options": { + "payment_option": [ + { + "name": "CAS", + "display_priority": 21, + "payment_mode_id": 39, + "display_name": "Cash at Store", + "list": [ + { + "aggregator_name": "Fynd", + "name": "CAS", + "display_name": "CASH", + "code": "CAS", + "logo_url": { + "large": "https://hdn-1.fynd.com/payment/cod.png", + "small": "https://hdn-1.fynd.com/payment/cod.png" + }, + "merchant_code": "CAS" + } + ] + }, + { + "name": "CSAS", + "display_priority": 21, + "payment_mode_id": 40, + "display_name": "Card Swiped at Store", + "list": [ + { + "aggregator_name": "Fynd", + "name": "CSAS", + "display_name": "Card Swipe", + "code": "CSAS", + "logo_url": { + "large": "https://hdn-1.fynd.com/payment/cod.png", + "small": "https://hdn-1.fynd.com/payment/cod.png" + }, + "merchant_code": "CSAS" + } + ] + }, + { + "name": "UPI", + "display_priority": 9, + "payment_mode_id": 7, + "display_name": "UPI", + "list": [ + { + "aggregator_name": "Razorpay", + "name": "UPI", + "display_name": "BHIM UPI", + "code": "UPI", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/upi_100x78.png", + "large": "https://hdn-1.fynd.com/payment/upi_150x100.png" + }, + "merchant_code": "UPI", + "timeout": 240, + "retry_count": 0, + "fynd_vpa": "shopsense.rzp@hdfcbank", + "intent_flow": true, + "intent_app": [ + { + "code": "google_pay", + "display_name": "Google Pay", + "package_name": "com.google.android.apps.nbu.paisa.user", + "logos": { + "small": "https://hdn-1.fynd.com/payment/upi-google-pay.png", + "large": "https://hdn-1.fynd.com/payment/upi-google-pay.png" + } + } + ], + "intent_app_error_list": [ + "com.csam.icici.bank.imobile", + "in.org.npci.upiapp", + "com.whatsapp" + ], + "intent_app_error_dict_list": [ + { + "package_name": "com.csam.icici.bank.imobile", + "code": "icici" + }, + { + "package_name": "in.org.npci.upiapp", + "code": "upiapp" + }, + { + "package_name": "com.whatsapp", + "code": "whatsapp" + } + ] + } + ] + } + ], + "payment_flows": { + "simpl": { + "data": { + "gateway": { + "route": "simpl", + "entity": "sdk", + "is_customer_validation_required": true, + "cust_validation_url": "https://api.fyndx0.de/gringotts/api/v1/validate-customer/?app_id=000000000000000000000001", + "sdk": { + "config": { + "redirect": false, + "callback_url": null, + "action_url": "https://api.fyndx0.de/platform/payment/v2/external/payments/confirm/charge/?app_id=000000000000000000000001" + }, + "data": { + "user_phone": "9999632145", + "user_email": "app@fynd.com" + } + }, + "return_url": null + } + }, + "api_link": "", + "payment_flow": "sdk" + }, + "juspay": { + "data": {}, + "api_link": "https://sandbox.juspay.in/txns", + "payment_flow": "api" + }, + "razorpay": { + "data": {}, + "api_link": "", + "payment_flow": "sdk" + }, + "upi_razorpay": { + "data": {}, + "api_link": "https://api.fyndx0.de/platform/payment/v2/external/payments/request/?app_id=000000000000000000000001", + "payment_flow": "api" + }, + "bqr_razorpay": { + "data": {}, + "api_link": "https://api.fyndx0.de/platform/payment/v2/external/payments/request/?app_id=000000000000000000000001", + "payment_flow": "api" + }, + "cashfree": { + "data": {}, + "api_link": "", + "payment_flow": "api" + }, + "fynd": { + "data": {}, + "api_link": "", + "payment_flow": "api" + }, + "jio": { + "data": {}, + "api_link": "", + "payment_flow": "api" + }, + "stripe": { + "data": {}, + "api_link": "", + "payment_flow": "sdk" + }, + "ccavenue": { + "data": {}, + "api_link": "", + "payment_flow": "sdk" + }, + "payumoney": { + "data": {}, + "api_link": "", + "payment_flow": "sdk" + }, + "rupifi": { + "data": {}, + "api_link": "", + "return_url": "", + "payment_flow": "api", + "cust_validation_url": "https://api.jiox0.de/gringotts/api/v1/validate-customer/" + } + } + } +} +``` +
    + + + + + + + + + +--- + + +#### getRupifiBannerDetails +Get CreditLine Offer + + + + +```swift +payment.getRupifiBannerDetails() { (response, error) in + // Use response +} +``` + + + + + + +Get CreditLine Offer if user is tentatively approved by rupifi + +*Returned Response:* + + + + +[RupifiBannerResponse](#RupifiBannerResponse) + +Success. Return CreditLine Offer detail. Check the example shown below or refer `RupifiBannerResponseSchema` for more details. + + + + +
    +  Example: + +```json +{ + "success": true, + "data": { + "kyc_url": "http://rupifi.kyc1.com/", + "status": "APPROVED" + } +} +``` +
    + + + + + + + + + +--- + + +#### getActiveRefundTransferModes +Lists the mode of refund + + + + +```swift +payment.getActiveRefundTransferModes() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to retrieve eligible refund modes (such as Netbanking) and add the beneficiary details. + +*Returned Response:* + + + + +[TransferModeResponse](#TransferModeResponse) + +Success. Shows the available refund mode to choose, e.g. Netbanking. Check the example shown below or refer `TransferModeResponse` for more details. + + + + +
    +  Example: + +```json +{ + "data": [ + { + "display_name": "BANK", + "items": [ + { + "id": 6, + "name": "bank", + "display_name": "BANK", + "logo_small": "https://hdn-1.fynd.com/payment/netbanking.png", + "logo_large": "https://hdn-1.fynd.com/payment/netbanking.png" + } + ] + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### enableOrDisableRefundTransferMode +Enable/Disable a mode for transferring a refund + + + + +```swift +payment.enableOrDisableRefundTransferMode(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | UpdateRefundTransferModeRequest | yes | Request body | + + +Activate or Deactivate Transfer Mode to collect Beneficiary Details for Refund + +*Returned Response:* + + + + +[UpdateRefundTransferModeResponse](#UpdateRefundTransferModeResponse) + +Success. Shows whether the refund mode was successfully enabled or disabled. + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getUserBeneficiariesDetail +Lists the beneficiary of a refund + + + + +```swift +payment.getUserBeneficiariesDetail(orderId: orderId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| orderId | String | yes | A unique number used for identifying and tracking your orders. | + + + +Use this API to get the details of all active beneficiary added by a user for refund. + +*Returned Response:* + + + + +[OrderBeneficiaryResponse](#OrderBeneficiaryResponse) + +Success. Returns the details of the beneficiary getting a refund. Check the example shown below or refer `OrderBeneficiaryResponse` for more details. + + + + +
    +  Example: + +```json +{ + "beneficiaries": [ + { + "id": 221, + "beneficiary_id": "0f7e44a922df352c05c5f73cb40ba115", + "bank_name": "State Bank of India", + "branch_name": "State Bank of India", + "account_holder": "SHASHI TEST", + "account_no": "1234567891", + "ifsc_code": "SBIN0005611", + "mobile": "9112042174", + "email": "payment@gofynd.com", + "address": "204A", + "comment": "", + "is_active": null, + "created_on": "2020-06-29 12:38:39", + "modified_on": "2020-06-29 12:38:39", + "display_name": "BANK", + "transfer_mode": "bank", + "title": "Bank Account", + "subtitle": "1234567891", + "delights_user_name": null + } + ], + "show_beneficiary_details": false +} +``` +
    + + + + + + + + + +--- + + +#### verifyIfscCode +Verify IFSC Code + + + + +```swift +payment.verifyIfscCode(ifscCode: ifscCode) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| ifscCode | String? | no | A 11-digit alphanumeric code that uniquely identifies a bank branch. | + + + +Use this API to check whether the 11-digit IFSC code is valid and to fetch the bank details for refund. + +*Returned Response:* + + + + +[IfscCodeResponse](#IfscCodeResponse) + +Success. Shows whether the IFSC code is valid, and returns the bank details. Check the example shown below or refer `IfscCodeResponse` for more details. + + + + +
    +  Example: + +```json +{ + "branch_name": "MANPUR", + "bank_name": "GAYA", + "BRANCH": "MANPUR", + "CENTRE": "GAYA", + "DISTRICT": "GAYA", + "STATE": "BIHAR", + "ADDRESS": "POBUNIYADGANJBIHAR", + "CONTACT": "00", + "MICR": "816002103", + "UPI": true, + "RTGS": true, + "CITY": "GAYA", + "NEFT": true, + "IMPS": true, + "SWIFT": "", + "BANK": "State Bank of India", + "BANKCODE": "SBIN", + "IFSC": "SBIN0005611", + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getOrderBeneficiariesDetail +Lists the beneficiary of a refund + + + + +```swift +payment.getOrderBeneficiariesDetail(orderId: orderId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| orderId | String | yes | A unique number used for identifying and tracking your orders. | + + + +Use this API to get the details of all active beneficiary added by a user for refund. + +*Returned Response:* + + + + +[OrderBeneficiaryResponse](#OrderBeneficiaryResponse) + +Success. Returns the details of the beneficiary getting a refund. Check the example shown below or refer `OrderBeneficiaryResponse` for more details. + + + + +
    +  Example: + +```json +{ + "beneficiaries": [ + { + "id": 3695, + "beneficiary_id": "4c86dd56e634a4c6a8fb51d195bc7b83", + "bank_name": "State Bank of India", + "branch_name": "BHOGAT", + "account_holder": "PRAKASH TEST", + "account_no": "3566342455454", + "ifsc_code": "SBIN0014982", + "mobile": "7819064010", + "email": "prakashtest@gmail.com", + "address": "49A, Dabhi seri, jodhpur, kalyanpur", + "comment": "COD Refund", + "is_active": null, + "created_on": "2021-01-22 11:31:02", + "modified_on": "2021-01-22 11:31:02", + "display_name": "BANK", + "transfer_mode": "bank", + "title": "Bank Account", + "subtitle": "35663423659", + "delights_user_name": "shreeniwas_24x7_gmail_com_45978_16624463" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### verifyOtpAndAddBeneficiaryForBank +Verify the beneficiary details using OTP + + + + +```swift +payment.verifyOtpAndAddBeneficiaryForBank(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | AddBeneficiaryViaOtpVerificationRequest | yes | Request body | + + +Use this API to perform an OTP validation before saving the beneficiary details added for a refund. + +*Returned Response:* + + + + +[AddBeneficiaryViaOtpVerificationResponse](#AddBeneficiaryViaOtpVerificationResponse) + +Success. Check the example shown below or refer `AddBeneficiaryViaOtpVerificationRequest` for more details. + + + + +
    +  Example: + +```json +{ + "success": true, + "message": "Account successfully created" +} +``` +
    + + + + + + + + + +--- + + +#### addBeneficiaryDetails +Save bank details for cancelled/returned order + + + + +```swift +payment.addBeneficiaryDetails(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | AddBeneficiaryDetailsRequest | yes | Request body | + + +Use this API to save the bank details for a returned or cancelled order to refund the amount. + +*Returned Response:* + + + + +[RefundAccountResponse](#RefundAccountResponse) + +Success. Shows whether the beneficiary details were saved to a returned/cancelled order or not. + + + + +
    +  Example: + +```json +{ + "success": true, + "message": "Account successfully created", + "data": {}, + "is_verified_flag": true +} +``` +
    + + + + + + + + + +--- + + +#### addRefundBankAccountUsingOTP +Save bank details for cancelled/returned order + + + + +```swift +payment.addRefundBankAccountUsingOTP(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | AddBeneficiaryDetailsOTPRequest | yes | Request body | + + +Use this API to save bank details for returned/cancelled order to refund amount in his account. + +*Returned Response:* + + + + +[RefundAccountResponse](#RefundAccountResponse) + +Success. Shows whether the beneficiary details were saved to a returned/cancelled order or not. + + + + +
    +  Example: + +```json +{ + "success": true, + "message": "Account successfully created", + "data": {}, + "is_verified_flag": true +} +``` +
    + + + + + + + + + +--- + + +#### verifyOtpAndAddBeneficiaryForWallet +Send OTP on adding a wallet beneficiary + + + + +```swift +payment.verifyOtpAndAddBeneficiaryForWallet(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | WalletOtpRequest | yes | Request body | + + +Use this API to send an OTP while adding a wallet beneficiary by mobile no. verification. + +*Returned Response:* + + + + +[WalletOtpResponse](#WalletOtpResponse) + +Success. Sends the OTP to the given mobile number. Check the example shown below or refer `WalletOtpResponse` for more details. + + + + +
    +  Example: + +```json +{ + "success": true, + "is_verified_flag": false, + "request_id": "c3ca6c13d490c885a125d106b45697b7" +} +``` +
    + + + + + + + + + +--- + + +#### updateDefaultBeneficiary +Set a default beneficiary for a refund + + + + +```swift +payment.updateDefaultBeneficiary(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | SetDefaultBeneficiaryRequest | yes | Request body | + + +Use this API to set a default beneficiary for getting a refund. + +*Returned Response:* + + + + +[SetDefaultBeneficiaryResponse](#SetDefaultBeneficiaryResponse) + +Success. Check the example shown below or refer `SetDefaultBeneficiaryResponse` for more details. + + + + +
    +  Example: + +```json +{ + "success": true, + "is_beneficiary_set": true +} +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [AggregatorConfigDetail](#AggregatorConfigDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | api | String? | yes | Payment gateway api endpoint | + | userId | String? | yes | Registered User id | + | merchantKey | String? | yes | Unique merchant key | + | sdk | Bool? | yes | SDK | + | pin | String? | yes | Masked pin | + | secret | String | no | Masked payment gateway api secret | + | verifyApi | String? | yes | Payment gateway verify payment api endpoint | + | merchantId | String? | yes | Unique merchant id | + | configType | String | no | Fynd or self payment gateway | + | key | String | no | Payment gateway api key | + +--- + + + + + #### [AggregatorsConfigDetailResponse](#AggregatorsConfigDetailResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | stripe | [AggregatorConfigDetail](#AggregatorConfigDetail)? | yes | | + | razorpay | [AggregatorConfigDetail](#AggregatorConfigDetail)? | yes | | + | simpl | [AggregatorConfigDetail](#AggregatorConfigDetail)? | yes | | + | juspay | [AggregatorConfigDetail](#AggregatorConfigDetail)? | yes | | + | ccavenue | [AggregatorConfigDetail](#AggregatorConfigDetail)? | yes | | + | rupifi | [AggregatorConfigDetail](#AggregatorConfigDetail)? | yes | | + | success | Bool | no | | + | mswipe | [AggregatorConfigDetail](#AggregatorConfigDetail)? | yes | | + | env | String | no | Environment i.e Live or Test | + | payumoney | [AggregatorConfigDetail](#AggregatorConfigDetail)? | yes | | + +--- + + + + + #### [ErrorCodeAndDescription](#ErrorCodeAndDescription) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | code | String | no | Error descrption code. | + | description | String | no | Error human understandable description. | + +--- + + + + + #### [HttpErrorCodeAndResponse](#HttpErrorCodeAndResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | error | [ErrorCodeAndDescription](#ErrorCodeAndDescription) | no | | + | success | Bool | no | Response is successful or not | + +--- + + + + + #### [AttachCardRequest](#AttachCardRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cardId | String | no | Card token of payment gateway. | + | nameOnCard | String? | yes | | + | refresh | Bool? | yes | Refresh cache flag. | + | nickname | String? | yes | | + +--- + + + + + #### [AttachCardsResponse](#AttachCardsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Response is successful or not. | + | data | [String: Any] | no | List of cards of customer. | + | message | String? | yes | Human readable message. | + +--- + + + + + #### [CardPaymentGateway](#CardPaymentGateway) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | api | String? | yes | Payment gateway CARD api endpoint | + | aggregator | String | no | Payment gateway name. | + | customerId | String? | yes | Payment gateway customer id. | + +--- + + + + + #### [ActiveCardPaymentGatewayResponse](#ActiveCardPaymentGatewayResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Response is successful or not. | + | cards | [CardPaymentGateway](#CardPaymentGateway) | no | Card's payment gateway with customer id. | + | message | String | no | Human readable message. | + +--- + + + + + #### [Card](#Card) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | aggregatorName | String | no | aggregator_name | + | nickname | String? | yes | nickname | + | cardIssuer | String? | yes | card_issuer | + | cardId | String? | yes | card_id | + | expMonth | Int? | yes | exp_month | + | cardFingerprint | String? | yes | card_fingerprint | + | cardToken | String? | yes | card_token | + | cardBrandImage | String? | yes | card_brand_image | + | cardReference | String? | yes | card_reference | + | cardName | String? | yes | card_name | + | expired | Bool? | yes | expired | + | cardType | String? | yes | card_type | + | cardBrand | String? | yes | card_brand | + | expYear | Int? | yes | exp_year | + | cardNumber | String? | yes | card_number | + | cardIsin | String? | yes | card_isin | + +--- + + + + + #### [ListCardsResponse](#ListCardsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Response is successful or not. | + | data | [[Card](#Card)]? | yes | List of cards of customer. | + | message | String | no | Human readable message. | + +--- + + + + + #### [DeletehCardRequest](#DeletehCardRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cardId | String | no | Card token of payment gateway. | + +--- + + + + + #### [DeleteCardsResponse](#DeleteCardsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Response is successful or not. | + | message | String? | yes | Human readable message. | + +--- + + + + + #### [ValidateCustomerRequest](#ValidateCustomerRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | aggregator | String | no | Payment gateway name in camel case i.e Simpl, Rupifi | + | transactionAmountInPaise | Int | no | Payable amount in paise | + | phoneNumber | String | no | User mobile number without country code. | + | merchantParams | [String: Any] | no | Extra meta fields. | + | payload | String | no | Hashed payload string. | + +--- + + + + + #### [ValidateCustomerResponse](#ValidateCustomerResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Response is successful or not | + | data | [String: Any] | no | Payment gateway response data | + | message | String | no | Error or success message. | + +--- + + + + + #### [ChargeCustomerRequest](#ChargeCustomerRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | aggregator | String | no | Payment gateway name i.e Simpl, Mswipe | + | amount | Int | no | Chargable amount of order. | + | verified | Bool? | yes | Already Verified flag from payment gateway i.e Mswipe | + | orderId | String | no | Unique order id. | + | transactionToken | String? | yes | Transaction token of payment gateway. | + +--- + + + + + #### [ChargeCustomerResponse](#ChargeCustomerResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | status | String | no | Status of charged payment. | + | aggregator | String | no | Payment gateway name i.e Simpl, Mswipe | + | cartId | String? | yes | Cart id of customer | + | orderId | String | no | Unique order id. | + | success | Bool | no | Response is successful or not. | + | deliveryAddressId | String? | yes | Delivery adddress id of customer | + | message | String | no | Human readable message. | + +--- + + + + + #### [PaymentInitializationRequest](#PaymentInitializationRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | razorpayPaymentId | String? | yes | Payment gateway payment id | + | method | String | no | Payment method | + | aggregator | String | no | Payment gateway name | + | email | String | no | Customer valid email | + | timeout | Int? | yes | Payment polling timeout if not recieved response | + | amount | Int | no | Payable amount. | + | merchantOrderId | String | no | Unique fynd order id | + | vpa | String? | yes | Customer vpa address | + | orderId | String | no | Payment gateway order id | + | customerId | String | no | Payment gateway customer id. | + | contact | String | no | Customer valid mobile number | + | currency | String | no | Currency code. | + +--- + + + + + #### [PaymentInitializationResponse](#PaymentInitializationResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | status | String? | yes | Status of payment. | + | merchantOrderId | String | no | order id | + | aggregator | String | no | Payment gateway name | + | method | String | no | Payment method | + | vpa | String? | yes | Customer vpa address | + | amount | Int? | yes | Payable amount. | + | pollingUrl | String | no | Polling url. | + | upiPollUrl | String? | yes | UPI poll url. | + | razorpayPaymentId | String? | yes | Payment id. | + | virtualId | String? | yes | Payment virtual address. | + | timeout | Int? | yes | timeout. | + | bqrImage | String? | yes | Bharath qr image url. | + | customerId | String? | yes | Payment gateway customer id. | + | success | Bool | no | Response is successful or not. | + | aggregatorOrderId | String? | yes | Payment order id | + | currency | String? | yes | Currency code. | + +--- + + + + + #### [PaymentStatusUpdateRequest](#PaymentStatusUpdateRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | status | String | no | Status of payment. | + | method | String | no | Payment method | + | aggregator | String | no | Payment gateway name | + | email | String | no | Customer valid email | + | merchantOrderId | String | no | Unique fynd order id | + | amount | Int | no | Payable amount. | + | vpa | String | no | Customer vpa address | + | orderId | String | no | Payment gateway order id | + | customerId | String | no | Payment gateway customer id. | + | contact | String | no | Customer valid mobile number | + | currency | String | no | Currency code. | + +--- + + + + + #### [PaymentStatusUpdateResponse](#PaymentStatusUpdateResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | status | String | no | Payment status | + | aggregatorName | String | no | Payment gateway name | + | retry | Bool | no | Response is successful or not. | + +--- + + + + + #### [AggregatorRoute](#AggregatorRoute) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [String: Any]? | yes | Data | + | paymentFlowData | String? | yes | payment_flow_data | + | paymentFlow | String? | yes | payment_flow | + | apiLink | String? | yes | api_link | + +--- + + + + + #### [PaymentFlow](#PaymentFlow) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | stripe | [AggregatorRoute](#AggregatorRoute)? | yes | Stripe | + | razorpay | [AggregatorRoute](#AggregatorRoute)? | yes | Razorpay | + | upiRazorpay | [AggregatorRoute](#AggregatorRoute)? | yes | UPI_Razorpay | + | simpl | [AggregatorRoute](#AggregatorRoute)? | yes | simpl | + | juspay | [AggregatorRoute](#AggregatorRoute)? | yes | Juspay | + | fynd | [AggregatorRoute](#AggregatorRoute)? | yes | Fynd | + | ccavenue | [AggregatorRoute](#AggregatorRoute)? | yes | Ccavenue | + | rupifi | [AggregatorRoute](#AggregatorRoute)? | yes | Rupifi | + | payubiz | [AggregatorRoute](#AggregatorRoute)? | yes | Payubiz | + | mswipe | [AggregatorRoute](#AggregatorRoute)? | yes | mswipe | + | bqrRazorpay | [AggregatorRoute](#AggregatorRoute)? | yes | BQR_Razorpay | + +--- + + + + + #### [IntentAppErrorList](#IntentAppErrorList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | packageName | String? | yes | package_name | + | code | String? | yes | code | + +--- + + + + + #### [PaymentModeLogo](#PaymentModeLogo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | large | String | no | large | + | small | String | no | smalll | + +--- + + + + + #### [IntentApp](#IntentApp) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | packageName | String? | yes | package_name | + | logos | [PaymentModeLogo](#PaymentModeLogo)? | yes | logos | + | code | String? | yes | code | + | displayName | String? | yes | display_name | + +--- + + + + + #### [PaymentModeList](#PaymentModeList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | nickname | String? | yes | nickname | + | fyndVpa | String? | yes | fynd_vpa | + | cardId | String? | yes | card_id | + | expMonth | Int? | yes | exp_month | + | cardFingerprint | String? | yes | card_fingerprint | + | intentAppErrorDictList | [[IntentAppErrorList](#IntentAppErrorList)]? | yes | intent_app_error_dict_list | + | cardType | String? | yes | card_type | + | expYear | Int? | yes | exp_year | + | merchantCode | String? | yes | merchant code | + | displayName | String? | yes | display name | + | cardIssuer | String? | yes | card_issuer | + | cardBrandImage | String? | yes | card_brand_image | + | cardReference | String? | yes | card_reference | + | name | String? | yes | name | + | retryCount | Int? | yes | retry_count | + | displayPriority | Int? | yes | Dispaly Priority | + | cardToken | String? | yes | card_token | + | logoUrl | [PaymentModeLogo](#PaymentModeLogo)? | yes | Logo | + | expired | Bool? | yes | expired | + | intentAppErrorList | [String]? | yes | intent_app_error_list | + | cardIsin | String? | yes | card_isin | + | intentFlow | Bool? | yes | intent_flow | + | aggregatorName | String | no | aggregator_name | + | timeout | Int? | yes | timeout | + | code | String? | yes | code | + | cardName | String? | yes | card_name | + | cardBrand | String? | yes | card_brand | + | cardNumber | String? | yes | card_number | + | intentApp | [[IntentApp](#IntentApp)]? | yes | intent_app | + +--- + + + + + #### [RootPaymentMode](#RootPaymentMode) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String | no | Payment mode name | + | aggregatorName | String? | yes | Dispaly Priority | + | displayPriority | Int | no | Dispaly Priority | + | addCardEnabled | Bool? | yes | Annonymous card flag | + | anonymousEnable | Bool? | yes | Annonymous card flag | + | list | [[PaymentModeList](#PaymentModeList)]? | yes | Payment mode | + | displayName | String | no | Payment mode display name | + +--- + + + + + #### [PaymentOptionAndFlow](#PaymentOptionAndFlow) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | paymentFlows | [PaymentFlow](#PaymentFlow) | no | payment_flows | + | paymentOption | [[RootPaymentMode](#RootPaymentMode)] | no | Payment options | + +--- + + + + + #### [PaymentModeRouteResponse](#PaymentModeRouteResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | paymentOptions | [PaymentOptionAndFlow](#PaymentOptionAndFlow) | no | payment_options | + | success | Bool | no | Response is successful or not | + +--- + + + + + #### [RupifiBannerData](#RupifiBannerData) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | status | String? | yes | Rupifi KYC status | + | kycUrl | String? | yes | Rupifi KYC banner url. | + +--- + + + + + #### [RupifiBannerResponse](#RupifiBannerResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Successful or not. | + | data | [RupifiBannerData](#RupifiBannerData) | no | Rupifi KYC banner details. | + +--- + + + + + #### [TransferItemsDetails](#TransferItemsDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String | no | Beneficiary Name | + | id | Int | no | | + | logoSmall | String | no | Beneficiary small Logo | + | logoLarge | String | no | Beneficiary large Logo | + | displayName | String? | yes | Beneficiary Display Name | + +--- + + + + + #### [TransferModeDetails](#TransferModeDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[TransferItemsDetails](#TransferItemsDetails)]? | yes | Beneficiary Mode Items | + | displayName | String | no | Beneficiary Mode Name | + +--- + + + + + #### [TransferModeResponse](#TransferModeResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [[TransferModeDetails](#TransferModeDetails)] | no | Response Object | + +--- + + + + + #### [UpdateRefundTransferModeRequest](#UpdateRefundTransferModeRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enable | Bool | no | True for enabling the Transfer Mode | + | transferMode | String | no | Transfer Mode of the Beneficiary to be added | + +--- + + + + + #### [UpdateRefundTransferModeResponse](#UpdateRefundTransferModeResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | Response is successful or not | + +--- + + + + + #### [OrderBeneficiaryDetails](#OrderBeneficiaryDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | modifiedOn | String | no | MOdification Date of Beneficiary | + | email | String | no | EMail of User | + | isActive | Bool | no | Boolean Flag whether Beneficiary set or not | + | transferMode | String | no | Transfer Mode Of Account | + | mobile | Bool? | yes | MObile no of User | + | branchName | Bool? | yes | Branch Name Of Account | + | createdOn | String | no | Creation Date of Beneficiary | + | ifscCode | String | no | Ifsc Code Of Account | + | comment | Bool? | yes | Remarks | + | subtitle | String | no | SHort Title Of Account | + | displayName | String | no | Display Name Of Account | + | id | Int | no | | + | accountHolder | String | no | Account Holder Name | + | address | String | no | Address of User | + | bankName | String | no | Bank Name Of Account | + | accountNo | String | no | Account Number | + | beneficiaryId | String | no | Benenficiary Id | + | title | String | no | Title Of Account | + | delightsUserName | String? | yes | User Id Who filled the Beneficiary | + +--- + + + + + #### [OrderBeneficiaryResponse](#OrderBeneficiaryResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | beneficiaries | [[OrderBeneficiaryDetails](#OrderBeneficiaryDetails)]? | yes | All Beneficiaries Of An Order | + | showBeneficiaryDetails | Bool? | yes | Show beneficiary details or not. | + +--- + + + + + #### [NotFoundResourceError](#NotFoundResourceError) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Response is successful or not | + | code | String | no | Bad Request Data | + | description | String | no | Not Found | + +--- + + + + + #### [IfscCodeResponse](#IfscCodeResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | Response is successful or not | + | bankName | String | no | Bank Name Of Account | + | branchName | String | no | Branch Name Of Account | + +--- + + + + + #### [ErrorCodeDescription](#ErrorCodeDescription) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Response is successful or not | + | code | String | no | Error descrption code. | + | description | String | no | Error human understandable description. | + +--- + + + + + #### [AddBeneficiaryViaOtpVerificationRequest](#AddBeneficiaryViaOtpVerificationRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | otp | String | no | Otp sent to the given Mobile No | + | hashKey | String | no | Hash key of the beneficiary Id | + | requestId | String | no | Request Id sent in | + +--- + + + + + #### [AddBeneficiaryViaOtpVerificationResponse](#AddBeneficiaryViaOtpVerificationResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | Response is successful or not | + | message | String | no | Aggregator Response of beneficicary | + +--- + + + + + #### [WrongOtpError](#WrongOtpError) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isVerifiedFlag | Bool | no | Vefified flag. | + | success | String | no | Response is successful or not | + | description | String | no | Wrong OTP Code | + +--- + + + + + #### [BeneficiaryModeDetails](#BeneficiaryModeDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | comment | String? | yes | Remarks added by The user | + | ifscCode | String | no | Ifsc Code of the Account | + | vpa | String? | yes | | + | email | String | no | Email of the Account Holder | + | wallet | String? | yes | | + | accountHolder | String | no | Name of the Account Holder | + | mobile | String | no | Moblie Number of the User | + | accountNo | String | no | Account NUmber of the Account Holder | + | address | String? | yes | Address of the User | + | bankName | String | no | Bank Name of the Account | + | branchName | String | no | Branch Name of the Account | + +--- + + + + + #### [AddBeneficiaryDetailsRequest](#AddBeneficiaryDetailsRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | otp | String? | yes | | + | details | [BeneficiaryModeDetails](#BeneficiaryModeDetails) | no | Beneficiary bank details | + | shipmentId | String | no | Shipment Id of the respective Merchant Order Id | + | orderId | String | no | Merchant Order Id | + | delights | Bool | no | True if beneficiary to be added by delights or False if by User | + | transferMode | String | no | Transfer Mode of the Beneficiary to be added | + | requestId | String? | yes | | + +--- + + + + + #### [RefundAccountResponse](#RefundAccountResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isVerifiedFlag | Bool? | yes | | + | success | Bool | no | Success or failure flag. | + | data | [String: Any]? | yes | Refund account data. | + | message | String | no | Response message | + +--- + + + + + #### [BankDetailsForOTP](#BankDetailsForOTP) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | ifscCode | String | no | | + | accountHolder | String | no | | + | accountNo | String | no | | + | bankName | String | no | | + | branchName | String | no | | + +--- + + + + + #### [AddBeneficiaryDetailsOTPRequest](#AddBeneficiaryDetailsOTPRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | details | [BankDetailsForOTP](#BankDetailsForOTP) | no | | + | orderId | String | no | | + +--- + + + + + #### [WalletOtpRequest](#WalletOtpRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | countryCode | String | no | Country Code of the Mobile Number | + | mobile | String | no | Wallet Moblie Number of the User | + +--- + + + + + #### [WalletOtpResponse](#WalletOtpResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isVerifiedFlag | String | no | Boolean Flag whether OTP Validation is already done or not | + | success | Bool? | yes | Response is successful or not | + | requestId | String | no | request id | + +--- + + + + + #### [SetDefaultBeneficiaryRequest](#SetDefaultBeneficiaryRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | beneficiaryId | String | no | Beneficiary Hash Id of the beneficiary added | + | orderId | String | no | Merchant Order Id | + +--- + + + + + #### [SetDefaultBeneficiaryResponse](#SetDefaultBeneficiaryResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | Response is successful or not | + | isBeneficiarySet | Bool | no | Boolean Flag whether Beneficiary set or not | + +--- + + + diff --git a/documentation/application/POSCART.md b/documentation/application/POSCART.md new file mode 100644 index 0000000000..3471a8533a --- /dev/null +++ b/documentation/application/POSCART.md @@ -0,0 +1,7658 @@ + + + + +##### [Back to Application docs](./README.md) + +## PosCart Methods +Cart APIs +* [getCart](#getcart) +* [getCartLastModified](#getcartlastmodified) +* [addItems](#additems) +* [updateCart](#updatecart) +* [getItemCount](#getitemcount) +* [getCoupons](#getcoupons) +* [applyCoupon](#applycoupon) +* [removeCoupon](#removecoupon) +* [getBulkDiscountOffers](#getbulkdiscountoffers) +* [applyRewardPoints](#applyrewardpoints) +* [getAddresses](#getaddresses) +* [addAddress](#addaddress) +* [getAddressById](#getaddressbyid) +* [updateAddress](#updateaddress) +* [removeAddress](#removeaddress) +* [selectAddress](#selectaddress) +* [selectPaymentMode](#selectpaymentmode) +* [validateCouponForPayment](#validatecouponforpayment) +* [getShipments](#getshipments) +* [updateShipments](#updateshipments) +* [checkoutCart](#checkoutcart) +* [updateCartMeta](#updatecartmeta) +* [getAvailableDeliveryModes](#getavailabledeliverymodes) +* [getStoreAddressByUid](#getstoreaddressbyuid) +* [getCartShareLink](#getcartsharelink) +* [getCartSharedItems](#getcartshareditems) +* [updateCartWithSharedItems](#updatecartwithshareditems) + + + +## Methods with example and description + + +#### getCart +Fetch all items added to the cart + + + + +```swift +poscart.getCart(id: id, i: i, b: b, assignCardId: assignCardId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | | +| i | Bool? | no | | +| b | Bool? | no | | +| assignCardId | Int? | no | | + + + +Use this API to get details of all the items added to a cart. + +*Returned Response:* + + + + +[CartDetailResponse](#CartDetailResponse) + +Success. Returns a Cart object. Check the example shown below or refer `CartDetailResponse` for more details. + + + + +
    +  Example: + +```json +{ + "items": [ + { + "bulk_offer": {}, + "discount": "67% OFF", + "article": { + "type": "article", + "uid": "604_902_SSTC60401_636BLUE_1", + "size": "1", + "seller": { + "uid": 604, + "name": "SHRI SHANTINATH TRADING COMPANY" + }, + "store": { + "uid": 4579, + "name": "Gandhi Nagar" + }, + "quantity": 108, + "price": { + "base": { + "marked": 2999, + "effective": 999, + "currency_code": "INR" + }, + "converted": { + "marked": 2999, + "effective": 999, + "currency_code": "INR" + } + } + }, + "coupon_message": "", + "key": "707569_1", + "availability": { + "sizes": [ + "1", + "8", + "7", + "2", + "9", + "5", + "3", + "6" + ], + "other_store_quantity": 107, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 707569, + "name": "Blue and Gold Printed Ethnic Set", + "slug": "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a", + "brand": { + "uid": 902, + "name": "" + }, + "categories": [ + { + "uid": 525, + "name": "" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/v1/products/aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a/", + "query": { + "product_slug": [ + "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a" + ] + } + } + }, + "price": { + "base": { + "add_on": 999, + "marked": 2999, + "effective": 999, + "selling": 999, + "currency_code": "INR" + }, + "converted": { + "add_on": 999, + "marked": 2999, + "effective": 999, + "selling": 999, + "currency_code": "INR" + } + }, + "message": "", + "quantity": 1 + } + ], + "cart_id": 54, + "uid": "54", + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": -2000, + "fynd_cash": 0, + "gst_charges": 47.57, + "mrp_total": 2999, + "subtotal": 999, + "total": 999, + "vog": 951.43, + "you_saved": 0 + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 2999, + "currency_code": "INR" + }, + { + "display": "Discount", + "key": "discount", + "value": -2000, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 999, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 999, + "currency_code": "INR" + } + ], + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + } + }, + "delivery_charge_info": "", + "coupon_text": "View all offers", + "gstin": null, + "checkout_mode": "self", + "restrict_checkout": false, + "is_valid": true, + "last_modified": "Tue, 03 Sep 2019 05:35:59 GMT" +} +``` +
    + + + + + + + + + +--- + + +#### getCartLastModified +Fetch last-modified timestamp + + + + +```swift +poscart.getCartLastModified(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | | + + + +Use this API to fetch Last-Modified timestamp in header metadata. + +*Returned Response:* + + + + + + + + +--- + + +#### addItems +Add items to cart + + + + +```swift +poscart.addItems(i: i, b: b, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| i | Bool? | no | | +| b | Bool? | no | | +| body | AddCartRequest | yes | Request body | + + +Use this API to add items to the cart. + +*Returned Response:* + + + + +[AddCartDetailResponse](#AddCartDetailResponse) + +Success. Returns a cart object as shown below. Refer `AddCartDetailResponse` for more details. + + + + +
    +  Examples: + + +
    +  Product has been added to your cart + +```json +{ + "value": { + "message": "Product has been added to your cart", + "success": true, + "cart": { + "breakup_values": { + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 17486, + "currency_code": "INR" + }, + { + "display": "Discount", + "key": "discount", + "value": -3540, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 13946, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 13946, + "currency_code": "INR" + } + ], + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": -3540, + "fynd_cash": 0, + "gst_charges": 1529.96, + "mrp_total": 17486, + "subtotal": 13946, + "total": 13946, + "vog": 12416.04, + "you_saved": 0 + }, + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + } + }, + "items": [ + { + "key": "751083_10", + "article": { + "type": "article", + "uid": "612_9_SE61201_19100302_10", + "size": "10", + "seller": { + "uid": 612, + "name": "SSR ENTERPRISE" + }, + "store": { + "uid": 4431, + "name": "Motilal Nagar 1, Goregaon" + }, + "quantity": 4, + "price": { + "base": { + "marked": 3999, + "effective": 2399, + "currency_code": "INR" + }, + "converted": { + "marked": 3999, + "effective": 2399, + "currency_code": "INR" + } + } + }, + "price": { + "base": { + "add_on": 4798, + "marked": 7998, + "effective": 4798, + "selling": 4798, + "currency_code": "INR" + }, + "converted": { + "add_on": 4798, + "marked": 7998, + "effective": 4798, + "selling": 4798, + "currency_code": "INR" + } + }, + "availability": { + "sizes": [ + "10" + ], + "other_store_quantity": 2, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 751083, + "name": "Carson 2", + "slug": "puma-carson-2-751083-6ad98d", + "brand": { + "uid": 9, + "name": "Puma" + }, + "categories": [ + { + "uid": 165, + "name": "Outdoor Sports Shoes" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/9_19100302/1_1542807042296.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/9_19100302/1_1542807042296.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/puma-carson-2-751083-6ad98d/", + "query": { + "product_slug": [ + "puma-carson-2-751083-6ad98d" + ] + } + } + }, + "coupon_message": "", + "quantity": 2, + "message": "", + "bulk_offer": {}, + "discount": "41% OFF" + }, + { + "key": "246228_S", + "article": { + "type": "article", + "uid": "46_235_TM62_M11029ONDSXNS_S", + "size": "S", + "seller": { + "uid": 46, + "name": "RELIANCE BRANDS LIMITED" + }, + "store": { + "uid": 4550, + "name": "VR Mall" + }, + "quantity": 1, + "price": { + "base": { + "marked": 4490, + "effective": 4490, + "currency_code": "INR" + }, + "converted": { + "marked": 4490, + "effective": 4490, + "currency_code": "INR" + } + } + }, + "price": { + "base": { + "add_on": 4490, + "marked": 4490, + "effective": 4490, + "selling": 4490, + "currency_code": "INR" + }, + "converted": { + "add_on": 4490, + "marked": 4490, + "effective": 4490, + "selling": 4490, + "currency_code": "INR" + } + }, + "availability": { + "sizes": [ + "L", + "M", + "S", + "XL", + "XXL" + ], + "other_store_quantity": 0, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 246228, + "name": "Blue Solid T-Shirt", + "slug": "superdry-blue-solid-t-shirt-2", + "brand": { + "uid": 235, + "name": "Superdry" + }, + "categories": [ + { + "uid": 192, + "name": "T-Shirts" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/235_M11029ONDSXNS/1.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/235_M11029ONDSXNS/1.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/superdry-blue-solid-t-shirt-2/", + "query": { + "product_slug": [ + "superdry-blue-solid-t-shirt-2" + ] + } + } + }, + "coupon_message": "", + "quantity": 1, + "message": "", + "bulk_offer": {}, + "discount": "" + }, + { + "key": "443175_S", + "article": { + "type": "article", + "uid": "162_207_1271_LJ03LBLUDN88_S", + "size": "S", + "seller": { + "uid": 162, + "name": "GO FASHION INDIA PRIVATE LIMITED" + }, + "store": { + "uid": 5784, + "name": "Vega City mall" + }, + "quantity": 3, + "price": { + "base": { + "marked": 1599, + "effective": 1599, + "currency_code": "INR" + }, + "converted": { + "marked": 1599, + "effective": 1599, + "currency_code": "INR" + } + } + }, + "price": { + "base": { + "add_on": 1599, + "marked": 1599, + "effective": 1599, + "selling": 1599, + "currency_code": "INR" + }, + "converted": { + "add_on": 1599, + "marked": 1599, + "effective": 1599, + "selling": 1599, + "currency_code": "INR" + } + }, + "availability": { + "sizes": [ + "XL", + "M", + "L", + "S" + ], + "other_store_quantity": 8, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 443175, + "name": "Light Blue Denim Jeggings", + "slug": "go-colors-light-blue-denim-jeggings-443175-3c688c", + "brand": { + "uid": 207, + "name": "Go Colors" + }, + "categories": [ + { + "uid": 267, + "name": "Jeggings" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/207_LJ03LBLUDN88/1_1512382513548.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/207_LJ03LBLUDN88/1_1512382513548.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/go-colors-light-blue-denim-jeggings-443175-3c688c/", + "query": { + "product_slug": [ + "go-colors-light-blue-denim-jeggings-443175-3c688c" + ] + } + } + }, + "coupon_message": "", + "quantity": 1, + "message": "", + "bulk_offer": {}, + "discount": "" + }, + { + "key": "778937_OS", + "article": { + "type": "article", + "uid": "686_963_IC68601_PWUPC01977_OS", + "size": "OS", + "seller": { + "uid": 686, + "name": "INDUS CORPORATION" + }, + "store": { + "uid": 5059, + "name": "Vidyaranyapura Main Road" + }, + "quantity": 3, + "price": { + "base": { + "marked": 3399, + "effective": 3059, + "currency_code": "INR" + }, + "converted": { + "marked": 3399, + "effective": 3059, + "currency_code": "INR" + } + } + }, + "price": { + "base": { + "add_on": 3059, + "marked": 3399, + "effective": 3059, + "selling": 3059, + "currency_code": "INR" + }, + "converted": { + "add_on": 3059, + "marked": 3399, + "effective": 3059, + "selling": 3059, + "currency_code": "INR" + } + }, + "availability": { + "sizes": [ + "OS" + ], + "other_store_quantity": 2, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 778937, + "name": "Colourful Carnival Bouncer", + "slug": "fisher-price-colourful-carnival-bouncer-778937-fafa1f", + "brand": { + "uid": 963, + "name": "Fisher-Price" + }, + "categories": [ + { + "uid": 576, + "name": "Cradles" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/963_PWUPC01977/1_1545308400588.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/963_PWUPC01977/1_1545308400588.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/fisher-price-colourful-carnival-bouncer-778937-fafa1f/", + "query": { + "product_slug": [ + "fisher-price-colourful-carnival-bouncer-778937-fafa1f" + ] + } + } + }, + "coupon_message": "", + "quantity": 1, + "message": "", + "bulk_offer": {}, + "discount": "11% OFF" + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "cart_id": 7927, + "uid": "7927", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Tue, 03 Sep 2019 06:00:43 GMT", + "restrict_checkout": false, + "is_valid": true + }, + "result": {} + } +} +``` +
    + +
    +  Sorry, item is out of stock + +```json +{ + "value": { + "message": "Sorry, item is out of stock", + "success": false, + "cart": { + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": -202000, + "fynd_cash": 0, + "gst_charges": 4804.71, + "mrp_total": 302899, + "subtotal": 100899, + "total": 100899, + "vog": 96094.29, + "you_saved": 0 + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 302899, + "currency_code": "INR" + }, + { + "display": "Discount", + "key": "discount", + "value": -202000, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 100899, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 100899, + "currency_code": "INR" + } + ], + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + } + }, + "items": [ + { + "bulk_offer": {}, + "discount": "67% OFF", + "article": { + "type": "article", + "uid": "604_902_SSTC60401_636BLUE_1", + "size": "1", + "seller": { + "uid": 604, + "name": "SHRI SHANTINATH TRADING COMPANY" + }, + "store": { + "uid": 4579, + "name": "Gandhi Nagar" + }, + "quantity": 108, + "price": { + "base": { + "marked": 2999, + "effective": 999, + "currency_code": "INR" + }, + "converted": { + "marked": 2999, + "effective": 999, + "currency_code": "INR" + } + } + }, + "coupon_message": "", + "key": "707569_1", + "availability": { + "sizes": [ + "1", + "8", + "7", + "2", + "9", + "5", + "3", + "6" + ], + "other_store_quantity": 7, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 707569, + "name": "Blue and Gold Printed Ethnic Set", + "slug": "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a", + "brand": { + "uid": 902, + "name": "" + }, + "categories": [ + { + "uid": 525, + "name": "" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/v1/products/aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a/", + "query": { + "product_slug": [ + "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a" + ] + } + } + }, + "price": { + "base": { + "add_on": 100899, + "marked": 302899, + "effective": 100899, + "selling": 100899, + "currency_code": "INR" + }, + "converted": { + "add_on": 100899, + "marked": 302899, + "effective": 100899, + "selling": 100899, + "currency_code": "INR" + } + }, + "message": "", + "quantity": 101 + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "cart_id": 54, + "uid": "54", + "gstin": null, + "checkout_mode": "self", + "restrict_checkout": false, + "is_valid": false, + "last_modified": "Tue, 03 Sep 2019 09:55:40 GMT" + }, + "result": {} + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateCart +Update items in the cart + + + + +```swift +poscart.updateCart(id: id, i: i, b: b, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | | +| i | Bool? | no | | +| b | Bool? | no | | +| body | UpdateCartRequest | yes | Request body | + + +

    Use this API to update items added to the cart with the help of a request object containing attributes like item_quantity and item_size. These attributes will be fetched from the following APIs

    • operation Operation for current api call. update_item for update items. remove_item for removing items.
    • item_id "/platform/content/v1/products/"
    • item_size "/platform/content/v1/products/:slug/sizes/"
    • quantity item quantity (must be greater than or equal to 1)
    • article_id "/content​/v1​/products​/:identifier​/sizes​/price​/"
    • item_index item position in the cart (must be greater than or equal to 0)
    + +*Returned Response:* + + + + +[UpdateCartDetailResponse](#UpdateCartDetailResponse) + +Success. Updates and returns a cart object as shown below. Refer `UpdateCartDetailResponse` for more details. + + + + +
    +  Examples: + + +
    +  Nothing updated + +```json +{ + "value": { + "cart": { + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": -202000, + "fynd_cash": 0, + "gst_charges": 4804.71, + "mrp_total": 302899, + "subtotal": 100899, + "total": 100899, + "vog": 96094.29, + "you_saved": 0 + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 302899, + "currency_code": "INR" + }, + { + "display": "Discount", + "key": "discount", + "value": -202000, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 100899, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 100899, + "currency_code": "INR" + } + ], + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + } + }, + "items": [ + { + "bulk_offer": {}, + "discount": "67% OFF", + "article": { + "type": "article", + "uid": "604_902_SSTC60401_636BLUE_1", + "size": "1", + "seller": { + "uid": 604, + "name": "SHRI SHANTINATH TRADING COMPANY" + }, + "store": { + "uid": 4579, + "name": "Gandhi Nagar" + }, + "quantity": 108, + "price": { + "base": { + "marked": 2999, + "effective": 999, + "currency_code": "INR" + }, + "converted": { + "marked": 2999, + "effective": 999, + "currency_code": "INR" + } + } + }, + "coupon_message": "", + "key": "707569_1", + "availability": { + "sizes": [ + "1", + "8", + "7", + "2", + "9", + "5", + "3", + "6" + ], + "other_store_quantity": 7, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 707569, + "name": "Blue and Gold Printed Ethnic Set", + "slug": "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a", + "brand": { + "uid": 902, + "name": "" + }, + "categories": [ + { + "uid": 525, + "name": "" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/v1/products/aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a/", + "query": { + "product_slug": [ + "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a" + ] + } + } + }, + "price": { + "base": { + "add_on": 100899, + "marked": 302899, + "effective": 100899, + "selling": 100899, + "currency_code": "INR" + }, + "converted": { + "add_on": 100899, + "marked": 302899, + "effective": 100899, + "selling": 100899, + "currency_code": "INR" + } + }, + "message": "", + "quantity": 101 + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "cart_id": 54, + "uid": "54", + "gstin": null, + "checkout_mode": "self", + "restrict_checkout": false, + "is_valid": true, + "last_modified": "Tue, 03 Sep 2019 10:19:20 GMT" + }, + "result": { + "707569_90": { + "success": true, + "message": "Nothing updated" + } + }, + "message": "Nothing updated", + "success": true + } +} +``` +
    + +
    +  Item updated in the cart + +```json +{ + "value": { + "cart": { + "breakup_values": { + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + }, + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + }, + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 838.83, + "mrp_total": 5499, + "subtotal": 5499, + "total": 5499, + "vog": 4660.17, + "you_saved": 0 + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 5499, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 5499, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 5499, + "currency_code": "INR" + } + ] + }, + "items": [ + { + "key": "437414_7", + "message": "", + "bulk_offer": {}, + "price": { + "base": { + "add_on": 5499, + "marked": 5499, + "effective": 5499, + "selling": 5499, + "currency_code": "INR" + }, + "converted": { + "add_on": 5499, + "marked": 5499, + "effective": 5499, + "selling": 5499, + "currency_code": "INR" + } + }, + "quantity": 1, + "discount": "", + "product": { + "type": "product", + "uid": 437414, + "name": "Suede Classic", + "slug": "puma-suede-classic-437414-6e6bbf", + "brand": { + "uid": 9, + "name": "Puma" + }, + "categories": [ + { + "uid": 165, + "name": "Outdoor Sports Shoes" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/9_35656851/1_1511171811830.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/9_35656851/1_1511171811830.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/puma-suede-classic-437414-6e6bbf/", + "query": { + "product_slug": [ + "puma-suede-classic-437414-6e6bbf" + ] + } + } + }, + "article": { + "type": "article", + "uid": "507_9_96099_35656851_7", + "size": "7", + "seller": { + "uid": 507, + "name": "PUMA SPORTS INDIA PVT LTD" + }, + "store": { + "uid": 3632, + "name": "Colaba Causway" + }, + "quantity": 5, + "price": { + "base": { + "marked": 5499, + "effective": 5499, + "currency_code": "INR" + }, + "converted": { + "marked": 5499, + "effective": 5499, + "currency_code": "INR" + } + } + }, + "coupon_message": "", + "availability": { + "sizes": [ + "10", + "11", + "6", + "9", + "7", + "8" + ], + "other_store_quantity": 22, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + } + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "cart_id": 12426, + "uid": "12426", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Thu, 22 Aug 2019 04:51:42 GMT", + "restrict_checkout": false, + "is_valid": true + }, + "result": { + "437414_7": { + "success": true, + "message": "Item updated in the bag" + } + }, + "message": "Item updated in the bag", + "success": true + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getItemCount +Count items in the cart + + + + +```swift +poscart.getItemCount(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | The unique identifier of the cart. | + + + +Use this API to get the total number of items present in cart. + +*Returned Response:* + + + + +[CartItemCountResponse](#CartItemCountResponse) + +Success. Returns the total count of items in a user's cart. + + + + +
    +  Example: + +```json +{ + "user_cart_items_count": 0 +} +``` +
    + + + + + + + + + +--- + + +#### getCoupons +Fetch Coupon + + + + +```swift +poscart.getCoupons(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | | + + + +Use this API to get a list of available coupons along with their details. + +*Returned Response:* + + + + +[GetCouponResponse](#GetCouponResponse) + +Success. Returns a coupon object which has a list of all the eligible coupons. Refer `GetCouponResponse` for more details. + + + + +
    +  Example: + +```json +{ + "available_coupon_list": [ + { + "coupon_value": 500, + "minimum_cart_value": 0, + "coupon_code": "RAJA500", + "title": "RAJA500 | Fynd coupon", + "sub_title": "NA", + "message": "TEST500", + "max_discount_value": 500, + "uid": 17921, + "is_applicable": true, + "is_applied": false, + "expires_on": "28 Aug, 19" + }, + { + "coupon_value": 2250, + "minimum_cart_value": 0, + "coupon_code": "PRISMC22250111", + "title": "celio 2 time coupn to kalim hsp", + "sub_title": "celio 2 time coupn to kalim hsp", + "message": "celio 2 time coupn to kalim hsp", + "max_discount_value": 2250, + "uid": 17743, + "is_applicable": true, + "is_applied": false, + "expires_on": "24 Jan, 20" + } + ], + "page": { + "current": 1, + "total": 0, + "has_previous": false, + "has_next": false, + "total_item_count": 0 + } +} +``` +
    + + + + + + + + + +--- + + +#### applyCoupon +Apply Coupon + + + + +```swift +poscart.applyCoupon(i: i, b: b, p: p, id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| i | Bool? | no | | +| b | Bool? | no | | +| p | Bool? | no | | +| id | String? | no | | +| body | ApplyCouponRequest | yes | Request body | + + +Use this API to apply coupons on items in the cart. + +*Returned Response:* + + + + +[CartDetailResponse](#CartDetailResponse) + +Success. Returns coupons applied to the cart along with item details and price breakup. Refer `CartDetailResponse` for more details. + + + + +
    +  Example: + +```json +{ + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": -2250, + "delivery_charge": 0, + "discount": -7240.2163, + "fynd_cash": 0, + "gst_charges": 2139.08, + "mrp_total": 26983, + "subtotal": 19742.7837, + "total": 17492.7837, + "vog": 15353.7, + "you_saved": 0 + }, + "coupon": { + "type": "cash", + "code": "PRISMC22250111", + "uid": 17743, + "value": 2250, + "is_applied": true, + "message": "coupn applied" + }, + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 26983, + "currency_code": "INR" + }, + { + "display": "Discount", + "key": "discount", + "value": -7240, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 19743, + "currency_code": "INR" + }, + { + "display": "Coupon", + "key": "coupon", + "value": -2250, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 17493, + "currency_code": "INR" + } + ] + }, + "items": [ + { + "availability": { + "sizes": [ + "10" + ], + "other_store_quantity": 0, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 751083, + "name": "Carson 2", + "slug": "puma-carson-2-751083-6ad98d", + "brand": { + "uid": 9, + "name": "Puma" + }, + "categories": [ + { + "uid": 165, + "name": "Outdoor Sports Shoes" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/9_19100302/1_1542807042296.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/9_19100302/1_1542807042296.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/puma-carson-2-751083-6ad98d/", + "query": { + "product_slug": [ + "puma-carson-2-751083-6ad98d" + ] + } + } + }, + "quantity": 4, + "discount": "41% OFF", + "price": { + "base": { + "add_on": 9596, + "marked": 15996, + "effective": 9596, + "selling": 9596, + "currency_code": "INR" + }, + "converted": { + "add_on": 9596, + "marked": 15996, + "effective": 9596, + "selling": 9596, + "currency_code": "INR" + } + }, + "message": "", + "bulk_offer": {}, + "key": "751083_10", + "coupon_message": "", + "article": { + "type": "article", + "uid": "612_9_SE61201_19100302_10", + "size": "10", + "seller": { + "uid": 612, + "name": "SSR ENTERPRISE" + }, + "store": { + "uid": 4431, + "name": "Motilal Nagar 1, Goregaon" + }, + "quantity": 4, + "price": { + "base": { + "marked": 3999, + "effective": 2399, + "currency_code": "INR" + }, + "converted": { + "marked": 3999, + "effective": 2399, + "currency_code": "INR" + } + } + } + }, + { + "availability": { + "sizes": [ + "L", + "M", + "S", + "XL", + "XXL" + ], + "other_store_quantity": 0, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 246228, + "name": "Blue Solid T-Shirt", + "slug": "superdry-blue-solid-t-shirt-2", + "brand": { + "uid": 235, + "name": "Superdry" + }, + "categories": [ + { + "uid": 192, + "name": "T-Shirts" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/235_M11029ONDSXNS/1.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/235_M11029ONDSXNS/1.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/superdry-blue-solid-t-shirt-2/", + "query": { + "product_slug": [ + "superdry-blue-solid-t-shirt-2" + ] + } + } + }, + "quantity": 1, + "discount": "", + "price": { + "base": { + "add_on": 4490, + "marked": 4490, + "effective": 4490, + "selling": 4490, + "currency_code": "INR" + }, + "converted": { + "add_on": 4490, + "marked": 4490, + "effective": 4490, + "selling": 4490, + "currency_code": "INR" + } + }, + "message": "", + "bulk_offer": {}, + "key": "246228_S", + "coupon_message": "", + "article": { + "type": "article", + "uid": "46_235_TM62_M11029ONDSXNS_S", + "size": "S", + "seller": { + "uid": 46, + "name": "RELIANCE BRANDS LIMITED" + }, + "store": { + "uid": 4550, + "name": "VR Mall" + }, + "quantity": 1, + "price": { + "base": { + "marked": 4490, + "effective": 4490, + "currency_code": "INR" + }, + "converted": { + "marked": 4490, + "effective": 4490, + "currency_code": "INR" + } + } + } + }, + { + "availability": { + "sizes": [ + "XL", + "M", + "L", + "S" + ], + "other_store_quantity": 8, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 443175, + "name": "Light Blue Denim Jeggings", + "slug": "go-colors-light-blue-denim-jeggings-443175-3c688c", + "brand": { + "uid": 207, + "name": "Go Colors" + }, + "categories": [ + { + "uid": 267, + "name": "Jeggings" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/207_LJ03LBLUDN88/1_1512382513548.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/207_LJ03LBLUDN88/1_1512382513548.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/go-colors-light-blue-denim-jeggings-443175-3c688c/", + "query": { + "product_slug": [ + "go-colors-light-blue-denim-jeggings-443175-3c688c" + ] + } + } + }, + "quantity": 1, + "discount": "", + "price": { + "base": { + "add_on": 1599, + "marked": 1599, + "effective": 1599, + "selling": 1599, + "currency_code": "INR" + }, + "converted": { + "add_on": 1599, + "marked": 1599, + "effective": 1599, + "selling": 1599, + "currency_code": "INR" + } + }, + "message": "", + "bulk_offer": {}, + "key": "443175_S", + "coupon_message": "", + "article": { + "type": "article", + "uid": "162_207_1271_LJ03LBLUDN88_S", + "size": "S", + "seller": { + "uid": 162, + "name": "GO FASHION INDIA PRIVATE LIMITED" + }, + "store": { + "uid": 5784, + "name": "Vega City mall" + }, + "quantity": 3, + "price": { + "base": { + "marked": 1599, + "effective": 1599, + "currency_code": "INR" + }, + "converted": { + "marked": 1599, + "effective": 1599, + "currency_code": "INR" + } + } + } + }, + { + "availability": { + "sizes": [ + "OS" + ], + "other_store_quantity": 12, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 842716, + "name": "Blue Backpack", + "slug": "istorm-blue-backpack-842716-951b5a", + "brand": { + "uid": 1177, + "name": "iStorm" + }, + "categories": [ + { + "uid": 198, + "name": "Backpacks" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1177_IS483/1_1551353288247.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1177_IS483/1_1551353288247.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/istorm-blue-backpack-842716-951b5a/", + "query": { + "product_slug": [ + "istorm-blue-backpack-842716-951b5a" + ] + } + } + }, + "quantity": 1, + "discount": "34% OFF", + "price": { + "base": { + "add_on": 998.7837, + "marked": 1499, + "effective": 998.7837, + "selling": 998.7837, + "currency_code": "INR" + }, + "converted": { + "add_on": 998.7837, + "marked": 1499, + "effective": 998.7837, + "selling": 998.7837, + "currency_code": "INR" + } + }, + "message": "", + "bulk_offer": {}, + "key": "842716_OS", + "coupon_message": "", + "article": { + "type": "article", + "uid": "638_1177_CRSL63802_IS483_OS", + "size": "OS", + "seller": { + "uid": 638, + "name": "COUNFREEDISE RETAIL SERVICES LTD" + }, + "store": { + "uid": 4630, + "name": "Bhiwandi" + }, + "quantity": 4, + "price": { + "base": { + "marked": 1499, + "effective": 998.7837, + "currency_code": "INR" + }, + "converted": { + "marked": 1499, + "effective": 998.7837, + "currency_code": "INR" + } + } + } + }, + { + "availability": { + "sizes": [ + "OS" + ], + "other_store_quantity": 2, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 778937, + "name": "Colourful Carnival Bouncer", + "slug": "fisher-price-colourful-carnival-bouncer-778937-fafa1f", + "brand": { + "uid": 963, + "name": "Fisher-Price" + }, + "categories": [ + { + "uid": 576, + "name": "Cradles" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/963_PWUPC01977/1_1545308400588.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/963_PWUPC01977/1_1545308400588.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/fisher-price-colourful-carnival-bouncer-778937-fafa1f/", + "query": { + "product_slug": [ + "fisher-price-colourful-carnival-bouncer-778937-fafa1f" + ] + } + } + }, + "quantity": 1, + "discount": "11% OFF", + "price": { + "base": { + "add_on": 3059, + "marked": 3399, + "effective": 3059, + "selling": 3059, + "currency_code": "INR" + }, + "converted": { + "add_on": 3059, + "marked": 3399, + "effective": 3059, + "selling": 3059, + "currency_code": "INR" + } + }, + "message": "", + "bulk_offer": {}, + "key": "778937_OS", + "coupon_message": "", + "article": { + "type": "article", + "uid": "686_963_IC68601_PWUPC01977_OS", + "size": "OS", + "seller": { + "uid": 686, + "name": "INDUS CORPORATION" + }, + "store": { + "uid": 5059, + "name": "Vidyaranyapura Main Road" + }, + "quantity": 3, + "price": { + "base": { + "marked": 3399, + "effective": 3059, + "currency_code": "INR" + }, + "converted": { + "marked": 3399, + "effective": 3059, + "currency_code": "INR" + } + } + } + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "cart_id": 7927, + "uid": "7927", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Wed, 04 Sep 2019 04:52:21 GMT", + "restrict_checkout": false, + "is_valid": true +} +``` +
    + + + + + + + + + +--- + + +#### removeCoupon +Remove Coupon Applied + + + + +```swift +poscart.removeCoupon(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | The unique identifier of the cart | + + + +Remove Coupon applied on the cart by passing uid in request body. + +*Returned Response:* + + + + +[CartDetailResponse](#CartDetailResponse) + +Success. Returns coupons removed from the cart along with item details and price breakup. Refer `CartDetailResponse` for more details. + + + + +
    +  Example: + +```json +{ + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 342.75, + "mrp_total": 3199, + "subtotal": 3199, + "total": 3199, + "vog": 2856.25, + "you_saved": 0 + }, + "coupon": { + "type": "cash", + "code": "prismc22250111", + "uid": 17743, + "value": 0, + "is_applied": false, + "message": "Coupon successfully removed" + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 3199, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 3199, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 3199, + "currency_code": "INR" + } + ], + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + } + }, + "items": [ + { + "message": "", + "availability": { + "sizes": [ + "M", + "S", + "L", + "XXL", + "XL" + ], + "other_store_quantity": 10, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "bulk_offer": {}, + "key": "857596_S", + "quantity": 1, + "price": { + "base": { + "add_on": 3199, + "marked": 3199, + "effective": 3199, + "selling": 3199, + "currency_code": "INR" + }, + "converted": { + "add_on": 3199, + "marked": 3199, + "effective": 3199, + "selling": 3199, + "currency_code": "INR" + } + }, + "discount": "", + "coupon_message": "", + "product": { + "type": "product", + "uid": 857596, + "name": "Pink Solid Hoodie", + "slug": "883-police-pink-solid-hoodie-857596-111bdc", + "brand": { + "uid": 610, + "name": "883 Police" + }, + "categories": [ + { + "uid": 144, + "name": "Hoodies" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/883-police-pink-solid-hoodie-857596-111bdc/", + "query": { + "product_slug": [ + "883-police-pink-solid-hoodie-857596-111bdc" + ] + } + } + }, + "article": { + "type": "article", + "uid": "381_610_IGPL01_LETTER19APINK_S", + "size": "S", + "seller": { + "uid": 381, + "name": "INTERSOURCE GARMENTS PVT LTD" + }, + "store": { + "uid": 3009, + "name": "Kormangala" + }, + "quantity": 11, + "price": { + "base": { + "marked": 3199, + "effective": 3199, + "currency_code": "INR" + }, + "converted": { + "marked": 3199, + "effective": 3199, + "currency_code": "INR" + } + } + } + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "cart_id": 7477, + "uid": "7477", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Thu, 22 Aug 2019 10:55:05 GMT", + "restrict_checkout": false, + "is_valid": true +} +``` +
    + + + + + + + + + +--- + + +#### getBulkDiscountOffers +Get discount offers based on quantity + + + + +```swift +poscart.getBulkDiscountOffers(itemId: itemId, articleId: articleId, uid: uid, slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| itemId | Int? | no | The Item ID of the product | +| articleId | String? | no | Article Mongo ID | +| uid | Int? | no | UID of the product | +| slug | String? | no | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint /service/application/catalog/v1.0/products/ | + + + +Use this API to get a list of applicable offers along with current, next and best offer for given product. Either one of uid, item_id, slug should be present. + +*Returned Response:* + + + + +[BulkPriceResponse](#BulkPriceResponse) + +Success. Returns a data object containing the seller details and available offers (if exists) on bulk products. Refer `BulkPriceResponse` for more details. + + + + +
    +  Examples: + + +
    +  Offers found + +```json +{ + "value": { + "data": [ + { + "seller": { + "uid": 248, + "name": "MANYAVAR CREATIONS PRIVATE LIMITED" + }, + "offers": [ + { + "quantity": 1, + "auto_applied": true, + "margin": 10, + "type": "bundle", + "price": { + "marked": 3999, + "effective": 3999, + "bulk_effective": 3599.1, + "currency_code": "INR" + }, + "total": 3599.1 + }, + { + "quantity": 3, + "auto_applied": true, + "margin": 20, + "type": "bundle", + "price": { + "marked": 3999, + "effective": 3999, + "bulk_effective": 3199.2, + "currency_code": "INR" + }, + "total": 9597.6 + }, + { + "quantity": 9, + "auto_applied": true, + "margin": 30, + "type": "bundle", + "price": { + "marked": 3999, + "effective": 3999, + "bulk_effective": 3443.4444444444, + "currency_code": "INR" + }, + "total": 30991, + "best": true + } + ] + } + ] + } +} +``` +
    + +
    +  Offers not found + +```json +{ + "value": { + "data": [] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### applyRewardPoints +Apply reward points at cart + + + + +```swift +poscart.applyRewardPoints(id: id, i: i, b: b, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | | +| i | Bool? | no | | +| b | Bool? | no | | +| body | RewardPointRequest | yes | Request body | + + +Use this API to redeem a fixed no. of reward points by applying it to the cart. + +*Returned Response:* + + + + +[CartDetailResponse](#CartDetailResponse) + +Success. Returns a Cart object. Check the example shown below or refer `CartDetailResponse` for more details. + + + + +
    +  Example: + +```json +{ + "items": [ + { + "bulk_offer": {}, + "discount": "67% OFF", + "article": { + "type": "article", + "uid": "604_902_SSTC60401_636BLUE_1", + "size": "1", + "seller": { + "uid": 604, + "name": "SHRI SHANTINATH TRADING COMPANY" + }, + "store": { + "uid": 4579, + "name": "Gandhi Nagar" + }, + "quantity": 108, + "price": { + "base": { + "marked": 2999, + "effective": 999, + "currency_code": "INR" + }, + "converted": { + "marked": 2999, + "effective": 999, + "currency_code": "INR" + } + } + }, + "coupon_message": "", + "key": "707569_1", + "availability": { + "sizes": [ + "1", + "8", + "7", + "2", + "9", + "5", + "3", + "6" + ], + "other_store_quantity": 107, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "product": { + "type": "product", + "uid": 707569, + "name": "Blue and Gold Printed Ethnic Set", + "slug": "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a", + "brand": { + "uid": 902, + "name": "" + }, + "categories": [ + { + "uid": 525, + "name": "" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/902_636BLUE/1_1540301094877.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/v1/products/aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a/", + "query": { + "product_slug": [ + "aj-dezines-blue-and-gold-printed-ethnic-set-707569-bff01a" + ] + } + } + }, + "price": { + "base": { + "add_on": 999, + "marked": 2999, + "effective": 999, + "selling": 999, + "currency_code": "INR" + }, + "converted": { + "add_on": 999, + "marked": 2999, + "effective": 999, + "selling": 999, + "currency_code": "INR" + } + }, + "message": "", + "quantity": 1 + } + ], + "cart_id": 54, + "uid": "54", + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": -2000, + "fynd_cash": 0, + "gst_charges": 47.57, + "mrp_total": 2999, + "subtotal": 999, + "total": 999, + "vog": 951.43, + "you_saved": 0 + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 2999, + "currency_code": "INR" + }, + { + "display": "Discount", + "key": "discount", + "value": -2000, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 999, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 999, + "currency_code": "INR" + } + ], + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + } + }, + "delivery_charge_info": "", + "coupon_text": "View all offers", + "gstin": null, + "checkout_mode": "self", + "restrict_checkout": false, + "is_valid": true, + "last_modified": "Tue, 03 Sep 2019 05:35:59 GMT" +} +``` +
    + + + + + + + + + +--- + + +#### getAddresses +Fetch address + + + + +```swift +poscart.getAddresses(cartId: cartId, mobileNo: mobileNo, checkoutMode: checkoutMode, tags: tags, isDefault: isDefault) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| cartId | String? | no | | +| mobileNo | String? | no | | +| checkoutMode | String? | no | | +| tags | String? | no | | +| isDefault | Bool? | no | | + + + +Use this API to get all the addresses associated with an account. If successful, returns a Address resource in the response body specified in GetAddressesResponse.attibutes listed below are optional
    • uid
    • address_id
    • mobile_no
    • checkout_mode
    • tags
    • default
    + +*Returned Response:* + + + + +[GetAddressesResponse](#GetAddressesResponse) + +Success. Returns an Address object containing a list of address saved in the account. Refer `GetAddressesResponse` for more details. + + + + +
    +  Example: + +```json +{ + "address": [ + { + "landmark": "", + "area_code": { + "slug": "pincode", + "id": 400093 + }, + "id": "8b526f521bb14a2593a8b9e3ce8c76b3", + "state": "Maharashtra", + "meta": {}, + "user_id": "8b526f521bb14a2593a8b9e3ce8c76b3", + "country_code": "IND", + "phone": 9915347757, + "geo_location": {}, + "country": "India", + "is_default_address": true, + "is_active": true, + "city": "Mumbai", + "pincode": 400093, + "checkout_mode": "self", + "address_type": "home", + "tags": [], + "area": "Sector 127", + "name": "abc", + "email": "ankur@gofynd1.com", + "address": "Megatron2", + "store_name": "store123" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### addAddress +Add address to an account + + + + +```swift +poscart.addAddress(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | Address | yes | Request body | + + +Use this API to add an address to an account. + +*Returned Response:* + + + + +[SaveAddressResponse](#SaveAddressResponse) + +Success. Returns the address ID, a flag whether the address is set as default, and a success message. Refer `SaveAddressResponse` for more details. + + + + +
    +  Example: + +```json +{ + "id": "mongo_object_id", + "is_default_address": true, + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getAddressById +Fetch a single address by its ID + + + + +```swift +poscart.getAddressById(id: id, cartId: cartId, mobileNo: mobileNo, checkoutMode: checkoutMode, tags: tags, isDefault: isDefault) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | | +| cartId | String? | no | | +| mobileNo | String? | no | | +| checkoutMode | String? | no | | +| tags | String? | no | | +| isDefault | Bool? | no | | + + + +Use this API to get an addresses using its ID. If successful, returns a Address resource in the response body specified in `Address`. Attibutes listed below are optional
    • mobile_no
    • checkout_mode
    • tags
    • default
    + +*Returned Response:* + + + + +[Address](#Address) + +Success. Returns an Address object containing a list of address saved in the account. Refer `Address` for more details. + + + + +
    +  Example: + +```json +{ + "landmark": "", + "area_code": { + "slug": "pincode", + "id": 400093 + }, + "state": "Maharashtra", + "meta": {}, + "user_id": "8b526f521bb14a2593a8b9e3ce8c76b3", + "country_code": "IND", + "phone": 9915347757, + "geo_location": {}, + "country": "India", + "is_default_address": true, + "is_active": true, + "city": "Mumbai", + "pincode": 400093, + "checkout_mode": "self", + "address_type": "home", + "uid": 1145, + "tags": [], + "area": "Sector 127", + "name": "abc", + "address_id": 1145, + "email": "ankur@gofynd1.com", + "address": "Megatron2", + "store_name": "store123" +} +``` +
    + + + + + + + + + +--- + + +#### updateAddress +Update address added to an account + + + + +```swift +poscart.updateAddress(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | ID allotted to the selected address | +| body | Address | yes | Request body | + + +

    Use this API to update an existing address in the account. Request object should contain attributes mentioned in Address can be updated. These attributes are:

    • is_default_address
    • landmark
    • area
    • pincode
    • email
    • address_type
    • name
    • address_id
    • address
    + +*Returned Response:* + + + + +[UpdateAddressResponse](#UpdateAddressResponse) + +Success. Returns the address ID and a message indicating a successful address updation. + + + + +
    +  Example: + +```json +{ + "is_updated": true, + "id": "", + "is_default_address": true, + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### removeAddress +Remove address associated with an account + + + + +```swift +poscart.removeAddress(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | ID allotted to the selected address | + + + +Use this API to delete an address by its ID. This will returns an object that will indicate whether the address was deleted successfully or not. + +*Returned Response:* + + + + +[DeleteAddressResponse](#DeleteAddressResponse) + +Returns a Status object indicating the success or failure of address deletion. + + + + +
    +  Example: + +```json +{ + "id": "", + "is_deleted": true +} +``` +
    + + + + + + + + + +--- + + +#### selectAddress +Select an address from available addresses + + + + +```swift +poscart.selectAddress(cartId: cartId, i: i, b: b, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| cartId | String? | no | | +| i | Bool? | no | | +| b | Bool? | no | | +| body | SelectCartAddressRequest | yes | Request body | + + +

    Select Address from all addresses associated with the account in order to ship the cart items to that address, otherwise default address will be selected implicitly. See `SelectCartAddressRequest` in schema of request body for the list of attributes needed to select Address from account. On successful request, this API returns a Cart object. Below address attributes are required.

    • address_id
    • billing_address_id
    • uid

    + +*Returned Response:* + + + + +[CartDetailResponse](#CartDetailResponse) + +Success. Returns a Cart object as shown below. Refer `CartDetailResponse` for more details. . + + + + +
    +  Example: + +```json +{ + "is_valid": true, + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": -2250, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 315.86, + "mrp_total": 5198, + "subtotal": 5198, + "total": 2948, + "vog": 2632.15, + "you_saved": 0 + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 5198, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 5198, + "currency_code": "INR" + }, + { + "display": "Coupon", + "key": "coupon", + "value": -2250, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 2948, + "currency_code": "INR" + } + ], + "coupon": { + "type": "cash", + "code": "PRISMC22250111", + "uid": 17743, + "value": 2250, + "is_applied": true, + "message": "coupn applied" + }, + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + } + }, + "items": [ + { + "message": "", + "quantity": 1, + "availability": { + "sizes": [ + "M", + "S", + "L", + "XXL", + "XL" + ], + "other_store_quantity": 10, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "coupon_message": "PRISMC22250111 coupon applied", + "price": { + "base": { + "add_on": 3199, + "marked": 3199, + "effective": 3199, + "selling": 3199, + "currency_code": "INR" + }, + "converted": { + "add_on": 3199, + "marked": 3199, + "effective": 3199, + "selling": 3199, + "currency_code": "INR" + } + }, + "bulk_offer": {}, + "article": { + "type": "article", + "uid": "381_610_IGPL01_LETTER19APINK_S", + "size": "S", + "seller": { + "uid": 381, + "name": "INTERSOURCE GARMENTS PVT LTD" + }, + "store": { + "uid": 3009, + "name": "Kormangala" + }, + "quantity": 11, + "price": { + "base": { + "marked": 3199, + "effective": 3199, + "currency_code": "INR" + }, + "converted": { + "marked": 3199, + "effective": 3199, + "currency_code": "INR" + } + } + }, + "product": { + "type": "product", + "uid": 857596, + "name": "Pink Solid Hoodie", + "slug": "883-police-pink-solid-hoodie-857596-111bdc", + "brand": { + "uid": 610, + "name": "883 Police" + }, + "categories": [ + { + "uid": 144, + "name": "Hoodies" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/883-police-pink-solid-hoodie-857596-111bdc/", + "query": { + "product_slug": [ + "883-police-pink-solid-hoodie-857596-111bdc" + ] + } + } + }, + "key": "857596_S", + "discount": "" + }, + { + "message": "", + "quantity": 1, + "availability": { + "sizes": [ + "L", + "XL", + "XXL" + ], + "other_store_quantity": 1, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "coupon_message": "PRISMC22250111 coupon applied", + "price": { + "base": { + "add_on": 1999, + "marked": 1999, + "effective": 1999, + "selling": 1999, + "currency_code": "INR" + }, + "converted": { + "add_on": 1999, + "marked": 1999, + "effective": 1999, + "selling": 1999, + "currency_code": "INR" + } + }, + "bulk_offer": {}, + "article": { + "type": "article", + "uid": "381_610_IGPL01_SPIRAL19ANAVY_L", + "size": "L", + "seller": { + "uid": 381, + "name": "INTERSOURCE GARMENTS PVT LTD" + }, + "store": { + "uid": 3009, + "name": "Kormangala" + }, + "quantity": 2, + "price": { + "base": { + "marked": 1999, + "effective": 1999, + "currency_code": "INR" + }, + "converted": { + "marked": 1999, + "effective": 1999, + "currency_code": "INR" + } + } + }, + "product": { + "type": "product", + "uid": 820312, + "name": "Navy Blue Melange Shorts", + "slug": "883-police-navy-blue-melange-shorts-820312-4943a8", + "brand": { + "uid": 610, + "name": "883 Police" + }, + "categories": [ + { + "uid": 193, + "name": "Shorts" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/883-police-navy-blue-melange-shorts-820312-4943a8/", + "query": { + "product_slug": [ + "883-police-navy-blue-melange-shorts-820312-4943a8" + ] + } + } + }, + "key": "820312_L", + "discount": "" + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "uid": "7477", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Fri, 23 Aug 2019 08:03:12 GMT", + "restrict_checkout": false +} +``` +
    + + + + + + + + + +--- + + +#### selectPaymentMode +Update cart payment + + + + +```swift +poscart.selectPaymentMode(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | | +| body | UpdateCartPaymentRequest | yes | Request body | + + +Use this API to update cart payment. + +*Returned Response:* + + + + +[CartDetailResponse](#CartDetailResponse) + +Success. Returns a Cart object as shown below. Refer `CartDetailResponse` for more details. + + + + +
    +  Example: + +```json +{ + "success": true, + "error_message": "Note: Your order delivery will be delayed by 7-10 Days", + "user_type": "Store User", + "cod_charges": 0, + "order_id": null, + "cod_available": true, + "cod_message": "No additional COD charges applicable", + "delivery_charges": 0, + "delivery_charge_order_value": 0, + "store_code": "", + "store_emps": [], + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": -2250, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 315.86, + "mrp_total": 5198, + "subtotal": 5198, + "total": 2948, + "vog": 2632.15, + "you_saved": 0 + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 5198, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 5198, + "currency_code": "INR" + }, + { + "display": "Coupon", + "key": "coupon", + "value": -2250, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 2948, + "currency_code": "INR" + } + ], + "coupon": { + "type": "cash", + "code": "PRISMC22250111", + "uid": 17743, + "value": 2250, + "is_applied": true, + "message": "coupn applied" + }, + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + } + }, + "items": [ + { + "message": "", + "quantity": 1, + "availability": { + "sizes": [ + "M", + "S", + "L", + "XXL", + "XL" + ], + "other_store_quantity": 10, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "coupon_message": "PRISMC22250111 coupon applied", + "price": { + "base": { + "add_on": 3199, + "marked": 3199, + "effective": 3199, + "selling": 3199, + "currency_code": "INR" + }, + "converted": { + "add_on": 3199, + "marked": 3199, + "effective": 3199, + "selling": 3199, + "currency_code": "INR" + } + }, + "bulk_offer": {}, + "article": { + "type": "article", + "uid": "381_610_IGPL01_LETTER19APINK_S", + "size": "S", + "seller": { + "uid": 381, + "name": "INTERSOURCE GARMENTS PVT LTD" + }, + "store": { + "uid": 3009, + "name": "Kormangala" + }, + "quantity": 11, + "price": { + "base": { + "marked": 3199, + "effective": 3199, + "currency_code": "INR" + }, + "converted": { + "marked": 3199, + "effective": 3199, + "currency_code": "INR" + } + } + }, + "product": { + "type": "product", + "uid": 857596, + "name": "Pink Solid Hoodie", + "slug": "883-police-pink-solid-hoodie-857596-111bdc", + "brand": { + "uid": 610, + "name": "883 Police" + }, + "categories": [ + { + "uid": 144, + "name": "Hoodies" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_LETTER19APINK/1_1553062658148.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/883-police-pink-solid-hoodie-857596-111bdc/", + "query": { + "product_slug": [ + "883-police-pink-solid-hoodie-857596-111bdc" + ] + } + } + }, + "key": "857596_S", + "discount": "" + }, + { + "message": "", + "quantity": 1, + "availability": { + "sizes": [ + "L", + "XL", + "XXL" + ], + "other_store_quantity": 1, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "coupon_message": "PRISMC22250111 coupon applied", + "price": { + "base": { + "add_on": 1999, + "marked": 1999, + "effective": 1999, + "selling": 1999, + "currency_code": "INR" + }, + "converted": { + "add_on": 1999, + "marked": 1999, + "effective": 1999, + "selling": 1999, + "currency_code": "INR" + } + }, + "bulk_offer": {}, + "article": { + "type": "article", + "uid": "381_610_IGPL01_SPIRAL19ANAVY_L", + "size": "L", + "seller": { + "uid": 381, + "name": "INTERSOURCE GARMENTS PVT LTD" + }, + "store": { + "uid": 3009, + "name": "Kormangala" + }, + "quantity": 2, + "price": { + "base": { + "marked": 1999, + "effective": 1999, + "currency_code": "INR" + }, + "converted": { + "marked": 1999, + "effective": 1999, + "currency_code": "INR" + } + } + }, + "product": { + "type": "product", + "uid": 820312, + "name": "Navy Blue Melange Shorts", + "slug": "883-police-navy-blue-melange-shorts-820312-4943a8", + "brand": { + "uid": 610, + "name": "883 Police" + }, + "categories": [ + { + "uid": 193, + "name": "Shorts" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/883-police-navy-blue-melange-shorts-820312-4943a8/", + "query": { + "product_slug": [ + "883-police-navy-blue-melange-shorts-820312-4943a8" + ] + } + } + }, + "key": "820312_L", + "discount": "" + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "cart_id": 7477, + "uid": "7477", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Fri, 23 Aug 2019 08:03:04 GMT", + "restrict_checkout": false, + "is_valid": true +} +``` +
    + + + + + + + + + +--- + + +#### validateCouponForPayment +Verify the coupon eligibility against the payment mode + + + + +```swift +poscart.validateCouponForPayment(id: id, addressId: addressId, paymentMode: paymentMode, paymentIdentifier: paymentIdentifier, aggregatorName: aggregatorName, merchantCode: merchantCode) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | | +| addressId | String? | no | | +| paymentMode | String? | no | | +| paymentIdentifier | String? | no | | +| aggregatorName | String? | no | | +| merchantCode | String? | no | | + + + +Use this API to validate a coupon against the payment mode such as NetBanking, Wallet, UPI etc. + +*Returned Response:* + + + + +[PaymentCouponValidate](#PaymentCouponValidate) + +Success. Returns a success message and the coupon validity. Refer `PaymentCouponValidate` for more details. + + + + +
    +  Example: + +```json +{ + "success": true, + "message": "", + "coupon_validity": { + "valid": true, + "discount": 499.5, + "code": "testpayment", + "display_message_en": "", + "title": "Coupon value will change." + } +} +``` +
    + + + + + + + + + +--- + + +#### getShipments +Get delivery date and options before checkout + + + + +```swift +poscart.getShipments(pickAtStoreUid: pickAtStoreUid, orderingStoreId: orderingStoreId, p: p, id: id, addressId: addressId, areaCode: areaCode, orderType: orderType) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pickAtStoreUid | Int? | no | | +| orderingStoreId | Int? | no | | +| p | Bool? | no | This is a boolean value. Select `true` for getting a payment option in response. | +| id | String? | no | The unique identifier of the cart | +| addressId | String? | no | ID allotted to the selected address | +| areaCode | String? | no | The PIN Code of the destination address, e.g. 400059 | +| orderType | String? | no | The order type of shipment HomeDelivery - If the customer wants the order home-delivered PickAtStore - If the customer wants the handover of an order at the store itself. | + + + +Use this API to get shipment details, expected delivery date, items and price breakup of the shipment. + +*Returned Response:* + + + + +[CartShipmentsResponse](#CartShipmentsResponse) + +Success. Returns delivery promise along with shipment details and price breakup. Refer `CartShipmentsResponse` for more details. + + + + +
    +  Examples: + + +
    +  Shipment Generated + +```json +{ + "value": { + "items": [], + "cart_id": 7501, + "uid": "7501", + "success": true, + "error_message": "Note: Your order delivery will be delayed by 7-10 Days", + "payment_options": { + "payment_option": [ + { + "name": "COD", + "display_name": "Cash on Delivery", + "display_priority": 1, + "payment_mode_id": 11, + "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png" + }, + "list": [] + }, + { + "name": "CARD", + "display_priority": 2, + "payment_mode_id": 2, + "display_name": "Card", + "list": [] + }, + { + "name": "NB", + "display_priority": 3, + "payment_mode_id": 3, + "display_name": "Net Banking", + "list": [ + { + "aggregator_name": "Razorpay", + "bank_name": "ICICI Bank", + "bank_code": "ICIC", + "url": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png" + }, + "merchant_code": "NB_ICICI", + "display_priority": 1 + } + ] + }, + { + "name": "WL", + "display_priority": 4, + "payment_mode_id": 4, + "display_name": "Wallet", + "list": [ + { + "wallet_name": "Paytm", + "wallet_code": "paytm", + "wallet_id": 4, + "merchant_code": "PAYTM", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_small.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_large.png" + }, + "aggregator_name": "Juspay", + "display_priority": 1 + } + ] + }, + { + "name": "UPI", + "display_priority": 9, + "payment_mode_id": 6, + "display_name": "UPI", + "list": [ + { + "aggregator_name": "UPI_Razorpay", + "name": "UPI", + "display_name": "BHIM UPI", + "code": "UPI", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_100x78.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_150x100.png" + }, + "merchant_code": "UPI", + "timeout": 240, + "retry_count": 0, + "fynd_vpa": "shopsense.rzp@hdfcbank", + "intent_flow": true, + "intent_app_error_list": [ + "com.csam.icici.bank.imobile", + "in.org.npci.upiapp", + "com.whatsapp" + ] + } + ] + }, + { + "name": "PL", + "display_priority": 11, + "payment_mode_id": 1, + "display_name": "Pay Later", + "list": [ + { + "aggregator_name": "Simpl", + "name": "Simpl", + "code": "simpl", + "merchant_code": "SIMPL", + "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png" + } + } + ] + } + ], + "payment_flows": { + "Simpl": { + "data": { + "gateway": { + "route": "simpl", + "entity": "sdk", + "is_customer_validation_required": true, + "cust_validation_url": "https://api.addsale.com/gringotts/api/v1/validate-customer/", + "sdk": { + "config": { + "redirect": false, + "callback_url": null, + "action_url": "https://api.addsale.com/avis/api/v1/payments/charge-gringotts-transaction/" + }, + "data": { + "user_phone": "8452996729", + "user_email": "paymentsdummy@gofynd.com" + } + }, + "return_url": null + } + }, + "api_link": "", + "payment_flow": "sdk" + }, + "Juspay": { + "data": {}, + "api_link": "https://sandbox.juspay.in/txns", + "payment_flow": "api" + }, + "Razorpay": { + "data": {}, + "api_link": "", + "payment_flow": "sdk" + }, + "UPI_Razorpay": { + "data": {}, + "api_link": "https://api.addsale.com/gringotts/api/v1/external/payment-initialisation/", + "payment_flow": "api" + }, + "Fynd": { + "data": {}, + "api_link": "", + "payment_flow": "api" + } + }, + "default": {} + }, + "user_type": "Store User", + "cod_charges": 0, + "order_id": null, + "cod_available": true, + "cod_message": "No additional COD charges applicable", + "delivery_charges": 0, + "delivery_charge_order_value": 0, + "delivery_slots": [ + { + "date": "Sat, 24 Aug", + "delivery_slot": [ + { + "delivery_slot_timing": "By 9:00 PM", + "default": true, + "delivery_slot_id": 1 + } + ] + } + ], + "store_code": "", + "store_emps": [], + "breakup_values": { + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + }, + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 214.18, + "mrp_total": 1999, + "subtotal": 1999, + "total": 1999, + "vog": 1784.82, + "you_saved": 0 + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 1999, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 1999, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 1999, + "currency_code": "INR" + } + ] + }, + "shipments": [ + { + "fulfillment_id": 3009, + "shipment_type": "single_shipment", + "fulfillment_type": "store", + "dp_id": "29", + "dp_options": { + "4": { + "f_priority": 4, + "r_priority": 5, + "is_cod": true, + "is_prepaid": true, + "is_reverse": true + }, + "7": { + "f_priority": 3, + "r_priority": 4, + "is_cod": true, + "is_prepaid": true, + "is_reverse": true + }, + "29": { + "f_priority": 1, + "r_priority": 2, + "is_cod": true, + "is_prepaid": true, + "is_reverse": true + } + }, + "promise": { + "timestamp": { + "min": 1566678108, + "max": 1567023708 + }, + "formatted": { + "min": "Aug 24", + "max": "Aug 28" + } + }, + "box_type": "Small Courier bag", + "shipments": 1, + "items": [ + { + "quantity": 1, + "product": { + "type": "product", + "uid": 820312, + "name": "Navy Blue Melange Shorts", + "slug": "883-police-navy-blue-melange-shorts-820312-4943a8", + "brand": { + "uid": 610, + "name": "883 Police" + }, + "categories": [ + { + "uid": 193, + "name": "Shorts" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/883-police-navy-blue-melange-shorts-820312-4943a8/", + "query": { + "product_slug": [ + "883-police-navy-blue-melange-shorts-820312-4943a8" + ] + } + } + }, + "discount": "", + "bulk_offer": {}, + "key": "820312_L", + "price": { + "base": { + "add_on": 1999, + "marked": 1999, + "effective": 1999, + "selling": 1999, + "currency_code": "INR" + }, + "converted": { + "add_on": 1999, + "marked": 1999, + "effective": 1999, + "selling": 1999, + "currency_code": "INR" + } + }, + "article": { + "type": "article", + "uid": "381_610_IGPL01_SPIRAL19ANAVY_L", + "size": "L", + "seller": { + "uid": 381, + "name": "INTERSOURCE GARMENTS PVT LTD" + }, + "store": { + "uid": 3009, + "name": "Kormangala" + }, + "quantity": 2, + "price": { + "base": { + "marked": 1999, + "effective": 1999, + "currency_code": "INR" + }, + "converted": { + "marked": 1999, + "effective": 1999, + "currency_code": "INR" + } + } + }, + "availability": { + "sizes": [ + "L", + "XL", + "XXL" + ], + "other_store_quantity": 1, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "coupon_message": "", + "message": "" + } + ] + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Thu, 22 Aug 2019 20:21:48 GMT", + "restrict_checkout": false, + "is_valid": true + } +} +``` +
    + +
    +  Shipment Generation Failed + +```json +{ + "value": { + "items": [], + "cart_id": 7501, + "uid": "7501", + "success": true, + "error_message": "Note: Your order delivery will be delayed by 7-10 Days", + "payment_options": { + "payment_option": [ + { + "name": "COD", + "display_name": "Cash on Delivery", + "display_priority": 1, + "payment_mode_id": 11, + "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png" + }, + "list": [] + }, + { + "name": "CARD", + "display_priority": 2, + "payment_mode_id": 2, + "display_name": "Card", + "list": [] + }, + { + "name": "NB", + "display_priority": 3, + "payment_mode_id": 3, + "display_name": "Net Banking", + "list": [ + { + "aggregator_name": "Razorpay", + "bank_name": "ICICI Bank", + "bank_code": "ICIC", + "url": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png" + }, + "merchant_code": "NB_ICICI", + "display_priority": 1 + } + ] + }, + { + "name": "WL", + "display_priority": 4, + "payment_mode_id": 4, + "display_name": "Wallet", + "list": [ + { + "wallet_name": "Paytm", + "wallet_code": "paytm", + "wallet_id": 4, + "merchant_code": "PAYTM", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_small.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_large.png" + }, + "aggregator_name": "Juspay", + "display_priority": 1 + } + ] + }, + { + "name": "UPI", + "display_priority": 9, + "payment_mode_id": 6, + "display_name": "UPI", + "list": [ + { + "aggregator_name": "UPI_Razorpay", + "name": "UPI", + "display_name": "BHIM UPI", + "code": "UPI", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_100x78.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_150x100.png" + }, + "merchant_code": "UPI", + "timeout": 240, + "retry_count": 0, + "fynd_vpa": "shopsense.rzp@hdfcbank", + "intent_flow": true, + "intent_app_error_list": [ + "com.csam.icici.bank.imobile", + "in.org.npci.upiapp", + "com.whatsapp" + ] + } + ] + }, + { + "name": "PL", + "display_priority": 11, + "payment_mode_id": 1, + "display_name": "Pay Later", + "list": [ + { + "aggregator_name": "Simpl", + "name": "Simpl", + "code": "simpl", + "merchant_code": "SIMPL", + "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png" + } + } + ] + } + ], + "payment_flows": { + "Simpl": { + "data": { + "gateway": { + "route": "simpl", + "entity": "sdk", + "is_customer_validation_required": true, + "cust_validation_url": "https://api.addsale.com/gringotts/api/v1/validate-customer/", + "sdk": { + "config": { + "redirect": false, + "callback_url": null, + "action_url": "https://api.addsale.com/avis/api/v1/payments/charge-gringotts-transaction/" + }, + "data": { + "user_phone": "8452996729", + "user_email": "paymentsdummy@gofynd.com" + } + }, + "return_url": null + } + }, + "api_link": "", + "payment_flow": "sdk" + }, + "Juspay": { + "data": {}, + "api_link": "https://sandbox.juspay.in/txns", + "payment_flow": "api" + }, + "Razorpay": { + "data": {}, + "api_link": "", + "payment_flow": "sdk" + }, + "UPI_Razorpay": { + "data": {}, + "api_link": "https://api.addsale.com/gringotts/api/v1/external/payment-initialisation/", + "payment_flow": "api" + }, + "Fynd": { + "data": {}, + "api_link": "", + "payment_flow": "api" + } + }, + "default": {} + }, + "user_type": "Store User", + "cod_charges": 0, + "order_id": null, + "cod_available": true, + "cod_message": "No additional COD charges applicable", + "delivery_charges": 0, + "delivery_charge_order_value": 0, + "delivery_slots": [ + { + "date": "Sat, 24 Aug", + "delivery_slot": [ + { + "delivery_slot_timing": "By 9:00 PM", + "default": true, + "delivery_slot_id": 1 + } + ] + } + ], + "store_code": "", + "store_emps": [], + "breakup_values": { + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + }, + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 214.18, + "mrp_total": 1999, + "subtotal": 1999, + "total": 1999, + "vog": 1784.82, + "you_saved": 0 + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 1999, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 1999, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 1999, + "currency_code": "INR" + } + ] + }, + "shipments": [], + "message": "Shipments could not be generated. Please Try again after some time.", + "delivery_charge_info": "", + "coupon_text": "View all offers", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Thu, 22 Aug 2019 20:21:48 GMT", + "restrict_checkout": false, + "is_valid": false + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateShipments +Update shipment delivery type and quantity before checkout + + + + +```swift +poscart.updateShipments(i: i, p: p, id: id, addressId: addressId, orderType: orderType, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| i | Bool? | no | This is a boolean value. Select `true` to retrieve all the items added in the cart. | +| p | Bool? | no | This is a boolean value. Select `true` for getting a payment option in response. | +| id | String? | no | The unique identifier of the cart | +| addressId | String? | no | ID allotted to an address | +| orderType | String? | no | The order type of shipment HomeDelivery - If the customer wants the order home-delivered PickAtStore - If the customer wants the handover of an order at the store itself. | +| body | UpdateCartShipmentRequest | yes | Request body | + + +Use this API to update the delivery type and quantity as per customer's preference for either store pick-up or home-delivery. + +*Returned Response:* + + + + +[CartShipmentsResponse](#CartShipmentsResponse) + +Success. Returns delivery promise along with shipment details and price breakup. Refer `CartShipmentsResponse` for more details. + + + + +
    +  Examples: + + +
    +  Shipment Generated + +```json +{ + "value": { + "items": [], + "cart_id": 7501, + "uid": "7501", + "success": true, + "error_message": "Note: Your order delivery will be delayed by 7-10 Days", + "payment_options": { + "payment_option": [ + { + "name": "COD", + "display_name": "Cash on Delivery", + "display_priority": 1, + "payment_mode_id": 11, + "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png" + }, + "list": [] + }, + { + "name": "CARD", + "display_priority": 2, + "payment_mode_id": 2, + "display_name": "Card", + "list": [] + }, + { + "name": "NB", + "display_priority": 3, + "payment_mode_id": 3, + "display_name": "Net Banking", + "list": [ + { + "aggregator_name": "Razorpay", + "bank_name": "ICICI Bank", + "bank_code": "ICIC", + "url": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png" + }, + "merchant_code": "NB_ICICI", + "display_priority": 1 + } + ] + }, + { + "name": "WL", + "display_priority": 4, + "payment_mode_id": 4, + "display_name": "Wallet", + "list": [ + { + "wallet_name": "Paytm", + "wallet_code": "paytm", + "wallet_id": 4, + "merchant_code": "PAYTM", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_small.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_large.png" + }, + "aggregator_name": "Juspay", + "display_priority": 1 + } + ] + }, + { + "name": "UPI", + "display_priority": 9, + "payment_mode_id": 6, + "display_name": "UPI", + "list": [ + { + "aggregator_name": "UPI_Razorpay", + "name": "UPI", + "display_name": "BHIM UPI", + "code": "UPI", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_100x78.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_150x100.png" + }, + "merchant_code": "UPI", + "timeout": 240, + "retry_count": 0, + "fynd_vpa": "shopsense.rzp@hdfcbank", + "intent_flow": true, + "intent_app_error_list": [ + "com.csam.icici.bank.imobile", + "in.org.npci.upiapp", + "com.whatsapp" + ] + } + ] + }, + { + "name": "PL", + "display_priority": 11, + "payment_mode_id": 1, + "display_name": "Pay Later", + "list": [ + { + "aggregator_name": "Simpl", + "name": "Simpl", + "code": "simpl", + "merchant_code": "SIMPL", + "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png" + } + } + ] + } + ], + "payment_flows": { + "Simpl": { + "data": { + "gateway": { + "route": "simpl", + "entity": "sdk", + "is_customer_validation_required": true, + "cust_validation_url": "https://api.addsale.com/gringotts/api/v1/validate-customer/", + "sdk": { + "config": { + "redirect": false, + "callback_url": null, + "action_url": "https://api.addsale.com/avis/api/v1/payments/charge-gringotts-transaction/" + }, + "data": { + "user_phone": "8452996729", + "user_email": "paymentsdummy@gofynd.com" + } + }, + "return_url": null + } + }, + "api_link": "", + "payment_flow": "sdk" + }, + "Juspay": { + "data": {}, + "api_link": "https://sandbox.juspay.in/txns", + "payment_flow": "api" + }, + "Razorpay": { + "data": {}, + "api_link": "", + "payment_flow": "sdk" + }, + "UPI_Razorpay": { + "data": {}, + "api_link": "https://api.addsale.com/gringotts/api/v1/external/payment-initialisation/", + "payment_flow": "api" + }, + "Fynd": { + "data": {}, + "api_link": "", + "payment_flow": "api" + } + }, + "default": {} + }, + "user_type": "Store User", + "cod_charges": 0, + "order_id": null, + "cod_available": true, + "cod_message": "No additional COD charges applicable", + "delivery_charges": 0, + "delivery_charge_order_value": 0, + "delivery_slots": [ + { + "date": "Sat, 24 Aug", + "delivery_slot": [ + { + "delivery_slot_timing": "By 9:00 PM", + "default": true, + "delivery_slot_id": 1 + } + ] + } + ], + "store_code": "", + "store_emps": [], + "breakup_values": { + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + }, + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 214.18, + "mrp_total": 1999, + "subtotal": 1999, + "total": 1999, + "vog": 1784.82, + "you_saved": 0 + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 1999, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 1999, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 1999, + "currency_code": "INR" + } + ] + }, + "shipments": [ + { + "fulfillment_id": 3009, + "shipment_type": "single_shipment", + "fulfillment_type": "store", + "dp_id": "29", + "order_type": "PickAtStore", + "dp_options": { + "4": { + "f_priority": 4, + "r_priority": 5, + "is_cod": true, + "is_prepaid": true, + "is_reverse": true + }, + "7": { + "f_priority": 3, + "r_priority": 4, + "is_cod": true, + "is_prepaid": true, + "is_reverse": true + }, + "29": { + "f_priority": 1, + "r_priority": 2, + "is_cod": true, + "is_prepaid": true, + "is_reverse": true + } + }, + "promise": { + "timestamp": { + "min": 1566678108, + "max": 1567023708 + }, + "formatted": { + "min": "Aug 24", + "max": "Aug 28" + } + }, + "box_type": "Small Courier bag", + "shipments": 1, + "items": [ + { + "quantity": 1, + "product": { + "type": "product", + "uid": 820312, + "name": "Navy Blue Melange Shorts", + "slug": "883-police-navy-blue-melange-shorts-820312-4943a8", + "brand": { + "uid": 610, + "name": "883 Police" + }, + "categories": [ + { + "uid": 193, + "name": "Shorts" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/883-police-navy-blue-melange-shorts-820312-4943a8/", + "query": { + "product_slug": [ + "883-police-navy-blue-melange-shorts-820312-4943a8" + ] + } + } + }, + "discount": "", + "bulk_offer": {}, + "key": "820312_L", + "price": { + "base": { + "add_on": 1999, + "marked": 1999, + "effective": 1999, + "selling": 1999, + "currency_code": "INR" + }, + "converted": { + "add_on": 1999, + "marked": 1999, + "effective": 1999, + "selling": 1999, + "currency_code": "INR" + } + }, + "article": { + "type": "article", + "uid": "381_610_IGPL01_SPIRAL19ANAVY_L", + "size": "L", + "seller": { + "uid": 381, + "name": "INTERSOURCE GARMENTS PVT LTD" + }, + "store": { + "uid": 3009, + "name": "Kormangala" + }, + "quantity": 2, + "price": { + "base": { + "marked": 1999, + "effective": 1999, + "currency_code": "INR" + }, + "converted": { + "marked": 1999, + "effective": 1999, + "currency_code": "INR" + } + } + }, + "availability": { + "sizes": [ + "L", + "XL", + "XXL" + ], + "other_store_quantity": 1, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "coupon_message": "", + "message": "" + } + ] + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Thu, 22 Aug 2019 20:21:48 GMT", + "restrict_checkout": false, + "is_valid": true + } +} +``` +
    + +
    +  Shipment Generation Failed + +```json +{ + "value": { + "items": [], + "cart_id": 7501, + "uid": "7501", + "success": true, + "error_message": "Note: Your order delivery will be delayed by 7-10 Days", + "payment_options": { + "payment_option": [ + { + "name": "COD", + "display_name": "Cash on Delivery", + "display_priority": 1, + "payment_mode_id": 11, + "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png" + }, + "list": [] + }, + { + "name": "CARD", + "display_priority": 2, + "payment_mode_id": 2, + "display_name": "Card", + "list": [] + }, + { + "name": "NB", + "display_priority": 3, + "payment_mode_id": 3, + "display_name": "Net Banking", + "list": [ + { + "aggregator_name": "Razorpay", + "bank_name": "ICICI Bank", + "bank_code": "ICIC", + "url": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png" + }, + "merchant_code": "NB_ICICI", + "display_priority": 1 + } + ] + }, + { + "name": "WL", + "display_priority": 4, + "payment_mode_id": 4, + "display_name": "Wallet", + "list": [ + { + "wallet_name": "Paytm", + "wallet_code": "paytm", + "wallet_id": 4, + "merchant_code": "PAYTM", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_small.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_large.png" + }, + "aggregator_name": "Juspay", + "display_priority": 1 + } + ] + }, + { + "name": "UPI", + "display_priority": 9, + "payment_mode_id": 6, + "display_name": "UPI", + "list": [ + { + "aggregator_name": "UPI_Razorpay", + "name": "UPI", + "display_name": "BHIM UPI", + "code": "UPI", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_100x78.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_150x100.png" + }, + "merchant_code": "UPI", + "timeout": 240, + "retry_count": 0, + "fynd_vpa": "shopsense.rzp@hdfcbank", + "intent_flow": true, + "intent_app_error_list": [ + "com.csam.icici.bank.imobile", + "in.org.npci.upiapp", + "com.whatsapp" + ] + } + ] + }, + { + "name": "PL", + "display_priority": 11, + "payment_mode_id": 1, + "display_name": "Pay Later", + "list": [ + { + "aggregator_name": "Simpl", + "name": "Simpl", + "code": "simpl", + "merchant_code": "SIMPL", + "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png" + } + } + ] + } + ], + "payment_flows": { + "Simpl": { + "data": { + "gateway": { + "route": "simpl", + "entity": "sdk", + "is_customer_validation_required": true, + "cust_validation_url": "https://api.addsale.com/gringotts/api/v1/validate-customer/", + "sdk": { + "config": { + "redirect": false, + "callback_url": null, + "action_url": "https://api.addsale.com/avis/api/v1/payments/charge-gringotts-transaction/" + }, + "data": { + "user_phone": "8452996729", + "user_email": "paymentsdummy@gofynd.com" + } + }, + "return_url": null + } + }, + "api_link": "", + "payment_flow": "sdk" + }, + "Juspay": { + "data": {}, + "api_link": "https://sandbox.juspay.in/txns", + "payment_flow": "api" + }, + "Razorpay": { + "data": {}, + "api_link": "", + "payment_flow": "sdk" + }, + "UPI_Razorpay": { + "data": {}, + "api_link": "https://api.addsale.com/gringotts/api/v1/external/payment-initialisation/", + "payment_flow": "api" + }, + "Fynd": { + "data": {}, + "api_link": "", + "payment_flow": "api" + } + }, + "default": {} + }, + "user_type": "Store User", + "cod_charges": 0, + "order_id": null, + "cod_available": true, + "cod_message": "No additional COD charges applicable", + "delivery_charges": 0, + "delivery_charge_order_value": 0, + "delivery_slots": [ + { + "date": "Sat, 24 Aug", + "delivery_slot": [ + { + "delivery_slot_timing": "By 9:00 PM", + "default": true, + "delivery_slot_id": 1 + } + ] + } + ], + "store_code": "", + "store_emps": [], + "breakup_values": { + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + }, + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 214.18, + "mrp_total": 1999, + "subtotal": 1999, + "total": 1999, + "vog": 1784.82, + "you_saved": 0 + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 1999, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 1999, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 1999, + "currency_code": "INR" + } + ] + }, + "shipments": [], + "message": "Shipments could not be generated. Please Try again after some time.", + "delivery_charge_info": "", + "coupon_text": "View all offers", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Thu, 22 Aug 2019 20:21:48 GMT", + "restrict_checkout": false, + "is_valid": false + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### checkoutCart +Checkout all items in the cart + + + + +```swift +poscart.checkoutCart(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | | +| body | CartPosCheckoutDetailRequest | yes | Request body | + + +Use this API to checkout all items in the cart for payment and order generation. For COD, order will be generated directly, whereas for other checkout modes, user will be redirected to a payment gateway. + +*Returned Response:* + + + + +[CartCheckoutResponse](#CartCheckoutResponse) + +Success. Returns the status of cart checkout. Refer `CartCheckoutResponse` for more details. + + + + +
    +  Examples: + + +
    +  Address id not found + +```json +{ + "value": { + "success": false, + "message": "No address found with address id {address_id}" + } +} +``` +
    + +
    +  Missing address_id + +```json +{ + "value": { + "address_id": [ + "Missing data for required field." + ] + } +} +``` +
    + +
    +  Successful checkout cod payment + +```json +{ + "value": { + "success": true, + "cart": { + "success": true, + "error_message": "Note: Your order delivery will be delayed by 7-10 Days", + "payment_options": { + "payment_option": [ + { + "name": "COD", + "display_name": "Cash on Delivery", + "display_priority": 1, + "payment_mode_id": 11, + "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/cod.png" + }, + "list": [] + }, + { + "name": "CARD", + "display_priority": 2, + "payment_mode_id": 2, + "display_name": "Card", + "list": [] + }, + { + "name": "NB", + "display_priority": 3, + "payment_mode_id": 3, + "display_name": "Net Banking", + "list": [ + { + "aggregator_name": "Razorpay", + "bank_name": "ICICI Bank", + "bank_code": "ICIC", + "url": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/NB_ICICI.png" + }, + "merchant_code": "NB_ICICI", + "display_priority": 1 + } + ] + }, + { + "name": "WL", + "display_priority": 4, + "payment_mode_id": 4, + "display_name": "Wallet", + "list": [ + { + "wallet_name": "Paytm", + "wallet_code": "paytm", + "wallet_id": 4, + "merchant_code": "PAYTM", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_small.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/paytm_logo_large.png" + }, + "aggregator_name": "Juspay", + "display_priority": 1 + } + ] + }, + { + "name": "UPI", + "display_priority": 9, + "payment_mode_id": 6, + "display_name": "UPI", + "list": [ + { + "aggregator_name": "UPI_Razorpay", + "name": "UPI", + "display_name": "BHIM UPI", + "code": "UPI", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_100x78.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/upi_150x100.png" + }, + "merchant_code": "UPI", + "timeout": 240, + "retry_count": 0, + "fynd_vpa": "shopsense.rzp@hdfcbank", + "intent_flow": true, + "intent_app_error_list": [ + "com.csam.icici.bank.imobile", + "in.org.npci.upiapp", + "com.whatsapp" + ] + } + ] + }, + { + "name": "PL", + "display_priority": 11, + "payment_mode_id": 1, + "display_name": "Pay Later", + "list": [ + { + "aggregator_name": "Simpl", + "name": "Simpl", + "code": "simpl", + "merchant_code": "SIMPL", + "logo": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", + "logo_url": { + "small": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png", + "large": "https://d2co8r51m5ca2d.cloudfront.net/payments_assets/simpl_logo.png" + } + } + ] + } + ], + "payment_flows": { + "Simpl": { + "data": { + "gateway": { + "route": "simpl", + "entity": "sdk", + "is_customer_validation_required": true, + "cust_validation_url": "https://api.addsale.com/gringotts/api/v1/validate-customer/", + "sdk": { + "config": { + "redirect": false, + "callback_url": null, + "action_url": "https://api.addsale.com/avis/api/v1/payments/charge-gringotts-transaction/" + }, + "data": { + "user_phone": "8452996729", + "user_email": "paymentsdummy@gofynd.com" + } + }, + "return_url": null + } + }, + "api_link": "", + "payment_flow": "sdk" + }, + "Juspay": { + "data": {}, + "api_link": "https://sandbox.juspay.in/txns", + "payment_flow": "api" + }, + "Razorpay": { + "data": {}, + "api_link": "", + "payment_flow": "sdk" + }, + "UPI_Razorpay": { + "data": {}, + "api_link": "https://api.addsale.com/gringotts/api/v1/external/payment-initialisation/", + "payment_flow": "api" + }, + "Fynd": { + "data": {}, + "api_link": "", + "payment_flow": "api" + } + }, + "default": {} + }, + "user_type": "Store User", + "cod_charges": 0, + "order_id": "FY5D5E215CF287584CE6", + "cod_available": true, + "cod_message": "No additional COD charges applicable", + "delivery_charges": 0, + "delivery_charge_order_value": 0, + "delivery_slots": [ + { + "date": "Sat, 24 Aug", + "delivery_slot": [ + { + "delivery_slot_timing": "By 9:00 PM", + "default": true, + "delivery_slot_id": 1 + } + ] + } + ], + "store_code": "", + "store_emps": [], + "breakup_values": { + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid Coupon" + }, + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + }, + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 214.18, + "mrp_total": 1999, + "subtotal": 1999, + "total": 1999, + "vog": 1784.82, + "you_saved": 0 + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 1999, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 1999, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 1999, + "currency_code": "INR" + } + ] + }, + "items": [ + { + "key": "820312_L", + "message": "", + "bulk_offer": {}, + "price": { + "base": { + "add_on": 1999, + "marked": 1999, + "effective": 1999, + "selling": 1999, + "currency_code": "INR" + }, + "converted": { + "add_on": 1999, + "marked": 1999, + "effective": 1999, + "selling": 1999, + "currency_code": "INR" + } + }, + "quantity": 1, + "discount": "", + "product": { + "type": "product", + "uid": 820312, + "name": "Navy Blue Melange Shorts", + "slug": "883-police-navy-blue-melange-shorts-820312-4943a8", + "brand": { + "uid": 610, + "name": "883 Police" + }, + "categories": [ + { + "uid": 193, + "name": "Shorts" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/610_SPIRAL19ANAVY/1_1549105947281.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/883-police-navy-blue-melange-shorts-820312-4943a8/", + "query": { + "product_slug": [ + "883-police-navy-blue-melange-shorts-820312-4943a8" + ] + } + } + }, + "article": { + "type": "article", + "uid": "381_610_IGPL01_SPIRAL19ANAVY_L", + "size": "L", + "seller": { + "uid": 381, + "name": "INTERSOURCE GARMENTS PVT LTD" + }, + "store": { + "uid": 3009, + "name": "Kormangala" + }, + "quantity": 2, + "price": { + "base": { + "marked": 1999, + "effective": 1999, + "currency_code": "INR" + }, + "converted": { + "marked": 1999, + "effective": 1999, + "currency_code": "INR" + } + } + }, + "coupon_message": "", + "availability": { + "sizes": [ + "L", + "XL", + "XXL" + ], + "other_store_quantity": 1, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + } + } + ], + "delivery_charge_info": "", + "coupon_text": "View all offers", + "cart_id": 7483, + "uid": "7483", + "gstin": null, + "checkout_mode": "self", + "last_modified": "Thu, 22 Aug 2019 04:58:44 GMT", + "restrict_checkout": false, + "is_valid": true + }, + "callback_url": "https://api.addsale.com/gringotts/api/v1/external/payment-callback/", + "app_intercept_url": "http://uniket-testing.addsale.link/cart/order-status", + "message": "", + "data": { + "order_id": "FY5D5E215CF287584CE6" + }, + "order_id": "FY5D5E215CF287584CE6" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateCartMeta +Update the cart meta + + + + +```swift +poscart.updateCartMeta(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | The unique identifier of the cart | +| body | CartMetaRequest | yes | Request body | + + +Use this API to update cart meta like checkout_mode and gstin. + +*Returned Response:* + + + + +[CartMetaResponse](#CartMetaResponse) + +Returns a message indicating the success of cart meta updation as shown below. + + + + +
    +  Example: + +```json +{ + "message": "cart meta updated" +} +``` +
    + + + + + + + + + +--- + + +#### getAvailableDeliveryModes +Get available delivery modes for cart + + + + +```swift +poscart.getAvailableDeliveryModes(areaCode: areaCode, id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| areaCode | String | yes | | +| id | String? | no | | + + + +Use this API to get the delivery modes (home-delivery/store-pickup) along with a list of pickup stores available for a given cart at a given PIN Code. User can then view the address of a pickup store with the help of store-address API. + +*Returned Response:* + + + + +[CartDeliveryModesResponse](#CartDeliveryModesResponse) + +Success. Returns the available delivery mode available for a given PIN Code, along with the UID of all the eligible pickup stores. + + + + +
    +  Example: + +```json +{ + "available_modes": [ + "HomeDelivery", + "PickAtStore" + ], + "pickup_stores": [ + 1 + ] +} +``` +
    + + + + + + + + + +--- + + +#### getStoreAddressByUid +Get list of stores for give uids + + + + +```swift +poscart.getStoreAddressByUid(storeUid: storeUid) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| storeUid | Int | yes | | + + + +Use this API to get the store details by entering the unique identifier of the pickup stores shown in the response of available-delivery-mode API. + +*Returned Response:* + + + + +[StoreDetailsResponse](#StoreDetailsResponse) + +Success. Returns available store information with its address as shown below. + + + + +
    +  Example: + +```json +{ + "items": [ + { + "name": "Tennille Urse", + "phone": "9819716565", + "email": "rehman@cashkart.com", + "address_type": "store", + "address": "NO", + "area": "", + "pincode": 400072, + "area_code": 400072, + "area_code_slug": "pincode", + "landmark": "", + "country": "INDIA", + "city": "MUMBAI", + "state": "MAHA", + "store_code": "6462b3cd-9d64-4da9-a764-b0e6a52cf5e8", + "uid": 20, + "geo_location": { + "longitude": 1, + "latitude": 1 + } + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getCartShareLink +Generate token for sharing the cart + + + + +```swift +poscart.getCartShareLink(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | GetShareCartLinkRequest | yes | Request body | + + +Use this API to generate a shared cart snapshot and return a shortlink token. The link can be shared with other users for getting the same items in their cart. + +*Returned Response:* + + + + +[GetShareCartLinkResponse](#GetShareCartLinkResponse) + +Returns a URL to share and a token as shown below. + + + + +
    +  Examples: + + +
    +  Token Generated + +```json +{ + "value": { + "token": "ZweG1XyX", + "share_url": "https://uniket-testing.addsale.link/shared-cart/ZweG1XyX" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getCartSharedItems +Get details of a shared cart + + + + +```swift +poscart.getCartSharedItems(token: token) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| token | String | yes | Token of the shared short link | + + + +Use this API to get the shared cart details as per the token generated using the share-cart API. + +*Returned Response:* + + + + +[SharedCartResponse](#SharedCartResponse) + +Success. Returns a Cart object as per the valid token. Refer `SharedCartResponse` for more details. + + + + +
    +  Example: + +```json +{ + "cart": { + "shared_cart_details": { + "token": "BQ9jySQ9", + "user": { + "user_id": "23109086", + "is_anonymous": false + }, + "meta": { + "selected_staff": "", + "ordering_store": null + }, + "selected_staff": "", + "ordering_store": null, + "source": {}, + "created_on": "2019-12-18T14:00:07.165000" + }, + "items": [ + { + "key": "791651_6", + "discount": "", + "bulk_offer": {}, + "coupon_message": "", + "article": { + "type": "article", + "uid": "304_1054_9036_R1005753_6", + "size": "6", + "seller": { + "uid": 304, + "name": "LEAYAN GLOBAL PVT. LTD." + }, + "store": { + "uid": 5322, + "name": "Vaisali Nagar" + }, + "quantity": 1, + "price": { + "base": { + "marked": 2095, + "effective": 2095, + "currency_code": "INR" + }, + "converted": { + "marked": 2095, + "effective": 2095, + "currency_code": "INR" + } + } + }, + "product": { + "type": "product", + "uid": 791651, + "name": "Black Running Shoes", + "slug": "furo-black-running-shoes-791651-f8bcc3", + "brand": { + "uid": 1054, + "name": "Furo" + }, + "categories": [ + { + "uid": 160, + "name": "Running Shoes" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/furo-black-running-shoes-791651-f8bcc3/", + "query": { + "product_slug": [ + "furo-black-running-shoes-791651-f8bcc3" + ] + } + } + }, + "message": "", + "quantity": 1, + "availability": { + "sizes": [ + "7", + "8", + "9", + "10", + "6" + ], + "other_store_quantity": 12, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "price": { + "base": { + "add_on": 2095, + "marked": 2095, + "effective": 2095, + "selling": 2095, + "currency_code": "INR" + }, + "converted": { + "add_on": 2095, + "marked": 2095, + "effective": 2095, + "selling": 2095, + "currency_code": "INR" + } + } + }, + { + "key": "791651_7", + "discount": "", + "bulk_offer": {}, + "coupon_message": "", + "article": { + "type": "article", + "uid": "304_1054_9036_R1005753_7", + "size": "7", + "seller": { + "uid": 304, + "name": "LEAYAN GLOBAL PVT. LTD." + }, + "store": { + "uid": 5322, + "name": "Vaisali Nagar" + }, + "quantity": 2, + "price": { + "base": { + "marked": 2095, + "effective": 2095, + "currency_code": "INR" + }, + "converted": { + "marked": 2095, + "effective": 2095, + "currency_code": "INR" + } + } + }, + "product": { + "type": "product", + "uid": 791651, + "name": "Black Running Shoes", + "slug": "furo-black-running-shoes-791651-f8bcc3", + "brand": { + "uid": 1054, + "name": "Furo" + }, + "categories": [ + { + "uid": 160, + "name": "Running Shoes" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/furo-black-running-shoes-791651-f8bcc3/", + "query": { + "product_slug": [ + "furo-black-running-shoes-791651-f8bcc3" + ] + } + } + }, + "message": "", + "quantity": 2, + "availability": { + "sizes": [ + "7", + "8", + "9", + "10", + "6" + ], + "other_store_quantity": 7, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "price": { + "base": { + "add_on": 4190, + "marked": 4190, + "effective": 4190, + "selling": 4190, + "currency_code": "INR" + }, + "converted": { + "add_on": 4190, + "marked": 4190, + "effective": 4190, + "selling": 4190, + "currency_code": "INR" + } + } + } + ], + "cart_id": 13055, + "uid": "13055", + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 958.73, + "mrp_total": 6285, + "subtotal": 6285, + "total": 6285, + "vog": 5326.27, + "you_saved": 0 + }, + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid coupon" + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 6285, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 6285, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 6285, + "currency_code": "INR" + } + ] + }, + "delivery_charge_info": "", + "coupon_text": "View all offers", + "gstin": null, + "comment": "", + "checkout_mode": "self", + "payment_selection_lock": { + "enabled": false, + "default_options": "COD", + "payment_identifier": null + }, + "restrict_checkout": false, + "is_valid": true, + "last_modified": "Mon, 16 Dec 2019 07:02:18 GMT" + }, + "error": "" +} +``` +
    + + + + + + + + + +--- + + +#### updateCartWithSharedItems +Merge or replace existing cart + + + + +```swift +poscart.updateCartWithSharedItems(token: token, action: action) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| token | String | yes | Token of the shared short link | +| action | String | yes | Operation to perform on the existing cart merge or replace. | + + + +Use this API to merge the shared cart with existing cart, or replace the existing cart with the shared cart. The `action` parameter is used to indicate the operation Merge or Replace. + +*Returned Response:* + + + + +[SharedCartResponse](#SharedCartResponse) + +Success. Returns a merged or replaced cart as per the valid token. Refer `SharedCartResponse` for more details. + + + + +
    +  Examples: + + +
    +  Cart Merged/Replaced + +```json +{ + "value": { + "cart": { + "shared_cart_details": { + "token": "BQ9jySQ9", + "user": { + "user_id": "23109086", + "is_anonymous": false + }, + "meta": { + "selected_staff": "", + "ordering_store": null + }, + "selected_staff": "", + "ordering_store": null, + "source": {}, + "created_on": "2019-12-18T14:00:07.165000" + }, + "items": [ + { + "key": "791651_6", + "discount": "", + "bulk_offer": {}, + "coupon_message": "", + "article": { + "type": "article", + "uid": "304_1054_9036_R1005753_6", + "size": "6", + "seller": { + "uid": 304, + "name": "LEAYAN GLOBAL PVT. LTD." + }, + "store": { + "uid": 5322, + "name": "Vaisali Nagar" + }, + "quantity": 1, + "price": { + "base": { + "marked": 2095, + "effective": 2095, + "currency_code": "INR" + }, + "converted": { + "marked": 2095, + "effective": 2095, + "currency_code": "INR" + } + } + }, + "product": { + "type": "product", + "uid": 791651, + "name": "Black Running Shoes", + "slug": "furo-black-running-shoes-791651-f8bcc3", + "brand": { + "uid": 1054, + "name": "Furo" + }, + "categories": [ + { + "uid": 160, + "name": "Running Shoes" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/furo-black-running-shoes-791651-f8bcc3/", + "query": { + "product_slug": [ + "furo-black-running-shoes-791651-f8bcc3" + ] + } + } + }, + "message": "", + "quantity": 1, + "availability": { + "sizes": [ + "7", + "8", + "9", + "10", + "6" + ], + "other_store_quantity": 12, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "price": { + "base": { + "add_on": 2095, + "marked": 2095, + "effective": 2095, + "selling": 2095, + "currency_code": "INR" + }, + "converted": { + "add_on": 2095, + "marked": 2095, + "effective": 2095, + "selling": 2095, + "currency_code": "INR" + } + } + }, + { + "key": "791651_7", + "discount": "", + "bulk_offer": {}, + "coupon_message": "", + "article": { + "type": "article", + "uid": "304_1054_9036_R1005753_7", + "size": "7", + "seller": { + "uid": 304, + "name": "LEAYAN GLOBAL PVT. LTD." + }, + "store": { + "uid": 5322, + "name": "Vaisali Nagar" + }, + "quantity": 2, + "price": { + "base": { + "marked": 2095, + "effective": 2095, + "currency_code": "INR" + }, + "converted": { + "marked": 2095, + "effective": 2095, + "currency_code": "INR" + } + } + }, + "product": { + "type": "product", + "uid": 791651, + "name": "Black Running Shoes", + "slug": "furo-black-running-shoes-791651-f8bcc3", + "brand": { + "uid": 1054, + "name": "Furo" + }, + "categories": [ + { + "uid": 160, + "name": "Running Shoes" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/1054_R1005753/1_1546490507364.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/furo-black-running-shoes-791651-f8bcc3/", + "query": { + "product_slug": [ + "furo-black-running-shoes-791651-f8bcc3" + ] + } + } + }, + "message": "", + "quantity": 2, + "availability": { + "sizes": [ + "7", + "8", + "9", + "10", + "6" + ], + "other_store_quantity": 7, + "out_of_stock": false, + "deliverable": true, + "is_valid": true + }, + "price": { + "base": { + "add_on": 4190, + "marked": 4190, + "effective": 4190, + "selling": 4190, + "currency_code": "INR" + }, + "converted": { + "add_on": 4190, + "marked": 4190, + "effective": 4190, + "selling": 4190, + "currency_code": "INR" + } + } + } + ], + "cart_id": 13055, + "uid": "13055", + "breakup_values": { + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": 0, + "fynd_cash": 0, + "gst_charges": 958.73, + "mrp_total": 6285, + "subtotal": 6285, + "total": 6285, + "vog": 5326.27, + "you_saved": 0 + }, + "loyalty_points": { + "total": 0, + "applicable": 0, + "is_applied": false, + "description": "Your cashback, referrals, and refund amount get credited to Fynd Cash which can be redeemed while placing an order." + }, + "coupon": { + "type": "cash", + "code": "", + "uid": null, + "value": 0, + "is_applied": false, + "message": "Sorry! Invalid coupon" + }, + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 6285, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 6285, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 6285, + "currency_code": "INR" + } + ] + }, + "delivery_charge_info": "", + "coupon_text": "View all offers", + "gstin": null, + "comment": "", + "checkout_mode": "self", + "payment_selection_lock": { + "enabled": false, + "default_options": "COD", + "payment_identifier": null + }, + "restrict_checkout": false, + "is_valid": true, + "last_modified": "Mon, 16 Dec 2019 07:02:18 GMT" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [CategoryInfo](#CategoryInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | Product Category Id | + | name | String? | yes | | + +--- + + + + + #### [ActionQuery](#ActionQuery) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | productSlug | [String]? | yes | Contains list of product slug | + +--- + + + + + #### [ProductAction](#ProductAction) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | query | [ActionQuery](#ActionQuery)? | yes | | + | url | String? | yes | | + +--- + + + + + #### [ProductImage](#ProductImage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | aspectRatio | String? | yes | | + | secureUrl | String? | yes | | + | url | String? | yes | | + +--- + + + + + #### [BaseInfo](#BaseInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | name | String? | yes | | + +--- + + + + + #### [CartProduct](#CartProduct) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | categories | [[CategoryInfo](#CategoryInfo)]? | yes | | + | uid | Int? | yes | | + | name | String? | yes | | + | action | [ProductAction](#ProductAction)? | yes | | + | images | [[ProductImage](#ProductImage)]? | yes | | + | slug | String? | yes | Unique product url name generated via product name and other meta data | + | brand | [BaseInfo](#BaseInfo)? | yes | | + +--- + + + + + #### [CartProductIdentifer](#CartProductIdentifer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | identifier | String? | yes | Article idenfier generated by cart | + +--- + + + + + #### [BasePrice](#BasePrice) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | marked | Double? | yes | | + | effective | Double? | yes | | + | currencySymbol | String? | yes | | + | currencyCode | String? | yes | | + +--- + + + + + #### [ArticlePriceInfo](#ArticlePriceInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | base | [BasePrice](#BasePrice)? | yes | | + | converted | [BasePrice](#BasePrice)? | yes | | + +--- + + + + + #### [ProductArticle](#ProductArticle) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | quantity | Int? | yes | | + | uid | String? | yes | | + | price | [ArticlePriceInfo](#ArticlePriceInfo)? | yes | | + | extraMeta | [String: Any]? | yes | | + | store | [BaseInfo](#BaseInfo)? | yes | | + | size | String? | yes | | + | seller | [BaseInfo](#BaseInfo)? | yes | | + +--- + + + + + #### [ProductPrice](#ProductPrice) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | currencySymbol | String? | yes | | + | selling | Double? | yes | | + | currencyCode | String? | yes | | + | marked | Double? | yes | | + | effective | Double? | yes | | + | addOn | Double? | yes | | + +--- + + + + + #### [ProductPriceInfo](#ProductPriceInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | base | [ProductPrice](#ProductPrice)? | yes | | + | converted | [ProductPrice](#ProductPrice)? | yes | | + +--- + + + + + #### [ProductAvailability](#ProductAvailability) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | outOfStock | Bool? | yes | | + | sizes | [String]? | yes | | + | otherStoreQuantity | Int? | yes | | + | deliverable | Bool? | yes | | + | isValid | Bool? | yes | | + +--- + + + + + #### [PromoMeta](#PromoMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [CartProductInfo](#CartProductInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | product | [CartProduct](#CartProduct)? | yes | | + | quantity | Int? | yes | | + | identifiers | [CartProductIdentifer](#CartProductIdentifer) | no | | + | article | [ProductArticle](#ProductArticle)? | yes | | + | price | [ProductPriceInfo](#ProductPriceInfo)? | yes | | + | pricePerUnit | [ProductPriceInfo](#ProductPriceInfo)? | yes | | + | key | String? | yes | | + | isSet | Bool? | yes | | + | availability | [ProductAvailability](#ProductAvailability)? | yes | | + | discount | String? | yes | | + | bulkOffer | [String: Any]? | yes | | + | message | String? | yes | | + | promoMeta | [PromoMeta](#PromoMeta)? | yes | | + | couponMessage | String? | yes | | + +--- + + + + + #### [CartCurrency](#CartCurrency) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | symbol | String? | yes | | + | code | String? | yes | Currency code defined by ISO 4217:2015 | + +--- + + + + + #### [RawBreakup](#RawBreakup) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | fyndCash | Double? | yes | | + | convenienceFee | Double? | yes | | + | vog | Double? | yes | | + | coupon | Double? | yes | | + | codCharge | Double? | yes | | + | subtotal | Double? | yes | | + | youSaved | Double? | yes | | + | discount | Double? | yes | | + | total | Double? | yes | | + | mrpTotal | Double? | yes | | + | deliveryCharge | Double? | yes | | + | gstCharges | Double? | yes | | + +--- + + + + + #### [LoyaltyPoints](#LoyaltyPoints) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String? | yes | | + | isApplied | Bool? | yes | | + | applicable | Double? | yes | | + | total | Double? | yes | | + +--- + + + + + #### [DisplayBreakup](#DisplayBreakup) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | currencySymbol | String? | yes | | + | currencyCode | String? | yes | | + | display | String? | yes | | + | key | String? | yes | | + | value | Double? | yes | | + | message | [String]? | yes | | + +--- + + + + + #### [CouponBreakup](#CouponBreakup) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | uid | String? | yes | | + | isApplied | Bool? | yes | | + | code | String? | yes | | + | value | Double? | yes | | + | message | String? | yes | | + +--- + + + + + #### [CartBreakup](#CartBreakup) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | raw | [RawBreakup](#RawBreakup)? | yes | | + | loyaltyPoints | [LoyaltyPoints](#LoyaltyPoints)? | yes | | + | display | [[DisplayBreakup](#DisplayBreakup)]? | yes | | + | coupon | [CouponBreakup](#CouponBreakup)? | yes | | + +--- + + + + + #### [PromiseFormatted](#PromiseFormatted) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | max | String? | yes | | + | min | String? | yes | | + +--- + + + + + #### [PromiseTimestamp](#PromiseTimestamp) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | max | Double? | yes | | + | min | Double? | yes | | + +--- + + + + + #### [ShipmentPromise](#ShipmentPromise) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | formatted | [PromiseFormatted](#PromiseFormatted)? | yes | | + | timestamp | [PromiseTimestamp](#PromiseTimestamp)? | yes | | + +--- + + + + + #### [PaymentSelectionLock](#PaymentSelectionLock) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | paymentIdentifier | String? | yes | | + | defaultOptions | String? | yes | | + | enabled | Bool? | yes | | + +--- + + + + + #### [CartDetailResponse](#CartDetailResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | checkoutMode | String? | yes | | + | items | [[CartProductInfo](#CartProductInfo)]? | yes | | + | restrictCheckout | Bool? | yes | | + | currency | [CartCurrency](#CartCurrency)? | yes | | + | comment | String? | yes | | + | gstin | String? | yes | | + | couponText | String? | yes | | + | breakupValues | [CartBreakup](#CartBreakup)? | yes | | + | id | String? | yes | | + | lastModified | String? | yes | | + | deliveryChargeInfo | String? | yes | | + | deliveryPromise | [ShipmentPromise](#ShipmentPromise)? | yes | | + | paymentSelectionLock | [PaymentSelectionLock](#PaymentSelectionLock)? | yes | | + | message | String? | yes | | + | isValid | Bool? | yes | | + +--- + + + + + #### [AddProductCart](#AddProductCart) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | articleAssignment | [String: Any]? | yes | | + | quantity | Int? | yes | | + | display | String? | yes | | + | storeId | Int? | yes | | + | itemSize | String? | yes | | + | articleId | String? | yes | | + | extraMeta | [String: Any]? | yes | | + | pos | Bool? | yes | | + | sellerId | Int? | yes | | + | itemId | Int? | yes | | + +--- + + + + + #### [AddCartRequest](#AddCartRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[AddProductCart](#AddProductCart)]? | yes | | + +--- + + + + + #### [AddCartDetailResponse](#AddCartDetailResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | True if all items are added successfully. False if partially added or not added. | + | partial | Bool? | yes | When adding multiple items check if all added. True if only few are added. | + | cart | [CartDetailResponse](#CartDetailResponse)? | yes | | + | message | String? | yes | | + +--- + + + + + #### [UpdateProductCart](#UpdateProductCart) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | quantity | Int? | yes | | + | itemIndex | Int? | yes | | + | identifiers | [CartProductIdentifer](#CartProductIdentifer) | no | | + | itemSize | String? | yes | | + | articleId | String? | yes | | + | extraMeta | [String: Any]? | yes | | + | itemId | Int? | yes | | + +--- + + + + + #### [UpdateCartRequest](#UpdateCartRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | operation | String | no | | + | items | [[UpdateProductCart](#UpdateProductCart)]? | yes | | + +--- + + + + + #### [UpdateCartDetailResponse](#UpdateCartDetailResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | True if all items are added successfully. False if partially added or not added. | + | cart | [CartDetailResponse](#CartDetailResponse)? | yes | | + | message | String? | yes | | + +--- + + + + + #### [CartItemCountResponse](#CartItemCountResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | userCartItemsCount | Int? | yes | Item count present in cart | + +--- + + + + + #### [Coupon](#Coupon) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | expiresOn | String? | yes | | + | maxDiscountValue | Double? | yes | | + | isApplied | Bool? | yes | | + | minimumCartValue | Double? | yes | | + | title | String? | yes | | + | isApplicable | Bool? | yes | | + | message | String? | yes | | + | subTitle | String? | yes | | + | couponValue | Double? | yes | | + | couponCode | String? | yes | | + +--- + + + + + #### [PageCoupon](#PageCoupon) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | totalItemCount | Int? | yes | | + | current | Int? | yes | | + | hasPrevious | Bool? | yes | | + | total | Int? | yes | | + | hasNext | Bool? | yes | | + +--- + + + + + #### [GetCouponResponse](#GetCouponResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | availableCouponList | [[Coupon](#Coupon)]? | yes | | + | page | [PageCoupon](#PageCoupon)? | yes | | + +--- + + + + + #### [ApplyCouponRequest](#ApplyCouponRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | couponCode | String | no | Coupon code to be applied | + +--- + + + + + #### [OfferSeller](#OfferSeller) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | Seller id | + | name | String? | yes | | + +--- + + + + + #### [OfferPrice](#OfferPrice) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | currencySymbol | String? | yes | Currency symbol for currency | + | bulkEffective | Double? | yes | Discounted per unit price for current offer object | + | currencyCode | String? | yes | Currency code for all amounts | + | marked | Int? | yes | Original price of product | + | effective | Int? | yes | Current per unit price of product after existing deductions | + +--- + + + + + #### [OfferItem](#OfferItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | Offer type | + | best | Bool? | yes | Is true for best offer from all offers present for all sellers | + | margin | Int? | yes | Percentage value of discount | + | quantity | Int? | yes | Quantity on which offer is applicable | + | price | [OfferPrice](#OfferPrice)? | yes | | + | autoApplied | Bool? | yes | Whether offer discount is auto applied in cart | + | total | Double? | yes | Total price of offer quantity with discount | + +--- + + + + + #### [BulkPriceOffer](#BulkPriceOffer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | seller | [OfferSeller](#OfferSeller)? | yes | | + | offers | [[OfferItem](#OfferItem)]? | yes | | + +--- + + + + + #### [BulkPriceResponse](#BulkPriceResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [[BulkPriceOffer](#BulkPriceOffer)]? | yes | Consist of offers from multiple seller | + +--- + + + + + #### [RewardPointRequest](#RewardPointRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | points | Bool | no | | + +--- + + + + + #### [GeoLocation](#GeoLocation) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | latitude | Double? | yes | | + | longitude | Double? | yes | | + +--- + + + + + #### [Address](#Address) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | areaCode | String? | yes | | + | country | String? | yes | | + | geoLocation | [GeoLocation](#GeoLocation)? | yes | | + | city | String? | yes | | + | meta | [String: Any]? | yes | | + | checkoutMode | String? | yes | | + | name | String? | yes | | + | area | String? | yes | | + | id | String? | yes | | + | phone | String? | yes | | + | address | String? | yes | | + | state | String? | yes | | + | countryCode | String? | yes | | + | userId | String? | yes | | + | addressType | String? | yes | | + | isDefaultAddress | Bool? | yes | | + | landmark | String? | yes | | + | email | String? | yes | | + | googleMapPoint | [String: Any]? | yes | | + | isActive | Bool? | yes | | + | areaCodeSlug | String? | yes | | + | tags | [String]? | yes | | + +--- + + + + + #### [GetAddressesResponse](#GetAddressesResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | address | [[Address](#Address)]? | yes | | + +--- + + + + + #### [SaveAddressResponse](#SaveAddressResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | success | Bool? | yes | | + | isDefaultAddress | Bool? | yes | | + +--- + + + + + #### [UpdateAddressResponse](#UpdateAddressResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | isUpdated | Bool? | yes | | + | success | Bool? | yes | | + | isDefaultAddress | Bool? | yes | | + +--- + + + + + #### [DeleteAddressResponse](#DeleteAddressResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | isDeleted | Bool? | yes | | + +--- + + + + + #### [SelectCartAddressRequest](#SelectCartAddressRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | billingAddressId | String? | yes | | + | cartId | String? | yes | | + +--- + + + + + #### [UpdateCartPaymentRequest](#UpdateCartPaymentRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | aggregatorName | String? | yes | | + | merchantCode | String? | yes | | + | id | String? | yes | | + | paymentMode | String? | yes | | + | paymentIdentifier | String? | yes | | + | addressId | String? | yes | | + +--- + + + + + #### [CouponValidity](#CouponValidity) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | displayMessageEn | String? | yes | | + | code | String? | yes | | + | title | String? | yes | | + | discount | Double? | yes | | + | valid | Bool? | yes | | + +--- + + + + + #### [PaymentCouponValidate](#PaymentCouponValidate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | couponValidity | [CouponValidity](#CouponValidity)? | yes | | + | success | Bool | no | | + | message | String? | yes | | + +--- + + + + + #### [ShipmentResponse](#ShipmentResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | shipmentType | String? | yes | | + | items | [[CartProductInfo](#CartProductInfo)]? | yes | | + | orderType | String? | yes | | + | shipments | Int? | yes | | + | fulfillmentType | String? | yes | | + | dpId | String? | yes | | + | promise | [ShipmentPromise](#ShipmentPromise)? | yes | | + | dpOptions | [String: Any]? | yes | | + | boxType | String? | yes | | + | fulfillmentId | Int? | yes | | + +--- + + + + + #### [CartShipmentsResponse](#CartShipmentsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | shipments | [[ShipmentResponse](#ShipmentResponse)]? | yes | | + | couponText | String? | yes | | + | breakupValues | [CartBreakup](#CartBreakup)? | yes | | + | lastModified | String? | yes | | + | isValid | Bool? | yes | | + | checkoutMode | String? | yes | | + | uid | String? | yes | | + | restrictCheckout | Bool? | yes | | + | currency | [CartCurrency](#CartCurrency)? | yes | | + | error | Bool? | yes | | + | comment | String? | yes | | + | gstin | String? | yes | | + | cartId | Int? | yes | | + | paymentSelectionLock | [PaymentSelectionLock](#PaymentSelectionLock)? | yes | | + | id | String? | yes | | + | deliveryChargeInfo | String? | yes | | + | deliveryPromise | [ShipmentPromise](#ShipmentPromise)? | yes | | + | message | String? | yes | | + +--- + + + + + #### [UpdateCartShipmentItem](#UpdateCartShipmentItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | quantity | Int? | yes | Quantity of product in shipment | + | shipmentType | String | no | Shipment delivery type | + | articleUid | String | no | Article mongo id | + +--- + + + + + #### [UpdateCartShipmentRequest](#UpdateCartShipmentRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | shipments | [[UpdateCartShipmentItem](#UpdateCartShipmentItem)] | no | | + +--- + + + + + #### [Files](#Files) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | values | [String] | no | | + | key | String | no | | + +--- + + + + + #### [StaffCheckout](#StaffCheckout) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | firstName | String | no | | + | user | String | no | | + | id | String | no | | + | lastName | String | no | | + +--- + + + + + #### [CartPosCheckoutDetailRequest](#CartPosCheckoutDetailRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | paymentAutoConfirm | Bool? | yes | | + | merchantCode | String? | yes | | + | pickAtStoreUid | Int? | yes | | + | billingAddress | [String: Any]? | yes | | + | meta | [String: Any]? | yes | | + | aggregator | String? | yes | | + | callbackUrl | String? | yes | | + | orderingStore | Int? | yes | | + | extraMeta | [String: Any]? | yes | | + | pos | Bool? | yes | | + | files | [[Files](#Files)]? | yes | List of file url | + | staff | [StaffCheckout](#StaffCheckout)? | yes | | + | addressId | String? | yes | | + | paymentParams | [String: Any]? | yes | | + | orderType | String | no | | + | deliveryAddress | [String: Any]? | yes | | + | billingAddressId | String? | yes | | + | paymentMode | String | no | | + | paymentIdentifier | String? | yes | | + +--- + + + + + #### [CheckCart](#CheckCart) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | errorMessage | String? | yes | | + | userType | String? | yes | | + | lastModified | String? | yes | | + | codAvailable | Bool? | yes | | + | isValid | Bool? | yes | | + | deliveryChargeOrderValue | Int? | yes | | + | checkoutMode | String? | yes | | + | items | [[CartProductInfo](#CartProductInfo)]? | yes | | + | uid | String? | yes | | + | restrictCheckout | Bool? | yes | | + | gstin | String? | yes | | + | codMessage | String? | yes | | + | paymentSelectionLock | [PaymentSelectionLock](#PaymentSelectionLock)? | yes | | + | id | String? | yes | | + | couponText | String? | yes | | + | breakupValues | [CartBreakup](#CartBreakup)? | yes | | + | deliveryCharges | Int? | yes | | + | storeEmps | [[String: Any]]? | yes | | + | orderId | String? | yes | | + | storeCode | String? | yes | | + | success | Bool? | yes | | + | currency | [CartCurrency](#CartCurrency)? | yes | | + | comment | String? | yes | | + | cartId | Int? | yes | | + | codCharges | Int? | yes | | + | deliveryChargeInfo | String? | yes | | + | deliveryPromise | [ShipmentPromise](#ShipmentPromise)? | yes | | + | message | String? | yes | | + +--- + + + + + #### [CartCheckoutResponse](#CartCheckoutResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | | + | data | [String: Any]? | yes | | + | cart | [CheckCart](#CheckCart)? | yes | | + | callbackUrl | String? | yes | | + | paymentConfirmUrl | String? | yes | | + | message | String? | yes | | + | appInterceptUrl | String? | yes | | + | orderId | String? | yes | | + +--- + + + + + #### [CartMetaRequest](#CartMetaRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | gstin | String? | yes | | + | checkoutMode | String? | yes | | + | pickUpCustomerDetails | [String: Any]? | yes | Customer contact details for customer pickup at store | + | comment | String? | yes | | + +--- + + + + + #### [CartMetaResponse](#CartMetaResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [CartMetaMissingResponse](#CartMetaMissingResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | errors | [String]? | yes | | + +--- + + + + + #### [CartDeliveryModesResponse](#CartDeliveryModesResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | availableModes | [String]? | yes | Available delivery modes | + | pickupStores | [Int]? | yes | Store pick up available store uids | + +--- + + + + + #### [PickupStoreDetail](#PickupStoreDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | landmark | String? | yes | | + | state | String? | yes | | + | email | String? | yes | | + | pincode | Int? | yes | | + | name | String? | yes | | + | uid | Int? | yes | | + | areaCode | String? | yes | | + | area | String? | yes | | + | country | String? | yes | | + | id | Int? | yes | | + | phone | String? | yes | | + | address | String? | yes | | + | areaCodeSlug | String? | yes | | + | addressType | String? | yes | | + | city | String? | yes | | + | storeCode | String? | yes | | + +--- + + + + + #### [StoreDetailsResponse](#StoreDetailsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[PickupStoreDetail](#PickupStoreDetail)]? | yes | | + +--- + + + + + #### [GetShareCartLinkRequest](#GetShareCartLinkRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | Cart uid for generating sharing | + | meta | [String: Any]? | yes | Staff, Ordering store or any other data. This data will be used to generate link as well as sent as shared details. | + +--- + + + + + #### [GetShareCartLinkResponse](#GetShareCartLinkResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | shareUrl | String? | yes | Short shareable final url | + | token | String? | yes | Short url unique id | + +--- + + + + + #### [SharedCartDetails](#SharedCartDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | meta | [String: Any]? | yes | Meta data sent while generating share cart link | + | source | [String: Any]? | yes | Share link device and other source information | + | createdOn | String? | yes | | + | user | [String: Any]? | yes | User details of who generated share link | + | token | String? | yes | Short link id | + +--- + + + + + #### [SharedCart](#SharedCart) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | checkoutMode | String? | yes | | + | items | [[CartProductInfo](#CartProductInfo)]? | yes | | + | uid | String? | yes | | + | restrictCheckout | Bool? | yes | | + | currency | [CartCurrency](#CartCurrency)? | yes | | + | comment | String? | yes | | + | gstin | String? | yes | | + | cartId | Int? | yes | | + | sharedCartDetails | [SharedCartDetails](#SharedCartDetails)? | yes | | + | couponText | String? | yes | | + | breakupValues | [CartBreakup](#CartBreakup)? | yes | | + | id | String? | yes | | + | lastModified | String? | yes | | + | deliveryChargeInfo | String? | yes | | + | deliveryPromise | [ShipmentPromise](#ShipmentPromise)? | yes | | + | paymentSelectionLock | [PaymentSelectionLock](#PaymentSelectionLock)? | yes | | + | message | String? | yes | | + | isValid | Bool? | yes | | + +--- + + + + + #### [SharedCartResponse](#SharedCartResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cart | [SharedCart](#SharedCart)? | yes | | + | error | String? | yes | | + +--- + + + diff --git a/documentation/application/README.md b/documentation/application/README.md new file mode 100644 index 0000000000..f0dac5c965 --- /dev/null +++ b/documentation/application/README.md @@ -0,0 +1,23 @@ +##### [Back to home](../../README.md) + +# FDK Application Front API Documentation + + +* [Catalog](CATALOG.md) - Catalog API's allows you to access list of products, prices, seller details, similar features, variants and many more useful features. +* [Cart](CART.md) - Cart APIs +* [Common](COMMON.md) - Application configuration apis +* [Lead](LEAD.md) - Handles communication between Staff and Users +* [Theme](THEME.md) - Responsible for themes +* [User](USER.md) - Authentication Service +* [Content](CONTENT.md) - Content System +* [Communication](COMMUNICATION.md) - Manages email, sms, push notifications sent to users +* [Share](SHARE.md) - Short link and QR Code +* [FileStorage](FILESTORAGE.md) - File Storage +* [Configuration](CONFIGURATION.md) - Application configuration apis +* [Payment](PAYMENT.md) - Collect payment through many payment gateway i.e Stripe, Razorpay, Juspay etc.into Fynd or Self account +* [Order](ORDER.md) - Handles Platform websites OMS +* [Rewards](REWARDS.md) - Earn and redeem reward points +* [Feedback](FEEDBACK.md) - User Reviews and Rating System +* [PosCart](POSCART.md) - Cart APIs +* [Logistic](LOGISTIC.md) - Handles Platform websites OMS + diff --git a/documentation/application/REWARDS.md b/documentation/application/REWARDS.md new file mode 100644 index 0000000000..60e54ee4c6 --- /dev/null +++ b/documentation/application/REWARDS.md @@ -0,0 +1,704 @@ + + + + +##### [Back to Application docs](./README.md) + +## Rewards Methods +Earn and redeem reward points +* [getPointsOnProduct](#getpointsonproduct) +* [getOfferByName](#getofferbyname) +* [getOrderDiscount](#getorderdiscount) +* [getUserPoints](#getuserpoints) +* [getUserPointsHistory](#getuserpointshistory) +* [getUserReferralDetails](#getuserreferraldetails) +* [redeemReferralCode](#redeemreferralcode) + + + +## Methods with example and description + + +#### getPointsOnProduct +Get the eligibility of reward points on a product + + + + +```swift +rewards.getPointsOnProduct(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CatalogueOrderRequest | yes | Request body | + + +Use this API to evaluate the amount of reward points that could be earned on any catalogue product. + +*Returned Response:* + + + + +[CatalogueOrderResponse](#CatalogueOrderResponse) + +Success. Check example below or refer `CatalogueOrderRequest` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getOfferByName +Get offer by name + + + + +```swift +rewards.getOfferByName(name: name) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| name | String | yes | The name given to the offer. | + + + +Use this API to get the offer details and configuration by entering the name of the offer. + +*Returned Response:* + + + + +[Offer](#Offer) + +Success. Check example below or refer `Offer` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getOrderDiscount +Calculates the discount on order-amount + + + + +```swift +rewards.getOrderDiscount(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | OrderDiscountRequest | yes | Request body | + + +Use this API to calculate the discount on order-amount based on all the amount range configured in order_discount. + +*Returned Response:* + + + + +[OrderDiscountResponse](#OrderDiscountResponse) + +Success. Check example below or refer `OrderDiscountResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getUserPoints +Get reward points available with a user + + + + +```swift +rewards.getUserPoints() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to retrieve total available points of a user for current application + +*Returned Response:* + + + + +[PointsResponse](#PointsResponse) + +Success. Check example below or refer `PointsResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getUserPointsHistory +Get all transactions of reward points + + + + +```swift +rewards.getUserPointsHistory(pageId: pageId, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageId | String? | no | PageID is the ID of the requested page. For first request it should be kept empty. | +| pageSize | Int? | no | The number of items to retrieve in each page. | + + + +Use this API to get a list of points transactions. The list of points history is paginated. + +*Returned Response:* + + + + +[PointsHistoryResponse](#PointsHistoryResponse) + +Success. Check example below or refer `PointsHistoryResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getUserReferralDetails +Get referral details of a user + + + + +```swift +rewards.getUserReferralDetails() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to retrieve the referral details a user has configured in the application. + +*Returned Response:* + + + + +[ReferralDetailsResponse](#ReferralDetailsResponse) + +Success. Check example below or refer `ReferralDetailsResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### redeemReferralCode +Redeems a referral code and credits reward points to users + + + + +```swift +rewards.redeemReferralCode(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | RedeemReferralCodeRequest | yes | Request body | + + +Use this API to enter a referral code following which, the configured points would be credited to a user's reward points account. + +*Returned Response:* + + + + +[RedeemReferralCodeResponse](#RedeemReferralCodeResponse) + +Success. Check example below or refer `RedeemReferralCodeResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [ActionPageParams](#ActionPageParams) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | [String]? | yes | | + +--- + + + + + #### [Asset](#Asset) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | aspectRatio | String? | yes | | + | id | String? | yes | | + | secureUrl | String? | yes | | + +--- + + + + + #### [CatalogueOrderRequest](#CatalogueOrderRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | articles | [[RewardsArticle](#RewardsArticle)]? | yes | | + +--- + + + + + #### [CatalogueOrderResponse](#CatalogueOrderResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | articles | [[RewardsArticle](#RewardsArticle)]? | yes | | + +--- + + + + + #### [DiscountProperties](#DiscountProperties) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | absolute | Double? | yes | | + | currency | String? | yes | | + | displayAbsolute | String? | yes | | + | displayPercent | String? | yes | | + | percent | Double? | yes | | + +--- + + + + + #### [Error](#Error) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | code | Int? | yes | | + | exception | String? | yes | | + | info | String? | yes | | + | message | String? | yes | | + +--- + + + + + #### [Offer](#Offer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | schedule | [Schedule](#Schedule)? | yes | | + | active | Bool? | yes | | + | applicationId | String? | yes | | + | bannerImage | [Asset](#Asset)? | yes | | + | createdAt | String? | yes | | + | name | String? | yes | | + | rule | [String: Any]? | yes | | + | share | [ShareMessages](#ShareMessages)? | yes | | + | subText | String? | yes | | + | text | String? | yes | | + | type | String? | yes | | + | updatedAt | String? | yes | | + | updatedBy | String? | yes | | + | url | String? | yes | | + +--- + + + + + #### [OrderDiscountRequest](#OrderDiscountRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | currency | String? | yes | | + | orderAmount | Double | no | | + +--- + + + + + #### [OrderDiscountResponse](#OrderDiscountResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appliedRuleBucket | [OrderDiscountRuleBucket](#OrderDiscountRuleBucket)? | yes | | + | baseDiscount | [DiscountProperties](#DiscountProperties)? | yes | | + | discount | [DiscountProperties](#DiscountProperties)? | yes | | + | orderAmount | Double? | yes | | + | points | Double? | yes | | + +--- + + + + + #### [OrderDiscountRuleBucket](#OrderDiscountRuleBucket) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | high | Double? | yes | | + | low | Double? | yes | | + | max | Double? | yes | | + | value | Double? | yes | | + | valueType | String? | yes | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + | hasPrevious | Bool? | yes | | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | size | Int? | yes | | + | type | String | no | | + +--- + + + + + #### [PointsHistory](#PointsHistory) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | applicationId | String? | yes | | + | claimed | Bool? | yes | | + | createdAt | String? | yes | | + | expiresOn | String? | yes | | + | meta | [String: Any]? | yes | | + | points | Double? | yes | | + | remainingPoints | Double? | yes | | + | text1 | String? | yes | | + | text2 | String? | yes | | + | text3 | String? | yes | | + | txnName | String? | yes | | + | updatedAt | String? | yes | | + | userId | String? | yes | | + +--- + + + + + #### [PointsHistoryResponse](#PointsHistoryResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[PointsHistory](#PointsHistory)]? | yes | History is the list of points transaction. | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [PointsResponse](#PointsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | points | Double? | yes | Points is the total available | + +--- + + + + + #### [RedeemReferralCodeRequest](#RedeemReferralCodeRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | deviceId | String | no | | + | referralCode | String | no | | + +--- + + + + + #### [RedeemReferralCodeResponse](#RedeemReferralCodeResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + | points | Double? | yes | | + | redeemed | Bool? | yes | | + | referrerId | String? | yes | | + | referrerInfo | String? | yes | | + +--- + + + + + #### [ReferralDetailsResponse](#ReferralDetailsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | referral | [Offer](#Offer)? | yes | | + | referrerInfo | String? | yes | | + | share | [ShareMessages](#ShareMessages)? | yes | | + | user | [ReferralDetailsUser](#ReferralDetailsUser)? | yes | | + +--- + + + + + #### [ReferralDetailsUser](#ReferralDetailsUser) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | blocked | Bool? | yes | | + | points | Double? | yes | | + | redeemed | Bool? | yes | | + | referralCode | String? | yes | | + +--- + + + + + #### [RewardsArticle](#RewardsArticle) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | points | Double? | yes | | + | price | Double? | yes | | + +--- + + + + + #### [Schedule](#Schedule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cron | String? | yes | | + | duration | Int? | yes | | + | end | String? | yes | | + | start | String? | yes | | + +--- + + + + + #### [ShareMessages](#ShareMessages) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + | facebook | String? | yes | | + | fallback | String? | yes | | + | message | String? | yes | | + | messenger | String? | yes | | + | sms | String? | yes | | + | text | String? | yes | | + | twitter | String? | yes | | + | whatsapp | String? | yes | | + +--- + + + diff --git a/documentation/application/SHARE.md b/documentation/application/SHARE.md new file mode 100644 index 0000000000..e1d5f02136 --- /dev/null +++ b/documentation/application/SHARE.md @@ -0,0 +1,721 @@ + + + + +##### [Back to Application docs](./README.md) + +## Share Methods +Short link and QR Code +* [getApplicationQRCode](#getapplicationqrcode) +* [getProductQRCodeBySlug](#getproductqrcodebyslug) +* [getCollectionQRCodeBySlug](#getcollectionqrcodebyslug) +* [getUrlQRCode](#geturlqrcode) +* [createShortLink](#createshortlink) +* [getShortLinkByHash](#getshortlinkbyhash) +* [getOriginalShortLinkByHash](#getoriginalshortlinkbyhash) + + + +## Methods with example and description + + +#### getApplicationQRCode +Create QR Code of an app + + + + +```swift +share.getApplicationQRCode() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to create a QR code of an app for sharing it with users who want to use the app. + +*Returned Response:* + + + + +[QRCodeResp](#QRCodeResp) + +Success. Check the example shown below or refer `QRCodeResp` for more details. + + + + +
    +  Example: + +```json +{ + "link": "https://fynd.com", + "svg": "" +} +``` +
    + + + + + + + + + +--- + + +#### getProductQRCodeBySlug +Create QR Code of a product + + + + +```swift +share.getProductQRCodeBySlug(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a product. You can get slug value from the endpoint. | + + + +Use this API to create a QR code of a product for sharing it with users who want to view/purchase the product. + +*Returned Response:* + + + + +[QRCodeResp](#QRCodeResp) + +Success. Check the example shown below or refer `QRCodeResp` for more details. + + + + +
    +  Example: + +```json +{ + "link": "https://fynd.com/products/shirt-small-blue", + "svg": "" +} +``` +
    + + + + + + + + + +--- + + +#### getCollectionQRCodeBySlug +Create QR Code of a collection + + + + +```swift +share.getCollectionQRCodeBySlug(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a collection. You can get slug value from the endpoint. | + + + +Use this API to create a QR code of a collection of products for sharing it with users who want to view/purchase the collection. + +*Returned Response:* + + + + +[QRCodeResp](#QRCodeResp) + +Success. Check the example shown below or refer `QRCodeResp` for more details. + + + + +
    +  Example: + +```json +{ + "link": "https://fynd.com/collection/flat-50-off", + "svg": "" +} +``` +
    + + + + + + + + + +--- + + +#### getUrlQRCode +Create QR Code of a URL + + + + +```swift +share.getUrlQRCode(url: url) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| url | String | yes | A link or a web address | + + + +Use this API to create a QR code of a URL for sharing it with users who want to visit the link. + +*Returned Response:* + + + + +[QRCodeResp](#QRCodeResp) + +Success. Check the example shown below or refer `QRCodeResp` for more details. + + + + +
    +  Example: + +```json +{ + "link": "https://fynd.com", + "svg": "" +} +``` +
    + + + + + + + + + +--- + + +#### createShortLink +Create a short link + + + + +```swift +share.createShortLink(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | ShortLinkReq | yes | Request body | + + +Use this API to create a short link that is easy to write/share/read as compared to long URLs. + +*Returned Response:* + + + + +[ShortLinkRes](#ShortLinkRes) + +Success. Check the example shown below or refer `ShortLinkRes` for more details. + + + + +
    +  Example: + +```json +{ + "url": { + "original": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh", + "short": "https://0icof6vvsf.hostx0.de/l/3qKlnsq-x", + "hash": "3qKlnsq-x" + }, + "redirects": { + "ios": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "android": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "web": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "force_web": false + }, + "created_by": "team", + "personalized": false, + "app_redirect": false, + "fallback": "web", + "enable_tracking": false, + "active": true, + "count": 0, + "_id": "601a54054c0349592e76c8f3", + "title": "new ", + "meta": { + "type": "brand" + }, + "expire_at": null, + "application": "5eda528b97457fe43a733ace", + "user_id": "5e4d01e2c39837ab66144f6d", + "created_at": "2021-02-03T07:43:01.342Z", + "updated_at": "2021-02-03T07:43:01.342Z" +} +``` +
    + + + + + + + + + +--- + + +#### getShortLinkByHash +Get short link by hash + + + + +```swift +share.getShortLinkByHash(hash: hash) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| hash | String | yes | A string value used for converting long URL to short URL and vice-versa. | + + + +Use this API to get a short link by using a hash value. + +*Returned Response:* + + + + +[ShortLinkRes](#ShortLinkRes) + +Success. Check the example shown below or refer `ShortLinkRes` for more details. + + + + +
    +  Example: + +```json +{ + "url": { + "original": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh", + "short": "https://0icof6vvsf.hostx0.de/l/3qKlnsq-x", + "hash": "3qKlnsq-x" + }, + "redirects": { + "ios": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "android": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "web": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "force_web": false + }, + "created_by": "team", + "personalized": false, + "app_redirect": false, + "fallback": "web", + "enable_tracking": false, + "active": true, + "count": 0, + "_id": "601a54054c0349592e76c8f3", + "title": "new ", + "meta": { + "type": "brand" + }, + "expire_at": null, + "application": "5eda528b97457fe43a733ace", + "user_id": "5e4d01e2c39837ab66144f6d", + "created_at": "2021-02-03T07:43:01.342Z", + "updated_at": "2021-02-03T07:43:01.342Z" +} +``` +
    + + + + + + + + + +--- + + +#### getOriginalShortLinkByHash +Get original link by hash + + + + +```swift +share.getOriginalShortLinkByHash(hash: hash) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| hash | String | yes | A string value used for converting long URL to short URL and vice-versa. | + + + +Use this API to retrieve the original link from a short-link by using a hash value. + +*Returned Response:* + + + + +[ShortLinkRes](#ShortLinkRes) + +Success. Check the example shown below or refer `ShortLinkRes` for more details. + + + + +
    +  Example: + +```json +{ + "url": { + "original": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh", + "short": "https://0icof6vvsf.hostx0.de/l/3qKlnsq-x", + "hash": "3qKlnsq-x" + }, + "redirects": { + "ios": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "android": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "web": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "force_web": false + }, + "created_by": "team", + "personalized": false, + "app_redirect": false, + "fallback": "web", + "enable_tracking": false, + "active": true, + "count": 0, + "_id": "601a54054c0349592e76c8f3", + "title": "new ", + "meta": { + "type": "brand" + }, + "expire_at": null, + "application": "5eda528b97457fe43a733ace", + "user_id": "5e4d01e2c39837ab66144f6d", + "created_at": "2021-02-03T07:43:01.342Z", + "updated_at": "2021-02-03T07:43:01.342Z" +} +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [QRCodeResp](#QRCodeResp) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | link | String? | yes | | + | svg | String? | yes | | + +--- + + + + + #### [RedirectDevice](#RedirectDevice) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | link | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [WebRedirect](#WebRedirect) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | link | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [Redirects](#Redirects) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | ios | [RedirectDevice](#RedirectDevice)? | yes | | + | android | [RedirectDevice](#RedirectDevice)? | yes | | + | web | [WebRedirect](#WebRedirect)? | yes | | + | forceWeb | Bool? | yes | | + +--- + + + + + #### [CampaignShortLink](#CampaignShortLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | source | String? | yes | | + | medium | String? | yes | | + +--- + + + + + #### [Attribution](#Attribution) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | campaignCookieExpiry | String? | yes | | + +--- + + + + + #### [SocialMediaTags](#SocialMediaTags) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | description | String? | yes | | + | image | String? | yes | | + +--- + + + + + #### [ShortLinkReq](#ShortLinkReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String | no | Give a name to the link. | + | url | String | no | The web address to shorten. | + | hash | String? | yes | | + | active | Bool? | yes | | + | expireAt | String? | yes | | + | enableTracking | Bool? | yes | | + | personalized | Bool? | yes | To create personalized short links. | + | campaign | [CampaignShortLink](#CampaignShortLink)? | yes | | + | redirects | [Redirects](#Redirects)? | yes | | + | attribution | [Attribution](#Attribution)? | yes | | + | socialMediaTags | [SocialMediaTags](#SocialMediaTags)? | yes | | + | count | Int? | yes | | + +--- + + + + + #### [UrlInfo](#UrlInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | original | String? | yes | | + | short | String? | yes | | + | hash | String? | yes | | + +--- + + + + + #### [ShortLinkRes](#ShortLinkRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | url | [UrlInfo](#UrlInfo)? | yes | | + | createdBy | String? | yes | | + | appRedirect | Bool? | yes | | + | fallback | String? | yes | | + | active | Bool? | yes | | + | id | String? | yes | | + | enableTracking | Bool? | yes | | + | expireAt | String? | yes | | + | application | String? | yes | | + | userId | String? | yes | | + | createdAt | String? | yes | | + | meta | [String: Any]? | yes | | + | updatedAt | String? | yes | | + | personalized | Bool? | yes | To create personalized short links | + | campaign | [CampaignShortLink](#CampaignShortLink)? | yes | | + | redirects | [Redirects](#Redirects)? | yes | | + | attribution | [Attribution](#Attribution)? | yes | | + | socialMediaTags | [SocialMediaTags](#SocialMediaTags)? | yes | | + | count | Int? | yes | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + | hasNext | Bool? | yes | | + | current | Int? | yes | | + | type | String | no | | + | size | Int? | yes | | + +--- + + + + + #### [ShortLinkList](#ShortLinkList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[ShortLinkRes](#ShortLinkRes)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [ErrorRes](#ErrorRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + diff --git a/documentation/application/THEME.md b/documentation/application/THEME.md new file mode 100644 index 0000000000..44f16fb732 --- /dev/null +++ b/documentation/application/THEME.md @@ -0,0 +1,5793 @@ + + + + +##### [Back to Application docs](./README.md) + +## Theme Methods +Responsible for themes +* [getAllPages](#getallpages) +* [getPage](#getpage) +* [getAppliedTheme](#getappliedtheme) +* [getThemeForPreview](#getthemeforpreview) + + + +## Methods with example and description + + +#### getAllPages +Get all pages of a theme + + + + +```swift +theme.getAllPages(themeId: themeId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| themeId | String | yes | ID of the theme to be retrieved | + + + +Use this API to retrieve all the available pages of a theme by its ID. + +*Returned Response:* + + + + +[AllAvailablePageSchema](#AllAvailablePageSchema) + +Success. Returns an array all the pages of the theme. Refer `AllAvailablePageSchema` for more details. + + + + +
    +  Examples: + + +
    +  All pages + +```json +{ + "value": { + "pages": [ + { + "path": "products", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981639e13f6b2" + }, + "_id": "60ab5ca6d572fed64294eb0e", + "value": "product-listing", + "text": "Product Listing", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "collection", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981fc5d13f6b9" + }, + "_id": "60ab5ca6d572fed64294eaf9", + "text": "Collection Listing", + "value": "collection-listing", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "compare", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981cbca13f6b1" + }, + "_id": "60ab5ca6d572fed64294eb0b", + "value": "compare-products", + "text": "Compare Products", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "cart/bag", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e9812fdf13f6ae" + }, + "_id": "60ab5ca6d572fed64294eb02", + "value": "cart-landing", + "text": "Cart Landing", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "product", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e9815c9713f6ab" + }, + "_id": "60ab5ca6d572fed64294eaf6", + "text": "Product Description", + "value": "product-description", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "product/:slug/reviews", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60ab5ca6d572fed64294eb24" + }, + "_id": "60ab5ca6d572fed64294eb25", + "sections_meta": [], + "value": "product-reviews", + "text": "Product Reviews", + "theme": "5fb3ee4194a5181feeeba8e5", + "__v": 9 + }, + { + "path": "blog", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60ab5ca6d572fed64294eb22" + }, + "_id": "60ab5ca6d572fed64294eb23", + "sections_meta": [], + "value": "blog", + "text": "Blog", + "theme": "5fb3ee4194a5181feeeba8e5", + "__v": 9 + }, + { + "path": "sections/cookie", + "type": "sections", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e9814fed13f6b5" + }, + "_id": "60ab5ca6d572fed64294eb17", + "text": "cookie", + "value": "cookie", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "sections/vivek", + "type": "sections", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981b32713f6b6" + }, + "_id": "60ab5ca6d572fed64294eb1a", + "text": "vivek", + "value": "vivek", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "about-us", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60ab5ca6d572fed64294eb28" + }, + "_id": "60ab5ca6d572fed64294eb29", + "sections_meta": [], + "value": "about-us", + "text": "About Us", + "theme": "5fb3ee4194a5181feeeba8e5", + "__v": 9 + }, + { + "path": "wishlist", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981dd2d13f6b3" + }, + "_id": "60ab5ca6d572fed64294eb11", + "value": "wishlist", + "text": "Wishlist", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "product/:slug/add-review", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60ab5ca6d572fed64294eb26" + }, + "_id": "60ab5ca6d572fed64294eb27", + "sections_meta": [], + "value": "add-product-review", + "text": "Add Product Review", + "theme": "5fb3ee4194a5181feeeba8e5", + "__v": 9 + }, + { + "path": "brands", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981161a13f6ad" + }, + "_id": "60ab5ca6d572fed64294eaff", + "value": "brands", + "text": "Brands", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e98115b013f6ac" + }, + "_id": "60ab5ca6d572fed64294eafc", + "value": "home", + "text": "Home", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "collections", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981ad0b13f6b0" + }, + "_id": "60ab5ca6d572fed64294eb08", + "value": "collections", + "text": "Collections", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "categories", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981872c13f6af" + }, + "_id": "60ab5ca6d572fed64294eb05", + "value": "categories", + "text": "Categories", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "sections/test", + "type": "sections", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e98177f713f6b4" + }, + "_id": "60ab5ca6d572fed64294eb14", + "text": "Test", + "value": "test", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "sections/vinit", + "type": "sections", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e98170b813f6b8" + }, + "_id": "60ab5ca6d572fed64294eb20", + "text": "vinit", + "value": "vinit", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "sections/maggie", + "type": "sections", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981469613f6b7" + }, + "_id": "60ab5ca6d572fed64294eb1d", + "text": "maggie", + "value": "maggie", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + } + ] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getPage +Get page of a theme + + + + +```swift +theme.getPage(themeId: themeId, pageValue: pageValue) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| themeId | String | yes | ID of the theme to be retrieved | +| pageValue | String | yes | Value of the page to be retrieved | + + + +Use this API to retrieve a page of a theme. + +*Returned Response:* + + + + +[AvailablePageSchema](#AvailablePageSchema) + +Success. Returns an object of the pages. Refer `AvailablePageSchema` for more details. + + + + +
    +  Examples: + + +
    +  Home page + +```json +{ + "value": { + "path": "", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e98115b013f6ac" + }, + "props": [], + "_id": "60ab5ca6d572fed64294eafc", + "sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": false, + "desktop": false, + "tablet": false + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "utm": "facebook" + } + } + }, + "name": "customHtml", + "props": { + "code": { + "type": "code", + "value": "

    " + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "udm": "vivek" + } + } + }, + "name": "brands-listing", + "props": { + "title": { + "type": "text", + "value": "Popular rrrrr" + }, + "header": { + "type": "header" + }, + "brand_type": { + "value": "all", + "type": "radio" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 5, + "type": "range" + }, + "layout": { + "value": "horizontal", + "type": "select" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + }, + { + "blocks": [ + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + }, + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + }, + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + }, + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": false, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "" + } + }, + "name": "featuredProducts", + "props": { + "heading": { + "value": "Featured Products", + "type": "text" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "value": false, + "type": "checkbox" + } + }, + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "": "" + } + } + }, + "name": "categoryListPage", + "props": { + "heading": { + "type": "text", + "value": "Explore Categories" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "item_count": { + "value": 5, + "type": "range" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "": "" + } + } + }, + "name": "heroBanner", + "props": { + "ctaLink": { + "type": "url", + "value": "https://uniket.hostx0.de/about-us" + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "": "" + } + } + }, + "name": "imageBanner", + "props": { + "image": { + "value": "", + "type": "image_picker" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "overlayLayout": { + "value": "left", + "type": "select" + }, + "overlayImage": { + "value": "", + "type": "image_picker" + }, + "text": { + "value": "", + "type": "text" + }, + "text_color": { + "value": "#000", + "type": "color" + }, + "ctaLink": { + "value": "", + "type": "url" + }, + "ctaText": { + "value": "", + "type": "text" + }, + "layout": { + "type": "select", + "value": "full" + }, + "height": { + "type": "select", + "value": "h-auto" + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "" + } + }, + "name": "brands-listing", + "props": { + "title": { + "type": "text", + "value": "asdfasdf" + }, + "header": { + "type": "header" + }, + "brand_type": { + "value": "all", + "type": "radio" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 5, + "type": "range" + }, + "layout": { + "value": "horizontal", + "type": "select" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "value": "home", + "text": "Home", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getAppliedTheme +Get the theme currently applied to an application + + + + +```swift +theme.getAppliedTheme() { (response, error) in + // Use response +} +``` + + + + + + +An application has multiple themes, but only one theme can be applied at a time. Use this API to retrieve the theme currently applied to the application. + +*Returned Response:* + + + + +[ThemesSchema](#ThemesSchema) + +Success. Returns a JSON object of the theme. Check the example shown below or refer `ThemesSchema` for more details. + + + + +
    +  Examples: + + +
    +  Applied Theme + +```json +{ + "value": { + "information": { + "images": { + "desktop": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ], + "android": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "ios": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "thumbnail": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ] + }, + "features": [ + "Responsive" + ], + "name": "Akash-Artisan" + }, + "src": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/sources/J-1s-N-pl-archive.zip" + }, + "assets": { + "css": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/Ia4m885Mw2-themeBundle.css" + }, + "umd_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/nEPGyc15g-themeBundle.umd.min.js" + }, + "common_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/5f7tOB5rpq-themeBundle.common.js" + } + }, + "config": { + "preset": { + "sections": [ + { + "page_sections": [ + { + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219133573.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/men-collection-vcahuo2q" + } + } + }, + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219184350.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/shirts-5e9654ad" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "image-carousel", + "props": { + "slide_height": { + "type": "select", + "value": "adapt" + }, + "autoplay": { + "type": "checkbox", + "value": false + }, + "slide_interval": { + "type": "range", + "value": 2 + } + } + }, + { + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "accessories-7ee89654" + }, + "title": { + "type": "text", + "value": "Turtle sports club" + }, + "subtitle": { + "type": "text", + "value": "Casual Collections" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/casual_nfadbl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Formal Collection" + }, + "subtitle": { + "type": "text", + "value": "Turtle Tailor Mark" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/tailors_nsrrfl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Bottomwear" + }, + "subtitle": { + "type": "text", + "value": "Chinos | Trousers | Pants" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/bottomwear_tdkhn2.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "t-shirt-7ee3cbcd" + }, + "title": { + "type": "text", + "value": "Shirts" + }, + "subtitle": { + "type": "text", + "value": "Casual" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/t-shirt_re9srk.jpg" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionGrid", + "props": { + "title": { + "type": "text", + "value": "Collections" + }, + "subtitle": { + "type": "text", + "value": "Buy from our" + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "department": { + "type": "department", + "value": "others" + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "layout": { + "type": "select", + "value": "grid" + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + } + ] + }, + "global_schema": { + "props": [ + { + "type": "color", + "id": "header_bg_color", + "default": "#ffffff", + "category": "Header", + "label": "Header background Color" + }, + { + "type": "color", + "id": "footer_bg_color", + "default": "#1b1b1b", + "category": "Footer", + "label": "Footer background Color" + }, + { + "type": "text", + "id": "footer_text", + "default": "", + "category": "Footer", + "label": "Footer Text" + }, + { + "type": "checkbox", + "id": "disable_cart", + "default": false, + "category": "Cart", + "label": "Disable Cart" + } + ] + }, + "current": "default", + "page_schema": [ + { + "props": [], + "_id": "5fe182f763d26d042fd205c4", + "page": "add-product-review" + }, + { + "props": [], + "_id": "5fe182f763d26dadc8d205c6", + "page": "blog" + }, + { + "props": [], + "_id": "5fe182f763d26d0a36d205c7", + "page": "brands" + }, + { + "props": [ + { + "type": "checkbox", + "id": "gst", + "label": "GST", + "default": true, + "info": "Show GST on cart" + }, + { + "type": "checkbox", + "id": "staff_selection", + "label": "Staff Selection", + "default": true, + "info": "Show Staff selection on Cart" + }, + { + "type": "checkbox", + "id": "enable_customer", + "label": "Customer", + "default": true, + "info": "Placing on behalf of customer" + }, + { + "type": "checkbox", + "id": "enable_guest", + "label": "Enable Guest Checkout", + "default": true, + "info": "Enable Continue as Guest" + } + ], + "_id": "5fe182f763d26d81c5d205c8", + "page": "cart-landing" + }, + { + "props": [], + "_id": "5fe182f763d26d7e15d205c9", + "page": "cart-review" + }, + { + "props": [], + "_id": "5fe182f763d26d270ed205ca", + "page": "categories" + }, + { + "props": [], + "_id": "5fe182f763d26d9b4fd205cb", + "page": "collection-listing" + }, + { + "props": [], + "_id": "5fe182f763d26da6ecd205cc", + "page": "collections" + }, + { + "props": [], + "_id": "5fe182f763d26d7156d205cd", + "page": "compare-products" + }, + { + "props": [], + "_id": "5fe182f763d26d62bad205ce", + "page": "home" + }, + { + "props": [], + "_id": "5fe182f763d26d5afcd205cf", + "page": "order-review" + }, + { + "props": [], + "_id": "5fe182f763d26def8dd205d0", + "page": "order-tracking-details" + }, + { + "props": [], + "_id": "5fe182f763d26d381fd205d1", + "page": "order-tracking" + }, + { + "props": [ + { + "type": "text", + "id": "shipping_link", + "label": "Shipping Link", + "default": "https://fynd.freshdesk.com/support/solutions/folders/33000111600", + "info": "Link of shipping page" + }, + { + "type": "checkbox", + "id": "original_image", + "label": "Use original Image", + "default": false, + "info": "Use original product image." + }, + { + "type": "checkbox", + "id": "wishlist", + "label": "Wishlist", + "default": true, + "info": "Show Wishlist for product" + }, + { + "type": "checkbox", + "id": "reviews", + "label": "Review", + "default": true, + "info": "Show Reviews of product" + }, + { + "type": "checkbox", + "id": "add_to_compare", + "label": "Add to Compare", + "default": true, + "info": "Allow comparison of products" + }, + { + "type": "checkbox", + "id": "size_guide", + "label": "Size Guide", + "default": true, + "info": "Show Size Guide" + }, + { + "type": "checkbox", + "id": "product_request", + "label": "Product Request", + "default": true, + "info": "Show Product Request" + }, + { + "type": "checkbox", + "id": "share", + "label": "Share", + "default": true, + "info": "Enable Sharing product" + }, + { + "type": "checkbox", + "id": "sold_by", + "label": "Show Sold By", + "default": true, + "info": "Show name of the store" + }, + { + "type": "checkbox", + "id": "store_selection", + "label": "Seller Store Selection", + "default": true, + "info": "Allow to explicitly select stores" + }, + { + "type": "checkbox", + "id": "compare_products", + "label": "Compare Products", + "default": true, + "info": "Show Most Compared Products" + }, + { + "type": "checkbox", + "id": "variants", + "label": "Product Variants", + "default": true, + "info": "Show Product Variants" + }, + { + "type": "checkbox", + "id": "ratings", + "label": "Product Rating", + "default": true, + "info": "Show Product Ratings" + }, + { + "type": "checkbox", + "id": "similar_products", + "label": "Similar Products", + "default": true, + "info": "Show Similar Products" + }, + { + "type": "checkbox", + "id": "bulk_prices", + "label": "Bulk Prices", + "default": true, + "info": "Show Bulk Prices" + }, + { + "type": "checkbox", + "id": "showDeliveryInfo", + "label": "Delivery Info", + "default": true, + "info": "Show Delivery Date" + } + ], + "_id": "5fe182f763d26d29bbd205d2", + "page": "product-description" + }, + { + "props": [], + "_id": "5fe182f763d26da5f0d205d3", + "page": "product-listing" + }, + { + "props": [], + "_id": "5fe182f763d26d3d18d205d4", + "page": "product-reviews" + }, + { + "props": [], + "_id": "5fe182f763d26d4e2dd205d5", + "page": "wishlist" + }, + { + "props": [ + { + "default": true, + "id": "header", + "label": "Header", + "type": "checkbox" + }, + { + "default": true, + "id": "footer", + "label": "Footer", + "type": "checkbox" + } + ], + "_id": "5fe7166cbaae343115de8555", + "page": "tesr" + } + ], + "list": [ + { + "name": "default", + "global_config": { + "static": { + "props": { + "colors": { + "primary_color": "#7043f7", + "secondary_color": "#02d1cb", + "accent_color": "#FFFFFF", + "link_color": "#7043f7", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "disable_cart": false + } + } + }, + "page": [ + { + "settings": { + "props": { + "show_info_message": true + } + }, + "page": "cart-landing" + } + ], + "_id": "5fc4bb9078e957737e7d79a3" + } + ] + }, + "colors": { + "primary_color": "#41434C", + "secondary_color": "#41434C", + "accent_color": "#FFFFFF", + "link_color": "#33B1C0", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + }, + "font": { + "variants": { + "light": { + "name": "300", + "file": "" + }, + "regular": { + "name": "regular", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVRS0Fbvbc14VxRD7N01bV7kg.ttf" + }, + "medium": { + "name": "500", + "file": "" + }, + "semi_bold": { + "name": "600", + "file": "" + }, + "bold": { + "name": "700", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVSS0Fbvbc14Vxps5xQ3Z5nm29Gww.ttf" + } + }, + "family": "Judson" + }, + "applied": true, + "published": false, + "archived": false, + "customized": true, + "version": "1.1.19", + "tags": [], + "_id": "5fe17f7063d26dc54fd202b4", + "pages": { + "home": { + "path": "", + "type": "system", + "sections": [], + "value": "home", + "text": "Home" + }, + "brands": { + "path": "brands", + "type": "system", + "sections": [], + "value": "brands", + "text": "Brands" + }, + "cart-landing": { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + "categories": { + "path": "categories", + "type": "system", + "sections": [], + "value": "categories", + "text": "Categories" + }, + "collections": { + "path": "collections", + "type": "system", + "sections": [], + "value": "collections", + "text": "Collections" + }, + "compare-products": { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + "product-description": { + "path": "product", + "type": "system", + "sections": [], + "value": "product-description", + "text": "Product Description" + }, + "product-listing": { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + "collection-listing": { + "path": "collection", + "type": "system", + "sections": [], + "value": "collection-listing", + "text": "COllection Listing" + }, + "wishlist": { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + } + }, + "available_sections": [ + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Brands", + "label": "Brands Heading" + }, + { + "type": "radio", + "id": "brand_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "department", + "text": "Department" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "department", + "id": "department", + "label": "Department", + "info": "Select a department of brands", + "note": "Department only applies if 'department' type is selected" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": [ + { + "type": "brand", + "id": "brand", + "label": "Select Brand" + } + ] + } + ], + "_id": "5feacca5bec232d59b89283a", + "name": "brandTemplate", + "label": "Brands List Page" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Categories", + "label": "Categories Heading" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All", + "info": "Check to show View All Button" + } + ], + "blocks": [], + "_id": "5feacca5bec232404189283b", + "name": "categoriesTemplate", + "label": "Categories Page" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Subtitle" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Background image", + "info": "Background Image" + }, + { + "type": "text", + "id": "title", + "default": "", + "label": "Overlay title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Overlay subtitle" + } + ] + } + ], + "_id": "5feacca5bec2321fd589283c", + "name": "collectionGrid", + "label": "Collection Grid" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collection List", + "label": "Collection Heading", + "info": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + } + ] + } + ], + "_id": "5feacca5bec2323bf689283d", + "name": "collectionList", + "label": "Collection List" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "radio", + "id": "collection_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "collection-item", + "name": "Collection Item", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select collection" + } + ] + } + ], + "_id": "5feacca5bec23263b489283e", + "name": "collectionTemplate", + "label": "Collection List Page" + }, + { + "props": [ + { + "type": "code", + "id": "code", + "label": "Custom HTML", + "info": "Add Your custom HTML Code below. You can also use the full screen icon to open a code editor and add your code" + } + ], + "blocks": [], + "_id": "5feacca5bec232409489283f", + "name": "customHtml", + "label": "Custom HTML" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Products", + "label": "Section Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "product", + "name": "Product", + "props": [ + { + "type": "product", + "id": "product", + "label": "Select a Product", + "info": "Product Item to be displayed" + } + ] + } + ], + "_id": "5feacca5bec2326213892840", + "name": "featuredProducts", + "label": "Featured Products", + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "props": [ + { + "type": "range", + "id": "item_count", + "min": 1, + "max": 4, + "step": 1, + "unit": "", + "label": "No of items", + "default": 4, + "info": "Maximum items allowed per row" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image", + "default": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1603773049684.svg" + }, + { + "type": "text", + "id": "caption", + "label": "Image Caption", + "default": "" + }, + { + "type": "url", + "id": "link", + "label": "Link", + "default": "", + "info": "Link to redirect" + } + ] + } + ], + "_id": "5feacca5bec2321047892841", + "name": "gallery", + "label": "Gallery", + "preset": { + "props": { + "item_count": 4 + }, + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec232b085892842", + "name": "heroBanner", + "label": "Hero Banner" + }, + { + "props": [ + { + "id": "image", + "type": "image_picker", + "label": "Hero Image", + "default": "" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "overlayLayout", + "type": "select", + "options": [ + { + "value": "left", + "text": "Align Left" + }, + { + "value": "center", + "text": "Align Center" + }, + { + "value": "right", + "text": "Align Right" + } + ], + "default": "left", + "label": "Overlay Layout", + "info": "Alignment of overlay content" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Overlay image", + "info": "Overlay Image" + }, + { + "type": "text", + "id": "text", + "default": "", + "label": "Overlay Text" + }, + { + "type": "color", + "id": "text_color", + "default": "#000", + "label": "Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "Shop Now", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec2321e74892843", + "name": "imageBanner", + "label": "Hero Image" + }, + { + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "coverUrl", + "type": "image_picker", + "label": "Video Cover Image URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + }, + { + "type": "select", + "id": "size", + "options": [ + { + "value": "adapt", + "text": "Adapt" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Video Height", + "info": "Height of Video" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "color", + "id": "heading_color", + "default": "#000", + "label": "Headin Text Color" + }, + { + "type": "text", + "id": "subHeading", + "default": "", + "label": "Sub-heading" + }, + { + "type": "color", + "id": "subheading_color", + "default": "#000", + "label": "Subheading Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "ShopNow", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec232bfc8892844", + "name": "videoBanner", + "label": "Hero Video" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first image" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides after every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image" + }, + { + "type": "url", + "id": "slide_link", + "label": "Slide Link" + } + ] + } + ], + "_id": "5feacca5bec232a916892845", + "name": "image-carousel", + "label": "Image Carousel", + "preset": { + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 2, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "collection", + "id": "collection", + "label": "Collection", + "info": "Select a collection to display its products" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec23258ec892846", + "name": "productList", + "label": "Product List", + "preset": { + "props": { + "heading": "Featured Products", + "item_count": 4, + "collection": "" + } + } + }, + { + "props": [ + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2 + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "testimonial", + "name": "Testimonial", + "props": [ + { + "type": "textarea", + "id": "testimonialText", + "label": "Text for Testimonial", + "default": "", + "info": "Text for testimonial", + "placeholder": "Text" + }, + { + "type": "text", + "id": "author", + "label": "Customers name" + } + ] + } + ], + "_id": "5feacca5bec23299e8892847", + "name": "testimonials", + "label": "Testimonial" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first video" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "video_item", + "name": "Video Slide", + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + } + ] + } + ], + "_id": "5feacca5bec232d89b892848", + "name": "videoCarousel", + "label": "Video Carousel" + } + ], + "sections": [ + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "Brands" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "department": { + "type": "department", + "value": null + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": null + } + } + } + ], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "collection-listing" + }, + { + "page_sections": [ + { + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Apple", + "id": "apple" + } + } + } + }, + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Gionee", + "id": "gionee" + } + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "heading": { + "type": "text", + "value": "Brandss" + }, + "brand_type": { + "type": "radio", + "value": "handpicked" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 4, + "type": "range" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + }, + { + "page_sections": [], + "page_key": "tesr" + } + ], + "application": "5e737afb97e0f586bf9d04db", + "available_pages": [ + { + "path": "product", + "type": "system", + "sections": [], + "text": "Product Description", + "value": "product-description" + }, + { + "path": "collection", + "type": "system", + "sections": [], + "text": "Collection Listing", + "value": "collection-listing" + }, + { + "path": "", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2327927892853", + "attributes": { + "page": "home" + } + } + ], + "value": "home", + "text": "Home" + }, + { + "path": "brands", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2326422892854", + "attributes": { + "page": "brands" + } + } + ], + "value": "brands", + "text": "Brands" + }, + { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + { + "path": "categories", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec232424c892855", + "attributes": { + "page": "categories" + } + } + ], + "value": "categories", + "text": "Categories" + }, + { + "path": "collections", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec23281de892856", + "attributes": { + "page": "collections" + } + } + ], + "value": "collections", + "text": "Collections" + }, + { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + }, + { + "path": "sections/test", + "type": "sections", + "sections": [], + "text": "test", + "value": "test" + } + ], + "styles": {}, + "constants": {}, + "settings": {}, + "created_at": "2020-12-22T05:09:04.720Z", + "updated_at": "2021-01-24T11:22:41.376Z" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getThemeForPreview +Get a theme for a preview + + + + +```swift +theme.getThemeForPreview(themeId: themeId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| themeId | String | yes | ID of the theme to be retrieved | + + + +A theme can be previewed before applying it. Use this API to retrieve the preview of a theme by its ID. + +*Returned Response:* + + + + +[ThemesSchema](#ThemesSchema) + +Success. Returns a JSON object of the theme. Check the example shown below or refer `ThemesSchema` for more details. + + + + +
    +  Examples: + + +
    +  Preview Theme + +```json +{ + "value": { + "information": { + "images": { + "desktop": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ], + "android": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "ios": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "thumbnail": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ] + }, + "features": [ + "Responsive" + ], + "name": "Akash-Artisan" + }, + "src": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/sources/J-1s-N-pl-archive.zip" + }, + "assets": { + "css": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/Ia4m885Mw2-themeBundle.css" + }, + "umd_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/nEPGyc15g-themeBundle.umd.min.js" + }, + "common_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/5f7tOB5rpq-themeBundle.common.js" + } + }, + "config": { + "preset": { + "sections": [ + { + "page_sections": [ + { + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219133573.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/men-collection-vcahuo2q" + } + } + }, + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219184350.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/shirts-5e9654ad" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "image-carousel", + "props": { + "slide_height": { + "type": "select", + "value": "adapt" + }, + "autoplay": { + "type": "checkbox", + "value": false + }, + "slide_interval": { + "type": "range", + "value": 2 + } + } + }, + { + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "accessories-7ee89654" + }, + "title": { + "type": "text", + "value": "Turtle sports club" + }, + "subtitle": { + "type": "text", + "value": "Casual Collections" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/casual_nfadbl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Formal Collection" + }, + "subtitle": { + "type": "text", + "value": "Turtle Tailor Mark" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/tailors_nsrrfl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Bottomwear" + }, + "subtitle": { + "type": "text", + "value": "Chinos | Trousers | Pants" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/bottomwear_tdkhn2.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "t-shirt-7ee3cbcd" + }, + "title": { + "type": "text", + "value": "Shirts" + }, + "subtitle": { + "type": "text", + "value": "Casual" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/t-shirt_re9srk.jpg" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionGrid", + "props": { + "title": { + "type": "text", + "value": "Collections" + }, + "subtitle": { + "type": "text", + "value": "Buy from our" + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "department": { + "type": "department", + "value": "others" + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "layout": { + "type": "select", + "value": "grid" + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + } + ] + }, + "global_schema": { + "props": [ + { + "type": "color", + "id": "header_bg_color", + "default": "#ffffff", + "category": "Header", + "label": "Header background Color" + }, + { + "type": "color", + "id": "footer_bg_color", + "default": "#1b1b1b", + "category": "Footer", + "label": "Footer background Color" + }, + { + "type": "text", + "id": "footer_text", + "default": "", + "category": "Footer", + "label": "Footer Text" + }, + { + "type": "checkbox", + "id": "disable_cart", + "default": false, + "category": "Cart", + "label": "Disable Cart" + } + ] + }, + "current": "default", + "page_schema": [ + { + "props": [], + "_id": "5fe182f763d26d042fd205c4", + "page": "add-product-review" + }, + { + "props": [], + "_id": "5fe182f763d26dadc8d205c6", + "page": "blog" + }, + { + "props": [], + "_id": "5fe182f763d26d0a36d205c7", + "page": "brands" + }, + { + "props": [ + { + "type": "checkbox", + "id": "gst", + "label": "GST", + "default": true, + "info": "Show GST on cart" + }, + { + "type": "checkbox", + "id": "staff_selection", + "label": "Staff Selection", + "default": true, + "info": "Show Staff selection on Cart" + }, + { + "type": "checkbox", + "id": "enable_customer", + "label": "Customer", + "default": true, + "info": "Placing on behalf of customer" + }, + { + "type": "checkbox", + "id": "enable_guest", + "label": "Enable Guest Checkout", + "default": true, + "info": "Enable Continue as Guest" + } + ], + "_id": "5fe182f763d26d81c5d205c8", + "page": "cart-landing" + }, + { + "props": [], + "_id": "5fe182f763d26d7e15d205c9", + "page": "cart-review" + }, + { + "props": [], + "_id": "5fe182f763d26d270ed205ca", + "page": "categories" + }, + { + "props": [], + "_id": "5fe182f763d26d9b4fd205cb", + "page": "collection-listing" + }, + { + "props": [], + "_id": "5fe182f763d26da6ecd205cc", + "page": "collections" + }, + { + "props": [], + "_id": "5fe182f763d26d7156d205cd", + "page": "compare-products" + }, + { + "props": [], + "_id": "5fe182f763d26d62bad205ce", + "page": "home" + }, + { + "props": [], + "_id": "5fe182f763d26d5afcd205cf", + "page": "order-review" + }, + { + "props": [], + "_id": "5fe182f763d26def8dd205d0", + "page": "order-tracking-details" + }, + { + "props": [], + "_id": "5fe182f763d26d381fd205d1", + "page": "order-tracking" + }, + { + "props": [ + { + "type": "text", + "id": "shipping_link", + "label": "Shipping Link", + "default": "https://fynd.freshdesk.com/support/solutions/folders/33000111600", + "info": "Link of shipping page" + }, + { + "type": "checkbox", + "id": "original_image", + "label": "Use original Image", + "default": false, + "info": "Use original product image." + }, + { + "type": "checkbox", + "id": "wishlist", + "label": "Wishlist", + "default": true, + "info": "Show Wishlist for product" + }, + { + "type": "checkbox", + "id": "reviews", + "label": "Review", + "default": true, + "info": "Show Reviews of product" + }, + { + "type": "checkbox", + "id": "add_to_compare", + "label": "Add to Compare", + "default": true, + "info": "Allow comparison of products" + }, + { + "type": "checkbox", + "id": "size_guide", + "label": "Size Guide", + "default": true, + "info": "Show Size Guide" + }, + { + "type": "checkbox", + "id": "product_request", + "label": "Product Request", + "default": true, + "info": "Show Product Request" + }, + { + "type": "checkbox", + "id": "share", + "label": "Share", + "default": true, + "info": "Enable Sharing product" + }, + { + "type": "checkbox", + "id": "sold_by", + "label": "Show Sold By", + "default": true, + "info": "Show name of the store" + }, + { + "type": "checkbox", + "id": "store_selection", + "label": "Seller Store Selection", + "default": true, + "info": "Allow to explicitly select stores" + }, + { + "type": "checkbox", + "id": "compare_products", + "label": "Compare Products", + "default": true, + "info": "Show Most Compared Products" + }, + { + "type": "checkbox", + "id": "variants", + "label": "Product Variants", + "default": true, + "info": "Show Product Variants" + }, + { + "type": "checkbox", + "id": "ratings", + "label": "Product Rating", + "default": true, + "info": "Show Product Ratings" + }, + { + "type": "checkbox", + "id": "similar_products", + "label": "Similar Products", + "default": true, + "info": "Show Similar Products" + }, + { + "type": "checkbox", + "id": "bulk_prices", + "label": "Bulk Prices", + "default": true, + "info": "Show Bulk Prices" + }, + { + "type": "checkbox", + "id": "showDeliveryInfo", + "label": "Delivery Info", + "default": true, + "info": "Show Delivery Date" + } + ], + "_id": "5fe182f763d26d29bbd205d2", + "page": "product-description" + }, + { + "props": [], + "_id": "5fe182f763d26da5f0d205d3", + "page": "product-listing" + }, + { + "props": [], + "_id": "5fe182f763d26d3d18d205d4", + "page": "product-reviews" + }, + { + "props": [], + "_id": "5fe182f763d26d4e2dd205d5", + "page": "wishlist" + }, + { + "props": [ + { + "default": true, + "id": "header", + "label": "Header", + "type": "checkbox" + }, + { + "default": true, + "id": "footer", + "label": "Footer", + "type": "checkbox" + } + ], + "_id": "5fe7166cbaae343115de8555", + "page": "tesr" + } + ], + "list": [ + { + "name": "default", + "global_config": { + "static": { + "props": { + "colors": { + "primary_color": "#7043f7", + "secondary_color": "#02d1cb", + "accent_color": "#FFFFFF", + "link_color": "#7043f7", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "disable_cart": false + } + } + }, + "page": [ + { + "settings": { + "props": { + "show_info_message": true + } + }, + "page": "cart-landing" + } + ], + "_id": "5fc4bb9078e957737e7d79a3" + } + ] + }, + "colors": { + "primary_color": "#41434C", + "secondary_color": "#41434C", + "accent_color": "#FFFFFF", + "link_color": "#33B1C0", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + }, + "font": { + "variants": { + "light": { + "name": "300", + "file": "" + }, + "regular": { + "name": "regular", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVRS0Fbvbc14VxRD7N01bV7kg.ttf" + }, + "medium": { + "name": "500", + "file": "" + }, + "semi_bold": { + "name": "600", + "file": "" + }, + "bold": { + "name": "700", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVSS0Fbvbc14Vxps5xQ3Z5nm29Gww.ttf" + } + }, + "family": "Judson" + }, + "applied": true, + "published": false, + "archived": false, + "customized": true, + "version": "1.1.19", + "tags": [], + "_id": "5fe17f7063d26dc54fd202b4", + "pages": { + "home": { + "path": "", + "type": "system", + "sections": [], + "value": "home", + "text": "Home" + }, + "brands": { + "path": "brands", + "type": "system", + "sections": [], + "value": "brands", + "text": "Brands" + }, + "cart-landing": { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + "categories": { + "path": "categories", + "type": "system", + "sections": [], + "value": "categories", + "text": "Categories" + }, + "collections": { + "path": "collections", + "type": "system", + "sections": [], + "value": "collections", + "text": "Collections" + }, + "compare-products": { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + "product-description": { + "path": "product", + "type": "system", + "sections": [], + "value": "product-description", + "text": "Product Description" + }, + "product-listing": { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + "collection-listing": { + "path": "collection", + "type": "system", + "sections": [], + "value": "collection-listing", + "text": "COllection Listing" + }, + "wishlist": { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + } + }, + "available_sections": [ + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Brands", + "label": "Brands Heading" + }, + { + "type": "radio", + "id": "brand_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "department", + "text": "Department" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "department", + "id": "department", + "label": "Department", + "info": "Select a department of brands", + "note": "Department only applies if 'department' type is selected" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": [ + { + "type": "brand", + "id": "brand", + "label": "Select Brand" + } + ] + } + ], + "_id": "5feacca5bec232d59b89283a", + "name": "brandTemplate", + "label": "Brands List Page" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Categories", + "label": "Categories Heading" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All", + "info": "Check to show View All Button" + } + ], + "blocks": [], + "_id": "5feacca5bec232404189283b", + "name": "categoriesTemplate", + "label": "Categories Page" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Subtitle" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Background image", + "info": "Background Image" + }, + { + "type": "text", + "id": "title", + "default": "", + "label": "Overlay title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Overlay subtitle" + } + ] + } + ], + "_id": "5feacca5bec2321fd589283c", + "name": "collectionGrid", + "label": "Collection Grid" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collection List", + "label": "Collection Heading", + "info": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + } + ] + } + ], + "_id": "5feacca5bec2323bf689283d", + "name": "collectionList", + "label": "Collection List" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "radio", + "id": "collection_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "collection-item", + "name": "Collection Item", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select collection" + } + ] + } + ], + "_id": "5feacca5bec23263b489283e", + "name": "collectionTemplate", + "label": "Collection List Page" + }, + { + "props": [ + { + "type": "code", + "id": "code", + "label": "Custom HTML", + "info": "Add Your custom HTML Code below. You can also use the full screen icon to open a code editor and add your code" + } + ], + "blocks": [], + "_id": "5feacca5bec232409489283f", + "name": "customHtml", + "label": "Custom HTML" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Products", + "label": "Section Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "product", + "name": "Product", + "props": [ + { + "type": "product", + "id": "product", + "label": "Select a Product", + "info": "Product Item to be displayed" + } + ] + } + ], + "_id": "5feacca5bec2326213892840", + "name": "featuredProducts", + "label": "Featured Products", + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "props": [ + { + "type": "range", + "id": "item_count", + "min": 1, + "max": 4, + "step": 1, + "unit": "", + "label": "No of items", + "default": 4, + "info": "Maximum items allowed per row" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image", + "default": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1603773049684.svg" + }, + { + "type": "text", + "id": "caption", + "label": "Image Caption", + "default": "" + }, + { + "type": "url", + "id": "link", + "label": "Link", + "default": "", + "info": "Link to redirect" + } + ] + } + ], + "_id": "5feacca5bec2321047892841", + "name": "gallery", + "label": "Gallery", + "preset": { + "props": { + "item_count": 4 + }, + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec232b085892842", + "name": "heroBanner", + "label": "Hero Banner" + }, + { + "props": [ + { + "id": "image", + "type": "image_picker", + "label": "Hero Image", + "default": "" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "overlayLayout", + "type": "select", + "options": [ + { + "value": "left", + "text": "Align Left" + }, + { + "value": "center", + "text": "Align Center" + }, + { + "value": "right", + "text": "Align Right" + } + ], + "default": "left", + "label": "Overlay Layout", + "info": "Alignment of overlay content" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Overlay image", + "info": "Overlay Image" + }, + { + "type": "text", + "id": "text", + "default": "", + "label": "Overlay Text" + }, + { + "type": "color", + "id": "text_color", + "default": "#000", + "label": "Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "Shop Now", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec2321e74892843", + "name": "imageBanner", + "label": "Hero Image" + }, + { + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "coverUrl", + "type": "image_picker", + "label": "Video Cover Image URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + }, + { + "type": "select", + "id": "size", + "options": [ + { + "value": "adapt", + "text": "Adapt" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Video Height", + "info": "Height of Video" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "color", + "id": "heading_color", + "default": "#000", + "label": "Headin Text Color" + }, + { + "type": "text", + "id": "subHeading", + "default": "", + "label": "Sub-heading" + }, + { + "type": "color", + "id": "subheading_color", + "default": "#000", + "label": "Subheading Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "ShopNow", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec232bfc8892844", + "name": "videoBanner", + "label": "Hero Video" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first image" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides after every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image" + }, + { + "type": "url", + "id": "slide_link", + "label": "Slide Link" + } + ] + } + ], + "_id": "5feacca5bec232a916892845", + "name": "image-carousel", + "label": "Image Carousel", + "preset": { + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 2, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "collection", + "id": "collection", + "label": "Collection", + "info": "Select a collection to display its products" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec23258ec892846", + "name": "productList", + "label": "Product List", + "preset": { + "props": { + "heading": "Featured Products", + "item_count": 4, + "collection": "" + } + } + }, + { + "props": [ + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2 + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "testimonial", + "name": "Testimonial", + "props": [ + { + "type": "textarea", + "id": "testimonialText", + "label": "Text for Testimonial", + "default": "", + "info": "Text for testimonial", + "placeholder": "Text" + }, + { + "type": "text", + "id": "author", + "label": "Customers name" + } + ] + } + ], + "_id": "5feacca5bec23299e8892847", + "name": "testimonials", + "label": "Testimonial" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first video" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "video_item", + "name": "Video Slide", + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + } + ] + } + ], + "_id": "5feacca5bec232d89b892848", + "name": "videoCarousel", + "label": "Video Carousel" + } + ], + "sections": [ + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "Brands" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "department": { + "type": "department", + "value": null + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": null + } + } + } + ], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "collection-listing" + }, + { + "page_sections": [ + { + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Apple", + "id": "apple" + } + } + } + }, + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Gionee", + "id": "gionee" + } + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "heading": { + "type": "text", + "value": "Brandss" + }, + "brand_type": { + "type": "radio", + "value": "handpicked" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 4, + "type": "range" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + }, + { + "page_sections": [], + "page_key": "tesr" + } + ], + "application": "5e737afb97e0f586bf9d04db", + "available_pages": [ + { + "path": "product", + "type": "system", + "sections": [], + "text": "Product Description", + "value": "product-description" + }, + { + "path": "collection", + "type": "system", + "sections": [], + "text": "Collection Listing", + "value": "collection-listing" + }, + { + "path": "", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2327927892853", + "attributes": { + "page": "home" + } + } + ], + "value": "home", + "text": "Home" + }, + { + "path": "brands", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2326422892854", + "attributes": { + "page": "brands" + } + } + ], + "value": "brands", + "text": "Brands" + }, + { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + { + "path": "categories", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec232424c892855", + "attributes": { + "page": "categories" + } + } + ], + "value": "categories", + "text": "Categories" + }, + { + "path": "collections", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec23281de892856", + "attributes": { + "page": "collections" + } + } + ], + "value": "collections", + "text": "Collections" + }, + { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + }, + { + "path": "sections/test", + "type": "sections", + "sections": [], + "text": "test", + "value": "test" + } + ], + "styles": {}, + "constants": {}, + "settings": {}, + "created_at": "2020-12-22T05:09:04.720Z", + "updated_at": "2021-01-24T11:22:41.376Z" + } +} +``` +
    + +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [AvailablePageSchema](#AvailablePageSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | value | String? | yes | | + | text | String? | yes | | + | path | String? | yes | | + | type | String? | yes | | + | sections | [[AvailablePageSchemaSections](#AvailablePageSchemaSections)]? | yes | | + | sectionsMeta | [[AvailablePageSectionMetaAttributes](#AvailablePageSectionMetaAttributes)]? | yes | | + | theme | String? | yes | | + | seo | [AvailablePageSeo](#AvailablePageSeo)? | yes | | + | props | [[String: Any]]? | yes | | + | id | String? | yes | | + +--- + + + + + #### [AvailablePageSectionMetaAttributes](#AvailablePageSectionMetaAttributes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | attributes | [String: Any]? | yes | | + +--- + + + + + #### [AvailablePageSeo](#AvailablePageSeo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | description | String? | yes | | + | id | String? | yes | | + +--- + + + + + #### [AvailablePageSchemaSections](#AvailablePageSchemaSections) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | label | String? | yes | | + | props | [String: Any]? | yes | | + | blocks | [[String: Any]]? | yes | | + | preset | [String: Any]? | yes | | + | predicate | [AvailablePagePredicate](#AvailablePagePredicate)? | yes | | + +--- + + + + + #### [AvailablePageScreenPredicate](#AvailablePageScreenPredicate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | mobile | Bool? | yes | | + | desktop | Bool? | yes | | + | tablet | Bool? | yes | | + +--- + + + + + #### [AvailablePageUserPredicate](#AvailablePageUserPredicate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | authenticated | Bool? | yes | | + | anonymous | Bool? | yes | | + +--- + + + + + #### [AvailablePageRoutePredicate](#AvailablePageRoutePredicate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | selected | String? | yes | | + | exactUrl | String? | yes | | + | query | [String: Any]? | yes | | + +--- + + + + + #### [AvailablePagePredicate](#AvailablePagePredicate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | screen | [AvailablePageScreenPredicate](#AvailablePageScreenPredicate)? | yes | | + | user | [AvailablePageUserPredicate](#AvailablePageUserPredicate)? | yes | | + | route | [AvailablePageRoutePredicate](#AvailablePageRoutePredicate)? | yes | | + +--- + + + + + #### [AllAvailablePageSchema](#AllAvailablePageSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pages | [[AvailablePageSchema](#AvailablePageSchema)]? | yes | | + +--- + + + + + #### [PaginationSchema](#PaginationSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | size | Int? | yes | | + | itemTotal | Int? | yes | | + | hasNext | Bool? | yes | | + | type | String? | yes | | + | current | Int? | yes | | + +--- + + + + + #### [ThemesListingResponseSchema](#ThemesListingResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[ThemesSchema](#ThemesSchema)]? | yes | | + | page | [PaginationSchema](#PaginationSchema)? | yes | | + +--- + + + + + #### [AddThemeRequestSchema](#AddThemeRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | themeId | String? | yes | | + +--- + + + + + #### [UpgradableThemeSchema](#UpgradableThemeSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | parentTheme | String? | yes | | + | appliedTheme | String? | yes | | + | upgrade | Bool? | yes | | + +--- + + + + + #### [FontsSchema](#FontsSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [FontsSchemaItems](#FontsSchemaItems)? | yes | | + | kind | String? | yes | | + +--- + + + + + #### [BlitzkriegApiErrorSchema](#BlitzkriegApiErrorSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [BlitzkriegNotFoundSchema](#BlitzkriegNotFoundSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [BlitzkriegInternalServerErrorSchema](#BlitzkriegInternalServerErrorSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [FontsSchemaItems](#FontsSchemaItems) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | family | String? | yes | | + | variants | [String]? | yes | | + | subsets | [String]? | yes | | + | version | String? | yes | | + | lastModified | String? | yes | | + | files | [FontsSchemaItemsFiles](#FontsSchemaItemsFiles)? | yes | | + | category | String? | yes | | + | kind | String? | yes | | + +--- + + + + + #### [FontsSchemaItemsFiles](#FontsSchemaItemsFiles) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | regular | String? | yes | | + | italic | String? | yes | | + | bold | String? | yes | | + +--- + + + + + #### [ThemesSchema](#ThemesSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | String? | yes | | + | applied | Bool? | yes | | + | customized | Bool? | yes | | + | published | Bool? | yes | | + | archived | Bool? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | version | String? | yes | | + | parentThemeVersion | String? | yes | | + | parentTheme | String? | yes | | + | information | [Information](#Information)? | yes | | + | tags | [String]? | yes | | + | src | [Src](#Src)? | yes | | + | assets | [AssetsSchema](#AssetsSchema)? | yes | | + | availableSections | [[availableSectionSchema](#availableSectionSchema)]? | yes | | + | constants | [String: Any]? | yes | | + | styles | [String: Any]? | yes | | + | config | [Config](#Config)? | yes | | + | settings | [String: Any]? | yes | | + | font | [Font](#Font)? | yes | | + | id | String? | yes | | + | v | Int? | yes | | + | colors | [Colors](#Colors)? | yes | | + +--- + + + + + #### [availableSectionSchema](#availableSectionSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | blocks | [[Blocks](#Blocks)]? | yes | | + | name | String? | yes | | + | label | String? | yes | | + | props | [[BlocksProps](#BlocksProps)]? | yes | | + +--- + + + + + #### [Information](#Information) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | images | [Images](#Images)? | yes | | + | features | [String]? | yes | | + | name | String? | yes | | + | description | String? | yes | | + +--- + + + + + #### [Images](#Images) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | desktop | [String]? | yes | | + | android | [String]? | yes | | + | ios | [String]? | yes | | + | thumbnail | [String]? | yes | | + +--- + + + + + #### [Src](#Src) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | link | String? | yes | | + +--- + + + + + #### [AssetsSchema](#AssetsSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | umdJs | [UmdJs](#UmdJs)? | yes | | + | commonJs | [CommonJs](#CommonJs)? | yes | | + | css | [Css](#Css)? | yes | | + +--- + + + + + #### [UmdJs](#UmdJs) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | link | String? | yes | | + +--- + + + + + #### [CommonJs](#CommonJs) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | link | String? | yes | | + +--- + + + + + #### [Css](#Css) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | link | String? | yes | | + +--- + + + + + #### [Sections](#Sections) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | attributes | String? | yes | | + +--- + + + + + #### [Config](#Config) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | preset | [Preset](#Preset)? | yes | | + | globalSchema | [GlobalSchema](#GlobalSchema)? | yes | | + | current | String? | yes | | + | list | [[ListSchemaItem](#ListSchemaItem)]? | yes | | + +--- + + + + + #### [Preset](#Preset) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pages | [[AvailablePageSchema](#AvailablePageSchema)]? | yes | | + +--- + + + + + #### [GlobalSchema](#GlobalSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | props | [[GlobalSchemaProps](#GlobalSchemaProps)]? | yes | | + +--- + + + + + #### [ListSchemaItem](#ListSchemaItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | globalConfig | [String: Any]? | yes | | + | page | [[ConfigPage](#ConfigPage)]? | yes | | + | name | String? | yes | | + +--- + + + + + #### [Colors](#Colors) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | bgColor | String? | yes | | + | primaryColor | String? | yes | | + | secondaryColor | String? | yes | | + | accentColor | String? | yes | | + | linkColor | String? | yes | | + | buttonSecondaryColor | String? | yes | | + +--- + + + + + #### [Custom](#Custom) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | props | [String: Any]? | yes | | + +--- + + + + + #### [ConfigPage](#ConfigPage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | settings | [String: Any]? | yes | | + | page | String? | yes | | + +--- + + + + + #### [Font](#Font) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | family | String? | yes | | + | variants | [Variants](#Variants)? | yes | | + +--- + + + + + #### [Variants](#Variants) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | medium | [Medium](#Medium)? | yes | | + | semiBold | [SemiBold](#SemiBold)? | yes | | + | bold | [Bold](#Bold)? | yes | | + | light | [Light](#Light)? | yes | | + | regular | [Regular](#Regular)? | yes | | + +--- + + + + + #### [Medium](#Medium) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | file | String? | yes | | + +--- + + + + + #### [SemiBold](#SemiBold) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | file | String? | yes | | + +--- + + + + + #### [Bold](#Bold) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | file | String? | yes | | + +--- + + + + + #### [Light](#Light) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | file | String? | yes | | + +--- + + + + + #### [Regular](#Regular) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | file | String? | yes | | + +--- + + + + + #### [Blocks](#Blocks) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | name | String? | yes | | + | props | [[BlocksProps](#BlocksProps)]? | yes | | + +--- + + + + + #### [GlobalSchemaProps](#GlobalSchemaProps) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | label | String? | yes | | + | type | String? | yes | | + | category | String? | yes | | + +--- + + + + + #### [BlocksProps](#BlocksProps) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | label | String? | yes | | + | type | String? | yes | | + +--- + + + diff --git a/documentation/application/USER.md b/documentation/application/USER.md new file mode 100644 index 0000000000..ac1cbb8d3b --- /dev/null +++ b/documentation/application/USER.md @@ -0,0 +1,3999 @@ + + + + +##### [Back to Application docs](./README.md) + +## User Methods +Authentication Service +* [loginWithFacebook](#loginwithfacebook) +* [loginWithGoogle](#loginwithgoogle) +* [loginWithGoogleAndroid](#loginwithgoogleandroid) +* [loginWithGoogleIOS](#loginwithgoogleios) +* [loginWithAppleIOS](#loginwithappleios) +* [loginWithOTP](#loginwithotp) +* [loginWithEmailAndPassword](#loginwithemailandpassword) +* [sendResetPasswordEmail](#sendresetpasswordemail) +* [forgotPassword](#forgotpassword) +* [sendResetToken](#sendresettoken) +* [loginWithToken](#loginwithtoken) +* [registerWithForm](#registerwithform) +* [verifyEmail](#verifyemail) +* [verifyMobile](#verifymobile) +* [hasPassword](#haspassword) +* [updatePassword](#updatepassword) +* [logout](#logout) +* [sendOTPOnMobile](#sendotponmobile) +* [verifyMobileOTP](#verifymobileotp) +* [sendOTPOnEmail](#sendotponemail) +* [verifyEmailOTP](#verifyemailotp) +* [getLoggedInUser](#getloggedinuser) +* [getListOfActiveSessions](#getlistofactivesessions) +* [getPlatformConfig](#getplatformconfig) +* [updateProfile](#updateprofile) +* [addMobileNumber](#addmobilenumber) +* [deleteMobileNumber](#deletemobilenumber) +* [setMobileNumberAsPrimary](#setmobilenumberasprimary) +* [sendVerificationLinkToMobile](#sendverificationlinktomobile) +* [addEmail](#addemail) +* [deleteEmail](#deleteemail) +* [setEmailAsPrimary](#setemailasprimary) +* [sendVerificationLinkToEmail](#sendverificationlinktoemail) + + + +## Methods with example and description + + +#### loginWithFacebook +Login or Register using Facebook + + + + +```swift +user.loginWithFacebook(platform: platform, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platform | String? | no | ID of the application | +| body | OAuthRequestSchema | yes | Request body | + + +Use this API to login or register using Facebook credentials. + +*Returned Response:* + + + + +[AuthSuccess](#AuthSuccess) + +Success. Returns a JSON object with the user details. Check the example shown below or refer `AuthSuccess` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "user_exists": false, + "user": { + "emails": [ + { + "email": "www.akash24@gmail.com", + "verified": true, + "primary": true, + "active": true + } + ], + "phone_numbers": [], + "first_name": "Akash", + "last_name": "Mane", + "debug": { + "platform": "Fynd" + }, + "active": true + }, + "register_token": "d960c388-e286-43d9-b688-f6d1decc632d" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### loginWithGoogle +Login or Register using Google + + + + +```swift +user.loginWithGoogle(platform: platform, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platform | String? | no | ID of the application | +| body | OAuthRequestSchema | yes | Request body | + + +Use this API to login or register using Google Account credentials. + +*Returned Response:* + + + + +[AuthSuccess](#AuthSuccess) + +Success. Returns a JSON object with the user details. Check the example shown below or refer `AuthSuccess` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "user_exists": false, + "user": { + "emails": [ + { + "email": "www.akash24@gmail.com", + "verified": true, + "primary": true, + "active": true + } + ], + "phone_numbers": [], + "first_name": "Akash", + "last_name": "Mane", + "debug": { + "platform": "Fynd" + }, + "active": true + }, + "register_token": "d960c388-e286-43d9-b688-f6d1decc632d" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### loginWithGoogleAndroid +Login or Register using Google on Android + + + + +```swift +user.loginWithGoogleAndroid(platform: platform, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platform | String? | no | ID of the application | +| body | OAuthRequestSchema | yes | Request body | + + +Use this API to login or register in Android app using Google Account credentials. + +*Returned Response:* + + + + +[AuthSuccess](#AuthSuccess) + +Success. Returns a JSON object with the user details. Check the example shown below or refer `AuthSuccess` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "user_exists": false, + "user": { + "emails": [ + { + "email": "www.akash24@gmail.com", + "verified": true, + "primary": true, + "active": true + } + ], + "phone_numbers": [], + "first_name": "Akash", + "last_name": "Mane", + "debug": { + "platform": "Fynd" + }, + "active": true + }, + "register_token": "d960c388-e286-43d9-b688-f6d1decc632d" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### loginWithGoogleIOS +Login or Register using Google on iOS + + + + +```swift +user.loginWithGoogleIOS(platform: platform, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platform | String? | no | ID of the application | +| body | OAuthRequestSchema | yes | Request body | + + +Use this API to login or register in iOS app using Google Account credentials. + +*Returned Response:* + + + + +[AuthSuccess](#AuthSuccess) + +Success. Returns a JSON object with the user details. Check the example shown below or refer `AuthSuccess` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "user_exists": false, + "user": { + "emails": [ + { + "email": "www.akash24@gmail.com", + "verified": true, + "primary": true, + "active": true + } + ], + "phone_numbers": [], + "first_name": "Akash", + "last_name": "Mane", + "debug": { + "platform": "Fynd" + }, + "active": true + }, + "register_token": "d960c388-e286-43d9-b688-f6d1decc632d" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### loginWithAppleIOS +Login or Register using Apple on iOS + + + + +```swift +user.loginWithAppleIOS(platform: platform, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platform | String? | no | ID of the application | +| body | OAuthRequestAppleSchema | yes | Request body | + + +Use this API to login or register in iOS app using Apple Account credentials. + +*Returned Response:* + + + + +[AuthSuccess](#AuthSuccess) + +Success. Returns a JSON object with the user details. Check the example shown below or refer `AuthSuccess` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "user_exists": false, + "user": { + "emails": [ + { + "email": "www.akash24@gmail.com", + "verified": true, + "primary": true, + "active": true + } + ], + "phone_numbers": [], + "first_name": "Akash", + "last_name": "Mane", + "debug": { + "platform": "Fynd" + }, + "active": true + }, + "register_token": "d960c388-e286-43d9-b688-f6d1decc632d" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### loginWithOTP +Login or Register with OTP + + + + +```swift +user.loginWithOTP(platform: platform, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platform | String? | no | ID of the application | +| body | SendOtpRequestSchema | yes | Request body | + + +Use this API to login or register with a One-time Password (OTP) sent via Email or SMS. + +*Returned Response:* + + + + +[SendOtpResponse](#SendOtpResponse) + +Success. Check the example shown below or refer `SendOtpResponse` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "success": true, + "request_id": "01503005aeab87cbed93d40f46cc2749", + "message": "OTP sent", + "mobile": "8652523958", + "country_code": "91", + "resend_timer": 30, + "resendToken": "58e72ca0-66ae-11eb-98b1-77d61363826e" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### loginWithEmailAndPassword +Login or Register with password + + + + +```swift +user.loginWithEmailAndPassword(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | PasswordLoginRequestSchema | yes | Request body | + + +Use this API to login or register using an email address and password. + +*Returned Response:* + + + + +[LoginSuccess](#LoginSuccess) + +Success. Check the example shown below or refer `LoginSuccess` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "user": { + "debug": { + "source": "grimlock", + "platform": "000000000000000000000001" + }, + "gender": "male", + "account_type": "user", + "roles": [ + "Test-Role" + ], + "active": true, + "profile_pic_url": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", + "has_old_password_hash": false, + "_id": "5e68af49cfa09bf7233022f1", + "first_name": "Akash", + "last_name": "Mane", + "username": "akashmane_gofynd_com_10039", + "phone_numbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "8652523958", + "country_code": 91 + } + ], + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "akashmane@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@uniket.store" + } + ], + "created_at": "2020-03-11T09:28:41.982Z", + "updated_at": "2021-02-04T10:10:44.981Z", + "uid": "61" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### sendResetPasswordEmail +Reset Password + + + + +```swift +user.sendResetPasswordEmail(platform: platform, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platform | String? | no | ID of the application | +| body | SendResetPasswordEmailRequestSchema | yes | Request body | + + +Use this API to reset a password using the link sent on email. + +*Returned Response:* + + + + +[ResetPasswordSuccess](#ResetPasswordSuccess) + +Success. Check the example shown below or refer `ResetPasswordSuccess` for more details. + + + + +
    +  Example: + +```json +{ + "status": "sent" +} +``` +
    + + + + + + + + + +--- + + +#### forgotPassword +Forgot Password + + + + +```swift +user.forgotPassword(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | ForgotPasswordRequestSchema | yes | Request body | + + +Use this API to reset a password using the code sent on email or SMS. + +*Returned Response:* + + + + +[LoginSuccess](#LoginSuccess) + +Success. Check the example shown below or refer `LoginSuccess` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "user": { + "debug": { + "source": "grimlock", + "platform": "000000000000000000000001" + }, + "gender": "male", + "account_type": "user", + "roles": [ + "Test-Role" + ], + "active": true, + "profile_pic_url": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", + "has_old_password_hash": false, + "_id": "5e68af49cfa09bf7233022f1", + "first_name": "Akash", + "last_name": "Mane", + "username": "akashmane_gofynd_com_10039", + "phone_numbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "8652523958", + "country_code": 91 + } + ], + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "akashmane@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@uniket.store" + } + ], + "created_at": "2020-03-11T09:28:41.982Z", + "updated_at": "2021-02-04T10:10:44.981Z", + "uid": "61" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### sendResetToken +Reset Password using token + + + + +```swift +user.sendResetToken(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CodeRequestBodySchema | yes | Request body | + + +Use this API to send code to reset password. + +*Returned Response:* + + + + +[ResetPasswordSuccess](#ResetPasswordSuccess) + +Success. Check the example shown below or refer `ResetPasswordSuccess` for more details. + + + + +
    +  Example: + +```json +{ + "status": "success" +} +``` +
    + + + + + + + + + +--- + + +#### loginWithToken +Login or Register with token + + + + +```swift +user.loginWithToken(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | TokenRequestBodySchema | yes | Request body | + + +Use this API to login or register using a token for authentication. + +*Returned Response:* + + + + +[LoginSuccess](#LoginSuccess) + +Success. Check the example shown below or refer `LoginSuccess` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "user": { + "debug": { + "source": "grimlock", + "platform": "000000000000000000000001" + }, + "gender": "male", + "account_type": "user", + "roles": [ + "Test-Role" + ], + "active": true, + "profile_pic_url": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", + "has_old_password_hash": false, + "_id": "5e68af49cfa09bf7233022f1", + "first_name": "Akash", + "last_name": "Mane", + "username": "akashmane_gofynd_com_10039", + "phone_numbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "8652523958", + "country_code": 91 + } + ], + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "akashmane@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@uniket.store" + } + ], + "created_at": "2020-03-11T09:28:41.982Z", + "updated_at": "2021-02-04T10:10:44.981Z", + "uid": "61" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### registerWithForm +Registration using a form + + + + +```swift +user.registerWithForm(platform: platform, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platform | String? | no | ID of the application | +| body | FormRegisterRequestSchema | yes | Request body | + + +Use this API to perform user registration by sending form data in the request body. + +*Returned Response:* + + + + +[RegisterFormSuccess](#RegisterFormSuccess) + +Success. Check the example shown below or refer `RegisterFormSuccess` for more details. + + + + +
    +  Example: + +```json +{ + "success": true, + "request_id": "ebc059191393681cdfb805b5424bddad", + "message": "OTP sent", + "mobile": "7400448798", + "country_code": "91", + "resend_timer": 30, + "resend_token": "5197ff90-66e2-11eb-9399-0312fbf2c2a6", + "verify_mobile_otp": true, + "register_token": "276e718a-d406-4a4b-83f7-cb6cb72b99ff", + "userExists": false +} +``` +
    + + + + + + + + + +--- + + +#### verifyEmail +Verify email + + + + +```swift +user.verifyEmail(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CodeRequestBodySchema | yes | Request body | + + +Use this API to send a verification code to verify an email. + +*Returned Response:* + + + + +[VerifyEmailSuccess](#VerifyEmailSuccess) + +Success. Check the example shown below or refer `VerifyEmailSuccess` for more details. + + + + +
    +  Example: + +```json +{ + "message": "verified" +} +``` +
    + + + + + + + + + +--- + + +#### verifyMobile +Verify mobile + + + + +```swift +user.verifyMobile(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CodeRequestBodySchema | yes | Request body | + + +Use this API to send a verification code to verify a mobile number. + +*Returned Response:* + + + + +[VerifyEmailSuccess](#VerifyEmailSuccess) + +Success. Check the example shown below or refer `VerifyEmailSuccess` for more details. + + + + +
    +  Example: + +```json +{ + "message": "verified" +} +``` +
    + + + + + + + + + +--- + + +#### hasPassword +Check password + + + + +```swift +user.hasPassword() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to check if user has created a password for login. + +*Returned Response:* + + + + +[HasPasswordSuccess](#HasPasswordSuccess) + +Success. Returns a boolean value. Check the example shown below or refer `HasPasswordSuccess` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updatePassword +Update user password + + + + +```swift +user.updatePassword(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | UpdatePasswordRequestSchema | yes | Request body | + + +Use this API to update the password. + +*Returned Response:* + + + + +[VerifyEmailSuccess](#VerifyEmailSuccess) + +Success. Returns a success message. Refer `VerifyEmailSuccess` for more details. + + + + +
    +  Example: + +```json +{ + "message": "success" +} +``` +
    + + + + + + + + + +--- + + +#### logout +Logs out currently logged in user + + + + +```swift +user.logout() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to check to logout a user from the app. + +*Returned Response:* + + + + +[LogoutSuccess](#LogoutSuccess) + +Success. Returns a success message as shown below. Refer `LogoutSuccess` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### sendOTPOnMobile +Send OTP on mobile + + + + +```swift +user.sendOTPOnMobile(platform: platform, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platform | String? | no | ID of the application | +| body | SendMobileOtpRequestSchema | yes | Request body | + + +Use this API to send an OTP to a mobile number. + +*Returned Response:* + + + + +[OtpSuccess](#OtpSuccess) + +Success. Returns a JSON object as shown below. Refer `OtpSuccess` for more details. + + + + +
    +  Example: + +```json +{ + "success": true, + "request_id": "01503005aeab87cbed93d40f46cc2749", + "message": "OTP sent", + "mobile": "8652523958", + "country_code": "91", + "resend_timer": 30, + "resend_token": "18fc3d60-66e5-11eb-9399-0312fbf2c2a6" +} +``` +
    + + + + + + + + + +--- + + +#### verifyMobileOTP +Verify OTP on mobile + + + + +```swift +user.verifyMobileOTP(platform: platform, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platform | String? | no | ID of the application | +| body | VerifyOtpRequestSchema | yes | Request body | + + +Use this API to verify the OTP received on a mobile number. + +*Returned Response:* + + + + +[VerifyOtpSuccess](#VerifyOtpSuccess) + +Success. Returns a JSON object as shown below. Refer `VerifyOtpSuccess` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "verify_mobile_link": true, + "user": { + "debug": { + "source": "grimlock", + "platform": "000000000000000000000001" + }, + "gender": "male", + "account_type": "user", + "roles": [ + "Test-Role" + ], + "active": true, + "profile_pic_url": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", + "has_old_password_hash": false, + "_id": "5e68af49cfa09bf7233022f1", + "first_name": "Akash", + "last_name": "Mane", + "username": "akashmane_gofynd_com_10039", + "phone_numbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "8652523958", + "country_code": 91 + } + ], + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "akashmane@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@uniket.store" + } + ], + "created_at": "2020-03-11T09:28:41.982Z", + "updated_at": "2021-02-04T10:10:44.981Z", + "uid": "61" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### sendOTPOnEmail +Send OTP on email + + + + +```swift +user.sendOTPOnEmail(platform: platform, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platform | String? | no | ID of the application | +| body | SendEmailOtpRequestSchema | yes | Request body | + + +Use this API to send an OTP to an email ID. + +*Returned Response:* + + + + +[EmailOtpSuccess](#EmailOtpSuccess) + +Success. Returns a JSON object as shown below. Refer `EmailOtpSuccess` for more details. + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### verifyEmailOTP +Verify OTP on email + + + + +```swift +user.verifyEmailOTP(platform: platform, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platform | String? | no | ID of the application | +| body | VerifyEmailOtpRequestSchema | yes | Request body | + + +Use this API to verify the OTP received on an email ID. + +*Returned Response:* + + + + +[VerifyOtpSuccess](#VerifyOtpSuccess) + +Success. Returns a JSON object as shown below. Refer `VerifyOtpSuccess` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "verify_mobile_link": true, + "user": { + "debug": { + "source": "grimlock", + "platform": "000000000000000000000001" + }, + "gender": "male", + "account_type": "user", + "roles": [ + "Test-Role" + ], + "active": true, + "profile_pic_url": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", + "has_old_password_hash": false, + "_id": "5e68af49cfa09bf7233022f1", + "first_name": "Akash", + "last_name": "Mane", + "username": "akashmane_gofynd_com_10039", + "phone_numbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "8652523958", + "country_code": 91 + } + ], + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "akashmane@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@uniket.store" + } + ], + "created_at": "2020-03-11T09:28:41.982Z", + "updated_at": "2021-02-04T10:10:44.981Z", + "uid": "61" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getLoggedInUser +Get logged in user + + + + +```swift +user.getLoggedInUser() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get the details of a logged in user. + +*Returned Response:* + + + + +[UserObjectSchema](#UserObjectSchema) + +Success. Returns a JSON object with user details. Refer `UserObjectSchema` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "user": { + "debug": { + "source": "grimlock", + "platform": "000000000000000000000001" + }, + "gender": "male", + "account_type": "user", + "roles": [ + "Test-Role" + ], + "active": true, + "profile_pic_url": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", + "has_old_password_hash": false, + "_id": "5e68af49cfa09bf7233022f1", + "first_name": "Akash", + "last_name": "Mane", + "username": "akashmane_gofynd_com_10039", + "phone_numbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "8652523958", + "country_code": 91 + } + ], + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "akashmane@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@uniket.store" + } + ], + "created_at": "2020-03-11T09:28:41.982Z", + "updated_at": "2021-02-04T10:10:44.981Z", + "uid": "61" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getListOfActiveSessions +Get list of sessions + + + + +```swift +user.getListOfActiveSessions() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to retrieve all active sessions of a user. + +*Returned Response:* + + + + +[SessionListSuccess](#SessionListSuccess) + +Success. Returns a JSON object containing an array of sessions. Refer `SessionListSuccess` for more details. + + + + +
    +  Example: + +```json +{ + "sessions": [ + "session_1", + "session_2" + ] +} +``` +
    + + + + + + + + + +--- + + +#### getPlatformConfig +Get platform configurations + + + + +```swift +user.getPlatformConfig(name: name) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| name | String? | no | Name of the application, e.g. Fynd | + + + +Use this API to get all the platform configurations such as mobile image, desktop image, social logins, and all other text. + +*Returned Response:* + + + + +[PlatformSchema](#PlatformSchema) + +Success. Returns a JSON object containing the all the platform configurations. Refer `PlatformSchema` for more details. + + + + +
    +  Example: + +```json +{ + "active": true, + "mobile_image": null, + "desktop_image": null, + "social": { + "facebook": true, + "google": true, + "account_kit": true + }, + "flash_card": { + "text": "", + "text_color": "#FFFFFF", + "background_color": "#EF5350" + }, + "register": true, + "forgot_password": true, + "login": { + "password": true, + "otp": true + }, + "skip_captcha": false, + "display": "Fynd", + "subtext": "Login to Fynd", + "name": "Fynd", + "meta": {}, + "required_fields": { + "email": { + "is_required": false, + "level": "hard" + }, + "mobile": { + "is_required": true, + "level": "hard" + } + }, + "register_required_fields": { + "email": { + "is_required": false, + "level": "hard" + }, + "mobile": { + "is_required": true, + "level": "hard" + } + }, + "skip_login": false, + "look_and_feel": { + "background_color": "#F5F5F5", + "card_position": "center" + }, + "social_tokens": { + "google": { + "appId": "token_123" + }, + "facebook": { + "appId": "2033146826724884" + }, + "account_kit": { + "appId": "548529975557631" + } + }, + "_id": "5e04a5e5220bc15839ad9bc0", + "created_at": "2019-12-26T12:21:57.878Z", + "updated_at": "2020-08-13T14:31:09.878Z", + "__v": 0 +} +``` +
    + + + + + + + + + +--- + + +#### updateProfile +Edit Profile Details + + + + +```swift +user.updateProfile(platform: platform, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platform | String? | no | ID of the application | +| body | EditProfileRequestSchema | yes | Request body | + + +Use this API to update details in the user profile. Details can be first name, last name, gender, email, phone number, or profile picture. + +*Returned Response:* + + + + +[ProfileEditSuccess](#ProfileEditSuccess) + +Success. Check the example shown below or refer `LoginSuccess` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "user": { + "debug": { + "source": "grimlock", + "platform": "000000000000000000000001" + }, + "gender": "male", + "account_type": "user", + "roles": [ + "Test-Role" + ], + "active": true, + "profile_pic_url": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", + "has_old_password_hash": false, + "_id": "5e68af49cfa09bf7233022f1", + "first_name": "Akash", + "last_name": "Mane", + "username": "akashmane_gofynd_com_10039", + "phone_numbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "8652523958", + "country_code": 91 + } + ], + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "akashmane@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@uniket.store" + } + ], + "created_at": "2020-03-11T09:28:41.982Z", + "updated_at": "2021-02-04T10:10:44.981Z", + "uid": "61" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### addMobileNumber +Add mobile number to profile + + + + +```swift +user.addMobileNumber(platform: platform, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platform | String? | no | ID of the application | +| body | EditMobileRequestSchema | yes | Request body | + + +Use this API to add a new mobile number to a profile. + +*Returned Response:* + + + + +[VerifyMobileOTPSuccess](#VerifyMobileOTPSuccess) + +Success. Check the example shown below or refer `VerifyMobileOTPSuccess` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "verify_mobile_link": true, + "user": { + "debug": { + "source": "grimlock", + "platform": "000000000000000000000001" + }, + "gender": "male", + "account_type": "user", + "roles": [ + "Test-Role" + ], + "active": true, + "profile_pic_url": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", + "has_old_password_hash": false, + "_id": "5e68af49cfa09bf7233022f1", + "first_name": "Akash", + "last_name": "Mane", + "username": "akashmane_gofynd_com_10039", + "phone_numbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "8652523958", + "country_code": 91 + } + ], + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "akashmane@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@uniket.store" + } + ], + "created_at": "2020-03-11T09:28:41.982Z", + "updated_at": "2021-02-04T10:10:44.981Z", + "uid": "61" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### deleteMobileNumber +Delete mobile number from profile + + + + +```swift +user.deleteMobileNumber(platform: platform, active: active, primary: primary, verified: verified, countryCode: countryCode, phone: phone) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platform | String? | no | ID of the application | +| active | Bool | yes | This is a boolean value to check if mobile number is active 1.True - Number is active 2. False - Number is inactive | +| primary | Bool | yes | This is a boolean value to check if mobile number is primary number (main number) 1. True - Number is primary 2. False - Number is not primary | +| verified | Bool | yes | This is a boolean value to check if mobile number is verified 1. True - Number is verified 2.False - Number is not verified yet | +| countryCode | String | yes | Country code of the phone number, e.g. 91 | +| phone | String | yes | Phone number | + + + +Use this API to delete a mobile number from a profile. + +*Returned Response:* + + + + +[LoginSuccess](#LoginSuccess) + +Success. Check the example shown below or refer `LoginSuccess` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "user": { + "debug": { + "source": "grimlock", + "platform": "000000000000000000000001" + }, + "gender": "male", + "account_type": "user", + "roles": [ + "Test-Role" + ], + "active": true, + "profile_pic_url": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", + "has_old_password_hash": false, + "_id": "5e68af49cfa09bf7233022f1", + "first_name": "Akash", + "last_name": "Mane", + "username": "akashmane_gofynd_com_10039", + "phone_numbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "8652523958", + "country_code": 91 + } + ], + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "akashmane@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@uniket.store" + } + ], + "created_at": "2020-03-11T09:28:41.982Z", + "updated_at": "2021-02-04T10:10:44.981Z", + "uid": "61" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### setMobileNumberAsPrimary +Set mobile as primary + + + + +```swift +user.setMobileNumberAsPrimary(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | SendVerificationLinkMobileRequestSchema | yes | Request body | + + +Use this API to set a mobile number as primary. Primary number is a verified number used for all future communications. + +*Returned Response:* + + + + +[LoginSuccess](#LoginSuccess) + +Success. Check the example shown below or refer `LoginSuccess` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "user": { + "debug": { + "source": "grimlock", + "platform": "000000000000000000000001" + }, + "gender": "male", + "account_type": "user", + "roles": [ + "Test-Role" + ], + "active": true, + "profile_pic_url": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", + "has_old_password_hash": false, + "_id": "5e68af49cfa09bf7233022f1", + "first_name": "Akash", + "last_name": "Mane", + "username": "akashmane_gofynd_com_10039", + "phone_numbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "8652523958", + "country_code": 91 + } + ], + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "akashmane@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@uniket.store" + } + ], + "created_at": "2020-03-11T09:28:41.982Z", + "updated_at": "2021-02-04T10:10:44.981Z", + "uid": "61" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### sendVerificationLinkToMobile +Send verification link to mobile + + + + +```swift +user.sendVerificationLinkToMobile(platform: platform, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platform | String? | no | ID of the application | +| body | SendVerificationLinkMobileRequestSchema | yes | Request body | + + +Use this API to send a verification link to a mobile number + +*Returned Response:* + + + + +[SendMobileVerifyLinkSuccess](#SendMobileVerifyLinkSuccess) + +Success. Check the example shown below or refer `SendMobileVerifyLinkSuccess` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "verify_mobile_link": true, + "user": { + "debug": { + "source": "grimlock", + "platform": "000000000000000000000001" + }, + "gender": "male", + "account_type": "user", + "roles": [ + "Test-Role" + ], + "active": true, + "profile_pic_url": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", + "has_old_password_hash": false, + "_id": "5e68af49cfa09bf7233022f1", + "first_name": "Akash", + "last_name": "Mane", + "username": "akashmane_gofynd_com_10039", + "phone_numbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "8652523958", + "country_code": 91 + } + ], + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "akashmane@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@uniket.store" + } + ], + "created_at": "2020-03-11T09:28:41.982Z", + "updated_at": "2021-02-04T10:10:44.981Z", + "uid": "61" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### addEmail +Add email to profile + + + + +```swift +user.addEmail(platform: platform, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platform | String? | no | ID of the application | +| body | EditEmailRequestSchema | yes | Request body | + + +Use this API to add a new email address to a profile + +*Returned Response:* + + + + +[VerifyEmailOTPSuccess](#VerifyEmailOTPSuccess) + +Success. Returns a JSON object with user details. Refer `VerifyEmailOTPSuccess` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "verify_email_link": true, + "user": { + "debug": { + "source": "grimlock", + "platform": "000000000000000000000001" + }, + "gender": "male", + "account_type": "user", + "roles": [ + "Test-Role" + ], + "active": true, + "profile_pic_url": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", + "has_old_password_hash": false, + "_id": "5e68af49cfa09bf7233022f1", + "first_name": "Akash", + "last_name": "Mane", + "username": "akashmane_gofynd_com_10039", + "phone_numbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "8652523958", + "country_code": 91 + } + ], + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "akashmane@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@uniket.store" + } + ], + "created_at": "2020-03-11T09:28:41.982Z", + "updated_at": "2021-02-04T10:10:44.981Z", + "uid": "61" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### deleteEmail +Delete email from profile + + + + +```swift +user.deleteEmail(platform: platform, active: active, primary: primary, verified: verified, email: email) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platform | String? | no | ID of the application | +| active | Bool | yes | This is a boolean value to check if email ID is active 1. True - Email ID is active 2.False - Email ID is inactive | +| primary | Bool | yes | This is a boolean value to check if email ID is primary (main email ID) 1. True - Email ID is primary 2.False - Email ID is not primary | +| verified | Bool | yes | This is a boolean value to check if email ID is verified 1. True - Email ID is verified 2.False - Email ID is not verified yet | +| email | String | yes | The email ID to delete | + + + +Use this API to delete an email address from a profile + +*Returned Response:* + + + + +[LoginSuccess](#LoginSuccess) + +Success. Returns a JSON object with user details. Refer `LoginSuccess` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "user": { + "debug": { + "source": "grimlock", + "platform": "000000000000000000000001" + }, + "gender": "male", + "account_type": "user", + "roles": [ + "Test-Role" + ], + "active": true, + "profile_pic_url": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", + "has_old_password_hash": false, + "_id": "5e68af49cfa09bf7233022f1", + "first_name": "Akash", + "last_name": "Mane", + "username": "akashmane_gofynd_com_10039", + "phone_numbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "8652523958", + "country_code": 91 + } + ], + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "akashmane@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@uniket.store" + } + ], + "created_at": "2020-03-11T09:28:41.982Z", + "updated_at": "2021-02-04T10:10:44.981Z", + "uid": "61" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### setEmailAsPrimary +Set email as primary + + + + +```swift +user.setEmailAsPrimary(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | EditEmailRequestSchema | yes | Request body | + + +Use this API to set an email address as primary. Primary email ID is a email address used for all future communications. + +*Returned Response:* + + + + +[LoginSuccess](#LoginSuccess) + +Success. Returns a JSON object with user details. Refer `LoginSuccess` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "user": { + "debug": { + "source": "grimlock", + "platform": "000000000000000000000001" + }, + "gender": "male", + "account_type": "user", + "roles": [ + "Test-Role" + ], + "active": true, + "profile_pic_url": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", + "has_old_password_hash": false, + "_id": "5e68af49cfa09bf7233022f1", + "first_name": "Akash", + "last_name": "Mane", + "username": "akashmane_gofynd_com_10039", + "phone_numbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "8652523958", + "country_code": 91 + } + ], + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "akashmane@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@uniket.store" + } + ], + "created_at": "2020-03-11T09:28:41.982Z", + "updated_at": "2021-02-04T10:10:44.981Z", + "uid": "61" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### sendVerificationLinkToEmail +Send verification link to email + + + + +```swift +user.sendVerificationLinkToEmail(platform: platform, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platform | String? | no | ID of the application | +| body | EditEmailRequestSchema | yes | Request body | + + +Use this API to send verification link to an email address. + +*Returned Response:* + + + + +[SendEmailVerifyLinkSuccess](#SendEmailVerifyLinkSuccess) + +Request body must contain an email ID. Refer `EditEmailRequestSchema` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [EditEmailRequestSchema](#EditEmailRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + +--- + + + + + #### [SendVerificationLinkMobileRequestSchema](#SendVerificationLinkMobileRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | verified | Bool? | yes | | + | active | Bool? | yes | | + | countryCode | String? | yes | | + | phone | String? | yes | | + | primary | Bool? | yes | | + +--- + + + + + #### [EditMobileRequestSchema](#EditMobileRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | countryCode | String? | yes | | + | phone | String? | yes | | + +--- + + + + + #### [EditProfileRequestSchema](#EditProfileRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | firstName | String? | yes | | + | lastName | String? | yes | | + | mobile | [EditProfileMobileSchema](#EditProfileMobileSchema)? | yes | | + | countryCode | String? | yes | | + | email | String? | yes | | + | gender | String? | yes | | + | dob | String? | yes | | + | profilePicUrl | String? | yes | | + | androidHash | String? | yes | | + | sender | String? | yes | | + | registerToken | String? | yes | | + +--- + + + + + #### [EditProfileMobileSchema](#EditProfileMobileSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | phone | String? | yes | | + | countryCode | String? | yes | | + +--- + + + + + #### [SendEmailOtpRequestSchema](#SendEmailOtpRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + | action | String? | yes | | + | token | String? | yes | | + | registerToken | String? | yes | | + +--- + + + + + #### [VerifyEmailOtpRequestSchema](#VerifyEmailOtpRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + | action | String? | yes | | + | registerToken | String? | yes | | + | otp | String? | yes | | + +--- + + + + + #### [VerifyOtpRequestSchema](#VerifyOtpRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | requestId | String? | yes | | + | registerToken | String? | yes | | + | otp | String? | yes | | + +--- + + + + + #### [SendMobileOtpRequestSchema](#SendMobileOtpRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | mobile | String? | yes | | + | countryCode | String? | yes | | + | action | String? | yes | | + | token | String? | yes | | + | androidHash | String? | yes | | + | force | String? | yes | | + | captchaCode | String? | yes | | + +--- + + + + + #### [UpdatePasswordRequestSchema](#UpdatePasswordRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | oldPassword | String? | yes | | + | newPassword | String? | yes | | + +--- + + + + + #### [FormRegisterRequestSchema](#FormRegisterRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | firstName | String? | yes | | + | lastName | String? | yes | | + | gender | String? | yes | | + | email | String? | yes | | + | password | String? | yes | | + | phone | [FormRegisterRequestSchemaPhone](#FormRegisterRequestSchemaPhone)? | yes | | + | registerToken | String? | yes | | + +--- + + + + + #### [TokenRequestBodySchema](#TokenRequestBodySchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | token | String? | yes | | + +--- + + + + + #### [ForgotPasswordRequestSchema](#ForgotPasswordRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | code | String? | yes | | + | password | String? | yes | | + +--- + + + + + #### [CodeRequestBodySchema](#CodeRequestBodySchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | code | String? | yes | | + +--- + + + + + #### [SendResetPasswordEmailRequestSchema](#SendResetPasswordEmailRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + | captchaCode | String? | yes | | + +--- + + + + + #### [PasswordLoginRequestSchema](#PasswordLoginRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | captchaCode | String? | yes | | + | password | String? | yes | | + | username | String? | yes | | + +--- + + + + + #### [SendOtpRequestSchema](#SendOtpRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | countryCode | String? | yes | | + | captchaCode | String? | yes | | + | mobile | String? | yes | | + +--- + + + + + #### [OAuthRequestSchema](#OAuthRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isSignedIn | Bool? | yes | | + | oauth2 | [OAuthRequestSchemaOauth2](#OAuthRequestSchemaOauth2)? | yes | | + | profile | [OAuthRequestSchemaProfile](#OAuthRequestSchemaProfile)? | yes | | + +--- + + + + + #### [OAuthRequestAppleSchema](#OAuthRequestAppleSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | userIdentifier | String? | yes | | + | oauth | [OAuthRequestAppleSchemaOauth](#OAuthRequestAppleSchemaOauth)? | yes | | + | profile | [OAuthRequestAppleSchemaProfile](#OAuthRequestAppleSchemaProfile)? | yes | | + +--- + + + + + #### [UserObjectSchema](#UserObjectSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [UserSchema](#UserSchema)? | yes | | + +--- + + + + + #### [AuthSuccess](#AuthSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | registerToken | String? | yes | | + | userExists | Bool? | yes | | + | user | [UserSchema](#UserSchema)? | yes | | + +--- + + + + + #### [SendOtpResponse](#SendOtpResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | resendTimer | Int? | yes | | + | resendToken | String? | yes | | + | success | Bool? | yes | | + | requestId | String? | yes | | + | message | String? | yes | | + | mobile | String? | yes | | + | countryCode | String? | yes | | + | email | String? | yes | | + | resendEmailToken | String? | yes | | + | registerToken | String? | yes | | + | verifyEmailOtp | Bool? | yes | | + | verifyMobileOtp | Bool? | yes | | + | userExists | Bool? | yes | | + +--- + + + + + #### [ProfileEditSuccess](#ProfileEditSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [UserSchema](#UserSchema)? | yes | | + | resendEmailToken | String? | yes | | + | registerToken | String? | yes | | + | userExists | Bool? | yes | | + | verifyEmailLink | Bool? | yes | | + | verifyEmailOtp | Bool? | yes | | + | verifyMobileOtp | Bool? | yes | | + | email | String? | yes | | + | requestId | String? | yes | | + +--- + + + + + #### [LoginSuccess](#LoginSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [UserSchema](#UserSchema)? | yes | | + | requestId | String? | yes | | + | registerToken | String? | yes | | + +--- + + + + + #### [VerifyOtpSuccess](#VerifyOtpSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [UserSchema](#UserSchema)? | yes | | + | userExists | Bool? | yes | | + | registerToken | String? | yes | | + +--- + + + + + #### [ResetPasswordSuccess](#ResetPasswordSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | status | String? | yes | | + +--- + + + + + #### [RegisterFormSuccess](#RegisterFormSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + | resendTimer | Int? | yes | | + | resendToken | String? | yes | | + | resendEmailToken | String? | yes | | + | registerToken | String? | yes | | + | success | Bool? | yes | | + | requestId | String? | yes | | + | message | String? | yes | | + | mobile | String? | yes | | + | countryCode | String? | yes | | + | verifyEmailOtp | Bool? | yes | | + | verifyMobileOtp | Bool? | yes | | + | userExists | Bool? | yes | | + +--- + + + + + #### [VerifyEmailSuccess](#VerifyEmailSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [HasPasswordSuccess](#HasPasswordSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | result | Bool? | yes | | + +--- + + + + + #### [LogoutSuccess](#LogoutSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | logout | Bool? | yes | | + +--- + + + + + #### [OtpSuccess](#OtpSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | resendTimer | Int? | yes | | + | resendToken | String? | yes | | + | registerToken | String? | yes | | + | success | Bool? | yes | | + | requestId | String? | yes | | + | message | String? | yes | | + | mobile | String? | yes | | + | countryCode | String? | yes | | + +--- + + + + + #### [EmailOtpSuccess](#EmailOtpSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | | + +--- + + + + + #### [SessionListSuccess](#SessionListSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | sessions | [String]? | yes | | + +--- + + + + + #### [VerifyMobileOTPSuccess](#VerifyMobileOTPSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [UserSchema](#UserSchema)? | yes | | + | verifyMobileLink | Bool? | yes | | + +--- + + + + + #### [VerifyEmailOTPSuccess](#VerifyEmailOTPSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [UserSchema](#UserSchema)? | yes | | + | verifyEmailLink | Bool? | yes | | + +--- + + + + + #### [SendMobileVerifyLinkSuccess](#SendMobileVerifyLinkSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | verifyMobileLink | Bool? | yes | | + +--- + + + + + #### [SendEmailVerifyLinkSuccess](#SendEmailVerifyLinkSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | verifyEmailLink | Bool? | yes | | + +--- + + + + + #### [UserSearchResponseSchema](#UserSearchResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | users | [[UserSchema](#UserSchema)]? | yes | | + +--- + + + + + #### [CustomerListResponseSchema](#CustomerListResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[UserSchema](#UserSchema)]? | yes | | + | page | [PaginationSchema](#PaginationSchema)? | yes | | + +--- + + + + + #### [PaginationSchema](#PaginationSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | size | Int? | yes | | + | itemTotal | Int? | yes | | + | hasNext | Bool? | yes | | + | type | String? | yes | | + | current | Int? | yes | | + +--- + + + + + #### [UnauthorizedSchema](#UnauthorizedSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [UnauthenticatedSchema](#UnauthenticatedSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | authenticated | Bool? | yes | | + +--- + + + + + #### [NotFoundSchema](#NotFoundSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [AuthenticationInternalServerErrorSchema](#AuthenticationInternalServerErrorSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [AuthenticationApiErrorSchema](#AuthenticationApiErrorSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [ProfileEditSuccessSchema](#ProfileEditSuccessSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + | verifyEmailOtp | Bool? | yes | | + | verifyEmailLink | Bool? | yes | | + | verifyMobileOtp | Bool? | yes | | + | user | String? | yes | | + | registerToken | String? | yes | | + | userExists | Bool? | yes | | + +--- + + + + + #### [FormRegisterRequestSchemaPhone](#FormRegisterRequestSchemaPhone) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | countryCode | String? | yes | | + | mobile | String? | yes | | + +--- + + + + + #### [OAuthRequestSchemaOauth2](#OAuthRequestSchemaOauth2) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | accessToken | String? | yes | | + | expiry | Int? | yes | | + | refreshToken | String? | yes | | + +--- + + + + + #### [OAuthRequestSchemaProfile](#OAuthRequestSchemaProfile) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | lastName | String? | yes | | + | image | String? | yes | | + | id | String? | yes | | + | email | String? | yes | | + | fullName | String? | yes | | + | firstName | String? | yes | | + +--- + + + + + #### [OAuthRequestAppleSchemaOauth](#OAuthRequestAppleSchemaOauth) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | identityToken | String? | yes | | + +--- + + + + + #### [OAuthRequestAppleSchemaProfile](#OAuthRequestAppleSchemaProfile) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | lastName | String? | yes | | + | fullName | String? | yes | | + | firstName | String? | yes | | + +--- + + + + + #### [AuthSuccessUser](#AuthSuccessUser) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | firstName | String? | yes | | + | lastName | String? | yes | | + | debug | [AuthSuccessUserDebug](#AuthSuccessUserDebug)? | yes | | + | active | Bool? | yes | | + | emails | [AuthSuccessUserEmails](#AuthSuccessUserEmails)? | yes | | + +--- + + + + + #### [AuthSuccessUserDebug](#AuthSuccessUserDebug) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | platform | String? | yes | | + +--- + + + + + #### [AuthSuccessUserEmails](#AuthSuccessUserEmails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + | verified | Bool? | yes | | + | primary | Bool? | yes | | + | active | Bool? | yes | | + +--- + + + + + #### [CreateUserRequestSchema](#CreateUserRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | phoneNumber | String | no | | + | email | String? | yes | | + | firstName | String? | yes | | + | lastName | String? | yes | | + | gender | String? | yes | | + | username | String | no | | + | meta | [String: Any]? | yes | | + +--- + + + + + #### [CreateUserResponseSchema](#CreateUserResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [UserSchema](#UserSchema)? | yes | | + +--- + + + + + #### [CreateUserSessionRequestSchema](#CreateUserSessionRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | domain | String? | yes | | + | maxAge | Double? | yes | | + | userId | String? | yes | | + +--- + + + + + #### [CreateUserSessionResponseSchema](#CreateUserSessionResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | domain | String? | yes | | + | maxAge | Double? | yes | | + | secure | Bool? | yes | | + | httpOnly | Bool? | yes | | + | cookie | [String: Any]? | yes | | + +--- + + + + + #### [PlatformSchema](#PlatformSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | display | String? | yes | | + | lookAndFeel | [LookAndFeel](#LookAndFeel)? | yes | | + | updatedAt | String? | yes | | + | active | Bool? | yes | | + | forgotPassword | Bool? | yes | | + | login | [Login](#Login)? | yes | | + | skipCaptcha | Bool? | yes | | + | name | String? | yes | | + | meta | [MetaSchema](#MetaSchema)? | yes | | + | id | String? | yes | | + | social | [Social](#Social)? | yes | | + | requiredFields | [RequiredFields](#RequiredFields)? | yes | | + | registerRequiredFields | [RegisterRequiredFields](#RegisterRequiredFields)? | yes | | + | skipLogin | Bool? | yes | | + | flashCard | [FlashCard](#FlashCard)? | yes | | + | subtext | String? | yes | | + | socialTokens | [SocialTokens](#SocialTokens)? | yes | | + | createdAt | String? | yes | | + | register | Bool? | yes | | + | mobileImage | String? | yes | | + | desktopImage | String? | yes | | + +--- + + + + + #### [LookAndFeel](#LookAndFeel) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cardPosition | String? | yes | | + | backgroundColor | String? | yes | | + +--- + + + + + #### [Login](#Login) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | password | Bool? | yes | | + | otp | Bool? | yes | | + +--- + + + + + #### [MetaSchema](#MetaSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | fyndDefault | Bool? | yes | | + +--- + + + + + #### [Social](#Social) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | accountKit | Bool? | yes | | + | facebook | Bool? | yes | | + | google | Bool? | yes | | + | apple | Bool? | yes | | + +--- + + + + + #### [RequiredFields](#RequiredFields) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | [PlatformEmail](#PlatformEmail)? | yes | | + | mobile | [PlatformMobile](#PlatformMobile)? | yes | | + +--- + + + + + #### [PlatformEmail](#PlatformEmail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isRequired | Bool? | yes | | + | level | String? | yes | | + +--- + + + + + #### [PlatformMobile](#PlatformMobile) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isRequired | Bool? | yes | | + | level | String? | yes | | + +--- + + + + + #### [RegisterRequiredFields](#RegisterRequiredFields) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | [RegisterRequiredFieldsEmail](#RegisterRequiredFieldsEmail)? | yes | | + | mobile | [RegisterRequiredFieldsMobile](#RegisterRequiredFieldsMobile)? | yes | | + +--- + + + + + #### [RegisterRequiredFieldsEmail](#RegisterRequiredFieldsEmail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isRequired | Bool? | yes | | + | level | String? | yes | | + +--- + + + + + #### [RegisterRequiredFieldsMobile](#RegisterRequiredFieldsMobile) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isRequired | Bool? | yes | | + | level | String? | yes | | + +--- + + + + + #### [FlashCard](#FlashCard) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | text | String? | yes | | + | textColor | String? | yes | | + | backgroundColor | String? | yes | | + +--- + + + + + #### [SocialTokens](#SocialTokens) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | facebook | [Facebook](#Facebook)? | yes | | + | accountKit | [Accountkit](#Accountkit)? | yes | | + | google | [Google](#Google)? | yes | | + +--- + + + + + #### [Facebook](#Facebook) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appId | String? | yes | | + +--- + + + + + #### [Accountkit](#Accountkit) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appId | String? | yes | | + +--- + + + + + #### [Google](#Google) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appId | String? | yes | | + +--- + + + + + #### [UpdateUserRequestSchema](#UpdateUserRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | firstName | String? | yes | | + | lastName | String? | yes | | + | gender | String? | yes | | + | meta | [String: Any]? | yes | | + +--- + + + + + #### [UserSchema](#UserSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | firstName | String? | yes | | + | meta | [String: Any]? | yes | | + | lastName | String? | yes | | + | phoneNumbers | [[PhoneNumber](#PhoneNumber)]? | yes | | + | emails | [[Email](#Email)]? | yes | | + | gender | String? | yes | | + | dob | String? | yes | | + | active | Bool? | yes | | + | profilePicUrl | String? | yes | | + | username | String? | yes | | + | accountType | String? | yes | | + | uid | String? | yes | | + | debug | [Debug](#Debug)? | yes | | + | hasOldPasswordHash | Bool? | yes | | + | id | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + +--- + + + + + #### [PhoneNumber](#PhoneNumber) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | | + | primary | Bool? | yes | | + | verified | Bool? | yes | | + | phone | String? | yes | | + | countryCode | Int? | yes | | + +--- + + + + + #### [Email](#Email) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | primary | Bool? | yes | | + | verified | Bool? | yes | | + | email | String? | yes | | + | active | Bool? | yes | | + +--- + + + + + #### [Debug](#Debug) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | source | String? | yes | | + | platform | String? | yes | | + +--- + + + diff --git a/documentation/platform/ANALYTICS.md b/documentation/platform/ANALYTICS.md new file mode 100644 index 0000000000..becc3e01e2 --- /dev/null +++ b/documentation/platform/ANALYTICS.md @@ -0,0 +1,1113 @@ + + + + +##### [Back to Platform docs](./README.md) + +## Analytics Methods +Perceptor analytics +* [getStatiscticsGroups](#getstatiscticsgroups) +* [getStatiscticsGroupComponents](#getstatiscticsgroupcomponents) +* [getComponentStatsCSV](#getcomponentstatscsv) +* [getComponentStatsPDF](#getcomponentstatspdf) +* [getComponentStats](#getcomponentstats) +* [getAbandonCartList](#getabandoncartlist) +* [getAbandonCartsCSV](#getabandoncartscsv) +* [getAbandonCartDetail](#getabandoncartdetail) +* [createExportJob](#createexportjob) +* [getExportJobStatus](#getexportjobstatus) +* [getLogsList](#getlogslist) +* [searchLogs](#searchlogs) + + + +## Methods with example and description + + +#### getStatiscticsGroups +Get statistics groups + + + + +```swift +client.application("").analytics.getStatiscticsGroups() { (response, error) in + // Use response +} +``` + + + + + + +Get statistics groups + +*Returned Response:* + + + + +[StatsGroups](#StatsGroups) + +Success + + + + +
    +  Example: + +```json +{ + "groups": [ + { + "key": "general", + "url": "/v1/group/general", + "title": "General" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getStatiscticsGroupComponents +Get statistics group components + + + + +```swift +client.application("").analytics.getStatiscticsGroupComponents(groupName: groupName) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| groupName | String | yes | Group name | + + + +Get statistics group components + +*Returned Response:* + + + + +[StatsGroupComponents](#StatsGroupComponents) + +Success + + + + +
    +  Example: + +```json +{ + "title": "Catalogue & Inventory", + "components": [ + { + "key": "catalogue-basic", + "title": "Catalogue Basic", + "type": "text-blocks", + "url": "/stats/component/catalogue-basic", + "filters": {} + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getComponentStatsCSV +Get component statistics csv + + + + +```swift +client.application("").analytics.getComponentStatsCSV(componentName: componentName) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| componentName | String | yes | Component name | + + + +Get component statistics csv + +*Returned Response:* + + + + +[String](#String) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getComponentStatsPDF +Get component statistics pdf + + + + +```swift +client.application("").analytics.getComponentStatsPDF(componentName: componentName) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| componentName | String | yes | Component name | + + + +Get component statistics pdf + +*Returned Response:* + + + + +[String](#String) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getComponentStats +Get component statistics + + + + +```swift +client.application("").analytics.getComponentStats(componentName: componentName) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| componentName | String | yes | Component name | + + + +Get component statistics + +*Returned Response:* + + + + +[StatsRes](#StatsRes) + +Success + + + + +
    +  Example: + +```json +{ + "key": "article-distribution", + "title": "Inventory Distribution", + "type": "chart.pie", + "data": { + "raw": [ + { + "name": "Fatimah Logero", + "available_articles": 8, + "total_articles": 9, + "available_sizes": 3, + "total_sizes": 3, + "article_freshness": 9, + "count": 0, + "percent": "NaN" + } + ], + "type": "pie", + "data": { + "datasets": [ + { + "label": "# of products", + "backgroundColor": [ + "#7986CB", + "#3F51B5" + ], + "data": [ + 8, + 1 + ], + "percent": [ + "88.89", + "11.11" + ] + } + ], + "labels": [ + "Available Articles", + "Articles Out Of Stock" + ] + }, + "options": { + "responsive": true, + "display": false + }, + "cache_hit": false + } +} +``` +
    + + + + + + + + + +--- + + +#### getAbandonCartList +Get abandon carts list + + + + +```swift +client.application("").analytics.getAbandonCartList(fromDate: fromDate, toDate: toDate, pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| fromDate | String | yes | From date | +| toDate | String | yes | To date | +| pageNo | Int? | no | Current page number | +| pageSize | Int? | no | Current page size | + + + +Get abandon carts list + +*Returned Response:* + + + + +[AbandonCartsList](#AbandonCartsList) + +Success + + + + +
    +  Example: + +```json +{ + "items": { + "properties_cart_id": 11517, + "context_traits_first_name": "Ahmed", + "context_traits_last_name": "Sakri", + "context_traits_phone_number": "8433859662", + "context_traits_email": "ahmedsakri@gofynd.com", + "context_app_application_id": "000000000000000000000001", + "properties_breakup_values_raw_total": 4020, + "received_at": { + "value": "2021-03-09T05:09:06.840Z" + } + }, + "page": { + "type": "number", + "size": 10, + "current": 1, + "has_next": true, + "item_total": 15 + } +} +``` +
    + + + + + + + + + +--- + + +#### getAbandonCartsCSV +Get abandon carts csv + + + + +```swift +client.application("").analytics.getAbandonCartsCSV(fromDate: fromDate, toDate: toDate) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| fromDate | String | yes | From date | +| toDate | String | yes | To date | + + + +Get abandon carts csv + +*Returned Response:* + + + + +[String](#String) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getAbandonCartDetail +Get abandon carts details + + + + +```swift +client.application("").analytics.getAbandonCartDetail(cartId: cartId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| cartId | String | yes | Cart Id | + + + +Get abandon cart details + +*Returned Response:* + + + + +[AbandonCartDetail](#AbandonCartDetail) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### createExportJob +Create data export job in required format + + + + +```swift +client.analytics.createExportJob(exportType: exportType, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| exportType | String | yes | Export type / format | +| body | ExportJobReq | yes | Request body | + + +Create data export job in required format + +*Returned Response:* + + + + +[ExportJobRes](#ExportJobRes) + +Success + + + + +
    +  Example: + +```json +{ + "status": "queued", + "job_id": "6047c67060ad8241a948ee42" +} +``` +
    + + + + + + + + + +--- + + +#### getExportJobStatus +Get data export job status + + + + +```swift +client.analytics.getExportJobStatus(exportType: exportType, jobId: jobId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| exportType | String | yes | Export type / format | +| jobId | String | yes | Export job id | + + + +Get data export job status + +*Returned Response:* + + + + +[ExportJobStatusRes](#ExportJobStatusRes) + +Success + + + + +
    +  Example: + +```json +{ + "download_url": "https://marketplace-sync-logs-production.s3.ap-south-1.amazonaws.com/inv-log-37-flipkartAssured-Full_Inventory_Update.csv", + "status": "success", + "job_id": "6047c67060ad8241a948ee42" +} +``` +
    + + + + + + + + + +--- + + +#### getLogsList +Get logs list + + + + +```swift +client.analytics.getLogsList(logType: logType, pageNo: pageNo, pageSize: pageSize, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| logType | String | yes | Log type | +| pageNo | Int? | no | Current page number | +| pageSize | Int? | no | Current page size | +| body | GetLogsListReq | yes | Request body | + + +Get logs list + +*Returned Response:* + + + + +[GetLogsListRes](#GetLogsListRes) + +Success + + + + +
    +  Example: + +```json +{ + "items": [ + { + "start_time_iso": "2021-04-06T19:00:17.013Z", + "end_time_iso": "2021-04-06T19:00:17.015Z", + "event_type": "FULL_PRICE_UPDATE", + "trace_id": "marketplaces.aa18fa48-b3e8-4e1e-8396-69488e254ace", + "count": 17, + "status": "failed" + } + ], + "page": { + "type": "number", + "size": 10, + "current": 1, + "has_next": true, + "item_total": 88 + } +} +``` +
    + + + + + + + + + +--- + + +#### searchLogs +Search logs + + + + +```swift +client.analytics.searchLogs(pageNo: pageNo, pageSize: pageSize, logType: logType, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Current page number | +| pageSize | Int? | no | Current page size | +| logType | String | yes | Log type | +| body | SearchLogReq | yes | Request body | + + +Search logs + +*Returned Response:* + + + + +[SearchLogRes](#SearchLogRes) + +Success + + + + +
    +  Example: + +```json +{ + "items": [ + { + "_id": "606cafc19c2c466b24098437", + "status": "failed", + "event_type": "FULL_PRICE_UPDATE", + "marketplace_name": "myntra", + "event": "APPLICATION_FULL_INVENTORY", + "trace_id": "marketplaces.aa18fa48-b3e8-4e1e-8396-69488e254ace", + "company_id": 28, + "brand_id": 44, + "store_id": 57, + "item_id": 882857, + "article_id": "57_sku_102831159-TBUCKBEIGE_301066XL", + "seller_identifier": "SKU_102831159-TBUCKBEIGE_392826XL" + } + ], + "page": { + "type": "number", + "size": 10, + "current": 1, + "has_next": true, + "item_total": 88 + } +} +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [StatGroup](#StatGroup) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | url | String? | yes | | + | title | String? | yes | | + +--- + + + + + #### [ErrorRes](#ErrorRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [StatsGroups](#StatsGroups) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | groups | [[StatGroup](#StatGroup)]? | yes | | + +--- + + + + + #### [StatsGroupComponent](#StatsGroupComponent) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | url | String? | yes | | + | title | String? | yes | | + | type | String? | yes | | + | filters | [String: Any]? | yes | | + +--- + + + + + #### [StatsGroupComponents](#StatsGroupComponents) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | components | [[StatsGroupComponent](#StatsGroupComponent)]? | yes | | + +--- + + + + + #### [StatsRes](#StatsRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | title | String? | yes | | + | type | String? | yes | | + | data | [String: Any]? | yes | | + +--- + + + + + #### [ReceivedAt](#ReceivedAt) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | value | String? | yes | | + +--- + + + + + #### [AbandonCartsDetail](#AbandonCartsDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | propertiesCartId | String? | yes | | + | contextTraitsFirstName | String? | yes | | + | contextTraitsLastName | String? | yes | | + | contextTraitsPhoneNumber | String? | yes | | + | contextTraitsEmail | String? | yes | | + | contextAppApplicationId | String? | yes | | + | propertiesBreakupValuesRawTotal | String? | yes | | + | receivedAt | [ReceivedAt](#ReceivedAt)? | yes | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + | hasNext | Bool? | yes | | + | current | Int? | yes | | + | type | String | no | | + | size | Int? | yes | | + +--- + + + + + #### [AbandonCartsList](#AbandonCartsList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[AbandonCartsDetail](#AbandonCartsDetail)]? | yes | | + | cartTotal | String? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [AbandonCartDetail](#AbandonCartDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | userId | String? | yes | | + | cartValue | String? | yes | | + | articles | [[String: Any]]? | yes | | + | breakup | [String: Any]? | yes | | + | address | [String: Any]? | yes | | + +--- + + + + + #### [ExportJobReq](#ExportJobReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | marketplaceName | String? | yes | | + | startTime | String? | yes | | + | endTime | String? | yes | | + | eventType | String? | yes | | + | traceId | String? | yes | | + +--- + + + + + #### [ExportJobRes](#ExportJobRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | status | String? | yes | | + | jobId | String? | yes | | + +--- + + + + + #### [ExportJobStatusRes](#ExportJobStatusRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | status | String? | yes | | + | jobId | String? | yes | | + | downloadUrl | String? | yes | | + +--- + + + + + #### [GetLogsListReq](#GetLogsListReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | marketplaceName | String? | yes | | + | startDate | String? | yes | | + | companyId | String? | yes | | + | endDate | String? | yes | | + +--- + + + + + #### [MkpLogsResp](#MkpLogsResp) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | startTimeIso | String? | yes | | + | endTimeIso | String? | yes | | + | eventType | String? | yes | | + | traceId | String? | yes | | + | count | String? | yes | | + | status | String? | yes | | + +--- + + + + + #### [GetLogsListRes](#GetLogsListRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[MkpLogsResp](#MkpLogsResp)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [SearchLogReq](#SearchLogReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | marketplaceName | String? | yes | | + | startDate | String? | yes | | + | companyId | String? | yes | | + | endDate | String? | yes | | + | identifier | String? | yes | | + | identifierValue | String? | yes | | + +--- + + + + + #### [LogInfo](#LogInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | status | String? | yes | | + | eventType | String? | yes | | + | marketplaceName | String? | yes | | + | event | String? | yes | | + | traceId | String? | yes | | + | companyId | Double? | yes | | + | brandId | Double? | yes | | + | storeCode | String? | yes | | + | storeId | Double? | yes | | + | itemId | Double? | yes | | + | articleId | String? | yes | | + | sellerIdentifier | String? | yes | | + +--- + + + + + #### [SearchLogRes](#SearchLogRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[LogInfo](#LogInfo)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + diff --git a/documentation/platform/BILLING.md b/documentation/platform/BILLING.md new file mode 100644 index 0000000000..4f2233d7c8 --- /dev/null +++ b/documentation/platform/BILLING.md @@ -0,0 +1,2375 @@ + + + + +##### [Back to Platform docs](./README.md) + +## Billing Methods +Handle platform subscription +* [checkCouponValidity](#checkcouponvalidity) +* [createSubscriptionCharge](#createsubscriptioncharge) +* [getSubscriptionCharge](#getsubscriptioncharge) +* [cancelSubscriptionCharge](#cancelsubscriptioncharge) +* [getInvoices](#getinvoices) +* [getInvoiceById](#getinvoicebyid) +* [getCustomerDetail](#getcustomerdetail) +* [upsertCustomerDetail](#upsertcustomerdetail) +* [getSubscription](#getsubscription) +* [getFeatureLimitConfig](#getfeaturelimitconfig) +* [activateSubscriptionPlan](#activatesubscriptionplan) +* [cancelSubscriptionPlan](#cancelsubscriptionplan) + + + +## Methods with example and description + + +#### checkCouponValidity +Check coupon validity + + + + +```swift +client.billing.checkCouponValidity(plan: plan, couponCode: couponCode) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| plan | String | yes | ID of the plan. | +| couponCode | String | yes | Coupon code. | + + + +Check coupon validity. + +*Returned Response:* + + + + +[CheckValidityResponse](#CheckValidityResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### createSubscriptionCharge +Create subscription charge + + + + +```swift +client.billing.createSubscriptionCharge(extensionId: extensionId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| extensionId | String | yes | Extension _id | +| body | CreateSubscriptionCharge | yes | Request body | + + +Register subscription charge for a seller of your extension. + +*Returned Response:* + + + + +[CreateSubscriptionResponse](#CreateSubscriptionResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getSubscriptionCharge +Get subscription charge details + + + + +```swift +client.billing.getSubscriptionCharge(extensionId: extensionId, subscriptionId: subscriptionId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| extensionId | String | yes | Extension _id | +| subscriptionId | String | yes | Subscription charge _id | + + + +Get created subscription charge details + +*Returned Response:* + + + + +[EntitySubscription](#EntitySubscription) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### cancelSubscriptionCharge +Cancel subscription charge + + + + +```swift +client.billing.cancelSubscriptionCharge(extensionId: extensionId, subscriptionId: subscriptionId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| extensionId | String | yes | Extension _id | +| subscriptionId | String | yes | Subscription charge _id | + + + +Cancel subscription and attached charges. + +*Returned Response:* + + + + +[EntitySubscription](#EntitySubscription) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getInvoices +Get invoices + + + + +```swift +client.billing.getInvoices() { (response, error) in + // Use response +} +``` + + + + + + +Get invoices. + +*Returned Response:* + + + + +[Invoices](#Invoices) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "data": [ + { + "_id": "5f7acb709e76da30e3b92cdb", + "client": { + "name": "RELIANCE RETAIL LTD", + "email": "ZAK@GMAIL.COM", + "phone": "91 1234567890", + "address_lines": [ + "TV TOWER, Foot Over Bridge Khar", + null, + "Mumbai, 400079, Maharashtra, India" + ] + }, + "auto_advance": true, + "currency": "INR", + "paid": true, + "attemp": 3, + "collection_method": "charge_automatically", + "subscriber_id": "5ee773e1351e5e84289ed9cf", + "invoice_url": "", + "number": "FP-1-72020-736", + "pg_data": {}, + "period": { + "start": "2020-08-17T13:45:36.722Z", + "end": "2020-09-17T13:45:36.722Z" + }, + "receipt_number": "5fd9b08464dc6ac048a08988", + "statement_descriptor": "RELIANCE RETAIL LTD", + "current_status": "paid", + "status_trail": [ + { + "_id": "5f7ad29bd562744eab216379", + "value": "draft", + "timestamp": "2020-10-05T08:00:27.753Z" + }, + { + "_id": "5fcf40ce1613c029aff417dd", + "value": "open", + "timestamp": "2020-12-08T09:01:02.038Z" + }, + { + "_id": "5fd9b08664dc6a1ad0a08989", + "value": "paid", + "timestamp": "2020-12-16T07:00:22.973Z" + } + ], + "subtotal": 15720.08, + "total": 15720.08, + "subscription": "5f3a8a00668947663b7fbd38", + "next_action_time": "2020-10-05T09:00:27.754Z", + "created_at": "2020-10-05T07:29:52.876Z", + "modified_at": "2020-12-16T07:00:22.980Z", + "hash_identifier": "575999aca03e36f0fa54db5235bc7f25", + "payment_method": { + "pg_payment_method_id": null + }, + "invoice_items": [ + { + "_id": "5f7acb709e76da48b1b92cdd", + "currency": "INR", + "plan": { + "recurring": { + "interval": "month", + "interval_count": 1 + }, + "is_trial_plan": false, + "plan_group": "default", + "tag_lines": [], + "currency": "INR", + "is_active": true, + "is_visible": true, + "trial_period": 0, + "addons": [], + "tags": [], + "type": "public", + "country": "IN", + "_id": "5f3a8786c90d780037723a14", + "name": "Professional", + "description": "Professional", + "amount": 1499, + "product_suite_id": "5f3a8786c90d7800377239f3", + "created_at": "2020-08-17T13:35:02.802Z", + "modified_at": "2020-08-17T13:35:02.802Z" + }, + "name": "Professional", + "quantity": 1, + "description": "Professional", + "period": { + "start": "2020-08-17T13:45:36.722Z", + "end": "2020-10-05T07:29:52.868Z" + }, + "unit_amount": 2356.77, + "amount": 2356.77, + "type": "subscription", + "invoice_id": "5f7acb709e76da30e3b92cdb", + "created_at": "2020-10-05T07:29:52.886Z", + "modified_at": "2020-10-05T07:29:52.886Z" + }, + { + "_id": "5f7acf199aa6830c4fe5e984", + "currency": "INR", + "plan": { + "recurring": { + "interval": "month", + "interval_count": 1 + }, + "is_trial_plan": false, + "plan_group": "default", + "tag_lines": [], + "currency": "INR", + "is_active": true, + "is_visible": true, + "trial_period": 0, + "addons": [], + "tags": [ + "popular" + ], + "type": "public", + "country": "IN", + "_id": "5f3a8786c90d780037723a13", + "name": "Premium", + "description": "Premium", + "amount": 2499, + "product_suite_id": "5f3a8786c90d7800377239f3", + "created_at": "2020-08-17T13:35:02.547Z", + "modified_at": "2020-08-17T13:35:02.547Z" + }, + "name": "Premium", + "quantity": 1, + "description": "Premium", + "period": { + "start": "2020-08-17T13:45:36.722Z", + "end": "2020-10-05T07:45:29.755Z" + }, + "unit_amount": 3929.87, + "amount": 3929.87, + "type": "subscription", + "invoice_id": "5f7acb709e76da30e3b92cdb", + "created_at": "2020-10-05T07:45:29.765Z", + "modified_at": "2020-10-05T07:45:29.765Z" + }, + { + "_id": "5f7acf7da10a707fc502dcd4", + "currency": "INR", + "plan": { + "recurring": { + "interval": "month", + "interval_count": 1 + }, + "is_trial_plan": false, + "plan_group": "default", + "tag_lines": [], + "currency": "INR", + "is_active": true, + "is_visible": true, + "trial_period": 0, + "addons": [], + "tags": [], + "type": "public", + "country": "IN", + "_id": "5f3a8786c90d780037723a16", + "name": "Ultra Premium", + "description": "Ultra Premium", + "amount": 2999, + "product_suite_id": "5f3a8786c90d7800377239f3", + "created_at": "2020-08-17T13:35:02.802Z", + "modified_at": "2020-08-17T13:35:02.802Z" + }, + "name": "Ultra Premium", + "quantity": 1, + "description": "Ultra Premium", + "period": { + "start": "2020-08-17T13:45:36.722Z", + "end": "2020-10-05T07:47:09.532Z" + }, + "unit_amount": 4716.27, + "amount": 4716.27, + "type": "subscription", + "invoice_id": "5f7acb709e76da30e3b92cdb", + "created_at": "2020-10-05T07:47:09.541Z", + "modified_at": "2020-10-05T07:47:09.541Z" + }, + { + "_id": "5f7ad29bd56274f23321637a", + "currency": "INR", + "plan": { + "recurring": { + "interval": "month", + "interval_count": 1 + }, + "is_trial_plan": false, + "plan_group": "default", + "tag_lines": [], + "currency": "INR", + "is_active": true, + "is_visible": true, + "trial_period": 0, + "addons": [], + "tags": [], + "type": "public", + "country": "IN", + "_id": "5f3a8786c90d780037723a16", + "name": "Ultra Premium", + "description": "Ultra Premium", + "amount": 2999, + "product_suite_id": "5f3a8786c90d7800377239f3", + "created_at": "2020-08-17T13:35:02.802Z", + "modified_at": "2020-08-17T13:35:02.802Z" + }, + "name": "Ultra Premium", + "quantity": 1, + "description": "Ultra Premium", + "period": { + "start": "2020-08-17T13:45:36.722Z", + "end": "2020-10-05T08:00:27.753Z" + }, + "unit_amount": 4717.17, + "amount": 4717.17, + "type": "subscription", + "invoice_id": "5f7acb709e76da30e3b92cdb", + "created_at": "2020-10-05T08:00:27.768Z", + "modified_at": "2020-10-05T08:00:27.768Z" + } + ] + } + ], + "start": 0, + "end": 10, + "limit": 10, + "page": 1, + "total": 1 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getInvoiceById +Get invoice by id + + + + +```swift +client.billing.getInvoiceById(invoiceId: invoiceId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| invoiceId | String | yes | Invoice id | + + + +Get invoice by id. + +*Returned Response:* + + + + +[Invoice](#Invoice) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "invoice": { + "period": { + "start": "2020-08-17T13:45:36.722Z", + "end": "2020-09-17T13:45:36.722Z" + }, + "client": { + "address_lines": [ + "TV TOWER, Foot Over Bridge Khar", + null, + "Mumbai, 400079, Maharashtra, India" + ], + "name": "RELIANCE RETAIL LTD", + "email": "ZAK@GMAIL.COM", + "phone": "91 1234567890" + }, + "auto_advance": true, + "currency": "INR", + "paid": true, + "attemp": 3, + "_id": "5f7acb709e76da30e3b92cdb", + "collection_method": "charge_automatically", + "subscriber_id": "5ee773e1351e5e84289ed9cf", + "invoice_url": "", + "number": "FP-1-72020-736", + "pg_data": {}, + "receipt_number": "5fd9b08464dc6ac048a08988", + "statement_descriptor": "RELIANCE RETAIL LTD", + "current_status": "paid", + "status_trail": [ + { + "_id": "5f7ad29bd562744eab216379", + "value": "draft", + "timestamp": "2020-10-05T08:00:27.753Z" + }, + { + "_id": "5fcf40ce1613c029aff417dd", + "value": "open", + "timestamp": "2020-12-08T09:01:02.038Z" + }, + { + "_id": "5fd9b08664dc6a1ad0a08989", + "value": "paid", + "timestamp": "2020-12-16T07:00:22.973Z" + } + ], + "subtotal": 15720.08, + "total": 15720.08, + "subscription": "5f3a8a00668947663b7fbd38", + "next_action_time": "2020-10-05T09:00:27.754Z", + "created_at": "2020-10-05T07:29:52.876Z", + "modified_at": "2020-12-16T07:00:22.980Z", + "hash_identifier": "575999aca03e36f0fa54db5235bc7f25", + "payment_method": { + "pg_payment_method_id": null + } + }, + "invoice_items": [ + { + "_id": "5f7acb709e76da48b1b92cdd", + "currency": "INR", + "plan": { + "recurring": { + "interval": "month", + "interval_count": 1 + }, + "is_trial_plan": false, + "plan_group": "default", + "tag_lines": [], + "currency": "INR", + "is_active": true, + "is_visible": true, + "trial_period": 0, + "addons": [], + "tags": [], + "type": "public", + "country": "IN", + "_id": "5f3a8786c90d780037723a14", + "name": "Professional", + "description": "Professional", + "amount": 1499, + "product_suite_id": "5f3a8786c90d7800377239f3", + "created_at": "2020-08-17T13:35:02.802Z", + "modified_at": "2020-08-17T13:35:02.802Z" + }, + "name": "Professional", + "quantity": 1, + "description": "Professional", + "period": { + "start": "2020-08-17T13:45:36.722Z", + "end": "2020-10-05T07:29:52.868Z" + }, + "unit_amount": 2356.77, + "amount": 2356.77, + "type": "subscription", + "invoice_id": "5f7acb709e76da30e3b92cdb", + "created_at": "2020-10-05T07:29:52.886Z", + "modified_at": "2020-10-05T07:29:52.886Z" + }, + { + "_id": "5f7acf199aa6830c4fe5e984", + "currency": "INR", + "plan": { + "recurring": { + "interval": "month", + "interval_count": 1 + }, + "is_trial_plan": false, + "plan_group": "default", + "tag_lines": [], + "currency": "INR", + "is_active": true, + "is_visible": true, + "trial_period": 0, + "addons": [], + "tags": [ + "popular" + ], + "type": "public", + "country": "IN", + "_id": "5f3a8786c90d780037723a13", + "name": "Premium", + "description": "Premium", + "amount": 2499, + "product_suite_id": "5f3a8786c90d7800377239f3", + "created_at": "2020-08-17T13:35:02.547Z", + "modified_at": "2020-08-17T13:35:02.547Z" + }, + "name": "Premium", + "quantity": 1, + "description": "Premium", + "period": { + "start": "2020-08-17T13:45:36.722Z", + "end": "2020-10-05T07:45:29.755Z" + }, + "unit_amount": 3929.87, + "amount": 3929.87, + "type": "subscription", + "invoice_id": "5f7acb709e76da30e3b92cdb", + "created_at": "2020-10-05T07:45:29.765Z", + "modified_at": "2020-10-05T07:45:29.765Z" + }, + { + "_id": "5f7acf7da10a707fc502dcd4", + "currency": "INR", + "plan": { + "recurring": { + "interval": "month", + "interval_count": 1 + }, + "is_trial_plan": false, + "plan_group": "default", + "tag_lines": [], + "currency": "INR", + "is_active": true, + "is_visible": true, + "trial_period": 0, + "addons": [], + "tags": [], + "type": "public", + "country": "IN", + "_id": "5f3a8786c90d780037723a16", + "name": "Ultra Premium", + "description": "Ultra Premium", + "amount": 2999, + "product_suite_id": "5f3a8786c90d7800377239f3", + "created_at": "2020-08-17T13:35:02.802Z", + "modified_at": "2020-08-17T13:35:02.802Z" + }, + "name": "Ultra Premium", + "quantity": 1, + "description": "Ultra Premium", + "period": { + "start": "2020-08-17T13:45:36.722Z", + "end": "2020-10-05T07:47:09.532Z" + }, + "unit_amount": 4716.27, + "amount": 4716.27, + "type": "subscription", + "invoice_id": "5f7acb709e76da30e3b92cdb", + "created_at": "2020-10-05T07:47:09.541Z", + "modified_at": "2020-10-05T07:47:09.541Z" + }, + { + "_id": "5f7ad29bd56274f23321637a", + "currency": "INR", + "plan": { + "recurring": { + "interval": "month", + "interval_count": 1 + }, + "is_trial_plan": false, + "plan_group": "default", + "tag_lines": [], + "currency": "INR", + "is_active": true, + "is_visible": true, + "trial_period": 0, + "addons": [], + "tags": [], + "type": "public", + "country": "IN", + "_id": "5f3a8786c90d780037723a16", + "name": "Ultra Premium", + "description": "Ultra Premium", + "amount": 2999, + "product_suite_id": "5f3a8786c90d7800377239f3", + "created_at": "2020-08-17T13:35:02.802Z", + "modified_at": "2020-08-17T13:35:02.802Z" + }, + "name": "Ultra Premium", + "quantity": 1, + "description": "Ultra Premium", + "period": { + "start": "2020-08-17T13:45:36.722Z", + "end": "2020-10-05T08:00:27.753Z" + }, + "unit_amount": 4717.17, + "amount": 4717.17, + "type": "subscription", + "invoice_id": "5f7acb709e76da30e3b92cdb", + "created_at": "2020-10-05T08:00:27.768Z", + "modified_at": "2020-10-05T08:00:27.768Z" + } + ] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getCustomerDetail +Get subscription customer detail + + + + +```swift +client.billing.getCustomerDetail() { (response, error) in + // Use response +} +``` + + + + + + +Get subscription customer detail. + +*Returned Response:* + + + + +[SubscriptionCustomer](#SubscriptionCustomer) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "phone": { + "phone_number": "1234567890", + "phone_country_code": "91" + }, + "billing_address": { + "country": "India", + "state": "Maharastra", + "city": "Mumbai", + "line1": "test1", + "line2": "test2", + "postal_code": "400059" + }, + "_id": "5ee773e1351e5e84289ed9cf", + "unique_id": "1", + "type": "company", + "name": "test retail", + "email": "test@gmail.com", + "created_at": "2020-06-15T13:13:05.267Z", + "modified_at": "2021-02-04T00:58:45.356Z", + "data": { + "pg_user_exists": true, + "id": 2 + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### upsertCustomerDetail +Upsert subscription customer detail + + + + +```swift +client.billing.upsertCustomerDetail(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | SubscriptionCustomerCreate | yes | Request body | + + +Upsert subscription customer detail. + +*Returned Response:* + + + + +[SubscriptionCustomer](#SubscriptionCustomer) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "phone": { + "phone_number": "1234567890", + "phone_country_code": "91" + }, + "billing_address": { + "country": "India", + "state": "Maharastra", + "city": "Mumbai", + "line1": "test1", + "line2": "test2", + "postal_code": "400059" + }, + "_id": "5ee773e1351e5e84289ed9cf", + "unique_id": "1", + "type": "company", + "name": "test retail", + "email": "test@gmail.com", + "created_at": "2020-06-15T13:13:05.267Z", + "modified_at": "2021-02-04T00:58:45.356Z", + "data": { + "pg_user_exists": true, + "id": 2 + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getSubscription +Get current subscription detail + + + + +```swift +client.billing.getSubscription() { (response, error) in + // Use response +} +``` + + + + + + +If subscription is active then it will return is_enabled true and return subscription object. If subscription is not active then is_enabled false and message. + + +*Returned Response:* + + + + +[SubscriptionStatus](#SubscriptionStatus) + +Success + + + + +
    +  Examples: + + +
    +  Active subscription + +```json +{ + "value": { + "is_enabled": true, + "subscription": { + "current_period": { + "start": "2020-12-17T13:45:36.722Z", + "end": "2021-01-17T13:45:36.722Z" + }, + "pause_collection": {}, + "trial": {}, + "invoice_settings": { + "generation": true, + "charging": true + }, + "is_active": true, + "cancel_at_period_end": false, + "_id": "5f3a8a00668947663b7fbd38", + "subscriber_id": "5ee773e1351e5e84289ed9cf", + "plan_id": "5f3a8786c90d780037723a12", + "product_suite_id": "5f3a8786c90d7800377239f3", + "plan_data": { + "recurring": { + "interval": "month", + "interval_count": 1 + }, + "is_trial_plan": false, + "plan_group": "default", + "tag_lines": [], + "currency": "INR", + "is_active": true, + "is_visible": true, + "trial_period": 0, + "addons": [], + "tags": [], + "type": "public", + "country": "IN", + "_id": "5f3a8786c90d780037723a12", + "name": "Standard", + "description": "Standard", + "amount": 999, + "product_suite_id": "5f3a8786c90d7800377239f3", + "created_at": "2020-08-17T13:35:02.547Z", + "modified_at": "2020-08-17T13:35:02.547Z" + }, + "current_status": "active", + "collection_method": "charge_automatically", + "created_at": "2020-08-17T13:45:36.731Z", + "modified_at": "2020-12-17T11:01:15.960Z", + "latest_invoice": "5fdb3a7bfc849c2153b944d5" + } + } +} +``` +
    + +
    +  Inactive subscription + +```json +{ + "value": { + "is_enabled": true, + "message": "Subscription not enabled" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getFeatureLimitConfig +Get subscription subscription limits + + + + +```swift +client.billing.getFeatureLimitConfig() { (response, error) in + // Use response +} +``` + + + + + + +Get subscription subscription limits. + +*Returned Response:* + + + + +[SubscriptionLimit](#SubscriptionLimit) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "application": { + "enabled": true, + "hard_limit": 25, + "soft_limit": 25 + }, + "marketplace": { + "enabled": true + }, + "other_platform": { + "enabled": true + }, + "team": { + "limit": -1 + }, + "products": { + "bulk": true, + "limit": -1 + }, + "extensions": { + "enabled": true, + "limit": -1 + }, + "integrations": { + "enabled": true, + "limit": -1 + }, + "is_trial_plan": false + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### activateSubscriptionPlan +Activate subscription + + + + +```swift +client.billing.activateSubscriptionPlan(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | SubscriptionActivateReq | yes | Request body | + + +It will activate subscription plan for customer + +*Returned Response:* + + + + +[SubscriptionActivateRes](#SubscriptionActivateRes) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "success": true, + "data": { + "pause_collection": {}, + "trial": {}, + "invoice_settings": { + "generation": true, + "charging": true + }, + "is_active": true, + "cancel_at_period_end": false, + "_id": "601b8e4a32d3e837ec662f5c", + "subscriber_id": "5ef5f810961ddf004c1457ac", + "plan_id": "5f3a8786c90d780037723a12", + "product_suite_id": "5f3a8786c90d7800377239f3", + "plan_data": { + "recurring": { + "interval": "month", + "interval_count": 1 + }, + "is_trial_plan": false, + "plan_group": "default", + "tag_lines": [], + "currency": "INR", + "is_active": true, + "is_visible": true, + "trial_period": 0, + "addons": [], + "tags": [], + "type": "public", + "country": "IN", + "_id": "5f3a8786c90d780037723a12", + "name": "Standard", + "description": "Standard", + "amount": 999, + "product_suite_id": "5f3a8786c90d7800377239f3", + "created_at": "2020-08-17T13:35:02.547Z", + "modified_at": "2020-08-17T13:35:02.547Z" + }, + "current_period": { + "start": "2021-02-04T06:03:54.567Z", + "end": "2021-03-04T06:03:54.567Z" + }, + "current_status": "active", + "collection_method": "charge_automatically", + "created_at": "2021-02-04T06:03:54.580Z", + "modified_at": "2021-02-04T06:03:54.580Z" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### cancelSubscriptionPlan +Cancel subscription + + + + +```swift +client.billing.cancelSubscriptionPlan(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CancelSubscriptionReq | yes | Request body | + + +It will cancel current active subscription. + +*Returned Response:* + + + + +[CancelSubscriptionRes](#CancelSubscriptionRes) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "success": true, + "data": { + "current_period": { + "start": "2021-02-04T06:03:54.567Z", + "end": "2021-03-04T06:03:54.567Z" + }, + "pause_collection": {}, + "trial": {}, + "invoice_settings": { + "generation": true, + "charging": true + }, + "is_active": false, + "cancel_at_period_end": false, + "_id": "601b8e4a32d3e837ec662f5c", + "subscriber_id": "5ef5f810961ddf004c1457ac", + "plan_id": "5f3a8786c90d780037723a12", + "product_suite_id": "5f3a8786c90d7800377239f3", + "plan_data": { + "recurring": { + "interval": "month", + "interval_count": 1 + }, + "is_trial_plan": false, + "plan_group": "default", + "tag_lines": [], + "currency": "INR", + "is_active": true, + "is_visible": true, + "trial_period": 0, + "addons": [], + "tags": [], + "type": "public", + "country": "IN", + "_id": "5f3a8786c90d780037723a12", + "name": "Standard", + "description": "Standard", + "amount": 999, + "product_suite_id": "5f3a8786c90d7800377239f3", + "created_at": "2020-08-17T13:35:02.547Z", + "modified_at": "2020-08-17T13:35:02.547Z" + }, + "current_status": "canceled", + "collection_method": "charge_automatically", + "created_at": "2021-02-04T06:03:54.580Z", + "modified_at": "2021-02-04T08:52:25.806Z", + "cancel_at": "2021-02-04T08:52:25.802Z", + "canceled_at": "2021-02-04T08:52:25.802Z" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + | hasNext | Bool? | yes | | + | current | Int? | yes | | + | type | String | no | | + | size | Int? | yes | | + +--- + + + + + #### [UnauthenticatedUser](#UnauthenticatedUser) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | Failure message. | + +--- + + + + + #### [UnauthenticatedApplication](#UnauthenticatedApplication) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | Failure message. | + +--- + + + + + #### [BadRequest](#BadRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | Failure message. | + +--- + + + + + #### [ResourceNotFound](#ResourceNotFound) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | Resource not found with {id} | + +--- + + + + + #### [InternalServerError](#InternalServerError) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | Internal server Server error | + | code | String? | yes | Error code | + +--- + + + + + #### [CheckValidityResponse](#CheckValidityResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isValid | Bool? | yes | | + | discountAmount | Double? | yes | | + +--- + + + + + #### [PlanRecurring](#PlanRecurring) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | interval | String? | yes | | + | intervalCount | Double? | yes | | + +--- + + + + + #### [Plan](#Plan) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | recurring | [PlanRecurring](#PlanRecurring)? | yes | | + | isTrialPlan | Bool? | yes | | + | planGroup | String? | yes | | + | tagLines | [String]? | yes | | + | currency | String? | yes | | + | isActive | Bool? | yes | | + | isVisible | Bool? | yes | | + | trialPeriod | Double? | yes | | + | addons | [String]? | yes | | + | tags | [String]? | yes | | + | type | String? | yes | | + | country | String? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | description | String? | yes | | + | amount | Double? | yes | | + | productSuiteId | String? | yes | | + | createdAt | String? | yes | | + | modifiedAt | String? | yes | | + +--- + + + + + #### [DetailedPlanComponents](#DetailedPlanComponents) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | slug | String? | yes | | + | description | String? | yes | | + | group | String? | yes | | + | icon | String? | yes | | + | links | [String: Any]? | yes | | + | enabled | Bool? | yes | | + | displayText | String? | yes | | + +--- + + + + + #### [DetailedPlan](#DetailedPlan) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | recurring | [PlanRecurring](#PlanRecurring)? | yes | | + | isTrialPlan | Bool? | yes | | + | planGroup | String? | yes | | + | tagLines | [String]? | yes | | + | currency | String? | yes | | + | isActive | Bool? | yes | | + | isVisible | Bool? | yes | | + | trialPeriod | Double? | yes | | + | addons | [String]? | yes | | + | tags | [String]? | yes | | + | type | String? | yes | | + | country | String? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | description | String? | yes | | + | amount | Double? | yes | | + | productSuiteId | String? | yes | | + | createdAt | String? | yes | | + | modifiedAt | String? | yes | | + | components | [[DetailedPlanComponents](#DetailedPlanComponents)]? | yes | | + +--- + + + + + #### [SubscriptionTrialPeriod](#SubscriptionTrialPeriod) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | startDate | String? | yes | | + | endDate | String? | yes | | + +--- + + + + + #### [EntityChargePrice](#EntityChargePrice) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amount | Double | no | Amount for price. Minimum value 1 | + | currencyCode | String | no | | + +--- + + + + + #### [EntityChargeRecurring](#EntityChargeRecurring) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | interval | String | no | | + +--- + + + + + #### [ChargeLineItem](#ChargeLineItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String | no | | + | term | String | no | | + | pricingType | String | no | | + | price | [EntityChargePrice](#EntityChargePrice) | no | | + | recurring | [EntityChargeRecurring](#EntityChargeRecurring)? | yes | | + | cappedAmount | Double? | yes | | + | trialDays | Int? | yes | | + | isTest | Bool? | yes | | + | metadata | [String: Any]? | yes | | + +--- + + + + + #### [CreateSubscriptionCharge](#CreateSubscriptionCharge) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String | no | | + | trialDays | Int? | yes | | + | lineItems | [[ChargeLineItem](#ChargeLineItem)] | no | | + | isTest | Bool? | yes | | + | returnUrl | String | no | | + +--- + + + + + #### [CurrentPeriod](#CurrentPeriod) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | startDate | String? | yes | | + | endDate | String? | yes | | + +--- + + + + + #### [SubscriptionCharge](#SubscriptionCharge) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | name | String? | yes | | + | term | String? | yes | | + | pricingType | String? | yes | | + | price | [EntityChargePrice](#EntityChargePrice)? | yes | | + | recurring | [EntityChargeRecurring](#EntityChargeRecurring)? | yes | | + | cappedAmount | Double? | yes | | + | activatedOn | String? | yes | | + | cancelledOn | String? | yes | | + | billingDate | String? | yes | | + | currentPeriod | [CurrentPeriod](#CurrentPeriod)? | yes | | + | status | String? | yes | | + | isTest | Bool? | yes | | + | metadata | [String: Any]? | yes | | + +--- + + + + + #### [EntitySubscription](#EntitySubscription) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | name | String? | yes | | + | status | String? | yes | | + | companyId | Int? | yes | | + | activatedOn | String? | yes | | + | cancelledOn | String? | yes | | + | trialDays | Int? | yes | | + | trialPeriod | [SubscriptionTrialPeriod](#SubscriptionTrialPeriod)? | yes | | + | metadata | [String: Any]? | yes | | + | lineItems | [[SubscriptionCharge](#SubscriptionCharge)]? | yes | | + +--- + + + + + #### [CreateSubscriptionResponse](#CreateSubscriptionResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | subscription | [EntitySubscription](#EntitySubscription)? | yes | | + | confirmUrl | String? | yes | | + +--- + + + + + #### [InvoiceDetailsPeriod](#InvoiceDetailsPeriod) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | start | String? | yes | | + | end | String? | yes | | + +--- + + + + + #### [InvoiceDetailsClient](#InvoiceDetailsClient) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | addressLines | [String]? | yes | | + | name | String? | yes | | + | email | String? | yes | | + | phone | String? | yes | | + +--- + + + + + #### [InvoiceDetailsStatusTrail](#InvoiceDetailsStatusTrail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | value | String? | yes | | + | timestamp | String? | yes | | + +--- + + + + + #### [InvoiceDetailsPaymentMethodsDataChecks](#InvoiceDetailsPaymentMethodsDataChecks) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cvcCheck | String? | yes | | + | addressLine1Check | String? | yes | | + | addressPostalCodeCheck | String? | yes | | + +--- + + + + + #### [InvoiceDetailsPaymentMethodsDataNetworks](#InvoiceDetailsPaymentMethodsDataNetworks) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | available | [String]? | yes | | + | preferred | String? | yes | | + +--- + + + + + #### [InvoiceDetailsPaymentMethodsDataThreeDSecureUsage](#InvoiceDetailsPaymentMethodsDataThreeDSecureUsage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | supported | Bool? | yes | | + +--- + + + + + #### [InvoiceDetailsPaymentMethodsData](#InvoiceDetailsPaymentMethodsData) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | brand | String? | yes | | + | last4 | String? | yes | | + | checks | [InvoiceDetailsPaymentMethodsDataChecks](#InvoiceDetailsPaymentMethodsDataChecks)? | yes | | + | wallet | String? | yes | | + | country | String? | yes | | + | funding | String? | yes | | + | expYear | Int? | yes | | + | networks | [InvoiceDetailsPaymentMethodsDataNetworks](#InvoiceDetailsPaymentMethodsDataNetworks)? | yes | | + | expMonth | Int? | yes | | + | fingerprint | String? | yes | | + | generatedFrom | String? | yes | | + | threeDSecureUsage | [InvoiceDetailsPaymentMethodsDataThreeDSecureUsage](#InvoiceDetailsPaymentMethodsDataThreeDSecureUsage)? | yes | | + +--- + + + + + #### [InvoiceDetailsPaymentMethods](#InvoiceDetailsPaymentMethods) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | type | String? | yes | | + | pgPaymentMethodId | String? | yes | | + | data | [InvoiceDetailsPaymentMethodsData](#InvoiceDetailsPaymentMethodsData)? | yes | | + | isDefault | Bool? | yes | | + +--- + + + + + #### [InvoicePaymentMethod](#InvoicePaymentMethod) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pgPaymentMethodId | String? | yes | | + +--- + + + + + #### [InvoiceDetails](#InvoiceDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | period | [InvoiceDetailsPeriod](#InvoiceDetailsPeriod)? | yes | | + | client | [InvoiceDetailsClient](#InvoiceDetailsClient)? | yes | | + | autoAdvance | Bool? | yes | | + | currency | String? | yes | | + | paid | Bool? | yes | | + | attemp | Int? | yes | | + | id | String? | yes | | + | collectionMethod | String? | yes | | + | subscriberId | String? | yes | | + | invoiceUrl | String? | yes | | + | number | String? | yes | | + | pgData | [String: Any]? | yes | | + | receiptNumber | String? | yes | | + | statementDescriptor | String? | yes | | + | currentStatus | String? | yes | | + | statusTrail | [[InvoiceDetailsStatusTrail](#InvoiceDetailsStatusTrail)]? | yes | | + | subtotal | Double? | yes | | + | total | Double? | yes | | + | subscription | String? | yes | | + | nextActionTime | String? | yes | | + | createdAt | String? | yes | | + | modifiedAt | String? | yes | | + | hashIdentifier | String? | yes | | + | paymentMethod | [InvoicePaymentMethod](#InvoicePaymentMethod)? | yes | | + +--- + + + + + #### [InvoiceItemsPlanRecurring](#InvoiceItemsPlanRecurring) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | interval | String? | yes | | + | intervalCount | Int? | yes | | + +--- + + + + + #### [InvoiceItemsPlan](#InvoiceItemsPlan) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | recurring | [InvoiceItemsPlanRecurring](#InvoiceItemsPlanRecurring)? | yes | | + | isTrialPlan | Bool? | yes | | + | planGroup | String? | yes | | + | tagLines | [String]? | yes | | + | currency | String? | yes | | + | isActive | Bool? | yes | | + | isVisible | Bool? | yes | | + | trialPeriod | Int? | yes | | + | addons | [String]? | yes | | + | tags | [String]? | yes | | + | type | String? | yes | | + | country | String? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | description | String? | yes | | + | amount | Int? | yes | | + | productSuiteId | String? | yes | | + | createdAt | String? | yes | | + | modifiedAt | String? | yes | | + +--- + + + + + #### [InvoiceItemsPeriod](#InvoiceItemsPeriod) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | start | String? | yes | | + | end | String? | yes | | + +--- + + + + + #### [InvoiceItems](#InvoiceItems) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | currency | String? | yes | | + | plan | [InvoiceItemsPlan](#InvoiceItemsPlan)? | yes | | + | name | String? | yes | | + | quantity | Int? | yes | | + | description | String? | yes | | + | period | [InvoiceItemsPeriod](#InvoiceItemsPeriod)? | yes | | + | unitAmount | Double? | yes | | + | amount | Double? | yes | | + | type | String? | yes | | + | invoiceId | String? | yes | | + | createdAt | String? | yes | | + | modifiedAt | String? | yes | | + +--- + + + + + #### [Invoice](#Invoice) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | invoice | [InvoiceDetails](#InvoiceDetails)? | yes | | + | invoiceItems | [[InvoiceItems](#InvoiceItems)]? | yes | | + +--- + + + + + #### [InvoicesDataClient](#InvoicesDataClient) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | email | String? | yes | | + | phone | String? | yes | | + | addressLines | [String]? | yes | | + +--- + + + + + #### [InvoicesDataPeriod](#InvoicesDataPeriod) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | start | String? | yes | | + | end | String? | yes | | + +--- + + + + + #### [InvoicesDataPaymentMethod](#InvoicesDataPaymentMethod) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pgPaymentMethodId | String? | yes | | + +--- + + + + + #### [InvoicesData](#InvoicesData) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | client | [InvoicesDataClient](#InvoicesDataClient)? | yes | | + | autoAdvance | Bool? | yes | | + | currency | String? | yes | | + | paid | Bool? | yes | | + | attemp | Int? | yes | | + | collectionMethod | String? | yes | | + | subscriberId | String? | yes | | + | invoiceUrl | String? | yes | | + | number | String? | yes | | + | pgData | [String: Any]? | yes | | + | period | [InvoicesDataPeriod](#InvoicesDataPeriod)? | yes | | + | receiptNumber | String? | yes | | + | statementDescriptor | String? | yes | | + | currentStatus | String? | yes | | + | statusTrail | [[InvoiceDetailsStatusTrail](#InvoiceDetailsStatusTrail)]? | yes | | + | subtotal | Double? | yes | | + | total | Double? | yes | | + | subscription | String? | yes | | + | nextActionTime | String? | yes | | + | createdAt | String? | yes | | + | modifiedAt | String? | yes | | + | hashIdentifier | String? | yes | | + | paymentMethod | [InvoicesDataPaymentMethod](#InvoicesDataPaymentMethod)? | yes | | + | invoiceItems | [[InvoiceItems](#InvoiceItems)]? | yes | | + +--- + + + + + #### [Invoices](#Invoices) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [[InvoicesData](#InvoicesData)]? | yes | | + | start | Int? | yes | | + | end | Int? | yes | | + | limit | Int? | yes | | + | page | Int? | yes | | + | total | Int? | yes | | + +--- + + + + + #### [Phone](#Phone) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | phoneNumber | String? | yes | | + | phoneCountryCode | String? | yes | | + +--- + + + + + #### [SubscriptionBillingAddress](#SubscriptionBillingAddress) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | country | String? | yes | | + | state | String? | yes | | + | city | String? | yes | | + | line1 | String? | yes | | + | line2 | String? | yes | | + | postalCode | String? | yes | | + +--- + + + + + #### [SubscriptionCustomer](#SubscriptionCustomer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | phone | [Phone](#Phone)? | yes | | + | billingAddress | [SubscriptionBillingAddress](#SubscriptionBillingAddress)? | yes | | + | id | String? | yes | | + | uniqueId | String? | yes | | + | type | String? | yes | | + | name | String? | yes | | + | email | String? | yes | | + | createdAt | String? | yes | | + | modifiedAt | String? | yes | | + | data | [String: Any]? | yes | | + +--- + + + + + #### [SubscriptionCustomerCreate](#SubscriptionCustomerCreate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | phone | [Phone](#Phone)? | yes | | + | billingAddress | [SubscriptionBillingAddress](#SubscriptionBillingAddress)? | yes | | + | uniqueId | String? | yes | | + | type | String? | yes | | + | name | String? | yes | | + | email | String? | yes | | + +--- + + + + + #### [SubscriptionCurrentPeriod](#SubscriptionCurrentPeriod) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | start | String? | yes | | + | end | String? | yes | | + +--- + + + + + #### [SubscriptionPauseCollection](#SubscriptionPauseCollection) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | behavior | String? | yes | | + | resumeAt | String? | yes | | + +--- + + + + + #### [SubscriptionTrial](#SubscriptionTrial) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | start | String? | yes | | + | end | String? | yes | | + +--- + + + + + #### [SubscriptionInvoiceSettings](#SubscriptionInvoiceSettings) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | generation | Bool? | yes | | + | charging | Bool? | yes | | + +--- + + + + + #### [Subscription](#Subscription) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | currentPeriod | [SubscriptionCurrentPeriod](#SubscriptionCurrentPeriod)? | yes | | + | pauseCollection | [SubscriptionPauseCollection](#SubscriptionPauseCollection)? | yes | | + | trial | [SubscriptionTrial](#SubscriptionTrial)? | yes | | + | invoiceSettings | [SubscriptionInvoiceSettings](#SubscriptionInvoiceSettings)? | yes | | + | isActive | Bool? | yes | | + | cancelAtPeriodEnd | Bool? | yes | | + | id | String? | yes | | + | subscriberId | String? | yes | | + | planId | String? | yes | | + | productSuiteId | String? | yes | | + | planData | [Plan](#Plan)? | yes | | + | currentStatus | String? | yes | | + | collectionMethod | String? | yes | | + | createdAt | String? | yes | | + | modifiedAt | String? | yes | | + | latestInvoice | String? | yes | | + +--- + + + + + #### [SubscriptionStatus](#SubscriptionStatus) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isEnabled | Bool? | yes | | + | subscription | [Subscription](#Subscription)? | yes | | + +--- + + + + + #### [SubscriptionLimitApplication](#SubscriptionLimitApplication) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | hardLimit | Int? | yes | | + | softLimit | Int? | yes | | + +--- + + + + + #### [SubscriptionLimitMarketplace](#SubscriptionLimitMarketplace) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + +--- + + + + + #### [SubscriptionLimitOtherPlatform](#SubscriptionLimitOtherPlatform) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + +--- + + + + + #### [SubscriptionLimitTeam](#SubscriptionLimitTeam) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | limit | Int? | yes | | + +--- + + + + + #### [SubscriptionLimitProducts](#SubscriptionLimitProducts) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | bulk | Bool? | yes | | + | limit | Int? | yes | | + +--- + + + + + #### [SubscriptionLimitExtensions](#SubscriptionLimitExtensions) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | limit | Int? | yes | | + +--- + + + + + #### [SubscriptionLimitIntegrations](#SubscriptionLimitIntegrations) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | limit | Int? | yes | | + +--- + + + + + #### [SubscriptionLimit](#SubscriptionLimit) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | [SubscriptionLimitApplication](#SubscriptionLimitApplication)? | yes | | + | marketplace | [SubscriptionLimitMarketplace](#SubscriptionLimitMarketplace)? | yes | | + | otherPlatform | [SubscriptionLimitOtherPlatform](#SubscriptionLimitOtherPlatform)? | yes | | + | team | [SubscriptionLimitTeam](#SubscriptionLimitTeam)? | yes | | + | products | [SubscriptionLimitProducts](#SubscriptionLimitProducts)? | yes | | + | extensions | [SubscriptionLimitExtensions](#SubscriptionLimitExtensions)? | yes | | + | integrations | [SubscriptionLimitIntegrations](#SubscriptionLimitIntegrations)? | yes | | + | isTrialPlan | Bool? | yes | | + +--- + + + + + #### [SubscriptionActivateReq](#SubscriptionActivateReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uniqueId | String? | yes | | + | type | String? | yes | | + | productSuite | String? | yes | | + | planId | String? | yes | | + | paymentMethod | String? | yes | | + +--- + + + + + #### [SubscriptionActivateRes](#SubscriptionActivateRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | | + | data | [Subscription](#Subscription)? | yes | | + +--- + + + + + #### [CancelSubscriptionReq](#CancelSubscriptionReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uniqueId | String? | yes | | + | type | String? | yes | | + | productSuite | String? | yes | | + | subscriptionId | String? | yes | | + +--- + + + + + #### [CancelSubscriptionRes](#CancelSubscriptionRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | | + | data | [Subscription](#Subscription)? | yes | | + +--- + + + diff --git a/documentation/platform/CART.md b/documentation/platform/CART.md new file mode 100644 index 0000000000..18fae22454 --- /dev/null +++ b/documentation/platform/CART.md @@ -0,0 +1,2454 @@ + + + + +##### [Back to Platform docs](./README.md) + +## Cart Methods +Cart APIs +* [getCoupons](#getcoupons) +* [createCoupon](#createcoupon) +* [getCouponById](#getcouponbyid) +* [updateCoupon](#updatecoupon) +* [updateCouponPartially](#updatecouponpartially) +* [fetchAndvalidateCartItems](#fetchandvalidatecartitems) +* [checkCartServiceability](#checkcartserviceability) +* [checkoutCart](#checkoutcart) + + + +## Methods with example and description + + +#### getCoupons +Get with single coupon details or coupon list + + + + +```swift +client.application("").cart.getCoupons(pageNo: pageNo, pageSize: pageSize, isArchived: isArchived, title: title, isPublic: isPublic, isDisplay: isDisplay, typeSlug: typeSlug, code: code) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | | +| pageSize | Int? | no | | +| isArchived | Bool? | no | | +| title | String? | no | | +| isPublic | Bool? | no | | +| isDisplay | Bool? | no | | +| typeSlug | String? | no | | +| code | String? | no | | + + + +Get coupon list with pagination + +*Returned Response:* + + + + +[CouponsResponse](#CouponsResponse) + +Coupon List for sent page_size and page_no + + + + +
    +  Examples: + + +
    +  Coupon list for sent filter and page size + +```json +{ + "value": { + "items": [ + { + "_id": "5e1d9bec6d6b7e000146c840", + "display_meta": { + "title": "percent50 title" + }, + "_schedule": { + "next_schedule": [ + { + "start": "2020-01-14T10:45:03.600000+00:00", + "end": "2020-01-16T10:45:03+00:00" + } + ], + "duration": null, + "start": "2020-01-14T10:45:03.600000+00:00", + "end": "2020-01-16T10:45:03+00:00", + "cron": "" + }, + "state": { + "is_public": true, + "is_display": true, + "is_archived": false + }, + "ownership": { + "payable_category": "seller", + "payable_by": "" + }, + "code": "percent50", + "rule_definition": { + "type": "percentage", + "scope": [ + "category_id" + ], + "applicable_on": "quantity" + } + } + ], + "page": { + "has_next": true, + "size": 10, + "current": 1, + "item_total": 30 + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createCoupon +Create new coupon + + + + +```swift +client.application("").cart.createCoupon(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CouponAdd | yes | Request body | + + +Create new coupon + +*Returned Response:* + + + + +[SuccessMessage](#SuccessMessage) + +Coupon Created successfully + + + + +
    +  Example: + +```json +{ + "success": true, + "message": "Coupon Created" +} +``` +
    + + + + + + + + + +--- + + +#### getCouponById +Get with single coupon details or coupon list + + + + +```swift +client.application("").cart.getCouponById(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | | + + + +Get single coupon details with `id` in path param + +*Returned Response:* + + + + +[CouponUpdate](#CouponUpdate) + +Coupon object for sent `id` + + + + +
    +  Example: + +```json +{ + "_id": "5e1d9bec6d6b7e000146c840", + "validation": { + "anonymous": true, + "app_id": [ + "5cd3db5e9d692cfe5302a7ba" + ], + "user_registered_after": null + }, + "rule": [ + { + "key": 1, + "max": 1500, + "min": 3000, + "value": 50 + } + ], + "display_meta": { + "title": "percent50 title", + "description": "percent50 description", + "auto": { + "title": "", + "subtitle": "" + }, + "subtitle": "percent50 subtitle", + "remove": { + "title": "", + "subtitle": "" + }, + "apply": { + "title": "percen50 mt", + "subtitle": "percen50 ms" + } + }, + "date_meta": { + "modified_on": "2020-02-04T14:27:00.577000+00:00", + "created_on": "2020-01-14T10:46:04.474000+00:00" + }, + "action": { + "action_date": null, + "txn_mode": "coupon" + }, + "identifiers": { + "category_id": [ + 465, + 192, + 133, + 134, + 150, + 151, + 155, + 193, + 157, + 191, + 154, + 152, + 417, + 168, + 416, + 167, + 166, + 162, + 161, + 163, + 165, + 160 + ], + "user_id": [], + "store_id": [], + "company_id": [] + }, + "author": { + "modified_by": "23109086", + "created_by": "23206328" + }, + "_schedule": { + "next_schedule": [ + { + "start": "2020-01-14T10:45:03.600000+00:00", + "end": "2020-01-16T10:45:03+00:00" + } + ], + "duration": null, + "start": "2020-01-14T10:45:03.600000+00:00", + "end": "2020-01-16T10:45:03+00:00", + "cron": "" + }, + "state": { + "is_public": true, + "is_display": true, + "is_archived": false + }, + "ownership": { + "payable_category": "seller", + "payable_by": "" + }, + "validity": { + "priority": 0 + }, + "code": "percent50", + "rule_definition": { + "calculate_on": "esp", + "value_type": "percentage", + "is_exact": false, + "type": "percentage", + "scope": [ + "category_id" + ], + "auto_apply": false, + "applicable_on": "quantity", + "currency_code": "INR" + }, + "restrictions": { + "price_range": { + "max": -1, + "min": -1 + }, + "uses": { + "remaining": { + "app": -1, + "user": -1, + "total": -1 + }, + "maximum": { + "app": -1, + "user": -1, + "total": -1 + } + }, + "post_order": { + "cancellation_allowed": true, + "return_allowed": true + }, + "platforms": [ + "web", + "android", + "ios" + ] + }, + "type_slug": "percentage_quantity_percentage" +} +``` +
    + + + + + + + + + +--- + + +#### updateCoupon +Update existing coupon configuration + + + + +```swift +client.application("").cart.updateCoupon(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | | +| body | CouponUpdate | yes | Request body | + + +Update coupon with id sent in `id` + +*Returned Response:* + + + + +[SuccessMessage](#SuccessMessage) + +Coupon updated successfully + + + + +
    +  Example: + +```json +{ + "success": true, + "message": "Coupon Updated" +} +``` +
    + + + + + + + + + +--- + + +#### updateCouponPartially +Update coupon archive state and schedule + + + + +```swift +client.application("").cart.updateCouponPartially(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | | +| body | CouponPartialUpdate | yes | Request body | + + +Update archive/unarchive and change schedule for coupon + +*Returned Response:* + + + + +[SuccessMessage](#SuccessMessage) + +Coupon updated successfully + + + + +
    +  Examples: + + +
    +  Archive or Unarchive coupon + +```json +{ + "value": { + "success": true, + "message": "Coupon Updated" + } +} +``` +
    + +
    +  Coupon schedule updated successfully + +```json +{ + "value": { + "success": true, + "message": "Coupon schedule updated" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### fetchAndvalidateCartItems +Fetch Cart Details + + + + +```swift +client.application("").cart.fetchAndvalidateCartItems(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | OpenapiCartDetailsRequest | yes | Request body | + + +Get all the details of cart for a list of provided `cart_items` + +*Returned Response:* + + + + +[OpenapiCartDetailsResponse](#OpenapiCartDetailsResponse) + +Cart details with breakup + + + + +
    +  Example: + +```json +{ + "items": [ + { + "quantity": 1, + "message": "", + "coupon_message": "", + "product": { + "type": "product", + "uid": 803140, + "name": "Green Solid T-Shirt", + "slug": "celio-green-solid-t-shirt-803140-dd9e2c", + "brand": { + "uid": 44, + "name": "celio" + }, + "categories": [ + { + "uid": 192, + "name": "T-Shirts" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/44_NEMIEL@GREENBRITISH/1_1548161273344.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/44_NEMIEL@GREENBRITISH/1_1548161273344.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/celio-green-solid-t-shirt-803140-dd9e2c/", + "query": { + "product_slug": [ + "celio-green-solid-t-shirt-803140-dd9e2c" + ] + } + } + }, + "article": { + "type": "article", + "uid": "25_44_A7050_NEMIEL@GREENBRITISH_S", + "size": "S", + "seller": { + "uid": 25, + "name": "CELIO FUTURE FASHION PRIVATE LIMITED" + }, + "store": { + "uid": 1486, + "name": "Forum Mall" + }, + "quantity": 1, + "price": { + "base": { + "marked": 1299, + "effective": 649.5, + "currency_code": "INR" + }, + "converted": { + "marked": 1299, + "effective": 649.5, + "currency_code": "INR" + } + } + }, + "key": "803140_S", + "discount": "50% OFF", + "price": { + "base": { + "add_on": 0, + "marked": 1299, + "effective": 649.5, + "selling": 649.5, + "currency_code": "INR" + }, + "converted": { + "add_on": 0, + "marked": 1299, + "effective": 649.5, + "selling": 649.5, + "currency_code": "INR" + } + }, + "availability": { + "sizes": [ + "L", + "XL", + "M", + "S" + ], + "other_store_quantity": 0, + "out_of_stock": false, + "deliverable": true, + "is_valid": true, + "available_sizes": [ + { + "is_available": true, + "display": "L", + "value": "L" + }, + { + "is_available": true, + "display": "XXL", + "value": "XXL" + }, + { + "is_available": true, + "display": "XL", + "value": "XL" + }, + { + "is_available": true, + "display": "M", + "value": "M" + }, + { + "is_available": true, + "display": "S", + "value": "S" + }, + { + "is_available": false, + "display": "30", + "value": "30" + } + ] + }, + "bulk_offer": {} + }, + { + "quantity": 1, + "message": "Out of stock. Please remove item", + "coupon_message": "", + "product": { + "type": "product", + "uid": 803140, + "name": "Green Solid T-Shirt", + "slug": "celio-green-solid-t-shirt-803140-dd9e2c", + "brand": { + "uid": 44, + "name": "celio" + }, + "categories": [ + { + "uid": 192, + "name": "T-Shirts" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/44_NEMIEL@GREENBRITISH/1_1548161273344.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/44_NEMIEL@GREENBRITISH/1_1548161273344.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/celio-green-solid-t-shirt-803140-dd9e2c/", + "query": { + "product_slug": [ + "celio-green-solid-t-shirt-803140-dd9e2c" + ] + } + } + }, + "article": {}, + "key": "803140_S", + "discount": "", + "price": { + "base": { + "add_on": 0, + "marked": 1299, + "effective": 1299, + "selling": 1299, + "currency_code": "INR" + }, + "converted": { + "add_on": 0, + "marked": 1299, + "effective": 1299, + "selling": 1299, + "currency_code": "INR" + } + }, + "availability": { + "sizes": [ + "L", + "XXL", + "XL", + "M", + "S" + ], + "other_store_quantity": 0, + "out_of_stock": true, + "deliverable": false, + "is_valid": false, + "available_sizes": [ + { + "is_available": true, + "display": "L", + "value": "L" + }, + { + "is_available": true, + "display": "XXL", + "value": "XXL" + }, + { + "is_available": true, + "display": "XL", + "value": "XL" + }, + { + "is_available": true, + "display": "M", + "value": "M" + }, + { + "is_available": true, + "display": "S", + "value": "S" + }, + { + "is_available": false, + "display": "30", + "value": "30" + } + ] + }, + "bulk_offer": {} + } + ], + "is_valid": false, + "breakup_values": { + "display": [ + { + "display": "MRP Total", + "key": "mrp_total", + "value": 2598, + "currency_code": "INR" + }, + { + "display": "Discount", + "key": "discount", + "value": -649, + "currency_code": "INR" + }, + { + "display": "Subtotal", + "key": "subtotal", + "value": 1949, + "currency_code": "INR" + }, + { + "display": "Total", + "key": "total", + "value": 1949, + "currency_code": "INR" + } + ], + "raw": { + "cod_charge": 0, + "convenience_fee": 0, + "coupon": 0, + "delivery_charge": 0, + "discount": -649.5, + "fynd_cash": 0, + "gst_charges": 170.11, + "mrp_total": 2598, + "subtotal": 1948.5, + "total": 1948.5, + "vog": 1778.39, + "you_saved": 0 + } + } +} +``` +
    + + + + + + + + + +--- + + +#### checkCartServiceability +Check Pincode Serviceability + + + + +```swift +client.application("").cart.checkCartServiceability(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | OpenApiCartServiceabilityRequest | yes | Request body | + + +Check Pincode serviceability for cart items provided in `cart_items` and address pincode in `shipping_address` + +*Returned Response:* + + + + +[OpenApiCartServiceabilityResponse](#OpenApiCartServiceabilityResponse) + +Cart details with pincode validity information at item level + + + + +
    +  Examples: + + +
    +  Valid pincode + +```json +{ + "value": { + "items": [ + { + "quantity": 1, + "message": "", + "coupon_message": "", + "product": { + "type": "product", + "uid": 803140, + "name": "Green Solid T-Shirt", + "slug": "celio-green-solid-t-shirt-803140-dd9e2c", + "brand": { + "uid": 44, + "name": "celio" + }, + "categories": [ + { + "uid": 192, + "name": "T-Shirts" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/44_NEMIEL@GREENBRITISH/1_1548161273344.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/44_NEMIEL@GREENBRITISH/1_1548161273344.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/celio-green-solid-t-shirt-803140-dd9e2c/", + "query": { + "product_slug": [ + "celio-green-solid-t-shirt-803140-dd9e2c" + ] + } + } + }, + "article": { + "type": "article", + "uid": "25_44_A7050_NEMIEL@GREENBRITISH_S", + "size": "S", + "seller": { + "uid": 25, + "name": "CELIO FUTURE FASHION PRIVATE LIMITED" + }, + "store": { + "uid": 1486, + "name": "Forum Mall" + }, + "quantity": 1, + "price": { + "base": { + "marked": 1299, + "effective": 649.5, + "currency_code": "INR" + }, + "converted": { + "marked": 1299, + "effective": 649.5, + "currency_code": "INR" + } + } + }, + "key": "803140_S", + "discount": "50% OFF", + "price": { + "base": { + "add_on": 0, + "marked": 1299, + "effective": 649.5, + "selling": 649.5, + "currency_code": "INR" + }, + "converted": { + "add_on": 0, + "marked": 1299, + "effective": 649.5, + "selling": 649.5, + "currency_code": "INR" + } + }, + "availability": { + "sizes": [ + "L", + "XL", + "M", + "S" + ], + "other_store_quantity": 0, + "out_of_stock": false, + "deliverable": true, + "is_valid": true, + "delivery_promise": { + "timestamp": { + "min": 1605306343, + "max": 1605468343 + }, + "formatted": { + "min": "Sat, 14 Nov", + "max": "Mon, 16 Nov" + } + }, + "available_sizes": [ + { + "is_available": true, + "display": "L", + "value": "L" + }, + { + "is_available": true, + "display": "XXL", + "value": "XXL" + }, + { + "is_available": true, + "display": "XL", + "value": "XL" + }, + { + "is_available": true, + "display": "M", + "value": "M" + }, + { + "is_available": true, + "display": "S", + "value": "S" + }, + { + "is_available": false, + "display": "30", + "value": "30" + } + ] + }, + "bulk_offer": {} + }, + { + "quantity": 1, + "message": "Out of stock. Please remove item", + "coupon_message": "", + "product": { + "type": "product", + "uid": 803140, + "name": "Green Solid T-Shirt", + "slug": "celio-green-solid-t-shirt-803140-dd9e2c", + "brand": { + "uid": 44, + "name": "celio" + }, + "categories": [ + { + "uid": 192, + "name": "T-Shirts" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/44_NEMIEL@GREENBRITISH/1_1548161273344.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/44_NEMIEL@GREENBRITISH/1_1548161273344.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/celio-green-solid-t-shirt-803140-dd9e2c/", + "query": { + "product_slug": [ + "celio-green-solid-t-shirt-803140-dd9e2c" + ] + } + } + }, + "article": {}, + "key": "803140_S", + "discount": "", + "price": { + "base": { + "add_on": 0, + "marked": 1299, + "effective": 1299, + "selling": 1299, + "currency_code": "INR" + }, + "converted": { + "add_on": 0, + "marked": 1299, + "effective": 1299, + "selling": 1299, + "currency_code": "INR" + } + }, + "availability": { + "sizes": [ + "L", + "XXL", + "XL", + "M", + "S" + ], + "other_store_quantity": 0, + "out_of_stock": true, + "deliverable": false, + "is_valid": false, + "delivery_promise": { + "timestamp": { + "min": 1605306343, + "max": 1605468343 + }, + "formatted": { + "min": "Sat, 14 Nov", + "max": "Mon, 16 Nov" + } + }, + "available_sizes": [ + { + "is_available": true, + "display": "L", + "value": "L" + }, + { + "is_available": true, + "display": "XXL", + "value": "XXL" + }, + { + "is_available": true, + "display": "XL", + "value": "XL" + }, + { + "is_available": true, + "display": "M", + "value": "M" + }, + { + "is_available": true, + "display": "S", + "value": "S" + }, + { + "is_available": false, + "display": "30", + "value": "30" + } + ] + }, + "bulk_offer": {} + } + ], + "delivery_promise": { + "timestamp": { + "min": 1605306343, + "max": 1605468343 + }, + "formatted": { + "min": "Sat, 14 Nov", + "max": "Mon, 16 Nov" + } + }, + "is_valid": true + } +} +``` +
    + +
    +  Invalid pincode + +```json +{ + "value": { + "message": "All of the items in your cart are not deliverable to 800108", + "is_valid": false, + "items": [ + { + "discount": "15% OFF", + "price": { + "base": { + "add_on": 0, + "marked": 2195, + "effective": 1866, + "selling": 1866, + "currency_code": "INR" + }, + "converted": { + "add_on": 0, + "marked": 2195, + "effective": 1866, + "selling": 1866, + "currency_code": "INR" + } + }, + "product": { + "type": "product", + "uid": 876245, + "name": "Brown Sandals", + "slug": "red-chief-brown-sandals-876245-c92507", + "brand": { + "uid": 433, + "name": "" + }, + "categories": [ + { + "uid": 176, + "name": "" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/433_RC330004/1_1564147181287.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/433_RC330004/1_1564147181287.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/red-chief-brown-sandals-876245-c92507/", + "query": { + "product_slug": [ + "red-chief-brown-sandals-876245-c92507" + ] + } + }, + "item_code": "RC330004" + }, + "bulk_offer": {}, + "key": "876245_6", + "message": "We are not delivering to 800108", + "delivery_promise": null, + "coupon_message": "", + "availability": { + "sizes": [ + "7", + "6", + "10", + "8" + ], + "other_store_quantity": 21, + "out_of_stock": false, + "deliverable": false, + "is_valid": true, + "available_sizes": [ + { + "is_available": false, + "display": "9", + "value": "9" + }, + { + "is_available": true, + "display": "10", + "value": "10" + }, + { + "is_available": true, + "display": "6", + "value": "6" + }, + { + "is_available": true, + "display": "7", + "value": "7" + }, + { + "is_available": true, + "display": "8", + "value": "8" + } + ] + }, + "quantity": 1, + "article": { + "type": "article", + "uid": "304_433_LGPL30402_RC330004_6", + "size": "6", + "seller": { + "uid": 304, + "name": "LEAYAN GLOBAL PVT. LTD." + }, + "store": { + "uid": 9767, + "name": "Udyog Kunj, Kanpur" + }, + "quantity": 3, + "price": { + "base": { + "marked": 2195, + "effective": 1866, + "currency_code": "INR" + }, + "converted": { + "marked": 2195, + "effective": 1866, + "currency_code": "INR" + } + } + } + }, + { + "discount": "15% OFF", + "price": { + "base": { + "add_on": 0, + "marked": 2195, + "effective": 1866, + "selling": 1866, + "currency_code": "INR" + }, + "converted": { + "add_on": 0, + "marked": 2195, + "effective": 1866, + "selling": 1866, + "currency_code": "INR" + } + }, + "product": { + "type": "product", + "uid": 876245, + "name": "Brown Sandals", + "slug": "red-chief-brown-sandals-876245-c92507", + "brand": { + "uid": 433, + "name": "" + }, + "categories": [ + { + "uid": 176, + "name": "" + } + ], + "images": [ + { + "aspect_ratio": "16:25", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/433_RC330004/1_1564147181287.jpg", + "secure_url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/original/433_RC330004/1_1564147181287.jpg" + } + ], + "action": { + "type": "product", + "url": "https://api.addsale.com/platform/content/v1/products/red-chief-brown-sandals-876245-c92507/", + "query": { + "product_slug": [ + "red-chief-brown-sandals-876245-c92507" + ] + } + }, + "item_code": "RC330004" + }, + "bulk_offer": {}, + "key": "876245_6", + "message": "We are not delivering to 800108", + "coupon_message": "", + "availability": { + "sizes": [ + "7", + "6", + "10", + "8" + ], + "other_store_quantity": 21, + "out_of_stock": false, + "deliverable": false, + "is_valid": true, + "available_sizes": [ + { + "is_available": false, + "display": "9", + "value": "9" + }, + { + "is_available": true, + "display": "10", + "value": "10" + }, + { + "is_available": true, + "display": "6", + "value": "6" + }, + { + "is_available": true, + "display": "7", + "value": "7" + }, + { + "is_available": true, + "display": "8", + "value": "8" + } + ] + }, + "quantity": 1, + "article": { + "type": "article", + "uid": "304_433_LGPL30402_RC330004_6", + "size": "6", + "seller": { + "uid": 304, + "name": "LEAYAN GLOBAL PVT. LTD." + }, + "store": { + "uid": 9767, + "name": "Udyog Kunj, Kanpur" + }, + "quantity": 3, + "price": { + "base": { + "marked": 2195, + "effective": 1866, + "currency_code": "INR" + }, + "converted": { + "marked": 2195, + "effective": 1866, + "currency_code": "INR" + } + } + } + } + ] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### checkoutCart +Create Fynd order with cart details + + + + +```swift +client.application("").cart.checkoutCart(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | OpenApiPlatformCheckoutReq | yes | Request body | + + +Generate Fynd order for cart details send with provided `cart_items` + +*Returned Response:* + + + + +[OpenApiCheckoutResponse](#OpenApiCheckoutResponse) + +Checkout cart and create Fynd order id + + + + +
    +  Example: + +```json +{ + "success": true, + "order_id": "FY5E182A9D0A5E405446", + "message": "Order initiation completed", + "order_ref_id": null +} +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [CouponSchedule](#CouponSchedule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | nextSchedule | [[String: Any]]? | yes | | + | start | String? | yes | | + | cron | String? | yes | | + | duration | Int? | yes | | + | end | String? | yes | | + +--- + + + + + #### [Identifier](#Identifier) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | brandId | [Int]? | yes | | + | companyId | [Int]? | yes | | + | categoryId | [Int]? | yes | | + | articleId | [String]? | yes | | + | collectionId | [String]? | yes | | + | storeId | [Int]? | yes | | + | itemId | [Int]? | yes | | + | userId | [String]? | yes | | + +--- + + + + + #### [Validity](#Validity) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | priority | Int? | yes | | + +--- + + + + + #### [Validation](#Validation) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appId | [String]? | yes | | + | anonymous | Bool? | yes | | + | userRegisteredAfter | String? | yes | | + +--- + + + + + #### [RuleDefinition](#RuleDefinition) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | applicableOn | String | no | | + | currencyCode | String? | yes | | + | isExact | Bool? | yes | | + | autoApply | Bool? | yes | | + | valueType | String | no | | + | calculateOn | String | no | | + | type | String | no | | + | scope | [String]? | yes | | + +--- + + + + + #### [CouponDateMeta](#CouponDateMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | modifiedOn | String? | yes | | + | createdOn | String? | yes | | + +--- + + + + + #### [DisplayMetaDict](#DisplayMetaDict) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | subtitle | String? | yes | | + +--- + + + + + #### [DisplayMeta](#DisplayMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String? | yes | | + | apply | [DisplayMetaDict](#DisplayMetaDict)? | yes | | + | auto | [DisplayMetaDict](#DisplayMetaDict)? | yes | | + | title | String? | yes | | + | remove | [DisplayMetaDict](#DisplayMetaDict)? | yes | | + | subtitle | String? | yes | | + +--- + + + + + #### [PaymentAllowValue](#PaymentAllowValue) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | max | Int? | yes | | + +--- + + + + + #### [PaymentModes](#PaymentModes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uses | [PaymentAllowValue](#PaymentAllowValue)? | yes | | + | codes | [String]? | yes | | + | types | [String]? | yes | | + | networks | [String]? | yes | | + +--- + + + + + #### [PostOrder](#PostOrder) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cancellationAllowed | Bool? | yes | | + | returnAllowed | Bool? | yes | | + +--- + + + + + #### [BulkBundleRestriction](#BulkBundleRestriction) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | multiStoreAllowed | Bool | no | | + +--- + + + + + #### [PriceRange](#PriceRange) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | min | Int? | yes | | + | max | Int? | yes | | + +--- + + + + + #### [UsesRemaining](#UsesRemaining) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | app | Int? | yes | | + | total | Int? | yes | | + | user | Int? | yes | | + +--- + + + + + #### [UsesRestriction](#UsesRestriction) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | maximum | [UsesRemaining](#UsesRemaining)? | yes | | + | remaining | [UsesRemaining](#UsesRemaining)? | yes | | + +--- + + + + + #### [Restrictions](#Restrictions) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | couponAllowed | Bool? | yes | | + | payments | [String: [PaymentModes](#PaymentModes)]? | yes | | + | platforms | [String]? | yes | | + | postOrder | [PostOrder](#PostOrder)? | yes | | + | bulkBundle | [BulkBundleRestriction](#BulkBundleRestriction)? | yes | | + | priceRange | [PriceRange](#PriceRange)? | yes | | + | uses | [UsesRestriction](#UsesRestriction)? | yes | | + | orderingStores | [Int]? | yes | | + +--- + + + + + #### [State](#State) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isPublic | Bool? | yes | | + | isDisplay | Bool? | yes | | + | isArchived | Bool? | yes | | + +--- + + + + + #### [Ownership](#Ownership) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | payableBy | String | no | | + | payableCategory | String | no | | + +--- + + + + + #### [CouponAuthor](#CouponAuthor) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | createdBy | String? | yes | | + | modifiedBy | String? | yes | | + +--- + + + + + #### [CouponAction](#CouponAction) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | actionDate | String? | yes | | + | txnMode | String? | yes | | + +--- + + + + + #### [Rule](#Rule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | Double? | yes | | + | max | Double? | yes | | + | min | Double? | yes | | + | discountQty | Double? | yes | | + | value | Double? | yes | | + +--- + + + + + #### [CouponAdd](#CouponAdd) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | schedule | [CouponSchedule](#CouponSchedule)? | yes | | + | identifiers | [Identifier](#Identifier) | no | | + | validity | [Validity](#Validity) | no | | + | tags | [String]? | yes | | + | validation | [Validation](#Validation)? | yes | | + | ruleDefinition | [RuleDefinition](#RuleDefinition) | no | | + | dateMeta | [CouponDateMeta](#CouponDateMeta)? | yes | | + | displayMeta | [DisplayMeta](#DisplayMeta) | no | | + | restrictions | [Restrictions](#Restrictions)? | yes | | + | state | [State](#State)? | yes | | + | ownership | [Ownership](#Ownership) | no | | + | author | [CouponAuthor](#CouponAuthor)? | yes | | + | action | [CouponAction](#CouponAction)? | yes | | + | typeSlug | String | no | | + | rule | [[Rule](#Rule)] | no | | + | code | String | no | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | size | Int? | yes | Current request page size | + | current | Int? | yes | Current page no | + | nextId | String? | yes | Cursor id for next set of records. | + | itemTotal | Int? | yes | Total coupon count in system | + | type | String | no | | + | hasPrevious | Bool? | yes | True if more records are present for previous pages. Sent for cursor pagination | + | hasNext | Bool? | yes | True if more records are present for next pages | + +--- + + + + + #### [CouponsResponse](#CouponsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [CouponAdd](#CouponAdd)? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [SuccessMessage](#SuccessMessage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + | success | Bool? | yes | | + +--- + + + + + #### [OperationErrorResponse](#OperationErrorResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + | success | Bool? | yes | | + +--- + + + + + #### [CouponUpdate](#CouponUpdate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | schedule | [CouponSchedule](#CouponSchedule)? | yes | | + | identifiers | [Identifier](#Identifier) | no | | + | validity | [Validity](#Validity) | no | | + | tags | [String]? | yes | | + | validation | [Validation](#Validation)? | yes | | + | ruleDefinition | [RuleDefinition](#RuleDefinition) | no | | + | dateMeta | [CouponDateMeta](#CouponDateMeta)? | yes | | + | displayMeta | [DisplayMeta](#DisplayMeta) | no | | + | restrictions | [Restrictions](#Restrictions)? | yes | | + | state | [State](#State)? | yes | | + | ownership | [Ownership](#Ownership) | no | | + | author | [CouponAuthor](#CouponAuthor)? | yes | | + | action | [CouponAction](#CouponAction)? | yes | | + | typeSlug | String | no | | + | rule | [[Rule](#Rule)] | no | | + | code | String | no | | + +--- + + + + + #### [CouponPartialUpdate](#CouponPartialUpdate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | schedule | [CouponSchedule](#CouponSchedule)? | yes | | + | archive | Bool? | yes | Send true to unpublish coupon | + +--- + + + + + #### [CartItem](#CartItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | quantity | Int? | yes | | + | size | String | no | | + | productId | String | no | | + +--- + + + + + #### [OpenapiCartDetailsRequest](#OpenapiCartDetailsRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cartItems | [CartItem](#CartItem)? | yes | | + +--- + + + + + #### [CouponBreakup](#CouponBreakup) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | String? | yes | | + | message | String? | yes | | + | type | String? | yes | | + | isApplied | Bool? | yes | | + | value | Double? | yes | | + | code | String? | yes | | + +--- + + + + + #### [DisplayBreakup](#DisplayBreakup) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | currencyCode | String? | yes | | + | message | [String]? | yes | | + | currencySymbol | String? | yes | | + | value | Double? | yes | | + | display | String? | yes | | + +--- + + + + + #### [LoyaltyPoints](#LoyaltyPoints) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isApplied | Bool? | yes | | + | total | Double? | yes | | + | description | String? | yes | | + | applicable | Double? | yes | | + +--- + + + + + #### [RawBreakup](#RawBreakup) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | fyndCash | Double? | yes | | + | subtotal | Double? | yes | | + | total | Double? | yes | | + | codCharge | Double? | yes | | + | vog | Double? | yes | | + | discount | Double? | yes | | + | deliveryCharge | Double? | yes | | + | youSaved | Double? | yes | | + | mrpTotal | Double? | yes | | + | convenienceFee | Double? | yes | | + | coupon | Double? | yes | | + | gstCharges | Double? | yes | | + +--- + + + + + #### [CartBreakup](#CartBreakup) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | coupon | [CouponBreakup](#CouponBreakup)? | yes | | + | display | [[DisplayBreakup](#DisplayBreakup)]? | yes | | + | loyaltyPoints | [LoyaltyPoints](#LoyaltyPoints)? | yes | | + | raw | [RawBreakup](#RawBreakup)? | yes | | + +--- + + + + + #### [PromoMeta](#PromoMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [CartProductIdentifer](#CartProductIdentifer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | identifier | String? | yes | Article idenfier generated by cart | + +--- + + + + + #### [ProductPrice](#ProductPrice) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | marked | Double? | yes | | + | currencyCode | String? | yes | | + | selling | Double? | yes | | + | addOn | Double? | yes | | + | effective | Double? | yes | | + | currencySymbol | String? | yes | | + +--- + + + + + #### [ProductPriceInfo](#ProductPriceInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | base | [ProductPrice](#ProductPrice)? | yes | | + | converted | [ProductPrice](#ProductPrice)? | yes | | + +--- + + + + + #### [ProductImage](#ProductImage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | aspectRatio | String? | yes | | + | url | String? | yes | | + | secureUrl | String? | yes | | + +--- + + + + + #### [ActionQuery](#ActionQuery) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | productSlug | [String]? | yes | Contains list of product slug | + +--- + + + + + #### [ProductAction](#ProductAction) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | query | [ActionQuery](#ActionQuery)? | yes | | + | type | String? | yes | | + | url | String? | yes | | + +--- + + + + + #### [BaseInfo](#BaseInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | name | String? | yes | | + +--- + + + + + #### [CategoryInfo](#CategoryInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | Product Category Id | + | name | String? | yes | | + +--- + + + + + #### [CartProduct](#CartProduct) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | images | [[ProductImage](#ProductImage)]? | yes | | + | slug | String? | yes | Unique product url name generated via product name and other meta data | + | uid | Int? | yes | | + | type | String? | yes | | + | name | String? | yes | | + | action | [ProductAction](#ProductAction)? | yes | | + | brand | [BaseInfo](#BaseInfo)? | yes | | + | categories | [[CategoryInfo](#CategoryInfo)]? | yes | | + +--- + + + + + #### [ProductAvailability](#ProductAvailability) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | deliverable | Bool? | yes | | + | otherStoreQuantity | Int? | yes | | + | sizes | [String]? | yes | | + | outOfStock | Bool? | yes | | + | isValid | Bool? | yes | | + +--- + + + + + #### [BasePrice](#BasePrice) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | marked | Double? | yes | | + | currencySymbol | String? | yes | | + | effective | Double? | yes | | + | currencyCode | String? | yes | | + +--- + + + + + #### [ArticlePriceInfo](#ArticlePriceInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | base | [BasePrice](#BasePrice)? | yes | | + | converted | [BasePrice](#BasePrice)? | yes | | + +--- + + + + + #### [ProductArticle](#ProductArticle) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | quantity | Int? | yes | | + | size | String? | yes | | + | store | [BaseInfo](#BaseInfo)? | yes | | + | seller | [BaseInfo](#BaseInfo)? | yes | | + | uid | String? | yes | | + | price | [ArticlePriceInfo](#ArticlePriceInfo)? | yes | | + | type | String? | yes | | + | extraMeta | [String: Any]? | yes | | + +--- + + + + + #### [CartProductInfo](#CartProductInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | quantity | Int? | yes | | + | promoMeta | [PromoMeta](#PromoMeta)? | yes | | + | isSet | Bool? | yes | | + | discount | String? | yes | | + | identifiers | [CartProductIdentifer](#CartProductIdentifer) | no | | + | couponMessage | String? | yes | | + | message | String? | yes | | + | price | [ProductPriceInfo](#ProductPriceInfo)? | yes | | + | bulkOffer | [String: Any]? | yes | | + | product | [CartProduct](#CartProduct)? | yes | | + | availability | [ProductAvailability](#ProductAvailability)? | yes | | + | article | [ProductArticle](#ProductArticle)? | yes | | + | pricePerUnit | [ProductPriceInfo](#ProductPriceInfo)? | yes | | + +--- + + + + + #### [OpenapiCartDetailsResponse](#OpenapiCartDetailsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + | isValid | Bool? | yes | | + | breakupValues | [CartBreakup](#CartBreakup)? | yes | | + | items | [[CartProductInfo](#CartProductInfo)]? | yes | | + +--- + + + + + #### [OpenApiErrorResponse](#OpenApiErrorResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + | success | Bool? | yes | | + | errors | [String: Any]? | yes | Contains field name which has error as key and error message as value | + +--- + + + + + #### [ShippingAddress](#ShippingAddress) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | countryCode | String? | yes | | + | areaCodeSlug | String? | yes | | + | phone | Int? | yes | | + | pincode | Int? | yes | | + | country | String? | yes | | + | city | String? | yes | | + | addressType | String? | yes | | + | landmark | String? | yes | | + | meta | [String: Any]? | yes | | + | address | String? | yes | | + | state | String? | yes | | + | email | String? | yes | | + | name | String? | yes | | + | areaCode | String | no | | + | area | String? | yes | | + +--- + + + + + #### [OpenApiCartServiceabilityRequest](#OpenApiCartServiceabilityRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | shippingAddress | [ShippingAddress](#ShippingAddress) | no | | + | cartItems | [CartItem](#CartItem)? | yes | | + +--- + + + + + #### [PromiseTimestamp](#PromiseTimestamp) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | min | Double? | yes | | + | max | Double? | yes | | + +--- + + + + + #### [PromiseFormatted](#PromiseFormatted) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | min | String? | yes | | + | max | String? | yes | | + +--- + + + + + #### [ShipmentPromise](#ShipmentPromise) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | timestamp | [PromiseTimestamp](#PromiseTimestamp)? | yes | | + | formatted | [PromiseFormatted](#PromiseFormatted)? | yes | | + +--- + + + + + #### [OpenApiCartServiceabilityResponse](#OpenApiCartServiceabilityResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + | breakupValues | [CartBreakup](#CartBreakup)? | yes | | + | items | [[CartProductInfo](#CartProductInfo)]? | yes | | + | deliveryPromise | [ShipmentPromise](#ShipmentPromise)? | yes | | + | isValid | Bool? | yes | | + +--- + + + + + #### [MultiTenderPaymentMeta](#MultiTenderPaymentMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | orderId | String? | yes | | + | currentStatus | String? | yes | | + | paymentId | String? | yes | | + | paymentGateway | String? | yes | | + | extraMeta | [String: Any]? | yes | | + +--- + + + + + #### [MultiTenderPaymentMethod](#MultiTenderPaymentMethod) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | mode | String | no | | + | amount | Double | no | Payment amount | + | name | String? | yes | Payment mode name | + | meta | [MultiTenderPaymentMeta](#MultiTenderPaymentMeta)? | yes | | + +--- + + + + + #### [OpenApiFiles](#OpenApiFiles) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String | no | | + | values | [String] | no | | + +--- + + + + + #### [CartItemMeta](#CartItemMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | groupId | String? | yes | | + | primaryItem | Bool? | yes | | + +--- + + + + + #### [OpenApiOrderItem](#OpenApiOrderItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | quantity | Int? | yes | | + | deliveryCharges | Double | no | | + | amountPaid | Double | no | | + | size | String | no | | + | couponEffectiveDiscount | Double | no | | + | discount | Double | no | | + | priceEffective | Double | no | | + | paymentMethods | [[MultiTenderPaymentMethod](#MultiTenderPaymentMethod)] | no | | + | loyaltyDiscount | Double? | yes | | + | files | [[OpenApiFiles](#OpenApiFiles)]? | yes | | + | meta | [CartItemMeta](#CartItemMeta)? | yes | | + | employeeDiscount | Double? | yes | | + | productId | Int | no | | + | extraMeta | [String: Any]? | yes | | + | codCharges | Double | no | | + | priceMarked | Double | no | | + | cashbackApplied | Double | no | | + +--- + + + + + #### [OpenApiPlatformCheckoutReq](#OpenApiPlatformCheckoutReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | orderId | String? | yes | | + | paymentMethods | [[MultiTenderPaymentMethod](#MultiTenderPaymentMethod)] | no | | + | shippingAddress | [ShippingAddress](#ShippingAddress)? | yes | | + | loyaltyDiscount | Double? | yes | | + | affiliateOrderId | String? | yes | | + | couponValue | Double | no | | + | cartItems | [[OpenApiOrderItem](#OpenApiOrderItem)] | no | | + | currencyCode | String? | yes | | + | deliveryCharges | Double | no | | + | couponCode | String | no | | + | files | [[OpenApiFiles](#OpenApiFiles)]? | yes | | + | billingAddress | [ShippingAddress](#ShippingAddress) | no | | + | employeeDiscount | [String: Any]? | yes | | + | coupon | String? | yes | | + | cartValue | Double | no | | + | codCharges | Double | no | | + | paymentMode | String? | yes | | + | cashbackApplied | Double | no | | + +--- + + + + + #### [OpenApiCheckoutResponse](#OpenApiCheckoutResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | orderId | String | no | Fynd order id | + | message | String? | yes | | + | orderRefId | String? | yes | Order id sent in request | + | success | Bool? | yes | | + +--- + + + diff --git a/documentation/platform/CATALOG.md b/documentation/platform/CATALOG.md new file mode 100644 index 0000000000..f34248208c --- /dev/null +++ b/documentation/platform/CATALOG.md @@ -0,0 +1,16643 @@ + + + + +##### [Back to Platform docs](./README.md) + +## Catalog Methods +Catalog API's allows you to access list of products, prices, seller details, similar features, variants and many more useful features. +* [getSearchKeywords](#getsearchkeywords) +* [deleteSearchKeywords](#deletesearchkeywords) +* [updateSearchKeywords](#updatesearchkeywords) +* [getAllSearchKeyword](#getallsearchkeyword) +* [createCustomKeyword](#createcustomkeyword) +* [getAutocompleteKeywordDetail](#getautocompletekeyworddetail) +* [deleteAutocompleteKeyword](#deleteautocompletekeyword) +* [updateAutocompleteKeyword](#updateautocompletekeyword) +* [getAutocompleteConfig](#getautocompleteconfig) +* [createCustomAutocompleteRule](#createcustomautocompleterule) +* [getProductBundle](#getproductbundle) +* [createProductBundle](#createproductbundle) +* [getProductBundleDetail](#getproductbundledetail) +* [updateProductBundle](#updateproductbundle) +* [getSizeGuides](#getsizeguides) +* [createSizeGuide](#createsizeguide) +* [getSizeGuide](#getsizeguide) +* [updateSizeGuide](#updatesizeguide) +* [updateAppProduct](#updateappproduct) +* [getCatalogConfiguration](#getcatalogconfiguration) +* [getConfigurations](#getconfigurations) +* [createConfigurationProductListing](#createconfigurationproductlisting) +* [getConfigurationByType](#getconfigurationbytype) +* [createConfigurationByType](#createconfigurationbytype) +* [getQueryFilters](#getqueryfilters) +* [getAllCollections](#getallcollections) +* [createCollection](#createcollection) +* [getCollectionDetail](#getcollectiondetail) +* [deleteCollection](#deletecollection) +* [updateCollection](#updatecollection) +* [getCollectionItems](#getcollectionitems) +* [addCollectionItems](#addcollectionitems) +* [getCatalogInsights](#getcataloginsights) +* [getSellerInsights](#getsellerinsights) +* [createMarketplaceOptin](#createmarketplaceoptin) +* [getMarketplaceOptinDetail](#getmarketplaceoptindetail) +* [getCompanyDetail](#getcompanydetail) +* [getCompanyBrandDetail](#getcompanybranddetail) +* [getCompanyMetrics](#getcompanymetrics) +* [getStoreDetail](#getstoredetail) +* [getGenderAttribute](#getgenderattribute) +* [listProductTemplateCategories](#listproducttemplatecategories) +* [listDepartmentsData](#listdepartmentsdata) +* [getDepartmentData](#getdepartmentdata) +* [listProductTemplate](#listproducttemplate) +* [validateProductTemplate](#validateproducttemplate) +* [downloadProductTemplateViews](#downloadproducttemplateviews) +* [downloadProductTemplateView](#downloadproducttemplateview) +* [validateProductTemplateSchema](#validateproducttemplateschema) +* [listHSNCodes](#listhsncodes) +* [listProductTemplateExportDetails](#listproducttemplateexportdetails) +* [listTemplateBrandTypeValues](#listtemplatebrandtypevalues) +* [listCategories](#listcategories) +* [createCategories](#createcategories) +* [getCategoryData](#getcategorydata) +* [updateCategory](#updatecategory) +* [getProducts](#getproducts) +* [createProduct](#createproduct) +* [getProduct](#getproduct) +* [deleteProduct](#deleteproduct) +* [editProduct](#editproduct) +* [getProductValidation](#getproductvalidation) +* [getProductSize](#getproductsize) +* [getProductBulkUploadHistory](#getproductbulkuploadhistory) +* [updateProductAssetsInBulk](#updateproductassetsinbulk) +* [deleteProductBulkJob](#deleteproductbulkjob) +* [createProductsInBulk](#createproductsinbulk) +* [getProductTags](#getproducttags) +* [getProductAssetsInBulk](#getproductassetsinbulk) +* [createProductAssetsInBulk](#createproductassetsinbulk) +* [deleteSize](#deletesize) +* [getInventoryBySize](#getinventorybysize) +* [addInventory](#addinventory) +* [getInventoryBySizeIdentifier](#getinventorybysizeidentifier) +* [getDiscountedInventoryBySizeIdentifier](#getdiscountedinventorybysizeidentifier) +* [deleteInventory](#deleteinventory) +* [getInventoryBulkUploadHistory](#getinventorybulkuploadhistory) +* [createBulkInventoryJob](#createbulkinventoryjob) +* [deleteBulkInventoryJob](#deletebulkinventoryjob) +* [createBulkInventory](#createbulkinventory) +* [getInventoryExport](#getinventoryexport) +* [createInventoryExportJob](#createinventoryexportjob) +* [exportInventoryConfig](#exportinventoryconfig) +* [getAllHsnCodes](#getallhsncodes) +* [createHsnCode](#createhsncode) +* [getHsnCode](#gethsncode) +* [updateHsnCode](#updatehsncode) +* [bulkHsnCode](#bulkhsncode) +* [getApplicationBrands](#getapplicationbrands) +* [getDepartments](#getdepartments) +* [getCategories](#getcategories) +* [getAppicationProducts](#getappicationproducts) +* [getProductDetailBySlug](#getproductdetailbyslug) +* [getAppProducts](#getappproducts) +* [getOptimalLocations](#getoptimallocations) +* [getAppLocations](#getapplocations) + + + +## Methods with example and description + + +#### getSearchKeywords +Get a Search Keywords Details + + + + +```swift +client.application("").catalog.getSearchKeywords(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | A `id` is a unique identifier for a particular detail. Pass the `id` of the keywords which you want to retrieve. | + + + +Get the details of a words by its `id`. If successful, returns a Collection resource in the response body specified in `GetSearchWordsDetailResponseSchema` + +*Returned Response:* + + + + +[GetSearchWordsDetailResponse](#GetSearchWordsDetailResponse) + +The Collection object. See example below or refer `GetSearchWordsDetailResponseSchema` for details + + + + +
    +  Example: + +```json +{ + "uid": "602fa1e9a596ce349563f6b9", + "words": [ + "sds" + ], + "app_id": "000000000000000000000001", + "is_active": true, + "result": { + "query": { + "department": [ + "men" + ] + }, + "sort_on": "popular" + }, + "_custom_json": {} +} +``` +
    + + + + + + + + + +--- + + +#### deleteSearchKeywords +Delete a Search Keywords + + + + +```swift +client.application("").catalog.deleteSearchKeywords(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | A `id` is a unique identifier for a particular detail. Pass the `id` of the keywords which you want to delete. | + + + +Delete a keywords by it's id. Returns an object that tells whether the keywords was deleted successfully + +*Returned Response:* + + + + +[DeleteResponse](#DeleteResponse) + +Status object. Tells whether the operation was successful. See example below or refer `DeleteResponse` + + + + +
    +  Example: + +```json +{ + "message": "Words Deleted" +} +``` +
    + + + + + + + + + +--- + + +#### updateSearchKeywords +Update Search Keyword + + + + +```swift +client.application("").catalog.updateSearchKeywords(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | A `id` is a unique identifier for a particular detail. Pass the `id` of the keywords which you want to delete. | +| body | CreateSearchKeyword | yes | Request body | + + +Update Search Keyword by its id. On successful request, returns the updated collection + +*Returned Response:* + + + + +[GetSearchWordsData](#GetSearchWordsData) + +The Collection object. See example below or refer `GetSearchWordsDataSchema` for details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getAllSearchKeyword +List all Search Custom Keyword Listing + + + + +```swift +client.application("").catalog.getAllSearchKeyword() { (response, error) in + // Use response +} +``` + + + + + + +Custom Search Keyword allows you to map conditions with keywords to give you the ultimate results + +*Returned Response:* + + + + +[GetSearchWordsResponse](#GetSearchWordsResponse) + +List of custom search keywords. See example below or refer `GetSearchWordsResponseSchema` for details + + + + +
    +  Example: + +```json +{ + "page": { + "current": 1, + "size": 1, + "has_previous": false, + "has_next": false, + "item_count": 1 + }, + "items": [ + { + "uid": "602fa1e9a596ce349563f6b9", + "words": [ + "sds" + ], + "app_id": "000000000000000000000001", + "is_active": true, + "result": { + "query": { + "department": [ + "men" + ] + }, + "sort_on": "popular" + }, + "_custom_json": {} + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### createCustomKeyword +Add a Custom Search Keywords + + + + +```swift +client.application("").catalog.createCustomKeyword(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CreateSearchKeyword | yes | Request body | + + +Create a Custom Search Keywords. See `CreateSearchKeywordSchema` for the list of attributes needed to create a mapping and /collections/query-options for the available options to create a rule. On successful request, returns a paginated list of collections specified in `CreateSearchKeywordSchema` + +*Returned Response:* + + + + +[GetSearchWordsData](#GetSearchWordsData) + +Get keyword object with id that is added. See example below or refer `GetSearchWordsDataSchema` for details + + + + +
    +  Example: + +```json +{ + "uid": "602fa1e9a596ce349563f6b9", + "words": [ + "sds" + ], + "app_id": "000000000000000000000001", + "is_active": true, + "result": { + "query": { + "department": [ + "men" + ] + }, + "sort_on": "popular" + }, + "_custom_json": {} +} +``` +
    + + + + + + + + + +--- + + +#### getAutocompleteKeywordDetail +Get a Autocomplete Keywords Details + + + + +```swift +client.application("").catalog.getAutocompleteKeywordDetail(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | A `id` is a unique identifier for a particular detail. Pass the `id` of the keywords which you want to retrieve. | + + + +Get the details of a words by its `id`. If successful, returns a keywords resource in the response body specified in `GetAutocompleteWordsResponseSchema` + +*Returned Response:* + + + + +[GetAutocompleteWordsResponse](#GetAutocompleteWordsResponse) + +The mapping object. See example below or refer `GetAutocompleteWordsResponseSchema` for details + + + + +
    +  Example: + +```json +{ + "uid": "602fa1eaa596ce349563f6c6", + "app_id": "000000000000000000000001", + "words": [ + "dasd" + ], + "is_active": true, + "results": [ + { + "_custom_json": {}, + "display": "Helllow", + "logo": { + "url": "https://hdn-1.addsale.com/addsale/company/61/applications/600a5b3fe0991a4718cdb448/company/1/application/000000000000000000000001/search/pictures/square-logo/original/n_8bvEaBw-Helllow.png" + }, + "action": { + "type": "page", + "page": { + "query": { + "brand": [ + "nike" + ] + }, + "type": "products", + "url": "/products/?brand=nike" + } + } + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### deleteAutocompleteKeyword +Delete a Autocomplete Keywords + + + + +```swift +client.application("").catalog.deleteAutocompleteKeyword(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | A `id` is a unique identifier for a particular detail. Pass the `id` of the keywords which you want to delete. | + + + +Delete a keywords by it's id. Returns an object that tells whether the keywords was deleted successfully + +*Returned Response:* + + + + +[DeleteResponse](#DeleteResponse) + +Status object. Tells whether the operation was successful. See example below or refer `DeleteResponse` + + + + +
    +  Example: + +```json +{ + "message": "Words Deleted" +} +``` +
    + + + + + + + + + +--- + + +#### updateAutocompleteKeyword +Create & Update Autocomplete Keyword + + + + +```swift +client.application("").catalog.updateAutocompleteKeyword(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | A `id` is a unique identifier for a particular detail. Pass the `id` of the keywords which you want to delete. | +| body | CreateAutocompleteKeyword | yes | Request body | + + +Update a mapping by it's id. On successful request, returns the updated Keyword mapping + +*Returned Response:* + + + + +[GetAutocompleteWordsResponse](#GetAutocompleteWordsResponse) + +The Mapping object. See example below or refer `GetAutocompleteWordsResponseSchema` for details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getAutocompleteConfig +List all Autocomplete Keyword Listing + + + + +```swift +client.application("").catalog.getAutocompleteConfig() { (response, error) in + // Use response +} +``` + + + + + + +Custom Autocomplete Keyword allows you to map conditions with keywords to give you the ultimate results + +*Returned Response:* + + + + +[GetAutocompleteWordsResponse](#GetAutocompleteWordsResponse) + +List of custom autocomplete keywords. See example below or refer `GetAutocompleteWordsResponseSchema` for details + + + + +
    +  Example: + +```json +{ + "page": { + "current": 1, + "size": 1, + "has_previous": false, + "has_next": false, + "item_count": 1 + }, + "items": [ + { + "uid": "602fa1eaa596ce349563f6c6", + "app_id": "000000000000000000000001", + "words": [ + "dasd" + ], + "is_active": true, + "results": [ + { + "_custom_json": {}, + "display": "Helllow", + "logo": { + "url": "https://hdn-1.addsale.com/addsale/company/61/applications/600a5b3fe0991a4718cdb448/company/1/application/000000000000000000000001/search/pictures/square-logo/original/n_8bvEaBw-Helllow.png" + }, + "action": { + "type": "page", + "page": { + "query": { + "brand": [ + "nike" + ] + }, + "type": "products", + "url": "/products/?brand=nike" + } + } + } + ] + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### createCustomAutocompleteRule +Add a Custom Autocomplete Keywords + + + + +```swift +client.application("").catalog.createCustomAutocompleteRule(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CreateAutocompleteKeyword | yes | Request body | + + +Create a Custom Autocomplete Keywords. See `CreateAutocompleteKeywordSchema` for the list of attributes needed to create a mapping and /collections/query-options for the available options to create a rule. On successful request, returns a paginated list of collections specified in `CreateAutocompleteKeywordSchema` + +*Returned Response:* + + + + +[CreateAutocompleteWordsResponse](#CreateAutocompleteWordsResponse) + +List of all the collections including the one you added. See example below or refer `CreateAutocompleteWordsResponseSchema` for details + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getProductBundle +List all Product Bundles + + + + +```swift +client.catalog.getProductBundle(q: q, slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| q | String? | no | A search string that is searched with product bundle name. | +| slug | [String]? | no | slugs of bundles to be retrieved. | + + + +Get all product bundles for a particular company + +*Returned Response:* + + + + +[GetProductBundleListingResponse](#GetProductBundleListingResponse) + +List of bundle configured for a company. See example below or refer `GetProductBundleListingResponse` for details + + + + +
    +  Example: + +```json +{ + "page": { + "current": 1, + "total": 1, + "has_previous": false, + "has_next": false, + "total_item_count": 4 + }, + "items": [ + { + "slug": "bag", + "logo": "http://g.com/poo.png/", + "name": "Bag", + "choice": "multi", + "products": [ + { + "product_uid": 7500001, + "max_quantity": 1, + "min_quantity": 1, + "auto_add_to_cart": false, + "auto_select": false, + "allow_remove": true + } + ], + "meta": {}, + "same_store_assignment": true, + "is_active": true, + "page_visibility": [ + "pdp" + ], + "created_by": { + "username": "917827311650_22960", + "uid": "123" + }, + "company_id": 1, + "created_on": "2021-02-19 16:40:26.310007", + "modified_by": { + "username": "917827311650_22960", + "uid": "123" + }, + "modified_on": "2021-02-19 16:40:26.310027", + "id": "602f9ca2a596ce312f5956f9" + }, + { + "choice": "multi", + "same_store_assignment": true, + "products": [ + { + "auto_select": false, + "allow_remove": true, + "auto_add_to_cart": false, + "max_quantity": 1, + "product_uid": 7500001, + "min_quantity": 1 + } + ], + "is_active": true, + "slug": "bag", + "meta": {}, + "logo": "http://g.com/poo.png/", + "page_visibility": [ + "pdp" + ], + "name": "Bag", + "created_by": { + "username": "917827311650_22960", + "uid": "123" + }, + "company_id": 1, + "created_on": "2021-02-19 16:21:35.091512", + "modified_by": { + "username": "917827311650_22960", + "uid": "123" + }, + "modified_on": "2021-02-19 16:21:35.091540", + "id": "602f9837a596ce2edf9868e2" + }, + { + "slug": "bag", + "is_active": true, + "same_store_assignment": true, + "meta": {}, + "choice": "multi", + "logo": "http://g.com/poo.png/", + "page_visibility": [ + "pdp" + ], + "name": "Bag", + "products": [ + { + "auto_select": false, + "min_quantity": 1, + "allow_remove": true, + "auto_add_to_cart": false, + "max_quantity": 1, + "product_uid": 7500001 + } + ], + "created_by": { + "username": "917827311650_22960", + "uid": "123" + }, + "company_id": 1, + "created_on": "2021-02-19 16:20:24.605207", + "modified_by": { + "username": "917827311650_22960", + "uid": "123" + }, + "modified_on": "2021-02-19 16:20:24.605230", + "id": "602f97f0a596ce2ead47cd0b" + }, + { + "products": [ + { + "auto_select": false, + "auto_add_to_cart": false, + "min_quantity": 1, + "allow_remove": true, + "max_quantity": 1, + "product_uid": 7500001 + } + ], + "is_active": true, + "logo": "http://g.com/poo.png/", + "name": "Bag", + "choice": "multi", + "slug": "bag", + "same_store_assignment": true, + "page_visibility": [ + "pdp" + ], + "meta": {}, + "created_by": { + "username": "917827311650_22960", + "uid": "123" + }, + "company_id": 1, + "created_on": "2021-02-19 16:16:46.196449", + "modified_by": { + "username": "917827311650_22960", + "uid": "123" + }, + "modified_on": "2021-02-19 16:16:46.196467", + "id": "602f9716a596ce2e415196df" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### createProductBundle +Create Product Bundle + + + + +```swift +client.catalog.createProductBundle(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | ProductBundleRequest | yes | Request body | + + +Create Product Bundle. See `ProductBundleRequest` for the request body parameter need to create a product bundle. On successful request, returns in `ProductBundleRequest` with id + +*Returned Response:* + + + + +[GetProductBundleCreateResponse](#GetProductBundleCreateResponse) + +Get bundle with id that is added. See example below or refer `GetProductBundleCreateResponse` for details + + + + +
    +  Example: + +```json +{ + "slug": "bag", + "logo": "http://g.com/poo.png/", + "name": "Bag", + "choice": "multi", + "products": [ + { + "product_uid": 7500001, + "max_quantity": 1, + "min_quantity": 1, + "auto_add_to_cart": false, + "auto_select": false, + "allow_remove": true + } + ], + "meta": {}, + "same_store_assignment": true, + "is_active": true, + "page_visibility": [ + "pdp" + ], + "created_by": { + "username": "917827311650_22960", + "uid": "123" + }, + "company_id": 1, + "created_on": "2021-02-19 16:40:26.310007", + "modified_by": { + "username": "917827311650_22960", + "uid": "123" + }, + "modified_on": "2021-02-19 16:40:26.310027", + "id": "602f9ca2a596ce312f5956f9" +} +``` +
    + + + + + + + + + +--- + + +#### getProductBundleDetail +Get a particular Product Bundle details + + + + +```swift +client.catalog.getProductBundleDetail(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | A `id` is a unique identifier for a particular detail. Pass the `id` of the keywords which you want to retrieve. | + + + +Get a particular Bundle details by its `id`. If successful, returns a Product bundle resource in the response body specified in `GetProductBundleResponse` + +*Returned Response:* + + + + +[GetProductBundleResponse](#GetProductBundleResponse) + +The Collection object. See example below or refer `GetProductBundleResponse` for details + + + + +
    +  Example: + +```json +{ + "slug": "bag", + "company_id": 1, + "logo": "http://g.com/poo.png/", + "name": "Bag", + "choice": "multi", + "products": [ + { + "product_uid": 7500001, + "product_details": { + "country_of_origin": "India", + "slug": "slug-1", + "item_code": "760B3BFF-4905-44B8-A50E-082829E7107F", + "attributes": { + "brand_name": "brand 2" + }, + "name": "Some Phone", + "images": [ + "https://hdn-1.addsale.com/x0/media/pictures/tagged_items/original/random_code_4/FE6DUR_000000.png" + ], + "uid": 7500001 + }, + "max_quantity": 1, + "min_quantity": 1, + "auto_add_to_cart": false, + "auto_select": false, + "allow_remove": true + } + ], + "meta": {}, + "same_store_assignment": true, + "page_visibility": [ + "pdp" + ] +} +``` +
    + + + + + + + + + +--- + + +#### updateProductBundle +Update a Product Bundle + + + + +```swift +client.catalog.updateProductBundle(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | A `id` is a unique identifier for a particular detail. Pass the `id` of the keywords which you want to delete. | +| body | ProductBundleUpdateRequest | yes | Request body | + + +Update a Product Bundle by its id. On successful request, returns the updated product bundle + +*Returned Response:* + + + + +[GetProductBundleCreateResponse](#GetProductBundleCreateResponse) + +The Collection object. See example below or refer `GetProductBundleCreateResponse` for details. + + + + +
    +  Example: + +```json +{ + "slug": "bag", + "logo": "http://g.com/poo.png/", + "name": "Bag", + "choice": "multi", + "products": [ + { + "product_uid": 7500001, + "max_quantity": 1, + "min_quantity": 1, + "auto_add_to_cart": false, + "auto_select": false, + "allow_remove": true + } + ], + "meta": {}, + "same_store_assignment": true, + "is_active": true, + "page_visibility": [ + "pdp" + ], + "created_by": { + "username": "917827311650_22960", + "uid": "123" + }, + "company_id": 1, + "created_on": "2021-02-19 16:40:26.310007", + "modified_by": { + "username": "917827311650_22960", + "uid": "123" + }, + "modified_on": "2021-02-19 16:40:26.310027", + "id": "602f9ca2a596ce312f5956f9" +} +``` +
    + + + + + + + + + +--- + + +#### getSizeGuides +Get list of size guides + + + + +```swift +client.catalog.getSizeGuides(active: active, q: q, tag: tag, pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| active | Bool? | no | filter size guide on basis of active, in-active | +| q | String? | no | Query that is to be searched. | +| tag | String? | no | to filter size guide on basis of tag. | +| pageNo | Int? | no | The page number to navigate through the given set of results | +| pageSize | Int? | no | Number of items to retrieve in each page. Default is 10. | + + + +This API allows to view all the size guides associated to the seller. + +*Returned Response:* + + + + +[ListSizeGuide](#ListSizeGuide) + +Size guide object. See example below or refer `ListSizeGuide` for details + + + + +
    +  Example: + +```json +{ + "items": [ + { + "modified_by": { + "username": "silverbolt", + "user_id": "-1" + }, + "active": true, + "id": "60364384f08385bee776f83d", + "title": "Demo SG", + "modified_on": "2021-02-24T17:46:04.146000Z", + "brand_id": 2, + "created_by": { + "username": "silverbolt", + "user_id": "-1" + }, + "subtitle": "I am demo", + "company_id": 12, + "created_on": "2021-02-24T17:46:04.146000Z", + "guide": { + "meta": { + "values": [ + { + "col_1": "10", + "col_2": "20" + }, + { + "col_1": "12", + "col_2": "22" + }, + { + "col_1": "14", + "col_2": "24" + } + ], + "unit": "cm", + "headers": { + "col_1": { + "value": "Head", + "convertable": false + }, + "col_2": { + "value": "Shoulder", + "convertable": true + } + } + } + }, + "tag": "demo", + "name": "Demo" + } + ], + "page": { + "current": 1, + "size": 1, + "has_previous": false, + "has_next": false, + "item_count": 1 + } +} +``` +
    + + + + + + + + + +--- + + +#### createSizeGuide +Create a size guide. + + + + +```swift +client.catalog.createSizeGuide(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | ValidateSizeGuide | yes | Request body | + + +This API allows to create a size guide associated to a brand. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getSizeGuide +Get a single size guide. + + + + +```swift +client.catalog.getSizeGuide(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Id of the size guide to be viewed. | + + + +This API helps to get data associated to a size guide. + +*Returned Response:* + + + + +[SizeGuideResponse](#SizeGuideResponse) + +Brand object. See example below or refer `SizeGuideResponseSchema` for details + + + + +
    +  Example: + +```json +{ + "active": true, + "brand_id": 1, + "created_on": "2021-02-24T17:46:04.146000Z", + "modified_on": "2021-02-25T15:19:30.822000Z", + "created_by": { + "username": "silverbolt", + "user_id": "-1" + }, + "modified_by": { + "username": "917827311650_22960", + "user_id": "123" + }, + "name": "edited size guide", + "company_id": 1, + "guide": { + "meta": { + "headers": { + "col_1": { + "value": "Head", + "convertable": false + }, + "col_2": { + "value": "Shoulder", + "convertable": true + } + }, + "values": [ + { + "col_1": "10", + "col_2": "20" + }, + { + "col_1": "12", + "col_2": "22" + }, + { + "col_1": "14", + "col_2": "24" + } + ], + "unit": "cm" + } + }, + "tag": "demo", + "title": "Demo SG", + "subtitle": "I am demo", + "id": "60364384f08385bee776f83d" +} +``` +
    + + + + + + + + + +--- + + +#### updateSizeGuide +Edit a size guide. + + + + +```swift +client.catalog.updateSizeGuide(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Mongo id of the size guide to be edited | +| body | ValidateSizeGuide | yes | Request body | + + +This API allows to edit a size guide. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### updateAppProduct +Update a single custom meta. + + + + +```swift +client.application("").catalog.updateAppProduct(itemId: itemId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| itemId | String | yes | product id for which the custom_meta is associated. | +| body | ApplicationItemMeta | yes | Request body | + + +This API helps to update data associated to a item custom meta. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getCatalogConfiguration +Get configuration meta details for catalog for admin panel + + + + +```swift +client.application("").catalog.getCatalogConfiguration() { (response, error) in + // Use response +} +``` + + + + + + +configuration meta details for catalog. + +*Returned Response:* + + + + +[GetCatalogConfigurationMetaData](#GetCatalogConfigurationMetaData) + +configuration details for catalog. See example below or refer `GetCatalogConfigurationMetaDataSchema` for details + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getConfigurations +Get configured details for catalog + + + + +```swift +client.application("").catalog.getConfigurations() { (response, error) in + // Use response +} +``` + + + + + + +configured details for catalog. + +*Returned Response:* + + + + +[GetAppCatalogConfiguration](#GetAppCatalogConfiguration) + +Get application level configured catalog details. See example below or refer `GetAppCatalogConfigurationSchema` for details + + + + +
    +  Example: + +```json +{ + "data": { + "app_id": "000000000000000000000001", + "listing": { + "filter": { + "attribute_config": [ + { + "key": "gender", + "priority": 1, + "type": "multivalued", + "name": "Gender", + "value_config": { + "condition": "OR", + "sort": "count", + "value": "", + "bucket_points": [], + "map": {} + }, + "is_active": true + }, + { + "key": "min_price_effective", + "priority": 2, + "type": "range", + "name": "Price", + "value_config": { + "condition": "OR", + "sort": "count", + "value": "", + "bucket_points": [], + "map": { + "< 500": "Below Rs. 500", + ">= 6000": "Above Rs. 6000" + } + }, + "is_active": true + }, + { + "key": "departments", + "priority": 3, + "type": "multivalued", + "name": "Department", + "value_config": { + "condition": "OR", + "sort": "count", + "value": "metadata", + "bucket_points": [], + "map": {} + }, + "is_active": true + }, + { + "key": "brand_id", + "priority": 4, + "type": "multivalued", + "name": "Brand", + "value_config": { + "condition": "OR", + "sort": "ascending", + "value": "metadata", + "bucket_points": [], + "map": { + "5th Avenue": "A {{value}}" + } + }, + "is_active": true + }, + { + "key": "season", + "priority": 5, + "type": "multivalued", + "name": "Season", + "value_config": { + "condition": "OR", + "sort": "count", + "value": "", + "bucket_points": [], + "map": { + "": "" + } + }, + "is_active": false + }, + { + "key": "is_set", + "priority": 6, + "type": "multivalued", + "name": "Set", + "value_config": { + "condition": "OR", + "sort": "descending", + "value": "", + "bucket_points": [], + "map": { + "true": "Yes", + "false": "No" + } + }, + "is_active": true + }, + { + "key": "rating", + "priority": 7, + "type": "multivalued", + "name": "Rating", + "value_config": { + "condition": "OR", + "sort": "count", + "value": "", + "bucket_points": [], + "map": { + "": "" + } + }, + "is_active": true + }, + { + "key": "size_depth", + "priority": 8, + "type": "range", + "name": "Size Depth", + "value_config": { + "condition": "OR", + "sort": "count", + "value": "", + "bucket_points": [], + "map": { + "{} - {}": "{} - {}" + } + }, + "is_active": true + } + ], + "allow_single": false + }, + "sort": { + "default": "", + "config": [ + { + "key": "price_dsc", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Price%20High%20to%20Low.png", + "priority": 1, + "name": "Price High to Low", + "is_active": false + }, + { + "key": "rating_dsc", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Rating.png", + "priority": 2, + "name": "Rating", + "is_active": true + }, + { + "key": "depth_desc", + "priority": 3, + "name": "Size Depth (High to Low)", + "is_active": true + }, + { + "key": "discount_dsc", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Discount%20Low%20to%20High.png", + "priority": 4, + "name": "Discount High to Low", + "is_active": true + }, + { + "key": "popular", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Popularity.png", + "priority": 5, + "name": "Popularity", + "is_active": true + }, + { + "key": "relevance", + "priority": 6, + "name": "Relevance", + "is_active": true + }, + { + "key": "price_asc", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Price%20Low%20to%20High.png", + "priority": 7, + "name": "Price Low to High", + "is_active": true + } + ] + } + }, + "product": { + "similar": { + "config": [ + { + "key": "seller", + "size": { + "max": 10, + "min": 2 + }, + "priority": 1, + "title": "Seller", + "is_active": true, + "subtitle": "" + }, + { + "key": "visual", + "size": { + "max": 10, + "min": 2 + }, + "priority": 2, + "title": "Visual", + "is_active": true, + "subtitle": "" + }, + { + "key": "brand", + "size": { + "max": 10, + "min": 2 + }, + "priority": 3, + "title": "Brand", + "is_active": true, + "subtitle": "" + }, + { + "key": "specs", + "size": { + "max": 10, + "min": 2 + }, + "priority": 4, + "title": "Specs", + "is_active": true, + "subtitle": "" + } + ] + }, + "variant": { + "config": [ + { + "key": "color", + "display_type": "image", + "size": { + "max": 10, + "min": 2 + }, + "priority": 1, + "name": "Additional Colors12", + "is_active": true + }, + { + "key": "storage", + "display_type": "text", + "size": { + "max": 10, + "min": 2 + }, + "priority": 2, + "name": "Memory", + "is_active": true + }, + { + "key": "visual", + "display_type": "image", + "size": { + "max": 10, + "min": 2 + }, + "priority": 3, + "name": "Additional Colors", + "is_active": true + }, + { + "key": "ram_storage", + "display_type": "text", + "size": { + "max": 10, + "min": 2 + }, + "priority": 4, + "name": "Ram_Storage", + "is_active": true + }, + { + "key": "shade", + "display_type": "color", + "size": { + "max": 10, + "min": 2 + }, + "priority": 5, + "name": "Additional Shades", + "is_active": true + }, + { + "key": "water_resistant", + "display_type": "text", + "size": { + "max": 10, + "min": 2 + }, + "priority": 6, + "name": "Water_Resistant", + "is_active": true + } + ] + } + }, + "config_id": "000000000000000000000001", + "config_type": "app" + }, + "is_default": false +} +``` +
    + + + + + + + + + +--- + + +#### createConfigurationProductListing +Add configuration for products & listings + + + + +```swift +client.application("").catalog.createConfigurationProductListing(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | AppConfiguration | yes | Request body | + + +Add configuration for products & listing. + +*Returned Response:* + + + + +[GetAppCatalogConfiguration](#GetAppCatalogConfiguration) + +success flag will tell whether the operation was successful. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getConfigurationByType +Get configured details for catalog + + + + +```swift +client.application("").catalog.getConfigurationByType(type: type) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| type | String | yes | type can be brands, categories etc. | + + + +configured details for catalog. + +*Returned Response:* + + + + +[GetAppCatalogEntityConfiguration](#GetAppCatalogEntityConfiguration) + +Get application level configured catalog details. See example below or refer `GetAppCatalogEntityConfigurationSchema` for details + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### createConfigurationByType +Add configuration for categories and brands + + + + +```swift +client.application("").catalog.createConfigurationByType(type: type, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| type | String | yes | type can be brands, categories etc. | +| body | AppConfiguration | yes | Request body | + + +Add configuration for categories & brands. + +*Returned Response:* + + + + +[GetAppCatalogConfiguration](#GetAppCatalogConfiguration) + +success flag will tell whether the operation was successful. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getQueryFilters +Get query filters to configure a collection + + + + +```swift +client.application("").catalog.getQueryFilters() { (response, error) in + // Use response +} +``` + + + + + + +Get query filters to configure a collection + +*Returned Response:* + + + + +[GetCollectionQueryOptionResponse](#GetCollectionQueryOptionResponse) + +The attached items of an collection. See example below or refer `GetCollectionQueryOptionResponse` for details + + + + +
    +  Example: + +```json +{ + "filters": [ + { + "key": { + "display": "Department", + "name": "department", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Department.png" + }, + "values": [ + { + "display": "Men's Fashion", + "count": 2113, + "is_selected": false, + "value": "men", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/category_tab_icons/department/Men.png" + } + } + ] + }, + { + "key": { + "display": "Category", + "name": "category", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Category.png" + }, + "values": [ + { + "display": "T-Shirts", + "count": 968, + "is_selected": false, + "value": "192", + "logo": "https://hdn-1.fynd.com/media/logo/category/original/15442_57fdc97abfd248aaaf8841f097a4ed67.jpg" + } + ] + }, + { + "key": { + "display": "Size", + "name": "sizes", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Sizes.png" + }, + "values": [ + { + "display": "S", + "count": 1438, + "is_selected": false, + "value": "S" + } + ] + }, + { + "key": { + "display": "Brand", + "name": "brand", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Brand%20ID.png" + }, + "values": [ + { + "display": "Superdry", + "count": 4263, + "is_selected": false, + "value": "235", + "logo": "https://hdn-1.fynd.com/media/logo/brand/original/1008_238113b8e11448f792e9bf860aac30f2.jpg" + } + ] + }, + { + "key": { + "display": "Rating", + "name": "rating", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Rating.png" + }, + "values": [ + { + "count": 3, + "display": "5 ★", + "value": "[4 TO *}", + "is_selected": false + } + ] + }, + { + "key": { + "display": "Company", + "name": "company_id_list", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Store%20ID%20List.png" + }, + "values": [ + { + "display": "RELIANCE BRANDS LIMITED", + "count": 4262, + "is_selected": false, + "value": "46" + } + ] + }, + { + "key": { + "display": "Store Ids", + "name": "store_id_list", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Store%20ID%20List.png" + }, + "values": [ + { + "display": "PHOENIX, ,PALLADIUM, LOWER PAREL - 5410", + "count": 1385, + "is_selected": false, + "value": "2201" + } + ] + }, + { + "key": { + "display": "Image", + "name": "image_nature", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/image%20Nature.png" + }, + "values": [ + { + "display": "Good Quality", + "count": 3111, + "is_selected": false, + "value": "standard" + }, + { + "display": "No Image", + "count": 1152, + "is_selected": false, + "value": "default" + } + ] + }, + { + "key": { + "display": "Set", + "name": "is_set", + "kind": "multivalued", + "logo": "" + }, + "values": [ + { + "display": "No", + "count": 4263, + "is_selected": false, + "value": false + } + ] + }, + { + "key": { + "display": "Product Fit", + "name": "product_fit", + "kind": "multivalued", + "logo": "" + }, + "values": [ + { + "display": "Regular", + "count": 14, + "is_selected": false, + "value": "Regular" + } + ] + }, + { + "key": { + "display": "Primary Material", + "name": "primary_material", + "kind": "multivalued", + "logo": "" + }, + "values": [ + { + "display": "Cotton", + "count": 1246, + "is_selected": false, + "value": "Cotton" + } + ] + }, + { + "key": { + "display": "Gender", + "name": "gender", + "kind": "multivalued", + "logo": "" + }, + "values": [ + { + "display": "Men", + "count": 2125, + "is_selected": false, + "value": "Men" + }, + { + "display": "Women", + "count": 1492, + "is_selected": false, + "value": "Women" + } + ] + }, + { + "key": { + "display": "Primary Colour", + "name": "primary_color", + "kind": "multivalued", + "logo": "" + }, + "values": [ + { + "display": "Multi", + "count": 1403, + "is_selected": false, + "value": "Multi" + } + ] + }, + { + "key": { + "display": "Size Depth", + "name": "size_depth", + "kind": "range", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Size%20Depth.png" + }, + "values": [ + { + "count": 4263, + "min": 0, + "max": 9, + "is_selected": false, + "selected_min": 0, + "selected_max": 9, + "query_format": "[{} TO {}]", + "display_format": "{} - {}", + "display": "0 - 9" + } + ] + }, + { + "key": { + "display": "Price", + "name": "min_price_effective", + "kind": "range", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Min%20price%20effective.png" + }, + "values": [ + { + "count": 4263, + "min": 398, + "max": 24999, + "is_selected": false, + "selected_min": 398.8, + "selected_max": 24998.77, + "currency_code": "INR", + "currency_symbol": "₹", + "query_format": "[{},INR TO {},INR]" + } + ] + }, + { + "key": { + "display": "Discount", + "name": "platform_discount", + "kind": "range", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Platform%20Discount.png" + }, + "values": [ + { + "count": 4263, + "min": 0, + "max": 50, + "is_selected": false, + "selected_min": 0, + "selected_max": 50, + "query_format": "[{} TO {}]", + "display_format": "{} - {}", + "display": "0 - 50" + } + ] + } + ], + "sort_on": [ + { + "display": "Latest Products", + "name": "Latest Products", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Latest%20Products.png", + "value": "latest", + "is_selected": true + }, + { + "display": "Popularity", + "name": "Popularity", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Popularity.png", + "value": "popular", + "is_selected": false + }, + { + "display": "Price Low to High", + "name": "Price Low to High", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Price%20High%20to%20Low.png", + "value": "price_asc", + "is_selected": false + }, + { + "display": "Price High to Low", + "name": "Price High to Low", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Price%20High%20to%20Low.png", + "value": "price_dsc", + "is_selected": false + }, + { + "display": "Discount Low to High", + "name": "Discount Low to High", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Discount%20Low%20to%20High.png", + "value": "discount_asc", + "is_selected": false + }, + { + "display": "Discount High to Low", + "name": "Discount High to Low", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Discount%20Low%20to%20High.png", + "value": "discount_dsc", + "is_selected": false + }, + { + "display": "Rating", + "name": "Rating", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Rating.png", + "value": "rating_dsc", + "is_selected": false + }, + { + "display": "Size Depth (High to Low)", + "name": "Size Depth (High to Low)", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Size%20Depth.png", + "value": "depth_desc", + "is_selected": false + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getAllCollections +List all the collections + + + + +```swift +client.application("").catalog.getAllCollections(q: q, tags: tags, isActive: isActive, pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| q | String? | no | Get collection list filtered by q string, | +| tags | [String]? | no | Each response will contain next_id param, which should be sent back to make pagination work. | +| isActive | Bool? | no | get collections filtered by active status. | +| pageNo | Int? | no | The page number to navigate through the given set of results. | +| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | + + + +A Collection allows you to organize your products into hierarchical groups. For example, a dress might be in the category _Clothing_, the individual product might also be in the collection _Summer_. On successful request, returns all the collections as specified in `CollectionListingSchema` + +*Returned Response:* + + + + +[GetCollectionListingResponse](#GetCollectionListingResponse) + +List of collections. See example below or refer `GetCollectionListingResponse` for details + + + + +
    +  Example: + +```json +{ + "page": { + "current": 1, + "size": 19, + "has_previous": false, + "has_next": true, + "item_total": 190 + }, + "items": [ + { + "uid": "6040fed076d8a500011ef829", + "type": "query", + "query": { + "brand": [ + "6", + "3", + "4", + "2" + ], + "min_price_effective": "[6319,INR TO 11805,INR]", + "platform_discount": "[15 TO 39]", + "sort_on": "price_asc" + }, + "name": "test1", + "banners": { + "portrait": { + "type": "image", + "url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000001/collections/pictures/portrait-banner/original/mP6OnINGR-1601466767814.jpeg" + }, + "landscape": { + "type": "image", + "url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000001/collections/pictures/landscape-banner/original/3jSEzw9CN-1601465376892.jpeg" + } + }, + "logo": { + "type": "image", + "url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000001/collections/pictures/square-logo/original/y_-XUYXwx-1602326103322.jpeg" + }, + "published": true, + "description": "this is description", + "is_active": true, + "tags": [], + "slug": "test1", + "action": { + "page": { + "type": "collection", + "query": { + "collection": [ + "test1" + ] + } + }, + "type": "page" + }, + "allow_facets": true, + "allow_sort": true, + "visible_facets_keys": [], + "meta": {}, + "badge": { + "text": "", + "color": "#ffffff" + }, + "sort_on": "price_asc", + "_custom_json": {}, + "_locale_language": {}, + "_schedule": { + "start": "2021-03-04T15:35:13.640000Z", + "next_schedule": [ + { + "start": "2021-03-04T15:35:13.640000Z", + "end": null + } + ], + "end": null + } + }, + { + "uid": "6040a9b250f97e0001886294", + "type": "items", + "query": {}, + "name": "newapiplaform", + "banners": { + "portrait": { + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588858137/production/applications/app_000000000000000000000001/media/collection/portrait/xzuftshmmw4yuwzb12pm.png" + }, + "landscape": { + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857999/production/applications/app_000000000000000000000001/media/collection/landscape/avm7xibo2jgk8glc4bwl.png" + } + }, + "logo": { + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857854/production/applications/app_000000000000000000000001/media/collection/logo/w9ns7nfgv7fk45xqrpoh.png" + }, + "published": true, + "description": "sadasd", + "is_active": true, + "tags": [ + "sdsadas", + "asd" + ], + "slug": "newapiplaform", + "action": { + "page": { + "type": "collection", + "query": { + "collection": [ + "newapiplaform" + ] + } + }, + "type": "page" + }, + "allow_facets": true, + "allow_sort": true, + "visible_facets_keys": [], + "meta": {}, + "badge": { + "text": "", + "color": "#aa2727" + }, + "sort_on": "popular", + "_custom_json": {}, + "_locale_language": {}, + "_schedule": { + "start": "2021-03-04T09:33:53.686000Z", + "next_schedule": [ + { + "start": "2021-03-04T09:33:53.686000Z", + "end": null + } + ], + "end": null + } + }, + { + "uid": "603f68fd953a69000145dc92", + "type": "query", + "query": {}, + "name": "new", + "banners": { + "portrait": { + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588858137/production/applications/app_000000000000000000000001/media/collection/portrait/xzuftshmmw4yuwzb12pm.png" + }, + "landscape": { + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857999/production/applications/app_000000000000000000000001/media/collection/landscape/avm7xibo2jgk8glc4bwl.png" + } + }, + "logo": { + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857854/production/applications/app_000000000000000000000001/media/collection/logo/w9ns7nfgv7fk45xqrpoh.png" + }, + "published": true, + "description": "", + "is_active": true, + "tags": [], + "slug": "old", + "action": { + "page": { + "type": "collection", + "query": { + "collection": [ + "old" + ] + } + }, + "type": "page" + }, + "allow_facets": true, + "allow_sort": true, + "visible_facets_keys": [], + "meta": {}, + "badge": { + "color": "#ffffff", + "text": "" + }, + "sort_on": "popular", + "_custom_json": {}, + "_locale_language": {}, + "_schedule": { + "start": "2021-03-03T10:45:40.544000Z", + "next_schedule": [ + { + "start": "2021-03-03T10:45:40.544000Z", + "end": null + } + ], + "end": null + } + } + ], + "filters": { + "tags": [ + { + "name": "1+", + "is_selected": false, + "display": "1+" + }, + { + "name": "aa", + "is_selected": false, + "display": "aa" + }, + { + "name": "asd", + "is_selected": false, + "display": "asd" + }, + { + "name": "dda", + "is_selected": false, + "display": "dda" + }, + { + "name": "fahim", + "is_selected": false, + "display": "fahim" + }, + { + "name": "gfg", + "is_selected": false, + "display": "gfg" + }, + { + "name": "sakri", + "is_selected": false, + "display": "sakri" + }, + { + "name": "sdsadas", + "is_selected": false, + "display": "sdsadas" + }, + { + "name": "uuy", + "is_selected": false, + "display": "uuy" + } + ], + "type": [ + { + "name": "items", + "is_selected": false, + "display": "items" + }, + { + "name": "query", + "is_selected": false, + "display": "query" + } + ] + } +} +``` +
    + + + + + + + + + +--- + + +#### createCollection +Add a Collection + + + + +```swift +client.application("").catalog.createCollection(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CreateCollection | yes | Request body | + + +Create a collection. See `CreateCollectionRequestSchema` for the list of attributes needed to create a collection and collections/query-options for the available options to create a collection. On successful request, returns a paginated list of collections specified in `CollectionCreateResponse` + +*Returned Response:* + + + + +[CollectionCreateResponse](#CollectionCreateResponse) + +List of all the collections including the one you added. See example below or refer `CollectionCreateResponse` for details + + + + +
    +  Example: + +```json +{ + "uid": "604f585a7051e30001173ac1", + "type": "query", + "query": {}, + "name": "New", + "banners": { + "portrait": { + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588858137/production/applications/app_000000000000000000000001/media/collection/portrait/xzuftshmmw4yuwzb12pm.png" + }, + "landscape": { + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857999/production/applications/app_000000000000000000000001/media/collection/landscape/avm7xibo2jgk8glc4bwl.png" + } + }, + "logo": { + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857854/production/applications/app_000000000000000000000001/media/collection/logo/w9ns7nfgv7fk45xqrpoh.png" + }, + "published": true, + "description": "", + "is_active": true, + "tags": [], + "slug": "new", + "action": { + "page": { + "type": "collection", + "query": { + "collection": [ + "new" + ] + } + }, + "type": "page" + }, + "allow_facets": true, + "allow_sort": true, + "visible_facets_keys": [], + "meta": {}, + "badge": { + "color": "#ffffff", + "text": "" + }, + "sort_on": "depth_desc", + "_custom_json": {}, + "_locale_language": {}, + "_schedule": { + "start": "2021-03-15T12:51:21.333000+00:00Z", + "next_schedule": [ + { + "start": "2021-03-15T12:51:21.333000+00:00Z", + "end": null + } + ], + "end": null + }, + "seo": { + "title": "Test", + "description": "Test description" + } +} +``` +
    + + + + + + + + + +--- + + +#### getCollectionDetail +Get a particular collection + + + + +```swift +client.application("").catalog.getCollectionDetail(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A `slug` is a human readable, URL friendly unique identifier of an object. Pass the `slug` of the collection which you want to retrieve. | + + + +Get the details of a collection by its `slug`. If successful, returns a Collection resource in the response body specified in `CollectionDetailResponse` + +*Returned Response:* + + + + +[CollectionDetailResponse](#CollectionDetailResponse) + +The Collection object. See example below or refer `CollectionDetailResponse` for details + + + + +
    +  Example: + +```json +{ + "uid": "5ec5fc757cb1e4740a17da23", + "type": "query", + "query": { + "l3_categories": [ + "12" + ], + "sort_on": "discount_asc" + }, + "name": "new", + "banners": { + "portrait": { + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588858137/production/applications/app_000000000000000000000001/media/collection/portrait/xzuftshmmw4yuwzb12pm.png" + }, + "landscape": { + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857999/production/applications/app_000000000000000000000001/media/collection/landscape/avm7xibo2jgk8glc4bwl.png" + } + }, + "logo": { + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857854/production/applications/app_000000000000000000000001/media/collection/logo/w9ns7nfgv7fk45xqrpoh.png" + }, + "published": true, + "description": "", + "is_active": true, + "tags": [], + "slug": "new", + "action": { + "page": { + "type": "collection", + "query": { + "collection": [ + "new" + ] + } + }, + "type": "page" + }, + "allow_facets": true, + "allow_sort": true, + "visible_facets_keys": [], + "meta": {}, + "badge": { + "color": "#ffffff", + "text": "" + }, + "sort_on": "popular", + "_custom_json": {}, + "_locale_language": {}, + "_schedule": { + "start": "2020-05-21T03:58:41.237000Z", + "next_schedule": [ + { + "start": "2020-05-21T03:58:41.237000Z", + "end": null + } + ], + "end": null + } +} +``` +
    + + + + + + + + + +--- + + +#### deleteCollection +Delete a Collection + + + + +```swift +client.application("").catalog.deleteCollection(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | A `id` is a unique identifier of a collection. | + + + +Delete a collection by it's id. Returns an object that tells whether the collection was deleted successfully + +*Returned Response:* + + + + +[DeleteResponse](#DeleteResponse) + +Status object. Tells whether the operation was successful. See example below or refer `DeleteResponse` + + + + +
    +  Example: + +```json +{ + "message": "Collection Deleted" +} +``` +
    + + + + + + + + + +--- + + +#### updateCollection +Update a collection + + + + +```swift +client.application("").catalog.updateCollection(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | A `id` is a unique identifier of a collection. | +| body | UpdateCollection | yes | Request body | + + +Update a collection by it's id. On successful request, returns the updated collection + +*Returned Response:* + + + + +[UpdateCollection](#UpdateCollection) + +The Collection object. See example below or refer `UpdateCollectionSchema` for details. + + + + +
    +  Example: + +```json +{ + "uid": "604f585a7051e30001173ac1", + "type": "query", + "query": {}, + "name": "New", + "banners": { + "portrait": { + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588858137/production/applications/app_000000000000000000000001/media/collection/portrait/xzuftshmmw4yuwzb12pm.png" + }, + "landscape": { + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857999/production/applications/app_000000000000000000000001/media/collection/landscape/avm7xibo2jgk8glc4bwl.png" + } + }, + "logo": { + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857854/production/applications/app_000000000000000000000001/media/collection/logo/w9ns7nfgv7fk45xqrpoh.png" + }, + "published": true, + "description": "", + "is_active": true, + "tags": [], + "slug": "new", + "action": { + "page": { + "type": "collection", + "query": { + "collection": [ + "new" + ] + } + }, + "type": "page" + }, + "allow_facets": true, + "allow_sort": true, + "visible_facets_keys": [], + "meta": {}, + "badge": { + "color": "#ffffff", + "text": "" + }, + "sort_on": "depth_desc", + "_custom_json": {}, + "_locale_language": {}, + "_schedule": { + "start": "2021-03-15T12:51:21.333000+00:00Z", + "next_schedule": [ + { + "start": "2021-03-15T12:51:21.333000+00:00Z", + "end": null + } + ], + "end": null + }, + "seo": { + "title": "Test", + "description": "Test description" + } +} +``` +
    + + + + + + + + + +--- + + +#### getCollectionItems +Get the items for a collection + + + + +```swift +client.application("").catalog.getCollectionItems(id: id, sortOn: sortOn, pageId: pageId, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | A `id` is a unique identifier of a collection. | +| sortOn | String? | no | Each response will contain sort_on param, which should be sent back to make pagination work. | +| pageId | String? | no | Each response will contain next_id param, which should be sent back to make pagination work. | +| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | + + + +Get items from a collection specified by its `id`. + +*Returned Response:* + + + + +[GetCollectionItemsResponse](#GetCollectionItemsResponse) + +The attached items of an collection. See example below or refer `GetCollectionItemsResponseSchema` for details + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### addCollectionItems +Add items to a collection + + + + +```swift +client.application("").catalog.addCollectionItems(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | A `id` is a unique identifier of a collection. | +| body | CollectionItemRequest | yes | Request body | + + +Adds items to a collection specified by its `id`. See `CollectionItemRequest` for the list of attributes needed to add items to an collection. + +*Returned Response:* + + + + +[UpdatedResponse](#UpdatedResponse) + +Status object. Tells whether the operation was successful. + + + + +
    +  Example: + +```json +{ + "message": "items updated" +} +``` +
    + + + + + + + + + +--- + + +#### getCatalogInsights +Analytics data of catalog and inventory. + + + + +```swift +client.application("").catalog.getCatalogInsights(brand: brand) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| brand | String? | no | Brand slug | + + + +Catalog Insights api returns the count of catalog related data like products, brands, departments and categories that have been made live as per configuration of the app. + +*Returned Response:* + + + + +[CatalogInsightResponse](#CatalogInsightResponse) + +Response Data + + + + +
    +  Example: + +```json +{ + "item": { + "count": 637707, + "out_of_stock_count": 452806, + "sellable_count": 184901 + } +} +``` +
    + + + + + + + + + +--- + + +#### getSellerInsights +Analytics data of catalog and inventory that are being cross-selled. + + + + +```swift +client.catalog.getSellerInsights(sellerAppId: sellerAppId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| sellerAppId | String | yes | Id of the seller application which is serving the invetory/catalog of the company | + + + +Analytics data of catalog and inventory that are being cross-selled. + +*Returned Response:* + + + + +[CrossSellingResponse](#CrossSellingResponse) + +Response Data + + + + +
    +  Example: + +```json +{ + "products": 18, + "articles": 18 +} +``` +
    + + + + + + + + + +--- + + +#### createMarketplaceOptin +Create/Update opt-in infomation. + + + + +```swift +client.catalog.createMarketplaceOptin(marketplace: marketplace, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| marketplace | String | yes | The marketplace for which the detail needs to be retrieved. | +| body | OptInPostRequest | yes | Request body | + + +Use this API to create/update opt-in information for given platform. If successful, returns data in the response body as specified in `OptInPostResponseSchema` + +*Returned Response:* + + + + +[UpdatedResponse](#UpdatedResponse) + +See example below or refer `UpdatedResponse` for details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getMarketplaceOptinDetail +Get opt-in infomation. + + + + +```swift +client.catalog.getMarketplaceOptinDetail() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to fetch opt-in information for all the platforms. If successful, returns a logs in the response body as specified in `GetOptInPlatformSchema` + +*Returned Response:* + + + + +[GetOptInPlatform](#GetOptInPlatform) + +See example below or refer `GetOptInPlatformSchema` for details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getCompanyDetail +Get the Company details. + + + + +```swift +client.catalog.getCompanyDetail() { (response, error) in + // Use response +} +``` + + + + + + +Get the details of the company associated with the given company_id passed. + +*Returned Response:* + + + + +[OptinCompanyDetail](#OptinCompanyDetail) + +See example below or refer `OptinCompanyDetailSchema` for details + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getCompanyBrandDetail +Get the Company Brand details of Optin. + + + + +```swift +client.catalog.getCompanyBrandDetail(isActive: isActive, q: q, pageNo: pageNo, pageSize: pageSize, marketplace: marketplace) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| isActive | Bool? | no | The is_active status for the optin id. | +| q | Bool? | no | The search value to filter the list. | +| pageNo | Int? | no | The number of page for the company id. | +| pageSize | Int? | no | Number of records that can be seen on the page for the company id. | +| marketplace | String? | no | The marketplace platform associated with the company id. | + + + +Get the details of the Brands associated with the given company_id passed. + +*Returned Response:* + + + + +[OptinCompanyBrandDetailsView](#OptinCompanyBrandDetailsView) + +See example below or refer `OptinCompanyBrandDetailsView` for details + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getCompanyMetrics +Get the Company metrics + + + + +```swift +client.catalog.getCompanyMetrics() { (response, error) in + // Use response +} +``` + + + + + + +Get the Company metrics associated with the company ID passed. + +*Returned Response:* + + + + +[OptinCompanyMetrics](#OptinCompanyMetrics) + +See example below or refer `OptinCompanyMetrics` for details + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getStoreDetail +Get the Store details. + + + + +```swift +client.catalog.getStoreDetail(q: q, pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| q | String? | no | The search related the store for the company id. | +| pageNo | Int? | no | The number of page for the company id. | +| pageSize | Int? | no | Number of records that can be seen on the page for the company id. | + + + +Get the details of the store associated with the company ID passed. + +*Returned Response:* + + + + +[OptinStoreDetails](#OptinStoreDetails) + +See example below or refer `OptinStoreDetailsSchema` for details + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getGenderAttribute +Get gender attribute details + + + + +```swift +client.catalog.getGenderAttribute(attributeSlug: attributeSlug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| attributeSlug | String | yes | slug of the attribute for which you want to view the genders | + + + +This API allows to view the gender attribute details. + +*Returned Response:* + + + + +[GenderDetail](#GenderDetail) + +Size guide object. See example below or refer `GenderDetailSchema` for details + + + + +
    +  Example: + +```json +{ + "description": "Clothing department needs gener attribute", + "schema": { + "format": "", + "mandatory": false, + "multi": true, + "enum": [ + "Men", + "Women", + "Boy", + "Girl", + "more", + "men" + ], + "type": "str" + }, + "meta": { + "enriched": false, + "mandatory_details": { + "l3_keys": [] + } + }, + "slug": "gender", + "name": "Gender", + "enabled_for_end_consumer": true, + "details": { + "display_type": "text" + }, + "is_nested": true, + "filters": { + "indexing": true, + "priority": 2 + }, + "departments": [ + "men-s-fashion", + "kids", + "women-s-fashion", + "beauty-personal-care" + ], + "logo": "https://hdn-1.addsale.com/x0/products/pictures/attribute/logo/original/Rhv89tqRo-brand-website-logo.png", + "id": "5ed11eb0be8d5e00016f0335" +} +``` +
    + + + + + + + + + +--- + + +#### listProductTemplateCategories +List Department specifiec product categories + + + + +```swift +client.catalog.listProductTemplateCategories(departments: departments, itemType: itemType) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| departments | String | yes | A `department` is name of a departments whose category needs to be listed. Can specify multiple departments. | +| itemType | String | yes | An `item_type` is the type of item, it can be `set`, `standard`, `digital`, etc. | + + + +Allows you to list all product categories values for the departments specified + +*Returned Response:* + + + + +[ProdcutTemplateCategoriesResponse](#ProdcutTemplateCategoriesResponse) + +List of all categories attached to departments specified. See example below or refer `ProdcutTemplateCategoriesResponse` for details + + + + +
    +  Example: + +```json +{ + "page": {}, + "items": [] +} +``` +
    + + + + + + + + + +--- + + +#### listDepartmentsData +List all Departments + + + + +```swift +client.catalog.listDepartmentsData(pageNo: pageNo, pageSize: pageSize, name: name, search: search, isActive: isActive) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results | +| pageSize | Int? | no | Number of items to retrieve in each page. Default is 10. | +| name | String? | no | Can search departments by passing name. | +| search | String? | no | Can search departments by passing name of the department in search parameter. | +| isActive | Bool? | no | Can query for departments based on whether they are active or inactive. | + + + +Allows you to list all departments, also can search using name and filter active and incative departments, and item type + +*Returned Response:* + + + + +[DepartmentsResponse](#DepartmentsResponse) + +List of departments data. See example below or refer `DepartmentsResponse` for details + + + + +
    +  Example: + +```json +{ + "page": { + "current": 1, + "size": 1, + "has_previous": false, + "has_next": false, + "item_total": 12 + }, + "items": [ + { + "uid": 5, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "918793638893_86554", + "user_id": "3" + }, + "created_on": "2020-07-01T05:33:39.325000Z", + "is_active": true, + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/BSQ9Gk_123522-best-starry-sky-wallpaper-1920x1200-ipad-pro.jpgc7d0c15c-c1ff-47eb-8423-6e2df51f2ddf/BSQ9Gk_123522-best-starry-sky-wallpaper-1920x1200-ipad-pro.jpg", + "modified_by": { + "username": "917753852478_51632", + "user_id": "5677" + }, + "modified_on": "2021-03-03T15:55:25.118000Z", + "name": "Sample Dept", + "platforms": {}, + "priority_order": 111, + "slug": "sample-dept", + "synonyms": [ + "test", + "sampe" + ], + "tags": [], + "id": "5efc2033623d390001782238" + }, + { + "uid": 2, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "app@fynd.com", + "user_id": "0" + }, + "created_on": "2020-05-19T06:53:37.629000Z", + "is_active": true, + "logo": "https://hdn-1.addsale.com/addsale/media/logo/department/original/15974_381e2236c2a348cc851c29a5d05c66a9.png", + "modified_by": { + "user_id": "10", + "username": "fahimsakri_gofynd_com_44938" + }, + "modified_on": "2021-03-04T14:01:02.556000Z", + "name": "Men's Fashion", + "platforms": { + "fynd": true, + "fynd_store": true, + "marketplace": true, + "openapi": true, + "uniket_store": true, + "uniket_wholesale": true + }, + "priority_order": 111, + "slug": "men-s-fashion", + "synonyms": [], + "tags": [], + "id": "5ec3827156a7200001c9aeea" + }, + { + "uid": 4, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "fahimsakri_gofynd_com_44938", + "user_id": "10" + }, + "created_on": "2020-06-29T10:59:33.620000Z", + "is_active": true, + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/ywPVrU_preview_a637ca6e4da6e38f03eb0d650ac5d6ba.jpgc73cc22f-b5ee-4fd4-a585-8ada35762d68/ywPVrU_preview_a637ca6e4da6e38f03eb0d650ac5d6ba.jpg", + "modified_by": { + "username": "918793638893_86554", + "user_id": "3" + }, + "modified_on": "2020-08-06T18:08:02.675000Z", + "name": "Groceries", + "platforms": {}, + "priority_order": 10, + "slug": "groceries", + "synonyms": [], + "tags": [], + "id": "5ef9c9959b04f00001e40dba" + }, + { + "uid": 1, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "app@fynd.com", + "user_id": "0" + }, + "created_on": "2020-05-18T16:14:41.689000Z", + "is_active": true, + "logo": "https://hdn-1.addsale.com/x0/platform/pictures/free-logo/original/_G1Z2Fg1L-http:d3p8ifzkmzds37.cloudfront.netmedialogodepartmentoriginal15870_c287d3c2431a432bb0e49363ef6b82bc.png.png", + "modified_by": { + "user_id": "5677", + "username": "917753852478_51632" + }, + "modified_on": "2021-03-04T15:39:38.528000Z", + "name": "Electronics", + "platforms": { + "fynd": true, + "fynd_store": true, + "marketplace": true, + "openapi": true, + "uniket_store": true, + "uniket_wholesale": true + }, + "priority_order": 100, + "slug": "electronics", + "synonyms": [], + "tags": [], + "id": "5ec2b471661a4100019fca0d" + }, + { + "uid": 3, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "918793638893_86554", + "user_id": "3" + }, + "created_on": "2020-05-27T12:04:19.111000Z", + "is_active": true, + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/landscape-banner/original/g2plam_logo_Jio.pngeeb392ca-3958-46a0-9f13-23c205b596f7/g2plam_logo_Jio.png", + "modified_by": { + "username": "918793638893_86554", + "user_id": "3" + }, + "modified_on": "2020-08-06T18:07:46.060000Z", + "name": "Industrial Supplies", + "platforms": {}, + "priority_order": 111, + "slug": "industrial-supplies", + "synonyms": [], + "tags": [], + "id": "5ece5743cd1bae0001440427" + }, + { + "uid": 6, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "abhinavsrivastava_gofynd_com_05674", + "user_id": "13" + }, + "created_on": "2020-07-06T07:56:01.508000Z", + "is_active": false, + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/wTcfEi_crysis_-_1.jpg14580947-a659-486d-b2d3-d2ca025b1cac/wTcfEi_crysis_-_1.jpg", + "modified_by": { + "username": "918793638893_86554", + "user_id": "3" + }, + "modified_on": "2020-08-06T18:08:12.576000Z", + "name": "Clothing", + "platforms": {}, + "priority_order": 1, + "slug": "clothing", + "synonyms": [], + "tags": [], + "id": "5f02d9116b0ae500018923dd" + }, + { + "uid": 8, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "asavarijadhav_gofynd_com_99880", + "user_id": "5634" + }, + "created_on": "2020-08-05T09:04:33.604000Z", + "is_active": true, + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/RxTsd8_0DEFAULT-LOGO.jpg000ccfc1-2f79-4426-9ac3-de2468c2fcb9/RxTsd8_0DEFAULT-LOGO.jpg", + "modified_by": { + "username": "asavarijadhav_gofynd_com_99880", + "user_id": "5634" + }, + "modified_on": "2020-08-05T09:44:01.234000Z", + "name": "Kids", + "platforms": {}, + "priority_order": 3, + "slug": "kids", + "synonyms": [], + "tags": [], + "id": "5f2a762131c66700018cdc47" + }, + { + "uid": 9, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "asavarijadhav_gofynd_com_99880", + "user_id": "5634" + }, + "created_on": "2020-08-05T09:44:46.632000Z", + "is_active": true, + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/tKkDB8_0DEFAULT-LOGO.jpg1c324d4d-f667-4af8-8d98-37205d34e3b5/tKkDB8_0DEFAULT-LOGO.jpg", + "modified_by": { + "username": "918793638893_86554", + "user_id": "3" + }, + "modified_on": "2020-08-06T18:07:35.231000Z", + "name": "Women's Fashion", + "platforms": {}, + "priority_order": 2, + "slug": "women-s-fashion", + "synonyms": [], + "tags": [], + "id": "5f2a7f8e31c66700018cdc49" + }, + { + "uid": 10, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "asavarijadhav_gofynd_com_99880", + "user_id": "5634" + }, + "created_on": "2020-08-05T09:45:12.075000Z", + "is_active": true, + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/oLoxiL_0DEFAULT-LOGO.jpgbd050200-700a-4a3e-9da6-e6b78fbee943/oLoxiL_0DEFAULT-LOGO.jpg", + "modified_by": { + "username": "asavarijadhav_gofynd_com_99880", + "user_id": "5634" + }, + "modified_on": "2020-08-05T09:48:01.660000Z", + "name": "Beauty & Personal Care", + "platforms": {}, + "priority_order": 4, + "slug": "beauty-personal-care", + "synonyms": [], + "tags": [], + "id": "5f2a7fa831c66700018cdc4a" + }, + { + "uid": 11, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "asavarijadhav_gofynd_com_99880", + "user_id": "5634" + }, + "created_on": "2020-08-05T09:45:39.797000Z", + "is_active": true, + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/vQv4ot_0DEFAULT-LOGO.jpg701cb5af-2024-4abf-ae5d-b68bc1a3cd43/vQv4ot_0DEFAULT-LOGO.jpg", + "modified_by": { + "username": "918793638893_86554", + "user_id": "3" + }, + "modified_on": "2020-08-06T11:38:57.599000Z", + "name": "Home & Living", + "platforms": {}, + "priority_order": 5, + "slug": "home-living", + "synonyms": [], + "tags": [], + "id": "5f2a7fc331c66700018cdc4b" + }, + { + "uid": 14, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "asavarijadhav_gofynd_com_99880", + "user_id": "5634" + }, + "created_on": "2020-08-05T09:48:42.347000Z", + "is_active": false, + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/hTobjV_0DEFAULT-LOGO.jpga020159c-7fe7-4c1c-a11a-4be61a60da9f/hTobjV_0DEFAULT-LOGO.jpg", + "modified_by": { + "username": "asavarijadhav_gofynd_com_99880", + "user_id": "5634" + }, + "modified_on": "2020-08-05T09:48:42.347000Z", + "name": "Baby Care & Kids Essentials", + "platforms": {}, + "priority_order": 7, + "slug": "baby-care-kids-essentials", + "synonyms": [], + "tags": [], + "id": "5f2a807a31c66700018cdc4e" + }, + { + "_cls": "Department", + "created_on": "2021-01-13T10:12:33.002000Z", + "modified_on": "2021-01-13T13:50:55.415000Z", + "created_by": { + "username": "919821012599_75351", + "user_id": "5721" + }, + "modified_by": { + "username": "919821012599_75351", + "user_id": "5721" + }, + "uid": 21, + "name": "Skin care products", + "slug": "skin-care-produts", + "logo": "https://hdn-1.addsale.com/x0/department/pictures/square-logo/original/rNz8grLys-.png", + "tags": [], + "is_active": true, + "priority_order": 10235, + "platforms": {}, + "synonyms": [ + "skin", + "care" + ], + "_custom_json": {}, + "id": "5ffec79192813f0001eb6560" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getDepartmentData +Get specific departments details by passing in unique id of the department + + + + +```swift +client.catalog.getDepartmentData(uid: uid) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| uid | String | yes | A `uid` is a unique identifier of a department. | + + + +Allows you to get department data, by uid + +*Returned Response:* + + + + +[DepartmentsResponse](#DepartmentsResponse) + +Departments Data. See example below or refer `DepartmentsResponse` for details + + + + +
    +  Example: + +```json +{ + "page": {}, + "items": [ + { + "uid": 5, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "918793638893_86554", + "user_id": "3" + }, + "created_on": "2020-07-01T05:33:39.325000Z", + "is_active": true, + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/BSQ9Gk_123522-best-starry-sky-wallpaper-1920x1200-ipad-pro.jpgc7d0c15c-c1ff-47eb-8423-6e2df51f2ddf/BSQ9Gk_123522-best-starry-sky-wallpaper-1920x1200-ipad-pro.jpg", + "modified_by": { + "username": "917753852478_51632", + "user_id": "5677" + }, + "modified_on": "2021-03-03T15:55:25.118000Z", + "name": "Sample Dept", + "platforms": {}, + "priority_order": 111, + "slug": "sample-dept", + "synonyms": [ + "test", + "sampe" + ], + "tags": [], + "id": "5efc2033623d390001782238" + }, + { + "uid": 2, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "app@fynd.com", + "user_id": "0" + }, + "created_on": "2020-05-19T06:53:37.629000Z", + "is_active": true, + "logo": "https://hdn-1.addsale.com/addsale/media/logo/department/original/15974_381e2236c2a348cc851c29a5d05c66a9.png", + "modified_by": { + "user_id": "10", + "username": "fahimsakri_gofynd_com_44938" + }, + "modified_on": "2021-03-04T14:01:02.556000Z", + "name": "Men's Fashion", + "platforms": { + "fynd": true, + "fynd_store": true, + "marketplace": true, + "openapi": true, + "uniket_store": true, + "uniket_wholesale": true + }, + "priority_order": 111, + "slug": "men-s-fashion", + "synonyms": [], + "tags": [], + "id": "5ec3827156a7200001c9aeea" + }, + { + "uid": 4, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "fahimsakri_gofynd_com_44938", + "user_id": "10" + }, + "created_on": "2020-06-29T10:59:33.620000Z", + "is_active": true, + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/ywPVrU_preview_a637ca6e4da6e38f03eb0d650ac5d6ba.jpgc73cc22f-b5ee-4fd4-a585-8ada35762d68/ywPVrU_preview_a637ca6e4da6e38f03eb0d650ac5d6ba.jpg", + "modified_by": { + "username": "918793638893_86554", + "user_id": "3" + }, + "modified_on": "2020-08-06T18:08:02.675000Z", + "name": "Groceries", + "platforms": {}, + "priority_order": 10, + "slug": "groceries", + "synonyms": [], + "tags": [], + "id": "5ef9c9959b04f00001e40dba" + }, + { + "uid": 1, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "app@fynd.com", + "user_id": "0" + }, + "created_on": "2020-05-18T16:14:41.689000Z", + "is_active": true, + "logo": "https://hdn-1.addsale.com/x0/platform/pictures/free-logo/original/_G1Z2Fg1L-http:d3p8ifzkmzds37.cloudfront.netmedialogodepartmentoriginal15870_c287d3c2431a432bb0e49363ef6b82bc.png.png", + "modified_by": { + "user_id": "5677", + "username": "917753852478_51632" + }, + "modified_on": "2021-03-04T15:39:38.528000Z", + "name": "Electronics", + "platforms": { + "fynd": true, + "fynd_store": true, + "marketplace": true, + "openapi": true, + "uniket_store": true, + "uniket_wholesale": true + }, + "priority_order": 100, + "slug": "electronics", + "synonyms": [], + "tags": [], + "id": "5ec2b471661a4100019fca0d" + }, + { + "uid": 3, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "918793638893_86554", + "user_id": "3" + }, + "created_on": "2020-05-27T12:04:19.111000Z", + "is_active": true, + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/landscape-banner/original/g2plam_logo_Jio.pngeeb392ca-3958-46a0-9f13-23c205b596f7/g2plam_logo_Jio.png", + "modified_by": { + "username": "918793638893_86554", + "user_id": "3" + }, + "modified_on": "2020-08-06T18:07:46.060000Z", + "name": "Industrial Supplies", + "platforms": {}, + "priority_order": 111, + "slug": "industrial-supplies", + "synonyms": [], + "tags": [], + "id": "5ece5743cd1bae0001440427" + }, + { + "uid": 6, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "abhinavsrivastava_gofynd_com_05674", + "user_id": "13" + }, + "created_on": "2020-07-06T07:56:01.508000Z", + "is_active": false, + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/wTcfEi_crysis_-_1.jpg14580947-a659-486d-b2d3-d2ca025b1cac/wTcfEi_crysis_-_1.jpg", + "modified_by": { + "username": "918793638893_86554", + "user_id": "3" + }, + "modified_on": "2020-08-06T18:08:12.576000Z", + "name": "Clothing", + "platforms": {}, + "priority_order": 1, + "slug": "clothing", + "synonyms": [], + "tags": [], + "id": "5f02d9116b0ae500018923dd" + }, + { + "uid": 8, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "asavarijadhav_gofynd_com_99880", + "user_id": "5634" + }, + "created_on": "2020-08-05T09:04:33.604000Z", + "is_active": true, + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/RxTsd8_0DEFAULT-LOGO.jpg000ccfc1-2f79-4426-9ac3-de2468c2fcb9/RxTsd8_0DEFAULT-LOGO.jpg", + "modified_by": { + "username": "asavarijadhav_gofynd_com_99880", + "user_id": "5634" + }, + "modified_on": "2020-08-05T09:44:01.234000Z", + "name": "Kids", + "platforms": {}, + "priority_order": 3, + "slug": "kids", + "synonyms": [], + "tags": [], + "id": "5f2a762131c66700018cdc47" + }, + { + "uid": 9, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "asavarijadhav_gofynd_com_99880", + "user_id": "5634" + }, + "created_on": "2020-08-05T09:44:46.632000Z", + "is_active": true, + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/tKkDB8_0DEFAULT-LOGO.jpg1c324d4d-f667-4af8-8d98-37205d34e3b5/tKkDB8_0DEFAULT-LOGO.jpg", + "modified_by": { + "username": "918793638893_86554", + "user_id": "3" + }, + "modified_on": "2020-08-06T18:07:35.231000Z", + "name": "Women's Fashion", + "platforms": {}, + "priority_order": 2, + "slug": "women-s-fashion", + "synonyms": [], + "tags": [], + "id": "5f2a7f8e31c66700018cdc49" + }, + { + "uid": 10, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "asavarijadhav_gofynd_com_99880", + "user_id": "5634" + }, + "created_on": "2020-08-05T09:45:12.075000Z", + "is_active": true, + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/oLoxiL_0DEFAULT-LOGO.jpgbd050200-700a-4a3e-9da6-e6b78fbee943/oLoxiL_0DEFAULT-LOGO.jpg", + "modified_by": { + "username": "asavarijadhav_gofynd_com_99880", + "user_id": "5634" + }, + "modified_on": "2020-08-05T09:48:01.660000Z", + "name": "Beauty & Personal Care", + "platforms": {}, + "priority_order": 4, + "slug": "beauty-personal-care", + "synonyms": [], + "tags": [], + "id": "5f2a7fa831c66700018cdc4a" + }, + { + "uid": 11, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "asavarijadhav_gofynd_com_99880", + "user_id": "5634" + }, + "created_on": "2020-08-05T09:45:39.797000Z", + "is_active": true, + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/vQv4ot_0DEFAULT-LOGO.jpg701cb5af-2024-4abf-ae5d-b68bc1a3cd43/vQv4ot_0DEFAULT-LOGO.jpg", + "modified_by": { + "username": "918793638893_86554", + "user_id": "3" + }, + "modified_on": "2020-08-06T11:38:57.599000Z", + "name": "Home & Living", + "platforms": {}, + "priority_order": 5, + "slug": "home-living", + "synonyms": [], + "tags": [], + "id": "5f2a7fc331c66700018cdc4b" + }, + { + "uid": 14, + "_cls": "Department", + "_custom_json": {}, + "created_by": { + "username": "asavarijadhav_gofynd_com_99880", + "user_id": "5634" + }, + "created_on": "2020-08-05T09:48:42.347000Z", + "is_active": false, + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/hTobjV_0DEFAULT-LOGO.jpga020159c-7fe7-4c1c-a11a-4be61a60da9f/hTobjV_0DEFAULT-LOGO.jpg", + "modified_by": { + "username": "asavarijadhav_gofynd_com_99880", + "user_id": "5634" + }, + "modified_on": "2020-08-05T09:48:42.347000Z", + "name": "Baby Care & Kids Essentials", + "platforms": {}, + "priority_order": 7, + "slug": "baby-care-kids-essentials", + "synonyms": [], + "tags": [], + "id": "5f2a807a31c66700018cdc4e" + }, + { + "_cls": "Department", + "created_on": "2021-01-13T10:12:33.002000Z", + "modified_on": "2021-01-13T13:50:55.415000Z", + "created_by": { + "username": "919821012599_75351", + "user_id": "5721" + }, + "modified_by": { + "username": "919821012599_75351", + "user_id": "5721" + }, + "uid": 21, + "name": "Skin care products", + "slug": "skin-care-produts", + "logo": "https://hdn-1.addsale.com/x0/department/pictures/square-logo/original/rNz8grLys-.png", + "tags": [], + "is_active": true, + "priority_order": 10235, + "platforms": {}, + "synonyms": [ + "skin", + "care" + ], + "_custom_json": {}, + "id": "5ffec79192813f0001eb6560" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### listProductTemplate +List all Templates + + + + +```swift +client.catalog.listProductTemplate(department: department) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| department | String | yes | A `department` is the name of a particular department. | + + + +Allows you to list all product templates, also can filter by department + +*Returned Response:* + + + + +[TemplatesResponse](#TemplatesResponse) + +List of product templates. See example below or refer `TemplatesResponse` for details + + + + +
    +  Example: + +```json +{ + "page": { + "current": 1, + "size": 3, + "has_previous": false, + "has_next": true, + "item_total": 36 + }, + "items": [ + { + "name": "Accessories", + "categories": [ + "accessories-adornments", + "messenger-bags", + "wallets", + "satchels", + "backpacks", + "laptop-bags", + "briefcases", + "suitcases", + "duffles", + "analog-watches", + "chronograph-watches", + "digital-watches", + "aviators", + "wayfarers", + "round-sunglasses", + "cateye-sunglasses", + "rectangle-sunglasses", + "oversized-sunglasses", + "browline-sunglasses", + "square-sunglasses", + "sports-sunglasses", + "belts", + "ties", + "cufflinks", + "pocket-squares", + "tie-pins", + "brooches", + "baseball-caps", + "hats", + "shawls", + "mufflers", + "stoles", + "socks", + "dupattas", + "handbags", + "clutches", + "totes", + "sling-bags", + "hobos", + "scarves", + "stockings", + "hairbands", + "hair-clips", + "pouches", + "oval-sunglasses", + "gloves", + "frames", + "maang-tikka", + "bags", + "sunglasses", + "mittens", + "money-clips", + "card-cases", + "brushes", + "horns", + "spray", + "cleaner", + "cream", + "polishes", + "decoration-charms", + "care-kits", + "trees", + "shoe-bag", + "laces", + "insoles", + "handkerchief", + "toy-box", + "play-gym", + "camera-bag", + "fanny-pack", + "usb-cable", + "rca-cable", + "usb-c-to-multiport-adapter", + "batteries", + "power-banks", + "lightning-cable", + "tos-cable", + "aux-cable", + "hdmi-cable", + "charging-cable", + "mini-display-port-hdmi-cable", + "thunderbolt-cable", + "bluetooth-headphones", + "headphone", + "bluetooth-earphones", + "earphones", + "hard-disk-drive", + "photo-frame", + "notebook", + "pen", + "luggage-tag", + "stationery-combo", + "jewellery-case", + "folder", + "key-chain", + "suspender", + "cummerbund", + "cravet", + "toiletry-bag", + "cosmetic-bag", + "gift-bag", + "packaging-material", + "spectacle-case", + "cuff-bands", + "playing-cards", + "kalangi", + "kataar", + "safa", + "watch-case", + "paper-weight", + "caps", + "visor-caps", + "bucket-hats", + "beanie-caps", + "cowboy-hats", + "gatsby-caps", + "fedora-hats", + "rain-cover", + "round-glasses", + "rectangle-glasses", + "cateye-glasses", + "aviator-glasses", + "square-glasses", + "oval-glasses", + "almond-glasses", + "wayfarer-glasses", + "toric-contact-lenses", + "daily-disposable", + "monthly-reusable", + "multifocal-varifocal", + "solutions-accessories", + "coloured-lenses" + ], + "description": "This is the file validation template for the fashion department and accessories category.", + "departments": [ + "electronics", + "men", + "women", + "kids", + "toys" + ], + "attributes": [ + "gender", + "age-group", + "occasion", + "collection", + "season", + "color", + "material", + "product_type", + "pattern", + "closure_type", + "product_length", + "feature", + "care_instructions", + "package_contents", + "essential", + "gst-inclusive", + "gst-if-exclusive", + "fragile", + "manufacturer-packer-importer-name", + "manufacturer-packer-importer-address" + ], + "slug": "accessories", + "banner": "https://hdn-1.fynd.com/seller/pictures/landscape-banner/original/F4W6Pd_DEFAULT-BANNER_LANDSCAPE.jpgd54cb24d-dd2c-441c-bca0-8f65ea3b101c/F4W6Pd_DEFAULT-BANNER_LANDSCAPE.jpg", + "logo": "https://hdn-1.fynd.com/seller/pictures/logo/original/hkE1dC_0DEFAULT-LOGO.jpgfb5b1b31-9449-43db-9049-435fec88ee77/hkE1dC_0DEFAULT-LOGO.jpg", + "is_physical": true, + "id": "5f04a23544a2e5404274bc07" + }, + { + "slug": "all-attributes-template", + "categories": [ + "hd-television" + ], + "banner": "https://hdn-1.addsale.com/x0/seller/pictures/landscape-banner/original/tBqIbw_dj.jpg0b8e229f-45bd-4a96-97a5-3e5b193828d2/tBqIbw_dj.jpg", + "name": "All attributes Template", + "attributes": [ + "test-attribute-3", + "test-attribute", + "test-attribute-1", + "test-attribute-4", + "gender", + "neck-type", + "qwertyu", + "testtt-attribute-5", + "storage_humidity", + "operating_humidity", + "certifications", + "aspect_ratio", + "storage_temperature", + "memory_details", + "cache_memory", + "operating_temperature", + "expansion_slots", + "included_software", + "web_camera", + "video_memory", + "optical_drive", + "hard_drive_speed", + "hard_drive_type", + "hard_drive", + "speaker_type", + "core_type", + "processor_core", + "processor_model_number", + "processor_speed", + "processor_brand", + "processor_sub_brand", + "battery_cell", + "laptop_type", + "graphics_card_model", + "accessories", + "services", + "promotion_freebie", + "action", + "home_delivery", + "colour_reproduction", + "brightness", + "data_transfer_on_cloud", + "card_reader", + "battery_filter", + "volumetric_weight_in_kg", + "price_filter", + "brands_filter", + "number_of_usb_ports_filter", + "number_of_hdmi_ports_filter", + "smart_tv_filter", + "resolution_filter", + "display_technology", + "panel_type", + "record_as_you_watch", + "schedule_recording", + "no_of_channels", + "additional_side_panel_ports", + "response_time", + "contrast_ratio", + "hdmi_arc", + "tv_operating_system", + "refresh_rate", + "connect_to_router_via", + "connect_to_home_theatre_via", + "no_of_hdmi_ports", + "no_of_usb_ports", + "standby_power_consumption", + "connect_to_set_top_box_via", + "stream_content_from_devices", + "surround_sound_technology", + "tv_speaker_type", + "graphics_card_sub_brand", + "hdr", + "power_supply", + "power_consumption", + "connect_to_dvd_players_via", + "graphics_card_brand", + "rated_speaker_output_power_rms", + "3d_technology", + "optimized_heat_dissipation", + "backlit_keyboard_support", + "ethernet_lan_support", + "hdmi_support", + "anti_glare_screen", + "phone_network_and_connectivity", + "storage_filter", + "ram_filter", + "pallet", + "waterproof", + "selfie_camera_filter", + "primary_camera_filter", + "screen_size_filter", + "battery_power_features", + "in_the_box_warranty", + "features", + "screen_display_camera", + "phone_battery_charge_time", + "network_inter_device_connectivity", + "phone_os", + "phone_build_convenience", + "phone_hardware_storage", + "testcomparsion", + "country_of_origin", + "manufacturer_packer_importer_address", + "manufacturer_packer_importer_name", + "warranty_type", + "dlna_compliant", + "user_guides_attachment", + "resq_support_guide_attachment", + "water_resistant", + "speaker_support", + "fm_radio", + "nfc_support", + "package_content", + "talk_time", + "standby_time", + "quick_charge", + "preloaded_apps", + "metal_frame", + "touch_screen", + "glass_type", + "meta_description", + "short_description", + "is_flammable", + "transfer_price_tp", + "screen_size", + "bluetooth", + "wi_fi", + "3g", + "internal_storage", + "in_the_box", + "memory_ram", + "4g", + "usb", + "otg_support", + "edge", + "nfc", + "microphone", + "dummy_int", + "product_details", + "subtitle", + "general_information", + "expandable", + "style_note", + "is_waterproof", + "brand_name", + "color", + "model", + "product_type", + "series", + "product_identifiers", + "style", + "sub_brand", + "socks_length", + "heel_height", + "occasion", + "storage", + "season", + "processor", + "collection", + "storage_type", + "topwear_length", + "bottomwear_length", + "denim_type", + "boot_length", + "dial_shape", + "thickness", + "lens_colour", + "sensors", + "dial_colour", + "material", + "usb_support", + "fingerprint_recognition", + "strap_type", + "operating_system", + "frame_style", + "brand_rating", + "operating_system_type", + "4g_bands", + "strap_colour", + "4g_support", + "2g_bands", + "frame_colour", + "video_formats", + "3g_bands", + "feature", + "3g_support", + "movement_type", + "bluetooth_version", + "pattern", + "wi_fi_support", + "bluetooth_support", + "inner_material", + "selfie_camera", + "closure_type", + "screen_resolution", + "product_fit", + "screen_size_diagonal", + "dimensions", + "display_type", + "plating", + "primary_camera", + "toe_type", + "dual_camera_rear", + "clasp_type", + "ram", + "padding", + "microphone_support", + "sim_type", + "capacity", + "arch_type", + "stone_type", + "warranty_description", + "additional_connectivity", + "compartments", + "audio_formats", + "sleeve_type", + "audio_jack", + "diameter", + "battery_capacity", + "sleeve_length", + "battery_operated", + "product_length", + "battery_run_time", + "neck_type", + "battery_type", + "collar_type", + "battery_voltage", + "cellular_technology", + "waist_rise", + "edge_support", + "coverage", + "expandable_memory", + "package_contents", + "gprs_support", + "care_instructions", + "hybrid_sim_slot", + "model_info", + "variant", + "warranty", + "complexion", + "skin_type", + "spf", + "speciality", + "finish", + "lasting_power", + "benefits", + "hair_type", + "fragrance_family", + "fragrance_type", + "product_format", + "active_ingredients", + "ingredients", + "how_to_use", + "shelf_life", + "safety_warning", + "testtt-attribute-6" + ], + "departments": [ + "electronics" + ], + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/7V0z2B_dj.jpg21ac07ea-9f83-403e-ad37-69076c6c5c46/7V0z2B_dj.jpg", + "description": "Blah Blah", + "is_physical": true, + "id": "5ed5f84d2abe0f0001174d73" + }, + { + "name": "Baby Care & Toys", + "categories": [ + "kids-puzzles", + "kids-shirts" + ], + "description": "This is the file validation template for the Baby Care & Toys department.", + "departments": [ + "baby-care-kids-essentials", + "toys", + "kids" + ], + "attributes": [ + "gender", + "age-group", + "occasion", + "collection", + "season", + "color", + "material", + "product_type", + "no-of-pieces", + "battery_operated", + "is-portable", + "is_flammable", + "capacity", + "carrying-capacity", + "inner-dimension", + "seat-dimension", + "package_contents", + "additional-features", + "certification", + "essential", + "gst-inclusive", + "gst-if-exclusive", + "fragile", + "manufacturer-packer-importer-name", + "manufacturer-packer-importer-address" + ], + "slug": "baby-care-toys", + "banner": "https://hdn-1.fynd.com/seller/pictures/landscape-banner/original/Ikt1sK_DEFAULT-BANNER_LANDSCAPE.jpg7f923d3d-abc9-4a2e-9a49-204a36e1073c/Ikt1sK_DEFAULT-BANNER_LANDSCAPE.jpg", + "logo": "https://hdn-1.fynd.com/seller/pictures/logo/original/saEu9Z_0DEFAULT-LOGO.jpg4cd36f29-a15b-4ec1-ab33-1162ede2c61f/saEu9Z_0DEFAULT-LOGO.jpg", + "is_physical": true, + "id": "5f04a24944a2e5404274bc09" + }, + { + "name": "Bags", + "categories": [ + "seal-bags", + "reusable-bag", + "poly-bag", + "shoe-bag", + "sling-bags", + "bags" + ], + "description": "This is the file validation template for the fashion department and bags category.", + "departments": [ + "kids", + "women", + "men" + ], + "attributes": [ + "gender", + "age-group", + "color", + "outer-material", + "inner_material", + "product_type", + "collection", + "occasion", + "season", + "pattern", + "closure_type", + "care_instructions", + "compartments", + "expandable", + "water-resistence", + "water-resistence-details", + "water-proof", + "water-proof-details", + "warranty_type", + "warranty_description", + "package_contents", + "essential", + "gst-inclusive", + "gst-if-exclusive", + "fragile", + "manufacturer-packer-importer-name", + "manufacturer-packer-importer-address" + ], + "slug": "bags", + "banner": "https://hdn-1.fynd.com/seller/pictures/landscape-banner/original/ejcGMm_DEFAULT-BANNER_LANDSCAPE.jpg658c38fd-d6de-4fcf-9f0e-3a886b2e2225/ejcGMm_DEFAULT-BANNER_LANDSCAPE.jpg", + "logo": "https://hdn-1.fynd.com/seller/pictures/logo/original/GIysAV_0DEFAULT-LOGO.jpgf1942433-2bcb-4939-9128-675f66cd6d70/GIysAV_0DEFAULT-LOGO.jpg", + "is_physical": true, + "id": "5f04a24a44a2e5404274bc0b" + }, + { + "modified_on": "2020-08-19T04:04:30.421000Z", + "logo": "https://hdn-1.addsale.com/x0/products/pictures/template/logo/original/fW2zqHspe-q1.png", + "created_on": "2020-08-19T04:04:30.421000Z", + "banner": "https://hdn-1.addsale.com/x0/products/pictures/template/banner/original/_YRvLuMDn-q1.jpeg", + "attributes": [ + "base-material" + ], + "modified_by": { + "username": "fahimsakri_gofynd_com_44938", + "user_id": "10" + }, + "departments": [ + "men-s-fashion", + "kids", + "women-s-fashion", + "beauty-personal-care" + ], + "slug": "base-template", + "description": "ad", + "name": "Base Template", + "categories": [ + "adcdas" + ], + "created_by": { + "username": "fahimsakri_gofynd_com_44938", + "user_id": "10" + }, + "is_physical": true, + "id": "5f3ca4ce3f7e74000111925f" + }, + { + "description": "This is the file validation template for the Beauty & Personal Care department. ", + "name": "Beauty & Personal Care", + "slug": "beauty-personal-care", + "departments": [ + "beauty-personal-care" + ], + "attributes": [ + "gender", + "age-group", + "occasion", + "collection", + "season", + "color", + "product_type", + "complexion", + "skin_type", + "spf", + "speciality", + "finish", + "lasting_power", + "coverage", + "hair_type", + "fragrance_family", + "fragrance_type", + "closure_type", + "capacity", + "product_format", + "active_ingredients", + "benefits", + "how-to-use", + "shelf_life", + "safety_warning", + "mask_type", + "material", + "adjustable", + "reusable", + "foldable", + "filtration", + "compatible_filter", + "package_contents", + "warranty_type", + "warranty_description", + "essential", + "gst-inclusive", + "gst-if-exclusive", + "fragile", + "manufacturer-packer-importer-name", + "manufacturer-packer-importer-address" + ], + "categories": [ + "foundation", + "concealer", + "mascara", + "kajal", + "eyeshadow", + "false-eyelashes", + "eyebrow-enhancer", + "eyeliner", + "personal-care-gift-sets", + "primer", + "compact", + "hair-removal-cream", + "lip-liner", + "nail-polish-remover", + "liquid-lipstick", + "lipstick", + "nail-polish", + "moisturizing-socks", + "hand-cream", + "sindoor", + "crayon-lipstick", + "eye-brushes", + "manicure-kits", + "lip-gloss", + "makeup-remover", + "nail-art-kit", + "foot-cream", + "bb-cream", + "brush-sets", + "pedicure-kits", + "face-brushes", + "highlighters", + "lip-balm", + "lip-brushes", + "sunscreen", + "trimmer", + "facial-kits", + "colour-contact-lens", + "body-wash", + "toners", + "cleanser", + "epilator", + "eye-gels", + "face-wash", + "eye-masks", + "eye-creams", + "facial-wipes", + "masks", + "perfume", + "moisturizer", + "serum", + "night-cream", + "shoe-deodorant", + "razor", + "soaps", + "body-scrubs", + "day-cream", + "deodorants", + "eye-roll-on", + "eye-serums", + "attar", + "bath-sets", + "bathing-accessories", + "scrubs", + "sets", + "underarm-roll-on", + "wax-strips", + "body-creams", + "body-lotions", + "talcum-powders", + "body-butters", + "body-mousse", + "hair-brushes", + "combs", + "hair-spa", + "hair-colour", + "hair-spa-kits", + "hair-cream", + "hair-extensions", + "anti-stretch-mark-cream", + "body-oils", + "body-souffles", + "conditioner", + "hair-accessories", + "hair-oil", + "hair-serum", + "hair-spray", + "shampoo", + "body-mists", + "body-sprays", + "liquid-soap", + "beard-oil", + "beard-colour", + "beard-wash", + "beard-balm", + "nail-cutter", + "home-fragrance", + "gift-set", + "hand-soap", + "hand-sanitizer", + "face-oil", + "body-massage-balm", + "face-gel", + "face-mist", + "bath-oil", + "insect-repellent", + "anti-ageing-cream", + "bath-salt", + "anti-acne-cream", + "face-massage-cream", + "whitening-cream", + "anti-wrinkle-cream", + "foot-spray", + "anti-blemish-cream", + "blush", + "makeup-fixer", + "makeup-kit", + "sponge", + "foot-scrub", + "eyeshadow-palette", + "cc-cream", + "eye-wipes", + "head-wrap", + "patches", + "nipple-butter", + "pillow-spray", + "pillow-roll-on", + "fragrance-plug", + "pain-relief-balm", + "headache-roll-on", + "mirror", + "toilet-seat-spray", + "intimate-wash", + "massager", + "makeup-accessories", + "pillow", + "nail-accessories", + "sanitary-napkins", + "protective-mask", + "kohl-kajal", + "natural-lipstick", + "pearl-lipstick", + "creme-lipstick", + "matte-lipstick", + "glossy-lipstick", + "compact-spray", + "compact-stick", + "compact-powder", + "highlighter-cake", + "blush-highlighter", + "kajal-stick", + "compact-cake", + "roll-on-kajal-pencil", + "liquid-compact", + "stick-highlighter", + "kajal-pencil", + "gel-kajal", + "liquid-glossy-lipstick", + "liquid-matte-lipstick", + "crayon-matte-lipstick", + "liquid-creme-lipstick", + "crayon-glossy-lipstick", + "natural-lip-gloss", + "liquid-natural-lipstick", + "crayon-creme-lipstick", + "pearl-lip-gloss", + "liquid-pearl-lipstick", + "crayon-natural-lipstick", + "liquid-highlighter", + "crayon-pearl-lipstick", + "glossy-lip-gloss", + "matte-lip-gloss", + "creme-lip-gloss", + "eye-concealer", + "object-disinfectant", + "face-disinfectant", + "vegetable-fruit-wash", + "infrared-thermometer", + "safety-goggle", + "personal-protective-equipment-kit", + "examination-gloves", + "face-shield" + ], + "banner": "https://hdn-1.fynd.com/seller/pictures/landscape-banner/original/ZxNlYp_DEFAULT-BANNER_LANDSCAPE.jpg66a71bf3-c1a7-4aa0-98e6-f2a837caa59a/ZxNlYp_DEFAULT-BANNER_LANDSCAPE.jpg", + "logo": "https://hdn-1.fynd.com/seller/pictures/logo/original/OInLCX_0DEFAULT-LOGO.jpg03aeaeb8-2d04-4694-b641-f60fbdea5c4d/OInLCX_0DEFAULT-LOGO.jpg", + "is_physical": true, + "id": "5f05b34844a2e571575f3047" + }, + { + "name": "Clothing", + "categories": [ + "casual-shirts", + "formal-shirts", + "sweaters", + "sweatshirts", + "hoodies", + "cardigans", + "suits", + "front-open-jackets", + "blazers", + "waistcoats", + "jeans", + "chinos", + "cargos", + "corduroys", + "formal-trousers", + "3-4ths", + "trunks", + "boardshorts", + "rashguard", + "briefs", + "trackpants", + "tracksuits", + "joggers", + "t-shirts", + "shorts", + "gowns", + "blouson-top", + "tunics", + "corsets", + "kaftan-top", + "shift-dress", + "jumpsuits", + "jeggings", + "skirts", + "palazzos", + "culottes", + "leggings", + "shrugs", + "sports-bra", + "bikinis", + "swimsuit", + "sarong", + "kaftan", + "shapewear", + "camisole", + "activewear-tops", + "tights", + "yoga-pants", + "capris", + "harem", + "bomber-jackets", + "gilet", + "leather-jackets", + "polos", + "bodycon-dress", + "off-shoulder-dress", + "skater-dress", + "maxi-dress", + "sheath-dress", + "sweater-dress", + "tube-dress", + "slip-dress", + "asymmetric-dress", + "bodysuit", + "peplum-top", + "crop-top", + "tiered-dress", + "maxi-top", + "tank-top", + "tube-top", + "strappy-top", + "activewear-jackets", + "denim-jackets", + "windcheater", + "peplum-dress", + "off-shoulder-top", + "shirt-dress", + "kids-shirts", + "twin-sets", + "dungarees", + "trousers", + "western-jackets", + "frocks", + "dresses", + "tops", + "casual-pants", + "beachwear-bottoms", + "coat", + "fusion-set", + "indowestern-kurta", + "tapered-jeans", + "joggers-jeans", + "straight-chinos", + "tapered-chinos", + "double-breasted-suits", + "activewear-crop-tops", + "flat-front-formal-trousers", + "pleated-formal-trousers", + "straight-formal-trousers", + "straight-jeans", + "flared-jeans", + "tapered-formal-trousers", + "straight-skirt", + "flared-skirt", + "asymmetric-skirt", + "pleated-corduroys", + "tapered-corduroys", + "straight-corduroys", + "cropped-chinos", + "cropped-corduroys", + "bootcut-jeans", + "drop-crotch-jeans", + "cropped-jeans", + "bootcut-formal-trousers", + "cropped-formal-trousers", + "five-buttoned-suits", + "tuxedo-suits", + "one-buttoned-suits", + "two-buttoned-suits", + "four-buttoned-suits", + "three-buttoned-suits", + "pleated-chinos", + "pleated-jeans", + "beachwear-bikini-tops", + "pleated-skirt", + "flared-formal-trousers", + "activewear-tank-tops", + "beachwear-bikini-bottoms", + "pencil-skirt", + "activewear-blouse", + "casual-joggers" + ], + "description": "This is the file validation template for the fashion department and clothing category.", + "departments": [ + "men", + "women", + "kids", + "clothing" + ], + "attributes": [ + "gender", + "age-group", + "color", + "material", + "occasion", + "collection", + "season", + "product_fit", + "product_type", + "product_length", + "pattern", + "sleeve_type", + "sleeve_length", + "closure_type", + "neck_type", + "waist_rise", + "denim-fade", + "care_instructions", + "package_contents", + "number-of-pockets", + "model_info", + "essential", + "gst-inclusive", + "gst-if-exclusive", + "fragile", + "manufacturer-packer-importer-name", + "manufacturer-packer-importer-address" + ], + "slug": "clothing", + "banner": "https://hdn-1.fynd.com/seller/pictures/landscape-banner/original/720R34_DEFAULT-BANNER_LANDSCAPE.jpga765babe-cfaa-4cc5-9da7-f4e1402fa97e/720R34_DEFAULT-BANNER_LANDSCAPE.jpg", + "logo": "https://hdn-1.fynd.com/seller/pictures/logo/original/jKZEs7_0DEFAULT-LOGO.jpg78413c0a-11a8-43f8-88ad-1442e9fdb898/jKZEs7_0DEFAULT-LOGO.jpg", + "is_physical": true, + "id": "5f04a25044a2e5404274bc0e" + }, + { + "description": "asdd", + "attributes": [ + "color", + "warranty_type", + "care_instructions" + ], + "modified_on": "2020-08-20T16:15:33.598000Z", + "modified_by": { + "username": "fahimsakri_gofynd_com_44938", + "user_id": "10" + }, + "name": "FA-Template", + "categories": [ + "vision-qa-f9447f89-d2da-41fc-ac33-b9f286308c14" + ], + "logo": "https://hdn-1.addsale.com/x0/products/pictures/template/logo/original/fW2zqHspe-q1.png", + "departments": [ + "electronics" + ], + "banner": "https://hdn-1.addsale.com/x0/products/pictures/template/banner/original/L_u77Mz4T-FA-Template.png", + "slug": "fa-template", + "created_on": "2020-08-19T09:51:08.215000Z", + "created_by": { + "username": "fahimsakri_gofynd_com_44938", + "user_id": "10" + }, + "is_physical": true, + "id": "5f3cf60c9788cc00018ab276" + }, + { + "name": "Footwear", + "categories": [ + "sneakers", + "running-shoes", + "hiking-shoes", + "football-shoes", + "indoor-sports-shoes", + "trainers", + "outdoor-sports-shoes", + "moccasins", + "loafers", + "boat-shoes", + "brogues", + "derby-shoes", + "oxfords", + "monk-strap-shoes", + "lace-ups", + "formal-slip-ons", + "boots", + "sandals", + "flip-flops", + "floaters", + "d-orsay", + "espadrilles", + "pointed-toe", + "flat-slip-ons", + "gladiators", + "flat-sandals", + "stilettos", + "wedges", + "block-heels", + "kitten-heels", + "louis-heels", + "cone-heels", + "heel-sandals", + "ballerinas", + "casual-slip-ons", + "casual-lace-ups", + "ethnic-sandals", + "clogs", + "slippers", + "school-shoes", + "high-heels", + "flats", + "mules", + "crocs", + "heels-pumps", + "mojaris", + "jutties", + "labour-shoes" + ], + "description": "This is the file validation template for the fashion department and footwear category.", + "departments": [ + "men", + "women", + "kids" + ], + "attributes": [ + "gender", + "age-group", + "color", + "outer-material", + "inner_material", + "sole-material", + "occasion", + "collection", + "season", + "product_type", + "pattern", + "closure_type", + "toe_type", + "arch_type", + "heel_height", + "heel-height-unit-of-measure", + "care_instructions", + "package_contents", + "water-resistence", + "water-resistence-details", + "water-proof", + "water-proof-details", + "warranty_type", + "warranty_description", + "essential", + "gst-inclusive", + "gst-if-exclusive", + "fragile", + "manufacturer-packer-importer-name", + "manufacturer-packer-importer-address" + ], + "slug": "footwear", + "banner": "https://hdn-1.fynd.com/seller/pictures/landscape-banner/original/phMzNh_DEFAULT-BANNER_LANDSCAPE.jpgf06e7d2f-15a0-405a-b37b-1333c618abdb/phMzNh_DEFAULT-BANNER_LANDSCAPE.jpg", + "logo": "https://hdn-1.fynd.com/seller/pictures/logo/original/PkIwbo_0DEFAULT-LOGO.jpgbb9acb1b-5e2c-44d4-918a-9429367ccb7d/PkIwbo_0DEFAULT-LOGO.jpg", + "is_physical": true, + "id": "5f04a25344a2e5404274bc10" + }, + { + "slug": "groceries", + "name": "Groceries", + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/EtkWQm_fruit___vegetable_logo.jpgc541c78c-dabc-4823-bb72-c4bd3e5db449/EtkWQm_fruit___vegetable_logo.jpg", + "departments": [ + "groceries" + ], + "description": "Groceries", + "banner": "https://hdn-1.addsale.com/x0/seller/pictures/landscape-banner/original/BPjEl6_fruit___vegetable_logo.jpg577eb6bb-de4e-444c-a86a-bc23e0d97178/BPjEl6_fruit___vegetable_logo.jpg", + "attributes": [ + "ingredient-type", + "manufacturer_packer_importer_address" + ], + "categories": [ + "buns", + "non-veg-pickle", + "condensed-milk", + "shoe-shiners", + "bath-stool-tub-basin-sets", + "soda-cocktail-mix", + "tofu", + "buckets-mugs", + "fresh-mutton", + "games-calculators", + "kolam", + "namkeen-savoury-snacks", + "gift-bags", + "honey", + "cutlery-spoons-fork", + "pita", + "potato-onion-tomato", + "apples-pomegranate", + "dishwash-powder", + "country-eggs", + "fish-tuna", + "coconut-milk", + "sugarfree-sweeteners", + "cups-mugs-tumblers", + "turkey", + "breakfast-snack-mixes", + "diabetic-drinks", + "other-dal", + "herbs-seasoning", + "incense-sticks", + "scissor", + "slice-cakes", + "dips-dressings", + "files", + "lavash", + "flakes", + "tawa-sauce-pan", + "breads", + "jaggery", + "soya-chunks", + "exotic-vegetables", + "wine-rise-vinegar", + "recipe-packs", + "pen", + "cookware-sets", + "jam-conserve-marmalade", + "holi-pichkari", + "knives-peelers", + "chicken-sausages", + "poha", + "jowar-flour", + "cook-serve", + "unsweetened-cold-press", + "decorations", + "dust-cloth-wipes", + "jelly", + "gift-boxes", + "organic-cold-press-oil", + "glucose-powder-tablets", + "frozen-non-veg-snacks", + "leafy-vegetables", + "salted-biscuits", + "cooking-chocolates-cocoa", + "marinated-meat", + "berries", + "basmati-rice", + "ground-coffee", + "cut-vegetables", + "moong-dal", + "glue", + "fabric-pre-post-wash", + "canola-rapeseed-oil", + "water-fridge-bottle", + "frozen-fish-seafood", + "choppers-graters", + "soya", + "kiwi-melon-citrus-fruits", + "buttermilk", + "focaccia", + "healthy-baked-snacks", + "bowls", + "car-freshener", + "nachos", + "powdered-spices", + "rawa", + "pressure-cookers", + "chips", + "cream-rolls", + "tape", + "bajra", + "jowar", + "ice-cream", + "wicks", + "cooking-pastes", + "erasers-sharpeners", + "imported-fruits", + "notebooks", + "masoor-dal", + "canned-seafood", + "regular-white-vinegar", + "croissants-bread", + "pasta", + "root-vegetables", + "whole-spices", + "chana-dal", + "glassware", + "cucumber-gourds-capsicum", + "papads-ready-to-fry", + "lamp", + "hakka-noodles", + "balsamic-cider-vinegar", + "garbage-bags", + "pumpkin-drumstick", + "other-plastic-ware", + "frozen-indian-breads", + "glucose-milk-biscuits", + "non-alcoholic-drinks", + "paneer", + "toor-dal", + "fresh-salads-sprouts", + "fresh-chicken", + "wheat-flour", + "fruits-pulps", + "cheese-spread", + "camphor", + "cabbage-broccoli-cauliflower", + "sugar", + "candles", + "plates", + "mangoes", + "aerated-drinks", + "toffee-candy-lollypop", + "pizza-base", + "thai-asian-sauce", + "shoe-brushes", + "gas-stove", + "sports-energy-drinks", + "shrikhand", + "hangers-clips-ropes", + "croutons", + "floor-other-cleaners", + "toilet-cleaners", + "macaroni", + "folders", + "choco-nut-spread", + "salts", + "butter", + "pavs", + "hangers", + "khari", + "frozen-veg-snacks", + "tea-cakes", + "seasonal-fruits", + "olive", + "seasonal-accessories", + "cream", + "heat-eat-ready-meals", + "dishwash-liquid-paste", + "rubs", + "beans-pulses", + "seasonal-vegetables", + "besan", + "shoe-polish", + "packaged-water", + "kids-cereal", + "instant-coffee", + "powdered-milk", + "dishwash-bar", + "home-baking", + "laundry-storage-baskets", + "detergent-liquid", + "instant-noodles", + "canned-food", + "disposable-cups-plates", + "brinjals", + "imported-cleaners", + "tinned-packed-sweets", + "container-set", + "lamp-oil", + "mayonnaise", + "wall-hooks", + "spreads", + "juices", + "quinoa-grains", + "pooja-thali", + "milk", + "syrups-concentrates", + "cut-fruit-tender-coconut", + "kitchen-rolls", + "cold-drinks", + "vessels", + "premium-cookies", + "pooja-bells", + "other-pooja-needs", + "rise-flour", + "breadcrumbs", + "cup-cakes", + "berry", + "regional-rice", + "regional-grains", + "chilli-soya-sauce", + "gourmet-popcorn", + "beans-okra", + "wafers", + "sparkling-drinks", + "muffins", + "daliya", + "match-box", + "bagels-bread", + "rice-products", + "dry-fruits", + "dal-mix", + "flavoured-water", + "roasted-seeds-nuts", + "marshmallow", + "toilet-paper", + "wet-wipes", + "fruit-baskets", + "leaf-dust-tea", + "rakhi", + "insect-repellent", + "bajra-flour", + "ghee", + "lunch-boxes", + "cup-noodles", + "chocolates", + "candle-holder", + "frozen-mutton", + "marie-health-digestive", + "pencils", + "turkey-duck", + "vermicelli", + "exotic-flavoured-tea", + "powdered-mixes", + "urad-dal", + "toilet-other-brushes", + "jalapeno", + "maida", + "chutney", + "fresh-sweets", + "dessert-mixes", + "instant-pasta", + "kitchen-tools-other-accessories", + "mushrooms", + "chilli-lemon-garlic-ginger", + "gherkin", + "cooking-oil", + "curry-paste", + "tumblers", + "lamb", + "cheese", + "other-seafood", + "other-meat", + "frozen-chicken", + "banana-sapota-papaya", + "granola-cereal-bars", + "sabudana", + "cream-biscuits", + "bread-sticks", + "chia-seeds", + "utensil-scrub-pad-glove", + "soya-granules", + "soups", + "spring-water", + "rusks", + "olive-oil", + "organic-eggs", + "aluminium-foil-cling-wrap", + "colours-crayons", + "corn-snacks", + "pulses", + "protein-eggs", + "tomatoes-vegetables", + "cookies", + "still-drinks", + "mustard-cheese-sauce", + "regional-flour", + "detergent-powder", + "flavoured-other-oils", + "chikki-gajak", + "curd", + "strainers-ladle-spatula", + "holi-colours", + "trail-cocktail-mixes", + "baking-cake-decoration", + "biscuits", + "pencil-box", + "muesli", + "air-freshener", + "quinoa", + "metal-furniture-cleaners", + "green-tea", + "paper-napkin", + "flavoured-milk", + "mints-chewing-gum", + "lighters", + "lassi", + "edamame-beans", + "dry-fish", + "blended-masalas", + "tomato-ketchup", + "kadai-fry-pans", + "dustbins", + "syrups", + "wheat", + "kitchen-glass-drains", + "pork-ham", + "panini", + "flours-pre-mixes", + "cfl-led-bulbs", + "baguette-bread", + "brooms-dust-pans", + "prawns-shrimps", + "soap-cases-dispensers", + "oats-porridge", + "mops-wipers", + "exam-pads", + "tea-bags", + "pastries", + "mosquito-repellent", + "cut-peeled-veggies", + "pickle", + "brownies", + "margarine", + "soya-milk", + "fresh-fish", + "cloth-dryer-iron-table", + "gift-wrap", + "farm-eggs", + "detergent-bar", + "battery-electricals" + ], + "is_physical": true, + "id": "5efc43b13b4ca00001328666" + }, + { + "description": "This is the file validation template for the Home & Living Department", + "name": "Home & Living", + "slug": "home-living", + "departments": [ + "home-living" + ], + "categories": [ + "slippers", + "chairs", + "table", + "beds", + "vases", + "bed-sheets", + "dining-table", + "blankets", + "bath-robe", + "bathing-accessories", + "napkins", + "hanger", + "lunch-box", + "photo-frame", + "toiletry-bag", + "pillow", + "cup-saucer", + "pet-collar-charm", + "alarm-clocks", + "dessert-plates", + "vintage-clocks", + "tissue-holder", + "flush-mount-lights", + "jewellery-box-stands", + "desk-accessories", + "serving-sets", + "cake-stands", + "bath-towel", + "cutlery", + "knives", + "knives-holder", + "pillow-covers", + "placemats", + "saucer", + "coasters", + "tea-sets", + "forks", + "shower-curtains", + "serving-bowls", + "soap-dispensers", + "spoons", + "bath-mats", + "table-runner", + "bed-covers", + "tea-coffee-accessories", + "coverlets", + "soap-dishes", + "duvet", + "bed-sheets-sets", + "duvet-cover", + "bolster-pillows", + "quilts-rajais", + "mattress", + "bed-linen-set", + "candles", + "clothes-storage", + "shoe-racks", + "cushion-fillers", + "scented-candles", + "art-pieces", + "key-holder", + "planters", + "showpieces", + "decals-stickers", + "mirrors", + "clocks", + "coffee-tables", + "dining-benches", + "ottoman", + "artificial-flowers", + "dining-chair", + "dining-table-set", + "drapery", + "console-table", + "baking-mould", + "cup", + "dohars", + "cushion-covers", + "fountains", + "comforters", + "mugs", + "flowerpot", + "cushions", + "decorative-objects", + "napkin-holder", + "trays", + "table-cloth", + "tea-cosy", + "shower-caps", + "shower-mats", + "bed-skirts", + "wardrobe-organisers", + "mattress-protectors", + "pillow-protectors", + "tea-light-candles", + "sculptures", + "faux-plants", + "vintage-finds", + "wall-art", + "dressing-tables", + "benches", + "sofas", + "storage-trunks", + "curtains", + "side-table", + "pillow-shams", + "wind-chimes", + "candle-holders", + "cheese-boards", + "serving-platters", + "pitchers", + "drinking-glasses", + "pet-collar", + "bathroom-faucets", + "lamp-bases", + "wreath", + "pendant-lamps", + "hearth-fireplace", + "sconces", + "succulents-plants", + "fireplace-screens", + "garlands", + "electric-fireplaces", + "storage-boxes", + "elecrtonics-tech-accessories", + "diffusers", + "potpourri", + "throws", + "ceiling-lights", + "pet-feeding-bowl", + "chandeliers", + "carpets", + "salad-plates", + "room-partitions", + "bar-accessories", + "decorative-lights", + "hand-towel", + "lamp-shades", + "face-towel", + "study-table-lamps", + "floor-runner", + "wall-lamps", + "frying-pan", + "door-mats", + "carafe", + "dinner-plates", + "snifter", + "dinner-set", + "peg-measure", + "platters", + "shot-bottles", + "bathroom-caddy", + "vinegar-dispenser", + "toilet-brush-holder", + "cutlery-holder", + "toothbrush-holder", + "kitchen-trolly", + "stemware", + "measuring-cup", + "baking-tray", + "strainer", + "stew-pan", + "whisk", + "cocktail-shaker", + "flask", + "food-container", + "string-lights", + "bottle-holder", + "poufs", + "chopping-board", + "fireplace-tools", + "dish-rack", + "log-racks-holders", + "ladle", + "aroma-oils", + "peeler", + "incense-sticks-holders", + "tongs", + "incense-sticks", + "kettle", + "kulladhs", + "table-linen-set", + "handbag-organiser", + "upholstery", + "laundry-bag", + "floor-lamps", + "magazine-organiser", + "lighting-accessories", + "makeup-organiser", + "table-lamps", + "shelf-liner", + "rugs-dhurries", + "shoes-organiser", + "sweater-bag", + "bowls", + "decanters", + "garbage-bag", + "beach-towel", + "bookcase", + "towel-set", + "pool-table", + "bath-rug", + "poker-table", + "shower-holder", + "table-tennis", + "towel-holder", + "bar-counter-stools", + "bath-mirror", + "bar-carts", + "towel-rod", + "bar-furniture", + "floor-mats", + "bedside-table", + "kadhai", + "foundations", + "sauce-pan", + "pillow-inserts", + "tawa", + "bathroom-vanities", + "cocktail-set", + "lounging-relaxing-furniture", + "canister", + "oil-dispenser", + "salt-pepper-shakers", + "spatula", + "casserole", + "handi", + "glasses", + "kitchen-linen-set", + "wardrobe-organiser", + "jewellery-organiser", + "separators", + "closet-storage", + "garbage-bag-holder", + "hooks", + "foosball-table", + "board-game", + "wall-shelves", + "media-furniture", + "file-cabinets", + "leather-furniture", + "buffets-sidebars", + "mattress-pads", + "wastebaskets", + "hampers-baskets", + "outdoor-dining-furniture", + "entry-furniture", + "water-jugs", + "table-covers", + "lanterns", + "desk-organiser", + "drawer-organiser", + "suit-organiser", + "swab-storage", + "tote-basket", + "hanger-holder", + "cabinet", + "hockey-table", + "shuffleboard", + "game-accessories", + "desk", + "office-chairs", + "dining-storage", + "kitchen-island", + "nightstands", + "duvet-inserts", + "mattress-toppers", + "medicine-cabinets", + "bathroom-hardware-accessories", + "salt-pepper-grinders", + "water-bottle" + ], + "attributes": [ + "occasion", + "collection", + "color", + "material", + "product_type", + "bed_size", + "utility", + "quality", + "pattern", + "filling", + "shape", + "sheet-type", + "sheet_size", + "thread_count", + "product-dimensions", + "pocket_depth", + "group-id", + "variation-type", + "variation-based-on", + "capacity", + "dishwasher_safe", + "microwave_safe", + "oven_safe", + "additional-features", + "care_instructions", + "package_contents", + "sales_package", + "warranty_type", + "warranty_description", + "gst-inclusive", + "gst-if-exclusive", + "fragile", + "manufacturer-packer-importer-name", + "manufacturer-packer-importer-address" + ], + "banner": "https://hdn-1.fynd.com/seller/pictures/landscape-banner/original/EHRCqs_DEFAULT-BANNER_LANDSCAPE.jpgc596e149-f6e1-4695-9446-9a8b88797d4c/EHRCqs_DEFAULT-BANNER_LANDSCAPE.jpg", + "logo": "https://hdn-1.fynd.com/seller/pictures/logo/original/UAiJlq_0DEFAULT-LOGO.jpg25c9816d-2376-4eaf-b4ab-accb37e9a564/UAiJlq_0DEFAULT-LOGO.jpg", + "is_physical": true, + "id": "5f05acfa44a2e55081728be2" + }, + { + "categories": [ + "3-ply-box", + "5-ply-box", + "7-ply-box", + "9-ply-box", + "bubble-roll", + "card-board-roll", + "courier-bag", + "courier-pouch", + "die-cut-box", + "double-side-tape", + "drawer-box", + "duct-tape", + "filament-tape", + "laminated-box", + "packaging-tape", + "poly-bag", + "printed-tape", + "reusable-bag", + "seal-bags", + "stretch-wrap", + "suit-box", + "zip-lock-bags", + "box" + ], + "name": "Industrial Supplies", + "banner": "https://hdn-1.fynd.com/seller/pictures/landscape-banner/original/9DpMn3_Beauty_&_Personal_Care_L.jpg80d89967-9c2c-498b-a79c-d176b3e71ea5/9DpMn3_Beauty_and_Personal_Care_L.jpg", + "slug": "industrial-supplies", + "attributes": [ + "color", + "primary_color", + "style", + "features", + "safety_warning", + "is_flammable", + "water_resistant", + "product_details", + "package_contents", + "essential", + "pallet" + ], + "logo": "https://hdn-1.fynd.com/seller/pictures/logo/original/I2NV2c_indi.jpg2eaf85b5-8076-4b0b-8f01-f119d6d8b559/I2NV2c_indi.jpg", + "departments": [ + "industrial-supplies" + ], + "description": "Products used for business and industrial manufacturing process comes under this category. Example: Packaging Material", + "modified_by": { + "username": "meghagolecha_fynd_com_89167", + "user_id": "23244269" + }, + "modified_on": "2020-08-20T19:12:26.040000Z", + "is_active": true, + "is_physical": true, + "id": "5f11eced5ca7f90001685a70" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### validateProductTemplate +Validate Product Template Schema + + + + +```swift +client.catalog.validateProductTemplate(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A `slug` is a unique identifier for a particular template. | + + + +Allows you to list all product templates validation values for all the fields present in the database + +*Returned Response:* + + + + +[TemplatesValidationResponse](#TemplatesValidationResponse) + +List of fields and validation values fro each. See example below or refer `TemplatesValidationResponse` for details + + + + +
    +  Example: + +```json +null +``` +
    + + + + + + + + + +--- + + +#### downloadProductTemplateViews +Download Product Template View + + + + +```swift +client.catalog.downloadProductTemplateViews(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A `slug` is a unique identifier for a particular template. | + + + +Allows you to download product template data + +*Returned Response:* + + + + +[String](#String) + +CSV File of product template data. See example below or refer `TemplatesResponse` for details + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### downloadProductTemplateView +Download Product Template View + + + + +```swift +client.catalog.downloadProductTemplateView(itemType: itemType) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| itemType | String | yes | An `item_type` defines the type of item. | + + + +Allows you to download product template data + +*Returned Response:* + + + + +[String](#String) + +CSV File of product template data. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### validateProductTemplateSchema +Validate Product Template Schema + + + + +```swift +client.catalog.validateProductTemplateSchema(itemType: itemType) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| itemType | String | yes | An `item_type` defines the type of item. The default value is standard. | + + + +Allows you to list all product templates validation values for all the fields present in the database + +*Returned Response:* + + + + +[InventoryValidationResponse](#InventoryValidationResponse) + +List of fields and validation values fro each. See example below or refer `InventoryValidationResponse` for details + + + + +
    +  Example: + +```json +{ + "data": { + "title": "InventoryValidationResponse", + "type": "object", + "properties": { + "item": { + "$ref": "" + }, + "sizes": { + "title": "Sizes", + "type": "array", + "items": { + "$ref": "" + } + } + }, + "required": [ + "item", + "sizes" + ], + "definitions": { + "ItemQuery": { + "title": "ItemQuery", + "type": "object", + "properties": { + "uid": { + "title": "Uid", + "type": "integer" + }, + "brand_uid": { + "title": "Brand Uid", + "type": "integer" + }, + "item_code": { + "title": "Item Code", + "type": "integer" + } + } + }, + "InventoryBaseSchema": { + "title": "InventoryBaseSchema", + "type": "object", + "properties": { + "price": { + "title": "Actual Price", + "exclusiveMinimum": 1, + "type": "number" + }, + "price_effective": { + "title": "Selling Price", + "exclusiveMinimum": 1, + "type": "number" + }, + "seller_identifier": { + "title": "Gtin Value", + "pattern": "^[A-Za-z0-9]*$", + "type": "string" + }, + "quantity": { + "title": "Quantity", + "minimum": 0, + "type": "integer" + }, + "store_code": { + "title": "Store Code", + "type": "string", + "enum": [ + "RUOSH43", + "S106", + "S108", + "TIO9", + "talha" + ] + }, + "currency": { + "title": "Currency", + "enum": [ + "INR", + "QAR" + ], + "type": "string" + }, + "size": { + "title": "Size", + "type": "string" + } + }, + "required": [ + "price", + "price_effective", + "seller_identifier", + "quantity", + "store_code", + "currency", + "size" + ] + } + } + }, + "message": "Success" +} +``` +
    + + + + + + + + + +--- + + +#### listHSNCodes +List HSN Codes + + + + +```swift +client.catalog.listHSNCodes() { (response, error) in + // Use response +} +``` + + + + + + +Allows you to list all hsn Codes + +*Returned Response:* + + + + +[HSNCodesResponse](#HSNCodesResponse) + +List of all HSN Codes. See example below or refer `HSNCodesResponse` for details + + + + +
    +  Example: + +```json +{ + "data": { + "country_of_origin": [ + "India" + ], + "hsn_code": [ + "11111111" + ] + }, + "message": "Success" +} +``` +
    + + + + + + + + + +--- + + +#### listProductTemplateExportDetails +Allows you to list all product templates export list details + + + + +```swift +client.catalog.listProductTemplateExportDetails() { (response, error) in + // Use response +} +``` + + + + + + +Can view details including trigger data, task id , etc. + +*Returned Response:* + + + + +[ProductDownloadsResponse](#ProductDownloadsResponse) + +List of Product Downloads Data. See example below or refer `ProductDownloadsResponse` for details + + + + +
    +  Example: + +```json +{ + "page": {}, + "items": [ + { + "created_by": { + "username": "917972410891_48194", + "user_id": "5646" + }, + "data": { + "type": "csv", + "brand": [ + "ruosh" + ], + "templates": [ + "mobile-phones-and-tablet" + ] + }, + "status": "success", + "task_id": "c4b54ace-44ef-11eb-9806-1ef9bc4a2da1", + "template_tags": { + "mobile-phones-and-tablet": { + "display": "Mobile Phones & Tablet", + "logo": "https://hdn-1.jiox0.de/jiox0/seller/pictures/logo/original/Oda39B_99946594-portable-devices-with-tablet-and-mobile-phone-vector-icon-for-apps-and-websites.jpgcc2dff44-7fae-4002-9ebe-d2b59c8bee91/Oda39B_99946594-portable-devices-with-tablet-and-mobile-phone-vector-icon-for-apps-and-websites.jpg" + } + }, + "trigger_on": "2020-12-23T07:23:35.302000Z", + "seller_id": 3, + "completed_on": "2020-12-23T07:23:41.031000Z", + "url": "https://regrowth.s3.amazonaws.com/slingshot-catalogues/seller-catalog/3/c4b54ace-44ef-11eb-9806-1ef9bc4a2da1/c4b54ace-44ef-11eb-9806-1ef9bc4a2da1.zip", + "id": "5fe2f077516d980001880943" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### listTemplateBrandTypeValues +Allows you to list all values for Templates, Brands or Type + + + + +```swift +client.catalog.listTemplateBrandTypeValues(filter: filter) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| filter | String | yes | A `filter` is the unique identifier of the type of value required. | + + + +The filter type query parameter defines what type of data to return. The type of query returns the valid values for the same + +*Returned Response:* + + + + +[ProductConfigurationDownloads](#ProductConfigurationDownloads) + +See example below or refer `ProductConfigurationDownloadsSchema` for details + + + + +
    +  Example: + +```json +{ + "data": [ + { + "display": "csv", + "value": "csv" + }, + { + "display": "excel", + "value": "excel" + } + ], + "multivalue": false +} +``` +
    + + + + + + + + + +--- + + +#### listCategories +Get product categories list + + + + +```swift +client.catalog.listCategories(level: level, departments: departments, q: q, pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| level | String? | no | Get category for multiple levels | +| departments | String? | no | Get category for multiple departments filtered | +| q | String? | no | Get multiple categories filtered by search string | +| pageNo | Int? | no | The page number to navigate through the given set of results | +| pageSize | Int? | no | Number of items to retrieve in each page. Default is 10. | + + + +This API gets meta associated to product categories. + +*Returned Response:* + + + + +[CategoryResponse](#CategoryResponse) + +Category Meta. See example below or refer `CategoryResponse` for details + + + + +
    +  Example: + +```json +{ + "page": { + "current": 1, + "size": 58, + "has_previous": false, + "has_next": true, + "item_total": 574 + }, + "items": [ + { + "name": "Air Conditioners", + "media": { + "logo": "https://hdn-1.addsale.com/x0/category/pictures/square-logo/original/zTgh1zslj-.png", + "portrait": "https://hdn-1.addsale.com/x0/category/pictures/portrait-banner/original/VKqwRngFh-.png", + "landscape": "https://hdn-1.addsale.com/x0/category/pictures/landscape-banner/original/_7GDi3tyi-.png" + }, + "marketplaces": {}, + "tryouts": [], + "is_active": true, + "created_by": { + "username": "917972410891_48194", + "user_id": "5646" + }, + "uid": 22330, + "slug": "air-conditioners", + "priority": 1, + "synonyms": [], + "modified_by": { + "username": "917972410891_48194", + "user_id": "5646" + }, + "level": 3, + "hierarchy": [ + { + "l1": 1, + "department": 1, + "l2": 22329 + } + ], + "created_on": "2021-04-02T15:43:59.410000Z", + "departments": [ + 1 + ], + "modified_on": "2021-04-02T15:43:59.410000Z", + "id": "60673bbf7896da00017885ad" + }, + { + "name": "Home Appliances", + "media": { + "logo": "https://hdn-1.addsale.com/x0/category/pictures/square-logo/original/zTgh1zslj-.png", + "portrait": "https://hdn-1.addsale.com/x0/category/pictures/portrait-banner/original/VKqwRngFh-.png", + "landscape": "https://hdn-1.addsale.com/x0/category/pictures/landscape-banner/original/_7GDi3tyi-.png" + }, + "is_active": true, + "created_by": { + "username": "917972410891_48194", + "user_id": "5646" + }, + "uid": 22329, + "slug": "home-appliances", + "priority": 1, + "synonyms": [], + "modified_by": { + "username": "917972410891_48194", + "user_id": "5646" + }, + "level": 2, + "hierarchy": [], + "created_on": "2021-04-02T15:42:55.405000Z", + "departments": [ + 1 + ], + "modified_on": "2021-04-02T15:42:55.405000Z", + "id": "60673b7f7896da00017885ac" + }, + { + "created_by": { + "username": "919821012599_75351", + "user_id": "5721" + }, + "slug": "dummy-category-level-2", + "level": 2, + "uid": 22323, + "is_active": true, + "media": { + "portrait": "https://hdn-1.addsale.com/x0/category/pictures/portrait-banner/original/VKqwRngFh-.png", + "landscape": "https://hdn-1.addsale.com/x0/category/pictures/landscape-banner/original/0wCdjxWpI-.png", + "logo": "https://hdn-1.addsale.com/x0/category/pictures/square-logo/original/zTgh1zslj-.png" + }, + "name": "Dummy category level 2 by fahim", + "modified_on": "2021-03-04T15:43:50.495000Z", + "modified_by": { + "username": "917753852478_51632", + "user_id": "5677" + }, + "synonyms": [ + "skin", + "care", + "asdasd" + ], + "created_on": "2021-01-14T05:28:02.148000Z", + "priority": 123456, + "hierarchy": [], + "departments": [ + 21 + ], + "id": "5fffd662e64eb40001fc8a42" + }, + { + "synonyms": [], + "marketplaces": {}, + "created_on": "2021-02-25T00:00:47.589000Z", + "modified_by": { + "username": "917753852478_51632", + "user_id": "5677" + }, + "media": { + "landscape": "https://hdn-1.addsale.com/x0/category/pictures/landscape-banner/original/0wCdjxWpI-.png", + "logo": "https://hdn-1.addsale.com/x0/category/pictures/square-logo/original/EfCt9iXx8-http/d3p8ifzkmzds37.cloudfront.net/media/logo/department/original/15870_c287d3c2431a432bb0e49363ef6b82bc.png.jpeg", + "portrait": "https://hdn-1.addsale.com/x0/category/pictures/portrait-banner/original/S1axCMOJ4-.png" + }, + "modified_on": "2021-03-04T15:39:52.108000Z", + "hierarchy": [ + { + "l2": 22323, + "l1": 22322, + "department": 21 + } + ], + "name": "Dummy level 4", + "is_active": true, + "slug": "dummy-level-4", + "departments": [ + 21 + ], + "level": 3, + "tryouts": [], + "uid": 22325, + "priority": 986532, + "created_by": { + "username": "silverbolt", + "user_id": "-1" + }, + "id": "60369b57d23031d14be92c18" + }, + { + "created_by": { + "username": "919821012599_75351", + "user_id": "5721" + }, + "slug": "dummy-level-3", + "level": 3, + "uid": 22324, + "is_active": true, + "media": { + "landscape": "https://hdn-1.addsale.com/x0/category/pictures/landscape-banner/original/0wCdjxWpI-.png", + "logo": "https://hdn-1.addsale.com/x0/category/pictures/square-logo/original/EfCt9iXx8-http/d3p8ifzkmzds37.cloudfront.net/media/logo/department/original/15870_c287d3c2431a432bb0e49363ef6b82bc.png.jpeg", + "portrait": "https://hdn-1.addsale.com/x0/category/pictures/portrait-banner/original/S1axCMOJ4-.png" + }, + "name": "Dummy level 3 by fahim", + "tryouts": [ + "Lipstick", + "Eyeliner" + ], + "modified_on": "2021-03-04T15:39:46.246000Z", + "modified_by": { + "username": "917753852478_51632", + "user_id": "5677" + }, + "synonyms": [], + "marketplaces": {}, + "created_on": "2021-01-14T05:28:59.852000Z", + "priority": 986532, + "hierarchy": [ + { + "l2": 22323, + "l1": 22322, + "department": 21 + }, + { + "l2": 3732, + "l1": 3672, + "department": 4 + }, + { + "l2": 730, + "l1": 595, + "department": 2 + } + ], + "departments": [ + 2, + 4, + 21 + ], + "id": "5fffd69be64eb40001fc8a65" + }, + { + "uid": 3151, + "departments": [ + 4 + ], + "is_active": true, + "level": 1, + "media": { + "logo": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/YHIeoQ_fruit___vegetable_logo.jpg16aab608-a78a-458f-b60b-524525f27dec/YHIeoQ_fruit___vegetable_logo.jpg", + "portrait": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/ywPVrU_preview_a637ca6e4da6e38f03eb0d650ac5d6ba.jpgc73cc22f-b5ee-4fd4-a585-8ada35762d68/ywPVrU_preview_a637ca6e4da6e38f03eb0d650ac5d6ba.jpg", + "landscape": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/ywPVrU_preview_a637ca6e4da6e38f03eb0d650ac5d6ba.jpgc73cc22f-b5ee-4fd4-a585-8ada35762d68/ywPVrU_preview_a637ca6e4da6e38f03eb0d650ac5d6ba.jpg" + }, + "name": "Gourmet & World Food", + "priority": 123, + "slug": "gourmet-world-food", + "synonyms": [ + "gourmet & world food", + "food", + "gourmet" + ], + "created_on": "2016-04-09T06:44:35Z", + "hierarchy": [], + "modified_by": { + "username": "917753852478_51632", + "uid": "5677" + }, + "modified_on": "2021-03-03T09:35:50.415000Z", + "id": "5fabab8ea18a1284b97ff6c4" + }, + { + "modified_by": { + "username": "917753852478_51632", + "uid": "5677" + }, + "marketplaces": {}, + "hierarchy": [ + { + "l1": 595, + "l2": 714, + "department": 2 + }, + { + "l1": 2, + "l2": 4, + "department": 1 + } + ], + "created_on": "2021-03-03T06:30:08.342000Z", + "created_by": { + "username": "917753852478_51632", + "uid": "5677" + }, + "level": 3, + "name": "Test Category kaf", + "media": { + "landscape": "https://hdn-1.addsale.com/x0/category/pictures/landscape-banner/original/0wCdjxWpI-.png", + "logo": "https://hdn-1.addsale.com/x0/category/pictures/square-logo/original/EfCt9iXx8-http/d3p8ifzkmzds37.cloudfront.net/media/logo/department/original/15870_c287d3c2431a432bb0e49363ef6b82bc.png.jpeg", + "portrait": "https://hdn-1.addsale.com/x0/category/pictures/portrait-banner/original/VKqwRngFh-.png" + }, + "tryouts": [ + "Lipstick", + "Blush" + ], + "is_active": true, + "slug": "test-category-kaf", + "uid": 22328, + "synonyms": [ + "test", + "category" + ], + "priority": 23, + "departments": [ + 1, + 2 + ], + "modified_on": "2021-03-03T08:34:47.999000Z", + "id": "603f2cf0aac0360001c00731" + }, + { + "level": 3, + "departments": [ + 1 + ], + "is_active": false, + "created_by": { + "username": "silverbolt", + "user_id": "-1" + }, + "created_on": "2021-02-25T09:26:53.123000Z", + "tryouts": [], + "slug": "smart-cell", + "marketplaces": {}, + "priority": 5, + "media": { + "portrait": "http://cdn4.gofynd.com/media/logo/department/original/13239_660c6f5b2b8d458789de4552d241ea1b.jpg", + "landscape": "https://hdn-1.fynd.com/media/banner/category/original/16128_380bed8bff064a0b981041df65e0d8b3.jpg", + "logo": "http://d3p8ifzkmzds37.cloudfront.net/media/logo/department/original/15870_c287d3c2431a432bb0e49363ef6b82bc.png" + }, + "modified_on": "2021-02-25T09:26:53.123000Z", + "synonyms": [], + "uid": 22327, + "hierarchy": [ + { + "l1": 2, + "l2": 3, + "department": 1 + } + ], + "name": "Smart Cell", + "modified_by": { + "username": "silverbolt", + "user_id": "-1" + }, + "id": "60372005d230311fe9e51f0b" + }, + { + "is_active": true, + "hierarchy": [ + { + "department": 21, + "l1": 22322, + "l2": 22323 + } + ], + "slug": "dummy-level-98", + "priority": 986532, + "uid": 22326, + "departments": [ + 21 + ], + "created_by": { + "username": "silverbolt", + "user_id": "-1" + }, + "modified_on": "2021-02-25T00:09:35.026000Z", + "marketplaces": {}, + "tryouts": [], + "synonyms": [], + "media": { + "landscape": "https://hdn-1.addsale.com/x0/category/pictures/landscape-banner/original/0wCdjxWpI-.png", + "portrait": "https://hdn-1.addsale.com/x0/category/pictures/portrait-banner/original/S1axCMOJ4-.png", + "logo": "https://hdn-1.addsale.com/x0/category/pictures/square-logo/original/EfCt9iXx8-http/d3p8ifzkmzds37.cloudfront.net/media/logo/department/original/15870_c287d3c2431a432bb0e49363ef6b82bc.png.jpeg" + }, + "level": 3, + "name": "Dummy level 98", + "created_on": "2021-02-25T00:09:35.026000Z", + "modified_by": { + "username": "silverbolt", + "user_id": "-1" + }, + "id": "60369d67d2303111b8924dcf" + }, + { + "uid": 315, + "created_on": "2016-04-09T06:44:35Z", + "departments": [ + 2, + 3 + ], + "hierarchy": [ + { + "l1": 65, + "l2": 66, + "department": 2 + }, + { + "l1": 442, + "l2": 26, + "department": 2 + }, + { + "l1": 442, + "l2": 26, + "department": 3 + } + ], + "is_active": true, + "level": 3, + "marketplaces": {}, + "media": { + "landscape": "https://hdn-1.fynd.com/media/banner/category/original/19961_f042f1f4a90f4e828b6d77d6dbea264d.jpg", + "logo": "https://hdn-1.fynd.com/media/logo/category/original/81ef023d375044e9b9daa66b81ec411f.jpg", + "portrait": "https://hdn-1.fynd.com/media/banner_portrait/category/original/19960_c679d51cb1bd4ca99f00f9050aa647a4.jpg" + }, + "modified_by": { + "username": "917753852478_51632", + "user_id": "5677" + }, + "modified_on": "2021-02-15T15:48:05.329000Z", + "name": "Sports Bra", + "priority": 281, + "slug": "sports-bra", + "synonyms": [ + "Sports Bra", + "activewear bra", + "gym bra" + ], + "tryouts": [], + "id": "5fdba984642de8d93efb0d71" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### createCategories +Create product categories + + + + +```swift +client.catalog.createCategories(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CategoryRequestBody | yes | Request body | + + +This API lets user create product categories + +*Returned Response:* + + + + +[CategoryCreateResponse](#CategoryCreateResponse) + +Category Meta. See example below or refer `CategoryCreateResponse` for details + + + + +
    +  Example: + +```json +{ + "message": "Success", + "uid": 0 +} +``` +
    + + + + + + + + + +--- + + +#### getCategoryData +Get product category by uid + + + + +```swift +client.catalog.getCategoryData(uid: uid) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| uid | String | yes | Category unique id | + + + +This API gets meta associated to product categories. + +*Returned Response:* + + + + +[SingleCategoryResponse](#SingleCategoryResponse) + +Get Data for one category. See example below or refer `CategoryResponse` for details + + + + +
    +  Example: + +```json +{ + "data": { + "name": "Air Conditioners", + "media": { + "portrait": "https://hdn-1.addsale.com/x0/category/pictures/portrait-banner/original/_4p7Kz9Yp-banner.png", + "landscape": "https://hdn-1.addsale.com/x0/category/pictures/landscape-banner/original/nsi0nJ6gX-landscape.png", + "logo": "https://hdn-1.addsale.com/x0/category/pictures/square-logo/original/zTgh1zslj-.png" + }, + "marketplaces": {}, + "tryouts": [], + "is_active": true, + "created_by": { + "username": "917972410891_48194", + "user_id": "5646" + }, + "uid": 22330, + "slug": "air-conditioners", + "priority": 1, + "synonyms": [], + "modified_by": { + "username": "nikhilmhatre_gofynd_com_97636", + "user_id": "16" + }, + "level": 3, + "hierarchy": [ + { + "l1": 1, + "department": 1, + "l2": 22329 + } + ], + "created_on": "2021-04-02T15:43:59.410000Z", + "departments": [ + 1 + ], + "modified_on": "2021-04-13T13:57:56.443000Z", + "id": "60673bbf7896da00017885ad" + } +} +``` +
    + + + + + + + + + +--- + + +#### updateCategory +Update product categories + + + + +```swift +client.catalog.updateCategory(uid: uid, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| uid | String | yes | Category unique id | +| body | CategoryRequestBody | yes | Request body | + + +Update a product category using this apu + +*Returned Response:* + + + + +[CategoryUpdateResponse](#CategoryUpdateResponse) + +Category Meta. See example below or refer `CategoryUpdateResponse` for details + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getProducts +Get product list + + + + +```swift +client.catalog.getProducts(brandIds: brandIds, categoryIds: categoryIds, itemIds: itemIds, departmentIds: departmentIds, itemCode: itemCode, q: q, tags: tags, pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| brandIds | [Int]? | no | Get multiple products filtered by Brand Ids | +| categoryIds | [Int]? | no | Get multiple products filtered by Category Ids | +| itemIds | [Int]? | no | Get multiple products filtered by Item Ids | +| departmentIds | [Int]? | no | Get multiple products filtered by Department Ids | +| itemCode | [String]? | no | Get multiple products filtered by Item Code | +| q | String? | no | Get multiple products filtered by q string | +| tags | [String]? | no | Get multiple products filtered by tags | +| pageNo | Int? | no | The page number to navigate through the given set of results | +| pageSize | Int? | no | Number of items to retrieve in each page. Default is 10. | + + + +This API gets meta associated to products. + +*Returned Response:* + + + + +[ProductListingResponse](#ProductListingResponse) + +Product Meta. See example below for details + + + + +
    +  Example: + +```json +{ + "items": [ + { + "name": "TV Set", + "description": "Tv", + "country_of_origin": "India", + "currency": "INR", + "short_description": "", + "is_set": true, + "item_code": "TVSET111", + "brand_uid": 1, + "template_tag": "television", + "highlights": [ + "42 Inch" + ], + "slug": "tv-set", + "_custom_json": {}, + "l3_mapping": [ + "electronics>qled_television" + ], + "image_nature": "standard", + "departments": [ + 1 + ], + "created_on": 1599024995, + "created_by": { + "username": "919049753052_37528", + "user_id": "5" + }, + "modified_on": 1627642010, + "modified_by": { + "username": "xxxxxxxxxx", + "user_id": "xxxxxxxxxxx" + }, + "stage": "verified", + "uid": 7501547, + "verified_by": { + "username": "Silverbolt", + "user_id": "0" + }, + "verified_on": 1626965521, + "all_sizes": [ + { + "item_code": "TVSET111", + "brand_uid": 1, + "seller_identifier": "HGS272727272", + "identifiers": [ + { + "gtin_type": "ean", + "gtin_value": "HGS272727272", + "primary": true + } + ], + "company_id": 1, + "size": "XXLX23, MX11, LX67, XLX45 (146 PCS)", + "marked_price": 35000 + } + ], + "category_slug": "qled-television", + "is_image_less_product": false, + "media": [ + { + "url": "https://hdn-1.addsale.com/x0/products/pictures/item/free/135x0/dcizgsG_Y-Tv-Set.png", + "type": "image" + } + ], + "variants": {}, + "product_publish": { + "is_set": false, + "product_online_date": 1627642009 + }, + "is_dependent": false, + "is_physical": true, + "item_type": "set", + "category_uid": 1, + "custom_order": { + "manufacturing_time": 2, + "is_custom_order": true, + "manufacturing_time_unit": "days" + }, + "moq": { + "minimum": 1, + "is_set": false + }, + "multi_size": true, + "no_of_boxes": 1, + "product_group_tag": [], + "size_guide": "slim-fit-shirts-for-men", + "tags": [], + "teaser_tag": {}, + "synonyms": [], + "hsn_code": "11111111", + "return_config": { + "unit": "days", + "returnable": false, + "time": 0 + }, + "all_company_ids": [ + 1 + ], + "all_identifiers": [ + "19WE100" + ], + "trader": { + "address": "sdfdsfsdf", + "name": "asdasd" + }, + "trader_type": "Packer", + "verification_status": "pending", + "sizes": [ + { + "size": "FGX33, GHX33 (66 PCS)", + "store_count": 1 + }, + { + "size": "XSE WE23X100 (100 PCS)", + "store_count": 2 + }, + { + "size": "XSEX100 (100 PCS)", + "store_count": 3 + }, + { + "size": "XXLX23, MX11, LX67, XLX45 (146 PCS)", + "store_count": 3 + } + ], + "id": "5f4f2f6371a5970001f13655", + "brand": { + "name": "Apple", + "logo": { + "aspect_ratio": "1:1", + "aspect_ratio_f": 1, + "url": "https://hdn-1.jiox0.de/jioecomm/seller/pictures/logo/50x0/apple-7f951c/logo_apple.png", + "secure_url": "https://hdn-1.jiox0.de/jioecomm/seller/pictures/logo/50x0/apple-7f951c/logo_apple.png" + }, + "uid": 13 + }, + "images": [ + { + "aspect_ratio": "16:25", + "aspect_ratio_f": 0.64, + "url": "https://hdn-1.addsale.com/x0/products/pictures/item/free/135x0/dcizgsG_Y-Tv-Set.png", + "secure_url": "https://hdn-1.addsale.com/x0/products/pictures/item/free/135x0/dcizgsG_Y-Tv-Set.png" + } + ], + "price": { + "marked": { + "min": 35000, + "max": 35000 + }, + "effective": { + "min": 25000, + "max": 25000 + } + } + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 1, + "has_previous": false, + "has_next": false + } +} +``` +
    + + + + + + + + + +--- + + +#### createProduct +Create a product. + + + + +```swift +client.catalog.createProduct(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | ProductCreateUpdate | yes | Request body | + + +This API allows to create product. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getProduct +Get a single product. + + + + +```swift +client.catalog.getProduct(itemCode: itemCode, itemId: itemId, brandUid: brandUid) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| itemCode | String? | no | Item code of the product. | +| itemId | Int | yes | Item Id of the product. | +| brandUid | Int? | no | Brand Id of the product. | + + + +This API helps to get data associated to a particular product. + +*Returned Response:* + + + + +[Product](#Product) + +Product object. See example below or refer `product.utils.format_product_response` for details + + + + +
    +  Example: + +```json +{ + "data": { + "template_tag": "industrial-supplies", + "brand_uid": 1486, + "currency": "INR", + "item_code": "TP_FS_01", + "slug": "printed-fyndstore-packaging-tape-4inch-x-6-meter-length-pack-of-2-49d7343fc677", + "name": "Printed Fyndstore Packaging Tape (4inch X 6 Meter length) - Pack of 2", + "hsn_code": "48190000", + "country_of_origin": "India", + "description": "FyndStore 4 inch Printed BOPP Tapes ", + "is_set": true, + "is_active": true, + "departments": [ + 11 + ], + "uid": 1282497, + "category_slug": "printed-tape", + "company_id": 884, + "media": [ + { + "url": "https://hdn-1.fynd.com/media/pictures/tagged_items/original/TPFS01/IMG20200624130956.jpg", + "type": "image" + } + ], + "variants": {}, + "is_dependent": false, + "item_type": "set", + "multi_size": true, + "product_publish": { + "is_set": false, + "product_online_date": "2020-09-10T15:16:12.322000Z" + }, + "id": "5f5a433c74f3f400017cdaa0", + "brand": { + "name": "RollUp", + "logo": { + "aspect_ratio": "1:1", + "aspect_ratio_f": 1, + "url": "https://hdn-1.fynd.com/brands/pictures/square-logo/50x0/mPBaWqGRnjR-RMOnlpdMPKm-yjn5mua63gfmzdpombb1.png", + "secure_url": "https://hdn-1.fynd.com/brands/pictures/square-logo/50x0/mPBaWqGRnjR-RMOnlpdMPKm-yjn5mua63gfmzdpombb1.png" + }, + "uid": 1486 + }, + "return_config": { + "returnable": true, + "time": 30, + "unit": "days" + }, + "sizes": [ + { + "item_dimensions_unit_of_measure": "cm", + "item_weight": 0.15, + "set": { + "quantity": 1, + "size_distribution": { + "sizes": [ + { + "pieces": 1, + "size": "OS" + } + ] + } + }, + "item_height": 10.16, + "item_width": 10.16, + "price_effective": 999, + "size": "OS", + "seller_identifier": "TP_FS_01", + "brand_uid": 1486, + "price": 1000, + "item_weight_unit_of_measure": "gram", + "currency": "INR", + "item_length": 10.16, + "item_code": "TP_FS_01", + "company_id": 884, + "is_set": true, + "track_inventory": true, + "identifiers": [ + { + "gtin_value": "TP_FS_01", + "primary": true, + "gtin_type": "sku_code" + } + ], + "price_transfer": 0, + "id": "5f5a433c74f3f400017cdaa1", + "store_count": 1 + } + ], + "attributes": { + "style": "TPFS01", + "color": "White", + "pallet": 1, + "l3_mapping": [ + "industrial_supplies>printed_tape" + ], + "image_nature": "standard", + "created_on": "2020-09-10T15:16:12.322000Z", + "created_by": { + "username": "sumitdafda_gofynd_com_68387", + "user_id": "23108029", + "company_id": 884 + }, + "modified_on": "2020-09-24T04:51:00.229000Z", + "modified_by": { + "username": "sumitdafda_gofynd_com_68387", + "user_id": "23108029", + "company_id": 884 + }, + "stage": "verified", + "verified_by": { + "username": "sumitdafda_gofynd_com_68387", + "user_id": "23108029", + "company_id": 884 + }, + "verified_on": 1600923060, + "is_image_less_product": false, + "other_available_sizes": [] + } + } +} +``` +
    + + + + + + + + + +--- + + +#### deleteProduct +Delete a product. + + + + +```swift +client.catalog.deleteProduct(itemId: itemId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| itemId | Int | yes | Id of the product to be updated. | + + + +This API allows to delete product. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### editProduct +Edit a product. + + + + +```swift +client.catalog.editProduct(itemId: itemId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| itemId | Int | yes | Id of the product to be updated. | +| body | ProductCreateUpdate | yes | Request body | + + +This API allows to edit product. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "uid": 1, + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getProductValidation +Validate product/size data + + + + +```swift +client.catalog.getProductValidation() { (response, error) in + // Use response +} +``` + + + + + + +This API validates product data. + +*Returned Response:* + + + + +[ValidateProduct](#ValidateProduct) + +Validate Meta. See example below for details + + + + +
    +  Example: + +```json +{ + "valid": true +} +``` +
    + + + + + + + + + +--- + + +#### getProductSize +Get a single product size. + + + + +```swift +client.catalog.getProductSize(itemCode: itemCode, itemId: itemId, brandUid: brandUid, uid: uid) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| itemCode | String? | no | Item code of the product size. | +| itemId | Int | yes | Item Id of the product size. | +| brandUid | Int? | no | Brand Id of the product size. | +| uid | Int? | no | Id of the product size. | + + + +This API helps to get data associated to a particular product size. + +*Returned Response:* + + + + +[ProductListingResponse](#ProductListingResponse) + +Product object. See example below for details + + + + +
    +  Example: + +```json +{ + "name": "SQUADMTGIVESPACE", + "country_of_origin": "India", + "highlights": null, + "hsn_code": "61099090", + "item_code": "ACTESTCREATELISTING1", + "is_set": false, + "description": "", + "currency": "INR", + "slug": "play-clan-squadmtgivespace-857587-e928b0", + "template_tag": "topwear", + "is_active": false, + "departments": [ + 1 + ], + "uid": 857587, + "all_sizes": [ + "3XL" + ], + "category_slug": "t-shirts", + "company_id": 61, + "media": [], + "size_guide": "play-clan-men-casual-tees", + "is_dependent": false, + "item_type": "standard", + "multi_size": true, + "product_publish": { + "is_set": false, + "product_online_date": 1595478043 + }, + "id": "5f19101b99ee0500011dc896", + "brand": { + "name": "play clan", + "logo": { + "aspect_ratio": "1:1", + "aspect_ratio_f": 1, + "url": "https://hdn-1.fynd.com/brands/pictures/square-logo/50x0/zjt4-wU8Lk-VQYu0pcokb-r6yteuannoorjkq9f4tk.jpg", + "secure_url": "https://hdn-1.fynd.com/brands/pictures/square-logo/50x0/zjt4-wU8Lk-VQYu0pcokb-r6yteuannoorjkq9f4tk.jpg" + }, + "uid": 85 + }, + "images": [], + "sizes": [ + { + "price_transfer": 0, + "price_effective": 10000, + "price": 10000, + "currency": "INR", + "is_set": false, + "size": "3XL", + "identifiers": [ + { + "gtin_type": "sku_code", + "gtin_value": "ACTESTCREATELISTING1_3XL", + "primary": true + } + ] + } + ], + "attributes": { + "essential": "Yes", + "color": "Red", + "gender": [ + "Men" + ], + "material": "cotton", + "pattern": "Printed", + "product_fit": "Regular", + "sleeve_length": "Short", + "neck_type": "Round Neck", + "primary_color": "Red", + "primary_material": "Others", + "l3_mapping": [ + "men>casual_tees", + "women>casual_tees", + "girls>casual_tees", + "more>casual_tees" + ], + "image_nature": "standard", + "meta_nature": "standard", + "created_on": "2020-07-23T04:20:43.810000Z", + "created_by": { + "username": "silverbolt", + "user_id": "-1", + "company_id": 1181 + }, + "modified_on": "2020-07-23T04:20:44.185000Z", + "modified_by": { + "username": "silverbolt", + "user_id": "-1", + "company_id": 61 + }, + "stage": "verified", + "verified_by": { + "username": "Silverbolt", + "user_id": "0" + }, + "verified_on": 1595478044, + "is_image_less_product": false + } +} +``` +
    + + + + + + + + + +--- + + +#### getProductBulkUploadHistory +Get a list of all bulk product upload jobs. + + + + +```swift +client.catalog.getProductBulkUploadHistory(pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results | +| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | + + + +This API helps to get bulk product upload jobs data. + +*Returned Response:* + + + + +[ProductBulkRequestList](#ProductBulkRequestList) + +List of bulk product upload jobs. See `BulkRequestGetSchema` for details + + + + +
    +  Example: + +```json +{ + "items": [ + { + "stage": "completed", + "company_id": 61, + "is_active": true, + "cancelled_records": [], + "failed": 0, + "template_tag": "footwear", + "modified_on": "2021-03-12T08:11:08.646000Z", + "created_on": "2021-03-12T08:11:06.848000Z", + "failed_records": [], + "created_by": { + "username": "yadavanuja039_gmail_com_82948", + "user_id": "23218433", + "full_name": "Anuja Yadav" + }, + "total": 1, + "file_path": "https://hdn-1.fynd.com/company/61/self/documents/product-import/free/original/mkX5ApRmw-sample_bulk_products_footwear.xlsx", + "succeed": 1, + "modified_by": { + "username": "Silverbolt", + "user_id": "0" + }, + "cancelled": 0, + "template": { + "name": "Footwear", + "banner": "https://hdn-1.fynd.com/seller/pictures/landscape-banner/original/nFPtXR_Beauty_&_Personal_Care_L.jpgf30455a5-d265-4382-b513-65afb9240320/nFPtXR_Beauty_and_Personal_Care_L.jpg", + "slug": "footwear", + "logo": "https://hdn-1.fynd.com/seller/pictures/logo/original/9Y2UEp_ssssss.jpg7359e4c6-4c53-4dbe-a920-ef8ac658afb1/9Y2UEp_ssssss.jpg", + "departments": [ + "men", + "women", + "kids", + "fashion" + ], + "description": "Footwear is a garment worn on the feet to protect against environmental adversities like heat or ground textures. Example: Sports Shoes" + }, + "id": "604b221a73bfa20001cb00e8" + } + ], + "page": { + "current": 1, + "size": 26, + "has_previous": false, + "has_next": true, + "item_total": 251 + } +} +``` +
    + + + + + + + + + +--- + + +#### updateProductAssetsInBulk +Create a Bulk asset upload Job. + + + + +```swift +client.catalog.updateProductAssetsInBulk(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | BulkJob | yes | Request body | + + +This API helps to create a bulk asset upload job. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### deleteProductBulkJob +Delete Bulk product job. + + + + +```swift +client.catalog.deleteProductBulkJob(batchId: batchId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| batchId | Int | yes | Batch Id of the bulk product job to be deleted. | + + + +This API allows to delete bulk product job associated with company. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### createProductsInBulk +Create products in bulk associated with given batch Id. + + + + +```swift +client.catalog.createProductsInBulk(batchId: batchId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| batchId | String | yes | Batch Id in which assets to be uploaded. | +| body | BulkProductRequest | yes | Request body | + + +This API helps to create products in bulk push to kafka for approval/creation. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getProductTags +Get a list of all tags associated with company. + + + + +```swift +client.catalog.getProductTags() { (response, error) in + // Use response +} +``` + + + + + + +This API helps to get tags data associated to a particular company. + +*Returned Response:* + + + + +[ProductTagsViewResponse](#ProductTagsViewResponse) + +Tag List. See example below for details + + + + +
    +  Example: + +```json +{ + "items": [ + "demo", + "custom" + ] +} +``` +
    + + + + + + + + + +--- + + +#### getProductAssetsInBulk +Get a list of all bulk asset jobs. + + + + +```swift +client.catalog.getProductAssetsInBulk(pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results | +| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | + + + +This API helps to get bulk asset jobs data associated to a particular company. + +*Returned Response:* + + + + +[BulkAssetResponse](#BulkAssetResponse) + +List of bulk asset jobs List. See `BulkUtil.modify_batch_response` for details + + + + +
    +  Example: + +```json +{ + "items": [ + { + "created_on": "2021-02-25T16:45:22.425000Z", + "file_path": "https://hdn-1.fynd.com/company/61/self/documents/product-import/free/original/ZUSmmXHmZ-U8mTYx3KR-Nike-hoddie.zip", + "succeed": 1, + "cancelled_records": [], + "failed": 0, + "failed_records": [], + "stage": "completed", + "is_active": true, + "modified_by": { + "user_id": "23175373", + "username": "nikhilmhatre_gofynd_com_28085_23175373" + }, + "modified_on": "2021-02-25T16:47:24.551000Z", + "retry": 1, + "total": 1, + "company_id": 61, + "created_by": { + "user_id": "23175373", + "username": "nikhilmhatre_gofynd_com_28085_23175373", + "full_name": "nikhil mhatre" + }, + "cancelled": 0, + "tracking_url": "https://api.fynd.com/common/assets/v1/asset/status/extract-zips/3296", + "id": "6037d422aa879600015c6d1d" + } + ], + "page": { + "current": 1, + "size": 3, + "has_previous": false, + "has_next": false, + "item_total": 1 + } +} +``` +
    + + + + + + + + + +--- + + +#### createProductAssetsInBulk +Create a Bulk asset upload Job. + + + + +```swift +client.catalog.createProductAssetsInBulk(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | ProductBulkAssets | yes | Request body | + + +This API helps to create a bulk asset upload job. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### deleteSize +Delete a Size associated with product. + + + + +```swift +client.catalog.deleteSize(itemId: itemId, size: size) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| itemId | Int | yes | Item Id of the product associated with size to be deleted. | +| size | Int | yes | size to be deleted. | + + + +This API allows to delete size associated with product. + +*Returned Response:* + + + + +[ProductSizeDeleteResponse](#ProductSizeDeleteResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getInventoryBySize +Get Inventory for company + + + + +```swift +client.catalog.getInventoryBySize(itemId: itemId, size: size, pageNo: pageNo, pageSize: pageSize, q: q, sellable: sellable) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| itemId | String | yes | Item code of the product of which size is to be get. | +| size | String | yes | Size of which inventory is to get. | +| pageNo | Int? | no | The page number to navigate through the given set of results | +| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | +| q | String? | no | Search with help of store code. | +| sellable | Bool? | no | Filter on whether product is in stock or not. | + + + +This API allows get Inventory data for particular company grouped by size and store. + +*Returned Response:* + + + + +[InventoryResponse](#InventoryResponse) + +returns a list of all inventory grouped by size and store + + + + +
    +  Example: + +```json +{ + "items": [ + { + "store": { + "name": "yosss sdd dsdyo", + "store_code": "sanic6sdfsf7", + "uid": 59, + "address": { + "state": "MAHARASHTRA", + "address1": "A/204, SAI VANDAN, NARAYAN NAGAR, TULINJ ROAD", + "lat_long": { + "type": "Point", + "coordinates": [ + 72.8231511, + 19.4232024 + ] + }, + "address2": "", + "pincode": 401209, + "country": "INDIA", + "city": "MUMBAI", + "landmark": "" + }, + "manager": { + "name": "abc", + "email": "a@b.com", + "mobile_no": { + "number": "2382634324", + "country_code": 91 + } + }, + "integration_type": { + "order": "browntape", + "inventory": "browntape" + }, + "_custom_json": {} + }, + "uid": "59_RTYUIDSDFV", + "size": "AAX1 (1 PCS)", + "inventory_updated_on": "2021-04-06T03:30:01.487000", + "seller_identifier": "RTYUIDSDFV", + "item_id": 7500651, + "quantity": 10, + "price": 1234, + "price_effective": 1234, + "price_transfer": 0, + "currency": "INR", + "sellable_quantity": 10, + "identifiers": [ + { + "gtin_type": "sku_code", + "gtin_value": "RTYUIDSDFV", + "primary": true + } + ] + }, + { + "store": { + "name": "Saran Ledonne", + "store_code": "af6198fe-2c23-4441-bbf4-e694c96e255c", + "uid": 10, + "address": { + "state": "MAHA", + "address1": "NO", + "lat_long": { + "type": "Point", + "coordinates": [ + 1, + 1 + ] + }, + "address2": "", + "pincode": 400072, + "country": "INDIA", + "city": "MUMBAI" + }, + "manager": { + "name": "abc", + "email": "rehman@cashkart.com", + "mobile_no": { + "number": "9167943983", + "country_code": 91 + } + }, + "integration_type": { + "order": "browntape", + "inventory": "browntape" + }, + "_custom_json": {} + }, + "uid": "10_RTYUIDSDFV", + "size": "AAX1 (1 PCS)", + "inventory_updated_on": "2021-04-06T03:29:35.291000", + "seller_identifier": "RTYUIDSDFV", + "item_id": 7500651, + "quantity": 10, + "price": 1234, + "price_effective": 1234, + "price_transfer": 0, + "currency": "INR", + "sellable_quantity": 10, + "identifiers": [ + { + "gtin_type": "sku_code", + "gtin_value": "RTYUIDSDFV", + "primary": true + } + ] + }, + { + "store": { + "name": "ABC-1-17", + "store_code": "ABC-1-17", + "uid": 11061, + "address": { + "state": "MAHARASHTRA", + "address1": "14/1, VINOBHA BHAVE NAGAR", + "lat_long": { + "type": "Point", + "coordinates": [ + 1, + 1 + ] + }, + "address2": "VINOBHA BHAVE NAGAR, KURLA WEST, KURLA, ", + "pincode": 400070, + "country": "INDIA", + "city": "MUMBAI" + }, + "manager": { + "name": "Fahim", + "email": "fahimsakri@gofynd.com", + "mobile_no": { + "number": "9594495254", + "country_code": 91 + } + }, + "integration_type": { + "order": "browntape", + "inventory": "browntape" + }, + "_custom_json": {} + }, + "uid": "11061_RTYUIDSDFV", + "size": "AAX1 (1 PCS)", + "inventory_updated_on": "2021-03-17T12:35:29.992000", + "seller_identifier": "RTYUIDSDFV", + "item_id": 7500651, + "quantity": 10000000, + "price": 1234, + "price_effective": 1234, + "price_transfer": 0, + "currency": "INR", + "sellable_quantity": 10000000, + "order_committed_quantity": 0, + "identifiers": [ + { + "gtin_type": "sku_code", + "gtin_value": "RTYUIDSDFV", + "primary": true + } + ] + }, + { + "store": { + "name": "RRL01", + "store_code": "WH_8513", + "uid": 1, + "address": { + "state": "MAHARASHTRA", + "address1": "SHOPSENSE RETAIL TECHNOLOGIES PRIVATE LIMITED 1ST FLOOR WEWORK VIJAY DIAMOND, CROSS RD B, AJIT NAGAR,", + "lat_long": { + "type": "Point", + "coordinates": [ + 72.8691788, + 19.1174114 + ] + }, + "address2": "KONDIVITA, ANDHERI EAST, MUMBAI, MAHARASHTRA 400069", + "pincode": 400059, + "country": "INDIA", + "city": "MUMBAI" + }, + "manager": { + "name": "ASHISH CHANDORKAR", + "email": "ASHISHCHANDORKAR@FYND.COM", + "mobile_no": { + "number": "8369782851", + "country_code": 91 + } + }, + "integration_type": { + "order": "browntape", + "inventory": "browntape" + }, + "_custom_json": {} + }, + "uid": "1_RTYUIDSDFV", + "size": "AAX1 (1 PCS)", + "inventory_updated_on": "2021-03-31T19:00:10.943000", + "seller_identifier": "RTYUIDSDFV", + "item_id": 7500651, + "quantity": 39, + "price": 1234, + "price_effective": 1234, + "price_transfer": 0, + "currency": "INR", + "sellable_quantity": 18, + "order_committed_quantity": 7, + "not_available_quantity": 0, + "damaged_quantity": 0, + "identifiers": [ + { + "gtin_type": "sku_code", + "gtin_value": "RTYUIDSDFV", + "primary": true + } + ] + }, + { + "store": { + "name": "RRL01", + "store_code": "WH_8513", + "uid": 1, + "address": { + "state": "MAHARASHTRA", + "address1": "SHOPSENSE RETAIL TECHNOLOGIES PRIVATE LIMITED 1ST FLOOR WEWORK VIJAY DIAMOND, CROSS RD B, AJIT NAGAR,", + "lat_long": { + "type": "Point", + "coordinates": [ + 72.8691788, + 19.1174114 + ] + }, + "address2": "KONDIVITA, ANDHERI EAST, MUMBAI, MAHARASHTRA 400069", + "pincode": 400059, + "country": "INDIA", + "city": "MUMBAI" + }, + "manager": { + "name": "ASHISH CHANDORKAR", + "email": "ASHISHCHANDORKAR@FYND.COM", + "mobile_no": { + "number": "8369782851", + "country_code": 91 + } + }, + "integration_type": { + "order": "browntape", + "inventory": "browntape" + }, + "_custom_json": {} + }, + "uid": "1_rtyuidsdfv", + "size": "AAX1 (1 PCS)", + "inventory_updated_on": "2020-07-07T10:37:06.146000", + "seller_identifier": "RTYUIDSDFV", + "item_id": 7500651, + "quantity": 39, + "price": 1234, + "price_effective": 1234, + "price_transfer": 0, + "currency": "INR", + "sellable_quantity": 0, + "order_committed_quantity": 39, + "identifiers": [ + { + "gtin_type": "sku_code", + "gtin_value": "RTYUIDSDFV", + "primary": true + } + ] + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 5, + "has_previous": false, + "has_next": false + } +} +``` +
    + + + + + + + + + +--- + + +#### addInventory +Add Inventory for particular size and store. + + + + +```swift +client.catalog.addInventory(itemId: itemId, size: size, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| itemId | Double | yes | Item code of the product of which size is to be get. | +| size | String | yes | Size in which inventory is to be added. | +| body | InventoryRequest | yes | Request body | + + +This API allows add Inventory for particular size and store. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getInventoryBySizeIdentifier +Get Inventory for company + + + + +```swift +client.catalog.getInventoryBySizeIdentifier(itemId: itemId, sizeIdentifier: sizeIdentifier, pageNo: pageNo, pageSize: pageSize, q: q, locationIds: locationIds) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| itemId | String | yes | Item code of the product of which size is to be get. | +| sizeIdentifier | String | yes | Size Identifier (Seller Identifier or Primary Identifier) of which inventory is to get. | +| pageNo | Int? | no | The page number to navigate through the given set of results | +| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | +| q | String? | no | Search with help of store code. | +| locationIds | [Int]? | no | Search by store ids. | + + + +This API allows get Inventory data for particular company grouped by size and store. + +*Returned Response:* + + + + +[InventoryResponse](#InventoryResponse) + +returns a list of all inventory grouped by size and store + + + + +
    +  Example: + +```json +{ + "items": [ + { + "store": { + "name": "yosss sdd dsdyo", + "store_code": "sanic6sdfsf7", + "uid": 59, + "address": { + "state": "MAHARASHTRA", + "address1": "A/204, SAI VANDAN, NARAYAN NAGAR, TULINJ ROAD", + "lat_long": { + "type": "Point", + "coordinates": [ + 72.8231511, + 19.4232024 + ] + }, + "address2": "", + "pincode": 401209, + "country": "INDIA", + "city": "MUMBAI", + "landmark": "" + }, + "manager": { + "name": "abc", + "email": "a@b.com", + "mobile_no": { + "number": "2382634324", + "country_code": 91 + } + }, + "integration_type": { + "order": "browntape", + "inventory": "browntape" + }, + "_custom_json": {} + }, + "uid": "59_RTYUIDSDFV", + "size": "AAX1 (1 PCS)", + "inventory_updated_on": "2021-04-06T03:30:01.487000", + "seller_identifier": "RTYUIDSDFV", + "item_id": 7500651, + "quantity": 10, + "price": 1234, + "price_effective": 1234, + "price_transfer": 0, + "currency": "INR", + "sellable_quantity": 10, + "identifiers": [ + { + "gtin_type": "sku_code", + "gtin_value": "RTYUIDSDFV", + "primary": true + } + ] + }, + { + "store": { + "name": "Saran Ledonne", + "store_code": "af6198fe-2c23-4441-bbf4-e694c96e255c", + "uid": 10, + "address": { + "state": "MAHA", + "address1": "NO", + "lat_long": { + "type": "Point", + "coordinates": [ + 1, + 1 + ] + }, + "address2": "", + "pincode": 400072, + "country": "INDIA", + "city": "MUMBAI" + }, + "manager": { + "name": "abc", + "email": "rehman@cashkart.com", + "mobile_no": { + "number": "9167943983", + "country_code": 91 + } + }, + "integration_type": { + "order": "browntape", + "inventory": "browntape" + }, + "_custom_json": {} + }, + "uid": "10_RTYUIDSDFV", + "size": "AAX1 (1 PCS)", + "inventory_updated_on": "2021-04-06T03:29:35.291000", + "seller_identifier": "RTYUIDSDFV", + "item_id": 7500651, + "quantity": 10, + "price": 1234, + "price_effective": 1234, + "price_transfer": 0, + "currency": "INR", + "sellable_quantity": 10, + "identifiers": [ + { + "gtin_type": "sku_code", + "gtin_value": "RTYUIDSDFV", + "primary": true + } + ] + }, + { + "store": { + "name": "ABC-1-17", + "store_code": "ABC-1-17", + "uid": 11061, + "address": { + "state": "MAHARASHTRA", + "address1": "14/1, VINOBHA BHAVE NAGAR", + "lat_long": { + "type": "Point", + "coordinates": [ + 1, + 1 + ] + }, + "address2": "VINOBHA BHAVE NAGAR, KURLA WEST, KURLA, ", + "pincode": 400070, + "country": "INDIA", + "city": "MUMBAI" + }, + "manager": { + "name": "Fahim", + "email": "fahimsakri@gofynd.com", + "mobile_no": { + "number": "9594495254", + "country_code": 91 + } + }, + "integration_type": { + "order": "browntape", + "inventory": "browntape" + }, + "_custom_json": {} + }, + "uid": "11061_RTYUIDSDFV", + "size": "AAX1 (1 PCS)", + "inventory_updated_on": "2021-03-17T12:35:29.992000", + "seller_identifier": "RTYUIDSDFV", + "item_id": 7500651, + "quantity": 10000000, + "price": 1234, + "price_effective": 1234, + "price_transfer": 0, + "currency": "INR", + "sellable_quantity": 10000000, + "order_committed_quantity": 0, + "identifiers": [ + { + "gtin_type": "sku_code", + "gtin_value": "RTYUIDSDFV", + "primary": true + } + ] + }, + { + "store": { + "name": "RRL01", + "store_code": "WH_8513", + "uid": 1, + "address": { + "state": "MAHARASHTRA", + "address1": "SHOPSENSE RETAIL TECHNOLOGIES PRIVATE LIMITED 1ST FLOOR WEWORK VIJAY DIAMOND, CROSS RD B, AJIT NAGAR,", + "lat_long": { + "type": "Point", + "coordinates": [ + 72.8691788, + 19.1174114 + ] + }, + "address2": "KONDIVITA, ANDHERI EAST, MUMBAI, MAHARASHTRA 400069", + "pincode": 400059, + "country": "INDIA", + "city": "MUMBAI" + }, + "manager": { + "name": "ASHISH CHANDORKAR", + "email": "ASHISHCHANDORKAR@FYND.COM", + "mobile_no": { + "number": "8369782851", + "country_code": 91 + } + }, + "integration_type": { + "order": "browntape", + "inventory": "browntape" + }, + "_custom_json": {} + }, + "uid": "1_RTYUIDSDFV", + "size": "AAX1 (1 PCS)", + "inventory_updated_on": "2021-03-31T19:00:10.943000", + "seller_identifier": "RTYUIDSDFV", + "item_id": 7500651, + "quantity": 39, + "price": 1234, + "price_effective": 1234, + "price_transfer": 0, + "currency": "INR", + "sellable_quantity": 18, + "order_committed_quantity": 7, + "not_available_quantity": 0, + "damaged_quantity": 0, + "identifiers": [ + { + "gtin_type": "sku_code", + "gtin_value": "RTYUIDSDFV", + "primary": true + } + ] + }, + { + "store": { + "name": "RRL01", + "store_code": "WH_8513", + "uid": 1, + "address": { + "state": "MAHARASHTRA", + "address1": "SHOPSENSE RETAIL TECHNOLOGIES PRIVATE LIMITED 1ST FLOOR WEWORK VIJAY DIAMOND, CROSS RD B, AJIT NAGAR,", + "lat_long": { + "type": "Point", + "coordinates": [ + 72.8691788, + 19.1174114 + ] + }, + "address2": "KONDIVITA, ANDHERI EAST, MUMBAI, MAHARASHTRA 400069", + "pincode": 400059, + "country": "INDIA", + "city": "MUMBAI" + }, + "manager": { + "name": "ASHISH CHANDORKAR", + "email": "ASHISHCHANDORKAR@FYND.COM", + "mobile_no": { + "number": "8369782851", + "country_code": 91 + } + }, + "integration_type": { + "order": "browntape", + "inventory": "browntape" + }, + "_custom_json": {} + }, + "uid": "1_rtyuidsdfv", + "size": "AAX1 (1 PCS)", + "inventory_updated_on": "2020-07-07T10:37:06.146000", + "seller_identifier": "RTYUIDSDFV", + "item_id": 7500651, + "quantity": 39, + "price": 1234, + "price_effective": 1234, + "price_transfer": 0, + "currency": "INR", + "sellable_quantity": 0, + "order_committed_quantity": 39, + "identifiers": [ + { + "gtin_type": "sku_code", + "gtin_value": "RTYUIDSDFV", + "primary": true + } + ] + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 5, + "has_previous": false, + "has_next": false + } +} +``` +
    + + + + + + + + + +--- + + +#### getDiscountedInventoryBySizeIdentifier +Get Inventory for company + + + + +```swift +client.application("").catalog.getDiscountedInventoryBySizeIdentifier(itemId: itemId, sizeIdentifier: sizeIdentifier, pageNo: pageNo, pageSize: pageSize, q: q, locationIds: locationIds) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| itemId | Int | yes | Item code of the product of which size is to be get. | +| sizeIdentifier | String | yes | Size Identifier (Seller Identifier or Primary Identifier) of which inventory is to get. | +| pageNo | Int? | no | The page number to navigate through the given set of results | +| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | +| q | String? | no | Search with help of store code. | +| locationIds | [Int]? | no | Search by store ids. | + + + +This API allows get Inventory data for particular company grouped by size and store. + +*Returned Response:* + + + + +[InventoryResponse](#InventoryResponse) + +returns a list of all inventory grouped by size and store + + + + +
    +  Example: + +```json +{ + "items": [ + { + "store": { + "name": "yosss sdd dsdyo", + "store_code": "sanic6sdfsf7", + "uid": 59, + "address": { + "state": "MAHARASHTRA", + "address1": "A/204, SAI VANDAN, NARAYAN NAGAR, TULINJ ROAD", + "lat_long": { + "type": "Point", + "coordinates": [ + 72.8231511, + 19.4232024 + ] + }, + "address2": "", + "pincode": 401209, + "country": "INDIA", + "city": "MUMBAI", + "landmark": "" + }, + "manager": { + "name": "abc", + "email": "a@b.com", + "mobile_no": { + "number": "2382634324", + "country_code": 91 + } + }, + "integration_type": { + "order": "browntape", + "inventory": "browntape" + }, + "_custom_json": {} + }, + "uid": "59_RTYUIDSDFV", + "size": "AAX1 (1 PCS)", + "inventory_updated_on": "2021-04-06T03:30:01.487000", + "seller_identifier": "RTYUIDSDFV", + "item_id": 7500651, + "quantity": 10, + "price": 1234, + "price_effective": 1234, + "price_transfer": 0, + "currency": "INR", + "sellable_quantity": 10, + "identifiers": [ + { + "gtin_type": "sku_code", + "gtin_value": "RTYUIDSDFV", + "primary": true + } + ] + }, + { + "store": { + "name": "Saran Ledonne", + "store_code": "af6198fe-2c23-4441-bbf4-e694c96e255c", + "uid": 10, + "address": { + "state": "MAHA", + "address1": "NO", + "lat_long": { + "type": "Point", + "coordinates": [ + 1, + 1 + ] + }, + "address2": "", + "pincode": 400072, + "country": "INDIA", + "city": "MUMBAI" + }, + "manager": { + "name": "abc", + "email": "rehman@cashkart.com", + "mobile_no": { + "number": "9167943983", + "country_code": 91 + } + }, + "integration_type": { + "order": "browntape", + "inventory": "browntape" + }, + "_custom_json": {} + }, + "uid": "10_RTYUIDSDFV", + "size": "AAX1 (1 PCS)", + "inventory_updated_on": "2021-04-06T03:29:35.291000", + "seller_identifier": "RTYUIDSDFV", + "item_id": 7500651, + "quantity": 10, + "price": 1234, + "price_effective": 1234, + "price_transfer": 0, + "currency": "INR", + "sellable_quantity": 10, + "identifiers": [ + { + "gtin_type": "sku_code", + "gtin_value": "RTYUIDSDFV", + "primary": true + } + ] + }, + { + "store": { + "name": "ABC-1-17", + "store_code": "ABC-1-17", + "uid": 11061, + "address": { + "state": "MAHARASHTRA", + "address1": "14/1, VINOBHA BHAVE NAGAR", + "lat_long": { + "type": "Point", + "coordinates": [ + 1, + 1 + ] + }, + "address2": "VINOBHA BHAVE NAGAR, KURLA WEST, KURLA, ", + "pincode": 400070, + "country": "INDIA", + "city": "MUMBAI" + }, + "manager": { + "name": "Fahim", + "email": "fahimsakri@gofynd.com", + "mobile_no": { + "number": "9594495254", + "country_code": 91 + } + }, + "integration_type": { + "order": "browntape", + "inventory": "browntape" + }, + "_custom_json": {} + }, + "uid": "11061_RTYUIDSDFV", + "size": "AAX1 (1 PCS)", + "inventory_updated_on": "2021-03-17T12:35:29.992000", + "seller_identifier": "RTYUIDSDFV", + "item_id": 7500651, + "quantity": 10000000, + "price": 1234, + "price_effective": 1234, + "price_transfer": 0, + "currency": "INR", + "sellable_quantity": 10000000, + "order_committed_quantity": 0, + "identifiers": [ + { + "gtin_type": "sku_code", + "gtin_value": "RTYUIDSDFV", + "primary": true + } + ] + }, + { + "store": { + "name": "RRL01", + "store_code": "WH_8513", + "uid": 1, + "address": { + "state": "MAHARASHTRA", + "address1": "SHOPSENSE RETAIL TECHNOLOGIES PRIVATE LIMITED 1ST FLOOR WEWORK VIJAY DIAMOND, CROSS RD B, AJIT NAGAR,", + "lat_long": { + "type": "Point", + "coordinates": [ + 72.8691788, + 19.1174114 + ] + }, + "address2": "KONDIVITA, ANDHERI EAST, MUMBAI, MAHARASHTRA 400069", + "pincode": 400059, + "country": "INDIA", + "city": "MUMBAI" + }, + "manager": { + "name": "ASHISH CHANDORKAR", + "email": "ASHISHCHANDORKAR@FYND.COM", + "mobile_no": { + "number": "8369782851", + "country_code": 91 + } + }, + "integration_type": { + "order": "browntape", + "inventory": "browntape" + }, + "_custom_json": {} + }, + "uid": "1_RTYUIDSDFV", + "size": "AAX1 (1 PCS)", + "inventory_updated_on": "2021-03-31T19:00:10.943000", + "seller_identifier": "RTYUIDSDFV", + "item_id": 7500651, + "quantity": 39, + "price": 1234, + "price_effective": 1234, + "price_transfer": 0, + "currency": "INR", + "sellable_quantity": 18, + "order_committed_quantity": 7, + "not_available_quantity": 0, + "damaged_quantity": 0, + "identifiers": [ + { + "gtin_type": "sku_code", + "gtin_value": "RTYUIDSDFV", + "primary": true + } + ] + }, + { + "store": { + "name": "RRL01", + "store_code": "WH_8513", + "uid": 1, + "address": { + "state": "MAHARASHTRA", + "address1": "SHOPSENSE RETAIL TECHNOLOGIES PRIVATE LIMITED 1ST FLOOR WEWORK VIJAY DIAMOND, CROSS RD B, AJIT NAGAR,", + "lat_long": { + "type": "Point", + "coordinates": [ + 72.8691788, + 19.1174114 + ] + }, + "address2": "KONDIVITA, ANDHERI EAST, MUMBAI, MAHARASHTRA 400069", + "pincode": 400059, + "country": "INDIA", + "city": "MUMBAI" + }, + "manager": { + "name": "ASHISH CHANDORKAR", + "email": "ASHISHCHANDORKAR@FYND.COM", + "mobile_no": { + "number": "8369782851", + "country_code": 91 + } + }, + "integration_type": { + "order": "browntape", + "inventory": "browntape" + }, + "_custom_json": {} + }, + "uid": "1_rtyuidsdfv", + "size": "AAX1 (1 PCS)", + "inventory_updated_on": "2020-07-07T10:37:06.146000", + "seller_identifier": "RTYUIDSDFV", + "item_id": 7500651, + "quantity": 39, + "price": 1234, + "price_effective": 1234, + "price_transfer": 0, + "currency": "INR", + "sellable_quantity": 0, + "order_committed_quantity": 39, + "identifiers": [ + { + "gtin_type": "sku_code", + "gtin_value": "RTYUIDSDFV", + "primary": true + } + ] + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 5, + "has_previous": false, + "has_next": false + } +} +``` +
    + + + + + + + + + +--- + + +#### deleteInventory +Delete a Inventory. + + + + +```swift +client.catalog.deleteInventory(size: size, itemId: itemId, locationId: locationId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| size | String | yes | size that is to be deleted. | +| itemId | Int | yes | Id of the product associated with Inventory to be deleted. | +| locationId | Double | yes | Location ID of store of which inventory is to be deleted. | + + + +This API allows to delete inventory of a particular product for particular company. + +*Returned Response:* + + + + +[InventoryDelete](#InventoryDelete) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getInventoryBulkUploadHistory +Get a list of all bulk Inventory upload jobs. + + + + +```swift +client.catalog.getInventoryBulkUploadHistory(pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results | +| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | + + + +This API helps to get bulk Inventory upload jobs data. + +*Returned Response:* + + + + +[BulkInventoryGet](#BulkInventoryGet) + +List of bulk Inventory upload jobs. See `BulkInventoryGetSchema` for details + + + + +
    +  Example: + +```json +{ + "items": [ + { + "succeed": 1, + "stage": "completed", + "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/50DbgKLND-NtnL_EAVb-REicn1sDv-V8ZrKdnLt-product_inventory.csv", + "created_on": "2021-03-11T10:54:44.998000Z", + "cancelled_records": [], + "created_by": { + "username": "nikhilmhatre_gofynd_com_97636", + "user_id": "16", + "full_name": "Nikhil Mhatre" + }, + "modified_on": "2021-03-11T10:54:45.296000Z", + "cancelled": 0, + "failed": 0, + "modified_by": { + "user_id": "0", + "username": "Silverbolt" + }, + "company_id": 1, + "total": 1, + "is_active": true, + "failed_records": [], + "id": "6049f6f5723043000125a9ea" + }, + { + "created_by": { + "username": "silverbolt", + "user_id": "-1" + }, + "cancelled": 0, + "modified_by": { + "username": "Silverbolt", + "user_id": "0" + }, + "created_on": "2021-03-04T09:46:51.714000Z", + "company_id": 1, + "failed": 0, + "failed_records": [], + "succeed": 1, + "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/NtnL_EAVb-REicn1sDv-V8ZrKdnLt-product_inventory.csv", + "cancelled_records": [], + "total": 1, + "is_active": true, + "modified_on": "2021-03-04T09:46:55.349000Z", + "stage": "completed", + "id": "6040ac8b1803830001fcc1ed" + }, + { + "company_id": 1, + "failed": 0, + "modified_by": { + "user_id": "-1", + "username": "silverbolt" + }, + "cancelled": 0, + "is_active": true, + "cancelled_records": [], + "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/bmBZY9iAX-REicn1sDv-V8ZrKdnLt-product_inventory.csv", + "created_by": { + "user_id": "-1", + "username": "silverbolt" + }, + "modified_on": "2021-03-04T09:22:32.222000Z", + "succeed": 0, + "failed_records": [], + "stage": "terminated", + "created_on": "2021-03-04T09:22:32.222000Z", + "total": 1, + "id": "6040a6d8104f110001a85061" + }, + { + "company_id": 1, + "failed": 0, + "modified_by": { + "user_id": "-1", + "username": "silverbolt" + }, + "cancelled": 0, + "is_active": true, + "cancelled_records": [], + "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/m73yWRT3v-REicn1sDv-V8ZrKdnLt-product_inventory.csv", + "created_by": { + "user_id": "-1", + "username": "silverbolt" + }, + "modified_on": "2021-03-04T09:20:29.719000Z", + "succeed": 0, + "failed_records": [], + "stage": "terminated", + "created_on": "2021-03-04T09:20:29.719000Z", + "total": 1, + "id": "6040a65d104f110001a85060" + }, + { + "created_on": "2021-03-04T08:50:49.367000Z", + "cancelled_records": [], + "failed_records": [], + "succeed": 0, + "cancelled": 0, + "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/W9lxe19Uu-REicn1sDv-V8ZrKdnLt-product_inventory.csv", + "total": 1, + "created_by": { + "username": "silverbolt", + "user_id": "-1" + }, + "is_active": true, + "modified_by": { + "username": "silverbolt", + "user_id": "-1" + }, + "company_id": 1, + "failed": 0, + "modified_on": "2021-03-04T08:50:49.367000Z", + "stage": "terminated", + "id": "60409f699b21e30001c1e6b5" + }, + { + "total": 1, + "succeed": 1, + "created_on": "2021-02-10T10:57:57.236000Z", + "failed": 0, + "modified_by": { + "user_id": "0", + "username": "Silverbolt" + }, + "created_by": { + "username": "917972410891_48194", + "user_id": "5646", + "full_name": "Sourabh Nilakhe" + }, + "is_active": true, + "cancelled_records": [], + "failed_records": [], + "company_id": 1, + "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/REicn1sDv-V8ZrKdnLt-product_inventory.csv", + "modified_on": "2021-02-10T10:57:57.571000Z", + "stage": "completed", + "cancelled": 0, + "id": "6023bc35c85ca1000171e08a" + }, + { + "total": 1, + "succeed": 1, + "created_on": "2021-02-10T10:57:22.535000Z", + "failed": 0, + "modified_by": { + "user_id": "0", + "username": "Silverbolt" + }, + "created_by": { + "username": "917972410891_48194", + "user_id": "5646", + "full_name": "Sourabh Nilakhe" + }, + "is_active": true, + "cancelled_records": [], + "failed_records": [], + "company_id": 1, + "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/Oth_LaVyI-V8ZrKdnLt-product_inventory.csv", + "modified_on": "2021-02-10T10:57:23.311000Z", + "stage": "completed", + "cancelled": 0, + "id": "6023bc12c85ca1000171e089" + }, + { + "created_by": { + "user_id": "16", + "username": "nikhilmhatre_gofynd_com_97636", + "full_name": "Nikhil Mhatre" + }, + "succeed": 1, + "failed": 0, + "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/V8ZrKdnLt-product_inventory.csv", + "company_id": 1, + "created_on": "2021-01-13T13:58:06.155000Z", + "stage": "completed", + "modified_by": { + "username": "Silverbolt", + "user_id": "0" + }, + "is_active": true, + "total": 1, + "failed_records": [], + "modified_on": "2021-01-13T13:58:06.369000Z", + "cancelled_records": [], + "cancelled": 0, + "id": "5ffefc6ee2db8f000183fab8" + }, + { + "succeed": 0, + "is_active": true, + "cancelled": 0, + "failed_records": [ + { + "identifiers": "1.91887E+11", + "message": "Invalid identifier: 1.91887E+11. Product not found." + } + ], + "total": 1, + "stage": "failed", + "modified_by": { + "username": "Silverbolt", + "user_id": "0" + }, + "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/t3T6X2Riy-product_inventory.csv", + "cancelled_records": [], + "created_by": { + "username": "nikhilmhatre_gofynd_com_97636", + "user_id": "16", + "full_name": "Nikhil Mhatre" + }, + "created_on": "2021-01-13T13:57:38.598000Z", + "company_id": 1, + "failed": 1, + "modified_on": "2021-01-13T13:57:38.832000Z", + "id": "5ffefc5252f31100012ea981" + }, + { + "total": 1, + "company_id": 1, + "created_by": { + "user_id": "16", + "username": "nikhilmhatre_gofynd_com_97636", + "full_name": "Nikhil Mhatre" + }, + "failed": 1, + "modified_on": "2021-01-13T13:57:13.847000Z", + "succeed": 0, + "stage": "failed", + "cancelled_records": [], + "failed_records": [ + { + "identifiers": "1.91887E+11", + "message": "Invalid identifier: 1.91887E+11. Product not found." + } + ], + "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/NSTuhgsgq-product_inventory.csv", + "is_active": true, + "created_on": "2021-01-13T13:57:13.639000Z", + "cancelled": 0, + "modified_by": { + "username": "Silverbolt", + "user_id": "0" + }, + "id": "5ffefc39a0d1e20001ae118c" + }, + { + "succeed": 1, + "failed": 0, + "failed_records": [], + "cancelled": 0, + "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/cwQV-Z6gT-product_inventory.xlsx", + "created_on": "2021-01-12T06:37:06.167000Z", + "is_active": true, + "cancelled_records": [], + "created_by": { + "user_id": "16", + "username": "nikhilmhatre_gofynd_com_97636", + "full_name": "Nikhil Mhatre" + }, + "company_id": 1, + "stage": "completed", + "modified_by": { + "username": "Silverbolt", + "user_id": "0" + }, + "modified_on": "2021-01-12T06:37:06.307000Z", + "total": 1, + "id": "5ffd4392b4c34d000170697b" + }, + { + "succeed": 1, + "failed": 0, + "failed_records": [], + "cancelled": 0, + "file_path": "https://hdn-1.addsale.com/x0/company/1/self/documents/inventory-import/free/original/gccehef2f-product_inventory.xlsx", + "created_on": "2021-01-12T06:36:24.292000Z", + "is_active": true, + "cancelled_records": [], + "created_by": { + "user_id": "16", + "username": "nikhilmhatre_gofynd_com_97636", + "full_name": "Nikhil Mhatre" + }, + "company_id": 1, + "stage": "completed", + "modified_by": { + "username": "Silverbolt", + "user_id": "0" + }, + "modified_on": "2021-01-12T06:36:24.535000Z", + "total": 1, + "id": "5ffd4368b4c34d0001706960" + } + ], + "page": { + "type": "number", + "current": 1, + "size": 4, + "item_total": 39, + "has_previous": false, + "has_next": true + } +} +``` +
    + + + + + + + + + +--- + + +#### createBulkInventoryJob +Create a Bulk Inventory upload Job. + + + + +```swift +client.catalog.createBulkInventoryJob(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | BulkJob | yes | Request body | + + +This API helps to create a bulk Inventory upload job. + +*Returned Response:* + + + + +[CommonResponse](#CommonResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### deleteBulkInventoryJob +Delete Bulk Inventory job. + + + + +```swift +client.catalog.deleteBulkInventoryJob(batchId: batchId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| batchId | String | yes | Batch Id of the bulk delete job. | + + + +This API allows to delete bulk Inventory job associated with company. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### createBulkInventory +Create products in bulk associated with given batch Id. + + + + +```swift +client.catalog.createBulkInventory(batchId: batchId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| batchId | String | yes | Batch Id of the bulk create job. | +| body | InventoryBulkRequest | yes | Request body | + + +This API helps to create products in bulk push to kafka for approval/creation. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getInventoryExport +Get Inventory export history. + + + + +```swift +client.catalog.getInventoryExport() { (response, error) in + // Use response +} +``` + + + + + + +This API helps to get Inventory export history. + +*Returned Response:* + + + + +[InventoryExportJob](#InventoryExportJob) + +Returns a list of inventory export jobs + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### createInventoryExportJob +Create a Inventory export Job. + + + + +```swift +client.catalog.createInventoryExportJob(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | InventoryExportRequest | yes | Request body | + + +This API helps to create a Inventory export job. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### exportInventoryConfig +Get List of different filters for inventory export + + + + +```swift +client.catalog.exportInventoryConfig(filterType: filterType) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| filterType | String? | no | filter type from any one of ['brand', 'store', 'type'] | + + + +This API allows get List of different filters like brand, store, and type for inventory export. + +*Returned Response:* + + + + +[InventoryConfig](#InventoryConfig) + +returns filters configuration for inventory export + + + + +
    +  Example: + +```json +[ + { + "display": "csv", + "value": "csv" + }, + { + "display": "excel", + "value": "excel" + } +] +``` +
    + + + + + + + + + +--- + + +#### getAllHsnCodes +Hsn Code List. + + + + +```swift +client.catalog.getAllHsnCodes(pageNo: pageNo, pageSize: pageSize, q: q) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | page no | +| pageSize | Int? | no | page size | +| q | String? | no | search using hsn code. | + + + +Hsn Code List. + +*Returned Response:* + + + + +[HsnCodesListingResponse](#HsnCodesListingResponse) + +List of all HSN Codes. See example below or refer `HsnCodesListingResponseSchema` for details + + + + +
    +  Example: + +```json +{ + "items": [ + { + "company_id": 1, + "hs2_code": "xx", + "hsn_code": "xxxxxxxx", + "tax1": 0, + "tax2": 0, + "threshold1": 999999, + "threshold2": 0, + "tax_on_esp": true, + "tax_on_mrp": false, + "id": "xxxxxxxxxxxx" + } + ], + "page": { + "current": 1, + "size": 2, + "has_previous": false, + "has_next": true, + "item_total": 20 + } +} +``` +
    + + + + + + + + + +--- + + +#### createHsnCode +Create Hsn Code. + + + + +```swift +client.catalog.createHsnCode(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | HsnUpsert | yes | Request body | + + +Create Hsn Code. + +*Returned Response:* + + + + +[HsnCode](#HsnCode) + +See example below for details + + + + +
    +  Example: + +```json +{ + "data": { + "company_id": 1, + "hs2_code": "xx", + "modified_by": { + "username": "narutouzumaki", + "user_id": "0" + }, + "id": "xxxxxxxxxxxx", + "tax_on": "esp", + "slabs": [ + { + "tax": 0, + "threshold": 999999 + }, + { + "tax": 0, + "threshold": 0 + } + ], + "hsn_code": "xxxxxxxx" + } +} +``` +
    + + + + + + + + + +--- + + +#### getHsnCode +Fetch Hsn Code. + + + + +```swift +client.catalog.getHsnCode(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Unique id | + + + +Fetch Hsn Code. + +*Returned Response:* + + + + +[HsnCode](#HsnCode) + +See example below details + + + + +
    +  Example: + +```json +{ + "data": { + "company_id": 1, + "hs2_code": "xx", + "modified_by": { + "username": "narutouzumaki", + "user_id": "0" + }, + "id": "xxxxxxxxxxxx", + "tax_on": "esp", + "slabs": [ + { + "tax": 0, + "threshold": 999999 + }, + { + "tax": 0, + "threshold": 0 + } + ], + "hsn_code": "xxxxxxxx" + } +} +``` +
    + + + + + + + + + +--- + + +#### updateHsnCode +Update Hsn Code. + + + + +```swift +client.catalog.updateHsnCode(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Unique id | +| body | HsnUpsert | yes | Request body | + + +Update Hsn Code. + +*Returned Response:* + + + + +[HsnCode](#HsnCode) + +See example below for details + + + + +
    +  Example: + +```json +{ + "data": { + "company_id": 1, + "hs2_code": "xx", + "modified_by": { + "username": "narutouzumaki", + "user_id": "0" + }, + "id": "xxxxxxxxxxxx", + "tax_on": "esp", + "slabs": [ + { + "tax": 0, + "threshold": 999999 + }, + { + "tax": 0, + "threshold": 0 + } + ], + "hsn_code": "xxxxxxxx" + } +} +``` +
    + + + + + + + + + +--- + + +#### bulkHsnCode +Bulk Create or Update Hsn Code. + + + + +```swift +client.catalog.bulkHsnCode(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | BulkHsnUpsert | yes | Request body | + + +Bulk Create or Update Hsn Code. + +*Returned Response:* + + + + +[BulkHsnResponse](#BulkHsnResponse) + +See example below for details + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getApplicationBrands +List all the brands + + + + +```swift +client.application("").catalog.getApplicationBrands(department: department, pageNo: pageNo, pageSize: pageSize, q: q, brandId: brandId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| department | String? | no | The name of the department. Use this parameter to filter products by a particular department. See below the list of available departments. You can retrieve available departments from the **v1.0/departments/** API | +| pageNo | Int? | no | The page number to navigate through the given set of results | +| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | +| q | String? | no | Search query with brand name.Use this parameter to search brands by brand name. | +| brandId | [Int]? | no | Helps to sort the brands list on the basis of uid list. | + + + +A brand is the name under which a product is being sold. Use this API to list all the brands. You can pass optionally filter the brands by the department. If successful, returns a paginated list of brands specified in `BrandListingResponse` + +*Returned Response:* + + + + +[BrandListingResponse](#BrandListingResponse) + +List of Brands. See example below or refer `BrandListingResponse` for details + + + + +
    +  Example: + +```json +{ + "items": [ + { + "uid": 1, + "name": "Barry, Jennings and Larson", + "slug": "Hess-Inc", + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "banners": { + "portrait": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/12537_9cdfc6835e814b0986ee1643d38cf6cd.png" + } + }, + "en_name": "Barry, Jennings and Larson" + } + ], + "page": { + "current": 1, + "total": 1, + "has_previous": false, + "has_next": false, + "item_total": 1, + "type": "number" + } +} +``` +
    + + + + + + + + + +--- + + +#### getDepartments +List all the departments + + + + +```swift +client.application("").catalog.getDepartments() { (response, error) in + // Use response +} +``` + + + + + + +Departments are a way to categorise similar products. A product can lie in multiple departments. For example, a skirt can below to the 'Women's Fashion' Department while a handbag can lie in 'Women's Accessories' Department. Use this API to list all the departments. If successful, returns the list of departments specified in `DepartmentResponse` + +*Returned Response:* + + + + +[DepartmentResponse](#DepartmentResponse) + +List of Departments. See example below or refer `DepartmentResponse` for details. + + + + +
    +  Example: + +```json +{ + "items": [ + { + "uid": 1, + "name": "Zachary Harris", + "slug": "Zachary-Harris", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "uid": 2, + "name": "Aaron Reilly", + "slug": "Aaron-Reilly", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "uid": 3, + "name": "Bobby Sandoval", + "slug": "Bobby-Sandoval", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "uid": 4, + "name": "Seth Hughes", + "slug": "Seth-Hughes", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "uid": 5, + "name": "Michelle Moore", + "slug": "Michelle-Moore", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "uid": 6, + "name": "Annette Baldwin", + "slug": "Annette-Baldwin", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "uid": 7, + "name": "Chris Mata", + "slug": "Chris-Mata", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "uid": 8, + "name": "Nicole Jacobs", + "slug": "Nicole-Jacobs", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "uid": 9, + "name": "Pamela Smith", + "slug": "Pamela-Smith", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "uid": 10, + "name": "Nicole Simon", + "slug": "Nicole-Simon", + "priority_order": 7, + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getCategories +List all the categories + + + + +```swift +client.application("").catalog.getCategories(department: department) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| department | String? | no | The name of the department. Use this parameter to filter products by a particular department. See below the list of available departments. You can retrieve available departments from the **v1.0/departments/** API | + + + +List all the categories. You can optionally pass filter the brands by the department. If successful, returns a paginated list of brands specified in `CategoryListingResponse` + +*Returned Response:* + + + + +[CategoryListingResponse](#CategoryListingResponse) + +List of Categories. See example below or refer `CategoryListingResponse` for details. + + + + +
    +  Example: + +```json +{ + "departments": [ + { + "slug": "Cody-Doyle", + "uid": 1 + } + ], + "data": [ + { + "department": "Cody-Doyle", + "items": [ + { + "name": "Janet Parker", + "image": { + "aspect_ratio": "13:20", + "aspect_ratio_f": 0.65, + "url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/banner_portrait/category/resize-w:130,h:200/12064_e69e1d8b5e934d3488f0dc8663d8a158.jpg" + }, + "uid": 1, + "slug": "Janet-Parker", + "_custom_json": {}, + "action": { + "type": "category", + "url": "https://api.addsale.com/platform/content/v1/products/?l1_category=Janet-Parker&department=Jaime-Chambers", + "query": { + "l1_category": [ + "Janet-Parker" + ], + "department": [ + "Jaime-Chambers" + ] + } + }, + "childs": [ + { + "name": "Hannah Lawson", + "image": { + "aspect_ratio": "13:20", + "aspect_ratio_f": 0.65, + "url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/banner_portrait/category/resize-w:130,h:200/12064_e69e1d8b5e934d3488f0dc8663d8a158.jpg" + }, + "uid": 2, + "slug": "Hannah-Lawson", + "_custom_json": {}, + "action": { + "type": "category", + "url": "https://api.addsale.com/platform/content/v1/products/?l2_category=Hannah-Lawson&department=Jaime-Chambers", + "query": { + "l2_category": [ + "Hannah-Lawson" + ], + "department": [ + "Jaime-Chambers" + ] + } + }, + "childs": [ + { + "name": "Logan Black", + "image": { + "aspect_ratio": "13:20", + "aspect_ratio_f": 0.65, + "url": "https://d2zv4gzhlr4ud6.cloudfront.net/media/banner_portrait/category/resize-w:130,h:200/12064_e69e1d8b5e934d3488f0dc8663d8a158.jpg" + }, + "uid": 3, + "slug": "Logan-Black", + "_custom_json": {}, + "action": { + "type": "category", + "url": "https://api.addsale.com/platform/content/v1/products/?category=Logan-Black&department=Jaime-Chambers", + "query": { + "category": [ + "Logan-Black" + ], + "department": [ + "Jaime-Chambers" + ] + } + }, + "childs": [] + } + ] + } + ] + } + ] + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getAppicationProducts +List the products + + + + +```swift +client.application("").catalog.getAppicationProducts(q: q, f: f, filters: filters, sortOn: sortOn, pageId: pageId, pageSize: pageSize, pageNo: pageNo, pageType: pageType, itemIds: itemIds) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| q | String? | no | The search query. This can be a partial or complete name of a either a product, brand or category | +| f | String? | no | The search filter parameters. All the parameter filtered from filter parameters will be passed in **f** parameter in this format. **?f=brand:voi-jeans||and:::category:t-shirts||shirts** | +| filters | Bool? | no | Pass `filters` parameter to fetch the filter details. This flag is used to fetch all filters | +| sortOn | String? | no | The order to sort the list of products on. The supported sort parameters are popularity, price, redemption and discount in either ascending or descending order. See the supported values below. | +| pageId | String? | no | Each response will contain **page_id** param, which should be sent back to make pagination work. | +| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | +| pageNo | Int? | no | If page_type is number then pass it to fetch page items. Default is 1. | +| pageType | String? | no | For pagination type should be cursor or number. Default is cursor. | +| itemIds | [Int]? | no | Item Ids of product | + + + +List all the products associated with a brand, collection or category in a requested sort order. The API additionally supports arbitrary search queries that may refer the name of any product, brand, category or collection. If successful, returns a paginated list of products specified in `ApplicationProductListingResponse` + +*Returned Response:* + + + + +[ApplicationProductListingResponse](#ApplicationProductListingResponse) + +List of Products. See example below or refer `ApplicationProductListingResponse` for details + + + + +
    +  Example: + +```json +{ + "filters": [ + { + "key": { + "display": "Department", + "name": "department", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Department.svg" + }, + "values": [ + { + "display": "Debra Villarreal", + "count": 15, + "is_selected": false, + "value": "Debra-Villarreal", + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + }, + { + "display": "Tracey Miller", + "count": 15, + "is_selected": false, + "value": "Tracey-Miller", + "logo": { + "type": "image", + "url": "http://cdn4.gofynd.com/media/category_tab_icons/department/Men.png" + } + } + ] + }, + { + "key": { + "display": "Category", + "name": "category", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Category.svg" + }, + "values": [ + { + "display": "Amy Kim DDS", + "count": 15, + "is_selected": false, + "value": "3", + "logo": "http://cdn4.gofynd.com/media/banner/category/original/12063_a5bb91bd5cb44c3c9db98c2a0e6b3d99.jpg" + } + ] + }, + { + "key": { + "display": "Gender", + "name": "gender", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Gender.svg" + }, + "values": [ + { + "display": "Men", + "count": 15, + "is_selected": false, + "value": "men" + }, + { + "display": "Women", + "count": 15, + "is_selected": false, + "value": "women" + } + ] + }, + { + "key": { + "display": "Size", + "name": "sizes", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Sizes.svg" + }, + "values": [ + { + "display": "13", + "count": 15, + "is_selected": false, + "value": "13" + } + ] + }, + { + "key": { + "display": "Brand", + "name": "brand", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Brand%20ID.svg" + }, + "values": [ + { + "display": "Barry, Jennings and Larson", + "count": 15, + "is_selected": false, + "value": "1", + "logo": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + } + ] + }, + { + "key": { + "display": "Rating", + "name": "rating", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/Rating.svg" + }, + "values": [ + { + "count": 15, + "display": "2 - 3", + "value": "[2 TO 3}", + "is_selected": false + } + ] + }, + { + "key": { + "display": "Image", + "name": "image_nature", + "kind": "multivalued", + "logo": "https://hdn-1.fynd.com/global/menu-icons/image%20Nature.svg" + }, + "values": [ + { + "display": "GoodQuality", + "count": 15, + "is_selected": false, + "value": "standard" + } + ] + }, + { + "key": { + "display": "Monica Hampton", + "name": "material", + "kind": "multivalued", + "logo": "" + }, + "values": [ + { + "display": "Neoprene", + "count": 15, + "is_selected": false, + "value": "Neoprene" + } + ] + }, + { + "key": { + "display": "John Mendoza", + "name": "weight", + "kind": "multivalued", + "logo": "" + }, + "values": [ + { + "display": "100", + "count": 15, + "is_selected": false, + "value": "100" + } + ] + }, + { + "key": { + "display": "Kimberly Mcdaniel", + "name": "gender", + "kind": "multivalued", + "logo": "" + }, + "values": [ + { + "display": "['Men', 'Women']", + "count": 15, + "is_selected": false, + "value": "['Men', 'Women']" + } + ] + }, + { + "key": { + "display": "Kimberly Davidson", + "name": "color", + "kind": "multivalued", + "logo": "" + }, + "values": [ + { + "display": "Grey", + "count": 15, + "is_selected": false, + "value": "808080" + } + ] + }, + { + "key": { + "display": "Available", + "name": "is_available", + "kind": "singlevalued", + "logo": "" + }, + "values": [ + { + "display": "Available", + "count": 3, + "is_selected": false, + "value": true + } + ] + } + ], + "items": [ + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "benchmark collaborative paradigms", + "slug": "benchmark-collaborative-paradigms", + "uid": 1, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "benchmark-collaborative-paradigms" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "item_code": "ITEM_CODE_1", + "rating": 2.7 + }, + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "architect granular e-business", + "slug": "architect-granular-e-business", + "uid": 10, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "architect-granular-e-business" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "item_code": "ITEM_CODE_2", + "rating": 2.7 + }, + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "facilitate enterprise supply-chains", + "slug": "facilitate-enterprise-supply-chains", + "uid": 11, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "facilitate-enterprise-supply-chains" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "item_code": "ITEM_CODE_3", + "rating": 2.7 + }, + { + "type": "product", + "attributes": { + "primary_color_hex": "808080", + "weight": "100", + "gender": "women", + "material": "Neoprene", + "primary_color": "DarkGrey" + }, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "sellable": true, + "name": "optimize web-enabled e-tailers", + "slug": "optimize-web-enabled-e-tailers", + "uid": 12, + "item_type": "set", + "brand": { + "type": "brand", + "name": "Hess Inc", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "action": { + "page": { + "type": "product", + "query": { + "slug": "optimize-web-enabled-e-tailers" + } + }, + "type": "page" + }, + "medias": [ + { + "type": "image", + "url": "https://hdn-1.fynd.com/media/fynd_store_items/l2_category/original/2830_c5bb5fc02f414307a828c4c56483c30a.jpg" + } + ], + "discount": "14% OFF", + "price": { + "marked": { + "min": 1399, + "max": 1499, + "currency_code": "INR", + "currency_symbol": "₹" + }, + "effective": { + "min": 1199, + "max": 1399, + "currency_code": "INR", + "currency_symbol": "₹" + } + }, + "is_tryout": false, + "promo_meta": { + "title": "", + "subtitle": "" + }, + "item_code": "ITEM_CODE_4", + "rating": 2.7 + } + ], + "sort_on": [ + { + "display": "Latest Products.", + "name": "Latest Products.", + "logo": "https://d2zv4gzhlr4ud6.cloudfront.net/media/pictures/tagged_items/360x0/56_MKT02AI060CORAL/1_1567590349681.jpg", + "value": "latest", + "is_selected": true + } + ], + "page": { + "current": 1, + "total": 2, + "has_previous": false, + "has_next": true, + "item_total": 15, + "type": "number" + } +} +``` +
    + + + + + + + + + +--- + + +#### getProductDetailBySlug +Get a product + + + + +```swift +client.application("").catalog.getProductDetailBySlug(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | The unique identifier of a product. i.e; `slug` of a product. You can retrieve these from the APIs that list products like **v1.0/products/** | + + + +Products are the core resource of an application. Products can be associated by categories, collections, brands and more. This API retrieves the product specified by the given **slug**. If successful, returns a Product resource in the response body specified in `ProductDetail` + +*Returned Response:* + + + + +[ProductDetail](#ProductDetail) + +The Product object. See example below or refer `ProductDetail` for details. + + + + +
    +  Example: + +```json +{ + "type": "product", + "grouped_attributes": [ + { + "title": "Alexander Sawyer", + "details": [ + { + "key": "Kimberly Davidson", + "type": "text", + "value": "DarkGrey" + }, + { + "key": "Kimberly Mcdaniel", + "type": "text", + "value": "Men,Women" + }, + { + "key": "Monica Hampton", + "type": "text", + "value": "Neoprene" + }, + { + "key": "John Mendoza", + "type": "text", + "value": "100 g" + } + ] + } + ], + "medias": [ + { + "type": "image", + "url": "http://cdn4.gofynd.com/media/pictures/tagged_items/original/1309_LGLAPTOPSLEEVE5/1_1564735832806.jpg" + } + ], + "brand": { + "name": "Barry, Jennings and Larson", + "uid": 1, + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/logo/brand/original/12391_0d956c6c71a4427895c15e44cba82f88.jpg" + }, + "action": { + "page": { + "type": "products", + "query": { + "brand": [ + "Hess-Inc" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + }, + "uid": 1, + "slug": "benchmark-collaborative-paradigms", + "attributes": { + "color_hex": "808080", + "weight": 100, + "product_type": "LaptopBags", + "gender": [ + "Men", + "Women" + ], + "material": "Neoprene", + "style_note": "Shape up your overall appeal with this stunning laptop bag. The amazing storage and great design will let you carry your laptop in style!", + "item_code": "LGLAPTOPSLEEVE5", + "occasion": "Casual", + "primary_color": "Grey", + "primary_material": "Others", + "variant": "LGLAPTOPSLEEVE5", + "color": "DarkGrey", + "product_details": "This is a Unisex Product.", + "primary_color_hex": "808080", + "brand": "Barry, Jennings and Larson" + }, + "name": "benchmark collaborative paradigms", + "has_variant": true, + "categories": [ + { + "id": 3, + "uid": 3, + "name": "Amy Kim DDS", + "logo": { + "type": "image", + "url": "https://hdn-1.fynd.com/media/banner_portrait/brand/original/540_ecba3a1af141467da8abc20500f983db.jpg" + }, + "action": { + "page": { + "type": "category", + "query": { + "category": [ + "Amy-Kim-DDS" + ] + } + }, + "type": "page" + }, + "_custom_json": {} + } + ], + "tryouts": [], + "rating": 2.7, + "rating_count": 2, + "image_nature": "standard", + "tags": [ + "Digital" + ], + "teaser_tag": {}, + "no_of_boxes": 1, + "product_online_date": "2021-02-03T07:22:29Z", + "custom_order": {}, + "color": "808080", + "similars": [ + "brand" + ] +} +``` +
    + + + + + + + + + +--- + + +#### getAppProducts +Get applicationwise products + + + + +```swift +client.application("").catalog.getAppProducts(brandIds: brandIds, categoryIds: categoryIds, departmentIds: departmentIds, tags: tags, pageNo: pageNo, pageSize: pageSize, q: q) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| brandIds | [Int]? | no | Get multiple products filtered by Brand Ids | +| categoryIds | [Int]? | no | Get multiple products filtered by Category Ids | +| departmentIds | [Int]? | no | Get multiple products filtered by Department Ids | +| tags | [String]? | no | Get multiple products filtered by tags | +| pageNo | Int? | no | The page number to navigate through the given set of results | +| pageSize | Int? | no | Number of items to retrieve in each page. Default is 10. | +| q | String? | no | Search with Item Code, Name, Slug or Identifier. | + + + +Products are the core resource of an application. Products can be associated by categories, collections, brands and more. If successful, returns a Product resource in the response body specified in `ApplicationProductListingResponseDatabasePowered` + +*Returned Response:* + + + + +[ProductListingResponse](#ProductListingResponse) + +The Product object. See example below or refer `ApplicationProductListingResponseDatabasePowered` for details. + + + + +
    +  Example: + +```json +{ + "items": [ + { + "name": "TV Set", + "description": "Tv", + "country_of_origin": "India", + "currency": "INR", + "short_description": "", + "is_set": true, + "item_code": "TVSET111", + "brand_uid": 1, + "template_tag": "television", + "highlights": [ + "42 Inch" + ], + "slug": "tv-set", + "_custom_json": {}, + "l3_mapping": [ + "electronics>qled_television" + ], + "image_nature": "standard", + "departments": [ + 1 + ], + "created_on": 1599024995, + "created_by": { + "username": "919049753052_37528", + "user_id": "5" + }, + "modified_on": 1627642010, + "modified_by": { + "username": "xxxxxxxxxx", + "user_id": "xxxxxxxxxxx" + }, + "stage": "verified", + "uid": 7501547, + "verified_by": { + "username": "Silverbolt", + "user_id": "0" + }, + "verified_on": 1626965521, + "all_sizes": [ + { + "item_code": "TVSET111", + "brand_uid": 1, + "seller_identifier": "HGS272727272", + "identifiers": [ + { + "gtin_type": "ean", + "gtin_value": "HGS272727272", + "primary": true + } + ], + "company_id": 1, + "size": "XXLX23, MX11, LX67, XLX45 (146 PCS)", + "marked_price": 35000 + } + ], + "category_slug": "qled-television", + "is_image_less_product": false, + "media": [ + { + "url": "https://hdn-1.addsale.com/x0/products/pictures/item/free/135x0/dcizgsG_Y-Tv-Set.png", + "type": "image" + } + ], + "variants": {}, + "product_publish": { + "is_set": false, + "product_online_date": 1627642009 + }, + "is_dependent": false, + "is_physical": true, + "item_type": "set", + "category_uid": 1, + "custom_order": { + "manufacturing_time": 2, + "is_custom_order": true, + "manufacturing_time_unit": "days" + }, + "moq": { + "minimum": 1, + "is_set": false + }, + "multi_size": true, + "no_of_boxes": 1, + "product_group_tag": [], + "size_guide": "slim-fit-shirts-for-men", + "tags": [], + "teaser_tag": {}, + "synonyms": [], + "hsn_code": "11111111", + "return_config": { + "unit": "days", + "returnable": false, + "time": 0 + }, + "all_company_ids": [ + 1 + ], + "all_identifiers": [ + "19WE100" + ], + "trader": { + "address": "sdfdsfsdf", + "name": "asdasd" + }, + "trader_type": "Packer", + "verification_status": "pending", + "sizes": [ + { + "size": "FGX33, GHX33 (66 PCS)", + "store_count": 1 + }, + { + "size": "XSE WE23X100 (100 PCS)", + "store_count": 2 + }, + { + "size": "XSEX100 (100 PCS)", + "store_count": 3 + }, + { + "size": "XXLX23, MX11, LX67, XLX45 (146 PCS)", + "store_count": 3 + } + ], + "id": "5f4f2f6371a5970001f13655", + "brand": { + "name": "Apple", + "logo": { + "aspect_ratio": "1:1", + "aspect_ratio_f": 1, + "url": "https://hdn-1.jiox0.de/jioecomm/seller/pictures/logo/50x0/apple-7f951c/logo_apple.png", + "secure_url": "https://hdn-1.jiox0.de/jioecomm/seller/pictures/logo/50x0/apple-7f951c/logo_apple.png" + }, + "uid": 13 + }, + "images": [ + { + "aspect_ratio": "16:25", + "aspect_ratio_f": 0.64, + "url": "https://hdn-1.addsale.com/x0/products/pictures/item/free/135x0/dcizgsG_Y-Tv-Set.png", + "secure_url": "https://hdn-1.addsale.com/x0/products/pictures/item/free/135x0/dcizgsG_Y-Tv-Set.png" + } + ], + "price": { + "marked": { + "min": 35000, + "max": 35000 + }, + "effective": { + "min": 25000, + "max": 25000 + } + } + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 1, + "has_previous": false, + "has_next": false + } +} +``` +
    + + + + + + + + + +--- + + +#### getOptimalLocations +Location Reassignment + + + + +```swift +client.catalog.getOptimalLocations(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | AssignStore | yes | Request body | + + + + +*Returned Response:* + + + + +[StoreAssignResponse](#StoreAssignResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "items": [ + { + "meta": {}, + "store_id": 11550, + "size": "OS", + "_id": "61161830f1061e7c7f81d8ed", + "store_pincode": 201303, + "company_id": 783, + "s_city": "NOIDA", + "quantity": 1, + "price_effective": 995, + "status": true, + "price_marked": 995, + "uid": "11550_000000410234883001", + "article_assignment": { + "strategy": "app-config", + "level": "multi-company" + }, + "item_id": 75252658, + "strategy_wise_listing": [], + "index": 0 + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getAppLocations +Get list of locations + + + + +```swift +client.application("").catalog.getAppLocations(storeType: storeType, uid: uid, q: q, stage: stage, pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| storeType | String? | no | Helps to sort the location list on the basis of location type. | +| uid | [Int]? | no | Helps to sort the location list on the basis of uid list. | +| q | String? | no | Query that is to be searched. | +| stage | String? | no | to filter companies on basis of verified or unverified companies. | +| pageNo | Int? | no | The page number to navigate through the given set of results | +| pageSize | Int? | no | Number of items to retrieve in each page. Default is 20. | + + + +This API allows to view all the locations asscoiated to a application. + +*Returned Response:* + + + + +[LocationListSerializer](#LocationListSerializer) + +Company profile object. See example below or refer `LocationListSerializer` for details + + + + +
    +  Example: + +```json +{ + "page": { + "current": 1, + "type": "number", + "size": 3, + "has_previous": false, + "has_next": true, + "item_total": 3 + }, + "items": [ + { + "uid": 2, + "address": { + "address1": "POLARIS 2ND FLOOR, ANDHERI", + "address2": "", + "landmark": "", + "lat_long": { + "type": "Point", + "coordinates": [ + 72.8776559, + 19.0759837 + ] + }, + "country": "INDIA", + "state": "MAHARASHTRA", + "city": "MUMBAI", + "pincode": 400001 + }, + "company_id": 2, + "display_name": "Test", + "name": "Test", + "store_code": "HS-a0c85", + "store_type": "high_street" + } + ], + "filters": [] +} +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemTotal | Int? | yes | | + | type | String | no | | + | nextId | String? | yes | | + | hasNext | Bool? | yes | | + | current | Int? | yes | | + | hasPrevious | Bool? | yes | | + | size | Int? | yes | | + +--- + + + + + #### [GetSearchWordsData](#GetSearchWordsData) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | String? | yes | | + | words | [String]? | yes | | + | appId | String? | yes | | + | result | [String: Any]? | yes | | + | customJson | [String: Any]? | yes | | + +--- + + + + + #### [GetSearchWordsDetailResponse](#GetSearchWordsDetailResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [GetSearchWordsData](#GetSearchWordsData)? | yes | | + +--- + + + + + #### [ErrorResponse](#ErrorResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + | code | String? | yes | | + | meta | [String: Any]? | yes | | + | status | Int? | yes | | + +--- + + + + + #### [DeleteResponse](#DeleteResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [SearchKeywordResult](#SearchKeywordResult) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | query | [String: Any] | no | | + | sortOn | String | no | | + +--- + + + + + #### [CreateSearchKeyword](#CreateSearchKeyword) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isActive | Bool? | yes | | + | appId | String? | yes | | + | words | [String]? | yes | | + | result | [SearchKeywordResult](#SearchKeywordResult) | no | | + | customJson | [String: Any]? | yes | | + +--- + + + + + #### [GetSearchWordsResponse](#GetSearchWordsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [[GetSearchWordsData](#GetSearchWordsData)]? | yes | | + +--- + + + + + #### [GetAutocompleteWordsData](#GetAutocompleteWordsData) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | String? | yes | | + | words | [String]? | yes | | + | appId | String? | yes | | + | results | [[String: Any]]? | yes | | + | customJson | [String: Any]? | yes | | + +--- + + + + + #### [GetAutocompleteWordsResponse](#GetAutocompleteWordsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [[GetAutocompleteWordsData](#GetAutocompleteWordsData)]? | yes | | + +--- + + + + + #### [AutocompletePageAction](#AutocompletePageAction) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | url | String? | yes | | + | query | [String: Any]? | yes | | + | type | String? | yes | | + | params | [String: Any]? | yes | | + +--- + + + + + #### [AutocompleteAction](#AutocompleteAction) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [AutocompletePageAction](#AutocompletePageAction)? | yes | | + | type | String? | yes | | + +--- + + + + + #### [Media](#Media) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | url | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [AutocompleteResult](#AutocompleteResult) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | action | [AutocompleteAction](#AutocompleteAction)? | yes | | + | logo | [Media](#Media)? | yes | | + | customJson | [String: Any]? | yes | | + | display | String? | yes | | + +--- + + + + + #### [CreateAutocompleteKeyword](#CreateAutocompleteKeyword) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isActive | Bool? | yes | | + | appId | String? | yes | | + | words | [String]? | yes | | + | results | [[AutocompleteResult](#AutocompleteResult)]? | yes | | + | customJson | [String: Any]? | yes | | + +--- + + + + + #### [CreateAutocompleteWordsResponse](#CreateAutocompleteWordsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | words | [String]? | yes | | + | appId | String? | yes | | + | customJson | [String: Any]? | yes | | + | results | [[String: Any]]? | yes | | + +--- + + + + + #### [ProductBundleItem](#ProductBundleItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | autoSelect | Bool? | yes | | + | autoAddToCart | Bool? | yes | | + | minQuantity | Int | no | | + | maxQuantity | Int | no | | + | productUid | Int | no | | + | allowRemove | Bool? | yes | | + +--- + + + + + #### [GetProductBundleCreateResponse](#GetProductBundleCreateResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | logo | String? | yes | | + | isActive | Bool | no | | + | sameStoreAssignment | Bool? | yes | | + | modifiedOn | String? | yes | | + | pageVisibility | [String]? | yes | | + | choice | String | no | | + | id | String? | yes | | + | createdOn | String? | yes | | + | companyId | Int? | yes | | + | createdBy | [String: Any]? | yes | | + | modifiedBy | [String: Any]? | yes | | + | slug | String | no | | + | products | [[ProductBundleItem](#ProductBundleItem)] | no | | + | meta | [String: Any]? | yes | | + | name | String | no | | + +--- + + + + + #### [GetProductBundleListingResponse](#GetProductBundleListingResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [[GetProductBundleCreateResponse](#GetProductBundleCreateResponse)]? | yes | | + +--- + + + + + #### [ProductBundleRequest](#ProductBundleRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | logo | String? | yes | | + | isActive | Bool | no | | + | sameStoreAssignment | Bool? | yes | | + | modifiedOn | String? | yes | | + | pageVisibility | [String]? | yes | | + | choice | String | no | | + | createdOn | String? | yes | | + | createdBy | [String: Any]? | yes | | + | modifiedBy | [String: Any]? | yes | | + | slug | String | no | | + | products | [[ProductBundleItem](#ProductBundleItem)] | no | | + | meta | [String: Any]? | yes | | + | name | String | no | | + +--- + + + + + #### [Price](#Price) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | maxEffective | Double? | yes | | + | minEffective | Double? | yes | | + | currency | String? | yes | | + | minMarked | Double? | yes | | + | maxMarked | Double? | yes | | + +--- + + + + + #### [LimitedProductData](#LimitedProductData) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | images | [String]? | yes | | + | price | [String: Any]? | yes | | + | identifier | [String: Any]? | yes | | + | attributes | [String: Any]? | yes | | + | countryOfOrigin | String? | yes | | + | slug | String? | yes | | + | sizes | [String]? | yes | | + | itemCode | String? | yes | | + | name | String? | yes | | + | quantity | Int? | yes | | + | shortDescription | String? | yes | | + +--- + + + + + #### [Size](#Size) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | value | String? | yes | | + | isAvailable | Bool? | yes | | + | quantity | Int? | yes | | + | display | String? | yes | | + +--- + + + + + #### [GetProducts](#GetProducts) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | autoSelect | Bool? | yes | | + | autoAddToCart | Bool? | yes | | + | minQuantity | Int? | yes | | + | price | [Price](#Price)? | yes | | + | maxQuantity | Int? | yes | | + | allowRemove | Bool? | yes | | + | productUid | Int? | yes | | + | productDetails | [LimitedProductData](#LimitedProductData)? | yes | | + | sizes | [[Size](#Size)]? | yes | | + +--- + + + + + #### [GetProductBundleResponse](#GetProductBundleResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | logo | String? | yes | | + | isActive | Bool? | yes | | + | pageVisibility | [String]? | yes | | + | sameStoreAssignment | Bool? | yes | | + | choice | String? | yes | | + | companyId | Int? | yes | | + | slug | String? | yes | | + | products | [[GetProducts](#GetProducts)]? | yes | | + | meta | [String: Any]? | yes | | + | name | String? | yes | | + +--- + + + + + #### [ProductBundleUpdateRequest](#ProductBundleUpdateRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | logo | String? | yes | | + | isActive | Bool | no | | + | sameStoreAssignment | Bool? | yes | | + | modifiedOn | String? | yes | | + | pageVisibility | [String]? | yes | | + | choice | String | no | | + | modifiedBy | [String: Any]? | yes | | + | slug | String | no | | + | products | [[ProductBundleItem](#ProductBundleItem)] | no | | + | meta | [String: Any]? | yes | | + | name | String | no | | + +--- + + + + + #### [ListSizeGuide](#ListSizeGuide) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [String: Any]? | yes | | + | items | [[String: Any]]? | yes | | + +--- + + + + + #### [Meta](#Meta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | values | [[String: Any]]? | yes | | + | unit | String? | yes | | + | headers | [String: Any]? | yes | | + +--- + + + + + #### [Guide](#Guide) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | meta | [Meta](#Meta)? | yes | | + +--- + + + + + #### [ValidateSizeGuide](#ValidateSizeGuide) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | tag | String? | yes | | + | description | String? | yes | | + | modifiedOn | String? | yes | | + | brandId | Int? | yes | | + | image | String? | yes | | + | id | String? | yes | | + | createdOn | String? | yes | | + | title | String | no | | + | active | Bool? | yes | | + | companyId | Int? | yes | | + | createdBy | [String: Any]? | yes | | + | modifiedBy | [String: Any]? | yes | | + | guide | [Guide](#Guide)? | yes | | + | name | String | no | | + | subtitle | String? | yes | | + +--- + + + + + #### [SuccessResponse](#SuccessResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | success | Bool? | yes | | + +--- + + + + + #### [SizeGuideResponse](#SizeGuideResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | tag | String? | yes | | + | guide | [String: Any]? | yes | | + | modifiedOn | String? | yes | | + | brandId | Int? | yes | | + | id | String? | yes | | + | createdOn | String? | yes | | + | companyId | Int? | yes | | + | active | Bool? | yes | | + | title | String? | yes | | + | modifiedBy | [String: Any]? | yes | | + | createdBy | [String: Any]? | yes | | + | name | String? | yes | | + | subtitle | String? | yes | | + +--- + + + + + #### [MetaFields](#MetaFields) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | value | String | no | | + | key | String | no | | + +--- + + + + + #### [ApplicationItemMeta](#ApplicationItemMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | customMeta | [[MetaFields](#MetaFields)] | no | | + +--- + + + + + #### [MetaDataListingSortMetaResponse](#MetaDataListingSortMetaResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | display | String? | yes | | + +--- + + + + + #### [MetaDataListingSortResponse](#MetaDataListingSortResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [[MetaDataListingSortMetaResponse](#MetaDataListingSortMetaResponse)]? | yes | | + +--- + + + + + #### [MetaDataListingFilterMetaResponse](#MetaDataListingFilterMetaResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | filterTypes | [String]? | yes | | + | key | String? | yes | | + | units | [[String: Any]]? | yes | | + | display | String? | yes | | + +--- + + + + + #### [MetaDataListingFilterResponse](#MetaDataListingFilterResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [[MetaDataListingFilterMetaResponse](#MetaDataListingFilterMetaResponse)]? | yes | | + +--- + + + + + #### [MetaDataListingResponse](#MetaDataListingResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | sort | [MetaDataListingSortResponse](#MetaDataListingSortResponse) | no | | + | filter | [MetaDataListingFilterResponse](#MetaDataListingFilterResponse) | no | | + +--- + + + + + #### [GetCatalogConfigurationDetailsProduct](#GetCatalogConfigurationDetailsProduct) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | detail | [String: Any]? | yes | | + | compare | [String: Any]? | yes | | + | similar | [String: Any]? | yes | | + | variant | [String: Any]? | yes | | + +--- + + + + + #### [GetCatalogConfigurationMetaData](#GetCatalogConfigurationMetaData) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | listing | [MetaDataListingResponse](#MetaDataListingResponse)? | yes | | + | product | [GetCatalogConfigurationDetailsProduct](#GetCatalogConfigurationDetailsProduct)? | yes | | + +--- + + + + + #### [ConfigurationListingSortConfig](#ConfigurationListingSortConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | priority | Int | no | | + | logo | String? | yes | | + | key | String | no | | + | isActive | Bool | no | | + | name | String? | yes | | + +--- + + + + + #### [ConfigurationListingSort](#ConfigurationListingSort) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | config | [[ConfigurationListingSortConfig](#ConfigurationListingSortConfig)]? | yes | | + | defaultKey | String | no | | + +--- + + + + + #### [ConfigurationBucketPoints](#ConfigurationBucketPoints) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | end | Double? | yes | | + | start | Double? | yes | | + +--- + + + + + #### [ConfigurationListingFilterValue](#ConfigurationListingFilterValue) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | value | String? | yes | | + | condition | String? | yes | | + | bucketPoints | [[ConfigurationBucketPoints](#ConfigurationBucketPoints)]? | yes | | + | map | [String: Any]? | yes | | + | sort | String? | yes | | + +--- + + + + + #### [ConfigurationListingFilterConfig](#ConfigurationListingFilterConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | priority | Int | no | | + | logo | String? | yes | | + | key | String | no | | + | isActive | Bool | no | | + | type | String | no | | + | valueConfig | [ConfigurationListingFilterValue](#ConfigurationListingFilterValue)? | yes | | + | name | String? | yes | | + +--- + + + + + #### [ConfigurationListingFilter](#ConfigurationListingFilter) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | attributeConfig | [[ConfigurationListingFilterConfig](#ConfigurationListingFilterConfig)]? | yes | | + | allowSingle | Bool | no | | + +--- + + + + + #### [ConfigurationListing](#ConfigurationListing) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | sort | [ConfigurationListingSort](#ConfigurationListingSort) | no | | + | filter | [ConfigurationListingFilter](#ConfigurationListingFilter) | no | | + +--- + + + + + #### [ProductSize](#ProductSize) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | min | Int | no | | + | max | Int | no | | + +--- + + + + + #### [ConfigurationProductVariantConfig](#ConfigurationProductVariantConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | priority | Int | no | | + | logo | String? | yes | | + | key | String | no | | + | isActive | Bool | no | | + | displayType | String | no | | + | size | [ProductSize](#ProductSize) | no | | + | name | String | no | | + +--- + + + + + #### [ConfigurationProductVariant](#ConfigurationProductVariant) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | config | [[ConfigurationProductVariantConfig](#ConfigurationProductVariantConfig)]? | yes | | + +--- + + + + + #### [ConfigurationProductConfig](#ConfigurationProductConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | priority | Int | no | | + | logo | String? | yes | | + | key | String | no | | + | isActive | Bool | no | | + | title | String? | yes | | + | size | [ProductSize](#ProductSize)? | yes | | + | subtitle | String? | yes | | + +--- + + + + + #### [ConfigurationProductSimilar](#ConfigurationProductSimilar) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | config | [[ConfigurationProductConfig](#ConfigurationProductConfig)]? | yes | | + +--- + + + + + #### [ConfigurationProduct](#ConfigurationProduct) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | variant | [ConfigurationProductVariant](#ConfigurationProductVariant) | no | | + | similar | [ConfigurationProductSimilar](#ConfigurationProductSimilar) | no | | + +--- + + + + + #### [AppCatalogConfiguration](#AppCatalogConfiguration) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | configId | String? | yes | | + | id | String? | yes | | + | appId | String | no | | + | listing | [ConfigurationListing](#ConfigurationListing)? | yes | | + | configType | String | no | | + | product | [ConfigurationProduct](#ConfigurationProduct)? | yes | | + +--- + + + + + #### [GetAppCatalogConfiguration](#GetAppCatalogConfiguration) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isDefault | Bool? | yes | | + | data | [AppCatalogConfiguration](#AppCatalogConfiguration)? | yes | | + +--- + + + + + #### [AppConfiguration](#AppConfiguration) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | configId | String? | yes | | + | appId | String | no | | + | listing | [ConfigurationListing](#ConfigurationListing)? | yes | | + | configType | String | no | | + | product | [ConfigurationProduct](#ConfigurationProduct)? | yes | | + +--- + + + + + #### [GetCatalogConfigurationDetailsSchemaListing](#GetCatalogConfigurationDetailsSchemaListing) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | sort | [String: Any]? | yes | | + | filter | [String: Any]? | yes | | + +--- + + + + + #### [EntityConfiguration](#EntityConfiguration) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | configId | String? | yes | | + | id | String? | yes | | + | appId | String | no | | + | listing | [GetCatalogConfigurationDetailsSchemaListing](#GetCatalogConfigurationDetailsSchemaListing)? | yes | | + | configType | String | no | | + | product | [GetCatalogConfigurationDetailsProduct](#GetCatalogConfigurationDetailsProduct)? | yes | | + +--- + + + + + #### [GetAppCatalogEntityConfiguration](#GetAppCatalogEntityConfiguration) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isDefault | Bool? | yes | | + | data | [EntityConfiguration](#EntityConfiguration)? | yes | | + +--- + + + + + #### [ProductFiltersValue](#ProductFiltersValue) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isSelected | Bool | no | | + | selectedMin | Int? | yes | | + | value | String | no | | + | currencyCode | String? | yes | | + | display | String | no | | + | queryFormat | String? | yes | | + | currencySymbol | String? | yes | | + | displayFormat | String? | yes | | + | selectedMax | Int? | yes | | + | min | Int? | yes | | + | max | Int? | yes | | + | count | Int? | yes | | + +--- + + + + + #### [ProductFiltersKey](#ProductFiltersKey) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | kind | String? | yes | | + | logo | String? | yes | | + | name | String | no | | + | display | String | no | | + +--- + + + + + #### [ProductFilters](#ProductFilters) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | values | [[ProductFiltersValue](#ProductFiltersValue)] | no | | + | key | [ProductFiltersKey](#ProductFiltersKey) | no | | + +--- + + + + + #### [ProductSortOn](#ProductSortOn) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | value | String? | yes | | + | isSelected | Bool? | yes | | + | name | String? | yes | | + +--- + + + + + #### [GetCollectionQueryOptionResponse](#GetCollectionQueryOptionResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | filters | [[ProductFilters](#ProductFilters)]? | yes | | + | sortOn | [[ProductSortOn](#ProductSortOn)]? | yes | | + +--- + + + + + #### [CollectionListingFilterType](#CollectionListingFilterType) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isSelected | Bool? | yes | | + | name | String? | yes | | + | display | String? | yes | | + +--- + + + + + #### [CollectionListingFilterTag](#CollectionListingFilterTag) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isSelected | Bool? | yes | | + | name | String? | yes | | + | display | String? | yes | | + +--- + + + + + #### [CollectionListingFilter](#CollectionListingFilter) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | [[CollectionListingFilterType](#CollectionListingFilterType)]? | yes | | + | tags | [[CollectionListingFilterTag](#CollectionListingFilterTag)]? | yes | | + +--- + + + + + #### [ActionPage](#ActionPage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | query | [String: Any]? | yes | | + | type | String? | yes | | + +--- + + + + + #### [Action](#Action) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [ActionPage](#ActionPage)? | yes | | + | type | String? | yes | | + +--- + + + + + #### [BannerImage](#BannerImage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | aspectRatio | String? | yes | | + | url | String? | yes | | + +--- + + + + + #### [ImageUrls](#ImageUrls) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | portrait | [BannerImage](#BannerImage)? | yes | | + | landscape | [BannerImage](#BannerImage)? | yes | | + +--- + + + + + #### [Media1](#Media1) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | url | String | no | | + | type | String? | yes | | + | meta | [String: Any]? | yes | | + +--- + + + + + #### [GetCollectionDetailNest](#GetCollectionDetailNest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String? | yes | | + | allowFacets | Bool? | yes | | + | visibleFacetsKeys | [String]? | yes | | + | isActive | Bool? | yes | | + | appId | String? | yes | | + | action | [Action](#Action)? | yes | | + | badge | [String: Any]? | yes | | + | meta | [String: Any]? | yes | | + | query | [String: Any]? | yes | | + | banners | [ImageUrls](#ImageUrls)? | yes | | + | tag | [String]? | yes | | + | description | String? | yes | | + | logo | [Media1](#Media1)? | yes | | + | type | String? | yes | | + | uid | String? | yes | | + | schedule | [String: Any]? | yes | | + | cron | [String: Any]? | yes | | + | name | String? | yes | | + | allowSort | Bool? | yes | | + +--- + + + + + #### [GetCollectionListingResponse](#GetCollectionListingResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | filters | [CollectionListingFilter](#CollectionListingFilter)? | yes | | + | items | [[GetCollectionDetailNest](#GetCollectionDetailNest)]? | yes | | + +--- + + + + + #### [SeoDetail](#SeoDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String? | yes | | + | title | String? | yes | | + +--- + + + + + #### [CollectionBadge](#CollectionBadge) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | color | String? | yes | | + | text | String? | yes | | + +--- + + + + + #### [CollectionImage](#CollectionImage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | aspectRatio | String | no | | + | url | String | no | | + +--- + + + + + #### [CollectionBanner](#CollectionBanner) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | portrait | [CollectionImage](#CollectionImage) | no | | + | landscape | [CollectionImage](#CollectionImage) | no | | + +--- + + + + + #### [UserInfo](#UserInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + | userId | String? | yes | | + | uid | String? | yes | | + | username | String? | yes | | + +--- + + + + + #### [Schedule](#Schedule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cron | String? | yes | | + | end | String? | yes | | + | start | String? | yes | | + | duration | Int? | yes | | + +--- + + + + + #### [CreateCollection](#CreateCollection) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | localeLanguage | [String: Any]? | yes | | + | sortOn | String? | yes | | + | slug | String | no | | + | seo | [SeoDetail](#SeoDetail)? | yes | | + | tags | [String]? | yes | | + | allowFacets | Bool? | yes | | + | visibleFacetsKeys | [String]? | yes | | + | isActive | Bool? | yes | | + | appId | String | no | | + | badge | [CollectionBadge](#CollectionBadge)? | yes | | + | query | [String: Any]? | yes | | + | meta | [String: Any]? | yes | | + | banners | [CollectionBanner](#CollectionBanner) | no | | + | createdBy | [UserInfo](#UserInfo)? | yes | | + | published | Bool? | yes | | + | type | String | no | | + | logo | [CollectionImage](#CollectionImage) | no | | + | description | String? | yes | | + | isVisible | Bool? | yes | | + | schedule | [Schedule](#Schedule)? | yes | | + | modifiedBy | [UserInfo](#UserInfo)? | yes | | + | customJson | [String: Any]? | yes | | + | name | String | no | | + | allowSort | Bool? | yes | | + +--- + + + + + #### [CollectionCreateResponse](#CollectionCreateResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | allowFacets | Bool? | yes | | + | tag | [String]? | yes | | + | visibleFacetsKeys | [String]? | yes | | + | description | String? | yes | | + | logo | [BannerImage](#BannerImage)? | yes | | + | banners | [ImageUrls](#ImageUrls)? | yes | | + | isActive | Bool? | yes | | + | type | String? | yes | | + | appId | String? | yes | | + | badge | [String: Any]? | yes | | + | schedule | [String: Any]? | yes | | + | meta | [String: Any]? | yes | | + | slug | String? | yes | | + | cron | [String: Any]? | yes | | + | query | [String: Any]? | yes | | + | name | String? | yes | | + | allowSort | Bool? | yes | | + +--- + + + + + #### [CollectionDetailResponse](#CollectionDetailResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | allowFacets | Bool? | yes | | + | tag | [String]? | yes | | + | visibleFacetsKeys | [String]? | yes | | + | description | String? | yes | | + | logo | [Media1](#Media1)? | yes | | + | banners | [ImageUrls](#ImageUrls)? | yes | | + | isActive | Bool? | yes | | + | type | String? | yes | | + | appId | String? | yes | | + | badge | [String: Any]? | yes | | + | schedule | [String: Any]? | yes | | + | meta | [String: Any]? | yes | | + | slug | String? | yes | | + | cron | [String: Any]? | yes | | + | query | [String: Any]? | yes | | + | name | String? | yes | | + | allowSort | Bool? | yes | | + +--- + + + + + #### [UpdateCollection](#UpdateCollection) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | localeLanguage | [String: Any]? | yes | | + | sortOn | String? | yes | | + | slug | String? | yes | | + | seo | [SeoDetail](#SeoDetail)? | yes | | + | tags | [String]? | yes | | + | allowFacets | Bool? | yes | | + | visibleFacetsKeys | [String]? | yes | | + | isActive | Bool? | yes | | + | badge | [CollectionBadge](#CollectionBadge)? | yes | | + | meta | [String: Any]? | yes | | + | query | [String: Any]? | yes | | + | banners | [CollectionBanner](#CollectionBanner)? | yes | | + | published | Bool? | yes | | + | logo | [CollectionImage](#CollectionImage)? | yes | | + | description | String? | yes | | + | isVisible | Bool? | yes | | + | schedule | [Schedule](#Schedule)? | yes | | + | modifiedBy | [UserInfo](#UserInfo)? | yes | | + | customJson | [String: Any]? | yes | | + | name | String? | yes | | + | allowSort | Bool? | yes | | + +--- + + + + + #### [Price1](#Price1) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | currencySymbol | String? | yes | | + | currencyCode | String? | yes | | + | min | Double? | yes | | + | max | Double? | yes | | + +--- + + + + + #### [ProductListingPrice](#ProductListingPrice) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | marked | [Price1](#Price1)? | yes | | + | effective | [Price1](#Price1)? | yes | | + +--- + + + + + #### [ProductBrand](#ProductBrand) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | action | [Action](#Action)? | yes | | + | uid | Int? | yes | | + | name | String? | yes | | + | logo | [Media1](#Media1)? | yes | | + +--- + + + + + #### [ProductDetailAttribute](#ProductDetailAttribute) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | value | String? | yes | | + | type | String? | yes | | + | key | String? | yes | | + +--- + + + + + #### [ProductDetailGroupedAttribute](#ProductDetailGroupedAttribute) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | details | [[ProductDetailAttribute](#ProductDetailAttribute)]? | yes | | + | title | String? | yes | | + +--- + + + + + #### [ProductListingDetail](#ProductListingDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | productOnlineDate | String? | yes | | + | highlights | [String]? | yes | | + | ratingCount | Int? | yes | | + | slug | String | no | | + | sellable | Bool? | yes | | + | price | [ProductListingPrice](#ProductListingPrice)? | yes | | + | hasVariant | Bool? | yes | | + | color | String? | yes | | + | itemType | String? | yes | | + | brand | [ProductBrand](#ProductBrand)? | yes | | + | teaserTag | [String: Any]? | yes | | + | similars | [String]? | yes | | + | medias | [[Media1](#Media1)]? | yes | | + | attributes | [String: Any]? | yes | | + | imageNature | String? | yes | | + | tryouts | [String]? | yes | | + | groupedAttributes | [[ProductDetailGroupedAttribute](#ProductDetailGroupedAttribute)]? | yes | | + | type | String? | yes | | + | uid | Int? | yes | | + | description | String? | yes | | + | discount | String? | yes | | + | promoMeta | [String: Any]? | yes | | + | rating | Double? | yes | | + | itemCode | String? | yes | | + | name | String? | yes | | + | shortDescription | String? | yes | | + +--- + + + + + #### [GetCollectionItemsResponse](#GetCollectionItemsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | filters | [[ProductFilters](#ProductFilters)]? | yes | | + | sortOn | [[ProductSortOn](#ProductSortOn)]? | yes | | + | items | [[ProductListingDetail](#ProductListingDetail)]? | yes | | + +--- + + + + + #### [CollectionItemRequest](#CollectionItemRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pageNo | Int | no | | + | pageSize | Int | no | | + +--- + + + + + #### [UpdatedResponse](#UpdatedResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [CatalogInsightBrand](#CatalogInsightBrand) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | totalArticles | Int? | yes | | + | availableSizes | Int? | yes | | + | totalSizes | Int? | yes | | + | articleFreshness | Int? | yes | | + | availableArticles | Int? | yes | | + | name | String? | yes | | + +--- + + + + + #### [CatalogInsightItem](#CatalogInsightItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | sellableCount | Int? | yes | | + | count | Int? | yes | | + | outOfStockCount | Int? | yes | | + +--- + + + + + #### [CatalogInsightResponse](#CatalogInsightResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | brandDistribution | [CatalogInsightBrand](#CatalogInsightBrand)? | yes | | + | item | [CatalogInsightItem](#CatalogInsightItem)? | yes | | + +--- + + + + + #### [CrossSellingData](#CrossSellingData) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | articles | Int? | yes | | + | products | Int? | yes | | + +--- + + + + + #### [CrossSellingResponse](#CrossSellingResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | brandDistribution | [CatalogInsightBrand](#CatalogInsightBrand)? | yes | | + | data | [CrossSellingData](#CrossSellingData)? | yes | | + +--- + + + + + #### [OptInPostRequest](#OptInPostRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | storeIds | [Int]? | yes | | + | brandIds | [Int]? | yes | | + | enabled | Bool? | yes | | + | optLevel | String | no | | + +--- + + + + + #### [CompanyOptIn](#CompanyOptIn) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | storeIds | [Int] | no | | + | platform | String | no | | + | modifiedOn | Int | no | | + | enabled | Bool | no | | + | optLevel | String | no | | + | companyId | Int | no | | + | brandIds | [Int] | no | | + | createdBy | [String: Any]? | yes | | + | modifiedBy | [String: Any]? | yes | | + | createdOn | Int | no | | + +--- + + + + + #### [GetOptInPlatform](#GetOptInPlatform) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page) | no | | + | items | [[CompanyOptIn](#CompanyOptIn)] | no | | + +--- + + + + + #### [OptinCompanyDetail](#OptinCompanyDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | businessType | String? | yes | | + | uid | Int? | yes | | + | name | String? | yes | | + | companyType | String? | yes | | + +--- + + + + + #### [CompanyBrandDetail](#CompanyBrandDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | totalArticle | Int? | yes | | + | brandName | String? | yes | | + | brandId | Int? | yes | | + | companyId | Int? | yes | | + +--- + + + + + #### [OptinCompanyBrandDetailsView](#OptinCompanyBrandDetailsView) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [[CompanyBrandDetail](#CompanyBrandDetail)]? | yes | | + +--- + + + + + #### [OptinCompanyMetrics](#OptinCompanyMetrics) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | store | Int? | yes | | + | brand | Int? | yes | | + | company | String? | yes | | + +--- + + + + + #### [StoreDetail](#StoreDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | timing | [String: Any]? | yes | | + | storeType | String? | yes | | + | storeCode | String? | yes | | + | uid | Int? | yes | | + | modifiedOn | String? | yes | | + | documents | [[String: Any]]? | yes | | + | displayName | String? | yes | | + | companyId | Int? | yes | | + | additionalContacts | [[String: Any]]? | yes | | + | createdOn | String? | yes | | + | name | String? | yes | | + +--- + + + + + #### [OptinStoreDetails](#OptinStoreDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [[StoreDetail](#StoreDetail)]? | yes | | + +--- + + + + + #### [AttributeMasterFilter](#AttributeMasterFilter) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | indexing | Bool | no | | + | priority | Int? | yes | | + | dependsOn | [String]? | yes | | + +--- + + + + + #### [AttributeSchemaRange](#AttributeSchemaRange) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | min | Int? | yes | | + | max | Int? | yes | | + +--- + + + + + #### [AttributeMaster](#AttributeMaster) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | multi | Bool? | yes | | + | type | String | no | | + | mandatory | Bool? | yes | | + | allowedValues | [String]? | yes | | + | format | String? | yes | | + | range | [AttributeSchemaRange](#AttributeSchemaRange)? | yes | | + +--- + + + + + #### [AttributeMasterDetails](#AttributeMasterDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | displayType | String | no | | + +--- + + + + + #### [AttributeMasterMandatoryDetails](#AttributeMasterMandatoryDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | l3Keys | [String]? | yes | | + +--- + + + + + #### [AttributeMasterMeta](#AttributeMasterMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enriched | Bool? | yes | | + | mandatoryDetails | [AttributeMasterMandatoryDetails](#AttributeMasterMandatoryDetails) | no | | + +--- + + + + + #### [GenderDetail](#GenderDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String? | yes | | + | logo | String? | yes | | + | id | String? | yes | | + | filters | [AttributeMasterFilter](#AttributeMasterFilter)? | yes | | + | schema | [AttributeMaster](#AttributeMaster)? | yes | | + | details | [AttributeMasterDetails](#AttributeMasterDetails)? | yes | | + | slug | String? | yes | | + | enabledForEndConsumer | Bool? | yes | | + | isNested | Bool? | yes | | + | departments | [String]? | yes | | + | meta | [AttributeMasterMeta](#AttributeMasterMeta)? | yes | | + | name | String? | yes | | + +--- + + + + + #### [ProdcutTemplateCategoriesResponse](#ProdcutTemplateCategoriesResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [[String: Any]]? | yes | | + +--- + + + + + #### [PTErrorResponse](#PTErrorResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | errors | [String: Any]? | yes | | + | code | String? | yes | | + | message | String? | yes | | + | status | Int? | yes | | + | meta | [String: Any]? | yes | | + +--- + + + + + #### [UserSerializer](#UserSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | userId | String? | yes | | + | contact | String? | yes | | + | username | String? | yes | | + +--- + + + + + #### [GetDepartment](#GetDepartment) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pageNo | Int? | yes | | + | uid | Int? | yes | | + | logo | String? | yes | | + | isActive | Bool? | yes | | + | modifiedOn | String? | yes | | + | priorityOrder | Int? | yes | | + | search | String? | yes | | + | synonyms | [String]? | yes | | + | createdOn | String? | yes | | + | itemType | String? | yes | | + | createdBy | [UserSerializer](#UserSerializer)? | yes | | + | modifiedBy | [UserSerializer](#UserSerializer)? | yes | | + | slug | String? | yes | | + | pageSize | Int? | yes | | + | name | String? | yes | | + +--- + + + + + #### [DepartmentsResponse](#DepartmentsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [[GetDepartment](#GetDepartment)]? | yes | | + +--- + + + + + #### [DepartmentErrorResponse](#DepartmentErrorResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | errors | [String: Any]? | yes | | + | code | String? | yes | | + | message | String? | yes | | + | status | Int? | yes | | + | meta | [String: Any]? | yes | | + +--- + + + + + #### [ProductTemplate](#ProductTemplate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | tag | String? | yes | | + | description | String? | yes | | + | logo | String? | yes | | + | isActive | Bool? | yes | | + | isPhysical | Bool | no | | + | modifiedOn | String? | yes | | + | categories | [String]? | yes | | + | isArchived | Bool? | yes | | + | createdOn | String? | yes | | + | attributes | [String]? | yes | | + | createdBy | [String: Any]? | yes | | + | isExpirable | Bool | no | | + | modifiedBy | [String: Any]? | yes | | + | slug | String | no | | + | departments | [String]? | yes | | + | name | String? | yes | | + +--- + + + + + #### [TemplatesResponse](#TemplatesResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [ProductTemplate](#ProductTemplate)? | yes | | + +--- + + + + + #### [TemplateDetails](#TemplateDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | tag | String? | yes | | + | description | String? | yes | | + | logo | String? | yes | | + | isActive | Bool? | yes | | + | isPhysical | Bool | no | | + | id | String? | yes | | + | categories | [String]? | yes | | + | isArchived | Bool? | yes | | + | attributes | [String]? | yes | | + | isExpirable | Bool | no | | + | slug | String | no | | + | departments | [String]? | yes | | + | name | String? | yes | | + +--- + + + + + #### [Properties](#Properties) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | highlights | [String: Any]? | yes | | + | isDependent | [String: Any]? | yes | | + | noOfBoxes | [String: Any]? | yes | | + | slug | [String: Any]? | yes | | + | variants | [String: Any]? | yes | | + | moq | [String: Any]? | yes | | + | tags | [String: Any]? | yes | | + | sizeGuide | [String: Any]? | yes | | + | media | [String: Any]? | yes | | + | isActive | [String: Any]? | yes | | + | itemType | [String: Any]? | yes | | + | returnConfig | [String: Any]? | yes | | + | teaserTag | [String: Any]? | yes | | + | hsnCode | [String: Any]? | yes | | + | sizes | [String: Any]? | yes | | + | categorySlug | [String: Any]? | yes | | + | multiSize | [String: Any]? | yes | | + | customOrder | [String: Any]? | yes | | + | traderType | [String: Any]? | yes | | + | trader | [String: Any]? | yes | | + | brandUid | [String: Any]? | yes | | + | productPublish | [String: Any]? | yes | | + | description | [String: Any]? | yes | | + | productGroupTag | [String: Any]? | yes | | + | currency | [String: Any]? | yes | | + | countryOfOrigin | [String: Any]? | yes | | + | itemCode | [String: Any]? | yes | | + | command | [String: Any]? | yes | | + | name | [String: Any]? | yes | | + | shortDescription | [String: Any]? | yes | | + +--- + + + + + #### [GlobalValidation](#GlobalValidation) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | description | String? | yes | | + | title | String? | yes | | + | definitions | [String: Any]? | yes | | + | properties | [Properties](#Properties)? | yes | | + | required | [String]? | yes | | + +--- + + + + + #### [TemplateValidationData](#TemplateValidationData) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | globalValidation | [GlobalValidation](#GlobalValidation)? | yes | | + | templateValidation | [String: Any]? | yes | | + +--- + + + + + #### [TemplatesValidationResponse](#TemplatesValidationResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | templateDetails | [TemplateDetails](#TemplateDetails)? | yes | | + | data | [TemplateValidationData](#TemplateValidationData)? | yes | | + +--- + + + + + #### [InventoryValidationResponse](#InventoryValidationResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + | data | [String: Any]? | yes | | + +--- + + + + + #### [HSNData](#HSNData) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | countryOfOrigin | [String]? | yes | | + | hsnCode | [String]? | yes | | + +--- + + + + + #### [HSNCodesResponse](#HSNCodesResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + | data | [HSNData](#HSNData)? | yes | | + +--- + + + + + #### [ProductDownloadItemsData](#ProductDownloadItemsData) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | brand | [String]? | yes | | + | type | String? | yes | | + | templates | [String]? | yes | | + +--- + + + + + #### [VerifiedBy](#VerifiedBy) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | userId | String? | yes | | + | username | String? | yes | | + +--- + + + + + #### [ProductDownloadsItems](#ProductDownloadsItems) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | templateTags | [String: Any]? | yes | | + | id | String? | yes | | + | data | [ProductDownloadItemsData](#ProductDownloadItemsData)? | yes | | + | triggerOn | String? | yes | | + | status | String? | yes | | + | sellerId | Double? | yes | | + | createdBy | [VerifiedBy](#VerifiedBy)? | yes | | + | url | String? | yes | | + | taskId | String? | yes | | + | completedOn | String? | yes | | + +--- + + + + + #### [ProductDownloadsResponse](#ProductDownloadsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [ProductDownloadsItems](#ProductDownloadsItems)? | yes | | + +--- + + + + + #### [ProductConfigurationDownloads](#ProductConfigurationDownloads) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [[String: Any]]? | yes | | + | multivalue | Bool? | yes | | + +--- + + + + + #### [Media2](#Media2) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | portrait | String | no | | + | logo | String | no | | + | landscape | String | no | | + +--- + + + + + #### [CategoryMappingValues](#CategoryMappingValues) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String | no | | + | catalogId | Int? | yes | | + +--- + + + + + #### [CategoryMapping](#CategoryMapping) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | ajio | [CategoryMappingValues](#CategoryMappingValues)? | yes | | + | google | [CategoryMappingValues](#CategoryMappingValues)? | yes | | + | facebook | [CategoryMappingValues](#CategoryMappingValues)? | yes | | + +--- + + + + + #### [Hierarchy](#Hierarchy) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | l2 | Int | no | | + | department | Int | no | | + | l1 | Int | no | | + +--- + + + + + #### [Category](#Category) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | media | [Media2](#Media2)? | yes | | + | priority | Int? | yes | | + | uid | Int? | yes | | + | marketplaces | [CategoryMapping](#CategoryMapping)? | yes | | + | isActive | Bool | no | | + | modifiedOn | String? | yes | | + | synonyms | [String]? | yes | | + | createdOn | String? | yes | | + | createdBy | [String: Any]? | yes | | + | modifiedBy | [String: Any]? | yes | | + | id | String? | yes | | + | departments | [Int] | no | | + | slug | String? | yes | | + | tryouts | [String]? | yes | | + | level | Int | no | | + | name | String | no | | + | hierarchy | [[Hierarchy](#Hierarchy)]? | yes | | + +--- + + + + + #### [CategoryResponse](#CategoryResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [[Category](#Category)]? | yes | | + +--- + + + + + #### [CategoryRequestBody](#CategoryRequestBody) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | media | [Media2](#Media2)? | yes | | + | priority | Int? | yes | | + | marketplaces | [CategoryMapping](#CategoryMapping)? | yes | | + | isActive | Bool | no | | + | synonyms | [String]? | yes | | + | departments | [Int] | no | | + | slug | String? | yes | | + | tryouts | [String]? | yes | | + | level | Int | no | | + | name | String | no | | + | hierarchy | [[Hierarchy](#Hierarchy)]? | yes | | + +--- + + + + + #### [CategoryCreateResponse](#CategoryCreateResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + | uid | Int? | yes | | + +--- + + + + + #### [SingleCategoryResponse](#SingleCategoryResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [Category](#Category)? | yes | | + +--- + + + + + #### [CategoryUpdateResponse](#CategoryUpdateResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + | success | Bool? | yes | | + +--- + + + + + #### [Image](#Image) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | aspectRatioF | Double? | yes | | + | aspectRatio | String? | yes | | + | url | String? | yes | | + | secureUrl | String? | yes | | + +--- + + + + + #### [Logo](#Logo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | aspectRatioF | Int? | yes | | + | aspectRatio | String? | yes | | + | url | String? | yes | | + | secureUrl | String? | yes | | + +--- + + + + + #### [Brand](#Brand) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | logo | [Logo](#Logo)? | yes | | + | name | String? | yes | | + | uid | Int? | yes | | + +--- + + + + + #### [ProductPublished](#ProductPublished) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isSet | Bool? | yes | | + | productOnlineDate | Int? | yes | | + +--- + + + + + #### [Product](#Product) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | highlights | [String]? | yes | | + | isDependent | Bool? | yes | | + | slug | String? | yes | | + | departments | [Int]? | yes | | + | variants | [String: Any]? | yes | | + | moq | [String: Any]? | yes | | + | sizeGuide | String? | yes | | + | media | [[Media1](#Media1)]? | yes | | + | primaryColor | String? | yes | | + | isActive | Bool? | yes | | + | isPhysical | Bool? | yes | | + | id | String? | yes | | + | images | [[Image](#Image)]? | yes | | + | color | String? | yes | | + | itemType | String? | yes | | + | brand | [Brand](#Brand)? | yes | | + | isSet | Bool? | yes | | + | hsnCode | String? | yes | | + | sizes | [[String: Any]]? | yes | | + | allSizes | [[String: Any]]? | yes | | + | categorySlug | String? | yes | | + | multiSize | Bool? | yes | | + | customOrder | [String: Any]? | yes | | + | categoryUid | Int? | yes | | + | brandUid | Int? | yes | | + | imageNature | String? | yes | | + | productPublish | [ProductPublished](#ProductPublished)? | yes | | + | description | String? | yes | | + | uid | Int? | yes | | + | currency | String? | yes | | + | templateTag | String? | yes | | + | l3Mapping | [String]? | yes | | + | countryOfOrigin | String? | yes | | + | itemCode | String? | yes | | + | customJson | [String: Any]? | yes | | + | name | String? | yes | | + | shortDescription | String? | yes | | + +--- + + + + + #### [ProductListingResponse](#ProductListingResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [[Product](#Product)]? | yes | | + +--- + + + + + #### [OrderQuantity](#OrderQuantity) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isSet | Bool? | yes | | + | maximum | Int? | yes | | + | minimum | Int? | yes | | + +--- + + + + + #### [ReturnConfig](#ReturnConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | time | Int | no | | + | unit | String | no | | + | returnable | Bool | no | | + +--- + + + + + #### [TeaserTag](#TeaserTag) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | tag | String? | yes | | + | url | String? | yes | | + +--- + + + + + #### [CustomOrder](#CustomOrder) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isCustomOrder | Bool? | yes | | + | manufacturingTimeUnit | String? | yes | | + | manufacturingTime | Int? | yes | | + +--- + + + + + #### [Trader](#Trader) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | address | [String]? | yes | | + | type | String? | yes | | + | name | String? | yes | | + +--- + + + + + #### [ProductPublish](#ProductPublish) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isSet | Bool? | yes | | + | productOnlineDate | String? | yes | | + +--- + + + + + #### [ProductCreateUpdate](#ProductCreateUpdate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | highlights | [String]? | yes | | + | isDependent | Bool? | yes | | + | noOfBoxes | Int? | yes | | + | slug | String | no | | + | departments | [Int] | no | | + | variants | [String: Any]? | yes | | + | moq | [OrderQuantity](#OrderQuantity)? | yes | | + | tags | [String]? | yes | | + | sizeGuide | String? | yes | | + | media | [[Media1](#Media1)]? | yes | | + | isActive | Bool? | yes | | + | bulkJobId | String? | yes | | + | requester | String? | yes | | + | isImageLessProduct | Bool? | yes | | + | action | String? | yes | | + | itemType | String | no | | + | returnConfig | [ReturnConfig](#ReturnConfig) | no | | + | isSet | Bool? | yes | | + | teaserTag | [TeaserTag](#TeaserTag)? | yes | | + | hsnCode | String | no | | + | categorySlug | String | no | | + | multiSize | Bool? | yes | | + | customOrder | [CustomOrder](#CustomOrder)? | yes | | + | companyId | Int | no | | + | trader | [[Trader](#Trader)] | no | | + | brandUid | Int | no | | + | productPublish | [ProductPublish](#ProductPublish)? | yes | | + | description | String? | yes | | + | uid | Int? | yes | | + | productGroupTag | [String]? | yes | | + | currency | String | no | | + | templateTag | String | no | | + | countryOfOrigin | String | no | | + | itemCode | String | no | | + | changeRequestId | String? | yes | | + | customJson | [String: Any]? | yes | | + | name | String | no | | + | shortDescription | String? | yes | | + +--- + + + + + #### [ValidateProduct](#ValidateProduct) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | valid | Bool? | yes | | + +--- + + + + + #### [UserDetail](#UserDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | userId | String? | yes | | + | username | String? | yes | | + | fullName | String? | yes | | + +--- + + + + + #### [ProductBulkRequest](#ProductBulkRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | total | Int? | yes | | + | isActive | Bool? | yes | | + | modifiedOn | String? | yes | | + | templateTag | String? | yes | | + | template | [ProductTemplate](#ProductTemplate)? | yes | | + | cancelledRecords | [String]? | yes | | + | companyId | Int? | yes | | + | filePath | String? | yes | | + | createdBy | [UserDetail](#UserDetail)? | yes | | + | failedRecords | [String]? | yes | | + | cancelled | Int? | yes | | + | modifiedBy | [UserDetail](#UserDetail)? | yes | | + | createdOn | String? | yes | | + | failed | Int? | yes | | + | succeed | Int? | yes | | + | stage | String? | yes | | + +--- + + + + + #### [ProductBulkRequestList](#ProductBulkRequestList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [ProductBulkRequest](#ProductBulkRequest)? | yes | | + +--- + + + + + #### [UserInfo1](#UserInfo1) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + | userId | String? | yes | | + | uid | String? | yes | | + | username | String? | yes | | + +--- + + + + + #### [BulkJob](#BulkJob) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | total | Int | no | | + | modifiedOn | String? | yes | | + | isActive | Bool? | yes | | + | templateTag | String? | yes | | + | customTemplateTag | String? | yes | | + | trackingUrl | String? | yes | | + | companyId | Int | no | | + | cancelledRecords | [[String: Any]]? | yes | | + | filePath | String? | yes | | + | createdBy | [UserInfo1](#UserInfo1)? | yes | | + | cancelled | Int? | yes | | + | modifiedBy | [UserInfo1](#UserInfo1)? | yes | | + | failedRecords | [[String: Any]]? | yes | | + | createdOn | String | no | | + | failed | Int? | yes | | + | succeed | Int? | yes | | + | stage | String? | yes | | + +--- + + + + + #### [BulkProductRequest](#BulkProductRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | batchId | String | no | | + | templateTag | String | no | | + | data | [[String: Any]] | no | | + | companyId | Int | no | | + +--- + + + + + #### [NestedTags](#NestedTags) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | tags | [String]? | yes | | + +--- + + + + + #### [ProductTagsViewResponse](#ProductTagsViewResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [NestedTags](#NestedTags)? | yes | | + +--- + + + + + #### [UserCommon](#UserCommon) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | userId | String? | yes | | + | username | String? | yes | | + | companyId | Int? | yes | | + +--- + + + + + #### [Items](#Items) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | total | Int? | yes | | + | modifiedOn | String? | yes | | + | isActive | Bool? | yes | | + | id | String? | yes | | + | trackingUrl | String? | yes | | + | createdOn | String? | yes | | + | filePath | String? | yes | | + | cancelledRecords | [String]? | yes | | + | companyId | Int? | yes | | + | cancelled | Int? | yes | | + | failedRecords | [String]? | yes | | + | modifiedBy | [UserCommon](#UserCommon)? | yes | | + | createdBy | [UserCommon](#UserCommon)? | yes | | + | retry | Int? | yes | | + | failed | Int? | yes | | + | succeed | Int? | yes | | + | stage | String? | yes | | + +--- + + + + + #### [BulkAssetResponse](#BulkAssetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [[Items](#Items)]? | yes | | + +--- + + + + + #### [ProductBulkAssets](#ProductBulkAssets) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | url | String | no | | + | user | [String: Any] | no | | + | companyId | Int? | yes | | + +--- + + + + + #### [ProductSizeDeleteDataResponse](#ProductSizeDeleteDataResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemId | Int? | yes | | + | size | String? | yes | | + | companyId | Int? | yes | | + +--- + + + + + #### [ProductSizeDeleteResponse](#ProductSizeDeleteResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | | + | data | [ProductSizeDeleteDataResponse](#ProductSizeDeleteDataResponse)? | yes | | + +--- + + + + + #### [InventoryResponse](#InventoryResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | store | [String: Any]? | yes | | + | identifiers | [String: Any]? | yes | | + | uid | String? | yes | | + | currency | String? | yes | | + | itemId | Int? | yes | | + | priceEffective | Int? | yes | | + | price | Int? | yes | | + | priceTransfer | Int? | yes | | + | sellableQuantity | Int? | yes | | + | inventoryUpdatedOn | String? | yes | | + | size | String? | yes | | + | sellerIdentifier | Int? | yes | | + | quantity | Int? | yes | | + +--- + + + + + #### [ItemQuery](#ItemQuery) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | brandUid | Int? | yes | | + | itemCode | String? | yes | | + | uid | Int? | yes | | + +--- + + + + + #### [SetSize](#SetSize) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pieces | Int | no | | + | size | String | no | | + +--- + + + + + #### [SizeDistribution](#SizeDistribution) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | sizes | [[SetSize](#SetSize)] | no | | + +--- + + + + + #### [InventorySet](#InventorySet) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | sizeDistribution | [SizeDistribution](#SizeDistribution) | no | | + | quantity | Int? | yes | | + +--- + + + + + #### [GTIN](#GTIN) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | primary | Bool? | yes | | + | gtinValue | String | no | | + | gtinType | String | no | | + +--- + + + + + #### [InvSize](#InvSize) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | set | [InventorySet](#InventorySet)? | yes | | + | size | String | no | | + | itemDimensionsUnitOfMeasure | String? | yes | | + | identifiers | [[GTIN](#GTIN)] | no | | + | storeCode | String | no | | + | currency | String | no | | + | itemWidth | Double? | yes | | + | itemLength | Double? | yes | | + | priceEffective | Double | no | | + | priceTransfer | Double? | yes | | + | price | Double | no | | + | itemWeight | Double? | yes | | + | itemHeight | Double? | yes | | + | itemWeightUnitOfMeasure | String? | yes | | + | isSet | Bool? | yes | | + | expirationDate | String? | yes | | + | quantity | Int | no | | + +--- + + + + + #### [InventoryRequest](#InventoryRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | item | [ItemQuery](#ItemQuery) | no | | + | sizes | [[InvSize](#InvSize)] | no | | + | companyId | Int | no | | + +--- + + + + + #### [InventoryDeleteData](#InventoryDeleteData) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemId | Int? | yes | | + | size | String? | yes | | + | locationId | Int? | yes | | + +--- + + + + + #### [InventoryDelete](#InventoryDelete) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | | + | data | [InventoryDeleteData](#InventoryDeleteData)? | yes | | + +--- + + + + + #### [BulkInventoryGetItems](#BulkInventoryGetItems) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | total | Int? | yes | | + | isActive | Bool? | yes | | + | modifiedOn | String? | yes | | + | id | String? | yes | | + | createdOn | String? | yes | | + | companyId | Int? | yes | | + | cancelledRecords | [String]? | yes | | + | filePath | String? | yes | | + | cancelled | Int? | yes | | + | failedRecords | [String]? | yes | | + | modifiedBy | [String: Any]? | yes | | + | createdBy | [String: Any]? | yes | | + | failed | Int? | yes | | + | succeed | Int? | yes | | + | stage | String? | yes | | + +--- + + + + + #### [BulkInventoryGet](#BulkInventoryGet) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [[BulkInventoryGetItems](#BulkInventoryGetItems)]? | yes | | + +--- + + + + + #### [CommonResponse](#CommonResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | String? | yes | | + +--- + + + + + #### [Size1](#Size1) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | set | [InventorySet](#InventorySet)? | yes | | + | size | String? | yes | | + | itemDimensionsUnitOfMeasure | String? | yes | | + | identifiers | [[String: Any]]? | yes | | + | storeCode | String | no | | + | currency | String | no | | + | itemWidth | Double? | yes | | + | itemLength | Double? | yes | | + | priceEffective | Double | no | | + | priceTransfer | Double? | yes | | + | price | Double | no | | + | itemWeight | Double? | yes | | + | itemHeight | Double? | yes | | + | itemWeightUnitOfMeasure | String? | yes | | + | isSet | Bool? | yes | | + | sellerIdentifier | String | no | | + | expirationDate | String? | yes | | + | quantity | Int | no | | + +--- + + + + + #### [InventoryBulkRequest](#InventoryBulkRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [String: Any]? | yes | | + | batchId | String | no | | + | sizes | [[Size1](#Size1)] | no | | + | companyId | Int | no | | + +--- + + + + + #### [InventoryExportJob](#InventoryExportJob) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | requestParams | [String: Any]? | yes | | + | taskId | String | no | | + | triggerOn | String? | yes | | + | status | String? | yes | | + | sellerId | Int | no | | + | url | String? | yes | | + | completedOn | String? | yes | | + +--- + + + + + #### [InventoryExportRequest](#InventoryExportRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | store | [Int]? | yes | | + | brand | [Int]? | yes | | + | type | String? | yes | | + +--- + + + + + #### [FilerList](#FilerList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | value | String? | yes | | + | display | String? | yes | | + +--- + + + + + #### [InventoryConfig](#InventoryConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [[FilerList](#FilerList)]? | yes | | + | multivalues | Bool? | yes | | + +--- + + + + + #### [PageResponse](#PageResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemTotal | Int? | yes | | + | hasNext | Bool? | yes | | + | current | String? | yes | | + | hasPrevious | Bool? | yes | | + | size | Int? | yes | | + +--- + + + + + #### [HsnCodesObject](#HsnCodesObject) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | tax1 | Double? | yes | | + | modifiedOn | String? | yes | | + | taxOnEsp | Bool? | yes | | + | id | String? | yes | | + | threshold1 | Double? | yes | | + | companyId | Int? | yes | | + | threshold2 | Double? | yes | | + | tax2 | Double? | yes | | + | hs2Code | String? | yes | | + | taxOnMrp | Bool? | yes | | + | hsnCode | String? | yes | | + +--- + + + + + #### [HsnCodesListingResponse](#HsnCodesListingResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [PageResponse](#PageResponse)? | yes | | + | items | [[HsnCodesObject](#HsnCodesObject)]? | yes | | + +--- + + + + + #### [HsnUpsert](#HsnUpsert) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | tax1 | Double | no | | + | uid | Int? | yes | | + | taxOnEsp | Bool? | yes | | + | threshold1 | Double | no | | + | companyId | Int | no | | + | threshold2 | Double? | yes | | + | tax2 | Double? | yes | | + | hs2Code | String | no | | + | taxOnMrp | Bool | no | | + | hsnCode | String | no | | + +--- + + + + + #### [HsnCode](#HsnCode) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [HsnCodesObject](#HsnCodesObject)? | yes | | + +--- + + + + + #### [BulkHsnUpsert](#BulkHsnUpsert) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [[HsnUpsert](#HsnUpsert)] | no | | + +--- + + + + + #### [BulkHsnResponse](#BulkHsnResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | | + +--- + + + + + #### [BrandItem](#BrandItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | discount | String? | yes | | + | logo | [Media](#Media)? | yes | | + | banners | [ImageUrls](#ImageUrls)? | yes | | + | action | [Action](#Action)? | yes | | + | departments | [String]? | yes | | + | slug | String? | yes | | + | name | String? | yes | | + +--- + + + + + #### [BrandListingResponse](#BrandListingResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page) | no | | + | items | [[BrandItem](#BrandItem)]? | yes | | + +--- + + + + + #### [Department](#Department) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | logo | [Media](#Media)? | yes | | + | priorityOrder | Int? | yes | | + | slug | String? | yes | | + | name | String? | yes | | + +--- + + + + + #### [DepartmentResponse](#DepartmentResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Department](#Department)]? | yes | | + +--- + + + + + #### [ThirdLevelChild](#ThirdLevelChild) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | banners | [ImageUrls](#ImageUrls)? | yes | | + | childs | [[String: Any]]? | yes | | + | action | [Action](#Action)? | yes | | + | slug | String? | yes | | + | customJson | [String: Any]? | yes | | + | name | String? | yes | | + +--- + + + + + #### [SecondLevelChild](#SecondLevelChild) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | banners | [ImageUrls](#ImageUrls)? | yes | | + | childs | [[ThirdLevelChild](#ThirdLevelChild)]? | yes | | + | action | [Action](#Action)? | yes | | + | slug | String? | yes | | + | customJson | [String: Any]? | yes | | + | name | String? | yes | | + +--- + + + + + #### [Child](#Child) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | banners | [ImageUrls](#ImageUrls)? | yes | | + | childs | [[SecondLevelChild](#SecondLevelChild)]? | yes | | + | action | [Action](#Action)? | yes | | + | slug | String? | yes | | + | customJson | [String: Any]? | yes | | + | name | String? | yes | | + +--- + + + + + #### [CategoryItems](#CategoryItems) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | banners | [ImageUrls](#ImageUrls)? | yes | | + | childs | [[Child](#Child)]? | yes | | + | action | [Action](#Action)? | yes | | + | slug | String? | yes | | + | name | String? | yes | | + +--- + + + + + #### [DepartmentCategoryTree](#DepartmentCategoryTree) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | department | String? | yes | | + | items | [[CategoryItems](#CategoryItems)]? | yes | | + +--- + + + + + #### [DepartmentIdentifier](#DepartmentIdentifier) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | slug | String? | yes | | + +--- + + + + + #### [CategoryListingResponse](#CategoryListingResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [[DepartmentCategoryTree](#DepartmentCategoryTree)]? | yes | | + | departments | [[DepartmentIdentifier](#DepartmentIdentifier)]? | yes | | + +--- + + + + + #### [ApplicationProductListingResponse](#ApplicationProductListingResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page) | no | | + | filters | [[ProductFilters](#ProductFilters)]? | yes | | + | sortOn | [[ProductSortOn](#ProductSortOn)]? | yes | | + | items | [[ProductListingDetail](#ProductListingDetail)]? | yes | | + +--- + + + + + #### [ProductDetail](#ProductDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | productOnlineDate | String? | yes | | + | highlights | [String]? | yes | | + | ratingCount | Int? | yes | | + | slug | String | no | | + | hasVariant | Bool? | yes | | + | color | String? | yes | | + | itemType | String? | yes | | + | brand | [ProductBrand](#ProductBrand)? | yes | | + | teaserTag | [String: Any]? | yes | | + | similars | [String]? | yes | | + | medias | [[Media1](#Media1)]? | yes | | + | attributes | [String: Any]? | yes | | + | imageNature | String? | yes | | + | tryouts | [String]? | yes | | + | groupedAttributes | [[ProductDetailGroupedAttribute](#ProductDetailGroupedAttribute)]? | yes | | + | type | String? | yes | | + | uid | Int? | yes | | + | description | String? | yes | | + | promoMeta | [String: Any]? | yes | | + | rating | Double? | yes | | + | itemCode | String? | yes | | + | name | String? | yes | | + | shortDescription | String? | yes | | + +--- + + + + + #### [ArticleAssignment](#ArticleAssignment) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | strategy | String? | yes | | + | level | String? | yes | | + +--- + + + + + #### [ArticleQuery](#ArticleQuery) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemId | Int | no | | + | size | String | no | | + | ignoredStores | [Int]? | yes | | + +--- + + + + + #### [AssignStoreArticle](#AssignStoreArticle) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | groupId | String? | yes | | + | articleAssignment | [ArticleAssignment](#ArticleAssignment)? | yes | | + | meta | [String: Any]? | yes | | + | query | [ArticleQuery](#ArticleQuery)? | yes | | + | quantity | Int? | yes | | + +--- + + + + + #### [AssignStore](#AssignStore) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | storeIds | [Int]? | yes | | + | pincode | String | no | | + | appId | String | no | | + | companyId | Int? | yes | | + | articles | [[AssignStoreArticle](#AssignStoreArticle)] | no | | + | channelType | String? | yes | | + | channelIdentifier | String? | yes | | + +--- + + + + + #### [ArticleAssignment1](#ArticleAssignment1) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | strategy | String? | yes | | + | level | String? | yes | | + +--- + + + + + #### [StoreAssignResponse](#StoreAssignResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | priceMarked | Int? | yes | | + | uid | String? | yes | | + | sCity | String? | yes | | + | itemId | Int | no | | + | priceEffective | Int? | yes | | + | index | Int? | yes | | + | companyId | Int? | yes | | + | groupId | String? | yes | | + | strategyWiseListing | [[String: Any]]? | yes | | + | meta | [String: Any]? | yes | | + | articleAssignment | [ArticleAssignment1](#ArticleAssignment1) | no | | + | status | Bool | no | | + | id | String? | yes | | + | storePincode | Int? | yes | | + | size | String | no | | + | quantity | Int | no | | + | storeId | Int? | yes | | + +--- + + + + + #### [Document](#Document) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String | no | | + | verified | Bool? | yes | | + | value | String | no | | + | legalName | String? | yes | | + | url | String? | yes | | + +--- + + + + + #### [UserSerializer1](#UserSerializer1) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | userId | String? | yes | | + | contact | String? | yes | | + | username | String? | yes | | + +--- + + + + + #### [GetAddressSerializer](#GetAddressSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | state | String? | yes | | + | landmark | String? | yes | | + | pincode | Int? | yes | | + | address1 | String? | yes | | + | longitude | Double? | yes | | + | city | String? | yes | | + | address2 | String? | yes | | + | addressType | String? | yes | | + | countryCode | String? | yes | | + | latitude | Double? | yes | | + | country | String? | yes | | + +--- + + + + + #### [GetCompanySerializer](#GetCompanySerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | modifiedOn | String? | yes | | + | companyType | String? | yes | | + | stage | String? | yes | | + | verifiedOn | String? | yes | | + | createdBy | [UserSerializer1](#UserSerializer1)? | yes | | + | modifiedBy | [UserSerializer1](#UserSerializer1)? | yes | | + | businessType | String? | yes | | + | verifiedBy | [UserSerializer1](#UserSerializer1)? | yes | | + | createdOn | String? | yes | | + | rejectReason | String? | yes | | + | name | String? | yes | | + | addresses | [[GetAddressSerializer](#GetAddressSerializer)]? | yes | | + +--- + + + + + #### [UserSerializer2](#UserSerializer2) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | userId | String? | yes | | + | contact | String? | yes | | + | username | String? | yes | | + +--- + + + + + #### [ProductReturnConfigSerializer](#ProductReturnConfigSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | storeUid | Int? | yes | | + | onSameStore | Bool? | yes | | + +--- + + + + + #### [SellerPhoneNumber](#SellerPhoneNumber) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | number | String | no | | + | countryCode | Int | no | | + +--- + + + + + #### [InvoiceCredSerializer](#InvoiceCredSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | password | String? | yes | | + | username | String? | yes | | + | enabled | Bool? | yes | | + +--- + + + + + #### [InvoiceDetailsSerializer](#InvoiceDetailsSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | eInvoice | [InvoiceCredSerializer](#InvoiceCredSerializer)? | yes | | + | eWaybill | [InvoiceCredSerializer](#InvoiceCredSerializer)? | yes | | + +--- + + + + + #### [LocationManagerSerializer](#LocationManagerSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + | name | String? | yes | | + | mobileNo | [SellerPhoneNumber](#SellerPhoneNumber) | no | | + +--- + + + + + #### [LocationTimingSerializer](#LocationTimingSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | minute | Int? | yes | | + | hour | Int? | yes | | + +--- + + + + + #### [LocationDayWiseSerializer](#LocationDayWiseSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | weekday | String | no | | + | closing | [LocationTimingSerializer](#LocationTimingSerializer)? | yes | | + | open | Bool | no | | + | opening | [LocationTimingSerializer](#LocationTimingSerializer)? | yes | | + +--- + + + + + #### [LocationIntegrationType](#LocationIntegrationType) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | order | String? | yes | | + | inventory | String? | yes | | + +--- + + + + + #### [GetLocationSerializer](#GetLocationSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | documents | [[Document](#Document)]? | yes | | + | company | [GetCompanySerializer](#GetCompanySerializer)? | yes | | + | verifiedBy | [UserSerializer2](#UserSerializer2)? | yes | | + | productReturnConfig | [ProductReturnConfigSerializer](#ProductReturnConfigSerializer)? | yes | | + | stage | String? | yes | | + | storeType | String? | yes | | + | modifiedOn | String? | yes | | + | contactNumbers | [[SellerPhoneNumber](#SellerPhoneNumber)]? | yes | | + | verifiedOn | String? | yes | | + | warnings | [String: Any]? | yes | | + | code | String | no | | + | displayName | String | no | | + | gstCredentials | [InvoiceDetailsSerializer](#InvoiceDetailsSerializer)? | yes | | + | manager | [LocationManagerSerializer](#LocationManagerSerializer)? | yes | | + | createdBy | [UserSerializer2](#UserSerializer2)? | yes | | + | createdOn | String? | yes | | + | timing | [[LocationDayWiseSerializer](#LocationDayWiseSerializer)]? | yes | | + | uid | Int? | yes | | + | integrationType | [LocationIntegrationType](#LocationIntegrationType)? | yes | | + | phoneNumber | String | no | | + | notificationEmails | [String]? | yes | | + | address | [GetAddressSerializer](#GetAddressSerializer) | no | | + | modifiedBy | [UserSerializer2](#UserSerializer2)? | yes | | + | customJson | [String: Any]? | yes | | + | name | String | no | | + +--- + + + + + #### [LocationListSerializer](#LocationListSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [[GetLocationSerializer](#GetLocationSerializer)]? | yes | | + +--- + + + diff --git a/documentation/platform/COMMON.md b/documentation/platform/COMMON.md new file mode 100644 index 0000000000..3be58cdcc3 --- /dev/null +++ b/documentation/platform/COMMON.md @@ -0,0 +1,440 @@ + + + + +##### [Back to Platform docs](./README.md) + +## Common Methods +Application configuration apis +* [searchApplication](#searchapplication) +* [getLocations](#getlocations) + + + +## Methods with example and description + + +#### searchApplication +Search Application + + + + +```swift +common.searchApplication(authorization: authorization, query: query) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| authorization | String? | no | | +| query | String? | no | Provide application name | + + + +Provide application name or domain url + +*Returned Response:* + + + + +[ApplicationResponse](#ApplicationResponse) + +Success + + + + +
    +  Example: + +```json +{ + "application": { + "website": { + "enabled": true, + "basepath": "/" + }, + "cors": { + "domains": [] + }, + "auth": { + "enabled": true + }, + "description": "test", + "channel_type": "store", + "cache_ttl": -1, + "internal": false, + "is_active": true, + "mode": "live", + "_id": "620b931ee7bfb11f910bf4a3", + "company_id": 2, + "name": "test", + "owner": "5b9b98150df588546aaea6d2", + "logo": { + "secure_url": "https://hdn-1.addsale.com/x0/company/164/applications/5efc9913f474c329718e3690/application/pictures/free-logo/original/olqHM8LNr-JioMart-Groceries.png" + }, + "favicon": { + "secure_url": "https://hdn-1.addsale.com/x0/company/164/applications/5efc9913f474c329718e3690/application/pictures/free-logo/original/olqHM8LNr-JioMart-Groceries.png" + }, + "banner": { + "secure_url": "https://hdn-1.addsale.com/x0/company/164/applications/5efc9913f474c329718e3690/application/pictures/landscape-banner/original/D2fr98CUH-JioMart-Groceries.png" + }, + "token": "tPQv0nc23", + "tokens": [ + { + "token": "tPQv0nc23", + "created_at": "2022-02-15T11:48:46.909Z" + } + ], + "domains": [ + { + "verified": true, + "is_primary": true, + "is_shortlink": true, + "_id": "620b931ee7bfb11f910bf4a4", + "name": "qckvv5lhp.hostfynd.dev" + } + ], + "redirections": [], + "meta": [], + "created_at": "2022-02-15T11:48:46.909Z", + "modified_at": "2022-02-15T11:48:46.909Z", + "__v": 0, + "domain": { + "verified": true, + "is_primary": true, + "is_shortlink": true, + "_id": "620b931ee7bfb11f910bf4a4", + "name": "qckvv5lhp.hostfynd.dev" + }, + "id": "620b931ee7bfb11f910bf4a3" + } +} +``` +
    + + + + + + + + + +--- + + +#### getLocations +Get countries, states, cities + + + + +```swift +common.getLocations(locationType: locationType, id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| locationType | String? | no | Provide location type to query on. Possible values : country, state, city | +| id | String? | no | Field is optional when location_type is country. If querying for state, provide id of country. If querying for city, provide id of state. | + + + + + +*Returned Response:* + + + + +[Locations](#Locations) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [ApplicationResponse](#ApplicationResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | [Application](#Application)? | yes | | + +--- + + + + + #### [Currency](#Currency) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | isActive | Bool? | yes | | + | name | String? | yes | | + | code | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | decimalDigits | Int? | yes | | + | symbol | String? | yes | | + +--- + + + + + #### [Domain](#Domain) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | verified | Bool? | yes | | + | isPrimary | Bool? | yes | | + | isShortlink | Bool? | yes | | + | id | String? | yes | | + | name | String? | yes | | + +--- + + + + + #### [ApplicationWebsite](#ApplicationWebsite) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | basepath | String? | yes | | + +--- + + + + + #### [ApplicationCors](#ApplicationCors) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | domains | [String]? | yes | | + +--- + + + + + #### [ApplicationAuth](#ApplicationAuth) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + +--- + + + + + #### [ApplicationRedirections](#ApplicationRedirections) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | redirectFrom | String? | yes | | + | redirectTo | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [ApplicationMeta](#ApplicationMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [SecureUrl](#SecureUrl) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | secureUrl | String? | yes | | + +--- + + + + + #### [Application](#Application) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | website | [ApplicationWebsite](#ApplicationWebsite)? | yes | | + | cors | [ApplicationCors](#ApplicationCors)? | yes | | + | auth | [ApplicationAuth](#ApplicationAuth)? | yes | | + | description | String? | yes | | + | channelType | String? | yes | | + | cacheTtl | Int? | yes | | + | isInternal | Bool? | yes | | + | isActive | Bool? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | owner | String? | yes | | + | companyId | Int? | yes | | + | token | String? | yes | | + | redirections | [[ApplicationRedirections](#ApplicationRedirections)]? | yes | | + | meta | [[ApplicationMeta](#ApplicationMeta)]? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + | banner | [SecureUrl](#SecureUrl)? | yes | | + | logo | [SecureUrl](#SecureUrl)? | yes | | + | favicon | [SecureUrl](#SecureUrl)? | yes | | + | domains | [[Domain](#Domain)]? | yes | | + | appType | String? | yes | | + | mobileLogo | [SecureUrl](#SecureUrl)? | yes | | + | domain | [Domain](#Domain)? | yes | | + +--- + + + + + #### [NotFound](#NotFound) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [BadRequest](#BadRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | Failure message. | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String | no | | + | size | Int? | yes | | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + +--- + + + + + #### [LocationDefaultLanguage](#LocationDefaultLanguage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | code | String? | yes | | + +--- + + + + + #### [LocationDefaultCurrency](#LocationDefaultCurrency) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | symbol | String? | yes | | + | code | String? | yes | | + +--- + + + + + #### [LocationCountry](#LocationCountry) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | capital | String? | yes | | + | currency | String? | yes | | + | iso2 | String? | yes | | + | iso3 | String? | yes | | + | name | String? | yes | | + | parent | String? | yes | | + | phoneCode | String? | yes | | + | type | String? | yes | | + | uid | Int? | yes | | + | v | Int? | yes | | + | id | String? | yes | | + | defaultCurrency | [LocationDefaultCurrency](#LocationDefaultCurrency)? | yes | | + | defaultLanguage | [LocationDefaultLanguage](#LocationDefaultLanguage)? | yes | | + +--- + + + + + #### [Locations](#Locations) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[String: Any]]? | yes | | + +--- + + + diff --git a/documentation/platform/COMMUNICATION.md b/documentation/platform/COMMUNICATION.md new file mode 100644 index 0000000000..4858325737 --- /dev/null +++ b/documentation/platform/COMMUNICATION.md @@ -0,0 +1,5267 @@ + + + + +##### [Back to Platform docs](./README.md) + +## Communication Methods +Manages email, sms, push notifications sent to users +* [getCampaigns](#getcampaigns) +* [createCampaign](#createcampaign) +* [getCampaignById](#getcampaignbyid) +* [updateCampaignById](#updatecampaignbyid) +* [getStatsOfCampaignById](#getstatsofcampaignbyid) +* [getAudiences](#getaudiences) +* [createAudience](#createaudience) +* [getBigqueryHeaders](#getbigqueryheaders) +* [getAudienceById](#getaudiencebyid) +* [updateAudienceById](#updateaudiencebyid) +* [getNSampleRecordsFromCsv](#getnsamplerecordsfromcsv) +* [getEmailProviders](#getemailproviders) +* [createEmailProvider](#createemailprovider) +* [getEmailProviderById](#getemailproviderbyid) +* [updateEmailProviderById](#updateemailproviderbyid) +* [getEmailTemplates](#getemailtemplates) +* [createEmailTemplate](#createemailtemplate) +* [getSystemEmailTemplates](#getsystememailtemplates) +* [getEmailTemplateById](#getemailtemplatebyid) +* [updateEmailTemplateById](#updateemailtemplatebyid) +* [deleteEmailTemplateById](#deleteemailtemplatebyid) +* [sendCommunicationSynchronously](#sendcommunicationsynchronously) +* [sendCommunicationAsynchronously](#sendcommunicationasynchronously) +* [getEventSubscriptions](#geteventsubscriptions) +* [getJobs](#getjobs) +* [triggerCampaignJob](#triggercampaignjob) +* [getJobLogs](#getjoblogs) +* [getCommunicationLogs](#getcommunicationlogs) +* [getSystemNotifications](#getsystemnotifications) +* [getSmsProviders](#getsmsproviders) +* [createSmsProvider](#createsmsprovider) +* [getSmsProviderById](#getsmsproviderbyid) +* [updateSmsProviderById](#updatesmsproviderbyid) +* [getSmsTemplates](#getsmstemplates) +* [createSmsTemplate](#createsmstemplate) +* [getSmsTemplateById](#getsmstemplatebyid) +* [updateSmsTemplateById](#updatesmstemplatebyid) +* [deleteSmsTemplateById](#deletesmstemplatebyid) +* [getSystemSystemTemplates](#getsystemsystemtemplates) + + + +## Methods with example and description + + +#### getCampaigns +Get campaigns + + + + +```swift +client.application("").communication.getCampaigns(pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Current page no | +| pageSize | Int? | no | Current request items count | +| sort | [String: Any]? | no | To sort based on created_at | + + + +Get campaigns + +*Returned Response:* + + + + +[Campaigns](#Campaigns) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "recipient_headers": { + "email": "email" + }, + "email": { + "template": { + "key": "_id", + "value": "5fb6757a09fd90ca91917a60" + }, + "provider": { + "_id": "5e560652b5eb4b1f13b4d601", + "from_name": "Fynd", + "from_email": "hey@gofynd.com" + } + }, + "description": "", + "tags": [], + "is_active": true, + "_id": "6009a1ea1f6a61d88e80a867", + "datasource": "6009a1be1f6a61a13180a866", + "type": "email", + "name": "testing bq email", + "application": "000000000000000000000004", + "created_at": "2021-01-21T15:46:50.357Z", + "updated_at": "2021-01-21T15:46:50.357Z", + "slug": "testing-bq-email-vPyAd1YB1", + "__v": 0 + }, + { + "recipient_headers": { + "sms": "phone_number" + }, + "sms": { + "template": { + "key": "_id", + "value": "5fb675d009fd903196917a61" + }, + "provider": { + "_id": "5e560652b5eb4b06f3b4d5ff" + } + }, + "description": "", + "tags": [], + "is_active": true, + "_id": "600981561f6a612c6080a85e", + "datasource": "600981461f6a614b2c80a85d", + "type": "sms", + "name": "test", + "application": "000000000000000000000004", + "created_at": "2021-01-21T13:27:50.848Z", + "updated_at": "2021-01-21T13:27:50.848Z", + "slug": "test-ipLO3c8Jh", + "__v": 0 + } + ], + "page": { + "type": "number", + "current": 1, + "size": 2, + "item_total": 2, + "has_next": false + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createCampaign +Create campaign + + + + +```swift +client.application("").communication.createCampaign(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CampaignReq | yes | Request body | + + +Create campaign + +*Returned Response:* + + + + +[Campaign](#Campaign) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "recipient_headers": { + "email": "email" + }, + "email": { + "template": { + "key": "_id", + "value": "5fb6757a09fd90ca91917a60" + }, + "provider": { + "_id": "5e560652b5eb4b1f13b4d601", + "from_name": "Fynd", + "from_email": "hey@gofynd.com" + } + }, + "description": "", + "tags": [], + "is_active": true, + "_id": "6009a1ea1f6a61d88e80a867", + "datasource": "6009a1be1f6a61a13180a866", + "type": "email", + "name": "testing bq email", + "application": "000000000000000000000004", + "created_at": "2021-01-21T15:46:50.357Z", + "updated_at": "2021-01-21T15:46:50.357Z", + "slug": "testing-bq-email-vPyAd1YB1", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getCampaignById +Get campaign by id + + + + +```swift +client.application("").communication.getCampaignById(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Campaign id | + + + +Get campaign by id + +*Returned Response:* + + + + +[Campaign](#Campaign) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "recipient_headers": { + "email": "email" + }, + "email": { + "template": { + "key": "_id", + "value": "5fb6757a09fd90ca91917a60" + }, + "provider": { + "_id": "5e560652b5eb4b1f13b4d601", + "from_name": "Fynd", + "from_email": "hey@gofynd.com" + } + }, + "description": "", + "tags": [], + "is_active": true, + "_id": "6009a1ea1f6a61d88e80a867", + "datasource": "6009a1be1f6a61a13180a866", + "type": "email", + "name": "testing bq email", + "application": "000000000000000000000004", + "created_at": "2021-01-21T15:46:50.357Z", + "updated_at": "2021-01-21T15:46:50.357Z", + "slug": "testing-bq-email-vPyAd1YB1", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateCampaignById +Update campaign by id + + + + +```swift +client.application("").communication.updateCampaignById(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Campaign id | +| body | CampaignReq | yes | Request body | + + +Update campaign by id + +*Returned Response:* + + + + +[Campaign](#Campaign) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "recipient_headers": { + "email": "email" + }, + "email": { + "template": { + "key": "_id", + "value": "5fb6757a09fd90ca91917a60" + }, + "provider": { + "_id": "5e560652b5eb4b1f13b4d601", + "from_name": "Fynd", + "from_email": "hey@gofynd.com" + } + }, + "description": "", + "tags": [], + "is_active": true, + "_id": "6009a1ea1f6a61d88e80a867", + "datasource": "6009a1be1f6a61a13180a866", + "type": "email", + "name": "testing bq email", + "application": "000000000000000000000004", + "created_at": "2021-01-21T15:46:50.357Z", + "updated_at": "2021-01-21T15:46:50.357Z", + "slug": "testing-bq-email-vPyAd1YB1", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getStatsOfCampaignById +Get stats of campaign by id + + + + +```swift +client.application("").communication.getStatsOfCampaignById(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Campaign id | + + + +Get stats of campaign by id + +*Returned Response:* + + + + +[GetStats](#GetStats) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": [ + { + "_id": "6009a1ea1f6a61d88e80a867", + "imported": { + "count": 2 + }, + "processed": { + "email": { + "success": 2, + "failed": 0, + "suppressed": 0 + }, + "sms": { + "success": 0, + "failed": 0, + "suppressed": 0 + } + } + } + ] +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getAudiences +Get audiences + + + + +```swift +client.application("").communication.getAudiences(pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Current page no | +| pageSize | Int? | no | Current request items count | +| sort | [String: Any]? | no | To sort based on created_at | + + + +Get audiences + +*Returned Response:* + + + + +[Audiences](#Audiences) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "description": "test description", + "tags": [ + "csv" + ], + "headers": [ + "phone_number", + "email", + "firstname", + "lastname", + "orderid" + ], + "is_active": true, + "_id": "5fb6675c09fd901023917a5f", + "name": "Test csv", + "file_url": "https://hdn-1.addsale.com/x0/application/000000000000000000000004/datasources/2_r_D1jt6-test-1-entries.csv", + "type": "raw_csv", + "records_count": 3, + "application": "000000000000000000000004", + "created_at": "2020-11-19T12:38:52.580Z", + "updated_at": "2020-11-19T12:38:52.580Z", + "slug": "Test-csv", + "__v": 0 + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 1, + "has_next": false + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createAudience +Create audience + + + + +```swift +client.application("").communication.createAudience(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | AudienceReq | yes | Request body | + + +Create audience + +*Returned Response:* + + + + +[Audience](#Audience) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "description": "test description", + "tags": [ + "csv" + ], + "headers": [ + "phone_number", + "email", + "firstname", + "lastname", + "orderid" + ], + "is_active": true, + "_id": "5fb6675c09fd901023917a5f", + "name": "Test csv", + "file_url": "https://hdn-1.addsale.com/x0/application/000000000000000000000004/datasources/2_r_D1jt6-test-1-entries.csv", + "type": "raw_csv", + "records_count": 3, + "application": "000000000000000000000004", + "created_at": "2020-11-19T12:38:52.580Z", + "updated_at": "2020-11-19T12:38:52.580Z", + "slug": "Test-csv", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getBigqueryHeaders +Get bigquery headers + + + + +```swift +client.application("").communication.getBigqueryHeaders(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | BigqueryHeadersReq | yes | Request body | + + +Get bigquery headers + +*Returned Response:* + + + + +[BigqueryHeadersRes](#BigqueryHeadersRes) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "headers": [ + { + "name": "firstname", + "type": "STRING" + }, + { + "name": "lastname", + "type": "STRING" + }, + { + "name": "email", + "type": "STRING" + }, + { + "name": "phone", + "type": "STRING" + }, + { + "name": "countryCode", + "type": "STRING" + }, + { + "name": "application", + "type": "STRING" + } + ] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getAudienceById +Get audience by id + + + + +```swift +client.application("").communication.getAudienceById(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Audience id | + + + +Get audience by id + +*Returned Response:* + + + + +[Audience](#Audience) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "description": "test description", + "tags": [ + "csv" + ], + "headers": [ + "phone_number", + "email", + "firstname", + "lastname", + "orderid" + ], + "is_active": true, + "_id": "5fb6675c09fd901023917a5f", + "name": "Test csv", + "file_url": "https://hdn-1.addsale.com/x0/application/000000000000000000000004/datasources/2_r_D1jt6-test-1-entries.csv", + "type": "raw_csv", + "records_count": 3, + "application": "000000000000000000000004", + "created_at": "2020-11-19T12:38:52.580Z", + "updated_at": "2020-11-19T12:38:52.580Z", + "slug": "Test-csv", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateAudienceById +Update audience by id + + + + +```swift +client.application("").communication.updateAudienceById(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Audience id | +| body | AudienceReq | yes | Request body | + + +Update audience by id + +*Returned Response:* + + + + +[Audience](#Audience) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "description": "test description", + "tags": [ + "csv" + ], + "headers": [ + "phone_number", + "email", + "firstname", + "lastname", + "orderid" + ], + "is_active": true, + "_id": "5fb6675c09fd901023917a5f", + "name": "Test csv", + "file_url": "https://hdn-1.addsale.com/x0/application/000000000000000000000004/datasources/2_r_D1jt6-test-1-entries.csv", + "type": "raw_csv", + "records_count": 3, + "application": "000000000000000000000004", + "created_at": "2020-11-19T12:38:52.580Z", + "updated_at": "2020-11-19T12:38:52.580Z", + "slug": "Test-csv", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getNSampleRecordsFromCsv +Get n sample records from csv + + + + +```swift +client.application("").communication.getNSampleRecordsFromCsv(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | GetNRecordsCsvReq | yes | Request body | + + +Get n sample records from csv + +*Returned Response:* + + + + +[GetNRecordsCsvRes](#GetNRecordsCsvRes) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": [ + { + "phone_number": "1234567890", + "email": "abcxyz@gofynd.com", + "firstname": "Abc", + "lastname": "Xyz", + "orderid": "1" + } + ] +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getEmailProviders +Get email providers + + + + +```swift +client.application("").communication.getEmailProviders(pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Current page no | +| pageSize | Int? | no | Current request items count | +| sort | [String: Any]? | no | To sort based on created_at | + + + +Get email providers + +*Returned Response:* + + + + +[EmailProviders](#EmailProviders) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "type": "application", + "provider": "falconide", + "from_address": [ + { + "is_default": true, + "name": "abc", + "email": "abc@test.com" + } + ], + "_id": "5fd9fd44c474a7e3d5d376d6", + "name": "test falconide", + "description": "test", + "api_key": "testtttt", + "application": "000000000000000000000004", + "created_at": "2020-12-16T12:27:48.051Z", + "updated_at": "2020-12-16T12:27:48.051Z", + "slug": "test-falconide-application-falconide-ZTD-D7wbB", + "__v": 0 + } + ], + "page": { + "type": "number", + "current": 1, + "size": 10, + "item_total": 1, + "has_next": false + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createEmailProvider +Create email provider + + + + +```swift +client.application("").communication.createEmailProvider(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | EmailProviderReq | yes | Request body | + + +Create email provider + +*Returned Response:* + + + + +[EmailProvider](#EmailProvider) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "type": "application", + "provider": "falconide", + "from_address": [ + { + "is_default": true, + "name": "abc", + "email": "abc@test.com" + } + ], + "_id": "5fd9fd44c474a7e3d5d376d6", + "name": "test falconide", + "description": "test", + "api_key": "testtttt", + "application": "000000000000000000000004", + "created_at": "2020-12-16T12:27:48.051Z", + "updated_at": "2020-12-16T12:27:48.051Z", + "slug": "test-falconide-application-falconide-ZTD-D7wbB", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getEmailProviderById +Get email provider by id + + + + +```swift +client.application("").communication.getEmailProviderById(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Email provider id | + + + +Get email provider by id + +*Returned Response:* + + + + +[EmailProvider](#EmailProvider) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "type": "application", + "provider": "falconide", + "from_address": [ + { + "is_default": true, + "name": "abc", + "email": "abc@test.com" + } + ], + "_id": "5fd9fd44c474a7e3d5d376d6", + "name": "test falconide", + "description": "test", + "api_key": "testtttt", + "application": "000000000000000000000004", + "created_at": "2020-12-16T12:27:48.051Z", + "updated_at": "2020-12-16T12:27:48.051Z", + "slug": "test-falconide-application-falconide-ZTD-D7wbB", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateEmailProviderById +Update email provider by id + + + + +```swift +client.application("").communication.updateEmailProviderById(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Email provider id | +| body | EmailProviderReq | yes | Request body | + + +Update email provider by id + +*Returned Response:* + + + + +[EmailProvider](#EmailProvider) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "type": "application", + "provider": "falconide", + "from_address": [ + { + "is_default": true, + "name": "abc", + "email": "abc@test.com" + } + ], + "_id": "5fd9fd44c474a7e3d5d376d6", + "name": "test falconide", + "description": "test", + "api_key": "testtttt", + "application": "000000000000000000000004", + "created_at": "2020-12-16T12:27:48.051Z", + "updated_at": "2020-12-16T12:27:48.051Z", + "slug": "test-falconide-application-falconide-ZTD-D7wbB", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getEmailTemplates +Get email templates + + + + +```swift +client.application("").communication.getEmailTemplates(pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Current page no | +| pageSize | Int? | no | Current request items count | +| sort | [String: Any]? | no | To sort based on created_at | + + + +Get email templates + +*Returned Response:* + + + + +[EmailTemplates](#EmailTemplates) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "is_system": false, + "is_internal": true, + "description": "Application creation", + "static_to": [], + "static_cc": [], + "static_bcc": [], + "tags": [], + "priority": "high", + "published": true, + "_id": "5ef42a49c8b67d279c27a980", + "slug": "application-creation", + "name": "Application creation", + "from_name": "Fynd", + "subject": { + "template_type": "nunjucks", + "template": "This is a test email subject" + }, + "html": { + "template_type": "nunjucks", + "template": "This is a test email body" + }, + "text": { + "template_type": "nunjucks", + "template": "This is a test email body" + }, + "headers": [], + "attachments": [], + "created_at": "2020-06-25T04:38:34.003Z", + "updated_at": "2020-08-10T12:27:43.583Z", + "__v": 0 + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 66, + "has_next": true + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createEmailTemplate +Create email template + + + + +```swift +client.application("").communication.createEmailTemplate(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | EmailTemplateReq | yes | Request body | + + +Create email template + +*Returned Response:* + + + + +[EmailTemplateRes](#EmailTemplateRes) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "is_system": false, + "is_internal": false, + "description": "test template", + "static_to": [ + "abc@gofynd.com" + ], + "static_cc": [ + "abc@gofynd.com" + ], + "static_bcc": [ + "abc@gofynd.com" + ], + "tags": [], + "priority": "low", + "published": false, + "_id": "5ef42a49c8b67d279c27a980", + "name": "test", + "keys": { + "bcc": "abc@gofynd.com" + }, + "reply_to": "abc@gofynd.com", + "headers": [ + { + "key": "x-test-header", + "value": "test123" + } + ], + "subject": { + "template_type": "static", + "template": "This is test email" + }, + "html": { + "template_type": "static", + "template": "This is test email" + }, + "text": { + "template_type": "static", + "template": "This is test email" + }, + "attachments": [], + "created_at": "2021-02-08T03:33:42.103Z", + "updated_at": "2021-02-08T03:33:42.103Z", + "slug": "test-fZfGq0lSQ", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getSystemEmailTemplates +Get system email templates + + + + +```swift +client.application("").communication.getSystemEmailTemplates(pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Current page no | +| pageSize | Int? | no | Current request items count | +| sort | [String: Any]? | no | To sort based on created_at | + + + +Get system email templates + +*Returned Response:* + + + + +[SystemEmailTemplates](#SystemEmailTemplates) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "is_system": true, + "is_internal": true, + "description": "Application creation", + "static_to": [], + "static_cc": [], + "static_bcc": [], + "tags": [], + "priority": "high", + "published": true, + "_id": "5ef42a49c8b67d279c27a980", + "slug": "application-creation", + "name": "Application creation", + "from_name": "Fynd", + "subject": { + "template_type": "nunjucks", + "template": "This is a test email subject" + }, + "html": { + "template_type": "nunjucks", + "template": "This is a test email body" + }, + "text": { + "template_type": "nunjucks", + "template": "This is a test email body" + }, + "headers": [], + "attachments": [], + "created_at": "2020-06-25T04:38:34.003Z", + "updated_at": "2020-08-10T12:27:43.583Z", + "__v": 0 + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 66, + "has_next": true + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getEmailTemplateById +Get email template by id + + + + +```swift +client.application("").communication.getEmailTemplateById(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Email template id | + + + +Get email template by id + +*Returned Response:* + + + + +[EmailTemplate](#EmailTemplate) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "is_system": false, + "is_internal": true, + "description": "Application creation", + "static_to": [], + "static_cc": [], + "static_bcc": [], + "tags": [], + "priority": "high", + "published": true, + "_id": "5ef42a49c8b67d279c27a980", + "slug": "application-creation", + "name": "Application creation", + "from_name": "Fynd", + "subject": { + "template_type": "nunjucks", + "template": "This is a test email subject" + }, + "html": { + "template_type": "nunjucks", + "template": "This is a test email body" + }, + "text": { + "template_type": "nunjucks", + "template": "This is a test email body" + }, + "headers": [], + "attachments": [], + "created_at": "2020-06-25T04:38:34.003Z", + "updated_at": "2020-08-10T12:27:43.583Z", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateEmailTemplateById +Update email template by id + + + + +```swift +client.application("").communication.updateEmailTemplateById(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Email template id | +| body | EmailTemplateReq | yes | Request body | + + +Update email template by id + +*Returned Response:* + + + + +[EmailTemplateRes](#EmailTemplateRes) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "is_system": false, + "is_internal": false, + "description": "test template", + "static_to": [ + "abc@gofynd.com" + ], + "static_cc": [ + "abc@gofynd.com" + ], + "static_bcc": [ + "abc@gofynd.com" + ], + "tags": [], + "priority": "low", + "published": false, + "_id": "5ef42a49c8b67d279c27a980", + "name": "test", + "keys": { + "bcc": "abc@gofynd.com" + }, + "reply_to": "abc@gofynd.com", + "headers": [ + { + "key": "x-test-header", + "value": "test123" + } + ], + "subject": { + "template_type": "static", + "template": "This is test email" + }, + "html": { + "template_type": "static", + "template": "This is test email" + }, + "text": { + "template_type": "static", + "template": "This is test email" + }, + "attachments": [], + "created_at": "2021-02-08T03:33:42.103Z", + "updated_at": "2021-02-08T03:33:42.103Z", + "slug": "test-fZfGq0lSQ", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### deleteEmailTemplateById +Delete email template by id + + + + +```swift +client.application("").communication.deleteEmailTemplateById(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Email template id | + + + +Delete email template by id + +*Returned Response:* + + + + +[EmailTemplateDeleteSuccessRes](#EmailTemplateDeleteSuccessRes) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "success": true, + "message": "Deleted successfully" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### sendCommunicationSynchronously +Send email or sms synchronously + + + + +```swift +client.application("").communication.sendCommunicationSynchronously(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | EngineRequest | yes | Request body | + + +Send email or sms synchronously + +*Returned Response:* + + + + +[EngineResponse](#EngineResponse) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "success": true + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### sendCommunicationAsynchronously +Send email or sms asynchronously + + + + +```swift +client.application("").communication.sendCommunicationAsynchronously(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | EngineRequest | yes | Request body | + + +Send email or sms asynchronously + +*Returned Response:* + + + + +[EngineResponse](#EngineResponse) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "success": true + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getEventSubscriptions +Get event subscriptions + + + + +```swift +client.application("").communication.getEventSubscriptions(pageNo: pageNo, pageSize: pageSize, populate: populate) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Current page no | +| pageSize | Int? | no | Current request items count | +| populate | String? | no | populate fields | + + + +Get event subscriptions + +*Returned Response:* + + + + +[EventSubscriptions](#EventSubscriptions) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "template": { + "sms": { + "subscribed": true, + "template": null + }, + "email": { + "subscribed": true, + "template": "5e5653c1d503e0038407fc16" + } + }, + "is_default": true, + "_id": "5e56598f2bfda9050ccaa8e8", + "application": "000000000000000000000004", + "event": "5e5653c1d503e0038407fc10", + "slug": "reset-password-event", + "created_at": "2020-02-26T11:42:08.164Z", + "updated_at": "2021-03-03T09:00:47.871Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": null + }, + "email": { + "subscribed": true, + "template": "5e5653c1d503e0038407fc17" + } + }, + "is_default": true, + "_id": "5e56598f2bfda9050ccaa911", + "application": "000000000000000000000004", + "event": "5e5653c1d503e0038407fc11", + "slug": "invite-email-event", + "created_at": "2020-02-26T11:42:08.174Z", + "updated_at": "2021-03-03T09:00:47.871Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": null + }, + "email": { + "subscribed": true, + "template": "5e5653c1d503e0038407fc14" + } + }, + "is_default": true, + "_id": "5e56598f2bfda9050ccaa8f2", + "application": "000000000000000000000004", + "event": "5e5653c1d503e0038407fc12", + "slug": "verify-email-event", + "created_at": "2020-02-26T11:42:08.172Z", + "updated_at": "2021-03-03T09:00:47.953Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": null + }, + "email": { + "subscribed": true, + "template": "5e5653c1d503e0038407fc15" + } + }, + "is_default": true, + "_id": "5e56598f2bfda9050ccaa8fd", + "application": "000000000000000000000004", + "event": "5e5653c1d503e0038407fc13", + "slug": "verify-otp-event", + "created_at": "2020-02-26T11:42:08.172Z", + "updated_at": "2021-03-03T09:00:47.953Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5e565a10343582051d211d1c" + }, + "email": { + "subscribed": true, + "template": "5e565a10343582051d211d1b" + } + }, + "is_default": true, + "_id": "5e565a16343582051d211d68", + "application": "000000000000000000000004", + "event": "5e565a10343582051d211d1d", + "slug": "cancelled_customer-event", + "created_at": "2020-02-26T11:44:22.246Z", + "updated_at": "2021-03-03T09:00:47.953Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5e565a10343582051d211d1f" + }, + "email": { + "subscribed": true, + "template": "5e565a10343582051d211d1e" + } + }, + "is_default": true, + "_id": "5e565a16343582051d211d6c", + "application": "000000000000000000000004", + "event": "5e565a11343582051d211d20", + "slug": "cancelled_fynd-event", + "created_at": "2020-02-26T11:44:22.314Z", + "updated_at": "2021-03-03T09:00:47.953Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5e565a11343582051d211d22" + }, + "email": { + "subscribed": true, + "template": "5e565a11343582051d211d21" + } + }, + "is_default": true, + "_id": "5e565a16343582051d211d65", + "application": "000000000000000000000004", + "event": "5e565a11343582051d211d23", + "slug": "delivery_done-event", + "created_at": "2020-02-26T11:44:22.246Z", + "updated_at": "2021-03-03T09:00:47.972Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5e565a11343582051d211d25" + }, + "email": { + "subscribed": true, + "template": "5e565a11343582051d211d24" + } + }, + "is_default": true, + "_id": "5e565a16343582051d211d61", + "application": "000000000000000000000004", + "event": "5e565a11343582051d211d26", + "slug": "out_for_delivery-event", + "created_at": "2020-02-26T11:44:22.171Z", + "updated_at": "2021-03-03T09:00:47.972Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5e565a12343582051d211d28" + }, + "email": { + "subscribed": true, + "template": "5e565a11343582051d211d27" + } + }, + "is_default": true, + "_id": "5e565a16343582051d211d62", + "application": "000000000000000000000004", + "event": "5e565a12343582051d211d29", + "slug": "out_for_pickup-event", + "created_at": "2020-02-26T11:44:22.171Z", + "updated_at": "2021-03-03T09:00:47.972Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5e565a12343582051d211d2b" + }, + "email": { + "subscribed": true, + "template": "5e565a12343582051d211d2a" + } + }, + "is_default": true, + "_id": "5e565a16343582051d211d69", + "application": "000000000000000000000004", + "event": "5e565a12343582051d211d2c", + "slug": "placed-event", + "created_at": "2020-02-26T11:44:22.246Z", + "updated_at": "2021-03-03T09:00:47.953Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5e565a12343582051d211d2e" + }, + "email": { + "subscribed": true, + "template": "5e565a12343582051d211d2d" + } + }, + "is_default": true, + "_id": "5e565a16343582051d211d66", + "application": "000000000000000000000004", + "event": "5e565a12343582051d211d2f", + "slug": "refund_completed-event", + "created_at": "2020-02-26T11:44:22.246Z", + "updated_at": "2021-03-03T09:00:48.052Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5e565a13343582051d211d31" + }, + "email": { + "subscribed": true, + "template": "5e565a12343582051d211d30" + } + }, + "is_default": true, + "_id": "5e565a16343582051d211d64", + "application": "000000000000000000000004", + "event": "5e565a13343582051d211d32", + "slug": "refund_initiated-event", + "created_at": "2020-02-26T11:44:22.246Z", + "updated_at": "2021-03-03T09:00:47.972Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5e565a13343582051d211d34" + }, + "email": { + "subscribed": true, + "template": "5e565a13343582051d211d33" + } + }, + "is_default": true, + "_id": "5e565a16343582051d211d6d", + "application": "000000000000000000000004", + "event": "5e565a13343582051d211d35", + "slug": "rejected_by_customer-event", + "created_at": "2020-02-26T11:44:22.314Z", + "updated_at": "2021-03-03T09:00:47.972Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5e565a13343582051d211d37" + }, + "email": { + "subscribed": true, + "template": "5e565a13343582051d211d36" + } + }, + "is_default": true, + "_id": "5e565a16343582051d211d63", + "application": "000000000000000000000004", + "event": "5e565a13343582051d211d38", + "slug": "return_accepted-event", + "created_at": "2020-02-26T11:44:22.178Z", + "updated_at": "2021-03-03T09:00:48.052Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5e565a14343582051d211d3a" + }, + "email": { + "subscribed": true, + "template": "5e565a13343582051d211d39" + } + }, + "is_default": true, + "_id": "5e565a16343582051d211d6a", + "application": "000000000000000000000004", + "event": "5e565a14343582051d211d3b", + "slug": "return_bag_picked_by_dp-event", + "created_at": "2020-02-26T11:44:22.246Z", + "updated_at": "2021-03-03T09:00:48.052Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5e565a14343582051d211d3d" + }, + "email": { + "subscribed": true, + "template": "5e565a14343582051d211d3c" + } + }, + "is_default": true, + "_id": "5e565a16343582051d211d67", + "application": "000000000000000000000004", + "event": "5e565a14343582051d211d3e", + "slug": "return_initiated-event", + "created_at": "2020-02-26T11:44:22.246Z", + "updated_at": "2021-03-03T09:00:48.052Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5e565a14343582051d211d40" + }, + "email": { + "subscribed": true, + "template": "5e565a14343582051d211d3f" + } + }, + "is_default": true, + "_id": "5e565a16343582051d211d6b", + "application": "000000000000000000000004", + "event": "5e565a14343582051d211d41", + "slug": "return_not_accepted-event", + "created_at": "2020-02-26T11:44:22.314Z", + "updated_at": "2021-03-03T09:00:48.052Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5e565a15343582051d211d43" + }, + "email": { + "subscribed": true, + "template": "5e565a15343582051d211d42" + } + }, + "is_default": true, + "_id": "5e565a16343582051d211d6e", + "application": "000000000000000000000004", + "event": "5e565a15343582051d211d44", + "slug": "return_request_cancelled-event", + "created_at": "2020-02-26T11:44:22.314Z", + "updated_at": "2021-03-03T09:00:48.052Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5e6a4b6d610dbf44166e74ba" + }, + "email": { + "subscribed": true, + "template": null + } + }, + "is_default": true, + "_id": "5e6a4b6e610dbf6b2a6e74c4", + "application": "000000000000000000000004", + "event": "5e6a4b6d610dbf3b146e74bb", + "slug": "handed_over_to_customer-event", + "created_at": "2020-03-12T14:47:10.453Z", + "updated_at": "2021-03-03T09:00:48.141Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5e6a4b6d610dbf01326e74b6" + }, + "email": { + "subscribed": true, + "template": null + } + }, + "is_default": true, + "_id": "5e6a4b6e610dbf907e6e74c2", + "application": "000000000000000000000004", + "event": "5e6a4b6d610dbf454e6e74b7", + "slug": "arrived_at_store-event", + "created_at": "2020-03-12T14:47:10.453Z", + "updated_at": "2021-03-03T09:00:48.052Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5e6a4b6d610dbf69b16e74b8" + }, + "email": { + "subscribed": true, + "template": null + } + }, + "is_default": true, + "_id": "5e6a4b6e610dbf28086e74c3", + "application": "000000000000000000000004", + "event": "5e6a4b6d610dbf91c76e74b9", + "slug": "bag_packed-event", + "created_at": "2020-03-12T14:47:10.453Z", + "updated_at": "2021-03-03T09:00:48.052Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": null + }, + "email": { + "subscribed": true, + "template": "5ed72116ccc0c408fbb5a404" + } + }, + "is_default": true, + "_id": "5ed72117ccc0c48f29b5a408", + "application": "000000000000000000000004", + "event": "5ed72116ccc0c4e240b5a405", + "slug": "order-review-reminder-event", + "created_at": "2020-06-03T04:03:35.394Z", + "updated_at": "2021-03-03T09:00:48.052Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5f633b15b490eaf13f494bf4" + }, + "email": { + "subscribed": true, + "template": null + } + }, + "is_default": true, + "_id": "5f633b16b490ea31eb494bfd", + "application": "000000000000000000000004", + "event": "5f633b15b490ea3c9b494bf5", + "slug": "referral-code-applied-to-referrer", + "created_at": "2020-09-17T10:31:50.204Z", + "updated_at": "2021-03-03T09:00:48.141Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5f633b15b490ea465b494bf2" + }, + "email": { + "subscribed": true, + "template": null + } + }, + "is_default": true, + "_id": "5f633b16b490eada59494bfc", + "application": "000000000000000000000004", + "event": "5f633b15b490ea40dd494bf3", + "slug": "referral-code-applied-to-referred-friend", + "created_at": "2020-09-17T10:31:50.204Z", + "updated_at": "2021-03-03T09:00:48.141Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5fe2e7da09c5fc047172e830" + }, + "email": { + "subscribed": true, + "template": null + } + }, + "is_default": true, + "_id": "5fe2e7dc09c5fc657372e841", + "application": "000000000000000000000004", + "event": "5fe2e7da09c5fc3da372e831", + "slug": "return_dp_out_for_pickup-event", + "created_at": "2020-12-23T06:46:52.214Z", + "updated_at": "2021-03-03T09:00:48.141Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5fe2e7da09c5fcef0a72e82b" + }, + "email": { + "subscribed": true, + "template": "5ff841fd864df30915c416e9" + } + }, + "is_default": true, + "_id": "600951fb0e9745637d2e5081", + "application": "000000000000000000000004", + "event": "5fe2e7da09c5fc524f72e82c", + "slug": "delivery_attempt_failed-event", + "created_at": "2021-01-21T10:05:47.315Z", + "updated_at": "2021-03-03T09:00:48.141Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5fe2e7da09c5fc6c5272e82e" + }, + "email": { + "subscribed": true, + "template": "5fe2e7da09c5fc7fee72e82d" + } + }, + "is_default": true, + "_id": "5fe2e7dc09c5fc10fe72e840", + "application": "000000000000000000000004", + "event": "5fe2e7da09c5fc611c72e82f", + "slug": "return_bag_picked-event", + "created_at": "2020-12-23T06:46:52.214Z", + "updated_at": "2021-03-03T09:00:48.141Z", + "__v": 0 + }, + { + "template": { + "sms": { + "subscribed": true, + "template": "5fe2e7da09c5fc4cde72e829" + }, + "email": { + "subscribed": true, + "template": null + } + }, + "is_default": true, + "_id": "5fe2e7dc09c5fcf4fc72e83e", + "application": "000000000000000000000004", + "event": "5fe2e7da09c5fc72d272e82a", + "slug": "bag_picked-event", + "created_at": "2020-12-23T06:46:52.214Z", + "updated_at": "2021-03-03T09:00:48.141Z", + "__v": 0 + } + ], + "page": { + "type": "number", + "current": 1, + "size": 200, + "item_total": 28, + "has_next": false + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getJobs +Get jobs + + + + +```swift +client.application("").communication.getJobs(pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Current page no | +| pageSize | Int? | no | Current request items count | +| sort | [String: Any]? | no | To sort based on created_at | + + + +Get jobs + +*Returned Response:* + + + + +[Jobs](#Jobs) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "completed": true, + "is_active": false, + "_id": "6044be260c92a7be0624f1cf", + "campaign": "6044be1e0c92a7026924f1ce", + "application": "000000000000000000000001", + "created_at": "2021-03-07T11:51:02.234Z", + "updated_at": "2021-03-07T12:12:36.587Z", + "__v": 0 + } + ], + "page": { + "type": "number", + "current": 1, + "size": 50, + "item_total": 1, + "has_next": false + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### triggerCampaignJob +Trigger campaign job + + + + +```swift +client.application("").communication.triggerCampaignJob(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | TriggerJobRequest | yes | Request body | + + +Trigger campaign job + +*Returned Response:* + + + + +[TriggerJobResponse](#TriggerJobResponse) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "status": 200 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getJobLogs +Get job logs + + + + +```swift +client.application("").communication.getJobLogs(pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Current page no | +| pageSize | Int? | no | Current request items count | +| sort | [String: Any]? | no | To sort based on created_at | + + + +Get job logs + +*Returned Response:* + + + + +[JobLogs](#JobLogs) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "imported": { + "count": 61135 + }, + "processed": { + "email": { + "success": 0, + "failed": 0, + "suppressed": 0 + }, + "sms": { + "success": 61313, + "failed": 85, + "suppressed": 87 + } + }, + "_id": "6044be30bc5f4b79aae7b29f", + "job": "6044be260c92a7be0624f1cf", + "campaign": "6044be1e0c92a7026924f1ce", + "created_at": "2021-03-07T11:51:12.778Z", + "updated_at": "2021-03-07T12:14:11.475Z", + "__v": 0 + } + ], + "page": { + "type": "number", + "current": 1, + "size": 50, + "item_total": 1, + "has_next": false + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getCommunicationLogs +Get communication logs + + + + +```swift +client.application("").communication.getCommunicationLogs(pageId: pageId, pageSize: pageSize, sort: sort, query: query) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageId | String? | no | Current page no | +| pageSize | Int? | no | Current request items count | +| sort | [String: Any]? | no | To sort based on _id | +| query | [String: Any]? | no | | + + + +Get communication logs + +*Returned Response:* + + + + +[Logs](#Logs) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "sms": { + "phone_number": "1234567890", + "country_code": "+91", + "template": "603e00649014219f87943213", + "provider": "5f8ee2234d70f7c5624f0413" + }, + "pushnotification": { + "pushtokens": [] + }, + "meta": { + "type": "job", + "job": "603e021f171b19ee5a4324f4", + "campaign": "603e0217171b19556e4324f3", + "identifier": "pointblank.00395d65-c0a9-f9dc-0c46-5d65c0aa0c46" + }, + "_id": "603e02300b9f817e1592fcbd", + "application": "000000000000000000000004", + "service": "sms-consumer", + "step": "MSG_SENT", + "status": "success", + "pod": "fynd-core-pointblank-smslow-cnsmr-dply-d6dbf9d7f-b6h2f", + "expire_at": "2021-04-01T09:15:28.526Z", + "created_at": "2021-03-02T09:15:28.527Z" + } + ], + "page": { + "type": "cursor", + "next_id": null, + "has_previous": false, + "has_next": false + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getSystemNotifications +Get system notifications + + + + +```swift +client.communication.getSystemNotifications(pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | | +| pageSize | Int? | no | | + + + +Get system notifications + +*Returned Response:* + + + + +[SystemNotifications](#SystemNotifications) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "notification": { + "title": "Xyz Company is verified!", + "body": "", + "subtitle": "", + "icon": "icon.png", + "deeplink": "", + "click_action": "" + }, + "user": { + "type": "company", + "value": "1" + }, + "settings": { + "sound": true, + "priority": "normal", + "time_to_live": "60" + }, + "_id": "60619f167dbd13ff0722f6dd", + "group": "fynd-platform", + "created_at": "2021-03-29T09:34:14.182Z" + } + ], + "last_read_anchor": 1616748860, + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 1, + "has_next": false + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getSmsProviders +Get sms providers + + + + +```swift +client.application("").communication.getSmsProviders(pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Current page no | +| pageSize | Int? | no | Current request items count | +| sort | [String: Any]? | no | To sort based on created_at | + + + +Get sms providers + +*Returned Response:* + + + + +[SmsProviders](#SmsProviders) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "rpt": 1, + "type": "application", + "provider": "telspiel", + "_id": "5fd9fd07c474a7710dd376d5", + "name": "test telspiel", + "description": "test", + "sender": "test", + "username": "test", + "authkey": "test", + "application": "000000000000000000000004", + "created_at": "2020-12-16T12:26:47.794Z", + "updated_at": "2020-12-16T12:26:47.794Z", + "slug": "test-telspiel-application-telspiel-p9UY1r7nG", + "__v": 0 + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 1, + "has_next": false + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createSmsProvider +Create sms provider + + + + +```swift +client.application("").communication.createSmsProvider(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | SmsProviderReq | yes | Request body | + + +Create sms provider + +*Returned Response:* + + + + +[SmsProvider](#SmsProvider) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "rpt": 1, + "type": "application", + "provider": "telspiel", + "_id": "5fd9fd07c474a7710dd376d5", + "name": "test telspiel", + "description": "test", + "sender": "test", + "username": "test", + "authkey": "test", + "application": "000000000000000000000004", + "created_at": "2020-12-16T12:26:47.794Z", + "updated_at": "2020-12-16T12:26:47.794Z", + "slug": "test-telspiel-application-telspiel-p9UY1r7nG", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getSmsProviderById +Get sms provider by id + + + + +```swift +client.application("").communication.getSmsProviderById(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Sms provider id | + + + +Get sms provider by id + +*Returned Response:* + + + + +[SmsProvider](#SmsProvider) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "rpt": 1, + "type": "application", + "provider": "telspiel", + "_id": "5fd9fd07c474a7710dd376d5", + "name": "test telspiel", + "description": "test", + "sender": "test", + "username": "test", + "authkey": "test", + "application": "000000000000000000000004", + "created_at": "2020-12-16T12:26:47.794Z", + "updated_at": "2020-12-16T12:26:47.794Z", + "slug": "test-telspiel-application-telspiel-p9UY1r7nG", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateSmsProviderById +Update sms provider by id + + + + +```swift +client.application("").communication.updateSmsProviderById(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Sms provider id | +| body | SmsProviderReq | yes | Request body | + + +Update sms provider by id + +*Returned Response:* + + + + +[SmsProvider](#SmsProvider) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "rpt": 1, + "type": "application", + "provider": "telspiel", + "_id": "5fd9fd07c474a7710dd376d5", + "name": "test telspiel", + "description": "test", + "sender": "test", + "username": "test", + "authkey": "test", + "application": "000000000000000000000004", + "created_at": "2020-12-16T12:26:47.794Z", + "updated_at": "2020-12-16T12:26:47.794Z", + "slug": "test-telspiel-application-telspiel-p9UY1r7nG", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getSmsTemplates +Get sms templates + + + + +```swift +client.application("").communication.getSmsTemplates(pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Current page no | +| pageSize | Int? | no | Current request items count | +| sort | [String: Any]? | no | To sort based on created_at | + + + +Get sms templates + +*Returned Response:* + + + + +[SmsTemplates](#SmsTemplates) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "is_system": false, + "is_internal": true, + "description": "This is a test sms template", + "priority": "high", + "tags": [], + "published": true, + "_id": "5fd447728394dbf0d21329b3", + "slug": "test-sms", + "name": "Test sms", + "message": { + "template_type": "nunjucks", + "template": "This is a test sms for order - {{ orderId }}" + }, + "template_variables": { + "orderId": "12345" + }, + "created_at": "2020-12-12T04:30:42.456Z", + "updated_at": "2020-12-24T15:13:20.558Z", + "__v": 0 + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 66, + "has_next": true + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createSmsTemplate +Create sms template + + + + +```swift +client.application("").communication.createSmsTemplate(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | SmsTemplateReq | yes | Request body | + + +Create sms template + +*Returned Response:* + + + + +[SmsTemplateRes](#SmsTemplateRes) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "is_system": false, + "is_internal": true, + "description": "This is a test sms template", + "priority": "high", + "tags": [], + "published": true, + "_id": "5fd447728394dbf0d21329b3", + "slug": "test-sms", + "name": "Test sms", + "message": { + "template_type": "nunjucks", + "template": "This is a test sms for order - {{ orderId }}" + }, + "template_variables": { + "orderId": "12345" + }, + "created_at": "2020-12-12T04:30:42.456Z", + "updated_at": "2020-12-24T15:13:20.558Z", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getSmsTemplateById +Get sms template by id + + + + +```swift +client.application("").communication.getSmsTemplateById(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Sms template id | + + + +Get sms template by id + +*Returned Response:* + + + + +[SmsTemplate](#SmsTemplate) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "is_system": false, + "is_internal": true, + "description": "This is a test sms template", + "priority": "high", + "tags": [], + "published": true, + "_id": "5fd447728394dbf0d21329b3", + "slug": "test-sms", + "name": "Test sms", + "message": { + "template_type": "nunjucks", + "template": "This is a test sms for order - {{ orderId }}" + }, + "template_variables": { + "orderId": "12345" + }, + "created_at": "2020-12-12T04:30:42.456Z", + "updated_at": "2020-12-24T15:13:20.558Z", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateSmsTemplateById +Update sms template by id + + + + +```swift +client.application("").communication.updateSmsTemplateById(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Sms template id | +| body | SmsTemplateReq | yes | Request body | + + +Update sms template by id + +*Returned Response:* + + + + +[SmsTemplateRes](#SmsTemplateRes) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "is_system": false, + "is_internal": true, + "description": "This is a test sms template", + "priority": "high", + "tags": [], + "published": true, + "_id": "5fd447728394dbf0d21329b3", + "slug": "test-sms", + "name": "Test sms", + "message": { + "template_type": "nunjucks", + "template": "This is a test sms for order - {{ orderId }}" + }, + "template_variables": { + "orderId": "12345" + }, + "created_at": "2020-12-12T04:30:42.456Z", + "updated_at": "2020-12-24T15:13:20.558Z", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### deleteSmsTemplateById +Delete sms template by id + + + + +```swift +client.application("").communication.deleteSmsTemplateById(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Sms template id | + + + +Delete sms template by id + +*Returned Response:* + + + + +[SmsTemplateDeleteSuccessRes](#SmsTemplateDeleteSuccessRes) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "success": true, + "message": "Deleted successfully" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getSystemSystemTemplates +Get system sms templates + + + + +```swift +client.application("").communication.getSystemSystemTemplates(pageNo: pageNo, pageSize: pageSize, sort: sort) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Current page no | +| pageSize | Int? | no | Current request items count | +| sort | [String: Any]? | no | To sort based on created_at | + + + +Get system sms templates + +*Returned Response:* + + + + +[SystemSmsTemplates](#SystemSmsTemplates) + +Success + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "is_system": true, + "is_internal": true, + "description": "This is a test sms template", + "priority": "high", + "tags": [], + "published": true, + "_id": "5fd447728394dbf0d21329b3", + "slug": "test-sms", + "name": "Test sms", + "message": { + "template_type": "nunjucks", + "template": "This is a test sms for order - {{ orderId }}" + }, + "template_variables": { + "orderId": "12345" + }, + "created_at": "2020-12-12T04:30:42.456Z", + "updated_at": "2020-12-24T15:13:20.558Z", + "__v": 0 + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 66, + "has_next": true + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [StatsImported](#StatsImported) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | count | Int? | yes | | + +--- + + + + + #### [StatsProcessedEmail](#StatsProcessedEmail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Int? | yes | | + | failed | Int? | yes | | + | suppressed | Int? | yes | | + +--- + + + + + #### [StatsProcessedSms](#StatsProcessedSms) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Int? | yes | | + | failed | Int? | yes | | + | suppressed | Int? | yes | | + +--- + + + + + #### [StatsProcessed](#StatsProcessed) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | [StatsProcessedEmail](#StatsProcessedEmail)? | yes | | + | sms | [StatsProcessedSms](#StatsProcessedSms)? | yes | | + +--- + + + + + #### [Stats](#Stats) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | imported | [String: Any]? | yes | | + | processed | [String: Any]? | yes | | + +--- + + + + + #### [GetStats](#GetStats) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Stats](#Stats)]? | yes | | + +--- + + + + + #### [CampaignReq](#CampaignReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String? | yes | | + | tags | [String]? | yes | | + | headers | [String]? | yes | | + | isActive | Bool? | yes | | + | name | String? | yes | | + | fileUrl | String? | yes | | + | type | String? | yes | | + | recordsCount | Int? | yes | | + | application | String? | yes | | + +--- + + + + + #### [RecipientHeaders](#RecipientHeaders) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + +--- + + + + + #### [CampaignEmailTemplate](#CampaignEmailTemplate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [CampignEmailProvider](#CampignEmailProvider) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | fromName | String? | yes | | + | fromEmail | String? | yes | | + +--- + + + + + #### [CampaignEmail](#CampaignEmail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | template | [CampaignEmailTemplate](#CampaignEmailTemplate)? | yes | | + | provider | [CampignEmailProvider](#CampignEmailProvider)? | yes | | + +--- + + + + + #### [Campaign](#Campaign) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | recipientHeaders | [RecipientHeaders](#RecipientHeaders)? | yes | | + | email | [CampaignEmail](#CampaignEmail)? | yes | | + | description | String? | yes | | + | tags | [[String: Any]]? | yes | | + | isActive | Bool? | yes | | + | id | String? | yes | | + | datasource | String? | yes | | + | type | String? | yes | | + | name | String? | yes | | + | application | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | slug | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [Campaigns](#Campaigns) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Campaign](#Campaign)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [BigqueryHeadersReq](#BigqueryHeadersReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | query | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [BigqueryHeadersResHeaders](#BigqueryHeadersResHeaders) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [BigqueryHeadersRes](#BigqueryHeadersRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | headers | [[BigqueryHeadersResHeaders](#BigqueryHeadersResHeaders)]? | yes | | + +--- + + + + + #### [GetNRecordsCsvReq](#GetNRecordsCsvReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | url | String? | yes | | + | header | Bool? | yes | | + | count | Int? | yes | | + +--- + + + + + #### [GetNRecordsCsvResItems](#GetNRecordsCsvResItems) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | phoneNumber | String? | yes | | + | email | String? | yes | | + | firstname | String? | yes | | + | lastname | String? | yes | | + | orderid | String? | yes | | + +--- + + + + + #### [GetNRecordsCsvRes](#GetNRecordsCsvRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[GetNRecordsCsvResItems](#GetNRecordsCsvResItems)]? | yes | | + +--- + + + + + #### [AudienceReq](#AudienceReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String? | yes | | + | tags | [String]? | yes | | + | headers | [String]? | yes | | + | isActive | Bool? | yes | | + | name | String? | yes | | + | fileUrl | String? | yes | | + | type | String? | yes | | + | recordsCount | Int? | yes | | + | application | String? | yes | | + +--- + + + + + #### [Audience](#Audience) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String? | yes | | + | tags | [String]? | yes | | + | headers | [String]? | yes | | + | isActive | Bool? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | fileUrl | String? | yes | | + | type | String? | yes | | + | recordsCount | Int? | yes | | + | application | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | slug | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [Audiences](#Audiences) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Audience](#Audience)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [EmailProviderReqFrom](#EmailProviderReqFrom) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | email | String? | yes | | + | isDefault | Bool? | yes | | + +--- + + + + + #### [EmailProviderReq](#EmailProviderReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | description | String? | yes | | + | apiKey | String? | yes | | + | type | String? | yes | | + | provider | String? | yes | | + | fromAddress | [[EmailProviderReqFrom](#EmailProviderReqFrom)]? | yes | | + +--- + + + + + #### [EmailProvider](#EmailProvider) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | provider | String? | yes | | + | fromAddress | [[EmailProviderReqFrom](#EmailProviderReqFrom)]? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | description | String? | yes | | + | apiKey | String? | yes | | + | application | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | slug | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [EmailProviders](#EmailProviders) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[EmailProvider](#EmailProvider)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [EmailTemplateDeleteSuccessRes](#EmailTemplateDeleteSuccessRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | | + | message | String? | yes | | + +--- + + + + + #### [EmailTemplateDeleteFailureRes](#EmailTemplateDeleteFailureRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | | + | message | String? | yes | | + +--- + + + + + #### [EmailTemplateKeys](#EmailTemplateKeys) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | to | String? | yes | | + | cc | String? | yes | | + | bcc | String? | yes | | + +--- + + + + + #### [EmailTemplateHeaders](#EmailTemplateHeaders) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [EmailTemplateReq](#EmailTemplateReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | description | String? | yes | | + | keys | [EmailTemplateKeys](#EmailTemplateKeys)? | yes | | + | staticTo | [String]? | yes | | + | staticCc | [String]? | yes | | + | staticBcc | [String]? | yes | | + | replyTo | String? | yes | | + | headers | [[EmailTemplateHeaders](#EmailTemplateHeaders)]? | yes | | + | subject | [TemplateAndType](#TemplateAndType)? | yes | | + | html | [TemplateAndType](#TemplateAndType)? | yes | | + | text | [TemplateAndType](#TemplateAndType)? | yes | | + | attachments | [[String: Any]]? | yes | | + | priority | String? | yes | | + +--- + + + + + #### [TemplateAndType](#TemplateAndType) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | templateType | String? | yes | | + | template | String? | yes | | + +--- + + + + + #### [EmailTemplateRes](#EmailTemplateRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isSystem | Bool? | yes | | + | isInternal | Bool? | yes | | + | description | String? | yes | | + | staticTo | [String]? | yes | | + | staticCc | [String]? | yes | | + | staticBcc | [String]? | yes | | + | tags | [[String: Any]]? | yes | | + | priority | String? | yes | | + | published | Bool? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | keys | [EmailTemplateKeys](#EmailTemplateKeys)? | yes | | + | replyTo | String? | yes | | + | headers | [[EmailTemplateHeaders](#EmailTemplateHeaders)]? | yes | | + | subject | [TemplateAndType](#TemplateAndType)? | yes | | + | html | [TemplateAndType](#TemplateAndType)? | yes | | + | text | [TemplateAndType](#TemplateAndType)? | yes | | + | attachments | [[String: Any]]? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | slug | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [EmailTemplate](#EmailTemplate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isSystem | Bool? | yes | | + | isInternal | Bool? | yes | | + | description | String? | yes | | + | staticTo | [[String: Any]]? | yes | | + | staticCc | [[String: Any]]? | yes | | + | staticBcc | [[String: Any]]? | yes | | + | tags | [[String: Any]]? | yes | | + | priority | String? | yes | | + | published | Bool? | yes | | + | id | String? | yes | | + | slug | String? | yes | | + | name | String? | yes | | + | fromName | String? | yes | | + | subject | [TemplateAndType](#TemplateAndType)? | yes | | + | html | [TemplateAndType](#TemplateAndType)? | yes | | + | text | [TemplateAndType](#TemplateAndType)? | yes | | + | headers | [[String: Any]]? | yes | | + | attachments | [[String: Any]]? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [SystemEmailTemplate](#SystemEmailTemplate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isSystem | Bool? | yes | | + | isInternal | Bool? | yes | | + | description | String? | yes | | + | staticTo | [[String: Any]]? | yes | | + | staticCc | [[String: Any]]? | yes | | + | staticBcc | [[String: Any]]? | yes | | + | tags | [[String: Any]]? | yes | | + | priority | String? | yes | | + | published | Bool? | yes | | + | id | String? | yes | | + | slug | String? | yes | | + | name | String? | yes | | + | fromName | String? | yes | | + | subject | [TemplateAndType](#TemplateAndType)? | yes | | + | html | [TemplateAndType](#TemplateAndType)? | yes | | + | text | [TemplateAndType](#TemplateAndType)? | yes | | + | headers | [[String: Any]]? | yes | | + | attachments | [[String: Any]]? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [EmailTemplates](#EmailTemplates) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[EmailTemplate](#EmailTemplate)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [SystemEmailTemplates](#SystemEmailTemplates) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[SystemEmailTemplate](#SystemEmailTemplate)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [PayloadEmailTemplateStructure](#PayloadEmailTemplateStructure) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [PayloadEmailProviderStructure](#PayloadEmailProviderStructure) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + +--- + + + + + #### [PayloadEmailStructure](#PayloadEmailStructure) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | template | [PayloadEmailTemplateStructure](#PayloadEmailTemplateStructure)? | yes | | + | provider | [PayloadEmailProviderStructure](#PayloadEmailProviderStructure)? | yes | | + +--- + + + + + #### [PayloadSmsTemplateStructure](#PayloadSmsTemplateStructure) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [PayloadSmsProviderStructure](#PayloadSmsProviderStructure) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + +--- + + + + + #### [PayloadSmsStructure](#PayloadSmsStructure) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | template | [PayloadSmsTemplateStructure](#PayloadSmsTemplateStructure)? | yes | | + | provider | [PayloadSmsProviderStructure](#PayloadSmsProviderStructure)? | yes | | + +--- + + + + + #### [PayloadStructure](#PayloadStructure) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [[String: Any]]? | yes | | + | email | [PayloadEmailStructure](#PayloadEmailStructure)? | yes | | + | sms | [PayloadSmsStructure](#PayloadSmsStructure)? | yes | | + | application | String? | yes | | + +--- + + + + + #### [MetaStructure](#MetaStructure) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | jobType | String? | yes | | + | action | String? | yes | | + | trace | String? | yes | | + | timestamp | String? | yes | | + +--- + + + + + #### [EngineRequest](#EngineRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | payload | [PayloadStructure](#PayloadStructure)? | yes | | + | meta | [MetaStructure](#MetaStructure)? | yes | | + +--- + + + + + #### [EngineResponse](#EngineResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | | + +--- + + + + + #### [EventSubscriptionTemplateSms](#EventSubscriptionTemplateSms) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | subscribed | Bool? | yes | | + | template | String? | yes | | + +--- + + + + + #### [EventSubscriptionTemplateEmail](#EventSubscriptionTemplateEmail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | subscribed | Bool? | yes | | + | template | String? | yes | | + +--- + + + + + #### [EventSubscriptionTemplate](#EventSubscriptionTemplate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | sms | [EventSubscriptionTemplateSms](#EventSubscriptionTemplateSms)? | yes | | + | email | [EventSubscriptionTemplateEmail](#EventSubscriptionTemplateEmail)? | yes | | + +--- + + + + + #### [EventSubscription](#EventSubscription) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | template | [EventSubscriptionTemplate](#EventSubscriptionTemplate)? | yes | | + | isDefault | Bool? | yes | | + | id | String? | yes | | + | application | String? | yes | | + | event | String? | yes | | + | slug | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [EventSubscriptions](#EventSubscriptions) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[EventSubscription](#EventSubscription)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [TriggerJobResponse](#TriggerJobResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | status | Int? | yes | | + +--- + + + + + #### [TriggerJobRequest](#TriggerJobRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | jobId | String? | yes | | + +--- + + + + + #### [Job](#Job) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | completed | Bool? | yes | | + | isActive | Bool? | yes | | + | id | String? | yes | | + | campaign | String? | yes | | + | application | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [Jobs](#Jobs) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Job](#Job)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [JobLog](#JobLog) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | imported | [String: Any]? | yes | | + | processed | [String: Any]? | yes | | + | id | String? | yes | | + | job | String? | yes | | + | campaign | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [JobLogs](#JobLogs) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[JobLog](#JobLog)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [LogEmail](#LogEmail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | template | String? | yes | | + +--- + + + + + #### [LogPushnotification](#LogPushnotification) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pushtokens | [String]? | yes | | + +--- + + + + + #### [LogMeta](#LogMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | identifier | String? | yes | | + | key | String? | yes | | + | offset | String? | yes | | + | partition | String? | yes | | + | topic | String? | yes | | + +--- + + + + + #### [Log](#Log) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | [LogEmail](#LogEmail)? | yes | | + | pushnotification | [LogPushnotification](#LogPushnotification)? | yes | | + | meta | [LogMeta](#LogMeta)? | yes | | + | id | String? | yes | | + | application | String? | yes | | + | service | String? | yes | | + | step | String? | yes | | + | status | String? | yes | | + | data | [String: Any]? | yes | | + | expireAt | String? | yes | | + | createdAt | String? | yes | | + +--- + + + + + #### [Logs](#Logs) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Log](#Log)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [PushtokenReq](#PushtokenReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | action | String? | yes | | + | bundleIdentifier | String? | yes | | + | pushToken | String? | yes | | + | uniqueDeviceId | String? | yes | | + +--- + + + + + #### [PushtokenRes](#PushtokenRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | bundleIdentifier | String? | yes | | + | pushToken | String? | yes | | + | uniqueDeviceId | String? | yes | | + | type | String? | yes | | + | platform | String? | yes | | + | applicationId | String? | yes | | + | userId | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | expiredAt | String? | yes | | + +--- + + + + + #### [SmsProviderReq](#SmsProviderReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | description | String? | yes | | + | sender | String? | yes | | + | username | String? | yes | | + | authkey | String? | yes | | + | type | String? | yes | | + | provider | String? | yes | | + +--- + + + + + #### [SmsProvider](#SmsProvider) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | rpt | Int? | yes | | + | type | String? | yes | | + | provider | String? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | description | String? | yes | | + | sender | String? | yes | | + | username | String? | yes | | + | authkey | String? | yes | | + | application | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | slug | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [SmsProviders](#SmsProviders) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[SmsProvider](#SmsProvider)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [SmsTemplateDeleteSuccessRes](#SmsTemplateDeleteSuccessRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | | + | message | String? | yes | | + +--- + + + + + #### [SmsTemplateDeleteFailureRes](#SmsTemplateDeleteFailureRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | | + | message | String? | yes | | + +--- + + + + + #### [SmsTemplateMessage](#SmsTemplateMessage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | templateType | String? | yes | | + | template | String? | yes | | + +--- + + + + + #### [SmsTemplateReq](#SmsTemplateReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | description | String? | yes | | + | message | [SmsTemplateMessage](#SmsTemplateMessage)? | yes | | + | templateVariables | [String: Any]? | yes | | + | attachments | [[String: Any]]? | yes | | + | priority | String? | yes | | + +--- + + + + + #### [SmsTemplateRes](#SmsTemplateRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isSystem | Bool? | yes | | + | isInternal | Bool? | yes | | + | description | String? | yes | | + | tags | [[String: Any]]? | yes | | + | priority | String? | yes | | + | published | Bool? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | message | [SmsTemplateMessage](#SmsTemplateMessage)? | yes | | + | templateVariables | [String: Any]? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | slug | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [SmsTemplate](#SmsTemplate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isSystem | Bool? | yes | | + | isInternal | Bool? | yes | | + | description | String? | yes | | + | priority | String? | yes | | + | tags | [[String: Any]]? | yes | | + | published | Bool? | yes | | + | id | String? | yes | | + | slug | String? | yes | | + | name | String? | yes | | + | message | [SmsTemplateMessage](#SmsTemplateMessage)? | yes | | + | templateVariables | [String: Any]? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [SystemSmsTemplate](#SystemSmsTemplate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isSystem | Bool? | yes | | + | isInternal | Bool? | yes | | + | description | String? | yes | | + | tags | [[String: Any]]? | yes | | + | priority | String? | yes | | + | published | Bool? | yes | | + | id | String? | yes | | + | slug | String? | yes | | + | name | String? | yes | | + | message | [SmsTemplateMessage](#SmsTemplateMessage)? | yes | | + | templateVariables | [String: Any]? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [SmsTemplates](#SmsTemplates) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[SmsTemplate](#SmsTemplate)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [SystemSmsTemplates](#SystemSmsTemplates) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[SystemSmsTemplate](#SystemSmsTemplate)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [Notification](#Notification) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | body | String? | yes | | + | subtitle | String? | yes | | + | icon | String? | yes | | + | deeplink | String? | yes | | + | clickAction | String? | yes | | + +--- + + + + + #### [SystemNotificationUser](#SystemNotificationUser) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [SystemNotificationSettings](#SystemNotificationSettings) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | sound | Bool? | yes | | + | priority | String? | yes | | + | timeToLive | String? | yes | | + +--- + + + + + #### [SystemNotification](#SystemNotification) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | notification | [Notification](#Notification)? | yes | | + | user | [SystemNotificationUser](#SystemNotificationUser)? | yes | | + | settings | [SystemNotificationUser](#SystemNotificationUser)? | yes | | + | id | String? | yes | | + | group | String? | yes | | + | createdAt | String? | yes | | + +--- + + + + + #### [SystemNotificationsPage](#SystemNotificationsPage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | current | Int? | yes | | + | size | Int? | yes | | + | itemTotal | Int? | yes | | + | hasNext | Bool? | yes | | + +--- + + + + + #### [SystemNotifications](#SystemNotifications) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[SystemNotification](#SystemNotification)]? | yes | | + | lastReadAnchor | Int? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String | no | | + | size | Int? | yes | | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + +--- + + + diff --git a/documentation/platform/COMPANYPROFILE.md b/documentation/platform/COMPANYPROFILE.md new file mode 100644 index 0000000000..c96240190e --- /dev/null +++ b/documentation/platform/COMPANYPROFILE.md @@ -0,0 +1,1916 @@ + + + + +##### [Back to Platform docs](./README.md) + +## CompanyProfile Methods +Company Profile API's allows you to access list of products, prices, seller details, similar features, variants and many more useful features. +* [updateCompany](#updatecompany) +* [cbsOnboardGet](#cbsonboardget) +* [getCompanyMetrics](#getcompanymetrics) +* [editBrand](#editbrand) +* [getBrand](#getbrand) +* [createBrand](#createbrand) +* [createCompanyBrandMapping](#createcompanybrandmapping) +* [getBrands](#getbrands) +* [createLocation](#createlocation) +* [getLocations](#getlocations) +* [updateLocation](#updatelocation) +* [getLocationDetail](#getlocationdetail) +* [createLocationBulk](#createlocationbulk) + + + +## Methods with example and description + + +#### updateCompany +Edit company profile + + + + +```swift +client.companyprofile.updateCompany(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | UpdateCompany | yes | Request body | + + +This API allows to edit the company profile of the seller account. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success message + + + + +
    +  Example: + +```json +{ + "uid": 1, + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### cbsOnboardGet +Get company profile + + + + +```swift +client.companyprofile.cbsOnboardGet() { (response, error) in + // Use response +} +``` + + + + + + +This API allows to view the company profile of the seller account. + +*Returned Response:* + + + + +[GetCompanyProfileSerializerResponse](#GetCompanyProfileSerializerResponse) + +Company profile object. See example below or refer `GetCompanyProfileSerializerResponse` for details + + + + +
    +  Example: + +```json +{ + "documents": [ + { + "verified": true, + "legal_name": "SHOPSENSE RETAIL TECHNOLOGIES PRIVATE LIMITED", + "value": "AALCA0442L", + "type": "pan" + } + ], + "created_by": { + "user_id": "123", + "username": "917827311650_22960" + }, + "business_info": "I sell", + "franchise_enabled": true, + "company_type": "mbo", + "warnings": {}, + "business_details": { + "website": { + "url": "https://www.google.com" + } + }, + "addresses": [ + { + "country": "India", + "longitude": 72.8231511, + "state": "Maharashtra", + "address1": "A/204, Sai Vandan, Tulinj Road. Nallasopara East, ", + "country_code": "IN", + "latitude": 19.4232024, + "pincode": 401209, + "address_type": "office", + "city": "Mumbai" + }, + { + "country": "India", + "longitude": 72.8231511, + "state": "Maharashtra", + "address1": "A/204, Sai Vandan, Tulinj Road. Nallasopara East, ", + "country_code": "IN", + "latitude": 19.4232024, + "pincode": 401209, + "address_type": "registered", + "city": "Mumbai" + } + ], + "modified_by": { + "user_id": "123", + "username": "917827311650_22960" + }, + "notification_emails": [ + "gaurangpatel@gofynd.com" + ], + "business_type": "huf", + "name": "Cache Company", + "stage": "verified", + "uid": 1, + "business_country_info": { + "country": "India", + "country_code": "IN" + } +} +``` +
    + + + + + + + + + +--- + + +#### getCompanyMetrics +Get company metrics + + + + +```swift +client.companyprofile.getCompanyMetrics() { (response, error) in + // Use response +} +``` + + + + + + +This API allows to view the company metrics, i.e. the status of its brand and stores. Also its allows to view the number of products, company documents & store documents which are verified and unverified. + +*Returned Response:* + + + + +[MetricsSerializer](#MetricsSerializer) + +Metrics response object. See example below or refer `MetricsSerializer` for details + + + + +
    +  Example: + +```json +{ + "uid": 1, + "stage": "complete", + "store": { + "verified": 1, + "pending": 1 + }, + "brand": { + "verified": 1, + "pending": 1 + }, + "product": { + "verified": 0, + "pending": 0 + }, + "company_documents": { + "verified": 1, + "pending": 0 + }, + "store_documents": { + "verified": 0, + "pending": 2 + } +} +``` +
    + + + + + + + + + +--- + + +#### editBrand +Edit a brand. + + + + +```swift +client.companyprofile.editBrand(brandId: brandId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| brandId | String | yes | Id of the brand to be viewed. | +| body | CreateUpdateBrandRequestSerializer | yes | Request body | + + +This API allows to edit meta of a brand. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "uid": 1, + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getBrand +Get a single brand. + + + + +```swift +client.companyprofile.getBrand(brandId: brandId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| brandId | String | yes | Id of the brand to be viewed. | + + + +This API helps to get data associated to a particular brand. + +*Returned Response:* + + + + +[GetBrandResponseSerializer](#GetBrandResponseSerializer) + +Brand object. See example below or refer `GetBrandResponseSerializer` for details + + + + +
    +  Example: + +```json +{ + "stage": "verified", + "_custom_json": {}, + "uid": 1, + "logo": "http://cdn4.gofynd.com/media/logo/brand/original/4597_40d1ce44d61940d4829a3c54951bd9ee.jpg", + "warnings": {}, + "_locale_language": {}, + "name": "edited brand", + "slug_key": "brand-2", + "banner": { + "portrait": "http://cdn4.gofynd.com/media/banner_portrait/brand/original/7021_16fc50205c40477daf419b64ec64c64c.jpg", + "landscape": "http://cdn4.gofynd.com/media/banner/brand/original/7020_f9e91f7d501c4f2985c09bd196ed304d.jpg" + }, + "created_by": { + "username": "silverbolt", + "user_id": "0" + }, + "modified_by": { + "username": "917827311650_22960", + "user_id": "123" + }, + "verified_by": { + "username": "917827311650_22960", + "user_id": "123" + }, + "synonyms": [ + "xyz" + ] +} +``` +
    + + + + + + + + + +--- + + +#### createBrand +Create a Brand. + + + + +```swift +client.companyprofile.createBrand(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CreateUpdateBrandRequestSerializer | yes | Request body | + + +This API allows to create a brand associated to a company. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "uid": 1, + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### createCompanyBrandMapping +Create a company brand mapping. + + + + +```swift +client.companyprofile.createCompanyBrandMapping(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CompanyBrandPostRequestSerializer | yes | Request body | + + +This API allows to create a company brand mapping, for a already existing brand in the system. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getBrands +Get brands associated to a company + + + + +```swift +client.companyprofile.getBrands(pageNo: pageNo, pageSize: pageSize, q: q) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results | +| pageSize | Int? | no | Number of items to retrieve in each page. Default is 10. | +| q | String? | no | Search term for name. | + + + +This API helps to get view brands associated to a particular company. + +*Returned Response:* + + + + +[CompanyBrandListSerializer](#CompanyBrandListSerializer) + +Brand object. See example below or refer `CompanyBrandListSerializer` for details + + + + +
    +  Example: + +```json +{ + "items": [ + { + "brand": { + "stage": "complete", + "uid": 2, + "banner": { + "portrait": "http://cdn4.gofynd.com/media/banner_portrait/brand/original/7021_16fc50205c40477daf419b64ec64c64c.jpg", + "landscape": "http://cdn4.gofynd.com/media/banner/brand/original/7020_f9e91f7d501c4f2985c09bd196ed304d.jpg" + }, + "modified_by": { + "user_id": "123", + "username": "917827311650_22960" + }, + "slug_key": "test-post", + "synonyms": [ + "xyz" + ], + "created_on": "2021-02-25T15:21:57.666000+00:00", + "created_by": { + "user_id": "123", + "username": "917827311650_22960" + }, + "modified_on": "2021-02-25T15:21:57.666000+00:00", + "name": "test_post", + "logo": "http://cdn4.gofynd.com/media/logo/brand/original/4597_40d1ce44d61940d4829a3c54951bd9ee.jpg" + }, + "stage": "complete", + "uid": 2, + "modified_by": { + "user_id": "123", + "username": "917827311650_22960" + }, + "company": { + "business_type": "huf", + "stage": "complete", + "uid": 1, + "addresses": [ + { + "city": "Mumbai Suburban", + "latitude": 19.058461, + "longitude": 72.871395, + "address1": "Chunabhatti Phatak, Maharashtra Nagar, Maharashtra Nagar, ", + "country_code": "IN", + "state": "Maharashtra", + "country": "India", + "pincode": 400070, + "address_type": "office" + }, + { + "city": "Mumbai Suburban", + "latitude": 19.058461, + "longitude": 72.871395, + "address1": "Chunabhatti Phatak, Maharashtra Nagar, Maharashtra Nagar, ", + "country_code": "IN", + "state": "Maharashtra", + "country": "India", + "pincode": 400070, + "address_type": "registered" + } + ], + "modified_by": { + "user_id": "-1", + "username": "silverbolt" + }, + "company_type": "mbo", + "created_on": "2021-02-25T15:21:51.526000+00:00", + "created_by": { + "user_id": "123", + "username": "917827311650_22960" + }, + "modified_on": "2021-02-25T17:44:55.722000+00:00", + "name": "Cache Company" + }, + "created_by": { + "user_id": "123", + "username": "917827311650_22960" + } + } + ], + "page": { + "current": 1, + "size": 1, + "has_previous": false, + "has_next": false, + "item_count": 1 + } +} +``` +
    + + + + + + + + + +--- + + +#### createLocation +Create a location asscoiated to a company. + + + + +```swift +client.companyprofile.createLocation(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | LocationSerializer | yes | Request body | + + +This API allows to create a location associated to a company. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "uid": 1, + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getLocations +Get list of locations + + + + +```swift +client.companyprofile.getLocations(storeType: storeType, q: q, stage: stage, pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| storeType | String? | no | Helps to sort the location list on the basis of location type. | +| q | String? | no | Query that is to be searched. | +| stage | String? | no | to filter companies on basis of verified or unverified companies. | +| pageNo | Int? | no | The page number to navigate through the given set of results | +| pageSize | Int? | no | Number of items to retrieve in each page. Default is 10. | + + + +This API allows to view all the locations asscoiated to a company. + +*Returned Response:* + + + + +[LocationListSerializer](#LocationListSerializer) + +Company profile object. See example below or refer `LocationListSerializer` for details + + + + +
    +  Example: + +```json +{ + "items": [ + { + "company": { + "business_type": "huf", + "stage": "complete", + "uid": 1, + "addresses": [ + { + "city": "Mumbai Suburban", + "latitude": 19.058461, + "longitude": 72.871395, + "address1": "Chunabhatti Phatak, Maharashtra Nagar, Maharashtra Nagar, ", + "country_code": "IN", + "state": "Maharashtra", + "country": "India", + "pincode": 400070, + "address_type": "office" + }, + { + "city": "Mumbai Suburban", + "latitude": 19.058461, + "longitude": 72.871395, + "address1": "Chunabhatti Phatak, Maharashtra Nagar, Maharashtra Nagar, ", + "country_code": "IN", + "state": "Maharashtra", + "country": "India", + "pincode": 400070, + "address_type": "registered" + } + ], + "modified_by": { + "user_id": "-1", + "username": "silverbolt" + }, + "company_type": "mbo", + "created_on": "2021-02-25T15:21:51.526000+00:00", + "created_by": { + "user_id": "123", + "username": "917827311650_22960" + }, + "modified_on": "2021-02-25T17:44:55.722000+00:00", + "name": "Cache Company" + }, + "address": { + "city": "MUMBAI", + "latitude": 19.4232024, + "longitude": 72.8231511, + "address1": "A/204, SAI VANDAN, NARAYAN NAGAR, TULINJ ROAD", + "state": "MAHARASHTRA", + "country": "INDIA", + "pincode": 401209 + }, + "timing": [ + { + "closing": { + "minute": 0, + "hour": 22 + }, + "opening": { + "minute": 0, + "hour": 11 + }, + "open": true, + "weekday": "monday" + }, + { + "closing": { + "minute": 0, + "hour": 22 + }, + "opening": { + "minute": 0, + "hour": 11 + }, + "open": true, + "weekday": "tuesday" + }, + { + "closing": { + "minute": 0, + "hour": 22 + }, + "opening": { + "minute": 0, + "hour": 11 + }, + "open": true, + "weekday": "wednesday" + }, + { + "closing": { + "minute": 0, + "hour": 22 + }, + "opening": { + "minute": 0, + "hour": 11 + }, + "open": true, + "weekday": "thursday" + }, + { + "closing": { + "minute": 0, + "hour": 22 + }, + "opening": { + "minute": 0, + "hour": 11 + }, + "open": true, + "weekday": "friday" + }, + { + "closing": { + "minute": 0, + "hour": 22 + }, + "opening": { + "minute": 0, + "hour": 11 + }, + "open": true, + "weekday": "saturday" + }, + { + "closing": { + "minute": 0, + "hour": 22 + }, + "opening": { + "minute": 0, + "hour": 11 + }, + "open": true, + "weekday": "sunday" + } + ], + "documents": [], + "display_name": "new store", + "manager": { + "name": "Yrf", + "mobile_no": { + "country_code": 91, + "number": "83456774567" + }, + "email": "gbp@jkl.com" + }, + "code": "code2", + "product_return_config": { + "on_same_store": true + }, + "created_on": "2021-02-25T15:22:04.913000+00:00", + "created_by": { + "user_id": "123", + "username": "917827311650_22960" + }, + "name": "location2", + "gst_credentials": { + "e_invoice": { + "enabled": false + } + }, + "store_type": "high_street", + "contact_numbers": [ + { + "country_code": 91, + "number": "7208229698" + } + ], + "stage": "complete", + "uid": 2, + "notification_emails": [] + } + ], + "page": { + "current": 1, + "size": 1, + "has_previous": false, + "has_next": false, + "item_count": 1 + } +} +``` +
    + + + + + + + + + +--- + + +#### updateLocation +Edit a location asscoiated to a company. + + + + +```swift +client.companyprofile.updateLocation(locationId: locationId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| locationId | String | yes | Id of the location which you want to edit. | +| body | LocationSerializer | yes | Request body | + + +This API allows to edit a location associated to a company. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "uid": 1, + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getLocationDetail +Get details of a specific location. + + + + +```swift +client.companyprofile.getLocationDetail(locationId: locationId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| locationId | String | yes | Id of the location which you want to view. | + + + +This API helps to get data associated to a specific location. + +*Returned Response:* + + + + +[GetLocationSerializer](#GetLocationSerializer) + +Brand object. See example below or refer `GetLocationSerializer` for details + + + + +
    +  Example: + +```json +{ + "verified_on": "2021-02-25T15:22:07.140000+00:00", + "company": { + "business_type": "huf", + "stage": "complete", + "uid": 1, + "addresses": [ + { + "city": "Mumbai Suburban", + "latitude": 19.058461, + "longitude": 72.871395, + "address1": "Chunabhatti Phatak, Maharashtra Nagar, Maharashtra Nagar, ", + "country_code": "IN", + "state": "Maharashtra", + "country": "India", + "pincode": 400070, + "address_type": "office" + }, + { + "city": "Mumbai Suburban", + "latitude": 19.058461, + "longitude": 72.871395, + "address1": "Chunabhatti Phatak, Maharashtra Nagar, Maharashtra Nagar, ", + "country_code": "IN", + "state": "Maharashtra", + "country": "India", + "pincode": 400070, + "address_type": "registered" + } + ], + "modified_by": { + "user_id": "-1", + "username": "silverbolt" + }, + "company_type": "mbo", + "created_by": { + "user_id": "123", + "username": "917827311650_22960" + }, + "name": "Cache Company" + }, + "address": { + "city": "MUMBAI", + "landmark": "", + "latitude": 19.4232024, + "longitude": 72.8231511, + "address2": "", + "address1": "A/204, SAI VANDAN, NARAYAN NAGAR, TULINJ ROAD", + "state": "MAHARASHTRA", + "country": "INDIA", + "pincode": 401209 + }, + "timing": [ + { + "closing": { + "minute": 0, + "hour": 22 + }, + "opening": { + "minute": 0, + "hour": 11 + }, + "open": true, + "weekday": "monday" + }, + { + "closing": { + "minute": 0, + "hour": 22 + }, + "opening": { + "minute": 0, + "hour": 11 + }, + "open": true, + "weekday": "tuesday" + }, + { + "closing": { + "minute": 0, + "hour": 22 + }, + "opening": { + "minute": 0, + "hour": 11 + }, + "open": true, + "weekday": "wednesday" + }, + { + "closing": { + "minute": 0, + "hour": 22 + }, + "opening": { + "minute": 0, + "hour": 11 + }, + "open": true, + "weekday": "thursday" + }, + { + "closing": { + "minute": 0, + "hour": 22 + }, + "opening": { + "minute": 0, + "hour": 11 + }, + "open": true, + "weekday": "friday" + }, + { + "closing": { + "minute": 0, + "hour": 22 + }, + "opening": { + "minute": 0, + "hour": 11 + }, + "open": true, + "weekday": "saturday" + }, + { + "closing": { + "minute": 0, + "hour": 22 + }, + "opening": { + "minute": 0, + "hour": 11 + }, + "open": true, + "weekday": "sunday" + } + ], + "documents": [], + "warnings": {}, + "display_name": "new store", + "manager": { + "name": "Yrf", + "mobile_no": { + "country_code": 91, + "number": "83456774567" + }, + "email": "gbp@jkl.com" + }, + "code": "store1", + "product_return_config": { + "on_same_store": true + }, + "modified_by": { + "user_id": "-1", + "username": "silverbolt" + }, + "created_by": { + "user_id": "123", + "username": "917827311650_22960" + }, + "name": "edited_store", + "gst_credentials": { + "e_invoice": { + "enabled": false + } + }, + "verified_by": { + "user_id": "-1", + "username": "silverbolt" + }, + "store_type": "high_street", + "contact_numbers": [ + { + "country_code": 91, + "number": "7208229698" + } + ], + "stage": "verified", + "uid": 1, + "integration_type": { + "inventory": "pulse", + "order": "pulse" + }, + "notification_emails": [] +} +``` +
    + + + + + + + + + +--- + + +#### createLocationBulk +Create a location asscoiated to a company in bulk. + + + + +```swift +client.companyprofile.createLocationBulk(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | BulkLocationSerializer | yes | Request body | + + +This API allows to create a location associated to a company. + +*Returned Response:* + + + + +[SuccessResponse](#SuccessResponse) + +Returns a success response + + + + +
    +  Example: + +```json +{ + "message": "10 stores inserted", + "success": true +} +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [CreateUpdateAddressSerializer](#CreateUpdateAddressSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | landmark | String? | yes | | + | city | String | no | | + | state | String | no | | + | latitude | Double | no | | + | addressType | String | no | | + | pincode | Int | no | | + | country | String | no | | + | countryCode | String? | yes | | + | address2 | String? | yes | | + | longitude | Double | no | | + | address1 | String | no | | + +--- + + + + + #### [Website](#Website) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | url | String? | yes | | + +--- + + + + + #### [BusinessDetails](#BusinessDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | website | [Website](#Website)? | yes | | + +--- + + + + + #### [Document](#Document) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | url | String? | yes | | + | verified | Bool? | yes | | + | legalName | String? | yes | | + | type | String | no | | + | value | String | no | | + +--- + + + + + #### [SellerPhoneNumber](#SellerPhoneNumber) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | countryCode | Int | no | | + | number | String | no | | + +--- + + + + + #### [ContactDetails](#ContactDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | emails | [String]? | yes | | + | phone | [[SellerPhoneNumber](#SellerPhoneNumber)]? | yes | | + +--- + + + + + #### [UpdateCompany](#UpdateCompany) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | addresses | [[CreateUpdateAddressSerializer](#CreateUpdateAddressSerializer)]? | yes | | + | rejectReason | String? | yes | | + | businessDetails | [BusinessDetails](#BusinessDetails)? | yes | | + | documents | [[Document](#Document)]? | yes | | + | name | String? | yes | | + | customJson | [String: Any]? | yes | | + | notificationEmails | [String]? | yes | | + | franchiseEnabled | Bool? | yes | | + | businessInfo | String? | yes | | + | companyType | String? | yes | | + | contactDetails | [ContactDetails](#ContactDetails)? | yes | | + | warnings | [String: Any]? | yes | | + | businessType | String? | yes | | + +--- + + + + + #### [SuccessResponse](#SuccessResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | | + | uid | Int? | yes | | + +--- + + + + + #### [ErrorResponse](#ErrorResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | status | Int? | yes | | + | meta | [String: Any]? | yes | | + | message | String? | yes | | + | code | String? | yes | | + +--- + + + + + #### [UserSerializer](#UserSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | contact | String? | yes | | + | userId | String? | yes | | + | username | String? | yes | | + +--- + + + + + #### [BusinessCountryInfo](#BusinessCountryInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | countryCode | String? | yes | | + | country | String? | yes | | + +--- + + + + + #### [GetAddressSerializer](#GetAddressSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | landmark | String? | yes | | + | city | String? | yes | | + | addressType | String? | yes | | + | state | String? | yes | | + | latitude | Double? | yes | | + | pincode | Int? | yes | | + | country | String? | yes | | + | countryCode | String? | yes | | + | address2 | String? | yes | | + | longitude | Double? | yes | | + | address1 | String? | yes | | + +--- + + + + + #### [GetCompanyProfileSerializerResponse](#GetCompanyProfileSerializerResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | businessDetails | [BusinessDetails](#BusinessDetails)? | yes | | + | modifiedBy | [UserSerializer](#UserSerializer)? | yes | | + | franchiseEnabled | Bool? | yes | | + | createdBy | [UserSerializer](#UserSerializer)? | yes | | + | warnings | [String: Any]? | yes | | + | mode | String? | yes | | + | businessCountryInfo | [BusinessCountryInfo](#BusinessCountryInfo)? | yes | | + | notificationEmails | [String]? | yes | | + | verifiedOn | String? | yes | | + | businessInfo | String? | yes | | + | verifiedBy | [UserSerializer](#UserSerializer)? | yes | | + | modifiedOn | String? | yes | | + | stage | String? | yes | | + | documents | [[Document](#Document)]? | yes | | + | contactDetails | [ContactDetails](#ContactDetails)? | yes | | + | businessType | String | no | | + | addresses | [[GetAddressSerializer](#GetAddressSerializer)]? | yes | | + | createdOn | String? | yes | | + | uid | Int | no | | + | name | String? | yes | | + | companyType | String | no | | + +--- + + + + + #### [DocumentsObj](#DocumentsObj) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | verified | Int? | yes | | + | pending | Int? | yes | | + +--- + + + + + #### [MetricsSerializer](#MetricsSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | companyDocuments | [DocumentsObj](#DocumentsObj)? | yes | | + | product | [DocumentsObj](#DocumentsObj)? | yes | | + | store | [DocumentsObj](#DocumentsObj)? | yes | | + | stage | String? | yes | | + | uid | Int? | yes | | + | storeDocuments | [DocumentsObj](#DocumentsObj)? | yes | | + | brand | [DocumentsObj](#DocumentsObj)? | yes | | + +--- + + + + + #### [BrandBannerSerializer](#BrandBannerSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | portrait | String? | yes | | + | landscape | String? | yes | | + +--- + + + + + #### [CreateUpdateBrandRequestSerializer](#CreateUpdateBrandRequestSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | synonyms | [String]? | yes | | + | banner | [BrandBannerSerializer](#BrandBannerSerializer)? | yes | | + | brandTier | String? | yes | | + | localeLanguage | [String: Any]? | yes | | + | uid | Int? | yes | | + | name | String | no | | + | customJson | [String: Any]? | yes | | + | companyId | Int? | yes | | + | logo | String | no | | + | description | String? | yes | | + +--- + + + + + #### [UserSerializer1](#UserSerializer1) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | contact | String? | yes | | + | userId | String? | yes | | + | username | String? | yes | | + +--- + + + + + #### [GetBrandResponseSerializer](#GetBrandResponseSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | synonyms | [String]? | yes | | + | modifiedBy | [UserSerializer1](#UserSerializer1)? | yes | | + | createdBy | [UserSerializer1](#UserSerializer1)? | yes | | + | warnings | [String: Any]? | yes | | + | mode | String? | yes | | + | localeLanguage | [String: Any]? | yes | | + | customJson | [String: Any]? | yes | | + | verifiedOn | String? | yes | | + | slugKey | String? | yes | | + | verifiedBy | [UserSerializer1](#UserSerializer1)? | yes | | + | modifiedOn | String? | yes | | + | stage | String? | yes | | + | logo | String? | yes | | + | description | String? | yes | | + | banner | [BrandBannerSerializer](#BrandBannerSerializer)? | yes | | + | createdOn | String? | yes | | + | uid | Int? | yes | | + | rejectReason | String? | yes | | + | name | String | no | | + +--- + + + + + #### [CompanyBrandPostRequestSerializer](#CompanyBrandPostRequestSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | company | Int | no | | + | brands | [Int] | no | | + | uid | Int? | yes | | + +--- + + + + + #### [GetCompanySerializer](#GetCompanySerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | addresses | [[GetAddressSerializer](#GetAddressSerializer)]? | yes | | + | modifiedOn | String? | yes | | + | createdOn | String? | yes | | + | uid | Int? | yes | | + | stage | String? | yes | | + | rejectReason | String? | yes | | + | name | String? | yes | | + | verifiedOn | String? | yes | | + | modifiedBy | [UserSerializer](#UserSerializer)? | yes | | + | companyType | String? | yes | | + | createdBy | [UserSerializer](#UserSerializer)? | yes | | + | businessType | String? | yes | | + | verifiedBy | [UserSerializer](#UserSerializer)? | yes | | + +--- + + + + + #### [CompanyBrandSerializer](#CompanyBrandSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | modifiedOn | String? | yes | | + | createdOn | String? | yes | | + | uid | Int? | yes | | + | stage | String? | yes | | + | rejectReason | String? | yes | | + | verifiedOn | String? | yes | | + | modifiedBy | [UserSerializer1](#UserSerializer1)? | yes | | + | company | [GetCompanySerializer](#GetCompanySerializer)? | yes | | + | createdBy | [UserSerializer1](#UserSerializer1)? | yes | | + | brand | [GetBrandResponseSerializer](#GetBrandResponseSerializer)? | yes | | + | warnings | [String: Any]? | yes | | + | verifiedBy | [UserSerializer1](#UserSerializer1)? | yes | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String | no | | + | size | Int? | yes | | + | nextId | String? | yes | | + | itemTotal | Int? | yes | | + | hasPrevious | Bool? | yes | | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + +--- + + + + + #### [CompanyBrandListSerializer](#CompanyBrandListSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[CompanyBrandSerializer](#CompanyBrandSerializer)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [GetAddressSerializer1](#GetAddressSerializer1) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | landmark | String? | yes | | + | city | String? | yes | | + | addressType | String? | yes | | + | state | String? | yes | | + | latitude | Double? | yes | | + | pincode | Int? | yes | | + | country | String? | yes | | + | countryCode | String? | yes | | + | address2 | String? | yes | | + | longitude | Double? | yes | | + | address1 | String? | yes | | + +--- + + + + + #### [ProductReturnConfigSerializer](#ProductReturnConfigSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | onSameStore | Bool? | yes | | + | storeUid | Int? | yes | | + +--- + + + + + #### [LocationManagerSerializer](#LocationManagerSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | mobileNo | [SellerPhoneNumber](#SellerPhoneNumber) | no | | + | email | String? | yes | | + | name | String? | yes | | + +--- + + + + + #### [LocationTimingSerializer](#LocationTimingSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | minute | Int? | yes | | + | hour | Int? | yes | | + +--- + + + + + #### [LocationDayWiseSerializer](#LocationDayWiseSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | weekday | String | no | | + | opening | [LocationTimingSerializer](#LocationTimingSerializer)? | yes | | + | closing | [LocationTimingSerializer](#LocationTimingSerializer)? | yes | | + | open | Bool | no | | + +--- + + + + + #### [InvoiceCredSerializer](#InvoiceCredSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | password | String? | yes | | + | username | String? | yes | | + +--- + + + + + #### [InvoiceDetailsSerializer](#InvoiceDetailsSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | eWaybill | [InvoiceCredSerializer](#InvoiceCredSerializer)? | yes | | + | eInvoice | [InvoiceCredSerializer](#InvoiceCredSerializer)? | yes | | + +--- + + + + + #### [LocationSerializer](#LocationSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | storeType | String? | yes | | + | address | [GetAddressSerializer1](#GetAddressSerializer1) | no | | + | productReturnConfig | [ProductReturnConfigSerializer](#ProductReturnConfigSerializer)? | yes | | + | manager | [LocationManagerSerializer](#LocationManagerSerializer)? | yes | | + | uid | Int? | yes | | + | timing | [[LocationDayWiseSerializer](#LocationDayWiseSerializer)]? | yes | | + | stage | String? | yes | | + | documents | [[Document](#Document)]? | yes | | + | name | String | no | | + | customJson | [String: Any]? | yes | | + | displayName | String | no | | + | notificationEmails | [String]? | yes | | + | gstCredentials | [InvoiceDetailsSerializer](#InvoiceDetailsSerializer)? | yes | | + | company | Int | no | | + | warnings | [String: Any]? | yes | | + | contactNumbers | [[SellerPhoneNumber](#SellerPhoneNumber)]? | yes | | + | code | String | no | | + +--- + + + + + #### [LocationIntegrationType](#LocationIntegrationType) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | inventory | String? | yes | | + | order | String? | yes | | + +--- + + + + + #### [GetLocationSerializer](#GetLocationSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | storeType | String? | yes | | + | address | [GetAddressSerializer](#GetAddressSerializer) | no | | + | manager | [LocationManagerSerializer](#LocationManagerSerializer)? | yes | | + | modifiedBy | [UserSerializer1](#UserSerializer1)? | yes | | + | createdBy | [UserSerializer1](#UserSerializer1)? | yes | | + | warnings | [String: Any]? | yes | | + | phoneNumber | String | no | | + | integrationType | [LocationIntegrationType](#LocationIntegrationType)? | yes | | + | customJson | [String: Any]? | yes | | + | displayName | String | no | | + | verifiedOn | String? | yes | | + | notificationEmails | [String]? | yes | | + | verifiedBy | [UserSerializer1](#UserSerializer1)? | yes | | + | productReturnConfig | [ProductReturnConfigSerializer](#ProductReturnConfigSerializer)? | yes | | + | modifiedOn | String? | yes | | + | stage | String? | yes | | + | documents | [[Document](#Document)]? | yes | | + | gstCredentials | [InvoiceDetailsSerializer](#InvoiceDetailsSerializer)? | yes | | + | company | [GetCompanySerializer](#GetCompanySerializer)? | yes | | + | timing | [[LocationDayWiseSerializer](#LocationDayWiseSerializer)]? | yes | | + | createdOn | String? | yes | | + | uid | Int? | yes | | + | name | String | no | | + | contactNumbers | [[SellerPhoneNumber](#SellerPhoneNumber)]? | yes | | + | code | String | no | | + +--- + + + + + #### [LocationListSerializer](#LocationListSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[GetLocationSerializer](#GetLocationSerializer)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [BulkLocationSerializer](#BulkLocationSerializer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [[LocationSerializer](#LocationSerializer)]? | yes | | + +--- + + + diff --git a/documentation/platform/CONFIGURATION.md b/documentation/platform/CONFIGURATION.md new file mode 100644 index 0000000000..21c0e58a80 --- /dev/null +++ b/documentation/platform/CONFIGURATION.md @@ -0,0 +1,7208 @@ + + + + +##### [Back to Platform docs](./README.md) + +## Configuration Methods +Application configuration apis +* [getBuildConfig](#getbuildconfig) +* [updateBuildConfig](#updatebuildconfig) +* [getPreviousVersions](#getpreviousversions) +* [getAppFeatures](#getappfeatures) +* [updateAppFeatures](#updateappfeatures) +* [getAppBasicDetails](#getappbasicdetails) +* [updateAppBasicDetails](#updateappbasicdetails) +* [getAppContactInfo](#getappcontactinfo) +* [updateAppContactInfo](#updateappcontactinfo) +* [getAppApiTokens](#getappapitokens) +* [updateAppApiTokens](#updateappapitokens) +* [getAppCompanies](#getappcompanies) +* [getAppStores](#getappstores) +* [getInventoryConfig](#getinventoryconfig) +* [updateInventoryConfig](#updateinventoryconfig) +* [partiallyUpdateInventoryConfig](#partiallyupdateinventoryconfig) +* [getAppCurrencyConfig](#getappcurrencyconfig) +* [updateAppCurrencyConfig](#updateappcurrencyconfig) +* [getAppSupportedCurrency](#getappsupportedcurrency) +* [getOrderingStoresByFilter](#getorderingstoresbyfilter) +* [updateOrderingStoreConfig](#updateorderingstoreconfig) +* [getStaffOrderingStores](#getstafforderingstores) +* [getDomains](#getdomains) +* [addDomain](#adddomain) +* [removeDomainById](#removedomainbyid) +* [changeDomainType](#changedomaintype) +* [getDomainStatus](#getdomainstatus) +* [createApplication](#createapplication) +* [getApplications](#getapplications) +* [getApplicationById](#getapplicationbyid) +* [getCurrencies](#getcurrencies) +* [getDomainAvailibility](#getdomainavailibility) +* [getIntegrationById](#getintegrationbyid) +* [getAvailableOptIns](#getavailableoptins) +* [getSelectedOptIns](#getselectedoptins) +* [getIntegrationLevelConfig](#getintegrationlevelconfig) +* [updateLevelIntegration](#updatelevelintegration) +* [getIntegrationByLevelId](#getintegrationbylevelid) +* [updateLevelUidIntegration](#updateleveluidintegration) +* [getLevelActiveIntegrations](#getlevelactiveintegrations) +* [getBrandsByCompany](#getbrandsbycompany) +* [getCompanyByBrands](#getcompanybybrands) +* [getStoreByBrands](#getstorebybrands) +* [getOtherSellerApplications](#getothersellerapplications) +* [getOtherSellerApplicationById](#getothersellerapplicationbyid) +* [optOutFromApplication](#optoutfromapplication) + + + +## Methods with example and description + + +#### getBuildConfig +Get latest build config + + + + +```swift +client.application("").configuration.getBuildConfig(platformType: platformType) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platformType | String | yes | Current platform name | + + + +Get latest build config + +*Returned Response:* + + + + +[MobileAppConfiguration](#MobileAppConfiguration) + +Success + + + + +
    +  Example: + +```json +{ + "is_active": true, + "_id": "5ea9b318bc23a343ab6d442f", + "app_name": "TestUniket", + "landing_image": { + "aspect_ratio": "57/51", + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/mobile-build/pictures/free-landing/original/yKnXY1ATx-store-landing-image.png" + }, + "splash_image": { + "aspect_ratio": "1/1", + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/mobile-build/pictures/free-splash/original/s6d7oYfY6-store-splash-image.png" + }, + "application": "000000000000000000000004", + "platform_type": "android", + "created_at": "2020-04-29T17:02:16.976Z", + "modified_at": "2021-02-23T17:10:26.872Z", + "__v": 0, + "package_name": "com.fynd.store.x000000000000000000000004" +} +``` +
    + + + + + + + + + +--- + + +#### updateBuildConfig +Update build config for next build + + + + +```swift +client.application("").configuration.updateBuildConfig(platformType: platformType, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platformType | String | yes | Current platform name | +| body | MobileAppConfigRequest | yes | Request body | + + +Update build config for next build + +*Returned Response:* + + + + +[MobileAppConfiguration](#MobileAppConfiguration) + +Success + + + + +
    +  Example: + +```json +{ + "is_active": true, + "_id": "5ea9b318bc23a343ab6d442f", + "app_name": "TestUniket", + "landing_image": { + "aspect_ratio": "57/51", + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/mobile-build/pictures/free-landing/original/yKnXY1ATx-store-landing-image.png" + }, + "splash_image": { + "aspect_ratio": "1/1", + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/mobile-build/pictures/free-splash/original/s6d7oYfY6-store-splash-image.png" + }, + "application": "000000000000000000000004", + "platform_type": "android", + "created_at": "2020-04-29T17:02:16.976Z", + "modified_at": "2021-02-23T17:10:26.872Z", + "__v": 0, + "package_name": "com.fynd.store.x000000000000000000000004" +} +``` +
    + + + + + + + + + +--- + + +#### getPreviousVersions +Get previous build versions + + + + +```swift +client.application("").configuration.getPreviousVersions(platformType: platformType) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| platformType | String | yes | Current platform name | + + + +Get previous build versions + +*Returned Response:* + + + + +[BuildVersionHistory](#BuildVersionHistory) + +Success + + + + +
    +  Example: + +```json +{ + "versions": [ + { + "_id": "6035376ab937c5f7c5462888", + "application": "000000000000000000000004", + "platform_type": "android", + "build_status": "pending", + "version_name": "0.5.6", + "version_code": 1, + "created_at": "2021-02-23T17:12:10.977Z", + "modified_at": "2021-02-23T17:12:10.977Z", + "__v": 0 + } + ], + "latest_available_version_name": "0.5.7" +} +``` +
    + + + + + + + + + +--- + + +#### getAppFeatures +Get features of application + + + + +```swift +client.application("").configuration.getAppFeatures() { (response, error) in + // Use response +} +``` + + + + + + +Get features of application + +*Returned Response:* + + + + +[AppFeatureResponse](#AppFeatureResponse) + +Success + + + + +
    +  Example: + +```json +{ + "feature": { + "product_detail": { + "similar": [ + "basic", + "visual", + "brand", + "category", + "seller", + "price", + "specs" + ], + "seller_selection": true, + "update_product_meta": true, + "request_product": true + }, + "landing_page": { + "launch_page": { + "page_type": "home", + "params": null, + "query": null + }, + "continue_as_guest": true, + "login_btn_text": "Click here to sign-in", + "show_domain_textbox": true, + "show_register_btn": true + }, + "registration_page": { + "ask_store_address": false + }, + "home_page": { + "order_processing": true + }, + "common": { + "communication_optin_dialog": { + "visibility": true + }, + "deployment_store_selection": { + "enabled": true, + "type": "hard" + }, + "listing_price": { + "value": "min", + "sort": "min" + }, + "currency": { + "value": [ + "INR" + ], + "type": "explicit", + "default_currency": "INR" + }, + "revenue_engine": { + "enabled": false + }, + "feedback": { + "enabled": true + }, + "compare_products": { + "enabled": true + }, + "reward_points": { + "credit": { + "enabled": true + }, + "debit": { + "enabled": true, + "auto_apply": false, + "strategy_channel": "REWARDS" + } + } + }, + "cart": { + "gst_input": true, + "staff_selection": true, + "placing_for_customer": true, + "google_map": true, + "revenue_engine_coupon": false + }, + "qr": { + "application": true, + "products": true, + "collections": true + }, + "pcr": { + "staff_selection": true + }, + "order": { + "buy_again": true + }, + "_id": "5e57643c986e4119c973df7d", + "app": "000000000000000000000004", + "created_at": "2020-02-27T06:39:56.088Z", + "modified_at": "2021-02-02T11:04:14.289Z", + "__v": 1 + } +} +``` +
    + + + + + + + + + +--- + + +#### updateAppFeatures +Update features of application + + + + +```swift +client.application("").configuration.updateAppFeatures(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | AppFeatureRequest | yes | Request body | + + +Update features of application + +*Returned Response:* + + + + +[AppFeature](#AppFeature) + +Success + + + + +
    +  Example: + +```json +{ + "product_detail": { + "similar": [ + "basic", + "visual", + "brand", + "category", + "seller", + "price", + "specs" + ], + "seller_selection": true, + "update_product_meta": true, + "request_product": true + }, + "landing_page": { + "launch_page": { + "page_type": "home", + "params": null, + "query": null + }, + "continue_as_guest": true, + "login_btn_text": "Click here to sign-in", + "show_domain_textbox": true, + "show_register_btn": true + }, + "registration_page": { + "ask_store_address": false + }, + "home_page": { + "order_processing": true + }, + "common": { + "communication_optin_dialog": { + "visibility": true + }, + "deployment_store_selection": { + "enabled": true, + "type": "hard" + }, + "listing_price": { + "value": "min", + "sort": "min" + }, + "currency": { + "value": [ + "INR" + ], + "type": "explicit", + "default_currency": "INR" + }, + "revenue_engine": { + "enabled": false + }, + "feedback": { + "enabled": true + }, + "compare_products": { + "enabled": true + } + }, + "cart": { + "gst_input": true, + "staff_selection": true, + "placing_for_customer": true, + "google_map": true, + "revenue_engine_coupon": false + }, + "qr": { + "application": true, + "products": true, + "collections": true + }, + "pcr": { + "staff_selection": true + }, + "order": { + "buy_again": true + }, + "_id": "5e57643c986e4119c973df7d", + "app": "000000000000000000000004", + "created_at": "2020-02-27T06:39:56.088Z", + "modified_at": "2021-03-09T15:40:29.188Z", + "__v": 1 +} +``` +
    + + + + + + + + + +--- + + +#### getAppBasicDetails +Get basic application details + + + + +```swift +client.application("").configuration.getAppBasicDetails() { (response, error) in + // Use response +} +``` + + + + + + +Get basic application details like name + +*Returned Response:* + + + + +[ApplicationDetail](#ApplicationDetail) + +Success + + + + +
    +  Example: + +```json +{ + "name": "Uniket B2B", + "description": "Uniket B2B - India's Fastest Growing Retail Store - Aapki Badhti Dukaan", + "logo": { + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/free-logo/original/oEf3SQjda-Uniket-B2B.png" + }, + "mobile_logo": { + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/free-logo/original/oEf3SQjda-Uniket-B2B.png" + }, + "favicon": { + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/favicon/original/y3h6SSlY5-Uniket-B2B.png" + }, + "banner": { + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/landscape-banner/original/uSwlNpygq-Uniket-B2B.png" + }, + "domain": { + "verified": true, + "is_primary": true, + "is_shortlink": false, + "_id": "5eb1177748312a3bd55d0f1e", + "name": "uniket.hostx0.de" + }, + "domains": [ + { + "verified": true, + "is_primary": true, + "is_shortlink": false, + "_id": "5eb1177748312a3bd55d0f1e", + "name": "uniket.hostx0.de" + }, + { + "verified": true, + "is_primary": false, + "is_shortlink": true, + "_id": "5f0858c5f86e00cd42dccc8d", + "name": "jd.hostx0.de" + } + ], + "company_id": 1, + "_id": "000000000000000000000004" +} +``` +
    + + + + + + + + + +--- + + +#### updateAppBasicDetails +Add or update application's basic details + + + + +```swift +client.application("").configuration.updateAppBasicDetails(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | ApplicationDetail | yes | Request body | + + +Add or update application's basic details + +*Returned Response:* + + + + +[ApplicationDetail](#ApplicationDetail) + +Success + + + + +
    +  Example: + +```json +{ + "name": "Uniket B2B", + "description": "Uniket B2B - India's Fastest Growing Retail Store - Aapki Badhti Dukaan", + "logo": { + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/free-logo/original/oEf3SQjda-Uniket-B2B.png" + }, + "mobile_logo": { + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/free-logo/original/oEf3SQjda-Uniket-B2B.png" + }, + "favicon": { + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/favicon/original/y3h6SSlY5-Uniket-B2B.png" + }, + "banner": { + "secure_url": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/application/pictures/landscape-banner/original/uSwlNpygq-Uniket-B2B.png" + }, + "domain": { + "verified": true, + "is_primary": true, + "is_shortlink": false, + "_id": "5eb1177748312a3bd55d0f1e", + "name": "uniket.hostx0.de" + }, + "domains": [ + { + "verified": true, + "is_primary": true, + "is_shortlink": false, + "_id": "5eb1177748312a3bd55d0f1e", + "name": "uniket.hostx0.de" + }, + { + "verified": true, + "is_primary": false, + "is_shortlink": true, + "_id": "5f0858c5f86e00cd42dccc8d", + "name": "jd.hostx0.de" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getAppContactInfo +Get application information + + + + +```swift +client.application("").configuration.getAppContactInfo() { (response, error) in + // Use response +} +``` + + + + + + +Get Application Current Information. This includes information about social links, address and contact information of company/seller/brand of the application. + +*Returned Response:* + + + + +[ApplicationInformation](#ApplicationInformation) + +Success + + + + +
    +  Example: + +```json +{ + "value": { + "address": { + "loc": null, + "address_line": [ + "Warehouse 5, Near Industrial Complex", + "2nd Lane, Andheri" + ], + "phone": [ + { + "code": "+91", + "number": "9988776654" + } + ], + "city": "Mumbai , Maharashtra , India", + "country": "India", + "pincode": 400059 + }, + "support": { + "phone": [], + "email": [], + "timing": "9 AM to 9 PM" + }, + "social_links": { + "facebook": { + "title": "Facebook", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/hQAbAKdvHK-facebookfooteraopcjq.svg", + "link": "" + }, + "instagram": { + "title": "Instagram", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/UZYsGWOqXp-instagramfooterl3utrr.svg", + "link": "" + }, + "twitter": { + "title": "Twitter", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/oT2hW-BJjq-twitterfooternajsyr.svg", + "link": "" + }, + "pinterest": { + "title": "Pinterest", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/v0erlcMk8p-pinterestfooternzmq4b.svg", + "link": "" + }, + "google_plus": { + "title": "Google+", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/lw3Y5S58h4-googleplusysukr1.png", + "link": "" + }, + "youtube": { + "title": "Youtube", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/EYV03PDST_-youtubefootermqhcr7.svg", + "link": "" + }, + "linked_in": { + "title": "LinkedIn", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/qa7gx_bW9O-linkedinfooterrcr0yq.svg", + "link": "" + }, + "vimeo": { + "title": "Vimeo", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/Ttc80b3U78-vimeofooternho4br.svg", + "link": "" + }, + "blog_link": { + "title": "Blog", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/LKpxTk1I3s-mediumfooterdtvrva.svg", + "link": "" + } + }, + "links": [ + { + "title": "Shipping", + "link": "www.uniket.store/shipping-details" + }, + { + "title": "Returns", + "link": "www.uniket.store/policy/return-policy" + }, + { + "title": "Privacy", + "link": "www.uniket.store/policy/privacy-policy" + }, + { + "title": "Terms", + "link": "www.uniket.store/policy/terms-conditions" + } + ], + "copyright_text": "#MadeInIndia © 2020 Shopsense Retail Technologies", + "_id": "5e6627bd0732616083e83750", + "business_highlights": [ + { + "_id": "5fc901611dfba6c2e87d1ca9", + "title": "100% Genuine Products", + "icon": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/business-highlights/pictures/square-logo/original/bVlx43F2a-H6pvZ9tzp-business-logo-icon.png", + "sub_title": "Directly from brands" + }, + { + "_id": "5fc901611dfba64ce57d1caa", + "title": "Credit Facility Available", + "icon": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/business-highlights/pictures/square-logo/original/VMnltS1m3-QuUnEjOsA-business-logo-icon.png", + "sub_title": "Free 30 Days Credit" + }, + { + "_id": "5fc901611dfba64b2e7d1cab", + "title": "Assured Returns", + "icon": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/business-highlights/pictures/square-logo/original/cTHzgHJXK-sROtLMalN-business-logo-icon.png", + "sub_title": "For all damaged/wrong items" + } + ], + "application": "000000000000000000000004", + "created_at": "2020-03-09T11:25:49.921Z", + "modified_at": "2020-12-03T15:16:49.087Z", + "__v": 99 + } +} +``` +
    + + + + + + + + + +--- + + +#### updateAppContactInfo +Get application information + + + + +```swift +client.application("").configuration.updateAppContactInfo(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | ApplicationInformation | yes | Request body | + + +Save Application Current Information. This includes information about social links, address and contact information of an application. + +*Returned Response:* + + + + +[ApplicationInformation](#ApplicationInformation) + +Success + + + + +
    +  Example: + +```json +{ + "_id": "5e6627bd0732616083e83750", + "address": { + "address_line": [ + "Warehouse 5, Near Industrial Complex", + "2nd Lane, Andheri" + ], + "phone": [ + { + "code": "+91", + "number": "9988776654" + } + ], + "city": "Mumbai , Maharashtra , India", + "country": "India", + "pincode": 400059, + "loc": null + }, + "social_links": { + "facebook": { + "title": "Facebook", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/hQAbAKdvHK-facebookfooteraopcjq.svg", + "link": "" + }, + "instagram": { + "title": "Instagram", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/UZYsGWOqXp-instagramfooterl3utrr.svg", + "link": "" + }, + "twitter": { + "title": "Twitter", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/oT2hW-BJjq-twitterfooternajsyr.svg", + "link": "" + }, + "pinterest": { + "title": "Pinterest", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/v0erlcMk8p-pinterestfooternzmq4b.svg", + "link": "" + }, + "google_plus": { + "title": "Google+", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/lw3Y5S58h4-googleplusysukr1.png", + "link": "" + }, + "youtube": { + "title": "Youtube", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/EYV03PDST_-youtubefootermqhcr7.svg", + "link": "" + }, + "linked_in": { + "title": "LinkedIn", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/qa7gx_bW9O-linkedinfooterrcr0yq.svg", + "link": "" + }, + "blog_link": { + "title": "Blog", + "icon": "https://hdn-1.fynd.com/system/svg/social-media/icon/original/LKpxTk1I3s-mediumfooterdtvrva.svg", + "link": "" + } + }, + "links": [ + { + "title": "Shipping", + "link": "www.uniket.store/shipping-details" + }, + { + "title": "Returns", + "link": "www.uniket.store/policy/return-policy" + }, + { + "title": "Privacy", + "link": "www.uniket.store/policy/privacy-policy" + }, + { + "title": "Terms", + "link": "www.uniket.store/policy/terms-conditions" + } + ], + "copyright_text": "#MadeInIndia © 2020 Shopsense Retail Technologies", + "support": { + "timing": "9 AM to 9 PM", + "phone": [], + "email": [] + }, + "business_highlights": [ + { + "_id": "60479413a32f774d754b00ef", + "title": "100% Genuine Products", + "icon": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/business-highlights/pictures/square-logo/original/bVlx43F2a-H6pvZ9tzp-business-logo-icon.png", + "sub_title": "Directly from brands" + }, + { + "_id": "60479413a32f7717df4b00f0", + "title": "Credit Facility Available", + "icon": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/business-highlights/pictures/square-logo/original/VMnltS1m3-QuUnEjOsA-business-logo-icon.png", + "sub_title": "Free 30 Days Credit" + }, + { + "_id": "60479413a32f77e70b4b00f1", + "title": "Assured Returns", + "icon": "https://hdn-1.addsale.com/x0/company/1/applications/000000000000000000000004/business-highlights/pictures/square-logo/original/cTHzgHJXK-sROtLMalN-business-logo-icon.png", + "sub_title": "For all damaged/wrong items" + } + ], + "application": "000000000000000000000004", + "created_at": "2020-03-09T11:25:49.921Z", + "modified_at": "2021-03-09T15:28:19.598Z", + "__v": 101 +} +``` +
    + + + + + + + + + +--- + + +#### getAppApiTokens +Get social tokens + + + + +```swift +client.application("").configuration.getAppApiTokens() { (response, error) in + // Use response +} +``` + + + + + + +Get social tokens. + +*Returned Response:* + + + + +[TokenResponse](#TokenResponse) + +Success + + + + +
    +  Example: + +```json +{ + "tokens": { + "firebase": { + "credentials": { + "ios": { + "application_id": "test", + "api_key": "test" + }, + "android": { + "application_id": "test", + "api_key": "test" + }, + "project_id": "uniket-d8cdc", + "gcm_sender_id": "test", + "application_id": "test", + "api_key": "test" + }, + "enabled": true + }, + "moengage": { + "credentials": { + "app_id": "test" + }, + "enabled": true + }, + "segment": { + "credentials": { + "write_key": "test" + }, + "enabled": true + }, + "gtm": { + "credentials": { + "api_key": "test" + }, + "enabled": false + }, + "freshchat": { + "credentials": { + "app_id": "123456", + "app_key": "123456789", + "web_token": "" + }, + "enabled": false + }, + "safetynet": { + "credentials": { + "api_key": "test" + }, + "enabled": true + }, + "fynd_rewards": { + "credentials": { + "public_key": "test" + } + }, + "auth": { + "google": { + "appId": "test" + }, + "facebook": { + "appId": "test" + }, + "accountkit": { + "appId": "" + } + }, + "google_map": { + "credentials": { + "api_key": "test" + } + } + }, + "_id": "5e66282a073261060ee83751", + "application": "000000000000000000000004", + "created_at": "2020-03-09T11:27:38.894Z", + "modified_at": "2020-12-24T05:39:17.054Z", + "__v": 0 +} +``` +
    + + + + + + + + + +--- + + +#### updateAppApiTokens +Add social tokens + + + + +```swift +client.application("").configuration.updateAppApiTokens(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | TokenResponse | yes | Request body | + + +Add social tokens. + +*Returned Response:* + + + + +[TokenResponse](#TokenResponse) + +Success + + + + +
    +  Example: + +```json +{ + "tokens": { + "firebase": { + "credentials": { + "ios": { + "application_id": "test", + "api_key": "test" + }, + "android": { + "application_id": "test", + "api_key": "test" + }, + "project_id": "uniket-d8cdc", + "gcm_sender_id": "test", + "application_id": "test", + "api_key": "test" + }, + "enabled": true + }, + "moengage": { + "credentials": { + "app_id": "test" + }, + "enabled": true + }, + "segment": { + "credentials": { + "write_key": "test" + }, + "enabled": true + }, + "gtm": { + "credentials": { + "api_key": "1234567890" + }, + "enabled": false + }, + "freshchat": { + "credentials": { + "app_id": "123456", + "app_key": "123456789", + "web_token": "" + }, + "enabled": false + }, + "safetynet": { + "credentials": { + "api_key": "test" + }, + "enabled": true + }, + "fynd_rewards": { + "credentials": { + "public_key": "test" + } + }, + "auth": { + "google": { + "appId": "test" + }, + "facebook": { + "appId": "test" + }, + "accountkit": { + "appId": "" + } + }, + "google_map": { + "credentials": { + "api_key": "test" + } + } + }, + "_id": "5e66282a073261060ee83751", + "application": "000000000000000000000004", + "created_at": "2020-03-09T11:27:38.894Z", + "modified_at": "2020-12-24T05:39:17.054Z", + "__v": 0 +} +``` +
    + + + + + + + + + +--- + + +#### getAppCompanies +Application inventory enabled companies + + + + +```swift +client.application("").configuration.getAppCompanies(uid: uid, pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| uid | Int? | no | uid of companies to be fetched | +| pageNo | Int? | no | Current page no | +| pageSize | Int? | no | Current request items count | + + + +Application inventory enabled companies. + +*Returned Response:* + + + + +[CompaniesResponse](#CompaniesResponse) + +Success + + + + +
    +  Example: + +```json +{ + "items": [ + { + "uid": 108, + "name": "Sample2 Company", + "company_type": "mbo" + }, + { + "uid": 13, + "name": "Isabel Mazanec", + "company_type": "franchisee" + }, + { + "uid": 7, + "name": "Zack Burgdorf", + "company_type": "distributor" + } + ], + "page": { + "type": "number", + "size": 200, + "current": 1, + "has_next": false, + "item_total": 3 + } +} +``` +
    + + + + + + + + + +--- + + +#### getAppStores +Application inventory enabled stores + + + + +```swift +client.application("").configuration.getAppStores(pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Current page no | +| pageSize | Int? | no | Current request items count | + + + +Application inventory enabled stores. + +*Returned Response:* + + + + +[StoresResponse](#StoresResponse) + +Success + + + + +
    +  Example: + +```json +{ + "items": [ + { + "_id": "5ec2c0b168fc2800017112f5", + "uid": 1, + "name": "RRL01", + "display_name": "RRL01", + "store_type": "warehouse", + "store_code": "WH_8513", + "company_id": 1 + }, + { + "_id": "5ec3b09a68fc28000171137c", + "modified_on": "2020-06-30T10:02:41.208Z", + "uid": 10, + "name": "Saran Ledonne", + "display_name": "", + "store_type": "high_street", + "store_code": "af6198fe-2c23-4441-bbf4-e694c96e255c", + "company_id": 1 + }, + { + "_id": "5f099b2c931b1c0001e7ccb2", + "display_name": "cbs 2", + "store_code": "HS-c9bac", + "name": "cbs 2", + "company_id": 80, + "store_type": "high_street", + "uid": 11014 + } + ], + "page": { + "type": "number", + "size": 200, + "current": 1, + "has_next": true, + "item_total": 3 + } +} +``` +
    + + + + + + + + + +--- + + +#### getInventoryConfig +Get application configuration + + + + +```swift +client.application("").configuration.getInventoryConfig() { (response, error) in + // Use response +} +``` + + + + + + +Get application configuration for various features and data + +*Returned Response:* + + + + +[ApplicationInventory](#ApplicationInventory) + +Success + + + + +
    +  Example: + +```json +{ + "inventory": { + "brand": { + "criteria": "all", + "brands": [] + }, + "store": { + "criteria": "filter", + "stores": [], + "rules": [ + { + "companies": [ + 1, + 3, + 4 + ], + "brands": [] + } + ] + }, + "category": { + "criteria": "all", + "categories": [] + }, + "price": { + "min": 1, + "max": 10000 + }, + "discount": { + "min": 0, + "max": 100 + }, + "out_of_stock": true, + "franchise_enabled": true, + "exclude_category": [], + "image": [ + "standard", + "substandard", + "default" + ], + "company_store": [] + }, + "authentication": { + "required": true, + "provider": "fynd" + }, + "article_assignment": { + "rules": { + "store_priority": { + "enabled": false, + "storetype_order": [] + } + }, + "post_order_reassignment": true + }, + "reward_points": { + "credit": { + "enabled": true + }, + "debit": { + "enabled": true, + "auto_apply": false, + "strategy_channel": "rewards" + } + }, + "cart": { + "delivery_charges": { + "enabled": true, + "charges": [ + { + "threshold": 1000, + "charges": 49 + }, + { + "threshold": 200000, + "charges": 79 + } + ] + }, + "enabled": true, + "max_cart_items": 0, + "min_cart_value": 120, + "bulk_coupons": true, + "revenue_engine_coupon": false + }, + "payment": { + "callback_url": { + "app": "", + "web": "" + }, + "methods": { + "pl": { + "enabled": true + }, + "card": { + "enabled": true + }, + "nb": { + "enabled": true + }, + "wl": { + "enabled": true + }, + "ps": { + "enabled": true + }, + "upi": { + "enabled": true + }, + "qr": { + "enabled": true + }, + "cod": { + "enabled": true + }, + "pp": { + "enabled": true + }, + "jp": { + "enabled": false + }, + "pac": { + "enabled": false + }, + "fc": { + "enabled": false + }, + "jiopp": { + "enabled": false + }, + "stripepg": { + "enabled": true + }, + "juspaypg": { + "enabled": false + }, + "payubizpg": { + "enabled": true + }, + "payumoneypg": { + "enabled": true + }, + "rupifipg": { + "enabled": false + }, + "simpl": { + "enabled": true + } + }, + "payment_selection_lock": { + "enabled": false, + "default_options": "", + "payment_identifier": "" + }, + "mode_of_payment": "uniket_b2b", + "source": "uniket", + "enabled": true, + "cod_amount_limit": 100000, + "cod_charges": 1500 + }, + "order": { + "enabled": true, + "force_reassignment": false + }, + "logistics": { + "logistics_by_seller": false, + "serviceability_check": true, + "same_day_delivery": true, + "dp_assignment": true + }, + "business": "retail", + "comms_enabled": true, + "platforms": [ + "uniket_wholesale" + ], + "_id": "5e04c76b8dd8c003577fdd0a", + "loyalty_points": { + "enabled": true, + "auto_apply": false + }, + "app": "000000000000000000000004", + "created_at": "2019-12-26t14:44:59.835z", + "modified_at": "2021-03-09t15:40:29.208z", + "__v": 3, + "modified_by": "5e199eed98cfe16dc61385de" +} +``` +
    + + + + + + + + + +--- + + +#### updateInventoryConfig +Update application configuration + + + + +```swift +client.application("").configuration.updateInventoryConfig(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | ApplicationInventory | yes | Request body | + + +Update application configuration for various features and data + +*Returned Response:* + + + + +[ApplicationInventory](#ApplicationInventory) + +Success + + + + +
    +  Example: + +```json +{ + "inventory": { + "brand": { + "criteria": "all", + "brands": [] + }, + "store": { + "criteria": "filter", + "stores": [], + "rules": [ + { + "companies": [ + 1, + 3, + 4 + ], + "brands": [] + } + ] + }, + "category": { + "criteria": "all", + "categories": [] + }, + "price": { + "min": 1, + "max": 10000 + }, + "discount": { + "min": 0, + "max": 100 + }, + "out_of_stock": true, + "franchise_enabled": true, + "exclude_category": [], + "image": [ + "standard", + "substandard", + "default" + ], + "company_store": [] + }, + "authentication": { + "required": true, + "provider": "fynd" + }, + "article_assignment": { + "rules": { + "store_priority": { + "enabled": false, + "storetype_order": [] + } + }, + "post_order_reassignment": true + }, + "reward_points": { + "credit": { + "enabled": true + }, + "debit": { + "enabled": true, + "auto_apply": false, + "strategy_channel": "REWARDS" + } + }, + "cart": { + "delivery_charges": { + "enabled": true, + "charges": [ + { + "threshold": 1000, + "charges": 49 + }, + { + "threshold": 200000, + "charges": 79 + } + ] + }, + "enabled": true, + "max_cart_items": 0, + "min_cart_value": 120, + "bulk_coupons": true, + "revenue_engine_coupon": false + }, + "payment": { + "callback_url": { + "app": "", + "web": "" + }, + "methods": { + "PL": { + "enabled": true + }, + "CARD": { + "enabled": true + }, + "NB": { + "enabled": true + }, + "WL": { + "enabled": true + }, + "PS": { + "enabled": true + }, + "UPI": { + "enabled": true + }, + "QR": { + "enabled": true + }, + "COD": { + "enabled": true + }, + "PP": { + "enabled": true + }, + "JP": { + "enabled": false + }, + "PAC": { + "enabled": false + }, + "FC": { + "enabled": false + }, + "JIOPP": { + "enabled": false + }, + "STRIPEPG": { + "enabled": true + }, + "JUSPAYPG": { + "enabled": false + }, + "PAYUBIZPG": { + "enabled": true + }, + "PAYUMONEYPG": { + "enabled": true + }, + "RUPIFIPG": { + "enabled": false + }, + "SIMPL": { + "enabled": true + } + }, + "payment_selection_lock": { + "enabled": false, + "default_options": "", + "payment_identifier": "" + }, + "mode_of_payment": "UNIKET_B2B", + "source": "UNIKET", + "enabled": true, + "cod_amount_limit": 100000, + "cod_charges": 1500 + }, + "order": { + "enabled": true, + "force_reassignment": false + }, + "logistics": { + "logistics_by_seller": false, + "serviceability_check": true, + "same_day_delivery": true, + "dp_assignment": true + }, + "business": "retail", + "comms_enabled": true, + "platforms": [ + "uniket_wholesale" + ], + "_id": "5e04c76b8dd8c003577fdd0a", + "loyalty_points": { + "enabled": true, + "auto_apply": false + }, + "app": "000000000000000000000004", + "created_at": "2019-12-26T14:44:59.835Z", + "modified_at": "2021-03-09T15:40:29.208Z", + "__v": 3, + "modified_by": "5e199eed98cfe16dc61385de" +} +``` +
    + + + + + + + + + +--- + + +#### partiallyUpdateInventoryConfig +Partially update application configuration + + + + +```swift +client.application("").configuration.partiallyUpdateInventoryConfig(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | AppInventoryPartialUpdate | yes | Request body | + + +Partially update application configuration for various features and data + +*Returned Response:* + + + + +[ApplicationInventory](#ApplicationInventory) + +Success + + + + +
    +  Example: + +```json +{ + "inventory": { + "brand": { + "criteria": "all", + "brands": [] + }, + "store": { + "criteria": "filter", + "stores": [], + "rules": [ + { + "companies": [ + 1, + 3, + 4 + ], + "brands": [] + } + ] + }, + "category": { + "criteria": "all", + "categories": [] + }, + "price": { + "min": 1, + "max": 10000 + }, + "discount": { + "min": 0, + "max": 100 + }, + "out_of_stock": true, + "franchise_enabled": true, + "exclude_category": [], + "image": [ + "standard", + "substandard", + "default" + ], + "company_store": [] + }, + "authentication": { + "required": true, + "provider": "fynd" + }, + "article_assignment": { + "rules": { + "store_priority": { + "enabled": false, + "storetype_order": [] + } + }, + "post_order_reassignment": true + }, + "reward_points": { + "credit": { + "enabled": true + }, + "debit": { + "enabled": true, + "auto_apply": false, + "strategy_channel": "REWARDS" + } + }, + "cart": { + "delivery_charges": { + "enabled": true, + "charges": [ + { + "threshold": 1000, + "charges": 49 + }, + { + "threshold": 200000, + "charges": 79 + } + ] + }, + "enabled": true, + "max_cart_items": 0, + "min_cart_value": 120, + "bulk_coupons": true, + "revenue_engine_coupon": false + }, + "payment": { + "callback_url": { + "app": "", + "web": "" + }, + "methods": { + "PL": { + "enabled": true + }, + "CARD": { + "enabled": true + }, + "NB": { + "enabled": true + }, + "WL": { + "enabled": true + }, + "PS": { + "enabled": true + }, + "UPI": { + "enabled": true + }, + "QR": { + "enabled": true + }, + "COD": { + "enabled": true + }, + "PP": { + "enabled": true + }, + "JP": { + "enabled": false + }, + "PAC": { + "enabled": false + }, + "FC": { + "enabled": false + }, + "JIOPP": { + "enabled": false + }, + "STRIPEPG": { + "enabled": true + }, + "JUSPAYPG": { + "enabled": false + }, + "PAYUBIZPG": { + "enabled": true + }, + "PAYUMONEYPG": { + "enabled": true + }, + "RUPIFIPG": { + "enabled": false + }, + "SIMPL": { + "enabled": true + } + }, + "payment_selection_lock": { + "enabled": false, + "default_options": "", + "payment_identifier": "" + }, + "mode_of_payment": "UNIKET_B2B", + "source": "UNIKET", + "enabled": true, + "cod_amount_limit": 100000, + "cod_charges": 1500 + }, + "order": { + "enabled": true, + "force_reassignment": false + }, + "logistics": { + "logistics_by_seller": false, + "serviceability_check": true, + "same_day_delivery": true, + "dp_assignment": true + }, + "business": "retail", + "comms_enabled": true, + "platforms": [ + "uniket_wholesale" + ], + "_id": "5e04c76b8dd8c003577fdd0a", + "loyalty_points": { + "enabled": true, + "auto_apply": false + }, + "app": "000000000000000000000004", + "created_at": "2019-12-26T14:44:59.835Z", + "modified_at": "2021-03-09T15:40:29.208Z", + "__v": 3, + "modified_by": "5e199eed98cfe16dc61385de" +} +``` +
    + + + + + + + + + +--- + + +#### getAppCurrencyConfig +Get application enabled currency list + + + + +```swift +client.application("").configuration.getAppCurrencyConfig() { (response, error) in + // Use response +} +``` + + + + + + +Get application enabled currency list + +*Returned Response:* + + + + +[AppSupportedCurrency](#AppSupportedCurrency) + +Success + + + + +
    +  Example: + +```json +{ + "_id": "5ec7a85965c3893857538d93", + "supported_currency": [ + "5ec75d11f7bfb5a7d38f3524", + "5ec75d11f7bfb54d798f3516", + "5ec75d11f7bfb553b88f355f", + "5ec75d11f7bfb559d08f34d5", + "5ec75d11f7bfb5d1e98f34da" + ], + "application": "000000000000000000000004", + "default_currency": { + "ref": "5ec75d11f7bfb54d798f3516", + "code": "USD" + }, + "created_at": "2020-05-22T10:24:25.984Z", + "modified_at": "2021-03-09T10:47:32.664Z" +} +``` +
    + + + + + + + + + +--- + + +#### updateAppCurrencyConfig +Add initial application supported currency + + + + +```swift +client.application("").configuration.updateAppCurrencyConfig(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | AppSupportedCurrency | yes | Request body | + + +Add initial application supported currency for various features and data. Default INR will be enabled. + +*Returned Response:* + + + + +[AppSupportedCurrency](#AppSupportedCurrency) + +Success + + + + +
    +  Example: + +```json +{ + "_id": "5ec7a85965c3893857538d93", + "supported_currency": [ + "5ec75d11f7bfb5a7d38f3524", + "5ec75d11f7bfb54d798f3516", + "5ec75d11f7bfb553b88f355f", + "5ec75d11f7bfb559d08f34d5", + "5ec75d11f7bfb5d1e98f34da" + ], + "application": "000000000000000000000004", + "default_currency": { + "ref": "5ec75d11f7bfb54d798f3516", + "code": "USD" + }, + "created_at": "2020-05-22T10:24:25.984Z", + "modified_at": "2021-03-09T10:47:32.664Z" +} +``` +
    + + + + + + + + + +--- + + +#### getAppSupportedCurrency +Get currencies enabled in the application + + + + +```swift +client.application("").configuration.getAppSupportedCurrency() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get a list of currencies allowed in the current application. Moreover, get the name, code, symbol, and the decimal digits of the currencies. + +*Returned Response:* + + + + +[AppCurrencyResponse](#AppCurrencyResponse) + +Success. Check the example shown below or refer `AppCurrencyResponse` for more details. + + + + +
    +  Example: + +```json +{ + "application": "000000000000000000000001", + "default_currency": { + "ref": "5ecf6122d953d4242c044907", + "code": "INR" + }, + "supported_currency": [ + { + "_id": "5ecf6122d953d4242c044907", + "is_active": true, + "name": "Indian Rupee", + "code": "INR", + "decimal_digits": 2, + "symbol": "₹", + "created_at": "2020-05-28T06:58:42.532Z", + "modified_at": "2021-04-05T16:44:14.358Z" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getOrderingStoresByFilter +Get ordering store by filter + + + + +```swift +client.application("").configuration.getOrderingStoresByFilter(pageNo: pageNo, pageSize: pageSize, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Current page no | +| pageSize | Int? | no | Current request items count | +| body | FilterOrderingStoreRequest | yes | Request body | + + +Get ordering store by filter + +*Returned Response:* + + + + +[OrderingStores](#OrderingStores) + +Success + + + + +
    +  Example: + +```json +{ + "page": { + "type": "number", + "size": 10, + "current": 1, + "has_next": true, + "item_total": 583 + }, + "items": [ + { + "address": { + "state": "MAHARASHTRA", + "address1": "SAGAR TECH PLAZA, SAKINAKA", + "lat_long": { + "type": "Point", + "coordinates": [ + 1, + 1 + ] + }, + "pincode": 400070, + "country": "INDIA", + "city": "MUMBAI" + }, + "_id": "5f586563f509dd000145c02d", + "store_type": "high_street", + "uid": 11016, + "store_code": "HS-0c532", + "display_name": " Brand Company Store 11", + "name": " Brand Company Store 11", + "pincode": 400070, + "code": "HS-0c532" + }, + { + "address": { + "state": "MAHARASHTRA", + "address1": "UNNAMED ROAD, VASAI EAST SALT PLANT", + "lat_long": { + "type": "Point", + "coordinates": [ + 72.84293219999999, + 19.3805675 + ] + }, + "address2": "VASAI EAST SALT PLANT, VASAI EAST, ", + "pincode": 401208, + "country": "INDIA", + "city": "VIRAR", + "landmark": "" + }, + "_id": "5f585934f509dd000145c025", + "store_type": "high_street", + "uid": 11567, + "store_code": "123456", + "display_name": "2nd Store", + "name": "2nd Store", + "pincode": 401208, + "code": "123456" + }, + { + "address": { + "state": "GUJARAT", + "address1": "32, AANAND SHOPPING CENTRE ", + "lat_long": { + "type": "Point", + "coordinates": [ + 1, + 1 + ] + }, + "pincode": 380001, + "country": "INDIA", + "city": "AHMEDABAD" + }, + "_id": "5f587b5ef509dd000145c02f", + "store_type": "high_street", + "uid": 11568, + "store_code": "12345", + "display_name": "3rd ", + "name": "3rd ", + "pincode": 380001, + "code": "12345" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### updateOrderingStoreConfig +Add/Update ordering store config + + + + +```swift +client.application("").configuration.updateOrderingStoreConfig(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | OrderingStoreConfig | yes | Request body | + + +Add/Update ordering store config. + +*Returned Response:* + + + + +[DeploymentMeta](#DeploymentMeta) + +Success + + + + +
    +  Example: + +```json +{ + "deployed_stores": [ + 1, + 10 + ], + "all_stores": false, + "enabled": true, + "type": "hard", + "_id": "5e7e5e4d6b5f3b4b54c95f9c", + "app": "000000000000000000000004", + "__v": 6 +} +``` +
    + + + + + + + + + +--- + + +#### getStaffOrderingStores +Get deployment stores + + + + +```swift +client.application("").configuration.getStaffOrderingStores(pageNo: pageNo, pageSize: pageSize, q: q) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | +| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | +| q | String? | no | Store code or name of the ordering store. | + + + +Use this API to retrieve the details of all stores access given to the staff member (the selling locations where the application will be utilized for placing orders). + +*Returned Response:* + + + + +[OrderingStoresResponse](#OrderingStoresResponse) + +Success. Check the example shown below or refer `OrderingStoresResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getDomains +Get attached domain list + + + + +```swift +client.application("").configuration.getDomains() { (response, error) in + // Use response +} +``` + + + + + + +Get attached domain list. + +*Returned Response:* + + + + +[DomainsResponse](#DomainsResponse) + +Success + + + + +
    +  Example: + +```json +{ + "domains": [ + { + "_id": "5eb1177748312a3bd55d0f1e", + "verified": true, + "name": "uniket.hostx0.de", + "is_primary": true, + "is_shortlink": false + }, + { + "verified": true, + "is_primary": false, + "is_shortlink": true, + "_id": "5f0858c5f86e00cd42dccc8d", + "name": "jd.hostx0.de" + }, + { + "verified": true, + "is_primary": false, + "is_shortlink": false, + "_id": "6048497e87f5730423149190", + "name": "testdm.hostx0.de" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### addDomain +Add new domain to application + + + + +```swift +client.application("").configuration.addDomain(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | DomainAddRequest | yes | Request body | + + +Add new domain to application. + +*Returned Response:* + + + + +[Domain](#Domain) + +Success + + + + +
    +  Example: + +```json +{ + "name": "testdm.hostx0.de", + "verified": true, + "txtRecords": [], + "message": "New domain added successfully", + "is_primary": false, + "is_shortlink": false, + "_id": "6048497e87f5730423149190" +} +``` +
    + + + + + + + + + +--- + + +#### removeDomainById +Remove attached domain + + + + +```swift +client.application("").configuration.removeDomainById(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Domain _id | + + + +Remove attached domain. + +*Returned Response:* + + + + +[SuccessMessageResponse](#SuccessMessageResponse) + +Success + + + + +
    +  Example: + +```json +{ + "message": "Domain removed successfully" +} +``` +
    + + + + + + + + + +--- + + +#### changeDomainType +Change domain type + + + + +```swift +client.application("").configuration.changeDomainType(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | UpdateDomainTypeRequest | yes | Request body | + + +Change a domain to Primary or Shortlink domain + +*Returned Response:* + + + + +[DomainsResponse](#DomainsResponse) + +Success + + + + +
    +  Example: + +```json +{ + "domains": [ + { + "_id": "5eb1177748312a3bd55d0f1e", + "verified": true, + "name": "uniket.hostx0.de", + "is_primary": true, + "is_shortlink": false + }, + { + "verified": true, + "is_primary": false, + "is_shortlink": true, + "_id": "5f0858c5f86e00cd42dccc8d", + "name": "jd.hostx0.de" + }, + { + "verified": true, + "is_primary": false, + "is_shortlink": false, + "_id": "6048497e87f5730423149190", + "name": "testdm.hostx0.de" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getDomainStatus +Get domain connected status. + + + + +```swift +client.application("").configuration.getDomainStatus(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | DomainStatusRequest | yes | Request body | + + +Get domain connected status. Check if domain is live and mapped to appropriate IP to fynd servers. + +*Returned Response:* + + + + +[DomainStatusResponse](#DomainStatusResponse) + +Success + + + + +
    +  Example: + +```json +{ + "connected": true, + "status": [ + { + "display": "Domain TXT record entry 5d65089e031f9029f8e8dc2f", + "status": true + }, + { + "display": "Domain pointing to 18.217.232.69 A record", + "status": true + }, + { + "display": "Domain pointing to 18.188.115.251 A record", + "status": true + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### createApplication +Create application + + + + +```swift +client.configuration.createApplication(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CreateApplicationRequest | yes | Request body | + + +Create new application + +*Returned Response:* + + + + +[CreateAppResponse](#CreateAppResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getApplications +Get list of application under company + + + + +```swift +client.configuration.getApplications(pageNo: pageNo, pageSize: pageSize, q: q) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | | +| pageSize | Int? | no | | +| q | String? | no | Url encoded object used as mongodb query | + + + +Get list of application under company + +*Returned Response:* + + + + +[ApplicationsResponse](#ApplicationsResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getApplicationById +Get application data from id + + + + +```swift +client.application("").configuration.getApplicationById() { (response, error) in + // Use response +} +``` + + + + + + +Get application data from id + +*Returned Response:* + + + + +[Application](#Application) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getCurrencies +Get all currencies + + + + +```swift +client.configuration.getCurrencies() { (response, error) in + // Use response +} +``` + + + + + + +Get all currencies + +*Returned Response:* + + + + +[CurrenciesResponse](#CurrenciesResponse) + +Currencies Success response + + + + +
    +  Example: + +```json +{ + "items": [ + { + "_id": "5ec75d11f7bfb54d798f3516", + "is_active": true, + "name": "United States Dollar", + "code": "USD", + "created_at": "2020-05-22T05:03:13.354Z", + "modified_at": "2020-06-05T09:12:04.248Z", + "decimal_digits": 2, + "symbol": "$" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getDomainAvailibility +Check domain availibility before linking to application + + + + +```swift +client.configuration.getDomainAvailibility(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | DomainSuggestionsRequest | yes | Request body | + + +Check domain availibility before linking to application. Also sends domain suggestions with similar to queried domain. \ Custom domain search is currently powered by GoDaddy provider. + +*Returned Response:* + + + + +[DomainSuggestionsResponse](#DomainSuggestionsResponse) + +Success + + + + +
    +  Examples: + + +
    +  Suggestions for fynd domains + +```json +{ + "value": { + "domains": [ + { + "name": "test.hostx1.de", + "is_available": false + }, + { + "name": "testhive.hostx1.de", + "is_available": true + } + ] + } +} +``` +
    + +
    +  Suggestions for custom domains + +```json +{ + "value": { + "domains": [ + { + "name": "test25.in", + "unsupported": false, + "is_available": false + }, + { + "name": "try25.in", + "unsupported": false, + "is_available": true, + "price": 14.99, + "currency": "USD" + } + ] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getIntegrationById +Get integration data + + + + +```swift +client.configuration.getIntegrationById(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | Int | yes | Integration id | + + + +Get integration data + +*Returned Response:* + + + + +[Integration](#Integration) + +Success + + + + +
    +  Example: + +```json +{ + "_id": "5ec376ce848a005189acb312", + "validators": { + "company": { + "browser_script": "", + "json_schema": { + "type": "object", + "required": [ + "ip_address", + "icode", + "gds_entity_id", + "auth_key" + ], + "properties": { + "gds_entity_id": { + "type": "string", + "title": "GDS Entity ID", + "minLength": 3, + "maxLength": 10, + "pattern": "^[a-zA-Z0-9]+$", + "description": "GDS Entity ID is a unique identifier provided by Ginesys to you." + }, + "ip_address": { + "type": "string", + "title": "IP Address", + "pattern": "(\\d{1,3}\\.){3}\\d{1,3}", + "description": "Enter IP address provided by Ginesys for your POS server" + }, + "auth_key": { + "title": "Auth Key", + "type": "string", + "maxLength": 500, + "description": "Provide authentication token provided by Ginesys to you." + }, + "icode": { + "title": "ICODE", + "type": "string", + "enum": [ + "ean", + "upc", + "alu", + "sku_code" + ], + "description": "Please select the correct SKU identifier that you use to provide inventory to Fynd." + } + } + } + }, + "store": { + "browser_script": "", + "json_schema": { + "type": "object", + "properties": { + "location_id": { + "type": "string", + "title": "Location ID", + "description": "Provide site code as per POS/SAP." + }, + "ip_address": { + "type": "string", + "title": "IP Address", + "pattern": "(\\d{1,3}\\.){3}\\d{1,3}", + "description": "Enter IP address provided by Ginesys for your POS server" + } + } + } + } + }, + "description": "Sap Integration west ELM brands", + "constants": {}, + "name": "SAP RBL Integration", + "meta": [ + { + "public": true, + "_id": "5ee3e246129be17ce0b59ef4", + "name": "price_level", + "value": "store" + } + ], + "icon": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1589868232/addsale/platform/integrations/icon/z3kj9p8nidx4zzmdutdu.svg", + "owner": "5e60e43dcd08cf01069eb23e", + "created_at": "2020-05-19T06:03:58.757Z", + "modified_at": "2020-06-15T12:00:42.598Z", + "token": "qk60vXqk-", + "secret": "Gp0dYInpUV", + "__v": 13, + "description_html": "" +} +``` +
    + + + + + + + + + +--- + + +#### getAvailableOptIns +Get all available integration opt-ins + + + + +```swift +client.configuration.getAvailableOptIns(pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Current page no | +| pageSize | Int? | no | Current request items count | + + + +Get all available integration opt-ins + +*Returned Response:* + + + + +[GetIntegrationsOptInsResponse](#GetIntegrationsOptInsResponse) + +Success + + + + +
    +  Example: + +```json +{ + "items": [ + { + "validators": { + "company": { + "json_schema": [ + { + "display": "Host", + "key": "host", + "type": "text", + "tooltip": "Enter host address" + } + ], + "browser_script": "" + }, + "store": { + "json_schema": [], + "browser_script": "" + }, + "inventory": { + "json_schema": [], + "browser_script": "" + }, + "order": { + "json_schema": [], + "browser_script": "" + } + }, + "description": "awesome integration", + "description_html": "", + "constants": "{\"mop_mapping\":{\"FYND\":\"FYND\"}}", + "companies": [], + "support": [ + "inventory", + "order" + ], + "_id": "5e56089f4265cf2846d1e58c", + "name": "x0-1", + "meta": [ + { + "public": true, + "_id": "5e56089f4265cf81e1d1e58e", + "name": "wow", + "value": "1" + } + ], + "icon": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1582696589/addsale/platform/integrations/icon/jihgcoibfmdttgiukwg0.png", + "owner": "5e55fe074bda3c392ed9eab2", + "created_at": "2020-02-26T05:56:47.214Z", + "modified_at": "2021-03-02T12:29:03.554Z", + "token": "fKoHRW5H", + "secret": "d1E85CTmf", + "__v": 12 + }, + { + "validators": { + "company": { + "json_schema": [], + "browser_script": "" + }, + "store": { + "json_schema": [], + "browser_script": "" + }, + "inventory": { + "json_schema": [], + "browser_script": "" + }, + "order": { + "json_schema": [], + "browser_script": "" + } + }, + "description": "jabardast", + "description_html": "", + "constants": "{\"mop_mapping\":{\"FYND\":\"FYND\"}}", + "companies": [], + "support": [ + "inventory", + "order" + ], + "_id": "5e5608bf4265cf7198d1e58f", + "name": "x0-2", + "meta": [ + { + "public": false, + "_id": "5e5608bf4265cf813fd1e590", + "name": "wow", + "value": "1" + } + ], + "icon": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1582696633/addsale/platform/integrations/icon/cstvvkgjgip1ja56gq4x.png", + "owner": "5e55fe074bda3c392ed9eab2", + "created_at": "2020-02-26T05:57:19.875Z", + "modified_at": "2021-02-15T05:23:55.962Z", + "token": "3h3_mnzp", + "secret": "dgGHrIlFG", + "__v": 7 + } + ], + "page": { + "type": "number", + "current": 1, + "size": 50, + "item_total": 24, + "has_next": false + } +} +``` +
    + + + + + + + + + +--- + + +#### getSelectedOptIns +Get company/store level integration opt-ins + + + + +```swift +client.configuration.getSelectedOptIns(level: level, uid: uid, pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| level | String | yes | Integration level | +| uid | Int | yes | Integration level uid | +| pageNo | Int? | no | Current page no | +| pageSize | Int? | no | Current request items count | + + + +Get company/store level integration opt-ins + +*Returned Response:* + + + + +[GetIntegrationsOptInsResponse](#GetIntegrationsOptInsResponse) + +Success + + + + +
    +  Example: + +```json +{ + "items": [ + { + "validators": { + "company": { + "json_schema": [ + { + "display": "Host", + "key": "host", + "type": "text", + "tooltip": "Enter host address" + } + ], + "browser_script": "" + }, + "store": { + "json_schema": [], + "browser_script": "" + }, + "inventory": { + "json_schema": [], + "browser_script": "" + }, + "order": { + "json_schema": [], + "browser_script": "" + } + }, + "description": "awesome integration", + "description_html": "", + "constants": "{\"mop_mapping\":{\"FYND\":\"FYND\"}}", + "companies": [], + "support": [ + "inventory", + "order" + ], + "_id": "5e56089f4265cf2846d1e58c", + "name": "x0-1", + "meta": [ + { + "public": true, + "_id": "5e56089f4265cf81e1d1e58e", + "name": "wow", + "value": "1" + } + ], + "icon": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1582696589/addsale/platform/integrations/icon/jihgcoibfmdttgiukwg0.png", + "owner": "5e55fe074bda3c392ed9eab2", + "created_at": "2020-02-26T05:56:47.214Z", + "modified_at": "2021-03-02T12:29:03.554Z", + "token": "fKoHRW5H", + "secret": "d1E85CTmf", + "__v": 12 + }, + { + "validators": { + "company": { + "json_schema": [], + "browser_script": "" + }, + "store": { + "json_schema": [], + "browser_script": "" + }, + "inventory": { + "json_schema": [], + "browser_script": "" + }, + "order": { + "json_schema": [], + "browser_script": "" + } + }, + "description": "jabardast", + "description_html": "", + "constants": "{\"mop_mapping\":{\"FYND\":\"FYND\"}}", + "companies": [], + "support": [ + "inventory", + "order" + ], + "_id": "5e5608bf4265cf7198d1e58f", + "name": "x0-2", + "meta": [ + { + "public": false, + "_id": "5e5608bf4265cf813fd1e590", + "name": "wow", + "value": "1" + } + ], + "icon": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1582696633/addsale/platform/integrations/icon/cstvvkgjgip1ja56gq4x.png", + "owner": "5e55fe074bda3c392ed9eab2", + "created_at": "2020-02-26T05:57:19.875Z", + "modified_at": "2021-02-15T05:23:55.962Z", + "token": "3h3_mnzp", + "secret": "dgGHrIlFG", + "__v": 7 + } + ], + "page": { + "type": "number", + "current": 1, + "size": 50, + "item_total": 24, + "has_next": false + } +} +``` +
    + + + + + + + + + +--- + + +#### getIntegrationLevelConfig +Get integration level config + + + + +```swift +client.configuration.getIntegrationLevelConfig(id: id, level: level, opted: opted, checkPermission: checkPermission) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Integration id | +| level | String | yes | Integration level | +| opted | Bool? | no | Filter on opted stores | +| checkPermission | Bool? | no | Filter on if permissions are present | + + + +Get integration/integration-opt-in level config + +*Returned Response:* + + + + +[IntegrationConfigResponse](#IntegrationConfigResponse) + +Success + + + + +
    +  Example: + +```json +{ + "items": [ + { + "opted": false, + "permissions": [], + "last_patch": [], + "_id": "5ec377f2848a0073feacb31b", + "integration": "5ec376ce848a005189acb312", + "level": "store", + "uid": 1, + "meta": [], + "token": "1RuGX0Fyp", + "created_at": "2020-05-19T06:08:50.199Z", + "modified_at": "2020-08-17T07:54:01.809Z", + "__v": 14, + "data": { + "location_id": "09876", + "ip_address": "1.2.3.4" + } + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### updateLevelIntegration +Update a store level opt-in for integration + + + + +```swift +client.configuration.updateLevelIntegration(id: id, level: level, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Integration id | +| level | String | yes | Integration level | +| body | UpdateIntegrationLevelRequest | yes | Request body | + + +Update a store level opt-in for integration + +*Returned Response:* + + + + +[IntegrationLevel](#IntegrationLevel) + +Success + + + + +
    +  Example: + +```json +{ + "opted": false, + "permissions": [], + "last_patch": [], + "_id": "5ec377f2848a0073feacb31b", + "integration": "5ec376ce848a005189acb312", + "level": "store", + "uid": 1, + "meta": [], + "token": "1RuGX0Fyp", + "created_at": "2020-05-19T06:08:50.199Z", + "modified_at": "2020-08-17T07:54:01.809Z", + "__v": 14, + "data": { + "location_id": "09876", + "ip_address": "1.2.3.4" + } +} +``` +
    + + + + + + + + + +--- + + +#### getIntegrationByLevelId +Get level data for integration + + + + +```swift +client.configuration.getIntegrationByLevelId(id: id, level: level, uid: uid) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Integration id | +| level | String | yes | Integration level | +| uid | Int | yes | Integration level uid | + + + +Get level data for integration + +*Returned Response:* + + + + +[IntegrationLevel](#IntegrationLevel) + +Success + + + + +
    +  Example: + +```json +{ + "opted": false, + "permissions": [], + "last_patch": [], + "_id": "5ec377f2848a0073feacb31b", + "integration": "5ec376ce848a005189acb312", + "level": "store", + "uid": 1, + "meta": [], + "token": "1RuGX0Fyp", + "created_at": "2020-05-19T06:08:50.199Z", + "modified_at": "2020-08-17T07:54:01.809Z", + "__v": 14, + "data": { + "location_id": "09876", + "ip_address": "1.2.3.4" + } +} +``` +
    + + + + + + + + + +--- + + +#### updateLevelUidIntegration +Update a store level opt-in for integration + + + + +```swift +client.configuration.updateLevelUidIntegration(id: id, level: level, uid: uid, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Integration id | +| level | String | yes | Integration level | +| uid | Int | yes | Integration level uid | +| body | IntegrationLevel | yes | Request body | + + +Update a store level opt-in for integration + +*Returned Response:* + + + + +[IntegrationLevel](#IntegrationLevel) + +Success + + + + +
    +  Example: + +```json +{ + "opted": false, + "permissions": [], + "last_patch": [], + "_id": "5ec377f2848a0073feacb31b", + "integration": "5ec376ce848a005189acb312", + "level": "store", + "uid": 1, + "meta": [], + "token": "1RuGX0Fyp", + "created_at": "2020-05-19T06:08:50.199Z", + "modified_at": "2020-08-17T07:54:01.809Z", + "__v": 14, + "data": { + "location_id": "09876", + "ip_address": "1.2.3.4" + } +} +``` +
    + + + + + + + + + +--- + + +#### getLevelActiveIntegrations +Check store has active integration + + + + +```swift +client.configuration.getLevelActiveIntegrations(id: id, level: level, uid: uid) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Integration id | +| level | String | yes | Integration level | +| uid | Int | yes | Integration level uid | + + + +API checks if a store is already opted in any other integrations + +*Returned Response:* + + + + +[OptedStoreIntegration](#OptedStoreIntegration) + +Success + + + + +
    +  Example: + +```json +{ + "opted": false, + "permissions": [], + "last_patch": [], + "_id": "5ec377f2848a0073feacb31b", + "integration": "5ec376ce848a005189acb312", + "level": "store", + "uid": 1, + "meta": [], + "token": "1RuGX0Fyp", + "created_at": "2020-05-19T06:08:50.199Z", + "modified_at": "2020-08-17T07:54:01.809Z", + "__v": 14, + "data": { + "location_id": "09876", + "ip_address": "1.2.3.4" + } +} +``` +
    + + + + + + + + + +--- + + +#### getBrandsByCompany +Get brands by company + + + + +```swift +client.configuration.getBrandsByCompany(q: q) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| q | String? | no | Search text for brand name | + + + +Get brands by company + +*Returned Response:* + + + + +[BrandsByCompanyResponse](#BrandsByCompanyResponse) + +Success + + + + +
    +  Example: + +```json +{ + "brands": [ + { + "name": "5th Avenue", + "value": 476, + "brand_logo_url": "https://hdn-1.addsale.com/x0/seller/pictures/logo/original/--unnamed--/1595615012186.jpeg", + "brand_banner_url": "https://hdn-1.addsale.com/x0/seller/pictures/landscape-banner/original/--unnamed--/1595615012724.jpeg", + "brand_banner_portrait_url": "https://hdn-1.addsale.com/x0/seller/pictures/portrait-banner/original/--unnamed--/1595615013203.jpeg" + }, + { + "name": "Abhay", + "value": 47, + "brand_logo_url": "https://hdn-1.fynd.com/brands/pictures/square-logo/resize-h:200,w:0/9fG6jZUJV-brand-Slamay.png", + "brand_banner_url": "https://hdn-1.addsale.com/x0/seller/pictures/landscape-banner/original/cpApcg_insta_01.jpg034422ca-b739-4a30-ba9c-87ca32e8c2ef/cpApcg_insta_01.jpg", + "brand_banner_portrait_url": "https://hdn-1.addsale.com/x0/seller/pictures/portrait-banner/original/mtaSMv_insta_01.jpga088b881-886d-4b5a-b82f-139bd2aa3f35/mtaSMv_insta_01.jpg" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getCompanyByBrands +Get company by brand uids + + + + +```swift +client.configuration.getCompanyByBrands(pageNo: pageNo, pageSize: pageSize, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Current page no | +| pageSize | Int? | no | Current request items count | +| body | CompanyByBrandsRequest | yes | Request body | + + +Get company by brand uids + +*Returned Response:* + + + + +[CompanyByBrandsResponse](#CompanyByBrandsResponse) + +Success + + + + +
    +  Example: + +```json +{ + "items": [ + { + "company_name": "RELIANCE RETAIL LTD", + "company_id": 1 + }, + { + "company_name": "SARASUOLE PRIVATE LIMITED", + "company_id": 3 + }, + { + "company_name": "Lloyd Palek", + "company_id": 4 + } + ], + "page": { + "type": "number", + "current": 1, + "size": 200, + "item_total": 171, + "has_next": false + } +} +``` +
    + + + + + + + + + +--- + + +#### getStoreByBrands +Get stores by brand uids + + + + +```swift +client.configuration.getStoreByBrands(pageNo: pageNo, pageSize: pageSize, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Current page no | +| pageSize | Int? | no | Current request items count | +| body | StoreByBrandsRequest | yes | Request body | + + +Get stores by brand uids + +*Returned Response:* + + + + +[StoreByBrandsResponse](#StoreByBrandsResponse) + +Success + + + + +
    +  Example: + +```json +{ + "items": [ + { + "store_name": "RRL01", + "store_id": 1, + "store_type": "warehouse", + "store_code": "WH_8513", + "store_address": { + "state": "MAHARASHTRA", + "address1": "SHOPSENSE RETAIL TECHNOLOGIES PRIVATE LIMITED 1ST FLOOR WEWORK VIJAY DIAMOND, CROSS RD B, AJIT NAGAR,", + "lat_long": { + "type": "Point", + "coordinates": [ + 72.8691788, + 19.1174114 + ] + }, + "address2": "KONDIVITA, ANDHERI EAST, MUMBAI, MAHARASHTRA 400069", + "pincode": 400059, + "country": "INDIA", + "city": "MUMBAI" + }, + "company": { + "uid": 1, + "name": "RELIANCE RETAIL LTD" + } + }, + { + "store_name": "RUOSH WAREHOUSE", + "store_id": 2, + "store_type": "warehouse", + "store_code": "RUOSH43", + "store_address": { + "state": "MAHARASHTRA", + "address1": "RAUNAK CITY SECTOR 4 D10, SAPAD GAON", + "lat_long": { + "type": "Point", + "coordinates": [ + 73.121952, + 19.2645048 + ] + }, + "address2": "SAPAD GAON, KHADAKPADA, ", + "pincode": 421301, + "country": "INDIA", + "city": "THANE", + "landmark": "near taj" + }, + "company": { + "uid": 3, + "name": "SARASUOLE PRIVATE LIMITED" + } + } + ], + "page": { + "type": "number", + "current": 1, + "size": 200, + "item_total": 762, + "has_next": true + } +} +``` +
    + + + + + + + + + +--- + + +#### getOtherSellerApplications +Get other seller applications + + + + +```swift +client.configuration.getOtherSellerApplications(pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Current page no | +| pageSize | Int? | no | Current request items count | + + + +Get other seller applications who has opted current company as inventory + +*Returned Response:* + + + + +[OtherSellerApplications](#OtherSellerApplications) + +Success + + + + +
    +  Example: + +```json +{ + "items": [ + { + "name": "intent 2", + "description": "", + "_id": "5f030880f019afd636889afc", + "domain": "intent.hostx0.de", + "company": { + "uid": 94, + "name": "DummyImran" + }, + "opt_type": "store" + }, + { + "name": "new application imran", + "description": "", + "_id": "5f03f5d17692029e2d1a50a5", + "domain": "imranstore.hostx0.de", + "company": { + "uid": 94, + "name": "DummyImran" + }, + "opt_type": "store" + }, + { + "name": "helo", + "description": "", + "_id": "5f03f63b769202170c1a50a9", + "domain": "helo.hostx0.de", + "company": { + "uid": 7, + "name": "Zack Burgdorf" + }, + "opt_type": "store" + } + ], + "page": { + "type": "number", + "current": 1, + "size": 10, + "item_total": 20, + "has_next": true + } +} +``` +
    + + + + + + + + + +--- + + +#### getOtherSellerApplicationById +Get other seller applications + + + + +```swift +client.configuration.getOtherSellerApplicationById(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Application Id | + + + +Get other seller application + +*Returned Response:* + + + + +[OptedApplicationResponse](#OptedApplicationResponse) + +Success + + + + +
    +  Example: + +```json +{ + "name": "intent 2", + "description": "", + "_id": "5f030880f019afd636889afc", + "domain": "intent.hostx0.de", + "company": { + "uid": 94, + "name": "DummyImran" + }, + "opted_inventory": { + "opt_type": { + "key": "store", + "display": "Store" + }, + "items": [ + { + "name": "RRL01", + "id": 1, + "store_code": "WH_8513", + "_id": "5ec2c0b168fc2800017112f5", + "modified_on": "2020-09-09T04:25:55.843Z", + "uid": 1, + "address": { + "state": "MAHARASHTRA", + "address1": "SHOPSENSE RETAIL TECHNOLOGIES PRIVATE LIMITED 1ST FLOOR WEWORK VIJAY DIAMOND, CROSS RD B, AJIT NAGAR,", + "lat_long": { + "type": "Point", + "coordinates": [ + 72.8691788, + 19.1174114 + ] + }, + "address2": "KONDIVITA, ANDHERI EAST, MUMBAI, MAHARASHTRA 400069", + "pincode": 400059, + "country": "INDIA", + "city": "MUMBAI" + }, + "display_name": "RRL01", + "store_type": "warehouse", + "company_id": 1 + } + ] + }, + "opt_out_inventory": { + "store": [], + "company": [] + } +} +``` +
    + + + + + + + + + +--- + + +#### optOutFromApplication +Opt out company or store from other seller application + + + + +```swift +client.configuration.optOutFromApplication(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Application Id | +| body | OptOutInventory | yes | Request body | + + +Opt out company or store from other seller application + +*Returned Response:* + + + + +[SuccessMessageResponse](#SuccessMessageResponse) + +Success + + + + +
    +  Example: + +```json +{ + "message": "Updated opt out data" +} +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [ApplicationInventory](#ApplicationInventory) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | inventory | [AppInventoryConfig](#AppInventoryConfig)? | yes | | + | authentication | [AuthenticationConfig](#AuthenticationConfig)? | yes | | + | articleAssignment | [ArticleAssignmentConfig](#ArticleAssignmentConfig)? | yes | | + | rewardPoints | [RewardPointsConfig](#RewardPointsConfig)? | yes | | + | cart | [AppCartConfig](#AppCartConfig)? | yes | | + | payment | [AppPaymentConfig](#AppPaymentConfig)? | yes | | + | order | [AppOrderConfig](#AppOrderConfig)? | yes | | + | logistics | [AppLogisticsConfig](#AppLogisticsConfig)? | yes | | + | business | String? | yes | | + | commsEnabled | Bool? | yes | | + | platforms | [String]? | yes | | + | id | String? | yes | | + | loyaltyPoints | [LoyaltyPointsConfig](#LoyaltyPointsConfig)? | yes | | + | app | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | modifiedBy | String? | yes | | + +--- + + + + + #### [AppInventoryConfig](#AppInventoryConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | brand | [InventoryBrand](#InventoryBrand)? | yes | | + | store | [InventoryStore](#InventoryStore)? | yes | | + | category | [InventoryCategory](#InventoryCategory)? | yes | | + | price | [InventoryPrice](#InventoryPrice)? | yes | | + | discount | [InventoryDiscount](#InventoryDiscount)? | yes | | + | outOfStock | Bool? | yes | | + | onlyVerifiedProducts | Bool? | yes | | + | franchiseEnabled | Bool? | yes | | + | excludeCategory | [[String: Any]]? | yes | | + | image | [String]? | yes | | + | companyStore | [[String: Any]]? | yes | | + +--- + + + + + #### [InventoryBrand](#InventoryBrand) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | criteria | String? | yes | | + | brands | [[String: Any]]? | yes | | + +--- + + + + + #### [InventoryStore](#InventoryStore) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | criteria | String? | yes | | + | stores | [[String: Any]]? | yes | | + | rules | [AppStoreRules](#AppStoreRules)? | yes | | + +--- + + + + + #### [AppStoreRules](#AppStoreRules) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | companies | [Int]? | yes | | + | brands | [[String: Any]]? | yes | | + +--- + + + + + #### [InventoryCategory](#InventoryCategory) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | criteria | String? | yes | | + | categories | [[String: Any]]? | yes | | + +--- + + + + + #### [InventoryPrice](#InventoryPrice) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | min | Double? | yes | | + | max | Double? | yes | | + +--- + + + + + #### [InventoryDiscount](#InventoryDiscount) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | min | Double? | yes | | + | max | Double? | yes | | + +--- + + + + + #### [AuthenticationConfig](#AuthenticationConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | required | Bool? | yes | | + | provider | String? | yes | | + +--- + + + + + #### [ArticleAssignmentConfig](#ArticleAssignmentConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | rules | [ArticleAssignmentRules](#ArticleAssignmentRules)? | yes | | + | postOrderReassignment | Bool? | yes | | + +--- + + + + + #### [ArticleAssignmentRules](#ArticleAssignmentRules) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | storePriority | [StorePriority](#StorePriority)? | yes | | + +--- + + + + + #### [StorePriority](#StorePriority) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | storetypeOrder | [[String: Any]]? | yes | | + +--- + + + + + #### [AppCartConfig](#AppCartConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | deliveryCharges | [DeliveryCharges](#DeliveryCharges)? | yes | | + | enabled | Bool? | yes | | + | maxCartItems | Int? | yes | | + | minCartValue | Double? | yes | | + | bulkCoupons | Bool? | yes | | + | revenueEngineCoupon | Bool? | yes | | + +--- + + + + + #### [DeliveryCharges](#DeliveryCharges) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | charges | [Charges](#Charges)? | yes | | + +--- + + + + + #### [Charges](#Charges) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | threshold | Double? | yes | | + | charges | Double? | yes | | + +--- + + + + + #### [AppPaymentConfig](#AppPaymentConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | callbackUrl | [CallbackUrl](#CallbackUrl)? | yes | | + | methods | [Methods](#Methods)? | yes | | + | paymentSelectionLock | [PaymentSelectionLock](#PaymentSelectionLock)? | yes | | + | modeOfPayment | String? | yes | | + | source | String? | yes | | + | enabled | Bool? | yes | | + | codAmountLimit | Double? | yes | | + | codCharges | Double? | yes | | + +--- + + + + + #### [CallbackUrl](#CallbackUrl) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | app | String? | yes | | + | web | String? | yes | | + +--- + + + + + #### [Methods](#Methods) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pl | [PaymentModeConfig](#PaymentModeConfig)? | yes | | + | card | [PaymentModeConfig](#PaymentModeConfig)? | yes | | + | nb | [PaymentModeConfig](#PaymentModeConfig)? | yes | | + | wl | [PaymentModeConfig](#PaymentModeConfig)? | yes | | + | ps | [PaymentModeConfig](#PaymentModeConfig)? | yes | | + | upi | [PaymentModeConfig](#PaymentModeConfig)? | yes | | + | qr | [PaymentModeConfig](#PaymentModeConfig)? | yes | | + | cod | [PaymentModeConfig](#PaymentModeConfig)? | yes | | + | pp | [PaymentModeConfig](#PaymentModeConfig)? | yes | | + | jp | [PaymentModeConfig](#PaymentModeConfig)? | yes | | + | pac | [PaymentModeConfig](#PaymentModeConfig)? | yes | | + | fc | [PaymentModeConfig](#PaymentModeConfig)? | yes | | + | jiopp | [PaymentModeConfig](#PaymentModeConfig)? | yes | | + | stripepg | [PaymentModeConfig](#PaymentModeConfig)? | yes | | + | juspaypg | [PaymentModeConfig](#PaymentModeConfig)? | yes | | + | payubizpg | [PaymentModeConfig](#PaymentModeConfig)? | yes | | + | payumoneypg | [PaymentModeConfig](#PaymentModeConfig)? | yes | | + | rupifipg | [PaymentModeConfig](#PaymentModeConfig)? | yes | | + | simpl | [PaymentModeConfig](#PaymentModeConfig)? | yes | | + +--- + + + + + #### [PaymentModeConfig](#PaymentModeConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + +--- + + + + + #### [PaymentSelectionLock](#PaymentSelectionLock) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | defaultOptions | String? | yes | | + | paymentIdentifier | String? | yes | | + +--- + + + + + #### [AppOrderConfig](#AppOrderConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | forceReassignment | Bool? | yes | | + | message | String? | yes | | + +--- + + + + + #### [AppLogisticsConfig](#AppLogisticsConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | logisticsBySeller | Bool? | yes | | + | serviceabilityCheck | Bool? | yes | | + | sameDayDelivery | Bool? | yes | | + | dpAssignment | Bool? | yes | | + +--- + + + + + #### [LoyaltyPointsConfig](#LoyaltyPointsConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | autoApply | Bool? | yes | | + +--- + + + + + #### [AppInventoryPartialUpdate](#AppInventoryPartialUpdate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | rewardPoints | [RewardPointsConfig](#RewardPointsConfig)? | yes | | + | cart | [AppCartConfig](#AppCartConfig)? | yes | | + | payment | [AppPaymentConfig](#AppPaymentConfig)? | yes | | + | loyaltyPoints | [LoyaltyPointsConfig](#LoyaltyPointsConfig)? | yes | | + | commsEnabled | Bool? | yes | | + +--- + + + + + #### [BrandCompanyInfo](#BrandCompanyInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | companyName | String? | yes | | + | companyId | Int? | yes | | + +--- + + + + + #### [CompanyByBrandsRequest](#CompanyByBrandsRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | brands | Int | no | Brand uids | + | searchText | String? | yes | Search company by name | + +--- + + + + + #### [CompanyByBrandsResponse](#CompanyByBrandsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[BrandCompanyInfo](#BrandCompanyInfo)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [StoreByBrandsRequest](#StoreByBrandsRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | companyId | Int? | yes | Current company id for current company stores only. Don't send in case of cross selling enabled | + | brands | Int | no | Brand uids | + | searchText | String? | yes | Search store by name or store code | + +--- + + + + + #### [StoreByBrandsResponse](#StoreByBrandsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[BrandStoreInfo](#BrandStoreInfo)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [BrandStoreInfo](#BrandStoreInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | storeName | String? | yes | | + | storeId | Int? | yes | | + | storeType | String? | yes | | + | storeCode | String? | yes | | + | storeAddress | [OptedStoreAddress](#OptedStoreAddress)? | yes | | + | company | [OptedCompany](#OptedCompany)? | yes | | + +--- + + + + + #### [CompanyBrandInfo](#CompanyBrandInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | value | Int? | yes | | + | brandLogoUrl | String? | yes | | + | brandBannerUrl | String? | yes | | + | brandBannerPortraitUrl | String? | yes | | + +--- + + + + + #### [BrandsByCompanyResponse](#BrandsByCompanyResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | brands | [CompanyBrandInfo](#CompanyBrandInfo)? | yes | | + +--- + + + + + #### [CreateApplicationRequest](#CreateApplicationRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | app | [App](#App)? | yes | | + | configuration | [AppInventory](#AppInventory)? | yes | | + | domain | [AppDomain](#AppDomain)? | yes | | + +--- + + + + + #### [CreateAppResponse](#CreateAppResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | app | [Application](#Application)? | yes | | + | configuration | [ApplicationInventory](#ApplicationInventory)? | yes | | + +--- + + + + + #### [ApplicationsResponse](#ApplicationsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Application](#Application)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [MobileAppConfiguration](#MobileAppConfiguration) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isActive | Bool? | yes | | + | id | String? | yes | | + | appName | String? | yes | | + | landingImage | [LandingImage](#LandingImage)? | yes | | + | splashImage | [SplashImage](#SplashImage)? | yes | | + | application | String? | yes | | + | platformType | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + | packageName | String? | yes | | + +--- + + + + + #### [LandingImage](#LandingImage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | aspectRatio | String? | yes | | + | secureUrl | String? | yes | | + +--- + + + + + #### [SplashImage](#SplashImage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | aspectRatio | String? | yes | | + | secureUrl | String? | yes | | + +--- + + + + + #### [MobileAppConfigRequest](#MobileAppConfigRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appName | String? | yes | | + | landingImage | [LandingImage](#LandingImage)? | yes | | + | splashImage | [SplashImage](#SplashImage)? | yes | | + | isActive | Bool? | yes | | + +--- + + + + + #### [BuildVersionHistory](#BuildVersionHistory) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | versions | [BuildVersion](#BuildVersion)? | yes | | + | latestAvailableVersionName | String? | yes | | + +--- + + + + + #### [BuildVersion](#BuildVersion) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | application | String? | yes | | + | platformType | String? | yes | | + | buildStatus | String? | yes | | + | versionName | String? | yes | | + | versionCode | Int? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [AppSupportedCurrency](#AppSupportedCurrency) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | supportedCurrency | [String]? | yes | | + | application | String? | yes | | + | defaultCurrency | [DefaultCurrency](#DefaultCurrency)? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + +--- + + + + + #### [DefaultCurrency](#DefaultCurrency) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | ref | String? | yes | | + | code | String? | yes | | + +--- + + + + + #### [CurrencyConfig](#CurrencyConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | isActive | Bool? | yes | | + | name | String? | yes | | + | code | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | decimalDigits | Int? | yes | | + | symbol | String? | yes | | + +--- + + + + + #### [DomainAdd](#DomainAdd) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | Full domain name | + +--- + + + + + #### [DomainAddRequest](#DomainAddRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | domain | [DomainAdd](#DomainAdd)? | yes | | + +--- + + + + + #### [DomainsResponse](#DomainsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | domains | [[Domain](#Domain)]? | yes | | + +--- + + + + + #### [UpdateDomain](#UpdateDomain) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + +--- + + + + + #### [UpdateDomainTypeRequest](#UpdateDomainTypeRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | domain | [UpdateDomain](#UpdateDomain)? | yes | | + | action | String? | yes | | + +--- + + + + + #### [DomainStatusRequest](#DomainStatusRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | domainUrl | String? | yes | Domain url | + +--- + + + + + #### [DomainStatus](#DomainStatus) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | display | String? | yes | | + | status | Bool? | yes | | + +--- + + + + + #### [DomainStatusResponse](#DomainStatusResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | connected | Bool? | yes | | + | status | [[DomainStatus](#DomainStatus)]? | yes | | + +--- + + + + + #### [DomainSuggestionsRequest](#DomainSuggestionsRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | domainUrl | String? | yes | Domain url | + | custom | Bool? | yes | Get suggestion for custom domains or fynd domains | + +--- + + + + + #### [DomainSuggestion](#DomainSuggestion) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String | no | | + | unsupported | Bool? | yes | Whether TLD domain is supported or not | + | isAvailable | Bool | no | | + | price | Double? | yes | Price for purchasing a custom domain. Not present for fynd domain | + | currency | String? | yes | Custom domain price currency. Not present for fynd domain | + +--- + + + + + #### [DomainSuggestionsResponse](#DomainSuggestionsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | domains | [[DomainSuggestion](#DomainSuggestion)]? | yes | Domain url | + +--- + + + + + #### [GetIntegrationsOptInsResponse](#GetIntegrationsOptInsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[IntegrationOptIn](#IntegrationOptIn)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [IntegrationOptIn](#IntegrationOptIn) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | validators | [Validators](#Validators)? | yes | | + | description | String? | yes | | + | descriptionHtml | String? | yes | | + | constants | String? | yes | | + | companies | [[String: Any]]? | yes | | + | support | [String]? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | meta | [[IntegrationMeta](#IntegrationMeta)]? | yes | | + | icon | String? | yes | | + | owner | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | token | String? | yes | | + | secret | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [Validators](#Validators) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | company | [CompanyValidator](#CompanyValidator)? | yes | | + | store | [StoreValidator](#StoreValidator)? | yes | | + | inventory | [InventoryValidator](#InventoryValidator)? | yes | | + | order | [OrderValidator](#OrderValidator)? | yes | | + +--- + + + + + #### [CompanyValidator](#CompanyValidator) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | jsonSchema | [[JsonSchema](#JsonSchema)]? | yes | | + | browserScript | String? | yes | | + +--- + + + + + #### [JsonSchema](#JsonSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | display | String? | yes | | + | key | String? | yes | | + | type | String? | yes | | + | tooltip | String? | yes | | + +--- + + + + + #### [StoreValidator](#StoreValidator) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | jsonSchema | [[JsonSchema](#JsonSchema)]? | yes | | + | browserScript | String? | yes | | + +--- + + + + + #### [InventoryValidator](#InventoryValidator) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | jsonSchema | [[JsonSchema](#JsonSchema)]? | yes | | + | browserScript | String? | yes | | + +--- + + + + + #### [OrderValidator](#OrderValidator) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | jsonSchema | [[JsonSchema](#JsonSchema)]? | yes | | + | browserScript | String? | yes | | + +--- + + + + + #### [IntegrationMeta](#IntegrationMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isPublic | Bool? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [Integration](#Integration) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | validators | [Validators](#Validators)? | yes | | + | description | String? | yes | | + | descriptionHtml | String? | yes | | + | constants | [String: Any]? | yes | | + | companies | [[String: Any]]? | yes | | + | support | [String]? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | meta | [[IntegrationMeta](#IntegrationMeta)]? | yes | | + | icon | String? | yes | | + | owner | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | token | String? | yes | | + | secret | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [IntegrationConfigResponse](#IntegrationConfigResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[IntegrationLevel](#IntegrationLevel)]? | yes | | + +--- + + + + + #### [IntegrationLevel](#IntegrationLevel) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | opted | Bool? | yes | | + | permissions | [[String: Any]]? | yes | | + | lastPatch | [[LastPatch](#LastPatch)]? | yes | | + | id | String? | yes | | + | integration | String? | yes | | + | level | String? | yes | | + | uid | Int? | yes | | + | meta | [[IntegrationMeta](#IntegrationMeta)]? | yes | | + | token | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + | data | [String: Any]? | yes | | + +--- + + + + + #### [UpdateIntegrationLevelRequest](#UpdateIntegrationLevelRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[IntegrationLevel](#IntegrationLevel)]? | yes | | + +--- + + + + + #### [OptedStoreIntegration](#OptedStoreIntegration) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | otherOpted | Bool? | yes | | + | otherIntegration | [IntegrationOptIn](#IntegrationOptIn)? | yes | | + | otherEntity | [OtherEntity](#OtherEntity)? | yes | | + +--- + + + + + #### [OtherEntity](#OtherEntity) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | opted | Bool? | yes | | + | permissions | [String]? | yes | | + | lastPatch | [[LastPatch](#LastPatch)]? | yes | | + | id | String? | yes | | + | integration | String? | yes | | + | level | String? | yes | | + | uid | Int? | yes | | + | data | [OtherEntityData](#OtherEntityData)? | yes | | + | meta | [[String: Any]]? | yes | | + | token | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [LastPatch](#LastPatch) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | op | String? | yes | | + | path | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [OtherEntityData](#OtherEntityData) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | articleIdentifier | String? | yes | | + +--- + + + + + #### [App](#App) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | companyId | String? | yes | Current company id | + | channelType | String? | yes | | + | auth | [ApplicationAuth](#ApplicationAuth)? | yes | | + | name | String? | yes | User friendly name for application | + | desc | String? | yes | Basic description of application | + +--- + + + + + #### [AppInventory](#AppInventory) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | brand | [InventoryBrandRule](#InventoryBrandRule)? | yes | | + | store | [InventoryStoreRule](#InventoryStoreRule)? | yes | | + | image | [String]? | yes | | + | franchiseEnabled | Bool? | yes | | + | outOfStock | Bool? | yes | | + | onlyVerifiedProducts | Bool? | yes | | + | payment | [InventoryPaymentConfig](#InventoryPaymentConfig)? | yes | | + | articleAssignment | [InventoryArticleAssignment](#InventoryArticleAssignment)? | yes | | + +--- + + + + + #### [AppDomain](#AppDomain) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + +--- + + + + + #### [CompaniesResponse](#CompaniesResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [AppInventoryCompanies](#AppInventoryCompanies)? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [AppInventoryCompanies](#AppInventoryCompanies) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | name | String? | yes | | + | companyType | String? | yes | | + +--- + + + + + #### [StoresResponse](#StoresResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [AppInventoryStores](#AppInventoryStores)? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [AppInventoryStores](#AppInventoryStores) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | modifiedOn | String? | yes | | + | uid | Int? | yes | | + | name | String? | yes | | + | displayName | String? | yes | | + | storeType | String? | yes | | + | storeCode | String? | yes | | + | companyId | Int? | yes | | + +--- + + + + + #### [FilterOrderingStoreRequest](#FilterOrderingStoreRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | allStores | Bool? | yes | | + | deployedStores | [Int]? | yes | | + | q | String? | yes | | + +--- + + + + + #### [DeploymentMeta](#DeploymentMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | deployedStores | [Int]? | yes | | + | allStores | Bool? | yes | | + | enabled | Bool? | yes | | + | type | String? | yes | | + | id | String? | yes | | + | app | String? | yes | | + +--- + + + + + #### [OrderingStoreConfig](#OrderingStoreConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | deploymentMeta | [DeploymentMeta](#DeploymentMeta)? | yes | | + +--- + + + + + #### [OtherSellerCompany](#OtherSellerCompany) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | name | String? | yes | | + +--- + + + + + #### [OtherSellerApplication](#OtherSellerApplication) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | description | String? | yes | | + | id | String? | yes | | + | domain | String? | yes | | + | company | [OtherSellerCompany](#OtherSellerCompany)? | yes | | + | optType | String? | yes | | + +--- + + + + + #### [OtherSellerApplications](#OtherSellerApplications) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[OtherSellerApplication](#OtherSellerApplication)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [OptedApplicationResponse](#OptedApplicationResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | description | String? | yes | | + | id | String? | yes | | + | domain | String? | yes | | + | company | [OptedCompany](#OptedCompany)? | yes | | + | optedInventory | [OptedInventory](#OptedInventory)? | yes | | + | optOutInventory | [OptOutInventory](#OptOutInventory)? | yes | | + +--- + + + + + #### [OptedCompany](#OptedCompany) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uid | Int? | yes | | + | name | String? | yes | | + +--- + + + + + #### [OptedInventory](#OptedInventory) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | optType | [OptType](#OptType)? | yes | | + | items | [String: Any]? | yes | | + +--- + + + + + #### [OptType](#OptType) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | display | String? | yes | | + +--- + + + + + #### [OptedStore](#OptedStore) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | storeCode | String? | yes | | + | id | String? | yes | | + | modifiedOn | String? | yes | | + | uid | Int? | yes | | + | address | [OptedStoreAddress](#OptedStoreAddress)? | yes | | + | displayName | String? | yes | | + | storeType | String? | yes | | + | companyId | Int? | yes | | + +--- + + + + + #### [OptOutInventory](#OptOutInventory) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | store | [Int] | no | | + | company | [Int] | no | | + +--- + + + + + #### [TokenResponse](#TokenResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | tokens | [Tokens](#Tokens)? | yes | | + | id | String? | yes | | + | application | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [Tokens](#Tokens) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | firebase | [Firebase](#Firebase)? | yes | | + | moengage | [Moengage](#Moengage)? | yes | | + | segment | [Segment](#Segment)? | yes | | + | gtm | [Gtm](#Gtm)? | yes | | + | freshchat | [Freshchat](#Freshchat)? | yes | | + | safetynet | [Safetynet](#Safetynet)? | yes | | + | fyndRewards | [FyndRewards](#FyndRewards)? | yes | | + | googleMap | [GoogleMap](#GoogleMap)? | yes | | + +--- + + + + + #### [Firebase](#Firebase) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | credentials | [Credentials](#Credentials)? | yes | | + | enabled | Bool? | yes | | + +--- + + + + + #### [Credentials](#Credentials) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | ios | [Ios](#Ios)? | yes | | + | android | [Android](#Android)? | yes | | + | projectId | String? | yes | | + | gcmSenderId | String? | yes | | + | applicationId | String? | yes | | + | apiKey | String? | yes | | + +--- + + + + + #### [Ios](#Ios) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | applicationId | String? | yes | | + | apiKey | String? | yes | | + +--- + + + + + #### [Android](#Android) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | applicationId | String? | yes | | + | apiKey | String? | yes | | + +--- + + + + + #### [Moengage](#Moengage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | credentials | [MoengageCredentials](#MoengageCredentials)? | yes | | + | enabled | Bool? | yes | | + +--- + + + + + #### [MoengageCredentials](#MoengageCredentials) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appId | String? | yes | | + +--- + + + + + #### [Segment](#Segment) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | credentials | [SegmentCredentials](#SegmentCredentials)? | yes | | + | enabled | Bool? | yes | | + +--- + + + + + #### [SegmentCredentials](#SegmentCredentials) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | writeKey | String? | yes | | + +--- + + + + + #### [Gtm](#Gtm) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | credentials | [GtmCredentials](#GtmCredentials)? | yes | | + | enabled | Bool? | yes | | + +--- + + + + + #### [GtmCredentials](#GtmCredentials) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | apiKey | String? | yes | | + +--- + + + + + #### [Freshchat](#Freshchat) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | credentials | [FreshchatCredentials](#FreshchatCredentials)? | yes | | + | enabled | Bool? | yes | | + +--- + + + + + #### [FreshchatCredentials](#FreshchatCredentials) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appId | String? | yes | | + | appKey | String? | yes | | + | webToken | String? | yes | | + +--- + + + + + #### [Safetynet](#Safetynet) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | credentials | [SafetynetCredentials](#SafetynetCredentials)? | yes | | + | enabled | Bool? | yes | | + +--- + + + + + #### [SafetynetCredentials](#SafetynetCredentials) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | apiKey | String? | yes | | + +--- + + + + + #### [FyndRewards](#FyndRewards) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | credentials | [FyndRewardsCredentials](#FyndRewardsCredentials)? | yes | | + +--- + + + + + #### [FyndRewardsCredentials](#FyndRewardsCredentials) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | publicKey | String? | yes | | + +--- + + + + + #### [GoogleMap](#GoogleMap) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | credentials | [GoogleMapCredentials](#GoogleMapCredentials)? | yes | | + +--- + + + + + #### [GoogleMapCredentials](#GoogleMapCredentials) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | apiKey | String? | yes | | + +--- + + + + + #### [RewardPointsConfig](#RewardPointsConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | credit | [Credit](#Credit)? | yes | | + | debit | [Debit](#Debit)? | yes | | + +--- + + + + + #### [Credit](#Credit) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + +--- + + + + + #### [Debit](#Debit) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | autoApply | Bool? | yes | | + | strategyChannel | String? | yes | | + +--- + + + + + #### [ProductDetailFeature](#ProductDetailFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | similar | [String]? | yes | | + | sellerSelection | Bool? | yes | | + | updateProductMeta | Bool? | yes | | + | requestProduct | Bool? | yes | | + +--- + + + + + #### [LaunchPage](#LaunchPage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pageType | String? | yes | | + | params | [String: Any]? | yes | | + | query | [String: Any]? | yes | | + +--- + + + + + #### [LandingPageFeature](#LandingPageFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | launchPage | [LaunchPage](#LaunchPage)? | yes | | + | continueAsGuest | Bool? | yes | | + | loginBtnText | String? | yes | | + | showDomainTextbox | Bool? | yes | | + | showRegisterBtn | Bool? | yes | | + +--- + + + + + #### [RegistrationPageFeature](#RegistrationPageFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | askStoreAddress | Bool? | yes | | + +--- + + + + + #### [AppFeature](#AppFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | productDetail | [ProductDetailFeature](#ProductDetailFeature)? | yes | | + | landingPage | [LandingPageFeature](#LandingPageFeature)? | yes | | + | registrationPage | [RegistrationPageFeature](#RegistrationPageFeature)? | yes | | + | homePage | [HomePageFeature](#HomePageFeature)? | yes | | + | common | [CommonFeature](#CommonFeature)? | yes | | + | cart | [CartFeature](#CartFeature)? | yes | | + | qr | [QrFeature](#QrFeature)? | yes | | + | pcr | [PcrFeature](#PcrFeature)? | yes | | + | order | [OrderFeature](#OrderFeature)? | yes | | + | id | String? | yes | | + | app | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [HomePageFeature](#HomePageFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | orderProcessing | Bool? | yes | | + +--- + + + + + #### [CommonFeature](#CommonFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | communicationOptinDialog | [CommunicationOptinDialogFeature](#CommunicationOptinDialogFeature)? | yes | | + | deploymentStoreSelection | [DeploymentStoreSelectionFeature](#DeploymentStoreSelectionFeature)? | yes | | + | listingPrice | [ListingPriceFeature](#ListingPriceFeature)? | yes | | + | currency | [CurrencyFeature](#CurrencyFeature)? | yes | | + | revenueEngine | [RevenueEngineFeature](#RevenueEngineFeature)? | yes | | + | feedback | [FeedbackFeature](#FeedbackFeature)? | yes | | + | compareProducts | [CompareProductsFeature](#CompareProductsFeature)? | yes | | + | rewardPoints | [RewardPointsConfig](#RewardPointsConfig)? | yes | | + +--- + + + + + #### [CommunicationOptinDialogFeature](#CommunicationOptinDialogFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | visibility | Bool? | yes | | + +--- + + + + + #### [DeploymentStoreSelectionFeature](#DeploymentStoreSelectionFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | type | String? | yes | | + +--- + + + + + #### [ListingPriceFeature](#ListingPriceFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | value | String? | yes | | + +--- + + + + + #### [CurrencyFeature](#CurrencyFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | value | [String]? | yes | | + | type | String? | yes | | + | defaultCurrency | String? | yes | | + +--- + + + + + #### [RevenueEngineFeature](#RevenueEngineFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + +--- + + + + + #### [FeedbackFeature](#FeedbackFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + +--- + + + + + #### [CompareProductsFeature](#CompareProductsFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + +--- + + + + + #### [CartFeature](#CartFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | gstInput | Bool? | yes | | + | staffSelection | Bool? | yes | | + | placingForCustomer | Bool? | yes | | + | googleMap | Bool? | yes | | + | revenueEngineCoupon | Bool? | yes | | + +--- + + + + + #### [QrFeature](#QrFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | Bool? | yes | | + | products | Bool? | yes | | + | collections | Bool? | yes | | + +--- + + + + + #### [PcrFeature](#PcrFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | staffSelection | Bool? | yes | | + +--- + + + + + #### [OrderFeature](#OrderFeature) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | buyAgain | Bool? | yes | | + +--- + + + + + #### [AppFeatureRequest](#AppFeatureRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | feature | [AppFeature](#AppFeature)? | yes | | + +--- + + + + + #### [AppFeatureResponse](#AppFeatureResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | feature | [AppFeature](#AppFeature)? | yes | | + +--- + + + + + #### [Currency](#Currency) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | isActive | Bool? | yes | | + | name | String? | yes | | + | code | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | decimalDigits | Int? | yes | | + | symbol | String? | yes | | + +--- + + + + + #### [Domain](#Domain) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | verified | Bool? | yes | | + | isPrimary | Bool? | yes | | + | isShortlink | Bool? | yes | | + | id | String? | yes | | + | name | String? | yes | | + +--- + + + + + #### [ApplicationWebsite](#ApplicationWebsite) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | basepath | String? | yes | | + +--- + + + + + #### [ApplicationCors](#ApplicationCors) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | domains | [String]? | yes | | + +--- + + + + + #### [ApplicationAuth](#ApplicationAuth) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + +--- + + + + + #### [ApplicationRedirections](#ApplicationRedirections) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | redirectFrom | String? | yes | | + | redirectTo | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [ApplicationMeta](#ApplicationMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [SecureUrl](#SecureUrl) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | secureUrl | String? | yes | | + +--- + + + + + #### [Application](#Application) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | website | [ApplicationWebsite](#ApplicationWebsite)? | yes | | + | cors | [ApplicationCors](#ApplicationCors)? | yes | | + | auth | [ApplicationAuth](#ApplicationAuth)? | yes | | + | description | String? | yes | | + | channelType | String? | yes | | + | cacheTtl | Int? | yes | | + | isInternal | Bool? | yes | | + | isActive | Bool? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | owner | String? | yes | | + | companyId | Int? | yes | | + | token | String? | yes | | + | redirections | [[ApplicationRedirections](#ApplicationRedirections)]? | yes | | + | meta | [[ApplicationMeta](#ApplicationMeta)]? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + | banner | [SecureUrl](#SecureUrl)? | yes | | + | logo | [SecureUrl](#SecureUrl)? | yes | | + | favicon | [SecureUrl](#SecureUrl)? | yes | | + | domains | [[Domain](#Domain)]? | yes | | + | appType | String? | yes | | + | mobileLogo | [SecureUrl](#SecureUrl)? | yes | | + | domain | [Domain](#Domain)? | yes | | + +--- + + + + + #### [NotFound](#NotFound) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [UnhandledError](#UnhandledError) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [InvalidPayloadRequest](#InvalidPayloadRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [SuccessMessageResponse](#SuccessMessageResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [InventoryBrandRule](#InventoryBrandRule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | criteria | String? | yes | Whether enable all or explicitly few brands as inventory | + | brands | [Int]? | yes | Brand uids in case of explicit criteria | + +--- + + + + + #### [StoreCriteriaRule](#StoreCriteriaRule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | companies | [Int]? | yes | list of company uids | + | brands | [Int]? | yes | list of brand uids | + +--- + + + + + #### [InventoryStoreRule](#InventoryStoreRule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | criteria | String? | yes | Whether enable all or explicitly few stores or use filter of brands and company as inventory stores | + | rules | [[StoreCriteriaRule](#StoreCriteriaRule)]? | yes | List of rules with company and brands uids. Used when critera is `filter` | + | stores | [Int]? | yes | List of store uids. Used when critera is `explicit` | + +--- + + + + + #### [InventoryPaymentConfig](#InventoryPaymentConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | modeOfPayment | String? | yes | | + | source | String? | yes | | + +--- + + + + + #### [StorePriorityRule](#StorePriorityRule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | storetypeOrder | [String]? | yes | | + +--- + + + + + #### [ArticleAssignmentRule](#ArticleAssignmentRule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | storePriority | [StorePriorityRule](#StorePriorityRule)? | yes | | + +--- + + + + + #### [InventoryArticleAssignment](#InventoryArticleAssignment) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | postOrderReassignment | Bool? | yes | | + | rules | [ArticleAssignmentRule](#ArticleAssignmentRule)? | yes | | + +--- + + + + + #### [CompanyAboutAddress](#CompanyAboutAddress) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pincode | Int? | yes | | + | address1 | String? | yes | | + | address2 | String? | yes | | + | city | String? | yes | | + | state | String? | yes | | + | country | String? | yes | | + | addressType | String? | yes | | + +--- + + + + + #### [UserEmail](#UserEmail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | | + | primary | Bool? | yes | | + | verified | Bool? | yes | | + | email | String? | yes | | + +--- + + + + + #### [UserPhoneNumber](#UserPhoneNumber) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | | + | primary | Bool? | yes | | + | verified | Bool? | yes | | + | countryCode | Int? | yes | | + | phone | String? | yes | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String | no | | + | size | Int? | yes | | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + +--- + + + + + #### [ApplicationInformation](#ApplicationInformation) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | address | [InformationAddress](#InformationAddress)? | yes | | + | support | [InformationSupport](#InformationSupport)? | yes | | + | socialLinks | [SocialLinks](#SocialLinks)? | yes | | + | links | [Links](#Links)? | yes | | + | copyrightText | String? | yes | | + | id | String? | yes | | + | businessHighlights | [BusinessHighlights](#BusinessHighlights)? | yes | | + | application | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [InformationAddress](#InformationAddress) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | loc | String? | yes | | + | addressLine | [String]? | yes | | + | phone | [InformationPhone](#InformationPhone)? | yes | | + | city | String? | yes | | + | country | String? | yes | | + | pincode | Int? | yes | | + +--- + + + + + #### [InformationPhone](#InformationPhone) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | code | String? | yes | | + | number | String? | yes | | + +--- + + + + + #### [InformationSupport](#InformationSupport) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | phone | [String]? | yes | | + | email | [String]? | yes | | + | timing | String? | yes | | + +--- + + + + + #### [SocialLinks](#SocialLinks) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | facebook | [FacebookLink](#FacebookLink)? | yes | | + | instagram | [InstagramLink](#InstagramLink)? | yes | | + | twitter | [TwitterLink](#TwitterLink)? | yes | | + | pinterest | [PinterestLink](#PinterestLink)? | yes | | + | googlePlus | [GooglePlusLink](#GooglePlusLink)? | yes | | + | youtube | [YoutubeLink](#YoutubeLink)? | yes | | + | linkedIn | [LinkedInLink](#LinkedInLink)? | yes | | + | vimeo | [VimeoLink](#VimeoLink)? | yes | | + | blogLink | [BlogLink](#BlogLink)? | yes | | + +--- + + + + + #### [FacebookLink](#FacebookLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | icon | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [InstagramLink](#InstagramLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | icon | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [TwitterLink](#TwitterLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | icon | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [PinterestLink](#PinterestLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | icon | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [GooglePlusLink](#GooglePlusLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | icon | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [YoutubeLink](#YoutubeLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | icon | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [LinkedInLink](#LinkedInLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | icon | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [VimeoLink](#VimeoLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | icon | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [BlogLink](#BlogLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | icon | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [Links](#Links) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | link | String? | yes | | + +--- + + + + + #### [BusinessHighlights](#BusinessHighlights) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | title | String? | yes | | + | icon | String? | yes | | + | subTitle | String? | yes | | + +--- + + + + + #### [ApplicationDetail](#ApplicationDetail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String | no | | + | description | String | no | | + | logo | [SecureUrl](#SecureUrl) | no | | + | mobileLogo | [SecureUrl](#SecureUrl) | no | | + | favicon | [SecureUrl](#SecureUrl) | no | | + | banner | [SecureUrl](#SecureUrl) | no | | + | domain | [Domain](#Domain)? | yes | | + | domains | [[Domain](#Domain)]? | yes | | + | id | String? | yes | | + +--- + + + + + #### [CurrenciesResponse](#CurrenciesResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Currency](#Currency)]? | yes | | + +--- + + + + + #### [AppCurrencyResponse](#AppCurrencyResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | String? | yes | | + | defaultCurrency | [DefaultCurrency](#DefaultCurrency)? | yes | | + | supportedCurrency | [[Currency](#Currency)]? | yes | | + +--- + + + + + #### [StoreLatLong](#StoreLatLong) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | coordinates | [Double]? | yes | | + +--- + + + + + #### [OptedStoreAddress](#OptedStoreAddress) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | state | String? | yes | | + | address1 | String? | yes | | + | latLong | [StoreLatLong](#StoreLatLong)? | yes | | + | address2 | String? | yes | | + | pincode | Int? | yes | | + | country | String? | yes | | + | city | String? | yes | | + +--- + + + + + #### [OrderingStore](#OrderingStore) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | address | [OptedStoreAddress](#OptedStoreAddress)? | yes | | + | id | String? | yes | | + | uid | Int? | yes | | + | name | String? | yes | | + | displayName | String? | yes | | + | storeType | String? | yes | | + | storeCode | String? | yes | | + | pincode | Int? | yes | | + | code | String? | yes | | + +--- + + + + + #### [OrderingStores](#OrderingStores) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [[OrderingStore](#OrderingStore)]? | yes | | + | deployedStores | [Int]? | yes | | + | allStores | Bool? | yes | | + | enabled | Bool? | yes | | + | type | String? | yes | | + | id | String? | yes | | + | app | String? | yes | | + | v | Int? | yes | | + +--- + + + + + #### [OrderingStoresResponse](#OrderingStoresResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [Page](#Page)? | yes | | + | items | [[OrderingStore](#OrderingStore)]? | yes | | + +--- + + + diff --git a/documentation/platform/CONTENT.md b/documentation/platform/CONTENT.md new file mode 100644 index 0000000000..b1bca2cba5 --- /dev/null +++ b/documentation/platform/CONTENT.md @@ -0,0 +1,8715 @@ + + + + +##### [Back to Platform docs](./README.md) + +## Content Methods +Content System +* [getAnnouncementsList](#getannouncementslist) +* [createAnnouncement](#createannouncement) +* [getAnnouncementById](#getannouncementbyid) +* [updateAnnouncement](#updateannouncement) +* [updateAnnouncementSchedule](#updateannouncementschedule) +* [deleteAnnouncement](#deleteannouncement) +* [createBlog](#createblog) +* [getBlogs](#getblogs) +* [updateBlog](#updateblog) +* [deleteBlog](#deleteblog) +* [getComponentById](#getcomponentbyid) +* [addDataLoader](#adddataloader) +* [getDataLoaders](#getdataloaders) +* [deleteDataLoader](#deletedataloader) +* [editDataLoader](#editdataloader) +* [getDataLoadersByService](#getdataloadersbyservice) +* [selectDataLoader](#selectdataloader) +* [resetDataLoader](#resetdataloader) +* [getFaqCategories](#getfaqcategories) +* [getFaqCategoryBySlugOrId](#getfaqcategorybyslugorid) +* [createFaqCategory](#createfaqcategory) +* [updateFaqCategory](#updatefaqcategory) +* [deleteFaqCategory](#deletefaqcategory) +* [getFaqsByCategoryIdOrSlug](#getfaqsbycategoryidorslug) +* [addFaq](#addfaq) +* [updateFaq](#updatefaq) +* [deleteFaq](#deletefaq) +* [getFaqByIdOrSlug](#getfaqbyidorslug) +* [getLandingPages](#getlandingpages) +* [createLandingPage](#createlandingpage) +* [updateLandingPage](#updatelandingpage) +* [deleteLandingPage](#deletelandingpage) +* [getLegalInformation](#getlegalinformation) +* [updateLegalInformation](#updatelegalinformation) +* [getNavigations](#getnavigations) +* [createNavigation](#createnavigation) +* [getDefaultNavigations](#getdefaultnavigations) +* [getNavigationBySlug](#getnavigationbyslug) +* [updateNavigation](#updatenavigation) +* [deleteNavigation](#deletenavigation) +* [getPageMeta](#getpagemeta) +* [getPageSpec](#getpagespec) +* [createPagePreview](#createpagepreview) +* [updatePagePreview](#updatepagepreview) +* [deletePage](#deletepage) +* [updatePathRedirectionRules](#updatepathredirectionrules) +* [getPathRedirectionRules](#getpathredirectionrules) +* [getSEOConfiguration](#getseoconfiguration) +* [updateSEOConfiguration](#updateseoconfiguration) +* [getSlideshows](#getslideshows) +* [createSlideshow](#createslideshow) +* [getSlideshowBySlug](#getslideshowbyslug) +* [updateSlideshow](#updateslideshow) +* [deleteSlideshow](#deleteslideshow) +* [getSupportInformation](#getsupportinformation) +* [updateSupportInformation](#updatesupportinformation) +* [updateInjectableTag](#updateinjectabletag) +* [deleteAllInjectableTags](#deleteallinjectabletags) +* [getInjectableTags](#getinjectabletags) +* [addInjectableTag](#addinjectabletag) +* [removeInjectableTag](#removeinjectabletag) +* [editInjectableTag](#editinjectabletag) +* [createPage](#createpage) +* [getPages](#getpages) +* [updatePage](#updatepage) +* [getPageBySlug](#getpagebyslug) + + + +## Methods with example and description + + +#### getAnnouncementsList +Get a list of announcements + + + + +```swift +client.application("").content.getAnnouncementsList(pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | +| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | + + + +Announcements are useful to highlight a message or information on top of a webpage. Use this API to retrieve a list of announcements. + +*Returned Response:* + + + + +[GetAnnouncementListSchema](#GetAnnouncementListSchema) + +Success. Refer `GetAnnouncementListSchema` for more details. + + + + +
    +  Examples: + + +
    +  success + +```json +{ + "value": { + "items": [ + { + "_id": "6026283125f06a827dc1a5cc", + "platforms": [ + "web", + "android", + "ios" + ], + "title": "test", + "announcement": "

    test

    \n", + "pages": [ + { + "page_slug": "$all", + "type": "custom" + } + ], + "editor_meta": { + "foreground_color": "#000", + "background_color": "#fff", + "content_type": "markdown", + "content": "test" + }, + "_schedule": { + "published": true, + "cron": null, + "start": "2021-02-10T20:40:00.000Z", + "end": "2021-02-18T22:00:00.000Z", + "duration": null, + "next_schedule": [ + { + "start": "2021-02-10T20:40:00.000Z", + "end": "2021-02-18T22:00:00.000Z" + } + ] + }, + "app": "000000000000000000000001", + "author": { + "created_by": "5e199e6998cfe1776f1385dc", + "modified_by": "5e199e6998cfe1776f1385dc" + }, + "created_at": "2021-02-12T07:03:13.503Z", + "modified_at": "2021-02-12T07:03:13.503Z", + "id": "6026283125f06a827dc1a5cc" + } + ], + "page": { + "type": "number", + "current": 1, + "size": 10, + "item_total": 1, + "has_next": false + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createAnnouncement +Create an announcement + + + + +```swift +client.application("").content.createAnnouncement(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | AdminAnnouncementSchema | yes | Request body | + + +Announcements are useful to highlight a message or information on top of a webpage. Use this API to create an announcement. + +*Returned Response:* + + + + +[CreateAnnouncementSchema](#CreateAnnouncementSchema) + +Success. Refer `CreateAnnouncementSchema` for more details. + + + + +
    +  Examples: + + +
    +  success + +```json +{ + "value": { + "message": "Successfully saved announcement", + "data": { + "value": { + "platforms": [ + "web", + "android", + "ios" + ], + "_id": "6026283125f06a827dc1a5cc", + "title": "test", + "announcement": "

    test123

    \n", + "pages": [ + { + "page_slug": "$all", + "type": "custom" + } + ], + "editor_meta": { + "foreground_color": "#000", + "background_color": "#fff", + "content_type": "markdown", + "content": "test" + }, + "_schedule": { + "published": true, + "next_schedule": [ + { + "start": "2021-02-10T20:40:00.000Z", + "end": "2021-02-18T22:00:00.000Z" + } + ], + "cron": null, + "start": "2021-02-10T20:40:00.000Z", + "end": "2021-02-18T22:00:00.000Z", + "duration": null + }, + "app": "000000000000000000000001", + "author": { + "created_by": "5e199e6998cfe1776f1385dc", + "modified_by": "5e199e6998cfe1776f1385dc" + }, + "created_at": "2021-02-12T07:03:13.503Z", + "modified_at": "2021-02-12T07:05:57.020Z" + } + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getAnnouncementById +Get announcement by ID + + + + +```swift +client.application("").content.getAnnouncementById(announcementId: announcementId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| announcementId | String | yes | ID allotted to the announcement. | + + + +Use this API to retrieve an announcement and its details such as the target platform and pages on which it's applicable + +*Returned Response:* + + + + +[AdminAnnouncementSchema](#AdminAnnouncementSchema) + +Success. Refer `AdminAnnouncementSchema` for more details. + + + + +
    +  Examples: + + +
    +  success + +```json +{ + "value": { + "platforms": [ + "web", + "android", + "ios" + ], + "_id": "6026283125f06a827dc1a5cc", + "title": "test", + "announcement": "

    test123

    \n", + "pages": [ + { + "page_slug": "$all", + "type": "custom" + } + ], + "editor_meta": { + "foreground_color": "#000", + "background_color": "#fff", + "content_type": "markdown", + "content": "test" + }, + "_schedule": { + "published": true, + "next_schedule": [ + { + "start": "2021-02-10T20:40:00.000Z", + "end": "2021-02-18T22:00:00.000Z" + } + ], + "cron": null, + "start": "2021-02-10T20:40:00.000Z", + "end": "2021-02-18T22:00:00.000Z", + "duration": null + }, + "app": "000000000000000000000001", + "author": { + "created_by": "5e199e6998cfe1776f1385dc", + "modified_by": "5e199e6998cfe1776f1385dc" + }, + "created_at": "2021-02-12T07:03:13.503Z", + "modified_at": "2021-02-12T07:05:57.020Z" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateAnnouncement +Update an announcement + + + + +```swift +client.application("").content.updateAnnouncement(announcementId: announcementId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| announcementId | String | yes | ID allotted to the announcement. | +| body | AdminAnnouncementSchema | yes | Request body | + + +Use this API to edit an existing announcement and its details such as the target platform and pages on which it's applicable + +*Returned Response:* + + + + +[CreateAnnouncementSchema](#CreateAnnouncementSchema) + +Success. Refer `CreateAnnouncementSchema` for more details. + + + + +
    +  Examples: + + +
    +  success + +```json +{ + "value": { + "message": "Successfully updated announcement", + "data": { + "value": { + "platforms": [ + "web", + "android", + "ios" + ], + "_id": "6026283125f06a827dc1a5cc", + "title": "test", + "announcement": "

    test123

    \n", + "pages": [ + { + "page_slug": "$all", + "type": "custom" + } + ], + "editor_meta": { + "foreground_color": "#000", + "background_color": "#fff", + "content_type": "markdown", + "content": "test" + }, + "_schedule": { + "published": true, + "next_schedule": [ + { + "start": "2021-02-10T20:40:00.000Z", + "end": "2021-02-18T22:00:00.000Z" + } + ], + "cron": null, + "start": "2021-02-10T20:40:00.000Z", + "end": "2021-02-18T22:00:00.000Z", + "duration": null + }, + "app": "000000000000000000000001", + "author": { + "created_by": "5e199e6998cfe1776f1385dc", + "modified_by": "5e199e6998cfe1776f1385dc" + }, + "created_at": "2021-02-12T07:03:13.503Z", + "modified_at": "2021-02-12T07:05:57.020Z" + } + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateAnnouncementSchedule +Update the schedule and the publish status of an announcement + + + + +```swift +client.application("").content.updateAnnouncementSchedule(announcementId: announcementId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| announcementId | String | yes | ID allotted to the announcement. | +| body | ScheduleSchema | yes | Request body | + + +Use this API to edit the duration, i.e. start date-time and end date-time of an announcement. Moreover, you can enable/disable an announcement using this API. + +*Returned Response:* + + + + +[CreateAnnouncementSchema](#CreateAnnouncementSchema) + +Success. Refer `CreateAnnouncementSchema` for more details. + + + + +
    +  Examples: + + +
    +  success + +```json +{ + "value": { + "message": "Announcement unpublished", + "data": { + "value": { + "platforms": [ + "web", + "android", + "ios" + ], + "_id": "6026283125f06a827dc1a5cc", + "title": "test", + "announcement": "

    test123

    \n", + "pages": [ + { + "page_slug": "$all", + "type": "custom" + } + ], + "editor_meta": { + "foreground_color": "#000", + "background_color": "#fff", + "content_type": "markdown", + "content": "test" + }, + "_schedule": { + "published": false, + "next_schedule": [ + { + "start": "2021-02-10T20:40:00.000Z", + "end": "2021-02-18T22:00:00.000Z" + } + ], + "cron": null, + "start": "2021-02-10T20:40:00.000Z", + "end": "2021-02-18T22:00:00.000Z", + "duration": null + }, + "app": "000000000000000000000001", + "author": { + "created_by": "5e199e6998cfe1776f1385dc", + "modified_by": "5e199e6998cfe1776f1385dc" + }, + "created_at": "2021-02-12T07:03:13.503Z", + "modified_at": "2021-02-12T07:05:57.020Z" + } + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### deleteAnnouncement +Delete announcement by id + + + + +```swift +client.application("").content.deleteAnnouncement(announcementId: announcementId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| announcementId | String | yes | ID allotted to the announcement. | + + + +Use this API to delete an existing announcement. + +*Returned Response:* + + + + +[CreateAnnouncementSchema](#CreateAnnouncementSchema) + +Success. + + + + +
    +  Examples: + + +
    +  success + +```json +{ + "value": { + "message": "Successfully deleted announcement", + "data": { + "value": { + "platforms": [ + "web", + "android", + "ios" + ], + "_id": "6026283125f06a827dc1a5cc", + "title": "test", + "announcement": "

    test123

    \n", + "pages": [ + { + "page_slug": "$all", + "type": "custom" + } + ], + "editor_meta": { + "foreground_color": "#000", + "background_color": "#fff", + "content_type": "markdown", + "content": "test" + }, + "_schedule": { + "published": true, + "next_schedule": [ + { + "start": "2021-02-10T20:40:00.000Z", + "end": "2021-02-18T22:00:00.000Z" + } + ], + "cron": null, + "start": "2021-02-10T20:40:00.000Z", + "end": "2021-02-18T22:00:00.000Z", + "duration": null + }, + "app": "000000000000000000000001", + "author": { + "created_by": "5e199e6998cfe1776f1385dc", + "modified_by": "5e199e6998cfe1776f1385dc" + }, + "created_at": "2021-02-12T07:03:13.503Z", + "modified_at": "2021-02-12T07:05:57.020Z" + } + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createBlog +Create a blog + + + + +```swift +client.application("").content.createBlog(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | BlogRequest | yes | Request body | + + +Use this API to create a blog. + +*Returned Response:* + + + + +[BlogSchema](#BlogSchema) + +Success. Refer `BlogSchema` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "_id": "5eaa451a21a4dd75f0fd96c5", + "application": "5d3ebd89f540e7506b8b3548", + "tags": [ + "abhinav" + ], + "title": "my first blog", + "slug": "1st_blog", + "feature_image": { + "secure_url": "https://google.com" + }, + "content": [ + { + "type": "html", + "value": "

    hey there!

    " + } + ], + "_schedule": { + "cron": "* 10 * * *", + "start": "2021-03-31T23:30:00.000Z", + "end": "2021-03-31T23:55:00.000Z", + "duration": 1000, + "next_schedule": [ + { + "start": "2021-03-17T04:30:00.000Z", + "end": "2021-03-17T04:46:40.000Z" + } + ] + }, + "published": true, + "author": { + "name": "Fynd App" + }, + "date_meta": { + "created_on": "2021-03-14T06:49:03.945Z", + "modified_on": "2021-03-14T06:49:03.945Z" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getBlogs +Get blogs + + + + +```swift +client.application("").content.getBlogs(pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | +| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | + + + +Use this API to get a list of blogs along with their details, such as the title, reading time, publish status, feature image, tags, author, etc. + +*Returned Response:* + + + + +[BlogGetResponse](#BlogGetResponse) + +Success. Refer `BlogGetResponse` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "date_meta": { + "created_on": "2021-03-14T06:49:03.945Z", + "modified_on": "2021-03-14T06:49:03.945Z" + }, + "tags": [], + "_id": "604db275b3ae202873964d94", + "content": [ + { + "type": "html", + "value": "

    test abhinav

    " + } + ], + "title": "1st Blog", + "slug": "1st-blog", + "published": true, + "_schedule": { + "next_schedule": [ + {} + ], + "start": "2021-04-08T07:15:13.000Z", + "end": "2021-04-10T02:00:00.000Z" + }, + "feature_image": { + "secure_url": "" + }, + "application": "000000000000000000000001", + "author": { + "name": "Fynd App" + } + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 2, + "has_next": true + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateBlog +Update a blog + + + + +```swift +client.application("").content.updateBlog(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | ID allotted to the blog. | +| body | BlogRequest | yes | Request body | + + +Use this API to update the details of an existing blog which includes title, feature image, content, SEO details, expiry, etc. + +*Returned Response:* + + + + +[BlogSchema](#BlogSchema) + +Success. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "_id": "5eaa451a21a4dd75f0fd96c5", + "application": "5d3ebd89f540e7506b8b3548", + "tags": [ + "abhinav" + ], + "title": "my first blog", + "slug": "1st_blog", + "feature_image": { + "secure_url": "https://google.com" + }, + "content": [ + { + "type": "html", + "value": "

    hey there!

    " + } + ], + "_schedule": { + "cron": "* 10 * * *", + "start": "2021-03-31T23:30:00.000Z", + "end": "2021-03-31T23:55:00.000Z", + "duration": 1000, + "next_schedule": [ + { + "start": "2021-03-17T04:30:00.000Z", + "end": "2021-03-17T04:46:40.000Z" + } + ] + }, + "published": true, + "author": { + "name": "Fynd App" + }, + "date_meta": { + "created_on": "2021-03-14T06:49:03.945Z", + "modified_on": "2021-03-14T06:49:03.945Z" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### deleteBlog +Delete blogs + + + + +```swift +client.application("").content.deleteBlog(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | ID allotted to the blog. | + + + +Use this API to delete a blog. + +*Returned Response:* + + + + +[BlogSchema](#BlogSchema) + +Success. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "_id": "5eaa451a21a4dd75f0fd96c5", + "application": "5d3ebd89f540e7506b8b3548", + "tags": [ + "abhinav" + ], + "title": "my first blog", + "slug": "1st_blog", + "feature_image": { + "secure_url": "https://google.com" + }, + "content": [ + { + "type": "html", + "value": "

    hey there!

    " + } + ], + "_schedule": { + "cron": "* 10 * * *", + "start": "2021-03-31T23:30:00.000Z", + "end": "2021-03-31T23:55:00.000Z", + "duration": 1000, + "next_schedule": [ + { + "start": "2021-03-17T04:30:00.000Z", + "end": "2021-03-17T04:46:40.000Z" + } + ] + }, + "published": true, + "author": { + "name": "Fynd App" + }, + "date_meta": { + "created_on": "2021-03-14T06:49:03.945Z", + "modified_on": "2021-03-14T06:49:03.945Z" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getComponentById +Get components of a blog + + + + +```swift +client.application("").content.getComponentById(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a blog page. You can get slug value of a blog from `getBlogs` API. | + + + +Use this API to retrieve the components of a blog, such as title, slug, feature image, content, schedule, publish status, author, etc. + +*Returned Response:* + + + + +[BlogSchema](#BlogSchema) + +Success. Returns a a JSON object with components. Refer `BlogSchema` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "_id": "5eaa451a21a4dd75f0fd96c5", + "application": "5d3ebd89f540e7506b8b3548", + "tags": [ + "abhinav" + ], + "title": "my first blog", + "slug": "1st_blog", + "feature_image": { + "secure_url": "https://google.com" + }, + "content": [ + { + "type": "html", + "value": "

    hey there!

    " + } + ], + "_schedule": { + "cron": "* 10 * * *", + "start": "2021-03-31T23:30:00.000Z", + "end": "2021-03-31T23:55:00.000Z", + "duration": 1000, + "next_schedule": [ + { + "start": "2021-03-17T04:30:00.000Z", + "end": "2021-03-17T04:46:40.000Z" + } + ] + }, + "published": true, + "author": { + "name": "Fynd App" + }, + "date_meta": { + "created_on": "2021-03-14T06:49:03.945Z", + "modified_on": "2021-03-14T06:49:03.945Z" + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### addDataLoader +Adds a data loader + + + + +```swift +client.application("").content.addDataLoader(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | DataLoaderSchema | yes | Request body | + + +Use this API to add data loader. This includes the data loader name, operationId, service name and its type (url/function) with corresponding value. + +*Returned Response:* + + + + +[DataLoaderResponseSchema](#DataLoaderResponseSchema) + +Success. + + + + +
    +  Example: + +```json +{ + "_id": "601f77e7aa61066feda44487", + "name": "Search API from Algolia", + "service": "catalog", + "operation_id": "fetchSuggestions", + "type": "url", + "application": "000000000000000000000001", + "__v": 0 +} +``` +
    + + + + + + + + + +--- + + +#### getDataLoaders +Get all the data loaders in an application + + + + +```swift +client.application("").content.getDataLoaders() { (response, error) in + // Use response +} +``` + + + + + + +Use this to get all data loaders of an application + +*Returned Response:* + + + + +[DataLoadersSchema](#DataLoadersSchema) + +Success. Refer `DataLoaderResponseSchema` for more details. + + + + +
    +  Example: + +```json +{ + "items": [ + { + "name": "Algolia", + "is_selected": false, + "type": "url", + "_id": "61bc4523a7ffc7504f4de4a5", + "service": "catalog", + "operation_id": "fetchSuggestions", + "url": "/ext/example/url", + "__source": { + "type": "extension", + "id": "000000000000000000000003" + }, + "application": "100000000000000000000001", + "__v": 0 + }, + { + "name": "Algolia v3", + "is_selected": false, + "type": "url", + "_id": "61bc452da7ffc7504f4de4a7", + "service": "catalog", + "operation_id": "fetchSuggestions", + "url": "/ext/example/url", + "__source": { + "type": "extension", + "id": "000000000000000000000003" + }, + "application": "100000000000000000000001", + "__v": 0 + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### deleteDataLoader +Delete data loader in application + + + + +```swift +client.application("").content.deleteDataLoader(dataLoaderId: dataLoaderId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| dataLoaderId | String | yes | ID allotted to the data loader. | + + + +Use this API to delete data loader. + +*Returned Response:* + + + + +[DataLoaderResponseSchema](#DataLoaderResponseSchema) + +Success. + + + + +
    +  Example: + +```json +{ + "_id": "601f77e7aa61066feda44487", + "name": "Search API from Algolia", + "service": "catalog", + "operation_id": "fetchSuggestions", + "type": "url", + "application": "000000000000000000000001", + "__v": 0 +} +``` +
    + + + + + + + + + +--- + + +#### editDataLoader +Edit a data loader by id + + + + +```swift +client.application("").content.editDataLoader(dataLoaderId: dataLoaderId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| dataLoaderId | String | yes | ID allotted to the data loader. | +| body | DataLoaderSchema | yes | Request body | + + +Use this API to edit the details of an existing data loader by its ID. + +*Returned Response:* + + + + +[DataLoaderResponseSchema](#DataLoaderResponseSchema) + +Success. + + + + +
    +  Example: + +```json +{ + "_id": "601f77e7aa61066feda44487", + "name": "Search API from Algolia", + "service": "catalog", + "operation_id": "fetchSuggestions", + "type": "url", + "application": "000000000000000000000001", + "__v": 0 +} +``` +
    + + + + + + + + + +--- + + +#### getDataLoadersByService +Get all the data loaders in an application by service name + + + + +```swift +client.application("").content.getDataLoadersByService(serviceName: serviceName) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| serviceName | String | yes | Service name of the data loader. | + + + +Use this to get all data loaders of an application by service name + +*Returned Response:* + + + + +[DataLoadersSchema](#DataLoadersSchema) + +Success. Refer `DataLoaderResponseSchema` for more details. + + + + +
    +  Example: + +```json +{ + "items": [ + { + "name": "Algolia", + "is_selected": false, + "type": "url", + "_id": "61bc4523a7ffc7504f4de4a5", + "service": "catalog", + "operation_id": "fetchSuggestions", + "url": "/ext/example/url", + "__source": { + "type": "extension", + "id": "000000000000000000000003" + }, + "application": "100000000000000000000001", + "__v": 0 + }, + { + "name": "Algolia v3", + "is_selected": false, + "type": "url", + "_id": "61bc452da7ffc7504f4de4a7", + "service": "catalog", + "operation_id": "fetchSuggestions", + "url": "/ext/example/url", + "__source": { + "type": "extension", + "id": "000000000000000000000003" + }, + "application": "100000000000000000000001", + "__v": 0 + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### selectDataLoader +Select a data loader by id + + + + +```swift +client.application("").content.selectDataLoader(dataLoaderId: dataLoaderId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| dataLoaderId | String | yes | ID allotted to the data loader. | + + + +Use this API to select a data loader to be used in applications. + +*Returned Response:* + + + + +[DataLoaderResponseSchema](#DataLoaderResponseSchema) + +Success. + + + + +
    +  Example: + +```json +{ + "_id": "601f77e7aa61066feda44487", + "name": "Search API from Algolia", + "service": "catalog", + "operation_id": "fetchSuggestions", + "type": "url", + "application": "000000000000000000000001", + "__v": 0 +} +``` +
    + + + + + + + + + +--- + + +#### resetDataLoader +Reset a data loader by serive name and operation Id + + + + +```swift +client.application("").content.resetDataLoader(service: service, operationId: operationId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| service | String | yes | Name of service. | +| operationId | String | yes | Name of operation id of the service. | + + + +Use this API to reselect a data loader. + +*Returned Response:* + + + + +[DataLoaderResetResponseSchema](#DataLoaderResetResponseSchema) + +Success. + + + + +
    +  Example: + +```json +{ + "reset": true +} +``` +
    + + + + + + + + + +--- + + +#### getFaqCategories +Get a list of FAQ categories + + + + +```swift +client.application("").content.getFaqCategories() { (response, error) in + // Use response +} +``` + + + + + + +FAQs can be divided into categories. Use this API to get a list of FAQ categories. + +*Returned Response:* + + + + +[GetFaqCategoriesSchema](#GetFaqCategoriesSchema) + +Success. Refer `GetFaqCategoriesSchema` for more details. + + + + +
    +  Example: + +```json +{ + "categories": [ + { + "index": 0, + "children": [ + "6026426ae507768b168dee4b" + ], + "title": "Test", + "_id": "60263f80c83c1f89f2863a8a", + "slug": "test", + "application": "000000000000000000000001" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getFaqCategoryBySlugOrId +Get an FAQ category by slug or id + + + + +```swift +client.application("").content.getFaqCategoryBySlugOrId(idOrSlug: idOrSlug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| idOrSlug | String | yes | ID or the slug allotted to an FAQ category. Slug is a short, human-readable, URL-friendly identifier of an object. You can get slug value of an FAQ category from `getFaqCategories` API. | + + + +FAQs can be divided into categories. Use this API to get an FAQ categories using its slug or ID. + +*Returned Response:* + + + + +[GetFaqCategoryBySlugSchema](#GetFaqCategoryBySlugSchema) + +Success. Refer `GetFaqCategoryBySlugSchema` for more details. + + + + +
    +  Example: + +```json +{ + "category": { + "index": 0, + "children": [ + { + "_id": "6026426ae507768b168dee4b", + "question": "question 1", + "answer": "answer 1", + "slug": "question-1", + "application": "000000000000000000000001" + } + ], + "_id": "60263f80c83c1f89f2863a8a", + "slug": "test", + "title": "Test", + "application": "000000000000000000000001" + } +} +``` +
    + + + + + + + + + +--- + + +#### createFaqCategory +Create an FAQ category + + + + +```swift +client.application("").content.createFaqCategory(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CreateFaqCategoryRequestSchema | yes | Request body | + + +FAQs help users to solve an issue or know more about a process. FAQs can be categorized separately, for e.g. some questions can be related to payment, some could be related to purchase, shipping, navigating, etc. Use this API to create an FAQ category. + +*Returned Response:* + + + + +[CreateFaqCategorySchema](#CreateFaqCategorySchema) + +Success. + + + + +
    +  Example: + +```json +{ + "category": { + "index": 0, + "children": [], + "_id": "60263f80c83c1f89f2863a8a", + "slug": "test", + "application": "000000000000000000000001", + "title": "Test" + } +} +``` +
    + + + + + + + + + +--- + + +#### updateFaqCategory +Update an FAQ category + + + + +```swift +client.application("").content.updateFaqCategory(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | ID allotted to an FAQ category. | +| body | UpdateFaqCategoryRequestSchema | yes | Request body | + + +Use this API to edit an existing FAQ category. + +*Returned Response:* + + + + +[CreateFaqCategorySchema](#CreateFaqCategorySchema) + +Success. + + + + +
    +  Example: + +```json +{ + "category": { + "index": 0, + "children": [], + "_id": "60263f80c83c1f89f2863a8a", + "title": "Test Updated", + "slug": "test", + "application": "000000000000000000000001" + } +} +``` +
    + + + + + + + + + +--- + + +#### deleteFaqCategory +Delete an FAQ category + + + + +```swift +client.application("").content.deleteFaqCategory(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | ID allotted to an FAQ category. | + + + +Use this API to delete an FAQ category. + +*Returned Response:* + + + + +[FaqSchema](#FaqSchema) + +Success. + + + + +
    +  Example: + +```json +{ + "category": { + "index": 0, + "children": [], + "_id": "60263f80c83c1f89f2863a8a", + "slug": "test", + "title": "Test", + "application": "000000000000000000000001", + "__v": 2 + } +} +``` +
    + + + + + + + + + +--- + + +#### getFaqsByCategoryIdOrSlug +Get question and answers within an FAQ category + + + + +```swift +client.application("").content.getFaqsByCategoryIdOrSlug(idOrSlug: idOrSlug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| idOrSlug | String | yes | ID or the slug allotted to an FAQ category. Slug is a short, human-readable, URL-friendly identifier of an object. You can get slug value of an FAQ category from `getFaqCategories` API. | + + + +Use this API to retrieve all the commonly asked question and answers belonging to an FAQ category. + +*Returned Response:* + + + + +[GetFaqSchema](#GetFaqSchema) + +Success. Refer `GetFaqSchema` for more details. + + + + +
    +  Example: + +```json +{ + "faqs": [ + { + "_id": "60265b64e507768b168dee4d", + "question": "question 1", + "answer": "answer 1", + "slug": "question-1", + "application": "000000000000000000000001" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### addFaq +Create an FAQ + + + + +```swift +client.application("").content.addFaq(categoryId: categoryId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| categoryId | String | yes | ID allotted to an FAQ category. | +| body | CreateFaqSchema | yes | Request body | + + +FAQs help users to solve an issue or know more about a process. Use this API to create an FAQ for a given FAQ category. + +*Returned Response:* + + + + +[CreateFaqResponseSchema](#CreateFaqResponseSchema) + +Success. + + + + +
    +  Example: + +```json +{ + "faq": { + "_id": "60265b64e507768b168dee4d", + "question": "question 1", + "answer": "answer 1", + "slug": "question-1", + "application": "000000000000000000000001" + } +} +``` +
    + + + + + + + + + +--- + + +#### updateFaq +Update an FAQ + + + + +```swift +client.application("").content.updateFaq(categoryId: categoryId, faqId: faqId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| categoryId | String | yes | ID allotted to an FAQ category. | +| faqId | String | yes | ID allotted to an FAQ. | +| body | CreateFaqSchema | yes | Request body | + + +Use this API to edit an existing FAQ. + +*Returned Response:* + + + + +[CreateFaqResponseSchema](#CreateFaqResponseSchema) + +Success. + + + + +
    +  Example: + +```json +{ + "faq": { + "_id": "60265b64e507768b168dee4d", + "question": "question 1 updated", + "answer": "answer 1", + "slug": "question-1", + "application": "000000000000000000000001" + } +} +``` +
    + + + + + + + + + +--- + + +#### deleteFaq +Delete an FAQ + + + + +```swift +client.application("").content.deleteFaq(categoryId: categoryId, faqId: faqId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| categoryId | String | yes | ID allotted to an FAQ category. | +| faqId | String | yes | ID allotted to an FAQ. | + + + +Use this API to delete an existing FAQ. + +*Returned Response:* + + + + +[CreateFaqResponseSchema](#CreateFaqResponseSchema) + +Success. + + + + +
    +  Example: + +```json +{ + "faq": { + "_id": "60265b64e507768b168dee4d", + "question": "question 1 updated", + "answer": "answer 1", + "slug": "question-1", + "application": "000000000000000000000001" + } +} +``` +
    + + + + + + + + + +--- + + +#### getFaqByIdOrSlug +Get an FAQ + + + + +```swift +client.application("").content.getFaqByIdOrSlug(idOrSlug: idOrSlug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| idOrSlug | String | yes | ID or the slug allotted to an FAQ category. Slug is a short, human-readable, URL-friendly identifier of an object. You can get slug value of an FAQ category from `getFaqCategories` API. | + + + +Use this API to retrieve a specific FAQ. You will get the question and answer of that FAQ. + +*Returned Response:* + + + + +[CreateFaqResponseSchema](#CreateFaqResponseSchema) + +Success. Refer `CreateFaqResponseSchema` for more details. + + + + +
    +  Example: + +```json +{ + "faq": { + "_id": "60265b64e507768b168dee4d", + "question": "question 1", + "answer": "answer 1", + "slug": "question-1", + "application": "000000000000000000000001" + } +} +``` +
    + + + + + + + + + +--- + + +#### getLandingPages +Get landing pages + + + + +```swift +client.application("").content.getLandingPages(pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | +| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | + + + +Landing page is the first page that a prospect lands upon while visiting a website. Use this API to fetch a list of landing pages. + +*Returned Response:* + + + + +[LandingPageGetResponse](#LandingPageGetResponse) + +Success. Refer `LandingPageGetResponse` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "date_meta": { + "created_on": "2021-03-12T09:26:12.157Z", + "modified_on": "2021-03-12T09:26:12.157Z" + }, + "platform": [ + "android" + ], + "_id": "604b342e29f19310d8ae9743", + "slug": "landing-page-default-2", + "action": { + "page": { + "type": "default" + }, + "popup": {}, + "type": "page" + }, + "application": "5cd3db5e9d692cfe5302a7bb", + "archived": false, + "_custom_json": null, + "__v": 0 + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 2, + "has_next": true + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createLandingPage +Create a landing page + + + + +```swift +client.application("").content.createLandingPage(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | LandingPageSchema | yes | Request body | + + +Landing page is the first page that a prospect lands upon while visiting a website. Use this API to create a landing page. + +*Returned Response:* + + + + +[LandingPageSchema](#LandingPageSchema) + +Success. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "_id": "5eaa451a21a4dd75f0fd96c5", + "application": "5d3ebd89f540e7506b8b3548", + "_custom_json": null, + "slug": "pnc-landing", + "action": { + "page": { + "type": "home" + }, + "popup": {}, + "type": "page" + }, + "platform": [ + "web" + ], + "created_by": { + "id": "000000000000000000000000" + }, + "date_meta": { + "created_on": "2020-04-30T03:25:14.549Z", + "modified_on": "2020-04-30T03:25:14.549Z" + }, + "archived": false + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateLandingPage +Update a landing page + + + + +```swift +client.application("").content.updateLandingPage(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | ID allotted to a landing page. | +| body | LandingPageSchema | yes | Request body | + + +Use this API to edit the details of an existing landing page. + +*Returned Response:* + + + + +[LandingPageSchema](#LandingPageSchema) + +Success. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "_id": "5eaa451a21a4dd75f0fd96c5", + "application": "5d3ebd89f540e7506b8b3548", + "_custom_json": null, + "slug": "pnc-landing", + "action": { + "page": { + "type": "home" + }, + "popup": {}, + "type": "page" + }, + "platform": [ + "web" + ], + "created_by": { + "id": "000000000000000000000000" + }, + "date_meta": { + "created_on": "2020-04-30T03:25:14.549Z", + "modified_on": "2020-04-30T03:25:14.549Z" + }, + "archived": false + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### deleteLandingPage +Delete a landing page + + + + +```swift +client.application("").content.deleteLandingPage(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | ID allotted to a landing page. | + + + +Use this API to delete an existing landing page. + +*Returned Response:* + + + + +[LandingPageSchema](#LandingPageSchema) + +Success. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "_id": "5eaa451a21a4dd75f0fd96c5", + "application": "5d3ebd89f540e7506b8b3548", + "_custom_json": null, + "slug": "pnc-landing", + "action": { + "page": { + "type": "home" + }, + "popup": {}, + "type": "page" + }, + "platform": [ + "web" + ], + "created_by": { + "id": "000000000000000000000000" + }, + "date_meta": { + "created_on": "2020-04-30T03:25:14.549Z", + "modified_on": "2020-04-30T03:25:14.549Z" + }, + "archived": true + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getLegalInformation +Get legal information + + + + +```swift +client.application("").content.getLegalInformation() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get the legal information of an application, which includes Policy, Terms and Conditions, Shipping Policy and FAQ regarding the application. + +*Returned Response:* + + + + +[ApplicationLegal](#ApplicationLegal) + +Success. Refer `ApplicationLegal` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "tnc": "TERMS AND CONDITIONS FOR RECURRING PAYMENTS ON FYND PLATFORM\n\nUpdated On: July 11, 2020\n\nWhen you purchase (“**Services**”) from Fynd Platform (“**Fynd Platform**”, “**We**” or “**Us**”), you have the option to make payments on a recurring basis (“**Recurring Payments**”) on the (“**Terms and Conditions**”) below for your monthly usage charges towards the services provided to you under the account you operate with Fynd Platform (“**Account**”). We may, at our sole discretion, refuse Recurring Payments to anyone without notice for any reason at any time. \n\n\n1. **Recurring Payments** - You are not required to make Recurring Payments, and you may cancel Recurring Payments for your Account at your discretion. We will make Recurring Payments available to you only if you have designated an eligible payment method for your Account that is current, valid and otherwise acceptable to us. Such a method is hereinafter referred to as \"Payment Method\". We reserve the right to decide the payment methods eligible for Recurring Payments and we will automatically charge your Payment Method. You are solely responsible for the accuracy of the information you provide us regarding your Payment Method. We may limit the amount that you can pay using Recurring Payments every month.\n\n2. **Enabling Recurring Payments**- You agree that Recurring Payments will be enabled automatically for your Account if you chose an eligible Payment Method. Once Recurring Payments have been enabled for your Account, you authorize us to use your Payment Method to pay for your monthly invoices automatically until you cancel Recurring Payments for your Account. In Addition, once Recurring Payments has been enabled, you authorize us to charge the fees for the Services, unless you cancel or disable Recurring Payment, by means specified by us and applicable at such time, in which case you will be required to take action and pay for the Services.\n\n3. **Verification and Authentication**- Before Recurring Payments are enabled for your Fynd Platform Account, verification and authentication of your Payment Method will be performed. Once the verification and authentication are successful, you will be registered for Recurring Payments. This verification and authentication may also be repeated if (a) there are changes to your Account or Payment Method; (b) you cancel or disable Recurring Payments; (c) one of your Recurring Payments is declined for any reason whatsoever, including without limitation, expiry of your card.\n\n4. **Third Party Payment Processors** - You agree, understand and acknowledge that Fynd Platform may engage third party payment processors or gateway service providers to process Recurring Payments. Therefore, you may be required to agree to the terms and conditions of the third party payment processors or gateway service providers as communicated to you from time to time.\n\n5. **Cancelling Recurring Payments** - You have the right to cancel Recurring Payments for your Fynd Platform Account by contacting our customer support.\n\n6. **Notifications** - You authorize us to communicate with you by email regarding Recurring Payments. You acknowledge that we may also communicate with you through our affiliates that provide Services to you.\n\n7. **Disclaimer of Liability** - You agree that we will not be liable for any losses or damages suffered by you because of your use of Recurring Payments for your Fynd Platform Account, including any fraud in connection with any payment using your Payment Method. You realize that neither Fynd Platform nor Shopsense Retail Technologies Pvt. Ltd. which fully owns and controls the Fynd Platform, will be held responsible for any damages, whether partial or full.\n\n\n8. **Agreement Changes** - We may in our discretion change these Terms and Conditions at any time. If any change is found to be invalid, void, or for any reason unenforceable, that change is severable and does not affect the validity and enforceability of any other changes or the remainder of these Terms and Conditions.\n\nYOUR CONTINUED USE OF RECURRING PAYMENTS FOR YOUR FYND PLATFORM ACCOUNT AFTER WE CHANGE THESE TERMS AND CONDITIONS CONSTITUTES YOUR ACCEPTANCE OF THESE CHANGES.", + "policy": "**Privacy policy test**", + "shipping": "**Shipping term and conditions**", + "returns": "**Terms & conditions for returns **", + "_id": "5e8b2b96abe7dc94c02c9ac9", + "application": "000000000000000000000001", + "faq": [ + { + "question": "New Question", + "answer": "New Answer" + }, + { + "question": "New", + "answer": "sdfghjhg" + }, + { + "question": "test", + "answer": "test" + }, + { + "question": "New Test", + "answer": "New Test answer" + }, + { + "question": "test", + "answer": "test" + } + ], + "created_at": "2020-04-06T13:16:06.818Z", + "updated_at": "2020-07-16T09:47:40.751Z", + "__v": 260 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateLegalInformation +Save legal information + + + + +```swift +client.application("").content.updateLegalInformation(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | ApplicationLegal | yes | Request body | + + +Use this API to edit, update and save the legal information of an application, which includes Policy, Terms and Conditions, Shipping Policy and FAQ regarding the application. + +*Returned Response:* + + + + +[ApplicationLegal](#ApplicationLegal) + +Success. Refer `ApplicationLegal` for more details. + + + + +
    +  Example: + +```json +{ + "tnc": "This is terms and condition", + "policy": "This is policy", + "faq": [ + { + "question": "This is question", + "answer": "This is answer" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getNavigations +Get navigations + + + + +```swift +client.application("").content.getNavigations(devicePlatform: devicePlatform, pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| devicePlatform | String | yes | Filter navigations by platform. Acceptable values are: web, android, ios, all | +| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | +| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | + + + +Use this API to fetch the navigations details which includes the items of the navigation pane. It also shows the orientation, links, sub-navigations, etc. + +*Returned Response:* + + + + +[NavigationGetResponse](#NavigationGetResponse) + +Success. Refer `NavigationGetResponse` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "_id": "5ffbd9b90ac98678ae0458d7", + "application": "000000000000000000000001", + "_custom_json": null, + "name": "temp", + "slug": "temp", + "platform": "web", + "position": "top", + "orientation": "landscape", + "navigation": [ + { + "display": "Home", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/mystore-tab_y0dqzt.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/", + "type": "home" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + }, + "sub_navigation": [ + { + "display": "Brands", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/brands-tab_sfinpk.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/brands/", + "type": "brands" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + } + } + ] + }, + { + "display": "Collections", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/collections-tab_a0tg9c.png", + "sort_order": 2, + "type": "", + "action": { + "page": { + "url": "/collections/", + "type": "collections" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + }, + "sub_navigation": [ + { + "display": "Categories", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148154/production/system/icons/categories-tab_ss8e0q.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/categories/", + "type": "categories" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + } + } + ] + }, + { + "display": "Primary Menu", + "image": "", + "sort_order": 3, + "type": "", + "action": { + "page": { + "type": "home" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + } + } + ], + "created_by": { + "id": "000000000000000000000000" + }, + "date_meta": { + "created_on": "2021-01-11T04:53:13.585Z", + "modified_on": "2021-01-14T10:24:34.485Z" + } + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 2, + "has_next": true + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createNavigation +Create a navigation + + + + +```swift +client.application("").content.createNavigation(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | NavigationRequest | yes | Request body | + + +Navigation is the arrangement of navigational items to ease the accessibility of resources for users on a website. Use this API to create a navigation. + +*Returned Response:* + + + + +[NavigationSchema](#NavigationSchema) + +Success. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "_id": "5ffbd9b90ac98678ae0458d7", + "application": "000000000000000000000001", + "_custom_json": null, + "name": "test-nav", + "slug": "test-nav", + "platform": [ + "ios", + "android" + ], + "orientation": { + "portrait": [ + "left" + ] + }, + "navigation": [ + { + "display": "Home", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/mystore-tab_y0dqzt.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/", + "type": "home" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + }, + "sub_navigation": [ + { + "display": "Brands", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/brands-tab_sfinpk.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/brands/", + "type": "brands" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + } + } + ] + }, + { + "display": "Collections", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/collections-tab_a0tg9c.png", + "sort_order": 2, + "type": "", + "action": { + "page": { + "url": "/collections/", + "type": "collections" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + }, + "sub_navigation": [ + { + "display": "Categories", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148154/production/system/icons/categories-tab_ss8e0q.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/categories/", + "type": "categories" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + } + } + ] + }, + { + "display": "Primary Menu", + "image": "", + "sort_order": 3, + "type": "", + "action": { + "page": { + "type": "home" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + } + } + ], + "created_by": { + "id": "000000000000000000000000" + }, + "date_meta": { + "created_on": "2021-01-11T04:53:13.585Z", + "modified_on": "2021-01-14T10:24:34.485Z" + }, + "archived": false + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getDefaultNavigations +Get default navigations + + + + +```swift +client.application("").content.getDefaultNavigations() { (response, error) in + // Use response +} +``` + + + + + + +On any website (application), there are navigations that are present by default. Use this API to retrieve those default navigations. + +*Returned Response:* + + + + +[DefaultNavigationResponse](#DefaultNavigationResponse) + +Success. Refer `DefaultNavigationResponse` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "name": "default-bottom", + "slug": "default-bottom-vIhLiJKQvUZdQvGWzDdrzLP3CTC4Hbxg", + "orientation": { + "landscape": [ + "bottom" + ] + }, + "version": 3, + "navigation": [ + { + "display": "Home", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/mystore-tab_y0dqzt.png", + "sort_order": 1, + "acl": [ + "all" + ], + "action": { + "page": { + "type": "home" + }, + "type": "page" + }, + "active": true + }, + { + "display": "Brands", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/brands-tab_sfinpk.png", + "sort_order": 2, + "acl": [ + "all" + ], + "action": { + "page": { + "type": "brands" + }, + "type": "page" + }, + "active": true + }, + { + "display": "Collections", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/collections-tab_a0tg9c.png", + "sort_order": 3, + "acl": [ + "all" + ], + "action": { + "page": { + "type": "collections" + }, + "type": "page" + }, + "active": true + }, + { + "display": "Categories", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148154/production/system/icons/categories-tab_ss8e0q.png", + "sort_order": 4, + "acl": [ + "all" + ], + "action": { + "page": { + "type": "categories" + }, + "type": "page" + }, + "active": true + } + ], + "created_by": {}, + "_id": "6050244dbd9e072063f1586b", + "platform": [ + "android" + ] + }, + { + "name": "default-bottom", + "slug": "default-bottom-SB0zLTfiPN4Z5doJQBKRagsLTDldm8Ug", + "orientation": { + "landscape": [ + "bottom" + ] + }, + "version": 3, + "navigation": [ + { + "display": "Home", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/mystore-tab_y0dqzt.png", + "sort_order": 1, + "acl": [ + "all" + ], + "action": { + "page": { + "type": "home" + }, + "type": "page" + }, + "active": true + }, + { + "display": "Brands", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/brands-tab_sfinpk.png", + "sort_order": 2, + "acl": [ + "all" + ], + "action": { + "page": { + "type": "brands" + }, + "type": "page" + }, + "active": true + }, + { + "display": "Collections", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/collections-tab_a0tg9c.png", + "sort_order": 3, + "acl": [ + "all" + ], + "action": { + "page": { + "type": "collections" + }, + "type": "page" + }, + "active": true + }, + { + "display": "Categories", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148154/production/system/icons/categories-tab_ss8e0q.png", + "sort_order": 4, + "acl": [ + "all" + ], + "action": { + "page": { + "type": "categories" + }, + "type": "page" + }, + "active": true + } + ], + "created_by": {}, + "_id": "6050244dbd9e072063f1586c", + "platform": [ + "ios" + ] + }, + { + "name": "default-left", + "slug": "default-left-dWrrfpfcNw6Arl0QtmK5VgunYYAHhGRR", + "orientation": { + "portrait": [ + "left" + ] + }, + "version": 3, + "navigation": [ + { + "display": "Profile", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1583938091/production/applications/app_000000000000000000000001/media/navigation/icon/hv0cd5jdo0rkhsqoizmi.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/", + "type": "profile" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "registered" + ] + }, + { + "display": "Orders", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1583938144/production/applications/app_000000000000000000000001/media/navigation/icon/lmv4fzpxxk0a6acitlfg.png", + "sort_order": 2, + "type": "", + "action": { + "page": { + "url": "/", + "type": "orders" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "registered" + ] + }, + { + "display": "Track Order", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1583938144/production/applications/app_000000000000000000000001/media/navigation/icon/lmv4fzpxxk0a6acitlfg.png", + "sort_order": 3, + "type": "", + "action": { + "page": { + "type": "track-order" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "anonymous" + ] + }, + { + "display": "Addresses", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1583938161/production/applications/app_000000000000000000000001/media/navigation/icon/qbod8vkjmot3qnaroibr.png", + "sort_order": 4, + "type": "", + "action": { + "page": { + "url": "/", + "type": "addresses" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "registered" + ] + }, + { + "display": "Wishlist", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1583938125/production/applications/app_000000000000000000000001/media/navigation/icon/u8c7jdke4a3wwc0ftz8x.png", + "sort_order": 5, + "type": "", + "action": { + "page": { + "url": "/wishlist/", + "type": "wishlist" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "registered" + ] + }, + { + "display": "Settings", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1584003256/production/applications/app_000000000000000000000001/media/navigation/icon/vywbdiio1zi7cbnltvgz.png", + "sort_order": 6, + "type": "", + "action": { + "page": { + "url": "/", + "type": "settings" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "all" + ] + }, + { + "display": "Policy", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1583939301/production/applications/app_000000000000000000000001/media/navigation/icon/bygqvme7hkrd45oemzy0.png", + "sort_order": 7, + "type": "", + "action": { + "page": { + "url": "/", + "type": "policy" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "all" + ] + }, + { + "display": "Terms & Conditions", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1583939382/production/applications/app_000000000000000000000001/media/navigation/icon/eaq0aagqr0xirojbuki3.png", + "sort_order": 8, + "type": "", + "action": { + "page": { + "url": "/", + "type": "tnc" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "all" + ] + }, + { + "display": "Need Help", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1583939416/production/applications/app_000000000000000000000001/media/navigation/icon/xeqv7pzyxagwtxcwvxbw.png", + "sort_order": 9, + "type": "", + "action": { + "page": { + "url": "/faq/", + "type": "faq" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "all" + ] + }, + { + "display": "About Us", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1583939196/production/applications/app_000000000000000000000001/media/navigation/icon/dccm5et4sgylisbug9xr.png", + "sort_order": 10, + "type": "", + "action": { + "page": { + "url": "/", + "type": "about-us" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "all" + ] + }, + { + "display": "Rate Us", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1584091739/production/applications/app_000000000000000000000001/media/navigation/icon/afryyfeccqgjyeosdmbz.png", + "sort_order": 11, + "type": "", + "action": { + "page": { + "url": "/", + "type": "rate-us" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "registered" + ] + } + ], + "created_by": {}, + "_id": "6050244dbd9e072063f1586d", + "platform": [ + "android" + ] + }, + { + "name": "default-left", + "slug": "default-left-tRK1fsQVUD7BmdvX30Fb4u5ZVSrSi3KW", + "orientation": { + "portrait": [ + "left" + ] + }, + "version": 3, + "navigation": [ + { + "display": "Profile", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1583938091/production/applications/app_000000000000000000000001/media/navigation/icon/hv0cd5jdo0rkhsqoizmi.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/", + "type": "profile" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "registered" + ] + }, + { + "display": "Orders", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1583938144/production/applications/app_000000000000000000000001/media/navigation/icon/lmv4fzpxxk0a6acitlfg.png", + "sort_order": 2, + "type": "", + "action": { + "page": { + "url": "/", + "type": "orders" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "registered" + ] + }, + { + "display": "Track Order", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1583938144/production/applications/app_000000000000000000000001/media/navigation/icon/lmv4fzpxxk0a6acitlfg.png", + "sort_order": 3, + "type": "", + "action": { + "page": { + "type": "track-order" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "anonymous" + ] + }, + { + "display": "Addresses", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1583938161/production/applications/app_000000000000000000000001/media/navigation/icon/qbod8vkjmot3qnaroibr.png", + "sort_order": 4, + "type": "", + "action": { + "page": { + "url": "/", + "type": "addresses" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "registered" + ] + }, + { + "display": "Wishlist", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1583938125/production/applications/app_000000000000000000000001/media/navigation/icon/u8c7jdke4a3wwc0ftz8x.png", + "sort_order": 5, + "type": "", + "action": { + "page": { + "url": "/wishlist/", + "type": "wishlist" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "registered" + ] + }, + { + "display": "Settings", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1584003256/production/applications/app_000000000000000000000001/media/navigation/icon/vywbdiio1zi7cbnltvgz.png", + "sort_order": 6, + "type": "", + "action": { + "page": { + "url": "/", + "type": "settings" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "all" + ] + }, + { + "display": "Policy", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1583939301/production/applications/app_000000000000000000000001/media/navigation/icon/bygqvme7hkrd45oemzy0.png", + "sort_order": 7, + "type": "", + "action": { + "page": { + "url": "/", + "type": "policy" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "all" + ] + }, + { + "display": "Terms & Conditions", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1583939382/production/applications/app_000000000000000000000001/media/navigation/icon/eaq0aagqr0xirojbuki3.png", + "sort_order": 8, + "type": "", + "action": { + "page": { + "url": "/", + "type": "tnc" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "all" + ] + }, + { + "display": "Need Help", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1583939416/production/applications/app_000000000000000000000001/media/navigation/icon/xeqv7pzyxagwtxcwvxbw.png", + "sort_order": 9, + "type": "", + "action": { + "page": { + "url": "/faq/", + "type": "faq" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "all" + ] + }, + { + "display": "About Us", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1583939196/production/applications/app_000000000000000000000001/media/navigation/icon/dccm5et4sgylisbug9xr.png", + "sort_order": 10, + "type": "", + "action": { + "page": { + "url": "/", + "type": "about-us" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "all" + ] + }, + { + "display": "Rate Us", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1584091739/production/applications/app_000000000000000000000001/media/navigation/icon/afryyfeccqgjyeosdmbz.png", + "sort_order": 11, + "type": "", + "action": { + "page": { + "url": "/", + "type": "rate-us" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "acl": [ + "registered" + ] + } + ], + "created_by": {}, + "_id": "6050244dbd9e072063f1586e", + "platform": [ + "ios" + ] + }, + { + "name": "default-top", + "slug": "default-top-qrprb8dxqr3m698wwUGXWsvTfVkjt4cR", + "orientation": { + "landscape": [ + "top" + ] + }, + "version": 3, + "navigation": [ + { + "display": "Home", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/mystore-tab_y0dqzt.png", + "sort_order": 1, + "acl": [ + "all" + ], + "action": { + "page": { + "type": "home" + }, + "type": "page" + }, + "active": true + }, + { + "display": "Brands", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/brands-tab_sfinpk.png", + "sort_order": 2, + "acl": [ + "all" + ], + "action": { + "page": { + "type": "brands" + }, + "type": "page" + }, + "active": true + }, + { + "display": "Collections", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/collections-tab_a0tg9c.png", + "sort_order": 3, + "acl": [ + "all" + ], + "action": { + "page": { + "type": "collections" + }, + "type": "page" + }, + "active": true + }, + { + "display": "Categories", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148154/production/system/icons/categories-tab_ss8e0q.png", + "sort_order": 4, + "acl": [ + "all" + ], + "action": { + "page": { + "type": "categories" + }, + "type": "page" + }, + "active": true + } + ], + "created_by": {}, + "_id": "6050244dbd9e072063f1586f", + "platform": [ + "web" + ] + } + ] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getNavigationBySlug +Get a navigation by slug + + + + +```swift +client.application("").content.getNavigationBySlug(slug: slug, devicePlatform: devicePlatform) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a navigation. You can get slug value of a navigation from `getNavigations` API. | +| devicePlatform | String | yes | Filter navigations by platform. Acceptable values are: web, android, ios, all | + + + +Use this API to retrieve a navigation by its slug. + +*Returned Response:* + + + + +[NavigationSchema](#NavigationSchema) + +Success. Refer `NavigationSchema` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "_id": "5ffbd9b90ac98678ae0458d7", + "application": "000000000000000000000001", + "_custom_json": null, + "name": "test-nav", + "slug": "test-nav", + "platform": [ + "ios", + "android" + ], + "orientation": { + "portrait": [ + "left" + ] + }, + "navigation": [ + { + "display": "Home", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/mystore-tab_y0dqzt.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/", + "type": "home" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + }, + "sub_navigation": [ + { + "display": "Brands", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/brands-tab_sfinpk.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/brands/", + "type": "brands" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + } + } + ] + }, + { + "display": "Collections", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/collections-tab_a0tg9c.png", + "sort_order": 2, + "type": "", + "action": { + "page": { + "url": "/collections/", + "type": "collections" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + }, + "sub_navigation": [ + { + "display": "Categories", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148154/production/system/icons/categories-tab_ss8e0q.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/categories/", + "type": "categories" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + } + } + ] + }, + { + "display": "Primary Menu", + "image": "", + "sort_order": 3, + "type": "", + "action": { + "page": { + "type": "home" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + } + } + ], + "created_by": { + "id": "000000000000000000000000" + }, + "date_meta": { + "created_on": "2021-01-11T04:53:13.585Z", + "modified_on": "2021-01-14T10:24:34.485Z" + }, + "archived": false + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateNavigation +Update a navigation + + + + +```swift +client.application("").content.updateNavigation(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | ID allotted to the navigation. | +| body | NavigationRequest | yes | Request body | + + +Use this API to edit the details of an existing navigation. + +*Returned Response:* + + + + +[NavigationSchema](#NavigationSchema) + +Success. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "_id": "5ffbd9b90ac98678ae0458d7", + "application": "000000000000000000000001", + "_custom_json": null, + "name": "test-nav", + "slug": "test-nav", + "platform": [ + "ios", + "android" + ], + "orientation": { + "portrait": [ + "left" + ] + }, + "navigation": [ + { + "display": "Home", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/mystore-tab_y0dqzt.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/", + "type": "home" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + }, + "sub_navigation": [ + { + "display": "Brands", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/brands-tab_sfinpk.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/brands/", + "type": "brands" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + } + } + ] + }, + { + "display": "Collections", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/collections-tab_a0tg9c.png", + "sort_order": 2, + "type": "", + "action": { + "page": { + "url": "/collections/", + "type": "collections" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + }, + "sub_navigation": [ + { + "display": "Categories", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148154/production/system/icons/categories-tab_ss8e0q.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/categories/", + "type": "categories" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + } + } + ] + }, + { + "display": "Primary Menu", + "image": "", + "sort_order": 3, + "type": "", + "action": { + "page": { + "type": "home" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + } + } + ], + "created_by": { + "id": "000000000000000000000000" + }, + "date_meta": { + "created_on": "2021-01-11T04:53:13.585Z", + "modified_on": "2021-01-14T10:24:34.485Z" + }, + "archived": false + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### deleteNavigation +Delete a navigation + + + + +```swift +client.application("").content.deleteNavigation(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | ID allotted to the navigation. | + + + +Use this API to delete an existing navigation. + +*Returned Response:* + + + + +[NavigationSchema](#NavigationSchema) + +Success. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "_id": "5ffbd9b90ac98678ae0458d7", + "application": "000000000000000000000001", + "_custom_json": null, + "name": "temp", + "slug": "temp", + "platform": "[web]", + "orientation": { + "portrait": [ + "left" + ] + }, + "navigation": [ + { + "display": "Home", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/mystore-tab_y0dqzt.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/", + "type": "home" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + }, + "sub_navigation": [ + { + "display": "Brands", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/brands-tab_sfinpk.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/brands/", + "type": "brands" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + } + } + ] + }, + { + "display": "Collections", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/collections-tab_a0tg9c.png", + "sort_order": 2, + "type": "", + "action": { + "page": { + "url": "/collections/", + "type": "collections" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + }, + "sub_navigation": [ + { + "display": "Categories", + "image": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148154/production/system/icons/categories-tab_ss8e0q.png", + "sort_order": 1, + "type": "", + "action": { + "page": { + "url": "/categories/", + "type": "categories" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + } + } + ] + }, + { + "display": "Primary Menu", + "image": "", + "sort_order": 3, + "type": "", + "action": { + "page": { + "type": "home" + }, + "popup": {}, + "type": "page" + }, + "active": true, + "tags": null, + "acl": [ + "all" + ], + "_locale_language": { + "hi": { + "display": "" + }, + "ar": { + "display": "" + }, + "en_us": { + "display": "" + } + } + } + ], + "created_by": { + "id": "000000000000000000000000" + }, + "date_meta": { + "created_on": "2021-01-11T04:53:13.585Z", + "modified_on": "2021-01-14T10:24:34.485Z" + }, + "archived": true + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getPageMeta +Get page meta + + + + +```swift +client.application("").content.getPageMeta() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get the meta of custom pages (blog, page) and default system pages (e.g. home/brand/category/collection). + +*Returned Response:* + + + + +[PageMetaSchema](#PageMetaSchema) + +Success. Refer `PageMetaSchema` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "application_id": "000000000000000000000001", + "system_pages": [ + { + "display": "Home", + "action": { + "page": { + "type": "home" + }, + "type": "page" + }, + "page_type": "home" + }, + { + "display": "Brands", + "action": { + "page": { + "type": "brands" + }, + "type": "page" + }, + "page_type": "brands" + }, + { + "display": "Collections", + "action": { + "page": { + "type": "collections" + }, + "type": "page" + }, + "page_type": "collections" + }, + { + "display": "Categories", + "action": { + "page": { + "type": "categories" + }, + "type": "page" + }, + "page_type": "categories" + } + ], + "custom_pages": [ + { + "display": "my first page", + "slug": "first_page" + }, + { + "display": "my second page", + "slug": "second_page" + } + ] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getPageSpec +Get page spec + + + + +```swift +client.application("").content.getPageSpec() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get the specifications of a page, such as page type, display name, params and query. + +*Returned Response:* + + + + +[PageSpec](#PageSpec) + +Success. Refer `PageSpec` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "specifications": [ + { + "page_type": "home", + "display_name": "Home", + "params": [], + "query": [] + }, + { + "page_type": "collections", + "display_name": "Collections", + "params": [], + "query": [] + }, + { + "page_type": "collection", + "display_name": "Collection", + "params": [ + { + "key": "slug", + "required": true + } + ], + "query": [] + } + ] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createPagePreview +Create a page preview + + + + +```swift +client.application("").content.createPagePreview(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | PageRequest | yes | Request body | + + +Use this API to create a page preview to check the appearance of a custom page. + +*Returned Response:* + + + + +[PageSchema](#PageSchema) + +Success. Refer `PageSchema` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "date_meta": { + "created_on": "2021-03-16T08:24:19.197Z", + "modified_on": "2021-03-16T08:24:19.197Z" + }, + "tags": [ + "my first page" + ], + "published": true, + "component_ids": [], + "archived": false, + "_id": "60506dcad18cb33946026862", + "title": "my first page", + "slug": "1st_page", + "feature_image": { + "secure_url": "https://google.com/some-image" + }, + "content": [ + { + "type": "html", + "value": "
    Emtpy Page. Create Page here.
    hello there!
    how are you doing

    " + }, + { + "type": "css", + "value": "* { box-sizing: border-box; } body {margin: 0;}*{box-sizing:border-box;}body{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}*{box-sizing:border-box;}body{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}#icfm{text-align:center;padding-top:30px;padding-right:30px;padding-bottom:30px;padding-left:30px;}#izu5{padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;}#ibgj{color:black;}#izzl{float:none;display:flex;}.aa{float:right;}" + }, + { + "type": "js", + "value": "" + } + ], + "content_path": "https://hdn-1.fynd.com/company/1526/applications/61012f6a9250ccd1b9ef8a1d/pages/content/page_slug.html", + "platform": "web", + "description": "hey this is my first page", + "visibility": { + "test": true + }, + "_schedule": { + "start": "2021-04-23T23:50:00.000Z", + "next_schedule": [ + {} + ] + }, + "seo": { + "title": "my first page", + "description": "hey this is my first page", + "image": { + "url": "" + } + }, + "type": "rawhtml", + "application": "000000000000000000000001", + "orientation": "portrait", + "page_meta": [] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updatePagePreview +Change the publish status of a page + + + + +```swift +client.application("").content.updatePagePreview(slug: slug, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a page. You can get slug value of a page from `getPages` API. | +| body | PagePublishRequest | yes | Request body | + + +Use this API to change the publish status of an existing page. Allows you to publish and unpublish the page. + +*Returned Response:* + + + + +[PageSchema](#PageSchema) + +Success. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "date_meta": { + "created_on": "2021-03-16T08:24:19.197Z", + "modified_on": "2021-03-16T08:24:19.197Z" + }, + "tags": [ + "my first page" + ], + "published": true, + "component_ids": [], + "archived": false, + "_id": "60506dcad18cb33946026862", + "title": "my first page", + "slug": "1st_page", + "feature_image": { + "secure_url": "https://google.com/some-image" + }, + "content": [ + { + "type": "html", + "value": "
    Emtpy Page. Create Page here.
    hello there!
    how are you doing

    " + }, + { + "type": "css", + "value": "* { box-sizing: border-box; } body {margin: 0;}*{box-sizing:border-box;}body{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}*{box-sizing:border-box;}body{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}#icfm{text-align:center;padding-top:30px;padding-right:30px;padding-bottom:30px;padding-left:30px;}#izu5{padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;}#ibgj{color:black;}#izzl{float:none;display:flex;}.aa{float:right;}" + }, + { + "type": "js", + "value": "" + } + ], + "content_path": "https://hdn-1.fynd.com/company/1526/applications/61012f6a9250ccd1b9ef8a1d/pages/content/page_slug.html", + "platform": "web", + "description": "hey this is my first page", + "visibility": { + "test": true + }, + "_schedule": { + "start": "2021-04-23T23:50:00.000Z", + "next_schedule": [ + {} + ] + }, + "seo": { + "title": "my first page", + "description": "hey this is my first page", + "image": { + "url": "" + } + }, + "type": "rawhtml", + "application": "000000000000000000000001", + "orientation": "portrait", + "page_meta": [] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### deletePage +Delete a page + + + + +```swift +client.application("").content.deletePage(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | ID allotted to the page. | + + + +Use this API to delete an existing page. + +*Returned Response:* + + + + +[PageSchema](#PageSchema) + +Success. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "date_meta": { + "created_on": "2021-03-16T08:24:19.197Z", + "modified_on": "2021-03-16T08:24:19.197Z" + }, + "tags": [ + "my first page" + ], + "published": true, + "component_ids": [], + "archived": false, + "_id": "60506dcad18cb33946026862", + "title": "my first page", + "slug": "1st_page", + "feature_image": { + "secure_url": "https://google.com/some-image" + }, + "content": [ + { + "type": "html", + "value": "
    Emtpy Page. Create Page here.
    hello there!
    how are you doing

    " + }, + { + "type": "css", + "value": "* { box-sizing: border-box; } body {margin: 0;}*{box-sizing:border-box;}body{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}*{box-sizing:border-box;}body{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}#icfm{text-align:center;padding-top:30px;padding-right:30px;padding-bottom:30px;padding-left:30px;}#izu5{padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;}#ibgj{color:black;}#izzl{float:none;display:flex;}.aa{float:right;}" + }, + { + "type": "js", + "value": "" + } + ], + "content_path": "https://hdn-1.fynd.com/company/1526/applications/61012f6a9250ccd1b9ef8a1d/pages/content/page_slug.html", + "platform": "web", + "description": "hey this is my first page", + "visibility": { + "test": true + }, + "_schedule": { + "start": "2021-04-23T23:50:00.000Z", + "next_schedule": [ + {} + ] + }, + "seo": { + "title": "my first page", + "description": "hey this is my first page", + "image": { + "url": "" + } + }, + "type": "rawhtml", + "application": "000000000000000000000001", + "orientation": "portrait", + "page_meta": [] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updatePathRedirectionRules +Save path based redirection rules + + + + +```swift +client.application("").content.updatePathRedirectionRules(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | PathMappingSchema | yes | Request body | + + +Use this API to add, update or delete path-based redirection rules + +*Returned Response:* + + + + +[PathMappingSchema](#PathMappingSchema) + +Success. Refer `PathMappingSchema` for more details. + + + + +
    +  Example: + +```json +{ + "redirections": [ + { + "redirect_from": "test.hostfynd.dev/redirect_from", + "redirect_to": "/redirect_to" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getPathRedirectionRules +Get path based redirection rules + + + + +```swift +client.application("").content.getPathRedirectionRules() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get path based redirection rules. + +*Returned Response:* + + + + +[PathMappingSchema](#PathMappingSchema) + +Success. Refer `PathMappingSchema` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "_id": "615188e9db1e444cb0f40837", + "application": "000000000000000000000002", + "redirections": [ + { + "redirect_from": "/from", + "redirect_to": "/to" + } + ], + "createdAt": "2021-09-27T09:03:37.053Z", + "updatedAt": "2021-09-27T09:09:25.587Z" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getSEOConfiguration +Get SEO configuration of an application + + + + +```swift +client.application("").content.getSEOConfiguration() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to know how the SEO is configured in the application. This includes the sitemap, robot.txt, custom meta tags, etc. + +*Returned Response:* + + + + +[SeoComponent](#SeoComponent) + +Success. Refer `SeoComponent` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "seo": { + "details": { + "title": "Zyosa Zyosa" + }, + "robots_txt": "User-agent: * \nAllow: / \nsancisciasn xwsaixjowqnxwsiwjs", + "sitemap_enabled": false, + "_id": "6009819ee463ad40de397eb2", + "app": "000000000000000000000001", + "created_at": "2021-01-21T13:29:02.543Z", + "updated_at": "2021-02-05T06:36:16.048Z", + "__v": 11, + "custom_meta_tags": [ + { + "name": "test 0000", + "content": "", + "_id": "6017c301bde3c21dbb13b284" + }, + { + "name": "cwdcdc", + "content": "", + "_id": "6017c675bde3c22cfb13b290" + } + ] + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateSEOConfiguration +Update SEO of application + + + + +```swift +client.application("").content.updateSEOConfiguration(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | SeoComponent | yes | Request body | + + +Use this API to edit the SEO details of an application. This includes the sitemap, robot.txt, custom meta tags, etc. + +*Returned Response:* + + + + +[SeoSchema](#SeoSchema) + +Success. Refer `SeoSchema` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "details": { + "title": "Zyosa Zyosa" + }, + "robots_txt": "User-agent: * \nAllow: / \nsancisciasn xwsaixjowqnxwsiwjs", + "sitemap_enabled": false, + "_id": "6009819ee463ad40de397eb2", + "app": "000000000000000000000001", + "created_at": "2021-01-21T13:29:02.543Z", + "updated_at": "2021-02-05T06:36:16.048Z", + "__v": 11, + "custom_meta_tags": [ + { + "name": "test 0000", + "content": "", + "_id": "6017c301bde3c21dbb13b284" + }, + { + "name": "cwdcdc", + "content": "", + "_id": "6017c675bde3c22cfb13b290" + } + ] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getSlideshows +Get slideshows + + + + +```swift +client.application("").content.getSlideshows(devicePlatform: devicePlatform, pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| devicePlatform | String | yes | Filter slideshows by platform. Acceptable values are: web, android, ios and all | +| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | +| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | + + + +A slideshow is a group of images, videos or a combination of both that are shown on the website in the form of slides. Use this API to fetch a list of slideshows. + +*Returned Response:* + + + + +[SlideshowGetResponse](#SlideshowGetResponse) + +Success. Refer `SlideshowGetResponse` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "date_meta": { + "created_on": "2021-03-14T05:27:12.319Z", + "modified_on": "2021-03-14T05:27:12.319Z" + }, + "archived": false, + "_id": "604d9eb975e9d136bb1b8b83", + "configuration": { + "start_on_launch": false, + "duration": 50, + "sleep_time": 100, + "slide_direction": "horizontal" + }, + "slug": "ss-sfsd-updated", + "platform": "ios", + "media": [ + { + "auto_decide_duration": false, + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/brands-tab_sfinpk.png", + "bg_color": "#ffffff", + "duration": 10, + "action": { + "type": "" + } + }, + { + "auto_decide_duration": true, + "type": "youtube", + "url": "https://www.youtube.com/embed/9vJRopau0g0", + "bg_color": "#ffffff", + "duration": 909, + "action": { + "type": "" + } + } + ], + "application": "5cd3db5e9d692cfe5302a7bb", + "active": true, + "__v": 0 + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 2, + "has_next": true + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createSlideshow +Create a slideshow + + + + +```swift +client.application("").content.createSlideshow(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | SlideshowRequest | yes | Request body | + + +A slideshow is a group of images, videos or a combination of both that are shown on the website in the form of slides. Use this API to create a slideshow. + +*Returned Response:* + + + + +[SlideshowSchema](#SlideshowSchema) + +Success. Refer `SlideshowSchema` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "date_meta": { + "created_on": "2021-03-14T05:27:12.319Z", + "modified_on": "2021-03-14T05:27:12.319Z" + }, + "archived": false, + "_id": "604d9eb975e9d136bb1b8b83", + "configuration": { + "start_on_launch": false, + "duration": 50, + "sleep_time": 100, + "slide_direction": "horizontal" + }, + "slug": "ss-sfsd-updated", + "platform": "ios", + "media": [ + { + "auto_decide_duration": false, + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/brands-tab_sfinpk.png", + "bg_color": "#ffffff", + "duration": 10, + "action": { + "type": "" + } + }, + { + "auto_decide_duration": true, + "type": "youtube", + "url": "https://www.youtube.com/embed/9vJRopau0g0", + "bg_color": "#ffffff", + "duration": 909, + "action": { + "type": "" + } + } + ], + "application": "5cd3db5e9d692cfe5302a7bb", + "active": true + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getSlideshowBySlug +Get slideshow by slug + + + + +```swift +client.application("").content.getSlideshowBySlug(slug: slug, devicePlatform: devicePlatform) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a slideshow. You can get slug value of a page from `getSlideshows` API. | +| devicePlatform | String | yes | Filter slideshows by platform. Acceptable values are: web, android, ios and all | + + + +Use this API to retrieve the details of a slideshow by its slug. + +*Returned Response:* + + + + +[SlideshowSchema](#SlideshowSchema) + +Success. Refer `SlideshowSchema` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "date_meta": { + "created_on": "2021-03-14T05:27:12.319Z", + "modified_on": "2021-03-14T05:27:12.319Z" + }, + "archived": false, + "_id": "604d9eb975e9d136bb1b8b83", + "configuration": { + "start_on_launch": false, + "duration": 50, + "sleep_time": 100, + "slide_direction": "horizontal" + }, + "slug": "ss-sfsd-updated", + "platform": "ios", + "media": [ + { + "auto_decide_duration": false, + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/brands-tab_sfinpk.png", + "bg_color": "#ffffff", + "duration": 10, + "action": { + "type": "" + } + }, + { + "auto_decide_duration": true, + "type": "youtube", + "url": "https://www.youtube.com/embed/9vJRopau0g0", + "bg_color": "#ffffff", + "duration": 909, + "action": { + "type": "" + } + } + ], + "application": "5cd3db5e9d692cfe5302a7bb", + "active": true + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateSlideshow +Update a slideshow + + + + +```swift +client.application("").content.updateSlideshow(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | ID allotted to the slideshow. | +| body | SlideshowRequest | yes | Request body | + + +Use this API to edit the details of an existing slideshow. + +*Returned Response:* + + + + +[SlideshowSchema](#SlideshowSchema) + +Success. Refer `SlideshowSchema` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "date_meta": { + "created_on": "2021-03-14T05:27:12.319Z", + "modified_on": "2021-03-14T05:27:12.319Z" + }, + "archived": false, + "_id": "604d9eb975e9d136bb1b8b83", + "configuration": { + "start_on_launch": false, + "duration": 50, + "sleep_time": 100, + "slide_direction": "horizontal" + }, + "slug": "ss-sfsd-updated", + "platform": "ios", + "media": [ + { + "auto_decide_duration": false, + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/brands-tab_sfinpk.png", + "bg_color": "#ffffff", + "duration": 10, + "action": { + "type": "" + } + }, + { + "auto_decide_duration": true, + "type": "youtube", + "url": "https://www.youtube.com/embed/9vJRopau0g0", + "bg_color": "#ffffff", + "duration": 909, + "action": { + "type": "" + } + } + ], + "application": "5cd3db5e9d692cfe5302a7bb", + "active": true + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### deleteSlideshow +Delete a slideshow + + + + +```swift +client.application("").content.deleteSlideshow(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | ID allotted to the slideshow. | + + + +Use this API to delete an existing slideshow. + +*Returned Response:* + + + + +[SlideshowSchema](#SlideshowSchema) + +Success. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "date_meta": { + "created_on": "2021-03-14T05:27:12.319Z", + "modified_on": "2021-03-14T05:27:12.319Z" + }, + "archived": true, + "_id": "604d9eb975e9d136bb1b8b83", + "configuration": { + "start_on_launch": false, + "duration": 50, + "sleep_time": 100, + "slide_direction": "horizontal" + }, + "slug": "ss-sfsd-updated", + "platform": "ios", + "media": [ + { + "auto_decide_duration": false, + "type": "image", + "url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1567148153/production/system/icons/brands-tab_sfinpk.png", + "bg_color": "#ffffff", + "duration": 10, + "action": { + "type": "" + } + }, + { + "auto_decide_duration": true, + "type": "youtube", + "url": "https://www.youtube.com/embed/9vJRopau0g0", + "bg_color": "#ffffff", + "duration": 909, + "action": { + "type": "" + } + } + ], + "application": "5cd3db5e9d692cfe5302a7bb", + "active": true + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getSupportInformation +Get support information + + + + +```swift +client.application("").content.getSupportInformation() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get the contact details for customer support, including emails and phone numbers. + +*Returned Response:* + + + + +[Support](#Support) + +Success. Refer `Support` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "_id": "5ea4980b87a7944094216193", + "config_type": "app", + "application": "000000000000000000000001", + "created_at": "2020-04-25T20:05:31.300Z", + "updated_at": "2020-12-04T10:48:12.194Z", + "contact": { + "phone": { + "active": true, + "phone": [ + { + "key": "Jane Doe", + "code": "91", + "number": "9988776655" + } + ] + }, + "email": { + "active": false, + "email": [] + } + }, + "created": true + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateSupportInformation +Update the support data of an application + + + + +```swift +client.application("").content.updateSupportInformation(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | Support | yes | Request body | + + +Use this API to edit the existing contact details for customer support, including emails and phone numbers. + +*Returned Response:* + + + + +[Support](#Support) + +Success. Refer `Support` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "_id": "5ea4980b87a7944094216193", + "config_type": "app", + "application": "000000000000000000000001", + "created_at": "2020-04-25T20:05:31.300Z", + "updated_at": "2020-12-04T10:48:12.194Z", + "contact": { + "phone": { + "active": true, + "phone": [ + { + "key": "Jane Doe", + "code": "91", + "number": "9988776655" + } + ] + }, + "email": { + "active": false, + "email": [] + } + }, + "created": true + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateInjectableTag +Update a tag + + + + +```swift +client.application("").content.updateInjectableTag(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CreateTagRequestSchema | yes | Request body | + + +Use this API to edit the details of an existing tag. This includes the tag name, tag type (css/js), url and position of the tag. + +*Returned Response:* + + + + +[TagsSchema](#TagsSchema) + +Success. + + + + +
    +  Example: + +```json +{ + "_id": "601f77e7aa61066feda44487", + "tags": [ + { + "name": "Test", + "sub_type": "external", + "_id": "601f77e7aa61066feda44488", + "type": "js", + "url": "youtube.com/watch?v=AaxFIY-cWH0&list=PL3O3jhFJEElBHFbs6XsOqZAWZLtlEkZTw&index=31", + "position": "head" + }, + { + "name": "Test 2", + "sub_type": "external", + "_id": "601f77e7aa61066feda44489", + "type": "js", + "url": "youtube.com/watch?v=AaxFIY-cWH0&list=PL3O3jhFJEElBHFbs6XsOqZAWZLtlEkZTw&index=31", + "position": "head" + } + ], + "application": "000000000000000000000001", + "__v": 0 +} +``` +
    + + + + + + + + + +--- + + +#### deleteAllInjectableTags +Delete tags in application + + + + +```swift +client.application("").content.deleteAllInjectableTags() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to delete all the existing tags at once. + +*Returned Response:* + + + + +[TagsSchema](#TagsSchema) + +Success. + + + + +
    +  Example: + +```json +{ + "_id": "601f77e7aa61066feda44487", + "tags": [ + { + "name": "Test", + "sub_type": "external", + "_id": "601f77e7aa61066feda44488", + "type": "js", + "url": "youtube.com/watch?v=AaxFIY-cWH0&list=PL3O3jhFJEElBHFbs6XsOqZAWZLtlEkZTw&index=31", + "position": "head" + }, + { + "name": "Test 2", + "sub_type": "external", + "_id": "601f77e7aa61066feda44489", + "type": "js", + "url": "youtube.com/watch?v=AaxFIY-cWH0&list=PL3O3jhFJEElBHFbs6XsOqZAWZLtlEkZTw&index=31", + "position": "head" + } + ], + "application": "000000000000000000000001", + "__v": 0 +} +``` +
    + + + + + + + + + +--- + + +#### getInjectableTags +Get all the tags in an application + + + + +```swift +client.application("").content.getInjectableTags() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get all the CSS and JS injected in the application in the form of tags. + +*Returned Response:* + + + + +[TagsSchema](#TagsSchema) + +Success. Refer `TagsSchema` for more details. + + + + +
    +  Example: + +```json +{ + "_id": "601f77e7aa61066feda44487", + "tags": [ + { + "name": "Test", + "sub_type": "external", + "_id": "601f77e7aa61066feda44488", + "type": "js", + "url": "youtube.com/watch?v=AaxFIY-cWH0&list=PL3O3jhFJEElBHFbs6XsOqZAWZLtlEkZTw&index=31", + "position": "head" + }, + { + "name": "Test 2", + "sub_type": "external", + "_id": "601f77e7aa61066feda44489", + "type": "js", + "url": "youtube.com/watch?v=AaxFIY-cWH0&list=PL3O3jhFJEElBHFbs6XsOqZAWZLtlEkZTw&index=31", + "position": "head" + } + ], + "application": "000000000000000000000001", + "__v": 0 +} +``` +
    + + + + + + + + + +--- + + +#### addInjectableTag +Add a tag + + + + +```swift +client.application("").content.addInjectableTag(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CreateTagRequestSchema | yes | Request body | + + +CSS and JS can be injected in the application (website) with the help of tags. Use this API to create such tags by entering the tag name, tag type (css/js), url and position of the tag. + +*Returned Response:* + + + + +[TagsSchema](#TagsSchema) + +Success. + + + + +
    +  Example: + +```json +{ + "_id": "601f77e7aa61066feda44487", + "tags": [ + { + "name": "Test", + "sub_type": "external", + "_id": "601f77e7aa61066feda44488", + "type": "js", + "url": "youtube.com/watch?v=AaxFIY-cWH0&list=PL3O3jhFJEElBHFbs6XsOqZAWZLtlEkZTw&index=31", + "position": "head" + } + ], + "application": "000000000000000000000001", + "__v": 0 +} +``` +
    + + + + + + + + + +--- + + +#### removeInjectableTag +Remove a tag + + + + +```swift +client.application("").content.removeInjectableTag(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | RemoveHandpickedSchema | yes | Request body | + + +Use this API to delete an existing tag. + +*Returned Response:* + + + + +[TagDeleteSuccessResponse](#TagDeleteSuccessResponse) + +Success. + + + + +
    +  Example: + +```json +{ + "success": "true" +} +``` +
    + + + + + + + + + +--- + + +#### editInjectableTag +Edit a tag by id + + + + +```swift +client.application("").content.editInjectableTag(tagId: tagId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| tagId | String | yes | ID allotted to the tag. | +| body | UpdateHandpickedSchema | yes | Request body | + + +Use this API to edit the details of an existing tag by its ID. + +*Returned Response:* + + + + +[TagsSchema](#TagsSchema) + +Success. + + + + +
    +  Example: + +```json +{ + "_id": "602671b3c0bac99158b10874", + "application": "000000000000000000000001", + "tags": [ + { + "_id": "601f77e7aa61066feda44488", + "name": "floating whatsapp", + "sub_type": "inline", + "type": "css", + "position": "head", + "content": ".float{\n\tposition:fixed;\n\twidth:60px;\n\theight:60px;\n\tbottom:40px;\n\tright:40px;\n\tbackground-color:#25d366;\n\tcolor:#FFF;\n\tborder-radius:50px;\n\ttext-align:center;\n font-size:30px;\n\tbox-shadow: 2px 2px 3px #999;\n z-index:100;\n}\n\n.my-float{\n\tmargin-top:16px;\n}" + } + ], + "__v": 1 +} +``` +
    + + + + + + + + + +--- + + +#### createPage +Create a page + + + + +```swift +client.application("").content.createPage(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | PageRequest | yes | Request body | + + +Use this API to create a custom page using a title, seo, publish status, feature image, tags, meta, etc. + +*Returned Response:* + + + + +[PageSchema](#PageSchema) + +Success. Refer `PageSchema` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "date_meta": { + "created_on": "2021-03-16T08:24:19.197Z", + "modified_on": "2021-03-16T08:24:19.197Z" + }, + "tags": [ + "my first page" + ], + "published": true, + "component_ids": [], + "archived": false, + "_id": "60506dcad18cb33946026862", + "title": "my first page", + "slug": "1st_page", + "feature_image": { + "secure_url": "https://google.com/some-image" + }, + "content": [ + { + "type": "html", + "value": "
    Emtpy Page. Create Page here.
    hello there!
    how are you doing

    " + }, + { + "type": "css", + "value": "* { box-sizing: border-box; } body {margin: 0;}*{box-sizing:border-box;}body{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}*{box-sizing:border-box;}body{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}#icfm{text-align:center;padding-top:30px;padding-right:30px;padding-bottom:30px;padding-left:30px;}#izu5{padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;}#ibgj{color:black;}#izzl{float:none;display:flex;}.aa{float:right;}" + }, + { + "type": "js", + "value": "" + } + ], + "content_path": "https://hdn-1.fynd.com/company/1526/applications/61012f6a9250ccd1b9ef8a1d/pages/content/page_slug.html", + "platform": "web", + "description": "hey this is my first page", + "visibility": { + "test": true + }, + "_schedule": { + "start": "2021-04-23T23:50:00.000Z", + "next_schedule": [ + {} + ] + }, + "seo": { + "title": "my first page", + "description": "hey this is my first page", + "image": { + "url": "" + } + }, + "type": "rawhtml", + "application": "000000000000000000000001", + "orientation": "portrait", + "page_meta": [] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getPages +Get a list of pages + + + + +```swift +client.application("").content.getPages(pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | +| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | + + + +Use this API to retrieve a list of pages. + +*Returned Response:* + + + + +[PageGetResponse](#PageGetResponse) + +Success. Refer `PageGetResponse` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "items": [ + { + "date_meta": { + "created_on": "2021-03-14T06:49:03.945Z", + "modified_on": "2021-03-14T06:49:03.945Z" + }, + "tags": [ + "my first page" + ], + "_id": "604db275b3ae202873964d94", + "content_path": "https://hdn-1.fynd.com/company/1526/applications/61012f6a9250ccd1b9ef8a1d/pages/content/page_slug.html", + "title": "test-page", + "slug": "test-page", + "published": true, + "_schedule": { + "next_schedule": [ + {} + ], + "start": "2021-04-08T07:15:13.000Z", + "end": "2021-04-10T02:00:00.000Z" + }, + "feature_image": { + "secure_url": "https://google.com/some-image" + }, + "seo": { + "title": "my first page", + "description": "hey this is my first page", + "image": { + "url": "" + } + }, + "application": "000000000000000000000001", + "author": { + "name": "Abhinav Maurya" + } + } + ], + "page": { + "type": "number", + "current": 1, + "size": 1, + "item_total": 2, + "has_next": true + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updatePage +Update a page + + + + +```swift +client.application("").content.updatePage(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | ID allotted to the page. | +| body | PageSchema | yes | Request body | + + +Use this API to edit the details of an existing page, such as its title, seo, publish status, feature image, tags, schedule, etc. + +*Returned Response:* + + + + +[PageSchema](#PageSchema) + +Success. Refer `PageSchema` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "date_meta": { + "created_on": "2021-03-16T08:24:19.197Z", + "modified_on": "2021-03-16T08:24:19.197Z" + }, + "tags": [ + "my first page" + ], + "published": true, + "component_ids": [], + "archived": false, + "_id": "60506dcad18cb33946026862", + "title": "my first page", + "slug": "1st_page", + "feature_image": { + "secure_url": "https://google.com/some-image" + }, + "content": [ + { + "type": "html", + "value": "
    Emtpy Page. Create Page here.
    hello there!
    how are you doing

    " + }, + { + "type": "css", + "value": "* { box-sizing: border-box; } body {margin: 0;}*{box-sizing:border-box;}body{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}*{box-sizing:border-box;}body{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}#icfm{text-align:center;padding-top:30px;padding-right:30px;padding-bottom:30px;padding-left:30px;}#izu5{padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;}#ibgj{color:black;}#izzl{float:none;display:flex;}.aa{float:right;}" + }, + { + "type": "js", + "value": "" + } + ], + "content_path": "https://hdn-1.fynd.com/company/1526/applications/61012f6a9250ccd1b9ef8a1d/pages/content/page_slug.html", + "platform": "web", + "description": "hey this is my first page", + "visibility": { + "test": true + }, + "_schedule": { + "start": "2021-04-23T23:50:00.000Z", + "next_schedule": [ + {} + ] + }, + "seo": { + "title": "my first page", + "description": "hey this is my first page", + "image": { + "url": "" + } + }, + "type": "rawhtml", + "application": "000000000000000000000001", + "orientation": "portrait", + "page_meta": [] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getPageBySlug +Get pages by component Id + + + + +```swift +client.application("").content.getPageBySlug(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | A short, human-readable, URL-friendly identifier of a page. You can get slug value of a page from `getPages` API. | + + + +Use this API to retrieve the components of a page, such as its title, seo, publish status, feature image, tags, schedule, etc. + +*Returned Response:* + + + + +[PageSchema](#PageSchema) + +Success. Returns a JSON object of components. Refer `PageSchema` for more details. + + + + +
    +  Examples: + + +
    +  default + +```json +{ + "value": { + "date_meta": { + "created_on": "2021-03-16T08:24:19.197Z", + "modified_on": "2021-03-16T08:24:19.197Z" + }, + "tags": [ + "my first page" + ], + "published": true, + "component_ids": [], + "archived": false, + "_id": "60506dcad18cb33946026862", + "title": "my first page", + "slug": "1st_page", + "feature_image": { + "secure_url": "https://google.com/some-image" + }, + "content": [ + { + "type": "html", + "value": "
    Emtpy Page. Create Page here.
    hello there!
    how are you doing

    " + }, + { + "type": "css", + "value": "* { box-sizing: border-box; } body {margin: 0;}*{box-sizing:border-box;}body{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}*{box-sizing:border-box;}body{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}#icfm{text-align:center;padding-top:30px;padding-right:30px;padding-bottom:30px;padding-left:30px;}#izu5{padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;}#ibgj{color:black;}#izzl{float:none;display:flex;}.aa{float:right;}" + }, + { + "type": "js", + "value": "" + } + ], + "content_path": "https://hdn-1.fynd.com/company/1526/applications/61012f6a9250ccd1b9ef8a1d/pages/content/page_slug.html", + "platform": "web", + "description": "hey this is my first page", + "visibility": { + "test": true + }, + "_schedule": { + "start": "2021-04-23T23:50:00.000Z", + "next_schedule": [ + {} + ] + }, + "seo": { + "title": "my first page", + "description": "hey this is my first page", + "image": { + "url": "" + } + }, + "type": "rawhtml", + "application": "000000000000000000000001", + "orientation": "portrait", + "page_meta": [] + } +} +``` +
    + +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [ApplicationLegal](#ApplicationLegal) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | String? | yes | | + | tnc | String? | yes | | + | policy | String? | yes | | + | shipping | String? | yes | | + | faq | [[ApplicationLegalFAQ](#ApplicationLegalFAQ)]? | yes | | + | id | String? | yes | | + | updatedAt | String? | yes | | + | createdAt | String? | yes | | + +--- + + + + + #### [ApplicationLegalFAQ](#ApplicationLegalFAQ) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | question | String? | yes | | + | answer | String? | yes | | + +--- + + + + + #### [PathMappingSchema](#PathMappingSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | String? | yes | | + | redirections | [[RedirectionSchema](#RedirectionSchema)]? | yes | | + | id | String? | yes | | + | updatedAt | String? | yes | | + | createdAt | String? | yes | | + +--- + + + + + #### [RedirectionSchema](#RedirectionSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | redirectFrom | String? | yes | | + | redirectTo | String? | yes | | + +--- + + + + + #### [SeoComponent](#SeoComponent) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | seo | [SeoSchema](#SeoSchema)? | yes | | + +--- + + + + + #### [SeoSchema](#SeoSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | app | String? | yes | | + | id | String? | yes | | + | robotsTxt | String? | yes | | + | sitemapEnabled | Bool? | yes | | + | customMetaTags | [[CustomMetaTag](#CustomMetaTag)]? | yes | | + | details | [Detail](#Detail)? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + +--- + + + + + #### [CustomMetaTag](#CustomMetaTag) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | content | String? | yes | | + | id | String? | yes | | + +--- + + + + + #### [Detail](#Detail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | description | String? | yes | | + +--- + + + + + #### [AnnouncementPageSchema](#AnnouncementPageSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pageSlug | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [EditorMeta](#EditorMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | foregroundColor | String? | yes | | + | backgroundColor | String? | yes | | + | contentType | String? | yes | | + | content | String? | yes | | + +--- + + + + + #### [AnnouncementAuthorSchema](#AnnouncementAuthorSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | createdBy | String? | yes | | + | modifiedBy | String? | yes | | + +--- + + + + + #### [AdminAnnouncementSchema](#AdminAnnouncementSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | platforms | [String]? | yes | | + | title | String? | yes | | + | announcement | String? | yes | | + | pages | [[AnnouncementPageSchema](#AnnouncementPageSchema)]? | yes | | + | editorMeta | [EditorMeta](#EditorMeta)? | yes | | + | author | [AnnouncementAuthorSchema](#AnnouncementAuthorSchema)? | yes | | + | createdAt | String? | yes | | + | app | String? | yes | | + | modifiedAt | String? | yes | | + | schedule | [ScheduleSchema](#ScheduleSchema)? | yes | | + +--- + + + + + #### [ScheduleSchema](#ScheduleSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cron | String? | yes | | + | start | String? | yes | | + | end | String? | yes | | + | duration | Double? | yes | | + | nextSchedule | [[NextSchedule](#NextSchedule)]? | yes | | + +--- + + + + + #### [NextSchedule](#NextSchedule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | start | String? | yes | | + | end | String? | yes | | + +--- + + + + + #### [AnnouncementSchema](#AnnouncementSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | announcement | String? | yes | | + | schedule | [ScheduleStartSchema](#ScheduleStartSchema)? | yes | | + +--- + + + + + #### [ScheduleStartSchema](#ScheduleStartSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | start | String? | yes | | + | end | String? | yes | | + +--- + + + + + #### [BlogGetResponse](#BlogGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[BlogSchema](#BlogSchema)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [ResourceContent](#ResourceContent) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [Asset](#Asset) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | aspectRatio | String? | yes | | + | id | String? | yes | | + | secureUrl | String? | yes | | + +--- + + + + + #### [Author](#Author) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | designation | String? | yes | | + | id | String? | yes | | + | name | String? | yes | | + +--- + + + + + #### [BlogSchema](#BlogSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | customJson | [String: Any]? | yes | | + | application | String? | yes | | + | archived | Bool? | yes | | + | author | [Author](#Author)? | yes | | + | content | [[ResourceContent](#ResourceContent)]? | yes | | + | featureImage | [Asset](#Asset)? | yes | | + | published | Bool? | yes | | + | readingTime | String? | yes | | + | slug | String? | yes | | + | tags | [String]? | yes | | + | seo | [SEO](#SEO)? | yes | | + | schedule | [CronSchedule](#CronSchedule)? | yes | | + | title | String? | yes | | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + +--- + + + + + #### [SEO](#SEO) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String? | yes | | + | image | [SEOImage](#SEOImage)? | yes | | + | title | String? | yes | | + +--- + + + + + #### [SEOImage](#SEOImage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | url | String? | yes | | + +--- + + + + + #### [DateMeta](#DateMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | createdOn | String? | yes | | + | modifiedOn | String? | yes | | + +--- + + + + + #### [BlogRequest](#BlogRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | String? | yes | | + | customJson | [String: Any]? | yes | | + | author | [Author](#Author)? | yes | | + | content | [[ResourceContent](#ResourceContent)]? | yes | | + | featureImage | [Asset](#Asset)? | yes | | + | published | Bool? | yes | | + | readingTime | String? | yes | | + | slug | String? | yes | | + | tags | [String]? | yes | | + | title | String? | yes | | + | seo | [SEO](#SEO)? | yes | | + | schedule | [CronSchedule](#CronSchedule)? | yes | | + +--- + + + + + #### [GetAnnouncementListSchema](#GetAnnouncementListSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[AdminAnnouncementSchema](#AdminAnnouncementSchema)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [CreateAnnouncementSchema](#CreateAnnouncementSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + | data | [AdminAnnouncementSchema](#AdminAnnouncementSchema)? | yes | | + +--- + + + + + #### [DataLoaderResponseSchema](#DataLoaderResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | String? | yes | | + | company | String? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | service | String? | yes | | + | operationId | String? | yes | | + | type | String? | yes | | + | url | String? | yes | | + | content | String? | yes | | + | source | [DataLoaderSourceSchema](#DataLoaderSourceSchema)? | yes | | + +--- + + + + + #### [DataLoaderResetResponseSchema](#DataLoaderResetResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | reset | String? | yes | | + +--- + + + + + #### [Navigation](#Navigation) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | slug | String? | yes | | + | orientation | String? | yes | | + | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | id | String? | yes | | + | position | String? | yes | | + | application | String? | yes | | + | platform | String? | yes | | + | navigation | [NavigationReference](#NavigationReference)? | yes | | + +--- + + + + + #### [LocaleLanguage](#LocaleLanguage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | hi | [Language](#Language)? | yes | | + | ar | [Language](#Language)? | yes | | + | enUs | [Language](#Language)? | yes | | + +--- + + + + + #### [Language](#Language) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | display | String? | yes | | + +--- + + + + + #### [Action](#Action) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | page | [ActionPage](#ActionPage)? | yes | | + | popup | [ActionPage](#ActionPage)? | yes | | + | type | String? | yes | | + +--- + + + + + #### [ActionPage](#ActionPage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | params | [String: [String]]? | yes | | + | query | [String: [String]]? | yes | | + | url | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [NavigationReference](#NavigationReference) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | acl | [String]? | yes | | + | tags | [String]? | yes | | + | localeLanguage | [LocaleLanguage](#LocaleLanguage)? | yes | | + | image | String? | yes | | + | type | String? | yes | | + | action | [Action](#Action)? | yes | | + | active | Bool? | yes | | + | display | String? | yes | | + | sortOrder | Int? | yes | | + | subNavigation | [[NavigationReference](#NavigationReference)]? | yes | | + +--- + + + + + #### [LandingPage](#LandingPage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [LandingPageSchema](#LandingPageSchema)? | yes | | + | success | Bool? | yes | | + +--- + + + + + #### [ConfigurationSchema](#ConfigurationSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | sleepTime | Int? | yes | | + | startOnLaunch | Bool? | yes | | + | duration | Int? | yes | | + | slideDirection | String? | yes | | + +--- + + + + + #### [SlideshowMedia](#SlideshowMedia) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | url | String? | yes | | + | bgColor | String? | yes | | + | duration | Int? | yes | | + | autoDecideDuration | Bool? | yes | | + | action | [Action](#Action)? | yes | | + +--- + + + + + #### [Slideshow](#Slideshow) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [SlideshowSchema](#SlideshowSchema)? | yes | | + | success | Bool? | yes | | + +--- + + + + + #### [AnnouncementsResponseSchema](#AnnouncementsResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | announcements | [String: [[AnnouncementSchema](#AnnouncementSchema)]]? | yes | | + | refreshRate | Int? | yes | number of seconds after which api should hit again to fetch new announcements | + | refreshPages | [String]? | yes | list of page slugs on which announcement should be fetched as soon as they are loaded | + +--- + + + + + #### [FaqResponseSchema](#FaqResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | faqs | [[FaqSchema](#FaqSchema)]? | yes | | + +--- + + + + + #### [UpdateHandpickedSchema](#UpdateHandpickedSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | tag | [HandpickedTagSchema](#HandpickedTagSchema)? | yes | | + +--- + + + + + #### [HandpickedTagSchema](#HandpickedTagSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | position | String? | yes | | + | attributes | [String: Any]? | yes | | + | name | String? | yes | | + | url | String? | yes | | + | type | String? | yes | | + | subType | String? | yes | | + | content | String? | yes | | + +--- + + + + + #### [RemoveHandpickedSchema](#RemoveHandpickedSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | tags | [String]? | yes | | + +--- + + + + + #### [CreateTagSchema](#CreateTagSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | subType | String? | yes | | + | id | String? | yes | | + | type | String? | yes | | + | url | String? | yes | | + | position | String? | yes | | + | attributes | [String: Any]? | yes | | + | content | String? | yes | | + +--- + + + + + #### [CreateTagRequestSchema](#CreateTagRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | tags | [[CreateTagSchema](#CreateTagSchema)]? | yes | | + +--- + + + + + #### [DataLoaderSchema](#DataLoaderSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | service | String? | yes | | + | operationId | String? | yes | | + | type | String? | yes | | + | url | String? | yes | | + | content | String? | yes | | + | source | [DataLoaderSourceSchema](#DataLoaderSourceSchema)? | yes | | + +--- + + + + + #### [DataLoaderSourceSchema](#DataLoaderSourceSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | id | String? | yes | | + +--- + + + + + #### [DataLoadersSchema](#DataLoadersSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[DataLoaderSchema](#DataLoaderSchema)]? | yes | | + +--- + + + + + #### [TagDeleteSuccessResponse](#TagDeleteSuccessResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | | + +--- + + + + + #### [ContentAPIError](#ContentAPIError) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + | status | Double? | yes | | + | code | String? | yes | | + | exception | String? | yes | | + | info | String? | yes | | + | requestId | String? | yes | | + | stackTrace | String? | yes | | + | meta | [String: Any]? | yes | | + +--- + + + + + #### [CategorySchema](#CategorySchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | index | Int? | yes | | + | title | String? | yes | | + | description | String? | yes | | + | children | [String]? | yes | | + | id | String? | yes | | + | slug | String? | yes | | + | application | String? | yes | | + | iconUrl | String? | yes | | + | customJson | [String: Any]? | yes | | + +--- + + + + + #### [ChildrenSchema](#ChildrenSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | question | String? | yes | | + | answer | String? | yes | | + | slug | String? | yes | | + | application | String? | yes | | + | id | String? | yes | | + +--- + + + + + #### [CategoryRequestSchema](#CategoryRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String? | yes | | + | title | String? | yes | | + +--- + + + + + #### [FAQCategorySchema](#FAQCategorySchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | index | Int? | yes | | + | title | String? | yes | | + | description | String? | yes | | + | children | [[ChildrenSchema](#ChildrenSchema)]? | yes | | + | id | String? | yes | | + | slug | String? | yes | | + | application | String? | yes | | + | iconUrl | String? | yes | | + | customJson | [String: Any]? | yes | | + +--- + + + + + #### [FaqSchema](#FaqSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String? | yes | | + | application | String? | yes | | + | id | String? | yes | | + | question | String? | yes | | + | answer | String? | yes | | + +--- + + + + + #### [FAQ](#FAQ) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String? | yes | | + | question | String? | yes | | + | answer | String? | yes | | + +--- + + + + + #### [CreateFaqResponseSchema](#CreateFaqResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | faq | [FaqSchema](#FaqSchema)? | yes | | + +--- + + + + + #### [CreateFaqSchema](#CreateFaqSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | faq | [FAQ](#FAQ)? | yes | | + +--- + + + + + #### [GetFaqSchema](#GetFaqSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | faqs | [[FaqSchema](#FaqSchema)]? | yes | | + +--- + + + + + #### [UpdateFaqCategoryRequestSchema](#UpdateFaqCategoryRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | category | [CategorySchema](#CategorySchema)? | yes | | + +--- + + + + + #### [CreateFaqCategoryRequestSchema](#CreateFaqCategoryRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | category | [CategoryRequestSchema](#CategoryRequestSchema)? | yes | | + +--- + + + + + #### [CreateFaqCategorySchema](#CreateFaqCategorySchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | category | [CategorySchema](#CategorySchema)? | yes | | + +--- + + + + + #### [GetFaqCategoriesSchema](#GetFaqCategoriesSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | categories | [[CategorySchema](#CategorySchema)]? | yes | | + +--- + + + + + #### [GetFaqCategoryBySlugSchema](#GetFaqCategoryBySlugSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | category | [FAQCategorySchema](#FAQCategorySchema)? | yes | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + | hasNext | Bool? | yes | | + | current | Int? | yes | | + | type | String | no | | + | size | Int? | yes | | + +--- + + + + + #### [LandingPageGetResponse](#LandingPageGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[LandingPageSchema](#LandingPageSchema)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [LandingPageSchema](#LandingPageSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String? | yes | | + | action | [Action](#Action)? | yes | | + | platform | [String]? | yes | | + | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | id | String? | yes | | + | application | String? | yes | | + | archived | Bool? | yes | | + | customJson | [String: Any]? | yes | | + +--- + + + + + #### [DefaultNavigationResponse](#DefaultNavigationResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[NavigationSchema](#NavigationSchema)]? | yes | | + +--- + + + + + #### [NavigationGetResponse](#NavigationGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[NavigationSchema](#NavigationSchema)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [Orientation](#Orientation) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | portrait | [String]? | yes | | + | landscape | [String]? | yes | | + +--- + + + + + #### [NavigationSchema](#NavigationSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | application | String? | yes | | + | archived | Bool? | yes | | + | name | String? | yes | | + | slug | String? | yes | | + | platform | [String]? | yes | | + | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | orientation | [Orientation](#Orientation)? | yes | | + | version | Double? | yes | | + | navigation | [[NavigationReference](#NavigationReference)]? | yes | | + +--- + + + + + #### [NavigationRequest](#NavigationRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | slug | String? | yes | | + | platform | [String]? | yes | | + | orientation | [Orientation](#Orientation)? | yes | | + | navigation | [[NavigationReference](#NavigationReference)]? | yes | | + +--- + + + + + #### [CustomPageSchema](#CustomPageSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | platform | String? | yes | | + | title | String? | yes | | + | slug | String? | yes | | + | type | String? | yes | | + | orientation | String? | yes | | + | application | String? | yes | | + | description | String? | yes | | + | published | Bool? | yes | | + | tags | [String]? | yes | | + | content | [[String: Any]]? | yes | | + | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | schedule | [ScheduleSchema](#ScheduleSchema)? | yes | | + +--- + + + + + #### [ContentSchema](#ContentSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | value | [String: Any]? | yes | | + +--- + + + + + #### [CustomPage](#CustomPage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [CustomPageSchema](#CustomPageSchema)? | yes | | + +--- + + + + + #### [FeatureImage](#FeatureImage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | secureUrl | String? | yes | | + +--- + + + + + #### [PageGetResponse](#PageGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[PageSchema](#PageSchema)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [PageSpec](#PageSpec) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | specifications | [[PageSpecItem](#PageSpecItem)]? | yes | | + +--- + + + + + #### [PageSpecParam](#PageSpecParam) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | required | Bool? | yes | | + +--- + + + + + #### [PageSpecItem](#PageSpecItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pageType | String? | yes | | + | displayName | String? | yes | | + | params | [[PageSpecParam](#PageSpecParam)]? | yes | | + | query | [[PageSpecParam](#PageSpecParam)]? | yes | | + +--- + + + + + #### [PageSchema](#PageSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | application | String? | yes | | + | componentIds | [String]? | yes | Components can be used to store multiple components | + | content | [[String: Any]]? | yes | | + | contentPath | String? | yes | | + | createdBy | [CreatedBySchema](#CreatedBySchema)? | yes | | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | description | String? | yes | | + | featureImage | [Asset](#Asset)? | yes | | + | pageMeta | [[String: Any]]? | yes | | + | schedule | [ScheduleSchema](#ScheduleSchema)? | yes | | + | customJson | [String: Any]? | yes | | + | orientation | String? | yes | | + | platform | String? | yes | | + | published | Bool? | yes | | + | slug | String? | yes | | + | tags | [String]? | yes | | + | title | String? | yes | | + | type | String? | yes | | + | seo | [SEO](#SEO)? | yes | | + | visibility | [String: Any]? | yes | | + | archived | Bool? | yes | | + +--- + + + + + #### [CreatedBySchema](#CreatedBySchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + +--- + + + + + #### [PageContent](#PageContent) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | value | [String: Any]? | yes | | + +--- + + + + + #### [PageMeta](#PageMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | value | [String: Any]? | yes | | + +--- + + + + + #### [PageRequest](#PageRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | schedule | [CronSchedule](#CronSchedule)? | yes | | + | application | String? | yes | | + | author | [Author](#Author)? | yes | | + | customJson | [String: Any]? | yes | | + | orientation | String? | yes | | + | content | [[String: Any]]? | yes | | + | featureImage | [Asset](#Asset)? | yes | | + | published | Bool? | yes | | + | readingTime | String? | yes | | + | slug | String? | yes | | + | tags | [String]? | yes | | + | seo | [SEO](#SEO)? | yes | | + | title | String? | yes | | + +--- + + + + + #### [CronSchedule](#CronSchedule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cron | String? | yes | | + | start | String? | yes | | + | end | String? | yes | | + | duration | Double? | yes | | + +--- + + + + + #### [PagePublishRequest](#PagePublishRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | publish | Bool? | yes | | + +--- + + + + + #### [PageMetaSchema](#PageMetaSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | systemPages | [[NavigationSchema](#NavigationSchema)]? | yes | | + | customPages | [[PageSchema](#PageSchema)]? | yes | | + | applicationId | String? | yes | | + +--- + + + + + #### [SlideshowGetResponse](#SlideshowGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[SlideshowSchema](#SlideshowSchema)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [SlideshowSchema](#SlideshowSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | slug | String? | yes | | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | application | String? | yes | | + | platform | String? | yes | | + | configuration | [ConfigurationSchema](#ConfigurationSchema)? | yes | | + | media | [[SlideshowMedia](#SlideshowMedia)]? | yes | | + | active | Bool? | yes | | + | archived | Bool? | yes | | + | customJson | [String: Any]? | yes | | + +--- + + + + + #### [SlideshowRequest](#SlideshowRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String? | yes | | + | platform | String? | yes | | + | configuration | [ConfigurationSchema](#ConfigurationSchema)? | yes | | + | media | [SlideshowMedia](#SlideshowMedia)? | yes | | + | active | Bool? | yes | | + +--- + + + + + #### [Support](#Support) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | created | Bool? | yes | | + | id | String? | yes | | + | configType | String? | yes | | + | application | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | contact | [ContactSchema](#ContactSchema)? | yes | | + +--- + + + + + #### [PhoneProperties](#PhoneProperties) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | code | String? | yes | | + | number | String? | yes | | + +--- + + + + + #### [PhoneSchema](#PhoneSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | | + | phone | [[PhoneProperties](#PhoneProperties)]? | yes | | + +--- + + + + + #### [EmailProperties](#EmailProperties) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [EmailSchema](#EmailSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | | + | email | [[EmailProperties](#EmailProperties)]? | yes | | + +--- + + + + + #### [ContactSchema](#ContactSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | phone | [PhoneSchema](#PhoneSchema)? | yes | | + | email | [EmailSchema](#EmailSchema)? | yes | | + +--- + + + + + #### [TagsSchema](#TagsSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | String? | yes | | + | id | String? | yes | | + | tags | [[TagSchema](#TagSchema)]? | yes | | + +--- + + + + + #### [TagSchema](#TagSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | url | String? | yes | | + | type | String? | yes | | + | subType | String? | yes | | + | id | String? | yes | | + | position | String? | yes | | + | attributes | [String: Any]? | yes | | + | content | String? | yes | | + | source | [TagSourceSchema](#TagSourceSchema)? | yes | | + +--- + + + + + #### [TagSourceSchema](#TagSourceSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | id | String? | yes | | + +--- + + + + +### Enums + + + + + + #### [PageType](#PageType) + Type : string + + | Name | Value | Description | + | ---- | ----- | ----------- | + | aboutUs | about-us | Symbolic link for About Us: /about-us | + | addresses | addresses | Symbolic link for Saved Addresses: /profile/address | + | blog | blog | Symbolic link for Blog: /blog/:slug | + | brands | brands | Symbolic link for Brands: /brands/:department | + | cards | cards | Symbolic link for Saved Cards: /profile/my-cards | + | cart | cart | Symbolic link for Cart: /cart/bag/ | + | categories | categories | Symbolic link for Categories: /categories/:department | + | brand | brand | Symbolic link for Brand: /brand/:slug | + | category | category | Symbolic link for Category: /category/:slug | + | collection | collection | Symbolic link for Collection: /collection/:slug | + | collections | collections | Symbolic link for Collections: /collections/ | + | contactUs | contact-us | Symbolic link for Contact Us: /contact-us/ | + | externalLink | external | Symbolic link for External Link: /external/:url | + | faq | faq | Symbolic link for FAQ: /faq/:category | + | freshchat | freshchat | Symbolic link for Chat by Freshchat: /freshchat | + | home | home | Symbolic link for Home: / | + | notificationSettings | notification-settings | Symbolic link for Notification Settings: /notification-settings | + | orders | orders | Symbolic link for Orders: /profile/orders | + | page | page | Symbolic link for Page: /page/:slug | + | policy | policy | Symbolic link for Privacy Policy: /privacy-policy | + | product | product | Symbolic link for Product: /product/:slug | + | productReviews | product-reviews | Symbolic link for Product Reviews: /product/:slug/reviews | + | addProductReview | add-product-review | Symbolic link for Add Product review: /product/:slug/add-review | + | productRequest | product-request | Symbolic link for Product Request: /product-request/ | + | products | products | Symbolic link for Products: /products/ | + | profile | profile | Symbolic link for Profile: /profile | + | profileBasic | profile-basic | Symbolic link for Basic Profile: /profile/details | + | profileCompany | profile-company | Symbolic link for Profile Company: /profile/company | + | profileEmails | profile-emails | Symbolic link for Profile Emails: /profile/email | + | profilePhones | profile-phones | Symbolic link for Profile Phones: /profile/phone | + | rateUs | rate-us | Symbolic link for Rate Us: /rate-us | + | referEarn | refer-earn | Symbolic link for Refer & Earn: /profile/refer-earn | + | settings | settings | Symbolic link for Settings: /setting/currency | + | sharedCart | shared-cart | Symbolic link for Shared Cart: /shared-cart/:token | + | tnc | tnc | Symbolic link for Terms and Conditions: /terms-and-conditions | + | trackOrder | track-order | Symbolic link for Track Order: /order-tracking/:orderId | + | wishlist | wishlist | Symbolic link for Wishlist: /wishlist/ | + | sections | sections | Symbolic link for Sections: /sections/:group | + | form | form | Symbolic link for Form: /form/:slug | + | cartDelivery | cart-delivery | Symbolic link for Cart Delivery: /cart/delivery | + | cartPayment | cart-payment | Symbolic link for Cart Payment Information: /cart/payment-info | + | cartReview | cart-review | Symbolic link for Cart Order Review: /cart/order-review | + +--- + + + + + diff --git a/documentation/platform/DISCOUNT.md b/documentation/platform/DISCOUNT.md new file mode 100644 index 0000000000..d6b34358df --- /dev/null +++ b/documentation/platform/DISCOUNT.md @@ -0,0 +1,740 @@ + + + + +##### [Back to Platform docs](./README.md) + +## Discount Methods +Discount +* [getDiscounts](#getdiscounts) +* [createDiscount](#creatediscount) +* [getDiscount](#getdiscount) +* [updateDiscount](#updatediscount) +* [validateDiscountFile](#validatediscountfile) +* [downloadDiscountFile](#downloaddiscountfile) +* [getValidationJob](#getvalidationjob) +* [cancelValidationJob](#cancelvalidationjob) +* [getDownloadJob](#getdownloadjob) +* [cancelDownloadJob](#canceldownloadjob) + + + +## Methods with example and description + + +#### getDiscounts +Fetch discount list. + + + + +```swift +client.discount.getDiscounts(view: view, q: q, pageNo: pageNo, pageSize: pageSize, archived: archived, month: month, year: year, type: type, appIds: appIds) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| view | String? | no | listing or calender. Default is listing. | +| q | String? | no | The search query. This can be a partial or complete name of a discount. | +| pageNo | Int? | no | page number. Default is 1. | +| pageSize | Int? | no | page size. Default is 12. | +| archived | Bool? | no | archived. Default is false. | +| month | Int? | no | month. Default is current month. | +| year | Int? | no | year. Default is current year. | +| type | String? | no | basic or custom. | +| appIds | [String]? | no | application ids. | + + + +Fetch discount list. + +*Returned Response:* + + + + +[ListOrCalender](#ListOrCalender) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### createDiscount +Create Discount. + + + + +```swift +client.discount.createDiscount(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CreateUpdateDiscount | yes | Request body | + + +Create Discount. + +*Returned Response:* + + + + +[DiscountJob](#DiscountJob) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getDiscount +Fetch discount. + + + + +```swift +client.discount.getDiscount(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | unique id. | + + + +Fetch discount. + +*Returned Response:* + + + + +[DiscountJob](#DiscountJob) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updateDiscount +Create Discount. + + + + +```swift +client.discount.updateDiscount(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | id | +| body | CreateUpdateDiscount | yes | Request body | + + +Create Discount. + +*Returned Response:* + + + + +[DiscountJob](#DiscountJob) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### validateDiscountFile +Validate File. + + + + +```swift +client.discount.validateDiscountFile(discount: discount, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| discount | String? | no | discount | +| body | DiscountJob | yes | Request body | + + +Validate File. + +*Returned Response:* + + + + +[FileJobResponse](#FileJobResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### downloadDiscountFile +Validate File. + + + + +```swift +client.discount.downloadDiscountFile(type: type, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| type | String | yes | type | +| body | DownloadFileJob | yes | Request body | + + +Validate File. + +*Returned Response:* + + + + +[FileJobResponse](#FileJobResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getValidationJob +Validate File Job. + + + + +```swift +client.discount.getValidationJob(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | id | + + + +Validate File Job. + +*Returned Response:* + + + + +[FileJobResponse](#FileJobResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### cancelValidationJob +Cancel Validation Job. + + + + +```swift +client.discount.cancelValidationJob(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | id | + + + +Cancel Validation Job. + +*Returned Response:* + + + + +[CancelJobResponse](#CancelJobResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getDownloadJob +Download File Job. + + + + +```swift +client.discount.getDownloadJob(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | id | + + + +Download File Job. + +*Returned Response:* + + + + +[FileJobResponse](#FileJobResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### cancelDownloadJob +Cancel Download Job. + + + + +```swift +client.discount.cancelDownloadJob(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | id | + + + +Cancel Download Job. + +*Returned Response:* + + + + +[CancelJobResponse](#CancelJobResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [ValidityObject](#ValidityObject) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | start | String | no | | + | end | String | no | | + +--- + + + + + #### [CreateUpdateDiscount](#CreateUpdateDiscount) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String | no | | + | companyId | Int | no | | + | isActive | Bool | no | | + | appIds | [String] | no | | + | extensionIds | [String] | no | | + | jobType | String | no | | + | discountType | String | no | | + | discountLevel | String | no | | + | value | Int? | yes | | + | filePath | String? | yes | | + | brandIds | [Int]? | yes | | + | storeIds | [Int]? | yes | | + | validity | [ValidityObject](#ValidityObject) | no | | + +--- + + + + + #### [DiscountJob](#DiscountJob) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String | no | | + | name | String | no | | + | companyId | Int | no | | + | isActive | Bool | no | | + | appIds | [String]? | yes | | + | jobType | String? | yes | | + | discountType | String? | yes | | + | discountLevel | String? | yes | | + | value | Int? | yes | | + | filePath | String? | yes | | + | brandIds | [Int]? | yes | | + | storeIds | [Int]? | yes | | + | validity | [ValidityObject](#ValidityObject) | no | | + | createdOn | String | no | | + | modifiedOn | String | no | | + | createdBy | [UserDetails](#UserDetails) | no | | + | modifiedBy | [UserDetails](#UserDetails) | no | | + | meta | [String: Any]? | yes | | + +--- + + + + + #### [ListOrCalender](#ListOrCalender) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[DiscountJob](#DiscountJob)] | no | | + | page | [Page](#Page) | no | | + +--- + + + + + #### [FileJobResponse](#FileJobResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | stage | String | no | | + | total | Int | no | | + | failed | Int | no | | + | companyId | Int | no | | + | body | [String: Any]? | yes | | + | type | String | no | | + | fileType | String | no | | + +--- + + + + + #### [DownloadFileJob](#DownloadFileJob) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | brandIds | [Int]? | yes | | + | storeIds | [Int]? | yes | | + +--- + + + + + #### [CancelJobResponse](#CancelJobResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + | hasNext | Bool? | yes | | + | current | Int? | yes | | + | type | Int | no | | + | size | Int? | yes | | + +--- + + + + + #### [UserDetails](#UserDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | username | String | no | | + | userId | String | no | | + +--- + + + + + #### [BadRequestObject](#BadRequestObject) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String | no | | + +--- + + + diff --git a/documentation/platform/FEEDBACK.md b/documentation/platform/FEEDBACK.md new file mode 100644 index 0000000000..28fbaa5ddd --- /dev/null +++ b/documentation/platform/FEEDBACK.md @@ -0,0 +1,1180 @@ + + + + +##### [Back to Platform docs](./README.md) + +## Feedback Methods +User Reviews and Rating System +* [getAttributes](#getattributes) +* [getCustomerReviews](#getcustomerreviews) +* [updateApprove](#updateapprove) +* [getHistory](#gethistory) +* [getApplicationTemplates](#getapplicationtemplates) +* [createTemplate](#createtemplate) +* [getTemplateById](#gettemplatebyid) +* [updateTemplate](#updatetemplate) +* [updateTemplateStatus](#updatetemplatestatus) + + + +## Methods with example and description + + +#### getAttributes +Get list of attribute data + + + + +```swift +client.application("").feedback.getAttributes(pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | pagination page no | +| pageSize | Int? | no | pagination page size | + + + +Provides a list of all attribute data. + +*Returned Response:* + + + + +[FeedbackAttributes](#FeedbackAttributes) + +ok + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getCustomerReviews +Get list of customer reviews [admin] + + + + +```swift +client.application("").feedback.getCustomerReviews(id: id, entityId: entityId, entityType: entityType, userId: userId, media: media, rating: rating, attributeRating: attributeRating, facets: facets, sort: sort, next: next, start: start, limit: limit, count: count, pageId: pageId, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String? | no | review id | +| entityId | String? | no | entity id | +| entityType | String? | no | entity type | +| userId | String? | no | user id | +| media | String? | no | media type e.g. image | video | video_file | video_link | +| rating | [Double]? | no | rating filter, 1-5 | +| attributeRating | [String]? | no | attribute rating filter with ma,e of attribute | +| facets | Bool? | no | facets (true|false) | +| sort | String? | no | sort by : default | top | recent | +| next | String? | no | pagination next | +| start | String? | no | pagination start | +| limit | String? | no | pagination limit | +| count | String? | no | pagination count | +| pageId | String? | no | pagination page id | +| pageSize | Int? | no | pagination page size | + + + +The endpoint provides a list of customer reviews based on entity and provided filters + +*Returned Response:* + + + + +[GetReviewResponse](#GetReviewResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updateApprove +update approve details + + + + +```swift +client.application("").feedback.updateApprove(reviewId: reviewId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| reviewId | String | yes | review id | +| body | ApproveRequest | yes | Request body | + + +The is used to update approve details like status and description text + +*Returned Response:* + + + + +[UpdateResponse](#UpdateResponse) + +ok + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getHistory +get history details + + + + +```swift +client.application("").feedback.getHistory(reviewId: reviewId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| reviewId | String | yes | review id | + + + +The is used to get the history details like status and description text + +*Returned Response:* + + + + +[[ActivityDump]](#[ActivityDump]) + +ok + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getApplicationTemplates +Get list of templates + + + + +```swift +client.application("").feedback.getApplicationTemplates(pageId: pageId, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageId | String? | no | pagination page id | +| pageSize | Int? | no | pagination page size | + + + +Get all templates of application + +*Returned Response:* + + + + +[TemplateGetResponse](#TemplateGetResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### createTemplate +Create a new template + + + + +```swift +client.application("").feedback.createTemplate(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | TemplateRequestList | yes | Request body | + + +Create a new template for review with following data: +- Enable media, rating and review +- Rating - active/inactive/selected rate choices, attributes, text on rate, comment for each rate, type +- Review - header, title, description, image and video meta, enable votes + +*Returned Response:* + + + + +[InsertResponse](#InsertResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getTemplateById +Get a template by ID + + + + +```swift +client.application("").feedback.getTemplateById(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | template id | + + + +Get the template for product or l3 type by ID + +*Returned Response:* + + + + +[Template](#Template) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updateTemplate +Update a template's status + + + + +```swift +client.application("").feedback.updateTemplate(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | template id | +| body | UpdateTemplateRequest | yes | Request body | + + +Update existing template status, active/archive + +*Returned Response:* + + + + +[UpdateResponse](#UpdateResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updateTemplateStatus +Update a template's status + + + + +```swift +client.application("").feedback.updateTemplateStatus(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | template id | +| body | UpdateTemplateStatusRequest | yes | Request body | + + +Update existing template status, active/archive + +*Returned Response:* + + + + +[UpdateResponse](#UpdateResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [Activity](#Activity) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | currentState | [String: Any]? | yes | | + | documentId | String? | yes | | + | previousState | [String: Any]? | yes | | + +--- + + + + + #### [ActivityDump](#ActivityDump) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | activity | [Activity](#Activity)? | yes | | + | createdBy | [CreatedBy](#CreatedBy)? | yes | | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | id | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [AddMediaListRequest](#AddMediaListRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | entityId | String? | yes | | + | entityType | String? | yes | | + | mediaList | [[AddMediaRequest](#AddMediaRequest)]? | yes | | + | refId | String? | yes | | + | refType | String? | yes | | + +--- + + + + + #### [AddMediaRequest](#AddMediaRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cloudId | String? | yes | | + | cloudName | String? | yes | | + | cloudProvider | String? | yes | | + | entityId | String? | yes | | + | entityType | String? | yes | | + | mediaUrl | String? | yes | | + | refId | String? | yes | | + | refType | String? | yes | | + | tags | [String]? | yes | | + | thumbnailUrl | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [ApproveRequest](#ApproveRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | approve | Bool? | yes | | + | entityType | String? | yes | | + | id | String | no | | + | reason | String? | yes | | + +--- + + + + + #### [Attribute](#Attribute) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | description | String? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | slug | String? | yes | | + | tags | [[TagMeta](#TagMeta)]? | yes | | + +--- + + + + + #### [AttributeObject](#AttributeObject) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String? | yes | | + | name | String | no | | + | slug | String? | yes | | + | title | String? | yes | | + | type | String | no | | + | value | Double | no | | + +--- + + + + + #### [CreatedBy](#CreatedBy) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | name | String? | yes | | + | tags | [[TagMeta](#TagMeta)]? | yes | | + +--- + + + + + #### [CursorGetResponse](#CursorGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[String: Any]]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [DateMeta](#DateMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | createdOn | String? | yes | | + | modifiedOn | String? | yes | | + +--- + + + + + #### [DeviceMeta](#DeviceMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appVersion | String? | yes | | + | platform | String? | yes | | + +--- + + + + + #### [Entity](#Entity) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [EntityRequest](#EntityRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | entityId | String? | yes | | + | entityType | String? | yes | | + +--- + + + + + #### [FeedbackAttributes](#FeedbackAttributes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Attribute](#Attribute)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [FeedbackError](#FeedbackError) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | code | [String: Any]? | yes | | + | exception | String? | yes | | + | info | String? | yes | | + | message | String? | yes | | + | meta | [String: Any]? | yes | | + | requestId | String? | yes | | + | stackTrace | String? | yes | | + | status | Int? | yes | | + +--- + + + + + #### [FeedbackState](#FeedbackState) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | | + | archive | Bool? | yes | | + | media | String? | yes | image, video, any | + | qna | Bool? | yes | | + | rating | Bool? | yes | | + | review | Bool? | yes | | + +--- + + + + + #### [GetResponse](#GetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | data | [String: Any]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [GetReviewResponse](#GetReviewResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | facets | [[ReviewFacet](#ReviewFacet)]? | yes | | + | items | [[String: Any]]? | yes | | + | page | [Page](#Page)? | yes | | + | sort | [[SortMethod](#SortMethod)]? | yes | | + +--- + + + + + #### [InsertResponse](#InsertResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | count | Int? | yes | | + +--- + + + + + #### [MediaMeta](#MediaMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | maxCount | Int? | yes | | + | size | Int? | yes | | + | type | String? | yes | | + +--- + + + + + #### [MediaMetaRequest](#MediaMetaRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | maxCount | Int | no | | + | size | Int | no | | + +--- + + + + + #### [NumberGetResponse](#NumberGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[String: Any]]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + | hasPrevious | Bool? | yes | | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | size | Int? | yes | | + | type | String | no | | + +--- + + + + + #### [PageCursor](#PageCursor) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + | hasPrevious | Bool? | yes | | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | size | Int | no | | + | type | String | no | | + +--- + + + + + #### [PageNumber](#PageNumber) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + | itemTotal | Int? | yes | | + | size | Int? | yes | | + | type | String? | yes | | + +--- + + + + + #### [Rating](#Rating) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | attributes | [[Attribute](#Attribute)]? | yes | | + | attributesSlugs | [String]? | yes | | + | ui | [UI](#UI)? | yes | | + +--- + + + + + #### [RatingRequest](#RatingRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | attributes | [String] | no | | + | ui | [UI](#UI)? | yes | | + +--- + + + + + #### [ReportAbuseRequest](#ReportAbuseRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String? | yes | | + | entityId | String | no | | + | entityType | String | no | | + +--- + + + + + #### [Review](#Review) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String? | yes | | + | header | String? | yes | | + | imageMeta | [MediaMeta](#MediaMeta)? | yes | | + | title | String? | yes | | + | videoMeta | [MediaMeta](#MediaMeta)? | yes | | + | voteAllowed | Bool? | yes | | + +--- + + + + + #### [ReviewFacet](#ReviewFacet) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | display | String? | yes | | + | name | String? | yes | | + | selected | Bool? | yes | | + | slug | String? | yes | | + | type | String? | yes | rating, attributerating | + +--- + + + + + #### [ReviewRequest](#ReviewRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String | no | | + | header | String | no | | + | imageMeta | [MediaMetaRequest](#MediaMetaRequest) | no | | + | isVoteAllowed | Bool | no | | + | title | String | no | | + | videoMeta | [MediaMetaRequest](#MediaMetaRequest) | no | | + +--- + + + + + #### [SaveAttributeRequest](#SaveAttributeRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String? | yes | | + | name | String | no | | + | slug | String | no | | + +--- + + + + + #### [SortMethod](#SortMethod) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | selected | Bool? | yes | | + | type | String? | yes | | + +--- + + + + + #### [TagMeta](#TagMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | media | [[MediaMeta](#MediaMeta)]? | yes | | + | name | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [Template](#Template) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | dateMeta | [DateMeta](#DateMeta)? | yes | | + | entity | [Entity](#Entity)? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | rating | [Rating](#Rating)? | yes | | + | review | [Review](#Review)? | yes | | + | state | [FeedbackState](#FeedbackState)? | yes | | + | tags | [[TagMeta](#TagMeta)]? | yes | | + +--- + + + + + #### [TemplateGetResponse](#TemplateGetResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Template](#Template)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [TemplateRequest](#TemplateRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool | no | | + | enableMediaType | String? | yes | image | video | any | + | enableQna | Bool? | yes | | + | enableRating | Bool | no | | + | enableReview | Bool | no | | + | entity | [EntityRequest](#EntityRequest) | no | | + | rating | [RatingRequest](#RatingRequest) | no | | + | review | [ReviewRequest](#ReviewRequest) | no | | + +--- + + + + + #### [TemplateRequestList](#TemplateRequestList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | templateList | [[TemplateRequest](#TemplateRequest)] | no | | + +--- + + + + + #### [UI](#UI) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | feedbackQuestion | [String]? | yes | | + | icon | [UIIcon](#UIIcon)? | yes | | + | text | [String]? | yes | | + | type | String? | yes | star | images | gifs | smileys | + +--- + + + + + #### [UIIcon](#UIIcon) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | String? | yes | | + | inactive | String? | yes | | + | selected | [String]? | yes | | + +--- + + + + + #### [UpdateAttributeRequest](#UpdateAttributeRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String? | yes | | + | name | String | no | | + | slug | String? | yes | | + +--- + + + + + #### [UpdateResponse](#UpdateResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | count | Int? | yes | | + +--- + + + + + #### [UpdateReviewRequest](#UpdateReviewRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | | + | application | String? | yes | | + | approve | Bool? | yes | | + | archive | Bool? | yes | | + | attributesRating | [[AttributeObject](#AttributeObject)]? | yes | | + | description | String? | yes | | + | deviceMeta | [DeviceMeta](#DeviceMeta)? | yes | | + | entityId | String? | yes | | + | entityType | String? | yes | | + | mediaResource | [[MediaMeta](#MediaMeta)]? | yes | | + | rating | Double? | yes | | + | reviewId | String? | yes | | + | templateId | String? | yes | | + | title | String? | yes | | + +--- + + + + + #### [UpdateTemplateRequest](#UpdateTemplateRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool | no | | + | enableMediaType | String? | yes | image | video | any | + | enableQna | Bool? | yes | | + | enableRating | Bool | no | | + | enableReview | Bool | no | | + | entity | [EntityRequest](#EntityRequest) | no | | + | rating | [RatingRequest](#RatingRequest) | no | | + | review | [ReviewRequest](#ReviewRequest) | no | | + +--- + + + + + #### [UpdateTemplateStatusRequest](#UpdateTemplateStatusRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | | + | archive | Bool? | yes | | + +--- + + + diff --git a/documentation/platform/FILESTORAGE.md b/documentation/platform/FILESTORAGE.md new file mode 100644 index 0000000000..519fdbc97f --- /dev/null +++ b/documentation/platform/FILESTORAGE.md @@ -0,0 +1,968 @@ + + + + +##### [Back to Platform docs](./README.md) + +## FileStorage Methods +File Storage +* [startUpload](#startupload) +* [completeUpload](#completeupload) +* [appStartUpload](#appstartupload) +* [appCompleteUpload](#appcompleteupload) +* [getSignUrls](#getsignurls) +* [copyFiles](#copyfiles) +* [appCopyFiles](#appcopyfiles) +* [browse](#browse) +* [browse](#browse) +* [proxy](#proxy) + + + +## Methods with example and description + + +#### startUpload +This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob. + + + + +```swift +client.filestorage.startUpload(namespace: namespace, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| namespace | String | yes | bucket name | +| body | StartRequest | yes | Request body | + + +Uploads an arbitrarily sized buffer or blob. + +It has three Major Steps: +* Start +* Upload +* Complete + +### Start +Initiates the assets upload using `startUpload`. +It returns the storage link in response. + +### Upload +Use the storage link to upload a file (Buffer or Blob) to the File Storage. +Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body. + +### Complete +After successfully upload, call `completeUpload` api to complete the upload process. +This operation will return the url for the uploaded file. + + +*Returned Response:* + + + + +[StartResponse](#StartResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### completeUpload +This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process. + + + + +```swift +client.filestorage.completeUpload(namespace: namespace, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| namespace | String | yes | bucket name | +| body | StartResponse | yes | Request body | + + +Uploads an arbitrarily sized buffer or blob. + +It has three Major Steps: +* Start +* Upload +* Complete + +### Start +Initiates the assets upload using `startUpload`. +It returns the storage link in response. + +### Upload +Use the storage link to upload a file (Buffer or Blob) to the File Storage. +Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body. + +### Complete +After successfully upload, call `completeUpload` api to complete the upload process. +This operation will return the url for the uploaded file. + + +*Returned Response:* + + + + +[CompleteResponse](#CompleteResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### appStartUpload +This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob. + + + + +```swift +client.application("").filestorage.appStartUpload(namespace: namespace, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| namespace | String | yes | bucket name | +| body | StartRequest | yes | Request body | + + +Uploads an arbitrarily sized buffer or blob. + +It has three Major Steps: +* Start +* Upload +* Complete + +### Start +Initiates the assets upload using `appStartUpload`. +It returns the storage link in response. + +### Upload +Use the storage link to upload a file (Buffer or Blob) to the File Storage. +Make a `PUT` request on storage link received from `appStartUpload` api with file (Buffer or Blob) as a request body. + +### Complete +After successfully upload, call `appCompleteUpload` api to complete the upload process. +This operation will return the url for the uploaded file. + + +*Returned Response:* + + + + +[StartResponse](#StartResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### appCompleteUpload +This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process. + + + + +```swift +client.application("").filestorage.appCompleteUpload(namespace: namespace, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| namespace | String | yes | bucket name | +| body | StartResponse | yes | Request body | + + +Uploads an arbitrarily sized buffer or blob. + +It has three Major Steps: +* Start +* Upload +* Complete + +### Start +Initiates the assets upload using `appStartUpload`. +It returns the storage link in response. + +### Upload +Use the storage link to upload a file (Buffer or Blob) to the File Storage. +Make a `PUT` request on storage link received from `appStartUpload` api with file (Buffer or Blob) as a request body. + +### Complete +After successfully upload, call `appCompleteUpload` api to complete the upload process. +This operation will return the url for the uploaded file. + + +*Returned Response:* + + + + +[CompleteResponse](#CompleteResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getSignUrls +Explain here + + + + +```swift +client.filestorage.getSignUrls(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | SignUrlRequest | yes | Request body | + + +Describe here + +*Returned Response:* + + + + +[SignUrlResponse](#SignUrlResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### copyFiles +Copy Files + + + + +```swift +client.filestorage.copyFiles(sync: sync, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| sync | Bool? | no | sync | +| body | BulkRequest | yes | Request body | + + +Copy Files + +*Returned Response:* + + + + +[BulkResponse](#BulkResponse) + +Success + + + + +
    +  Example: + +```json +{ + "tracking_url": "https://xxx.xxx.xxx/2", + "task": { + "id": "2", + "name": "__default__", + "data": { + "urls": [ + "https://xxx.xxx.xxx/files.csv" + ], + "destination": { + "namespace": "/domaine/path", + "rewrite": "{{namespace}}/bar/{{dest.path}}" + } + }, + "opts": { + "attempts": 1, + "delay": 0, + "timestamp": 1613534206645 + }, + "progress": 0, + "delay": 0, + "timestamp": 1613534206645, + "attempts_made": 0, + "stacktrace": [], + "finished_on": 1613534206645, + "processed_on": 1613534206645 + } +} +``` +
    + + + + + + + + + +--- + + +#### appCopyFiles +Copy Files + + + + +```swift +client.application("").filestorage.appCopyFiles(sync: sync, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| sync | Bool? | no | sync | +| body | BulkRequest | yes | Request body | + + +Copy Files + +*Returned Response:* + + + + +[BulkResponse](#BulkResponse) + +Success + + + + +
    +  Example: + +```json +{ + "tracking_url": "https://xxx.xxx.xxx/2", + "task": { + "id": "2", + "name": "__default__", + "data": { + "urls": [ + "https://xxx.xxx.xxx/files.csv" + ], + "destination": { + "namespace": "/domaine/path", + "rewrite": "{{namespace}}/bar/{{dest.path}}" + } + }, + "opts": { + "attempts": 1, + "delay": 0, + "timestamp": 1613534206645 + }, + "progress": 0, + "delay": 0, + "timestamp": 1613534206645, + "attempts_made": 0, + "stacktrace": [], + "finished_on": 1613534206645, + "processed_on": 1613534206645 + } +} +``` +
    + + + + + + + + + +--- + + +#### browse +Browse Files + + + + +```swift +client.filestorage.browse(namespace: namespace, pageNo: pageNo) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| namespace | String | yes | bucket name | +| pageNo | Int? | no | page no | + + + +Browse Files + +*Returned Response:* + + + + +[BrowseResponse](#BrowseResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### browse +Browse Files + + + + +```swift +client.application("").filestorage.browse(namespace: namespace, pageNo: pageNo) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| namespace | String | yes | bucket name | +| pageNo | Int? | no | page no | + + + +Browse Files + +*Returned Response:* + + + + +[BrowseResponse](#BrowseResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### proxy +Proxy + + + + +```swift +client.filestorage.proxy(url: url) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| url | String | yes | url | + + + +Proxy + +*Returned Response:* + + + + +[String](#String) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [FailedResponse](#FailedResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String | no | | + +--- + + + + + #### [CDN](#CDN) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | url | String | no | | + +--- + + + + + #### [Upload](#Upload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | expiry | Int | no | | + | url | String | no | | + +--- + + + + + #### [StartResponse](#StartResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | fileName | String | no | | + | filePath | String | no | | + | contentType | String | no | | + | method | String | no | | + | namespace | String | no | | + | operation | String | no | | + | size | Int | no | | + | upload | [Upload](#Upload) | no | | + | cdn | [CDN](#CDN) | no | | + | tags | [String]? | yes | | + +--- + + + + + #### [StartRequest](#StartRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | fileName | String | no | | + | contentType | String | no | | + | size | Int | no | | + | tags | [String]? | yes | | + | params | [String: Any]? | yes | | + +--- + + + + + #### [CompleteResponse](#CompleteResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String | no | | + | fileName | String | no | | + | filePath | String | no | | + | contentType | String | no | | + | method | String | no | | + | namespace | String | no | | + | operation | String | no | | + | size | Int | no | | + | upload | [Upload](#Upload) | no | | + | cdn | [CDN](#CDN) | no | | + | success | String | no | | + | tags | [String]? | yes | | + | createdOn | String | no | | + | modifiedOn | String | no | | + +--- + + + + + #### [Opts](#Opts) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | attempts | Int? | yes | | + | timestamp | Int? | yes | | + | delay | Int? | yes | | + +--- + + + + + #### [CopyFileTask](#CopyFileTask) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String | no | | + | name | String | no | | + | data | [BulkRequest](#BulkRequest) | no | | + | opts | [Opts](#Opts) | no | | + | progress | Int | no | | + | delay | Int | no | | + | timestamp | Int | no | | + | attemptsMade | Int | no | | + | stacktrace | [String]? | yes | | + | finishedOn | Int | no | | + | processedOn | Int | no | | + +--- + + + + + #### [BulkResponse](#BulkResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | trackingUrl | String | no | | + | task | [CopyFileTask](#CopyFileTask) | no | | + +--- + + + + + #### [ReqConfiguration](#ReqConfiguration) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | concurrency | Int? | yes | | + +--- + + + + + #### [Destination](#Destination) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | namespace | String | no | | + | rewrite | String | no | | + | basepath | String? | yes | | + +--- + + + + + #### [BulkRequest](#BulkRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | urls | [String] | no | | + | destination | [Destination](#Destination) | no | | + | configuration | [ReqConfiguration](#ReqConfiguration)? | yes | | + +--- + + + + + #### [Urls](#Urls) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | url | String | no | | + | signedUrl | String | no | | + | expiry | Int | no | | + +--- + + + + + #### [SignUrlResponse](#SignUrlResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | urls | [[Urls](#Urls)] | no | | + +--- + + + + + #### [SignUrlRequest](#SignUrlRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | expiry | Int | no | | + | urls | [String] | no | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + | hasNext | Bool? | yes | | + | current | Int? | yes | | + | type | Int | no | | + | size | Int? | yes | | + +--- + + + + + #### [DbRecord](#DbRecord) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | | + | tags | [String] | no | | + | id | String | no | | + | fileName | String | no | | + | operation | String? | yes | | + | namespace | String | no | | + | contentType | String | no | | + | filePath | String | no | | + | upload | [Upload](#Upload) | no | | + | cdn | [CDN](#CDN) | no | | + | createdOn | String | no | | + | modifiedOn | String | no | | + +--- + + + + + #### [BrowseResponse](#BrowseResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[DbRecord](#DbRecord)] | no | | + | page | [Page](#Page) | no | | + +--- + + + diff --git a/documentation/platform/INVENTORY.md b/documentation/platform/INVENTORY.md new file mode 100644 index 0000000000..fdcd9dd621 --- /dev/null +++ b/documentation/platform/INVENTORY.md @@ -0,0 +1,1456 @@ + + + + +##### [Back to Platform docs](./README.md) + +## Inventory Methods + +* [getJobsByCompany](#getjobsbycompany) +* [updateJob](#updatejob) +* [createJob](#createjob) +* [getJobSteps](#getjobsteps) +* [getJobByCompanyAndIntegration](#getjobbycompanyandintegration) +* [disable](#disable) +* [getJobConfigDefaults](#getjobconfigdefaults) +* [getJobByCode](#getjobbycode) +* [getJobCodeMetrics](#getjobcodemetrics) +* [getJobCodesByCompanyAndIntegration](#getjobcodesbycompanyandintegration) + + + +## Methods with example and description + + +#### getJobsByCompany +Get Job Configs For A Company + + + + +```swift +client.inventory.getJobsByCompany(pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Page Number | +| pageSize | Int? | no | Page Size | + + + +REST Endpoint that returns all job configs for a company + +*Returned Response:* + + + + +[ResponseEnvelopeListJobConfigRawDTO](#ResponseEnvelopeListJobConfigRawDTO) + +Successful operation + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updateJob +Updates An Existing Job Config + + + + +```swift +client.inventory.updateJob(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | JobConfigDTO | yes | Request body | + + +REST Endpoint that updates a job config + +*Returned Response:* + + + + +[ResponseEnvelopeString](#ResponseEnvelopeString) + +Job Config Updated Successfully + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### createJob +Creates A New Job Config + + + + +```swift +client.inventory.createJob(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | JobConfigDTO | yes | Request body | + + +REST Endpoint that creates a new job config + +*Returned Response:* + + + + +[ResponseEnvelopeString](#ResponseEnvelopeString) + +Job Config Created Successfully + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getJobSteps +Get Job Code Steps + + + + +```swift +client.inventory.getJobSteps(jobId: jobId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| jobId | Int | yes | Job Id | + + + +REST Endpoint that returns Inventory Job Steps + +*Returned Response:* + + + + +[ResponseEnvelopeListJobStepsDTO](#ResponseEnvelopeListJobStepsDTO) + +Successful operation + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getJobByCompanyAndIntegration +Get Job Configs By Company And Integration + + + + +```swift +client.inventory.getJobByCompanyAndIntegration(integrationId: integrationId, pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| integrationId | String | yes | Integration Id | +| pageNo | Int? | no | Page Number | +| pageSize | Int? | no | Page Size | + + + +REST Endpoint that returns all job configs by company And integration + +*Returned Response:* + + + + +[ResponseEnvelopeListJobConfigDTO](#ResponseEnvelopeListJobConfigDTO) + +Successful operation + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### disable +Disable Job Config + + + + +```swift +client.inventory.disable(integrationId: integrationId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| integrationId | String | yes | IntegrationId | + + + +REST Endpoint that disables Inventory Job Config + +*Returned Response:* + + + + +[ResponseEnvelopeString](#ResponseEnvelopeString) + +Successful operation + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getJobConfigDefaults +Get Job Configs Defaults + + + + +```swift +client.inventory.getJobConfigDefaults() { (response, error) in + // Use response +} +``` + + + + + + +REST Endpoint that returns default fields job configs by company And integration + +*Returned Response:* + + + + +[ResponseEnvelopeJobConfigDTO](#ResponseEnvelopeJobConfigDTO) + +Successful operation + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getJobByCode +Get Job Config By Code + + + + +```swift +client.inventory.getJobByCode(code: code) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| code | String | yes | Job Code | + + + +REST Endpoint that returns job config by code + +*Returned Response:* + + + + +[ResponseEnvelopeJobConfigDTO](#ResponseEnvelopeJobConfigDTO) + +Successful operation + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getJobCodeMetrics +Get Job Metrics + + + + +```swift +client.inventory.getJobCodeMetrics(code: code, pageNo: pageNo, pageSize: pageSize, status: status, date: date) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| code | String | yes | Code | +| pageNo | Int? | no | Page Number | +| pageSize | Int? | no | Page Size | +| status | String? | no | Status | +| date | String? | no | From Date | + + + +REST Endpoint that returns Inventory Run History For A Job Code + +*Returned Response:* + + + + +[ResponseEnvelopeJobMetricsDto](#ResponseEnvelopeJobMetricsDto) + +Successful operation + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getJobCodesByCompanyAndIntegration +Get Job Codes By Company And Integration + + + + +```swift +client.inventory.getJobCodesByCompanyAndIntegration(integrationId: integrationId, pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| integrationId | String | yes | Integration Id | +| pageNo | Int? | no | Page Number | +| pageSize | Int? | no | Page Size | + + + +REST Endpoint that returns all job codes by company And integration + +*Returned Response:* + + + + +[ResponseEnvelopeListJobConfigListDTO](#ResponseEnvelopeListJobConfigListDTO) + +Successful operation + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [DataTresholdDTO](#DataTresholdDTO) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | minPrice | Double? | yes | | + | safeStock | Int? | yes | | + | periodThreshold | Int? | yes | | + | periodThresholdType | String? | yes | | + | periodTypeList | [[GenericDTO](#GenericDTO)]? | yes | | + +--- + + + + + #### [GenericDTO](#GenericDTO) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | text | String? | yes | | + | value | [String: Any]? | yes | | + +--- + + + + + #### [JobConfigDTO](#JobConfigDTO) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | integration | String | no | | + | integrationData | [String: Any]? | yes | | + | companyName | String? | yes | | + | companyId | Int | no | | + | taskDetails | [TaskDTO](#TaskDTO)? | yes | | + | thresholdDetails | [DataTresholdDTO](#DataTresholdDTO)? | yes | | + | jobCode | String? | yes | | + | alias | String? | yes | | + +--- + + + + + #### [TaskDTO](#TaskDTO) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | Int? | yes | | + | groupList | [[GenericDTO](#GenericDTO)]? | yes | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String | no | | + | size | Int? | yes | | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + +--- + + + + + #### [ResponseEnvelopeString](#ResponseEnvelopeString) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | timestamp | String? | yes | | + | status | Int? | yes | | + | error | String? | yes | | + | exception | String? | yes | | + | message | String? | yes | | + | totalTimeTakenInMillis | Int? | yes | | + | httpStatus | String? | yes | | + | items | String? | yes | | + | payload | String? | yes | | + | traceId | String? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [AWSS3config](#AWSS3config) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | bucket | String? | yes | | + | region | String? | yes | | + | dir | String? | yes | | + | accessKey | String? | yes | | + | secretKey | String? | yes | | + | localFilePath | String? | yes | | + | archivePath | String? | yes | | + | archive | Bool? | yes | | + | delete | Bool? | yes | | + | unzip | Bool? | yes | | + | zipFormat | String? | yes | | + | fileRegex | String? | yes | | + | archiveConfig | [ArchiveConfig](#ArchiveConfig)? | yes | | + +--- + + + + + #### [ArchiveConfig](#ArchiveConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | delete | Bool? | yes | | + | archive | Bool? | yes | | + | archiveDir | String? | yes | | + +--- + + + + + #### [Audit](#Audit) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | createdBy | String? | yes | | + | modifiedBy | String? | yes | | + | createdOn | String? | yes | | + | modifiedOn | String? | yes | | + +--- + + + + + #### [CatalogMasterConfig](#CatalogMasterConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | sourceSlug | String? | yes | | + +--- + + + + + #### [CompanyConfig](#CompanyConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | companyId | Int? | yes | | + | excludeSteps | [Int]? | yes | | + | hiddenClosetKeys | [String]? | yes | | + | openTags | [String: Any]? | yes | | + | taxIdentifiers | [String]? | yes | | + | deleteQuantityThreshold | Int? | yes | | + +--- + + + + + #### [DBConfig](#DBConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | vendor | String? | yes | | + | host | String? | yes | | + | port | Int? | yes | | + | username | String? | yes | | + | password | String? | yes | | + | dbname | String? | yes | | + | query | String? | yes | | + | procedure | Bool? | yes | | + | driverClass | String? | yes | | + | jdbcUrl | String? | yes | | + | optionalProperties | [String: String]? | yes | | + +--- + + + + + #### [DBConnectionProfile](#DBConnectionProfile) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | inventory | String? | yes | | + +--- + + + + + #### [DBParamConfig](#DBParamConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | params | [String: Any]? | yes | | + +--- + + + + + #### [DefaultHeadersDTO](#DefaultHeadersDTO) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | store | [PropBeanDTO](#PropBeanDTO)? | yes | | + | intfArticleId | [PropBeanDTO](#PropBeanDTO)? | yes | | + | priceEffective | [PropBeanDTO](#PropBeanDTO)? | yes | | + | quantity | [PropBeanDTO](#PropBeanDTO)? | yes | | + +--- + + + + + #### [DocMappingConfig](#DocMappingConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | properties | [String: Any]? | yes | | + | junkDataThresholdCount | Int? | yes | | + | propBeanConfigs | [[PropBeanConfig](#PropBeanConfig)]? | yes | | + | unwindField | String? | yes | | + | defaultHeaders | [DefaultHeadersDTO](#DefaultHeadersDTO)? | yes | | + +--- + + + + + #### [EmailConfig](#EmailConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | recepient | String? | yes | | + | host | String? | yes | | + | username | String? | yes | | + | password | String? | yes | | + | unzip | Bool? | yes | | + | readFromContent | Bool? | yes | | + | filterBasedOnRecepients | Bool? | yes | | + | pcol | String? | yes | | + | subjectLineRegex | String? | yes | | + | senderAddress | String? | yes | | + | localDir | String? | yes | | + | folderNameHierarchies | [String]? | yes | | + | attachmentRegex | String? | yes | | + | bodyContentRegex | String? | yes | | + | passwordProtected | Bool? | yes | | + | zipFormat | String? | yes | | + | attachmentMandate | Bool? | yes | | + | filterFilesAfterExtraction | Bool? | yes | | + | archiveConfig | [ArchiveConfig](#ArchiveConfig)? | yes | | + | readAllUnreadMails | Bool? | yes | | + | contentType | String? | yes | | + | downloadableLink | Bool? | yes | | + | properties | [String: String]? | yes | | + +--- + + + + + #### [FTPConfig](#FTPConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | host | String? | yes | | + | port | Int? | yes | | + | username | String? | yes | | + | password | String? | yes | | + | unzip | Bool? | yes | | + | retries | Int? | yes | | + | interval | Int? | yes | | + | localDir | String? | yes | | + | remoteDir | String? | yes | | + | zipFileRegex | String? | yes | | + | archiveConfig | [ArchiveConfig](#ArchiveConfig)? | yes | | + | fileRegex | String? | yes | | + | zipFormat | String? | yes | | + | readAllFiles | Bool? | yes | | + +--- + + + + + #### [FileConfig](#FileConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | delimiter | String? | yes | | + | charset | String? | yes | | + | properties | [String: Any]? | yes | | + | fileHasHeader | Bool? | yes | | + | headerIndex | Int? | yes | | + | headerArray | [String]? | yes | | + | dataStartIndex | Int? | yes | | + | propBeanConfigs | [[PropBeanConfig](#PropBeanConfig)]? | yes | | + | junkDataThresholdCount | Int? | yes | | + | fileType | String? | yes | | + | lineValidityCheck | Bool? | yes | | + | sheetNames | [String]? | yes | | + | readAllSheets | Bool? | yes | | + | quoteChar | String? | yes | | + | escapeChar | String? | yes | | + | defaultHeaders | [DefaultHeadersDTO](#DefaultHeadersDTO)? | yes | | + +--- + + + + + #### [GoogleSpreadSheetConfig](#GoogleSpreadSheetConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | range | String? | yes | | + | sheetId | String? | yes | | + | clientSecretLocation | String? | yes | | + | credStorageDirectory | String? | yes | | + | localDir | String? | yes | | + | archiveConfig | [ArchiveConfig](#ArchiveConfig)? | yes | | + +--- + + + + + #### [HttpConfig](#HttpConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | hosturl | String? | yes | | + | username | String? | yes | | + | password | String? | yes | | + | requestParams | [String: String]? | yes | | + | httpMethod | String? | yes | | + | requestPayload | String? | yes | | + | localPath | String? | yes | | + | archiveConfig | [ArchiveConfig](#ArchiveConfig)? | yes | | + +--- + + + + + #### [JobConfig](#JobConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | jobCode | String? | yes | | + | taskType | String? | yes | | + | syncDelay | Int? | yes | | + | cronExpression | String? | yes | | + | storeFilter | [StoreFilter](#StoreFilter)? | yes | | + | processConfig | [ProcessConfig](#ProcessConfig)? | yes | | + | storeConfig | [[StoreConfig](#StoreConfig)]? | yes | | + | properties | [String: String]? | yes | | + | immediateFirstRun | Bool? | yes | | + | disable | Bool? | yes | | + | dependentJobCodes | [String]? | yes | | + | companyConfig | [[CompanyConfig](#CompanyConfig)]? | yes | | + | companyIds | [Int]? | yes | | + | taxIdentifiers | [String]? | yes | | + | priority | String? | yes | | + | periodThreshold | Int? | yes | | + | periodThresholdType | String? | yes | | + | dbConnectionProfile | [DBConnectionProfile](#DBConnectionProfile)? | yes | | + | params | [String: Any]? | yes | | + | openTags | [String: Any]? | yes | | + | deleteQuantityThreshold | Int? | yes | | + | catalogMasterConfig | [CatalogMasterConfig](#CatalogMasterConfig)? | yes | | + | aggregatorTypes | [String]? | yes | | + | integrationType | String? | yes | | + | minPrice | Double? | yes | | + | audit | [Audit](#Audit)? | yes | | + | version | Int? | yes | | + | alias | String? | yes | | + +--- + + + + + #### [JobConfigRawDTO](#JobConfigRawDTO) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | integration | String | no | | + | companyName | String | no | | + | companyId | Int | no | | + | data | [JobConfig](#JobConfig)? | yes | | + +--- + + + + + #### [JsonDocConfig](#JsonDocConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | propBeanConfigs | [[PropBeanConfig](#PropBeanConfig)]? | yes | | + +--- + + + + + #### [LocalFileConfig](#LocalFileConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | retries | Int? | yes | | + | interval | Int? | yes | | + | localDir | String? | yes | | + | workingDir | String? | yes | | + | unzip | Bool? | yes | | + | zipFileRegex | String? | yes | | + | fileRegex | String? | yes | | + | zipFormat | String? | yes | | + | archiveConfig | [ArchiveConfig](#ArchiveConfig)? | yes | | + | readAllFiles | Bool? | yes | | + +--- + + + + + #### [MongoDocConfig](#MongoDocConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | collectionName | String? | yes | | + | findQuery | [String: Any]? | yes | | + | projectionQuery | [String: Any]? | yes | | + | propBeanConfigs | [[PropBeanConfig](#PropBeanConfig)]? | yes | | + | aggregatePipeline | [[String: Any]]? | yes | | + | skipSave | Bool? | yes | | + +--- + + + + + #### [OAuthConfig](#OAuthConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | limit | Int? | yes | | + | pages | Int? | yes | | + | interval | Int? | yes | | + | consumerKey | String? | yes | | + | consumerSecret | String? | yes | | + | token | String? | yes | | + | tokenSecret | String? | yes | | + | restUrl | String? | yes | | + | restBaseUrl | String? | yes | | + | functionName | String? | yes | | + +--- + + + + + #### [ProcessConfig](#ProcessConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | dbConfig | [DBConfig](#DBConfig)? | yes | | + | dbParamConfig | [DBParamConfig](#DBParamConfig)? | yes | | + | sftpConfig | [SFTPConfig](#SFTPConfig)? | yes | | + | awsS3Config | [AWSS3config](#AWSS3config)? | yes | | + | mongoDocConfig | [MongoDocConfig](#MongoDocConfig)? | yes | | + | ftpConfig | [FTPConfig](#FTPConfig)? | yes | | + | emailConfig | [EmailConfig](#EmailConfig)? | yes | | + | fileConfig | [FileConfig](#FileConfig)? | yes | | + | jsonDocConfig | [JsonDocConfig](#JsonDocConfig)? | yes | | + | docMappingConfig | [DocMappingConfig](#DocMappingConfig)? | yes | | + | taskStepConfig | [TaskStepConfig](#TaskStepConfig)? | yes | | + | httpConfig | [HttpConfig](#HttpConfig)? | yes | | + | localFileConfig | [LocalFileConfig](#LocalFileConfig)? | yes | | + | oauthConfig | [OAuthConfig](#OAuthConfig)? | yes | | + | googleSpreadsheetConfig | [GoogleSpreadSheetConfig](#GoogleSpreadSheetConfig)? | yes | | + +--- + + + + + #### [PropBeanConfig](#PropBeanConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | required | Bool? | yes | | + | mapping | [String: [PropBeanConfig](#PropBeanConfig)]? | yes | | + | optional | Bool? | yes | | + | send | [Send](#Send)? | yes | | + | validations | [[String: Any]]? | yes | | + | values | [String]? | yes | | + | include | Bool? | yes | | + | sourceField | String? | yes | | + | sourceFields | [String]? | yes | | + | destinationField | String? | yes | | + | dataType | String? | yes | | + | defaultValue | [String: Any]? | yes | | + | constValue | [String: Any]? | yes | | + | concatStr | String? | yes | | + | functionName | String? | yes | | + | transformerName | String? | yes | | + | allParamFunctionName | String? | yes | | + | subSeparator | String? | yes | | + | indexField | String? | yes | | + | ignoreIfNotExists | Bool? | yes | | + | identifierType | String? | yes | | + | projectionQuery | [String: Any]? | yes | | + | enrichFromMaster | Bool? | yes | | + +--- + + + + + #### [PropBeanDTO](#PropBeanDTO) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | required | Bool? | yes | | + | optional | Bool? | yes | | + | include | Bool? | yes | | + | sourceField | String? | yes | | + | sourceFields | [String]? | yes | | + | destinationField | String? | yes | | + | dataType | String? | yes | | + | defaultValue | [String: Any]? | yes | | + | constValue | [String: Any]? | yes | | + | concatStr | String? | yes | | + | functionName | String? | yes | | + | transformerName | String? | yes | | + | allParamFunctionName | String? | yes | | + | subSeparator | String? | yes | | + | indexField | String? | yes | | + | ignoreIfNotExists | Bool? | yes | | + | identifierType | String? | yes | | + | projectionQuery | [String: Any]? | yes | | + | enrichFromMaster | Bool? | yes | | + +--- + + + + + #### [ResponseEnvelopeListJobConfigRawDTO](#ResponseEnvelopeListJobConfigRawDTO) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | timestamp | String? | yes | | + | status | Int? | yes | | + | error | String? | yes | | + | exception | String? | yes | | + | message | String? | yes | | + | totalTimeTakenInMillis | Int? | yes | | + | httpStatus | String? | yes | | + | items | [[JobConfigRawDTO](#JobConfigRawDTO)]? | yes | | + | payload | [[JobConfigRawDTO](#JobConfigRawDTO)]? | yes | | + | traceId | String? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [SFTPConfig](#SFTPConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | host | String? | yes | | + | port | Int? | yes | | + | username | String? | yes | | + | password | String? | yes | | + | unzip | Bool? | yes | | + | retries | Int? | yes | | + | interval | Int? | yes | | + | privateKeyPath | String? | yes | | + | strictHostKeyChecking | Bool? | yes | | + | localDir | String? | yes | | + | remoteDir | String? | yes | | + | passwordProtected | Bool? | yes | | + | zipFileRegex | String? | yes | | + | fileRegex | String? | yes | | + | zipFormat | String? | yes | | + | archiveConfig | [ArchiveConfig](#ArchiveConfig)? | yes | | + | readAllFiles | Bool? | yes | | + +--- + + + + + #### [Send](#Send) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | raw | Bool? | yes | | + | processed | Bool? | yes | | + +--- + + + + + #### [StoreConfig](#StoreConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | jobCode | String? | yes | | + | storeid | String? | yes | | + | storeAlias | String? | yes | | + | storeFileRegex | String? | yes | | + | storeFileName | String? | yes | | + | processConfig | [ProcessConfig](#ProcessConfig)? | yes | | + | properties | [String: String]? | yes | | + +--- + + + + + #### [StoreFilter](#StoreFilter) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | includeTags | [String]? | yes | | + | excludeTags | [String]? | yes | | + | query | [String: Any]? | yes | | + +--- + + + + + #### [TaskConfig](#TaskConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | taskConfigId | Int? | yes | | + | taskParams | [[TaskParam](#TaskParam)]? | yes | | + +--- + + + + + #### [TaskParam](#TaskParam) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | value | [String: Any]? | yes | | + +--- + + + + + #### [TaskStepConfig](#TaskStepConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | taskConfigs | [[TaskConfig](#TaskConfig)]? | yes | | + | taskConfigIds | [Int]? | yes | | + | taskConfigGroupIds | [Int]? | yes | | + +--- + + + + + #### [JobStepsDTO](#JobStepsDTO) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | stepName | String? | yes | | + | type | String? | yes | | + | stepExecutionTime | Int? | yes | | + | startCount | Int? | yes | | + | endCount | Int? | yes | | + | deletedCount | Int? | yes | | + | processedStartTime | String? | yes | | + | processedAt | String? | yes | | + +--- + + + + + #### [ResponseEnvelopeListJobStepsDTO](#ResponseEnvelopeListJobStepsDTO) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | timestamp | String? | yes | | + | status | Int? | yes | | + | error | String? | yes | | + | exception | String? | yes | | + | message | String? | yes | | + | totalTimeTakenInMillis | Int? | yes | | + | httpStatus | String? | yes | | + | items | [[JobStepsDTO](#JobStepsDTO)]? | yes | | + | payload | [[JobStepsDTO](#JobStepsDTO)]? | yes | | + | traceId | String? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [ResponseEnvelopeListJobConfigDTO](#ResponseEnvelopeListJobConfigDTO) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | timestamp | String? | yes | | + | status | Int? | yes | | + | error | String? | yes | | + | exception | String? | yes | | + | message | String? | yes | | + | totalTimeTakenInMillis | Int? | yes | | + | httpStatus | String? | yes | | + | items | [[JobConfigDTO](#JobConfigDTO)]? | yes | | + | payload | [[JobConfigDTO](#JobConfigDTO)]? | yes | | + | traceId | String? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [ResponseEnvelopeJobConfigDTO](#ResponseEnvelopeJobConfigDTO) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | timestamp | String? | yes | | + | status | Int? | yes | | + | error | String? | yes | | + | exception | String? | yes | | + | message | String? | yes | | + | totalTimeTakenInMillis | Int? | yes | | + | httpStatus | String? | yes | | + | items | [JobConfigDTO](#JobConfigDTO)? | yes | | + | payload | [JobConfigDTO](#JobConfigDTO)? | yes | | + | traceId | String? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [JobHistoryDto](#JobHistoryDto) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | totalAddedCount | Int? | yes | | + | totalUpdatedCount | Int? | yes | | + | totalSuppressedCount | Int? | yes | | + | totalInitialCount | Int? | yes | | + | jobId | Int? | yes | | + | status | String? | yes | | + | jobCode | String? | yes | | + | processedOn | String? | yes | | + | filename | [String]? | yes | | + | errorType | String? | yes | | + | message | String? | yes | | + +--- + + + + + #### [JobMetricsDto](#JobMetricsDto) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | jobCode | String? | yes | | + | isRunMoreThanUsual | String? | yes | | + | jobHistory | [[JobHistoryDto](#JobHistoryDto)]? | yes | | + | totalSuccessCount | Int? | yes | | + | totalFailureCount | Int? | yes | | + | totalWarningCount | Int? | yes | | + | totalSuppressedCount | Int? | yes | | + | totalJobRuns | Int? | yes | | + +--- + + + + + #### [ResponseEnvelopeJobMetricsDto](#ResponseEnvelopeJobMetricsDto) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | timestamp | String? | yes | | + | status | Int? | yes | | + | error | String? | yes | | + | exception | String? | yes | | + | message | String? | yes | | + | totalTimeTakenInMillis | Int? | yes | | + | httpStatus | String? | yes | | + | items | [JobMetricsDto](#JobMetricsDto)? | yes | | + | payload | [JobMetricsDto](#JobMetricsDto)? | yes | | + | traceId | String? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [JobConfigListDTO](#JobConfigListDTO) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | code | String? | yes | | + | alias | String? | yes | | + | modifiedBy | String? | yes | | + | createdBy | String? | yes | | + | modifiedOn | String? | yes | | + | createdOn | String? | yes | | + | active | Bool? | yes | | + | type | String? | yes | | + +--- + + + + + #### [ResponseEnvelopeListJobConfigListDTO](#ResponseEnvelopeListJobConfigListDTO) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | timestamp | String? | yes | | + | status | Int? | yes | | + | error | String? | yes | | + | exception | String? | yes | | + | message | String? | yes | | + | totalTimeTakenInMillis | Int? | yes | | + | httpStatus | String? | yes | | + | items | [[JobConfigListDTO](#JobConfigListDTO)]? | yes | | + | payload | [[JobConfigListDTO](#JobConfigListDTO)]? | yes | | + | traceId | String? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + diff --git a/documentation/platform/LEAD.md b/documentation/platform/LEAD.md new file mode 100644 index 0000000000..507806f495 --- /dev/null +++ b/documentation/platform/LEAD.md @@ -0,0 +1,4521 @@ + + + + +##### [Back to Platform docs](./README.md) + +## Lead Methods +Handles communication between Administrator <-> Staff and Staff <-> Users +* [getTickets](#gettickets) +* [createTicket](#createticket) +* [getTickets](#gettickets) +* [getTicket](#getticket) +* [editTicket](#editticket) +* [getTicket](#getticket) +* [editTicket](#editticket) +* [createHistory](#createhistory) +* [getTicketHistory](#gettickethistory) +* [getFeedbacks](#getfeedbacks) +* [submitFeedback](#submitfeedback) +* [createHistory](#createhistory) +* [getTicketHistory](#gettickethistory) +* [getCustomForm](#getcustomform) +* [editCustomForm](#editcustomform) +* [getCustomForms](#getcustomforms) +* [createCustomForm](#createcustomform) +* [getTokenForVideoRoom](#gettokenforvideoroom) +* [getTokenForVideoRoom](#gettokenforvideoroom) +* [getVideoParticipants](#getvideoparticipants) +* [getVideoParticipants](#getvideoparticipants) +* [openVideoRoom](#openvideoroom) +* [closeVideoRoom](#closevideoroom) + + + +## Methods with example and description + + +#### getTickets +Gets the list of company level tickets and/or ticket filters depending on query params + + + + +```swift +client.lead.getTickets(items: items, filters: filters, q: q, status: status, priority: priority, category: category, pageNo: pageNo, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| items | Bool? | no | Decides that the reponse will contain the list of tickets | +| filters | Bool? | no | Decides that the reponse will contain the ticket filters | +| q | String? | no | Search through ticket titles and description | +| status | String? | no | Filter tickets on status | +| priority | PriorityEnum? | no | Filter tickets on priority | +| category | String? | no | Filter tickets on category | +| pageNo | Int? | no | The page number to navigate through the given set of results. | +| pageSize | Int? | no | Number of items to retrieve in each page. Default is 12. | + + + +Gets the list of company level tickets and/or ticket filters + +*Returned Response:* + + + + +[TicketList](#TicketList) + +Success + + + + +
    +  Examples: + + +
    +  Without items + +```json +{ + "value": { + "filters": { + "statuses": [ + { + "display": "Pending", + "color": "#eae22b", + "key": "pending" + }, + { + "display": "In Progress", + "color": "#ffa951", + "key": "in_progress" + }, + { + "display": "Resolved", + "color": "#20c3a6", + "key": "resolved" + }, + { + "display": "Closed", + "color": "#41434c", + "key": "closed" + } + ], + "priorities": [ + { + "display": "Low", + "color": "#fed766", + "key": "low" + }, + { + "display": "Medium", + "color": "#f37736", + "key": "medium" + }, + { + "display": "High", + "color": "#fe4a49", + "key": "high" + } + ], + "assignees": [], + "categories": [ + { + "form": { + "login_required": false, + "should_notify": false, + "inputs": [ + { + "type": "email", + "showRegexInput": false, + "enum": [], + "regex": "\\S+@\\S+\\.\\S+", + "display": "email", + "required": true, + "key": "email" + } + ], + "available_assignees": [], + "_id": "602e900a2042255c03cadaf0", + "title": "service-test-satyen", + "description": "testing form from service", + "slug": "service-test-satyen", + "header_image": "https://hdn-1.addsale.com/x0/support-ticket/files/free/original/KZL86aN5l-service-test-satyen.jpeg", + "application_id": "000000000000000000000001", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.150" + }, + "os": { + "name": "macOS", + "version": "11.2.0" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5f8147abbd1a0a870f61f1a6", + "createdAt": "2021-02-18T16:04:26.495Z", + "updatedAt": "2021-02-18T16:04:26.495Z", + "__v": 0 + }, + "key": "service-test-satyen", + "display": "service-test-satyen" + } + ] + } + } +} +``` +
    + +
    +  With items + +```json +{ + "value": { + "docs": [ + { + "_id": "602d2652ce284d0b008d5c97", + "status": { + "display": "Pending", + "color": "#eae22b", + "key": "pending" + }, + "priority": { + "display": "Medium", + "color": "#f37736", + "key": "medium" + }, + "assigned_to": { + "agent_id": "5e79e721768c6bf54b783146", + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", + "hasOldPasswordHash": false, + "_id": "5e79e721768c6bf54b783146", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "nikhilmanapure@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "nikhilmanapure@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "nikhilmanapure@uniket.store" + } + ], + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "username": "nikhilmanapure_gofynd_com_29298", + "createdAt": "2020-03-24T10:55:29.298Z", + "updatedAt": "2020-05-12T07:46:41.816Z", + "uid": "5567", + "__v": 2 + }, + "tags": [ + "asdf444" + ], + "context": { + "application_id": "000000000000000000000001", + "company_id": "1" + }, + "created_on": { + "user_agent": "Fynd Platform/0.0.1 (com.fynd.platform; build:3; iOS 14.2.0) Alamofire/5.0.2", + "platform": "web", + "meta": { + "browser": { + "name": "Fynd Platform", + "version": "0.0.1" + } + } + }, + "source": "sales_channel", + "content": { + "title": "asdf444 Response", + "description": "", + "attachments": [] + }, + "response_id": "602d2652ce284dee3c8d5c96", + "category": { + "form": { + "login_required": false, + "should_notify": true, + "inputs": [ + { + "type": "text", + "showRegexInput": false, + "enum": [], + "display": "asdf", + "key": "asdf" + }, + { + "type": "mobile", + "showRegexInput": false, + "enum": [], + "display": "mob num", + "regex": "[0-9]{10}$", + "key": "mob-num" + } + ], + "available_assignees": [ + "5e79e721768c6bf54b783146" + ], + "_id": "60124e4a4d2bc363625e1bf4", + "title": "asdf444", + "description": "adf", + "slug": "asdf444", + "application_id": "000000000000000000000001", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.96" + }, + "os": { + "name": "macOS", + "version": "10.15.7", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5e79e721768c6bf54b783146", + "createdAt": "2021-01-28T05:40:26.271Z", + "updatedAt": "2021-02-18T16:02:32.086Z", + "__v": 0, + "poll_for_assignment": { + "duration": 20, + "message": "We are looking for executive to connect you", + "success_message": "Executive found", + "failure_message": "All our executives are busy at the moment, We have accepted your request and someone will connect with you soon!" + } + }, + "key": "asdf444", + "display": "asdf444" + }, + "ticket_id": "472", + "createdAt": "2021-02-17T14:21:06.774Z", + "updatedAt": "2021-02-17T14:21:06.774Z", + "__v": 0, + "id": "602d2652ce284d0b008d5c97" + } + ], + "total": 472, + "limit": 10, + "page": 1, + "pages": 48, + "filters": { + "statuses": [ + { + "display": "Pending", + "color": "#eae22b", + "key": "pending" + }, + { + "display": "In Progress", + "color": "#ffa951", + "key": "in_progress" + }, + { + "display": "Resolved", + "color": "#20c3a6", + "key": "resolved" + }, + { + "display": "Closed", + "color": "#41434c", + "key": "closed" + } + ], + "priorities": [ + { + "display": "Low", + "color": "#fed766", + "key": "low" + }, + { + "display": "Medium", + "color": "#f37736", + "key": "medium" + }, + { + "display": "High", + "color": "#fe4a49", + "key": "high" + } + ], + "assignees": [], + "categories": [ + { + "form": { + "login_required": false, + "should_notify": false, + "inputs": [ + { + "type": "email", + "showRegexInput": false, + "enum": [], + "regex": "\\S+@\\S+\\.\\S+", + "display": "email", + "required": true, + "key": "email" + } + ], + "available_assignees": [], + "_id": "602e900a2042255c03cadaf0", + "title": "service-test-satyen", + "description": "testing form from service", + "slug": "service-test-satyen", + "header_image": "https://hdn-1.addsale.com/x0/support-ticket/files/free/original/KZL86aN5l-service-test-satyen.jpeg", + "application_id": "000000000000000000000001", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.150" + }, + "os": { + "name": "macOS", + "version": "11.2.0" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5f8147abbd1a0a870f61f1a6", + "createdAt": "2021-02-18T16:04:26.495Z", + "updatedAt": "2021-02-18T16:04:26.495Z", + "__v": 0 + }, + "key": "service-test-satyen", + "display": "service-test-satyen" + } + ] + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createTicket +Creates a company level ticket + + + + +```swift +client.lead.createTicket(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | AddTicketPayload | yes | Request body | + + +Creates a company level ticket + +*Returned Response:* + + + + +[Ticket](#Ticket) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "context": { + "company_id": "884" + }, + "content": { + "title": "SOme title Response", + "description": "Single lineeee: asdf
    Email: asdf@asdf.com
    dfsdf: asdf
    ", + "attachments": [] + }, + "status": { + "display": "In Progress", + "color": "#ffa951", + "key": "in_progress" + }, + "priority": { + "display": "Medium", + "color": "#f37736", + "key": "medium" + }, + "assigned_to": { + "agent_id": "5d1363adf599d850df93175e", + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", + "hasOldPasswordHash": false, + "_id": "5d1363adf599d850df93175e", + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + } + ], + "username": "nikhilmshchs_gmail_com_38425_20500281", + "createdAt": "2019-01-01T17:22:38.528Z", + "updatedAt": "2021-01-22T10:02:42.258Z", + "uid": "20500281", + "__v": 56 + }, + "tags": [ + "some-title" + ], + "_id": "6012f38557751ee8fc162cf7", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.96" + }, + "os": { + "name": "macOS", + "version": "10.15.7", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "source": "sales_channel", + "created_by": { + "id": "5d1363adf599d850df93175e", + "user": { + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", + "hasOldPasswordHash": false, + "_id": "5d1363adf599d850df93175e", + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + } + ], + "username": "nikhilmshchs_gmail_com_38425_20500281", + "createdAt": "2019-01-01T17:22:38.528Z", + "updatedAt": "2021-01-22T10:02:42.258Z", + "uid": "20500281", + "__v": 56 + } + }, + "response_id": "6012f38457751e0fb8162cf6", + "category": { + "form": { + "login_required": false, + "should_notify": false, + "inputs": [ + { + "required": false, + "type": "text", + "enum": [], + "display": "Single lineeee", + "key": "single-lineeee", + "showRegexInput": false + }, + { + "required": false, + "type": "email", + "enum": [], + "display": "Email", + "regex": "\\S+@\\S+\\.\\S+", + "key": "email", + "showRegexInput": true + }, + { + "required": false, + "type": "text", + "enum": [], + "display": "dfsdf", + "key": "dfsdf", + "showRegexInput": false + } + ], + "available_assignees": [ + "5b9b98150df588546aaea6d2", + "5c45d78395d7504f76c2cb37" + ], + "_id": "5fd72db3dc250f8decfc61b2", + "title": "SOme title", + "description": "SOme big description", + "slug": "some-title", + "application_id": "000000000000000000000003", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "87.0.4280.88" + }, + "os": { + "name": "macOS", + "version": "10.15.6", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5d1363adf599d850df93175e", + "createdAt": "2020-12-14T09:17:39.953Z", + "updatedAt": "2021-01-28T18:48:07.717Z", + "__v": 0 + }, + "key": "some-title", + "display": "SOme title" + }, + "ticket_id": "43", + "createdAt": "2021-01-28T17:25:25.013Z", + "updatedAt": "2021-01-28T17:25:33.396Z", + "__v": 0, + "video_room_id": "6012f38557751ee8fc162cf7" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getTickets +Gets the list of Application level Tickets and/or ticket filters depending on query params + + + + +```swift +client.application("").lead.getTickets(items: items, filters: filters, q: q, status: status, priority: priority, category: category) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| items | Bool? | no | Decides that the reponse will contain the list of tickets | +| filters | Bool? | no | Decides that the reponse will contain the ticket filters | +| q | String? | no | Search through ticket titles and description | +| status | String? | no | Filter tickets on status | +| priority | PriorityEnum? | no | Filter tickets on priority | +| category | String? | no | Filter tickets on category | + + + +Gets the list of Application level Tickets and/or ticket filters + +*Returned Response:* + + + + +[TicketList](#TicketList) + +Success + + + + +
    +  Examples: + + +
    +  Without items + +```json +{ + "value": { + "filters": { + "statuses": [ + { + "display": "Pending", + "color": "#eae22b", + "key": "pending" + }, + { + "display": "In Progress", + "color": "#ffa951", + "key": "in_progress" + }, + { + "display": "Resolved", + "color": "#20c3a6", + "key": "resolved" + }, + { + "display": "Closed", + "color": "#41434c", + "key": "closed" + } + ], + "priorities": [ + { + "display": "Low", + "color": "#fed766", + "key": "low" + }, + { + "display": "Medium", + "color": "#f37736", + "key": "medium" + }, + { + "display": "High", + "color": "#fe4a49", + "key": "high" + } + ], + "assignees": [], + "categories": [ + { + "form": { + "login_required": false, + "should_notify": false, + "inputs": [ + { + "type": "email", + "showRegexInput": false, + "enum": [], + "regex": "\\S+@\\S+\\.\\S+", + "display": "email", + "required": true, + "key": "email" + } + ], + "available_assignees": [], + "_id": "602e900a2042255c03cadaf0", + "title": "service-test-satyen", + "description": "testing form from service", + "slug": "service-test-satyen", + "header_image": "https://hdn-1.addsale.com/x0/support-ticket/files/free/original/KZL86aN5l-service-test-satyen.jpeg", + "application_id": "000000000000000000000001", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.150" + }, + "os": { + "name": "macOS", + "version": "11.2.0" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5f8147abbd1a0a870f61f1a6", + "createdAt": "2021-02-18T16:04:26.495Z", + "updatedAt": "2021-02-18T16:04:26.495Z", + "__v": 0 + }, + "key": "service-test-satyen", + "display": "service-test-satyen" + } + ] + } + } +} +``` +
    + +
    +  With items + +```json +{ + "value": { + "docs": [ + { + "_id": "602d2652ce284d0b008d5c97", + "status": { + "display": "Pending", + "color": "#eae22b", + "key": "pending" + }, + "priority": { + "display": "Medium", + "color": "#f37736", + "key": "medium" + }, + "assigned_to": { + "agent_id": "5e79e721768c6bf54b783146", + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", + "hasOldPasswordHash": false, + "_id": "5e79e721768c6bf54b783146", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "nikhilmanapure@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "nikhilmanapure@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "nikhilmanapure@uniket.store" + } + ], + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "username": "nikhilmanapure_gofynd_com_29298", + "createdAt": "2020-03-24T10:55:29.298Z", + "updatedAt": "2020-05-12T07:46:41.816Z", + "uid": "5567", + "__v": 2 + }, + "tags": [ + "asdf444" + ], + "context": { + "application_id": "000000000000000000000001", + "company_id": "1" + }, + "created_on": { + "user_agent": "Fynd Platform/0.0.1 (com.fynd.platform; build:3; iOS 14.2.0) Alamofire/5.0.2", + "platform": "web", + "meta": { + "browser": { + "name": "Fynd Platform", + "version": "0.0.1" + } + } + }, + "source": "sales_channel", + "content": { + "title": "asdf444 Response", + "description": "", + "attachments": [] + }, + "response_id": "602d2652ce284dee3c8d5c96", + "category": { + "form": { + "login_required": false, + "should_notify": true, + "inputs": [ + { + "type": "text", + "showRegexInput": false, + "enum": [], + "display": "asdf", + "key": "asdf" + }, + { + "type": "mobile", + "showRegexInput": false, + "enum": [], + "display": "mob num", + "regex": "[0-9]{10}$", + "key": "mob-num" + } + ], + "available_assignees": [ + "5e79e721768c6bf54b783146" + ], + "_id": "60124e4a4d2bc363625e1bf4", + "title": "asdf444", + "description": "adf", + "slug": "asdf444", + "application_id": "000000000000000000000001", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.96" + }, + "os": { + "name": "macOS", + "version": "10.15.7", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5e79e721768c6bf54b783146", + "createdAt": "2021-01-28T05:40:26.271Z", + "updatedAt": "2021-02-18T16:02:32.086Z", + "__v": 0, + "poll_for_assignment": { + "duration": 20, + "message": "We are looking for executive to connect you", + "success_message": "Executive found", + "failure_message": "All our executives are busy at the moment, We have accepted your request and someone will connect with you soon!" + } + }, + "key": "asdf444", + "display": "asdf444" + }, + "ticket_id": "472", + "createdAt": "2021-02-17T14:21:06.774Z", + "updatedAt": "2021-02-17T14:21:06.774Z", + "__v": 0, + "id": "602d2652ce284d0b008d5c97" + } + ], + "total": 472, + "limit": 10, + "page": 1, + "pages": 48, + "filters": { + "statuses": [ + { + "display": "Pending", + "color": "#eae22b", + "key": "pending" + }, + { + "display": "In Progress", + "color": "#ffa951", + "key": "in_progress" + }, + { + "display": "Resolved", + "color": "#20c3a6", + "key": "resolved" + }, + { + "display": "Closed", + "color": "#41434c", + "key": "closed" + } + ], + "priorities": [ + { + "display": "Low", + "color": "#fed766", + "key": "low" + }, + { + "display": "Medium", + "color": "#f37736", + "key": "medium" + }, + { + "display": "High", + "color": "#fe4a49", + "key": "high" + } + ], + "assignees": [], + "categories": [ + { + "form": { + "login_required": false, + "should_notify": false, + "inputs": [ + { + "type": "email", + "showRegexInput": false, + "enum": [], + "regex": "\\S+@\\S+\\.\\S+", + "display": "email", + "required": true, + "key": "email" + } + ], + "available_assignees": [], + "_id": "602e900a2042255c03cadaf0", + "title": "service-test-satyen", + "description": "testing form from service", + "slug": "service-test-satyen", + "header_image": "https://hdn-1.addsale.com/x0/support-ticket/files/free/original/KZL86aN5l-service-test-satyen.jpeg", + "application_id": "000000000000000000000001", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.150" + }, + "os": { + "name": "macOS", + "version": "11.2.0" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5f8147abbd1a0a870f61f1a6", + "createdAt": "2021-02-18T16:04:26.495Z", + "updatedAt": "2021-02-18T16:04:26.495Z", + "__v": 0 + }, + "key": "service-test-satyen", + "display": "service-test-satyen" + } + ] + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getTicket +Retreives ticket details of a company level ticket with ticket ID + + + + +```swift +client.lead.getTicket(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Tiket ID of the ticket to be fetched | + + + +Retreives ticket details of a company level ticket + +*Returned Response:* + + + + +[Ticket](#Ticket) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "context": { + "company_id": "1" + }, + "content": { + "title": "SOme title Response", + "description": "Single lineeee: asdf
    Email: asdf@asdf.com
    dfsdf: asdf
    ", + "attachments": [] + }, + "status": { + "display": "In Progress", + "color": "#ffa951", + "key": "in_progress" + }, + "priority": { + "display": "Medium", + "color": "#f37736", + "key": "medium" + }, + "assigned_to": { + "agent_id": "5d1363adf599d850df93175e", + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", + "hasOldPasswordHash": false, + "_id": "5d1363adf599d850df93175e", + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + } + ], + "username": "nikhilmshchs_gmail_com_38425_20500281", + "createdAt": "2019-01-01T17:22:38.528Z", + "updatedAt": "2021-01-22T10:02:42.258Z", + "uid": "20500281", + "__v": 56 + }, + "tags": [ + "some-title" + ], + "_id": "6012f38557751ee8fc162cf7", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.96" + }, + "os": { + "name": "macOS", + "version": "10.15.7", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "source": "sales_channel", + "created_by": { + "id": "5d1363adf599d850df93175e", + "user": { + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", + "hasOldPasswordHash": false, + "_id": "5d1363adf599d850df93175e", + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + } + ], + "username": "nikhilmshchs_gmail_com_38425_20500281", + "createdAt": "2019-01-01T17:22:38.528Z", + "updatedAt": "2021-01-22T10:02:42.258Z", + "uid": "20500281", + "__v": 56 + } + }, + "response_id": "6012f38457751e0fb8162cf6", + "category": { + "form": { + "login_required": false, + "should_notify": false, + "inputs": [ + { + "required": false, + "type": "text", + "enum": [], + "display": "Single lineeee", + "key": "single-lineeee", + "showRegexInput": false + }, + { + "required": false, + "type": "email", + "enum": [], + "display": "Email", + "regex": "\\S+@\\S+\\.\\S+", + "key": "email", + "showRegexInput": true + }, + { + "required": false, + "type": "text", + "enum": [], + "display": "dfsdf", + "key": "dfsdf", + "showRegexInput": false + } + ], + "available_assignees": [ + "5b9b98150df588546aaea6d2", + "5c45d78395d7504f76c2cb37" + ], + "_id": "5fd72db3dc250f8decfc61b2", + "title": "SOme title", + "description": "SOme big description", + "slug": "some-title", + "application_id": "000000000000000000000003", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "87.0.4280.88" + }, + "os": { + "name": "macOS", + "version": "10.15.6", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5d1363adf599d850df93175e", + "createdAt": "2020-12-14T09:17:39.953Z", + "updatedAt": "2021-01-28T18:48:07.717Z", + "__v": 0 + }, + "key": "some-title", + "display": "SOme title" + }, + "ticket_id": "43", + "createdAt": "2021-01-28T17:25:25.013Z", + "updatedAt": "2021-01-28T17:25:33.396Z", + "__v": 0, + "video_room_id": "6012f38557751ee8fc162cf7" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### editTicket +Edits ticket details of a company level ticket + + + + +```swift +client.lead.editTicket(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Ticket ID of ticket to be edited | +| body | EditTicketPayload | yes | Request body | + + +Edits ticket details of a company level ticket such as status, priority, category, tags, attachments, assigne & ticket content changes + +*Returned Response:* + + + + +[Ticket](#Ticket) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "context": { + "company_id": "1" + }, + "content": { + "title": "SOme title Response", + "description": "Single lineeee: asdf
    Email: asdf@asdf.com
    dfsdf: asdf
    ", + "attachments": [] + }, + "status": { + "display": "In Progress", + "color": "#ffa951", + "key": "in_progress" + }, + "priority": { + "display": "Medium", + "color": "#f37736", + "key": "medium" + }, + "assigned_to": { + "agent_id": "5d1363adf599d850df93175e", + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", + "hasOldPasswordHash": false, + "_id": "5d1363adf599d850df93175e", + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + } + ], + "username": "nikhilmshchs_gmail_com_38425_20500281", + "createdAt": "2019-01-01T17:22:38.528Z", + "updatedAt": "2021-01-22T10:02:42.258Z", + "uid": "20500281", + "__v": 56 + }, + "tags": [ + "some-title" + ], + "_id": "6012f38557751ee8fc162cf7", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.96" + }, + "os": { + "name": "macOS", + "version": "10.15.7", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "source": "sales_channel", + "created_by": { + "id": "5d1363adf599d850df93175e", + "user": { + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", + "hasOldPasswordHash": false, + "_id": "5d1363adf599d850df93175e", + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + } + ], + "username": "nikhilmshchs_gmail_com_38425_20500281", + "createdAt": "2019-01-01T17:22:38.528Z", + "updatedAt": "2021-01-22T10:02:42.258Z", + "uid": "20500281", + "__v": 56 + } + }, + "response_id": "6012f38457751e0fb8162cf6", + "category": { + "form": { + "login_required": false, + "should_notify": false, + "inputs": [ + { + "required": false, + "type": "text", + "enum": [], + "display": "Single lineeee", + "key": "single-lineeee", + "showRegexInput": false + }, + { + "required": false, + "type": "email", + "enum": [], + "display": "Email", + "regex": "\\S+@\\S+\\.\\S+", + "key": "email", + "showRegexInput": true + }, + { + "required": false, + "type": "text", + "enum": [], + "display": "dfsdf", + "key": "dfsdf", + "showRegexInput": false + } + ], + "available_assignees": [ + "5b9b98150df588546aaea6d2", + "5c45d78395d7504f76c2cb37" + ], + "_id": "5fd72db3dc250f8decfc61b2", + "title": "SOme title", + "description": "SOme big description", + "slug": "some-title", + "application_id": "000000000000000000000003", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "87.0.4280.88" + }, + "os": { + "name": "macOS", + "version": "10.15.6", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5d1363adf599d850df93175e", + "createdAt": "2020-12-14T09:17:39.953Z", + "updatedAt": "2021-01-28T18:48:07.717Z", + "__v": 0 + }, + "key": "some-title", + "display": "SOme title" + }, + "ticket_id": "43", + "createdAt": "2021-01-28T17:25:25.013Z", + "updatedAt": "2021-01-28T17:25:33.396Z", + "__v": 0, + "video_room_id": "6012f38557751ee8fc162cf7" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getTicket +Retreives ticket details of a application level ticket + + + + +```swift +client.application("").lead.getTicket(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Tiket ID of the ticket to be fetched | + + + +Retreives ticket details of a application level ticket with ticket ID + +*Returned Response:* + + + + +[Ticket](#Ticket) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "context": { + "application_id": "000000000000000000000003", + "company_id": "884" + }, + "content": { + "title": "SOme title Response", + "description": "Single lineeee: asdf
    Email: asdf@asdf.com
    dfsdf: asdf
    ", + "attachments": [] + }, + "status": { + "display": "In Progress", + "color": "#ffa951", + "key": "in_progress" + }, + "priority": { + "display": "Medium", + "color": "#f37736", + "key": "medium" + }, + "assigned_to": { + "agent_id": "5d1363adf599d850df93175e", + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", + "hasOldPasswordHash": false, + "_id": "5d1363adf599d850df93175e", + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + } + ], + "username": "nikhilmshchs_gmail_com_38425_20500281", + "createdAt": "2019-01-01T17:22:38.528Z", + "updatedAt": "2021-01-22T10:02:42.258Z", + "uid": "20500281", + "__v": 56 + }, + "tags": [ + "some-title" + ], + "_id": "6012f38557751ee8fc162cf7", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.96" + }, + "os": { + "name": "macOS", + "version": "10.15.7", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "source": "sales_channel", + "created_by": { + "id": "5d1363adf599d850df93175e", + "user": { + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", + "hasOldPasswordHash": false, + "_id": "5d1363adf599d850df93175e", + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + } + ], + "username": "nikhilmshchs_gmail_com_38425_20500281", + "createdAt": "2019-01-01T17:22:38.528Z", + "updatedAt": "2021-01-22T10:02:42.258Z", + "uid": "20500281", + "__v": 56 + } + }, + "response_id": "6012f38457751e0fb8162cf6", + "category": { + "form": { + "login_required": false, + "should_notify": false, + "inputs": [ + { + "required": false, + "type": "text", + "enum": [], + "display": "Single lineeee", + "key": "single-lineeee", + "showRegexInput": false + }, + { + "required": false, + "type": "email", + "enum": [], + "display": "Email", + "regex": "\\S+@\\S+\\.\\S+", + "key": "email", + "showRegexInput": true + }, + { + "required": false, + "type": "text", + "enum": [], + "display": "dfsdf", + "key": "dfsdf", + "showRegexInput": false + } + ], + "available_assignees": [ + "5b9b98150df588546aaea6d2", + "5c45d78395d7504f76c2cb37" + ], + "_id": "5fd72db3dc250f8decfc61b2", + "title": "SOme title", + "description": "SOme big description", + "slug": "some-title", + "application_id": "000000000000000000000003", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "87.0.4280.88" + }, + "os": { + "name": "macOS", + "version": "10.15.6", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5d1363adf599d850df93175e", + "createdAt": "2020-12-14T09:17:39.953Z", + "updatedAt": "2021-01-28T18:48:07.717Z", + "__v": 0 + }, + "key": "some-title", + "display": "SOme title" + }, + "ticket_id": "43", + "createdAt": "2021-01-28T17:25:25.013Z", + "updatedAt": "2021-01-28T17:25:33.396Z", + "__v": 0, + "video_room_id": "6012f38557751ee8fc162cf7" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### editTicket +Edits ticket details of a application level ticket + + + + +```swift +client.application("").lead.editTicket(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Ticket ID of ticket to be edited | +| body | EditTicketPayload | yes | Request body | + + +Edits ticket details of a application level ticket such as status, priority, category, tags, attachments, assigne & ticket content changes + +*Returned Response:* + + + + +[Ticket](#Ticket) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "context": { + "application_id": "000000000000000000000003", + "company_id": "884" + }, + "content": { + "title": "SOme title Response", + "description": "Single lineeee: asdf
    Email: asdf@asdf.com
    dfsdf: asdf
    ", + "attachments": [] + }, + "status": { + "display": "In Progress", + "color": "#ffa951", + "key": "in_progress" + }, + "priority": { + "display": "Medium", + "color": "#f37736", + "key": "medium" + }, + "assigned_to": { + "agent_id": "5d1363adf599d850df93175e", + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", + "hasOldPasswordHash": false, + "_id": "5d1363adf599d850df93175e", + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + } + ], + "username": "nikhilmshchs_gmail_com_38425_20500281", + "createdAt": "2019-01-01T17:22:38.528Z", + "updatedAt": "2021-01-22T10:02:42.258Z", + "uid": "20500281", + "__v": 56 + }, + "tags": [ + "some-title" + ], + "_id": "6012f38557751ee8fc162cf7", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.96" + }, + "os": { + "name": "macOS", + "version": "10.15.7", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "source": "sales_channel", + "created_by": { + "id": "5d1363adf599d850df93175e", + "user": { + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=2136700473091190&height=400&width=400&ext=1554542761&hash=AeS6cuWIdjDdJJ-b", + "hasOldPasswordHash": false, + "_id": "5d1363adf599d850df93175e", + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + } + ], + "username": "nikhilmshchs_gmail_com_38425_20500281", + "createdAt": "2019-01-01T17:22:38.528Z", + "updatedAt": "2021-01-22T10:02:42.258Z", + "uid": "20500281", + "__v": 56 + } + }, + "response_id": "6012f38457751e0fb8162cf6", + "category": { + "form": { + "login_required": false, + "should_notify": false, + "inputs": [ + { + "required": false, + "type": "text", + "enum": [], + "display": "Single lineeee", + "key": "single-lineeee", + "showRegexInput": false + }, + { + "required": false, + "type": "email", + "enum": [], + "display": "Email", + "regex": "\\S+@\\S+\\.\\S+", + "key": "email", + "showRegexInput": true + }, + { + "required": false, + "type": "text", + "enum": [], + "display": "dfsdf", + "key": "dfsdf", + "showRegexInput": false + } + ], + "available_assignees": [ + "5b9b98150df588546aaea6d2", + "5c45d78395d7504f76c2cb37" + ], + "_id": "5fd72db3dc250f8decfc61b2", + "title": "SOme title", + "description": "SOme big description", + "slug": "some-title", + "application_id": "000000000000000000000003", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "87.0.4280.88" + }, + "os": { + "name": "macOS", + "version": "10.15.6", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5d1363adf599d850df93175e", + "createdAt": "2020-12-14T09:17:39.953Z", + "updatedAt": "2021-01-28T18:48:07.717Z", + "__v": 0 + }, + "key": "some-title", + "display": "SOme title" + }, + "ticket_id": "43", + "createdAt": "2021-01-28T17:25:25.013Z", + "updatedAt": "2021-01-28T17:25:33.396Z", + "__v": 0, + "video_room_id": "6012f38557751ee8fc162cf7" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createHistory +Create history for specific company level ticket + + + + +```swift +client.lead.createHistory(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Ticket ID for which history is created | +| body | TicketHistoryPayload | yes | Request body | + + +Create history for specific company level ticket, this history is seen on ticket detail page, this can be comment, log or rating. + +*Returned Response:* + + + + +[TicketHistory](#TicketHistory) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "_id": "601a9d52c26687d086c499ef", + "ticket_id": "43", + "type": "comment", + "value": { + "text": "d", + "media": [] + }, + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.96" + }, + "os": { + "name": "macOS", + "version": "10.15.7", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5d1363adf599d850df93175e", + "createdAt": "2021-02-03T12:55:46.808Z", + "updatedAt": "2021-02-03T12:55:46.808Z", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getTicketHistory +Gets history list for specific company level ticket + + + + +```swift +client.lead.getTicketHistory(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Ticket ID for which history is to be fetched | + + + +Gets history list for specific company level ticket, this history is seen on ticket detail page, this can be comment, log or rating. + +*Returned Response:* + + + + +[TicketHistoryList](#TicketHistoryList) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "docs": [ + { + "_id": "602e5384204225eed5cadae7", + "ticket_id": "41", + "type": "comment", + "value": { + "text": "hello service", + "media": [] + }, + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.150" + }, + "os": { + "name": "macOS", + "version": "11.2.0" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": { + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://hdn-1.fynd.com/company/884/applications/000000000000000000000001/theme/pictures/free/original/default-profile_nxhzui.png", + "hasOldPasswordHash": false, + "_id": "5f8147abbd1a0a870f61f1a6", + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "8412805281", + "countryCode": 91 + } + ], + "firstName": "Satyen", + "lastName": "Maurya", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "satyenmaurya95@gmail.com" + } + ], + "username": "satyenmaurya95_gmail_com_11118", + "createdAt": "2020-10-10T05:33:31.119Z", + "updatedAt": "2020-10-10T05:33:31.119Z", + "uid": "5678", + "__v": 0 + }, + "createdAt": "2021-02-18T11:46:12.522Z", + "updatedAt": "2021-02-18T11:46:12.522Z", + "__v": 0, + "id": "602e5384204225eed5cadae7" + }, + { + "_id": "60372aa78a046d4d79c46e15", + "ticket_id": "41", + "type": "diff", + "value": { + "status": [ + "pending", + "in_progress" + ] + }, + "created_by": { + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", + "hasOldPasswordHash": false, + "_id": "5e79e721768c6bf54b783146", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "nikhilmanapure@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "nikhilmanapure@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "nikhilmanapure@uniket.store" + } + ], + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "username": "nikhilmanapure_gofynd_com_29298", + "createdAt": "2020-03-24T10:55:29.298Z", + "updatedAt": "2020-05-12T07:46:41.816Z", + "uid": "5567", + "__v": 2 + }, + "createdAt": "2021-02-25T04:42:15.225Z", + "updatedAt": "2021-02-25T04:42:15.225Z", + "__v": 0, + "id": "60372aa78a046d4d79c46e15" + } + ], + "total": 2, + "limit": 100, + "page": 1, + "pages": 1 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getFeedbacks +Gets a list of feedback submitted against that ticket + + + + +```swift +client.lead.getFeedbacks(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Ticket ID for which feedbacks are to be fetched | + + + +Gets a list of feedback submitted against that ticket + +*Returned Response:* + + + + +[TicketFeedbackList](#TicketFeedbackList) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "items": [ + { + "_id": "60c255bf00ecabfad19e9601", + "company_id": "1", + "ticket_id": "6095812876d2bf17143cb3b3", + "user": { + "_id": "5f8147abbd1a0a870f61f1a6", + "authenticated": true, + "user_id": "5f8147abbd1a0a870f61f1a6" + }, + "category": "customers", + "response": { + "audio": 2, + "video": 6 + }, + "createdAt": "2021-06-10T18:11:11.349Z", + "updatedAt": "2021-06-10T18:11:11.349Z", + "__v": 0 + } + ] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### submitFeedback +Submit a response for feeback form against that ticket + + + + +```swift +client.lead.submitFeedback(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Ticket ID for which feedback is to be submitted | +| body | TicketFeedbackPayload | yes | Request body | + + +Submit a response for feeback form against that ticket + +*Returned Response:* + + + + +[TicketFeedback](#TicketFeedback) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "_id": "60c255bf00ecabfad19e9601", + "company_id": "1", + "ticket_id": "6095812876d2bf17143cb3b3", + "user": { + "_id": "5f8147abbd1a0a870f61f1a6", + "authenticated": true, + "user_id": "5f8147abbd1a0a870f61f1a6" + }, + "category": "customers", + "response": { + "audio": 2, + "video": 6 + }, + "createdAt": "2021-06-10T18:11:11.349Z", + "updatedAt": "2021-06-10T18:11:11.349Z", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createHistory +Create history for specific application level ticket + + + + +```swift +client.application("").lead.createHistory(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Ticket ID for which history is created | +| body | TicketHistoryPayload | yes | Request body | + + +Create history for specific application level ticket, this history is seen on ticket detail page, this can be comment, log or rating. + +*Returned Response:* + + + + +[TicketHistory](#TicketHistory) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "_id": "601a9d52c26687d086c499ef", + "ticket_id": "41", + "type": "comment", + "value": { + "text": "d", + "media": [] + }, + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.96" + }, + "os": { + "name": "macOS", + "version": "10.15.7", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5d1363adf599d850df93175e", + "createdAt": "2021-02-03T12:55:46.808Z", + "updatedAt": "2021-02-03T12:55:46.808Z", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getTicketHistory +Gets history list for specific application level ticket + + + + +```swift +client.application("").lead.getTicketHistory(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Ticket ID for which history is to be fetched | + + + +Gets history list for specific application level ticket, this history is seen on ticket detail page, this can be comment, log or rating. + +*Returned Response:* + + + + +[TicketHistoryList](#TicketHistoryList) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "docs": [ + { + "_id": "602e5384204225eed5cadae7", + "ticket_id": "41", + "type": "comment", + "value": { + "text": "hello service", + "media": [] + }, + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.150" + }, + "os": { + "name": "macOS", + "version": "11.2.0" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": { + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://hdn-1.fynd.com/company/884/applications/000000000000000000000001/theme/pictures/free/original/default-profile_nxhzui.png", + "hasOldPasswordHash": false, + "_id": "5f8147abbd1a0a870f61f1a6", + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "8412805281", + "countryCode": 91 + } + ], + "firstName": "Satyen", + "lastName": "Maurya", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "satyenmaurya95@gmail.com" + } + ], + "username": "satyenmaurya95_gmail_com_11118", + "createdAt": "2020-10-10T05:33:31.119Z", + "updatedAt": "2020-10-10T05:33:31.119Z", + "uid": "5678", + "__v": 0 + }, + "createdAt": "2021-02-18T11:46:12.522Z", + "updatedAt": "2021-02-18T11:46:12.522Z", + "__v": 0, + "id": "602e5384204225eed5cadae7" + }, + { + "_id": "60372aa78a046d4d79c46e15", + "ticket_id": "41", + "type": "diff", + "value": { + "status": [ + "pending", + "in_progress" + ] + }, + "created_by": { + "gender": "male", + "accountType": "user", + "active": true, + "profilePicUrl": "https://d2co8r51m5ca2d.cloudfront.net/inapp_banners/default_profile_img.png", + "hasOldPasswordHash": false, + "_id": "5e79e721768c6bf54b783146", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "nikhilmshchs@gmail.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "nikhilmanapure@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "nikhilmanapure@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "nikhilmanapure@uniket.store" + } + ], + "phoneNumbers": [ + { + "active": true, + "primary": true, + "verified": true, + "countryCode": 91, + "phone": "9890425946" + } + ], + "firstName": "Nikhil", + "lastName": "Manapure", + "username": "nikhilmanapure_gofynd_com_29298", + "createdAt": "2020-03-24T10:55:29.298Z", + "updatedAt": "2020-05-12T07:46:41.816Z", + "uid": "5567", + "__v": 2 + }, + "createdAt": "2021-02-25T04:42:15.225Z", + "updatedAt": "2021-02-25T04:42:15.225Z", + "__v": 0, + "id": "60372aa78a046d4d79c46e15" + } + ], + "total": 2, + "limit": 100, + "page": 1, + "pages": 1 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getCustomForm +Get specific custom form using it's slug + + + + +```swift +client.application("").lead.getCustomForm(slug: slug) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | Slug of form whose response is getting submitted | + + + +Get specific custom form using it's slug, this is used to view the form. + +*Returned Response:* + + + + +[CustomForm](#CustomForm) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "login_required": false, + "should_notify": false, + "inputs": [ + { + "required": false, + "type": "text", + "display": "Name", + "placeholder": "Please enter your name", + "key": "name" + } + ], + "available_assignees": [], + "_id": "5fd258a9088f957f34c288fc", + "title": "trail form", + "description": "Trail form description", + "slug": "trail-form", + "application_id": "000000000000000000000003", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "87.0.4280.88" + }, + "os": { + "name": "macOS", + "version": "10.15.6", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5d1363adf599d850df93175e", + "createdAt": "2020-12-10T17:19:37.515Z", + "updatedAt": "2020-12-10T17:19:43.214Z", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### editCustomForm +Edit the given custom form + + + + +```swift +client.application("").lead.editCustomForm(slug: slug, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| slug | String | yes | Slug of form whose response is getting submitted | +| body | EditCustomFormPayload | yes | Request body | + + +Edit the given custom form field such as adding or deleting input, assignee, title, decription, notification and polling information. + +*Returned Response:* + + + + +[CustomForm](#CustomForm) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "login_required": false, + "should_notify": false, + "inputs": [ + { + "type": "email", + "showRegexInput": true, + "enum": [], + "regex": "\\S+@\\S+\\.\\S+", + "display": "email", + "required": true, + "key": "email" + }, + { + "type": "number", + "showRegexInput": false, + "enum": [], + "display": "Enter your fav number", + "placeholder": "123", + "key": "enter-your-fav-number" + } + ], + "available_assignees": [], + "_id": "602e900a2042255c03cadaf0", + "title": "service-test-satyen", + "description": "testing form from service", + "slug": "service-test-satyen", + "header_image": "https://hdn-1.addsale.com/x0/support-ticket/files/free/original/KZL86aN5l-service-test-satyen.jpeg", + "application_id": "000000000000000000000001", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.150" + }, + "os": { + "name": "macOS", + "version": "11.2.0" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5f8147abbd1a0a870f61f1a6", + "createdAt": "2021-02-18T16:04:26.495Z", + "updatedAt": "2021-02-26T10:16:49.272Z", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getCustomForms +Get list of custom form + + + + +```swift +client.application("").lead.getCustomForms() { (response, error) in + // Use response +} +``` + + + + + + +Get list of custom form for given application + +*Returned Response:* + + + + +[CustomFormList](#CustomFormList) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "docs": [ + { + "_id": "602e900a2042255c03cadaf0", + "login_required": false, + "should_notify": false, + "inputs": [ + { + "type": "email", + "showRegexInput": true, + "enum": [], + "regex": "\\S+@\\S+\\.\\S+", + "display": "email", + "required": true, + "key": "email" + }, + { + "type": "number", + "showRegexInput": false, + "enum": [], + "display": "Enter your fav number", + "placeholder": "123", + "key": "enter-your-fav-number" + }, + { + "type": "textarea", + "showRegexInput": false, + "enum": [], + "display": "kjhgjhvjb", + "required": true, + "key": "kjhgjhvjb" + } + ], + "available_assignees": [], + "title": "service-test-satyen", + "description": "testing form from service", + "slug": "service-test-satyen", + "header_image": "https://hdn-1.addsale.com/x0/support-ticket/files/free/original/KZL86aN5l-service-test-satyen.jpeg", + "application_id": "000000000000000000000001", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.150" + }, + "os": { + "name": "macOS", + "version": "11.2.0" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5f8147abbd1a0a870f61f1a6", + "createdAt": "2021-02-18T16:04:26.495Z", + "updatedAt": "2021-02-24T15:49:56.256Z", + "__v": 0, + "id": "602e900a2042255c03cadaf0" + }, + { + "_id": "60124e4a4d2bc363625e1bf4", + "login_required": false, + "should_notify": true, + "inputs": [ + { + "type": "text", + "showRegexInput": false, + "enum": [], + "display": "asdf", + "key": "asdf" + }, + { + "type": "mobile", + "showRegexInput": false, + "enum": [], + "display": "mob num", + "regex": "[0-9]{10}$", + "key": "mob-num" + } + ], + "available_assignees": [ + "5e79e721768c6bf54b783146" + ], + "title": "asdf444", + "description": "adf", + "slug": "asdf444", + "application_id": "000000000000000000000001", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.96" + }, + "os": { + "name": "macOS", + "version": "10.15.7", + "versionName": "Catalina" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5e79e721768c6bf54b783146", + "createdAt": "2021-01-28T05:40:26.271Z", + "updatedAt": "2021-02-18T16:02:32.086Z", + "__v": 0, + "poll_for_assignment": { + "duration": 20, + "message": "We are looking for executive to connect you", + "success_message": "Executive found", + "failure_message": "All our executives are busy at the moment, We have accepted your request and someone will connect with you soon!" + }, + "id": "60124e4a4d2bc363625e1bf4" + } + ], + "total": 2, + "limit": 10, + "page": 1, + "pages": 1 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createCustomForm +Creates a new custom form + + + + +```swift +client.application("").lead.createCustomForm(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CreateCustomFormPayload | yes | Request body | + + +Creates a new custom form for given application + +*Returned Response:* + + + + +[CustomForm](#CustomForm) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "login_required": false, + "should_notify": false, + "inputs": [ + { + "type": "email", + "showRegexInput": true, + "enum": [], + "regex": "\\S+@\\S+\\.\\S+", + "display": "email", + "required": true, + "key": "email" + }, + { + "type": "number", + "showRegexInput": false, + "enum": [], + "display": "Enter your fav number", + "placeholder": "123", + "key": "enter-your-fav-number" + } + ], + "available_assignees": [], + "_id": "602e900a2042255c03cadaf0", + "title": "service-test-satyen", + "description": "testing form from service", + "slug": "service-test-satyen", + "header_image": "https://hdn-1.addsale.com/x0/support-ticket/files/free/original/KZL86aN5l-service-test-satyen.jpeg", + "application_id": "000000000000000000000001", + "created_on": { + "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36", + "platform": "web", + "meta": { + "browser": { + "name": "Chrome", + "version": "88.0.4324.150" + }, + "os": { + "name": "macOS", + "version": "11.2.0" + }, + "platform": { + "type": "desktop", + "vendor": "Apple" + }, + "engine": { + "name": "Blink" + } + } + }, + "created_by": "5f8147abbd1a0a870f61f1a6", + "createdAt": "2021-02-18T16:04:26.495Z", + "updatedAt": "2021-02-26T10:16:49.272Z", + "__v": 0 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getTokenForVideoRoom +Get Token to join a specific Video Room using it's unqiue name + + + + +```swift +client.lead.getTokenForVideoRoom(uniqueName: uniqueName) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| uniqueName | String | yes | Unique name of video room | + + + +Get Token to join a specific Video Room using it's unqiue name, this Token is your ticket to Room and also creates your identity there. + +*Returned Response:* + + + + +[GetTokenForVideoRoomResponse](#GetTokenForVideoRoomResponse) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "access_token": "your_token_to_the_room" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getTokenForVideoRoom +Get Token to join a specific Video Room using it's unqiue name + + + + +```swift +client.application("").lead.getTokenForVideoRoom(uniqueName: uniqueName) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| uniqueName | String | yes | Unique name of video room | + + + +Get Token to join a specific Video Room using it's unqiue name, this Token is your ticket to Room and also creates your identity there. + +*Returned Response:* + + + + +[GetTokenForVideoRoomResponse](#GetTokenForVideoRoomResponse) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "access_token": "your_token_to_the_room" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getVideoParticipants +Get participants of a specific Video Room using it's unique name + + + + +```swift +client.lead.getVideoParticipants(uniqueName: uniqueName) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| uniqueName | String | yes | Unique name of Video Room | + + + +Get participants of a specific Video Room using it's unique name, this can be used to check if people are already there in the room and also to show their names. + +*Returned Response:* + + + + +[GetParticipantsInsideVideoRoomResponse](#GetParticipantsInsideVideoRoomResponse) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "participants": [] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getVideoParticipants +Get participants of a specific Video Room using it's unique name + + + + +```swift +client.application("").lead.getVideoParticipants(uniqueName: uniqueName) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| uniqueName | String | yes | Unique name of Video Room | + + + +Get participants of a specific Video Room using it's unique name, this can be used to check if people are already there in the room and also to show their names. + +*Returned Response:* + + + + +[GetParticipantsInsideVideoRoomResponse](#GetParticipantsInsideVideoRoomResponse) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "participants": [] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### openVideoRoom +Open a video room. + + + + +```swift +client.application("").lead.openVideoRoom(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CreateVideoRoomPayload | yes | Request body | + + +Open a video room. + +*Returned Response:* + + + + +[CreateVideoRoomResponse](#CreateVideoRoomResponse) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "unique_name": "alphanumeric123" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### closeVideoRoom +Close the video room and force all participants to leave. + + + + +```swift +client.application("").lead.closeVideoRoom(uniqueName: uniqueName) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| uniqueName | String | yes | Unique name of Video Room | + + + +Close the video room and force all participants to leave. + +*Returned Response:* + + + + +[CloseVideoRoomResponse](#CloseVideoRoomResponse) + +Success + + + + +
    +  Examples: + + +
    +  Default + +```json +{ + "value": { + "success": true + } +} +``` +
    + +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [TicketList](#TicketList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Ticket](#Ticket)]? | yes | List of tickets | + | filters | [Filter](#Filter)? | yes | All the filters available for tickets | + | page | [Page](#Page)? | yes | Describes the pagination state | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + | hasNext | Bool? | yes | | + | current | Int? | yes | | + | type | String | no | | + | size | Int? | yes | | + +--- + + + + + #### [TicketHistoryList](#TicketHistoryList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[TicketHistory](#TicketHistory)]? | yes | List of ticket history | + | page | [Page](#Page)? | yes | Describes the pagination state | + +--- + + + + + #### [CustomFormList](#CustomFormList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[CustomForm](#CustomForm)]? | yes | List of forms | + | page | [Page](#Page)? | yes | Describes the pagination state | + +--- + + + + + #### [CreateCustomFormPayload](#CreateCustomFormPayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | slug | String | no | Slug for the form | + | title | String | no | Title for the form | + | inputs | [[String: Any]] | no | List of all the form components | + | description | String? | yes | Description of the form | + | headerImage | String? | yes | Header image that is to be shown for the form | + | priority | [PriorityEnum](#PriorityEnum) | no | Describes the priority of the tickets created by the form | + | shouldNotify | Bool? | yes | Indicates if staff should be notified when a response is received | + | successMessage | String? | yes | Success message that will be shown on submission | + | pollForAssignment | [PollForAssignment](#PollForAssignment)? | yes | Describes how polling will be done for the tickets createds | + +--- + + + + + #### [EditCustomFormPayload](#EditCustomFormPayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String | no | Title for the form | + | inputs | [[String: Any]] | no | List of all the form components | + | description | String? | yes | Description of the form | + | priority | [PriorityEnum](#PriorityEnum) | no | Describes the priority of the tickets created by the form | + | headerImage | String? | yes | Header image that is to be shown for the form | + | shouldNotify | Bool? | yes | Indicates if staff should be notified when a response is received | + | loginRequired | Bool? | yes | Denotes if login is required to make a form response submission | + | successMessage | String? | yes | Success message that will be shown on submission | + | pollForAssignment | [PollForAssignment](#PollForAssignment)? | yes | Describes how polling will be done for the tickets createds | + +--- + + + + + #### [EditTicketPayload](#EditTicketPayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | content | [TicketContent](#TicketContent)? | yes | Ticket conetent details | + | category | String? | yes | Category assigned to the ticket | + | subCategory | String? | yes | Sub-category assigned to the ticket | + | source | String? | yes | Denotes if the ticket was created at company or application level | + | status | String? | yes | Denotes in what state is the ticket | + | priority | [PriorityEnum](#PriorityEnum)? | yes | Denotes the priority of ticket | + | assignedTo | [AgentChangePayload](#AgentChangePayload)? | yes | Details of support staff to whom ticket is assigned | + | tags | [String]? | yes | Tags relevant to ticket | + +--- + + + + + #### [AgentChangePayload](#AgentChangePayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | agentId | String | no | Agent's unique ID | + +--- + + + + + #### [CreateVideoRoomResponse](#CreateVideoRoomResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uniqueName | String | no | Video Room's unique name | + +--- + + + + + #### [CloseVideoRoomResponse](#CloseVideoRoomResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Denotes if operation was successfully | + +--- + + + + + #### [CreateVideoRoomPayload](#CreateVideoRoomPayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uniqueName | String | no | Ticket id | + | notify | [[NotifyUser](#NotifyUser)]? | yes | List of people to be notified | + +--- + + + + + #### [NotifyUser](#NotifyUser) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | countryCode | String | no | Country code | + | phoneNumber | String | no | Phone number | + +--- + + + + + #### [Filter](#Filter) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | priorities | [[Priority](#Priority)] | no | List of possible priorities for tickets | + | categories | [[TicketCategory](#TicketCategory)]? | yes | List of possible categories for tickets | + | statuses | [[Status](#Status)] | no | List of possible statuses for tickets | + | assignees | [[String: Any]] | no | List of support staff availble for tickets assignment | + +--- + + + + + #### [TicketHistoryPayload](#TicketHistoryPayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | value | [String: Any] | no | Details of history event | + | type | [HistoryTypeEnum](#HistoryTypeEnum) | no | Type of history event | + +--- + + + + + #### [CustomFormSubmissionPayload](#CustomFormSubmissionPayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | response | [[String: Any]] | no | Form response | + | attachments | [[TicketAsset](#TicketAsset)]? | yes | List of all attachments related to the form | + +--- + + + + + #### [GetTokenForVideoRoomResponse](#GetTokenForVideoRoomResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | accessToken | String | no | Access token to be used for video room | + +--- + + + + + #### [GetParticipantsInsideVideoRoomResponse](#GetParticipantsInsideVideoRoomResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | participants | [[Participant](#Participant)] | no | List of participants of the video room | + +--- + + + + + #### [Participant](#Participant) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [UserSchema](#UserSchema)? | yes | Details of participant | + | identity | String? | yes | Unique identifier of participant | + | status | String? | yes | Status of participant | + +--- + + + + + #### [UserSchema](#UserSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | firstName | String? | yes | First name | + | lastName | String? | yes | Last name | + | phoneNumbers | [[PhoneNumber](#PhoneNumber)]? | yes | List of phone numbers | + | emails | [[Email](#Email)]? | yes | List of email addresses | + | gender | String? | yes | Gender of user | + | active | Bool? | yes | Is account active | + | profilePicUrl | String? | yes | URL for profile pic | + | username | String? | yes | username of user | + | accountType | String? | yes | Type of account | + | uid | String? | yes | Unique identifier of user | + | debug | [Debug](#Debug)? | yes | Used for debugging | + | hasOldPasswordHash | Bool? | yes | Denotes if user has old password hash | + | id | String? | yes | Unique identifier of user | + | createdAt | String? | yes | Time of user creation | + | updatedAt | String? | yes | Last time of user details update | + +--- + + + + + #### [PhoneNumber](#PhoneNumber) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | Denotes if the phone number is active | + | primary | Bool? | yes | Denotes it's the primary phone number for the account | + | verified | Bool? | yes | Denotes it's a verified phone number | + | phone | String? | yes | Phone number | + | countryCode | Int? | yes | Country code | + +--- + + + + + #### [Email](#Email) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | primary | Bool? | yes | Denotes it's the primary email for the account | + | verified | Bool? | yes | Denotes it's a verified email | + | email | String? | yes | Email Address | + | active | Bool? | yes | Denotes if the email is active | + +--- + + + + + #### [Debug](#Debug) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | source | String? | yes | Source of user | + | platform | String? | yes | Platform of user | + +--- + + + + + #### [SubmitCustomFormResponse](#SubmitCustomFormResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | ticket | [Ticket](#Ticket) | no | Ticket created on form submission | + +--- + + + + + #### [TicketContext](#TicketContext) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | applicationId | String? | yes | Application ID related to the ticket | + | companyId | String | no | Company ID related to the ticket | + +--- + + + + + #### [CreatedOn](#CreatedOn) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | userAgent | String | no | Useragent details | + +--- + + + + + #### [TicketAsset](#TicketAsset) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | display | String? | yes | Display text for asset | + | value | String | no | To be used for details | + | type | [TicketAssetTypeEnum](#TicketAssetTypeEnum) | no | Type of asset | + +--- + + + + + #### [TicketContent](#TicketContent) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String | no | Title for ticket | + | description | String? | yes | Long description of issue | + | attachments | [[TicketAsset](#TicketAsset)]? | yes | List of all attachments related to the ticket | + +--- + + + + + #### [AddTicketPayload](#AddTicketPayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | createdBy | [String: Any]? | yes | Creator of the ticket | + | status | String? | yes | Status of the ticket | + | priority | [PriorityEnum](#PriorityEnum)? | yes | Priority of the ticket | + | category | String | no | Category of the ticket | + | content | [TicketContent](#TicketContent) | no | Content for the ticket | + +--- + + + + + #### [Priority](#Priority) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | [PriorityEnum](#PriorityEnum) | no | Key for priority | + | display | String | no | Display text for priority | + | color | String | no | Color for priority | + +--- + + + + + #### [Status](#Status) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String | no | Key for status | + | display | String | no | Display text for status | + | color | String | no | Color for status | + +--- + + + + + #### [TicketCategory](#TicketCategory) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String | no | Key for category | + | display | String | no | Display text for category | + | form | [CustomForm](#CustomForm)? | yes | Form related to the category | + | subCategories | [[TicketSubCategory](#TicketSubCategory)]? | yes | Sub-category related to the category | + | feedbackForm | [TicketFeedbackForm](#TicketFeedbackForm)? | yes | Feedback form of category used to submit ticket feedback | + +--- + + + + + #### [TicketSubCategory](#TicketSubCategory) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | key | String | no | Key for sub-category | + | display | String | no | Display text for sub-category | + +--- + + + + + #### [TicketFeedbackForm](#TicketFeedbackForm) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String | no | Feedback form title that will be shown to the user | + | display | [[String: Any]]? | yes | List of all the form fields | + +--- + + + + + #### [TicketFeedbackList](#TicketFeedbackList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[TicketFeedback](#TicketFeedback)]? | yes | List of all ticket feedback for the ticket | + +--- + + + + + #### [TicketFeedbackPayload](#TicketFeedbackPayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | formResponse | [String: Any]? | yes | Key-value pairs of all the form fields and their response | + +--- + + + + + #### [SubmitButton](#SubmitButton) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String | no | Title for submit button | + | titleColor | String | no | Title color submit button | + | backgroundColor | String | no | Color for submit button | + +--- + + + + + #### [PollForAssignment](#PollForAssignment) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | duration | Double | no | Duration for polling of staff | + | message | String | no | Message for polling | + | successMessage | String | no | Message for successful polling | + | failureMessage | String | no | Message if polling failed | + +--- + + + + + #### [CustomForm](#CustomForm) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | applicationId | String | no | Application ID for form | + | slug | String | no | Slug for the form, which is to be used for accessing the form | + | headerImage | String? | yes | Form header image that will be shown to the user | + | title | String | no | Form title that will be shown to the user | + | description | String? | yes | Form description that will be shown to the user | + | priority | [Priority](#Priority) | no | Sets priority of tickets created by form response | + | loginRequired | Bool | no | Denotes if login is required to make a form response submission | + | shouldNotify | Bool | no | Denotes if new response submission for the form should be notified to the assignees | + | successMessage | String? | yes | Message that is to be shown on succesfull form response submission | + | submitButton | [SubmitButton](#SubmitButton)? | yes | Details for submit button | + | inputs | [[String: Any]] | no | List of all the form fields | + | createdOn | [CreatedOn](#CreatedOn)? | yes | Gives details of when the form was created | + | createdBy | [String: Any]? | yes | Gives details of user who created the form | + | pollForAssignment | [PollForAssignment](#PollForAssignment)? | yes | Details of how polling should be done for support | + | id | String | no | Unique identifier for the form | + +--- + + + + + #### [FeedbackResponseItem](#FeedbackResponseItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | display | String | no | Question/Title of the form field | + | key | String | no | Key of the form field | + | value | String | no | User response value for the form field | + +--- + + + + + #### [TicketFeedback](#TicketFeedback) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String | no | Unique identifier for the feedback | + | ticketId | String | no | Readable ticket number | + | companyId | String | no | Company id for which ticket was raised | + | response | [[FeedbackResponseItem](#FeedbackResponseItem)] | no | | + | category | String? | yes | Category of the ticket | + | user | [String: Any]? | yes | User who submitted the feedback | + | updatedAt | String? | yes | Time when the feedback was last updated | + | createdAt | String? | yes | Time when the feedback was created | + +--- + + + + + #### [TicketHistory](#TicketHistory) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String | no | Type of the history event | + | value | [String: Any] | no | Data of the history event | + | ticketId | String | no | Readable ticket number | + | createdOn | [CreatedOn](#CreatedOn)? | yes | Time of creation of the history event | + | createdBy | [String: Any]? | yes | User who created the history event | + | id | String | no | Unique identifier of the history event | + | updatedAt | String? | yes | Time of last update of the history event | + | createdAt | String? | yes | Time of creation of the history event | + +--- + + + + + #### [Ticket](#Ticket) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | context | [TicketContext](#TicketContext)? | yes | Details of company and application realated to the ticket | + | createdOn | [CreatedOn](#CreatedOn)? | yes | Details of company and application realated to the ticket | + | responseId | String? | yes | Details of company and application realated to the ticket | + | content | [TicketContent](#TicketContent)? | yes | Ticket conetent details | + | ticketId | String | no | Readable ticket number | + | category | [TicketCategory](#TicketCategory) | no | Category assigned to the ticket | + | subCategory | [TicketSubCategory](#TicketSubCategory)? | yes | Sub-category assigned to the ticket | + | source | [TicketSourceEnum](#TicketSourceEnum) | no | Denotes if the ticket was created at company or application level | + | status | [Status](#Status) | no | Denotes in what state is the ticket | + | priority | [Priority](#Priority) | no | Denotes the priority of ticket | + | createdBy | [String: Any]? | yes | User details of ticket creator | + | assignedTo | [String: Any]? | yes | Details of support staff to whom ticket is assigned | + | tags | [String]? | yes | Tags relevant to ticket | + | customJson | [String: Any]? | yes | custom json relevant to the ticket | + | isFeedbackPending | Bool? | yes | Denotes if feedback submission is pending for the ticket | + | id | String | no | Unique identifier for the ticket | + | updatedAt | String? | yes | Time when the ticket was last updated | + | createdAt | String? | yes | Time when the ticket was created | + +--- + + + + +### Enums + + + + + + #### [PriorityEnum](#PriorityEnum) + Type : string + + | Name | Value | Description | + | ---- | ----- | ----------- | + | low | low | This means ticket is low priority | + | medium | medium | This means ticket is medium priority | + | high | high | This means ticket is high priority | + | urgent | urgent | This means ticket is of urgent priority | + +--- + + + + #### [HistoryTypeEnum](#HistoryTypeEnum) + Type : string + + | Name | Value | Description | + | ---- | ----- | ----------- | + | rating | rating | This means history event is a rating | + | log | log | This means history event is a changelog | + | comment | comment | This means history event is a comment | + +--- + + + + #### [TicketAssetTypeEnum](#TicketAssetTypeEnum) + Type : string + + | Name | Value | Description | + | ---- | ----- | ----------- | + | image | image | Denotes asset is of image type | + | video | video | Denotes asset is of video type | + | file | file | Denotes asset is of file type | + | youtube | youtube | Denotes asset is an youtube link | + | product | product | Denotes asset is of product type | + | collection | collection | Denotes asset is of collection type | + | brand | brand | Denotes asset is of brand type | + | shipment | shipment | Denotes asset is of shipment type | + | order | order | Denotes asset is of order type | + +--- + + + + #### [TicketSourceEnum](#TicketSourceEnum) + Type : string + + | Name | Value | Description | + | ---- | ----- | ----------- | + | platformPanel | platform_panel | This means it is company level ticket | + | salesChannel | sales_channel | This means it is a application/sales channel level ticket | + +--- + + + + + diff --git a/documentation/platform/ORDER.md b/documentation/platform/ORDER.md new file mode 100644 index 0000000000..a7da8973bf --- /dev/null +++ b/documentation/platform/ORDER.md @@ -0,0 +1,3792 @@ + + + + +##### [Back to Platform docs](./README.md) + +## Order Methods +Handles Platform websites OMS +* [shipmentStatusUpdate](#shipmentstatusupdate) +* [activityStatus](#activitystatus) +* [storeProcessShipmentUpdate](#storeprocessshipmentupdate) +* [checkRefund](#checkrefund) +* [shipmentBagsCanBreak](#shipmentbagscanbreak) +* [getOrdersByCompanyId](#getordersbycompanyid) +* [getOrderLanesCountByCompanyId](#getorderlanescountbycompanyid) +* [getOrderDetails](#getorderdetails) +* [getOrderDetails](#getorderdetails) +* [getPicklistOrdersByCompanyId](#getpicklistordersbycompanyid) +* [trackShipmentPlatform](#trackshipmentplatform) +* [trackOrder](#trackorder) +* [failedOrders](#failedorders) +* [reprocessOrder](#reprocessorder) +* [updateShipment](#updateshipment) +* [getPlatformShipmentReasons](#getplatformshipmentreasons) +* [getShipmentTrackDetails](#getshipmenttrackdetails) +* [getShipmentAddress](#getshipmentaddress) +* [updateShipmentAddress](#updateshipmentaddress) +* [getOrdersByApplicationId](#getordersbyapplicationid) +* [getPing](#getping) +* [voiceCallback](#voicecallback) +* [voiceClickToCall](#voiceclicktocall) + + + +## Methods with example and description + + +#### shipmentStatusUpdate +Update status of Shipment + + + + +```swift +client.order.shipmentStatusUpdate(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | UpdateShipmentStatusBody | yes | Request body | + + +Update Shipment Status + +*Returned Response:* + + + + +[UpdateShipmentStatusResponse](#UpdateShipmentStatusResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### activityStatus +Get Activity Status + + + + +```swift +client.order.activityStatus(bagId: bagId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| bagId | String | yes | Bag Id | + + + +Get Activity Status + +*Returned Response:* + + + + +[GetActivityStatus](#GetActivityStatus) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### storeProcessShipmentUpdate +Update Store Process-Shipment + + + + +```swift +client.order.storeProcessShipmentUpdate(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | UpdateProcessShipmenstRequestBody | yes | Request body | + + +Update Store Process-Shipment + +*Returned Response:* + + + + +[UpdateProcessShipmenstRequestResponse](#UpdateProcessShipmenstRequestResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### checkRefund +Check Refund is available or not + + + + +```swift +client.order.checkRefund(shipmentId: shipmentId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| shipmentId | String | yes | Shipment Id | + + + +Check Refund is available or not + +*Returned Response:* + + + + +[[String: Any]](#[String: Any]) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### shipmentBagsCanBreak +Decides if Shipment bags can break + + + + +```swift +client.order.shipmentBagsCanBreak(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CanBreakRequestBody | yes | Request body | + + +Decides if Shipment bags can break + +*Returned Response:* + + + + +[CanBreakResponse](#CanBreakResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getOrdersByCompanyId +Get Orders for company based on Company Id + + + + +```swift +client.order.getOrdersByCompanyId(pageNo: pageNo, pageSize: pageSize, fromDate: fromDate, toDate: toDate, isPrioritySort: isPrioritySort, lockStatus: lockStatus, q: q, stage: stage, salesChannels: salesChannels, orderId: orderId, stores: stores, deploymentStores: deploymentStores, status: status, dp: dp, shortenUrls: shortenUrls, filterType: filterType) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | String? | no | Current page number | +| pageSize | String? | no | Page limit | +| fromDate | String? | no | From Date | +| toDate | String? | no | To Date | +| isPrioritySort | Bool? | no | Sorting Order | +| lockStatus | Bool? | no | Hide Lock Status | +| q | String? | no | Keyword for Search | +| stage | String? | no | Specefic Order Stage | +| salesChannels | String? | no | Selected Sales Channel | +| orderId | String? | no | Order Id | +| stores | String? | no | Selected Stores | +| deploymentStores | String? | no | Selected Deployment Stores | +| status | String? | no | Status of order | +| dp | String? | no | Delivery Partners | +| shortenUrls | Bool? | no | Shorten URL option | +| filterType | String? | no | Filters | + + + +Get Orders + +*Returned Response:* + + + + +[OrderListing](#OrderListing) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getOrderLanesCountByCompanyId +Get Order Lanes Count for company based on Company Id + + + + +```swift +client.order.getOrderLanesCountByCompanyId(pageNo: pageNo, pageSize: pageSize, fromDate: fromDate, toDate: toDate, q: q, stage: stage, salesChannels: salesChannels, orderId: orderId, stores: stores, status: status, shortenUrls: shortenUrls, filterType: filterType) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | String? | no | Current page number | +| pageSize | String? | no | Page limit | +| fromDate | String? | no | From Date | +| toDate | String? | no | To Date | +| q | String? | no | Keyword for Search | +| stage | String? | no | Specefic Order Stage | +| salesChannels | String? | no | Selected Sales Channel | +| orderId | String? | no | Order Id | +| stores | String? | no | Selected Stores | +| status | String? | no | Status of order | +| shortenUrls | Bool? | no | Shorten URL option | +| filterType | String? | no | Filters | + + + +Get Orders Seperate Lane Count + +*Returned Response:* + + + + +[OrderLanesCount](#OrderLanesCount) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getOrderDetails +Get Order Details for company based on Company Id and Order Id + + + + +```swift +client.order.getOrderDetails(orderId: orderId, next: next, previous: previous) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| orderId | String? | no | Order Id | +| next | String? | no | Next | +| previous | String? | no | Previous | + + + +Get Orders + +*Returned Response:* + + + + +[OrderDetails](#OrderDetails) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getOrderDetails +Get Order Details for company based on Company Id and Order Id + + + + +```swift +client.application("").order.getOrderDetails(orderId: orderId, next: next, previous: previous) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| orderId | String? | no | Order Id | +| next | String? | no | Next | +| previous | String? | no | Previous | + + + +Get Orders + +*Returned Response:* + + + + +[OrderDetails](#OrderDetails) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getPicklistOrdersByCompanyId +Get Orders for company based on Company Id + + + + +```swift +client.order.getPicklistOrdersByCompanyId(pageNo: pageNo, pageSize: pageSize, fromDate: fromDate, toDate: toDate, q: q, stage: stage, salesChannels: salesChannels, orderId: orderId, stores: stores, status: status, shortenUrls: shortenUrls, filterType: filterType) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | String? | no | Current page number | +| pageSize | String? | no | Page limit | +| fromDate | String? | no | From Date | +| toDate | String? | no | To Date | +| q | String? | no | Keyword for Search | +| stage | String? | no | Specefic Order Stage | +| salesChannels | String? | no | Selected Sales Channel | +| orderId | String? | no | Order Id | +| stores | String? | no | Selected Stores | +| status | String? | no | Status of order | +| shortenUrls | Bool? | no | Shorten URL option | +| filterType | String? | no | Filters | + + + +Get Orders + +*Returned Response:* + + + + +[OrderPicklistListing](#OrderPicklistListing) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### trackShipmentPlatform +Track Shipment by shipment id, for application based on application Id + + + + +```swift +client.application("").order.trackShipmentPlatform(shipmentId: shipmentId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| shipmentId | String | yes | Shipment Id | + + + +Shipment Track + +*Returned Response:* + + + + +[PlatformShipmentTrack](#PlatformShipmentTrack) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### trackOrder +Track Order by order id, for application based on application Id + + + + +```swift +client.application("").order.trackOrder(orderId: orderId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| orderId | String | yes | Order Id | + + + +Order Track + +*Returned Response:* + + + + +[PlatformOrderTrack](#PlatformOrderTrack) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### failedOrders +Get all failed orders application wise + + + + +```swift +client.application("").order.failedOrders() { (response, error) in + // Use response +} +``` + + + + + + +Failed Orders + +*Returned Response:* + + + + +[FailedOrders](#FailedOrders) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### reprocessOrder +Reprocess order by order id + + + + +```swift +client.application("").order.reprocessOrder(orderId: orderId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| orderId | String | yes | Order Id | + + + +Order Reprocess + +*Returned Response:* + + + + +[UpdateOrderReprocessResponse](#UpdateOrderReprocessResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updateShipment +Use this API to update the shipment using its shipment ID. + + + + +```swift +client.application("").order.updateShipment(shipmentId: shipmentId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | +| body | ShipmentUpdateRequest | yes | Request body | + + +Update the shipment + +*Returned Response:* + + + + +[ShipmentUpdateResponse](#ShipmentUpdateResponse) + +Success. Check the example shown below or refer `ShipmentUpdateRequest` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getPlatformShipmentReasons +Use this API to retrieve the issues that led to the cancellation of bags within a shipment. + + + + +```swift +client.application("").order.getPlatformShipmentReasons(action: action) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| action | String | yes | Action | + + + +Get reasons behind full or partial cancellation of a shipment + +*Returned Response:* + + + + +[ShipmentReasonsResponse](#ShipmentReasonsResponse) + +Success. Check the example shown below or refer `ShipmentReasonsResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getShipmentTrackDetails +Use this API to track a shipment using its shipment ID. + + + + +```swift +client.application("").order.getShipmentTrackDetails(orderId: orderId, shipmentId: shipmentId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| orderId | String | yes | ID of the order. | +| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | + + + +Track shipment + +*Returned Response:* + + + + +[ShipmentTrackResponse](#ShipmentTrackResponse) + +Success. Check the example shown below or refer `ShipmentTrackResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getShipmentAddress +Use this API to get address of a shipment using its shipment ID and Address Category. + + + + +```swift +client.order.getShipmentAddress(shipmentId: shipmentId, addressCategory: addressCategory) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | +| addressCategory | String | yes | Category of the address it falls into(billing or delivery). | + + + +Get Shipment Address + +*Returned Response:* + + + + +[GetShipmentAddressResponse](#GetShipmentAddressResponse) + +Success. Check the example shown below or refer `GetShipmentAddressResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updateShipmentAddress +Use this API to update address of a shipment using its shipment ID and Address Category. + + + + +```swift +client.order.updateShipmentAddress(shipmentId: shipmentId, addressCategory: addressCategory, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| shipmentId | String | yes | ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. | +| addressCategory | String | yes | Category of the address it falls into(billing or delivery). | +| body | UpdateShipmentAddressRequest | yes | Request body | + + +Update Shipment Address + +*Returned Response:* + + + + +[UpdateShipmentAddressResponse](#UpdateShipmentAddressResponse) + +Success. Check the example shown below or refer `UpdateShipmentAddressResponse` for more details. + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getOrdersByApplicationId +Get Orders for company based on Company Id + + + + +```swift +client.application("").order.getOrdersByApplicationId(pageNo: pageNo, pageSize: pageSize, fromDate: fromDate, toDate: toDate, q: q, stage: stage, salesChannels: salesChannels, orderId: orderId, stores: stores, status: status, dp: dp, shortenUrls: shortenUrls, filterType: filterType) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | String? | no | Current page number | +| pageSize | String? | no | Page limit | +| fromDate | String? | no | From Date | +| toDate | String? | no | To Date | +| q | String? | no | Keyword for Search | +| stage | String? | no | Specefic Order Stage | +| salesChannels | String? | no | Selected Sales Channel | +| orderId | String? | no | Order Id | +| stores | String? | no | Selected Stores | +| status | String? | no | Status of order | +| dp | String? | no | Delivery Partners | +| shortenUrls | Bool? | no | Shorten URL option | +| filterType | String? | no | Filters | + + + +Get Orders at Application Level + +*Returned Response:* + + + + +[OrderListing](#OrderListing) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getPing +Get Ping + + + + +```swift +client.order.getPing() { (response, error) in + // Use response +} +``` + + + + + + +Get Ping + +*Returned Response:* + + + + +[GetPingResponse](#GetPingResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### voiceCallback +Get Voice Callback + + + + +```swift +client.order.voiceCallback() { (response, error) in + // Use response +} +``` + + + + + + +Voice Callback + +*Returned Response:* + + + + +[GetVoiceCallbackResponse](#GetVoiceCallbackResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### voiceClickToCall +Get Voice Click to Call + + + + +```swift +client.order.voiceClickToCall(caller: caller, receiver: receiver) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| caller | String | yes | Caller contact number | +| receiver | String | yes | Receiver contact number | + + + +Voice Click to Call + +*Returned Response:* + + + + +[GetClickToCallResponse](#GetClickToCallResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [GetActivityStatus](#GetActivityStatus) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | activityHistory | [ActivityHistory](#ActivityHistory) | no | | + +--- + + + + + #### [ActivityHistory](#ActivityHistory) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | createdat | String? | yes | | + | message | String? | yes | | + | type | String? | yes | | + | user | String? | yes | | + +--- + + + + + #### [CanBreakRequestBody](#CanBreakRequestBody) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | shipmentIds | [String] | no | | + +--- + + + + + #### [CanBreakResponse](#CanBreakResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | status | Bool | no | | + | validActions | [String: Any] | no | | + +--- + + + + + #### [FailedOrders](#FailedOrders) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | orders | [FailOrder](#FailOrder) | no | | + +--- + + + + + #### [FailOrder](#FailOrder) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | updatedAt | String? | yes | | + | id | String? | yes | | + | reason | String? | yes | | + | marketplaceOrder | [MarketplaceOrder](#MarketplaceOrder)? | yes | | + | marketplaceOrderId | String? | yes | | + | createdAt | String? | yes | | + | appId | String? | yes | | + | marketplace | String? | yes | | + | companyId | Int? | yes | | + +--- + + + + + #### [MarketplaceOrder](#MarketplaceOrder) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | orderStatusUrl | String? | yes | | + | adminGraphqlApiId | String? | yes | | + | email | String? | yes | | + | test | Bool? | yes | | + | note | String? | yes | | + | totalPrice | String? | yes | | + | appId | Int? | yes | | + | totalDiscountsSet | [TotalDiscountsSet](#TotalDiscountsSet)? | yes | | + | totalPriceSet | [TotalPriceSet](#TotalPriceSet)? | yes | | + | totalTaxSet | [TotalTaxSet](#TotalTaxSet)? | yes | | + | gateway | String? | yes | | + | name | String? | yes | | + | subtotalPriceSet | [SubtotalPriceSet](#SubtotalPriceSet)? | yes | | + | number | Int? | yes | | + | buyerAcceptsMarketing | Bool? | yes | | + | contactEmail | String? | yes | | + | token | String? | yes | | + | sourceName | String? | yes | | + | paymentGatewayNames | [[String: Any]]? | yes | | + | presentmentCurrency | String? | yes | | + | subtotalPrice | String? | yes | | + | processedAt | String? | yes | | + | orderNumber | Int? | yes | | + | totalTipReceived | String? | yes | | + | id | Int? | yes | | + | confirmed | Bool? | yes | | + | currency | String? | yes | | + | totalLineItemsPrice | String? | yes | | + | lineItems | [LineItems](#LineItems)? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | totalWeight | Int? | yes | | + | billingAddress | [BillingAddress](#BillingAddress)? | yes | | + | totalShippingPriceSet | [TotalShippingPriceSet](#TotalShippingPriceSet)? | yes | | + | customer | [Customer](#Customer)? | yes | | + | totalDiscounts | String? | yes | | + | totalLineItemsPriceSet | [TotalLineItemsPriceSet](#TotalLineItemsPriceSet)? | yes | | + | tags | String? | yes | | + | totalPriceUsd | String? | yes | | + | userId | Int? | yes | | + | totalTax | String? | yes | | + | processingMethod | String? | yes | | + | shippingAddress | [OrderShippingAddress](#OrderShippingAddress)? | yes | | + | taxesIncluded | Bool? | yes | | + | financialStatus | String? | yes | | + +--- + + + + + #### [TotalDiscountsSet](#TotalDiscountsSet) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | presentmentMoney | [PresentmentMoney](#PresentmentMoney)? | yes | | + | shopMoney | [ShopMoney](#ShopMoney)? | yes | | + +--- + + + + + #### [PresentmentMoney](#PresentmentMoney) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amount | String? | yes | | + | currencyCode | String? | yes | | + +--- + + + + + #### [ShopMoney](#ShopMoney) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amount | String? | yes | | + | currencyCode | String? | yes | | + +--- + + + + + #### [TotalPriceSet](#TotalPriceSet) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | shopMoney | [TotalPriceSetShopMoney](#TotalPriceSetShopMoney)? | yes | | + | presentmentMoney | [TotalPriceSetPresentmentMoney](#TotalPriceSetPresentmentMoney)? | yes | | + +--- + + + + + #### [TotalPriceSetShopMoney](#TotalPriceSetShopMoney) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amount | String? | yes | | + | currencyCode | String? | yes | | + +--- + + + + + #### [TotalPriceSetPresentmentMoney](#TotalPriceSetPresentmentMoney) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amount | String? | yes | | + | currencyCode | String? | yes | | + +--- + + + + + #### [TotalTaxSet](#TotalTaxSet) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | shopMoney | [TotalTaxSetShopMoney](#TotalTaxSetShopMoney)? | yes | | + | presentmentMoney | [TotalTaxSetPresentmentMoney](#TotalTaxSetPresentmentMoney)? | yes | | + +--- + + + + + #### [TotalTaxSetShopMoney](#TotalTaxSetShopMoney) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amount | String? | yes | | + | currencyCode | String? | yes | | + +--- + + + + + #### [TotalTaxSetPresentmentMoney](#TotalTaxSetPresentmentMoney) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amount | String? | yes | | + | currencyCode | String? | yes | | + +--- + + + + + #### [SubtotalPriceSet](#SubtotalPriceSet) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | shopMoney | [SubtotalPriceSetShopMoney](#SubtotalPriceSetShopMoney)? | yes | | + | presentmentMoney | [SubtotalPriceSetPresentmentMoney](#SubtotalPriceSetPresentmentMoney)? | yes | | + +--- + + + + + #### [SubtotalPriceSetShopMoney](#SubtotalPriceSetShopMoney) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amount | String? | yes | | + | currencyCode | String? | yes | | + +--- + + + + + #### [SubtotalPriceSetPresentmentMoney](#SubtotalPriceSetPresentmentMoney) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amount | String? | yes | | + | currencyCode | String? | yes | | + +--- + + + + + #### [LineItems](#LineItems) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | sku | String? | yes | | + | fulfillableQuantity | Int? | yes | | + | grams | Int? | yes | | + | totalDiscount | String? | yes | | + | article | [LineItemsArticle](#LineItemsArticle)? | yes | | + | title | String? | yes | | + | variantInventoryManagement | String? | yes | | + | id | Int? | yes | | + | variantId | Int? | yes | | + | variantTitle | String? | yes | | + | productExists | Bool? | yes | | + | price | String? | yes | | + | adminGraphqlApiId | String? | yes | | + | quantity | Int? | yes | | + | vendor | String? | yes | | + | fulfillmentService | String? | yes | | + | taxable | Bool? | yes | | + | name | String? | yes | | + | productId | Int? | yes | | + | priceSet | [PriceSet](#PriceSet)? | yes | | + | taxLines | [TaxLines](#TaxLines)? | yes | | + | requiresShipping | Bool? | yes | | + | giftCard | Bool? | yes | | + | totalDiscountSet | [TotalDiscountSet](#TotalDiscountSet)? | yes | | + +--- + + + + + #### [LineItemsArticle](#LineItemsArticle) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | quantities | [Quantities](#Quantities)? | yes | | + | oldArticleUid | String? | yes | | + | totalQuantity | Int? | yes | | + | manufacturer | [Manufacturer](#Manufacturer)? | yes | | + | price | [ArticlePrice](#ArticlePrice)? | yes | | + | trackInventory | Bool? | yes | | + | company | [Company](#Company)? | yes | | + | isActive | Bool? | yes | | + | dateMeta | [FailOrderDateMeta](#FailOrderDateMeta)? | yes | | + | fragile | Bool? | yes | | + | marketplaceIdentifiers | [MarketplaceIdentifiers](#MarketplaceIdentifiers)? | yes | | + | size | String? | yes | | + | isSet | Bool? | yes | | + | dimension | [Dimension](#Dimension)? | yes | | + | weight | [Weight](#Weight)? | yes | | + | store | [Store](#Store)? | yes | | + | meta | [ArticleMeta](#ArticleMeta)? | yes | | + | uid | String? | yes | | + | brand | [ArticleBrand](#ArticleBrand)? | yes | | + | itemId | Int? | yes | | + | fyndArticleCode | String? | yes | | + | id | String? | yes | | + | identifier | [LineItemsArticleIdentifier](#LineItemsArticleIdentifier)? | yes | | + | sellerIdentifier | String? | yes | | + | fyndItemCode | String? | yes | | + | countryOfOrigin | String? | yes | | + +--- + + + + + #### [Quantities](#Quantities) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | notAvailable | [NotAvailable](#NotAvailable)? | yes | | + | sellable | [Sellable](#Sellable)? | yes | | + | orderCommitted | [OrderCommitted](#OrderCommitted)? | yes | | + | damaged | [Damaged](#Damaged)? | yes | | + +--- + + + + + #### [NotAvailable](#NotAvailable) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | count | Int? | yes | | + | updatedAt | String? | yes | | + +--- + + + + + #### [Sellable](#Sellable) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | count | Int? | yes | | + | updatedAt | String? | yes | | + +--- + + + + + #### [OrderCommitted](#OrderCommitted) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | count | Int? | yes | | + | updatedAt | String? | yes | | + +--- + + + + + #### [Damaged](#Damaged) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | updatedAt | String? | yes | | + | count | Int? | yes | | + +--- + + + + + #### [Manufacturer](#Manufacturer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isDefault | Bool? | yes | | + | address | String? | yes | | + | name | String? | yes | | + +--- + + + + + #### [ArticlePrice](#ArticlePrice) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | marked | Int? | yes | | + | currency | String? | yes | | + | effective | Int? | yes | | + | transfer | Int? | yes | | + +--- + + + + + #### [Company](#Company) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | companyType | String? | yes | | + | businessType | String? | yes | | + | companyName | String? | yes | | + | createdOn | String? | yes | | + | panNo | String? | yes | | + | returnAllowed | Bool? | yes | | + | meta | String? | yes | | + | exchangeAllowed | Bool? | yes | | + | agreementStartDate | String? | yes | | + | exchangeWithinDays | Int? | yes | | + | paymentProcesingCharge | Int? | yes | | + | fyndAFitAvailable | Bool? | yes | | + | modifiedOn | String? | yes | | + | returnWithinDays | Int? | yes | | + +--- + + + + + #### [FailOrderDateMeta](#FailOrderDateMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | addedOnStore | String? | yes | | + | inventoryUpdatedOn | String? | yes | | + | createdOn | String? | yes | | + | modifiedOn | String? | yes | | + +--- + + + + + #### [MarketplaceIdentifiers](#MarketplaceIdentifiers) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | tatacliqLuxury | [TatacliqLuxury](#TatacliqLuxury)? | yes | | + +--- + + + + + #### [TatacliqLuxury](#TatacliqLuxury) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | sku | String? | yes | | + +--- + + + + + #### [Dimension](#Dimension) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | height | Int? | yes | | + | width | Int? | yes | | + | unit | String? | yes | | + | length | Int? | yes | | + | isDefault | Bool? | yes | | + +--- + + + + + #### [Weight](#Weight) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isDefault | Bool? | yes | | + | unit | String? | yes | | + | shipping | Int? | yes | | + +--- + + + + + #### [Store](#Store) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + +--- + + + + + #### [ArticleMeta](#ArticleMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | service | String? | yes | | + +--- + + + + + #### [ArticleBrand](#ArticleBrand) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | id | Int? | yes | | + +--- + + + + + #### [LineItemsArticleIdentifier](#LineItemsArticleIdentifier) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | skuCode | String? | yes | | + +--- + + + + + #### [PriceSet](#PriceSet) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | shopMoney | [PriceSetShopMoney](#PriceSetShopMoney)? | yes | | + | presentmentMoney | [PriceSetPresentmentMoney](#PriceSetPresentmentMoney)? | yes | | + +--- + + + + + #### [PriceSetShopMoney](#PriceSetShopMoney) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amount | String? | yes | | + | currencyCode | String? | yes | | + +--- + + + + + #### [PriceSetPresentmentMoney](#PriceSetPresentmentMoney) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amount | String? | yes | | + | currencyCode | String? | yes | | + +--- + + + + + #### [TaxLines](#TaxLines) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | price | String? | yes | | + | rate | Int? | yes | | + | priceSet | [TaxLinesPriceSet](#TaxLinesPriceSet)? | yes | | + +--- + + + + + #### [TaxLinesPriceSet](#TaxLinesPriceSet) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | shopMoney | [TaxLinesPriceSetShopMoney](#TaxLinesPriceSetShopMoney)? | yes | | + | presentmentMoney | [TaxLinesPriceSetPresentmentMoney](#TaxLinesPriceSetPresentmentMoney)? | yes | | + +--- + + + + + #### [TaxLinesPriceSetShopMoney](#TaxLinesPriceSetShopMoney) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amount | String? | yes | | + | currencyCode | String? | yes | | + +--- + + + + + #### [TaxLinesPriceSetPresentmentMoney](#TaxLinesPriceSetPresentmentMoney) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | currencyCode | String? | yes | | + | amount | String? | yes | | + +--- + + + + + #### [TotalDiscountSet](#TotalDiscountSet) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | presentmentMoney | [TotalDiscountSetPresentmentMoney](#TotalDiscountSetPresentmentMoney)? | yes | | + | shopMoney | [TotalDiscountSetShopMoney](#TotalDiscountSetShopMoney)? | yes | | + +--- + + + + + #### [TotalDiscountSetPresentmentMoney](#TotalDiscountSetPresentmentMoney) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amount | String? | yes | | + | currencyCode | String? | yes | | + +--- + + + + + #### [TotalDiscountSetShopMoney](#TotalDiscountSetShopMoney) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amount | String? | yes | | + | currencyCode | String? | yes | | + +--- + + + + + #### [BillingAddress](#BillingAddress) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | address1 | String? | yes | | + | city | String? | yes | | + | zip | String? | yes | | + | lastName | String? | yes | | + | address2 | String? | yes | | + | latitude | Double? | yes | | + | longitude | Double? | yes | | + | provinceCode | String? | yes | | + | phone | String? | yes | | + | company | String? | yes | | + | name | String? | yes | | + | country | String? | yes | | + | countryCode | String? | yes | | + | firstName | String? | yes | | + | province | String? | yes | | + +--- + + + + + #### [TotalShippingPriceSet](#TotalShippingPriceSet) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | shopMoney | [TotalShippingPriceSetShopMoney](#TotalShippingPriceSetShopMoney)? | yes | | + | presentmentMoney | [TotalShippingPriceSetPresentmentMoney](#TotalShippingPriceSetPresentmentMoney)? | yes | | + +--- + + + + + #### [TotalShippingPriceSetShopMoney](#TotalShippingPriceSetShopMoney) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amount | String? | yes | | + | currencyCode | String? | yes | | + +--- + + + + + #### [TotalShippingPriceSetPresentmentMoney](#TotalShippingPriceSetPresentmentMoney) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amount | String? | yes | | + | currencyCode | String? | yes | | + +--- + + + + + #### [Customer](#Customer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | createdAt | String? | yes | | + | id | Int? | yes | | + | lastName | String? | yes | | + | state | String? | yes | | + | lastOrderId | Int? | yes | | + | note | String? | yes | | + | verifiedEmail | Bool? | yes | | + | phone | String? | yes | | + | acceptsMarketing | Bool? | yes | | + | firstName | String? | yes | | + | tags | String? | yes | | + | lastOrderName | String? | yes | | + | ordersCount | Int? | yes | | + | totalSpent | String? | yes | | + | taxExempt | Bool? | yes | | + | currency | String? | yes | | + | acceptsMarketingUpdatedAt | String? | yes | | + | email | String? | yes | | + | updatedAt | String? | yes | | + | adminGraphqlApiId | String? | yes | | + | defaultAddress | [DefaultAddress](#DefaultAddress)? | yes | | + +--- + + + + + #### [DefaultAddress](#DefaultAddress) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | lastName | String? | yes | | + | name | String? | yes | | + | provinceCode | String? | yes | | + | countryCode | String? | yes | | + | isDefault | Bool? | yes | | + | id | Int? | yes | | + | customerId | Int? | yes | | + | firstName | String? | yes | | + | address1 | String? | yes | | + | phone | String? | yes | | + | countryName | String? | yes | | + | company | String? | yes | | + | address2 | String? | yes | | + | city | String? | yes | | + | province | String? | yes | | + | country | String? | yes | | + | zip | String? | yes | | + +--- + + + + + #### [TotalLineItemsPriceSet](#TotalLineItemsPriceSet) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | shopMoney | [TotalLineItemsPriceSetShopMoney](#TotalLineItemsPriceSetShopMoney)? | yes | | + | presentmentMoney | [TotalLineItemsPriceSetPresentmentMoney](#TotalLineItemsPriceSetPresentmentMoney)? | yes | | + +--- + + + + + #### [TotalLineItemsPriceSetShopMoney](#TotalLineItemsPriceSetShopMoney) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amount | String? | yes | | + | currencyCode | String? | yes | | + +--- + + + + + #### [TotalLineItemsPriceSetPresentmentMoney](#TotalLineItemsPriceSetPresentmentMoney) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amount | String? | yes | | + | currencyCode | String? | yes | | + +--- + + + + + #### [OrderShippingAddress](#OrderShippingAddress) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | address1 | String? | yes | | + | zip | String? | yes | | + | address2 | String? | yes | | + | countryCode | String? | yes | | + | country | String? | yes | | + | lastName | String? | yes | | + | provinceCode | String? | yes | | + | firstName | String? | yes | | + | phone | String? | yes | | + | province | String? | yes | | + | latitude | Double? | yes | | + | longitude | Double? | yes | | + | city | String? | yes | | + | company | String? | yes | | + | name | String? | yes | | + +--- + + + + + #### [OrderListing](#OrderListing) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[OrderItems](#OrderItems)] | no | | + | filters | [Filters](#Filters) | no | | + | nextOrderStatus | [String: Any] | no | | + | page | [PlatformOrderPage](#PlatformOrderPage) | no | | + | appliedFilters | [AppliedFilters](#AppliedFilters) | no | | + +--- + + + + + #### [OrderItems](#OrderItems) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [PlatformOrderUserInfo](#PlatformOrderUserInfo)? | yes | | + | deliveryAddress | [PlatformDeliveryAddress](#PlatformDeliveryAddress)? | yes | | + | channel | [Channel](#Channel)? | yes | | + | id | String? | yes | | + | application | [PlatformApplication](#PlatformApplication)? | yes | | + | shipments | [PlatformShipment](#PlatformShipment)? | yes | | + | createdAt | String? | yes | | + | totalShipmentsInOrder | Int? | yes | | + +--- + + + + + #### [PlatformOrderUserInfo](#PlatformOrderUserInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | mobile | String? | yes | | + | firstName | String? | yes | | + | gender | String? | yes | | + | email | String? | yes | | + | lastName | String? | yes | | + | isAnonymousUser | Bool? | yes | | + | uid | Int? | yes | | + | avisUserId | String? | yes | | + +--- + + + + + #### [PlatformDeliveryAddress](#PlatformDeliveryAddress) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | area | String? | yes | | + | state | String? | yes | | + | country | String? | yes | | + | version | String? | yes | | + | address1 | String? | yes | | + | updatedAt | String? | yes | | + | city | String? | yes | | + | landmark | String? | yes | | + | createdAt | String? | yes | | + | name | String? | yes | | + | address | String? | yes | | + | phone | String? | yes | | + | latitude | Double? | yes | | + | longitude | Double? | yes | | + | addressType | String? | yes | | + | email | String? | yes | | + | pincode | String? | yes | | + | address2 | String? | yes | | + | contactPerson | String? | yes | | + | addressCategory | String? | yes | | + +--- + + + + + #### [Channel](#Channel) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | logo | String? | yes | | + +--- + + + + + #### [PlatformApplication](#PlatformApplication) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + +--- + + + + + #### [PlatformShipment](#PlatformShipment) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | status | [PlatformShipmentStatus](#PlatformShipmentStatus)? | yes | | + | bags | [Bags](#Bags)? | yes | | + | prices | [ShipmentPrices](#ShipmentPrices)? | yes | | + | id | String? | yes | | + | gst | [ShipmentGst](#ShipmentGst)? | yes | | + | priority | Double? | yes | | + | priorityText | String? | yes | | + | lockStatus | Bool? | yes | | + | orderingChannel | String? | yes | | + | totalShipmentBags | Int? | yes | | + +--- + + + + + #### [PlatformShipmentStatus](#PlatformShipmentStatus) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | bagList | [Int]? | yes | | + | createdAt | String? | yes | | + | status | String? | yes | | + | name | String? | yes | | + | progress | Int? | yes | | + | shipmentId | String? | yes | | + | currentShipmentStatus | String? | yes | | + | colorCode | String? | yes | | + +--- + + + + + #### [Bags](#Bags) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | item | [BagItem](#BagItem)? | yes | | + | id | Int? | yes | | + +--- + + + + + #### [BagItem](#BagItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | size | String? | yes | | + | slugKey | String? | yes | | + | canReturn | Bool? | yes | | + | brandId | Int? | yes | | + | l2Category | [String]? | yes | | + | name | String? | yes | | + | code | String? | yes | | + | canCancel | Bool? | yes | | + | attributes | [BagItemAttributes](#BagItemAttributes)? | yes | | + | l3CategoryName | String? | yes | | + | l3Category | Int? | yes | | + | l1Category | [String]? | yes | | + | image | [String]? | yes | | + | brand | String? | yes | | + | lastUpdatedAt | String? | yes | | + +--- + + + + + #### [BagItemAttributes](#BagItemAttributes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemCode | String? | yes | | + | brandName | String? | yes | | + | countryOfOrigin | String? | yes | | + +--- + + + + + #### [ShipmentPrices](#ShipmentPrices) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | refundAmount | Double? | yes | | + | cashbackApplied | Double? | yes | | + | transferPrice | Double? | yes | | + | couponValue | Double? | yes | | + | amountPaid | Double? | yes | | + | deliveryCharge | Double? | yes | | + | couponEffectiveDiscount | Double? | yes | | + | codCharges | Double? | yes | | + | refundCredit | Double? | yes | | + | addedToFyndCash | Bool? | yes | | + | gstTaxPercentage | Double? | yes | | + | priceMarked | Double? | yes | | + | priceEffective | Double? | yes | | + | discount | Double? | yes | | + | promotionEffectiveDiscount | Double? | yes | | + | amountPaidRoundoff | Double? | yes | | + | fyndCredits | Double? | yes | | + | brandCalculatedAmount | Double? | yes | | + | cashback | Double? | yes | | + | valueOfGood | Double? | yes | | + +--- + + + + + #### [Payments](#Payments) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isActive | Bool? | yes | | + | displayName | String? | yes | | + | logo | String? | yes | | + | source | String? | yes | | + | sourceNickname | String? | yes | | + | displayPriority | Int? | yes | | + | id | Int? | yes | | + | mode | String? | yes | | + | paymentIdentifier | String? | yes | | + +--- + + + + + #### [Filters](#Filters) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | stage | [Stage](#Stage)? | yes | | + | stages | [Stages](#Stages)? | yes | | + +--- + + + + + #### [Stage](#Stage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | text | String? | yes | | + | value | String? | yes | | + | isDefault | Bool? | yes | | + | filters | [StagesFilters](#StagesFilters)? | yes | | + +--- + + + + + #### [StagesFilters](#StagesFilters) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | text | String? | yes | | + | value | String? | yes | | + | type | String? | yes | | + | options | [Options](#Options)? | yes | | + +--- + + + + + #### [Options](#Options) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | text | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [PlatformOrderPage](#PlatformOrderPage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | next | String? | yes | | + | previous | String? | yes | | + | type | String? | yes | | + | size | Int? | yes | | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + | total | Int? | yes | | + | itemTotal | [ItemTotal](#ItemTotal)? | yes | | + +--- + + + + + #### [AppliedFilters](#AppliedFilters) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | stage | String? | yes | | + | stores | [String]? | yes | | + | deploymentStores | [String]? | yes | | + | dp | [Int]? | yes | | + | fromDate | String? | yes | | + | toDate | String? | yes | | + +--- + + + + + #### [OrderDetails](#OrderDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[OrderPicklistListing](#OrderPicklistListing)] | no | | + | page | [PlatformOrderPage](#PlatformOrderPage) | no | | + | filters | [Filters](#Filters) | no | | + | nextOrderStatus | [String: Any] | no | | + | appliedFilters | [AppliedFilters](#AppliedFilters) | no | | + +--- + + + + + #### [OrderDetailsItem](#OrderDetailsItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [PlatformOrderUserInfo](#PlatformOrderUserInfo)? | yes | | + | deliveryAddress | [PlatformDeliveryAddress](#PlatformDeliveryAddress)? | yes | | + | channel | [Channel](#Channel)? | yes | | + | fyndstoreEmp | [String: Any]? | yes | | + | orderingStore | [String: Any]? | yes | | + | breakupValues | [PlatformBreakupValues](#PlatformBreakupValues)? | yes | | + | id | String? | yes | | + | application | [PlatformApplication](#PlatformApplication)? | yes | | + | shipments | [PlatformShipmentDetails](#PlatformShipmentDetails)? | yes | | + | createdAt | String? | yes | | + | totalShipmentsInOrder | Int? | yes | | + | payments | [ItemsPayments](#ItemsPayments)? | yes | | + | paymentMethods | [String: Any]? | yes | | + +--- + + + + + #### [PlatformBreakupValues](#PlatformBreakupValues) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | display | String? | yes | | + | value | Double? | yes | | + | name | String? | yes | | + +--- + + + + + #### [ArticleAssignment](#ArticleAssignment) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | strategy | String? | yes | | + | level | String? | yes | | + +--- + + + + + #### [PlatformShipmentDetails](#PlatformShipmentDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | status | [PlatformShipmentDetailsStatus](#PlatformShipmentDetailsStatus)? | yes | | + | bags | [BagsDetails](#BagsDetails)? | yes | | + | prices | [ShipmentPrices](#ShipmentPrices)? | yes | | + | breakupValues | [ShipmentBreakupValues](#ShipmentBreakupValues)? | yes | | + | id | String? | yes | | + | dpDetails | [DpDetails](#DpDetails)? | yes | | + | paymentMethods | [String: Any]? | yes | | + | invoice | [ShipmentInvoice](#ShipmentInvoice)? | yes | | + | fulfillingStore | [PlatformFulfillingStore](#PlatformFulfillingStore)? | yes | | + | payments | [Payments](#Payments)? | yes | | + | gst | [ShipmentGst](#ShipmentGst)? | yes | | + | company | [Company](#Company)? | yes | | + | brand | [PlatformShipmentDetailsBrand](#PlatformShipmentDetailsBrand)? | yes | | + | coupon | [String: Any]? | yes | | + | orderSource | String? | yes | | + | isNotFyndSource | Bool? | yes | | + | canBreak | [String: Any]? | yes | | + | comment | String? | yes | | + | promise | [Promise](#Promise)? | yes | | + | trackingDetails | [ShipmentTrackingDetails](#ShipmentTrackingDetails)? | yes | | + | isFyndCoupon | Bool? | yes | | + | orderType | String? | yes | | + | totalShipmentBags | Int? | yes | | + | pod | [String: Any]? | yes | | + | lockStatus | Bool? | yes | | + | priority | Double? | yes | | + | priorityText | String? | yes | | + | orderingChannel | String? | yes | | + | creditNoteId | String? | yes | | + | autoTriggerDpAssignment | Bool? | yes | | + | packagingType | String? | yes | | + | dates | [ShipmentDates](#ShipmentDates)? | yes | | + +--- + + + + + #### [PlatformShipmentDetailsStatus](#PlatformShipmentDetailsStatus) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | bagList | [Int]? | yes | | + | createdAt | String? | yes | | + | status | String? | yes | | + | name | String? | yes | | + | progress | Int? | yes | | + | shipmentId | String? | yes | | + | currentShipmentStatus | String? | yes | | + | colorCode | String? | yes | | + +--- + + + + + #### [BagsDetails](#BagsDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | financialBreakup | [[BagFinancialBreakup](#BagFinancialBreakup)]? | yes | | + | status | [BagCurrStatus](#BagCurrStatus)? | yes | | + | item | [BagItem](#BagItem)? | yes | | + | article | [BagArticle](#BagArticle)? | yes | | + | id | Int? | yes | | + | prices | [BagPrices](#BagPrices)? | yes | | + | gstDetails | [GstDetails](#GstDetails)? | yes | | + | breakupValues | [BagBreakupValues](#BagBreakupValues)? | yes | | + | updateTime | Int? | yes | | + | currentStatus | [BagCurrentStatus](#BagCurrentStatus)? | yes | | + | bagStatus | [BagStatus](#BagStatus)? | yes | | + | canCancel | Bool? | yes | | + | canReturn | Bool? | yes | | + | paymentMethods | [String: Any]? | yes | | + +--- + + + + + #### [BagFinancialBreakup](#BagFinancialBreakup) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | valueOfGood | Double? | yes | | + | hsnCode | String? | yes | | + | priceEffective | Double? | yes | | + | codCharges | Double? | yes | | + | gstFee | String? | yes | | + | fyndCredits | Double? | yes | | + | refundAmount | Double? | yes | | + | cashbackApplied | Double? | yes | | + | transferPrice | Double? | yes | | + | amountPaidRoundoff | Double? | yes | | + | couponValue | Double? | yes | | + | amountPaid | Double? | yes | | + | gstTaxPercentage | Double? | yes | | + | size | String? | yes | | + | totalUnits | Int? | yes | | + | discount | Double? | yes | | + | couponEffectiveDiscount | Double? | yes | | + | cashback | Double? | yes | | + | promotionEffectiveDiscount | Double? | yes | | + | gstTag | String? | yes | | + | deliveryCharge | Double? | yes | | + | refundCredit | Double? | yes | | + | priceMarked | Double? | yes | | + | identifiers | [Identifiers](#Identifiers)? | yes | | + | itemName | String? | yes | | + | addedToFyndCash | Bool? | yes | | + | brandCalculatedAmount | Double? | yes | | + +--- + + + + + #### [Identifiers](#Identifiers) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | ean | String? | yes | | + +--- + + + + + #### [BagCurrStatus](#BagCurrStatus) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enableTracking | Bool? | yes | | + | isCustomerReturnAllowed | Bool? | yes | | + | isActive | Bool? | yes | | + | isReturnable | Bool? | yes | | + | canBeCancelled | Bool? | yes | | + +--- + + + + + #### [BagArticle](#BagArticle) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | identifiers | [ArticleIdentifiers](#ArticleIdentifiers)? | yes | | + | espModified | Bool? | yes | | + | isSet | Bool? | yes | | + | size | String? | yes | | + | code | String? | yes | | + | set | [Set](#Set)? | yes | | + | sellerIdentifier | String? | yes | | + | returnConfig | [BagArticleReturnConfig](#BagArticleReturnConfig)? | yes | | + | id | String? | yes | | + | uid | String? | yes | | + | childDetails | [String: Any]? | yes | | + +--- + + + + + #### [ArticleIdentifiers](#ArticleIdentifiers) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | ean | String? | yes | | + +--- + + + + + #### [Set](#Set) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | quantity | Int? | yes | | + | sizeDistribution | [SetSizeDistribution](#SetSizeDistribution)? | yes | | + +--- + + + + + #### [SetSizeDistribution](#SetSizeDistribution) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | sizes | [Sizes](#Sizes)? | yes | | + +--- + + + + + #### [Sizes](#Sizes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | size | String? | yes | | + | pieces | Int? | yes | | + +--- + + + + + #### [BagArticleReturnConfig](#BagArticleReturnConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | time | Int? | yes | | + | unit | String? | yes | | + | returnable | Bool? | yes | | + +--- + + + + + #### [GstDetails](#GstDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | brandCalculatedAmount | Double? | yes | | + | gstFee | String? | yes | | + | gstTag | String? | yes | | + | hsnCode | String? | yes | | + | valueOfGood | Double? | yes | | + | gstTaxPercentage | Double? | yes | | + | isDefaultHsnCode | Bool? | yes | | + +--- + + + + + #### [BagBreakupValues](#BagBreakupValues) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | display | String? | yes | | + | value | Double? | yes | | + +--- + + + + + #### [BagCurrentStatus](#BagCurrentStatus) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | updatedAt | String? | yes | | + | bagStateMapper | [BagStateMapper](#BagStateMapper)? | yes | | + | status | String? | yes | | + | stateType | String? | yes | | + +--- + + + + + #### [BagStateMapper](#BagStateMapper) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appStateName | String? | yes | | + | isActive | Bool? | yes | | + | displayName | String? | yes | | + | name | String? | yes | | + | appDisplayName | String? | yes | | + +--- + + + + + #### [BagStatus](#BagStatus) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | status | String? | yes | | + | stateType | String? | yes | | + | updatedAt | String? | yes | | + | bagStateMapper | [BagStatusBagStateMapper](#BagStatusBagStateMapper)? | yes | | + +--- + + + + + #### [BagStatusBagStateMapper](#BagStatusBagStateMapper) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isActive | Bool? | yes | | + | displayName | String? | yes | | + | name | String? | yes | | + | appDisplayName | String? | yes | | + | appStateName | String? | yes | | + +--- + + + + + #### [BagPrices](#BagPrices) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cashback | Double? | yes | | + | refundCredit | Double? | yes | | + | couponValue | Double? | yes | | + | deliveryCharge | Double? | yes | | + | fyndCredits | Double? | yes | | + | priceMarked | Double? | yes | | + | cashbackApplied | Double? | yes | | + | valueOfGood | Double? | yes | | + | amountPaidRoundoff | Double? | yes | | + | amountPaid | Double? | yes | | + | codCharges | Double? | yes | | + | priceEffective | Double? | yes | | + | refundAmount | Double? | yes | | + | discount | Double? | yes | | + +--- + + + + + #### [ShipmentBreakupValues](#ShipmentBreakupValues) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | display | String? | yes | | + | value | Double? | yes | | + +--- + + + + + #### [DpDetails](#DpDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | gstTag | String? | yes | | + +--- + + + + + #### [ShipmentInvoice](#ShipmentInvoice) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | paymentType | String? | yes | | + | updatedDate | String? | yes | | + | invoiceUrl | String? | yes | | + | labelUrl | String? | yes | | + | paymentMode | String? | yes | | + | amountToCollect | Double? | yes | | + | rtoAddress | [RtoAddress](#RtoAddress)? | yes | | + +--- + + + + + #### [RtoAddress](#RtoAddress) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | id | Int? | yes | | + | phone | String? | yes | | + | locationType | String? | yes | | + | storeAddressJson | [StoreAddressJson](#StoreAddressJson)? | yes | | + | code | String? | yes | | + | address1 | String? | yes | | + | city | String? | yes | | + | country | String? | yes | | + | pincode | String? | yes | | + | companyId | Int? | yes | | + | contactPerson | String? | yes | | + | state | String? | yes | | + | storeEmail | String? | yes | | + | address2 | String? | yes | | + +--- + + + + + #### [StoreAddressJson](#StoreAddressJson) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | country | String? | yes | | + | updatedAt | String? | yes | | + | area | String? | yes | | + | state | String? | yes | | + | addressType | String? | yes | | + | city | String? | yes | | + | pincode | String? | yes | | + | address1 | String? | yes | | + | address2 | String? | yes | | + | latitude | Double? | yes | | + | longitude | Double? | yes | | + | email | String? | yes | | + | phone | String? | yes | | + | createdAt | String? | yes | | + | contactPerson | String? | yes | | + | addressCategory | String? | yes | | + | version | String? | yes | | + | landmark | String? | yes | | + +--- + + + + + #### [PlatformFulfillingStore](#PlatformFulfillingStore) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | packagingMaterialCount | Int? | yes | | + | locationType | String? | yes | | + | code | String? | yes | | + | city | String? | yes | | + | meta | [FulfillingStoreMeta](#FulfillingStoreMeta)? | yes | | + | name | String? | yes | | + | isActive | Bool? | yes | | + | address1 | String? | yes | | + | storeEmail | String? | yes | | + | isArchived | Bool? | yes | | + | state | String? | yes | | + | address2 | String? | yes | | + | contactPerson | String? | yes | | + | phone | String? | yes | | + | isEnabledForRecon | Bool? | yes | | + | fulfillmentChannel | String? | yes | | + | createdAt | String? | yes | | + | id | Int? | yes | | + | pincode | String? | yes | | + | brandStoreTags | [String]? | yes | | + | companyId | Int? | yes | | + | storeAddressJson | [FulfillingStoreStoreAddressJson](#FulfillingStoreStoreAddressJson)? | yes | | + | updatedAt | String? | yes | | + | loginUsername | String? | yes | | + | country | String? | yes | | + +--- + + + + + #### [FulfillingStoreMeta](#FulfillingStoreMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | additionalContactDetails | [AdditionalContactDetails](#AdditionalContactDetails)? | yes | | + | documents | [Documents](#Documents)? | yes | | + | gstNumber | String? | yes | | + | displayName | String? | yes | | + | productReturnConfig | [ProductReturnConfig](#ProductReturnConfig)? | yes | | + | allowDpAssignmentFromFynd | Bool? | yes | | + | stage | String? | yes | | + | timing | [Timing](#Timing)? | yes | | + +--- + + + + + #### [AdditionalContactDetails](#AdditionalContactDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | number | [String]? | yes | | + +--- + + + + + #### [Documents](#Documents) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | gst | [Gst](#Gst)? | yes | | + +--- + + + + + #### [Gst](#Gst) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | legalName | String? | yes | | + | type | String? | yes | | + | value | String? | yes | | + | verified | Bool? | yes | | + +--- + + + + + #### [ProductReturnConfig](#ProductReturnConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | onSameStore | Bool? | yes | | + +--- + + + + + #### [Timing](#Timing) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | opening | [Opening](#Opening)? | yes | | + | weekday | String? | yes | | + | open | Bool? | yes | | + | closing | [Closing](#Closing)? | yes | | + +--- + + + + + #### [Opening](#Opening) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | minute | Int? | yes | | + | hour | Int? | yes | | + +--- + + + + + #### [Closing](#Closing) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | hour | Int? | yes | | + | minute | Int? | yes | | + +--- + + + + + #### [FulfillingStoreStoreAddressJson](#FulfillingStoreStoreAddressJson) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | address2 | String? | yes | | + | area | String? | yes | | + | email | String? | yes | | + | phone | String? | yes | | + | state | String? | yes | | + | contactPerson | String? | yes | | + | country | String? | yes | | + | pincode | String? | yes | | + | version | String? | yes | | + | createdAt | String? | yes | | + | addressType | String? | yes | | + | city | String? | yes | | + | address1 | String? | yes | | + | landmark | String? | yes | | + | latitude | Double? | yes | | + | longitude | Double? | yes | | + | updatedAt | String? | yes | | + | addressCategory | String? | yes | | + +--- + + + + + #### [ShipmentGst](#ShipmentGst) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | brandCalculatedAmount | Double? | yes | | + | valueOfGood | Double? | yes | | + | gstFee | Double? | yes | | + +--- + + + + + #### [PlatformShipmentDetailsBrand](#PlatformShipmentDetailsBrand) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | creditNoteAllowed | Bool? | yes | | + | brandName | String? | yes | | + | modifiedOn | String? | yes | | + | id | Int? | yes | | + | isVirtualInvoice | Bool? | yes | | + | createdOn | String? | yes | | + | logo | String? | yes | | + +--- + + + + + #### [Promise](#Promise) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | timestamp | [Timestamp](#Timestamp)? | yes | | + +--- + + + + + #### [Timestamp](#Timestamp) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | min | String? | yes | | + | max | String? | yes | | + +--- + + + + + #### [ShipmentTrackingDetails](#ShipmentTrackingDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | status | String? | yes | | + | time | String? | yes | | + | isPassed | Bool? | yes | | + | isCurrent | Bool? | yes | | + +--- + + + + + #### [ItemsPayments](#ItemsPayments) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | displayPriority | Int? | yes | | + | id | Int? | yes | | + | isActive | Bool? | yes | | + | displayName | String? | yes | | + | logo | String? | yes | | + | paymentIdentifier | String? | yes | | + | sourceNickname | String? | yes | | + | mode | String? | yes | | + | source | String? | yes | | + +--- + + + + + #### [PlatformOrderDetailsPage](#PlatformOrderDetailsPage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | next | String? | yes | | + | previous | String? | yes | | + +--- + + + + + #### [ShipmentDates](#ShipmentDates) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | dueDate | String? | yes | | + +--- + + + + + #### [OrderLanesCount](#OrderLanesCount) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | stages | [[StageItem](#StageItem)] | no | | + +--- + + + + + #### [StageItem](#StageItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | count | Int? | yes | | + | text | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [UpdateOrderReprocessResponse](#UpdateOrderReprocessResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | status | String | no | | + +--- + + + + + #### [PlatformOrderTrack](#PlatformOrderTrack) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | | + | requestId | String | no | | + | message | String | no | | + | mobile | String | no | | + | countryCode | String | no | | + | resendTimer | Int | no | | + | resendToken | String? | yes | | + +--- + + + + + #### [OrderPicklistListing](#OrderPicklistListing) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [PlatformOrderUserInfo](#PlatformOrderUserInfo)? | yes | | + | deliveryAddress | [PlatformDeliveryAddress](#PlatformDeliveryAddress)? | yes | | + | channel | [Channel](#Channel)? | yes | | + | fyndstoreEmp | [String: Any]? | yes | | + | orderingStore | [String: Any]? | yes | | + | breakupValues | [PlatformBreakupValues](#PlatformBreakupValues)? | yes | | + | id | String? | yes | | + | application | [PlatformApplication](#PlatformApplication)? | yes | | + | shipments | [PlatformShipmentDetails](#PlatformShipmentDetails)? | yes | | + | createdAt | String? | yes | | + | totalShipmentsInOrder | Int? | yes | | + | payments | [ItemsPayments](#ItemsPayments)? | yes | | + | paymentMethods | [String: Any]? | yes | | + +--- + + + + + #### [Stages](#Stages) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | text | String? | yes | | + | value | String? | yes | | + | isDefault | Bool? | yes | | + | filters | [StagesFilters](#StagesFilters)? | yes | | + +--- + + + + + #### [ItemTotal](#ItemTotal) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | new | Int? | yes | | + | processing | Int? | yes | | + | returns | Int? | yes | | + | all | Int? | yes | | + +--- + + + + + #### [GetPingResponse](#GetPingResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | ping | String | no | | + +--- + + + + + #### [GetShipmentAddressResponse](#GetShipmentAddressResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String | no | | + | data | [DataShipmentAddress](#DataShipmentAddress) | no | | + | success | Bool | no | | + +--- + + + + + #### [DataShipmentAddress](#DataShipmentAddress) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | city | String? | yes | | + | country | String? | yes | | + | pincode | String? | yes | | + | phone | String? | yes | | + | area | String? | yes | | + | address | String? | yes | | + | landmark | String? | yes | | + | state | String? | yes | | + | addressType | String? | yes | | + | addressCategory | String? | yes | | + | email | String? | yes | | + | name | String? | yes | | + +--- + + + + + #### [UpdateShipmentAddressRequest](#UpdateShipmentAddressRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String | no | | + | address | String | no | | + | pincode | String | no | | + | state | String | no | | + | addressType | String | no | | + | country | String | no | | + | name | String | no | | + | phone | String | no | | + | area | String | no | | + | landmark | String | no | | + | city | String | no | | + +--- + + + + + #### [UpdateShipmentAddressResponse](#UpdateShipmentAddressResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | | + | message | String | no | | + +--- + + + + + #### [ShipmentTrackResponse](#ShipmentTrackResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | bagList | [[ShipmentTrackResponseBagListItem](#ShipmentTrackResponseBagListItem)] | no | | + | message | String | no | | + | orderValue | Int | no | | + +--- + + + + + #### [ShipmentTrackResponseBagListItem](#ShipmentTrackResponseBagListItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enableTracking | Bool? | yes | | + | price | String? | yes | | + | timeSlot | String? | yes | | + | productName | String? | yes | | + | canReturn | Bool? | yes | | + | orderDate | String? | yes | | + | isTryAtHome | Bool? | yes | | + | breakupValues | [[ShipmentTrackResponseBagListItemBreakValues](#ShipmentTrackResponseBagListItemBreakValues)]? | yes | | + | statuses | [[ShipmentTrackResponseBagListItemStatuses](#ShipmentTrackResponseBagListItemStatuses)]? | yes | | + | isActive | Bool? | yes | | + | bagId | String? | yes | | + | orderId | String? | yes | | + | size | String? | yes | | + | paymentModeSource | String? | yes | | + | dpDetails | [ShipmentTrackResponseBagListItemDpDetails](#ShipmentTrackResponseBagListItemDpDetails)? | yes | | + | productId | Int? | yes | | + | productImage | [ShipmentTrackResponseBagListItemsProductImage](#ShipmentTrackResponseBagListItemsProductImage)? | yes | | + | brandName | String? | yes | | + | priceMarked | String? | yes | | + | status | String? | yes | | + | canCancel | Bool? | yes | | + | paymentMode | String? | yes | | + | fyndCashMsg | String? | yes | | + | deliveryAddress | String? | yes | | + +--- + + + + + #### [ShipmentTrackResponseBagListItemBreakValues](#ShipmentTrackResponseBagListItemBreakValues) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | display | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [ShipmentTrackResponseBagListItemStatuses](#ShipmentTrackResponseBagListItemStatuses) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | npsRating | Int? | yes | | + | npsString | String? | yes | | + | progressStatus | [[ShipmentTrackResponseBagListItemStatusesProgress](#ShipmentTrackResponseBagListItemStatusesProgress)]? | yes | | + | flowType | String? | yes | | + | statusProgress | Int? | yes | | + | isNpsDone | Bool? | yes | | + | headerMessage | String? | yes | | + | isDelayed | String? | yes | | + | trackingList | [[ShipmentTrackResponseBagListItemStatusesTrack](#ShipmentTrackResponseBagListItemStatusesTrack)]? | yes | | + +--- + + + + + #### [ShipmentTrackResponseBagListItemStatusesProgress](#ShipmentTrackResponseBagListItemStatusesProgress) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | type | String? | yes | | + | state | Bool? | yes | | + +--- + + + + + #### [ShipmentTrackResponseBagListItemStatusesTrack](#ShipmentTrackResponseBagListItemStatusesTrack) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | status | String? | yes | | + | time | String? | yes | | + | isPassed | Bool? | yes | | + | isCurrent | Bool? | yes | | + +--- + + + + + #### [ShipmentTrackResponseBagListItemDpDetails](#ShipmentTrackResponseBagListItemDpDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | trackingNo | String? | yes | | + | courier | String? | yes | | + +--- + + + + + #### [ShipmentTrackResponseBagListItemsProductImage](#ShipmentTrackResponseBagListItemsProductImage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | aspectRatio | String? | yes | | + | url | String? | yes | | + +--- + + + + + #### [UpdateShipmentStatusResponse](#UpdateShipmentStatusResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | shipments | [String: Any] | no | | + | errorShipments | [[String: Any]]? | yes | | + +--- + + + + + #### [UpdateShipmentStatusBody](#UpdateShipmentStatusBody) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | shipments | [String: Any] | no | | + | forceTransition | Bool | no | | + | task | Bool | no | | + +--- + + + + + #### [ShipmentReasonsResponse](#ShipmentReasonsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | | + | message | String | no | | + | reasons | [[ShipmentResponseReasons](#ShipmentResponseReasons)] | no | | + +--- + + + + + #### [ShipmentResponseReasons](#ShipmentResponseReasons) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | reasonId | Double? | yes | | + | reason | String? | yes | | + +--- + + + + + #### [PlatformShipmentTrack](#PlatformShipmentTrack) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | results | [Results](#Results) | no | | + +--- + + + + + #### [Results](#Results) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | awb | String? | yes | | + | updatedAt | String? | yes | | + | lastLocationRecievedAt | String? | yes | | + | reason | String? | yes | | + | shipmentType | String? | yes | | + | status | String? | yes | | + | updatedTime | String? | yes | | + | accountName | String? | yes | | + +--- + + + + + #### [ShipmentUpdateRequest](#ShipmentUpdateRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | bags | [String] | no | | + | reason | [String: Any] | no | | + | comments | String | no | | + | action | String | no | | + +--- + + + + + #### [ShipmentUpdateResponse](#ShipmentUpdateResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | | + | message | String | no | | + +--- + + + + + #### [UpdateProcessShipmenstRequestBody](#UpdateProcessShipmenstRequestBody) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | shipmentIds | [String] | no | | + | expectedStatus | String | no | | + +--- + + + + + #### [UpdateProcessShipmenstRequestResponse](#UpdateProcessShipmenstRequestResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | | + | message | String | no | | + +--- + + + + + #### [GetVoiceCallbackResponse](#GetVoiceCallbackResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String | no | | + +--- + + + + + #### [GetClickToCallResponse](#GetClickToCallResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String | no | | + +--- + + + + + #### [ApefaceApiError](#ApefaceApiError) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + diff --git a/documentation/platform/PARTNER.md b/documentation/platform/PARTNER.md new file mode 100644 index 0000000000..41b2fd59d4 --- /dev/null +++ b/documentation/platform/PARTNER.md @@ -0,0 +1,209 @@ + + + + +##### [Back to Platform docs](./README.md) + +## Partner Methods +Partner configuration apis +* [addProxyPath](#addproxypath) +* [removeProxyPath](#removeproxypath) + + + +## Methods with example and description + + +#### addProxyPath +Add proxy path for external url + + + + +```swift +client.application("").partner.addProxyPath(extensionId: extensionId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| extensionId | String | yes | Extension id | +| body | AddProxyReq | yes | Request body | + + +Add proxy path for external url + +*Returned Response:* + + + + +[AddProxyResponse](#AddProxyResponse) + +Success + + + + +
    +  Example: + +```json +{ + "_id": "607406b8a472cd527303692f", + "attached_path": "test", + "proxy_url": "https://www.abc.com", + "company_id": "1", + "application_id": "000000000000000000000004", + "extension_id": "6073280be899ea5b1150fd9d", + "created_at": "2021-04-12T08:37:12.077Z", + "modified_at": "2021-04-12T08:37:12.077Z" +} +``` +
    + + + + + + + + + +--- + + +#### removeProxyPath +Remove proxy path for external url + + + + +```swift +client.application("").partner.removeProxyPath(extensionId: extensionId, attachedPath: attachedPath) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| extensionId | String | yes | Extension id | +| attachedPath | String | yes | Attachaed path slug | + + + +Remove proxy path for external url + +*Returned Response:* + + + + +[RemoveProxyResponse](#RemoveProxyResponse) + +Success + + + + +
    +  Example: + +```json +{ + "message": "Proxy URL deleted", + "data": { + "_id": "607406b8a472cd527303692f", + "attached_path": "test", + "proxy_url": "https://www.abc.com", + "company_id": "1", + "application_id": "000000000000000000000004", + "extension_id": "6073280be899ea5b1150fd9d", + "created_at": "2021-04-12T08:37:12.077Z", + "modified_at": "2021-04-12T08:37:12.077Z" + } +} +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [AddProxyReq](#AddProxyReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | attachedPath | String? | yes | Proxy path slug | + | proxyUrl | String? | yes | Proxied url | + +--- + + + + + #### [AddProxyResponse](#AddProxyResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | attachedPath | String? | yes | | + | proxyUrl | String? | yes | | + | companyId | String? | yes | | + | applicationId | String? | yes | | + | extensionId | String? | yes | | + | createdAt | String? | yes | | + | modifiedAt | String? | yes | | + +--- + + + + + #### [APIError](#APIError) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | code | String? | yes | | + | message | String? | yes | | + | info | String? | yes | Error code description link | + | requestId | String? | yes | | + | meta | [String: Any]? | yes | | + +--- + + + + + #### [RemoveProxyResponse](#RemoveProxyResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + | data | [String: Any]? | yes | | + +--- + + + diff --git a/documentation/platform/PAYMENT.md b/documentation/platform/PAYMENT.md new file mode 100644 index 0000000000..28700ae859 --- /dev/null +++ b/documentation/platform/PAYMENT.md @@ -0,0 +1,3167 @@ + + + + +##### [Back to Platform docs](./README.md) + +## Payment Methods +Collect payment through many payment gateway i.e Stripe, Razorpay, Juspay etc.into Fynd or Self account +* [getBrandPaymentGatewayConfig](#getbrandpaymentgatewayconfig) +* [saveBrandPaymentGatewayConfig](#savebrandpaymentgatewayconfig) +* [updateBrandPaymentGatewayConfig](#updatebrandpaymentgatewayconfig) +* [getPaymentModeRoutes](#getpaymentmoderoutes) +* [getAllPayouts](#getallpayouts) +* [savePayout](#savepayout) +* [updatePayout](#updatepayout) +* [activateAndDectivatePayout](#activateanddectivatepayout) +* [deletePayout](#deletepayout) +* [getSubscriptionPaymentMethod](#getsubscriptionpaymentmethod) +* [deleteSubscriptionPaymentMethod](#deletesubscriptionpaymentmethod) +* [getSubscriptionConfig](#getsubscriptionconfig) +* [saveSubscriptionSetupIntent](#savesubscriptionsetupintent) +* [addBeneficiaryDetails](#addbeneficiarydetails) +* [verifyIfscCode](#verifyifsccode) +* [getUserOrderBeneficiaries](#getuserorderbeneficiaries) +* [getUserBeneficiaries](#getuserbeneficiaries) +* [confirmPayment](#confirmpayment) + + + +## Methods with example and description + + +#### getBrandPaymentGatewayConfig +Get All Brand Payment Gateway Config Secret + + + + +```swift +client.application("").payment.getBrandPaymentGatewayConfig() { (response, error) in + // Use response +} +``` + + + + + + +Get All Brand Payment Gateway Config Secret + +*Returned Response:* + + + + +[PaymentGatewayConfigResponse](#PaymentGatewayConfigResponse) + +Refund Transfer Mode + + + + +
    +  Example: + +```json +{ + "success": true, + "created": true, + "app_id": "000000000000000000000004", + "excluded_fields": [ + "config_type", + "aggregator" + ], + "display_fields": [ + "logo", + "display" + ], + "aggregators": [ + { + "key": "rrroooouuurrrrdddd", + "secret": "yyyyooo", + "is_active": false, + "config_type": "", + "merchant_key": "vvvvvvvvddd", + "aggregator": "juspay", + "display": { + "link": "", + "text": "Review in under process. Please wait while process completed or contact us for any further query.", + "description": "Juspay is not a Payment Gateway (like Citrus, CCAvenue, PayU) but it works with any gateway or aggregator with zero interference in the Merchant-PG relations.", + "reviewed": false + }, + "logo": "https://hdn-1.fynd.com/payment/juspay-pg-logo.jpg" + }, + { + "key": "", + "pin": "", + "secret": "", + "user_id": "", + "is_active": false, + "config_type": "", + "merchant_id": "", + "aggregator": "mswipe", + "display": { + "link": "", + "text": "Submitted request to be reviewed before going live. Please contact us for any further query.", + "description": "Mswipe card swipe machines are safe and secure and accepts all debit & credit cards." + }, + "logo": "https://hdn-1.fynd.com/payment/mswipe-pg-logo.png" + }, + { + "key": "tttyyyyyy", + "secret": "rerrrrrrrr", + "is_active": false, + "config_type": "", + "merchant_salt": "qqqqq", + "aggregator": "payumoney", + "display": { + "link": "", + "text": "Review in under process. Please wait while process completed or contact us for any further query.", + "description": "PayUmoney supports wide range of options for making online payments via wallets, UPI, cards, and netbanking.", + "reviewed": false + }, + "logo": "https://hdn-1.fynd.com/payment/payu_logo_large.png" + }, + { + "key": "test", + "secret": "test", + "is_active": true, + "config_type": "self", + "webhook_secret": "test", + "aggregator": "razorpay", + "display": { + "link": "", + "text": "Well done, You payment gateway successfully lived. Collect your payment at your end.", + "description": "Razorpay is a payments platform which accept online payments via Credit Card, Debit Card, Net banking, UPI, BharatQR and Wallets.", + "reviewed": true + }, + "logo": "https://hdn-1.fynd.com/payment/razorpay-pg-logo.jpg" + }, + { + "key": "", + "secret": "", + "is_active": false, + "config_type": "", + "aggregator": "rupifi", + "display": { + "link": "", + "text": "Submitted request to be reviewed before going live. Please contact us for any further query.", + "description": "Rupifi enables businesses to avail credits and allows a 'Buy now, Pay later' system for making transactions and purchases." + }, + "logo": "https://hdn-1.fynd.com/payment/Rupifi.png" + }, + { + "key": "12345", + "secret": "12345", + "is_active": false, + "config_type": "", + "aggregator": "simpl", + "display": { + "link": "", + "text": "Review in under process. Please wait while process completed or contact us for any further query.", + "description": "Simpl is a Pay Later payment method.", + "reviewed": false + }, + "logo": "https://hdn-1.fynd.com/payment/simpl-pg-logo.jpg" + }, + { + "key": "", + "secret": "", + "is_active": false, + "product_id": "", + "config_type": "", + "webhook_secret": "", + "aggregator": "stripe", + "display": { + "link": "", + "text": "Submitted request to be reviewed before going live. Please contact us for any further query.", + "description": "Stripe is a payment processor that supports online payments, credit cards, recurring subscriptions and direct payouts to bank accounts." + }, + "logo": "https://hdn-1.fynd.com/payment/Stripe.png" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### saveBrandPaymentGatewayConfig +Save Config Secret For Brand Payment Gateway + + + + +```swift +client.application("").payment.saveBrandPaymentGatewayConfig(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | PaymentGatewayConfigRequest | yes | Request body | + + +Save Config Secret For Brand Payment Gateway + +*Returned Response:* + + + + +[PaymentGatewayToBeReviewed](#PaymentGatewayToBeReviewed) + +Save Config Secret For Brand Payment Gateway Success Response. + + + + +
    +  Example: + +```json +{ + "success": true, + "aggregators": [ + "razorpay" + ] +} +``` +
    + + + + + + + + + +--- + + +#### updateBrandPaymentGatewayConfig +Save Config Secret For Brand Payment Gateway + + + + +```swift +client.application("").payment.updateBrandPaymentGatewayConfig(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | PaymentGatewayConfigRequest | yes | Request body | + + +Save Config Secret For Brand Payment Gateway + +*Returned Response:* + + + + +[PaymentGatewayToBeReviewed](#PaymentGatewayToBeReviewed) + +Save Config Secret For Brand Payment Gateway Success Response. + + + + +
    +  Example: + +```json +{ + "success": true, + "aggregators": [ + "razorpay" + ] +} +``` +
    + + + + + + + + + +--- + + +#### getPaymentModeRoutes +Get All Valid Payment Options + + + + +```swift +client.application("").payment.getPaymentModeRoutes(refresh: refresh, requestType: requestType) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| refresh | Bool | yes | | +| requestType | String | yes | | + + + +Use this API to get Get All Valid Payment Options for making payment + +*Returned Response:* + + + + +[PaymentOptionsResponse](#PaymentOptionsResponse) + +Success + + + + +
    +  Example: + +```json +{ + "success": true, + "payment_options": { + "payment_option": [ + { + "name": "CARD", + "display_priority": 2, + "payment_mode_id": 2, + "display_name": "Card", + "list": [], + "anonymous_enable": true, + "aggregator_name": "Razorpay", + "add_card_enabled": false, + "types": [], + "networks": [], + "banks": [] + }, + { + "name": "NB", + "display_priority": 3, + "payment_mode_id": 3, + "display_name": "Net Banking", + "list": [ + { + "aggregator_name": "Razorpay", + "name": "ICICI Bank", + "code": "ICIC", + "bank_name": "ICICI Bank", + "bank_code": "ICIC", + "url": "https://hdn-1.fynd.com/payment/NB_ICICI.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_ICICI.png", + "large": "https://hdn-1.fynd.com/payment/NB_ICICI.png" + }, + "merchant_code": "NB_ICICI", + "display_priority": 1, + "display_name": "ICICI Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "HDFC Bank", + "code": "HDFC", + "bank_name": "HDFC Bank", + "bank_code": "HDFC", + "url": "https://hdn-1.fynd.com/payment/NB_HDFC.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_HDFC.png", + "large": "https://hdn-1.fynd.com/payment/NB_HDFC.png" + }, + "merchant_code": "NB_HDFC", + "display_priority": 2, + "display_name": "HDFC Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Axis Bank", + "code": "UTIB", + "bank_name": "Axis Bank", + "bank_code": "UTIB", + "url": "https://hdn-1.fynd.com/payment/NB_AXIS.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_AXIS.png", + "large": "https://hdn-1.fynd.com/payment/NB_AXIS.png" + }, + "merchant_code": "NB_AXIS", + "display_priority": 3, + "display_name": "Axis Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "State Bank of India", + "code": "SBIN", + "bank_name": "State Bank of India", + "bank_code": "SBIN", + "url": "https://hdn-1.fynd.com/payment/NB_SBI.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_SBI.png", + "large": "https://hdn-1.fynd.com/payment/NB_SBI.png" + }, + "merchant_code": "NB_SBI", + "display_priority": 4, + "display_name": "State Bank of India" + }, + { + "aggregator_name": "Razorpay", + "name": "Kotak Mahindra Bank", + "code": "KKBK", + "bank_name": "Kotak Mahindra Bank", + "bank_code": "KKBK", + "url": "https://hdn-1.fynd.com/payment/NB_KOTAK.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_KOTAK.png", + "large": "https://hdn-1.fynd.com/payment/NB_KOTAK.png" + }, + "merchant_code": "NB_KOTAK", + "display_priority": 5, + "display_name": "Kotak Mahindra Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Indusind Bank", + "code": "INDB", + "bank_name": "Indusind Bank", + "bank_code": "INDB", + "url": "https://hdn-1.fynd.com/payment/NB_INDUS.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_INDUS.png", + "large": "https://hdn-1.fynd.com/payment/NB_INDUS.png" + }, + "merchant_code": "INDB", + "display_priority": 6, + "display_name": "Indusind Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "City Union Bank", + "code": "CIUB", + "bank_name": "City Union Bank", + "bank_code": "CIUB", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_CUB", + "display_priority": 9, + "display_name": "City Union Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Catholic Syrian Bank", + "code": "CSBK", + "bank_name": "Catholic Syrian Bank", + "bank_code": "CSBK", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "CSBK", + "display_priority": 11, + "display_name": "Catholic Syrian Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "State Bank of Hyderabad", + "code": "SBHY", + "bank_name": "State Bank of Hyderabad", + "bank_code": "SBHY", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_SBH", + "display_priority": 12, + "display_name": "State Bank of Hyderabad" + }, + { + "aggregator_name": "Razorpay", + "name": "Allahabad Bank", + "code": "ALLA", + "bank_name": "Allahabad Bank", + "bank_code": "ALLA", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "ALLA", + "display_priority": 15, + "display_name": "Allahabad Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Syndicate Bank", + "code": "SYNB", + "bank_name": "Syndicate Bank", + "bank_code": "SYNB", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "SYNB", + "display_priority": 17, + "display_name": "Syndicate Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Corporation Bank", + "code": "CORP", + "bank_name": "Corporation Bank", + "bank_code": "CORP", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_CORP", + "display_priority": 18, + "display_name": "Corporation Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Punjab National Bank - Corporate Banking", + "code": "PUNB_C", + "bank_name": "Punjab National Bank - Corporate Banking", + "bank_code": "PUNB_C", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "PUNB_C", + "display_priority": 19, + "display_name": "Punjab National Bank - Corporate Banking" + }, + { + "aggregator_name": "Razorpay", + "name": "Canara Bank", + "code": "CNRB", + "bank_name": "Canara Bank", + "bank_code": "CNRB", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_CANR", + "display_priority": 20, + "display_name": "Canara Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Saraswat Co-operative Bank", + "code": "SRCB", + "bank_name": "Saraswat Co-operative Bank", + "bank_code": "SRCB", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "SRCB", + "display_priority": 21, + "display_name": "Saraswat Co-operative Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Deutsche Bank", + "code": "DEUT", + "bank_name": "Deutsche Bank", + "bank_code": "DEUT", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_DEUT", + "display_priority": 22, + "display_name": "Deutsche Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Dhanlaxmi Bank", + "code": "DLXB", + "bank_name": "Dhanlaxmi Bank", + "bank_code": "DLXB", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "DLXB", + "display_priority": 24, + "display_name": "Dhanlaxmi Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Oriental Bank of Commerce", + "code": "ORBC", + "bank_name": "Oriental Bank of Commerce", + "bank_code": "ORBC", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "ORBC", + "display_priority": 25, + "display_name": "Oriental Bank of Commerce" + }, + { + "aggregator_name": "Razorpay", + "name": "Punjab National Bank - Retail Banking", + "code": "PUNB_R", + "bank_name": "Punjab National Bank - Retail Banking", + "bank_code": "PUNB_R", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "PUNB_R", + "display_priority": 26, + "display_name": "Punjab National Bank - Retail Banking" + }, + { + "aggregator_name": "Razorpay", + "name": "State Bank of Bikaner and Jaipur", + "code": "SBBJ", + "bank_name": "State Bank of Bikaner and Jaipur", + "bank_code": "SBBJ", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_SBBJ", + "display_priority": 27, + "display_name": "State Bank of Bikaner and Jaipur" + }, + { + "aggregator_name": "Razorpay", + "name": "Indian Overseas Bank", + "code": "IOBA", + "bank_name": "Indian Overseas Bank", + "bank_code": "IOBA", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_IOB", + "display_priority": 28, + "display_name": "Indian Overseas Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "State Bank of Travancore", + "code": "SBTR", + "bank_name": "State Bank of Travancore", + "bank_code": "SBTR", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_SBT", + "display_priority": 29, + "display_name": "State Bank of Travancore" + }, + { + "aggregator_name": "Razorpay", + "name": "Airtel Payments Bank", + "code": "AIRP", + "bank_name": "Airtel Payments Bank", + "bank_code": "AIRP", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "AIRP", + "display_priority": 30, + "display_name": "Airtel Payments Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Development Bank of Singapore", + "code": "DBSS", + "bank_name": "Development Bank of Singapore", + "bank_code": "DBSS", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "DBSS", + "display_priority": 31, + "display_name": "Development Bank of Singapore" + }, + { + "aggregator_name": "Razorpay", + "name": "Vijaya Bank", + "code": "VIJB", + "bank_name": "Vijaya Bank", + "bank_code": "VIJB", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_VJYB", + "display_priority": 32, + "display_name": "Vijaya Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "NKGSB Co-operative Bank", + "code": "NKGS", + "bank_name": "NKGSB Co-operative Bank", + "bank_code": "NKGS", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NKGS", + "display_priority": 33, + "display_name": "NKGSB Co-operative Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "RBL Bank", + "code": "RATN", + "bank_name": "RBL Bank", + "bank_code": "RATN", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "RATN", + "display_priority": 35, + "display_name": "RBL Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Bank of Baroda - Retail Banking", + "code": "BARB_R", + "bank_name": "Bank of Baroda - Retail Banking", + "bank_code": "BARB_R", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "BARB_R", + "display_priority": 36, + "display_name": "Bank of Baroda - Retail Banking" + }, + { + "aggregator_name": "Razorpay", + "name": "Karnataka Bank", + "code": "KARB", + "bank_name": "Karnataka Bank", + "bank_code": "KARB", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_KARN", + "display_priority": 37, + "display_name": "Karnataka Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Tamilnadu State Apex Co-operative Bank", + "code": "TNSC", + "bank_name": "Tamilnadu State Apex Co-operative Bank", + "bank_code": "TNSC", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "TNSC", + "display_priority": 38, + "display_name": "Tamilnadu State Apex Co-operative Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Tamilnadu Mercantile Bank", + "code": "TMBL", + "bank_name": "Tamilnadu Mercantile Bank", + "bank_code": "TMBL", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "TMBL", + "display_priority": 40, + "display_name": "Tamilnadu Mercantile Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Lakshmi Vilas Bank - Retail Banking", + "code": "LAVB_R", + "bank_name": "Lakshmi Vilas Bank - Retail Banking", + "bank_code": "LAVB_R", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "LAVB_R", + "display_priority": 42, + "display_name": "Lakshmi Vilas Bank - Retail Banking" + }, + { + "aggregator_name": "Razorpay", + "name": "Dena Bank", + "code": "BKDN", + "bank_name": "Dena Bank", + "bank_code": "BKDN", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "BKDN", + "display_priority": 43, + "display_name": "Dena Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Federal Bank", + "code": "FDRL", + "bank_name": "Federal Bank", + "bank_code": "FDRL", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_FED", + "display_priority": 44, + "display_name": "Federal Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Indian Bank", + "code": "IDIB", + "bank_name": "Indian Bank", + "bank_code": "IDIB", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_INDB", + "display_priority": 45, + "display_name": "Indian Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "South Indian Bank", + "code": "SIBL", + "bank_name": "South Indian Bank", + "bank_code": "SIBL", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_SOIB", + "display_priority": 46, + "display_name": "South Indian Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "IDBI", + "code": "IBKL", + "bank_name": "IDBI", + "bank_code": "IBKL", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "IBKL", + "display_priority": 49, + "display_name": "IDBI" + }, + { + "aggregator_name": "Razorpay", + "name": "Karur Vysya Bank", + "code": "KVBL", + "bank_name": "Karur Vysya Bank", + "bank_code": "KVBL", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_KVB", + "display_priority": 50, + "display_name": "Karur Vysya Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Punjab & Sind Bank", + "code": "PSIB", + "bank_name": "Punjab & Sind Bank", + "bank_code": "PSIB", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "PSIB", + "display_priority": 52, + "display_name": "Punjab & Sind Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "UCO Bank", + "code": "UCBA", + "bank_name": "UCO Bank", + "bank_code": "UCBA", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "UCBA", + "display_priority": 53, + "display_name": "UCO Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Bank of Bahrein and Kuwait", + "code": "BBKM", + "bank_name": "Bank of Bahrein and Kuwait", + "bank_code": "BBKM", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "BBKM", + "display_priority": 54, + "display_name": "Bank of Bahrein and Kuwait" + }, + { + "aggregator_name": "Razorpay", + "name": "Yes Bank", + "code": "YESB", + "bank_name": "Yes Bank", + "bank_code": "YESB", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_YESB", + "display_priority": 55, + "display_name": "Yes Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Punjab & Maharashtra Co-operative Bank", + "code": "PMCB", + "bank_name": "Punjab & Maharashtra Co-operative Bank", + "bank_code": "PMCB", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "PMCB", + "display_priority": 56, + "display_name": "Punjab & Maharashtra Co-operative Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Bank of India", + "code": "BKID", + "bank_name": "Bank of India", + "bank_code": "BKID", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_BOI", + "display_priority": 57, + "display_name": "Bank of India" + }, + { + "aggregator_name": "Razorpay", + "name": "Bank of Maharashtra", + "code": "MAHB", + "bank_name": "Bank of Maharashtra", + "bank_code": "MAHB", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_BOM", + "display_priority": 58, + "display_name": "Bank of Maharashtra" + }, + { + "aggregator_name": "Razorpay", + "name": "IDFC Bank", + "code": "IDFB", + "bank_name": "IDFC Bank", + "bank_code": "IDFB", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "IDFB", + "display_priority": 59, + "display_name": "IDFC Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Janata Sahakari Bank (Pune)", + "code": "JSBP", + "bank_name": "Janata Sahakari Bank (Pune)", + "bank_code": "JSBP", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "JSBP", + "display_priority": 60, + "display_name": "Janata Sahakari Bank (Pune)" + }, + { + "aggregator_name": "Razorpay", + "name": "Shamrao Vithal Co-operative Bank", + "code": "SVCB", + "bank_name": "Shamrao Vithal Co-operative Bank", + "bank_code": "SVCB", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "SVCB", + "display_priority": 61, + "display_name": "Shamrao Vithal Co-operative Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Cosmos Co-operative Bank", + "code": "COSB", + "bank_name": "Cosmos Co-operative Bank", + "bank_code": "COSB", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "COSB", + "display_priority": 62, + "display_name": "Cosmos Co-operative Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "State Bank of Mysore", + "code": "SBMY", + "bank_name": "State Bank of Mysore", + "bank_code": "SBMY", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_SBM", + "display_priority": 63, + "display_name": "State Bank of Mysore" + }, + { + "aggregator_name": "Razorpay", + "name": "Andhra Bank", + "code": "ANDB", + "bank_name": "Andhra Bank", + "bank_code": "ANDB", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "ANDB", + "display_priority": 65, + "display_name": "Andhra Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Jammu and Kashmir Bank", + "code": "JAKA", + "bank_name": "Jammu and Kashmir Bank", + "bank_code": "JAKA", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_JNK", + "display_priority": 66, + "display_name": "Jammu and Kashmir Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "United Bank of India", + "code": "UTBI", + "bank_name": "United Bank of India", + "bank_code": "UTBI", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "UTBI", + "display_priority": 67, + "display_name": "United Bank of India" + }, + { + "aggregator_name": "Razorpay", + "name": "Lakshmi Vilas Bank - Corporate Banking", + "code": "LAVB_C", + "bank_name": "Lakshmi Vilas Bank - Corporate Banking", + "bank_code": "LAVB_C", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "LAVB_C", + "display_priority": 69, + "display_name": "Lakshmi Vilas Bank - Corporate Banking" + }, + { + "aggregator_name": "Razorpay", + "name": "State Bank of Patiala", + "code": "STBP", + "bank_name": "State Bank of Patiala", + "bank_code": "STBP", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_SBP", + "display_priority": 70, + "display_name": "State Bank of Patiala" + }, + { + "aggregator_name": "Razorpay", + "name": "DCB Bank", + "code": "DCBL", + "bank_name": "DCB Bank", + "bank_code": "DCBL", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "DCBL", + "display_priority": 71, + "display_name": "DCB Bank" + }, + { + "aggregator_name": "Razorpay", + "name": "Union Bank of India", + "code": "UBIN", + "bank_name": "Union Bank of India", + "bank_code": "UBIN", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "NB_UBI", + "display_priority": 73, + "display_name": "Union Bank of India" + }, + { + "aggregator_name": "Razorpay", + "name": "Standard Chartered Bank", + "code": "SCBL", + "bank_name": "Standard Chartered Bank", + "bank_code": "SCBL", + "url": "https://hdn-1.fynd.com/payment/NB_generic.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/NB_generic.png", + "large": "https://hdn-1.fynd.com/payment/NB_generic.png" + }, + "merchant_code": "SCBL", + "display_priority": 74, + "display_name": "Standard Chartered Bank" + } + ] + }, + { + "name": "WL", + "display_priority": 4, + "payment_mode_id": 4, + "display_name": "Wallet", + "list": [ + { + "wallet_name": "Paytm", + "wallet_code": "paytm", + "name": "Paytm", + "display_name": "Paytm", + "code": "PAYTM", + "wallet_id": 4, + "merchant_code": "PAYTM", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/paytm_logo_small.png", + "large": "https://hdn-1.fynd.com/payment/paytm_logo_large.png" + }, + "aggregator_name": "Juspay", + "display_priority": 1 + }, + { + "wallet_name": "Mobikwik", + "wallet_code": "mobikwik", + "name": "Mobikwik", + "display_name": "Mobikwik", + "code": "MOBIKWIK", + "wallet_id": 5, + "merchant_code": "MOBIKWIK", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/mobikwik_logo_small.png", + "large": "https://hdn-1.fynd.com/payment/mobikwik_logo_small.png" + }, + "aggregator_name": "Juspay", + "display_priority": 3 + }, + { + "wallet_name": "Ola Money", + "wallet_code": "olamoney", + "name": "Ola Money", + "display_name": "Ola Money", + "code": "OLAMONEY", + "wallet_id": 6, + "merchant_code": "OLAMONEY", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/olamoney.png", + "large": "https://hdn-1.fynd.com/payment/olamoney.png" + }, + "aggregator_name": "Razorpay", + "display_priority": 4 + }, + { + "wallet_name": "Amazon Pay", + "wallet_code": "amazonpay", + "name": "Amazon Pay", + "display_name": "Amazon Pay", + "code": "AMAZONPAY", + "wallet_id": 10, + "merchant_code": "AMAZONPAY", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/amazon-pay.png", + "large": "https://hdn-1.fynd.com/payment/amazon-pay.png" + }, + "aggregator_name": "Razorpay", + "display_priority": 9 + }, + { + "wallet_name": "PayPal", + "wallet_code": "paypal", + "name": "PayPal", + "display_name": "PayPal", + "code": "PAYPAL", + "wallet_id": 11, + "merchant_code": "PAYPAL", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/paypal.jpg", + "large": "https://hdn-1.fynd.com/payment/paypal.jpg " + }, + "aggregator_name": "Razorpay", + "display_priority": 10 + } + ] + }, + { + "name": "UPI", + "display_priority": 9, + "payment_mode_id": 7, + "display_name": "UPI", + "list": [ + { + "aggregator_name": "Razorpay", + "name": "UPI", + "display_name": "BHIM UPI", + "code": "UPI", + "logo_url": { + "large": "https://hdn-1.fynd.com/payment/upi_150x100.png", + "small": "https://hdn-1.fynd.com/payment/upi_100x78.png" + }, + "merchant_code": "UPI", + "timeout": 240, + "retry_count": 0, + "fynd_vpa": "shopsense.rzp@hdfcbank", + "intent_flow": true, + "intent_app": [ + { + "code": "google_pay", + "display_name": "Google Pay", + "package_name": "com.google.android.apps.nbu.paisa.user", + "logos": { + "small": "https://hdn-1.fynd.com/payment/upi-google-pay.png", + "large": "https://hdn-1.fynd.com/payment/upi-google-pay.png" + } + } + ], + "intent_app_error_list": [ + "com.csam.icici.bank.imobile", + "in.org.npci.upiapp", + "com.whatsapp" + ], + "intent_app_error_dict_list": [ + { + "package_name": "com.csam.icici.bank.imobile", + "code": "icici" + }, + { + "package_name": "in.org.npci.upiapp", + "code": "upiapp" + }, + { + "package_name": "com.whatsapp", + "code": "whatsapp" + } + ] + } + ] + }, + { + "name": "EMI", + "display_priority": 18, + "payment_mode_id": 19, + "display_name": "Easy EMI", + "list": [ + { + "aggregator_name": "Razorpay", + "name": "EMI", + "display_name": "Easy EMI", + "code": "EMI", + "logo_url": { + "large": "https://hdn-1.fynd.com/payment/Pos+Logo.png", + "small": "https://hdn-1.fynd.com/payment/Pos+Logo.png" + }, + "merchant_code": "EMI" + } + ] + }, + { + "name": "JUSPAYPG", + "display_priority": 18, + "payment_mode_id": 23, + "display_name": "Pay Using Juspay", + "list": [ + { + "aggregator_name": "Juspay", + "name": "JUSPAYPG", + "display_name": "Pay Using Juspay", + "code": "JUSPAYPG", + "logo_url": { + "large": "https://hdn-1.fynd.com/payment/netbanking.png", + "small": "https://hdn-1.fynd.com/payment/netbanking.png" + }, + "merchant_code": "JUSPAYPG" + } + ] + }, + { + "name": "PG_PAYMENT", + "display_priority": 20, + "display_name": "Other payment gateway", + "list": [ + { + "aggregator_name": "Stripe", + "name": "STRIPEPG", + "display_name": "Pay using Stripe", + "code": "STRIPEPG", + "logo_url": { + "large": "https://hdn-1.fynd.com/payment/Pos+Logo.png", + "small": "https://hdn-1.fynd.com/payment/Pos+Logo.png" + }, + "merchant_code": "STRIPEPG" + }, + { + "aggregator_name": "Ccavenue", + "name": "CCAVENUEPG", + "display_name": "Pay using Ccavenue", + "code": "CCAVENUEPG", + "logo_url": { + "large": "https://hdn-1.fynd.com/payment/Pos+Logo.png", + "small": "https://hdn-1.fynd.com/payment/Pos+Logo.png" + }, + "merchant_code": "CCAVENUEPG" + }, + { + "aggregator_name": "Payumoney", + "name": "PAYUMONEYPG", + "display_name": "Pay using Payumoney", + "code": "PAYUMONEYPG", + "logo_url": { + "large": "https://fynd-obscuro-media-new.s3.amazonaws.com/payment/payu_logo_large.png", + "small": "https://fynd-obscuro-media-new.s3.amazonaws.com/payment/payu_logo_small.png" + }, + "merchant_code": "PAYUMONEYPG" + }, + { + "aggregator_name": "Payubiz", + "name": "PAYUBIZPG", + "display_name": "Pay using Payubiz", + "code": "PAYUBIZPG", + "logo_url": { + "large": "https://hdn-1.fynd.com/payment/payu.png", + "small": "https://hdn-1.fynd.com/payment/payu.png" + }, + "merchant_code": "PAYUBIZPG" + } + ] + }, + { + "name": "PL", + "display_priority": 21, + "display_name": "Pay Later", + "list": [ + { + "aggregator_name": "Simpl", + "name": "Simpl", + "display_name": "Simpl", + "code": "SIMPL", + "merchant_code": "SIMPL", + "logo": "https://hdn-1.fynd.com/payment/simpl_logo.png", + "logo_url": { + "small": "https://hdn-1.fynd.com/payment/simpl_logo.png", + "large": "https://hdn-1.fynd.com/payment/simpl_logo.png" + } + }, + { + "aggregator_name": "Rupifi", + "name": "RUPIFIPG", + "display_name": "Pay using Rupifi", + "code": "RUPIFIPG", + "logo_url": { + "large": "https://hdn-1.fynd.com/payment/Rupifi.png", + "small": "https://hdn-1.fynd.com/payment/Rupifi.png" + }, + "merchant_code": "RUPIFIPG" + } + ] + } + ] + } +} +``` +
    + + + + + + + + + +--- + + +#### getAllPayouts +Get All Payouts + + + + +```swift +client.payment.getAllPayouts(uniqueExternalId: uniqueExternalId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| uniqueExternalId | String? | no | Fetch payouts using unique external id | + + + +Get All Payouts + +*Returned Response:* + + + + +[PayoutsResponse](#PayoutsResponse) + +payouts response object + + + + +
    +  Example: + +```json +[ + { + "unique_transfer_no": "d2ff79fcd3459831864824da8c9d7e5f", + "more_attributes": { + "city": "", + "state": "", + "country": "", + "bank_name": "YES", + "ifsc_code": "IFSCYES101", + "account_no": "9876541234", + "branch_name": "Mumbai", + "account_type": "current", + "account_holder": "Vikas Kumar" + }, + "transfer_type": "bank", + "is_default": true, + "is_active": true, + "customers": { + "id": 2, + "name": "reliance retail", + "mobile": "1234567890", + "email": "reliance@gmail.com", + "unique_external_id": "company:1" + }, + "payouts_aggregators": [ + { + "payout_details_id": 888, + "aggregator_id": 3, + "aggregator_fund_id": null + } + ] + }, + { + "unique_transfer_no": "e388c1c5df4933fa01f6da9f92595589", + "more_attributes": { + "city": "", + "state": "", + "country": "", + "bank_name": "SBI", + "ifsc_code": "SBIN0011513", + "account_no": "9876543210", + "branch_name": "Mumbai", + "account_type": "saving", + "account_holder": "Vikas Kumar" + }, + "transfer_type": "bank", + "is_default": false, + "is_active": true, + "customers": { + "id": 2, + "name": "reliance retail", + "mobile": "1234567890", + "email": "reliance@gmail.com", + "unique_external_id": "company:1" + }, + "payouts_aggregators": [ + { + "payout_details_id": 891, + "aggregator_id": 3, + "aggregator_fund_id": null + } + ] + } +] +``` +
    + + + + + + + + + +--- + + +#### savePayout +Save Payout + + + + +```swift +client.payment.savePayout(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | PayoutRequest | yes | Request body | + + +Save Payout + +*Returned Response:* + + + + +[PayoutResponse](#PayoutResponse) + +save payout response object + + + + +
    +  Example: + +```json +{ + "success": true, + "is_active": true, + "bank_details": { + "account_type": "saving", + "account_holder": "Vikas Kumar", + "branch_name": "Mumbai", + "country": "", + "ifsc_code": "SBIN0011513", + "account_no": "9876543210", + "city": "", + "state": "", + "bank_name": "SBI" + }, + "unique_transfer_no": "e388c1c5df4933fa01f6da9f92595589", + "users": { + "name": "reliance retail", + "unique_external_id": "company:1", + "mobile": "1234567890", + "email": "reliance@gmail.com" + }, + "aggregator": "Razorpay", + "transfer_type": "bank", + "created": true, + "payouts": { + "aggregator_fund_id": null + }, + "payment_status": "payout_initiated" +} +``` +
    + + + + + + + + + +--- + + +#### updatePayout +Update Payout + + + + +```swift +client.payment.updatePayout(uniqueTransferNo: uniqueTransferNo, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| uniqueTransferNo | String | yes | Unique transfer id | +| body | PayoutRequest | yes | Request body | + + +Update Payout + +*Returned Response:* + + + + +[UpdatePayoutResponse](#UpdatePayoutResponse) + +save payout response object + + + + +
    +  Example: + +```json +{ + "success": true, + "is_default": true, + "is_active": true +} +``` +
    + + + + + + + + + +--- + + +#### activateAndDectivatePayout +Partial Update Payout + + + + +```swift +client.payment.activateAndDectivatePayout(uniqueTransferNo: uniqueTransferNo, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| uniqueTransferNo | String | yes | Unique transfer id | +| body | UpdatePayoutRequest | yes | Request body | + + +Partial Update Payout + +*Returned Response:* + + + + +[UpdatePayoutResponse](#UpdatePayoutResponse) + +save payout response object + + + + +
    +  Example: + +```json +{ + "success": true, + "is_default": true, + "is_active": true +} +``` +
    + + + + + + + + + +--- + + +#### deletePayout +Delete Payout + + + + +```swift +client.payment.deletePayout(uniqueTransferNo: uniqueTransferNo) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| uniqueTransferNo | String | yes | Unique transfer id | + + + +Delete Payout + +*Returned Response:* + + + + +[DeletePayoutResponse](#DeletePayoutResponse) + +delete payout response object + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getSubscriptionPaymentMethod +List Subscription Payment Method + + + + +```swift +client.payment.getSubscriptionPaymentMethod(uniqueExternalId: uniqueExternalId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| uniqueExternalId | String? | no | Unique external id | + + + +Get all Subscription Payment Method + +*Returned Response:* + + + + +[SubscriptionPaymentMethodResponse](#SubscriptionPaymentMethodResponse) + +List Subscription Payment Method Response + + + + +
    +  Example: + +```json +{ + "success": true, + "data": [ + { + "id": 68, + "type": "card", + "pg_payment_method_id": "pm_1H8HyIJ1ZTFIN1aD5eDOL4nU", + "data": { + "brand": "visa", + "last4": "4242", + "checks": { + "cvc_check": "pass", + "address_line1_check": null, + "address_postal_code_check": null + }, + "wallet": null, + "country": "US", + "funding": "credit", + "exp_year": 2044, + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "exp_month": 12, + "fingerprint": "0aror24meTf8iYfw", + "generated_from": null, + "three_d_secure_usage": { + "supported": true + } + }, + "is_default": false + }, + { + "id": 81, + "type": "card", + "pg_payment_method_id": "pm_1Hc7tMJ1ZTFIN1aDCvMIIBeT", + "data": { + "brand": "visa", + "last4": "4242", + "checks": { + "cvc_check": "pass", + "address_line1_check": null, + "address_postal_code_check": null + }, + "wallet": null, + "country": "US", + "funding": "credit", + "exp_year": 2020, + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "exp_month": 11, + "fingerprint": "0aror24meTf8iYfw", + "generated_from": null, + "three_d_secure_usage": { + "supported": true + } + }, + "is_default": true + }, + { + "id": 93, + "type": "card", + "pg_payment_method_id": "pm_1HvddjJ1ZTFIN1aDgebQvuyi", + "data": { + "brand": "visa", + "last4": "4242", + "checks": { + "cvc_check": "pass", + "address_line1_check": "pass", + "address_postal_code_check": "pass" + }, + "wallet": null, + "country": "US", + "funding": "credit", + "exp_year": 2022, + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "exp_month": 11, + "fingerprint": "0aror24meTf8iYfw", + "generated_from": null, + "three_d_secure_usage": { + "supported": true + } + }, + "is_default": false + }, + { + "id": 98, + "type": "card", + "pg_payment_method_id": "pm_1IJDF0J1ZTFIN1aDnJFi4i2v", + "data": { + "brand": "visa", + "last4": "1111", + "checks": { + "cvc_check": "pass", + "address_line1_check": "pass", + "address_postal_code_check": "pass" + }, + "wallet": null, + "country": "US", + "funding": "credit", + "exp_year": 2025, + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "exp_month": 11, + "fingerprint": "ZtDTGycouUEup4Q4", + "generated_from": null, + "three_d_secure_usage": { + "supported": true + } + }, + "is_default": false + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### deleteSubscriptionPaymentMethod +Delete Subscription Payment Method + + + + +```swift +client.payment.deleteSubscriptionPaymentMethod(uniqueExternalId: uniqueExternalId, paymentMethodId: paymentMethodId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| uniqueExternalId | String | yes | | +| paymentMethodId | String | yes | | + + + +Uses this api to Delete Subscription Payment Method + +*Returned Response:* + + + + +[DeleteSubscriptionPaymentMethodResponse](#DeleteSubscriptionPaymentMethodResponse) + +Delete Subscription Payment Method Response. + + + + +
    +  Example: + +```json +{ + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getSubscriptionConfig +List Subscription Config + + + + +```swift +client.payment.getSubscriptionConfig() { (response, error) in + // Use response +} +``` + + + + + + +Get all Subscription Config details + +*Returned Response:* + + + + +[SubscriptionConfigResponse](#SubscriptionConfigResponse) + +List Subscription Config Response + + + + +
    +  Example: + +```json +{ + "success": true, + "aggregator": "stripe", + "config": { + "public_key": "pk_test_lHBf12TZLa5" + } +} +``` +
    + + + + + + + + + +--- + + +#### saveSubscriptionSetupIntent +Save Subscription Setup Intent + + + + +```swift +client.payment.saveSubscriptionSetupIntent(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | SaveSubscriptionSetupIntentRequest | yes | Request body | + + +Uses this api to Save Subscription Setup Intent + +*Returned Response:* + + + + +[SaveSubscriptionSetupIntentResponse](#SaveSubscriptionSetupIntentResponse) + +Save Subscription Setup Intent Response. + + + + +
    +  Example: + +```json +{ + "success": true, + "data": { + "id": "test", + "object": "test", + "client_secret": "test", + "customer": "test", + "status": "requires_payment_method" + } +} +``` +
    + + + + + + + + + +--- + + +#### addBeneficiaryDetails +Save bank details for cancelled/returned order + + + + +```swift +client.application("").payment.addBeneficiaryDetails(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | AddBeneficiaryDetailsRequest | yes | Request body | + + +Use this API to save bank details for returned/cancelled order to refund amount in his account. + +*Returned Response:* + + + + +[RefundAccountResponse](#RefundAccountResponse) + +Success + + + + +
    +  Example: + +```json +{ + "success": true, + "message": "Account successfully created", + "data": {}, + "is_verified_flag": true +} +``` +
    + + + + + + + + + +--- + + +#### verifyIfscCode +Ifsc Code Verification + + + + +```swift +client.payment.verifyIfscCode(ifscCode: ifscCode) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| ifscCode | String? | no | | + + + +Get True/False for correct IFSC Code for adding bank details for refund + +*Returned Response:* + + + + +[IfscCodeResponse](#IfscCodeResponse) + +Bank details on correct Ifsc Code + + + + +
    +  Example: + +```json +{ + "branch_name": "MANPUR", + "bank_name": "GAYA", + "BRANCH": "MANPUR", + "CENTRE": "GAYA", + "DISTRICT": "GAYA", + "STATE": "BIHAR", + "ADDRESS": "POBUNIYADGANJBIHAR", + "CONTACT": "00", + "MICR": "816002103", + "UPI": true, + "RTGS": true, + "CITY": "GAYA", + "NEFT": true, + "IMPS": true, + "SWIFT": "", + "BANK": "State Bank of India", + "BANKCODE": "SBIN", + "IFSC": "SBIN0005611", + "success": true +} +``` +
    + + + + + + + + + +--- + + +#### getUserOrderBeneficiaries +List Order Beneficiary + + + + +```swift +client.application("").payment.getUserOrderBeneficiaries(orderId: orderId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| orderId | String | yes | | + + + +Get all active beneficiary details added by the user for refund + +*Returned Response:* + + + + +[OrderBeneficiaryResponse](#OrderBeneficiaryResponse) + +List Order Beneficiary + + + + +
    +  Example: + +```json +{ + "beneficiaries": [ + { + "id": 3695, + "beneficiary_id": "4c86dd56e634a4c6a8fb51d195bc7b83", + "bank_name": "State Bank of India", + "branch_name": "BHOGAT", + "account_holder": "PRAKASH TEST", + "account_no": "3566342455454", + "ifsc_code": "SBIN0014982", + "mobile": "7819064010", + "email": "prakashtest@gmail.com", + "address": "49A, Dabhi seri, jodhpur, kalyanpur", + "comment": "COD Refund", + "is_active": null, + "created_on": "2021-01-22 11:31:02", + "modified_on": "2021-01-22 11:31:02", + "display_name": "BANK", + "transfer_mode": "bank", + "title": "Bank Account", + "subtitle": "35663423659", + "delights_user_name": "shreeniwas_24x7_gmail_com_45978_16624463" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### getUserBeneficiaries +List User Beneficiary + + + + +```swift +client.application("").payment.getUserBeneficiaries(orderId: orderId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| orderId | String | yes | | + + + +Get all active beneficiary details added by the user for refund + +*Returned Response:* + + + + +[OrderBeneficiaryResponse](#OrderBeneficiaryResponse) + +List User Beneficiary + + + + +
    +  Example: + +```json +{ + "beneficiaries": [ + { + "id": 221, + "beneficiary_id": "0f7e44a922df352c05c5f73cb40ba115", + "bank_name": "State Bank of India", + "branch_name": "State Bank of India", + "account_holder": "SHASHI TEST", + "account_no": "1234567891", + "ifsc_code": "SBIN0005611", + "mobile": "9112042174", + "email": "payment@gofynd.com", + "address": "204A", + "comment": "", + "is_active": null, + "created_on": "2020-06-29 12:38:39", + "modified_on": "2020-06-29 12:38:39", + "display_name": "BANK", + "transfer_mode": "bank", + "title": "Bank Account", + "subtitle": "1234567891", + "delights_user_name": null + } + ], + "show_beneficiary_details": false +} +``` +
    + + + + + + + + + +--- + + +#### confirmPayment +Confirm payment after successful payment from payment gateway + + + + +```swift +client.application("").payment.confirmPayment(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | PaymentConfirmationRequest | yes | Request body | + + +Use this API to confirm payment after payment gateway accepted payment. + +*Returned Response:* + + + + +[PaymentConfirmationResponse](#PaymentConfirmationResponse) + +Success. Returns the status of payment. Check the example shown below or refer `PaymentConfirmationResponseSchema` for more details. + + + + +
    +  Example: + +```json +{ + "success": true, + "message": "Payment Successful", + "order_id": "FY60F90AEF01FF43E878" +} +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [PaymentGatewayConfigResponse](#PaymentGatewayConfigResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appId | String | no | Application Id to which Payment config Mapped | + | created | Bool | no | Response is created or not | + | success | Bool | no | Response is successful or not | + | aggregators | [[String: Any]]? | yes | List of all speceific Payment options with their Details. | + | excludedFields | [String] | no | List of all excluded options with their Details. | + | displayFields | [String] | no | List of all included options with their Details. | + +--- + + + + + #### [ErrorCodeDescription](#ErrorCodeDescription) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Response is successful or not | + | description | String | no | Error human understandable description. | + | code | String | no | Error descrption code. | + +--- + + + + + #### [PaymentGatewayConfig](#PaymentGatewayConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | merchantSalt | String | no | Merchant key of the payment aggregator | + | isActive | Bool? | yes | Enable/ Disable Flag | + | secret | String | no | Secret Key of the payment aggregator | + | configType | String | no | Config Type of the aggregator | + | key | String | no | Api key of the payment aggregator | + +--- + + + + + #### [PaymentGatewayConfigRequest](#PaymentGatewayConfigRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isActive | Bool? | yes | Enable/ Disable Flag | + | aggregatorName | [PaymentGatewayConfig](#PaymentGatewayConfig)? | yes | | + | appId | String | no | Application Id to which Payment config Mapped | + +--- + + + + + #### [PaymentGatewayToBeReviewed](#PaymentGatewayToBeReviewed) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Response is successful or not | + | aggregator | [String] | no | List of added payment gateway | + +--- + + + + + #### [ErrorCodeAndDescription](#ErrorCodeAndDescription) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | description | String | no | Error human understandable description. | + | code | String | no | Error descrption code. | + +--- + + + + + #### [HttpErrorCodeAndResponse](#HttpErrorCodeAndResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Response is successful or not | + | error | [ErrorCodeAndDescription](#ErrorCodeAndDescription) | no | | + +--- + + + + + #### [PaymentModeLogo](#PaymentModeLogo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | large | String | no | large | + | small | String | no | smalll | + +--- + + + + + #### [IntentApp](#IntentApp) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | logos | [PaymentModeLogo](#PaymentModeLogo)? | yes | logos | + | packageName | String? | yes | package_name | + | displayName | String? | yes | display_name | + | code | String? | yes | code | + +--- + + + + + #### [IntentAppErrorList](#IntentAppErrorList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | code | String? | yes | code | + | packageName | String? | yes | package_name | + +--- + + + + + #### [PaymentModeList](#PaymentModeList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | nickname | String? | yes | nickname | + | intentAppErrorList | [String]? | yes | intent_app_error_list | + | logoUrl | [PaymentModeLogo](#PaymentModeLogo)? | yes | Logo | + | cardId | String? | yes | card_id | + | fyndVpa | String? | yes | fynd_vpa | + | intentFlow | Bool? | yes | intent_flow | + | cardToken | String? | yes | card_token | + | cardIssuer | String? | yes | card_issuer | + | expMonth | Int? | yes | exp_month | + | intentApp | [[IntentApp](#IntentApp)]? | yes | intent_app | + | cardFingerprint | String? | yes | card_fingerprint | + | cardReference | String? | yes | card_reference | + | aggregatorName | String | no | aggregator_name | + | merchantCode | String? | yes | merchant code | + | intentAppErrorDictList | [[IntentAppErrorList](#IntentAppErrorList)]? | yes | intent_app_error_dict_list | + | displayName | String? | yes | display name | + | retryCount | Int? | yes | retry_count | + | expired | Bool? | yes | expired | + | code | String? | yes | code | + | name | String? | yes | name | + | cardNumber | String? | yes | card_number | + | cardBrand | String? | yes | card_brand | + | cardBrandImage | String? | yes | card_brand_image | + | timeout | Int? | yes | timeout | + | cardType | String? | yes | card_type | + | displayPriority | Int? | yes | Dispaly Priority | + | cardName | String? | yes | card_name | + | cardIsin | String? | yes | card_isin | + | expYear | Int? | yes | exp_year | + +--- + + + + + #### [RootPaymentMode](#RootPaymentMode) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | displayPriority | Int | no | Dispaly Priority | + | addCardEnabled | Bool? | yes | Annonymous card flag | + | aggregatorName | String? | yes | Dispaly Priority | + | list | [[PaymentModeList](#PaymentModeList)]? | yes | Payment mode | + | name | String | no | Payment mode name | + | anonymousEnable | Bool? | yes | Annonymous card flag | + | displayName | String | no | Payment mode display name | + +--- + + + + + #### [PaymentOptions](#PaymentOptions) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | paymentOption | [[RootPaymentMode](#RootPaymentMode)] | no | Payment options | + +--- + + + + + #### [PaymentOptionsResponse](#PaymentOptionsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Response is successful or not | + | paymentOptions | [PaymentOptions](#PaymentOptions) | no | Payment options | + +--- + + + + + #### [PayoutsResponse](#PayoutsResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | customers | [String: Any] | no | customers details object | + | isActive | Bool | no | Enable/DIsable Flag Payout | + | transferType | String | no | transafer type | + | uniqueTransferNo | [String: Any] | no | display priority of the payment mode | + | payoutsAggregators | [[String: Any]] | no | payout aggregator object | + | isDefault | Bool | no | default or not | + | moreAttributes | [String: Any] | no | bank details object | + +--- + + + + + #### [PayoutBankDetails](#PayoutBankDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | city | String? | yes | | + | ifscCode | String | no | | + | country | String? | yes | | + | pincode | Int? | yes | | + | accountNo | String? | yes | | + | bankName | String? | yes | | + | accountType | String | no | | + | accountHolder | String? | yes | | + | branchName | String? | yes | | + | state | String? | yes | | + +--- + + + + + #### [PayoutRequest](#PayoutRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | users | [String: Any] | no | payout users object | + | bankDetails | [PayoutBankDetails](#PayoutBankDetails) | no | payout bank details object | + | isActive | Bool | no | Enable/Disable Flag Payout | + | transferType | String | no | transafer type | + | uniqueExternalId | String | no | Unique Id of Payout | + | aggregator | String | no | Aggregator Name | + +--- + + + + + #### [PayoutResponse](#PayoutResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | users | [String: Any] | no | users details object | + | created | Bool | no | created flag | + | bankDetails | [String: Any] | no | payout bank_details object | + | success | Bool | no | Response is successful or not | + | isActive | Bool | no | Enable/DIsable Flag Payout | + | uniqueTransferNo | String | no | unique transfer no | + | transferType | String | no | transfer type | + | aggregator | String | no | Aggregator Name | + | paymentStatus | String | no | status of payment | + | payouts | [String: Any] | no | payout object | + +--- + + + + + #### [UpdatePayoutResponse](#UpdatePayoutResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Response is successful or not | + | isActive | Bool | no | Enable/DIsable Flag Payout | + | isDefault | Bool | no | Enable/Disable Default Payout | + +--- + + + + + #### [UpdatePayoutRequest](#UpdatePayoutRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uniqueExternalId | String | no | Unique Id of Payout | + | isActive | Bool | no | Enable/Disable Flag Payout | + | isDefault | Bool | no | Enable/Disable Default Payout | + +--- + + + + + #### [DeletePayoutResponse](#DeletePayoutResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Response is successful or not | + +--- + + + + + #### [SubscriptionPaymentMethodResponse](#SubscriptionPaymentMethodResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Response is successful or not | + | data | [[String: Any]] | no | Subscription Payment Method Object | + +--- + + + + + #### [DeleteSubscriptionPaymentMethodResponse](#DeleteSubscriptionPaymentMethodResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Success or failure. | + +--- + + + + + #### [SubscriptionConfigResponse](#SubscriptionConfigResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Response is successful or not | + | config | [String: Any] | no | Aggregator Config | + | aggregator | String | no | Aggregator Name | + +--- + + + + + #### [SaveSubscriptionSetupIntentRequest](#SaveSubscriptionSetupIntentRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | uniqueExternalId | String | no | Unique id i.e company:id | + +--- + + + + + #### [SaveSubscriptionSetupIntentResponse](#SaveSubscriptionSetupIntentResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Response is successful or not | + | data | [String: Any] | no | Subscription Payment Method Object | + +--- + + + + + #### [BeneficiaryModeDetails](#BeneficiaryModeDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | comment | String? | yes | Remarks added by The user | + | address | String? | yes | Address of the User | + | ifscCode | String | no | Ifsc Code of the Account | + | vpa | String? | yes | | + | accountNo | String | no | Account NUmber of the Account Holder | + | bankName | String | no | Bank Name of the Account | + | wallet | String? | yes | | + | mobile | String | no | Moblie Number of the User | + | accountHolder | String | no | Name of the Account Holder | + | email | String | no | Email of the Account Holder | + | branchName | String | no | Branch Name of the Account | + +--- + + + + + #### [AddBeneficiaryDetailsRequest](#AddBeneficiaryDetailsRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | shipmentId | String | no | Shipment Id of the respective Merchant Order Id | + | details | [BeneficiaryModeDetails](#BeneficiaryModeDetails) | no | Beneficiary bank details | + | requestId | String? | yes | | + | orderId | String | no | Merchant Order Id | + | transferMode | String | no | Transfer Mode of the Beneficiary to be added | + | delights | Bool | no | True if beneficiary to be added by delights or False if by User | + | otp | String? | yes | | + +--- + + + + + #### [RefundAccountResponse](#RefundAccountResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Success or failure flag. | + | data | [String: Any]? | yes | Refund account data. | + | message | String | no | Response message | + | isVerifiedFlag | Bool? | yes | | + +--- + + + + + #### [NotFoundResourceError](#NotFoundResourceError) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Response is successful or not | + | description | String | no | Not Found | + | code | String | no | Bad Request Data | + +--- + + + + + #### [IfscCodeResponse](#IfscCodeResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | Response is successful or not | + | bankName | String | no | Bank Name Of Account | + | branchName | String | no | Branch Name Of Account | + +--- + + + + + #### [OrderBeneficiaryDetails](#OrderBeneficiaryDetails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | modifiedOn | String | no | MOdification Date of Beneficiary | + | isActive | Bool | no | Boolean Flag whether Beneficiary set or not | + | accountNo | String | no | Account Number | + | id | Int | no | | + | email | String | no | EMail of User | + | delightsUserName | String? | yes | User Id Who filled the Beneficiary | + | title | String | no | Title Of Account | + | accountHolder | String | no | Account Holder Name | + | displayName | String | no | Display Name Of Account | + | branchName | Bool? | yes | Branch Name Of Account | + | comment | Bool? | yes | Remarks | + | address | String | no | Address of User | + | ifscCode | String | no | Ifsc Code Of Account | + | bankName | String | no | Bank Name Of Account | + | beneficiaryId | String | no | Benenficiary Id | + | subtitle | String | no | SHort Title Of Account | + | createdOn | String | no | Creation Date of Beneficiary | + | transferMode | String | no | Transfer Mode Of Account | + | mobile | Bool? | yes | MObile no of User | + +--- + + + + + #### [OrderBeneficiaryResponse](#OrderBeneficiaryResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | beneficiaries | [[OrderBeneficiaryDetails](#OrderBeneficiaryDetails)]? | yes | All Beneficiaries Of An Order | + | showBeneficiaryDetails | Bool? | yes | Show beneficiary details or not. | + +--- + + + + + #### [MultiTenderPaymentMeta](#MultiTenderPaymentMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | paymentId | String? | yes | | + | extraMeta | [String: Any]? | yes | | + | paymentGateway | String? | yes | | + | currentStatus | String? | yes | | + | orderId | String? | yes | | + +--- + + + + + #### [MultiTenderPaymentMethod](#MultiTenderPaymentMethod) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | mode | String | no | | + | amount | Double | no | Payment amount | + | name | String? | yes | Payment mode name | + | meta | [MultiTenderPaymentMeta](#MultiTenderPaymentMeta)? | yes | | + +--- + + + + + #### [PaymentConfirmationRequest](#PaymentConfirmationRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | orderId | String | no | Unique order id | + | paymentMethods | [[MultiTenderPaymentMethod](#MultiTenderPaymentMethod)] | no | | + +--- + + + + + #### [PaymentConfirmationResponse](#PaymentConfirmationResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool | no | Payment confirmation updated or not. | + | orderId | String | no | Unique order id | + | message | String | no | Message | + +--- + + + diff --git a/documentation/platform/README.md b/documentation/platform/README.md new file mode 100644 index 0000000000..aa07df4373 --- /dev/null +++ b/documentation/platform/README.md @@ -0,0 +1,27 @@ +##### [Back to home](../../README.md) + +# FDK Platform Front API Documentation + + +* [Common](COMMON.md) - Application configuration apis +* [Lead](LEAD.md) - Handles communication between Administrator <-> Staff and Staff <-> Users +* [Feedback](FEEDBACK.md) - User Reviews and Rating System +* [Theme](THEME.md) - Responsible for themes +* [User](USER.md) - Authentication Service +* [Content](CONTENT.md) - Content System +* [Billing](BILLING.md) - Handle platform subscription +* [Communication](COMMUNICATION.md) - Manages email, sms, push notifications sent to users +* [Payment](PAYMENT.md) - Collect payment through many payment gateway i.e Stripe, Razorpay, Juspay etc.into Fynd or Self account +* [Order](ORDER.md) - Handles Platform websites OMS +* [Catalog](CATALOG.md) - Catalog API's allows you to access list of products, prices, seller details, similar features, variants and many more useful features. +* [CompanyProfile](COMPANYPROFILE.md) - Company Profile API's allows you to access list of products, prices, seller details, similar features, variants and many more useful features. +* [FileStorage](FILESTORAGE.md) - File Storage +* [Share](SHARE.md) - Short link and QR Code +* [Inventory](INVENTORY.md) - +* [Configuration](CONFIGURATION.md) - Application configuration apis +* [Cart](CART.md) - Cart APIs +* [Rewards](REWARDS.md) - Rewards +* [Analytics](ANALYTICS.md) - Perceptor analytics +* [Discount](DISCOUNT.md) - Discount +* [Partner](PARTNER.md) - Partner configuration apis +* [Webhook](WEBHOOK.md) - Webhook dispatcher with retry and one event to many subscriber vice versa \ No newline at end of file diff --git a/documentation/platform/REWARDS.md b/documentation/platform/REWARDS.md new file mode 100644 index 0000000000..385d84775b --- /dev/null +++ b/documentation/platform/REWARDS.md @@ -0,0 +1,844 @@ + + + + +##### [Back to Platform docs](./README.md) + +## Rewards Methods +Rewards +* [getGiveaways](#getgiveaways) +* [createGiveaway](#creategiveaway) +* [getGiveawayByID](#getgiveawaybyid) +* [updateGiveaway](#updategiveaway) +* [getOffers](#getoffers) +* [getOfferByName](#getofferbyname) +* [updateOfferByName](#updateofferbyname) +* [getUserAvailablePoints](#getuseravailablepoints) +* [updateUserStatus](#updateuserstatus) +* [getUserPointsHistory](#getuserpointshistory) + + + +## Methods with example and description + + +#### getGiveaways +List of giveaways of the current application. + + + + +```swift +client.application("").rewards.getGiveaways(pageId: pageId, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageId | String? | no | pagination page id | +| pageSize | Int? | no | pagination page size | + + + +List of giveaways of the current application. + +*Returned Response:* + + + + +[GiveawayResponse](#GiveawayResponse) + +ok + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### createGiveaway +Adds a new giveaway. + + + + +```swift +client.application("").rewards.createGiveaway(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | Giveaway | yes | Request body | + + +Adds a new giveaway. + +*Returned Response:* + + + + +[Giveaway](#Giveaway) + +ok + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getGiveawayByID +Get giveaway by ID. + + + + +```swift +client.application("").rewards.getGiveawayByID(id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Giveaway ID | + + + +Get giveaway by ID. + +*Returned Response:* + + + + +[Giveaway](#Giveaway) + +ok + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updateGiveaway +Updates the giveaway by it's ID. + + + + +```swift +client.application("").rewards.updateGiveaway(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Giveaway ID | +| body | Giveaway | yes | Request body | + + +Updates the giveaway by it's ID. + +*Returned Response:* + + + + +[Giveaway](#Giveaway) + +ok + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getOffers +List of offer of the current application. + + + + +```swift +client.application("").rewards.getOffers() { (response, error) in + // Use response +} +``` + + + + + + +List of offer of the current application. + +*Returned Response:* + + + + +[[Offer]](#[Offer]) + +ok + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getOfferByName +Get offer by name. + + + + +```swift +client.application("").rewards.getOfferByName(cookie: cookie, name: name) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| cookie | String | yes | User's session cookie. This cookie is set in browser cookie when logged-in to fynd's authentication system i.e. `Grimlock` or by using grimlock-backend SDK for backend implementation. | +| name | String | yes | Offer name | + + + +Get offer by name. + +*Returned Response:* + + + + +[Offer](#Offer) + +ok + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updateOfferByName +Updates the offer by name. + + + + +```swift +client.application("").rewards.updateOfferByName(name: name, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| name | String | yes | Offer name | +| body | Offer | yes | Request body | + + +Updates the offer by name. + +*Returned Response:* + + + + +[Offer](#Offer) + +ok + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getUserAvailablePoints +User's reward details. + + + + +```swift +client.application("").rewards.getUserAvailablePoints(userId: userId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| userId | String | yes | user id | + + + +User's reward details. + +*Returned Response:* + + + + +[UserRes](#UserRes) + +ok + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updateUserStatus +Update User status + + + + +```swift +client.application("").rewards.updateUserStatus(userId: userId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| userId | String | yes | user id | +| body | AppUser | yes | Request body | + + +Update user status, active/archive + +*Returned Response:* + + + + +[AppUser](#AppUser) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getUserPointsHistory +Get list of points transactions. + + + + +```swift +client.application("").rewards.getUserPointsHistory(userId: userId, pageId: pageId, pageLimit: pageLimit, pageSize: pageSize) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| userId | String | yes | user id | +| pageId | String? | no | PageID is the ID of the requested page. For first request it should be kept empty. | +| pageLimit | Int? | no | PageLimit is the number of requested items in response. | +| pageSize | Int? | no | PageSize is the number of requested items in response. | + + + +Get list of points transactions. +The list of points history is paginated. + +*Returned Response:* + + + + +[HistoryRes](#HistoryRes) + +ok + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [AppUser](#AppUser) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | active | Bool? | yes | | + | applicationId | String? | yes | | + | blockReason | String? | yes | | + | updatedAt | String? | yes | | + | updatedBy | String? | yes | | + | userId | String? | yes | | + +--- + + + + + #### [Asset](#Asset) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | aspectRatio | String? | yes | | + | id | String? | yes | | + | secureUrl | String? | yes | | + +--- + + + + + #### [E](#E) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | code | [String: Any]? | yes | | + | exception | String? | yes | | + | info | String? | yes | | + | message | String? | yes | | + | requestId | String? | yes | | + | stackTrace | String? | yes | | + | status | Int? | yes | | + +--- + + + + + #### [Giveaway](#Giveaway) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | schedule | [Schedule](#Schedule)? | yes | | + | active | Bool? | yes | | + | applicationId | String? | yes | | + | audience | [RewardsAudience](#RewardsAudience)? | yes | | + | bannerImage | [Asset](#Asset)? | yes | | + | createdAt | String? | yes | | + | description | String? | yes | | + | name | String? | yes | | + | rule | [RewardsRule](#RewardsRule)? | yes | | + | title | String? | yes | | + | updatedAt | String? | yes | | + +--- + + + + + #### [GiveawayResponse](#GiveawayResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[Giveaway](#Giveaway)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [HistoryPretty](#HistoryPretty) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | applicationId | String? | yes | | + | claimed | Bool? | yes | | + | createdAt | String? | yes | | + | expiresOn | String? | yes | | + | points | Double? | yes | | + | remainingPoints | Double? | yes | | + | text1 | String? | yes | | + | text2 | String? | yes | | + | text3 | String? | yes | | + | txnName | String? | yes | | + | updatedAt | String? | yes | | + | userId | String? | yes | | + +--- + + + + + #### [HistoryRes](#HistoryRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[HistoryPretty](#HistoryPretty)]? | yes | | + | page | [Page](#Page)? | yes | | + | points | Double? | yes | | + +--- + + + + + #### [Offer](#Offer) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | schedule | [Schedule](#Schedule)? | yes | | + | active | Bool? | yes | | + | applicationId | String? | yes | | + | bannerImage | [Asset](#Asset)? | yes | | + | createdAt | String? | yes | | + | name | String? | yes | | + | rule | [String: Any]? | yes | | + | share | [ShareMessages](#ShareMessages)? | yes | | + | subText | String? | yes | | + | text | String? | yes | | + | type | String? | yes | | + | updatedAt | String? | yes | | + | updatedBy | String? | yes | | + | url | String? | yes | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + | hasPrevious | Bool? | yes | | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | size | Int? | yes | | + | type | String | no | | + +--- + + + + + #### [Points](#Points) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | available | Double? | yes | | + +--- + + + + + #### [Referral](#Referral) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | code | String? | yes | | + +--- + + + + + #### [RewardUser](#RewardUser) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | active | Bool? | yes | | + | createdAt | String? | yes | | + | referral | [Referral](#Referral)? | yes | | + | uid | Int? | yes | | + | updatedAt | String? | yes | | + | userBlockReason | String? | yes | | + | userId | String? | yes | | + +--- + + + + + #### [RewardsAudience](#RewardsAudience) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | headerUserId | String? | yes | | + | id | String? | yes | | + +--- + + + + + #### [RewardsRule](#RewardsRule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | amount | Double? | yes | | + +--- + + + + + #### [Schedule](#Schedule) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cron | String? | yes | | + | duration | Int? | yes | | + | end | String? | yes | | + | start | String? | yes | | + +--- + + + + + #### [ShareMessages](#ShareMessages) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + | facebook | String? | yes | | + | fallback | String? | yes | | + | message | String? | yes | | + | messenger | String? | yes | | + | sms | String? | yes | | + | text | String? | yes | | + | twitter | String? | yes | | + | whatsapp | String? | yes | | + +--- + + + + + #### [UserRes](#UserRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | points | [Points](#Points)? | yes | | + | user | [RewardUser](#RewardUser)? | yes | | + +--- + + + diff --git a/documentation/platform/SHARE.md b/documentation/platform/SHARE.md new file mode 100644 index 0000000000..8efa6c32c7 --- /dev/null +++ b/documentation/platform/SHARE.md @@ -0,0 +1,587 @@ + + + + +##### [Back to Platform docs](./README.md) + +## Share Methods +Short link and QR Code +* [createShortLink](#createshortlink) +* [getShortLinks](#getshortlinks) +* [getShortLinkByHash](#getshortlinkbyhash) +* [updateShortLinkById](#updateshortlinkbyid) + + + +## Methods with example and description + + +#### createShortLink +Create short link + + + + +```swift +client.application("").share.createShortLink(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | ShortLinkReq | yes | Request body | + + +Create short link + +*Returned Response:* + + + + +[ShortLinkRes](#ShortLinkRes) + +Success + + + + +
    +  Example: + +```json +{ + "url": { + "original": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh", + "short": "https://0icof6vvsf.hostx0.de/l/3qKlnsq-x", + "hash": "3qKlnsq-x" + }, + "redirects": { + "ios": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "android": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "web": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "force_web": false + }, + "created_by": "team", + "personalized": false, + "app_redirect": false, + "fallback": "web", + "enable_tracking": false, + "active": true, + "count": 0, + "_id": "601a54054c0349592e76c8f3", + "title": "new ", + "meta": { + "type": "brand" + }, + "expire_at": null, + "application": "5eda528b97457fe43a733ace", + "user_id": "5e4d01e2c39837ab66144f6d", + "created_at": "2021-02-03T07:43:01.342Z", + "updated_at": "2021-02-03T07:43:01.342Z" +} +``` +
    + + + + + + + + + +--- + + +#### getShortLinks +Get short links + + + + +```swift +client.application("").share.getShortLinks(pageNo: pageNo, pageSize: pageSize, createdBy: createdBy, active: active, q: q) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Current page number | +| pageSize | Int? | no | Current page size | +| createdBy | String? | no | Short link creator | +| active | String? | no | Short link active status | +| q | String? | no | Search text for original and short url | + + + +Get short links + +*Returned Response:* + + + + +[ShortLinkList](#ShortLinkList) + +Success + + + + +
    +  Example: + +```json +{ + "items": [ + { + "url": { + "original": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh", + "short": "https://0icof6vvsf.hostx0.de/l/3qKlnsq-x", + "hash": "3qKlnsq-x" + }, + "redirects": { + "ios": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "android": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "web": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "force_web": false + }, + "created_by": "team", + "personalized": false, + "app_redirect": false, + "fallback": "web", + "enable_tracking": false, + "active": true, + "count": 0, + "_id": "601a54054c0349592e76c8f3", + "title": "new ", + "meta": { + "type": "brand" + }, + "expire_at": null, + "application": "5eda528b97457fe43a733ace", + "user_id": "5e4d01e2c39837ab66144f6d", + "created_at": "2021-02-03T07:43:01.342Z", + "updated_at": "2021-02-03T07:43:01.342Z" + } + ], + "page": { + "size": 10, + "type": "number", + "page": 1, + "item_total": 30, + "has_next": true + } +} +``` +
    + + + + + + + + + +--- + + +#### getShortLinkByHash +Get short link by hash + + + + +```swift +client.application("").share.getShortLinkByHash(hash: hash) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| hash | String | yes | Hash of short url | + + + +Get short link by hash + +*Returned Response:* + + + + +[ShortLinkRes](#ShortLinkRes) + +Success + + + + +
    +  Example: + +```json +{ + "url": { + "original": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh", + "short": "https://0icof6vvsf.hostx0.de/l/3qKlnsq-x", + "hash": "3qKlnsq-x" + }, + "redirects": { + "ios": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "android": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "web": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "force_web": false + }, + "created_by": "team", + "personalized": false, + "app_redirect": false, + "fallback": "web", + "enable_tracking": false, + "active": true, + "count": 0, + "_id": "601a54054c0349592e76c8f3", + "title": "new ", + "meta": { + "type": "brand" + }, + "expire_at": null, + "application": "5eda528b97457fe43a733ace", + "user_id": "5e4d01e2c39837ab66144f6d", + "created_at": "2021-02-03T07:43:01.342Z", + "updated_at": "2021-02-03T07:43:01.342Z" +} +``` +
    + + + + + + + + + +--- + + +#### updateShortLinkById +Update short link by id + + + + +```swift +client.application("").share.updateShortLinkById(id: id, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| id | String | yes | Short link document identifier | +| body | ShortLinkReq | yes | Request body | + + +Update short link by id + +*Returned Response:* + + + + +[ShortLinkRes](#ShortLinkRes) + +Success + + + + +
    +  Example: + +```json +{ + "url": { + "original": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh", + "short": "https://0icof6vvsf.hostx0.de/l/3qKlnsq-x", + "hash": "3qKlnsq-x" + }, + "redirects": { + "ios": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "android": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "web": { + "type": "web", + "link": "https://0icof6vvsf.hostx0.de/products/?brand=ruosh" + }, + "force_web": false + }, + "created_by": "team", + "personalized": false, + "app_redirect": false, + "fallback": "web", + "enable_tracking": false, + "active": true, + "count": 0, + "_id": "601a54054c0349592e76c8f3", + "title": "new ", + "meta": { + "type": "brand" + }, + "expire_at": null, + "application": "5eda528b97457fe43a733ace", + "user_id": "5e4d01e2c39837ab66144f6d", + "created_at": "2021-02-03T07:43:01.342Z", + "updated_at": "2021-02-03T07:43:01.342Z" +} +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [RedirectDevice](#RedirectDevice) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | link | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [WebRedirect](#WebRedirect) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | link | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [Redirects](#Redirects) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | ios | [RedirectDevice](#RedirectDevice)? | yes | | + | android | [RedirectDevice](#RedirectDevice)? | yes | | + | web | [WebRedirect](#WebRedirect)? | yes | | + | forceWeb | Bool? | yes | | + +--- + + + + + #### [CampaignShortLink](#CampaignShortLink) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | source | String? | yes | | + | medium | String? | yes | | + +--- + + + + + #### [Attribution](#Attribution) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | campaignCookieExpiry | String? | yes | | + +--- + + + + + #### [SocialMediaTags](#SocialMediaTags) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | description | String? | yes | | + | image | String? | yes | | + +--- + + + + + #### [ShortLinkReq](#ShortLinkReq) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String | no | Give a name to the link. | + | url | String | no | The web address to shorten. | + | hash | String? | yes | | + | active | Bool? | yes | | + | expireAt | String? | yes | | + | enableTracking | Bool? | yes | | + | personalized | Bool? | yes | To create personalized short links. | + | campaign | [CampaignShortLink](#CampaignShortLink)? | yes | | + | redirects | [Redirects](#Redirects)? | yes | | + | attribution | [Attribution](#Attribution)? | yes | | + | socialMediaTags | [SocialMediaTags](#SocialMediaTags)? | yes | | + | count | Int? | yes | | + +--- + + + + + #### [UrlInfo](#UrlInfo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | original | String? | yes | | + | short | String? | yes | | + | hash | String? | yes | | + +--- + + + + + #### [ShortLinkRes](#ShortLinkRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | url | [UrlInfo](#UrlInfo)? | yes | | + | createdBy | String? | yes | | + | appRedirect | Bool? | yes | | + | fallback | String? | yes | | + | active | Bool? | yes | | + | id | String? | yes | | + | enableTracking | Bool? | yes | | + | expireAt | String? | yes | | + | application | String? | yes | | + | userId | String? | yes | | + | createdAt | String? | yes | | + | meta | [String: Any]? | yes | | + | updatedAt | String? | yes | | + | personalized | Bool? | yes | To create personalized short links | + | campaign | [CampaignShortLink](#CampaignShortLink)? | yes | | + | redirects | [Redirects](#Redirects)? | yes | | + | attribution | [Attribution](#Attribution)? | yes | | + | socialMediaTags | [SocialMediaTags](#SocialMediaTags)? | yes | | + | count | Int? | yes | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + | hasNext | Bool? | yes | | + | current | Int? | yes | | + | type | String | no | | + | size | Int? | yes | | + +--- + + + + + #### [ShortLinkList](#ShortLinkList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[ShortLinkRes](#ShortLinkRes)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [ErrorRes](#ErrorRes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + diff --git a/documentation/platform/THEME.md b/documentation/platform/THEME.md new file mode 100644 index 0000000000..3dd1b10e52 --- /dev/null +++ b/documentation/platform/THEME.md @@ -0,0 +1,35673 @@ + + + + +##### [Back to Platform docs](./README.md) + +## Theme Methods +Responsible for themes +* [getAllPages](#getallpages) +* [createPage](#createpage) +* [updateMultiplePages](#updatemultiplepages) +* [getPage](#getpage) +* [updatePage](#updatepage) +* [deletePage](#deletepage) +* [getThemeLibrary](#getthemelibrary) +* [addToThemeLibrary](#addtothemelibrary) +* [applyTheme](#applytheme) +* [isUpgradable](#isupgradable) +* [upgradeTheme](#upgradetheme) +* [getPublicThemes](#getpublicthemes) +* [createTheme](#createtheme) +* [getAppliedTheme](#getappliedtheme) +* [getFonts](#getfonts) +* [getThemeById](#getthemebyid) +* [updateTheme](#updatetheme) +* [deleteTheme](#deletetheme) +* [getThemeForPreview](#getthemeforpreview) +* [publishTheme](#publishtheme) +* [unpublishTheme](#unpublishtheme) +* [archiveTheme](#archivetheme) +* [unarchiveTheme](#unarchivetheme) + + + +## Methods with example and description + + +#### getAllPages +Get all pages of a theme + + + + +```swift +client.application("").theme.getAllPages(themeId: themeId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| themeId | String | yes | ID of the theme to be retrieved | + + + +Use this API to retrieve all the available pages of a theme by its ID. + +*Returned Response:* + + + + +[AllAvailablePageSchema](#AllAvailablePageSchema) + +Success. Returns an array all the pages of the theme. Refer `AllAvailablePageSchema` for more details. + + + + +
    +  Examples: + + +
    +  All pages + +```json +{ + "value": { + "pages": [ + { + "path": "products", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981639e13f6b2" + }, + "_id": "60ab5ca6d572fed64294eb0e", + "value": "product-listing", + "text": "Product Listing", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "collection", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981fc5d13f6b9" + }, + "_id": "60ab5ca6d572fed64294eaf9", + "text": "Collection Listing", + "value": "collection-listing", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "compare", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981cbca13f6b1" + }, + "_id": "60ab5ca6d572fed64294eb0b", + "value": "compare-products", + "text": "Compare Products", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "cart/bag", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e9812fdf13f6ae" + }, + "_id": "60ab5ca6d572fed64294eb02", + "value": "cart-landing", + "text": "Cart Landing", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "product", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e9815c9713f6ab" + }, + "_id": "60ab5ca6d572fed64294eaf6", + "text": "Product Description", + "value": "product-description", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "product/:slug/reviews", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60ab5ca6d572fed64294eb24" + }, + "_id": "60ab5ca6d572fed64294eb25", + "sections_meta": [], + "value": "product-reviews", + "text": "Product Reviews", + "theme": "5fb3ee4194a5181feeeba8e5", + "__v": 9 + }, + { + "path": "blog", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60ab5ca6d572fed64294eb22" + }, + "_id": "60ab5ca6d572fed64294eb23", + "sections_meta": [], + "value": "blog", + "text": "Blog", + "theme": "5fb3ee4194a5181feeeba8e5", + "__v": 9 + }, + { + "path": "sections/cookie", + "type": "sections", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e9814fed13f6b5" + }, + "_id": "60ab5ca6d572fed64294eb17", + "text": "cookie", + "value": "cookie", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "sections/vivek", + "type": "sections", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981b32713f6b6" + }, + "_id": "60ab5ca6d572fed64294eb1a", + "text": "vivek", + "value": "vivek", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "about-us", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60ab5ca6d572fed64294eb28" + }, + "_id": "60ab5ca6d572fed64294eb29", + "sections_meta": [], + "value": "about-us", + "text": "About Us", + "theme": "5fb3ee4194a5181feeeba8e5", + "__v": 9 + }, + { + "path": "wishlist", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981dd2d13f6b3" + }, + "_id": "60ab5ca6d572fed64294eb11", + "value": "wishlist", + "text": "Wishlist", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "product/:slug/add-review", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60ab5ca6d572fed64294eb26" + }, + "_id": "60ab5ca6d572fed64294eb27", + "sections_meta": [], + "value": "add-product-review", + "text": "Add Product Review", + "theme": "5fb3ee4194a5181feeeba8e5", + "__v": 9 + }, + { + "path": "brands", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981161a13f6ad" + }, + "_id": "60ab5ca6d572fed64294eaff", + "value": "brands", + "text": "Brands", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e98115b013f6ac" + }, + "_id": "60ab5ca6d572fed64294eafc", + "value": "home", + "text": "Home", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "collections", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981ad0b13f6b0" + }, + "_id": "60ab5ca6d572fed64294eb08", + "value": "collections", + "text": "Collections", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "categories", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981872c13f6af" + }, + "_id": "60ab5ca6d572fed64294eb05", + "value": "categories", + "text": "Categories", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "sections/test", + "type": "sections", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e98177f713f6b4" + }, + "_id": "60ab5ca6d572fed64294eb14", + "text": "Test", + "value": "test", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "sections/vinit", + "type": "sections", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e98170b813f6b8" + }, + "_id": "60ab5ca6d572fed64294eb20", + "text": "vinit", + "value": "vinit", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "sections/maggie", + "type": "sections", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981469613f6b7" + }, + "_id": "60ab5ca6d572fed64294eb1d", + "text": "maggie", + "value": "maggie", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + } + ] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createPage +Create a page + + + + +```swift +client.application("").theme.createPage(themeId: themeId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| themeId | String | yes | ID of the theme | +| body | AvailablePageSchema | yes | Request body | + + +Use this API to create a page for a theme by its ID. + +*Returned Response:* + + + + +[AvailablePageSchema](#AvailablePageSchema) + +Success. Returns the page of the theme. Refer `AvailablePageSchema` for more details. + + + + +
    +  Examples: + + +
    +  page + +```json +{ + "value": { + "path": "", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e98115b013f6ac" + }, + "props": [], + "_id": "60ab5ca6d572fed64294eafc", + "sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": false, + "desktop": false, + "tablet": false + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "utm": "facebook" + } + } + }, + "name": "customHtml", + "props": { + "code": { + "type": "code", + "value": "

    " + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "udm": "vivek" + } + } + }, + "name": "brands-listing", + "props": { + "title": { + "type": "text", + "value": "Popular rrrrr" + }, + "header": { + "type": "header" + }, + "brand_type": { + "value": "all", + "type": "radio" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 5, + "type": "range" + }, + "layout": { + "value": "horizontal", + "type": "select" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + }, + { + "blocks": [ + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + }, + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + }, + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + }, + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": false, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "" + } + }, + "name": "featuredProducts", + "props": { + "heading": { + "value": "Featured Products", + "type": "text" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "value": false, + "type": "checkbox" + } + }, + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "": "" + } + } + }, + "name": "categoryListPage", + "props": { + "heading": { + "type": "text", + "value": "Explore Categories" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "item_count": { + "value": 5, + "type": "range" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "": "" + } + } + }, + "name": "heroBanner", + "props": { + "ctaLink": { + "type": "url", + "value": "https://uniket.hostx0.de/about-us" + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "": "" + } + } + }, + "name": "imageBanner", + "props": { + "image": { + "value": "", + "type": "image_picker" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "overlayLayout": { + "value": "left", + "type": "select" + }, + "overlayImage": { + "value": "", + "type": "image_picker" + }, + "text": { + "value": "", + "type": "text" + }, + "text_color": { + "value": "#000", + "type": "color" + }, + "ctaLink": { + "value": "", + "type": "url" + }, + "ctaText": { + "value": "", + "type": "text" + }, + "layout": { + "type": "select", + "value": "full" + }, + "height": { + "type": "select", + "value": "h-auto" + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "" + } + }, + "name": "brands-listing", + "props": { + "title": { + "type": "text", + "value": "asdfasdf" + }, + "header": { + "type": "header" + }, + "brand_type": { + "value": "all", + "type": "radio" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 5, + "type": "range" + }, + "layout": { + "value": "horizontal", + "type": "select" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "value": "home", + "text": "Home", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateMultiplePages +Update multiple pages of a theme + + + + +```swift +client.application("").theme.updateMultiplePages(themeId: themeId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| themeId | String | yes | ID of the theme to be retrieved | +| body | AllAvailablePageSchema | yes | Request body | + + +Use this API to update multiple pages of a theme by its ID. + +*Returned Response:* + + + + +[AllAvailablePageSchema](#AllAvailablePageSchema) + +Success. Returns an array all the pages of the theme. Refer `AllAvailablePageSchema` for more details. + + + + +
    +  Examples: + + +
    +  All pages + +```json +{ + "value": { + "pages": [ + { + "path": "products", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981639e13f6b2" + }, + "_id": "60ab5ca6d572fed64294eb0e", + "value": "product-listing", + "text": "Product Listing", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "collection", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981fc5d13f6b9" + }, + "_id": "60ab5ca6d572fed64294eaf9", + "text": "Collection Listing", + "value": "collection-listing", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "compare", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981cbca13f6b1" + }, + "_id": "60ab5ca6d572fed64294eb0b", + "value": "compare-products", + "text": "Compare Products", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "cart/bag", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e9812fdf13f6ae" + }, + "_id": "60ab5ca6d572fed64294eb02", + "value": "cart-landing", + "text": "Cart Landing", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "product", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e9815c9713f6ab" + }, + "_id": "60ab5ca6d572fed64294eaf6", + "text": "Product Description", + "value": "product-description", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "product/:slug/reviews", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60ab5ca6d572fed64294eb24" + }, + "_id": "60ab5ca6d572fed64294eb25", + "sections_meta": [], + "value": "product-reviews", + "text": "Product Reviews", + "theme": "5fb3ee4194a5181feeeba8e5", + "__v": 9 + }, + { + "path": "blog", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60ab5ca6d572fed64294eb22" + }, + "_id": "60ab5ca6d572fed64294eb23", + "sections_meta": [], + "value": "blog", + "text": "Blog", + "theme": "5fb3ee4194a5181feeeba8e5", + "__v": 9 + }, + { + "path": "sections/cookie", + "type": "sections", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e9814fed13f6b5" + }, + "_id": "60ab5ca6d572fed64294eb17", + "text": "cookie", + "value": "cookie", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "sections/vivek", + "type": "sections", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981b32713f6b6" + }, + "_id": "60ab5ca6d572fed64294eb1a", + "text": "vivek", + "value": "vivek", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "about-us", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60ab5ca6d572fed64294eb28" + }, + "_id": "60ab5ca6d572fed64294eb29", + "sections_meta": [], + "value": "about-us", + "text": "About Us", + "theme": "5fb3ee4194a5181feeeba8e5", + "__v": 9 + }, + { + "path": "wishlist", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981dd2d13f6b3" + }, + "_id": "60ab5ca6d572fed64294eb11", + "value": "wishlist", + "text": "Wishlist", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "product/:slug/add-review", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60ab5ca6d572fed64294eb26" + }, + "_id": "60ab5ca6d572fed64294eb27", + "sections_meta": [], + "value": "add-product-review", + "text": "Add Product Review", + "theme": "5fb3ee4194a5181feeeba8e5", + "__v": 9 + }, + { + "path": "brands", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981161a13f6ad" + }, + "_id": "60ab5ca6d572fed64294eaff", + "value": "brands", + "text": "Brands", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e98115b013f6ac" + }, + "_id": "60ab5ca6d572fed64294eafc", + "value": "home", + "text": "Home", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "collections", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981ad0b13f6b0" + }, + "_id": "60ab5ca6d572fed64294eb08", + "value": "collections", + "text": "Collections", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "categories", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981872c13f6af" + }, + "_id": "60ab5ca6d572fed64294eb05", + "value": "categories", + "text": "Categories", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "sections/test", + "type": "sections", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e98177f713f6b4" + }, + "_id": "60ab5ca6d572fed64294eb14", + "text": "Test", + "value": "test", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "sections/vinit", + "type": "sections", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e98170b813f6b8" + }, + "_id": "60ab5ca6d572fed64294eb20", + "text": "vinit", + "value": "vinit", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + }, + { + "path": "sections/maggie", + "type": "sections", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e981469613f6b7" + }, + "_id": "60ab5ca6d572fed64294eb1d", + "text": "maggie", + "value": "maggie", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + } + ] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getPage +Get page of a theme + + + + +```swift +client.application("").theme.getPage(themeId: themeId, pageValue: pageValue) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| themeId | String | yes | ID of the theme to be retrieved | +| pageValue | String | yes | Value of the page to be retrieved | + + + +Use this API to retrieve a page of a theme. + +*Returned Response:* + + + + +[AvailablePageSchema](#AvailablePageSchema) + +Success. Returns an object of the page. Refer `AvailablePageSchema` for more details. + + + + +
    +  Examples: + + +
    +  Home page + +```json +{ + "value": { + "path": "", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e98115b013f6ac" + }, + "props": [], + "_id": "60ab5ca6d572fed64294eafc", + "sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": false, + "desktop": false, + "tablet": false + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "utm": "facebook" + } + } + }, + "name": "customHtml", + "props": { + "code": { + "type": "code", + "value": "

    " + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "udm": "vivek" + } + } + }, + "name": "brands-listing", + "props": { + "title": { + "type": "text", + "value": "Popular rrrrr" + }, + "header": { + "type": "header" + }, + "brand_type": { + "value": "all", + "type": "radio" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 5, + "type": "range" + }, + "layout": { + "value": "horizontal", + "type": "select" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + }, + { + "blocks": [ + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + }, + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + }, + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + }, + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": false, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "" + } + }, + "name": "featuredProducts", + "props": { + "heading": { + "value": "Featured Products", + "type": "text" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "value": false, + "type": "checkbox" + } + }, + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "": "" + } + } + }, + "name": "categoryListPage", + "props": { + "heading": { + "type": "text", + "value": "Explore Categories" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "item_count": { + "value": 5, + "type": "range" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "": "" + } + } + }, + "name": "heroBanner", + "props": { + "ctaLink": { + "type": "url", + "value": "https://uniket.hostx0.de/about-us" + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "": "" + } + } + }, + "name": "imageBanner", + "props": { + "image": { + "value": "", + "type": "image_picker" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "overlayLayout": { + "value": "left", + "type": "select" + }, + "overlayImage": { + "value": "", + "type": "image_picker" + }, + "text": { + "value": "", + "type": "text" + }, + "text_color": { + "value": "#000", + "type": "color" + }, + "ctaLink": { + "value": "", + "type": "url" + }, + "ctaText": { + "value": "", + "type": "text" + }, + "layout": { + "type": "select", + "value": "full" + }, + "height": { + "type": "select", + "value": "h-auto" + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "" + } + }, + "name": "brands-listing", + "props": { + "title": { + "type": "text", + "value": "asdfasdf" + }, + "header": { + "type": "header" + }, + "brand_type": { + "value": "all", + "type": "radio" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 5, + "type": "range" + }, + "layout": { + "value": "horizontal", + "type": "select" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "value": "home", + "text": "Home", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updatePage +Updates a page + + + + +```swift +client.application("").theme.updatePage(themeId: themeId, pageValue: pageValue, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| themeId | String | yes | ID of the theme | +| pageValue | String | yes | Value of the page to be updated | +| body | AvailablePageSchema | yes | Request body | + + +Use this API to update a page for a theme by its ID. + +*Returned Response:* + + + + +[AvailablePageSchema](#AvailablePageSchema) + +Success. Returns a the page of the theme. Refer `AvailablePageSchema` for more details. + + + + +
    +  Examples: + + +
    +  page + +```json +{ + "value": { + "path": "", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e98115b013f6ac" + }, + "props": [], + "_id": "60ab5ca6d572fed64294eafc", + "sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": false, + "desktop": false, + "tablet": false + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "utm": "facebook" + } + } + }, + "name": "customHtml", + "props": { + "code": { + "type": "code", + "value": "

    " + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "udm": "vivek" + } + } + }, + "name": "brands-listing", + "props": { + "title": { + "type": "text", + "value": "Popular rrrrr" + }, + "header": { + "type": "header" + }, + "brand_type": { + "value": "all", + "type": "radio" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 5, + "type": "range" + }, + "layout": { + "value": "horizontal", + "type": "select" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + }, + { + "blocks": [ + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + }, + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + }, + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + }, + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": false, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "" + } + }, + "name": "featuredProducts", + "props": { + "heading": { + "value": "Featured Products", + "type": "text" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "value": false, + "type": "checkbox" + } + }, + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "": "" + } + } + }, + "name": "categoryListPage", + "props": { + "heading": { + "type": "text", + "value": "Explore Categories" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "item_count": { + "value": 5, + "type": "range" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "": "" + } + } + }, + "name": "heroBanner", + "props": { + "ctaLink": { + "type": "url", + "value": "https://uniket.hostx0.de/about-us" + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "": "" + } + } + }, + "name": "imageBanner", + "props": { + "image": { + "value": "", + "type": "image_picker" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "overlayLayout": { + "value": "left", + "type": "select" + }, + "overlayImage": { + "value": "", + "type": "image_picker" + }, + "text": { + "value": "", + "type": "text" + }, + "text_color": { + "value": "#000", + "type": "color" + }, + "ctaLink": { + "value": "", + "type": "url" + }, + "ctaText": { + "value": "", + "type": "text" + }, + "layout": { + "type": "select", + "value": "full" + }, + "height": { + "type": "select", + "value": "h-auto" + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "" + } + }, + "name": "brands-listing", + "props": { + "title": { + "type": "text", + "value": "asdfasdf" + }, + "header": { + "type": "header" + }, + "brand_type": { + "value": "all", + "type": "radio" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 5, + "type": "range" + }, + "layout": { + "value": "horizontal", + "type": "select" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "value": "home", + "text": "Home", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### deletePage +Deletes a page + + + + +```swift +client.application("").theme.deletePage(themeId: themeId, pageValue: pageValue) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| themeId | String | yes | ID of the theme | +| pageValue | String | yes | Value of the page to be updated | + + + +Use this API to delete a page for a theme by its ID and page_value. + +*Returned Response:* + + + + +[AvailablePageSchema](#AvailablePageSchema) + +Success. Returns a the page of the theme. Refer `AvailablePageSchema` for more details. + + + + +
    +  Examples: + + +
    +  page + +```json +{ + "value": { + "path": "", + "type": "system", + "seo": { + "title": "", + "description": "", + "_id": "60210832d7e98115b013f6ac" + }, + "props": [], + "_id": "60ab5ca6d572fed64294eafc", + "sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": false, + "desktop": false, + "tablet": false + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "utm": "facebook" + } + } + }, + "name": "customHtml", + "props": { + "code": { + "type": "code", + "value": "

    " + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "udm": "vivek" + } + } + }, + "name": "brands-listing", + "props": { + "title": { + "type": "text", + "value": "Popular rrrrr" + }, + "header": { + "type": "header" + }, + "brand_type": { + "value": "all", + "type": "radio" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 5, + "type": "range" + }, + "layout": { + "value": "horizontal", + "type": "select" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + }, + { + "blocks": [ + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + }, + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + }, + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + }, + { + "type": "product", + "name": "Product", + "props": { + "product": { + "type": "product" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": false, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "" + } + }, + "name": "featuredProducts", + "props": { + "heading": { + "value": "Featured Products", + "type": "text" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "value": false, + "type": "checkbox" + } + }, + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "": "" + } + } + }, + "name": "categoryListPage", + "props": { + "heading": { + "type": "text", + "value": "Explore Categories" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "item_count": { + "value": 5, + "type": "range" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "": "" + } + } + }, + "name": "heroBanner", + "props": { + "ctaLink": { + "type": "url", + "value": "https://uniket.hostx0.de/about-us" + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "", + "query": { + "": "" + } + } + }, + "name": "imageBanner", + "props": { + "image": { + "value": "", + "type": "image_picker" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "overlayLayout": { + "value": "left", + "type": "select" + }, + "overlayImage": { + "value": "", + "type": "image_picker" + }, + "text": { + "value": "", + "type": "text" + }, + "text_color": { + "value": "#000", + "type": "color" + }, + "ctaLink": { + "value": "", + "type": "url" + }, + "ctaText": { + "value": "", + "type": "text" + }, + "layout": { + "type": "select", + "value": "full" + }, + "height": { + "type": "select", + "value": "h-auto" + } + } + }, + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "exactURL": "" + } + }, + "name": "brands-listing", + "props": { + "title": { + "type": "text", + "value": "asdfasdf" + }, + "header": { + "type": "header" + }, + "brand_type": { + "value": "all", + "type": "radio" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 5, + "type": "range" + }, + "layout": { + "value": "horizontal", + "type": "select" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "value": "home", + "text": "Home", + "theme": "5fb3ee4194a5181feeeba8e5", + "sections_meta": [], + "__v": 9 + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getThemeLibrary +Get a list of themes from the theme library + + + + +```swift +client.application("").theme.getThemeLibrary(pageSize: pageSize, pageNo: pageNo) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | +| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | + + + +Theme library is a personalized collection of themes that are chosen and added from the available themes. Use this API to fetch a list of themes from the library along with their configuration details. + +*Returned Response:* + + + + +[ThemesListingResponseSchema](#ThemesListingResponseSchema) + +Success. Refer `ThemesListingResponseSchema` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "items": [ + { + "information": { + "images": { + "desktop": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/emerge-desktop.jpeg" + ], + "android": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/emerge-mobile.jpeg" + ], + "ios": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/emerge-mobile.jpeg" + ], + "thumbnail": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/emerge-desktop.jpeg" + ] + }, + "features": [ + "Responsive" + ], + "name": "Akash-Emerge" + }, + "src": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/sources/KQmf7yHiw-archive.zip" + }, + "assets": { + "css": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/cca6Ghosfr-themeBundle.css" + }, + "umd_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/mL5ak5KO5-themeBundle.umd.min.js" + }, + "common_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/XZ60Mor-bV-themeBundle.common.js" + } + }, + "config": { + "preset": { + "sections": [ + { + "page_sections": [] + } + ] + }, + "global_schema": { + "props": [ + { + "type": "header", + "category": "Colors", + "value": "Header" + }, + { + "type": "color", + "category": "Colors", + "id": "header_bg_color", + "label": "Background ", + "default": "#ffffff" + }, + { + "type": "color", + "category": "Colors", + "id": "header_text_color", + "label": "Text ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "header_border_color", + "label": "Border ", + "default": "#ffffff" + }, + { + "type": "color", + "category": "Colors", + "id": "header_icon_color", + "label": "Icons ", + "default": "#ffffff" + }, + { + "type": "color", + "category": "Colors", + "id": "header_cart_notification_bg_color", + "label": "Notification background ", + "default": "#ffffff" + }, + { + "type": "color", + "category": "Colors", + "id": "header_cart_notification_text_color", + "label": "Notification text ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "header_nav_hover_color", + "label": "Navigation hover color", + "default": "#000000" + }, + { + "type": "header", + "category": "Colors", + "value": "Buttons" + }, + { + "type": "color", + "category": "Colors", + "id": "button_primary_color", + "label": "Primary ", + "default": "#ffffff" + }, + { + "type": "color", + "category": "Colors", + "id": "button_primary_label_color", + "label": "Primary label ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "button_add_to_cart_color", + "label": "Add to cart ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "button_add_to_cart_label_color", + "label": "Add to cart label ", + "default": "#ffffff" + }, + { + "type": "color", + "category": "Colors", + "id": "button_secondary_color", + "label": "Secondary ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "button_secondary_label_color", + "label": "Secondary label ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "button_tertiary_color", + "label": "Tertiary ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "button_tertiary_label_color", + "label": "Tertiary label ", + "default": "#000000" + }, + { + "type": "header", + "category": "Colors", + "value": "Text" + }, + { + "type": "color", + "category": "Colors", + "id": "text_heading_link_color", + "label": "Heading and link", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "text_body_color", + "label": "Body ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "text_price_color", + "label": "Price ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "text_sale_price_color", + "label": "Sale price ", + "default": "#fb406b" + }, + { + "type": "color", + "category": "Colors", + "id": "text_strikethrough_price_color", + "label": "Strikethrough price ", + "default": "#9b9b9b" + }, + { + "type": "color", + "category": "Colors", + "id": "text_discount_color", + "label": "Discount ", + "default": "#ee478d" + }, + { + "type": "header", + "category": "Colors", + "value": "Footer" + }, + { + "type": "color", + "category": "Colors", + "id": "footer_bg_color", + "label": "Background ", + "default": "#ffffff" + }, + { + "type": "color", + "category": "Colors", + "id": "footer_text_color", + "label": "Text ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "footer_border_color", + "label": "Border ", + "default": "#e1e1e1" + }, + { + "type": "color", + "category": "Colors", + "id": "footer_nav_hover_color", + "label": "Navigation hover color", + "default": "#000000" + }, + { + "type": "header", + "category": "Colors", + "value": "" + }, + { + "type": "header", + "category": "Colors", + "value": "" + }, + { + "type": "header", + "category": "Colors", + "value": "" + }, + { + "type": "checkbox", + "id": "disable_cart", + "default": false, + "category": "Cart", + "label": "Disable Cart" + } + ] + }, + "current": "Default", + "list": [ + { + "name": "Default", + "global_config": { + "static": { + "props": { + "colors": { + "cart": { + "header": "#FFFFFF", + "accent": "#02D1CB", + "button": "#FF8F47", + "header_label": "#41434C", + "button_label": "#FFFFFF", + "background": "#F8F8F8", + "sheet": "#FFFFFF" + }, + "primary_color": "#000000", + "secondary_color": "#000000", + "accent_color": "#000000", + "link_color": "#4499FF", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "header_bg_color": "#ffffff", + "header_text_color": "#000000", + "header_border_color": "#e1e1e1", + "header_icon_color": "#000000", + "header_cart_notification_bg_color": "#e8a76c", + "header_cart_notification_text_color": "#ffffff", + "header_nav_hover_color": "#999999", + "button_primary_color": "#ffffff", + "button_primary_label_color": "#000000", + "button_add_to_cart_color": "#000000", + "button_add_to_cart_label_color": "#ffffff", + "button_secondary_color": "#000000", + "button_secondary_label_color": "#ffffff", + "button_tertiary_color": "#000000", + "button_tertiary_label_color": "#000000", + "button_tertiary_hover_color": "#000000", + "button_tertiary_hover_text_color": "#ffffff", + "text_heading_link_color": "#000000", + "text_body_color": "#000000", + "text_price_color": "#000000", + "text_sale_price_color": "#fb406b", + "text_strikethrough_price_color": "#9b9b9b", + "text_discount_color": "#ee478d", + "footer_bg_color": "#ffffff", + "footer_text_color": "#999999", + "footer_border_color": "#e1e1e1", + "footer_nav_hover_color": "#000000", + "disable_cart": false + } + } + }, + "page": [ + { + "settings": { + "props": { + "reviews": false, + "add_to_compare": false, + "product_request": false, + "store_selection": true, + "compare_products": false, + "variants": true, + "ratings": false, + "similar_products": true + } + }, + "page": "product-description" + }, + { + "settings": { + "props": { + "show_info_message": true, + "gst": false, + "staff_selection": false, + "enable_customer": false, + "enable_guest": false + } + }, + "page": "cart-landing" + } + ], + "_id": "5fda8743b07e386cea1f2cbf" + }, + { + "name": "Dark", + "global_config": { + "static": { + "props": { + "colors": { + "cart": { + "header": "#FFFFFF", + "accent": "#02D1CB", + "button": "#FF8F47", + "header_label": "#41434C", + "button_label": "#FFFFFF", + "background": "#F8F8F8", + "sheet": "#FFFFFF" + }, + "primary_color": "#000000", + "secondary_color": "#000000", + "accent_color": "#000000", + "link_color": "#4499FF", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "header_bg_color": "#2e3032", + "header_text_color": "#ffffff", + "header_border_color": "#FFFFFF", + "header_icon_color": "#ffffff", + "header_cart_notification_bg_color": "#FFFFFF", + "header_cart_notification_text_color": "#2e3032", + "header_nav_hover_color": "#000000", + "button_primary_color": "#000000", + "button_primary_label_color": "#ffffff", + "button_add_to_cart_color": "#000000", + "button_add_to_cart_label_color": "#ffffff", + "button_secondary_color": "#000000", + "button_secondary_label_color": "#ffffff", + "button_tertiary_color": "#000000", + "button_tertiary_label_color": "#000000", + "button_tertiary_hover_color": "#000000", + "button_tertiary_hover_text_color": "#ffffff", + "text_heading_link_color": "#000000", + "text_body_color": "#000000", + "text_price_color": "#000000", + "text_sale_price_color": "#fb406b", + "text_strikethrough_price_color": "#9b9b9b", + "text_discount_color": "#ee478d", + "footer_bg_color": "#2e3032", + "footer_text_color": "#ffffff", + "footer_border_color": "#FFFFFF", + "footer_nav_hover_color": "#ffffff" + } + } + }, + "page": [ + { + "settings": { + "props": { + "show_info_message": true + } + }, + "page": "cart-landing" + } + ], + "_id": "5fda8743b07e3846b81f2cc0" + }, + { + "name": "Blue", + "global_config": { + "static": { + "props": { + "colors": { + "cart": { + "header": "#FFFFFF", + "accent": "#02D1CB", + "button": "#FF8F47", + "header_label": "#41434C", + "button_label": "#FFFFFF", + "background": "#F8F8F8", + "sheet": "#FFFFFF" + }, + "primary_color": "#000000", + "secondary_color": "#000000", + "accent_color": "#000000", + "link_color": "#4499FF", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "header_bg_color": "#7f9ed0", + "header_text_color": "#FFFFFF", + "header_border_color": "#FFFFFF", + "header_icon_color": "#FFFFFF", + "header_cart_notification_bg_color": "#2e3032", + "header_cart_notification_text_color": "#FFFFFF", + "header_nav_hover_color": "#2e3032", + "button_primary_color": "#ffffff", + "button_primary_label_color": "#000000", + "button_add_to_cart_color": "#000000", + "button_add_to_cart_label_color": "#ffffff", + "button_secondary_color": "#000000", + "button_secondary_label_color": "#ffffff", + "button_tertiary_color": "#000000", + "button_tertiary_label_color": "#000000", + "button_tertiary_hover_color": "#000000", + "button_tertiary_hover_text_color": "#ffffff", + "text_heading_link_color": "#000000", + "text_body_color": "#000000", + "text_price_color": "#000000", + "text_sale_price_color": "#fb406b", + "text_strikethrough_price_color": "#9b9b9b", + "text_discount_color": "#ee478d", + "footer_bg_color": "#7f9ed0", + "footer_text_color": "#FFFFFF", + "footer_border_color": "#FFFFFF", + "footer_nav_hover_color": "#2e3032" + } + } + }, + "page": [ + { + "settings": { + "props": { + "show_info_message": true + } + }, + "page": "cart-landing" + } + ], + "_id": "5fda8743b07e3850661f2cc1" + } + ] + }, + "colors": { + "primary_color": "#f8973d", + "secondary_color": "#f8973d", + "accent_color": "#FFFFFF", + "link_color": "#f63420", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + }, + "font": { + "variants": { + "light": { + "name": "300", + "file": "https://fonts.gstatic.com/s/montserrat/v15/JTURjIg1_i6t8kCHKm45_cJD7g7J_950vCo.ttf" + }, + "regular": { + "name": "400", + "file": "" + }, + "medium": { + "name": "500", + "file": "https://fonts.gstatic.com/s/montserrat/v15/JTURjIg1_i6t8kCHKm45_ZpC7g7J_950vCo.ttf" + }, + "semi_bold": { + "name": "600", + "file": "https://fonts.gstatic.com/s/montserrat/v15/JTURjIg1_i6t8kCHKm45_bZF7g7J_950vCo.ttf" + }, + "bold": { + "name": "700", + "file": "https://fonts.gstatic.com/s/montserrat/v15/JTURjIg1_i6t8kCHKm45_dJE7g7J_950vCo.ttf" + } + }, + "family": "Montserrat" + }, + "applied": false, + "published": false, + "archived": false, + "customized": true, + "version": "1.0.15", + "tags": [], + "_id": "5fe17ff363d26d6707d2032a", + "pages": { + "home": { + "path": "", + "type": "system", + "sections": [], + "value": "home", + "text": "Home" + }, + "brands": { + "path": "brands", + "type": "system", + "sections": [], + "value": "brands", + "text": "Brands" + }, + "cart-landing": { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + "categories": { + "path": "categories", + "type": "system", + "sections": [], + "value": "categories", + "text": "Categories" + }, + "collections": { + "path": "collections", + "type": "system", + "sections": [], + "value": "collections", + "text": "Collections" + }, + "compare-products": { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + "product-description": { + "path": "product", + "type": "system", + "sections": [], + "value": "product-description", + "text": "Product Description" + }, + "product-listing": { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + "collection-listing": { + "path": "collection", + "type": "system", + "sections": [], + "value": "collection-listing", + "text": "COllection Listing" + }, + "wishlist": { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + } + }, + "available_sections": [ + { + "props": [ + { + "type": "url", + "id": "banner_link", + "default": "", + "label": "Redirect Link" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacf62d092d5f99df2bf2a", + "name": "application_banner", + "label": "Application Banner" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "header", + "id": "header", + "value": "Choose Brands to Show" + }, + { + "id": "view_options", + "type": "select", + "options": [ + { + "value": "logo", + "text": "Logo View" + }, + { + "value": "fullview", + "text": "Logo and Banner View" + } + ], + "default": "fullview", + "label": "View Options", + "info": "Brand card view options" + }, + { + "type": "radio", + "id": "brand_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "department", + "text": "Department" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "department", + "id": "department", + "label": "Department", + "info": "Select a department of brands", + "note": "Department only applies if 'department' type is selected" + }, + { + "type": "range", + "id": "items_per_row", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 5, + "info": "Maximum items allowed per row" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "horizontal", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "text", + "id": "cta_text", + "default": "View all", + "label": "CTA Text" + } + ], + "blocks": [ + { + "type": "brand_item", + "name": "Brand Item", + "props": [ + { + "type": "brand", + "id": "brand", + "label": "Select Brand" + } + ] + } + ], + "_id": "5feacf62d092d5a70df2bf2b", + "name": "brands_listing", + "label": "Brands Listing" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "radio", + "id": "collection_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "handpicked", + "text": "Handpicked (works with Horizontal view)" + } + ] + }, + { + "type": "text", + "id": "tags_filter", + "default": "", + "label": "Filter by tags", + "info": "Filter by Tags (Only for collection type - all)" + }, + { + "type": "range", + "id": "items_per_row", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 5, + "info": "Maximum items allowed per row" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "horizontal", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "text", + "id": "cta_text", + "default": "View all", + "label": "CTA Text" + } + ], + "blocks": [ + { + "type": "collection-item", + "name": "collection Item", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select Collection" + } + ] + } + ], + "_id": "5feacf62d092d59434f2bf2c", + "name": "collections_listing", + "label": "Collections Listing" + }, + { + "props": [ + { + "type": "code", + "id": "code", + "label": "Custom HTML", + "info": "Add Your custom HTML Code below. You can also use the full screen icon to open a code editor and add your code" + } + ], + "blocks": [], + "_id": "5feacf62d092d509cbf2bf2d", + "name": "custom_html", + "label": "Custom HTML" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "Featured Collection", + "label": "Title" + }, + { + "type": "collection", + "id": "collection", + "label": "Collection", + "info": "Select a collection to display its products" + }, + { + "type": "range", + "id": "items_per_row", + "min": 2, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "horizontal", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides after every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [], + "_id": "5feacf62d092d5acc0f2bf2e", + "name": "featured_collection", + "label": "Featured Collection" + }, + { + "props": [ + { + "id": "image", + "type": "image_picker", + "label": "Hero Image", + "default": "" + }, + { + "id": "overlay_layout", + "type": "select", + "options": [ + { + "value": "left", + "text": "Align Left" + }, + { + "value": "center", + "text": "Align Center" + }, + { + "value": "right", + "text": "Align Right" + } + ], + "default": "left", + "label": "Overlay Layout", + "info": "Alignment of overlay content" + }, + { + "type": "image_picker", + "id": "overlay_image", + "default": "", + "label": "Overlay image", + "info": "Overlay Image" + }, + { + "type": "text", + "id": "overlay_text", + "default": "", + "label": "Overlay Text" + }, + { + "type": "color", + "id": "text_color", + "default": "#000", + "label": "Text Color" + }, + { + "type": "url", + "id": "button_link", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "button_text", + "default": "Shop Now", + "label": "Button Text" + }, + { + "type": "checkbox", + "id": "full_width", + "default": true, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacf62d092d5e884f2bf2f", + "name": "hero_image", + "label": "Hero Image" + }, + { + "props": [ + { + "id": "video_url", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "id": "cover_url", + "type": "url", + "label": "Video Cover Image URL", + "default": "" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "Autoplay", + "info": "Check to enable autoplay of video" + }, + { + "type": "select", + "id": "size", + "options": [ + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "medium", + "label": "Video Height", + "info": "Height of Video" + }, + { + "id": "overlay_position", + "type": "select", + "options": [ + { + "value": "top-left", + "text": "Top Left" + }, + { + "value": "top-center", + "text": "Top Center" + }, + { + "value": "top-right", + "text": "Top Right" + }, + { + "value": "center-left", + "text": "Center Left" + }, + { + "value": "center-center", + "text": "Center (Default)" + }, + { + "value": "center-right", + "text": "Center Right" + }, + { + "value": "bottom-left", + "text": "Bottom Left" + }, + { + "value": "bottom-center", + "text": "Bottom Center" + }, + { + "value": "bottom-right", + "text": "Bottom right" + } + ], + "default": "center-center", + "label": "Overlay position", + "info": "Alignment of Overlay content(heading, sub-heading, button)" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "color", + "id": "heading_color", + "default": "#000", + "label": "Heading Text Color" + }, + { + "type": "text", + "id": "sub_heading", + "default": "", + "label": "Sub-heading" + }, + { + "type": "color", + "id": "sub_heading_color", + "default": "#000", + "label": "Sub-heading Text Color" + }, + { + "type": "url", + "id": "button_link", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "button_text", + "default": "ShopNow", + "label": "Button Text" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacf62d092d5af80f2bf30", + "name": "hero_video", + "label": "Hero Video" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 4, + "step": 1, + "unit": "", + "label": "No of items", + "default": 4, + "info": "Maximum items allowed per row for Horizontal view, for gallery max 5 are viewable and only 5 blocks are required" + }, + { + "type": "text", + "id": "cta_text", + "default": "", + "label": "CTA Text" + }, + { + "type": "url", + "id": "cta_link", + "label": "CTA Link", + "default": "", + "info": "Link to redirect" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image", + "default": "" + }, + { + "type": "text", + "id": "caption", + "label": "Image Caption", + "default": "" + }, + { + "type": "url", + "id": "link", + "label": "Link", + "default": "", + "info": "Link to redirect" + } + ] + } + ], + "_id": "5feacf62d092d54f17f2bf31", + "name": "image_gallery", + "label": "Image Gallery", + "preset": { + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides after every", + "default": 2, + "info": "Autoplay slide duration" + }, + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first image" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "image_slide", + "name": "Slide", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Image" + }, + { + "type": "url", + "id": "slide_link", + "label": "Slide Link" + } + ] + } + ], + "_id": "5feacf62d092d5a6c3f2bf32", + "name": "image_slideshow", + "label": "Image Slideshow", + "preset": { + "blocks": [ + { + "name": "Slide" + }, + { + "name": "Slide" + }, + { + "name": "Slide" + } + ] + } + }, + { + "props": [ + { + "type": "image_picker", + "id": "image", + "default": "", + "label": "Image" + }, + { + "id": "video", + "type": "url", + "label": "Video", + "default": "" + }, + { + "id": "cover", + "type": "url", + "label": "Video Cover Image", + "default": "" + }, + { + "type": "select", + "id": "media_alignment", + "options": [ + { + "value": "left", + "text": "Left" + }, + { + "value": "center", + "text": "Center" + }, + { + "value": "right", + "text": "Right" + } + ], + "default": "left", + "label": "Media Alignment" + }, + { + "type": "text", + "id": "heading", + "default": "Media with Text", + "label": "Heading" + }, + { + "type": "text", + "id": "text", + "default": "Pair large text with an image to give focus to your chosen product, collection, or blog post. Add details on availability, style, or even provide a review.", + "label": "Text" + }, + { + "type": "select", + "id": "text_alignment", + "options": [ + { + "value": "left", + "text": "Left" + }, + { + "value": "center", + "text": "Center" + }, + { + "value": "right", + "text": "Right" + } + ], + "default": "left", + "label": "Text Alignment" + } + ], + "blocks": [], + "_id": "5feacf62d092d55d3af2bf33", + "name": "media_with_text", + "label": "Media with text" + }, + { + "props": [ + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2 + } + ], + "blocks": [ + { + "type": "testimonial", + "name": "Testimonial", + "props": [ + { + "type": "textarea", + "id": "testimonialText", + "label": "Text for Testimonial", + "default": "", + "info": "Text for testimonial", + "placeholder": "Text" + }, + { + "type": "text", + "id": "author_name", + "label": "Author name" + }, + { + "type": "text", + "id": "author_description", + "default": "", + "label": "Author Description" + }, + { + "type": "image_picker", + "id": "author_image", + "default": "", + "label": "Author Image" + } + ] + } + ], + "_id": "5feacf62d092d51a97f2bf34", + "name": "testimonials", + "label": "Testimonial", + "preset": { + "blocks": [ + { + "name": "Testimonial" + }, + { + "name": "Testimonial" + }, + { + "name": "Testimonial" + } + ] + } + } + ], + "sections": [ + { + "page_sections": [], + "page_key": "product-description" + }, + { + "page_sections": [ + { + "blocks": [ + { + "type": "brand_item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Gionee", + "id": "gionee" + } + } + } + }, + { + "type": "brand_item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Gionee", + "id": "gionee" + } + } + } + }, + { + "type": "brand_item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Apple", + "id": "apple" + } + } + } + }, + { + "type": "brand_item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Apple", + "id": "apple" + } + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brands_listing", + "props": { + "title": { + "type": "text", + "value": "test" + }, + "header": { + "type": "header" + }, + "view_options": { + "type": "select", + "value": "fullview" + }, + "brand_type": { + "type": "radio", + "value": "handpicked" + }, + "department": { + "type": "department" + }, + "items_per_row": { + "type": "range", + "value": 3 + }, + "layout": { + "type": "select", + "value": "horizontal" + }, + "cta_text": { + "value": "View all", + "type": "text" + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [], + "page_key": "categories" + }, + { + "page_sections": [], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + } + ], + "application": "5e737afb97e0f586bf9d04db", + "available_pages": [ + { + "path": "product", + "type": "system", + "props": [ + { + "type": "checkbox", + "id": "wishlist", + "label": "Wishlist", + "default": true, + "info": "Show Wishlist for product" + }, + { + "type": "checkbox", + "id": "reviews", + "label": "Review", + "default": true, + "info": "Show Reviews of product" + }, + { + "type": "checkbox", + "id": "add_to_compare", + "label": "Add to Compare", + "default": true, + "info": "Allow comparison of products" + }, + { + "type": "checkbox", + "id": "size_guide", + "label": "Size Guide", + "default": true, + "info": "Show Size Guide" + }, + { + "type": "checkbox", + "id": "product_request", + "label": "Product Request", + "default": true, + "info": "Show Product Request" + }, + { + "type": "checkbox", + "id": "share", + "label": "Share", + "default": true, + "info": "Enable Sharing product" + }, + { + "type": "checkbox", + "id": "store_selection", + "label": "Seller Store Selection", + "default": true, + "info": "Allow to explicitly select stores" + }, + { + "type": "checkbox", + "id": "compare_products", + "label": "Compare Products", + "default": true, + "info": "Show Most Compared Products" + }, + { + "type": "checkbox", + "id": "variants", + "label": "Product Variants", + "default": true, + "info": "Show Product Variants" + }, + { + "type": "checkbox", + "id": "ratings", + "label": "Product Rating", + "default": true, + "info": "Show Product Ratings" + }, + { + "type": "checkbox", + "id": "similar_products", + "label": "Similar Products", + "default": true, + "info": "Show Similar Products" + } + ], + "sections": [], + "text": "Product Description", + "value": "product-description" + }, + { + "path": "collection", + "type": "system", + "props": [], + "sections": [], + "text": "Collection Listing", + "value": "collection-listing" + }, + { + "path": "", + "type": "system", + "props": [], + "sections": [ + { + "_id": "5feacf62d092d581d9f2bf37", + "attributes": { + "page": "home" + } + } + ], + "value": "home", + "text": "Home" + }, + { + "path": "brands", + "type": "system", + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "id": "view_options", + "type": "select", + "options": [ + { + "value": "logo", + "text": "Logo View" + }, + { + "value": "fullview", + "text": "Logo and Banner View" + } + ], + "default": "fullview", + "label": "View Options", + "info": "Brand card view options" + }, + { + "type": "range", + "id": "items_per_row", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 5, + "info": "Maximum items allowed per row" + } + ], + "sections": [], + "value": "brands", + "text": "Brands" + }, + { + "path": "cart/bag", + "type": "system", + "props": [ + { + "type": "checkbox", + "id": "gst", + "label": "GST", + "default": true, + "info": "Show GST on cart" + }, + { + "type": "checkbox", + "id": "staff_selection", + "label": "Staff Selection", + "default": true, + "info": "Show Staff selection on Cart" + }, + { + "type": "checkbox", + "id": "enable_customer", + "label": "Customer", + "default": true, + "info": "Placing on behalf of customer" + }, + { + "type": "checkbox", + "id": "enable_guest", + "label": "Enable Guest Checkout", + "default": true, + "info": "Enable Continue as Guest" + } + ], + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + { + "path": "categories", + "type": "system", + "props": [ + { + "type": "text", + "id": "heading", + "default": "", + "label": "Category List Heading" + }, + { + "type": "range", + "id": "items_per_row", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 5, + "info": "Maximum items allowed per row" + } + ], + "sections": [], + "value": "categories", + "text": "Categories" + }, + { + "path": "collections", + "type": "system", + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "range", + "id": "items_per_row", + "min": 3, + "max": 8, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 5, + "info": "Maximum items allowed per row" + } + ], + "sections": [], + "value": "collections", + "text": "Collections" + }, + { + "path": "compare", + "type": "system", + "props": [], + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + { + "path": "products", + "type": "system", + "props": [], + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + { + "path": "wishlist", + "type": "system", + "props": [], + "sections": [], + "value": "wishlist", + "text": "Wishlist" + }, + { + "path": "sections/test", + "type": "sections", + "props": [ + { + "default": true, + "id": "header", + "label": "Header", + "type": "checkbox" + }, + { + "default": true, + "id": "footer", + "label": "Footer", + "type": "checkbox" + } + ], + "sections": [], + "text": "test", + "value": "test" + } + ], + "styles": {}, + "constants": {}, + "settings": {}, + "created_at": "2020-12-22T05:11:16.027Z", + "updated_at": "2021-02-24T14:03:52.974Z" + } + ], + "page": { + "type": "number", + "current": 1, + "size": 10, + "item_total": 1, + "has_next": false + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### addToThemeLibrary +Add a theme to the theme library + + + + +```swift +client.application("").theme.addToThemeLibrary(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | AddThemeRequestSchema | yes | Request body | + + +Theme library is a personalized collection of themes that are chosen and added from the available themes. Use this API to choose a theme and add it to the theme library. + +*Returned Response:* + + + + +[ThemesSchema](#ThemesSchema) + +Success. Refer `ThemesSchema` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "information": { + "images": { + "desktop": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ], + "android": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "ios": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "thumbnail": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ] + }, + "features": [ + "Responsive" + ], + "name": "Akash-Artisan" + }, + "src": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/sources/J-1s-N-pl-archive.zip" + }, + "assets": { + "css": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/Ia4m885Mw2-themeBundle.css" + }, + "umd_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/nEPGyc15g-themeBundle.umd.min.js" + }, + "common_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/5f7tOB5rpq-themeBundle.common.js" + } + }, + "config": { + "preset": { + "sections": [ + { + "page_sections": [ + { + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219133573.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/men-collection-vcahuo2q" + } + } + }, + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219184350.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/shirts-5e9654ad" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "image-carousel", + "props": { + "slide_height": { + "type": "select", + "value": "adapt" + }, + "autoplay": { + "type": "checkbox", + "value": false + }, + "slide_interval": { + "type": "range", + "value": 2 + } + } + }, + { + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "accessories-7ee89654" + }, + "title": { + "type": "text", + "value": "Turtle sports club" + }, + "subtitle": { + "type": "text", + "value": "Casual Collections" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/casual_nfadbl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Formal Collection" + }, + "subtitle": { + "type": "text", + "value": "Turtle Tailor Mark" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/tailors_nsrrfl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Bottomwear" + }, + "subtitle": { + "type": "text", + "value": "Chinos | Trousers | Pants" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/bottomwear_tdkhn2.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "t-shirt-7ee3cbcd" + }, + "title": { + "type": "text", + "value": "Shirts" + }, + "subtitle": { + "type": "text", + "value": "Casual" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/t-shirt_re9srk.jpg" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionGrid", + "props": { + "title": { + "type": "text", + "value": "Collections" + }, + "subtitle": { + "type": "text", + "value": "Buy from our" + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "department": { + "type": "department", + "value": "others" + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "layout": { + "type": "select", + "value": "grid" + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + } + ] + }, + "global_schema": { + "props": [ + { + "type": "color", + "id": "header_bg_color", + "default": "#ffffff", + "category": "Header", + "label": "Header background Color" + }, + { + "type": "color", + "id": "footer_bg_color", + "default": "#1b1b1b", + "category": "Footer", + "label": "Footer background Color" + }, + { + "type": "text", + "id": "footer_text", + "default": "", + "category": "Footer", + "label": "Footer Text" + }, + { + "type": "checkbox", + "id": "disable_cart", + "default": false, + "category": "Cart", + "label": "Disable Cart" + } + ] + }, + "current": "default", + "page_schema": [ + { + "props": [], + "_id": "5fe182f763d26d042fd205c4", + "page": "add-product-review" + }, + { + "props": [], + "_id": "5fe182f763d26dadc8d205c6", + "page": "blog" + }, + { + "props": [], + "_id": "5fe182f763d26d0a36d205c7", + "page": "brands" + }, + { + "props": [ + { + "type": "checkbox", + "id": "gst", + "label": "GST", + "default": true, + "info": "Show GST on cart" + }, + { + "type": "checkbox", + "id": "staff_selection", + "label": "Staff Selection", + "default": true, + "info": "Show Staff selection on Cart" + }, + { + "type": "checkbox", + "id": "enable_customer", + "label": "Customer", + "default": true, + "info": "Placing on behalf of customer" + }, + { + "type": "checkbox", + "id": "enable_guest", + "label": "Enable Guest Checkout", + "default": true, + "info": "Enable Continue as Guest" + } + ], + "_id": "5fe182f763d26d81c5d205c8", + "page": "cart-landing" + }, + { + "props": [], + "_id": "5fe182f763d26d7e15d205c9", + "page": "cart-review" + }, + { + "props": [], + "_id": "5fe182f763d26d270ed205ca", + "page": "categories" + }, + { + "props": [], + "_id": "5fe182f763d26d9b4fd205cb", + "page": "collection-listing" + }, + { + "props": [], + "_id": "5fe182f763d26da6ecd205cc", + "page": "collections" + }, + { + "props": [], + "_id": "5fe182f763d26d7156d205cd", + "page": "compare-products" + }, + { + "props": [], + "_id": "5fe182f763d26d62bad205ce", + "page": "home" + }, + { + "props": [], + "_id": "5fe182f763d26d5afcd205cf", + "page": "order-review" + }, + { + "props": [], + "_id": "5fe182f763d26def8dd205d0", + "page": "order-tracking-details" + }, + { + "props": [], + "_id": "5fe182f763d26d381fd205d1", + "page": "order-tracking" + }, + { + "props": [ + { + "type": "text", + "id": "shipping_link", + "label": "Shipping Link", + "default": "https://fynd.freshdesk.com/support/solutions/folders/33000111600", + "info": "Link of shipping page" + }, + { + "type": "checkbox", + "id": "original_image", + "label": "Use original Image", + "default": false, + "info": "Use original product image." + }, + { + "type": "checkbox", + "id": "wishlist", + "label": "Wishlist", + "default": true, + "info": "Show Wishlist for product" + }, + { + "type": "checkbox", + "id": "reviews", + "label": "Review", + "default": true, + "info": "Show Reviews of product" + }, + { + "type": "checkbox", + "id": "add_to_compare", + "label": "Add to Compare", + "default": true, + "info": "Allow comparison of products" + }, + { + "type": "checkbox", + "id": "size_guide", + "label": "Size Guide", + "default": true, + "info": "Show Size Guide" + }, + { + "type": "checkbox", + "id": "product_request", + "label": "Product Request", + "default": true, + "info": "Show Product Request" + }, + { + "type": "checkbox", + "id": "share", + "label": "Share", + "default": true, + "info": "Enable Sharing product" + }, + { + "type": "checkbox", + "id": "sold_by", + "label": "Show Sold By", + "default": true, + "info": "Show name of the store" + }, + { + "type": "checkbox", + "id": "store_selection", + "label": "Seller Store Selection", + "default": true, + "info": "Allow to explicitly select stores" + }, + { + "type": "checkbox", + "id": "compare_products", + "label": "Compare Products", + "default": true, + "info": "Show Most Compared Products" + }, + { + "type": "checkbox", + "id": "variants", + "label": "Product Variants", + "default": true, + "info": "Show Product Variants" + }, + { + "type": "checkbox", + "id": "ratings", + "label": "Product Rating", + "default": true, + "info": "Show Product Ratings" + }, + { + "type": "checkbox", + "id": "similar_products", + "label": "Similar Products", + "default": true, + "info": "Show Similar Products" + }, + { + "type": "checkbox", + "id": "bulk_prices", + "label": "Bulk Prices", + "default": true, + "info": "Show Bulk Prices" + }, + { + "type": "checkbox", + "id": "showDeliveryInfo", + "label": "Delivery Info", + "default": true, + "info": "Show Delivery Date" + } + ], + "_id": "5fe182f763d26d29bbd205d2", + "page": "product-description" + }, + { + "props": [], + "_id": "5fe182f763d26da5f0d205d3", + "page": "product-listing" + }, + { + "props": [], + "_id": "5fe182f763d26d3d18d205d4", + "page": "product-reviews" + }, + { + "props": [], + "_id": "5fe182f763d26d4e2dd205d5", + "page": "wishlist" + }, + { + "props": [ + { + "default": true, + "id": "header", + "label": "Header", + "type": "checkbox" + }, + { + "default": true, + "id": "footer", + "label": "Footer", + "type": "checkbox" + } + ], + "_id": "5fe7166cbaae343115de8555", + "page": "tesr" + } + ], + "list": [ + { + "name": "default", + "global_config": { + "static": { + "props": { + "colors": { + "primary_color": "#7043f7", + "secondary_color": "#02d1cb", + "accent_color": "#FFFFFF", + "link_color": "#7043f7", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "disable_cart": false + } + } + }, + "page": [ + { + "settings": { + "props": { + "show_info_message": true + } + }, + "page": "cart-landing" + } + ], + "_id": "5fc4bb9078e957737e7d79a3" + } + ] + }, + "colors": { + "primary_color": "#41434C", + "secondary_color": "#41434C", + "accent_color": "#FFFFFF", + "link_color": "#33B1C0", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + }, + "font": { + "variants": { + "light": { + "name": "300", + "file": "" + }, + "regular": { + "name": "regular", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVRS0Fbvbc14VxRD7N01bV7kg.ttf" + }, + "medium": { + "name": "500", + "file": "" + }, + "semi_bold": { + "name": "600", + "file": "" + }, + "bold": { + "name": "700", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVSS0Fbvbc14Vxps5xQ3Z5nm29Gww.ttf" + } + }, + "family": "Judson" + }, + "applied": true, + "published": false, + "archived": false, + "customized": true, + "version": "1.1.19", + "tags": [], + "_id": "5fe17f7063d26dc54fd202b4", + "pages": { + "home": { + "path": "", + "type": "system", + "sections": [], + "value": "home", + "text": "Home" + }, + "brands": { + "path": "brands", + "type": "system", + "sections": [], + "value": "brands", + "text": "Brands" + }, + "cart-landing": { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + "categories": { + "path": "categories", + "type": "system", + "sections": [], + "value": "categories", + "text": "Categories" + }, + "collections": { + "path": "collections", + "type": "system", + "sections": [], + "value": "collections", + "text": "Collections" + }, + "compare-products": { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + "product-description": { + "path": "product", + "type": "system", + "sections": [], + "value": "product-description", + "text": "Product Description" + }, + "product-listing": { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + "collection-listing": { + "path": "collection", + "type": "system", + "sections": [], + "value": "collection-listing", + "text": "COllection Listing" + }, + "wishlist": { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + } + }, + "available_sections": [ + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Brands", + "label": "Brands Heading" + }, + { + "type": "radio", + "id": "brand_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "department", + "text": "Department" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "department", + "id": "department", + "label": "Department", + "info": "Select a department of brands", + "note": "Department only applies if 'department' type is selected" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": [ + { + "type": "brand", + "id": "brand", + "label": "Select Brand" + } + ] + } + ], + "_id": "5feacca5bec232d59b89283a", + "name": "brandTemplate", + "label": "Brands List Page" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Categories", + "label": "Categories Heading" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All", + "info": "Check to show View All Button" + } + ], + "blocks": [], + "_id": "5feacca5bec232404189283b", + "name": "categoriesTemplate", + "label": "Categories Page" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Subtitle" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Background image", + "info": "Background Image" + }, + { + "type": "text", + "id": "title", + "default": "", + "label": "Overlay title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Overlay subtitle" + } + ] + } + ], + "_id": "5feacca5bec2321fd589283c", + "name": "collectionGrid", + "label": "Collection Grid" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collection List", + "label": "Collection Heading", + "info": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + } + ] + } + ], + "_id": "5feacca5bec2323bf689283d", + "name": "collectionList", + "label": "Collection List" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "radio", + "id": "collection_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "collection-item", + "name": "Collection Item", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select collection" + } + ] + } + ], + "_id": "5feacca5bec23263b489283e", + "name": "collectionTemplate", + "label": "Collection List Page" + }, + { + "props": [ + { + "type": "code", + "id": "code", + "label": "Custom HTML", + "info": "Add Your custom HTML Code below. You can also use the full screen icon to open a code editor and add your code" + } + ], + "blocks": [], + "_id": "5feacca5bec232409489283f", + "name": "customHtml", + "label": "Custom HTML" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Products", + "label": "Section Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "product", + "name": "Product", + "props": [ + { + "type": "product", + "id": "product", + "label": "Select a Product", + "info": "Product Item to be displayed" + } + ] + } + ], + "_id": "5feacca5bec2326213892840", + "name": "featuredProducts", + "label": "Featured Products", + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "props": [ + { + "type": "range", + "id": "item_count", + "min": 1, + "max": 4, + "step": 1, + "unit": "", + "label": "No of items", + "default": 4, + "info": "Maximum items allowed per row" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image", + "default": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1603773049684.svg" + }, + { + "type": "text", + "id": "caption", + "label": "Image Caption", + "default": "" + }, + { + "type": "url", + "id": "link", + "label": "Link", + "default": "", + "info": "Link to redirect" + } + ] + } + ], + "_id": "5feacca5bec2321047892841", + "name": "gallery", + "label": "Gallery", + "preset": { + "props": { + "item_count": 4 + }, + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec232b085892842", + "name": "heroBanner", + "label": "Hero Banner" + }, + { + "props": [ + { + "id": "image", + "type": "image_picker", + "label": "Hero Image", + "default": "" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "overlayLayout", + "type": "select", + "options": [ + { + "value": "left", + "text": "Align Left" + }, + { + "value": "center", + "text": "Align Center" + }, + { + "value": "right", + "text": "Align Right" + } + ], + "default": "left", + "label": "Overlay Layout", + "info": "Alignment of overlay content" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Overlay image", + "info": "Overlay Image" + }, + { + "type": "text", + "id": "text", + "default": "", + "label": "Overlay Text" + }, + { + "type": "color", + "id": "text_color", + "default": "#000", + "label": "Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "Shop Now", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec2321e74892843", + "name": "imageBanner", + "label": "Hero Image" + }, + { + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "coverUrl", + "type": "image_picker", + "label": "Video Cover Image URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + }, + { + "type": "select", + "id": "size", + "options": [ + { + "value": "adapt", + "text": "Adapt" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Video Height", + "info": "Height of Video" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "color", + "id": "heading_color", + "default": "#000", + "label": "Headin Text Color" + }, + { + "type": "text", + "id": "subHeading", + "default": "", + "label": "Sub-heading" + }, + { + "type": "color", + "id": "subheading_color", + "default": "#000", + "label": "Subheading Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "ShopNow", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec232bfc8892844", + "name": "videoBanner", + "label": "Hero Video" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first image" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides after every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image" + }, + { + "type": "url", + "id": "slide_link", + "label": "Slide Link" + } + ] + } + ], + "_id": "5feacca5bec232a916892845", + "name": "image-carousel", + "label": "Image Carousel", + "preset": { + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 2, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "collection", + "id": "collection", + "label": "Collection", + "info": "Select a collection to display its products" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec23258ec892846", + "name": "productList", + "label": "Product List", + "preset": { + "props": { + "heading": "Featured Products", + "item_count": 4, + "collection": "" + } + } + }, + { + "props": [ + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2 + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "testimonial", + "name": "Testimonial", + "props": [ + { + "type": "textarea", + "id": "testimonialText", + "label": "Text for Testimonial", + "default": "", + "info": "Text for testimonial", + "placeholder": "Text" + }, + { + "type": "text", + "id": "author", + "label": "Customers name" + } + ] + } + ], + "_id": "5feacca5bec23299e8892847", + "name": "testimonials", + "label": "Testimonial" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first video" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "video_item", + "name": "Video Slide", + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + } + ] + } + ], + "_id": "5feacca5bec232d89b892848", + "name": "videoCarousel", + "label": "Video Carousel" + } + ], + "sections": [ + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "Brands" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "department": { + "type": "department", + "value": null + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": null + } + } + } + ], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "collection-listing" + }, + { + "page_sections": [ + { + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Apple", + "id": "apple" + } + } + } + }, + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Gionee", + "id": "gionee" + } + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "heading": { + "type": "text", + "value": "Brandss" + }, + "brand_type": { + "type": "radio", + "value": "handpicked" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 4, + "type": "range" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + }, + { + "page_sections": [], + "page_key": "tesr" + } + ], + "application": "5e737afb97e0f586bf9d04db", + "available_pages": [ + { + "path": "product", + "type": "system", + "sections": [], + "text": "Product Description", + "value": "product-description" + }, + { + "path": "collection", + "type": "system", + "sections": [], + "text": "Collection Listing", + "value": "collection-listing" + }, + { + "path": "", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2327927892853", + "attributes": { + "page": "home" + } + } + ], + "value": "home", + "text": "Home" + }, + { + "path": "brands", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2326422892854", + "attributes": { + "page": "brands" + } + } + ], + "value": "brands", + "text": "Brands" + }, + { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + { + "path": "categories", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec232424c892855", + "attributes": { + "page": "categories" + } + } + ], + "value": "categories", + "text": "Categories" + }, + { + "path": "collections", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec23281de892856", + "attributes": { + "page": "collections" + } + } + ], + "value": "collections", + "text": "Collections" + }, + { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + }, + { + "path": "sections/test", + "type": "sections", + "sections": [], + "text": "test", + "value": "test" + } + ], + "styles": {}, + "constants": {}, + "settings": {}, + "created_at": "2020-12-22T05:09:04.720Z", + "updated_at": "2021-01-24T11:22:41.376Z" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### applyTheme +Apply a theme + + + + +```swift +client.application("").theme.applyTheme(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | AddThemeRequestSchema | yes | Request body | + + +Use this API to apply a theme to the website. + +*Returned Response:* + + + + +[ThemesSchema](#ThemesSchema) + +Success. Refer `ThemesSchema` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "information": { + "images": { + "desktop": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ], + "android": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "ios": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "thumbnail": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ] + }, + "features": [ + "Responsive" + ], + "name": "Akash-Artisan" + }, + "src": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/sources/J-1s-N-pl-archive.zip" + }, + "assets": { + "css": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/Ia4m885Mw2-themeBundle.css" + }, + "umd_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/nEPGyc15g-themeBundle.umd.min.js" + }, + "common_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/5f7tOB5rpq-themeBundle.common.js" + } + }, + "config": { + "preset": { + "sections": [ + { + "page_sections": [ + { + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219133573.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/men-collection-vcahuo2q" + } + } + }, + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219184350.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/shirts-5e9654ad" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "image-carousel", + "props": { + "slide_height": { + "type": "select", + "value": "adapt" + }, + "autoplay": { + "type": "checkbox", + "value": false + }, + "slide_interval": { + "type": "range", + "value": 2 + } + } + }, + { + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "accessories-7ee89654" + }, + "title": { + "type": "text", + "value": "Turtle sports club" + }, + "subtitle": { + "type": "text", + "value": "Casual Collections" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/casual_nfadbl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Formal Collection" + }, + "subtitle": { + "type": "text", + "value": "Turtle Tailor Mark" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/tailors_nsrrfl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Bottomwear" + }, + "subtitle": { + "type": "text", + "value": "Chinos | Trousers | Pants" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/bottomwear_tdkhn2.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "t-shirt-7ee3cbcd" + }, + "title": { + "type": "text", + "value": "Shirts" + }, + "subtitle": { + "type": "text", + "value": "Casual" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/t-shirt_re9srk.jpg" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionGrid", + "props": { + "title": { + "type": "text", + "value": "Collections" + }, + "subtitle": { + "type": "text", + "value": "Buy from our" + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "department": { + "type": "department", + "value": "others" + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "layout": { + "type": "select", + "value": "grid" + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + } + ] + }, + "global_schema": { + "props": [ + { + "type": "color", + "id": "header_bg_color", + "default": "#ffffff", + "category": "Header", + "label": "Header background Color" + }, + { + "type": "color", + "id": "footer_bg_color", + "default": "#1b1b1b", + "category": "Footer", + "label": "Footer background Color" + }, + { + "type": "text", + "id": "footer_text", + "default": "", + "category": "Footer", + "label": "Footer Text" + }, + { + "type": "checkbox", + "id": "disable_cart", + "default": false, + "category": "Cart", + "label": "Disable Cart" + } + ] + }, + "current": "default", + "page_schema": [ + { + "props": [], + "_id": "5fe182f763d26d042fd205c4", + "page": "add-product-review" + }, + { + "props": [], + "_id": "5fe182f763d26dadc8d205c6", + "page": "blog" + }, + { + "props": [], + "_id": "5fe182f763d26d0a36d205c7", + "page": "brands" + }, + { + "props": [ + { + "type": "checkbox", + "id": "gst", + "label": "GST", + "default": true, + "info": "Show GST on cart" + }, + { + "type": "checkbox", + "id": "staff_selection", + "label": "Staff Selection", + "default": true, + "info": "Show Staff selection on Cart" + }, + { + "type": "checkbox", + "id": "enable_customer", + "label": "Customer", + "default": true, + "info": "Placing on behalf of customer" + }, + { + "type": "checkbox", + "id": "enable_guest", + "label": "Enable Guest Checkout", + "default": true, + "info": "Enable Continue as Guest" + } + ], + "_id": "5fe182f763d26d81c5d205c8", + "page": "cart-landing" + }, + { + "props": [], + "_id": "5fe182f763d26d7e15d205c9", + "page": "cart-review" + }, + { + "props": [], + "_id": "5fe182f763d26d270ed205ca", + "page": "categories" + }, + { + "props": [], + "_id": "5fe182f763d26d9b4fd205cb", + "page": "collection-listing" + }, + { + "props": [], + "_id": "5fe182f763d26da6ecd205cc", + "page": "collections" + }, + { + "props": [], + "_id": "5fe182f763d26d7156d205cd", + "page": "compare-products" + }, + { + "props": [], + "_id": "5fe182f763d26d62bad205ce", + "page": "home" + }, + { + "props": [], + "_id": "5fe182f763d26d5afcd205cf", + "page": "order-review" + }, + { + "props": [], + "_id": "5fe182f763d26def8dd205d0", + "page": "order-tracking-details" + }, + { + "props": [], + "_id": "5fe182f763d26d381fd205d1", + "page": "order-tracking" + }, + { + "props": [ + { + "type": "text", + "id": "shipping_link", + "label": "Shipping Link", + "default": "https://fynd.freshdesk.com/support/solutions/folders/33000111600", + "info": "Link of shipping page" + }, + { + "type": "checkbox", + "id": "original_image", + "label": "Use original Image", + "default": false, + "info": "Use original product image." + }, + { + "type": "checkbox", + "id": "wishlist", + "label": "Wishlist", + "default": true, + "info": "Show Wishlist for product" + }, + { + "type": "checkbox", + "id": "reviews", + "label": "Review", + "default": true, + "info": "Show Reviews of product" + }, + { + "type": "checkbox", + "id": "add_to_compare", + "label": "Add to Compare", + "default": true, + "info": "Allow comparison of products" + }, + { + "type": "checkbox", + "id": "size_guide", + "label": "Size Guide", + "default": true, + "info": "Show Size Guide" + }, + { + "type": "checkbox", + "id": "product_request", + "label": "Product Request", + "default": true, + "info": "Show Product Request" + }, + { + "type": "checkbox", + "id": "share", + "label": "Share", + "default": true, + "info": "Enable Sharing product" + }, + { + "type": "checkbox", + "id": "sold_by", + "label": "Show Sold By", + "default": true, + "info": "Show name of the store" + }, + { + "type": "checkbox", + "id": "store_selection", + "label": "Seller Store Selection", + "default": true, + "info": "Allow to explicitly select stores" + }, + { + "type": "checkbox", + "id": "compare_products", + "label": "Compare Products", + "default": true, + "info": "Show Most Compared Products" + }, + { + "type": "checkbox", + "id": "variants", + "label": "Product Variants", + "default": true, + "info": "Show Product Variants" + }, + { + "type": "checkbox", + "id": "ratings", + "label": "Product Rating", + "default": true, + "info": "Show Product Ratings" + }, + { + "type": "checkbox", + "id": "similar_products", + "label": "Similar Products", + "default": true, + "info": "Show Similar Products" + }, + { + "type": "checkbox", + "id": "bulk_prices", + "label": "Bulk Prices", + "default": true, + "info": "Show Bulk Prices" + }, + { + "type": "checkbox", + "id": "showDeliveryInfo", + "label": "Delivery Info", + "default": true, + "info": "Show Delivery Date" + } + ], + "_id": "5fe182f763d26d29bbd205d2", + "page": "product-description" + }, + { + "props": [], + "_id": "5fe182f763d26da5f0d205d3", + "page": "product-listing" + }, + { + "props": [], + "_id": "5fe182f763d26d3d18d205d4", + "page": "product-reviews" + }, + { + "props": [], + "_id": "5fe182f763d26d4e2dd205d5", + "page": "wishlist" + }, + { + "props": [ + { + "default": true, + "id": "header", + "label": "Header", + "type": "checkbox" + }, + { + "default": true, + "id": "footer", + "label": "Footer", + "type": "checkbox" + } + ], + "_id": "5fe7166cbaae343115de8555", + "page": "tesr" + } + ], + "list": [ + { + "name": "default", + "global_config": { + "static": { + "props": { + "colors": { + "primary_color": "#7043f7", + "secondary_color": "#02d1cb", + "accent_color": "#FFFFFF", + "link_color": "#7043f7", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "disable_cart": false + } + } + }, + "page": [ + { + "settings": { + "props": { + "show_info_message": true + } + }, + "page": "cart-landing" + } + ], + "_id": "5fc4bb9078e957737e7d79a3" + } + ] + }, + "colors": { + "primary_color": "#41434C", + "secondary_color": "#41434C", + "accent_color": "#FFFFFF", + "link_color": "#33B1C0", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + }, + "font": { + "variants": { + "light": { + "name": "300", + "file": "" + }, + "regular": { + "name": "regular", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVRS0Fbvbc14VxRD7N01bV7kg.ttf" + }, + "medium": { + "name": "500", + "file": "" + }, + "semi_bold": { + "name": "600", + "file": "" + }, + "bold": { + "name": "700", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVSS0Fbvbc14Vxps5xQ3Z5nm29Gww.ttf" + } + }, + "family": "Judson" + }, + "applied": true, + "published": false, + "archived": false, + "customized": true, + "version": "1.1.19", + "tags": [], + "_id": "5fe17f7063d26dc54fd202b4", + "pages": { + "home": { + "path": "", + "type": "system", + "sections": [], + "value": "home", + "text": "Home" + }, + "brands": { + "path": "brands", + "type": "system", + "sections": [], + "value": "brands", + "text": "Brands" + }, + "cart-landing": { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + "categories": { + "path": "categories", + "type": "system", + "sections": [], + "value": "categories", + "text": "Categories" + }, + "collections": { + "path": "collections", + "type": "system", + "sections": [], + "value": "collections", + "text": "Collections" + }, + "compare-products": { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + "product-description": { + "path": "product", + "type": "system", + "sections": [], + "value": "product-description", + "text": "Product Description" + }, + "product-listing": { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + "collection-listing": { + "path": "collection", + "type": "system", + "sections": [], + "value": "collection-listing", + "text": "COllection Listing" + }, + "wishlist": { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + } + }, + "available_sections": [ + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Brands", + "label": "Brands Heading" + }, + { + "type": "radio", + "id": "brand_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "department", + "text": "Department" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "department", + "id": "department", + "label": "Department", + "info": "Select a department of brands", + "note": "Department only applies if 'department' type is selected" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": [ + { + "type": "brand", + "id": "brand", + "label": "Select Brand" + } + ] + } + ], + "_id": "5feacca5bec232d59b89283a", + "name": "brandTemplate", + "label": "Brands List Page" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Categories", + "label": "Categories Heading" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All", + "info": "Check to show View All Button" + } + ], + "blocks": [], + "_id": "5feacca5bec232404189283b", + "name": "categoriesTemplate", + "label": "Categories Page" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Subtitle" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Background image", + "info": "Background Image" + }, + { + "type": "text", + "id": "title", + "default": "", + "label": "Overlay title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Overlay subtitle" + } + ] + } + ], + "_id": "5feacca5bec2321fd589283c", + "name": "collectionGrid", + "label": "Collection Grid" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collection List", + "label": "Collection Heading", + "info": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + } + ] + } + ], + "_id": "5feacca5bec2323bf689283d", + "name": "collectionList", + "label": "Collection List" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "radio", + "id": "collection_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "collection-item", + "name": "Collection Item", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select collection" + } + ] + } + ], + "_id": "5feacca5bec23263b489283e", + "name": "collectionTemplate", + "label": "Collection List Page" + }, + { + "props": [ + { + "type": "code", + "id": "code", + "label": "Custom HTML", + "info": "Add Your custom HTML Code below. You can also use the full screen icon to open a code editor and add your code" + } + ], + "blocks": [], + "_id": "5feacca5bec232409489283f", + "name": "customHtml", + "label": "Custom HTML" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Products", + "label": "Section Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "product", + "name": "Product", + "props": [ + { + "type": "product", + "id": "product", + "label": "Select a Product", + "info": "Product Item to be displayed" + } + ] + } + ], + "_id": "5feacca5bec2326213892840", + "name": "featuredProducts", + "label": "Featured Products", + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "props": [ + { + "type": "range", + "id": "item_count", + "min": 1, + "max": 4, + "step": 1, + "unit": "", + "label": "No of items", + "default": 4, + "info": "Maximum items allowed per row" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image", + "default": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1603773049684.svg" + }, + { + "type": "text", + "id": "caption", + "label": "Image Caption", + "default": "" + }, + { + "type": "url", + "id": "link", + "label": "Link", + "default": "", + "info": "Link to redirect" + } + ] + } + ], + "_id": "5feacca5bec2321047892841", + "name": "gallery", + "label": "Gallery", + "preset": { + "props": { + "item_count": 4 + }, + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec232b085892842", + "name": "heroBanner", + "label": "Hero Banner" + }, + { + "props": [ + { + "id": "image", + "type": "image_picker", + "label": "Hero Image", + "default": "" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "overlayLayout", + "type": "select", + "options": [ + { + "value": "left", + "text": "Align Left" + }, + { + "value": "center", + "text": "Align Center" + }, + { + "value": "right", + "text": "Align Right" + } + ], + "default": "left", + "label": "Overlay Layout", + "info": "Alignment of overlay content" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Overlay image", + "info": "Overlay Image" + }, + { + "type": "text", + "id": "text", + "default": "", + "label": "Overlay Text" + }, + { + "type": "color", + "id": "text_color", + "default": "#000", + "label": "Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "Shop Now", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec2321e74892843", + "name": "imageBanner", + "label": "Hero Image" + }, + { + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "coverUrl", + "type": "image_picker", + "label": "Video Cover Image URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + }, + { + "type": "select", + "id": "size", + "options": [ + { + "value": "adapt", + "text": "Adapt" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Video Height", + "info": "Height of Video" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "color", + "id": "heading_color", + "default": "#000", + "label": "Headin Text Color" + }, + { + "type": "text", + "id": "subHeading", + "default": "", + "label": "Sub-heading" + }, + { + "type": "color", + "id": "subheading_color", + "default": "#000", + "label": "Subheading Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "ShopNow", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec232bfc8892844", + "name": "videoBanner", + "label": "Hero Video" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first image" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides after every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image" + }, + { + "type": "url", + "id": "slide_link", + "label": "Slide Link" + } + ] + } + ], + "_id": "5feacca5bec232a916892845", + "name": "image-carousel", + "label": "Image Carousel", + "preset": { + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 2, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "collection", + "id": "collection", + "label": "Collection", + "info": "Select a collection to display its products" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec23258ec892846", + "name": "productList", + "label": "Product List", + "preset": { + "props": { + "heading": "Featured Products", + "item_count": 4, + "collection": "" + } + } + }, + { + "props": [ + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2 + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "testimonial", + "name": "Testimonial", + "props": [ + { + "type": "textarea", + "id": "testimonialText", + "label": "Text for Testimonial", + "default": "", + "info": "Text for testimonial", + "placeholder": "Text" + }, + { + "type": "text", + "id": "author", + "label": "Customers name" + } + ] + } + ], + "_id": "5feacca5bec23299e8892847", + "name": "testimonials", + "label": "Testimonial" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first video" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "video_item", + "name": "Video Slide", + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + } + ] + } + ], + "_id": "5feacca5bec232d89b892848", + "name": "videoCarousel", + "label": "Video Carousel" + } + ], + "sections": [ + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "Brands" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "department": { + "type": "department", + "value": null + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": null + } + } + } + ], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "collection-listing" + }, + { + "page_sections": [ + { + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Apple", + "id": "apple" + } + } + } + }, + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Gionee", + "id": "gionee" + } + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "heading": { + "type": "text", + "value": "Brandss" + }, + "brand_type": { + "type": "radio", + "value": "handpicked" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 4, + "type": "range" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + }, + { + "page_sections": [], + "page_key": "tesr" + } + ], + "application": "5e737afb97e0f586bf9d04db", + "available_pages": [ + { + "path": "product", + "type": "system", + "sections": [], + "text": "Product Description", + "value": "product-description" + }, + { + "path": "collection", + "type": "system", + "sections": [], + "text": "Collection Listing", + "value": "collection-listing" + }, + { + "path": "", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2327927892853", + "attributes": { + "page": "home" + } + } + ], + "value": "home", + "text": "Home" + }, + { + "path": "brands", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2326422892854", + "attributes": { + "page": "brands" + } + } + ], + "value": "brands", + "text": "Brands" + }, + { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + { + "path": "categories", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec232424c892855", + "attributes": { + "page": "categories" + } + } + ], + "value": "categories", + "text": "Categories" + }, + { + "path": "collections", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec23281de892856", + "attributes": { + "page": "collections" + } + } + ], + "value": "collections", + "text": "Collections" + }, + { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + }, + { + "path": "sections/test", + "type": "sections", + "sections": [], + "text": "test", + "value": "test" + } + ], + "styles": {}, + "constants": {}, + "settings": {}, + "created_at": "2020-12-22T05:09:04.720Z", + "updated_at": "2021-01-24T11:22:41.376Z" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### isUpgradable +Checks if theme is upgradable + + + + +```swift +client.application("").theme.isUpgradable(themeId: themeId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| themeId | String | yes | Theme ID | + + + +There's always a possibility that new features get added to a theme. Use this API to check if the applied theme has an upgrade available. + +*Returned Response:* + + + + +[UpgradableThemeSchema](#UpgradableThemeSchema) + +Success. If the boolean value of `upgrade` returns **true**, the theme can be upgraded. Refer `UpgradableThemeSchema` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "parent_theme": "1.0.1", + "applied_theme": "1.0.0", + "upgrade": true + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### upgradeTheme +Upgrade a theme + + + + +```swift +client.application("").theme.upgradeTheme(themeId: themeId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| themeId | String | yes | ID allotted to the theme. | + + + +Use this API to upgrade the current theme to its latest version. + +*Returned Response:* + + + + +[ThemesSchema](#ThemesSchema) + +Success. Upgrades the theme and shares the details of the new version in the response. Refer `ThemesSchema` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "information": { + "images": { + "desktop": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ], + "android": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "ios": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "thumbnail": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ] + }, + "features": [ + "Responsive" + ], + "name": "Akash-Artisan" + }, + "src": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/sources/J-1s-N-pl-archive.zip" + }, + "assets": { + "css": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/Ia4m885Mw2-themeBundle.css" + }, + "umd_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/nEPGyc15g-themeBundle.umd.min.js" + }, + "common_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/5f7tOB5rpq-themeBundle.common.js" + } + }, + "config": { + "preset": { + "sections": [ + { + "page_sections": [ + { + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219133573.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/men-collection-vcahuo2q" + } + } + }, + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219184350.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/shirts-5e9654ad" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "image-carousel", + "props": { + "slide_height": { + "type": "select", + "value": "adapt" + }, + "autoplay": { + "type": "checkbox", + "value": false + }, + "slide_interval": { + "type": "range", + "value": 2 + } + } + }, + { + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "accessories-7ee89654" + }, + "title": { + "type": "text", + "value": "Turtle sports club" + }, + "subtitle": { + "type": "text", + "value": "Casual Collections" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/casual_nfadbl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Formal Collection" + }, + "subtitle": { + "type": "text", + "value": "Turtle Tailor Mark" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/tailors_nsrrfl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Bottomwear" + }, + "subtitle": { + "type": "text", + "value": "Chinos | Trousers | Pants" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/bottomwear_tdkhn2.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "t-shirt-7ee3cbcd" + }, + "title": { + "type": "text", + "value": "Shirts" + }, + "subtitle": { + "type": "text", + "value": "Casual" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/t-shirt_re9srk.jpg" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionGrid", + "props": { + "title": { + "type": "text", + "value": "Collections" + }, + "subtitle": { + "type": "text", + "value": "Buy from our" + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "department": { + "type": "department", + "value": "others" + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "layout": { + "type": "select", + "value": "grid" + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + } + ] + }, + "global_schema": { + "props": [ + { + "type": "color", + "id": "header_bg_color", + "default": "#ffffff", + "category": "Header", + "label": "Header background Color" + }, + { + "type": "color", + "id": "footer_bg_color", + "default": "#1b1b1b", + "category": "Footer", + "label": "Footer background Color" + }, + { + "type": "text", + "id": "footer_text", + "default": "", + "category": "Footer", + "label": "Footer Text" + }, + { + "type": "checkbox", + "id": "disable_cart", + "default": false, + "category": "Cart", + "label": "Disable Cart" + } + ] + }, + "current": "default", + "page_schema": [ + { + "props": [], + "_id": "5fe182f763d26d042fd205c4", + "page": "add-product-review" + }, + { + "props": [], + "_id": "5fe182f763d26dadc8d205c6", + "page": "blog" + }, + { + "props": [], + "_id": "5fe182f763d26d0a36d205c7", + "page": "brands" + }, + { + "props": [ + { + "type": "checkbox", + "id": "gst", + "label": "GST", + "default": true, + "info": "Show GST on cart" + }, + { + "type": "checkbox", + "id": "staff_selection", + "label": "Staff Selection", + "default": true, + "info": "Show Staff selection on Cart" + }, + { + "type": "checkbox", + "id": "enable_customer", + "label": "Customer", + "default": true, + "info": "Placing on behalf of customer" + }, + { + "type": "checkbox", + "id": "enable_guest", + "label": "Enable Guest Checkout", + "default": true, + "info": "Enable Continue as Guest" + } + ], + "_id": "5fe182f763d26d81c5d205c8", + "page": "cart-landing" + }, + { + "props": [], + "_id": "5fe182f763d26d7e15d205c9", + "page": "cart-review" + }, + { + "props": [], + "_id": "5fe182f763d26d270ed205ca", + "page": "categories" + }, + { + "props": [], + "_id": "5fe182f763d26d9b4fd205cb", + "page": "collection-listing" + }, + { + "props": [], + "_id": "5fe182f763d26da6ecd205cc", + "page": "collections" + }, + { + "props": [], + "_id": "5fe182f763d26d7156d205cd", + "page": "compare-products" + }, + { + "props": [], + "_id": "5fe182f763d26d62bad205ce", + "page": "home" + }, + { + "props": [], + "_id": "5fe182f763d26d5afcd205cf", + "page": "order-review" + }, + { + "props": [], + "_id": "5fe182f763d26def8dd205d0", + "page": "order-tracking-details" + }, + { + "props": [], + "_id": "5fe182f763d26d381fd205d1", + "page": "order-tracking" + }, + { + "props": [ + { + "type": "text", + "id": "shipping_link", + "label": "Shipping Link", + "default": "https://fynd.freshdesk.com/support/solutions/folders/33000111600", + "info": "Link of shipping page" + }, + { + "type": "checkbox", + "id": "original_image", + "label": "Use original Image", + "default": false, + "info": "Use original product image." + }, + { + "type": "checkbox", + "id": "wishlist", + "label": "Wishlist", + "default": true, + "info": "Show Wishlist for product" + }, + { + "type": "checkbox", + "id": "reviews", + "label": "Review", + "default": true, + "info": "Show Reviews of product" + }, + { + "type": "checkbox", + "id": "add_to_compare", + "label": "Add to Compare", + "default": true, + "info": "Allow comparison of products" + }, + { + "type": "checkbox", + "id": "size_guide", + "label": "Size Guide", + "default": true, + "info": "Show Size Guide" + }, + { + "type": "checkbox", + "id": "product_request", + "label": "Product Request", + "default": true, + "info": "Show Product Request" + }, + { + "type": "checkbox", + "id": "share", + "label": "Share", + "default": true, + "info": "Enable Sharing product" + }, + { + "type": "checkbox", + "id": "sold_by", + "label": "Show Sold By", + "default": true, + "info": "Show name of the store" + }, + { + "type": "checkbox", + "id": "store_selection", + "label": "Seller Store Selection", + "default": true, + "info": "Allow to explicitly select stores" + }, + { + "type": "checkbox", + "id": "compare_products", + "label": "Compare Products", + "default": true, + "info": "Show Most Compared Products" + }, + { + "type": "checkbox", + "id": "variants", + "label": "Product Variants", + "default": true, + "info": "Show Product Variants" + }, + { + "type": "checkbox", + "id": "ratings", + "label": "Product Rating", + "default": true, + "info": "Show Product Ratings" + }, + { + "type": "checkbox", + "id": "similar_products", + "label": "Similar Products", + "default": true, + "info": "Show Similar Products" + }, + { + "type": "checkbox", + "id": "bulk_prices", + "label": "Bulk Prices", + "default": true, + "info": "Show Bulk Prices" + }, + { + "type": "checkbox", + "id": "showDeliveryInfo", + "label": "Delivery Info", + "default": true, + "info": "Show Delivery Date" + } + ], + "_id": "5fe182f763d26d29bbd205d2", + "page": "product-description" + }, + { + "props": [], + "_id": "5fe182f763d26da5f0d205d3", + "page": "product-listing" + }, + { + "props": [], + "_id": "5fe182f763d26d3d18d205d4", + "page": "product-reviews" + }, + { + "props": [], + "_id": "5fe182f763d26d4e2dd205d5", + "page": "wishlist" + }, + { + "props": [ + { + "default": true, + "id": "header", + "label": "Header", + "type": "checkbox" + }, + { + "default": true, + "id": "footer", + "label": "Footer", + "type": "checkbox" + } + ], + "_id": "5fe7166cbaae343115de8555", + "page": "tesr" + } + ], + "list": [ + { + "name": "default", + "global_config": { + "static": { + "props": { + "colors": { + "primary_color": "#7043f7", + "secondary_color": "#02d1cb", + "accent_color": "#FFFFFF", + "link_color": "#7043f7", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "disable_cart": false + } + } + }, + "page": [ + { + "settings": { + "props": { + "show_info_message": true + } + }, + "page": "cart-landing" + } + ], + "_id": "5fc4bb9078e957737e7d79a3" + } + ] + }, + "colors": { + "primary_color": "#41434C", + "secondary_color": "#41434C", + "accent_color": "#FFFFFF", + "link_color": "#33B1C0", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + }, + "font": { + "variants": { + "light": { + "name": "300", + "file": "" + }, + "regular": { + "name": "regular", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVRS0Fbvbc14VxRD7N01bV7kg.ttf" + }, + "medium": { + "name": "500", + "file": "" + }, + "semi_bold": { + "name": "600", + "file": "" + }, + "bold": { + "name": "700", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVSS0Fbvbc14Vxps5xQ3Z5nm29Gww.ttf" + } + }, + "family": "Judson" + }, + "applied": true, + "published": false, + "archived": false, + "customized": true, + "version": "1.1.19", + "tags": [], + "_id": "5fe17f7063d26dc54fd202b4", + "pages": { + "home": { + "path": "", + "type": "system", + "sections": [], + "value": "home", + "text": "Home" + }, + "brands": { + "path": "brands", + "type": "system", + "sections": [], + "value": "brands", + "text": "Brands" + }, + "cart-landing": { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + "categories": { + "path": "categories", + "type": "system", + "sections": [], + "value": "categories", + "text": "Categories" + }, + "collections": { + "path": "collections", + "type": "system", + "sections": [], + "value": "collections", + "text": "Collections" + }, + "compare-products": { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + "product-description": { + "path": "product", + "type": "system", + "sections": [], + "value": "product-description", + "text": "Product Description" + }, + "product-listing": { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + "collection-listing": { + "path": "collection", + "type": "system", + "sections": [], + "value": "collection-listing", + "text": "COllection Listing" + }, + "wishlist": { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + } + }, + "available_sections": [ + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Brands", + "label": "Brands Heading" + }, + { + "type": "radio", + "id": "brand_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "department", + "text": "Department" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "department", + "id": "department", + "label": "Department", + "info": "Select a department of brands", + "note": "Department only applies if 'department' type is selected" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": [ + { + "type": "brand", + "id": "brand", + "label": "Select Brand" + } + ] + } + ], + "_id": "5feacca5bec232d59b89283a", + "name": "brandTemplate", + "label": "Brands List Page" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Categories", + "label": "Categories Heading" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All", + "info": "Check to show View All Button" + } + ], + "blocks": [], + "_id": "5feacca5bec232404189283b", + "name": "categoriesTemplate", + "label": "Categories Page" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Subtitle" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Background image", + "info": "Background Image" + }, + { + "type": "text", + "id": "title", + "default": "", + "label": "Overlay title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Overlay subtitle" + } + ] + } + ], + "_id": "5feacca5bec2321fd589283c", + "name": "collectionGrid", + "label": "Collection Grid" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collection List", + "label": "Collection Heading", + "info": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + } + ] + } + ], + "_id": "5feacca5bec2323bf689283d", + "name": "collectionList", + "label": "Collection List" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "radio", + "id": "collection_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "collection-item", + "name": "Collection Item", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select collection" + } + ] + } + ], + "_id": "5feacca5bec23263b489283e", + "name": "collectionTemplate", + "label": "Collection List Page" + }, + { + "props": [ + { + "type": "code", + "id": "code", + "label": "Custom HTML", + "info": "Add Your custom HTML Code below. You can also use the full screen icon to open a code editor and add your code" + } + ], + "blocks": [], + "_id": "5feacca5bec232409489283f", + "name": "customHtml", + "label": "Custom HTML" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Products", + "label": "Section Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "product", + "name": "Product", + "props": [ + { + "type": "product", + "id": "product", + "label": "Select a Product", + "info": "Product Item to be displayed" + } + ] + } + ], + "_id": "5feacca5bec2326213892840", + "name": "featuredProducts", + "label": "Featured Products", + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "props": [ + { + "type": "range", + "id": "item_count", + "min": 1, + "max": 4, + "step": 1, + "unit": "", + "label": "No of items", + "default": 4, + "info": "Maximum items allowed per row" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image", + "default": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1603773049684.svg" + }, + { + "type": "text", + "id": "caption", + "label": "Image Caption", + "default": "" + }, + { + "type": "url", + "id": "link", + "label": "Link", + "default": "", + "info": "Link to redirect" + } + ] + } + ], + "_id": "5feacca5bec2321047892841", + "name": "gallery", + "label": "Gallery", + "preset": { + "props": { + "item_count": 4 + }, + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec232b085892842", + "name": "heroBanner", + "label": "Hero Banner" + }, + { + "props": [ + { + "id": "image", + "type": "image_picker", + "label": "Hero Image", + "default": "" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "overlayLayout", + "type": "select", + "options": [ + { + "value": "left", + "text": "Align Left" + }, + { + "value": "center", + "text": "Align Center" + }, + { + "value": "right", + "text": "Align Right" + } + ], + "default": "left", + "label": "Overlay Layout", + "info": "Alignment of overlay content" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Overlay image", + "info": "Overlay Image" + }, + { + "type": "text", + "id": "text", + "default": "", + "label": "Overlay Text" + }, + { + "type": "color", + "id": "text_color", + "default": "#000", + "label": "Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "Shop Now", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec2321e74892843", + "name": "imageBanner", + "label": "Hero Image" + }, + { + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "coverUrl", + "type": "image_picker", + "label": "Video Cover Image URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + }, + { + "type": "select", + "id": "size", + "options": [ + { + "value": "adapt", + "text": "Adapt" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Video Height", + "info": "Height of Video" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "color", + "id": "heading_color", + "default": "#000", + "label": "Headin Text Color" + }, + { + "type": "text", + "id": "subHeading", + "default": "", + "label": "Sub-heading" + }, + { + "type": "color", + "id": "subheading_color", + "default": "#000", + "label": "Subheading Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "ShopNow", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec232bfc8892844", + "name": "videoBanner", + "label": "Hero Video" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first image" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides after every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image" + }, + { + "type": "url", + "id": "slide_link", + "label": "Slide Link" + } + ] + } + ], + "_id": "5feacca5bec232a916892845", + "name": "image-carousel", + "label": "Image Carousel", + "preset": { + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 2, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "collection", + "id": "collection", + "label": "Collection", + "info": "Select a collection to display its products" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec23258ec892846", + "name": "productList", + "label": "Product List", + "preset": { + "props": { + "heading": "Featured Products", + "item_count": 4, + "collection": "" + } + } + }, + { + "props": [ + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2 + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "testimonial", + "name": "Testimonial", + "props": [ + { + "type": "textarea", + "id": "testimonialText", + "label": "Text for Testimonial", + "default": "", + "info": "Text for testimonial", + "placeholder": "Text" + }, + { + "type": "text", + "id": "author", + "label": "Customers name" + } + ] + } + ], + "_id": "5feacca5bec23299e8892847", + "name": "testimonials", + "label": "Testimonial" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first video" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "video_item", + "name": "Video Slide", + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + } + ] + } + ], + "_id": "5feacca5bec232d89b892848", + "name": "videoCarousel", + "label": "Video Carousel" + } + ], + "sections": [ + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "Brands" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "department": { + "type": "department", + "value": null + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": null + } + } + } + ], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "collection-listing" + }, + { + "page_sections": [ + { + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Apple", + "id": "apple" + } + } + } + }, + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Gionee", + "id": "gionee" + } + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "heading": { + "type": "text", + "value": "Brandss" + }, + "brand_type": { + "type": "radio", + "value": "handpicked" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 4, + "type": "range" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + }, + { + "page_sections": [], + "page_key": "tesr" + } + ], + "application": "5e737afb97e0f586bf9d04db", + "available_pages": [ + { + "path": "product", + "type": "system", + "sections": [], + "text": "Product Description", + "value": "product-description" + }, + { + "path": "collection", + "type": "system", + "sections": [], + "text": "Collection Listing", + "value": "collection-listing" + }, + { + "path": "", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2327927892853", + "attributes": { + "page": "home" + } + } + ], + "value": "home", + "text": "Home" + }, + { + "path": "brands", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2326422892854", + "attributes": { + "page": "brands" + } + } + ], + "value": "brands", + "text": "Brands" + }, + { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + { + "path": "categories", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec232424c892855", + "attributes": { + "page": "categories" + } + } + ], + "value": "categories", + "text": "Categories" + }, + { + "path": "collections", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec23281de892856", + "attributes": { + "page": "collections" + } + } + ], + "value": "collections", + "text": "Collections" + }, + { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + }, + { + "path": "sections/test", + "type": "sections", + "sections": [], + "text": "test", + "value": "test" + } + ], + "styles": {}, + "constants": {}, + "settings": {}, + "created_at": "2020-12-22T05:09:04.720Z", + "updated_at": "2021-01-24T11:22:41.376Z" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getPublicThemes +Get all public themes + + + + +```swift +client.application("").theme.getPublicThemes(pageSize: pageSize, pageNo: pageNo) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | +| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | + + + +Use this API to get a list of free themes that you can apply to your website. + +*Returned Response:* + + + + +[ThemesListingResponseSchema](#ThemesListingResponseSchema) + +Success. Refer `ThemesListingResponseSchema` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "items": [ + { + "information": { + "images": { + "desktop": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/emerge-desktop.jpeg" + ], + "android": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/emerge-mobile.jpeg" + ], + "ios": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/emerge-mobile.jpeg" + ], + "thumbnail": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/emerge-desktop.jpeg" + ] + }, + "features": [ + "Responsive" + ], + "name": "Akash-Emerge" + }, + "src": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/sources/KQmf7yHiw-archive.zip" + }, + "assets": { + "css": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/cca6Ghosfr-themeBundle.css" + }, + "umd_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/mL5ak5KO5-themeBundle.umd.min.js" + }, + "common_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/XZ60Mor-bV-themeBundle.common.js" + } + }, + "config": { + "preset": { + "sections": [ + { + "page_sections": [] + } + ] + }, + "global_schema": { + "props": [ + { + "type": "header", + "category": "Colors", + "value": "Header" + }, + { + "type": "color", + "category": "Colors", + "id": "header_bg_color", + "label": "Background ", + "default": "#ffffff" + }, + { + "type": "color", + "category": "Colors", + "id": "header_text_color", + "label": "Text ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "header_border_color", + "label": "Border ", + "default": "#ffffff" + }, + { + "type": "color", + "category": "Colors", + "id": "header_icon_color", + "label": "Icons ", + "default": "#ffffff" + }, + { + "type": "color", + "category": "Colors", + "id": "header_cart_notification_bg_color", + "label": "Notification background ", + "default": "#ffffff" + }, + { + "type": "color", + "category": "Colors", + "id": "header_cart_notification_text_color", + "label": "Notification text ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "header_nav_hover_color", + "label": "Navigation hover color", + "default": "#000000" + }, + { + "type": "header", + "category": "Colors", + "value": "Buttons" + }, + { + "type": "color", + "category": "Colors", + "id": "button_primary_color", + "label": "Primary ", + "default": "#ffffff" + }, + { + "type": "color", + "category": "Colors", + "id": "button_primary_label_color", + "label": "Primary label ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "button_add_to_cart_color", + "label": "Add to cart ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "button_add_to_cart_label_color", + "label": "Add to cart label ", + "default": "#ffffff" + }, + { + "type": "color", + "category": "Colors", + "id": "button_secondary_color", + "label": "Secondary ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "button_secondary_label_color", + "label": "Secondary label ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "button_tertiary_color", + "label": "Tertiary ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "button_tertiary_label_color", + "label": "Tertiary label ", + "default": "#000000" + }, + { + "type": "header", + "category": "Colors", + "value": "Text" + }, + { + "type": "color", + "category": "Colors", + "id": "text_heading_link_color", + "label": "Heading and link", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "text_body_color", + "label": "Body ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "text_price_color", + "label": "Price ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "text_sale_price_color", + "label": "Sale price ", + "default": "#fb406b" + }, + { + "type": "color", + "category": "Colors", + "id": "text_strikethrough_price_color", + "label": "Strikethrough price ", + "default": "#9b9b9b" + }, + { + "type": "color", + "category": "Colors", + "id": "text_discount_color", + "label": "Discount ", + "default": "#ee478d" + }, + { + "type": "header", + "category": "Colors", + "value": "Footer" + }, + { + "type": "color", + "category": "Colors", + "id": "footer_bg_color", + "label": "Background ", + "default": "#ffffff" + }, + { + "type": "color", + "category": "Colors", + "id": "footer_text_color", + "label": "Text ", + "default": "#000000" + }, + { + "type": "color", + "category": "Colors", + "id": "footer_border_color", + "label": "Border ", + "default": "#e1e1e1" + }, + { + "type": "color", + "category": "Colors", + "id": "footer_nav_hover_color", + "label": "Navigation hover color", + "default": "#000000" + }, + { + "type": "header", + "category": "Colors", + "value": "" + }, + { + "type": "header", + "category": "Colors", + "value": "" + }, + { + "type": "header", + "category": "Colors", + "value": "" + }, + { + "type": "checkbox", + "id": "disable_cart", + "default": false, + "category": "Cart", + "label": "Disable Cart" + } + ] + }, + "current": "Default", + "list": [ + { + "name": "Default", + "global_config": { + "static": { + "props": { + "colors": { + "cart": { + "header": "#FFFFFF", + "accent": "#02D1CB", + "button": "#FF8F47", + "header_label": "#41434C", + "button_label": "#FFFFFF", + "background": "#F8F8F8", + "sheet": "#FFFFFF" + }, + "primary_color": "#000000", + "secondary_color": "#000000", + "accent_color": "#000000", + "link_color": "#4499FF", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "header_bg_color": "#ffffff", + "header_text_color": "#000000", + "header_border_color": "#e1e1e1", + "header_icon_color": "#000000", + "header_cart_notification_bg_color": "#e8a76c", + "header_cart_notification_text_color": "#ffffff", + "header_nav_hover_color": "#999999", + "button_primary_color": "#ffffff", + "button_primary_label_color": "#000000", + "button_add_to_cart_color": "#000000", + "button_add_to_cart_label_color": "#ffffff", + "button_secondary_color": "#000000", + "button_secondary_label_color": "#ffffff", + "button_tertiary_color": "#000000", + "button_tertiary_label_color": "#000000", + "button_tertiary_hover_color": "#000000", + "button_tertiary_hover_text_color": "#ffffff", + "text_heading_link_color": "#000000", + "text_body_color": "#000000", + "text_price_color": "#000000", + "text_sale_price_color": "#fb406b", + "text_strikethrough_price_color": "#9b9b9b", + "text_discount_color": "#ee478d", + "footer_bg_color": "#ffffff", + "footer_text_color": "#999999", + "footer_border_color": "#e1e1e1", + "footer_nav_hover_color": "#000000", + "disable_cart": false + } + } + }, + "page": [ + { + "settings": { + "props": { + "reviews": false, + "add_to_compare": false, + "product_request": false, + "store_selection": true, + "compare_products": false, + "variants": true, + "ratings": false, + "similar_products": true + } + }, + "page": "product-description" + }, + { + "settings": { + "props": { + "show_info_message": true, + "gst": false, + "staff_selection": false, + "enable_customer": false, + "enable_guest": false + } + }, + "page": "cart-landing" + } + ], + "_id": "5fda8743b07e386cea1f2cbf" + }, + { + "name": "Dark", + "global_config": { + "static": { + "props": { + "colors": { + "cart": { + "header": "#FFFFFF", + "accent": "#02D1CB", + "button": "#FF8F47", + "header_label": "#41434C", + "button_label": "#FFFFFF", + "background": "#F8F8F8", + "sheet": "#FFFFFF" + }, + "primary_color": "#000000", + "secondary_color": "#000000", + "accent_color": "#000000", + "link_color": "#4499FF", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "header_bg_color": "#2e3032", + "header_text_color": "#ffffff", + "header_border_color": "#FFFFFF", + "header_icon_color": "#ffffff", + "header_cart_notification_bg_color": "#FFFFFF", + "header_cart_notification_text_color": "#2e3032", + "header_nav_hover_color": "#000000", + "button_primary_color": "#000000", + "button_primary_label_color": "#ffffff", + "button_add_to_cart_color": "#000000", + "button_add_to_cart_label_color": "#ffffff", + "button_secondary_color": "#000000", + "button_secondary_label_color": "#ffffff", + "button_tertiary_color": "#000000", + "button_tertiary_label_color": "#000000", + "button_tertiary_hover_color": "#000000", + "button_tertiary_hover_text_color": "#ffffff", + "text_heading_link_color": "#000000", + "text_body_color": "#000000", + "text_price_color": "#000000", + "text_sale_price_color": "#fb406b", + "text_strikethrough_price_color": "#9b9b9b", + "text_discount_color": "#ee478d", + "footer_bg_color": "#2e3032", + "footer_text_color": "#ffffff", + "footer_border_color": "#FFFFFF", + "footer_nav_hover_color": "#ffffff" + } + } + }, + "page": [ + { + "settings": { + "props": { + "show_info_message": true + } + }, + "page": "cart-landing" + } + ], + "_id": "5fda8743b07e3846b81f2cc0" + }, + { + "name": "Blue", + "global_config": { + "static": { + "props": { + "colors": { + "cart": { + "header": "#FFFFFF", + "accent": "#02D1CB", + "button": "#FF8F47", + "header_label": "#41434C", + "button_label": "#FFFFFF", + "background": "#F8F8F8", + "sheet": "#FFFFFF" + }, + "primary_color": "#000000", + "secondary_color": "#000000", + "accent_color": "#000000", + "link_color": "#4499FF", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "header_bg_color": "#7f9ed0", + "header_text_color": "#FFFFFF", + "header_border_color": "#FFFFFF", + "header_icon_color": "#FFFFFF", + "header_cart_notification_bg_color": "#2e3032", + "header_cart_notification_text_color": "#FFFFFF", + "header_nav_hover_color": "#2e3032", + "button_primary_color": "#ffffff", + "button_primary_label_color": "#000000", + "button_add_to_cart_color": "#000000", + "button_add_to_cart_label_color": "#ffffff", + "button_secondary_color": "#000000", + "button_secondary_label_color": "#ffffff", + "button_tertiary_color": "#000000", + "button_tertiary_label_color": "#000000", + "button_tertiary_hover_color": "#000000", + "button_tertiary_hover_text_color": "#ffffff", + "text_heading_link_color": "#000000", + "text_body_color": "#000000", + "text_price_color": "#000000", + "text_sale_price_color": "#fb406b", + "text_strikethrough_price_color": "#9b9b9b", + "text_discount_color": "#ee478d", + "footer_bg_color": "#7f9ed0", + "footer_text_color": "#FFFFFF", + "footer_border_color": "#FFFFFF", + "footer_nav_hover_color": "#2e3032" + } + } + }, + "page": [ + { + "settings": { + "props": { + "show_info_message": true + } + }, + "page": "cart-landing" + } + ], + "_id": "5fda8743b07e3850661f2cc1" + } + ] + }, + "colors": { + "primary_color": "#f8973d", + "secondary_color": "#f8973d", + "accent_color": "#FFFFFF", + "link_color": "#f63420", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + }, + "font": { + "variants": { + "light": { + "name": "300", + "file": "https://fonts.gstatic.com/s/montserrat/v15/JTURjIg1_i6t8kCHKm45_cJD7g7J_950vCo.ttf" + }, + "regular": { + "name": "400", + "file": "" + }, + "medium": { + "name": "500", + "file": "https://fonts.gstatic.com/s/montserrat/v15/JTURjIg1_i6t8kCHKm45_ZpC7g7J_950vCo.ttf" + }, + "semi_bold": { + "name": "600", + "file": "https://fonts.gstatic.com/s/montserrat/v15/JTURjIg1_i6t8kCHKm45_bZF7g7J_950vCo.ttf" + }, + "bold": { + "name": "700", + "file": "https://fonts.gstatic.com/s/montserrat/v15/JTURjIg1_i6t8kCHKm45_dJE7g7J_950vCo.ttf" + } + }, + "family": "Montserrat" + }, + "applied": false, + "published": false, + "archived": false, + "customized": true, + "version": "1.0.15", + "tags": [], + "_id": "5fe17ff363d26d6707d2032a", + "pages": { + "home": { + "path": "", + "type": "system", + "sections": [], + "value": "home", + "text": "Home" + }, + "brands": { + "path": "brands", + "type": "system", + "sections": [], + "value": "brands", + "text": "Brands" + }, + "cart-landing": { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + "categories": { + "path": "categories", + "type": "system", + "sections": [], + "value": "categories", + "text": "Categories" + }, + "collections": { + "path": "collections", + "type": "system", + "sections": [], + "value": "collections", + "text": "Collections" + }, + "compare-products": { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + "product-description": { + "path": "product", + "type": "system", + "sections": [], + "value": "product-description", + "text": "Product Description" + }, + "product-listing": { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + "collection-listing": { + "path": "collection", + "type": "system", + "sections": [], + "value": "collection-listing", + "text": "COllection Listing" + }, + "wishlist": { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + } + }, + "available_sections": [ + { + "props": [ + { + "type": "url", + "id": "banner_link", + "default": "", + "label": "Redirect Link" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacf62d092d5f99df2bf2a", + "name": "application_banner", + "label": "Application Banner" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "header", + "id": "header", + "value": "Choose Brands to Show" + }, + { + "id": "view_options", + "type": "select", + "options": [ + { + "value": "logo", + "text": "Logo View" + }, + { + "value": "fullview", + "text": "Logo and Banner View" + } + ], + "default": "fullview", + "label": "View Options", + "info": "Brand card view options" + }, + { + "type": "radio", + "id": "brand_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "department", + "text": "Department" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "department", + "id": "department", + "label": "Department", + "info": "Select a department of brands", + "note": "Department only applies if 'department' type is selected" + }, + { + "type": "range", + "id": "items_per_row", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 5, + "info": "Maximum items allowed per row" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "horizontal", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "text", + "id": "cta_text", + "default": "View all", + "label": "CTA Text" + } + ], + "blocks": [ + { + "type": "brand_item", + "name": "Brand Item", + "props": [ + { + "type": "brand", + "id": "brand", + "label": "Select Brand" + } + ] + } + ], + "_id": "5feacf62d092d5a70df2bf2b", + "name": "brands_listing", + "label": "Brands Listing" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "radio", + "id": "collection_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "handpicked", + "text": "Handpicked (works with Horizontal view)" + } + ] + }, + { + "type": "text", + "id": "tags_filter", + "default": "", + "label": "Filter by tags", + "info": "Filter by Tags (Only for collection type - all)" + }, + { + "type": "range", + "id": "items_per_row", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 5, + "info": "Maximum items allowed per row" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "horizontal", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "text", + "id": "cta_text", + "default": "View all", + "label": "CTA Text" + } + ], + "blocks": [ + { + "type": "collection-item", + "name": "collection Item", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select Collection" + } + ] + } + ], + "_id": "5feacf62d092d59434f2bf2c", + "name": "collections_listing", + "label": "Collections Listing" + }, + { + "props": [ + { + "type": "code", + "id": "code", + "label": "Custom HTML", + "info": "Add Your custom HTML Code below. You can also use the full screen icon to open a code editor and add your code" + } + ], + "blocks": [], + "_id": "5feacf62d092d509cbf2bf2d", + "name": "custom_html", + "label": "Custom HTML" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "Featured Collection", + "label": "Title" + }, + { + "type": "collection", + "id": "collection", + "label": "Collection", + "info": "Select a collection to display its products" + }, + { + "type": "range", + "id": "items_per_row", + "min": 2, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "horizontal", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides after every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [], + "_id": "5feacf62d092d5acc0f2bf2e", + "name": "featured_collection", + "label": "Featured Collection" + }, + { + "props": [ + { + "id": "image", + "type": "image_picker", + "label": "Hero Image", + "default": "" + }, + { + "id": "overlay_layout", + "type": "select", + "options": [ + { + "value": "left", + "text": "Align Left" + }, + { + "value": "center", + "text": "Align Center" + }, + { + "value": "right", + "text": "Align Right" + } + ], + "default": "left", + "label": "Overlay Layout", + "info": "Alignment of overlay content" + }, + { + "type": "image_picker", + "id": "overlay_image", + "default": "", + "label": "Overlay image", + "info": "Overlay Image" + }, + { + "type": "text", + "id": "overlay_text", + "default": "", + "label": "Overlay Text" + }, + { + "type": "color", + "id": "text_color", + "default": "#000", + "label": "Text Color" + }, + { + "type": "url", + "id": "button_link", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "button_text", + "default": "Shop Now", + "label": "Button Text" + }, + { + "type": "checkbox", + "id": "full_width", + "default": true, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacf62d092d5e884f2bf2f", + "name": "hero_image", + "label": "Hero Image" + }, + { + "props": [ + { + "id": "video_url", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "id": "cover_url", + "type": "url", + "label": "Video Cover Image URL", + "default": "" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "Autoplay", + "info": "Check to enable autoplay of video" + }, + { + "type": "select", + "id": "size", + "options": [ + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "medium", + "label": "Video Height", + "info": "Height of Video" + }, + { + "id": "overlay_position", + "type": "select", + "options": [ + { + "value": "top-left", + "text": "Top Left" + }, + { + "value": "top-center", + "text": "Top Center" + }, + { + "value": "top-right", + "text": "Top Right" + }, + { + "value": "center-left", + "text": "Center Left" + }, + { + "value": "center-center", + "text": "Center (Default)" + }, + { + "value": "center-right", + "text": "Center Right" + }, + { + "value": "bottom-left", + "text": "Bottom Left" + }, + { + "value": "bottom-center", + "text": "Bottom Center" + }, + { + "value": "bottom-right", + "text": "Bottom right" + } + ], + "default": "center-center", + "label": "Overlay position", + "info": "Alignment of Overlay content(heading, sub-heading, button)" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "color", + "id": "heading_color", + "default": "#000", + "label": "Heading Text Color" + }, + { + "type": "text", + "id": "sub_heading", + "default": "", + "label": "Sub-heading" + }, + { + "type": "color", + "id": "sub_heading_color", + "default": "#000", + "label": "Sub-heading Text Color" + }, + { + "type": "url", + "id": "button_link", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "button_text", + "default": "ShopNow", + "label": "Button Text" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacf62d092d5af80f2bf30", + "name": "hero_video", + "label": "Hero Video" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 4, + "step": 1, + "unit": "", + "label": "No of items", + "default": 4, + "info": "Maximum items allowed per row for Horizontal view, for gallery max 5 are viewable and only 5 blocks are required" + }, + { + "type": "text", + "id": "cta_text", + "default": "", + "label": "CTA Text" + }, + { + "type": "url", + "id": "cta_link", + "label": "CTA Link", + "default": "", + "info": "Link to redirect" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image", + "default": "" + }, + { + "type": "text", + "id": "caption", + "label": "Image Caption", + "default": "" + }, + { + "type": "url", + "id": "link", + "label": "Link", + "default": "", + "info": "Link to redirect" + } + ] + } + ], + "_id": "5feacf62d092d54f17f2bf31", + "name": "image_gallery", + "label": "Image Gallery", + "preset": { + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides after every", + "default": 2, + "info": "Autoplay slide duration" + }, + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first image" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "image_slide", + "name": "Slide", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Image" + }, + { + "type": "url", + "id": "slide_link", + "label": "Slide Link" + } + ] + } + ], + "_id": "5feacf62d092d5a6c3f2bf32", + "name": "image_slideshow", + "label": "Image Slideshow", + "preset": { + "blocks": [ + { + "name": "Slide" + }, + { + "name": "Slide" + }, + { + "name": "Slide" + } + ] + } + }, + { + "props": [ + { + "type": "image_picker", + "id": "image", + "default": "", + "label": "Image" + }, + { + "id": "video", + "type": "url", + "label": "Video", + "default": "" + }, + { + "id": "cover", + "type": "url", + "label": "Video Cover Image", + "default": "" + }, + { + "type": "select", + "id": "media_alignment", + "options": [ + { + "value": "left", + "text": "Left" + }, + { + "value": "center", + "text": "Center" + }, + { + "value": "right", + "text": "Right" + } + ], + "default": "left", + "label": "Media Alignment" + }, + { + "type": "text", + "id": "heading", + "default": "Media with Text", + "label": "Heading" + }, + { + "type": "text", + "id": "text", + "default": "Pair large text with an image to give focus to your chosen product, collection, or blog post. Add details on availability, style, or even provide a review.", + "label": "Text" + }, + { + "type": "select", + "id": "text_alignment", + "options": [ + { + "value": "left", + "text": "Left" + }, + { + "value": "center", + "text": "Center" + }, + { + "value": "right", + "text": "Right" + } + ], + "default": "left", + "label": "Text Alignment" + } + ], + "blocks": [], + "_id": "5feacf62d092d55d3af2bf33", + "name": "media_with_text", + "label": "Media with text" + }, + { + "props": [ + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2 + } + ], + "blocks": [ + { + "type": "testimonial", + "name": "Testimonial", + "props": [ + { + "type": "textarea", + "id": "testimonialText", + "label": "Text for Testimonial", + "default": "", + "info": "Text for testimonial", + "placeholder": "Text" + }, + { + "type": "text", + "id": "author_name", + "label": "Author name" + }, + { + "type": "text", + "id": "author_description", + "default": "", + "label": "Author Description" + }, + { + "type": "image_picker", + "id": "author_image", + "default": "", + "label": "Author Image" + } + ] + } + ], + "_id": "5feacf62d092d51a97f2bf34", + "name": "testimonials", + "label": "Testimonial", + "preset": { + "blocks": [ + { + "name": "Testimonial" + }, + { + "name": "Testimonial" + }, + { + "name": "Testimonial" + } + ] + } + } + ], + "sections": [ + { + "page_sections": [], + "page_key": "product-description" + }, + { + "page_sections": [ + { + "blocks": [ + { + "type": "brand_item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Gionee", + "id": "gionee" + } + } + } + }, + { + "type": "brand_item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Gionee", + "id": "gionee" + } + } + } + }, + { + "type": "brand_item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Apple", + "id": "apple" + } + } + } + }, + { + "type": "brand_item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Apple", + "id": "apple" + } + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brands_listing", + "props": { + "title": { + "type": "text", + "value": "test" + }, + "header": { + "type": "header" + }, + "view_options": { + "type": "select", + "value": "fullview" + }, + "brand_type": { + "type": "radio", + "value": "handpicked" + }, + "department": { + "type": "department" + }, + "items_per_row": { + "type": "range", + "value": 3 + }, + "layout": { + "type": "select", + "value": "horizontal" + }, + "cta_text": { + "value": "View all", + "type": "text" + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [], + "page_key": "categories" + }, + { + "page_sections": [], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + } + ], + "application": "5e737afb97e0f586bf9d04db", + "available_pages": [ + { + "path": "product", + "type": "system", + "props": [ + { + "type": "checkbox", + "id": "wishlist", + "label": "Wishlist", + "default": true, + "info": "Show Wishlist for product" + }, + { + "type": "checkbox", + "id": "reviews", + "label": "Review", + "default": true, + "info": "Show Reviews of product" + }, + { + "type": "checkbox", + "id": "add_to_compare", + "label": "Add to Compare", + "default": true, + "info": "Allow comparison of products" + }, + { + "type": "checkbox", + "id": "size_guide", + "label": "Size Guide", + "default": true, + "info": "Show Size Guide" + }, + { + "type": "checkbox", + "id": "product_request", + "label": "Product Request", + "default": true, + "info": "Show Product Request" + }, + { + "type": "checkbox", + "id": "share", + "label": "Share", + "default": true, + "info": "Enable Sharing product" + }, + { + "type": "checkbox", + "id": "store_selection", + "label": "Seller Store Selection", + "default": true, + "info": "Allow to explicitly select stores" + }, + { + "type": "checkbox", + "id": "compare_products", + "label": "Compare Products", + "default": true, + "info": "Show Most Compared Products" + }, + { + "type": "checkbox", + "id": "variants", + "label": "Product Variants", + "default": true, + "info": "Show Product Variants" + }, + { + "type": "checkbox", + "id": "ratings", + "label": "Product Rating", + "default": true, + "info": "Show Product Ratings" + }, + { + "type": "checkbox", + "id": "similar_products", + "label": "Similar Products", + "default": true, + "info": "Show Similar Products" + } + ], + "sections": [], + "text": "Product Description", + "value": "product-description" + }, + { + "path": "collection", + "type": "system", + "props": [], + "sections": [], + "text": "Collection Listing", + "value": "collection-listing" + }, + { + "path": "", + "type": "system", + "props": [], + "sections": [ + { + "_id": "5feacf62d092d581d9f2bf37", + "attributes": { + "page": "home" + } + } + ], + "value": "home", + "text": "Home" + }, + { + "path": "brands", + "type": "system", + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "id": "view_options", + "type": "select", + "options": [ + { + "value": "logo", + "text": "Logo View" + }, + { + "value": "fullview", + "text": "Logo and Banner View" + } + ], + "default": "fullview", + "label": "View Options", + "info": "Brand card view options" + }, + { + "type": "range", + "id": "items_per_row", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 5, + "info": "Maximum items allowed per row" + } + ], + "sections": [], + "value": "brands", + "text": "Brands" + }, + { + "path": "cart/bag", + "type": "system", + "props": [ + { + "type": "checkbox", + "id": "gst", + "label": "GST", + "default": true, + "info": "Show GST on cart" + }, + { + "type": "checkbox", + "id": "staff_selection", + "label": "Staff Selection", + "default": true, + "info": "Show Staff selection on Cart" + }, + { + "type": "checkbox", + "id": "enable_customer", + "label": "Customer", + "default": true, + "info": "Placing on behalf of customer" + }, + { + "type": "checkbox", + "id": "enable_guest", + "label": "Enable Guest Checkout", + "default": true, + "info": "Enable Continue as Guest" + } + ], + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + { + "path": "categories", + "type": "system", + "props": [ + { + "type": "text", + "id": "heading", + "default": "", + "label": "Category List Heading" + }, + { + "type": "range", + "id": "items_per_row", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 5, + "info": "Maximum items allowed per row" + } + ], + "sections": [], + "value": "categories", + "text": "Categories" + }, + { + "path": "collections", + "type": "system", + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "range", + "id": "items_per_row", + "min": 3, + "max": 8, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 5, + "info": "Maximum items allowed per row" + } + ], + "sections": [], + "value": "collections", + "text": "Collections" + }, + { + "path": "compare", + "type": "system", + "props": [], + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + { + "path": "products", + "type": "system", + "props": [], + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + { + "path": "wishlist", + "type": "system", + "props": [], + "sections": [], + "value": "wishlist", + "text": "Wishlist" + }, + { + "path": "sections/test", + "type": "sections", + "props": [ + { + "default": true, + "id": "header", + "label": "Header", + "type": "checkbox" + }, + { + "default": true, + "id": "footer", + "label": "Footer", + "type": "checkbox" + } + ], + "sections": [], + "text": "test", + "value": "test" + } + ], + "styles": {}, + "constants": {}, + "settings": {}, + "created_at": "2020-12-22T05:11:16.027Z", + "updated_at": "2021-02-24T14:03:52.974Z" + } + ], + "page": { + "type": "number", + "current": 1, + "size": 10, + "item_total": 1, + "has_next": false + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### createTheme +Create a new theme + + + + +```swift +client.application("").theme.createTheme(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | ThemesSchema | yes | Request body | + + +Themes improve the look and appearance of a website. Use this API to create a theme. + +*Returned Response:* + + + + +[ThemesSchema](#ThemesSchema) + +Theme + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "information": { + "images": { + "desktop": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ], + "android": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "ios": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "thumbnail": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ] + }, + "features": [ + "Responsive" + ], + "name": "Akash-Artisan" + }, + "src": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/sources/J-1s-N-pl-archive.zip" + }, + "assets": { + "css": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/Ia4m885Mw2-themeBundle.css" + }, + "umd_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/nEPGyc15g-themeBundle.umd.min.js" + }, + "common_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/5f7tOB5rpq-themeBundle.common.js" + } + }, + "config": { + "preset": { + "sections": [ + { + "page_sections": [ + { + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219133573.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/men-collection-vcahuo2q" + } + } + }, + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219184350.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/shirts-5e9654ad" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "image-carousel", + "props": { + "slide_height": { + "type": "select", + "value": "adapt" + }, + "autoplay": { + "type": "checkbox", + "value": false + }, + "slide_interval": { + "type": "range", + "value": 2 + } + } + }, + { + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "accessories-7ee89654" + }, + "title": { + "type": "text", + "value": "Turtle sports club" + }, + "subtitle": { + "type": "text", + "value": "Casual Collections" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/casual_nfadbl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Formal Collection" + }, + "subtitle": { + "type": "text", + "value": "Turtle Tailor Mark" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/tailors_nsrrfl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Bottomwear" + }, + "subtitle": { + "type": "text", + "value": "Chinos | Trousers | Pants" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/bottomwear_tdkhn2.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "t-shirt-7ee3cbcd" + }, + "title": { + "type": "text", + "value": "Shirts" + }, + "subtitle": { + "type": "text", + "value": "Casual" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/t-shirt_re9srk.jpg" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionGrid", + "props": { + "title": { + "type": "text", + "value": "Collections" + }, + "subtitle": { + "type": "text", + "value": "Buy from our" + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "department": { + "type": "department", + "value": "others" + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "layout": { + "type": "select", + "value": "grid" + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + } + ] + }, + "global_schema": { + "props": [ + { + "type": "color", + "id": "header_bg_color", + "default": "#ffffff", + "category": "Header", + "label": "Header background Color" + }, + { + "type": "color", + "id": "footer_bg_color", + "default": "#1b1b1b", + "category": "Footer", + "label": "Footer background Color" + }, + { + "type": "text", + "id": "footer_text", + "default": "", + "category": "Footer", + "label": "Footer Text" + }, + { + "type": "checkbox", + "id": "disable_cart", + "default": false, + "category": "Cart", + "label": "Disable Cart" + } + ] + }, + "current": "default", + "page_schema": [ + { + "props": [], + "_id": "5fe182f763d26d042fd205c4", + "page": "add-product-review" + }, + { + "props": [], + "_id": "5fe182f763d26dadc8d205c6", + "page": "blog" + }, + { + "props": [], + "_id": "5fe182f763d26d0a36d205c7", + "page": "brands" + }, + { + "props": [ + { + "type": "checkbox", + "id": "gst", + "label": "GST", + "default": true, + "info": "Show GST on cart" + }, + { + "type": "checkbox", + "id": "staff_selection", + "label": "Staff Selection", + "default": true, + "info": "Show Staff selection on Cart" + }, + { + "type": "checkbox", + "id": "enable_customer", + "label": "Customer", + "default": true, + "info": "Placing on behalf of customer" + }, + { + "type": "checkbox", + "id": "enable_guest", + "label": "Enable Guest Checkout", + "default": true, + "info": "Enable Continue as Guest" + } + ], + "_id": "5fe182f763d26d81c5d205c8", + "page": "cart-landing" + }, + { + "props": [], + "_id": "5fe182f763d26d7e15d205c9", + "page": "cart-review" + }, + { + "props": [], + "_id": "5fe182f763d26d270ed205ca", + "page": "categories" + }, + { + "props": [], + "_id": "5fe182f763d26d9b4fd205cb", + "page": "collection-listing" + }, + { + "props": [], + "_id": "5fe182f763d26da6ecd205cc", + "page": "collections" + }, + { + "props": [], + "_id": "5fe182f763d26d7156d205cd", + "page": "compare-products" + }, + { + "props": [], + "_id": "5fe182f763d26d62bad205ce", + "page": "home" + }, + { + "props": [], + "_id": "5fe182f763d26d5afcd205cf", + "page": "order-review" + }, + { + "props": [], + "_id": "5fe182f763d26def8dd205d0", + "page": "order-tracking-details" + }, + { + "props": [], + "_id": "5fe182f763d26d381fd205d1", + "page": "order-tracking" + }, + { + "props": [ + { + "type": "text", + "id": "shipping_link", + "label": "Shipping Link", + "default": "https://fynd.freshdesk.com/support/solutions/folders/33000111600", + "info": "Link of shipping page" + }, + { + "type": "checkbox", + "id": "original_image", + "label": "Use original Image", + "default": false, + "info": "Use original product image." + }, + { + "type": "checkbox", + "id": "wishlist", + "label": "Wishlist", + "default": true, + "info": "Show Wishlist for product" + }, + { + "type": "checkbox", + "id": "reviews", + "label": "Review", + "default": true, + "info": "Show Reviews of product" + }, + { + "type": "checkbox", + "id": "add_to_compare", + "label": "Add to Compare", + "default": true, + "info": "Allow comparison of products" + }, + { + "type": "checkbox", + "id": "size_guide", + "label": "Size Guide", + "default": true, + "info": "Show Size Guide" + }, + { + "type": "checkbox", + "id": "product_request", + "label": "Product Request", + "default": true, + "info": "Show Product Request" + }, + { + "type": "checkbox", + "id": "share", + "label": "Share", + "default": true, + "info": "Enable Sharing product" + }, + { + "type": "checkbox", + "id": "sold_by", + "label": "Show Sold By", + "default": true, + "info": "Show name of the store" + }, + { + "type": "checkbox", + "id": "store_selection", + "label": "Seller Store Selection", + "default": true, + "info": "Allow to explicitly select stores" + }, + { + "type": "checkbox", + "id": "compare_products", + "label": "Compare Products", + "default": true, + "info": "Show Most Compared Products" + }, + { + "type": "checkbox", + "id": "variants", + "label": "Product Variants", + "default": true, + "info": "Show Product Variants" + }, + { + "type": "checkbox", + "id": "ratings", + "label": "Product Rating", + "default": true, + "info": "Show Product Ratings" + }, + { + "type": "checkbox", + "id": "similar_products", + "label": "Similar Products", + "default": true, + "info": "Show Similar Products" + }, + { + "type": "checkbox", + "id": "bulk_prices", + "label": "Bulk Prices", + "default": true, + "info": "Show Bulk Prices" + }, + { + "type": "checkbox", + "id": "showDeliveryInfo", + "label": "Delivery Info", + "default": true, + "info": "Show Delivery Date" + } + ], + "_id": "5fe182f763d26d29bbd205d2", + "page": "product-description" + }, + { + "props": [], + "_id": "5fe182f763d26da5f0d205d3", + "page": "product-listing" + }, + { + "props": [], + "_id": "5fe182f763d26d3d18d205d4", + "page": "product-reviews" + }, + { + "props": [], + "_id": "5fe182f763d26d4e2dd205d5", + "page": "wishlist" + }, + { + "props": [ + { + "default": true, + "id": "header", + "label": "Header", + "type": "checkbox" + }, + { + "default": true, + "id": "footer", + "label": "Footer", + "type": "checkbox" + } + ], + "_id": "5fe7166cbaae343115de8555", + "page": "tesr" + } + ], + "list": [ + { + "name": "default", + "global_config": { + "static": { + "props": { + "colors": { + "primary_color": "#7043f7", + "secondary_color": "#02d1cb", + "accent_color": "#FFFFFF", + "link_color": "#7043f7", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "disable_cart": false + } + } + }, + "page": [ + { + "settings": { + "props": { + "show_info_message": true + } + }, + "page": "cart-landing" + } + ], + "_id": "5fc4bb9078e957737e7d79a3" + } + ] + }, + "colors": { + "primary_color": "#41434C", + "secondary_color": "#41434C", + "accent_color": "#FFFFFF", + "link_color": "#33B1C0", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + }, + "font": { + "variants": { + "light": { + "name": "300", + "file": "" + }, + "regular": { + "name": "regular", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVRS0Fbvbc14VxRD7N01bV7kg.ttf" + }, + "medium": { + "name": "500", + "file": "" + }, + "semi_bold": { + "name": "600", + "file": "" + }, + "bold": { + "name": "700", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVSS0Fbvbc14Vxps5xQ3Z5nm29Gww.ttf" + } + }, + "family": "Judson" + }, + "applied": true, + "published": false, + "archived": false, + "customized": true, + "version": "1.1.19", + "tags": [], + "_id": "5fe17f7063d26dc54fd202b4", + "pages": { + "home": { + "path": "", + "type": "system", + "sections": [], + "value": "home", + "text": "Home" + }, + "brands": { + "path": "brands", + "type": "system", + "sections": [], + "value": "brands", + "text": "Brands" + }, + "cart-landing": { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + "categories": { + "path": "categories", + "type": "system", + "sections": [], + "value": "categories", + "text": "Categories" + }, + "collections": { + "path": "collections", + "type": "system", + "sections": [], + "value": "collections", + "text": "Collections" + }, + "compare-products": { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + "product-description": { + "path": "product", + "type": "system", + "sections": [], + "value": "product-description", + "text": "Product Description" + }, + "product-listing": { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + "collection-listing": { + "path": "collection", + "type": "system", + "sections": [], + "value": "collection-listing", + "text": "COllection Listing" + }, + "wishlist": { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + } + }, + "available_sections": [ + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Brands", + "label": "Brands Heading" + }, + { + "type": "radio", + "id": "brand_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "department", + "text": "Department" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "department", + "id": "department", + "label": "Department", + "info": "Select a department of brands", + "note": "Department only applies if 'department' type is selected" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": [ + { + "type": "brand", + "id": "brand", + "label": "Select Brand" + } + ] + } + ], + "_id": "5feacca5bec232d59b89283a", + "name": "brandTemplate", + "label": "Brands List Page" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Categories", + "label": "Categories Heading" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All", + "info": "Check to show View All Button" + } + ], + "blocks": [], + "_id": "5feacca5bec232404189283b", + "name": "categoriesTemplate", + "label": "Categories Page" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Subtitle" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Background image", + "info": "Background Image" + }, + { + "type": "text", + "id": "title", + "default": "", + "label": "Overlay title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Overlay subtitle" + } + ] + } + ], + "_id": "5feacca5bec2321fd589283c", + "name": "collectionGrid", + "label": "Collection Grid" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collection List", + "label": "Collection Heading", + "info": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + } + ] + } + ], + "_id": "5feacca5bec2323bf689283d", + "name": "collectionList", + "label": "Collection List" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "radio", + "id": "collection_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "collection-item", + "name": "Collection Item", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select collection" + } + ] + } + ], + "_id": "5feacca5bec23263b489283e", + "name": "collectionTemplate", + "label": "Collection List Page" + }, + { + "props": [ + { + "type": "code", + "id": "code", + "label": "Custom HTML", + "info": "Add Your custom HTML Code below. You can also use the full screen icon to open a code editor and add your code" + } + ], + "blocks": [], + "_id": "5feacca5bec232409489283f", + "name": "customHtml", + "label": "Custom HTML" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Products", + "label": "Section Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "product", + "name": "Product", + "props": [ + { + "type": "product", + "id": "product", + "label": "Select a Product", + "info": "Product Item to be displayed" + } + ] + } + ], + "_id": "5feacca5bec2326213892840", + "name": "featuredProducts", + "label": "Featured Products", + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "props": [ + { + "type": "range", + "id": "item_count", + "min": 1, + "max": 4, + "step": 1, + "unit": "", + "label": "No of items", + "default": 4, + "info": "Maximum items allowed per row" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image", + "default": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1603773049684.svg" + }, + { + "type": "text", + "id": "caption", + "label": "Image Caption", + "default": "" + }, + { + "type": "url", + "id": "link", + "label": "Link", + "default": "", + "info": "Link to redirect" + } + ] + } + ], + "_id": "5feacca5bec2321047892841", + "name": "gallery", + "label": "Gallery", + "preset": { + "props": { + "item_count": 4 + }, + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec232b085892842", + "name": "heroBanner", + "label": "Hero Banner" + }, + { + "props": [ + { + "id": "image", + "type": "image_picker", + "label": "Hero Image", + "default": "" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "overlayLayout", + "type": "select", + "options": [ + { + "value": "left", + "text": "Align Left" + }, + { + "value": "center", + "text": "Align Center" + }, + { + "value": "right", + "text": "Align Right" + } + ], + "default": "left", + "label": "Overlay Layout", + "info": "Alignment of overlay content" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Overlay image", + "info": "Overlay Image" + }, + { + "type": "text", + "id": "text", + "default": "", + "label": "Overlay Text" + }, + { + "type": "color", + "id": "text_color", + "default": "#000", + "label": "Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "Shop Now", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec2321e74892843", + "name": "imageBanner", + "label": "Hero Image" + }, + { + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "coverUrl", + "type": "image_picker", + "label": "Video Cover Image URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + }, + { + "type": "select", + "id": "size", + "options": [ + { + "value": "adapt", + "text": "Adapt" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Video Height", + "info": "Height of Video" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "color", + "id": "heading_color", + "default": "#000", + "label": "Headin Text Color" + }, + { + "type": "text", + "id": "subHeading", + "default": "", + "label": "Sub-heading" + }, + { + "type": "color", + "id": "subheading_color", + "default": "#000", + "label": "Subheading Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "ShopNow", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec232bfc8892844", + "name": "videoBanner", + "label": "Hero Video" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first image" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides after every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image" + }, + { + "type": "url", + "id": "slide_link", + "label": "Slide Link" + } + ] + } + ], + "_id": "5feacca5bec232a916892845", + "name": "image-carousel", + "label": "Image Carousel", + "preset": { + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 2, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "collection", + "id": "collection", + "label": "Collection", + "info": "Select a collection to display its products" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec23258ec892846", + "name": "productList", + "label": "Product List", + "preset": { + "props": { + "heading": "Featured Products", + "item_count": 4, + "collection": "" + } + } + }, + { + "props": [ + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2 + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "testimonial", + "name": "Testimonial", + "props": [ + { + "type": "textarea", + "id": "testimonialText", + "label": "Text for Testimonial", + "default": "", + "info": "Text for testimonial", + "placeholder": "Text" + }, + { + "type": "text", + "id": "author", + "label": "Customers name" + } + ] + } + ], + "_id": "5feacca5bec23299e8892847", + "name": "testimonials", + "label": "Testimonial" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first video" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "video_item", + "name": "Video Slide", + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + } + ] + } + ], + "_id": "5feacca5bec232d89b892848", + "name": "videoCarousel", + "label": "Video Carousel" + } + ], + "sections": [ + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "Brands" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "department": { + "type": "department", + "value": null + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": null + } + } + } + ], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "collection-listing" + }, + { + "page_sections": [ + { + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Apple", + "id": "apple" + } + } + } + }, + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Gionee", + "id": "gionee" + } + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "heading": { + "type": "text", + "value": "Brandss" + }, + "brand_type": { + "type": "radio", + "value": "handpicked" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 4, + "type": "range" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + }, + { + "page_sections": [], + "page_key": "tesr" + } + ], + "application": "5e737afb97e0f586bf9d04db", + "available_pages": [ + { + "path": "product", + "type": "system", + "sections": [], + "text": "Product Description", + "value": "product-description" + }, + { + "path": "collection", + "type": "system", + "sections": [], + "text": "Collection Listing", + "value": "collection-listing" + }, + { + "path": "", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2327927892853", + "attributes": { + "page": "home" + } + } + ], + "value": "home", + "text": "Home" + }, + { + "path": "brands", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2326422892854", + "attributes": { + "page": "brands" + } + } + ], + "value": "brands", + "text": "Brands" + }, + { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + { + "path": "categories", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec232424c892855", + "attributes": { + "page": "categories" + } + } + ], + "value": "categories", + "text": "Categories" + }, + { + "path": "collections", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec23281de892856", + "attributes": { + "page": "collections" + } + } + ], + "value": "collections", + "text": "Collections" + }, + { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + }, + { + "path": "sections/test", + "type": "sections", + "sections": [], + "text": "test", + "value": "test" + } + ], + "styles": {}, + "constants": {}, + "settings": {}, + "created_at": "2020-12-22T05:09:04.720Z", + "updated_at": "2021-01-24T11:22:41.376Z" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getAppliedTheme +Get the applied theme + + + + +```swift +client.application("").theme.getAppliedTheme() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to retrieve the theme that is currently applied to the website along with its details. + +*Returned Response:* + + + + +[ThemesSchema](#ThemesSchema) + +Success. Refer `ThemesSchema` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "information": { + "images": { + "desktop": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ], + "android": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "ios": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "thumbnail": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ] + }, + "features": [ + "Responsive" + ], + "name": "Akash-Artisan" + }, + "src": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/sources/J-1s-N-pl-archive.zip" + }, + "assets": { + "css": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/Ia4m885Mw2-themeBundle.css" + }, + "umd_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/nEPGyc15g-themeBundle.umd.min.js" + }, + "common_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/5f7tOB5rpq-themeBundle.common.js" + } + }, + "config": { + "preset": { + "sections": [ + { + "page_sections": [ + { + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219133573.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/men-collection-vcahuo2q" + } + } + }, + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219184350.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/shirts-5e9654ad" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "image-carousel", + "props": { + "slide_height": { + "type": "select", + "value": "adapt" + }, + "autoplay": { + "type": "checkbox", + "value": false + }, + "slide_interval": { + "type": "range", + "value": 2 + } + } + }, + { + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "accessories-7ee89654" + }, + "title": { + "type": "text", + "value": "Turtle sports club" + }, + "subtitle": { + "type": "text", + "value": "Casual Collections" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/casual_nfadbl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Formal Collection" + }, + "subtitle": { + "type": "text", + "value": "Turtle Tailor Mark" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/tailors_nsrrfl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Bottomwear" + }, + "subtitle": { + "type": "text", + "value": "Chinos | Trousers | Pants" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/bottomwear_tdkhn2.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "t-shirt-7ee3cbcd" + }, + "title": { + "type": "text", + "value": "Shirts" + }, + "subtitle": { + "type": "text", + "value": "Casual" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/t-shirt_re9srk.jpg" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionGrid", + "props": { + "title": { + "type": "text", + "value": "Collections" + }, + "subtitle": { + "type": "text", + "value": "Buy from our" + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "department": { + "type": "department", + "value": "others" + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "layout": { + "type": "select", + "value": "grid" + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + } + ] + }, + "global_schema": { + "props": [ + { + "type": "color", + "id": "header_bg_color", + "default": "#ffffff", + "category": "Header", + "label": "Header background Color" + }, + { + "type": "color", + "id": "footer_bg_color", + "default": "#1b1b1b", + "category": "Footer", + "label": "Footer background Color" + }, + { + "type": "text", + "id": "footer_text", + "default": "", + "category": "Footer", + "label": "Footer Text" + }, + { + "type": "checkbox", + "id": "disable_cart", + "default": false, + "category": "Cart", + "label": "Disable Cart" + } + ] + }, + "current": "default", + "page_schema": [ + { + "props": [], + "_id": "5fe182f763d26d042fd205c4", + "page": "add-product-review" + }, + { + "props": [], + "_id": "5fe182f763d26dadc8d205c6", + "page": "blog" + }, + { + "props": [], + "_id": "5fe182f763d26d0a36d205c7", + "page": "brands" + }, + { + "props": [ + { + "type": "checkbox", + "id": "gst", + "label": "GST", + "default": true, + "info": "Show GST on cart" + }, + { + "type": "checkbox", + "id": "staff_selection", + "label": "Staff Selection", + "default": true, + "info": "Show Staff selection on Cart" + }, + { + "type": "checkbox", + "id": "enable_customer", + "label": "Customer", + "default": true, + "info": "Placing on behalf of customer" + }, + { + "type": "checkbox", + "id": "enable_guest", + "label": "Enable Guest Checkout", + "default": true, + "info": "Enable Continue as Guest" + } + ], + "_id": "5fe182f763d26d81c5d205c8", + "page": "cart-landing" + }, + { + "props": [], + "_id": "5fe182f763d26d7e15d205c9", + "page": "cart-review" + }, + { + "props": [], + "_id": "5fe182f763d26d270ed205ca", + "page": "categories" + }, + { + "props": [], + "_id": "5fe182f763d26d9b4fd205cb", + "page": "collection-listing" + }, + { + "props": [], + "_id": "5fe182f763d26da6ecd205cc", + "page": "collections" + }, + { + "props": [], + "_id": "5fe182f763d26d7156d205cd", + "page": "compare-products" + }, + { + "props": [], + "_id": "5fe182f763d26d62bad205ce", + "page": "home" + }, + { + "props": [], + "_id": "5fe182f763d26d5afcd205cf", + "page": "order-review" + }, + { + "props": [], + "_id": "5fe182f763d26def8dd205d0", + "page": "order-tracking-details" + }, + { + "props": [], + "_id": "5fe182f763d26d381fd205d1", + "page": "order-tracking" + }, + { + "props": [ + { + "type": "text", + "id": "shipping_link", + "label": "Shipping Link", + "default": "https://fynd.freshdesk.com/support/solutions/folders/33000111600", + "info": "Link of shipping page" + }, + { + "type": "checkbox", + "id": "original_image", + "label": "Use original Image", + "default": false, + "info": "Use original product image." + }, + { + "type": "checkbox", + "id": "wishlist", + "label": "Wishlist", + "default": true, + "info": "Show Wishlist for product" + }, + { + "type": "checkbox", + "id": "reviews", + "label": "Review", + "default": true, + "info": "Show Reviews of product" + }, + { + "type": "checkbox", + "id": "add_to_compare", + "label": "Add to Compare", + "default": true, + "info": "Allow comparison of products" + }, + { + "type": "checkbox", + "id": "size_guide", + "label": "Size Guide", + "default": true, + "info": "Show Size Guide" + }, + { + "type": "checkbox", + "id": "product_request", + "label": "Product Request", + "default": true, + "info": "Show Product Request" + }, + { + "type": "checkbox", + "id": "share", + "label": "Share", + "default": true, + "info": "Enable Sharing product" + }, + { + "type": "checkbox", + "id": "sold_by", + "label": "Show Sold By", + "default": true, + "info": "Show name of the store" + }, + { + "type": "checkbox", + "id": "store_selection", + "label": "Seller Store Selection", + "default": true, + "info": "Allow to explicitly select stores" + }, + { + "type": "checkbox", + "id": "compare_products", + "label": "Compare Products", + "default": true, + "info": "Show Most Compared Products" + }, + { + "type": "checkbox", + "id": "variants", + "label": "Product Variants", + "default": true, + "info": "Show Product Variants" + }, + { + "type": "checkbox", + "id": "ratings", + "label": "Product Rating", + "default": true, + "info": "Show Product Ratings" + }, + { + "type": "checkbox", + "id": "similar_products", + "label": "Similar Products", + "default": true, + "info": "Show Similar Products" + }, + { + "type": "checkbox", + "id": "bulk_prices", + "label": "Bulk Prices", + "default": true, + "info": "Show Bulk Prices" + }, + { + "type": "checkbox", + "id": "showDeliveryInfo", + "label": "Delivery Info", + "default": true, + "info": "Show Delivery Date" + } + ], + "_id": "5fe182f763d26d29bbd205d2", + "page": "product-description" + }, + { + "props": [], + "_id": "5fe182f763d26da5f0d205d3", + "page": "product-listing" + }, + { + "props": [], + "_id": "5fe182f763d26d3d18d205d4", + "page": "product-reviews" + }, + { + "props": [], + "_id": "5fe182f763d26d4e2dd205d5", + "page": "wishlist" + }, + { + "props": [ + { + "default": true, + "id": "header", + "label": "Header", + "type": "checkbox" + }, + { + "default": true, + "id": "footer", + "label": "Footer", + "type": "checkbox" + } + ], + "_id": "5fe7166cbaae343115de8555", + "page": "tesr" + } + ], + "list": [ + { + "name": "default", + "global_config": { + "static": { + "props": { + "colors": { + "primary_color": "#7043f7", + "secondary_color": "#02d1cb", + "accent_color": "#FFFFFF", + "link_color": "#7043f7", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "disable_cart": false + } + } + }, + "page": [ + { + "settings": { + "props": { + "show_info_message": true + } + }, + "page": "cart-landing" + } + ], + "_id": "5fc4bb9078e957737e7d79a3" + } + ] + }, + "colors": { + "primary_color": "#41434C", + "secondary_color": "#41434C", + "accent_color": "#FFFFFF", + "link_color": "#33B1C0", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + }, + "font": { + "variants": { + "light": { + "name": "300", + "file": "" + }, + "regular": { + "name": "regular", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVRS0Fbvbc14VxRD7N01bV7kg.ttf" + }, + "medium": { + "name": "500", + "file": "" + }, + "semi_bold": { + "name": "600", + "file": "" + }, + "bold": { + "name": "700", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVSS0Fbvbc14Vxps5xQ3Z5nm29Gww.ttf" + } + }, + "family": "Judson" + }, + "applied": true, + "published": false, + "archived": false, + "customized": true, + "version": "1.1.19", + "tags": [], + "_id": "5fe17f7063d26dc54fd202b4", + "pages": { + "home": { + "path": "", + "type": "system", + "sections": [], + "value": "home", + "text": "Home" + }, + "brands": { + "path": "brands", + "type": "system", + "sections": [], + "value": "brands", + "text": "Brands" + }, + "cart-landing": { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + "categories": { + "path": "categories", + "type": "system", + "sections": [], + "value": "categories", + "text": "Categories" + }, + "collections": { + "path": "collections", + "type": "system", + "sections": [], + "value": "collections", + "text": "Collections" + }, + "compare-products": { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + "product-description": { + "path": "product", + "type": "system", + "sections": [], + "value": "product-description", + "text": "Product Description" + }, + "product-listing": { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + "collection-listing": { + "path": "collection", + "type": "system", + "sections": [], + "value": "collection-listing", + "text": "COllection Listing" + }, + "wishlist": { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + } + }, + "available_sections": [ + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Brands", + "label": "Brands Heading" + }, + { + "type": "radio", + "id": "brand_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "department", + "text": "Department" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "department", + "id": "department", + "label": "Department", + "info": "Select a department of brands", + "note": "Department only applies if 'department' type is selected" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": [ + { + "type": "brand", + "id": "brand", + "label": "Select Brand" + } + ] + } + ], + "_id": "5feacca5bec232d59b89283a", + "name": "brandTemplate", + "label": "Brands List Page" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Categories", + "label": "Categories Heading" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All", + "info": "Check to show View All Button" + } + ], + "blocks": [], + "_id": "5feacca5bec232404189283b", + "name": "categoriesTemplate", + "label": "Categories Page" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Subtitle" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Background image", + "info": "Background Image" + }, + { + "type": "text", + "id": "title", + "default": "", + "label": "Overlay title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Overlay subtitle" + } + ] + } + ], + "_id": "5feacca5bec2321fd589283c", + "name": "collectionGrid", + "label": "Collection Grid" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collection List", + "label": "Collection Heading", + "info": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + } + ] + } + ], + "_id": "5feacca5bec2323bf689283d", + "name": "collectionList", + "label": "Collection List" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "radio", + "id": "collection_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "collection-item", + "name": "Collection Item", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select collection" + } + ] + } + ], + "_id": "5feacca5bec23263b489283e", + "name": "collectionTemplate", + "label": "Collection List Page" + }, + { + "props": [ + { + "type": "code", + "id": "code", + "label": "Custom HTML", + "info": "Add Your custom HTML Code below. You can also use the full screen icon to open a code editor and add your code" + } + ], + "blocks": [], + "_id": "5feacca5bec232409489283f", + "name": "customHtml", + "label": "Custom HTML" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Products", + "label": "Section Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "product", + "name": "Product", + "props": [ + { + "type": "product", + "id": "product", + "label": "Select a Product", + "info": "Product Item to be displayed" + } + ] + } + ], + "_id": "5feacca5bec2326213892840", + "name": "featuredProducts", + "label": "Featured Products", + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "props": [ + { + "type": "range", + "id": "item_count", + "min": 1, + "max": 4, + "step": 1, + "unit": "", + "label": "No of items", + "default": 4, + "info": "Maximum items allowed per row" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image", + "default": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1603773049684.svg" + }, + { + "type": "text", + "id": "caption", + "label": "Image Caption", + "default": "" + }, + { + "type": "url", + "id": "link", + "label": "Link", + "default": "", + "info": "Link to redirect" + } + ] + } + ], + "_id": "5feacca5bec2321047892841", + "name": "gallery", + "label": "Gallery", + "preset": { + "props": { + "item_count": 4 + }, + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec232b085892842", + "name": "heroBanner", + "label": "Hero Banner" + }, + { + "props": [ + { + "id": "image", + "type": "image_picker", + "label": "Hero Image", + "default": "" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "overlayLayout", + "type": "select", + "options": [ + { + "value": "left", + "text": "Align Left" + }, + { + "value": "center", + "text": "Align Center" + }, + { + "value": "right", + "text": "Align Right" + } + ], + "default": "left", + "label": "Overlay Layout", + "info": "Alignment of overlay content" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Overlay image", + "info": "Overlay Image" + }, + { + "type": "text", + "id": "text", + "default": "", + "label": "Overlay Text" + }, + { + "type": "color", + "id": "text_color", + "default": "#000", + "label": "Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "Shop Now", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec2321e74892843", + "name": "imageBanner", + "label": "Hero Image" + }, + { + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "coverUrl", + "type": "image_picker", + "label": "Video Cover Image URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + }, + { + "type": "select", + "id": "size", + "options": [ + { + "value": "adapt", + "text": "Adapt" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Video Height", + "info": "Height of Video" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "color", + "id": "heading_color", + "default": "#000", + "label": "Headin Text Color" + }, + { + "type": "text", + "id": "subHeading", + "default": "", + "label": "Sub-heading" + }, + { + "type": "color", + "id": "subheading_color", + "default": "#000", + "label": "Subheading Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "ShopNow", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec232bfc8892844", + "name": "videoBanner", + "label": "Hero Video" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first image" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides after every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image" + }, + { + "type": "url", + "id": "slide_link", + "label": "Slide Link" + } + ] + } + ], + "_id": "5feacca5bec232a916892845", + "name": "image-carousel", + "label": "Image Carousel", + "preset": { + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 2, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "collection", + "id": "collection", + "label": "Collection", + "info": "Select a collection to display its products" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec23258ec892846", + "name": "productList", + "label": "Product List", + "preset": { + "props": { + "heading": "Featured Products", + "item_count": 4, + "collection": "" + } + } + }, + { + "props": [ + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2 + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "testimonial", + "name": "Testimonial", + "props": [ + { + "type": "textarea", + "id": "testimonialText", + "label": "Text for Testimonial", + "default": "", + "info": "Text for testimonial", + "placeholder": "Text" + }, + { + "type": "text", + "id": "author", + "label": "Customers name" + } + ] + } + ], + "_id": "5feacca5bec23299e8892847", + "name": "testimonials", + "label": "Testimonial" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first video" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "video_item", + "name": "Video Slide", + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + } + ] + } + ], + "_id": "5feacca5bec232d89b892848", + "name": "videoCarousel", + "label": "Video Carousel" + } + ], + "sections": [ + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "Brands" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "department": { + "type": "department", + "value": null + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": null + } + } + } + ], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "collection-listing" + }, + { + "page_sections": [ + { + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Apple", + "id": "apple" + } + } + } + }, + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Gionee", + "id": "gionee" + } + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "heading": { + "type": "text", + "value": "Brandss" + }, + "brand_type": { + "type": "radio", + "value": "handpicked" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 4, + "type": "range" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + }, + { + "page_sections": [], + "page_key": "tesr" + } + ], + "application": "5e737afb97e0f586bf9d04db", + "available_pages": [ + { + "path": "product", + "type": "system", + "sections": [], + "text": "Product Description", + "value": "product-description" + }, + { + "path": "collection", + "type": "system", + "sections": [], + "text": "Collection Listing", + "value": "collection-listing" + }, + { + "path": "", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2327927892853", + "attributes": { + "page": "home" + } + } + ], + "value": "home", + "text": "Home" + }, + { + "path": "brands", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2326422892854", + "attributes": { + "page": "brands" + } + } + ], + "value": "brands", + "text": "Brands" + }, + { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + { + "path": "categories", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec232424c892855", + "attributes": { + "page": "categories" + } + } + ], + "value": "categories", + "text": "Categories" + }, + { + "path": "collections", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec23281de892856", + "attributes": { + "page": "collections" + } + } + ], + "value": "collections", + "text": "Collections" + }, + { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + }, + { + "path": "sections/test", + "type": "sections", + "sections": [], + "text": "test", + "value": "test" + } + ], + "styles": {}, + "constants": {}, + "settings": {}, + "created_at": "2020-12-22T05:09:04.720Z", + "updated_at": "2021-01-24T11:22:41.376Z" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getFonts +Get all the supported fonts in a theme + + + + +```swift +client.application("").theme.getFonts() { (response, error) in + // Use response +} +``` + + + + + + +Font is a collection of characters with a similar design. Use this API to retrieve a list of website fonts. + +*Returned Response:* + + + + +[FontsSchema](#FontsSchema) + +Success. Refer `FontsSchema` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "kind": "webfonts#webfontList", + "items": [ + { + "family": "ABeeZee", + "variants": [ + "regular", + "italic" + ], + "subsets": [ + "latin" + ], + "version": "v14", + "last_modified": "2020-09-02", + "files": { + "regular": "http://fonts.gstatic.com/s/abeezee/v14/esDR31xSG-6AGleN6tKukbcHCpE.ttf", + "italic": "http://fonts.gstatic.com/s/abeezee/v14/esDT31xSG-6AGleN2tCklZUCGpG-GQ.ttf" + }, + "category": "sans-serif", + "kind": "webfonts#webfont" + } + ] + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getThemeById +Gets theme by id + + + + +```swift +client.application("").theme.getThemeById(themeId: themeId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| themeId | String | yes | ID allotted to the theme. | + + + +Use this API to retrieve the details of a specific theme by using its ID. + +*Returned Response:* + + + + +[ThemesSchema](#ThemesSchema) + +Success. Refer `ThemesSchema` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "information": { + "images": { + "desktop": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ], + "android": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "ios": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "thumbnail": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ] + }, + "features": [ + "Responsive" + ], + "name": "Akash-Artisan" + }, + "src": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/sources/J-1s-N-pl-archive.zip" + }, + "assets": { + "css": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/Ia4m885Mw2-themeBundle.css" + }, + "umd_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/nEPGyc15g-themeBundle.umd.min.js" + }, + "common_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/5f7tOB5rpq-themeBundle.common.js" + } + }, + "config": { + "preset": { + "sections": [ + { + "page_sections": [ + { + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219133573.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/men-collection-vcahuo2q" + } + } + }, + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219184350.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/shirts-5e9654ad" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "image-carousel", + "props": { + "slide_height": { + "type": "select", + "value": "adapt" + }, + "autoplay": { + "type": "checkbox", + "value": false + }, + "slide_interval": { + "type": "range", + "value": 2 + } + } + }, + { + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "accessories-7ee89654" + }, + "title": { + "type": "text", + "value": "Turtle sports club" + }, + "subtitle": { + "type": "text", + "value": "Casual Collections" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/casual_nfadbl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Formal Collection" + }, + "subtitle": { + "type": "text", + "value": "Turtle Tailor Mark" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/tailors_nsrrfl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Bottomwear" + }, + "subtitle": { + "type": "text", + "value": "Chinos | Trousers | Pants" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/bottomwear_tdkhn2.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "t-shirt-7ee3cbcd" + }, + "title": { + "type": "text", + "value": "Shirts" + }, + "subtitle": { + "type": "text", + "value": "Casual" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/t-shirt_re9srk.jpg" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionGrid", + "props": { + "title": { + "type": "text", + "value": "Collections" + }, + "subtitle": { + "type": "text", + "value": "Buy from our" + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "department": { + "type": "department", + "value": "others" + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "layout": { + "type": "select", + "value": "grid" + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + } + ] + }, + "global_schema": { + "props": [ + { + "type": "color", + "id": "header_bg_color", + "default": "#ffffff", + "category": "Header", + "label": "Header background Color" + }, + { + "type": "color", + "id": "footer_bg_color", + "default": "#1b1b1b", + "category": "Footer", + "label": "Footer background Color" + }, + { + "type": "text", + "id": "footer_text", + "default": "", + "category": "Footer", + "label": "Footer Text" + }, + { + "type": "checkbox", + "id": "disable_cart", + "default": false, + "category": "Cart", + "label": "Disable Cart" + } + ] + }, + "current": "default", + "page_schema": [ + { + "props": [], + "_id": "5fe182f763d26d042fd205c4", + "page": "add-product-review" + }, + { + "props": [], + "_id": "5fe182f763d26dadc8d205c6", + "page": "blog" + }, + { + "props": [], + "_id": "5fe182f763d26d0a36d205c7", + "page": "brands" + }, + { + "props": [ + { + "type": "checkbox", + "id": "gst", + "label": "GST", + "default": true, + "info": "Show GST on cart" + }, + { + "type": "checkbox", + "id": "staff_selection", + "label": "Staff Selection", + "default": true, + "info": "Show Staff selection on Cart" + }, + { + "type": "checkbox", + "id": "enable_customer", + "label": "Customer", + "default": true, + "info": "Placing on behalf of customer" + }, + { + "type": "checkbox", + "id": "enable_guest", + "label": "Enable Guest Checkout", + "default": true, + "info": "Enable Continue as Guest" + } + ], + "_id": "5fe182f763d26d81c5d205c8", + "page": "cart-landing" + }, + { + "props": [], + "_id": "5fe182f763d26d7e15d205c9", + "page": "cart-review" + }, + { + "props": [], + "_id": "5fe182f763d26d270ed205ca", + "page": "categories" + }, + { + "props": [], + "_id": "5fe182f763d26d9b4fd205cb", + "page": "collection-listing" + }, + { + "props": [], + "_id": "5fe182f763d26da6ecd205cc", + "page": "collections" + }, + { + "props": [], + "_id": "5fe182f763d26d7156d205cd", + "page": "compare-products" + }, + { + "props": [], + "_id": "5fe182f763d26d62bad205ce", + "page": "home" + }, + { + "props": [], + "_id": "5fe182f763d26d5afcd205cf", + "page": "order-review" + }, + { + "props": [], + "_id": "5fe182f763d26def8dd205d0", + "page": "order-tracking-details" + }, + { + "props": [], + "_id": "5fe182f763d26d381fd205d1", + "page": "order-tracking" + }, + { + "props": [ + { + "type": "text", + "id": "shipping_link", + "label": "Shipping Link", + "default": "https://fynd.freshdesk.com/support/solutions/folders/33000111600", + "info": "Link of shipping page" + }, + { + "type": "checkbox", + "id": "original_image", + "label": "Use original Image", + "default": false, + "info": "Use original product image." + }, + { + "type": "checkbox", + "id": "wishlist", + "label": "Wishlist", + "default": true, + "info": "Show Wishlist for product" + }, + { + "type": "checkbox", + "id": "reviews", + "label": "Review", + "default": true, + "info": "Show Reviews of product" + }, + { + "type": "checkbox", + "id": "add_to_compare", + "label": "Add to Compare", + "default": true, + "info": "Allow comparison of products" + }, + { + "type": "checkbox", + "id": "size_guide", + "label": "Size Guide", + "default": true, + "info": "Show Size Guide" + }, + { + "type": "checkbox", + "id": "product_request", + "label": "Product Request", + "default": true, + "info": "Show Product Request" + }, + { + "type": "checkbox", + "id": "share", + "label": "Share", + "default": true, + "info": "Enable Sharing product" + }, + { + "type": "checkbox", + "id": "sold_by", + "label": "Show Sold By", + "default": true, + "info": "Show name of the store" + }, + { + "type": "checkbox", + "id": "store_selection", + "label": "Seller Store Selection", + "default": true, + "info": "Allow to explicitly select stores" + }, + { + "type": "checkbox", + "id": "compare_products", + "label": "Compare Products", + "default": true, + "info": "Show Most Compared Products" + }, + { + "type": "checkbox", + "id": "variants", + "label": "Product Variants", + "default": true, + "info": "Show Product Variants" + }, + { + "type": "checkbox", + "id": "ratings", + "label": "Product Rating", + "default": true, + "info": "Show Product Ratings" + }, + { + "type": "checkbox", + "id": "similar_products", + "label": "Similar Products", + "default": true, + "info": "Show Similar Products" + }, + { + "type": "checkbox", + "id": "bulk_prices", + "label": "Bulk Prices", + "default": true, + "info": "Show Bulk Prices" + }, + { + "type": "checkbox", + "id": "showDeliveryInfo", + "label": "Delivery Info", + "default": true, + "info": "Show Delivery Date" + } + ], + "_id": "5fe182f763d26d29bbd205d2", + "page": "product-description" + }, + { + "props": [], + "_id": "5fe182f763d26da5f0d205d3", + "page": "product-listing" + }, + { + "props": [], + "_id": "5fe182f763d26d3d18d205d4", + "page": "product-reviews" + }, + { + "props": [], + "_id": "5fe182f763d26d4e2dd205d5", + "page": "wishlist" + }, + { + "props": [ + { + "default": true, + "id": "header", + "label": "Header", + "type": "checkbox" + }, + { + "default": true, + "id": "footer", + "label": "Footer", + "type": "checkbox" + } + ], + "_id": "5fe7166cbaae343115de8555", + "page": "tesr" + } + ], + "list": [ + { + "name": "default", + "global_config": { + "static": { + "props": { + "colors": { + "primary_color": "#7043f7", + "secondary_color": "#02d1cb", + "accent_color": "#FFFFFF", + "link_color": "#7043f7", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "disable_cart": false + } + } + }, + "page": [ + { + "settings": { + "props": { + "show_info_message": true + } + }, + "page": "cart-landing" + } + ], + "_id": "5fc4bb9078e957737e7d79a3" + } + ] + }, + "colors": { + "primary_color": "#41434C", + "secondary_color": "#41434C", + "accent_color": "#FFFFFF", + "link_color": "#33B1C0", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + }, + "font": { + "variants": { + "light": { + "name": "300", + "file": "" + }, + "regular": { + "name": "regular", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVRS0Fbvbc14VxRD7N01bV7kg.ttf" + }, + "medium": { + "name": "500", + "file": "" + }, + "semi_bold": { + "name": "600", + "file": "" + }, + "bold": { + "name": "700", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVSS0Fbvbc14Vxps5xQ3Z5nm29Gww.ttf" + } + }, + "family": "Judson" + }, + "applied": true, + "published": false, + "archived": false, + "customized": true, + "version": "1.1.19", + "tags": [], + "_id": "5fe17f7063d26dc54fd202b4", + "pages": { + "home": { + "path": "", + "type": "system", + "sections": [], + "value": "home", + "text": "Home" + }, + "brands": { + "path": "brands", + "type": "system", + "sections": [], + "value": "brands", + "text": "Brands" + }, + "cart-landing": { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + "categories": { + "path": "categories", + "type": "system", + "sections": [], + "value": "categories", + "text": "Categories" + }, + "collections": { + "path": "collections", + "type": "system", + "sections": [], + "value": "collections", + "text": "Collections" + }, + "compare-products": { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + "product-description": { + "path": "product", + "type": "system", + "sections": [], + "value": "product-description", + "text": "Product Description" + }, + "product-listing": { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + "collection-listing": { + "path": "collection", + "type": "system", + "sections": [], + "value": "collection-listing", + "text": "COllection Listing" + }, + "wishlist": { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + } + }, + "available_sections": [ + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Brands", + "label": "Brands Heading" + }, + { + "type": "radio", + "id": "brand_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "department", + "text": "Department" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "department", + "id": "department", + "label": "Department", + "info": "Select a department of brands", + "note": "Department only applies if 'department' type is selected" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": [ + { + "type": "brand", + "id": "brand", + "label": "Select Brand" + } + ] + } + ], + "_id": "5feacca5bec232d59b89283a", + "name": "brandTemplate", + "label": "Brands List Page" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Categories", + "label": "Categories Heading" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All", + "info": "Check to show View All Button" + } + ], + "blocks": [], + "_id": "5feacca5bec232404189283b", + "name": "categoriesTemplate", + "label": "Categories Page" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Subtitle" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Background image", + "info": "Background Image" + }, + { + "type": "text", + "id": "title", + "default": "", + "label": "Overlay title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Overlay subtitle" + } + ] + } + ], + "_id": "5feacca5bec2321fd589283c", + "name": "collectionGrid", + "label": "Collection Grid" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collection List", + "label": "Collection Heading", + "info": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + } + ] + } + ], + "_id": "5feacca5bec2323bf689283d", + "name": "collectionList", + "label": "Collection List" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "radio", + "id": "collection_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "collection-item", + "name": "Collection Item", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select collection" + } + ] + } + ], + "_id": "5feacca5bec23263b489283e", + "name": "collectionTemplate", + "label": "Collection List Page" + }, + { + "props": [ + { + "type": "code", + "id": "code", + "label": "Custom HTML", + "info": "Add Your custom HTML Code below. You can also use the full screen icon to open a code editor and add your code" + } + ], + "blocks": [], + "_id": "5feacca5bec232409489283f", + "name": "customHtml", + "label": "Custom HTML" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Products", + "label": "Section Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "product", + "name": "Product", + "props": [ + { + "type": "product", + "id": "product", + "label": "Select a Product", + "info": "Product Item to be displayed" + } + ] + } + ], + "_id": "5feacca5bec2326213892840", + "name": "featuredProducts", + "label": "Featured Products", + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "props": [ + { + "type": "range", + "id": "item_count", + "min": 1, + "max": 4, + "step": 1, + "unit": "", + "label": "No of items", + "default": 4, + "info": "Maximum items allowed per row" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image", + "default": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1603773049684.svg" + }, + { + "type": "text", + "id": "caption", + "label": "Image Caption", + "default": "" + }, + { + "type": "url", + "id": "link", + "label": "Link", + "default": "", + "info": "Link to redirect" + } + ] + } + ], + "_id": "5feacca5bec2321047892841", + "name": "gallery", + "label": "Gallery", + "preset": { + "props": { + "item_count": 4 + }, + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec232b085892842", + "name": "heroBanner", + "label": "Hero Banner" + }, + { + "props": [ + { + "id": "image", + "type": "image_picker", + "label": "Hero Image", + "default": "" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "overlayLayout", + "type": "select", + "options": [ + { + "value": "left", + "text": "Align Left" + }, + { + "value": "center", + "text": "Align Center" + }, + { + "value": "right", + "text": "Align Right" + } + ], + "default": "left", + "label": "Overlay Layout", + "info": "Alignment of overlay content" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Overlay image", + "info": "Overlay Image" + }, + { + "type": "text", + "id": "text", + "default": "", + "label": "Overlay Text" + }, + { + "type": "color", + "id": "text_color", + "default": "#000", + "label": "Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "Shop Now", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec2321e74892843", + "name": "imageBanner", + "label": "Hero Image" + }, + { + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "coverUrl", + "type": "image_picker", + "label": "Video Cover Image URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + }, + { + "type": "select", + "id": "size", + "options": [ + { + "value": "adapt", + "text": "Adapt" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Video Height", + "info": "Height of Video" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "color", + "id": "heading_color", + "default": "#000", + "label": "Headin Text Color" + }, + { + "type": "text", + "id": "subHeading", + "default": "", + "label": "Sub-heading" + }, + { + "type": "color", + "id": "subheading_color", + "default": "#000", + "label": "Subheading Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "ShopNow", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec232bfc8892844", + "name": "videoBanner", + "label": "Hero Video" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first image" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides after every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image" + }, + { + "type": "url", + "id": "slide_link", + "label": "Slide Link" + } + ] + } + ], + "_id": "5feacca5bec232a916892845", + "name": "image-carousel", + "label": "Image Carousel", + "preset": { + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 2, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "collection", + "id": "collection", + "label": "Collection", + "info": "Select a collection to display its products" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec23258ec892846", + "name": "productList", + "label": "Product List", + "preset": { + "props": { + "heading": "Featured Products", + "item_count": 4, + "collection": "" + } + } + }, + { + "props": [ + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2 + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "testimonial", + "name": "Testimonial", + "props": [ + { + "type": "textarea", + "id": "testimonialText", + "label": "Text for Testimonial", + "default": "", + "info": "Text for testimonial", + "placeholder": "Text" + }, + { + "type": "text", + "id": "author", + "label": "Customers name" + } + ] + } + ], + "_id": "5feacca5bec23299e8892847", + "name": "testimonials", + "label": "Testimonial" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first video" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "video_item", + "name": "Video Slide", + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + } + ] + } + ], + "_id": "5feacca5bec232d89b892848", + "name": "videoCarousel", + "label": "Video Carousel" + } + ], + "sections": [ + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "Brands" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "department": { + "type": "department", + "value": null + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": null + } + } + } + ], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "collection-listing" + }, + { + "page_sections": [ + { + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Apple", + "id": "apple" + } + } + } + }, + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Gionee", + "id": "gionee" + } + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "heading": { + "type": "text", + "value": "Brandss" + }, + "brand_type": { + "type": "radio", + "value": "handpicked" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 4, + "type": "range" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + }, + { + "page_sections": [], + "page_key": "tesr" + } + ], + "application": "5e737afb97e0f586bf9d04db", + "available_pages": [ + { + "path": "product", + "type": "system", + "sections": [], + "text": "Product Description", + "value": "product-description" + }, + { + "path": "collection", + "type": "system", + "sections": [], + "text": "Collection Listing", + "value": "collection-listing" + }, + { + "path": "", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2327927892853", + "attributes": { + "page": "home" + } + } + ], + "value": "home", + "text": "Home" + }, + { + "path": "brands", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2326422892854", + "attributes": { + "page": "brands" + } + } + ], + "value": "brands", + "text": "Brands" + }, + { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + { + "path": "categories", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec232424c892855", + "attributes": { + "page": "categories" + } + } + ], + "value": "categories", + "text": "Categories" + }, + { + "path": "collections", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec23281de892856", + "attributes": { + "page": "collections" + } + } + ], + "value": "collections", + "text": "Collections" + }, + { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + }, + { + "path": "sections/test", + "type": "sections", + "sections": [], + "text": "test", + "value": "test" + } + ], + "styles": {}, + "constants": {}, + "settings": {}, + "created_at": "2020-12-22T05:09:04.720Z", + "updated_at": "2021-01-24T11:22:41.376Z" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### updateTheme +Update a theme + + + + +```swift +client.application("").theme.updateTheme(themeId: themeId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| themeId | String | yes | ID allotted to the theme. | +| body | ThemesSchema | yes | Request body | + + +Use this API to edit an existing theme. You can customize the website font, sections, images, styles, and many more. + +*Returned Response:* + + + + +[ThemesSchema](#ThemesSchema) + +Success. Refer `ThemesSchema` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "information": { + "images": { + "desktop": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ], + "android": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "ios": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "thumbnail": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ] + }, + "features": [ + "Responsive" + ], + "name": "Akash-Artisan" + }, + "src": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/sources/J-1s-N-pl-archive.zip" + }, + "assets": { + "css": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/Ia4m885Mw2-themeBundle.css" + }, + "umd_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/nEPGyc15g-themeBundle.umd.min.js" + }, + "common_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/5f7tOB5rpq-themeBundle.common.js" + } + }, + "config": { + "preset": { + "sections": [ + { + "page_sections": [ + { + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219133573.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/men-collection-vcahuo2q" + } + } + }, + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219184350.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/shirts-5e9654ad" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "image-carousel", + "props": { + "slide_height": { + "type": "select", + "value": "adapt" + }, + "autoplay": { + "type": "checkbox", + "value": false + }, + "slide_interval": { + "type": "range", + "value": 2 + } + } + }, + { + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "accessories-7ee89654" + }, + "title": { + "type": "text", + "value": "Turtle sports club" + }, + "subtitle": { + "type": "text", + "value": "Casual Collections" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/casual_nfadbl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Formal Collection" + }, + "subtitle": { + "type": "text", + "value": "Turtle Tailor Mark" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/tailors_nsrrfl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Bottomwear" + }, + "subtitle": { + "type": "text", + "value": "Chinos | Trousers | Pants" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/bottomwear_tdkhn2.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "t-shirt-7ee3cbcd" + }, + "title": { + "type": "text", + "value": "Shirts" + }, + "subtitle": { + "type": "text", + "value": "Casual" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/t-shirt_re9srk.jpg" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionGrid", + "props": { + "title": { + "type": "text", + "value": "Collections" + }, + "subtitle": { + "type": "text", + "value": "Buy from our" + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "department": { + "type": "department", + "value": "others" + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "layout": { + "type": "select", + "value": "grid" + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + } + ] + }, + "global_schema": { + "props": [ + { + "type": "color", + "id": "header_bg_color", + "default": "#ffffff", + "category": "Header", + "label": "Header background Color" + }, + { + "type": "color", + "id": "footer_bg_color", + "default": "#1b1b1b", + "category": "Footer", + "label": "Footer background Color" + }, + { + "type": "text", + "id": "footer_text", + "default": "", + "category": "Footer", + "label": "Footer Text" + }, + { + "type": "checkbox", + "id": "disable_cart", + "default": false, + "category": "Cart", + "label": "Disable Cart" + } + ] + }, + "current": "default", + "page_schema": [ + { + "props": [], + "_id": "5fe182f763d26d042fd205c4", + "page": "add-product-review" + }, + { + "props": [], + "_id": "5fe182f763d26dadc8d205c6", + "page": "blog" + }, + { + "props": [], + "_id": "5fe182f763d26d0a36d205c7", + "page": "brands" + }, + { + "props": [ + { + "type": "checkbox", + "id": "gst", + "label": "GST", + "default": true, + "info": "Show GST on cart" + }, + { + "type": "checkbox", + "id": "staff_selection", + "label": "Staff Selection", + "default": true, + "info": "Show Staff selection on Cart" + }, + { + "type": "checkbox", + "id": "enable_customer", + "label": "Customer", + "default": true, + "info": "Placing on behalf of customer" + }, + { + "type": "checkbox", + "id": "enable_guest", + "label": "Enable Guest Checkout", + "default": true, + "info": "Enable Continue as Guest" + } + ], + "_id": "5fe182f763d26d81c5d205c8", + "page": "cart-landing" + }, + { + "props": [], + "_id": "5fe182f763d26d7e15d205c9", + "page": "cart-review" + }, + { + "props": [], + "_id": "5fe182f763d26d270ed205ca", + "page": "categories" + }, + { + "props": [], + "_id": "5fe182f763d26d9b4fd205cb", + "page": "collection-listing" + }, + { + "props": [], + "_id": "5fe182f763d26da6ecd205cc", + "page": "collections" + }, + { + "props": [], + "_id": "5fe182f763d26d7156d205cd", + "page": "compare-products" + }, + { + "props": [], + "_id": "5fe182f763d26d62bad205ce", + "page": "home" + }, + { + "props": [], + "_id": "5fe182f763d26d5afcd205cf", + "page": "order-review" + }, + { + "props": [], + "_id": "5fe182f763d26def8dd205d0", + "page": "order-tracking-details" + }, + { + "props": [], + "_id": "5fe182f763d26d381fd205d1", + "page": "order-tracking" + }, + { + "props": [ + { + "type": "text", + "id": "shipping_link", + "label": "Shipping Link", + "default": "https://fynd.freshdesk.com/support/solutions/folders/33000111600", + "info": "Link of shipping page" + }, + { + "type": "checkbox", + "id": "original_image", + "label": "Use original Image", + "default": false, + "info": "Use original product image." + }, + { + "type": "checkbox", + "id": "wishlist", + "label": "Wishlist", + "default": true, + "info": "Show Wishlist for product" + }, + { + "type": "checkbox", + "id": "reviews", + "label": "Review", + "default": true, + "info": "Show Reviews of product" + }, + { + "type": "checkbox", + "id": "add_to_compare", + "label": "Add to Compare", + "default": true, + "info": "Allow comparison of products" + }, + { + "type": "checkbox", + "id": "size_guide", + "label": "Size Guide", + "default": true, + "info": "Show Size Guide" + }, + { + "type": "checkbox", + "id": "product_request", + "label": "Product Request", + "default": true, + "info": "Show Product Request" + }, + { + "type": "checkbox", + "id": "share", + "label": "Share", + "default": true, + "info": "Enable Sharing product" + }, + { + "type": "checkbox", + "id": "sold_by", + "label": "Show Sold By", + "default": true, + "info": "Show name of the store" + }, + { + "type": "checkbox", + "id": "store_selection", + "label": "Seller Store Selection", + "default": true, + "info": "Allow to explicitly select stores" + }, + { + "type": "checkbox", + "id": "compare_products", + "label": "Compare Products", + "default": true, + "info": "Show Most Compared Products" + }, + { + "type": "checkbox", + "id": "variants", + "label": "Product Variants", + "default": true, + "info": "Show Product Variants" + }, + { + "type": "checkbox", + "id": "ratings", + "label": "Product Rating", + "default": true, + "info": "Show Product Ratings" + }, + { + "type": "checkbox", + "id": "similar_products", + "label": "Similar Products", + "default": true, + "info": "Show Similar Products" + }, + { + "type": "checkbox", + "id": "bulk_prices", + "label": "Bulk Prices", + "default": true, + "info": "Show Bulk Prices" + }, + { + "type": "checkbox", + "id": "showDeliveryInfo", + "label": "Delivery Info", + "default": true, + "info": "Show Delivery Date" + } + ], + "_id": "5fe182f763d26d29bbd205d2", + "page": "product-description" + }, + { + "props": [], + "_id": "5fe182f763d26da5f0d205d3", + "page": "product-listing" + }, + { + "props": [], + "_id": "5fe182f763d26d3d18d205d4", + "page": "product-reviews" + }, + { + "props": [], + "_id": "5fe182f763d26d4e2dd205d5", + "page": "wishlist" + }, + { + "props": [ + { + "default": true, + "id": "header", + "label": "Header", + "type": "checkbox" + }, + { + "default": true, + "id": "footer", + "label": "Footer", + "type": "checkbox" + } + ], + "_id": "5fe7166cbaae343115de8555", + "page": "tesr" + } + ], + "list": [ + { + "name": "default", + "global_config": { + "static": { + "props": { + "colors": { + "primary_color": "#7043f7", + "secondary_color": "#02d1cb", + "accent_color": "#FFFFFF", + "link_color": "#7043f7", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "disable_cart": false + } + } + }, + "page": [ + { + "settings": { + "props": { + "show_info_message": true + } + }, + "page": "cart-landing" + } + ], + "_id": "5fc4bb9078e957737e7d79a3" + } + ] + }, + "colors": { + "primary_color": "#41434C", + "secondary_color": "#41434C", + "accent_color": "#FFFFFF", + "link_color": "#33B1C0", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + }, + "font": { + "variants": { + "light": { + "name": "300", + "file": "" + }, + "regular": { + "name": "regular", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVRS0Fbvbc14VxRD7N01bV7kg.ttf" + }, + "medium": { + "name": "500", + "file": "" + }, + "semi_bold": { + "name": "600", + "file": "" + }, + "bold": { + "name": "700", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVSS0Fbvbc14Vxps5xQ3Z5nm29Gww.ttf" + } + }, + "family": "Judson" + }, + "applied": true, + "published": false, + "archived": false, + "customized": true, + "version": "1.1.19", + "tags": [], + "_id": "5fe17f7063d26dc54fd202b4", + "pages": { + "home": { + "path": "", + "type": "system", + "sections": [], + "value": "home", + "text": "Home" + }, + "brands": { + "path": "brands", + "type": "system", + "sections": [], + "value": "brands", + "text": "Brands" + }, + "cart-landing": { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + "categories": { + "path": "categories", + "type": "system", + "sections": [], + "value": "categories", + "text": "Categories" + }, + "collections": { + "path": "collections", + "type": "system", + "sections": [], + "value": "collections", + "text": "Collections" + }, + "compare-products": { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + "product-description": { + "path": "product", + "type": "system", + "sections": [], + "value": "product-description", + "text": "Product Description" + }, + "product-listing": { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + "collection-listing": { + "path": "collection", + "type": "system", + "sections": [], + "value": "collection-listing", + "text": "COllection Listing" + }, + "wishlist": { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + } + }, + "available_sections": [ + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Brands", + "label": "Brands Heading" + }, + { + "type": "radio", + "id": "brand_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "department", + "text": "Department" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "department", + "id": "department", + "label": "Department", + "info": "Select a department of brands", + "note": "Department only applies if 'department' type is selected" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": [ + { + "type": "brand", + "id": "brand", + "label": "Select Brand" + } + ] + } + ], + "_id": "5feacca5bec232d59b89283a", + "name": "brandTemplate", + "label": "Brands List Page" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Categories", + "label": "Categories Heading" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All", + "info": "Check to show View All Button" + } + ], + "blocks": [], + "_id": "5feacca5bec232404189283b", + "name": "categoriesTemplate", + "label": "Categories Page" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Subtitle" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Background image", + "info": "Background Image" + }, + { + "type": "text", + "id": "title", + "default": "", + "label": "Overlay title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Overlay subtitle" + } + ] + } + ], + "_id": "5feacca5bec2321fd589283c", + "name": "collectionGrid", + "label": "Collection Grid" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collection List", + "label": "Collection Heading", + "info": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + } + ] + } + ], + "_id": "5feacca5bec2323bf689283d", + "name": "collectionList", + "label": "Collection List" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "radio", + "id": "collection_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "collection-item", + "name": "Collection Item", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select collection" + } + ] + } + ], + "_id": "5feacca5bec23263b489283e", + "name": "collectionTemplate", + "label": "Collection List Page" + }, + { + "props": [ + { + "type": "code", + "id": "code", + "label": "Custom HTML", + "info": "Add Your custom HTML Code below. You can also use the full screen icon to open a code editor and add your code" + } + ], + "blocks": [], + "_id": "5feacca5bec232409489283f", + "name": "customHtml", + "label": "Custom HTML" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Products", + "label": "Section Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "product", + "name": "Product", + "props": [ + { + "type": "product", + "id": "product", + "label": "Select a Product", + "info": "Product Item to be displayed" + } + ] + } + ], + "_id": "5feacca5bec2326213892840", + "name": "featuredProducts", + "label": "Featured Products", + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "props": [ + { + "type": "range", + "id": "item_count", + "min": 1, + "max": 4, + "step": 1, + "unit": "", + "label": "No of items", + "default": 4, + "info": "Maximum items allowed per row" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image", + "default": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1603773049684.svg" + }, + { + "type": "text", + "id": "caption", + "label": "Image Caption", + "default": "" + }, + { + "type": "url", + "id": "link", + "label": "Link", + "default": "", + "info": "Link to redirect" + } + ] + } + ], + "_id": "5feacca5bec2321047892841", + "name": "gallery", + "label": "Gallery", + "preset": { + "props": { + "item_count": 4 + }, + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec232b085892842", + "name": "heroBanner", + "label": "Hero Banner" + }, + { + "props": [ + { + "id": "image", + "type": "image_picker", + "label": "Hero Image", + "default": "" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "overlayLayout", + "type": "select", + "options": [ + { + "value": "left", + "text": "Align Left" + }, + { + "value": "center", + "text": "Align Center" + }, + { + "value": "right", + "text": "Align Right" + } + ], + "default": "left", + "label": "Overlay Layout", + "info": "Alignment of overlay content" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Overlay image", + "info": "Overlay Image" + }, + { + "type": "text", + "id": "text", + "default": "", + "label": "Overlay Text" + }, + { + "type": "color", + "id": "text_color", + "default": "#000", + "label": "Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "Shop Now", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec2321e74892843", + "name": "imageBanner", + "label": "Hero Image" + }, + { + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "coverUrl", + "type": "image_picker", + "label": "Video Cover Image URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + }, + { + "type": "select", + "id": "size", + "options": [ + { + "value": "adapt", + "text": "Adapt" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Video Height", + "info": "Height of Video" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "color", + "id": "heading_color", + "default": "#000", + "label": "Headin Text Color" + }, + { + "type": "text", + "id": "subHeading", + "default": "", + "label": "Sub-heading" + }, + { + "type": "color", + "id": "subheading_color", + "default": "#000", + "label": "Subheading Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "ShopNow", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec232bfc8892844", + "name": "videoBanner", + "label": "Hero Video" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first image" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides after every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image" + }, + { + "type": "url", + "id": "slide_link", + "label": "Slide Link" + } + ] + } + ], + "_id": "5feacca5bec232a916892845", + "name": "image-carousel", + "label": "Image Carousel", + "preset": { + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 2, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "collection", + "id": "collection", + "label": "Collection", + "info": "Select a collection to display its products" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec23258ec892846", + "name": "productList", + "label": "Product List", + "preset": { + "props": { + "heading": "Featured Products", + "item_count": 4, + "collection": "" + } + } + }, + { + "props": [ + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2 + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "testimonial", + "name": "Testimonial", + "props": [ + { + "type": "textarea", + "id": "testimonialText", + "label": "Text for Testimonial", + "default": "", + "info": "Text for testimonial", + "placeholder": "Text" + }, + { + "type": "text", + "id": "author", + "label": "Customers name" + } + ] + } + ], + "_id": "5feacca5bec23299e8892847", + "name": "testimonials", + "label": "Testimonial" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first video" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "video_item", + "name": "Video Slide", + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + } + ] + } + ], + "_id": "5feacca5bec232d89b892848", + "name": "videoCarousel", + "label": "Video Carousel" + } + ], + "sections": [ + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "Brands" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "department": { + "type": "department", + "value": null + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": null + } + } + } + ], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "collection-listing" + }, + { + "page_sections": [ + { + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Apple", + "id": "apple" + } + } + } + }, + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Gionee", + "id": "gionee" + } + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "heading": { + "type": "text", + "value": "Brandss" + }, + "brand_type": { + "type": "radio", + "value": "handpicked" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 4, + "type": "range" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + }, + { + "page_sections": [], + "page_key": "tesr" + } + ], + "application": "5e737afb97e0f586bf9d04db", + "available_pages": [ + { + "path": "product", + "type": "system", + "sections": [], + "text": "Product Description", + "value": "product-description" + }, + { + "path": "collection", + "type": "system", + "sections": [], + "text": "Collection Listing", + "value": "collection-listing" + }, + { + "path": "", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2327927892853", + "attributes": { + "page": "home" + } + } + ], + "value": "home", + "text": "Home" + }, + { + "path": "brands", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2326422892854", + "attributes": { + "page": "brands" + } + } + ], + "value": "brands", + "text": "Brands" + }, + { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + { + "path": "categories", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec232424c892855", + "attributes": { + "page": "categories" + } + } + ], + "value": "categories", + "text": "Categories" + }, + { + "path": "collections", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec23281de892856", + "attributes": { + "page": "collections" + } + } + ], + "value": "collections", + "text": "Collections" + }, + { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + }, + { + "path": "sections/test", + "type": "sections", + "sections": [], + "text": "test", + "value": "test" + } + ], + "styles": {}, + "constants": {}, + "settings": {}, + "created_at": "2020-12-22T05:09:04.720Z", + "updated_at": "2021-01-24T11:22:41.376Z" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### deleteTheme +Delete a theme + + + + +```swift +client.application("").theme.deleteTheme(themeId: themeId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| themeId | String | yes | ID allotted to the theme. | + + + +Use this API to delete a theme from the theme library. + +*Returned Response:* + + + + +[ThemesSchema](#ThemesSchema) + +Success. Refer `ThemesSchema` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "information": { + "images": { + "desktop": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ], + "android": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "ios": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "thumbnail": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ] + }, + "features": [ + "Responsive" + ], + "name": "Akash-Artisan" + }, + "src": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/sources/J-1s-N-pl-archive.zip" + }, + "assets": { + "css": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/Ia4m885Mw2-themeBundle.css" + }, + "umd_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/nEPGyc15g-themeBundle.umd.min.js" + }, + "common_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/5f7tOB5rpq-themeBundle.common.js" + } + }, + "config": { + "preset": { + "sections": [ + { + "page_sections": [ + { + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219133573.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/men-collection-vcahuo2q" + } + } + }, + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219184350.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/shirts-5e9654ad" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "image-carousel", + "props": { + "slide_height": { + "type": "select", + "value": "adapt" + }, + "autoplay": { + "type": "checkbox", + "value": false + }, + "slide_interval": { + "type": "range", + "value": 2 + } + } + }, + { + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "accessories-7ee89654" + }, + "title": { + "type": "text", + "value": "Turtle sports club" + }, + "subtitle": { + "type": "text", + "value": "Casual Collections" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/casual_nfadbl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Formal Collection" + }, + "subtitle": { + "type": "text", + "value": "Turtle Tailor Mark" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/tailors_nsrrfl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Bottomwear" + }, + "subtitle": { + "type": "text", + "value": "Chinos | Trousers | Pants" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/bottomwear_tdkhn2.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "t-shirt-7ee3cbcd" + }, + "title": { + "type": "text", + "value": "Shirts" + }, + "subtitle": { + "type": "text", + "value": "Casual" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/t-shirt_re9srk.jpg" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionGrid", + "props": { + "title": { + "type": "text", + "value": "Collections" + }, + "subtitle": { + "type": "text", + "value": "Buy from our" + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "department": { + "type": "department", + "value": "others" + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "layout": { + "type": "select", + "value": "grid" + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + } + ] + }, + "global_schema": { + "props": [ + { + "type": "color", + "id": "header_bg_color", + "default": "#ffffff", + "category": "Header", + "label": "Header background Color" + }, + { + "type": "color", + "id": "footer_bg_color", + "default": "#1b1b1b", + "category": "Footer", + "label": "Footer background Color" + }, + { + "type": "text", + "id": "footer_text", + "default": "", + "category": "Footer", + "label": "Footer Text" + }, + { + "type": "checkbox", + "id": "disable_cart", + "default": false, + "category": "Cart", + "label": "Disable Cart" + } + ] + }, + "current": "default", + "page_schema": [ + { + "props": [], + "_id": "5fe182f763d26d042fd205c4", + "page": "add-product-review" + }, + { + "props": [], + "_id": "5fe182f763d26dadc8d205c6", + "page": "blog" + }, + { + "props": [], + "_id": "5fe182f763d26d0a36d205c7", + "page": "brands" + }, + { + "props": [ + { + "type": "checkbox", + "id": "gst", + "label": "GST", + "default": true, + "info": "Show GST on cart" + }, + { + "type": "checkbox", + "id": "staff_selection", + "label": "Staff Selection", + "default": true, + "info": "Show Staff selection on Cart" + }, + { + "type": "checkbox", + "id": "enable_customer", + "label": "Customer", + "default": true, + "info": "Placing on behalf of customer" + }, + { + "type": "checkbox", + "id": "enable_guest", + "label": "Enable Guest Checkout", + "default": true, + "info": "Enable Continue as Guest" + } + ], + "_id": "5fe182f763d26d81c5d205c8", + "page": "cart-landing" + }, + { + "props": [], + "_id": "5fe182f763d26d7e15d205c9", + "page": "cart-review" + }, + { + "props": [], + "_id": "5fe182f763d26d270ed205ca", + "page": "categories" + }, + { + "props": [], + "_id": "5fe182f763d26d9b4fd205cb", + "page": "collection-listing" + }, + { + "props": [], + "_id": "5fe182f763d26da6ecd205cc", + "page": "collections" + }, + { + "props": [], + "_id": "5fe182f763d26d7156d205cd", + "page": "compare-products" + }, + { + "props": [], + "_id": "5fe182f763d26d62bad205ce", + "page": "home" + }, + { + "props": [], + "_id": "5fe182f763d26d5afcd205cf", + "page": "order-review" + }, + { + "props": [], + "_id": "5fe182f763d26def8dd205d0", + "page": "order-tracking-details" + }, + { + "props": [], + "_id": "5fe182f763d26d381fd205d1", + "page": "order-tracking" + }, + { + "props": [ + { + "type": "text", + "id": "shipping_link", + "label": "Shipping Link", + "default": "https://fynd.freshdesk.com/support/solutions/folders/33000111600", + "info": "Link of shipping page" + }, + { + "type": "checkbox", + "id": "original_image", + "label": "Use original Image", + "default": false, + "info": "Use original product image." + }, + { + "type": "checkbox", + "id": "wishlist", + "label": "Wishlist", + "default": true, + "info": "Show Wishlist for product" + }, + { + "type": "checkbox", + "id": "reviews", + "label": "Review", + "default": true, + "info": "Show Reviews of product" + }, + { + "type": "checkbox", + "id": "add_to_compare", + "label": "Add to Compare", + "default": true, + "info": "Allow comparison of products" + }, + { + "type": "checkbox", + "id": "size_guide", + "label": "Size Guide", + "default": true, + "info": "Show Size Guide" + }, + { + "type": "checkbox", + "id": "product_request", + "label": "Product Request", + "default": true, + "info": "Show Product Request" + }, + { + "type": "checkbox", + "id": "share", + "label": "Share", + "default": true, + "info": "Enable Sharing product" + }, + { + "type": "checkbox", + "id": "sold_by", + "label": "Show Sold By", + "default": true, + "info": "Show name of the store" + }, + { + "type": "checkbox", + "id": "store_selection", + "label": "Seller Store Selection", + "default": true, + "info": "Allow to explicitly select stores" + }, + { + "type": "checkbox", + "id": "compare_products", + "label": "Compare Products", + "default": true, + "info": "Show Most Compared Products" + }, + { + "type": "checkbox", + "id": "variants", + "label": "Product Variants", + "default": true, + "info": "Show Product Variants" + }, + { + "type": "checkbox", + "id": "ratings", + "label": "Product Rating", + "default": true, + "info": "Show Product Ratings" + }, + { + "type": "checkbox", + "id": "similar_products", + "label": "Similar Products", + "default": true, + "info": "Show Similar Products" + }, + { + "type": "checkbox", + "id": "bulk_prices", + "label": "Bulk Prices", + "default": true, + "info": "Show Bulk Prices" + }, + { + "type": "checkbox", + "id": "showDeliveryInfo", + "label": "Delivery Info", + "default": true, + "info": "Show Delivery Date" + } + ], + "_id": "5fe182f763d26d29bbd205d2", + "page": "product-description" + }, + { + "props": [], + "_id": "5fe182f763d26da5f0d205d3", + "page": "product-listing" + }, + { + "props": [], + "_id": "5fe182f763d26d3d18d205d4", + "page": "product-reviews" + }, + { + "props": [], + "_id": "5fe182f763d26d4e2dd205d5", + "page": "wishlist" + }, + { + "props": [ + { + "default": true, + "id": "header", + "label": "Header", + "type": "checkbox" + }, + { + "default": true, + "id": "footer", + "label": "Footer", + "type": "checkbox" + } + ], + "_id": "5fe7166cbaae343115de8555", + "page": "tesr" + } + ], + "list": [ + { + "name": "default", + "global_config": { + "static": { + "props": { + "colors": { + "primary_color": "#7043f7", + "secondary_color": "#02d1cb", + "accent_color": "#FFFFFF", + "link_color": "#7043f7", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "disable_cart": false + } + } + }, + "page": [ + { + "settings": { + "props": { + "show_info_message": true + } + }, + "page": "cart-landing" + } + ], + "_id": "5fc4bb9078e957737e7d79a3" + } + ] + }, + "colors": { + "primary_color": "#41434C", + "secondary_color": "#41434C", + "accent_color": "#FFFFFF", + "link_color": "#33B1C0", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + }, + "font": { + "variants": { + "light": { + "name": "300", + "file": "" + }, + "regular": { + "name": "regular", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVRS0Fbvbc14VxRD7N01bV7kg.ttf" + }, + "medium": { + "name": "500", + "file": "" + }, + "semi_bold": { + "name": "600", + "file": "" + }, + "bold": { + "name": "700", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVSS0Fbvbc14Vxps5xQ3Z5nm29Gww.ttf" + } + }, + "family": "Judson" + }, + "applied": true, + "published": false, + "archived": false, + "customized": true, + "version": "1.1.19", + "tags": [], + "_id": "5fe17f7063d26dc54fd202b4", + "pages": { + "home": { + "path": "", + "type": "system", + "sections": [], + "value": "home", + "text": "Home" + }, + "brands": { + "path": "brands", + "type": "system", + "sections": [], + "value": "brands", + "text": "Brands" + }, + "cart-landing": { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + "categories": { + "path": "categories", + "type": "system", + "sections": [], + "value": "categories", + "text": "Categories" + }, + "collections": { + "path": "collections", + "type": "system", + "sections": [], + "value": "collections", + "text": "Collections" + }, + "compare-products": { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + "product-description": { + "path": "product", + "type": "system", + "sections": [], + "value": "product-description", + "text": "Product Description" + }, + "product-listing": { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + "collection-listing": { + "path": "collection", + "type": "system", + "sections": [], + "value": "collection-listing", + "text": "COllection Listing" + }, + "wishlist": { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + } + }, + "available_sections": [ + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Brands", + "label": "Brands Heading" + }, + { + "type": "radio", + "id": "brand_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "department", + "text": "Department" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "department", + "id": "department", + "label": "Department", + "info": "Select a department of brands", + "note": "Department only applies if 'department' type is selected" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": [ + { + "type": "brand", + "id": "brand", + "label": "Select Brand" + } + ] + } + ], + "_id": "5feacca5bec232d59b89283a", + "name": "brandTemplate", + "label": "Brands List Page" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Categories", + "label": "Categories Heading" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All", + "info": "Check to show View All Button" + } + ], + "blocks": [], + "_id": "5feacca5bec232404189283b", + "name": "categoriesTemplate", + "label": "Categories Page" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Subtitle" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Background image", + "info": "Background Image" + }, + { + "type": "text", + "id": "title", + "default": "", + "label": "Overlay title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Overlay subtitle" + } + ] + } + ], + "_id": "5feacca5bec2321fd589283c", + "name": "collectionGrid", + "label": "Collection Grid" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collection List", + "label": "Collection Heading", + "info": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + } + ] + } + ], + "_id": "5feacca5bec2323bf689283d", + "name": "collectionList", + "label": "Collection List" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "radio", + "id": "collection_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "collection-item", + "name": "Collection Item", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select collection" + } + ] + } + ], + "_id": "5feacca5bec23263b489283e", + "name": "collectionTemplate", + "label": "Collection List Page" + }, + { + "props": [ + { + "type": "code", + "id": "code", + "label": "Custom HTML", + "info": "Add Your custom HTML Code below. You can also use the full screen icon to open a code editor and add your code" + } + ], + "blocks": [], + "_id": "5feacca5bec232409489283f", + "name": "customHtml", + "label": "Custom HTML" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Products", + "label": "Section Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "product", + "name": "Product", + "props": [ + { + "type": "product", + "id": "product", + "label": "Select a Product", + "info": "Product Item to be displayed" + } + ] + } + ], + "_id": "5feacca5bec2326213892840", + "name": "featuredProducts", + "label": "Featured Products", + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "props": [ + { + "type": "range", + "id": "item_count", + "min": 1, + "max": 4, + "step": 1, + "unit": "", + "label": "No of items", + "default": 4, + "info": "Maximum items allowed per row" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image", + "default": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1603773049684.svg" + }, + { + "type": "text", + "id": "caption", + "label": "Image Caption", + "default": "" + }, + { + "type": "url", + "id": "link", + "label": "Link", + "default": "", + "info": "Link to redirect" + } + ] + } + ], + "_id": "5feacca5bec2321047892841", + "name": "gallery", + "label": "Gallery", + "preset": { + "props": { + "item_count": 4 + }, + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec232b085892842", + "name": "heroBanner", + "label": "Hero Banner" + }, + { + "props": [ + { + "id": "image", + "type": "image_picker", + "label": "Hero Image", + "default": "" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "overlayLayout", + "type": "select", + "options": [ + { + "value": "left", + "text": "Align Left" + }, + { + "value": "center", + "text": "Align Center" + }, + { + "value": "right", + "text": "Align Right" + } + ], + "default": "left", + "label": "Overlay Layout", + "info": "Alignment of overlay content" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Overlay image", + "info": "Overlay Image" + }, + { + "type": "text", + "id": "text", + "default": "", + "label": "Overlay Text" + }, + { + "type": "color", + "id": "text_color", + "default": "#000", + "label": "Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "Shop Now", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec2321e74892843", + "name": "imageBanner", + "label": "Hero Image" + }, + { + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "coverUrl", + "type": "image_picker", + "label": "Video Cover Image URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + }, + { + "type": "select", + "id": "size", + "options": [ + { + "value": "adapt", + "text": "Adapt" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Video Height", + "info": "Height of Video" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "color", + "id": "heading_color", + "default": "#000", + "label": "Headin Text Color" + }, + { + "type": "text", + "id": "subHeading", + "default": "", + "label": "Sub-heading" + }, + { + "type": "color", + "id": "subheading_color", + "default": "#000", + "label": "Subheading Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "ShopNow", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec232bfc8892844", + "name": "videoBanner", + "label": "Hero Video" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first image" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides after every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image" + }, + { + "type": "url", + "id": "slide_link", + "label": "Slide Link" + } + ] + } + ], + "_id": "5feacca5bec232a916892845", + "name": "image-carousel", + "label": "Image Carousel", + "preset": { + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 2, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "collection", + "id": "collection", + "label": "Collection", + "info": "Select a collection to display its products" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec23258ec892846", + "name": "productList", + "label": "Product List", + "preset": { + "props": { + "heading": "Featured Products", + "item_count": 4, + "collection": "" + } + } + }, + { + "props": [ + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2 + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "testimonial", + "name": "Testimonial", + "props": [ + { + "type": "textarea", + "id": "testimonialText", + "label": "Text for Testimonial", + "default": "", + "info": "Text for testimonial", + "placeholder": "Text" + }, + { + "type": "text", + "id": "author", + "label": "Customers name" + } + ] + } + ], + "_id": "5feacca5bec23299e8892847", + "name": "testimonials", + "label": "Testimonial" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first video" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "video_item", + "name": "Video Slide", + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + } + ] + } + ], + "_id": "5feacca5bec232d89b892848", + "name": "videoCarousel", + "label": "Video Carousel" + } + ], + "sections": [ + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "Brands" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "department": { + "type": "department", + "value": null + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": null + } + } + } + ], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "collection-listing" + }, + { + "page_sections": [ + { + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Apple", + "id": "apple" + } + } + } + }, + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Gionee", + "id": "gionee" + } + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "heading": { + "type": "text", + "value": "Brandss" + }, + "brand_type": { + "type": "radio", + "value": "handpicked" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 4, + "type": "range" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + }, + { + "page_sections": [], + "page_key": "tesr" + } + ], + "application": "5e737afb97e0f586bf9d04db", + "available_pages": [ + { + "path": "product", + "type": "system", + "sections": [], + "text": "Product Description", + "value": "product-description" + }, + { + "path": "collection", + "type": "system", + "sections": [], + "text": "Collection Listing", + "value": "collection-listing" + }, + { + "path": "", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2327927892853", + "attributes": { + "page": "home" + } + } + ], + "value": "home", + "text": "Home" + }, + { + "path": "brands", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2326422892854", + "attributes": { + "page": "brands" + } + } + ], + "value": "brands", + "text": "Brands" + }, + { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + { + "path": "categories", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec232424c892855", + "attributes": { + "page": "categories" + } + } + ], + "value": "categories", + "text": "Categories" + }, + { + "path": "collections", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec23281de892856", + "attributes": { + "page": "collections" + } + } + ], + "value": "collections", + "text": "Collections" + }, + { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + }, + { + "path": "sections/test", + "type": "sections", + "sections": [], + "text": "test", + "value": "test" + } + ], + "styles": {}, + "constants": {}, + "settings": {}, + "created_at": "2020-12-22T05:09:04.720Z", + "updated_at": "2021-01-24T11:22:41.376Z" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### getThemeForPreview +Get a theme preview + + + + +```swift +client.application("").theme.getThemeForPreview(themeId: themeId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| themeId | String | yes | ID allotted to the theme. | + + + +A theme can be previewed before applying it. Use this API to retrieve the theme preview by using its ID. + +*Returned Response:* + + + + +[ThemesSchema](#ThemesSchema) + +Success. Refer `ThemesSchema` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "information": { + "images": { + "desktop": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ], + "android": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "ios": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "thumbnail": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ] + }, + "features": [ + "Responsive" + ], + "name": "Akash-Artisan" + }, + "src": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/sources/J-1s-N-pl-archive.zip" + }, + "assets": { + "css": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/Ia4m885Mw2-themeBundle.css" + }, + "umd_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/nEPGyc15g-themeBundle.umd.min.js" + }, + "common_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/5f7tOB5rpq-themeBundle.common.js" + } + }, + "config": { + "preset": { + "sections": [ + { + "page_sections": [ + { + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219133573.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/men-collection-vcahuo2q" + } + } + }, + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219184350.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/shirts-5e9654ad" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "image-carousel", + "props": { + "slide_height": { + "type": "select", + "value": "adapt" + }, + "autoplay": { + "type": "checkbox", + "value": false + }, + "slide_interval": { + "type": "range", + "value": 2 + } + } + }, + { + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "accessories-7ee89654" + }, + "title": { + "type": "text", + "value": "Turtle sports club" + }, + "subtitle": { + "type": "text", + "value": "Casual Collections" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/casual_nfadbl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Formal Collection" + }, + "subtitle": { + "type": "text", + "value": "Turtle Tailor Mark" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/tailors_nsrrfl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Bottomwear" + }, + "subtitle": { + "type": "text", + "value": "Chinos | Trousers | Pants" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/bottomwear_tdkhn2.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "t-shirt-7ee3cbcd" + }, + "title": { + "type": "text", + "value": "Shirts" + }, + "subtitle": { + "type": "text", + "value": "Casual" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/t-shirt_re9srk.jpg" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionGrid", + "props": { + "title": { + "type": "text", + "value": "Collections" + }, + "subtitle": { + "type": "text", + "value": "Buy from our" + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "department": { + "type": "department", + "value": "others" + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "layout": { + "type": "select", + "value": "grid" + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + } + ] + }, + "global_schema": { + "props": [ + { + "type": "color", + "id": "header_bg_color", + "default": "#ffffff", + "category": "Header", + "label": "Header background Color" + }, + { + "type": "color", + "id": "footer_bg_color", + "default": "#1b1b1b", + "category": "Footer", + "label": "Footer background Color" + }, + { + "type": "text", + "id": "footer_text", + "default": "", + "category": "Footer", + "label": "Footer Text" + }, + { + "type": "checkbox", + "id": "disable_cart", + "default": false, + "category": "Cart", + "label": "Disable Cart" + } + ] + }, + "current": "default", + "page_schema": [ + { + "props": [], + "_id": "5fe182f763d26d042fd205c4", + "page": "add-product-review" + }, + { + "props": [], + "_id": "5fe182f763d26dadc8d205c6", + "page": "blog" + }, + { + "props": [], + "_id": "5fe182f763d26d0a36d205c7", + "page": "brands" + }, + { + "props": [ + { + "type": "checkbox", + "id": "gst", + "label": "GST", + "default": true, + "info": "Show GST on cart" + }, + { + "type": "checkbox", + "id": "staff_selection", + "label": "Staff Selection", + "default": true, + "info": "Show Staff selection on Cart" + }, + { + "type": "checkbox", + "id": "enable_customer", + "label": "Customer", + "default": true, + "info": "Placing on behalf of customer" + }, + { + "type": "checkbox", + "id": "enable_guest", + "label": "Enable Guest Checkout", + "default": true, + "info": "Enable Continue as Guest" + } + ], + "_id": "5fe182f763d26d81c5d205c8", + "page": "cart-landing" + }, + { + "props": [], + "_id": "5fe182f763d26d7e15d205c9", + "page": "cart-review" + }, + { + "props": [], + "_id": "5fe182f763d26d270ed205ca", + "page": "categories" + }, + { + "props": [], + "_id": "5fe182f763d26d9b4fd205cb", + "page": "collection-listing" + }, + { + "props": [], + "_id": "5fe182f763d26da6ecd205cc", + "page": "collections" + }, + { + "props": [], + "_id": "5fe182f763d26d7156d205cd", + "page": "compare-products" + }, + { + "props": [], + "_id": "5fe182f763d26d62bad205ce", + "page": "home" + }, + { + "props": [], + "_id": "5fe182f763d26d5afcd205cf", + "page": "order-review" + }, + { + "props": [], + "_id": "5fe182f763d26def8dd205d0", + "page": "order-tracking-details" + }, + { + "props": [], + "_id": "5fe182f763d26d381fd205d1", + "page": "order-tracking" + }, + { + "props": [ + { + "type": "text", + "id": "shipping_link", + "label": "Shipping Link", + "default": "https://fynd.freshdesk.com/support/solutions/folders/33000111600", + "info": "Link of shipping page" + }, + { + "type": "checkbox", + "id": "original_image", + "label": "Use original Image", + "default": false, + "info": "Use original product image." + }, + { + "type": "checkbox", + "id": "wishlist", + "label": "Wishlist", + "default": true, + "info": "Show Wishlist for product" + }, + { + "type": "checkbox", + "id": "reviews", + "label": "Review", + "default": true, + "info": "Show Reviews of product" + }, + { + "type": "checkbox", + "id": "add_to_compare", + "label": "Add to Compare", + "default": true, + "info": "Allow comparison of products" + }, + { + "type": "checkbox", + "id": "size_guide", + "label": "Size Guide", + "default": true, + "info": "Show Size Guide" + }, + { + "type": "checkbox", + "id": "product_request", + "label": "Product Request", + "default": true, + "info": "Show Product Request" + }, + { + "type": "checkbox", + "id": "share", + "label": "Share", + "default": true, + "info": "Enable Sharing product" + }, + { + "type": "checkbox", + "id": "sold_by", + "label": "Show Sold By", + "default": true, + "info": "Show name of the store" + }, + { + "type": "checkbox", + "id": "store_selection", + "label": "Seller Store Selection", + "default": true, + "info": "Allow to explicitly select stores" + }, + { + "type": "checkbox", + "id": "compare_products", + "label": "Compare Products", + "default": true, + "info": "Show Most Compared Products" + }, + { + "type": "checkbox", + "id": "variants", + "label": "Product Variants", + "default": true, + "info": "Show Product Variants" + }, + { + "type": "checkbox", + "id": "ratings", + "label": "Product Rating", + "default": true, + "info": "Show Product Ratings" + }, + { + "type": "checkbox", + "id": "similar_products", + "label": "Similar Products", + "default": true, + "info": "Show Similar Products" + }, + { + "type": "checkbox", + "id": "bulk_prices", + "label": "Bulk Prices", + "default": true, + "info": "Show Bulk Prices" + }, + { + "type": "checkbox", + "id": "showDeliveryInfo", + "label": "Delivery Info", + "default": true, + "info": "Show Delivery Date" + } + ], + "_id": "5fe182f763d26d29bbd205d2", + "page": "product-description" + }, + { + "props": [], + "_id": "5fe182f763d26da5f0d205d3", + "page": "product-listing" + }, + { + "props": [], + "_id": "5fe182f763d26d3d18d205d4", + "page": "product-reviews" + }, + { + "props": [], + "_id": "5fe182f763d26d4e2dd205d5", + "page": "wishlist" + }, + { + "props": [ + { + "default": true, + "id": "header", + "label": "Header", + "type": "checkbox" + }, + { + "default": true, + "id": "footer", + "label": "Footer", + "type": "checkbox" + } + ], + "_id": "5fe7166cbaae343115de8555", + "page": "tesr" + } + ], + "list": [ + { + "name": "default", + "global_config": { + "static": { + "props": { + "colors": { + "primary_color": "#7043f7", + "secondary_color": "#02d1cb", + "accent_color": "#FFFFFF", + "link_color": "#7043f7", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "disable_cart": false + } + } + }, + "page": [ + { + "settings": { + "props": { + "show_info_message": true + } + }, + "page": "cart-landing" + } + ], + "_id": "5fc4bb9078e957737e7d79a3" + } + ] + }, + "colors": { + "primary_color": "#41434C", + "secondary_color": "#41434C", + "accent_color": "#FFFFFF", + "link_color": "#33B1C0", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + }, + "font": { + "variants": { + "light": { + "name": "300", + "file": "" + }, + "regular": { + "name": "regular", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVRS0Fbvbc14VxRD7N01bV7kg.ttf" + }, + "medium": { + "name": "500", + "file": "" + }, + "semi_bold": { + "name": "600", + "file": "" + }, + "bold": { + "name": "700", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVSS0Fbvbc14Vxps5xQ3Z5nm29Gww.ttf" + } + }, + "family": "Judson" + }, + "applied": true, + "published": false, + "archived": false, + "customized": true, + "version": "1.1.19", + "tags": [], + "_id": "5fe17f7063d26dc54fd202b4", + "pages": { + "home": { + "path": "", + "type": "system", + "sections": [], + "value": "home", + "text": "Home" + }, + "brands": { + "path": "brands", + "type": "system", + "sections": [], + "value": "brands", + "text": "Brands" + }, + "cart-landing": { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + "categories": { + "path": "categories", + "type": "system", + "sections": [], + "value": "categories", + "text": "Categories" + }, + "collections": { + "path": "collections", + "type": "system", + "sections": [], + "value": "collections", + "text": "Collections" + }, + "compare-products": { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + "product-description": { + "path": "product", + "type": "system", + "sections": [], + "value": "product-description", + "text": "Product Description" + }, + "product-listing": { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + "collection-listing": { + "path": "collection", + "type": "system", + "sections": [], + "value": "collection-listing", + "text": "COllection Listing" + }, + "wishlist": { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + } + }, + "available_sections": [ + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Brands", + "label": "Brands Heading" + }, + { + "type": "radio", + "id": "brand_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "department", + "text": "Department" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "department", + "id": "department", + "label": "Department", + "info": "Select a department of brands", + "note": "Department only applies if 'department' type is selected" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": [ + { + "type": "brand", + "id": "brand", + "label": "Select Brand" + } + ] + } + ], + "_id": "5feacca5bec232d59b89283a", + "name": "brandTemplate", + "label": "Brands List Page" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Categories", + "label": "Categories Heading" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All", + "info": "Check to show View All Button" + } + ], + "blocks": [], + "_id": "5feacca5bec232404189283b", + "name": "categoriesTemplate", + "label": "Categories Page" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Subtitle" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Background image", + "info": "Background Image" + }, + { + "type": "text", + "id": "title", + "default": "", + "label": "Overlay title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Overlay subtitle" + } + ] + } + ], + "_id": "5feacca5bec2321fd589283c", + "name": "collectionGrid", + "label": "Collection Grid" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collection List", + "label": "Collection Heading", + "info": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + } + ] + } + ], + "_id": "5feacca5bec2323bf689283d", + "name": "collectionList", + "label": "Collection List" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "radio", + "id": "collection_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "collection-item", + "name": "Collection Item", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select collection" + } + ] + } + ], + "_id": "5feacca5bec23263b489283e", + "name": "collectionTemplate", + "label": "Collection List Page" + }, + { + "props": [ + { + "type": "code", + "id": "code", + "label": "Custom HTML", + "info": "Add Your custom HTML Code below. You can also use the full screen icon to open a code editor and add your code" + } + ], + "blocks": [], + "_id": "5feacca5bec232409489283f", + "name": "customHtml", + "label": "Custom HTML" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Products", + "label": "Section Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "product", + "name": "Product", + "props": [ + { + "type": "product", + "id": "product", + "label": "Select a Product", + "info": "Product Item to be displayed" + } + ] + } + ], + "_id": "5feacca5bec2326213892840", + "name": "featuredProducts", + "label": "Featured Products", + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "props": [ + { + "type": "range", + "id": "item_count", + "min": 1, + "max": 4, + "step": 1, + "unit": "", + "label": "No of items", + "default": 4, + "info": "Maximum items allowed per row" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image", + "default": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1603773049684.svg" + }, + { + "type": "text", + "id": "caption", + "label": "Image Caption", + "default": "" + }, + { + "type": "url", + "id": "link", + "label": "Link", + "default": "", + "info": "Link to redirect" + } + ] + } + ], + "_id": "5feacca5bec2321047892841", + "name": "gallery", + "label": "Gallery", + "preset": { + "props": { + "item_count": 4 + }, + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec232b085892842", + "name": "heroBanner", + "label": "Hero Banner" + }, + { + "props": [ + { + "id": "image", + "type": "image_picker", + "label": "Hero Image", + "default": "" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "overlayLayout", + "type": "select", + "options": [ + { + "value": "left", + "text": "Align Left" + }, + { + "value": "center", + "text": "Align Center" + }, + { + "value": "right", + "text": "Align Right" + } + ], + "default": "left", + "label": "Overlay Layout", + "info": "Alignment of overlay content" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Overlay image", + "info": "Overlay Image" + }, + { + "type": "text", + "id": "text", + "default": "", + "label": "Overlay Text" + }, + { + "type": "color", + "id": "text_color", + "default": "#000", + "label": "Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "Shop Now", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec2321e74892843", + "name": "imageBanner", + "label": "Hero Image" + }, + { + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "coverUrl", + "type": "image_picker", + "label": "Video Cover Image URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + }, + { + "type": "select", + "id": "size", + "options": [ + { + "value": "adapt", + "text": "Adapt" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Video Height", + "info": "Height of Video" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "color", + "id": "heading_color", + "default": "#000", + "label": "Headin Text Color" + }, + { + "type": "text", + "id": "subHeading", + "default": "", + "label": "Sub-heading" + }, + { + "type": "color", + "id": "subheading_color", + "default": "#000", + "label": "Subheading Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "ShopNow", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec232bfc8892844", + "name": "videoBanner", + "label": "Hero Video" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first image" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides after every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image" + }, + { + "type": "url", + "id": "slide_link", + "label": "Slide Link" + } + ] + } + ], + "_id": "5feacca5bec232a916892845", + "name": "image-carousel", + "label": "Image Carousel", + "preset": { + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 2, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "collection", + "id": "collection", + "label": "Collection", + "info": "Select a collection to display its products" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec23258ec892846", + "name": "productList", + "label": "Product List", + "preset": { + "props": { + "heading": "Featured Products", + "item_count": 4, + "collection": "" + } + } + }, + { + "props": [ + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2 + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "testimonial", + "name": "Testimonial", + "props": [ + { + "type": "textarea", + "id": "testimonialText", + "label": "Text for Testimonial", + "default": "", + "info": "Text for testimonial", + "placeholder": "Text" + }, + { + "type": "text", + "id": "author", + "label": "Customers name" + } + ] + } + ], + "_id": "5feacca5bec23299e8892847", + "name": "testimonials", + "label": "Testimonial" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first video" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "video_item", + "name": "Video Slide", + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + } + ] + } + ], + "_id": "5feacca5bec232d89b892848", + "name": "videoCarousel", + "label": "Video Carousel" + } + ], + "sections": [ + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "Brands" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "department": { + "type": "department", + "value": null + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": null + } + } + } + ], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "collection-listing" + }, + { + "page_sections": [ + { + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Apple", + "id": "apple" + } + } + } + }, + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Gionee", + "id": "gionee" + } + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "heading": { + "type": "text", + "value": "Brandss" + }, + "brand_type": { + "type": "radio", + "value": "handpicked" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 4, + "type": "range" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + }, + { + "page_sections": [], + "page_key": "tesr" + } + ], + "application": "5e737afb97e0f586bf9d04db", + "available_pages": [ + { + "path": "product", + "type": "system", + "sections": [], + "text": "Product Description", + "value": "product-description" + }, + { + "path": "collection", + "type": "system", + "sections": [], + "text": "Collection Listing", + "value": "collection-listing" + }, + { + "path": "", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2327927892853", + "attributes": { + "page": "home" + } + } + ], + "value": "home", + "text": "Home" + }, + { + "path": "brands", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2326422892854", + "attributes": { + "page": "brands" + } + } + ], + "value": "brands", + "text": "Brands" + }, + { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + { + "path": "categories", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec232424c892855", + "attributes": { + "page": "categories" + } + } + ], + "value": "categories", + "text": "Categories" + }, + { + "path": "collections", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec23281de892856", + "attributes": { + "page": "collections" + } + } + ], + "value": "collections", + "text": "Collections" + }, + { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + }, + { + "path": "sections/test", + "type": "sections", + "sections": [], + "text": "test", + "value": "test" + } + ], + "styles": {}, + "constants": {}, + "settings": {}, + "created_at": "2020-12-22T05:09:04.720Z", + "updated_at": "2021-01-24T11:22:41.376Z" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### publishTheme +Publish a theme + + + + +```swift +client.application("").theme.publishTheme(themeId: themeId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| themeId | String | yes | ID allotted to the theme. | + + + +Use this API to publish a theme that is either newly created or edited. + +*Returned Response:* + + + + +[ThemesSchema](#ThemesSchema) + +Success. Refer `ThemesSchema` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "information": { + "images": { + "desktop": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ], + "android": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "ios": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "thumbnail": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ] + }, + "features": [ + "Responsive" + ], + "name": "Akash-Artisan" + }, + "src": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/sources/J-1s-N-pl-archive.zip" + }, + "assets": { + "css": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/Ia4m885Mw2-themeBundle.css" + }, + "umd_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/nEPGyc15g-themeBundle.umd.min.js" + }, + "common_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/5f7tOB5rpq-themeBundle.common.js" + } + }, + "config": { + "preset": { + "sections": [ + { + "page_sections": [ + { + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219133573.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/men-collection-vcahuo2q" + } + } + }, + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219184350.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/shirts-5e9654ad" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "image-carousel", + "props": { + "slide_height": { + "type": "select", + "value": "adapt" + }, + "autoplay": { + "type": "checkbox", + "value": false + }, + "slide_interval": { + "type": "range", + "value": 2 + } + } + }, + { + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "accessories-7ee89654" + }, + "title": { + "type": "text", + "value": "Turtle sports club" + }, + "subtitle": { + "type": "text", + "value": "Casual Collections" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/casual_nfadbl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Formal Collection" + }, + "subtitle": { + "type": "text", + "value": "Turtle Tailor Mark" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/tailors_nsrrfl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Bottomwear" + }, + "subtitle": { + "type": "text", + "value": "Chinos | Trousers | Pants" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/bottomwear_tdkhn2.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "t-shirt-7ee3cbcd" + }, + "title": { + "type": "text", + "value": "Shirts" + }, + "subtitle": { + "type": "text", + "value": "Casual" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/t-shirt_re9srk.jpg" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionGrid", + "props": { + "title": { + "type": "text", + "value": "Collections" + }, + "subtitle": { + "type": "text", + "value": "Buy from our" + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "department": { + "type": "department", + "value": "others" + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "layout": { + "type": "select", + "value": "grid" + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + } + ] + }, + "global_schema": { + "props": [ + { + "type": "color", + "id": "header_bg_color", + "default": "#ffffff", + "category": "Header", + "label": "Header background Color" + }, + { + "type": "color", + "id": "footer_bg_color", + "default": "#1b1b1b", + "category": "Footer", + "label": "Footer background Color" + }, + { + "type": "text", + "id": "footer_text", + "default": "", + "category": "Footer", + "label": "Footer Text" + }, + { + "type": "checkbox", + "id": "disable_cart", + "default": false, + "category": "Cart", + "label": "Disable Cart" + } + ] + }, + "current": "default", + "page_schema": [ + { + "props": [], + "_id": "5fe182f763d26d042fd205c4", + "page": "add-product-review" + }, + { + "props": [], + "_id": "5fe182f763d26dadc8d205c6", + "page": "blog" + }, + { + "props": [], + "_id": "5fe182f763d26d0a36d205c7", + "page": "brands" + }, + { + "props": [ + { + "type": "checkbox", + "id": "gst", + "label": "GST", + "default": true, + "info": "Show GST on cart" + }, + { + "type": "checkbox", + "id": "staff_selection", + "label": "Staff Selection", + "default": true, + "info": "Show Staff selection on Cart" + }, + { + "type": "checkbox", + "id": "enable_customer", + "label": "Customer", + "default": true, + "info": "Placing on behalf of customer" + }, + { + "type": "checkbox", + "id": "enable_guest", + "label": "Enable Guest Checkout", + "default": true, + "info": "Enable Continue as Guest" + } + ], + "_id": "5fe182f763d26d81c5d205c8", + "page": "cart-landing" + }, + { + "props": [], + "_id": "5fe182f763d26d7e15d205c9", + "page": "cart-review" + }, + { + "props": [], + "_id": "5fe182f763d26d270ed205ca", + "page": "categories" + }, + { + "props": [], + "_id": "5fe182f763d26d9b4fd205cb", + "page": "collection-listing" + }, + { + "props": [], + "_id": "5fe182f763d26da6ecd205cc", + "page": "collections" + }, + { + "props": [], + "_id": "5fe182f763d26d7156d205cd", + "page": "compare-products" + }, + { + "props": [], + "_id": "5fe182f763d26d62bad205ce", + "page": "home" + }, + { + "props": [], + "_id": "5fe182f763d26d5afcd205cf", + "page": "order-review" + }, + { + "props": [], + "_id": "5fe182f763d26def8dd205d0", + "page": "order-tracking-details" + }, + { + "props": [], + "_id": "5fe182f763d26d381fd205d1", + "page": "order-tracking" + }, + { + "props": [ + { + "type": "text", + "id": "shipping_link", + "label": "Shipping Link", + "default": "https://fynd.freshdesk.com/support/solutions/folders/33000111600", + "info": "Link of shipping page" + }, + { + "type": "checkbox", + "id": "original_image", + "label": "Use original Image", + "default": false, + "info": "Use original product image." + }, + { + "type": "checkbox", + "id": "wishlist", + "label": "Wishlist", + "default": true, + "info": "Show Wishlist for product" + }, + { + "type": "checkbox", + "id": "reviews", + "label": "Review", + "default": true, + "info": "Show Reviews of product" + }, + { + "type": "checkbox", + "id": "add_to_compare", + "label": "Add to Compare", + "default": true, + "info": "Allow comparison of products" + }, + { + "type": "checkbox", + "id": "size_guide", + "label": "Size Guide", + "default": true, + "info": "Show Size Guide" + }, + { + "type": "checkbox", + "id": "product_request", + "label": "Product Request", + "default": true, + "info": "Show Product Request" + }, + { + "type": "checkbox", + "id": "share", + "label": "Share", + "default": true, + "info": "Enable Sharing product" + }, + { + "type": "checkbox", + "id": "sold_by", + "label": "Show Sold By", + "default": true, + "info": "Show name of the store" + }, + { + "type": "checkbox", + "id": "store_selection", + "label": "Seller Store Selection", + "default": true, + "info": "Allow to explicitly select stores" + }, + { + "type": "checkbox", + "id": "compare_products", + "label": "Compare Products", + "default": true, + "info": "Show Most Compared Products" + }, + { + "type": "checkbox", + "id": "variants", + "label": "Product Variants", + "default": true, + "info": "Show Product Variants" + }, + { + "type": "checkbox", + "id": "ratings", + "label": "Product Rating", + "default": true, + "info": "Show Product Ratings" + }, + { + "type": "checkbox", + "id": "similar_products", + "label": "Similar Products", + "default": true, + "info": "Show Similar Products" + }, + { + "type": "checkbox", + "id": "bulk_prices", + "label": "Bulk Prices", + "default": true, + "info": "Show Bulk Prices" + }, + { + "type": "checkbox", + "id": "showDeliveryInfo", + "label": "Delivery Info", + "default": true, + "info": "Show Delivery Date" + } + ], + "_id": "5fe182f763d26d29bbd205d2", + "page": "product-description" + }, + { + "props": [], + "_id": "5fe182f763d26da5f0d205d3", + "page": "product-listing" + }, + { + "props": [], + "_id": "5fe182f763d26d3d18d205d4", + "page": "product-reviews" + }, + { + "props": [], + "_id": "5fe182f763d26d4e2dd205d5", + "page": "wishlist" + }, + { + "props": [ + { + "default": true, + "id": "header", + "label": "Header", + "type": "checkbox" + }, + { + "default": true, + "id": "footer", + "label": "Footer", + "type": "checkbox" + } + ], + "_id": "5fe7166cbaae343115de8555", + "page": "tesr" + } + ], + "list": [ + { + "name": "default", + "global_config": { + "static": { + "props": { + "colors": { + "primary_color": "#7043f7", + "secondary_color": "#02d1cb", + "accent_color": "#FFFFFF", + "link_color": "#7043f7", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "disable_cart": false + } + } + }, + "page": [ + { + "settings": { + "props": { + "show_info_message": true + } + }, + "page": "cart-landing" + } + ], + "_id": "5fc4bb9078e957737e7d79a3" + } + ] + }, + "colors": { + "primary_color": "#41434C", + "secondary_color": "#41434C", + "accent_color": "#FFFFFF", + "link_color": "#33B1C0", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + }, + "font": { + "variants": { + "light": { + "name": "300", + "file": "" + }, + "regular": { + "name": "regular", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVRS0Fbvbc14VxRD7N01bV7kg.ttf" + }, + "medium": { + "name": "500", + "file": "" + }, + "semi_bold": { + "name": "600", + "file": "" + }, + "bold": { + "name": "700", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVSS0Fbvbc14Vxps5xQ3Z5nm29Gww.ttf" + } + }, + "family": "Judson" + }, + "applied": true, + "published": false, + "archived": false, + "customized": true, + "version": "1.1.19", + "tags": [], + "_id": "5fe17f7063d26dc54fd202b4", + "pages": { + "home": { + "path": "", + "type": "system", + "sections": [], + "value": "home", + "text": "Home" + }, + "brands": { + "path": "brands", + "type": "system", + "sections": [], + "value": "brands", + "text": "Brands" + }, + "cart-landing": { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + "categories": { + "path": "categories", + "type": "system", + "sections": [], + "value": "categories", + "text": "Categories" + }, + "collections": { + "path": "collections", + "type": "system", + "sections": [], + "value": "collections", + "text": "Collections" + }, + "compare-products": { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + "product-description": { + "path": "product", + "type": "system", + "sections": [], + "value": "product-description", + "text": "Product Description" + }, + "product-listing": { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + "collection-listing": { + "path": "collection", + "type": "system", + "sections": [], + "value": "collection-listing", + "text": "COllection Listing" + }, + "wishlist": { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + } + }, + "available_sections": [ + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Brands", + "label": "Brands Heading" + }, + { + "type": "radio", + "id": "brand_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "department", + "text": "Department" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "department", + "id": "department", + "label": "Department", + "info": "Select a department of brands", + "note": "Department only applies if 'department' type is selected" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": [ + { + "type": "brand", + "id": "brand", + "label": "Select Brand" + } + ] + } + ], + "_id": "5feacca5bec232d59b89283a", + "name": "brandTemplate", + "label": "Brands List Page" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Categories", + "label": "Categories Heading" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All", + "info": "Check to show View All Button" + } + ], + "blocks": [], + "_id": "5feacca5bec232404189283b", + "name": "categoriesTemplate", + "label": "Categories Page" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Subtitle" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Background image", + "info": "Background Image" + }, + { + "type": "text", + "id": "title", + "default": "", + "label": "Overlay title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Overlay subtitle" + } + ] + } + ], + "_id": "5feacca5bec2321fd589283c", + "name": "collectionGrid", + "label": "Collection Grid" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collection List", + "label": "Collection Heading", + "info": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + } + ] + } + ], + "_id": "5feacca5bec2323bf689283d", + "name": "collectionList", + "label": "Collection List" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "radio", + "id": "collection_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "collection-item", + "name": "Collection Item", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select collection" + } + ] + } + ], + "_id": "5feacca5bec23263b489283e", + "name": "collectionTemplate", + "label": "Collection List Page" + }, + { + "props": [ + { + "type": "code", + "id": "code", + "label": "Custom HTML", + "info": "Add Your custom HTML Code below. You can also use the full screen icon to open a code editor and add your code" + } + ], + "blocks": [], + "_id": "5feacca5bec232409489283f", + "name": "customHtml", + "label": "Custom HTML" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Products", + "label": "Section Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "product", + "name": "Product", + "props": [ + { + "type": "product", + "id": "product", + "label": "Select a Product", + "info": "Product Item to be displayed" + } + ] + } + ], + "_id": "5feacca5bec2326213892840", + "name": "featuredProducts", + "label": "Featured Products", + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "props": [ + { + "type": "range", + "id": "item_count", + "min": 1, + "max": 4, + "step": 1, + "unit": "", + "label": "No of items", + "default": 4, + "info": "Maximum items allowed per row" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image", + "default": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1603773049684.svg" + }, + { + "type": "text", + "id": "caption", + "label": "Image Caption", + "default": "" + }, + { + "type": "url", + "id": "link", + "label": "Link", + "default": "", + "info": "Link to redirect" + } + ] + } + ], + "_id": "5feacca5bec2321047892841", + "name": "gallery", + "label": "Gallery", + "preset": { + "props": { + "item_count": 4 + }, + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec232b085892842", + "name": "heroBanner", + "label": "Hero Banner" + }, + { + "props": [ + { + "id": "image", + "type": "image_picker", + "label": "Hero Image", + "default": "" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "overlayLayout", + "type": "select", + "options": [ + { + "value": "left", + "text": "Align Left" + }, + { + "value": "center", + "text": "Align Center" + }, + { + "value": "right", + "text": "Align Right" + } + ], + "default": "left", + "label": "Overlay Layout", + "info": "Alignment of overlay content" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Overlay image", + "info": "Overlay Image" + }, + { + "type": "text", + "id": "text", + "default": "", + "label": "Overlay Text" + }, + { + "type": "color", + "id": "text_color", + "default": "#000", + "label": "Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "Shop Now", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec2321e74892843", + "name": "imageBanner", + "label": "Hero Image" + }, + { + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "coverUrl", + "type": "image_picker", + "label": "Video Cover Image URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + }, + { + "type": "select", + "id": "size", + "options": [ + { + "value": "adapt", + "text": "Adapt" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Video Height", + "info": "Height of Video" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "color", + "id": "heading_color", + "default": "#000", + "label": "Headin Text Color" + }, + { + "type": "text", + "id": "subHeading", + "default": "", + "label": "Sub-heading" + }, + { + "type": "color", + "id": "subheading_color", + "default": "#000", + "label": "Subheading Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "ShopNow", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec232bfc8892844", + "name": "videoBanner", + "label": "Hero Video" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first image" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides after every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image" + }, + { + "type": "url", + "id": "slide_link", + "label": "Slide Link" + } + ] + } + ], + "_id": "5feacca5bec232a916892845", + "name": "image-carousel", + "label": "Image Carousel", + "preset": { + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 2, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "collection", + "id": "collection", + "label": "Collection", + "info": "Select a collection to display its products" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec23258ec892846", + "name": "productList", + "label": "Product List", + "preset": { + "props": { + "heading": "Featured Products", + "item_count": 4, + "collection": "" + } + } + }, + { + "props": [ + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2 + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "testimonial", + "name": "Testimonial", + "props": [ + { + "type": "textarea", + "id": "testimonialText", + "label": "Text for Testimonial", + "default": "", + "info": "Text for testimonial", + "placeholder": "Text" + }, + { + "type": "text", + "id": "author", + "label": "Customers name" + } + ] + } + ], + "_id": "5feacca5bec23299e8892847", + "name": "testimonials", + "label": "Testimonial" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first video" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "video_item", + "name": "Video Slide", + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + } + ] + } + ], + "_id": "5feacca5bec232d89b892848", + "name": "videoCarousel", + "label": "Video Carousel" + } + ], + "sections": [ + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "Brands" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "department": { + "type": "department", + "value": null + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": null + } + } + } + ], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "collection-listing" + }, + { + "page_sections": [ + { + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Apple", + "id": "apple" + } + } + } + }, + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Gionee", + "id": "gionee" + } + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "heading": { + "type": "text", + "value": "Brandss" + }, + "brand_type": { + "type": "radio", + "value": "handpicked" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 4, + "type": "range" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + }, + { + "page_sections": [], + "page_key": "tesr" + } + ], + "application": "5e737afb97e0f586bf9d04db", + "available_pages": [ + { + "path": "product", + "type": "system", + "sections": [], + "text": "Product Description", + "value": "product-description" + }, + { + "path": "collection", + "type": "system", + "sections": [], + "text": "Collection Listing", + "value": "collection-listing" + }, + { + "path": "", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2327927892853", + "attributes": { + "page": "home" + } + } + ], + "value": "home", + "text": "Home" + }, + { + "path": "brands", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2326422892854", + "attributes": { + "page": "brands" + } + } + ], + "value": "brands", + "text": "Brands" + }, + { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + { + "path": "categories", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec232424c892855", + "attributes": { + "page": "categories" + } + } + ], + "value": "categories", + "text": "Categories" + }, + { + "path": "collections", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec23281de892856", + "attributes": { + "page": "collections" + } + } + ], + "value": "collections", + "text": "Collections" + }, + { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + }, + { + "path": "sections/test", + "type": "sections", + "sections": [], + "text": "test", + "value": "test" + } + ], + "styles": {}, + "constants": {}, + "settings": {}, + "created_at": "2020-12-22T05:09:04.720Z", + "updated_at": "2021-01-24T11:22:41.376Z" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### unpublishTheme +Unpublish a theme + + + + +```swift +client.application("").theme.unpublishTheme(themeId: themeId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| themeId | String | yes | ID allotted to the theme. | + + + +Use this API to remove an existing theme from the list of available themes. + +*Returned Response:* + + + + +[ThemesSchema](#ThemesSchema) + +Success. Refer `ThemesSchema` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "information": { + "images": { + "desktop": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ], + "android": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "ios": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "thumbnail": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ] + }, + "features": [ + "Responsive" + ], + "name": "Akash-Artisan" + }, + "src": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/sources/J-1s-N-pl-archive.zip" + }, + "assets": { + "css": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/Ia4m885Mw2-themeBundle.css" + }, + "umd_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/nEPGyc15g-themeBundle.umd.min.js" + }, + "common_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/5f7tOB5rpq-themeBundle.common.js" + } + }, + "config": { + "preset": { + "sections": [ + { + "page_sections": [ + { + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219133573.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/men-collection-vcahuo2q" + } + } + }, + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219184350.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/shirts-5e9654ad" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "image-carousel", + "props": { + "slide_height": { + "type": "select", + "value": "adapt" + }, + "autoplay": { + "type": "checkbox", + "value": false + }, + "slide_interval": { + "type": "range", + "value": 2 + } + } + }, + { + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "accessories-7ee89654" + }, + "title": { + "type": "text", + "value": "Turtle sports club" + }, + "subtitle": { + "type": "text", + "value": "Casual Collections" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/casual_nfadbl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Formal Collection" + }, + "subtitle": { + "type": "text", + "value": "Turtle Tailor Mark" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/tailors_nsrrfl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Bottomwear" + }, + "subtitle": { + "type": "text", + "value": "Chinos | Trousers | Pants" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/bottomwear_tdkhn2.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "t-shirt-7ee3cbcd" + }, + "title": { + "type": "text", + "value": "Shirts" + }, + "subtitle": { + "type": "text", + "value": "Casual" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/t-shirt_re9srk.jpg" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionGrid", + "props": { + "title": { + "type": "text", + "value": "Collections" + }, + "subtitle": { + "type": "text", + "value": "Buy from our" + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "department": { + "type": "department", + "value": "others" + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "layout": { + "type": "select", + "value": "grid" + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + } + ] + }, + "global_schema": { + "props": [ + { + "type": "color", + "id": "header_bg_color", + "default": "#ffffff", + "category": "Header", + "label": "Header background Color" + }, + { + "type": "color", + "id": "footer_bg_color", + "default": "#1b1b1b", + "category": "Footer", + "label": "Footer background Color" + }, + { + "type": "text", + "id": "footer_text", + "default": "", + "category": "Footer", + "label": "Footer Text" + }, + { + "type": "checkbox", + "id": "disable_cart", + "default": false, + "category": "Cart", + "label": "Disable Cart" + } + ] + }, + "current": "default", + "page_schema": [ + { + "props": [], + "_id": "5fe182f763d26d042fd205c4", + "page": "add-product-review" + }, + { + "props": [], + "_id": "5fe182f763d26dadc8d205c6", + "page": "blog" + }, + { + "props": [], + "_id": "5fe182f763d26d0a36d205c7", + "page": "brands" + }, + { + "props": [ + { + "type": "checkbox", + "id": "gst", + "label": "GST", + "default": true, + "info": "Show GST on cart" + }, + { + "type": "checkbox", + "id": "staff_selection", + "label": "Staff Selection", + "default": true, + "info": "Show Staff selection on Cart" + }, + { + "type": "checkbox", + "id": "enable_customer", + "label": "Customer", + "default": true, + "info": "Placing on behalf of customer" + }, + { + "type": "checkbox", + "id": "enable_guest", + "label": "Enable Guest Checkout", + "default": true, + "info": "Enable Continue as Guest" + } + ], + "_id": "5fe182f763d26d81c5d205c8", + "page": "cart-landing" + }, + { + "props": [], + "_id": "5fe182f763d26d7e15d205c9", + "page": "cart-review" + }, + { + "props": [], + "_id": "5fe182f763d26d270ed205ca", + "page": "categories" + }, + { + "props": [], + "_id": "5fe182f763d26d9b4fd205cb", + "page": "collection-listing" + }, + { + "props": [], + "_id": "5fe182f763d26da6ecd205cc", + "page": "collections" + }, + { + "props": [], + "_id": "5fe182f763d26d7156d205cd", + "page": "compare-products" + }, + { + "props": [], + "_id": "5fe182f763d26d62bad205ce", + "page": "home" + }, + { + "props": [], + "_id": "5fe182f763d26d5afcd205cf", + "page": "order-review" + }, + { + "props": [], + "_id": "5fe182f763d26def8dd205d0", + "page": "order-tracking-details" + }, + { + "props": [], + "_id": "5fe182f763d26d381fd205d1", + "page": "order-tracking" + }, + { + "props": [ + { + "type": "text", + "id": "shipping_link", + "label": "Shipping Link", + "default": "https://fynd.freshdesk.com/support/solutions/folders/33000111600", + "info": "Link of shipping page" + }, + { + "type": "checkbox", + "id": "original_image", + "label": "Use original Image", + "default": false, + "info": "Use original product image." + }, + { + "type": "checkbox", + "id": "wishlist", + "label": "Wishlist", + "default": true, + "info": "Show Wishlist for product" + }, + { + "type": "checkbox", + "id": "reviews", + "label": "Review", + "default": true, + "info": "Show Reviews of product" + }, + { + "type": "checkbox", + "id": "add_to_compare", + "label": "Add to Compare", + "default": true, + "info": "Allow comparison of products" + }, + { + "type": "checkbox", + "id": "size_guide", + "label": "Size Guide", + "default": true, + "info": "Show Size Guide" + }, + { + "type": "checkbox", + "id": "product_request", + "label": "Product Request", + "default": true, + "info": "Show Product Request" + }, + { + "type": "checkbox", + "id": "share", + "label": "Share", + "default": true, + "info": "Enable Sharing product" + }, + { + "type": "checkbox", + "id": "sold_by", + "label": "Show Sold By", + "default": true, + "info": "Show name of the store" + }, + { + "type": "checkbox", + "id": "store_selection", + "label": "Seller Store Selection", + "default": true, + "info": "Allow to explicitly select stores" + }, + { + "type": "checkbox", + "id": "compare_products", + "label": "Compare Products", + "default": true, + "info": "Show Most Compared Products" + }, + { + "type": "checkbox", + "id": "variants", + "label": "Product Variants", + "default": true, + "info": "Show Product Variants" + }, + { + "type": "checkbox", + "id": "ratings", + "label": "Product Rating", + "default": true, + "info": "Show Product Ratings" + }, + { + "type": "checkbox", + "id": "similar_products", + "label": "Similar Products", + "default": true, + "info": "Show Similar Products" + }, + { + "type": "checkbox", + "id": "bulk_prices", + "label": "Bulk Prices", + "default": true, + "info": "Show Bulk Prices" + }, + { + "type": "checkbox", + "id": "showDeliveryInfo", + "label": "Delivery Info", + "default": true, + "info": "Show Delivery Date" + } + ], + "_id": "5fe182f763d26d29bbd205d2", + "page": "product-description" + }, + { + "props": [], + "_id": "5fe182f763d26da5f0d205d3", + "page": "product-listing" + }, + { + "props": [], + "_id": "5fe182f763d26d3d18d205d4", + "page": "product-reviews" + }, + { + "props": [], + "_id": "5fe182f763d26d4e2dd205d5", + "page": "wishlist" + }, + { + "props": [ + { + "default": true, + "id": "header", + "label": "Header", + "type": "checkbox" + }, + { + "default": true, + "id": "footer", + "label": "Footer", + "type": "checkbox" + } + ], + "_id": "5fe7166cbaae343115de8555", + "page": "tesr" + } + ], + "list": [ + { + "name": "default", + "global_config": { + "static": { + "props": { + "colors": { + "primary_color": "#7043f7", + "secondary_color": "#02d1cb", + "accent_color": "#FFFFFF", + "link_color": "#7043f7", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "disable_cart": false + } + } + }, + "page": [ + { + "settings": { + "props": { + "show_info_message": true + } + }, + "page": "cart-landing" + } + ], + "_id": "5fc4bb9078e957737e7d79a3" + } + ] + }, + "colors": { + "primary_color": "#41434C", + "secondary_color": "#41434C", + "accent_color": "#FFFFFF", + "link_color": "#33B1C0", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + }, + "font": { + "variants": { + "light": { + "name": "300", + "file": "" + }, + "regular": { + "name": "regular", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVRS0Fbvbc14VxRD7N01bV7kg.ttf" + }, + "medium": { + "name": "500", + "file": "" + }, + "semi_bold": { + "name": "600", + "file": "" + }, + "bold": { + "name": "700", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVSS0Fbvbc14Vxps5xQ3Z5nm29Gww.ttf" + } + }, + "family": "Judson" + }, + "applied": true, + "published": false, + "archived": false, + "customized": true, + "version": "1.1.19", + "tags": [], + "_id": "5fe17f7063d26dc54fd202b4", + "pages": { + "home": { + "path": "", + "type": "system", + "sections": [], + "value": "home", + "text": "Home" + }, + "brands": { + "path": "brands", + "type": "system", + "sections": [], + "value": "brands", + "text": "Brands" + }, + "cart-landing": { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + "categories": { + "path": "categories", + "type": "system", + "sections": [], + "value": "categories", + "text": "Categories" + }, + "collections": { + "path": "collections", + "type": "system", + "sections": [], + "value": "collections", + "text": "Collections" + }, + "compare-products": { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + "product-description": { + "path": "product", + "type": "system", + "sections": [], + "value": "product-description", + "text": "Product Description" + }, + "product-listing": { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + "collection-listing": { + "path": "collection", + "type": "system", + "sections": [], + "value": "collection-listing", + "text": "COllection Listing" + }, + "wishlist": { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + } + }, + "available_sections": [ + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Brands", + "label": "Brands Heading" + }, + { + "type": "radio", + "id": "brand_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "department", + "text": "Department" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "department", + "id": "department", + "label": "Department", + "info": "Select a department of brands", + "note": "Department only applies if 'department' type is selected" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": [ + { + "type": "brand", + "id": "brand", + "label": "Select Brand" + } + ] + } + ], + "_id": "5feacca5bec232d59b89283a", + "name": "brandTemplate", + "label": "Brands List Page" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Categories", + "label": "Categories Heading" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All", + "info": "Check to show View All Button" + } + ], + "blocks": [], + "_id": "5feacca5bec232404189283b", + "name": "categoriesTemplate", + "label": "Categories Page" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Subtitle" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Background image", + "info": "Background Image" + }, + { + "type": "text", + "id": "title", + "default": "", + "label": "Overlay title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Overlay subtitle" + } + ] + } + ], + "_id": "5feacca5bec2321fd589283c", + "name": "collectionGrid", + "label": "Collection Grid" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collection List", + "label": "Collection Heading", + "info": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + } + ] + } + ], + "_id": "5feacca5bec2323bf689283d", + "name": "collectionList", + "label": "Collection List" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "radio", + "id": "collection_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "collection-item", + "name": "Collection Item", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select collection" + } + ] + } + ], + "_id": "5feacca5bec23263b489283e", + "name": "collectionTemplate", + "label": "Collection List Page" + }, + { + "props": [ + { + "type": "code", + "id": "code", + "label": "Custom HTML", + "info": "Add Your custom HTML Code below. You can also use the full screen icon to open a code editor and add your code" + } + ], + "blocks": [], + "_id": "5feacca5bec232409489283f", + "name": "customHtml", + "label": "Custom HTML" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Products", + "label": "Section Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "product", + "name": "Product", + "props": [ + { + "type": "product", + "id": "product", + "label": "Select a Product", + "info": "Product Item to be displayed" + } + ] + } + ], + "_id": "5feacca5bec2326213892840", + "name": "featuredProducts", + "label": "Featured Products", + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "props": [ + { + "type": "range", + "id": "item_count", + "min": 1, + "max": 4, + "step": 1, + "unit": "", + "label": "No of items", + "default": 4, + "info": "Maximum items allowed per row" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image", + "default": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1603773049684.svg" + }, + { + "type": "text", + "id": "caption", + "label": "Image Caption", + "default": "" + }, + { + "type": "url", + "id": "link", + "label": "Link", + "default": "", + "info": "Link to redirect" + } + ] + } + ], + "_id": "5feacca5bec2321047892841", + "name": "gallery", + "label": "Gallery", + "preset": { + "props": { + "item_count": 4 + }, + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec232b085892842", + "name": "heroBanner", + "label": "Hero Banner" + }, + { + "props": [ + { + "id": "image", + "type": "image_picker", + "label": "Hero Image", + "default": "" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "overlayLayout", + "type": "select", + "options": [ + { + "value": "left", + "text": "Align Left" + }, + { + "value": "center", + "text": "Align Center" + }, + { + "value": "right", + "text": "Align Right" + } + ], + "default": "left", + "label": "Overlay Layout", + "info": "Alignment of overlay content" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Overlay image", + "info": "Overlay Image" + }, + { + "type": "text", + "id": "text", + "default": "", + "label": "Overlay Text" + }, + { + "type": "color", + "id": "text_color", + "default": "#000", + "label": "Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "Shop Now", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec2321e74892843", + "name": "imageBanner", + "label": "Hero Image" + }, + { + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "coverUrl", + "type": "image_picker", + "label": "Video Cover Image URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + }, + { + "type": "select", + "id": "size", + "options": [ + { + "value": "adapt", + "text": "Adapt" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Video Height", + "info": "Height of Video" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "color", + "id": "heading_color", + "default": "#000", + "label": "Headin Text Color" + }, + { + "type": "text", + "id": "subHeading", + "default": "", + "label": "Sub-heading" + }, + { + "type": "color", + "id": "subheading_color", + "default": "#000", + "label": "Subheading Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "ShopNow", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec232bfc8892844", + "name": "videoBanner", + "label": "Hero Video" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first image" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides after every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image" + }, + { + "type": "url", + "id": "slide_link", + "label": "Slide Link" + } + ] + } + ], + "_id": "5feacca5bec232a916892845", + "name": "image-carousel", + "label": "Image Carousel", + "preset": { + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 2, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "collection", + "id": "collection", + "label": "Collection", + "info": "Select a collection to display its products" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec23258ec892846", + "name": "productList", + "label": "Product List", + "preset": { + "props": { + "heading": "Featured Products", + "item_count": 4, + "collection": "" + } + } + }, + { + "props": [ + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2 + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "testimonial", + "name": "Testimonial", + "props": [ + { + "type": "textarea", + "id": "testimonialText", + "label": "Text for Testimonial", + "default": "", + "info": "Text for testimonial", + "placeholder": "Text" + }, + { + "type": "text", + "id": "author", + "label": "Customers name" + } + ] + } + ], + "_id": "5feacca5bec23299e8892847", + "name": "testimonials", + "label": "Testimonial" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first video" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "video_item", + "name": "Video Slide", + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + } + ] + } + ], + "_id": "5feacca5bec232d89b892848", + "name": "videoCarousel", + "label": "Video Carousel" + } + ], + "sections": [ + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "Brands" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "department": { + "type": "department", + "value": null + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": null + } + } + } + ], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "collection-listing" + }, + { + "page_sections": [ + { + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Apple", + "id": "apple" + } + } + } + }, + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Gionee", + "id": "gionee" + } + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "heading": { + "type": "text", + "value": "Brandss" + }, + "brand_type": { + "type": "radio", + "value": "handpicked" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 4, + "type": "range" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + }, + { + "page_sections": [], + "page_key": "tesr" + } + ], + "application": "5e737afb97e0f586bf9d04db", + "available_pages": [ + { + "path": "product", + "type": "system", + "sections": [], + "text": "Product Description", + "value": "product-description" + }, + { + "path": "collection", + "type": "system", + "sections": [], + "text": "Collection Listing", + "value": "collection-listing" + }, + { + "path": "", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2327927892853", + "attributes": { + "page": "home" + } + } + ], + "value": "home", + "text": "Home" + }, + { + "path": "brands", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2326422892854", + "attributes": { + "page": "brands" + } + } + ], + "value": "brands", + "text": "Brands" + }, + { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + { + "path": "categories", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec232424c892855", + "attributes": { + "page": "categories" + } + } + ], + "value": "categories", + "text": "Categories" + }, + { + "path": "collections", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec23281de892856", + "attributes": { + "page": "collections" + } + } + ], + "value": "collections", + "text": "Collections" + }, + { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + }, + { + "path": "sections/test", + "type": "sections", + "sections": [], + "text": "test", + "value": "test" + } + ], + "styles": {}, + "constants": {}, + "settings": {}, + "created_at": "2020-12-22T05:09:04.720Z", + "updated_at": "2021-01-24T11:22:41.376Z" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### archiveTheme +Archive a theme + + + + +```swift +client.application("").theme.archiveTheme(themeId: themeId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| themeId | String | yes | ID allotted to the theme. | + + + +Use this API to store an existing theme but not delete it so that it can be used in future if required. + +*Returned Response:* + + + + +[ThemesSchema](#ThemesSchema) + +Success. Refer `ThemesSchema` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "information": { + "images": { + "desktop": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ], + "android": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "ios": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "thumbnail": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ] + }, + "features": [ + "Responsive" + ], + "name": "Akash-Artisan" + }, + "src": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/sources/J-1s-N-pl-archive.zip" + }, + "assets": { + "css": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/Ia4m885Mw2-themeBundle.css" + }, + "umd_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/nEPGyc15g-themeBundle.umd.min.js" + }, + "common_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/5f7tOB5rpq-themeBundle.common.js" + } + }, + "config": { + "preset": { + "sections": [ + { + "page_sections": [ + { + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219133573.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/men-collection-vcahuo2q" + } + } + }, + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219184350.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/shirts-5e9654ad" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "image-carousel", + "props": { + "slide_height": { + "type": "select", + "value": "adapt" + }, + "autoplay": { + "type": "checkbox", + "value": false + }, + "slide_interval": { + "type": "range", + "value": 2 + } + } + }, + { + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "accessories-7ee89654" + }, + "title": { + "type": "text", + "value": "Turtle sports club" + }, + "subtitle": { + "type": "text", + "value": "Casual Collections" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/casual_nfadbl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Formal Collection" + }, + "subtitle": { + "type": "text", + "value": "Turtle Tailor Mark" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/tailors_nsrrfl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Bottomwear" + }, + "subtitle": { + "type": "text", + "value": "Chinos | Trousers | Pants" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/bottomwear_tdkhn2.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "t-shirt-7ee3cbcd" + }, + "title": { + "type": "text", + "value": "Shirts" + }, + "subtitle": { + "type": "text", + "value": "Casual" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/t-shirt_re9srk.jpg" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionGrid", + "props": { + "title": { + "type": "text", + "value": "Collections" + }, + "subtitle": { + "type": "text", + "value": "Buy from our" + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "department": { + "type": "department", + "value": "others" + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "layout": { + "type": "select", + "value": "grid" + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + } + ] + }, + "global_schema": { + "props": [ + { + "type": "color", + "id": "header_bg_color", + "default": "#ffffff", + "category": "Header", + "label": "Header background Color" + }, + { + "type": "color", + "id": "footer_bg_color", + "default": "#1b1b1b", + "category": "Footer", + "label": "Footer background Color" + }, + { + "type": "text", + "id": "footer_text", + "default": "", + "category": "Footer", + "label": "Footer Text" + }, + { + "type": "checkbox", + "id": "disable_cart", + "default": false, + "category": "Cart", + "label": "Disable Cart" + } + ] + }, + "current": "default", + "page_schema": [ + { + "props": [], + "_id": "5fe182f763d26d042fd205c4", + "page": "add-product-review" + }, + { + "props": [], + "_id": "5fe182f763d26dadc8d205c6", + "page": "blog" + }, + { + "props": [], + "_id": "5fe182f763d26d0a36d205c7", + "page": "brands" + }, + { + "props": [ + { + "type": "checkbox", + "id": "gst", + "label": "GST", + "default": true, + "info": "Show GST on cart" + }, + { + "type": "checkbox", + "id": "staff_selection", + "label": "Staff Selection", + "default": true, + "info": "Show Staff selection on Cart" + }, + { + "type": "checkbox", + "id": "enable_customer", + "label": "Customer", + "default": true, + "info": "Placing on behalf of customer" + }, + { + "type": "checkbox", + "id": "enable_guest", + "label": "Enable Guest Checkout", + "default": true, + "info": "Enable Continue as Guest" + } + ], + "_id": "5fe182f763d26d81c5d205c8", + "page": "cart-landing" + }, + { + "props": [], + "_id": "5fe182f763d26d7e15d205c9", + "page": "cart-review" + }, + { + "props": [], + "_id": "5fe182f763d26d270ed205ca", + "page": "categories" + }, + { + "props": [], + "_id": "5fe182f763d26d9b4fd205cb", + "page": "collection-listing" + }, + { + "props": [], + "_id": "5fe182f763d26da6ecd205cc", + "page": "collections" + }, + { + "props": [], + "_id": "5fe182f763d26d7156d205cd", + "page": "compare-products" + }, + { + "props": [], + "_id": "5fe182f763d26d62bad205ce", + "page": "home" + }, + { + "props": [], + "_id": "5fe182f763d26d5afcd205cf", + "page": "order-review" + }, + { + "props": [], + "_id": "5fe182f763d26def8dd205d0", + "page": "order-tracking-details" + }, + { + "props": [], + "_id": "5fe182f763d26d381fd205d1", + "page": "order-tracking" + }, + { + "props": [ + { + "type": "text", + "id": "shipping_link", + "label": "Shipping Link", + "default": "https://fynd.freshdesk.com/support/solutions/folders/33000111600", + "info": "Link of shipping page" + }, + { + "type": "checkbox", + "id": "original_image", + "label": "Use original Image", + "default": false, + "info": "Use original product image." + }, + { + "type": "checkbox", + "id": "wishlist", + "label": "Wishlist", + "default": true, + "info": "Show Wishlist for product" + }, + { + "type": "checkbox", + "id": "reviews", + "label": "Review", + "default": true, + "info": "Show Reviews of product" + }, + { + "type": "checkbox", + "id": "add_to_compare", + "label": "Add to Compare", + "default": true, + "info": "Allow comparison of products" + }, + { + "type": "checkbox", + "id": "size_guide", + "label": "Size Guide", + "default": true, + "info": "Show Size Guide" + }, + { + "type": "checkbox", + "id": "product_request", + "label": "Product Request", + "default": true, + "info": "Show Product Request" + }, + { + "type": "checkbox", + "id": "share", + "label": "Share", + "default": true, + "info": "Enable Sharing product" + }, + { + "type": "checkbox", + "id": "sold_by", + "label": "Show Sold By", + "default": true, + "info": "Show name of the store" + }, + { + "type": "checkbox", + "id": "store_selection", + "label": "Seller Store Selection", + "default": true, + "info": "Allow to explicitly select stores" + }, + { + "type": "checkbox", + "id": "compare_products", + "label": "Compare Products", + "default": true, + "info": "Show Most Compared Products" + }, + { + "type": "checkbox", + "id": "variants", + "label": "Product Variants", + "default": true, + "info": "Show Product Variants" + }, + { + "type": "checkbox", + "id": "ratings", + "label": "Product Rating", + "default": true, + "info": "Show Product Ratings" + }, + { + "type": "checkbox", + "id": "similar_products", + "label": "Similar Products", + "default": true, + "info": "Show Similar Products" + }, + { + "type": "checkbox", + "id": "bulk_prices", + "label": "Bulk Prices", + "default": true, + "info": "Show Bulk Prices" + }, + { + "type": "checkbox", + "id": "showDeliveryInfo", + "label": "Delivery Info", + "default": true, + "info": "Show Delivery Date" + } + ], + "_id": "5fe182f763d26d29bbd205d2", + "page": "product-description" + }, + { + "props": [], + "_id": "5fe182f763d26da5f0d205d3", + "page": "product-listing" + }, + { + "props": [], + "_id": "5fe182f763d26d3d18d205d4", + "page": "product-reviews" + }, + { + "props": [], + "_id": "5fe182f763d26d4e2dd205d5", + "page": "wishlist" + }, + { + "props": [ + { + "default": true, + "id": "header", + "label": "Header", + "type": "checkbox" + }, + { + "default": true, + "id": "footer", + "label": "Footer", + "type": "checkbox" + } + ], + "_id": "5fe7166cbaae343115de8555", + "page": "tesr" + } + ], + "list": [ + { + "name": "default", + "global_config": { + "static": { + "props": { + "colors": { + "primary_color": "#7043f7", + "secondary_color": "#02d1cb", + "accent_color": "#FFFFFF", + "link_color": "#7043f7", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "disable_cart": false + } + } + }, + "page": [ + { + "settings": { + "props": { + "show_info_message": true + } + }, + "page": "cart-landing" + } + ], + "_id": "5fc4bb9078e957737e7d79a3" + } + ] + }, + "colors": { + "primary_color": "#41434C", + "secondary_color": "#41434C", + "accent_color": "#FFFFFF", + "link_color": "#33B1C0", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + }, + "font": { + "variants": { + "light": { + "name": "300", + "file": "" + }, + "regular": { + "name": "regular", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVRS0Fbvbc14VxRD7N01bV7kg.ttf" + }, + "medium": { + "name": "500", + "file": "" + }, + "semi_bold": { + "name": "600", + "file": "" + }, + "bold": { + "name": "700", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVSS0Fbvbc14Vxps5xQ3Z5nm29Gww.ttf" + } + }, + "family": "Judson" + }, + "applied": true, + "published": false, + "archived": false, + "customized": true, + "version": "1.1.19", + "tags": [], + "_id": "5fe17f7063d26dc54fd202b4", + "pages": { + "home": { + "path": "", + "type": "system", + "sections": [], + "value": "home", + "text": "Home" + }, + "brands": { + "path": "brands", + "type": "system", + "sections": [], + "value": "brands", + "text": "Brands" + }, + "cart-landing": { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + "categories": { + "path": "categories", + "type": "system", + "sections": [], + "value": "categories", + "text": "Categories" + }, + "collections": { + "path": "collections", + "type": "system", + "sections": [], + "value": "collections", + "text": "Collections" + }, + "compare-products": { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + "product-description": { + "path": "product", + "type": "system", + "sections": [], + "value": "product-description", + "text": "Product Description" + }, + "product-listing": { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + "collection-listing": { + "path": "collection", + "type": "system", + "sections": [], + "value": "collection-listing", + "text": "COllection Listing" + }, + "wishlist": { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + } + }, + "available_sections": [ + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Brands", + "label": "Brands Heading" + }, + { + "type": "radio", + "id": "brand_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "department", + "text": "Department" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "department", + "id": "department", + "label": "Department", + "info": "Select a department of brands", + "note": "Department only applies if 'department' type is selected" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": [ + { + "type": "brand", + "id": "brand", + "label": "Select Brand" + } + ] + } + ], + "_id": "5feacca5bec232d59b89283a", + "name": "brandTemplate", + "label": "Brands List Page" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Categories", + "label": "Categories Heading" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All", + "info": "Check to show View All Button" + } + ], + "blocks": [], + "_id": "5feacca5bec232404189283b", + "name": "categoriesTemplate", + "label": "Categories Page" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Subtitle" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Background image", + "info": "Background Image" + }, + { + "type": "text", + "id": "title", + "default": "", + "label": "Overlay title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Overlay subtitle" + } + ] + } + ], + "_id": "5feacca5bec2321fd589283c", + "name": "collectionGrid", + "label": "Collection Grid" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collection List", + "label": "Collection Heading", + "info": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + } + ] + } + ], + "_id": "5feacca5bec2323bf689283d", + "name": "collectionList", + "label": "Collection List" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "radio", + "id": "collection_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "collection-item", + "name": "Collection Item", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select collection" + } + ] + } + ], + "_id": "5feacca5bec23263b489283e", + "name": "collectionTemplate", + "label": "Collection List Page" + }, + { + "props": [ + { + "type": "code", + "id": "code", + "label": "Custom HTML", + "info": "Add Your custom HTML Code below. You can also use the full screen icon to open a code editor and add your code" + } + ], + "blocks": [], + "_id": "5feacca5bec232409489283f", + "name": "customHtml", + "label": "Custom HTML" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Products", + "label": "Section Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "product", + "name": "Product", + "props": [ + { + "type": "product", + "id": "product", + "label": "Select a Product", + "info": "Product Item to be displayed" + } + ] + } + ], + "_id": "5feacca5bec2326213892840", + "name": "featuredProducts", + "label": "Featured Products", + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "props": [ + { + "type": "range", + "id": "item_count", + "min": 1, + "max": 4, + "step": 1, + "unit": "", + "label": "No of items", + "default": 4, + "info": "Maximum items allowed per row" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image", + "default": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1603773049684.svg" + }, + { + "type": "text", + "id": "caption", + "label": "Image Caption", + "default": "" + }, + { + "type": "url", + "id": "link", + "label": "Link", + "default": "", + "info": "Link to redirect" + } + ] + } + ], + "_id": "5feacca5bec2321047892841", + "name": "gallery", + "label": "Gallery", + "preset": { + "props": { + "item_count": 4 + }, + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec232b085892842", + "name": "heroBanner", + "label": "Hero Banner" + }, + { + "props": [ + { + "id": "image", + "type": "image_picker", + "label": "Hero Image", + "default": "" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "overlayLayout", + "type": "select", + "options": [ + { + "value": "left", + "text": "Align Left" + }, + { + "value": "center", + "text": "Align Center" + }, + { + "value": "right", + "text": "Align Right" + } + ], + "default": "left", + "label": "Overlay Layout", + "info": "Alignment of overlay content" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Overlay image", + "info": "Overlay Image" + }, + { + "type": "text", + "id": "text", + "default": "", + "label": "Overlay Text" + }, + { + "type": "color", + "id": "text_color", + "default": "#000", + "label": "Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "Shop Now", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec2321e74892843", + "name": "imageBanner", + "label": "Hero Image" + }, + { + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "coverUrl", + "type": "image_picker", + "label": "Video Cover Image URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + }, + { + "type": "select", + "id": "size", + "options": [ + { + "value": "adapt", + "text": "Adapt" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Video Height", + "info": "Height of Video" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "color", + "id": "heading_color", + "default": "#000", + "label": "Headin Text Color" + }, + { + "type": "text", + "id": "subHeading", + "default": "", + "label": "Sub-heading" + }, + { + "type": "color", + "id": "subheading_color", + "default": "#000", + "label": "Subheading Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "ShopNow", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec232bfc8892844", + "name": "videoBanner", + "label": "Hero Video" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first image" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides after every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image" + }, + { + "type": "url", + "id": "slide_link", + "label": "Slide Link" + } + ] + } + ], + "_id": "5feacca5bec232a916892845", + "name": "image-carousel", + "label": "Image Carousel", + "preset": { + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 2, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "collection", + "id": "collection", + "label": "Collection", + "info": "Select a collection to display its products" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec23258ec892846", + "name": "productList", + "label": "Product List", + "preset": { + "props": { + "heading": "Featured Products", + "item_count": 4, + "collection": "" + } + } + }, + { + "props": [ + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2 + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "testimonial", + "name": "Testimonial", + "props": [ + { + "type": "textarea", + "id": "testimonialText", + "label": "Text for Testimonial", + "default": "", + "info": "Text for testimonial", + "placeholder": "Text" + }, + { + "type": "text", + "id": "author", + "label": "Customers name" + } + ] + } + ], + "_id": "5feacca5bec23299e8892847", + "name": "testimonials", + "label": "Testimonial" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first video" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "video_item", + "name": "Video Slide", + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + } + ] + } + ], + "_id": "5feacca5bec232d89b892848", + "name": "videoCarousel", + "label": "Video Carousel" + } + ], + "sections": [ + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "Brands" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "department": { + "type": "department", + "value": null + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": null + } + } + } + ], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "collection-listing" + }, + { + "page_sections": [ + { + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Apple", + "id": "apple" + } + } + } + }, + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Gionee", + "id": "gionee" + } + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "heading": { + "type": "text", + "value": "Brandss" + }, + "brand_type": { + "type": "radio", + "value": "handpicked" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 4, + "type": "range" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + }, + { + "page_sections": [], + "page_key": "tesr" + } + ], + "application": "5e737afb97e0f586bf9d04db", + "available_pages": [ + { + "path": "product", + "type": "system", + "sections": [], + "text": "Product Description", + "value": "product-description" + }, + { + "path": "collection", + "type": "system", + "sections": [], + "text": "Collection Listing", + "value": "collection-listing" + }, + { + "path": "", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2327927892853", + "attributes": { + "page": "home" + } + } + ], + "value": "home", + "text": "Home" + }, + { + "path": "brands", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2326422892854", + "attributes": { + "page": "brands" + } + } + ], + "value": "brands", + "text": "Brands" + }, + { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + { + "path": "categories", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec232424c892855", + "attributes": { + "page": "categories" + } + } + ], + "value": "categories", + "text": "Categories" + }, + { + "path": "collections", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec23281de892856", + "attributes": { + "page": "collections" + } + } + ], + "value": "collections", + "text": "Collections" + }, + { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + }, + { + "path": "sections/test", + "type": "sections", + "sections": [], + "text": "test", + "value": "test" + } + ], + "styles": {}, + "constants": {}, + "settings": {}, + "created_at": "2020-12-22T05:09:04.720Z", + "updated_at": "2021-01-24T11:22:41.376Z" + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### unarchiveTheme +Unarchive a theme + + + + +```swift +client.application("").theme.unarchiveTheme(themeId: themeId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| themeId | String | yes | ID allotted to the theme. | + + + +Use this API to restore an archived theme and bring it back for editing or publishing. + +*Returned Response:* + + + + +[ThemesSchema](#ThemesSchema) + +Success. Refer `ThemesSchema` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "information": { + "images": { + "desktop": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ], + "android": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "ios": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-mobile.png" + ], + "thumbnail": [ + "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/artisan-desktop.png" + ] + }, + "features": [ + "Responsive" + ], + "name": "Akash-Artisan" + }, + "src": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/sources/J-1s-N-pl-archive.zip" + }, + "assets": { + "css": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/Ia4m885Mw2-themeBundle.css" + }, + "umd_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/nEPGyc15g-themeBundle.umd.min.js" + }, + "common_js": { + "link": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/assets/5f7tOB5rpq-themeBundle.common.js" + } + }, + "config": { + "preset": { + "sections": [ + { + "page_sections": [ + { + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219133573.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/men-collection-vcahuo2q" + } + } + }, + { + "type": "gallery_image", + "name": "Image", + "props": { + "image": { + "type": "image_picker", + "value": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1601219184350.jpeg" + }, + "slide_link": { + "type": "url", + "value": "https://www.turtleonline.in/collection/shirts-5e9654ad" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "image-carousel", + "props": { + "slide_height": { + "type": "select", + "value": "adapt" + }, + "autoplay": { + "type": "checkbox", + "value": false + }, + "slide_interval": { + "type": "range", + "value": 2 + } + } + }, + { + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "accessories-7ee89654" + }, + "title": { + "type": "text", + "value": "Turtle sports club" + }, + "subtitle": { + "type": "text", + "value": "Casual Collections" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/casual_nfadbl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Formal Collection" + }, + "subtitle": { + "type": "text", + "value": "Turtle Tailor Mark" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/tailors_nsrrfl.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "bottom-wear-fb133293" + }, + "title": { + "type": "text", + "value": "Bottomwear" + }, + "subtitle": { + "type": "text", + "value": "Chinos | Trousers | Pants" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/bottomwear_tdkhn2.jpg" + } + } + }, + { + "type": "collection", + "name": "Collection", + "props": { + "collection": { + "type": "collection", + "value": "t-shirt-7ee3cbcd" + }, + "title": { + "type": "text", + "value": "Shirts" + }, + "subtitle": { + "type": "text", + "value": "Casual" + }, + "overlay_image": { + "type": "image_picker", + "value": "https://hdn-1.addsale.com/x0/company/1/applications/5e737afb97e0f586bf9d04db/theme/pictures/free/original/t-shirt_re9srk.jpg" + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionGrid", + "props": { + "title": { + "type": "text", + "value": "Collections" + }, + "subtitle": { + "type": "text", + "value": "Buy from our" + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "department": { + "type": "department", + "value": "others" + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "layout": { + "type": "select", + "value": "grid" + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + } + ] + }, + "global_schema": { + "props": [ + { + "type": "color", + "id": "header_bg_color", + "default": "#ffffff", + "category": "Header", + "label": "Header background Color" + }, + { + "type": "color", + "id": "footer_bg_color", + "default": "#1b1b1b", + "category": "Footer", + "label": "Footer background Color" + }, + { + "type": "text", + "id": "footer_text", + "default": "", + "category": "Footer", + "label": "Footer Text" + }, + { + "type": "checkbox", + "id": "disable_cart", + "default": false, + "category": "Cart", + "label": "Disable Cart" + } + ] + }, + "current": "default", + "page_schema": [ + { + "props": [], + "_id": "5fe182f763d26d042fd205c4", + "page": "add-product-review" + }, + { + "props": [], + "_id": "5fe182f763d26dadc8d205c6", + "page": "blog" + }, + { + "props": [], + "_id": "5fe182f763d26d0a36d205c7", + "page": "brands" + }, + { + "props": [ + { + "type": "checkbox", + "id": "gst", + "label": "GST", + "default": true, + "info": "Show GST on cart" + }, + { + "type": "checkbox", + "id": "staff_selection", + "label": "Staff Selection", + "default": true, + "info": "Show Staff selection on Cart" + }, + { + "type": "checkbox", + "id": "enable_customer", + "label": "Customer", + "default": true, + "info": "Placing on behalf of customer" + }, + { + "type": "checkbox", + "id": "enable_guest", + "label": "Enable Guest Checkout", + "default": true, + "info": "Enable Continue as Guest" + } + ], + "_id": "5fe182f763d26d81c5d205c8", + "page": "cart-landing" + }, + { + "props": [], + "_id": "5fe182f763d26d7e15d205c9", + "page": "cart-review" + }, + { + "props": [], + "_id": "5fe182f763d26d270ed205ca", + "page": "categories" + }, + { + "props": [], + "_id": "5fe182f763d26d9b4fd205cb", + "page": "collection-listing" + }, + { + "props": [], + "_id": "5fe182f763d26da6ecd205cc", + "page": "collections" + }, + { + "props": [], + "_id": "5fe182f763d26d7156d205cd", + "page": "compare-products" + }, + { + "props": [], + "_id": "5fe182f763d26d62bad205ce", + "page": "home" + }, + { + "props": [], + "_id": "5fe182f763d26d5afcd205cf", + "page": "order-review" + }, + { + "props": [], + "_id": "5fe182f763d26def8dd205d0", + "page": "order-tracking-details" + }, + { + "props": [], + "_id": "5fe182f763d26d381fd205d1", + "page": "order-tracking" + }, + { + "props": [ + { + "type": "text", + "id": "shipping_link", + "label": "Shipping Link", + "default": "https://fynd.freshdesk.com/support/solutions/folders/33000111600", + "info": "Link of shipping page" + }, + { + "type": "checkbox", + "id": "original_image", + "label": "Use original Image", + "default": false, + "info": "Use original product image." + }, + { + "type": "checkbox", + "id": "wishlist", + "label": "Wishlist", + "default": true, + "info": "Show Wishlist for product" + }, + { + "type": "checkbox", + "id": "reviews", + "label": "Review", + "default": true, + "info": "Show Reviews of product" + }, + { + "type": "checkbox", + "id": "add_to_compare", + "label": "Add to Compare", + "default": true, + "info": "Allow comparison of products" + }, + { + "type": "checkbox", + "id": "size_guide", + "label": "Size Guide", + "default": true, + "info": "Show Size Guide" + }, + { + "type": "checkbox", + "id": "product_request", + "label": "Product Request", + "default": true, + "info": "Show Product Request" + }, + { + "type": "checkbox", + "id": "share", + "label": "Share", + "default": true, + "info": "Enable Sharing product" + }, + { + "type": "checkbox", + "id": "sold_by", + "label": "Show Sold By", + "default": true, + "info": "Show name of the store" + }, + { + "type": "checkbox", + "id": "store_selection", + "label": "Seller Store Selection", + "default": true, + "info": "Allow to explicitly select stores" + }, + { + "type": "checkbox", + "id": "compare_products", + "label": "Compare Products", + "default": true, + "info": "Show Most Compared Products" + }, + { + "type": "checkbox", + "id": "variants", + "label": "Product Variants", + "default": true, + "info": "Show Product Variants" + }, + { + "type": "checkbox", + "id": "ratings", + "label": "Product Rating", + "default": true, + "info": "Show Product Ratings" + }, + { + "type": "checkbox", + "id": "similar_products", + "label": "Similar Products", + "default": true, + "info": "Show Similar Products" + }, + { + "type": "checkbox", + "id": "bulk_prices", + "label": "Bulk Prices", + "default": true, + "info": "Show Bulk Prices" + }, + { + "type": "checkbox", + "id": "showDeliveryInfo", + "label": "Delivery Info", + "default": true, + "info": "Show Delivery Date" + } + ], + "_id": "5fe182f763d26d29bbd205d2", + "page": "product-description" + }, + { + "props": [], + "_id": "5fe182f763d26da5f0d205d3", + "page": "product-listing" + }, + { + "props": [], + "_id": "5fe182f763d26d3d18d205d4", + "page": "product-reviews" + }, + { + "props": [], + "_id": "5fe182f763d26d4e2dd205d5", + "page": "wishlist" + }, + { + "props": [ + { + "default": true, + "id": "header", + "label": "Header", + "type": "checkbox" + }, + { + "default": true, + "id": "footer", + "label": "Footer", + "type": "checkbox" + } + ], + "_id": "5fe7166cbaae343115de8555", + "page": "tesr" + } + ], + "list": [ + { + "name": "default", + "global_config": { + "static": { + "props": { + "colors": { + "primary_color": "#7043f7", + "secondary_color": "#02d1cb", + "accent_color": "#FFFFFF", + "link_color": "#7043f7", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + } + } + }, + "custom": { + "props": { + "disable_cart": false + } + } + }, + "page": [ + { + "settings": { + "props": { + "show_info_message": true + } + }, + "page": "cart-landing" + } + ], + "_id": "5fc4bb9078e957737e7d79a3" + } + ] + }, + "colors": { + "primary_color": "#41434C", + "secondary_color": "#41434C", + "accent_color": "#FFFFFF", + "link_color": "#33B1C0", + "button_secondary_color": "#000000", + "bg_color": "#F8F8F8" + }, + "font": { + "variants": { + "light": { + "name": "300", + "file": "" + }, + "regular": { + "name": "regular", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVRS0Fbvbc14VxRD7N01bV7kg.ttf" + }, + "medium": { + "name": "500", + "file": "" + }, + "semi_bold": { + "name": "600", + "file": "" + }, + "bold": { + "name": "700", + "file": "https://fonts.gstatic.com/s/judson/v13/FeVSS0Fbvbc14Vxps5xQ3Z5nm29Gww.ttf" + } + }, + "family": "Judson" + }, + "applied": true, + "published": false, + "archived": false, + "customized": true, + "version": "1.1.19", + "tags": [], + "_id": "5fe17f7063d26dc54fd202b4", + "pages": { + "home": { + "path": "", + "type": "system", + "sections": [], + "value": "home", + "text": "Home" + }, + "brands": { + "path": "brands", + "type": "system", + "sections": [], + "value": "brands", + "text": "Brands" + }, + "cart-landing": { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + "categories": { + "path": "categories", + "type": "system", + "sections": [], + "value": "categories", + "text": "Categories" + }, + "collections": { + "path": "collections", + "type": "system", + "sections": [], + "value": "collections", + "text": "Collections" + }, + "compare-products": { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + "product-description": { + "path": "product", + "type": "system", + "sections": [], + "value": "product-description", + "text": "Product Description" + }, + "product-listing": { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + "collection-listing": { + "path": "collection", + "type": "system", + "sections": [], + "value": "collection-listing", + "text": "COllection Listing" + }, + "wishlist": { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + } + }, + "available_sections": [ + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Brands", + "label": "Brands Heading" + }, + { + "type": "radio", + "id": "brand_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "department", + "text": "Department" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "department", + "id": "department", + "label": "Department", + "info": "Select a department of brands", + "note": "Department only applies if 'department' type is selected" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": [ + { + "type": "brand", + "id": "brand", + "label": "Select Brand" + } + ] + } + ], + "_id": "5feacca5bec232d59b89283a", + "name": "brandTemplate", + "label": "Brands List Page" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Categories", + "label": "Categories Heading" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Items per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All", + "info": "Check to show View All Button" + } + ], + "blocks": [], + "_id": "5feacca5bec232404189283b", + "name": "categoriesTemplate", + "label": "Categories Page" + }, + { + "props": [ + { + "type": "text", + "id": "title", + "default": "", + "label": "Title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Subtitle" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Background image", + "info": "Background Image" + }, + { + "type": "text", + "id": "title", + "default": "", + "label": "Overlay title" + }, + { + "type": "text", + "id": "subtitle", + "default": "", + "label": "Overlay subtitle" + } + ] + } + ], + "_id": "5feacca5bec2321fd589283c", + "name": "collectionGrid", + "label": "Collection Grid" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collection List", + "label": "Collection Heading", + "info": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "collection", + "name": "Collection", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select a collection" + } + ] + } + ], + "_id": "5feacca5bec2323bf689283d", + "name": "collectionList", + "label": "Collection List" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Collections per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "radio", + "id": "collection_type", + "default": "all", + "options": [ + { + "value": "all", + "text": "All" + }, + { + "value": "handpicked", + "text": "Handpicked" + } + ] + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "layout", + "type": "select", + "options": [ + { + "value": "grid", + "text": "Grid View" + }, + { + "value": "horizontal", + "text": "Horizontal View" + } + ], + "default": "grid", + "label": "Layout", + "info": "Alignment of content" + }, + { + "type": "checkbox", + "id": "view_all", + "default": false, + "label": "Show View All" + } + ], + "blocks": [ + { + "type": "collection-item", + "name": "Collection Item", + "props": [ + { + "type": "collection", + "id": "collection", + "label": "Select collection" + } + ] + } + ], + "_id": "5feacca5bec23263b489283e", + "name": "collectionTemplate", + "label": "Collection List Page" + }, + { + "props": [ + { + "type": "code", + "id": "code", + "label": "Custom HTML", + "info": "Add Your custom HTML Code below. You can also use the full screen icon to open a code editor and add your code" + } + ], + "blocks": [], + "_id": "5feacca5bec232409489283f", + "name": "customHtml", + "label": "Custom HTML" + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Products", + "label": "Section Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 3, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 4, + "info": "Maximum items allowed per row" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "product", + "name": "Product", + "props": [ + { + "type": "product", + "id": "product", + "label": "Select a Product", + "info": "Product Item to be displayed" + } + ] + } + ], + "_id": "5feacca5bec2326213892840", + "name": "featuredProducts", + "label": "Featured Products", + "preset": { + "blocks": [ + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + }, + { + "name": "Product" + } + ] + } + }, + { + "props": [ + { + "type": "range", + "id": "item_count", + "min": 1, + "max": 4, + "step": 1, + "unit": "", + "label": "No of items", + "default": 4, + "info": "Maximum items allowed per row" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image", + "default": "https://hdn-1.fynd.com/company/163/applications/5d5265c8f8ad9cae6dbf18f1/theme/pictures/free/original/theme-image-1603773049684.svg" + }, + { + "type": "text", + "id": "caption", + "label": "Image Caption", + "default": "" + }, + { + "type": "url", + "id": "link", + "label": "Link", + "default": "", + "info": "Link to redirect" + } + ] + } + ], + "_id": "5feacca5bec2321047892841", + "name": "gallery", + "label": "Gallery", + "preset": { + "props": { + "item_count": 4 + }, + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec232b085892842", + "name": "heroBanner", + "label": "Hero Banner" + }, + { + "props": [ + { + "id": "image", + "type": "image_picker", + "label": "Hero Image", + "default": "" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "overlayLayout", + "type": "select", + "options": [ + { + "value": "left", + "text": "Align Left" + }, + { + "value": "center", + "text": "Align Center" + }, + { + "value": "right", + "text": "Align Right" + } + ], + "default": "left", + "label": "Overlay Layout", + "info": "Alignment of overlay content" + }, + { + "type": "image_picker", + "id": "overlayImage", + "default": "", + "label": "Overlay image", + "info": "Overlay Image" + }, + { + "type": "text", + "id": "text", + "default": "", + "label": "Overlay Text" + }, + { + "type": "color", + "id": "text_color", + "default": "#000", + "label": "Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "Shop Now", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec2321e74892843", + "name": "imageBanner", + "label": "Hero Image" + }, + { + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "id": "coverUrl", + "type": "image_picker", + "label": "Video Cover Image URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + }, + { + "type": "select", + "id": "size", + "options": [ + { + "value": "adapt", + "text": "Adapt" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Video Height", + "info": "Height of Video" + }, + { + "type": "text", + "id": "heading", + "default": "", + "label": "Heading" + }, + { + "type": "color", + "id": "heading_color", + "default": "#000", + "label": "Headin Text Color" + }, + { + "type": "text", + "id": "subHeading", + "default": "", + "label": "Sub-heading" + }, + { + "type": "color", + "id": "subheading_color", + "default": "#000", + "label": "Subheading Text Color" + }, + { + "type": "url", + "id": "ctaLink", + "default": "", + "label": "Redirect Link" + }, + { + "type": "text", + "id": "ctaText", + "default": "ShopNow", + "label": "Button Text" + } + ], + "blocks": [], + "_id": "5feacca5bec232bfc8892844", + "name": "videoBanner", + "label": "Hero Video" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first image" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides after every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "gallery_image", + "name": "Image", + "props": [ + { + "type": "image_picker", + "id": "image", + "label": "Gallery Image" + }, + { + "type": "url", + "id": "slide_link", + "label": "Slide Link" + } + ] + } + ], + "_id": "5feacca5bec232a916892845", + "name": "image-carousel", + "label": "Image Carousel", + "preset": { + "blocks": [ + { + "name": "Image" + }, + { + "name": "Image" + } + ] + } + }, + { + "props": [ + { + "type": "text", + "id": "heading", + "default": "Featured Collections", + "label": "Collection Heading" + }, + { + "type": "range", + "id": "item_count", + "min": 2, + "max": 5, + "step": 1, + "unit": "", + "label": "Products per row", + "default": 2, + "info": "Maximum items allowed per row" + }, + { + "type": "collection", + "id": "collection", + "label": "Collection", + "info": "Select a collection to display its products" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [], + "_id": "5feacca5bec23258ec892846", + "name": "productList", + "label": "Product List", + "preset": { + "props": { + "heading": "Featured Products", + "item_count": 4, + "collection": "" + } + } + }, + { + "props": [ + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2 + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + } + ], + "blocks": [ + { + "type": "testimonial", + "name": "Testimonial", + "props": [ + { + "type": "textarea", + "id": "testimonialText", + "label": "Text for Testimonial", + "default": "", + "info": "Text for testimonial", + "placeholder": "Text" + }, + { + "type": "text", + "id": "author", + "label": "Customers name" + } + ] + } + ], + "_id": "5feacca5bec23299e8892847", + "name": "testimonials", + "label": "Testimonial" + }, + { + "props": [ + { + "type": "select", + "id": "slide_height", + "options": [ + { + "value": "adapt", + "text": "Adapt to first video" + }, + { + "value": "small", + "text": "Small" + }, + { + "value": "medium", + "text": "Medium" + }, + { + "value": "large", + "text": "Large" + } + ], + "default": "adapt", + "label": "Slide height", + "info": "Size of the slide" + }, + { + "type": "checkbox", + "id": "full_width", + "default": false, + "label": "Full width", + "info": "Check to allow items to take entire width of the viewport" + }, + { + "type": "checkbox", + "id": "autoplay", + "default": false, + "label": "AutoPlay Slides", + "info": "Check to autoplay slides" + }, + { + "type": "range", + "id": "slide_interval", + "min": 1, + "max": 10, + "step": 1, + "unit": "sec", + "label": "Change slides every", + "default": 2, + "info": "Autoplay slide duration" + } + ], + "blocks": [ + { + "type": "video_item", + "name": "Video Slide", + "props": [ + { + "id": "videoUrl", + "type": "url", + "label": "Video URL", + "default": "" + }, + { + "type": "checkbox", + "id": "showcontrols", + "default": false, + "label": "Show Controls on Video", + "info": "Check to show controls on video" + } + ] + } + ], + "_id": "5feacca5bec232d89b892848", + "name": "videoCarousel", + "label": "Video Carousel" + } + ], + "sections": [ + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + }, + "heading": { + "type": "text", + "value": "Brands" + }, + "brand_type": { + "type": "radio", + "value": "all" + }, + "department": { + "type": "department", + "value": null + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "type": "checkbox", + "value": null + } + } + } + ], + "page_key": "product-description" + }, + { + "page_sections": [], + "page_key": "collection-listing" + }, + { + "page_sections": [ + { + "blocks": [ + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Apple", + "id": "apple" + } + } + } + }, + { + "type": "brand-item", + "name": "Brand Item", + "props": { + "brand": { + "type": "brand", + "value": { + "display": "Gionee", + "id": "gionee" + } + } + } + } + ], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "heading": { + "type": "text", + "value": "Brandss" + }, + "brand_type": { + "type": "radio", + "value": "handpicked" + }, + "department": { + "type": "department" + }, + "item_count": { + "value": 4, + "type": "range" + }, + "full_width": { + "value": false, + "type": "checkbox" + }, + "layout": { + "type": "select", + "value": "grid" + }, + "view_all": { + "value": false, + "type": "checkbox" + } + } + } + ], + "page_key": "home" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "brandTemplate", + "props": { + "title": { + "type": "text", + "value": "Brands" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "brands" + }, + { + "page_sections": [], + "page_key": "cart-landing" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "categoriesTemplate", + "props": { + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "categories" + }, + { + "page_sections": [ + { + "blocks": [], + "predicate": { + "screen": { + "mobile": true, + "desktop": true, + "tablet": true + }, + "user": { + "authenticated": true, + "anonymous": true + }, + "route": { + "selected": "none", + "query": {}, + "exact_u_r_l": "" + } + }, + "name": "collectionTemplate", + "props": { + "heading": { + "type": "text", + "value": "Featured Collections" + }, + "item_count": { + "type": "range", + "value": 4 + }, + "full_width": { + "type": "checkbox", + "value": false + } + } + } + ], + "page_key": "collections" + }, + { + "page_sections": [], + "page_key": "compare-products" + }, + { + "page_sections": [], + "page_key": "product-listing" + }, + { + "page_sections": [], + "page_key": "wishlist" + }, + { + "page_sections": [], + "page_key": "tesr" + } + ], + "application": "5e737afb97e0f586bf9d04db", + "available_pages": [ + { + "path": "product", + "type": "system", + "sections": [], + "text": "Product Description", + "value": "product-description" + }, + { + "path": "collection", + "type": "system", + "sections": [], + "text": "Collection Listing", + "value": "collection-listing" + }, + { + "path": "", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2327927892853", + "attributes": { + "page": "home" + } + } + ], + "value": "home", + "text": "Home" + }, + { + "path": "brands", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec2326422892854", + "attributes": { + "page": "brands" + } + } + ], + "value": "brands", + "text": "Brands" + }, + { + "path": "cart/bag", + "type": "system", + "sections": [], + "value": "cart-landing", + "text": "Cart Landing" + }, + { + "path": "categories", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec232424c892855", + "attributes": { + "page": "categories" + } + } + ], + "value": "categories", + "text": "Categories" + }, + { + "path": "collections", + "type": "system", + "sections": [ + { + "_id": "5feacca5bec23281de892856", + "attributes": { + "page": "collections" + } + } + ], + "value": "collections", + "text": "Collections" + }, + { + "path": "compare", + "type": "system", + "sections": [], + "value": "compare-products", + "text": "Compare Products" + }, + { + "path": "products", + "type": "system", + "sections": [], + "value": "product-listing", + "text": "Product Listing" + }, + { + "path": "wishlist", + "type": "system", + "sections": [], + "value": "wishlist", + "text": "Wishlist" + }, + { + "path": "sections/test", + "type": "sections", + "sections": [], + "text": "test", + "value": "test" + } + ], + "styles": {}, + "constants": {}, + "settings": {}, + "created_at": "2020-12-22T05:09:04.720Z", + "updated_at": "2021-01-24T11:22:41.376Z" + } +} +``` +
    + +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [AvailablePageSchema](#AvailablePageSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | value | String? | yes | | + | text | String? | yes | | + | path | String? | yes | | + | type | String? | yes | | + | sections | [[AvailablePageSchemaSections](#AvailablePageSchemaSections)]? | yes | | + | sectionsMeta | [[AvailablePageSectionMetaAttributes](#AvailablePageSectionMetaAttributes)]? | yes | | + | theme | String? | yes | | + | seo | [AvailablePageSeo](#AvailablePageSeo)? | yes | | + | props | [[String: Any]]? | yes | | + | id | String? | yes | | + +--- + + + + + #### [AvailablePageSectionMetaAttributes](#AvailablePageSectionMetaAttributes) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | attributes | [String: Any]? | yes | | + +--- + + + + + #### [AvailablePageSeo](#AvailablePageSeo) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | title | String? | yes | | + | description | String? | yes | | + | id | String? | yes | | + +--- + + + + + #### [AvailablePageSchemaSections](#AvailablePageSchemaSections) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | label | String? | yes | | + | props | [String: Any]? | yes | | + | blocks | [[String: Any]]? | yes | | + | preset | [String: Any]? | yes | | + | predicate | [AvailablePagePredicate](#AvailablePagePredicate)? | yes | | + +--- + + + + + #### [AvailablePageScreenPredicate](#AvailablePageScreenPredicate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | mobile | Bool? | yes | | + | desktop | Bool? | yes | | + | tablet | Bool? | yes | | + +--- + + + + + #### [AvailablePageUserPredicate](#AvailablePageUserPredicate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | authenticated | Bool? | yes | | + | anonymous | Bool? | yes | | + +--- + + + + + #### [AvailablePageRoutePredicate](#AvailablePageRoutePredicate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | selected | String? | yes | | + | exactUrl | String? | yes | | + | query | [String: Any]? | yes | | + +--- + + + + + #### [AvailablePagePredicate](#AvailablePagePredicate) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | screen | [AvailablePageScreenPredicate](#AvailablePageScreenPredicate)? | yes | | + | user | [AvailablePageUserPredicate](#AvailablePageUserPredicate)? | yes | | + | route | [AvailablePageRoutePredicate](#AvailablePageRoutePredicate)? | yes | | + +--- + + + + + #### [AllAvailablePageSchema](#AllAvailablePageSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pages | [[AvailablePageSchema](#AvailablePageSchema)]? | yes | | + +--- + + + + + #### [PaginationSchema](#PaginationSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | size | Int? | yes | | + | itemTotal | Int? | yes | | + | hasNext | Bool? | yes | | + | type | String? | yes | | + | current | Int? | yes | | + +--- + + + + + #### [ThemesListingResponseSchema](#ThemesListingResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[ThemesSchema](#ThemesSchema)]? | yes | | + | page | [PaginationSchema](#PaginationSchema)? | yes | | + +--- + + + + + #### [AddThemeRequestSchema](#AddThemeRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | themeId | String? | yes | | + +--- + + + + + #### [UpgradableThemeSchema](#UpgradableThemeSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | parentTheme | String? | yes | | + | appliedTheme | String? | yes | | + | upgrade | Bool? | yes | | + +--- + + + + + #### [FontsSchema](#FontsSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [FontsSchemaItems](#FontsSchemaItems)? | yes | | + | kind | String? | yes | | + +--- + + + + + #### [BlitzkriegApiErrorSchema](#BlitzkriegApiErrorSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [BlitzkriegNotFoundSchema](#BlitzkriegNotFoundSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [BlitzkriegInternalServerErrorSchema](#BlitzkriegInternalServerErrorSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [FontsSchemaItems](#FontsSchemaItems) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | family | String? | yes | | + | variants | [String]? | yes | | + | subsets | [String]? | yes | | + | version | String? | yes | | + | lastModified | String? | yes | | + | files | [FontsSchemaItemsFiles](#FontsSchemaItemsFiles)? | yes | | + | category | String? | yes | | + | kind | String? | yes | | + +--- + + + + + #### [FontsSchemaItemsFiles](#FontsSchemaItemsFiles) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | regular | String? | yes | | + | italic | String? | yes | | + | bold | String? | yes | | + +--- + + + + + #### [ThemesSchema](#ThemesSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | String? | yes | | + | applied | Bool? | yes | | + | customized | Bool? | yes | | + | published | Bool? | yes | | + | archived | Bool? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | version | String? | yes | | + | parentThemeVersion | String? | yes | | + | parentTheme | String? | yes | | + | information | [Information](#Information)? | yes | | + | tags | [String]? | yes | | + | src | [Src](#Src)? | yes | | + | assets | [AssetsSchema](#AssetsSchema)? | yes | | + | availableSections | [[availableSectionSchema](#availableSectionSchema)]? | yes | | + | constants | [String: Any]? | yes | | + | styles | [String: Any]? | yes | | + | config | [Config](#Config)? | yes | | + | settings | [String: Any]? | yes | | + | font | [Font](#Font)? | yes | | + | id | String? | yes | | + | v | Int? | yes | | + | colors | [Colors](#Colors)? | yes | | + +--- + + + + + #### [availableSectionSchema](#availableSectionSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | blocks | [[Blocks](#Blocks)]? | yes | | + | name | String? | yes | | + | label | String? | yes | | + | props | [[BlocksProps](#BlocksProps)]? | yes | | + +--- + + + + + #### [Information](#Information) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | images | [Images](#Images)? | yes | | + | features | [String]? | yes | | + | name | String? | yes | | + | description | String? | yes | | + +--- + + + + + #### [Images](#Images) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | desktop | [String]? | yes | | + | android | [String]? | yes | | + | ios | [String]? | yes | | + | thumbnail | [String]? | yes | | + +--- + + + + + #### [Src](#Src) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | link | String? | yes | | + +--- + + + + + #### [AssetsSchema](#AssetsSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | umdJs | [UmdJs](#UmdJs)? | yes | | + | commonJs | [CommonJs](#CommonJs)? | yes | | + | css | [Css](#Css)? | yes | | + +--- + + + + + #### [UmdJs](#UmdJs) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | link | String? | yes | | + +--- + + + + + #### [CommonJs](#CommonJs) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | link | String? | yes | | + +--- + + + + + #### [Css](#Css) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | link | String? | yes | | + +--- + + + + + #### [Sections](#Sections) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | attributes | String? | yes | | + +--- + + + + + #### [Config](#Config) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | preset | [Preset](#Preset)? | yes | | + | globalSchema | [GlobalSchema](#GlobalSchema)? | yes | | + | current | String? | yes | | + | list | [[ListSchemaItem](#ListSchemaItem)]? | yes | | + +--- + + + + + #### [Preset](#Preset) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | pages | [[AvailablePageSchema](#AvailablePageSchema)]? | yes | | + +--- + + + + + #### [GlobalSchema](#GlobalSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | props | [[GlobalSchemaProps](#GlobalSchemaProps)]? | yes | | + +--- + + + + + #### [ListSchemaItem](#ListSchemaItem) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | globalConfig | [String: Any]? | yes | | + | page | [[ConfigPage](#ConfigPage)]? | yes | | + | name | String? | yes | | + +--- + + + + + #### [Colors](#Colors) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | bgColor | String? | yes | | + | primaryColor | String? | yes | | + | secondaryColor | String? | yes | | + | accentColor | String? | yes | | + | linkColor | String? | yes | | + | buttonSecondaryColor | String? | yes | | + +--- + + + + + #### [Custom](#Custom) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | props | [String: Any]? | yes | | + +--- + + + + + #### [ConfigPage](#ConfigPage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | settings | [String: Any]? | yes | | + | page | String? | yes | | + +--- + + + + + #### [Font](#Font) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | family | String? | yes | | + | variants | [Variants](#Variants)? | yes | | + +--- + + + + + #### [Variants](#Variants) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | medium | [Medium](#Medium)? | yes | | + | semiBold | [SemiBold](#SemiBold)? | yes | | + | bold | [Bold](#Bold)? | yes | | + | light | [Light](#Light)? | yes | | + | regular | [Regular](#Regular)? | yes | | + +--- + + + + + #### [Medium](#Medium) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | file | String? | yes | | + +--- + + + + + #### [SemiBold](#SemiBold) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | file | String? | yes | | + +--- + + + + + #### [Bold](#Bold) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | file | String? | yes | | + +--- + + + + + #### [Light](#Light) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | file | String? | yes | | + +--- + + + + + #### [Regular](#Regular) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | file | String? | yes | | + +--- + + + + + #### [Blocks](#Blocks) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | name | String? | yes | | + | props | [[BlocksProps](#BlocksProps)]? | yes | | + +--- + + + + + #### [GlobalSchemaProps](#GlobalSchemaProps) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | label | String? | yes | | + | type | String? | yes | | + | category | String? | yes | | + +--- + + + + + #### [BlocksProps](#BlocksProps) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | label | String? | yes | | + | type | String? | yes | | + +--- + + + diff --git a/documentation/platform/USER.md b/documentation/platform/USER.md new file mode 100644 index 0000000000..55ed2f6cba --- /dev/null +++ b/documentation/platform/USER.md @@ -0,0 +1,1793 @@ + + + + +##### [Back to Platform docs](./README.md) + +## User Methods +Authentication Service +* [getCustomers](#getcustomers) +* [searchUsers](#searchusers) +* [createUser](#createuser) +* [updateUser](#updateuser) +* [createUserSession](#createusersession) +* [getPlatformConfig](#getplatformconfig) +* [updatePlatformConfig](#updateplatformconfig) + + + +## Methods with example and description + + +#### getCustomers +Get a list of customers + + + + +```swift +client.application("").user.getCustomers(q: q, pageSize: pageSize, pageNo: pageNo) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| q | String? | no | The search query. Mobile number or email ID of a customer. | +| pageSize | Int? | no | The number of items to retrieve in each page. Default value is 10. | +| pageNo | Int? | no | The page number to navigate through the given set of results. Default value is 1. | + + + +Use this API to retrieve a list of customers who have registered in the application. + +*Returned Response:* + + + + +[CustomerListResponseSchema](#CustomerListResponseSchema) + +Success. Refer `CustomerListResponseSchema` for more details. + + + + +
    +  Examples: + + +
    +  Success + +```json +{ + "value": { + "items": [ + { + "_id": "000000000000000023106198", + "gender": "male", + "roles": [ + "Ark-Qnatemplate-FullAccess" + ], + "active": true, + "uid": "23106198", + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "raaz.crzy@gmail.com" + } + ], + "username": "raaz_crzy_gmail_com_63747_23106198", + "__v": 7, + "debug": { + "source": "grimlock", + "platform": "000000000000000000000003" + }, + "dob": "1995-07-23T00:00:00.000Z", + "id": "000000000000000023106198", + "account_type": "user", + "profile_pic_url": "https://hdn-1.fynd.com/user/profile/original/000000000000000023106198/1586498418772.jpg", + "first_name": "Prince", + "last_name": "Raj", + "phone_numbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "7008963113", + "country_code": 91 + } + ], + "created_at": "2019-05-15T14:07:52.872Z", + "updated_at": "2020-09-21T06:38:41.388Z", + "has_old_password_hash": false + } + ], + "page": { + "type": "number", + "current": 1, + "size": 10, + "item_total": 0, + "has_next": false + } + } +} +``` +
    + +
    + + + + + + + + + +--- + + +#### searchUsers +Search an existing user. + + + + +```swift +client.application("").user.searchUsers(q: q) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| q | [String: Any]? | no | The search query. Mobile number or email ID of a customer. | + + + +Use this API to retrieve an existing user from a list. + +*Returned Response:* + + + + +[UserSearchResponseSchema](#UserSearchResponseSchema) + +Success. Returns first name, last name, emails, phone number and gender of the user. Refer `UserSearchResponseSchema` for more details. + + + + +
    +  Example: + +```json +{ + "users": [ + { + "_id": "5e68af49cfa09bf7233022f1", + "gender": "male", + "active": true, + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "akashmane@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@uniket.store" + } + ], + "uid": "61", + "account_type": "user", + "first_name": "Akash", + "last_name": "Mane", + "phone_numbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "8652523958", + "country_code": 91 + } + ], + "created_at": "2020-03-11T09:28:41.982Z", + "updated_at": "2020-03-11T09:28:41.982Z" + } + ] +} +``` +
    + + + + + + + + + +--- + + +#### createUser +Create user + + + + +```swift +client.application("").user.createUser(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CreateUserRequestSchema | yes | Request body | + + +Create user + +*Returned Response:* + + + + +[CreateUserResponseSchema](#CreateUserResponseSchema) + +User create + + + + +
    +  Example: + +```json +{ + "user": { + "_id": "5e68af49cfa09bf7233022f1", + "gender": "male", + "active": true, + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "akashmane@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@uniket.store" + } + ], + "uid": "61", + "account_type": "user", + "first_name": "Akash", + "last_name": "Mane", + "phone_numbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "8652523958", + "country_code": 91 + } + ], + "meta": {}, + "created_at": "2020-03-11T09:28:41.982Z", + "updated_at": "2020-03-11T09:28:41.982Z" + } +} +``` +
    + + + + + + + + + +--- + + +#### updateUser +Update user + + + + +```swift +client.application("").user.updateUser(userId: userId, body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| userId | String | yes | User ID | +| body | UpdateUserRequestSchema | yes | Request body | + + +Update user + +*Returned Response:* + + + + +[CreateUserResponseSchema](#CreateUserResponseSchema) + +User update + + + + +
    +  Example: + +```json +{ + "user": { + "_id": "5e68af49cfa09bf7233022f1", + "gender": "male", + "active": true, + "emails": [ + { + "active": true, + "primary": true, + "verified": true, + "email": "akashmane@gofynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@fynd.com" + }, + { + "active": true, + "primary": false, + "verified": true, + "email": "akashmane@uniket.store" + } + ], + "uid": "61", + "account_type": "user", + "first_name": "Akash", + "last_name": "Mane", + "phone_numbers": [ + { + "active": true, + "primary": true, + "verified": true, + "phone": "8652523958", + "country_code": 91 + } + ], + "meta": {}, + "created_at": "2020-03-11T09:28:41.982Z", + "updated_at": "2020-03-11T09:28:41.982Z" + } +} +``` +
    + + + + + + + + + +--- + + +#### createUserSession +Create user session + + + + +```swift +client.application("").user.createUserSession(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | CreateUserSessionRequestSchema | yes | Request body | + + +Create user session + +*Returned Response:* + + + + +[CreateUserSessionResponseSchema](#CreateUserSessionResponseSchema) + +Create user session + + + + +
    +  Example: + +```json +{ + "domain": "vinit.com", + "max_age": 4555555, + "secure": true, + "http_only": true, + "cookie": { + "f.session": "s%3A-LrEF5FVR8jrT5DCtCHSbAy7JFyX-f9T.uXOQwzje8nOfx4ODANrLi4yNX5fW2W5kLQ2rkBdO2xE" + } +} +``` +
    + + + + + + + + + +--- + + +#### getPlatformConfig +Get platform configurations + + + + +```swift +client.application("").user.getPlatformConfig() { (response, error) in + // Use response +} +``` + + + + + + +Use this API to get all the platform configurations such as mobile image, desktop image, social logins, and all other text. + +*Returned Response:* + + + + +[PlatformSchema](#PlatformSchema) + +Success. Returns a JSON object containing the all the platform configurations. Refer `PlatformSchema` for more details. + + + + +
    +  Example: + +```json +{ + "active": true, + "mobile_image": "", + "desktop_image": "", + "social": { + "facebook": true, + "google": true, + "account_kit": true + }, + "flash_card": { + "text": "", + "text_color": "#FFFFFF", + "background_color": "#EF5350" + }, + "register": true, + "forgot_password": true, + "login": { + "password": true, + "otp": true + }, + "skip_captcha": false, + "display": "Fynd", + "subtext": "Login to Fynd", + "name": "Fynd", + "meta": {}, + "required_fields": { + "email": { + "is_required": false, + "level": "hard" + }, + "mobile": { + "is_required": true, + "level": "hard" + } + }, + "register_required_fields": { + "email": { + "is_required": false, + "level": "hard" + }, + "mobile": { + "is_required": true, + "level": "hard" + } + }, + "skip_login": false, + "look_and_feel": { + "background_color": "#F5F5F5", + "card_position": "center" + }, + "social_tokens": { + "google": { + "appId": "token_123" + }, + "facebook": { + "appId": "token_123" + }, + "account_kit": { + "appId": "token_123" + } + }, + "_id": "5e04a5e5220bc15839ad9bc0", + "created_at": "2019-12-26T12:21:57.878Z", + "updated_at": "2020-08-13T14:31:09.878Z", + "__v": 0 +} +``` +
    + + + + + + + + + +--- + + +#### updatePlatformConfig +Update platform configurations + + + + +```swift +client.application("").user.updatePlatformConfig(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | PlatformSchema | yes | Request body | + + +Use this API to edit the existing platform configurations such as mobile image, desktop image, social logins, and all other text. + +*Returned Response:* + + + + +[PlatformSchema](#PlatformSchema) + +Success. Returns a JSON object with the updated platform configurations. Refer `PlatformSchema` for more details. + + + + +
    +  Example: + +```json +{ + "active": true, + "mobile_image": "", + "desktop_image": "", + "social": { + "facebook": true, + "google": true, + "account_kit": true + }, + "flash_card": { + "text": "", + "text_color": "#FFFFFF", + "background_color": "#EF5350" + }, + "register": true, + "forgot_password": true, + "login": { + "password": true, + "otp": true + }, + "skip_captcha": false, + "display": "Fynd", + "subtext": "Login to Fynd", + "name": "Fynd", + "meta": {}, + "required_fields": { + "email": { + "is_required": false, + "level": "hard" + }, + "mobile": { + "is_required": true, + "level": "hard" + } + }, + "register_required_fields": { + "email": { + "is_required": false, + "level": "hard" + }, + "mobile": { + "is_required": true, + "level": "hard" + } + }, + "skip_login": false, + "look_and_feel": { + "background_color": "#F5F5F5", + "card_position": "center" + }, + "social_tokens": { + "google": { + "appId": "token_123" + }, + "facebook": { + "appId": "token_123" + }, + "account_kit": { + "appId": "token_123" + } + }, + "_id": "5e04a5e5220bc15839ad9bc0", + "created_at": "2019-12-26T12:21:57.878Z", + "updated_at": "2020-08-13T14:31:09.878Z", + "__v": 0 +} +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [EditEmailRequestSchema](#EditEmailRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + +--- + + + + + #### [SendVerificationLinkMobileRequestSchema](#SendVerificationLinkMobileRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | verified | Bool? | yes | | + | active | Bool? | yes | | + | countryCode | String? | yes | | + | phone | String? | yes | | + | primary | Bool? | yes | | + +--- + + + + + #### [EditMobileRequestSchema](#EditMobileRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | countryCode | String? | yes | | + | phone | String? | yes | | + +--- + + + + + #### [EditProfileRequestSchema](#EditProfileRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | firstName | String? | yes | | + | lastName | String? | yes | | + | mobile | [EditProfileMobileSchema](#EditProfileMobileSchema)? | yes | | + | countryCode | String? | yes | | + | email | String? | yes | | + | gender | String? | yes | | + | dob | String? | yes | | + | profilePicUrl | String? | yes | | + | androidHash | String? | yes | | + | sender | String? | yes | | + | registerToken | String? | yes | | + +--- + + + + + #### [EditProfileMobileSchema](#EditProfileMobileSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | phone | String? | yes | | + | countryCode | String? | yes | | + +--- + + + + + #### [SendEmailOtpRequestSchema](#SendEmailOtpRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + | action | String? | yes | | + | token | String? | yes | | + | registerToken | String? | yes | | + +--- + + + + + #### [VerifyEmailOtpRequestSchema](#VerifyEmailOtpRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + | action | String? | yes | | + | registerToken | String? | yes | | + | otp | String? | yes | | + +--- + + + + + #### [VerifyOtpRequestSchema](#VerifyOtpRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | requestId | String? | yes | | + | registerToken | String? | yes | | + | otp | String? | yes | | + +--- + + + + + #### [SendMobileOtpRequestSchema](#SendMobileOtpRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | mobile | String? | yes | | + | countryCode | String? | yes | | + | action | String? | yes | | + | token | String? | yes | | + | androidHash | String? | yes | | + | force | String? | yes | | + | captchaCode | String? | yes | | + +--- + + + + + #### [UpdatePasswordRequestSchema](#UpdatePasswordRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | oldPassword | String? | yes | | + | newPassword | String? | yes | | + +--- + + + + + #### [FormRegisterRequestSchema](#FormRegisterRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | firstName | String? | yes | | + | lastName | String? | yes | | + | gender | String? | yes | | + | email | String? | yes | | + | password | String? | yes | | + | phone | [FormRegisterRequestSchemaPhone](#FormRegisterRequestSchemaPhone)? | yes | | + | registerToken | String? | yes | | + +--- + + + + + #### [TokenRequestBodySchema](#TokenRequestBodySchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | token | String? | yes | | + +--- + + + + + #### [ForgotPasswordRequestSchema](#ForgotPasswordRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | code | String? | yes | | + | password | String? | yes | | + +--- + + + + + #### [CodeRequestBodySchema](#CodeRequestBodySchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | code | String? | yes | | + +--- + + + + + #### [SendResetPasswordEmailRequestSchema](#SendResetPasswordEmailRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + | captchaCode | String? | yes | | + +--- + + + + + #### [PasswordLoginRequestSchema](#PasswordLoginRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | captchaCode | String? | yes | | + | password | String? | yes | | + | username | String? | yes | | + +--- + + + + + #### [SendOtpRequestSchema](#SendOtpRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | countryCode | String? | yes | | + | captchaCode | String? | yes | | + | mobile | String? | yes | | + +--- + + + + + #### [OAuthRequestSchema](#OAuthRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isSignedIn | Bool? | yes | | + | oauth2 | [OAuthRequestSchemaOauth2](#OAuthRequestSchemaOauth2)? | yes | | + | profile | [OAuthRequestSchemaProfile](#OAuthRequestSchemaProfile)? | yes | | + +--- + + + + + #### [OAuthRequestAppleSchema](#OAuthRequestAppleSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | userIdentifier | String? | yes | | + | oauth | [OAuthRequestAppleSchemaOauth](#OAuthRequestAppleSchemaOauth)? | yes | | + | profile | [OAuthRequestAppleSchemaProfile](#OAuthRequestAppleSchemaProfile)? | yes | | + +--- + + + + + #### [UserObjectSchema](#UserObjectSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [UserSchema](#UserSchema)? | yes | | + +--- + + + + + #### [AuthSuccess](#AuthSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | registerToken | String? | yes | | + | userExists | Bool? | yes | | + | user | [UserSchema](#UserSchema)? | yes | | + +--- + + + + + #### [SendOtpResponse](#SendOtpResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | resendTimer | Int? | yes | | + | resendToken | String? | yes | | + | success | Bool? | yes | | + | requestId | String? | yes | | + | message | String? | yes | | + | mobile | String? | yes | | + | countryCode | String? | yes | | + | email | String? | yes | | + | resendEmailToken | String? | yes | | + | registerToken | String? | yes | | + | verifyEmailOtp | Bool? | yes | | + | verifyMobileOtp | Bool? | yes | | + | userExists | Bool? | yes | | + +--- + + + + + #### [ProfileEditSuccess](#ProfileEditSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [UserSchema](#UserSchema)? | yes | | + | resendEmailToken | String? | yes | | + | registerToken | String? | yes | | + | userExists | Bool? | yes | | + | verifyEmailLink | Bool? | yes | | + | verifyEmailOtp | Bool? | yes | | + | verifyMobileOtp | Bool? | yes | | + | email | String? | yes | | + | requestId | String? | yes | | + +--- + + + + + #### [LoginSuccess](#LoginSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [UserSchema](#UserSchema)? | yes | | + | requestId | String? | yes | | + | registerToken | String? | yes | | + +--- + + + + + #### [VerifyOtpSuccess](#VerifyOtpSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [UserSchema](#UserSchema)? | yes | | + | userExists | Bool? | yes | | + | registerToken | String? | yes | | + +--- + + + + + #### [ResetPasswordSuccess](#ResetPasswordSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | status | String? | yes | | + +--- + + + + + #### [RegisterFormSuccess](#RegisterFormSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + | resendTimer | Int? | yes | | + | resendToken | String? | yes | | + | resendEmailToken | String? | yes | | + | registerToken | String? | yes | | + | success | Bool? | yes | | + | requestId | String? | yes | | + | message | String? | yes | | + | mobile | String? | yes | | + | countryCode | String? | yes | | + | verifyEmailOtp | Bool? | yes | | + | verifyMobileOtp | Bool? | yes | | + | userExists | Bool? | yes | | + +--- + + + + + #### [VerifyEmailSuccess](#VerifyEmailSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [HasPasswordSuccess](#HasPasswordSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | result | Bool? | yes | | + +--- + + + + + #### [LogoutSuccess](#LogoutSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | logout | Bool? | yes | | + +--- + + + + + #### [OtpSuccess](#OtpSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | resendTimer | Int? | yes | | + | resendToken | String? | yes | | + | registerToken | String? | yes | | + | success | Bool? | yes | | + | requestId | String? | yes | | + | message | String? | yes | | + | mobile | String? | yes | | + | countryCode | String? | yes | | + +--- + + + + + #### [EmailOtpSuccess](#EmailOtpSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | success | Bool? | yes | | + +--- + + + + + #### [SessionListSuccess](#SessionListSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | sessions | [String]? | yes | | + +--- + + + + + #### [VerifyMobileOTPSuccess](#VerifyMobileOTPSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [UserSchema](#UserSchema)? | yes | | + | verifyMobileLink | Bool? | yes | | + +--- + + + + + #### [VerifyEmailOTPSuccess](#VerifyEmailOTPSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [UserSchema](#UserSchema)? | yes | | + | verifyEmailLink | Bool? | yes | | + +--- + + + + + #### [SendMobileVerifyLinkSuccess](#SendMobileVerifyLinkSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | verifyMobileLink | Bool? | yes | | + +--- + + + + + #### [SendEmailVerifyLinkSuccess](#SendEmailVerifyLinkSuccess) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | verifyEmailLink | Bool? | yes | | + +--- + + + + + #### [UserSearchResponseSchema](#UserSearchResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | users | [[UserSchema](#UserSchema)]? | yes | | + +--- + + + + + #### [CustomerListResponseSchema](#CustomerListResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[UserSchema](#UserSchema)]? | yes | | + | page | [PaginationSchema](#PaginationSchema)? | yes | | + +--- + + + + + #### [PaginationSchema](#PaginationSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | size | Int? | yes | | + | itemTotal | Int? | yes | | + | hasNext | Bool? | yes | | + | type | String? | yes | | + | current | Int? | yes | | + +--- + + + + + #### [UnauthorizedSchema](#UnauthorizedSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [UnauthenticatedSchema](#UnauthenticatedSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | authenticated | Bool? | yes | | + +--- + + + + + #### [NotFoundSchema](#NotFoundSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [AuthenticationInternalServerErrorSchema](#AuthenticationInternalServerErrorSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [AuthenticationApiErrorSchema](#AuthenticationApiErrorSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [ProfileEditSuccessSchema](#ProfileEditSuccessSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + | verifyEmailOtp | Bool? | yes | | + | verifyEmailLink | Bool? | yes | | + | verifyMobileOtp | Bool? | yes | | + | user | String? | yes | | + | registerToken | String? | yes | | + | userExists | Bool? | yes | | + +--- + + + + + #### [FormRegisterRequestSchemaPhone](#FormRegisterRequestSchemaPhone) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | countryCode | String? | yes | | + | mobile | String? | yes | | + +--- + + + + + #### [OAuthRequestSchemaOauth2](#OAuthRequestSchemaOauth2) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | accessToken | String? | yes | | + | expiry | Int? | yes | | + | refreshToken | String? | yes | | + +--- + + + + + #### [OAuthRequestSchemaProfile](#OAuthRequestSchemaProfile) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | lastName | String? | yes | | + | image | String? | yes | | + | id | String? | yes | | + | email | String? | yes | | + | fullName | String? | yes | | + | firstName | String? | yes | | + +--- + + + + + #### [OAuthRequestAppleSchemaOauth](#OAuthRequestAppleSchemaOauth) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | identityToken | String? | yes | | + +--- + + + + + #### [OAuthRequestAppleSchemaProfile](#OAuthRequestAppleSchemaProfile) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | lastName | String? | yes | | + | fullName | String? | yes | | + | firstName | String? | yes | | + +--- + + + + + #### [AuthSuccessUser](#AuthSuccessUser) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | firstName | String? | yes | | + | lastName | String? | yes | | + | debug | [AuthSuccessUserDebug](#AuthSuccessUserDebug)? | yes | | + | active | Bool? | yes | | + | emails | [AuthSuccessUserEmails](#AuthSuccessUserEmails)? | yes | | + +--- + + + + + #### [AuthSuccessUserDebug](#AuthSuccessUserDebug) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | platform | String? | yes | | + +--- + + + + + #### [AuthSuccessUserEmails](#AuthSuccessUserEmails) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | String? | yes | | + | verified | Bool? | yes | | + | primary | Bool? | yes | | + | active | Bool? | yes | | + +--- + + + + + #### [CreateUserRequestSchema](#CreateUserRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | phoneNumber | String | no | | + | email | String? | yes | | + | firstName | String? | yes | | + | lastName | String? | yes | | + | gender | String? | yes | | + | username | String | no | | + | meta | [String: Any]? | yes | | + +--- + + + + + #### [CreateUserResponseSchema](#CreateUserResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | user | [UserSchema](#UserSchema)? | yes | | + +--- + + + + + #### [CreateUserSessionRequestSchema](#CreateUserSessionRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | domain | String? | yes | | + | maxAge | Double? | yes | | + | userId | String? | yes | | + +--- + + + + + #### [CreateUserSessionResponseSchema](#CreateUserSessionResponseSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | domain | String? | yes | | + | maxAge | Double? | yes | | + | secure | Bool? | yes | | + | httpOnly | Bool? | yes | | + | cookie | [String: Any]? | yes | | + +--- + + + + + #### [PlatformSchema](#PlatformSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | display | String? | yes | | + | lookAndFeel | [LookAndFeel](#LookAndFeel)? | yes | | + | updatedAt | String? | yes | | + | active | Bool? | yes | | + | forgotPassword | Bool? | yes | | + | login | [Login](#Login)? | yes | | + | skipCaptcha | Bool? | yes | | + | name | String? | yes | | + | meta | [MetaSchema](#MetaSchema)? | yes | | + | id | String? | yes | | + | social | [Social](#Social)? | yes | | + | requiredFields | [RequiredFields](#RequiredFields)? | yes | | + | registerRequiredFields | [RegisterRequiredFields](#RegisterRequiredFields)? | yes | | + | skipLogin | Bool? | yes | | + | flashCard | [FlashCard](#FlashCard)? | yes | | + | subtext | String? | yes | | + | socialTokens | [SocialTokens](#SocialTokens)? | yes | | + | createdAt | String? | yes | | + | register | Bool? | yes | | + | mobileImage | String? | yes | | + | desktopImage | String? | yes | | + +--- + + + + + #### [LookAndFeel](#LookAndFeel) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | cardPosition | String? | yes | | + | backgroundColor | String? | yes | | + +--- + + + + + #### [Login](#Login) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | password | Bool? | yes | | + | otp | Bool? | yes | | + +--- + + + + + #### [MetaSchema](#MetaSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | fyndDefault | Bool? | yes | | + +--- + + + + + #### [Social](#Social) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | accountKit | Bool? | yes | | + | facebook | Bool? | yes | | + | google | Bool? | yes | | + | apple | Bool? | yes | | + +--- + + + + + #### [RequiredFields](#RequiredFields) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | [PlatformEmail](#PlatformEmail)? | yes | | + | mobile | [PlatformMobile](#PlatformMobile)? | yes | | + +--- + + + + + #### [PlatformEmail](#PlatformEmail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isRequired | Bool? | yes | | + | level | String? | yes | | + +--- + + + + + #### [PlatformMobile](#PlatformMobile) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isRequired | Bool? | yes | | + | level | String? | yes | | + +--- + + + + + #### [RegisterRequiredFields](#RegisterRequiredFields) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | email | [RegisterRequiredFieldsEmail](#RegisterRequiredFieldsEmail)? | yes | | + | mobile | [RegisterRequiredFieldsMobile](#RegisterRequiredFieldsMobile)? | yes | | + +--- + + + + + #### [RegisterRequiredFieldsEmail](#RegisterRequiredFieldsEmail) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isRequired | Bool? | yes | | + | level | String? | yes | | + +--- + + + + + #### [RegisterRequiredFieldsMobile](#RegisterRequiredFieldsMobile) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | isRequired | Bool? | yes | | + | level | String? | yes | | + +--- + + + + + #### [FlashCard](#FlashCard) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | text | String? | yes | | + | textColor | String? | yes | | + | backgroundColor | String? | yes | | + +--- + + + + + #### [SocialTokens](#SocialTokens) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | facebook | [Facebook](#Facebook)? | yes | | + | accountKit | [Accountkit](#Accountkit)? | yes | | + | google | [Google](#Google)? | yes | | + +--- + + + + + #### [Facebook](#Facebook) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appId | String? | yes | | + +--- + + + + + #### [Accountkit](#Accountkit) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appId | String? | yes | | + +--- + + + + + #### [Google](#Google) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | appId | String? | yes | | + +--- + + + + + #### [UpdateUserRequestSchema](#UpdateUserRequestSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | firstName | String? | yes | | + | lastName | String? | yes | | + | gender | String? | yes | | + | meta | [String: Any]? | yes | | + +--- + + + + + #### [UserSchema](#UserSchema) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | firstName | String? | yes | | + | meta | [String: Any]? | yes | | + | lastName | String? | yes | | + | phoneNumbers | [[PhoneNumber](#PhoneNumber)]? | yes | | + | emails | [[Email](#Email)]? | yes | | + | gender | String? | yes | | + | dob | String? | yes | | + | active | Bool? | yes | | + | profilePicUrl | String? | yes | | + | username | String? | yes | | + | accountType | String? | yes | | + | uid | String? | yes | | + | debug | [Debug](#Debug)? | yes | | + | hasOldPasswordHash | Bool? | yes | | + | id | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + +--- + + + + + #### [PhoneNumber](#PhoneNumber) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | active | Bool? | yes | | + | primary | Bool? | yes | | + | verified | Bool? | yes | | + | phone | String? | yes | | + | countryCode | Int? | yes | | + +--- + + + + + #### [Email](#Email) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | primary | Bool? | yes | | + | verified | Bool? | yes | | + | email | String? | yes | | + | active | Bool? | yes | | + +--- + + + + + #### [Debug](#Debug) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | source | String? | yes | | + | platform | String? | yes | | + +--- + + + diff --git a/documentation/platform/WEBHOOK.md b/documentation/platform/WEBHOOK.md new file mode 100644 index 0000000000..6866fd8067 --- /dev/null +++ b/documentation/platform/WEBHOOK.md @@ -0,0 +1,572 @@ + + + + +##### [Back to Platform docs](./README.md) + +## Webhook Methods +Webhook dispatcher with retry and one event to many subscriber vice versa +* [getSubscribersByCompany](#getsubscribersbycompany) +* [registerSubscriberToEvent](#registersubscribertoevent) +* [updateSubscriberConfig](#updatesubscriberconfig) +* [getSubscribersByExtensionId](#getsubscribersbyextensionid) +* [getSubscriberById](#getsubscriberbyid) +* [fetchAllEventConfigurations](#fetchalleventconfigurations) + + + +## Methods with example and description + + +#### getSubscribersByCompany +Get Subscribers By Company ID + + + + +```swift +client.webhook.getSubscribersByCompany(pageNo: pageNo, pageSize: pageSize, extensionId: extensionId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Page Number | +| pageSize | Int? | no | Page Size | +| extensionId | String? | no | Extension ID | + + + +Get Subscribers By CompanyId + +*Returned Response:* + + + + +[SubscriberResponse](#SubscriberResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### registerSubscriberToEvent +Register Subscriber + + + + +```swift +client.webhook.registerSubscriberToEvent(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | SubscriberConfig | yes | Request body | + + +Register Subscriber + +*Returned Response:* + + + + +[SubscriberConfig](#SubscriberConfig) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### updateSubscriberConfig +Update Subscriber + + + + +```swift +client.webhook.updateSubscriberConfig(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | SubscriberConfig | yes | Request body | + + +Update Subscriber + +*Returned Response:* + + + + +[SubscriberConfig](#SubscriberConfig) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getSubscribersByExtensionId +Get Subscribers By Extension ID + + + + +```swift +client.webhook.getSubscribersByExtensionId(pageNo: pageNo, pageSize: pageSize, extensionId: extensionId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| pageNo | Int? | no | Page Number | +| pageSize | Int? | no | Page Size | +| extensionId | String | yes | Extension ID | + + + +Get Subscribers By ExtensionID + +*Returned Response:* + + + + +[SubscriberConfigList](#SubscriberConfigList) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### getSubscriberById +Get Subscriber By Subscriber ID + + + + +```swift +client.webhook.getSubscriberById(subscriberId: subscriberId) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| subscriberId | Int | yes | Subscriber ID | + + + +Get Subscriber By Subscriber ID + +*Returned Response:* + + + + +[SubscriberResponse](#SubscriberResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### fetchAllEventConfigurations +Get All Webhook Events + + + + +```swift +client.webhook.fetchAllEventConfigurations() { (response, error) in + // Use response +} +``` + + + + + + +Get All Webhook Events + +*Returned Response:* + + + + +[EventConfigResponse](#EventConfigResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [EventConfig](#EventConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | eventName | String? | yes | | + | eventType | String? | yes | | + | eventCategory | String? | yes | | + | version | String? | yes | | + | displayName | String? | yes | | + | description | String? | yes | | + | createdOn | String? | yes | | + +--- + + + + + #### [EventConfigList](#EventConfigList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[EventConfig](#EventConfig)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [EventConfigResponse](#EventConfigResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | eventConfigs | [[EventConfig](#EventConfig)]? | yes | | + +--- + + + + + #### [SubscriberConfigList](#SubscriberConfigList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[SubscriberResponse](#SubscriberResponse)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + | hasNext | Bool? | yes | | + | current | Int? | yes | | + | type | String | no | | + | size | Int? | yes | | + +--- + + + + + #### [EventProcessedStatus](#EventProcessedStatus) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | subscriberId | String? | yes | | + | attempt | Int? | yes | | + | responseCode | String? | yes | | + | responseMessage | String? | yes | | + | createdOn | String? | yes | | + | processedOn | String? | yes | | + | status | Bool? | yes | | + +--- + + + + + #### [EventPayload](#EventPayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | eventTraceId | String? | yes | | + | messageId | String? | yes | | + | eventName | String? | yes | | + | eventType | String? | yes | | + | version | String? | yes | | + | status | Bool? | yes | | + +--- + + + + + #### [SubscriberConfig](#SubscriberConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | name | String? | yes | | + | webhookUrl | String? | yes | | + | association | [Association](#Association)? | yes | | + | customHeaders | [String: Any]? | yes | | + | status | [SubscriberStatus](#SubscriberStatus)? | yes | | + | emailId | String? | yes | | + | authMeta | [AuthMeta](#AuthMeta)? | yes | | + | eventId | [Int]? | yes | | + +--- + + + + + #### [SubscriberResponse](#SubscriberResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | name | String? | yes | | + | webhookUrl | String? | yes | | + | association | [Association](#Association)? | yes | | + | customHeaders | [String: Any]? | yes | | + | emailId | String? | yes | | + | status | [SubscriberStatus](#SubscriberStatus)? | yes | | + | authMeta | [AuthMeta](#AuthMeta)? | yes | | + | createdOn | String? | yes | | + | updatedOn | String? | yes | | + | eventConfigs | [[EventConfig](#EventConfig)]? | yes | | + +--- + + + + + #### [SubscriberEvent](#SubscriberEvent) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | subscriberId | Int? | yes | | + | eventId | Int? | yes | | + | createdDate | String? | yes | | + +--- + + + + + #### [AuthMeta](#AuthMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | secret | String? | yes | | + +--- + + + + + #### [Association](#Association) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | companyId | Int? | yes | | + | applicationId | [String]? | yes | | + | extensionId | String? | yes | | + | criteria | String? | yes | | + +--- + + + + + #### [EventConfigBase](#EventConfigBase) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | eventName | String? | yes | | + | eventType | String? | yes | | + | eventCategory | String? | yes | | + | version | String? | yes | | + +--- + + + + +### Enums + + + + + + #### [SubscriberStatus](#SubscriberStatus) + Type : string + + | Name | Value | Description | + | ---- | ----- | ----------- | + | active | active | Status is active | + | inactive | inactive | Status is inactive | + | blocked | blocked | Subscriber is blocked by system due to multiple failed delivery attempts. | + +--- + + + + + diff --git a/documentation/public/CONFIGURATION.md b/documentation/public/CONFIGURATION.md new file mode 100644 index 0000000000..8f0f7ba1ec --- /dev/null +++ b/documentation/public/CONFIGURATION.md @@ -0,0 +1,440 @@ + + + + +##### [Back to Public docs](./README.md) + +## Configuration Methods +Application configuration apis +* [searchApplication](#searchapplication) +* [getLocations](#getlocations) + + + +## Methods with example and description + + +#### searchApplication +Search Application + + + + +```swift +configuration.searchApplication(authorization: authorization, query: query) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| authorization | String? | no | | +| query | String? | no | Provide application name | + + + +Provide application name or domain url + +*Returned Response:* + + + + +[ApplicationResponse](#ApplicationResponse) + +Success + + + + +
    +  Example: + +```json +{ + "application": { + "website": { + "enabled": true, + "basepath": "/" + }, + "cors": { + "domains": [] + }, + "auth": { + "enabled": true + }, + "description": "test", + "channel_type": "store", + "cache_ttl": -1, + "internal": false, + "is_active": true, + "mode": "live", + "_id": "620b931ee7bfb11f910bf4a3", + "company_id": 2, + "name": "test", + "owner": "5b9b98150df588546aaea6d2", + "logo": { + "secure_url": "https://hdn-1.addsale.com/x0/company/164/applications/5efc9913f474c329718e3690/application/pictures/free-logo/original/olqHM8LNr-JioMart-Groceries.png" + }, + "favicon": { + "secure_url": "https://hdn-1.addsale.com/x0/company/164/applications/5efc9913f474c329718e3690/application/pictures/free-logo/original/olqHM8LNr-JioMart-Groceries.png" + }, + "banner": { + "secure_url": "https://hdn-1.addsale.com/x0/company/164/applications/5efc9913f474c329718e3690/application/pictures/landscape-banner/original/D2fr98CUH-JioMart-Groceries.png" + }, + "token": "tPQv0nc23", + "tokens": [ + { + "token": "tPQv0nc23", + "created_at": "2022-02-15T11:48:46.909Z" + } + ], + "domains": [ + { + "verified": true, + "is_primary": true, + "is_shortlink": true, + "_id": "620b931ee7bfb11f910bf4a4", + "name": "qckvv5lhp.hostfynd.dev" + } + ], + "redirections": [], + "meta": [], + "created_at": "2022-02-15T11:48:46.909Z", + "modified_at": "2022-02-15T11:48:46.909Z", + "__v": 0, + "domain": { + "verified": true, + "is_primary": true, + "is_shortlink": true, + "_id": "620b931ee7bfb11f910bf4a4", + "name": "qckvv5lhp.hostfynd.dev" + }, + "id": "620b931ee7bfb11f910bf4a3" + } +} +``` +
    + + + + + + + + + +--- + + +#### getLocations +Get countries, states, cities + + + + +```swift +configuration.getLocations(locationType: locationType, id: id) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| locationType | String? | no | Provide location type to query on. Possible values : country, state, city | +| id | String? | no | Field is optional when location_type is country. If querying for state, provide id of country. If querying for city, provide id of state. | + + + + + +*Returned Response:* + + + + +[Locations](#Locations) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [ApplicationResponse](#ApplicationResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | application | [Application](#Application)? | yes | | + +--- + + + + + #### [Currency](#Currency) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | String? | yes | | + | isActive | Bool? | yes | | + | name | String? | yes | | + | code | String? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | decimalDigits | Int? | yes | | + | symbol | String? | yes | | + +--- + + + + + #### [Domain](#Domain) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | verified | Bool? | yes | | + | isPrimary | Bool? | yes | | + | isShortlink | Bool? | yes | | + | id | String? | yes | | + | name | String? | yes | | + +--- + + + + + #### [ApplicationWebsite](#ApplicationWebsite) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + | basepath | String? | yes | | + +--- + + + + + #### [ApplicationCors](#ApplicationCors) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | domains | [String]? | yes | | + +--- + + + + + #### [ApplicationAuth](#ApplicationAuth) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | enabled | Bool? | yes | | + +--- + + + + + #### [ApplicationRedirections](#ApplicationRedirections) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | redirectFrom | String? | yes | | + | redirectTo | String? | yes | | + | type | String? | yes | | + +--- + + + + + #### [ApplicationMeta](#ApplicationMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | value | String? | yes | | + +--- + + + + + #### [SecureUrl](#SecureUrl) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | secureUrl | String? | yes | | + +--- + + + + + #### [Application](#Application) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | website | [ApplicationWebsite](#ApplicationWebsite)? | yes | | + | cors | [ApplicationCors](#ApplicationCors)? | yes | | + | auth | [ApplicationAuth](#ApplicationAuth)? | yes | | + | description | String? | yes | | + | channelType | String? | yes | | + | cacheTtl | Int? | yes | | + | isInternal | Bool? | yes | | + | isActive | Bool? | yes | | + | id | String? | yes | | + | name | String? | yes | | + | owner | String? | yes | | + | companyId | Int? | yes | | + | token | String? | yes | | + | redirections | [[ApplicationRedirections](#ApplicationRedirections)]? | yes | | + | meta | [[ApplicationMeta](#ApplicationMeta)]? | yes | | + | createdAt | String? | yes | | + | updatedAt | String? | yes | | + | v | Int? | yes | | + | banner | [SecureUrl](#SecureUrl)? | yes | | + | logo | [SecureUrl](#SecureUrl)? | yes | | + | favicon | [SecureUrl](#SecureUrl)? | yes | | + | domains | [[Domain](#Domain)]? | yes | | + | appType | String? | yes | | + | mobileLogo | [SecureUrl](#SecureUrl)? | yes | | + | domain | [Domain](#Domain)? | yes | | + +--- + + + + + #### [NotFound](#NotFound) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | | + +--- + + + + + #### [BadRequest](#BadRequest) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | message | String? | yes | Failure message. | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String | no | | + | size | Int? | yes | | + | current | Int? | yes | | + | hasNext | Bool? | yes | | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + +--- + + + + + #### [LocationDefaultLanguage](#LocationDefaultLanguage) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | code | String? | yes | | + +--- + + + + + #### [LocationDefaultCurrency](#LocationDefaultCurrency) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | name | String? | yes | | + | symbol | String? | yes | | + | code | String? | yes | | + +--- + + + + + #### [LocationCountry](#LocationCountry) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | capital | String? | yes | | + | currency | String? | yes | | + | iso2 | String? | yes | | + | iso3 | String? | yes | | + | name | String? | yes | | + | parent | String? | yes | | + | phoneCode | String? | yes | | + | type | String? | yes | | + | uid | Int? | yes | | + | v | Int? | yes | | + | id | String? | yes | | + | defaultCurrency | [LocationDefaultCurrency](#LocationDefaultCurrency)? | yes | | + | defaultLanguage | [LocationDefaultLanguage](#LocationDefaultLanguage)? | yes | | + +--- + + + + + #### [Locations](#Locations) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[String: Any]]? | yes | | + +--- + + + diff --git a/documentation/public/README.md b/documentation/public/README.md new file mode 100644 index 0000000000..db30ee6640 --- /dev/null +++ b/documentation/public/README.md @@ -0,0 +1,8 @@ +##### [Back to home](../../README.md) + +# FDK Public API Documentation + + +* [Configuration](CONFIGURATION.md) - Application configuration apis +* [Webhook](WEBHOOK.md) - Webhook dispatcher with retry and one event to many subscriber vice versa + diff --git a/documentation/public/WEBHOOK.md b/documentation/public/WEBHOOK.md new file mode 100644 index 0000000000..e6555c1120 --- /dev/null +++ b/documentation/public/WEBHOOK.md @@ -0,0 +1,345 @@ + + + + +##### [Back to Public docs](./README.md) + +## Webhook Methods +Webhook dispatcher with retry and one event to many subscriber vice versa +* [fetchAllWebhookEvents](#fetchallwebhookevents) +* [queryWebhookEventDetails](#querywebhookeventdetails) + + + +## Methods with example and description + + +#### fetchAllWebhookEvents +Get All Webhook Events + + + + +```swift +webhook.fetchAllWebhookEvents() { (response, error) in + // Use response +} +``` + + + + + + +Get All Webhook Events + +*Returned Response:* + + + + +[EventConfigResponse](#EventConfigResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + +#### queryWebhookEventDetails +Send webhook event name, type, version, category in request body to get complete details of event from server + + + + +```swift +webhook.queryWebhookEventDetails(body: body) { (response, error) in + // Use response +} +``` + + + + + +| Argument | Type | Required | Description | +| -------- | ---- | -------- | ----------- | +| body | [EventConfigBase] | yes | Request body | + + +Get Webhook Event Details for provided events + +*Returned Response:* + + + + +[EventConfigResponse](#EventConfigResponse) + +Success + + + + +
    +  Example: + +```json + +``` +
    + + + + + + + + + +--- + + + +### Schemas + + + + #### [EventConfig](#EventConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | eventName | String? | yes | | + | eventType | String? | yes | | + | eventCategory | String? | yes | | + | version | String? | yes | | + | displayName | String? | yes | | + | description | String? | yes | | + | createdOn | String? | yes | | + +--- + + + + + #### [EventConfigList](#EventConfigList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[EventConfig](#EventConfig)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [EventConfigResponse](#EventConfigResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | eventConfigs | [[EventConfig](#EventConfig)]? | yes | | + +--- + + + + + #### [SubscriberConfigList](#SubscriberConfigList) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | items | [[SubscriberResponse](#SubscriberResponse)]? | yes | | + | page | [Page](#Page)? | yes | | + +--- + + + + + #### [Page](#Page) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | itemTotal | Int? | yes | | + | nextId | String? | yes | | + | hasPrevious | Bool? | yes | | + | hasNext | Bool? | yes | | + | current | Int? | yes | | + | type | String | no | | + | size | Int? | yes | | + +--- + + + + + #### [EventProcessedStatus](#EventProcessedStatus) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | subscriberId | String? | yes | | + | attempt | Int? | yes | | + | responseCode | String? | yes | | + | responseMessage | String? | yes | | + | createdOn | String? | yes | | + | processedOn | String? | yes | | + | status | Bool? | yes | | + +--- + + + + + #### [EventPayload](#EventPayload) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | eventTraceId | String? | yes | | + | messageId | String? | yes | | + | eventName | String? | yes | | + | eventType | String? | yes | | + | version | String? | yes | | + | status | Bool? | yes | | + +--- + + + + + #### [SubscriberConfig](#SubscriberConfig) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | name | String? | yes | | + | webhookUrl | String? | yes | | + | association | [Association](#Association)? | yes | | + | customHeaders | [String: Any]? | yes | | + | status | [SubscriberStatus](#SubscriberStatus)? | yes | | + | emailId | String? | yes | | + | authMeta | [AuthMeta](#AuthMeta)? | yes | | + | eventId | [Int]? | yes | | + +--- + + + + + #### [SubscriberResponse](#SubscriberResponse) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | name | String? | yes | | + | webhookUrl | String? | yes | | + | association | [Association](#Association)? | yes | | + | customHeaders | [String: Any]? | yes | | + | emailId | String? | yes | | + | status | [SubscriberStatus](#SubscriberStatus)? | yes | | + | authMeta | [AuthMeta](#AuthMeta)? | yes | | + | createdOn | String? | yes | | + | updatedOn | String? | yes | | + | eventConfigs | [[EventConfig](#EventConfig)]? | yes | | + +--- + + + + + #### [SubscriberEvent](#SubscriberEvent) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | id | Int? | yes | | + | subscriberId | Int? | yes | | + | eventId | Int? | yes | | + | createdDate | String? | yes | | + +--- + + + + + #### [AuthMeta](#AuthMeta) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | type | String? | yes | | + | secret | String? | yes | | + +--- + + + + + #### [Association](#Association) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | companyId | Int? | yes | | + | applicationId | [String]? | yes | | + | extensionId | String? | yes | | + | criteria | String? | yes | | + +--- + + + + + #### [EventConfigBase](#EventConfigBase) + + | Properties | Type | Nullable | Description | + | ---------- | ---- | -------- | ----------- | + | eventName | String? | yes | | + | eventType | String? | yes | | + | eventCategory | String? | yes | | + | version | String? | yes | | + +--- + + + + +### Enums + + + + + + #### [SubscriberStatus](#SubscriberStatus) + Type : string + + | Name | Value | Description | + | ---- | ----- | ----------- | + | active | active | Status is active | + | inactive | inactive | Status is inactive | + | blocked | blocked | Subscriber is blocked by system due to multiple failed delivery attempts. | + +--- + + + + +